From 10b9668c8db95c7242837041247693fecd649809 Mon Sep 17 00:00:00 2001 From: AdAstra-LD <76622070+AdAstra-LD@users.noreply.github.com> Date: Tue, 21 May 2024 18:38:10 +0200 Subject: [PATCH] Level Script Editor improvements --- DS_Map/Editors/LevelScriptEditor.Designer.cs | 28 +++++++++---------- DS_Map/Editors/LevelScriptEditor.cs | 29 +++++++++++++------- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/DS_Map/Editors/LevelScriptEditor.Designer.cs b/DS_Map/Editors/LevelScriptEditor.Designer.cs index 6fb115e..16bb748 100644 --- a/DS_Map/Editors/LevelScriptEditor.Designer.cs +++ b/DS_Map/Editors/LevelScriptEditor.Designer.cs @@ -36,7 +36,7 @@ namespace DSPRE.Editors { this.textBoxScriptID = new System.Windows.Forms.TextBox(); this.textBoxVariableName = new System.Windows.Forms.TextBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.groupBoxScript = new System.Windows.Forms.GroupBox(); this.groupBoxVariable = new System.Windows.Forms.GroupBox(); this.groupBoxValue = new System.Windows.Forms.GroupBox(); this.textBoxVariableValue = new System.Windows.Forms.TextBox(); @@ -58,7 +58,7 @@ namespace DSPRE.Editors { this.groupBox6 = new System.Windows.Forms.GroupBox(); this.groupBox7 = new System.Windows.Forms.GroupBox(); this.groupBox1.SuspendLayout(); - this.groupBox2.SuspendLayout(); + this.groupBoxScript.SuspendLayout(); this.groupBoxVariable.SuspendLayout(); this.groupBoxValue.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -167,15 +167,15 @@ namespace DSPRE.Editors { this.groupBox1.TabStop = false; this.groupBox1.Text = "Activation Condition"; // - // groupBox2 + // groupBoxScript // - this.groupBox2.Controls.Add(this.textBoxScriptID); - this.groupBox2.Location = new System.Drawing.Point(3, 480); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(149, 46); - this.groupBox2.TabIndex = 12; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Keep running this Script ID"; + this.groupBoxScript.Controls.Add(this.textBoxScriptID); + this.groupBoxScript.Location = new System.Drawing.Point(3, 480); + this.groupBoxScript.Name = "groupBoxScript"; + this.groupBoxScript.Size = new System.Drawing.Size(149, 46); + this.groupBoxScript.TabIndex = 12; + this.groupBoxScript.TabStop = false; + this.groupBoxScript.Text = "Keep running this Script ID"; // // groupBoxVariable // @@ -408,15 +408,15 @@ namespace DSPRE.Editors { this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBoxValue); this.Controls.Add(this.groupBoxVariable); - this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBoxScript); this.Controls.Add(this.groupBox1); this.Controls.Add(this.listBoxTriggers); this.Location = new System.Drawing.Point(15, 15); this.Name = "LevelScriptEditor"; this.Size = new System.Drawing.Size(408, 622); this.groupBox1.ResumeLayout(false); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); + this.groupBoxScript.ResumeLayout(false); + this.groupBoxScript.PerformLayout(); this.groupBoxVariable.ResumeLayout(false); this.groupBoxVariable.PerformLayout(); this.groupBoxValue.ResumeLayout(false); @@ -451,7 +451,7 @@ namespace DSPRE.Editors { private System.Windows.Forms.TextBox textBoxScriptID; private System.Windows.Forms.TextBox textBoxVariableName; private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.GroupBox groupBoxScript; private System.Windows.Forms.GroupBox groupBoxVariable; private System.Windows.Forms.GroupBox groupBoxValue; private System.Windows.Forms.TextBox textBoxVariableValue; diff --git a/DS_Map/Editors/LevelScriptEditor.cs b/DS_Map/Editors/LevelScriptEditor.cs index a980078..ea15496 100644 --- a/DS_Map/Editors/LevelScriptEditor.cs +++ b/DS_Map/Editors/LevelScriptEditor.cs @@ -56,8 +56,6 @@ namespace DSPRE.Editors { radioButtonLoadGame.Checked = false; textBoxScriptID.Enabled = false; - textBoxVariableName.Enabled = false; - textBoxVariableValue.Enabled = false; radioButtonVariableValue.Enabled = false; radioButtonMapChange.Enabled = false; @@ -331,29 +329,40 @@ namespace DSPRE.Editors { private void radioButtonDecimal_CheckedChanged(object sender, EventArgs e) { handleDecimalFormat(); } + private void AssignGroupBoxScriptText() { + if (radioButtonVariableValue.Checked) { + groupBoxScript.Text = "Keep running this Script"; + } else { + groupBoxScript.Text = "Run this Script"; + } + } private void radioButtonVariableValue_CheckedChanged(object sender, EventArgs e) { - textBoxVariableName.Enabled = true; - textBoxVariableValue.Enabled = true; + groupBoxVariable.Visible = true; + groupBoxValue.Visible = true; buttonAdd_logic(); + AssignGroupBoxScriptText(); } private void radioButtonMapChange_CheckedChanged(object sender, EventArgs e) { - textBoxVariableName.Enabled = false; - textBoxVariableValue.Enabled = false; + groupBoxVariable.Visible = false; + groupBoxValue.Visible = false; buttonAdd_logic(); + AssignGroupBoxScriptText(); } private void radioButtonScreenReset_CheckedChanged(object sender, EventArgs e) { - textBoxVariableName.Enabled = false; - textBoxVariableValue.Enabled = false; + groupBoxVariable.Visible = false; + groupBoxValue.Visible = false; buttonAdd_logic(); + AssignGroupBoxScriptText(); } private void radioButtonLoadGame_CheckedChanged(object sender, EventArgs e) { - textBoxVariableName.Enabled = false; - textBoxVariableValue.Enabled = false; + groupBoxVariable.Visible = false; + groupBoxValue.Visible = false; buttonAdd_logic(); + AssignGroupBoxScriptText(); } void textBoxScriptID_TextChanged(object sender, EventArgs e) {