mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
feat: add global UI scale to settings
This commit is contained in:
parent
7ac4881595
commit
87c3c32dc6
3 changed files with 21 additions and 1 deletions
|
|
@ -40,6 +40,8 @@ namespace Dalamud
|
|||
public bool DoPluginTest { get; set; } = false;
|
||||
public bool DoDalamudTest { get; set; } = false;
|
||||
|
||||
public float GlobalUiScale { get; set; } = 1.0f;
|
||||
|
||||
[JsonIgnore]
|
||||
public string ConfigPath;
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ namespace Dalamud.Interface
|
|||
|
||||
this.doCfTaskBarFlash = this.dalamud.Configuration.DutyFinderTaskbarFlash;
|
||||
|
||||
this.globalUiScale = this.dalamud.Configuration.GlobalUiScale;
|
||||
|
||||
this.doPluginTest = this.dalamud.Configuration.DoPluginTest;
|
||||
this.doDalamudTest = this.dalamud.Configuration.DoDalamudTest;
|
||||
|
||||
|
|
@ -46,6 +48,10 @@ namespace Dalamud.Interface
|
|||
|
||||
private bool doCfTaskBarFlash;
|
||||
|
||||
private const float MinScale = 0.3f;
|
||||
private const float MaxScale = 2.0f;
|
||||
private float globalUiScale;
|
||||
|
||||
#region Experimental
|
||||
|
||||
private bool doPluginTest;
|
||||
|
|
@ -87,6 +93,15 @@ namespace Dalamud.Interface
|
|||
ImGui.EndTabItem();
|
||||
}
|
||||
|
||||
if (ImGui.BeginTabItem(Loc.Localize("DalamudSettingsVisual", "Look & Feel"))) {
|
||||
if (ImGui.DragFloat(Loc.Localize("DalamudSettingsGlobalUiScale", "Global UI scale"), ref this.globalUiScale, 0.005f, MinScale, MaxScale, "%.2f"))
|
||||
ImGui.GetIO().FontGlobalScale = this.globalUiScale;
|
||||
|
||||
ImGui.TextColored(this.hintTextColor, Loc.Localize("DalamudSettingsGlobalUiScaleHint", "Scale all XIVLauncher UI elements - useful for 4K displays."));
|
||||
|
||||
ImGui.EndTabItem();
|
||||
}
|
||||
|
||||
if (ImGui.BeginTabItem(Loc.Localize("DalamudSettingsExperimental", "Experimental")))
|
||||
{
|
||||
ImGui.Text(Loc.Localize("DalamudSettingsRestartHint", "You need to restart your game after changing these settings."));
|
||||
|
|
@ -107,7 +122,6 @@ namespace Dalamud.Interface
|
|||
|
||||
ImGui.EndChild();
|
||||
|
||||
|
||||
if (ImGui.Button(Loc.Localize("Save", "Save"))) {
|
||||
Save();
|
||||
}
|
||||
|
|
@ -130,6 +144,8 @@ namespace Dalamud.Interface
|
|||
|
||||
this.dalamud.Configuration.DutyFinderTaskbarFlash = this.doCfTaskBarFlash;
|
||||
|
||||
this.dalamud.Configuration.GlobalUiScale = this.globalUiScale;
|
||||
|
||||
this.dalamud.Configuration.DoPluginTest = this.doPluginTest;
|
||||
this.dalamud.Configuration.DoDalamudTest = this.doDalamudTest;
|
||||
|
||||
|
|
|
|||
|
|
@ -253,6 +253,8 @@ namespace Dalamud.Interface
|
|||
ImGui.GetStyle().Colors[(int) ImGuiCol.Tab] = new Vector4(0.23f, 0.23f, 0.23f, 0.86f);
|
||||
ImGui.GetStyle().Colors[(int) ImGuiCol.TabHovered] = new Vector4(0.71f, 0.71f, 0.71f, 0.80f);
|
||||
ImGui.GetStyle().Colors[(int) ImGuiCol.TabActive] = new Vector4(0.36f, 0.36f, 0.36f, 1.00f);
|
||||
|
||||
ImGui.GetIO().FontGlobalScale = this.dalamud.Configuration.GlobalUiScale;
|
||||
}
|
||||
|
||||
this.scene.Render();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue