Skip to content

Commit

Permalink
Add tooltips.
Browse files Browse the repository at this point in the history
  • Loading branch information
brotalnia committed Jan 8, 2022
1 parent e49a717 commit 20ff28b
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 7 deletions.
10 changes: 10 additions & 0 deletions ScriptEditor/FormEventEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
37 changes: 32 additions & 5 deletions ScriptEditor/FormScriptEditor.Designer.cs

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

35 changes: 35 additions & 0 deletions ScriptEditor/FormScriptEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -457,6 +473,7 @@ private void ResetAndDisableGeneralForm()
cmbCommandId.Text = "";

// Check Boxes.
chkSkipMissingTargets.Checked = false;
chkAbortScript.Checked = false;
chkSwapFinal.Checked = false;
chkSwapInitial.Checked = false;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions ScriptEditor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

0 comments on commit 20ff28b

Please sign in to comment.