Add minimap coordinate tooltip and play time warning display

Hovering over the minimap now shows a tooltip with the player's
WoW canonical coordinates (X=North, Y=West) and a hint about
Ctrl+click pinging.

SMSG_PLAY_TIME_WARNING is now parsed (type + minutes) and shown
as both a chat message and a UIError overlay rather than silently
dropped.
This commit is contained in:
Kelsi 2026-03-12 01:57:03 -07:00
parent 1bc3e6b677
commit 7a1f330655
2 changed files with 39 additions and 1 deletions

View file

@ -6125,10 +6125,33 @@ void GameHandler::handlePacket(network::Packet& packet) {
case Opcode::SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA:
case Opcode::SMSG_RESET_RANGED_COMBAT_TIMER:
case Opcode::SMSG_PROFILEDATA_RESPONSE:
case Opcode::SMSG_PLAY_TIME_WARNING:
packet.setReadPos(packet.getSize());
break;
case Opcode::SMSG_PLAY_TIME_WARNING: {
// uint32 type (0=normal, 1=heavy, 2=tired/restricted) + uint32 minutes played
if (packet.getSize() - packet.getReadPos() >= 4) {
uint32_t warnType = packet.readUInt32();
uint32_t minutesPlayed = (packet.getSize() - packet.getReadPos() >= 4)
? packet.readUInt32() : 0;
const char* severity = (warnType >= 2) ? "[Tired] " : "[Play Time] ";
char buf[128];
if (minutesPlayed > 0) {
uint32_t h = minutesPlayed / 60;
uint32_t m = minutesPlayed % 60;
if (h > 0)
std::snprintf(buf, sizeof(buf), "%sYou have been playing for %uh %um.", severity, h, m);
else
std::snprintf(buf, sizeof(buf), "%sYou have been playing for %um.", severity, m);
} else {
std::snprintf(buf, sizeof(buf), "%sYou have been playing for a long time.", severity);
}
addSystemChatMessage(buf);
addUIError(buf);
}
break;
}
// ---- Item query multiple (same format as single, re-use handler) ----
case Opcode::SMSG_ITEM_QUERY_MULTIPLE_RESPONSE:
handleItemQueryResponse(packet);