[Quest API] Add Timer Events to Perl/Lua (#4099)

* [Quest API] Add Timer Events to Perl/Lua

# DRAFT

* Cleanup
This commit is contained in:
Alex King authored and GitHub committed 2024-02-19 03:51:16 -06:00
1 parent 137a9f835a
commit db3601c25c
9 files changed
+901 -250

No files matched your search

+15 -1
View File
@@ -193,6 +193,10 @@ const char* QuestEventSubroutines[_LargestEventID] = {
"EVENT_ALT_CURRENCY_LOSS",
"EVENT_CRYSTAL_GAIN",
"EVENT_CRYSTAL_LOSS",
"EVENT_TIMER_PAUSE",
"EVENT_TIMER_RESUME",
"EVENT_TIMER_START",
"EVENT_TIMER_STOP",
// Add new events before these or Lua crashes
"EVENT_SPELL_EFFECT_BOT",
@@ -1668,11 +1672,21 @@ void PerlembParser::ExportEventVariables(
break;
}
case EVENT_TIMER: {
case EVENT_TIMER:
case EVENT_TIMER_STOP: {
ExportVar(package_name.c_str(), "timer", data);
break;
}
case EVENT_TIMER_PAUSE:
case EVENT_TIMER_RESUME:
case EVENT_TIMER_START: {
Seperator sep(data);
ExportVar(package_name.c_str(), "timer", sep.arg[0]);
ExportVar(package_name.c_str(), "duration", sep.arg[1]);
break;
}
case EVENT_SIGNAL: {
ExportVar(package_name.c_str(), "signal", data);
break;