Skip to content

Commit

Permalink
Add [D] icon, plugin counts, color
Browse files Browse the repository at this point in the history
  • Loading branch information
KazWolfe committed Jul 17, 2024
1 parent 560c294 commit cfdb4ac
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions Dalamud/Interface/Internal/Windows/TitleScreenMenuWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
using Dalamud.Game.ClientState;
using Dalamud.Game.Gui;
using Dalamud.Game.Text;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Interface.Animation.EasingFunctions;
using Dalamud.Interface.ManagedFontAtlas;
using Dalamud.Interface.ManagedFontAtlas.Internals;
using Dalamud.Interface.Textures.TextureWraps;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using Dalamud.Interface.Windowing;
using Dalamud.Plugin.Internal;
using Dalamud.Plugin.Internal.Types;
using Dalamud.Plugin.Services;
using Dalamud.Storage.Assets;
using Dalamud.Support;
Expand Down Expand Up @@ -442,10 +446,21 @@ private unsafe void OnVersionStringDraw(AddonEvent ev, AddonArgs args)

var addon = (AtkUnitBase*)setupArgs.Addon;

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();

addon->GetTextNodeById(3)->TextFlags |= (byte)TextFlags.MultiLine;
addon->GetTextNodeById(3)->NodeText.SetString(
$"{addon->AtkValues[1].GetValueAsString()}" +
$"\n\nDalamud: {Util.GetScmVersion()} ({this.trackName})");
addon->GetTextNodeById(3)->NodeText.SetString(seText.Encode());
}

private void TitleScreenMenuEntryListChange() => this.privateAtlas.BuildFontsAsync();
Expand Down

0 comments on commit cfdb4ac

Please sign in to comment.