From 20ff28b599503f5a50f87d6d31a219ce517f9265 Mon Sep 17 00:00:00 2001 From: brotalnia Date: Sat, 8 Jan 2022 09:55:33 +0200 Subject: [PATCH] Add tooltips. --- ScriptEditor/FormEventEditor.cs | 10 ++++++ ScriptEditor/FormScriptEditor.Designer.cs | 37 ++++++++++++++++++++--- ScriptEditor/FormScriptEditor.cs | 35 +++++++++++++++++++++ ScriptEditor/Properties/AssemblyInfo.cs | 4 +-- 4 files changed, 79 insertions(+), 7 deletions(-) diff --git a/ScriptEditor/FormEventEditor.cs b/ScriptEditor/FormEventEditor.cs index a10162f..c0b7a09 100644 --- a/ScriptEditor/FormEventEditor.cs +++ b/ScriptEditor/FormEventEditor.cs @@ -121,6 +121,16 @@ private void LoadControls() // Add options to Hit By Aura combo box. cmbHitByAuraType.DataSource = GameData.SpellAuraNamesList; + //Add tooltips to controls. + ToolTip toolTip1 = new ToolTip(); + toolTip1.AutoPopDelay = 5000; + toolTip1.InitialDelay = 1000; + toolTip1.ReshowDelay = 500; + toolTip1.SetToolTip(this.lblEventId, "Event Ids should start from CreatureId * 100 + 1"); + toolTip1.SetToolTip(this.lblEventPhaseMask, "In which phases the event will NOT trigger."); + toolTip1.SetToolTip(this.lblEventCondition, "Event will only trigger if the specified condition is satisfied."); + toolTip1.SetToolTip(this.lblEventComment, "Creature Name - Action Description on Event Type (Phases)"); + dontUpdate = false; } diff --git a/ScriptEditor/FormScriptEditor.Designer.cs b/ScriptEditor/FormScriptEditor.Designer.cs index 73de5b5..6da149c 100644 --- a/ScriptEditor/FormScriptEditor.Designer.cs +++ b/ScriptEditor/FormScriptEditor.Designer.cs @@ -45,6 +45,7 @@ private void InitializeComponent() this.lblComment = new System.Windows.Forms.Label(); this.txtCommandComment = new System.Windows.Forms.TextBox(); this.grpDataFlags = new System.Windows.Forms.GroupBox(); + this.chkSkipMissingTargets = new System.Windows.Forms.CheckBox(); this.chkAbortScript = new System.Windows.Forms.CheckBox(); this.chkTargetSelf = new System.Windows.Forms.CheckBox(); this.chkSwapFinal = new System.Windows.Forms.CheckBox(); @@ -498,6 +499,7 @@ private void InitializeComponent() this.lblSetDefaultMovementType = new System.Windows.Forms.Label(); this.lblSetDefaultMovementTooltip = new System.Windows.Forms.Label(); this.frmCommandStartScriptForAll = new System.Windows.Forms.Panel(); + this.btnStartScriptForAllEdit = new System.Windows.Forms.Button(); this.btnStartScriptForAllObjectEntry = new System.Windows.Forms.Button(); this.txtStartScriptForAllDistance = new System.Windows.Forms.TextBox(); this.lblStartScriptForAllDistance = new System.Windows.Forms.Label(); @@ -783,6 +785,7 @@ private void InitializeComponent() // // grpDataFlags // + this.grpDataFlags.Controls.Add(this.chkSkipMissingTargets); this.grpDataFlags.Controls.Add(this.chkAbortScript); this.grpDataFlags.Controls.Add(this.chkTargetSelf); this.grpDataFlags.Controls.Add(this.chkSwapFinal); @@ -794,10 +797,21 @@ private void InitializeComponent() this.grpDataFlags.TabStop = false; this.grpDataFlags.Text = "Data Flags"; // + // chkSkipMissingTargets + // + this.chkSkipMissingTargets.AutoSize = true; + this.chkSkipMissingTargets.Location = new System.Drawing.Point(6, 103); + this.chkSkipMissingTargets.Name = "chkSkipMissingTargets"; + this.chkSkipMissingTargets.Size = new System.Drawing.Size(124, 17); + this.chkSkipMissingTargets.TabIndex = 4; + this.chkSkipMissingTargets.Text = "Skip Missing Targets"; + this.chkSkipMissingTargets.UseVisualStyleBackColor = true; + this.chkSkipMissingTargets.CheckedChanged += new System.EventHandler(this.chkSkipMissingTargets_CheckedChanged); + // // chkAbortScript // this.chkAbortScript.AutoSize = true; - this.chkAbortScript.Location = new System.Drawing.Point(6, 90); + this.chkAbortScript.Location = new System.Drawing.Point(6, 82); this.chkAbortScript.Name = "chkAbortScript"; this.chkAbortScript.Size = new System.Drawing.Size(132, 17); this.chkAbortScript.TabIndex = 3; @@ -808,7 +822,7 @@ private void InitializeComponent() // chkTargetSelf // this.chkTargetSelf.AutoSize = true; - this.chkTargetSelf.Location = new System.Drawing.Point(6, 69); + this.chkTargetSelf.Location = new System.Drawing.Point(6, 61); this.chkTargetSelf.Name = "chkTargetSelf"; this.chkTargetSelf.Size = new System.Drawing.Size(78, 17); this.chkTargetSelf.TabIndex = 2; @@ -819,7 +833,7 @@ private void InitializeComponent() // chkSwapFinal // this.chkSwapFinal.AutoSize = true; - this.chkSwapFinal.Location = new System.Drawing.Point(6, 48); + this.chkSwapFinal.Location = new System.Drawing.Point(6, 40); this.chkSwapFinal.Name = "chkSwapFinal"; this.chkSwapFinal.Size = new System.Drawing.Size(117, 17); this.chkSwapFinal.TabIndex = 1; @@ -830,7 +844,7 @@ private void InitializeComponent() // chkSwapInitial // this.chkSwapInitial.AutoSize = true; - this.chkSwapInitial.Location = new System.Drawing.Point(6, 26); + this.chkSwapInitial.Location = new System.Drawing.Point(6, 19); this.chkSwapInitial.Name = "chkSwapInitial"; this.chkSwapInitial.Size = new System.Drawing.Size(119, 17); this.chkSwapInitial.TabIndex = 0; @@ -5493,6 +5507,7 @@ private void InitializeComponent() // frmCommandStartScriptForAll // this.frmCommandStartScriptForAll.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.frmCommandStartScriptForAll.Controls.Add(this.btnStartScriptForAllEdit); this.frmCommandStartScriptForAll.Controls.Add(this.btnStartScriptForAllObjectEntry); this.frmCommandStartScriptForAll.Controls.Add(this.txtStartScriptForAllDistance); this.frmCommandStartScriptForAll.Controls.Add(this.lblStartScriptForAllDistance); @@ -5508,6 +5523,16 @@ private void InitializeComponent() this.frmCommandStartScriptForAll.TabIndex = 62; this.frmCommandStartScriptForAll.Visible = false; // + // btnStartScriptForAllEdit + // + this.btnStartScriptForAllEdit.Location = new System.Drawing.Point(429, 58); + this.btnStartScriptForAllEdit.Name = "btnStartScriptForAllEdit"; + this.btnStartScriptForAllEdit.Size = new System.Drawing.Size(44, 22); + this.btnStartScriptForAllEdit.TabIndex = 17; + this.btnStartScriptForAllEdit.Text = "Edit"; + this.btnStartScriptForAllEdit.UseVisualStyleBackColor = true; + this.btnStartScriptForAllEdit.Click += new System.EventHandler(this.btnStartScriptForAllEdit_Click); + // // btnStartScriptForAllObjectEntry // this.btnStartScriptForAllObjectEntry.Location = new System.Drawing.Point(99, 121); @@ -5539,7 +5564,7 @@ private void InitializeComponent() // this.txtStartScriptForAllScriptId.Location = new System.Drawing.Point(99, 59); this.txtStartScriptForAllScriptId.Name = "txtStartScriptForAllScriptId"; - this.txtStartScriptForAllScriptId.Size = new System.Drawing.Size(374, 20); + this.txtStartScriptForAllScriptId.Size = new System.Drawing.Size(316, 20); this.txtStartScriptForAllScriptId.TabIndex = 13; this.txtStartScriptForAllScriptId.Leave += new System.EventHandler(this.txtStartScriptForAllScriptId_Leave); // @@ -6882,6 +6907,8 @@ private void InitializeComponent() private System.Windows.Forms.TextBox txtCommandPriority; private System.Windows.Forms.Button btnModifyFlagsFlags; private System.Windows.Forms.Label lblModifyFlagsFlags; + private System.Windows.Forms.CheckBox chkSkipMissingTargets; + private System.Windows.Forms.Button btnStartScriptForAllEdit; } } diff --git a/ScriptEditor/FormScriptEditor.cs b/ScriptEditor/FormScriptEditor.cs index 6ffa2f1..c5b550c 100644 --- a/ScriptEditor/FormScriptEditor.cs +++ b/ScriptEditor/FormScriptEditor.cs @@ -271,6 +271,22 @@ private void LoadControls() cmbTable.SelectedIndex = 0; cmbSetMovementType.SelectedIndex = 0; + //Add tooltips to controls. + ToolTip toolTip1 = new ToolTip(); + toolTip1.AutoPopDelay = 5000; + toolTip1.InitialDelay = 1000; + toolTip1.ReshowDelay = 500; + toolTip1.SetToolTip(this.chkSwapInitial, "Swaps the original source and target, before buddy is checked."); + toolTip1.SetToolTip(this.chkSwapFinal, "Swaps the final source and target, after buddy is assigned."); + toolTip1.SetToolTip(this.chkTargetSelf, "Replaces the final target with the final source."); + toolTip1.SetToolTip(this.chkAbortScript, "Terminates the whole script if the command fails."); + toolTip1.SetToolTip(this.chkSkipMissingTargets, "Command is skipped if source or target is not found, without printing an error."); + toolTip1.SetToolTip(this.lblDelay, "Delay in seconds before the command runs."); + toolTip1.SetToolTip(this.lblPriority, "Defines the order of execution of commands with the same delay. Lower priority runs first."); + toolTip1.SetToolTip(this.lblCommandCondition, "Command will only be executed if the specified condition is satisfied. Checked after targets are assigned."); + toolTip1.SetToolTip(this.lblComment, "Script Name: Source Name - Command Name"); + toolTip1.SetToolTip(this.lblTargetType, "Allows you to replace the original target that's provided to the script.\r\nBe aware that it's the source that executes the action, while target is only used as an additional argument for some commands.\r\nFor example if you use the Cast Spell command, its the source that will cast the spell at the target.\r\nTo make another object perform the action, use the flag to swap the source and target."); + //MessageBox.Show((cmbCommandId.SelectedItem as ComboboxPair).Value.ToString()); dontUpdate = false; } @@ -457,6 +473,7 @@ private void ResetAndDisableGeneralForm() cmbCommandId.Text = ""; // Check Boxes. + chkSkipMissingTargets.Checked = false; chkAbortScript.Checked = false; chkSwapFinal.Checked = false; chkSwapInitial.Checked = false; @@ -2223,6 +2240,8 @@ private void lstActions_SelectedIndexChanged(object sender, EventArgs e) chkTargetSelf.Checked = true; if ((selectedAction.DataFlags & 8) != 0) chkAbortScript.Checked = true; + if ((selectedAction.DataFlags & 16) != 0) + chkSkipMissingTargets.Checked = true; if (Program.highlight) { @@ -2621,6 +2640,11 @@ private void chkAbortScript_CheckedChanged(object sender, EventArgs e) SetScriptFlagsFromCheckbox(chkAbortScript, "DataFlags", 8); } + private void chkSkipMissingTargets_CheckedChanged(object sender, EventArgs e) + { + SetScriptFlagsFromCheckbox(chkSkipMissingTargets, "DataFlags", 16); + } + private void btnActionAdd_Click(object sender, EventArgs e) { ListViewItem newItem = new ListViewItem(); @@ -4257,6 +4281,17 @@ private void btnStartScriptForAllObjectEntry_Click(object sender, EventArgs e) } } } + private void btnStartScriptForAllEdit_Click(object sender, EventArgs e) + { + uint script_id = 0; + uint.TryParse(txtStartScriptForAllScriptId.Text, out script_id); + if (script_id > 0) + { + FormScriptEditor formEditor = new FormScriptEditor(); + formEditor.Show(); + formEditor.LoadScript(script_id, "generic_scripts"); + } + } //SCRIPT_COMMAND_SUMMON_OBJECT (76) private void btnSummonObjectId_Click(object sender, EventArgs e) diff --git a/ScriptEditor/Properties/AssemblyInfo.cs b/ScriptEditor/Properties/AssemblyInfo.cs index 20d3ee9..8772459 100644 --- a/ScriptEditor/Properties/AssemblyInfo.cs +++ b/ScriptEditor/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.2.0.0")] -[assembly: AssemblyFileVersion("8.2.0.0")] +[assembly: AssemblyVersion("8.3.0.0")] +[assembly: AssemblyFileVersion("8.3.0.0")]