feat: add modifier key queries and resting/exhaustion state events

Implement keyboard modifier queries using ImGui IO:
- IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown
- IsModifiedClick(action) — CHATLINK=Shift, DRESSUP=Ctrl, SELFCAST=Alt
- GetModifiedClick/SetModifiedClick for keybind configuration

Fire UPDATE_EXHAUSTION and PLAYER_UPDATE_RESTING events when rest state
changes (entering/leaving inns and cities) and when rested XP updates.
XP bar addons use UPDATE_EXHAUSTION to show the rested bonus indicator.
This commit is contained in:
Kelsi 2026-03-22 17:19:57 -07:00
parent bf8c0aaf1a
commit 015574f0bd

View file

@ -12380,7 +12380,12 @@ void GameHandler::applyUpdateObjectBlock(const UpdateBlock& block, bool& newItem
// Byte 3 (bits 24-31): REST_STATE
// 0 = not resting, 1 = REST_TYPE_IN_TAVERN, 2 = REST_TYPE_IN_CITY
uint8_t restStateByte = static_cast<uint8_t>((val >> 24) & 0xFF);
bool wasResting = isResting_;
isResting_ = (restStateByte != 0);
if (isResting_ != wasResting && addonEventCallback_) {
addonEventCallback_("UPDATE_EXHAUSTION", {});
addonEventCallback_("PLAYER_UPDATE_RESTING", {});
}
}
else if (ufChosenTitle != 0xFFFF && key == ufChosenTitle) {
chosenTitleBit_ = static_cast<int32_t>(val);
@ -12825,6 +12830,8 @@ void GameHandler::applyUpdateObjectBlock(const UpdateBlock& block, bool& newItem
}
else if (ufPlayerRestedXpV != 0xFFFF && key == ufPlayerRestedXpV) {
playerRestedXp_ = val;
if (addonEventCallback_)
addonEventCallback_("UPDATE_EXHAUSTION", {});
}
else if (key == ufPlayerLevel) {
serverPlayerLevel_ = val;