Skip to content

Commit

Permalink
Added the first two Unique Editors
Browse files Browse the repository at this point in the history
Redesigned the default editor
Added more events to the Identification Assistant
Fixed a bug where random letters were displayed as Camera Types
Fixed a bug where the Identification Assistant broke
  • Loading branch information
SuperHackio committed May 19, 2020
1 parent 73609ff commit 8f5273d
Show file tree
Hide file tree
Showing 20 changed files with 1,711 additions and 327 deletions.
6 changes: 4 additions & 2 deletions LaunchCamPlus/CameraEditorForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using LaunchCamPlus.Properties;
using System.Media;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace LaunchCamPlus
{
Expand Down Expand Up @@ -41,7 +42,8 @@ public CameraEditorForm(string[] args)
PreBufferedPanels = new Dictionary<string, CameraPanelBase>
{
{ "DEFAULT", new DefaultCameraPanel() { Dock = DockStyle.Fill } },
{ "CAM_TYPE_XZ_PARA", new XZParaCameraPanel() { Dock = DockStyle.Fill } }
{ "CAM_TYPE_XZ_PARA", new XZParaCameraPanel() { Dock = DockStyle.Fill } },
{ "CAM_TYPE_EYEPOS_FIX_THERE", new EyeposFixThereCameraPanel() { Dock = DockStyle.Fill } }
};

ReloadTheme();
Expand Down Expand Up @@ -139,7 +141,7 @@ private void AddDefaultCameraToolStripMenuItem_Click(object sender, EventArgs e)
if (Cameras == null)
return;
BCAMEntry newcamera = CameraDefaults.Defaults["CAM_TYPE_XZ_PARA"];
newcamera.Identification = "c:" + BCAMEx.CalculateNextCameraArea(Cameras).ToString("X4");
newcamera.Identification = "c:" + BCAMEx.CalculateNextCameraArea(Cameras).ToString("x4");
newcamera.Type = "CAM_TYPE_XZ_PARA";
AddCamera(newcamera);
Console.WriteLine("Added the Default Camera to the end of the Camera List");
Expand Down
9 changes: 8 additions & 1 deletion LaunchCamPlus/CameraPanels/CameraPanelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ protected CameraPanelBase()
TypeComboBox.SelectionLength = 0;
}));
};
TypeComboBox.MouseWheel += TypeComboBox_MouseWheel;
Loading = false;
}

Expand Down Expand Up @@ -107,7 +108,13 @@ private void TypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
if (Loading || Settings.Default.IsUseDefaultOnly)
return;

((CameraEditorForm)ParentForm).ReloadEditor(true);
((CameraEditorForm)ParentForm)?.ReloadEditor(true);
}

void TypeComboBox_MouseWheel(object sender, MouseEventArgs e)
{
if (sender is ComboBox cb && !cb.DroppedDown)
((HandledMouseEventArgs)e).Handled = true;
}
}

Expand Down
364 changes: 212 additions & 152 deletions LaunchCamPlus/CameraPanels/DefaultCameraPanel.Designer.cs

Large diffs are not rendered by default.

21 changes: 13 additions & 8 deletions LaunchCamPlus/CameraPanels/DefaultCameraPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ public override void LoadCamera(BCAMEntry Entry)
VerticalPanAxisVector3NumericUpDown.LoadVector3(Entry.VerticalPanAxis);
UpAxisVector3NumericUpDown.LoadVector3(Entry.UpAxis);

DisableResetCheckBox.Checked = Entry.DisableReset;
DisableResetCheckBox.Checked = !Entry.DisableReset;
FieldOfViewCheckBox.Checked = Entry.EnableFoV;
SharpZoomCheckBox.Checked = Entry.SharpZoom;
SharpZoomCheckBox.Checked = !Entry.SharpZoom;
DisableAntiBlurCheckBox.Checked = Entry.DisableAntiBlur;
DisableCollisionCheckBox.Checked = Entry.DisableCollision;
DisableFirstPersonCheckBox.Checked = Entry.DisableFirstPerson;
DisableCollisionCheckBox.Checked = !Entry.DisableCollision;
DisableFirstPersonCheckBox.Checked = !Entry.DisableFirstPerson;
GFlagEndErpFrameCheckBox.Checked = Entry.GFlagEndErpFrame;
GFlagThroughCheckBox.Checked = Entry.GFlagThrough;
GFlagEndTimeNumericUpDown.Value = (decimal)Entry.GFlagEndTime;
Expand Down Expand Up @@ -146,12 +146,12 @@ public override void UnLoadCamera(BCAMEntry Entry)
Entry.PlayerOffset = PlayerOffsetVector3NumericUpDown.GetVector3();
Entry.VerticalPanAxis = VerticalPanAxisVector3NumericUpDown.GetVector3();
Entry.UpAxis = UpAxisVector3NumericUpDown.GetVector3();
Entry.DisableReset = DisableResetCheckBox.Checked;
Entry.DisableReset = !DisableResetCheckBox.Checked;
Entry.EnableFoV = FieldOfViewCheckBox.Checked;
Entry.SharpZoom = SharpZoomCheckBox.Checked;
Entry.SharpZoom = !SharpZoomCheckBox.Checked;
Entry.DisableAntiBlur = DisableAntiBlurCheckBox.Checked;
Entry.DisableCollision = DisableCollisionCheckBox.Checked;
Entry.DisableFirstPerson = DisableFirstPersonCheckBox.Checked;
Entry.DisableCollision = !DisableCollisionCheckBox.Checked;
Entry.DisableFirstPerson = !DisableFirstPersonCheckBox.Checked;
Entry.GFlagEndErpFrame = GFlagEndErpFrameCheckBox.Checked;
Entry.GFlagThrough = GFlagThroughCheckBox.Checked;
Entry.GFlagEndTime = (int)GFlagEndTimeNumericUpDown.Value;
Expand All @@ -167,5 +167,10 @@ private void FieldOfViewCheckBox_CheckedChanged(object sender, EventArgs e)
{
FieldOfViewNumericUpDown.Enabled = FieldOfViewCheckBox.Checked;
}

private void UseVerticalPanAxisCheckBox_CheckedChanged(object sender, EventArgs e)
{
VerticalPanAxisVector3NumericUpDown.Enabled = UseVerticalPanAxisCheckBox.Checked;
}
}
}
Loading

0 comments on commit 8f5273d

Please sign in to comment.