feat: add language override
This commit is contained in:
@@ -132,6 +132,7 @@ internal sealed class Settings : IUiComponent {
|
||||
var fontSizeChanged = Math.Abs(this.Mutable.FontSize - this.Ui.Plugin.Config.FontSize) > 0.001
|
||||
|| Math.Abs(this.Mutable.JapaneseFontSize - this.Ui.Plugin.Config.JapaneseFontSize) > 0.001
|
||||
|| Math.Abs(this.Mutable.SymbolsFontSize - this.Ui.Plugin.Config.SymbolsFontSize) > 0.001;
|
||||
var langChanged = this.Mutable.LanguageOverride != this.Ui.Plugin.Config.LanguageOverride;
|
||||
|
||||
config.UpdateFrom(this.Mutable);
|
||||
|
||||
@@ -145,6 +146,10 @@ internal sealed class Settings : IUiComponent {
|
||||
this.Ui.Plugin.Interface.UiBuilder.RebuildFonts();
|
||||
}
|
||||
|
||||
if (langChanged) {
|
||||
this.Ui.Plugin.LanguageChanged(this.Ui.Plugin.Interface.UiLanguage);
|
||||
}
|
||||
|
||||
if (!this.Mutable.HideChat && hideChatChanged) {
|
||||
GameFunctions.GameFunctions.SetChatInteractable(true);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,16 @@ internal sealed class Miscellaneous : ISettingsTab {
|
||||
}
|
||||
|
||||
public void Draw() {
|
||||
if (ImGui.BeginCombo(Language.Options_Language_Name, this.Mutable.LanguageOverride.Name())) {
|
||||
foreach (var language in Enum.GetValues<LanguageOverride>()) {
|
||||
if (ImGui.Selectable(language.Name())) {
|
||||
this.Mutable.LanguageOverride = language;
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.EndCombo();
|
||||
}
|
||||
|
||||
ImGuiUtil.HelpText(string.Format(Language.Options_Language_Description, Plugin.PluginName));
|
||||
ImGui.Spacing();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user