From c0744776679d5e2b9737773cdb85ddc4a8803587 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 14:42:47 +0000 Subject: [PATCH] Centre the leader crown on name tags; widen default tag ranges - The party leader's crown is now centred on the capital letters of the name instead of on the font's line box, which includes room for accents and descenders and left the crown sitting low. - Name tags now start fading at 2000 units (was 3000) and are invisible from 8000 units (was 5000), for both strangers and party members. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_018fvQxPvkxb6UCNKSi6tjgx --- Code/client/Services/Generic/NameTagService.cpp | 8 ++++++-- Code/client/Services/NameTagService.h | 8 ++++---- Code/skyrim_ui/src/app/services/setting.service.ts | 8 ++++---- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Code/client/Services/Generic/NameTagService.cpp b/Code/client/Services/Generic/NameTagService.cpp index 170021f5e..bf7cc7e3c 100644 --- a/Code/client/Services/Generic/NameTagService.cpp +++ b/Code/client/Services/Generic/NameTagService.cpp @@ -316,8 +316,12 @@ void NameTagService::OnDraw() noexcept if (isLeader) { - // Same icon as the party widget, a square crownWidth wide, centred on the text. - const ImVec2 origin(contentPos.x, contentPos.y + (textSize.y - crownWidth) * 0.5f); + // Same icon as the party widget, a square crownWidth wide. The line height includes room for + // accents and descenders, so centre the crown on the capital letters instead of on the line. + float textCenterY = textSize.y * 0.5f; + if (const ImFontGlyph* pCapital = font->FindGlyph('H')) + textCenterY = (pCapital->Y0 + pCapital->Y1) * 0.5f * (fontSize / font->FontSize); + const ImVec2 origin(contentPos.x, contentPos.y + textCenterY - crownWidth * 0.5f); DrawPartyCrown(drawList, ImVec2(origin.x + 1.f, origin.y + 1.f), crownWidth, shadowColor); DrawPartyCrown(drawList, origin, crownWidth, ColorWithAlpha(ImVec4(0.95f, 0.95f, 0.95f, 1.f), alpha)); } diff --git a/Code/client/Services/NameTagService.h b/Code/client/Services/NameTagService.h index 937eea85b..cb463f342 100644 --- a/Code/client/Services/NameTagService.h +++ b/Code/client/Services/NameTagService.h @@ -35,10 +35,10 @@ struct NameTagService Filter NameTags = Filter::kParty; Filter Backdrop = Filter::kParty; float FontSize = 16.f; - float NameFadeStart = 3000.f; - float NameInvisible = 5000.f; - float PartyFadeStart = 3000.f; - float PartyInvisible = 5000.f; + float NameFadeStart = 2000.f; + float NameInvisible = 8000.f; + float PartyFadeStart = 2000.f; + float PartyInvisible = 8000.f; // Drawn in italics instead of the name of players whose name is hidden. String StrangerLabel = "Stranger"; // Players whose real name may be shown. The UI decides this from the diff --git a/Code/skyrim_ui/src/app/services/setting.service.ts b/Code/skyrim_ui/src/app/services/setting.service.ts index e3ab783bc..27ea6f9c2 100644 --- a/Code/skyrim_ui/src/app/services/setting.service.ts +++ b/Code/skyrim_ui/src/app/services/setting.service.ts @@ -209,22 +209,22 @@ export class SettingService { nameFadeStart: new SliderSetting( this.storeService, 'playerUi_nameFadeStart', - 3000, + 2000, ), nameInvisible: new SliderSetting( this.storeService, 'playerUi_nameInvisible', - 5000, + 8000, ), partyFadeStart: new SliderSetting( this.storeService, 'playerUi_partyFadeStart', - 3000, + 2000, ), partyInvisible: new SliderSetting( this.storeService, 'playerUi_partyInvisible', - 5000, + 8000, ), };