Skip to content

Commit

Permalink
feat: Hide with rest of TSM
Browse files Browse the repository at this point in the history
  • Loading branch information
KazWolfe committed Jul 17, 2024
1 parent cfdb4ac commit e6204f9
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions Dalamud/Interface/Internal/Windows/TitleScreenMenuWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PluginManager>.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<PluginManager>.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();
Expand Down

0 comments on commit e6204f9

Please sign in to comment.