Skip to content

Commit

Permalink
Add support for generic scripts table.
Browse files Browse the repository at this point in the history
  • Loading branch information
brotalnia committed Sep 2, 2020
1 parent 0061989 commit 1e7e0fa
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 30 deletions.
125 changes: 123 additions & 2 deletions ScriptEditor/DataFinderForms/FormConditionFinder.Designer.cs

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

51 changes: 40 additions & 11 deletions ScriptEditor/DataFinderForms/FormConditionFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ private void ResetAndHideConditionSpecificForms()
// CONDITION_HEALTH_PERCENT (41)
// CONDITION_MANA_PERCENT (42)
// CONDITION_PVP_RANK (51)
// CONDITION_DB_GUID (52)
txtWarEffortStage.Text = "";
cmbWarEffortComparison.SelectedIndex = 0;
frmConditionWarEffort.Visible = false;
Expand Down Expand Up @@ -239,6 +238,13 @@ private void ResetAndHideConditionSpecificForms()
btnMapEventTargetsConditionId.Text = "-NONE-";
frmConditionMapEventTargets.Visible = false;

// CONDITION_DB_GUID (52)
txtConditionDbGuid1.Text = "";
txtConditionDbGuid2.Text = "";
txtConditionDbGuid3.Text = "";
txtConditionDbGuid4.Text = "";
frmConditionDbGuid.Visible = false;

// Unknown Condition Id
txtUnknownValue1.Text = "";
txtUnknownValue2.Text = "";
Expand Down Expand Up @@ -607,14 +613,14 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
case 41: // CONDITION_HEALTH_PERCENT
case 42: // CONDITION_MANA_PERCENT
case 51: // CONDITION_PVP_RANK
case 52: // CONDITION_DB_GUID
{
switch (selectedCondition.Type)
{
case 11: // CONDITION_WAR_EFFORT_STAGE
{
lblConditionWarEffortTooltip.Text = "Returns true if the War Effort event is at the specified stage.";
cmbWarEffortComparison.Visible = true;
cmbWarEffortComparison.SelectedIndex = (int)selectedCondition.Value2;
lblWarEffortComparison.Visible = true;
lblWarEffortStage.Text = "Stage:";
break;
Expand All @@ -623,6 +629,7 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
{
lblConditionWarEffortTooltip.Text = "Returns true if the target Player fits the specified level requirement.";
cmbWarEffortComparison.Visible = true;
cmbWarEffortComparison.SelectedIndex = (int)selectedCondition.Value2;
lblWarEffortComparison.Visible = true;
lblWarEffortStage.Text = "Level:";
break;
Expand All @@ -647,6 +654,7 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
{
lblConditionWarEffortTooltip.Text = "Returns true if the source Creature's last reached waypoint matches the one specified.";
cmbWarEffortComparison.Visible = true;
cmbWarEffortComparison.SelectedIndex = (int)selectedCondition.Value2;
lblWarEffortComparison.Visible = true;
lblWarEffortStage.Text = "Waypoint:";
break;
Expand All @@ -663,6 +671,7 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
{
lblConditionWarEffortTooltip.Text = "Returns true if the source and target WorldObjects are within a specified distance of each other.";
cmbWarEffortComparison.Visible = true;
cmbWarEffortComparison.SelectedIndex = (int)selectedCondition.Value2;
lblWarEffortComparison.Visible = true;
lblWarEffortStage.Text = "Distance:";
break;
Expand All @@ -671,6 +680,7 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
{
lblConditionWarEffortTooltip.Text = "Returns true if the target Unit's remaining health percent matches the specified criteria.";
cmbWarEffortComparison.Visible = true;
cmbWarEffortComparison.SelectedIndex = (int)selectedCondition.Value2;
lblWarEffortComparison.Visible = true;
lblWarEffortStage.Text = "Health:";
break;
Expand All @@ -679,6 +689,7 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
{
lblConditionWarEffortTooltip.Text = "Returns true if the target Unit's remaining mana percent matches the specified criteria.";
cmbWarEffortComparison.Visible = true;
cmbWarEffortComparison.SelectedIndex = (int)selectedCondition.Value2;
lblWarEffortComparison.Visible = true;
lblWarEffortStage.Text = "Mana:";
break;
Expand All @@ -687,21 +698,13 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
{
lblConditionWarEffortTooltip.Text = "Returns true if the target Player's honor rank matches the specified criteria.";
cmbWarEffortComparison.Visible = true;
cmbWarEffortComparison.SelectedIndex = (int)selectedCondition.Value2;
lblWarEffortComparison.Visible = true;
lblWarEffortStage.Text = "Rank:";
break;
}
case 52: // CONDITION_DB_GUID
{
lblConditionWarEffortTooltip.Text = "Returns true if the source object's database guid matches the one specified.";
cmbWarEffortComparison.Visible = false;
lblWarEffortComparison.Visible = false;
lblWarEffortStage.Text = "Guid:";
break;
}
}
txtWarEffortStage.Text = selectedCondition.Value1.ToString();
cmbWarEffortComparison.SelectedIndex = (int)selectedCondition.Value2;
frmConditionWarEffort.Visible = true;
break;
}
Expand Down Expand Up @@ -806,6 +809,15 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
frmConditionMapEventTargets.Visible = true;
break;
}
case 52: // CONDITION_DB_GUID
{
txtConditionDbGuid1.Text = selectedCondition.Value1.ToString();
txtConditionDbGuid2.Text = selectedCondition.Value2.ToString();
txtConditionDbGuid3.Text = selectedCondition.Value3.ToString();
txtConditionDbGuid4.Text = selectedCondition.Value4.ToString();
frmConditionDbGuid.Visible = true;
break;
}
default:
{
txtUnknownValue1.Text = selectedCondition.Value1.ToString();
Expand Down Expand Up @@ -1798,6 +1810,23 @@ private void btnMapEventTargetsConditionId_Click(object sender, EventArgs e)
{
SetScriptFieldFromDataFinderForm<FormConditionFinder>(btnMapEventTargetsConditionId, null, GameData.FindConditionName, "Value2");
}
// CONDITION_DB_GUID
private void txtConditionDbGuid1_Leave(object sender, EventArgs e)
{
SetScriptFieldFromTextbox(txtConditionDbGuid1, "Value1");
}
private void txtConditionDbGuid2_Leave(object sender, EventArgs e)
{
SetScriptFieldFromTextbox(txtConditionDbGuid2, "Value2");
}
private void txtConditionDbGuid3_Leave(object sender, EventArgs e)
{
SetScriptFieldFromTextbox(txtConditionDbGuid3, "Value3");
}
private void txtConditionDbGuid4_Leave(object sender, EventArgs e)
{
SetScriptFieldFromTextbox(txtConditionDbGuid4, "Value4");
}
// Unknown Condition Id
private void txtUnknownValue1_Leave(object sender, EventArgs e)
{
Expand Down
Loading

0 comments on commit 1e7e0fa

Please sign in to comment.