mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
fix: show inventory, mount, and socket errors in UIError overlay
Several server-reported action failures were posting to chat only without firing the red on-screen UIError overlay: - SMSG_INVENTORY_CHANGE_FAILURE: bag full, wrong slot, can't equip, etc. - SMSG_MOUNTRESULT / SMSG_DISMOUNTRESULT: mount denied errors - SMSG_QUESTLOG_FULL: quest log at capacity - SMSG_SOCKET_GEMS_RESULT: gem socketing failure All now call addUIError() in addition to addSystemChatMessage() so players see the error immediately on screen without looking at chat.
This commit is contained in:
parent
dcf9aeed92
commit
fba6aba80d
1 changed files with 7 additions and 2 deletions
|
|
@ -2817,7 +2817,9 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
uint32_t result = packet.readUInt32();
|
uint32_t result = packet.readUInt32();
|
||||||
if (result != 4) {
|
if (result != 4) {
|
||||||
const char* msgs[] = { "Cannot mount here.", "Invalid mount spell.", "Too far away to mount.", "Already mounted." };
|
const char* msgs[] = { "Cannot mount here.", "Invalid mount spell.", "Too far away to mount.", "Already mounted." };
|
||||||
addSystemChatMessage(result < 4 ? msgs[result] : "Cannot mount.");
|
std::string mountErr = result < 4 ? msgs[result] : "Cannot mount.";
|
||||||
|
addUIError(mountErr);
|
||||||
|
addSystemChatMessage(mountErr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -2825,7 +2827,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
// uint32 result: 0=ok, others=error
|
// uint32 result: 0=ok, others=error
|
||||||
if (packet.getSize() - packet.getReadPos() < 4) break;
|
if (packet.getSize() - packet.getReadPos() < 4) break;
|
||||||
uint32_t result = packet.readUInt32();
|
uint32_t result = packet.readUInt32();
|
||||||
if (result != 0) addSystemChatMessage("Cannot dismount here.");
|
if (result != 0) { addUIError("Cannot dismount here."); addSystemChatMessage("Cannot dismount here."); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4677,6 +4679,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
std::string msg = errMsg ? errMsg : "Inventory error (" + std::to_string(error) + ").";
|
std::string msg = errMsg ? errMsg : "Inventory error (" + std::to_string(error) + ").";
|
||||||
|
addUIError(msg);
|
||||||
addSystemChatMessage(msg);
|
addSystemChatMessage(msg);
|
||||||
if (auto* renderer = core::Application::getInstance().getRenderer()) {
|
if (auto* renderer = core::Application::getInstance().getRenderer()) {
|
||||||
if (auto* sfx = renderer->getUiSoundManager())
|
if (auto* sfx = renderer->getUiSoundManager())
|
||||||
|
|
@ -4913,6 +4916,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
addSystemChatMessage("Gems socketed successfully.");
|
addSystemChatMessage("Gems socketed successfully.");
|
||||||
} else {
|
} else {
|
||||||
|
addUIError("Failed to socket gems.");
|
||||||
addSystemChatMessage("Failed to socket gems.");
|
addSystemChatMessage("Failed to socket gems.");
|
||||||
}
|
}
|
||||||
LOG_DEBUG("SMSG_SOCKET_GEMS_RESULT: result=", result);
|
LOG_DEBUG("SMSG_SOCKET_GEMS_RESULT: result=", result);
|
||||||
|
|
@ -5440,6 +5444,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
}
|
}
|
||||||
case Opcode::SMSG_QUESTLOG_FULL:
|
case Opcode::SMSG_QUESTLOG_FULL:
|
||||||
// Zero-payload notification: the player's quest log is full (25 quests).
|
// Zero-payload notification: the player's quest log is full (25 quests).
|
||||||
|
addUIError("Your quest log is full.");
|
||||||
addSystemChatMessage("Your quest log is full.");
|
addSystemChatMessage("Your quest log is full.");
|
||||||
LOG_INFO("SMSG_QUESTLOG_FULL: quest log is at capacity");
|
LOG_INFO("SMSG_QUESTLOG_FULL: quest log is at capacity");
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue