feat: fire MIRROR_TIMER_START and MIRROR_TIMER_STOP events
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run

Fire MIRROR_TIMER_START with type, value, maxValue, scale, and paused
args when breath/fatigue/fire timers begin. Fire MIRROR_TIMER_STOP with
type when they end. Timer types: 0=fatigue, 1=breath, 2=fire.

Used by timer bar addons to display breath/fatigue countdown overlays.
This commit is contained in:
Kelsi 2026-03-21 07:48:06 -07:00
parent 774f9bf214
commit 5ee2b55f4b

View file

@ -2275,6 +2275,11 @@ void GameHandler::handlePacket(network::Packet& packet) {
mirrorTimers_[type].scale = scale;
mirrorTimers_[type].paused = (paused != 0);
mirrorTimers_[type].active = true;
if (addonEventCallback_)
addonEventCallback_("MIRROR_TIMER_START", {
std::to_string(type), std::to_string(value),
std::to_string(maxV), std::to_string(scale),
paused ? "1" : "0"});
}
break;
}
@ -2285,6 +2290,8 @@ void GameHandler::handlePacket(network::Packet& packet) {
if (type < 3) {
mirrorTimers_[type].active = false;
mirrorTimers_[type].value = 0;
if (addonEventCallback_)
addonEventCallback_("MIRROR_TIMER_STOP", {std::to_string(type)});
}
break;
}