mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +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
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <ctime>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
|
@ -63,6 +64,19 @@ struct CombatTextEntry {
|
|||
bool isExpired() const { return age >= LIFETIME; }
|
||||
};
|
||||
|
||||
/**
|
||||
* Persistent combat log entry (stored in a rolling deque, survives beyond floating-text lifetime)
|
||||
*/
|
||||
struct CombatLogEntry {
|
||||
CombatTextEntry::Type type = CombatTextEntry::MELEE_DAMAGE;
|
||||
int32_t amount = 0;
|
||||
uint32_t spellId = 0;
|
||||
bool isPlayerSource = false;
|
||||
time_t timestamp = 0; // Wall-clock time (std::time(nullptr))
|
||||
std::string sourceName; // Resolved display name of attacker/caster
|
||||
std::string targetName; // Resolved display name of victim/target
|
||||
};
|
||||
|
||||
/**
|
||||
* Spell cooldown entry received from server
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue