69fa0fecbd
Honorific's TitleData carries Glow / Color3 / GradientColourSet / GradientAnimationStyle beyond the Title + Color we parsed in Cycle 1. The DTO now mirrors all four so the JSON roundtrip doesn't silently drop fields. Rendering for v1.4.7 covers Glow only: when Config.ShowHonorificGlow is on and the title has a Glow colour, the chat header title gets an 8-direction ±1px draw-list outline pre-pass in the glow colour at 0.4 alpha, then the primary text on top. Gradient (Color3 / GradientColourSet / GradientAnimationStyle) is parsed and stashed for a later cycle — porting the full animation needs Honorific's hardcoded Pride-palette list and GradientSystem.cs (or an upstream IPC PR exposing the resolved frame colour). Tracked as "Honorific Full Gradient Port" in the vault backlog. ShowHonorificGlow defaults OFF — keeps v1.4.6 visuals untouched and dodges per-frame DrawList overhead on low-end hardware. Tooltip flags the gradient deferral so users aren't surprised by static rendering.
220 lines
7.3 KiB
C#
220 lines
7.3 KiB
C#
using Dalamud.Bindings.ImGui;
|
|
using Dalamud.Interface;
|
|
using Dalamud.Interface.Utility.Raii;
|
|
using HellionChat.Branding;
|
|
using HellionChat.Integrations;
|
|
using HellionChat.Resources;
|
|
using HellionChat.Util;
|
|
|
|
namespace HellionChat.Ui.SettingsTabs;
|
|
|
|
// Added in v1.3.0. Each future integration cycle adds a section above
|
|
// the "Coming soon" block and removes its stub item.
|
|
internal sealed class Integrations : ISettingsTab
|
|
{
|
|
private Plugin Plugin { get; }
|
|
private Configuration Mutable { get; }
|
|
|
|
public string Name => HellionStrings.Settings_Tab_Integrations + "###tabs-integrations";
|
|
|
|
internal Integrations(Plugin plugin, Configuration mutable)
|
|
{
|
|
Plugin = plugin;
|
|
Mutable = mutable;
|
|
}
|
|
|
|
public void Draw(bool changed)
|
|
{
|
|
ImGui.TextWrapped(HellionStrings.Settings_Integrations_Intro);
|
|
ImGui.Spacing();
|
|
ImGui.Spacing();
|
|
|
|
DrawHonorificSection();
|
|
ImGui.Spacing();
|
|
ImGui.Spacing();
|
|
|
|
DrawComingSoonSection();
|
|
ImGui.Spacing();
|
|
ImGui.Spacing();
|
|
|
|
DrawGotAnIdeaSection();
|
|
}
|
|
|
|
private void DrawHonorificSection()
|
|
{
|
|
DrawSectionHeader(HellionStrings.Settings_Integrations_Honorific_SectionHeader);
|
|
|
|
DrawHonorificStatus();
|
|
ImGui.Spacing();
|
|
|
|
// Toggle works regardless of detection state: "show when available,
|
|
// hide otherwise". Disabling it when Honorific is missing would force
|
|
// the user to retoggle on every reload.
|
|
if (
|
|
ImGui.Checkbox(
|
|
HellionStrings.Settings_Integrations_Honorific_Toggle,
|
|
ref Mutable.ShowHonorificTitleInHeader
|
|
)
|
|
)
|
|
{
|
|
Plugin.SaveConfig();
|
|
}
|
|
|
|
using (ImRaii.PushIndent())
|
|
{
|
|
using (
|
|
ImRaii.PushColor(
|
|
ImGuiCol.Text,
|
|
ColourUtil.RgbaToAbgr(Plugin.ThemeRegistry.Active.Colors.TextMuted)
|
|
)
|
|
)
|
|
{
|
|
ImGui.TextWrapped(HellionStrings.Settings_Integrations_Honorific_ToggleHint);
|
|
}
|
|
|
|
if (
|
|
ImGui.Checkbox(
|
|
HellionStrings.Settings_Integrations_Honorific_Glow_Toggle,
|
|
ref Mutable.ShowHonorificGlow
|
|
)
|
|
)
|
|
{
|
|
Plugin.SaveConfig();
|
|
}
|
|
ImGuiUtil.HelpMarker(HellionStrings.Settings_Integrations_Honorific_Glow_Hint);
|
|
}
|
|
|
|
// Honorific has no LICENSE in its repo so we link upstream and author
|
|
// instead of bundling assets. Text labels because FA Brands isn't
|
|
// guaranteed in Dalamud's font set.
|
|
ImGui.Spacing();
|
|
if (ImGui.Button(HellionStrings.Settings_Integrations_Honorific_LinkRepo))
|
|
{
|
|
Plugin.PlatformUtil.OpenLink(IntegrationLinks.HonorificRepo);
|
|
}
|
|
ImGui.SameLine();
|
|
if (ImGui.Button(HellionStrings.Settings_Integrations_Honorific_LinkAuthor))
|
|
{
|
|
Plugin.PlatformUtil.OpenLink(IntegrationLinks.HonorificAuthor);
|
|
}
|
|
}
|
|
|
|
private void DrawHonorificStatus()
|
|
{
|
|
var theme = Plugin.ThemeRegistry.Active;
|
|
var service = Plugin.HonorificService;
|
|
|
|
if (service.IsAvailable && service.DetectedApiVersion is { } version)
|
|
{
|
|
DrawStatusGlyph('●', theme.Colors.StatusSuccess);
|
|
ImGui.SameLine();
|
|
ImGui.TextUnformatted(
|
|
string.Format(
|
|
HellionStrings.Settings_Integrations_Honorific_Status_Detected,
|
|
version.Major,
|
|
version.Minor
|
|
)
|
|
);
|
|
}
|
|
else if (service.DetectedApiVersion is { } incompatibleVersion)
|
|
{
|
|
DrawStatusGlyph('⚠', theme.Colors.StatusWarning);
|
|
ImGui.SameLine();
|
|
ImGui.TextUnformatted(
|
|
string.Format(
|
|
HellionStrings.Settings_Integrations_Honorific_Status_Incompatible,
|
|
HonorificService.ExpectedApiMajor,
|
|
incompatibleVersion.Major,
|
|
incompatibleVersion.Minor
|
|
)
|
|
);
|
|
}
|
|
else
|
|
{
|
|
DrawStatusGlyph('○', theme.Colors.TextMuted);
|
|
ImGui.SameLine();
|
|
ImGui.TextUnformatted(
|
|
HellionStrings.Settings_Integrations_Honorific_Status_NotInstalled
|
|
);
|
|
}
|
|
}
|
|
|
|
private static void DrawStatusGlyph(char glyph, uint rgba)
|
|
{
|
|
using (ImRaii.PushColor(ImGuiCol.Text, ColourUtil.RgbaToAbgr(rgba)))
|
|
{
|
|
ImGui.TextUnformatted(glyph.ToString());
|
|
}
|
|
}
|
|
|
|
private void DrawComingSoonSection()
|
|
{
|
|
DrawSectionHeader(HellionStrings.Settings_Integrations_ComingSoon_SectionHeader);
|
|
ImGui.TextWrapped(HellionStrings.Settings_Integrations_ComingSoon_Intro);
|
|
ImGui.Spacing();
|
|
|
|
// Each integration cycle removes its stub here and adds a full section above.
|
|
DrawComingSoonItem(
|
|
HellionStrings.Settings_Integrations_ComingSoon_ContextMenu_Title,
|
|
HellionStrings.Settings_Integrations_ComingSoon_ContextMenu_Description
|
|
);
|
|
DrawComingSoonItem(
|
|
HellionStrings.Settings_Integrations_ComingSoon_Notifications_Title,
|
|
HellionStrings.Settings_Integrations_ComingSoon_Notifications_Description
|
|
);
|
|
DrawComingSoonItem(
|
|
HellionStrings.Settings_Integrations_ComingSoon_RPStatus_Title,
|
|
HellionStrings.Settings_Integrations_ComingSoon_RPStatus_Description
|
|
);
|
|
DrawComingSoonItem(
|
|
HellionStrings.Settings_Integrations_ComingSoon_ExtraChat_Title,
|
|
HellionStrings.Settings_Integrations_ComingSoon_ExtraChat_Description
|
|
);
|
|
DrawComingSoonItem(
|
|
HellionStrings.Settings_Integrations_ComingSoon_QuickDM_Title,
|
|
HellionStrings.Settings_Integrations_ComingSoon_QuickDM_Description
|
|
);
|
|
}
|
|
|
|
private void DrawComingSoonItem(string title, string description)
|
|
{
|
|
var theme = Plugin.ThemeRegistry.Active;
|
|
using (ImRaii.PushColor(ImGuiCol.Text, ColourUtil.RgbaToAbgr(theme.Colors.TextMuted)))
|
|
using (Plugin.FontManager.FontAwesome.Push())
|
|
{
|
|
ImGui.TextUnformatted(FontAwesomeIcon.Hourglass.ToIconString());
|
|
}
|
|
ImGui.SameLine();
|
|
ImGui.TextUnformatted(title);
|
|
using (ImRaii.PushIndent())
|
|
{
|
|
using (ImRaii.PushColor(ImGuiCol.Text, ColourUtil.RgbaToAbgr(theme.Colors.TextMuted)))
|
|
{
|
|
ImGui.TextWrapped(description);
|
|
}
|
|
}
|
|
ImGui.Spacing();
|
|
}
|
|
|
|
private void DrawGotAnIdeaSection()
|
|
{
|
|
DrawSectionHeader(HellionStrings.Settings_Integrations_GotAnIdea_SectionHeader);
|
|
ImGui.TextWrapped(HellionStrings.Settings_Integrations_GotAnIdea_Body);
|
|
ImGui.Spacing();
|
|
|
|
if (ImGui.Button(HellionStrings.Settings_Integrations_GotAnIdea_LinkLabel))
|
|
{
|
|
Plugin.PlatformUtil.OpenLink(BrandingLinks.HellionForgeDiscordInvite);
|
|
}
|
|
}
|
|
|
|
private void DrawSectionHeader(string label)
|
|
{
|
|
var theme = Plugin.ThemeRegistry.Active;
|
|
using (ImRaii.PushColor(ImGuiCol.Text, ColourUtil.RgbaToAbgr(theme.Colors.Primary)))
|
|
{
|
|
ImGui.TextUnformatted("── " + label + " ──");
|
|
}
|
|
}
|
|
}
|