feat: add option to sort auto translate list

This commit is contained in:
Anna
2022-05-30 00:52:44 -04:00
parent 70cecf4a6d
commit 212835c33a
6 changed files with 673 additions and 1023 deletions
+3 -3
View File
@@ -955,7 +955,7 @@ internal sealed class ChatLog : IUiComponent {
return;
}
this._autoCompleteList ??= AutoTranslate.Matching(this.Ui.Plugin.DataManager, this._autoCompleteInfo.ToComplete);
this._autoCompleteList ??= AutoTranslate.Matching(this.Ui.Plugin.DataManager, this._autoCompleteInfo.ToComplete, this.Ui.Plugin.Config.SortAutoTranslate);
if (this._autoCompleteOpen) {
ImGui.OpenPopup(AutoCompleteId);
@@ -975,8 +975,8 @@ internal sealed class ChatLog : IUiComponent {
}
ImGui.SetNextItemWidth(-1);
if (ImGui.InputTextWithHint("##auto-complete-filter", "Search auto translate...", ref this._autoCompleteInfo.ToComplete, 256, ImGuiInputTextFlags.CallbackAlways, this.FixCursor)) {
this._autoCompleteList = AutoTranslate.Matching(this.Ui.Plugin.DataManager, this._autoCompleteInfo.ToComplete);
if (ImGui.InputTextWithHint("##auto-complete-filter", Language.AutoTranslate_Search_Hint, ref this._autoCompleteInfo.ToComplete, 256, ImGuiInputTextFlags.CallbackAlways, this.FixCursor)) {
this._autoCompleteList = AutoTranslate.Matching(this.Ui.Plugin.DataManager, this._autoCompleteInfo.ToComplete, this.Ui.Plugin.Config.SortAutoTranslate);
}
if (ImGui.IsWindowAppearing()) {
+4
View File
@@ -58,5 +58,9 @@ internal sealed class Miscellaneous : ISettingsTab {
ImGuiUtil.HelpText(string.Format(Language.Options_KeybindMode_Description, Plugin.PluginName));
ImGui.Spacing();
ImGui.Checkbox(Language.Options_SortAutoTranslate_Name, ref this.Mutable.SortAutoTranslate);
ImGuiUtil.HelpText(Language.Options_SortAutoTranslate_Description);
ImGui.Spacing();
}
}