Skip to content

Commit

Permalink
Add quick finish quest
Browse files Browse the repository at this point in the history
  • Loading branch information
jie65535 committed May 30, 2024
1 parent 3ddfa18 commit de53f68
Show file tree
Hide file tree
Showing 6 changed files with 258 additions and 191 deletions.
10 changes: 10 additions & 0 deletions Source/GrasscutterTools/Pages/PageQuest.Designer.cs

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

14 changes: 13 additions & 1 deletion Source/GrasscutterTools/Pages/PageQuest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,19 @@ private void QuestButsClicked(object sender, EventArgs e)
return;
var item = ListQuest.SelectedItem as string;
var id = ItemMap.ToId(item);
SetCommand("/quest", $"{(sender as Button).Tag} {id}");
SetCommand("/quest", $"{(sender == BtnAddQuest ? "add" : "finish")} {id}");
}

/// <summary>
/// 列表选中项改变时触发
/// </summary>
private void ListQuest_SelectedIndexChanged(object sender, EventArgs e)
{
if (!ChkAddAndFinishQuest.Checked || ListQuest.SelectedIndex == -1) return;

var item = ListQuest.SelectedItem as string;
var id = ItemMap.ToId(item);
SetCommand($"/quest add {id} | /quest finish {id}");
}
}
}
6 changes: 6 additions & 0 deletions Source/GrasscutterTools/Pages/PageQuest.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,10 @@ Tip: Many quest require server-side scripting support
Therefore, the quest can be added and finished, but not necessarily work.
</value>
</data>
<data name="ChkAddAndFinishQuest.Size" type="System.Drawing.Size, System.Drawing">
<value>187, 21</value>
</data>
<data name="ChkAddAndFinishQuest.Text" xml:space="preserve">
<value>Add &amp;&amp; Finish when selected</value>
</data>
</root>
Loading

0 comments on commit de53f68

Please sign in to comment.