diff --git a/autogen/convert_constants.py b/autogen/convert_constants.py index 15a8dfff4..577edc219 100644 --- a/autogen/convert_constants.py +++ b/autogen/convert_constants.py @@ -243,7 +243,7 @@ def doc_constant_index(processed_files): constants = [x for x in processed_file['constants'] if 'identifier' in x] constants = sorted(constants, key=lambda d: d['identifier']) for c in constants: - s += ' - [%s](#%s)\n' % (c['identifier'], c['identifier']) + s += ' - [enum %s](#enum-%s)\n' % (c['identifier'], c['identifier']) s += '\n
\n\n' return s diff --git a/docs/lua/constants.md b/docs/lua/constants.md index 2a03d771a..ecbf8132b 100644 --- a/docs/lua/constants.md +++ b/docs/lua/constants.md @@ -3,40 +3,40 @@ # Supported Constants - [audio_defines.h](#audio_defines.h) - [behavior_table.h](#behavior_table.h) - - [BehaviorId](#BehaviorId) + - [enum BehaviorId](#enum-BehaviorId) - [camera.h](#camera.h) - [characters.h](#characters.h) - - [CharacterSound](#CharacterSound) - - [CharacterType](#CharacterType) + - [enum CharacterSound](#enum-CharacterSound) + - [enum CharacterType](#enum-CharacterType) - [djui_hud_utils.h](#djui_hud_utils.h) - - [DjuiFontType](#DjuiFontType) - - [HudUtilsResolution](#HudUtilsResolution) + - [enum DjuiFontType](#enum-DjuiFontType) + - [enum HudUtilsResolution](#enum-HudUtilsResolution) - [graph_node.h](#graph_node.h) - [interaction.c](#interaction.c) - - [InteractionFlag](#InteractionFlag) + - [enum InteractionFlag](#enum-InteractionFlag) - [interaction.h](#interaction.h) - - [InteractionType](#InteractionType) + - [enum InteractionType](#enum-InteractionType) - [mario_animation_ids.h](#mario_animation_ids.h) - - [MarioAnimID](#MarioAnimID) + - [enum MarioAnimID](#enum-MarioAnimID) - [mario_geo_switch_case_ids.h](#mario_geo_switch_case_ids.h) - - [MarioCapGSCId](#MarioCapGSCId) - - [MarioEyesGSCId](#MarioEyesGSCId) - - [MarioGrabPosGSCId](#MarioGrabPosGSCId) - - [MarioHandGSCId](#MarioHandGSCId) + - [enum MarioCapGSCId](#enum-MarioCapGSCId) + - [enum MarioEyesGSCId](#enum-MarioEyesGSCId) + - [enum MarioGrabPosGSCId](#enum-MarioGrabPosGSCId) + - [enum MarioHandGSCId](#enum-MarioHandGSCId) - [network_player.h](#network_player.h) - - [NetworkPlayerType](#NetworkPlayerType) + - [enum NetworkPlayerType](#enum-NetworkPlayerType) - [object_constants.h](#object_constants.h) - [object_list_processor.h](#object_list_processor.h) - - [ObjectList](#ObjectList) + - [enum ObjectList](#enum-ObjectList) - [os_cont.h](#os_cont.h) - [sm64.h](#sm64.h) - [smlua_hooks.h](#smlua_hooks.h) - - [LuaHookedEventType](#LuaHookedEventType) + - [enum LuaHookedEventType](#enum-LuaHookedEventType) - [smlua_model_utils.h](#smlua_model_utils.h) - - [ModelExtendedId](#ModelExtendedId) + - [enum ModelExtendedId](#enum-ModelExtendedId) - [types.h](#types.h) - - [AreaTimerType](#AreaTimerType) - - [SpTaskState](#SpTaskState) + - [enum AreaTimerType](#enum-AreaTimerType) + - [enum SpTaskState](#enum-SpTaskState)
@@ -1223,6 +1223,7 @@
## [characters.h](#characters.h) +- PALETTE_MAX ### [enum CharacterSound](#CharacterSound) | Identifier | Value | diff --git a/docs/lua/hooks.md b/docs/lua/hooks.md index c0575bd1f..b4812f40f 100644 --- a/docs/lua/hooks.md +++ b/docs/lua/hooks.md @@ -21,8 +21,8 @@ Hooks are a way for SM64 to trigger Lua code, whereas the functions listed in [f | ----- | ---- | ----- | | behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) | Set to `0` to create a new behavior | | objectList | [enum ObjectList](constants.md#enum-ObjectList) | | -| initFunction | Lua Function | Runs once per object | -| loopFunction | Lua Function | Runs once per frame per object | +| initFunction([Object](structs.md#Object) obj) | Lua Function | Runs once per object | +| loopFunction([Object](structs.md#Object) obj) | Lua Function | Runs once per frame per object | ### Returns - [enum BehaviorId](constants.md#enum-BehaviorId) @@ -55,7 +55,7 @@ id_bhvExample = hook_behavior(0, OBJ_LIST_DEFAULT, bhv_example_init, bhv_example | ----- | ---- | | command | string | | description | string | -| func | Lua Function | +| func(`string` message) -> `bool` | Lua Function | ### Lua Example @@ -101,7 +101,7 @@ The lua functions sent to `hook_event()` will be automatically called by SM64 wh | Field | Type | | ----- | ---- | | hook_event_type | [HookEventType](#Hook-Event-Types) | -| func | Lua Function | +| func(`...`) | Lua Function | ### Lua Example @@ -126,7 +126,7 @@ hook_event(HOOK_MARIO_UPDATE, mario_update) | Field | Type | | ----- | ---- | | action_id | integer | -| func | Lua Function | +| func([MarioState](structs.md#MarioState) m) | Lua Function | | interaction_type | [enum InteractionFlag](constants.md#enum-InteractionFlag) | ### Lua Example @@ -207,7 +207,7 @@ hook_mario_action(ACT_WALL_SLIDE, act_wall_slide) | syncTable | SyncTable | | field | value | | tag | value | -| func | Lua Function | +| func(`value` tag, `value` oldValue, `value` newValue) | Lua Function | ### Lua Example diff --git a/src/pc/lua/smlua_constants_autogen.c b/src/pc/lua/smlua_constants_autogen.c index 06391f95b..b56647e04 100644 --- a/src/pc/lua/smlua_constants_autogen.c +++ b/src/pc/lua/smlua_constants_autogen.c @@ -1311,6 +1311,7 @@ char gSmluaConstants[] = "" "CAM_EVENT_START_ENDING = 11\n" "CAM_EVENT_START_END_WAVING = 12\n" "CAM_EVENT_START_CREDITS = 13\n" +"PALETTE_MAX = 24\n" "CT_MARIO = 0\n" "CT_LUIGI = 1\n" "CT_TOAD = 2\n"