Merge pull request #162 from Rytrak/master

Fixed issue on light editor form
This commit is contained in:
dexyfex 2022-09-08 10:28:35 +10:00 committed by GitHub
commit 6f5f0fde39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 1 deletions

View File

@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ModelLightForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ModelLightForm));
this.MainSplitContainer = new System.Windows.Forms.SplitContainer(); this.MainSplitContainer = new System.Windows.Forms.SplitContainer();
this.DuplicateLightButton = new System.Windows.Forms.Button(); this.DuplicateLightButton = new System.Windows.Forms.Button();
@ -120,6 +121,9 @@
this.MoveMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.MoveMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.RotateMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.RotateMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ScaleMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ScaleMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.LightMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.newLightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.deleteLightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.MainSplitContainer)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.MainSplitContainer)).BeginInit();
this.MainSplitContainer.Panel1.SuspendLayout(); this.MainSplitContainer.Panel1.SuspendLayout();
this.MainSplitContainer.Panel2.SuspendLayout(); this.MainSplitContainer.Panel2.SuspendLayout();
@ -140,6 +144,7 @@
((System.ComponentModel.ISupportInitialize)(this.ColourGUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ColourGUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ColourRUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ColourRUpDown)).BeginInit();
this.MainMenu.SuspendLayout(); this.MainMenu.SuspendLayout();
this.LightMenuStrip.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// MainSplitContainer // MainSplitContainer
@ -202,6 +207,7 @@
this.LightsTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.LightsTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.LightsTreeView.ContextMenuStrip = this.LightMenuStrip;
this.LightsTreeView.FullRowSelect = true; this.LightsTreeView.FullRowSelect = true;
this.LightsTreeView.HideSelection = false; this.LightsTreeView.HideSelection = false;
this.LightsTreeView.Location = new System.Drawing.Point(3, 3); this.LightsTreeView.Location = new System.Drawing.Point(3, 3);
@ -1213,6 +1219,28 @@
this.ScaleMenuItem.ToolTipText = "Scale"; this.ScaleMenuItem.ToolTipText = "Scale";
this.ScaleMenuItem.Click += new System.EventHandler(this.ScaleMenuItem_Click); this.ScaleMenuItem.Click += new System.EventHandler(this.ScaleMenuItem_Click);
// //
// LightMenuStrip
//
this.LightMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newLightToolStripMenuItem,
this.deleteLightToolStripMenuItem});
this.LightMenuStrip.Name = "LightMenuStrip";
this.LightMenuStrip.Size = new System.Drawing.Size(138, 48);
//
// newLightToolStripMenuItem
//
this.newLightToolStripMenuItem.Name = "newLightToolStripMenuItem";
this.newLightToolStripMenuItem.Size = new System.Drawing.Size(137, 22);
this.newLightToolStripMenuItem.Text = "New Light";
this.newLightToolStripMenuItem.Click += new System.EventHandler(this.newLightToolStripMenuItem_Click);
//
// deleteLightToolStripMenuItem
//
this.deleteLightToolStripMenuItem.Name = "deleteLightToolStripMenuItem";
this.deleteLightToolStripMenuItem.Size = new System.Drawing.Size(137, 22);
this.deleteLightToolStripMenuItem.Text = "Delete Light";
this.deleteLightToolStripMenuItem.Click += new System.EventHandler(this.deleteLightToolStripMenuItem_Click);
//
// ModelLightForm // ModelLightForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1247,6 +1275,7 @@
((System.ComponentModel.ISupportInitialize)(this.ColourRUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ColourRUpDown)).EndInit();
this.MainMenu.ResumeLayout(false); this.MainMenu.ResumeLayout(false);
this.MainMenu.PerformLayout(); this.MainMenu.PerformLayout();
this.LightMenuStrip.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -1345,5 +1374,8 @@
private System.Windows.Forms.Button DeleteLightButton; private System.Windows.Forms.Button DeleteLightButton;
private System.Windows.Forms.Button NewLightButton; private System.Windows.Forms.Button NewLightButton;
private System.Windows.Forms.Button DuplicateLightButton; private System.Windows.Forms.Button DuplicateLightButton;
private System.Windows.Forms.ContextMenuStrip LightMenuStrip;
private System.Windows.Forms.ToolStripMenuItem newLightToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem deleteLightToolStripMenuItem;
} }
} }

View File

@ -385,7 +385,7 @@ namespace CodeWalker.Forms
lights.Remove(selectedLight); lights.Remove(selectedLight);
FragDrawable.OwnerFragment.LightAttributes.data_items = lights.ToArray(); FragDrawable.OwnerFragment.LightAttributes.data_items = lights.ToArray();
UpdateLightParams(); UpdateLightParams();
LoadModel(Drawable); LoadModel(FragDrawable);
} }
else else
{ {
@ -1081,5 +1081,15 @@ namespace CodeWalker.Forms
{ {
} }
private void newLightToolStripMenuItem_Click(object sender, EventArgs e)
{
CreateLight();
}
private void deleteLightToolStripMenuItem_Click(object sender, EventArgs e)
{
DeleteLight();
}
} }
} }

View File

@ -117,6 +117,9 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="LightMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>127, 17</value>
</metadata>
<metadata name="MainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="MainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>