diff --git a/HellionChat/Resources/HellionStrings.Designer.cs b/HellionChat/Resources/HellionStrings.Designer.cs index fdcde43..547a5b5 100644 --- a/HellionChat/Resources/HellionStrings.Designer.cs +++ b/HellionChat/Resources/HellionStrings.Designer.cs @@ -383,4 +383,7 @@ internal class HellionStrings internal static string Settings_Integrations_GotAnIdea_SectionHeader => Get(nameof(Settings_Integrations_GotAnIdea_SectionHeader)); internal static string Settings_Integrations_GotAnIdea_Body => Get(nameof(Settings_Integrations_GotAnIdea_Body)); internal static string Settings_Integrations_GotAnIdea_LinkLabel => Get(nameof(Settings_Integrations_GotAnIdea_LinkLabel)); + + // Hellion Chat — v1.3.0 Honorific title slot tooltip + internal static string ChatHeader_HonorificTitle_Tooltip => Get(nameof(ChatHeader_HonorificTitle_Tooltip)); } diff --git a/HellionChat/Resources/HellionStrings.de.resx b/HellionChat/Resources/HellionStrings.de.resx index 88b978a..031615b 100644 --- a/HellionChat/Resources/HellionStrings.de.resx +++ b/HellionChat/Resources/HellionStrings.de.resx @@ -866,4 +866,7 @@ discord.gg/X9V7Kcv5gR + + Custom-Titel von Honorific + diff --git a/HellionChat/Resources/HellionStrings.resx b/HellionChat/Resources/HellionStrings.resx index ea54085..cb9857c 100644 --- a/HellionChat/Resources/HellionStrings.resx +++ b/HellionChat/Resources/HellionStrings.resx @@ -866,4 +866,7 @@ discord.gg/X9V7Kcv5gR + + Honorific custom title + diff --git a/HellionChat/Ui/ChatLogWindow.cs b/HellionChat/Ui/ChatLogWindow.cs index 8f4a4fa..95cf343 100644 --- a/HellionChat/Ui/ChatLogWindow.cs +++ b/HellionChat/Ui/ChatLogWindow.cs @@ -1727,13 +1727,22 @@ public sealed class ChatLogWindow : Window return; } - // Truncate with ellipsis when the title would overlap the pop-out - // button. We reserve the icon width plus a small gap so the title - // never touches the button edge — readability over information density. - const float gapPx = 8f; + // Reserve space for the crown icon plus a small gap before the title, + // then the title itself, then the gap-to-pop-out-button. We measure the + // crown width inside the FontAwesome font push because FontAwesome + // glyphs render in a different font than the regular ImGui text. + const float gapAfterCrown = 4f; + const float gapBeforeButton = 8f; var avail = ImGui.GetContentRegionAvail().X; var iconWidth = ImGui.GetFrameHeight(); - var maxTitleWidth = avail - iconWidth - gapPx; + + float crownWidth; + using (Plugin.FontManager.FontAwesome.Push()) + { + crownWidth = ImGui.CalcTextSize(FontAwesomeIcon.Crown.ToIconString()).X; + } + + var maxTitleWidth = avail - iconWidth - gapBeforeButton - crownWidth - gapAfterCrown; if (maxTitleWidth <= 0) { return; @@ -1742,14 +1751,32 @@ public sealed class ChatLogWindow : Window var rendered = "«" + title!.Title + "»"; rendered = TruncateToWidth(rendered, maxTitleWidth); - var color = title.Color is { } c + var titleColor = title.Color is { } c ? new Vector4(c.X, c.Y, c.Z, 1f) : ImGui.GetStyle().Colors[(int)ImGuiCol.Text]; - using (ImRaii.PushColor(ImGuiCol.Text, color)) + var theme = Plugin.ThemeRegistry.Active; + + // Group so the tooltip's IsItemHovered check fires for hover anywhere + // on the crown-plus-title pair, not just one of the two. + ImGui.BeginGroup(); + using (ImRaii.PushColor(ImGuiCol.Text, ColourUtil.RgbaToAbgr(theme.Colors.TextMuted))) + using (Plugin.FontManager.FontAwesome.Push()) + { + ImGui.TextUnformatted(FontAwesomeIcon.Crown.ToIconString()); + } + ImGui.SameLine(0f, gapAfterCrown); + using (ImRaii.PushColor(ImGuiCol.Text, titleColor)) { ImGui.TextUnformatted(rendered); } + ImGui.EndGroup(); + + if (ImGui.IsItemHovered()) + { + ImGui.SetTooltip(HellionStrings.ChatHeader_HonorificTitle_Tooltip); + } + ImGui.SameLine(); }