mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-25 08:30:13 +00:00
feat: show Elite/Rare/Boss classification badge in target frame
Reads creature rank (0=Normal, 1=Elite, 2=RareElite, 3=Boss, 4=Rare) from the existing creatureInfoCache populated by creature query responses. Shows a colored badge next to the level: gold for Elite, purple for Rare Elite, red for Boss, cyan for Rare — each with a tooltip. Adds getCreatureRank() accessor to GameHandler for UI use.
This commit is contained in:
parent
a03ee33f8c
commit
8cb0f1d0ef
2 changed files with 27 additions and 0 deletions
|
|
@ -548,6 +548,12 @@ public:
|
|||
}
|
||||
std::string getCachedPlayerName(uint64_t guid) const;
|
||||
std::string getCachedCreatureName(uint32_t entry) const;
|
||||
// Returns the creature rank (0=Normal,1=Elite,2=RareElite,3=Boss,4=Rare)
|
||||
// or -1 if not cached yet
|
||||
int getCreatureRank(uint32_t entry) const {
|
||||
auto it = creatureInfoCache.find(entry);
|
||||
return (it != creatureInfoCache.end()) ? static_cast<int>(it->second.rank) : -1;
|
||||
}
|
||||
|
||||
// ---- Phase 2: Combat ----
|
||||
void startAutoAttack(uint64_t targetGuid);
|
||||
|
|
|
|||
|
|
@ -3389,6 +3389,27 @@ void GameScreen::renderTargetFrame(game::GameHandler& gameHandler) {
|
|||
levelColor = ImVec4(0.7f, 0.7f, 0.7f, 1.0f);
|
||||
}
|
||||
ImGui::TextColored(levelColor, "Lv %u", unit->getLevel());
|
||||
// Classification badge: Elite / Rare Elite / Boss / Rare
|
||||
if (target->getType() == game::ObjectType::UNIT) {
|
||||
int rank = gameHandler.getCreatureRank(unit->getEntry());
|
||||
if (rank == 1) {
|
||||
ImGui::SameLine(0, 4);
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.8f, 0.2f, 1.0f), "[Elite]");
|
||||
if (ImGui::IsItemHovered()) ImGui::SetTooltip("Elite — requires a group");
|
||||
} else if (rank == 2) {
|
||||
ImGui::SameLine(0, 4);
|
||||
ImGui::TextColored(ImVec4(0.8f, 0.4f, 1.0f, 1.0f), "[Rare Elite]");
|
||||
if (ImGui::IsItemHovered()) ImGui::SetTooltip("Rare Elite — uncommon spawn, group recommended");
|
||||
} else if (rank == 3) {
|
||||
ImGui::SameLine(0, 4);
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), "[Boss]");
|
||||
if (ImGui::IsItemHovered()) ImGui::SetTooltip("Boss — raid / dungeon boss");
|
||||
} else if (rank == 4) {
|
||||
ImGui::SameLine(0, 4);
|
||||
ImGui::TextColored(ImVec4(0.5f, 0.9f, 1.0f, 1.0f), "[Rare]");
|
||||
if (ImGui::IsItemHovered()) ImGui::SetTooltip("Rare — uncommon spawn with better loot");
|
||||
}
|
||||
}
|
||||
if (confirmedCombatWithTarget) {
|
||||
float cPulse = 0.75f + 0.25f * std::sin(static_cast<float>(ImGui::GetTime()) * 4.0f);
|
||||
ImGui::SameLine();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue