Add nameplate scale setting to Interface settings tab

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'.
This commit is contained in:
Kelsi 2026-03-11 22:49:54 -07:00
parent d31c483944
commit 6e7a32ec7f
2 changed files with 14 additions and 2 deletions

View file

@ -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;

View file

@ -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") {