diff --git a/Dalamud/Configuration/Internal/DalamudConfiguration.cs b/Dalamud/Configuration/Internal/DalamudConfiguration.cs index cd5d90ba3..4405a11a7 100644 --- a/Dalamud/Configuration/Internal/DalamudConfiguration.cs +++ b/Dalamud/Configuration/Internal/DalamudConfiguration.cs @@ -256,6 +256,11 @@ namespace Dalamud.Configuration.Internal /// public List? DtrIgnore { get; set; } + /// + /// Gets or sets the spacing used for DTR entries. + /// + public int DtrSpacing { get; set; } = 10; + /// /// Gets or sets a value indicating whether the title screen menu is shown. /// diff --git a/Dalamud/Game/Gui/Dtr/DtrBar.cs b/Dalamud/Game/Gui/Dtr/DtrBar.cs index 2e6174993..578641af3 100644 --- a/Dalamud/Game/Gui/Dtr/DtrBar.cs +++ b/Dalamud/Game/Gui/Dtr/DtrBar.cs @@ -19,11 +19,6 @@ namespace Dalamud.Game.Gui.Dtr [InterfaceVersion("1.0")] public sealed unsafe class DtrBar : IDisposable { - /// - /// The amount of padding between Server Info UI elements. - /// - private const int ElementPadding = 30; - private List entries = new(); private uint runningNodeIds = 1000; @@ -174,7 +169,7 @@ namespace Dalamud.Game.Gui.Dtr if (!isHide) { - runningXPos -= data.TextNode->AtkResNode.Width + ElementPadding; + runningXPos -= data.TextNode->AtkResNode.Width + configuration.DtrSpacing; data.TextNode->AtkResNode.SetPositionFloat(runningXPos, 2); } diff --git a/Dalamud/Interface/Internal/Windows/SettingsWindow.cs b/Dalamud/Interface/Internal/Windows/SettingsWindow.cs index 312415dc7..e4c6281da 100644 --- a/Dalamud/Interface/Internal/Windows/SettingsWindow.cs +++ b/Dalamud/Interface/Internal/Windows/SettingsWindow.cs @@ -48,6 +48,7 @@ namespace Dalamud.Interface.Internal.Windows private List? dtrOrder; private List? dtrIgnore; + private int dtrSpacing; private List thirdRepoList; private bool thirdRepoListChanged; @@ -97,6 +98,8 @@ namespace Dalamud.Interface.Internal.Windows this.doFocus = configuration.IsFocusManagementEnabled; this.doTsm = configuration.ShowTsm; + this.dtrSpacing = configuration.DtrSpacing; + this.doPluginTest = configuration.DoPluginTest; this.thirdRepoList = configuration.ThirdRepoList.Select(x => x.Clone()).ToList(); this.devPluginLocations = configuration.DevPluginLoadLocations.Select(x => x.Clone()).ToList(); @@ -324,7 +327,7 @@ namespace Dalamud.Interface.Internal.Windows ImGui.Text(Loc.Localize("DalamudSettingServerInfoBar", "Server Info Bar configuration")); ImGui.TextColored(ImGuiColors.DalamudGrey, Loc.Localize("DalamudSettingServerInfoBarHint", "Plugins can put additional information into your server information bar(where world & time can be seen).\nYou can reorder and disable these here.")); - ImGuiHelpers.ScaledDummy(10, 10); + ImGuiHelpers.ScaledDummy(10); var configuration = Service.Get(); var dtrBar = Service.Get(); @@ -407,6 +410,12 @@ namespace Dalamud.Interface.Internal.Windows if (isOrderChange) dtrBar.ApplySort(); + + ImGuiHelpers.ScaledDummy(10); + + ImGui.Text(Loc.Localize("DalamudSettingServerInfoBarSpacing", "Server Info Bar spacing")); + ImGui.TextColored(ImGuiColors.DalamudGrey, Loc.Localize("DalamudSettingServerInfoBarSpacingHint", "Configure the amount of space between entries in the server info bar here.")); + ImGui.SliderInt("Spacing", ref this.dtrSpacing, 0, 40); } private void DrawExperimentalTab() @@ -813,6 +822,8 @@ namespace Dalamud.Interface.Internal.Windows this.dtrOrder = configuration.DtrOrder; this.dtrIgnore = configuration.DtrIgnore; + configuration.DtrSpacing = this.dtrSpacing; + configuration.DoPluginTest = this.doPluginTest; configuration.ThirdRepoList = this.thirdRepoList.Select(x => x.Clone()).ToList(); configuration.DevPluginLoadLocations = this.devPluginLocations.Select(x => x.Clone()).ToList();