From 7830d7651b528946cdd840b0896db9616f96e122 Mon Sep 17 00:00:00 2001 From: goat Date: Mon, 22 Jul 2024 00:34:49 +0200 Subject: [PATCH 1/5] pi: force-reload pluginmasters when toggling testing on a plugin --- .../Internal/Windows/PluginInstaller/PluginInstallerWindow.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs index ccf7b8226..92afe56a6 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs @@ -2889,6 +2889,7 @@ internal class PluginInstallerWindow : Window, IDisposable } configuration.QueueSave(); + _ = pluginManager.ReloadPluginMastersAsync(); } if (repoManifest?.IsTestingExclusive == true) From d44baa1f49e8b4f7a5d7d790a4eda13ba72797d4 Mon Sep 17 00:00:00 2001 From: nebel <9887+nebel@users.noreply.github.com> Date: Mon, 22 Jul 2024 08:00:15 +0900 Subject: [PATCH 2/5] Small efficiency improvements for DtrBar (#1954) --- Dalamud/Game/Gui/Dtr/DtrBar.cs | 72 ++++++++++++++--------------- Dalamud/Game/Gui/Dtr/DtrBarEntry.cs | 9 ++-- 2 files changed, 41 insertions(+), 40 deletions(-) diff --git a/Dalamud/Game/Gui/Dtr/DtrBar.cs b/Dalamud/Game/Gui/Dtr/DtrBar.cs index 2d8bb064b..4e1ad1533 100644 --- a/Dalamud/Game/Gui/Dtr/DtrBar.cs +++ b/Dalamud/Game/Gui/Dtr/DtrBar.cs @@ -131,9 +131,12 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar /// internal void HandleRemovedNodes() { - foreach (var data in this.entries.Where(d => d.ShouldBeRemoved)) + foreach (var data in this.entries) { - this.RemoveEntry(data); + if (data.ShouldBeRemoved) + { + this.RemoveEntry(data); + } } this.entries.RemoveAll(d => d.ShouldBeRemoved); @@ -210,7 +213,7 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar // If we have an unmodified DTR but still have entries, we need to // work to reset our state. - if (!this.CheckForDalamudNodes()) + if (!this.CheckForDalamudNodes(dtr)) this.RecreateNodes(); var collisionNode = dtr->GetNodeById(17); @@ -223,40 +226,35 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar foreach (var data in this.entries) { - var isHide = data.UserHidden || !data.Shown; - - if (data is { Dirty: true, Added: true, Text: not null, TextNode: not null }) - { - var node = data.TextNode; - - if (data.Storage == null) - { - data.Storage = Utf8String.CreateEmpty(); - } - - data.Storage->SetString(data.Text.EncodeWithNullTerminator()); - node->SetText(data.Storage->StringPtr); - - ushort w = 0, h = 0; - - if (!isHide) - { - node->GetTextDrawSize(&w, &h, node->NodeText.StringPtr); - node->AtkResNode.SetWidth(w); - } - - node->AtkResNode.ToggleVisibility(!isHide); - - data.Dirty = false; - } - if (!data.Added) { data.Added = this.AddNode(data.TextNode); } + var isHide = !data.Shown || data.UserHidden; + var node = data.TextNode; + var nodeHidden = !node->AtkResNode.IsVisible(); + if (!isHide) { + if (nodeHidden) + node->AtkResNode.ToggleVisibility(true); + + if (data is { Added: true, Text: not null, TextNode: not null } && (data.Dirty || nodeHidden)) + { + if (data.Storage == null) + { + data.Storage = Utf8String.CreateEmpty(); + } + + data.Storage->SetString(data.Text.EncodeWithNullTerminator()); + node->SetText(data.Storage->StringPtr); + + ushort w = 0, h = 0; + node->GetTextDrawSize(&w, &h, node->NodeText.StringPtr); + node->AtkResNode.SetWidth(w); + } + var elementWidth = data.TextNode->AtkResNode.Width + this.configuration.DtrSpacing; if (this.configuration.DtrSwapDirection) @@ -270,17 +268,20 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar data.TextNode->AtkResNode.SetPositionFloat(runningXPos, 2); } } - else + else if (!nodeHidden) { // If we want the node hidden, shift it up, to prevent collision conflicts - data.TextNode->AtkResNode.SetYFloat(-collisionNode->Height * dtr->RootNode->ScaleX); + node->AtkResNode.SetYFloat(-collisionNode->Height * dtr->RootNode->ScaleX); + node->AtkResNode.ToggleVisibility(false); } + + data.Dirty = false; } } private void HandleAddedNodes() { - if (this.newEntries.Any()) + if (!this.newEntries.IsEmpty) { foreach (var newEntry in this.newEntries) { @@ -354,11 +355,8 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar /// Checks if there are any Dalamud nodes in the DTR. /// /// True if there are nodes with an ID > 1000. - private bool CheckForDalamudNodes() + private bool CheckForDalamudNodes(AtkUnitBase* dtr) { - var dtr = this.GetDtr(); - if (dtr == null || dtr->RootNode == null) return false; - for (var i = 0; i < dtr->UldManager.NodeListCount; i++) { if (dtr->UldManager.NodeList[i]->NodeId > 1000) diff --git a/Dalamud/Game/Gui/Dtr/DtrBarEntry.cs b/Dalamud/Game/Gui/Dtr/DtrBarEntry.cs index 33e9b26e3..fc5210fda 100644 --- a/Dalamud/Game/Gui/Dtr/DtrBarEntry.cs +++ b/Dalamud/Game/Gui/Dtr/DtrBarEntry.cs @@ -137,14 +137,17 @@ public sealed unsafe class DtrBarEntry : IDisposable, IDtrBarEntry get => this.shownBacking; set { - this.shownBacking = value; - this.Dirty = true; + if (value != this.shownBacking) + { + this.shownBacking = value; + this.Dirty = true; + } } } /// [Api10ToDo("Maybe make this config scoped to internalname?")] - public bool UserHidden => this.configuration.DtrIgnore?.Any(x => x == this.Title) ?? false; + public bool UserHidden => this.configuration.DtrIgnore?.Contains(this.Title) ?? false; /// /// Gets or sets the internal text node of this entry. From 2335c498c59d80ad7770b65caffa4d2648c7e3f3 Mon Sep 17 00:00:00 2001 From: Tykku Date: Sun, 21 Jul 2024 19:00:48 -0400 Subject: [PATCH 3/5] fix: nin gauge missing kazematoi (#1904) Added Kazematoi to nin gauge from structs Co-authored-by: KazWolfe --- Dalamud/Game/ClientState/JobGauge/Types/NINGauge.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dalamud/Game/ClientState/JobGauge/Types/NINGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/NINGauge.cs index 4d0b08556..1123fa8b3 100644 --- a/Dalamud/Game/ClientState/JobGauge/Types/NINGauge.cs +++ b/Dalamud/Game/ClientState/JobGauge/Types/NINGauge.cs @@ -18,4 +18,9 @@ public unsafe class NINGauge : JobGaugeBase public byte Ninki => this.Struct->Ninki; + + /// + /// Gets the current charges for Kazematoi + /// + public byte Kazematoi => this.Struct->Kazematoi; } From 849f84e859f7be45c3dadab3adb9dae8763b89b4 Mon Sep 17 00:00:00 2001 From: goat Date: Mon, 22 Jul 2024 20:50:05 +0200 Subject: [PATCH 4/5] ExposedPlugin: correctly indicate whether a plugin has a config UI --- Dalamud/Plugin/InstalledPluginState.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dalamud/Plugin/InstalledPluginState.cs b/Dalamud/Plugin/InstalledPluginState.cs index f92cc0c2c..6700a1f8d 100644 --- a/Dalamud/Plugin/InstalledPluginState.cs +++ b/Dalamud/Plugin/InstalledPluginState.cs @@ -72,7 +72,7 @@ internal sealed class ExposedPlugin(LocalPlugin plugin) : IExposedPlugin public bool HasMainUi => plugin.DalamudInterface?.LocalUiBuilder.HasMainUi ?? false; /// - public bool HasConfigUi => plugin.DalamudInterface?.LocalUiBuilder.HasMainUi ?? false; + public bool HasConfigUi => plugin.DalamudInterface?.LocalUiBuilder.HasConfigUi ?? false; /// public void OpenMainUi() From 18b6596aaa9ad74cf839c1610f88858d96a4d12c Mon Sep 17 00:00:00 2001 From: goat Date: Tue, 23 Jul 2024 00:36:04 +0200 Subject: [PATCH 5/5] build: 10.0.0.6 --- Dalamud/Dalamud.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dalamud/Dalamud.csproj b/Dalamud/Dalamud.csproj index 97be8b600..dfaab870c 100644 --- a/Dalamud/Dalamud.csproj +++ b/Dalamud/Dalamud.csproj @@ -9,7 +9,7 @@ - 10.0.0.5 + 10.0.0.6 XIV Launcher addon framework $(DalamudVersion) $(DalamudVersion)