feat(branding): replace ASCII fox banner with embedded image
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Globalization;
|
||||
using System.Numerics;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using HellionChat.Branding;
|
||||
@@ -171,24 +172,20 @@ public sealed class FirstRunWizard : Window
|
||||
ImGui.TextUnformatted(HellionStrings.Wizard_Step1_Title);
|
||||
ImGui.Spacing();
|
||||
|
||||
// Banner is opt-in: the full silhouette dominates the wizard window
|
||||
// at the default size, so the TreeNode is folded by default and the
|
||||
// onboarding copy stays the primary focus. Mirrors the pre-rewrite
|
||||
// collapsible anchor from v1.5.1.
|
||||
using (var tree = ImRaii.TreeNode("Hellion Forge"))
|
||||
// Fox-banner image: the embedded Hellion Forge fox artwork, replacing
|
||||
// the ASCII FoxBanner. Async load renders nothing until the texture is
|
||||
// ready (a few frames). No theme tinting, the fox keeps its identity.
|
||||
var banner = FoxBannerTexture.Shared.GetWrapOrDefault();
|
||||
if (banner is not null)
|
||||
{
|
||||
if (tree.Success)
|
||||
{
|
||||
using (Plugin.Interface.UiBuilder.MonoFontHandle.Push())
|
||||
{
|
||||
// CalcTextSize must run inside the MonoFont push so the
|
||||
// measurement matches the glyph width actually used for
|
||||
// rendering.
|
||||
var bannerSize = ImGui.CalcTextSize(HellionForgeAscii.FoxBanner);
|
||||
ImGui.SetCursorPosX((ImGui.GetContentRegionAvail().X - bannerSize.X) * 0.5f);
|
||||
ImGui.TextUnformatted(HellionForgeAscii.FoxBanner);
|
||||
}
|
||||
}
|
||||
var height = 120f * ImGuiHelpers.GlobalScale;
|
||||
var width = height * banner.Size.X / banner.Size.Y;
|
||||
// Anchor the centering offset to the current cursor X. Avoids a
|
||||
// negative position if the banner is ever wider than the region.
|
||||
var offsetX = (ImGui.GetContentRegionAvail().X - width) * 0.5f;
|
||||
if (offsetX > 0f)
|
||||
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + offsetX);
|
||||
ImGui.Image(banner.Handle, new Vector2(width, height));
|
||||
}
|
||||
|
||||
ImGui.Spacing();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Numerics;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Colors;
|
||||
@@ -68,18 +69,15 @@ internal sealed class Information : ISettingsTab
|
||||
DrawChangelogSection();
|
||||
}
|
||||
|
||||
// Provenance anchor — folded by default so the tab opens to the
|
||||
// version-info section as before. Expands to show the full Hellion
|
||||
// Forge silhouette in monospace.
|
||||
private void DrawHellionForgeSection()
|
||||
{
|
||||
using var tree = ImRaii.TreeNode("Hellion Forge");
|
||||
if (!tree.Success)
|
||||
var banner = FoxBannerTexture.Shared.GetWrapOrDefault();
|
||||
if (banner is null)
|
||||
return;
|
||||
|
||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
||||
using (Plugin.Interface.UiBuilder.MonoFontHandle.Push())
|
||||
ImGui.TextUnformatted(HellionForgeAscii.FoxBanner);
|
||||
var height = 120f * ImGuiHelpers.GlobalScale;
|
||||
var width = height * banner.Size.X / banner.Size.Y;
|
||||
ImGui.Image(banner.Handle, new Vector2(width, height));
|
||||
}
|
||||
|
||||
private void DrawVersionInfoSection()
|
||||
|
||||
Reference in New Issue
Block a user