From 6e7a32ec7f9e9f967433f4d5620322ca674a5ebe Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 22:49:54 -0700 Subject: [PATCH] Add nameplate scale setting to Interface settings tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a 0.5x-2.0x scale slider under Nameplates in the Interface settings tab. The scale multiplies the base 80×8px nameplate health bar dimensions. Setting is persisted to settings.cfg as 'nameplate_scale'. --- include/ui/game_screen.hpp | 1 + src/ui/game_screen.cpp | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/ui/game_screen.hpp b/include/ui/game_screen.hpp index 18e78f24..3dadb2c6 100644 --- a/include/ui/game_screen.hpp +++ b/include/ui/game_screen.hpp @@ -65,6 +65,7 @@ private: bool showChatWindow = true; bool showMinimap_ = true; // M key toggles minimap bool showNameplates_ = true; // V key toggles nameplates + float nameplateScale_ = 1.0f; // Scale multiplier for nameplate bar dimensions bool showPlayerInfo = false; bool showSocialFrame_ = false; // O key toggles social/friends list bool showGuildRoster_ = false; diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 852a5d00..fa075aef 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -5484,8 +5484,8 @@ void GameScreen::renderNameplates(game::GameHandler& gameHandler) { : IM_COL32(20, 20, 20, A(180)); // Bar geometry - constexpr float barW = 80.0f; - constexpr float barH = 8.0f; + const float barW = 80.0f * nameplateScale_; + const float barH = 8.0f * nameplateScale_; const float barX = sx - barW * 0.5f; float healthPct = std::clamp( @@ -9562,6 +9562,14 @@ void GameScreen::renderSettingsWindow() { } } + ImGui::Spacing(); + ImGui::SeparatorText("Nameplates"); + ImGui::Spacing(); + ImGui::SetNextItemWidth(200.0f); + if (ImGui::SliderFloat("Nameplate Scale", &nameplateScale_, 0.5f, 2.0f, "%.2fx")) { + saveSettings(); + } + ImGui::Spacing(); ImGui::SeparatorText("Network"); ImGui::Spacing(); @@ -10995,6 +11003,7 @@ void GameScreen::saveSettings() { out << "show_latency_meter=" << (pendingShowLatencyMeter ? 1 : 0) << "\n"; out << "separate_bags=" << (pendingSeparateBags ? 1 : 0) << "\n"; out << "action_bar_scale=" << pendingActionBarScale << "\n"; + out << "nameplate_scale=" << nameplateScale_ << "\n"; out << "show_action_bar2=" << (pendingShowActionBar2 ? 1 : 0) << "\n"; out << "action_bar2_offset_x=" << pendingActionBar2OffsetX << "\n"; out << "action_bar2_offset_y=" << pendingActionBar2OffsetY << "\n"; @@ -11103,6 +11112,8 @@ void GameScreen::loadSettings() { inventoryScreen.setSeparateBags(pendingSeparateBags); } else if (key == "action_bar_scale") { pendingActionBarScale = std::clamp(std::stof(val), 0.5f, 1.5f); + } else if (key == "nameplate_scale") { + nameplateScale_ = std::clamp(std::stof(val), 0.5f, 2.0f); } else if (key == "show_action_bar2") { pendingShowActionBar2 = (std::stoi(val) != 0); } else if (key == "action_bar2_offset_x") {