Skip to content

Commit

Permalink
Movement command and event changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
brotalnia committed Dec 30, 2020
1 parent e5f58cd commit 86432bf
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 173 deletions.
27 changes: 20 additions & 7 deletions ScriptEditor/FormCastFlags.Designer.cs

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

8 changes: 8 additions & 0 deletions ScriptEditor/FormCastFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ public bool ShowDialog(ref uint flags, ref uint script, uint targettype, ref uin
if ((flags & 128) != 0)
chkCastFlag128.Checked = true;

// CF_TARGET_CASTING
if ((flags & 256) != 0)
chkCastFlag256.Checked = true;

// Show the form.
this.ShowDialog();

Expand Down Expand Up @@ -144,6 +148,10 @@ public bool ShowDialog(ref uint flags, ref uint script, uint targettype, ref uin
if (chkCastFlag128.Checked)
new_flags += 128;

// CF_TARGET_CASTING
if (chkCastFlag256.Checked)
new_flags += 256;

uint new_targetparam1 = 0;
uint.TryParse(txtTargetParam1.Text, out new_targetparam1);

Expand Down
97 changes: 42 additions & 55 deletions ScriptEditor/FormEventEditor.Designer.cs

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

29 changes: 0 additions & 29 deletions ScriptEditor/FormEventEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ private void LoadControls()
// Add options to Hit By Aura combo box.
cmbHitByAuraType.DataSource = GameData.SpellAuraNamesList;

// Fix size of textbox.
txtMovementInformType.AutoSize = false;
txtMovementInformType.Height = 21;

dontUpdate = false;
}

Expand Down Expand Up @@ -594,7 +590,6 @@ private void ShowEventSpecificForm(CreatureEvent selectedEvent)
}
case 29: // EVENT_T_MOVEMENT_INFORM
{
txtMovementInformType.Text = selectedEvent.Param1.ToString();
cmbMovementInformType.SelectedIndex = GameData.FindIndexOfMotionTypeFull((uint)selectedEvent.Param1);
txtMovementInformPoint.Text = selectedEvent.Param2.ToString();
txtMovementInformRepeatMin.Text = selectedEvent.Param3.ToString();
Expand Down Expand Up @@ -1369,30 +1364,6 @@ private void cmbMovementInformType_SelectedIndexChanged(object sender, EventArgs
return;

SetScriptFieldFromCombobox(cmbMovementInformType, "Param1", true);
txtMovementInformType.Text = (cmbMovementInformType.SelectedItem as ComboboxPair).Value.ToString();
}

private void txtMovementInformType_Leave(object sender, EventArgs e)
{
if (dontUpdate)
return;

uint motion_type;
if (uint.TryParse(txtMovementInformType.Text, out motion_type) && (GameData.FindIndexOfMotionTypeFull(motion_type) != -1))
{
dontUpdate = true;
cmbMovementInformType.SelectedIndex = GameData.FindIndexOfMotionTypeFull(motion_type);
dontUpdate = false;
SetScriptFieldFromValue(motion_type, "Param1");
}
else
{
dontUpdate = true;
txtMovementInformType.Text = "0";
cmbMovementInformType.SelectedIndex = 0;
dontUpdate = false;
SetScriptFieldFromValue(0, "Param1");
}
}

private void txtMovementInformPoint_Leave(object sender, EventArgs e)
Expand Down
Loading

0 comments on commit 86432bf

Please sign in to comment.