From e6204f973474ded15a174b63874347134f653767 Mon Sep 17 00:00:00 2001 From: Kaz Wolfe Date: Wed, 17 Jul 2024 12:16:57 -0700 Subject: [PATCH] feat: Hide with rest of TSM --- .../Internal/Windows/TitleScreenMenuWindow.cs | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/TitleScreenMenuWindow.cs b/Dalamud/Interface/Internal/Windows/TitleScreenMenuWindow.cs index 85f76c9a50..8b5701f065 100644 --- a/Dalamud/Interface/Internal/Windows/TitleScreenMenuWindow.cs +++ b/Dalamud/Interface/Internal/Windows/TitleScreenMenuWindow.cs @@ -445,22 +445,27 @@ private unsafe void OnVersionStringDraw(AddonEvent ev, AddonArgs args) if (args is not AddonDrawArgs setupArgs) return; var addon = (AtkUnitBase*)setupArgs.Addon; + + // look and feel init. should be harmless to set. + addon->GetTextNodeById(3)->TextFlags |= (byte)TextFlags.MultiLine; + addon->GetTextNodeById(3)->AlignmentType = AlignmentType.TopLeft; - var pluginCount = Service.GetNullable()?.InstalledPlugins - .Count(c => c.State == PluginState.Loaded) ?? 0; - - var seText = new SeStringBuilder() - .AddText(addon->AtkValues[1].GetValueAsString()) - .AddText("\n\n") - .AddUiForeground(SeIconChar.BoxedLetterD.ToIconString(), 539) - .AddUiForeground(561) - .AddText($" Dalamud: {Util.GetScmVersion()} ({this.trackName})") - .AddText($" - {pluginCount} {(pluginCount != 1 ? "plugins" : "plugin")} loaded") - .AddUiForegroundOff() - .Build(); + var titleVersionText = new SeStringBuilder().AddText(addon->AtkValues[1].GetValueAsString()); - addon->GetTextNodeById(3)->TextFlags |= (byte)TextFlags.MultiLine; - addon->GetTextNodeById(3)->NodeText.SetString(seText.Encode()); + if (this.configuration.ShowTsm) + { + var pluginCount = Service.GetNullable()?.InstalledPlugins + .Count(c => c.State == PluginState.Loaded) ?? 0; + + titleVersionText.AddText("\n\n") + .AddUiForeground(SeIconChar.BoxedLetterD.ToIconString(), 539) + .AddUiForeground(561) + .AddText($" Dalamud: {Util.GetScmVersion()} ({this.trackName})") + .AddText($" - {pluginCount} {(pluginCount != 1 ? "plugins" : "plugin")} loaded") + .AddUiForegroundOff(); + } + + addon->GetTextNodeById(3)->NodeText.SetString(titleVersionText.Build().Encode()); } private void TitleScreenMenuEntryListChange() => this.privateAtlas.BuildFontsAsync();