mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Fix HOOK_ON_DIALOG
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
This commit is contained in:
parent
7f2c5cc53b
commit
2c332d4db6
2 changed files with 9 additions and 6 deletions
|
|
@ -309,17 +309,20 @@ def main():
|
||||||
name=input["name"]
|
name=input["name"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
n_outputs = len(hook_event["outputs"])
|
||||||
generated += SMLUA_CALL_EVENT_HOOKS_CALLBACK.format(
|
generated += SMLUA_CALL_EVENT_HOOKS_CALLBACK.format(
|
||||||
n_inputs=len(hook_event["inputs"]) - mod_index_found,
|
n_inputs=len(hook_event["inputs"]) - mod_index_found,
|
||||||
n_outputs=len(hook_event["outputs"]),
|
n_outputs=n_outputs,
|
||||||
hook_type=hook_event["type"],
|
hook_type=hook_event["type"],
|
||||||
set_hook_result=set_hook_result
|
set_hook_result=set_hook_result
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Note: relative indexes for return values are reversed in the Lua stack
|
||||||
|
# -1 is the last value, -2 the penultimate, ... and -N the first
|
||||||
for i, output in enumerate(hook_event["outputs"]):
|
for i, output in enumerate(hook_event["outputs"]):
|
||||||
generated += SMLUA_TYPES[output["type"]]["output"].format(
|
generated += SMLUA_TYPES[output["type"]]["output"].format(
|
||||||
name=output["name"],
|
name=output["name"],
|
||||||
output_index=i+1,
|
output_index=n_outputs - i,
|
||||||
return_on_output_set=return_on_output_set
|
return_on_output_set=return_on_output_set
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1082,13 +1082,13 @@ bool smlua_call_event_hooks_HOOK_ON_DIALOG(s32 dialogID, bool *openDialogBox, co
|
||||||
hookResult = true;
|
hookResult = true;
|
||||||
|
|
||||||
// return openDialogBox
|
// return openDialogBox
|
||||||
if (lua_type(L, -1) == LUA_TBOOLEAN) {
|
if (lua_type(L, -2) == LUA_TBOOLEAN) {
|
||||||
*openDialogBox = smlua_to_boolean(L, -1);
|
*openDialogBox = smlua_to_boolean(L, -2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// return dialogTextOverride
|
// return dialogTextOverride
|
||||||
if (lua_type(L, -2) == LUA_TSTRING) {
|
if (lua_type(L, -1) == LUA_TSTRING) {
|
||||||
*dialogTextOverride = smlua_to_string(L, -2);
|
*dialogTextOverride = smlua_to_string(L, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
lua_settop(L, prevTop);
|
lua_settop(L, prevTop);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue