mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Add threat list window showing live aggro data for current target
Store SMSG_THREAT_UPDATE/SMSG_HIGHEST_THREAT_UPDATE in a per-unit map (sorted descending by threat) and clear on SMSG_THREAT_REMOVE/CLEAR. Show a threat window (/threat or via target frame button) with a progress bar per player and gold highlight for the tank, red if local player has aggro.
This commit is contained in:
parent
43de2be1f2
commit
920950dfbd
4 changed files with 149 additions and 27 deletions
|
|
@ -514,6 +514,21 @@ public:
|
|||
const std::vector<CombatTextEntry>& getCombatText() const { return combatText; }
|
||||
void updateCombatText(float deltaTime);
|
||||
|
||||
// Threat
|
||||
struct ThreatEntry {
|
||||
uint64_t victimGuid = 0;
|
||||
uint32_t threat = 0;
|
||||
};
|
||||
// Returns the current threat list for a given unit GUID (from last SMSG_THREAT_UPDATE)
|
||||
const std::vector<ThreatEntry>* getThreatList(uint64_t unitGuid) const {
|
||||
auto it = threatLists_.find(unitGuid);
|
||||
return (it != threatLists_.end()) ? &it->second : nullptr;
|
||||
}
|
||||
// Returns the threat list for the player's current target, or nullptr
|
||||
const std::vector<ThreatEntry>* getTargetThreatList() const {
|
||||
return targetGuid ? getThreatList(targetGuid) : nullptr;
|
||||
}
|
||||
|
||||
// ---- Phase 3: Spells ----
|
||||
void castSpell(uint32_t spellId, uint64_t targetGuid = 0);
|
||||
void cancelCast();
|
||||
|
|
@ -2047,6 +2062,8 @@ private:
|
|||
float autoAttackFacingSyncTimer_ = 0.0f; // Periodic facing sync while meleeing
|
||||
std::unordered_set<uint64_t> hostileAttackers_;
|
||||
std::vector<CombatTextEntry> combatText;
|
||||
// unitGuid → sorted threat list (descending by threat value)
|
||||
std::unordered_map<uint64_t, std::vector<ThreatEntry>> threatLists_;
|
||||
|
||||
// ---- Phase 3: Spells ----
|
||||
WorldEntryCallback worldEntryCallback_;
|
||||
|
|
|
|||
|
|
@ -368,6 +368,10 @@ private:
|
|||
// Inspect window
|
||||
bool showInspectWindow_ = false;
|
||||
void renderInspectWindow(game::GameHandler& gameHandler);
|
||||
|
||||
// Threat window
|
||||
bool showThreatWindow_ = false;
|
||||
void renderThreatWindow(game::GameHandler& gameHandler);
|
||||
uint8_t lfgRoles_ = 0x08; // default: DPS (0x02=tank, 0x04=healer, 0x08=dps)
|
||||
uint32_t lfgSelectedDungeon_ = 861; // default: random dungeon (entry 861 = Random Dungeon WotLK)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue