mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
feat(DTR): configurable spacing
This commit is contained in:
parent
e90ef9da9e
commit
976c26e544
3 changed files with 18 additions and 7 deletions
|
|
@ -256,6 +256,11 @@ namespace Dalamud.Configuration.Internal
|
|||
/// </summary>
|
||||
public List<string>? DtrIgnore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the spacing used for DTR entries.
|
||||
/// </summary>
|
||||
public int DtrSpacing { get; set; } = 10;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the title screen menu is shown.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -19,11 +19,6 @@ namespace Dalamud.Game.Gui.Dtr
|
|||
[InterfaceVersion("1.0")]
|
||||
public sealed unsafe class DtrBar : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The amount of padding between Server Info UI elements.
|
||||
/// </summary>
|
||||
private const int ElementPadding = 30;
|
||||
|
||||
private List<DtrBarEntry> 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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ namespace Dalamud.Interface.Internal.Windows
|
|||
|
||||
private List<string>? dtrOrder;
|
||||
private List<string>? dtrIgnore;
|
||||
private int dtrSpacing;
|
||||
|
||||
private List<ThirdPartyRepoSettings> 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<DalamudConfiguration>.Get();
|
||||
var dtrBar = Service<DtrBar>.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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue