mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 08:03:50 +00:00
feat: add persistent combat log window (/combatlog or /cl)
Stores up to 500 combat events in a rolling deque alongside the existing floating combat text. Events are populated via the existing addCombatText() call site, resolving attacker/target names from the entity manager and player name cache at event time. - CombatLogEntry struct in spell_defines.hpp (type, amount, spellId, isPlayerSource, timestamp, sourceName, targetName) - getCombatLog() / clearCombatLog() accessors on GameHandler - renderCombatLog() in GameScreen: scrollable two-column table (Time + Event), color-coded by event category, with Damage/Healing/Misc filter checkboxes, auto-scroll toggle, and Clear button - /combatlog (/cl) chat command toggles the window
This commit is contained in:
parent
36d40905e1
commit
661f7e3e8d
5 changed files with 248 additions and 1 deletions
|
|
@ -536,6 +536,10 @@ public:
|
|||
const std::vector<CombatTextEntry>& getCombatText() const { return combatText; }
|
||||
void updateCombatText(float deltaTime);
|
||||
|
||||
// Combat log (persistent rolling history, max MAX_COMBAT_LOG entries)
|
||||
const std::deque<CombatLogEntry>& getCombatLog() const { return combatLog_; }
|
||||
void clearCombatLog() { combatLog_.clear(); }
|
||||
|
||||
// Threat
|
||||
struct ThreatEntry {
|
||||
uint64_t victimGuid = 0;
|
||||
|
|
@ -2149,6 +2153,8 @@ private:
|
|||
float autoAttackFacingSyncTimer_ = 0.0f; // Periodic facing sync while meleeing
|
||||
std::unordered_set<uint64_t> hostileAttackers_;
|
||||
std::vector<CombatTextEntry> combatText;
|
||||
static constexpr size_t MAX_COMBAT_LOG = 500;
|
||||
std::deque<CombatLogEntry> combatLog_;
|
||||
// unitGuid → sorted threat list (descending by threat value)
|
||||
std::unordered_map<uint64_t, std::vector<ThreatEntry>> threatLists_;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue