mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: add HONOR_GAIN floating combat text for PvP honor gains
Show '+X Honor' floating text in gold when SMSG_PVP_CREDIT is received, matching WoW's native behavior. Also add HONOR_GAIN to the combat log panel for a complete record. Previously only a chat message was added.
This commit is contained in:
parent
b6ea78dfab
commit
8b57e6fa45
3 changed files with 11 additions and 1 deletions
|
|
@ -53,7 +53,7 @@ struct CombatTextEntry {
|
|||
MELEE_DAMAGE, SPELL_DAMAGE, HEAL, MISS, DODGE, PARRY, BLOCK,
|
||||
EVADE, CRIT_DAMAGE, CRIT_HEAL, PERIODIC_DAMAGE, PERIODIC_HEAL, ENVIRONMENTAL,
|
||||
ENERGIZE, POWER_DRAIN, XP_GAIN, IMMUNE, ABSORB, RESIST, DEFLECT, REFLECT, PROC_TRIGGER,
|
||||
DISPEL, STEAL, INTERRUPT, INSTAKILL
|
||||
DISPEL, STEAL, INTERRUPT, INSTAKILL, HONOR_GAIN
|
||||
};
|
||||
Type type;
|
||||
int32_t amount = 0;
|
||||
|
|
|
|||
|
|
@ -2168,6 +2168,8 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
|||
std::dec, " rank=", rank);
|
||||
std::string msg = "You gain " + std::to_string(honor) + " honor points.";
|
||||
addSystemChatMessage(msg);
|
||||
if (honor > 0)
|
||||
addCombatText(CombatTextEntry::HONOR_GAIN, static_cast<int32_t>(honor), 0, true);
|
||||
if (pvpHonorCallback_) {
|
||||
pvpHonorCallback_(honor, victimGuid, rank);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8631,6 +8631,10 @@ void GameScreen::renderCombatText(game::GameHandler& gameHandler) {
|
|||
color = outgoing ? ImVec4(1.0f, 0.25f, 0.25f, alpha)
|
||||
: ImVec4(1.0f, 0.1f, 0.1f, alpha);
|
||||
break;
|
||||
case game::CombatTextEntry::HONOR_GAIN:
|
||||
snprintf(text, sizeof(text), "+%d Honor", entry.amount);
|
||||
color = ImVec4(1.0f, 0.85f, 0.0f, alpha); // Gold for honor
|
||||
break;
|
||||
default:
|
||||
snprintf(text, sizeof(text), "%d", entry.amount);
|
||||
color = ImVec4(1.0f, 1.0f, 1.0f, alpha);
|
||||
|
|
@ -20723,6 +20727,10 @@ void GameScreen::renderCombatLog(game::GameHandler& gameHandler) {
|
|||
snprintf(desc, sizeof(desc), "%s instantly kills %s", src, tgt);
|
||||
color = ImVec4(1.0f, 0.2f, 0.2f, 1.0f);
|
||||
break;
|
||||
case T::HONOR_GAIN:
|
||||
snprintf(desc, sizeof(desc), "You gain %d honor", e.amount);
|
||||
color = ImVec4(1.0f, 0.85f, 0.0f, 1.0f);
|
||||
break;
|
||||
default:
|
||||
snprintf(desc, sizeof(desc), "Combat event (type %d, amount %d)", (int)e.type, e.amount);
|
||||
color = ImVec4(0.7f, 0.7f, 0.7f, 1.0f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue