Skip to content

Commit

Permalink
LCP Pre-release 2.3.8.8 content.
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperHackio committed Jun 6, 2020
1 parent 8f5273d commit 293a8f7
Show file tree
Hide file tree
Showing 22 changed files with 1,159 additions and 125 deletions.
19 changes: 16 additions & 3 deletions LaunchCamPlus/CameraEditorForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 43 additions & 7 deletions LaunchCamPlus/CameraEditorForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using LaunchCamPlus.Properties;
using System.Media;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace LaunchCamPlus
{
Expand Down Expand Up @@ -42,8 +41,9 @@ 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_EYEPOS_FIX_THERE", new EyeposFixThereCameraPanel() { Dock = DockStyle.Fill } }
{ "CAM_TYPE_EYEPOS_FIX_THERE", new EyeposFixThereCameraPanel() { Dock = DockStyle.Fill } },
{ "CAM_TYPE_WONDER_PLANET", new WanderPlanetCameraPanel() { Dock = DockStyle.Fill } },
{ "CAM_TYPE_XZ_PARA", new XZParaCameraPanel() { Dock = DockStyle.Fill } }
};

ReloadTheme();
Expand Down Expand Up @@ -90,6 +90,7 @@ private void NewToolStripMenuItem_Click(object sender, EventArgs e)
CameraListBox.Enabled = true;
SaveToolStripMenuItem.Enabled = true;
SaveAsToolStripMenuItem.Enabled = true;
ExportPresetToolStripMenuItem.Enabled = true;
CameraListBox.Items.Clear();
Console.WriteLine("New File Started!");
AddDefaultCameraToolStripMenuItem_Click(null, null);
Expand Down Expand Up @@ -139,7 +140,12 @@ private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
private void AddDefaultCameraToolStripMenuItem_Click(object sender, EventArgs e)
{
if (Cameras == null)
{
Console.WriteLine(Program.ConsoleHalfSplitter);
Console.WriteLine("Failed to add the camera!\nNo camera file is active");
Console.WriteLine(Program.ConsoleHalfSplitter);
return;
}
BCAMEntry newcamera = CameraDefaults.Defaults["CAM_TYPE_XZ_PARA"];
newcamera.Identification = "c:" + BCAMEx.CalculateNextCameraArea(Cameras).ToString("x4");
newcamera.Type = "CAM_TYPE_XZ_PARA";
Expand All @@ -156,6 +162,26 @@ private void PresetsToolStripMenuItem_Click(object sender, EventArgs e)
MainSplitContainer.Panel2.Controls.Add(PreBufferedPresets);
}

private void AddNewFromClipboardToolStripMenuItem_Click(object sender, EventArgs e)
{
BCAMEntry NewFromClipboard = new BCAMEntry();

if (NewFromClipboard.FromClipboard(Clipboard.GetText()))
{
if (Cameras == null)
{
Console.WriteLine(Program.ConsoleHalfSplitter);
Console.WriteLine("Failed to add the camera!\nNo camera file is active");
Console.WriteLine(Program.ConsoleHalfSplitter);
return;
}
AddCamera(NewFromClipboard);
Console.WriteLine("Camera Added from Clipboard!");
}
else
Console.WriteLine("Clipboard doesn't contain a Valid LCP Camera!"+(Cameras == null ? "\nAnd there is no camera file currently active":""));
}

private void DeleteCameraToolStripMenuItem_Click(object sender, EventArgs e)
{
if (CameraListBox.SelectedIndex == -1)
Expand Down Expand Up @@ -277,6 +303,8 @@ private void IdentificationAssistantToolStripMenuItem_Click(object sender, Event

private void ExportPresetToolStripMenuItem_Click(object sender, EventArgs e)
{
if (MainSplitContainer.Panel2.Controls.Count > 0 && MainSplitContainer.Panel2.Controls[0] is CameraPanelBase pnl)
pnl.UnLoadCamera(Cameras[PrevListID]);
CameraListBox.SelectedIndex = -1;
MainSplitContainer.Panel2.Controls.Clear();
EditToolStripMenuItem.Enabled = false;
Expand Down Expand Up @@ -375,6 +403,7 @@ public void Open(string file)
CameraListBox.Enabled = true;
SaveToolStripMenuItem.Enabled = true;
SaveAsToolStripMenuItem.Enabled = true;
ExportPresetToolStripMenuItem.Enabled = true;

Patience.Stop();
if (Program.CanPlaySfx(Program.SuccessSfx))
Expand Down Expand Up @@ -472,6 +501,7 @@ private void Save()
break;
}
Console.WriteLine("Save Complete!");
Console.WriteLine("Current time of Save: "+DateTime.Now.ToString("h:mm tt"));
Program.IsUnsavedChanges = false;
Console.WriteLine();

Expand All @@ -498,7 +528,6 @@ private void AdvancedSave()
{
if (Cameras.EntryCount == 0)
return;

Console.WriteLine("Processing the cameras for advanced saving:");
CameraListBox.Enabled = false;
Control ReturnControl = null;
Expand Down Expand Up @@ -616,12 +645,14 @@ public void RefreshSelected(string newID)
}
}

public void ReloadEditor(bool DoUnload = false)
public void ReloadEditor(bool DoUnload = false, bool SetType = false)
{
if (MainSplitContainer.Panel2.Controls[0] is CameraPanelBase CurrentPanel)
{
if (DoUnload)
CurrentPanel.UnLoadCamera(Cameras[PrevListID]);
else if (SetType)
Cameras[PrevListID].Type = CurrentPanel.CurrentCameraType;

string PanelKey = GetPanelKey(Cameras[PrevListID].Type);
if (PanelKey.Equals(CurrentPanel.CameraType))
Expand Down Expand Up @@ -695,9 +726,9 @@ private void PasteCamera()
int temp = CameraListBox.SelectedIndex;
CameraListBox.SelectedIndex = -1;
if (Cameras[temp].FromClipboard(Clipboard.GetText()))
{
Console.WriteLine("Paste Successful!");
}
else
Console.WriteLine("Clipboard doesn't contain a Valid LCP Camera!");
CameraListBox.SelectedIndex = temp;
CameraListBox.Items[temp] = Cameras[temp].GetTranslatedName();
}
Expand Down Expand Up @@ -752,6 +783,11 @@ private void CameraListBox_KeyDown(object sender, KeyEventArgs e)
e.SuppressKeyPress = true;
PasteCamera();
}
else if (e.Control && e.Shift && e.KeyCode == Keys.V)
{
e.SuppressKeyPress = true;
AddNewFromClipboardToolStripMenuItem_Click(null, null);
}
else if (e.Control && e.KeyCode == Keys.A)
{
e.SuppressKeyPress = true;
Expand Down
4 changes: 3 additions & 1 deletion LaunchCamPlus/CameraPanels/CameraPanelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected CameraPanelBase()
}

public string CameraType { get; set; }
private bool Loading = false;
protected bool Loading = false;

protected override CreateParams CreateParams
{
Expand Down Expand Up @@ -116,6 +116,8 @@ void TypeComboBox_MouseWheel(object sender, MouseEventArgs e)
if (sender is ComboBox cb && !cb.DroppedDown)
((HandledMouseEventArgs)e).Handled = true;
}

public string CurrentCameraType { get { return TypeComboBox.Text; } }
}

/// <summary>
Expand Down
12 changes: 6 additions & 6 deletions LaunchCamPlus/CameraPanels/DefaultCameraPanel.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 6 additions & 33 deletions LaunchCamPlus/CameraPanels/DefaultCameraPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,6 @@ public DefaultCameraPanel() : base()
InitializeComponent();
}

public override void ResizeEnd()
{
//ZoomLabel.Location = new Point(146 - (int)((MinimumSize.Width - Width) / 3.5f), Num1Label.Location.Y);
//ZoomNumericUpDown.Location = new Point(ZoomLabel.Location.X + ZoomLabel.Width + 6, ZoomNumericUpDown.Location.Y);

//FieldOfViewLabel.Location = new Point(ZoomLabel.Location.X, FieldOfViewLabel.Location.Y);
//FieldOfViewNumericUpDown.Location = new Point(FieldOfViewLabel.Location.X + FieldOfViewLabel.Width + 6, FieldOfViewNumericUpDown.Location.Y);

//Num1Label.Location = new Point(305 - (int)((MinimumSize.Width-Width)/1.5f), Num1Label.Location.Y);
//Num1NumericUpDown.Location = new Point(Num1Label.Location.X + Num1Label.Width + 6, Num1NumericUpDown.Location.Y);

//Num2Label.Location = new Point(305 - (int)((MinimumSize.Width - Width) / 1.5f), Num2Label.Location.Y);
//Num2NumericUpDown.Location = new Point(Num1NumericUpDown.Location.X, Num2NumericUpDown.Location.Y);
//JumpingYNumericUpDown.Location = new Point(Num1NumericUpDown.Location.X, JumpingYNumericUpDown.Location.Y);
//FallingYNumericUpDown.Location = new Point(Num1NumericUpDown.Location.X, FallingYNumericUpDown.Location.Y);

//MaxYLabel.Location = new Point(305 - (int)((MinimumSize.Width - Width) / 1.5f), MaxYLabel.Location.Y);
//MinYLabel.Location = new Point(305 - (int)((MinimumSize.Width - Width) / 1.5f), MinYLabel.Location.Y);

//RotationZNumericUpDown.Width = RotationYNumericUpDown.Width = RotationXNumericUpDown.Width = (ZoomLabel.Location.X - RotationXNumericUpDown.Location.X) - 6;

//ZoomNumericUpDown.Width = (Num1Label.Location.X - ZoomNumericUpDown.Location.X) - 6;
//FieldOfViewNumericUpDown.Width = (Num2Label.Location.X - FieldOfViewNumericUpDown.Location.X) - 6;

//JumpingYNumericUpDown.Width = FallingYNumericUpDown.Width = Num1NumericUpDown.Width = Num2NumericUpDown.Width = (Width - Num1NumericUpDown.Location.X) - 6;
}

public override void ReloadTheme()
{
base.ReloadTheme();
Expand Down Expand Up @@ -89,8 +62,8 @@ public override void LoadCamera(BCAMEntry Entry)
FallingYNumericUpDown.Value = (decimal)Entry.MinY;
CamIntNumericUpDown.Value = Entry.TransitionTime;
CamEndIntNumericUpDown.Value = Entry.TransitionEndTime;
FrontOffsetNumericUpDown.Value = (decimal)Entry.FrontOffset;
HeightOffsetNumericUpDown.Value = (decimal)Entry.HeightOffset;
FrontOffsetNumericUpDown.Value = (decimal)Entry.LookOffset;
HeightOffsetNumericUpDown.Value = (decimal)Entry.LookOffsetVertical;
GroundDelayNumericUpDown.Value = Entry.GroundMoveDelay;
AirDelayNumericUpDown.Value = Entry.AirMoveDelay;
UpperBorderNumericUpDown.Value = (decimal)Entry.UpperBorder;
Expand All @@ -106,7 +79,7 @@ public override void LoadCamera(BCAMEntry Entry)

DisableResetCheckBox.Checked = !Entry.DisableReset;
FieldOfViewCheckBox.Checked = Entry.EnableFoV;
SharpZoomCheckBox.Checked = !Entry.SharpZoom;
SharpZoomCheckBox.Checked = Entry.StaticLookOffset;
DisableAntiBlurCheckBox.Checked = Entry.DisableAntiBlur;
DisableCollisionCheckBox.Checked = !Entry.DisableCollision;
DisableFirstPersonCheckBox.Checked = !Entry.DisableFirstPerson;
Expand All @@ -133,8 +106,8 @@ public override void UnLoadCamera(BCAMEntry Entry)
Entry.MinY = (float)FallingYNumericUpDown.Value;
Entry.TransitionTime = (int)CamIntNumericUpDown.Value;
Entry.TransitionEndTime = (int)CamEndIntNumericUpDown.Value;
Entry.FrontOffset = (float)FrontOffsetNumericUpDown.Value;
Entry.HeightOffset = (float)HeightOffsetNumericUpDown.Value;
Entry.LookOffset = (float)FrontOffsetNumericUpDown.Value;
Entry.LookOffsetVertical = (float)HeightOffsetNumericUpDown.Value;
Entry.GroundMoveDelay = (int)GroundDelayNumericUpDown.Value;
Entry.AirMoveDelay = (int)AirDelayNumericUpDown.Value;
Entry.UpperBorder = (float)UpperBorderNumericUpDown.Value;
Expand All @@ -148,7 +121,7 @@ public override void UnLoadCamera(BCAMEntry Entry)
Entry.UpAxis = UpAxisVector3NumericUpDown.GetVector3();
Entry.DisableReset = !DisableResetCheckBox.Checked;
Entry.EnableFoV = FieldOfViewCheckBox.Checked;
Entry.SharpZoom = !SharpZoomCheckBox.Checked;
Entry.StaticLookOffset = SharpZoomCheckBox.Checked;
Entry.DisableAntiBlur = DisableAntiBlurCheckBox.Checked;
Entry.DisableCollision = !DisableCollisionCheckBox.Checked;
Entry.DisableFirstPerson = !DisableFirstPersonCheckBox.Checked;
Expand Down
Loading

0 comments on commit 293a8f7

Please sign in to comment.