mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 08:03:50 +00:00
refactor: add kCastGreen/kQueueGreen constants, remove dead code
Add kCastGreen (interruptible cast bar, 5 uses) and kQueueGreen (queue status / talent met, 7 uses across game_screen + talent_screen). Remove commented-out renderQuestMarkers call (replaced by 3D billboards).
This commit is contained in:
parent
53a4377ed7
commit
fb3bfe42c9
3 changed files with 16 additions and 13 deletions
|
|
@ -42,6 +42,10 @@ namespace colors {
|
||||||
constexpr ImVec4 kLowHealthRed = {0.8f, 0.2f, 0.2f, 1.0f};
|
constexpr ImVec4 kLowHealthRed = {0.8f, 0.2f, 0.2f, 1.0f};
|
||||||
constexpr ImVec4 kDangerRed = {0.7f, 0.2f, 0.2f, 1.0f};
|
constexpr ImVec4 kDangerRed = {0.7f, 0.2f, 0.2f, 1.0f};
|
||||||
|
|
||||||
|
// Cast bar / status colors
|
||||||
|
constexpr ImVec4 kCastGreen = {0.2f, 0.75f, 0.2f, 1.0f};
|
||||||
|
constexpr ImVec4 kQueueGreen = {0.3f, 0.9f, 0.3f, 1.0f};
|
||||||
|
|
||||||
// Button styling colors (accept/decline patterns)
|
// Button styling colors (accept/decline patterns)
|
||||||
constexpr ImVec4 kBtnGreen = {0.15f, 0.5f, 0.15f, 1.0f};
|
constexpr ImVec4 kBtnGreen = {0.15f, 0.5f, 0.15f, 1.0f};
|
||||||
constexpr ImVec4 kBtnGreenHover = {0.2f, 0.7f, 0.2f, 1.0f}; // == kFriendlyGreen
|
constexpr ImVec4 kBtnGreenHover = {0.2f, 0.7f, 0.2f, 1.0f}; // == kFriendlyGreen
|
||||||
|
|
|
||||||
|
|
@ -723,7 +723,6 @@ void GameScreen::render(game::GameHandler& gameHandler) {
|
||||||
renderBookWindow(gameHandler);
|
renderBookWindow(gameHandler);
|
||||||
renderThreatWindow(gameHandler);
|
renderThreatWindow(gameHandler);
|
||||||
renderBgScoreboard(gameHandler);
|
renderBgScoreboard(gameHandler);
|
||||||
// renderQuestMarkers(gameHandler); // Disabled - using 3D billboard markers now
|
|
||||||
if (showMinimap_) {
|
if (showMinimap_) {
|
||||||
renderMinimapMarkers(gameHandler);
|
renderMinimapMarkers(gameHandler);
|
||||||
}
|
}
|
||||||
|
|
@ -4533,7 +4532,7 @@ void GameScreen::renderTargetFrame(game::GameHandler& gameHandler) {
|
||||||
else
|
else
|
||||||
castBarColor = ImVec4(1.0f * pulse, 0.1f * pulse, 0.1f * pulse, 1.0f); // red pulse
|
castBarColor = ImVec4(1.0f * pulse, 0.1f * pulse, 0.1f * pulse, 1.0f); // red pulse
|
||||||
} else {
|
} else {
|
||||||
castBarColor = interruptible ? ImVec4(0.2f, 0.75f, 0.2f, 1.0f) // green = can interrupt
|
castBarColor = interruptible ? colors::kCastGreen // green = can interrupt
|
||||||
: ImVec4(0.85f, 0.15f, 0.15f, 1.0f); // red = uninterruptible
|
: ImVec4(0.85f, 0.15f, 0.15f, 1.0f); // red = uninterruptible
|
||||||
}
|
}
|
||||||
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, castBarColor);
|
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, castBarColor);
|
||||||
|
|
@ -4600,7 +4599,7 @@ void GameScreen::renderTargetFrame(game::GameHandler& gameHandler) {
|
||||||
uint32_t totMaxHp = totUnit->getMaxHealth();
|
uint32_t totMaxHp = totUnit->getMaxHealth();
|
||||||
float totPct = static_cast<float>(totHp) / static_cast<float>(totMaxHp);
|
float totPct = static_cast<float>(totHp) / static_cast<float>(totMaxHp);
|
||||||
ImVec4 totBarColor =
|
ImVec4 totBarColor =
|
||||||
totPct > 0.5f ? ImVec4(0.2f, 0.75f, 0.2f, 1.0f) :
|
totPct > 0.5f ? colors::kCastGreen :
|
||||||
totPct > 0.2f ? ImVec4(0.75f, 0.75f, 0.2f, 1.0f) :
|
totPct > 0.2f ? ImVec4(0.75f, 0.75f, 0.2f, 1.0f) :
|
||||||
ImVec4(0.75f, 0.2f, 0.2f, 1.0f);
|
ImVec4(0.75f, 0.2f, 0.2f, 1.0f);
|
||||||
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, totBarColor);
|
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, totBarColor);
|
||||||
|
|
@ -4906,7 +4905,7 @@ void GameScreen::renderTargetFrame(game::GameHandler& gameHandler) {
|
||||||
: ImVec4(1.0f * pulse, 0.1f * pulse, 0.1f * pulse, 1.0f);
|
: ImVec4(1.0f * pulse, 0.1f * pulse, 0.1f * pulse, 1.0f);
|
||||||
} else {
|
} else {
|
||||||
tcColor = totCs->interruptible
|
tcColor = totCs->interruptible
|
||||||
? ImVec4(0.2f, 0.75f, 0.2f, 1.0f)
|
? colors::kCastGreen
|
||||||
: ImVec4(0.85f, 0.15f, 0.15f, 1.0f);
|
: ImVec4(0.85f, 0.15f, 0.15f, 1.0f);
|
||||||
}
|
}
|
||||||
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, tcColor);
|
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, tcColor);
|
||||||
|
|
@ -5538,7 +5537,7 @@ void GameScreen::renderFocusFrame(game::GameHandler& gameHandler) {
|
||||||
float fofPct = static_cast<float>(fofUnit->getHealth()) /
|
float fofPct = static_cast<float>(fofUnit->getHealth()) /
|
||||||
static_cast<float>(fofUnit->getMaxHealth());
|
static_cast<float>(fofUnit->getMaxHealth());
|
||||||
ImVec4 fofBarColor =
|
ImVec4 fofBarColor =
|
||||||
fofPct > 0.5f ? ImVec4(0.2f, 0.75f, 0.2f, 1.0f) :
|
fofPct > 0.5f ? colors::kCastGreen :
|
||||||
fofPct > 0.2f ? ImVec4(0.75f, 0.75f, 0.2f, 1.0f) :
|
fofPct > 0.2f ? ImVec4(0.75f, 0.75f, 0.2f, 1.0f) :
|
||||||
ImVec4(0.75f, 0.2f, 0.2f, 1.0f);
|
ImVec4(0.75f, 0.2f, 0.2f, 1.0f);
|
||||||
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, fofBarColor);
|
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, fofBarColor);
|
||||||
|
|
@ -13289,7 +13288,7 @@ void GameScreen::renderBossFrames(game::GameHandler& gameHandler) {
|
||||||
: ImVec4(1.0f * pulse, 0.1f * pulse, 0.1f * pulse, 1.0f);
|
: ImVec4(1.0f * pulse, 0.1f * pulse, 0.1f * pulse, 1.0f);
|
||||||
} else {
|
} else {
|
||||||
bcastColor = cs->interruptible
|
bcastColor = cs->interruptible
|
||||||
? ImVec4(0.2f, 0.75f, 0.2f, 1.0f)
|
? colors::kCastGreen
|
||||||
: ImVec4(0.9f, 0.15f, 0.15f, 1.0f);
|
: ImVec4(0.9f, 0.15f, 0.15f, 1.0f);
|
||||||
}
|
}
|
||||||
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, bcastColor);
|
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, bcastColor);
|
||||||
|
|
@ -16956,7 +16955,7 @@ void GameScreen::renderTrainerWindow(game::GameHandler& gameHandler) {
|
||||||
const char* statusLabel;
|
const char* statusLabel;
|
||||||
// WotLK trainer states: 0=available, 1=unavailable, 2=known
|
// WotLK trainer states: 0=available, 1=unavailable, 2=known
|
||||||
if (effectiveState == 2 || alreadyKnown) {
|
if (effectiveState == 2 || alreadyKnown) {
|
||||||
color = ImVec4(0.3f, 0.9f, 0.3f, 1.0f);
|
color = colors::kQueueGreen;
|
||||||
statusLabel = "Known";
|
statusLabel = "Known";
|
||||||
} else if (effectiveState == 0) {
|
} else if (effectiveState == 0) {
|
||||||
color = ui::colors::kWhite;
|
color = ui::colors::kWhite;
|
||||||
|
|
@ -17018,7 +17017,7 @@ void GameScreen::renderTrainerWindow(game::GameHandler& gameHandler) {
|
||||||
if (node == 0) return;
|
if (node == 0) return;
|
||||||
bool met = isKnown(node);
|
bool met = isKnown(node);
|
||||||
const std::string& pname = gameHandler.getSpellName(node);
|
const std::string& pname = gameHandler.getSpellName(node);
|
||||||
ImVec4 pcolor = met ? ImVec4(0.3f, 0.9f, 0.3f, 1.0f) : kColorRed;
|
ImVec4 pcolor = met ? colors::kQueueGreen : kColorRed;
|
||||||
if (!pname.empty())
|
if (!pname.empty())
|
||||||
ImGui::TextColored(pcolor, "Requires: %s%s", pname.c_str(), met ? " (known)" : "");
|
ImGui::TextColored(pcolor, "Requires: %s%s", pname.c_str(), met ? " (known)" : "");
|
||||||
else
|
else
|
||||||
|
|
@ -23607,10 +23606,10 @@ void GameScreen::renderDungeonFinderWindow(game::GameHandler& gameHandler) {
|
||||||
int qSec = static_cast<int>((qMs % 60000) / 1000);
|
int qSec = static_cast<int>((qMs % 60000) / 1000);
|
||||||
std::string dName = gameHandler.getCurrentLfgDungeonName();
|
std::string dName = gameHandler.getCurrentLfgDungeonName();
|
||||||
if (!dName.empty())
|
if (!dName.empty())
|
||||||
ImGui::TextColored(ImVec4(0.3f, 0.9f, 0.3f, 1.0f),
|
ImGui::TextColored(colors::kQueueGreen,
|
||||||
"Status: In queue for %s (%d:%02d)", dName.c_str(), qMin, qSec);
|
"Status: In queue for %s (%d:%02d)", dName.c_str(), qMin, qSec);
|
||||||
else
|
else
|
||||||
ImGui::TextColored(ImVec4(0.3f, 0.9f, 0.3f, 1.0f), "Status: In queue (%d:%02d)", qMin, qSec);
|
ImGui::TextColored(colors::kQueueGreen, "Status: In queue (%d:%02d)", qMin, qSec);
|
||||||
if (avgSec >= 0) {
|
if (avgSec >= 0) {
|
||||||
int aMin = avgSec / 60;
|
int aMin = avgSec / 60;
|
||||||
int aSec = avgSec % 60;
|
int aSec = avgSec % 60;
|
||||||
|
|
|
||||||
|
|
@ -522,8 +522,8 @@ void TalentScreen::renderTalent(game::GameHandler& gameHandler,
|
||||||
// Rank display
|
// Rank display
|
||||||
ImVec4 rankColor;
|
ImVec4 rankColor;
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case MAXED: rankColor = ImVec4(0.3f, 0.9f, 0.3f, 1); break;
|
case MAXED: rankColor = ui::colors::kQueueGreen; break;
|
||||||
case PARTIAL: rankColor = ImVec4(0.3f, 0.9f, 0.3f, 1); break;
|
case PARTIAL: rankColor = ui::colors::kQueueGreen; break;
|
||||||
default: rankColor = ImVec4(0.7f, 0.7f, 0.7f, 1); break;
|
default: rankColor = ImVec4(0.7f, 0.7f, 0.7f, 1); break;
|
||||||
}
|
}
|
||||||
ImGui::TextColored(rankColor, "Rank %u/%u", currentRank, talent.maxRank);
|
ImGui::TextColored(rankColor, "Rank %u/%u", currentRank, talent.maxRank);
|
||||||
|
|
@ -556,7 +556,7 @@ void TalentScreen::renderTalent(game::GameHandler& gameHandler,
|
||||||
|
|
||||||
uint8_t prereqCurrentRank = gameHandler.getTalentRank(talent.prereqTalent[i]);
|
uint8_t prereqCurrentRank = gameHandler.getTalentRank(talent.prereqTalent[i]);
|
||||||
bool met = prereqCurrentRank > talent.prereqRank[i]; // storage 1-indexed, DBC 0-indexed
|
bool met = prereqCurrentRank > talent.prereqRank[i]; // storage 1-indexed, DBC 0-indexed
|
||||||
ImVec4 pColor = met ? ImVec4(0.3f, 0.9f, 0.3f, 1.0f) : ui::colors::kRed;
|
ImVec4 pColor = met ? ui::colors::kQueueGreen : ui::colors::kRed;
|
||||||
|
|
||||||
const std::string& prereqName = gameHandler.getSpellName(prereq->rankSpells[0]);
|
const std::string& prereqName = gameHandler.getSpellName(prereq->rankSpells[0]);
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue