mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-25 13:03:50 +00:00
feat: add missing player feedback for level-up, pet spells, and pet name errors
- SMSG_LEVELUP_INFO: show \"You have reached level N!\" chat message on level-up (was only calling the UI ding callback without any chat notification) - SMSG_PET_LEARNED_SPELL: show \"Your pet has learned X.\" with spell name lookup (was LOG_DEBUG only) - SMSG_PET_NAME_INVALID: show \"That pet name is invalid.\" (was silently consumed)
This commit is contained in:
parent
8e67a41983
commit
28ce441214
1 changed files with 9 additions and 3 deletions
|
|
@ -4060,8 +4060,9 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (newLevel > oldLevel && levelUpCallback_) {
|
if (newLevel > oldLevel) {
|
||||||
levelUpCallback_(newLevel);
|
addSystemChatMessage("You have reached level " + std::to_string(newLevel) + "!");
|
||||||
|
if (levelUpCallback_) levelUpCallback_(newLevel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6865,6 +6866,8 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
if (packet.getSize() - packet.getReadPos() >= 4) {
|
if (packet.getSize() - packet.getReadPos() >= 4) {
|
||||||
uint32_t spellId = packet.readUInt32();
|
uint32_t spellId = packet.readUInt32();
|
||||||
petSpellList_.push_back(spellId);
|
petSpellList_.push_back(spellId);
|
||||||
|
const std::string& sname = getSpellName(spellId);
|
||||||
|
addSystemChatMessage("Your pet has learned " + (sname.empty() ? "a new ability." : sname + "."));
|
||||||
LOG_DEBUG("SMSG_PET_LEARNED_SPELL: spellId=", spellId);
|
LOG_DEBUG("SMSG_PET_LEARNED_SPELL: spellId=", spellId);
|
||||||
}
|
}
|
||||||
packet.setReadPos(packet.getSize());
|
packet.setReadPos(packet.getSize());
|
||||||
|
|
@ -6908,11 +6911,14 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
case Opcode::SMSG_PET_DISMISS_SOUND:
|
case Opcode::SMSG_PET_DISMISS_SOUND:
|
||||||
case Opcode::SMSG_PET_ACTION_SOUND:
|
case Opcode::SMSG_PET_ACTION_SOUND:
|
||||||
case Opcode::SMSG_PET_UNLEARN_CONFIRM:
|
case Opcode::SMSG_PET_UNLEARN_CONFIRM:
|
||||||
case Opcode::SMSG_PET_NAME_INVALID:
|
|
||||||
case Opcode::SMSG_PET_RENAMEABLE:
|
case Opcode::SMSG_PET_RENAMEABLE:
|
||||||
case Opcode::SMSG_PET_UPDATE_COMBO_POINTS:
|
case Opcode::SMSG_PET_UPDATE_COMBO_POINTS:
|
||||||
packet.setReadPos(packet.getSize());
|
packet.setReadPos(packet.getSize());
|
||||||
break;
|
break;
|
||||||
|
case Opcode::SMSG_PET_NAME_INVALID:
|
||||||
|
addSystemChatMessage("That pet name is invalid. Please choose a different name.");
|
||||||
|
packet.setReadPos(packet.getSize());
|
||||||
|
break;
|
||||||
|
|
||||||
// ---- Inspect (Classic 1.12 gear inspection) ----
|
// ---- Inspect (Classic 1.12 gear inspection) ----
|
||||||
case Opcode::SMSG_INSPECT: {
|
case Opcode::SMSG_INSPECT: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue