From b892dca0e5b5b3ab3c519161b4b5c2ba5fd82fd0 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 25 Mar 2026 12:29:44 -0700 Subject: [PATCH] refactor: replace 60+ inline color literals with shared ui::colors constants Use kRed, kBrightGreen, kDarkGray, kLightGray from ui_colors.hpp across 8 UI files, eliminating duplicate ImVec4 color definitions throughout the UI layer. --- src/ui/auth_screen.cpp | 5 +++-- src/ui/character_create_screen.cpp | 7 ++++--- src/ui/character_screen.cpp | 7 ++++--- src/ui/game_screen.cpp | 30 +++++++++++++++--------------- src/ui/inventory_screen.cpp | 28 ++++++++++++++-------------- src/ui/realm_screen.cpp | 13 +++++++------ src/ui/spellbook_screen.cpp | 7 ++++--- src/ui/talent_screen.cpp | 13 +++++++------ 8 files changed, 58 insertions(+), 52 deletions(-) diff --git a/src/ui/auth_screen.cpp b/src/ui/auth_screen.cpp index 287023e2..710d45d5 100644 --- a/src/ui/auth_screen.cpp +++ b/src/ui/auth_screen.cpp @@ -1,4 +1,5 @@ #include "ui/auth_screen.hpp" +#include "ui/ui_colors.hpp" #include "auth/crypto.hpp" #include "core/application.hpp" #include "core/logger.hpp" @@ -393,9 +394,9 @@ void AuthScreen::render(auth::AuthHandler& authHandler) { // Connection status if (!statusMessage.empty()) { if (statusIsError) { - ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.3f, 0.3f, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_Text, ui::colors::kRed); } else { - ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.3f, 1.0f, 0.3f, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_Text, ui::colors::kBrightGreen); } ImGui::TextWrapped("%s", statusMessage.c_str()); ImGui::PopStyleColor(); diff --git a/src/ui/character_create_screen.cpp b/src/ui/character_create_screen.cpp index 9238bf7b..4a9cda9e 100644 --- a/src/ui/character_create_screen.cpp +++ b/src/ui/character_create_screen.cpp @@ -1,4 +1,5 @@ #include "ui/character_create_screen.hpp" +#include "ui/ui_colors.hpp" #include "rendering/character_preview.hpp" #include "rendering/renderer.hpp" #include "core/application.hpp" @@ -382,7 +383,7 @@ void CharacterCreateScreen::render(game::GameHandler& /*gameHandler*/) { preview_->rotate(deltaX * 0.2f); } - ImGui::TextColored(ImVec4(0.5f, 0.5f, 0.5f, 1.0f), "Drag to rotate"); + ImGui::TextColored(ui::colors::kDarkGray, "Drag to rotate"); } ImGui::EndChild(); @@ -424,7 +425,7 @@ void CharacterCreateScreen::render(game::GameHandler& /*gameHandler*/) { } } if (allianceRaceCount_ < raceCount) { - ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), "Horde:"); + ImGui::TextColored(ui::colors::kRed, "Horde:"); ImGui::SameLine(); for (int i = allianceRaceCount_; i < raceCount; ++i) { if (i > allianceRaceCount_) ImGui::SameLine(); @@ -517,7 +518,7 @@ void CharacterCreateScreen::render(game::GameHandler& /*gameHandler*/) { if (!statusMessage.empty()) { ImGui::Separator(); ImGui::Spacing(); - ImVec4 color = statusIsError ? ImVec4(1.0f, 0.3f, 0.3f, 1.0f) : ImVec4(0.3f, 1.0f, 0.3f, 1.0f); + ImVec4 color = statusIsError ? ui::colors::kRed : ui::colors::kBrightGreen; ImGui::TextColored(color, "%s", statusMessage.c_str()); } diff --git a/src/ui/character_screen.cpp b/src/ui/character_screen.cpp index 96b53dd0..67ada3f0 100644 --- a/src/ui/character_screen.cpp +++ b/src/ui/character_screen.cpp @@ -1,4 +1,5 @@ #include "ui/character_screen.hpp" +#include "ui/ui_colors.hpp" #include "rendering/character_preview.hpp" #include "rendering/renderer.hpp" #include "pipeline/asset_manager.hpp" @@ -173,7 +174,7 @@ void CharacterScreen::render(game::GameHandler& gameHandler) { // Status message if (!statusMessage.empty()) { - ImVec4 color = statusIsError ? ImVec4(1.0f, 0.3f, 0.3f, 1.0f) : ImVec4(0.3f, 1.0f, 0.3f, 1.0f); + ImVec4 color = statusIsError ? ui::colors::kRed : ui::colors::kBrightGreen; ImGui::PushStyleColor(ImGuiCol_Text, color); ImGui::TextWrapped("%s", statusMessage.c_str()); ImGui::PopStyleColor(); @@ -462,7 +463,7 @@ void CharacterScreen::render(game::GameHandler& gameHandler) { if (ImGui::BeginPopupModal("DeleteConfirm2", nullptr, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove)) { const auto& ch = characters[selectedCharacterIndex]; - ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.3f, 0.3f, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_Text, ui::colors::kRed); ImGui::Text("THIS CANNOT BE UNDONE!"); ImGui::PopStyleColor(); ImGui::Spacing(); @@ -518,7 +519,7 @@ ImVec4 CharacterScreen::getFactionColor(game::Race race) const { race == game::Race::TAUREN || race == game::Race::TROLL || race == game::Race::BLOOD_ELF) { - return ImVec4(1.0f, 0.3f, 0.3f, 1.0f); + return ui::colors::kRed; } return ImVec4(1.0f, 1.0f, 1.0f, 1.0f); diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index f68fe23f..cef4ae06 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -1460,9 +1460,9 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) { } if (slotName[0]) { if (!info->subclassName.empty()) - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s %s", slotName, info->subclassName.c_str()); + ImGui::TextColored(ui::colors::kLightGray, "%s %s", slotName, info->subclassName.c_str()); else - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s", slotName); + ImGui::TextColored(ui::colors::kLightGray, "%s", slotName); } } auto isWeaponInventoryType = [](uint32_t invType) { @@ -4472,7 +4472,7 @@ void GameScreen::renderTargetFrame(game::GameHandler& gameHandler) { // Level color matches the hostility/difficulty color ImVec4 levelColor = hostileColor; if (target->getType() == game::ObjectType::PLAYER) { - levelColor = ImVec4(0.7f, 0.7f, 0.7f, 1.0f); + levelColor = ui::colors::kLightGray; } if (unit->getLevel() == 0) ImGui::TextColored(levelColor, "Lv ??"); @@ -4895,7 +4895,7 @@ void GameScreen::renderTargetFrame(game::GameHandler& gameHandler) { char durBuf[32]; if (seconds < 60) snprintf(durBuf, sizeof(durBuf), "Remaining: %ds", seconds); else snprintf(durBuf, sizeof(durBuf), "Remaining: %dm %ds", seconds / 60, seconds % 60); - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s", durBuf); + ImGui::TextColored(ui::colors::kLightGray, "%s", durBuf); } ImGui::EndTooltip(); } @@ -5127,7 +5127,7 @@ void GameScreen::renderTargetFrame(game::GameHandler& gameHandler) { char db[32]; if (s < 60) snprintf(db, sizeof(db), "Remaining: %ds", s); else snprintf(db, sizeof(db), "Remaining: %dm %ds", s / 60, s % 60); - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s", db); + ImGui::TextColored(ui::colors::kLightGray, "%s", db); } ImGui::EndTooltip(); } @@ -5598,7 +5598,7 @@ void GameScreen::renderFocusFrame(game::GameHandler& gameHandler) { char db[32]; if (s < 60) snprintf(db, sizeof(db), "Remaining: %ds", s); else snprintf(db, sizeof(db), "Remaining: %dm %ds", s / 60, s % 60); - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s", db); + ImGui::TextColored(ui::colors::kLightGray, "%s", db); } ImGui::EndTooltip(); } @@ -8373,7 +8373,7 @@ ImVec4 GameScreen::getChatTypeColor(game::ChatType type) const { case game::ChatType::DND: return ImVec4(0.85f, 0.85f, 0.85f, 0.8f); // Light gray default: - return ImVec4(0.7f, 0.7f, 0.7f, 1.0f); // Gray + return ui::colors::kLightGray; // Gray } } @@ -13568,7 +13568,7 @@ void GameScreen::renderBossFrames(game::GameHandler& gameHandler) { char db[32]; if (s < 60) snprintf(db, sizeof(db), "Remaining: %ds", s); else snprintf(db, sizeof(db), "Remaining: %dm %ds", s / 60, s % 60); - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s", db); + ImGui::TextColored(ui::colors::kLightGray, "%s", db); } ImGui::EndTooltip(); } @@ -15688,7 +15688,7 @@ void GameScreen::renderBuffBar(game::GameHandler& gameHandler) { char durBuf[32]; if (seconds < 60) snprintf(durBuf, sizeof(durBuf), "Remaining: %ds", seconds); else snprintf(durBuf, sizeof(durBuf), "Remaining: %dm %ds", seconds / 60, seconds % 60); - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s", durBuf); + ImGui::TextColored(ui::colors::kLightGray, "%s", durBuf); } ImGui::EndTooltip(); } @@ -16253,7 +16253,7 @@ void GameScreen::renderQuestDetailsWindow(game::GameHandler& gameHandler) { } if (quest.suggestedPlayers > 1) { - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), + ImGui::TextColored(ui::colors::kLightGray, "Suggested players: %u", quest.suggestedPlayers); } @@ -16696,7 +16696,7 @@ void GameScreen::renderVendorWindow(game::GameHandler& gameHandler) { } ImGui::Separator(); - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "Right-click bag items to sell"); + ImGui::TextColored(ui::colors::kLightGray, "Right-click bag items to sell"); // Count grey (POOR quality) sellable items across backpack and bags const auto& inv = gameHandler.getInventory(); @@ -17163,7 +17163,7 @@ void GameScreen::renderTrainerWindow(game::GameHandler& gameHandler) { } ImGui::TextDisabled("Status: %s", statusLabel); if (spell->reqLevel > 0) { - ImVec4 lvlColor = levelMet ? ImVec4(0.7f, 0.7f, 0.7f, 1.0f) : kColorRed; + ImVec4 lvlColor = levelMet ? ui::colors::kLightGray : kColorRed; ImGui::TextColored(lvlColor, "Required Level: %u", spell->reqLevel); } if (spell->reqSkill > 0) ImGui::Text("Required Skill: %u (value %u)", spell->reqSkill, spell->reqSkillValue); @@ -17813,7 +17813,7 @@ void GameScreen::renderTaxiWindow(game::GameHandler& gameHandler) { } if (destCount == 0) { - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "No destinations available."); + ImGui::TextColored(ui::colors::kLightGray, "No destinations available."); } ImGui::Spacing(); @@ -21792,7 +21792,7 @@ void GameScreen::renderMailComposeWindow(game::GameHandler& gameHandler) { if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); ImGui::TextColored(qualColor, "%s", att.item.name.c_str()); - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "Click to remove"); + ImGui::TextColored(ui::colors::kLightGray, "Click to remove"); ImGui::EndTooltip(); } } else { @@ -24623,7 +24623,7 @@ void GameScreen::renderCombatLog(game::GameHandler& gameHandler) { break; default: snprintf(desc, sizeof(desc), "Combat event (type %d, amount %d)", static_cast(e.type), e.amount); - color = ImVec4(0.7f, 0.7f, 0.7f, 1.0f); + color = ui::colors::kLightGray; break; } diff --git a/src/ui/inventory_screen.cpp b/src/ui/inventory_screen.cpp index 136395e8..342d223f 100644 --- a/src/ui/inventory_screen.cpp +++ b/src/ui/inventory_screen.cpp @@ -1572,9 +1572,9 @@ void InventoryScreen::renderReputationPanel(game::GameHandler& gameHandler) { ImGui::TextColored(tier.color, "[%s]", tier.name); ImGui::SameLine(90.0f); if (atWar) { - ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), "%s", displayName); + ImGui::TextColored(ui::colors::kRed, "%s", displayName); ImGui::SameLine(); - ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), "(At War)"); + ImGui::TextColored(ui::colors::kRed, "(At War)"); } else if (isWatched) { ImGui::TextColored(ImVec4(1.0f, 0.9f, 0.5f, 1.0f), "%s", displayName); ImGui::SameLine(); @@ -2265,7 +2265,7 @@ void InventoryScreen::renderItemSlot(game::Inventory& inventory, const game::Ite if (label && ImGui::IsItemHovered()) { ImGui::BeginTooltip(); - ImGui::TextColored(ImVec4(0.5f, 0.5f, 0.5f, 1.0f), "%s", label); + ImGui::TextColored(ui::colors::kDarkGray, "%s", label); ImGui::TextColored(ImVec4(0.4f, 0.4f, 0.4f, 1.0f), "Empty"); ImGui::EndTooltip(); } @@ -2589,7 +2589,7 @@ void InventoryScreen::renderItemTooltip(const game::ItemDef& item, const game::I } ImGui::TextColored(ImVec4(0.8f, 0.9f, 1.0f, 1.0f), "Home: %s", homeLocation.c_str()); } else { - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "Home: not set"); + ImGui::TextColored(ui::colors::kLightGray, "Home: not set"); } ImGui::TextDisabled("Use: Teleport home"); } @@ -2627,9 +2627,9 @@ void InventoryScreen::renderItemTooltip(const game::ItemDef& item, const game::I } if (slotName[0]) { if (!item.subclassName.empty()) { - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s %s", slotName, item.subclassName.c_str()); + ImGui::TextColored(ui::colors::kLightGray, "%s %s", slotName, item.subclassName.c_str()); } else { - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s", slotName); + ImGui::TextColored(ui::colors::kLightGray, "%s", slotName); } } @@ -2671,7 +2671,7 @@ void InventoryScreen::renderItemTooltip(const game::ItemDef& item, const game::I ImGui::Text("%.0f - %.0f Damage", item.damageMin, item.damageMax); ImGui::SameLine(160.0f); ImGui::TextDisabled("Speed %.2f", speed); - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "(%.1f damage per second)", dps); + ImGui::TextColored(ui::colors::kLightGray, "(%.1f damage per second)", dps); } // Armor appears before stat bonuses — matches WoW tooltip order @@ -3104,8 +3104,8 @@ void InventoryScreen::renderItemTooltip(const game::ItemDef& item, const game::I else std::snprintf(ilvlBuf, sizeof(ilvlBuf), "Item Level: %u (=)", item.itemLevel); ImVec4 ilvlColor = (diff > 0.0f) ? ImVec4(0.0f, 1.0f, 0.0f, 1.0f) - : (diff < 0.0f) ? ImVec4(1.0f, 0.3f, 0.3f, 1.0f) - : ImVec4(0.7f, 0.7f, 0.7f, 1.0f); + : (diff < 0.0f) ? ui::colors::kRed + : ui::colors::kLightGray; ImGui::TextColored(ilvlColor, "%s", ilvlBuf); } @@ -3119,10 +3119,10 @@ void InventoryScreen::renderItemTooltip(const game::ItemDef& item, const game::I ImGui::TextColored(ImVec4(0.0f, 1.0f, 0.0f, 1.0f), "%s", buf); } else if (diff < 0.0f) { std::snprintf(buf, sizeof(buf), "%s: %.0f (▼%.0f)", label, newVal, -diff); - ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), "%s", buf); + ImGui::TextColored(ui::colors::kRed, "%s", buf); } else { std::snprintf(buf, sizeof(buf), "%s: %.0f (=)", label, newVal); - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s", buf); + ImGui::TextColored(ui::colors::kLightGray, "%s", buf); } }; @@ -3299,9 +3299,9 @@ void InventoryScreen::renderItemTooltip(const game::ItemQueryResponseData& info, } if (slotName[0]) { if (!info.subclassName.empty()) - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s %s", slotName, info.subclassName.c_str()); + ImGui::TextColored(ui::colors::kLightGray, "%s %s", slotName, info.subclassName.c_str()); else - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s", slotName); + ImGui::TextColored(ui::colors::kLightGray, "%s", slotName); } // Proficiency check for vendor/loot tooltips (ItemQueryResponseData has itemClass/subClass) @@ -3327,7 +3327,7 @@ void InventoryScreen::renderItemTooltip(const game::ItemQueryResponseData& info, ImGui::Text("%.0f - %.0f Damage", info.damageMin, info.damageMax); ImGui::SameLine(160.0f); ImGui::TextDisabled("Speed %.2f", speed); - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "(%.1f damage per second)", dps); + ImGui::TextColored(ui::colors::kLightGray, "(%.1f damage per second)", dps); } if (info.armor > 0) ImGui::Text("%d Armor", info.armor); diff --git a/src/ui/realm_screen.cpp b/src/ui/realm_screen.cpp index 589634a1..d2f8eecf 100644 --- a/src/ui/realm_screen.cpp +++ b/src/ui/realm_screen.cpp @@ -1,4 +1,5 @@ #include "ui/realm_screen.hpp" +#include "ui/ui_colors.hpp" #include namespace wowee { namespace ui { @@ -32,7 +33,7 @@ void RealmScreen::render(auth::AuthHandler& authHandler) { // Status message if (!statusMessage.empty()) { - ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.3f, 1.0f, 0.3f, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_Text, ui::colors::kBrightGreen); ImGui::TextWrapped("%s", statusMessage.c_str()); ImGui::PopStyleColor(); ImGui::Spacing(); @@ -153,9 +154,9 @@ void RealmScreen::render(auth::AuthHandler& authHandler) { ImGui::TableSetColumnIndex(4); const char* status = getRealmStatus(realm.flags); if (realm.lock) { - ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), "Locked"); + ImGui::TextColored(ui::colors::kRed, "Locked"); } else { - ImGui::TextColored(ImVec4(0.3f, 1.0f, 0.3f, 1.0f), "%s", status); + ImGui::TextColored(ui::colors::kBrightGreen, "%s", status); } } @@ -202,7 +203,7 @@ void RealmScreen::render(auth::AuthHandler& authHandler) { } ImGui::PopStyleColor(2); } else { - ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.5f, 0.5f, 0.5f, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_Button, ui::colors::kDarkGray); ImGui::Button("Realm Locked", ImVec2(200, 40)); ImGui::PopStyleColor(); } @@ -237,13 +238,13 @@ const char* RealmScreen::getRealmStatus(uint8_t flags) const { ImVec4 RealmScreen::getPopulationColor(float population) const { if (population < 0.5f) { - return ImVec4(0.3f, 1.0f, 0.3f, 1.0f); // Green - Low + return ui::colors::kBrightGreen; // Green - Low } else if (population < 1.5f) { return ImVec4(1.0f, 1.0f, 0.3f, 1.0f); // Yellow - Medium } else if (population < 2.5f) { return ImVec4(1.0f, 0.6f, 0.0f, 1.0f); // Orange - High } else { - return ImVec4(1.0f, 0.3f, 0.3f, 1.0f); // Red - Full + return ui::colors::kRed; // Red - Full } } diff --git a/src/ui/spellbook_screen.cpp b/src/ui/spellbook_screen.cpp index 3d2ceeed..e418c449 100644 --- a/src/ui/spellbook_screen.cpp +++ b/src/ui/spellbook_screen.cpp @@ -1,4 +1,5 @@ #include "ui/spellbook_screen.hpp" +#include "ui/ui_colors.hpp" #include "ui/keybinding_manager.hpp" #include "core/input.hpp" #include "core/application.hpp" @@ -585,7 +586,7 @@ void SpellbookScreen::renderSpellTooltip(const SpellInfo* info, game::GameHandle // Cooldown if active float cd = gameHandler.getSpellCooldown(info->spellId); if (cd > 0.0f) { - ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), "Cooldown: %.1fs", cd); + ImGui::TextColored(ui::colors::kRed, "Cooldown: %.1fs", cd); } // Description @@ -597,8 +598,8 @@ void SpellbookScreen::renderSpellTooltip(const SpellInfo* info, game::GameHandle // Usage hints — only shown when browsing the spellbook, not on action bar hover if (!info->isPassive() && showUsageHints) { ImGui::Spacing(); - ImGui::TextColored(ImVec4(0.3f, 1.0f, 0.3f, 1.0f), "Drag to action bar"); - ImGui::TextColored(ImVec4(0.3f, 1.0f, 0.3f, 1.0f), "Double-click to cast"); + ImGui::TextColored(ui::colors::kBrightGreen, "Drag to action bar"); + ImGui::TextColored(ui::colors::kBrightGreen, "Double-click to cast"); } ImGui::PopTextWrapPos(); diff --git a/src/ui/talent_screen.cpp b/src/ui/talent_screen.cpp index fee65757..ed29ca1f 100644 --- a/src/ui/talent_screen.cpp +++ b/src/ui/talent_screen.cpp @@ -1,4 +1,5 @@ #include "ui/talent_screen.hpp" +#include "ui/ui_colors.hpp" #include "ui/keybinding_manager.hpp" #include "core/input.hpp" #include "core/application.hpp" @@ -141,10 +142,10 @@ void TalentScreen::renderTalentTrees(game::GameHandler& gameHandler) { // Unspent points ImGui::SameLine(0, 20); if (unspent > 0) { - ImGui::TextColored(ImVec4(0.3f, 1.0f, 0.3f, 1.0f), "%u point%s available", + ImGui::TextColored(ui::colors::kBrightGreen, "%u point%s available", unspent, unspent > 1 ? "s" : ""); } else { - ImGui::TextColored(ImVec4(0.5f, 0.5f, 0.5f, 1.0f), "No points available"); + ImGui::TextColored(ui::colors::kDarkGray, "No points available"); } ImGui::Separator(); @@ -552,7 +553,7 @@ void TalentScreen::renderTalent(game::GameHandler& gameHandler, auto tooltipIt = spellTooltips.find(talent.rankSpells[currentRank]); if (tooltipIt != spellTooltips.end() && !tooltipIt->second.empty()) { ImGui::Spacing(); - ImGui::TextColored(ImVec4(0.3f, 1.0f, 0.3f, 1.0f), "Next Rank:"); + ImGui::TextColored(ui::colors::kBrightGreen, "Next Rank:"); ImGui::TextWrapped("%s", tooltipIt->second.c_str()); } } @@ -581,7 +582,7 @@ void TalentScreen::renderTalent(game::GameHandler& gameHandler, uint32_t requiredPoints = talent.row * 5; if (pointsInTree < requiredPoints) { ImGui::Spacing(); - ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), + ImGui::TextColored(ui::colors::kRed, "Requires %u points in this tree (%u/%u)", requiredPoints, pointsInTree, requiredPoints); } @@ -590,7 +591,7 @@ void TalentScreen::renderTalent(game::GameHandler& gameHandler, // Action hint if (canLearn && prereqsMet) { ImGui::Spacing(); - ImGui::TextColored(ImVec4(0.3f, 1.0f, 0.3f, 1.0f), "Click to learn"); + ImGui::TextColored(ui::colors::kBrightGreen, "Click to learn"); } ImGui::PopTextWrapPos(); @@ -748,7 +749,7 @@ void TalentScreen::renderGlyphs(game::GameHandler& gameHandler) { if (!name.empty()) { ImGui::TextColored(ImVec4(0.9f, 0.9f, 0.9f, 1.0f), "%s", name.c_str()); } else { - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "Glyph #%u", static_cast(glyphId)); + ImGui::TextColored(ui::colors::kLightGray, "Glyph #%u", static_cast(glyphId)); } };