Fixed how constants.md autogen'd links

This commit is contained in:
MysterD 2022-03-04 22:11:10 -08:00
parent e0808374f2
commit e740529776
4 changed files with 27 additions and 25 deletions

View file

@ -243,7 +243,7 @@ def doc_constant_index(processed_files):
constants = [x for x in processed_file['constants'] if 'identifier' in x] constants = [x for x in processed_file['constants'] if 'identifier' in x]
constants = sorted(constants, key=lambda d: d['identifier']) constants = sorted(constants, key=lambda d: d['identifier'])
for c in constants: for c in constants:
s += ' - [%s](#%s)\n' % (c['identifier'], c['identifier']) s += ' - [enum %s](#enum-%s)\n' % (c['identifier'], c['identifier'])
s += '\n<br />\n\n' s += '\n<br />\n\n'
return s return s

View file

@ -3,40 +3,40 @@
# Supported Constants # Supported Constants
- [audio_defines.h](#audio_defines.h) - [audio_defines.h](#audio_defines.h)
- [behavior_table.h](#behavior_table.h) - [behavior_table.h](#behavior_table.h)
- [BehaviorId](#BehaviorId) - [enum BehaviorId](#enum-BehaviorId)
- [camera.h](#camera.h) - [camera.h](#camera.h)
- [characters.h](#characters.h) - [characters.h](#characters.h)
- [CharacterSound](#CharacterSound) - [enum CharacterSound](#enum-CharacterSound)
- [CharacterType](#CharacterType) - [enum CharacterType](#enum-CharacterType)
- [djui_hud_utils.h](#djui_hud_utils.h) - [djui_hud_utils.h](#djui_hud_utils.h)
- [DjuiFontType](#DjuiFontType) - [enum DjuiFontType](#enum-DjuiFontType)
- [HudUtilsResolution](#HudUtilsResolution) - [enum HudUtilsResolution](#enum-HudUtilsResolution)
- [graph_node.h](#graph_node.h) - [graph_node.h](#graph_node.h)
- [interaction.c](#interaction.c) - [interaction.c](#interaction.c)
- [InteractionFlag](#InteractionFlag) - [enum InteractionFlag](#enum-InteractionFlag)
- [interaction.h](#interaction.h) - [interaction.h](#interaction.h)
- [InteractionType](#InteractionType) - [enum InteractionType](#enum-InteractionType)
- [mario_animation_ids.h](#mario_animation_ids.h) - [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) - [mario_geo_switch_case_ids.h](#mario_geo_switch_case_ids.h)
- [MarioCapGSCId](#MarioCapGSCId) - [enum MarioCapGSCId](#enum-MarioCapGSCId)
- [MarioEyesGSCId](#MarioEyesGSCId) - [enum MarioEyesGSCId](#enum-MarioEyesGSCId)
- [MarioGrabPosGSCId](#MarioGrabPosGSCId) - [enum MarioGrabPosGSCId](#enum-MarioGrabPosGSCId)
- [MarioHandGSCId](#MarioHandGSCId) - [enum MarioHandGSCId](#enum-MarioHandGSCId)
- [network_player.h](#network_player.h) - [network_player.h](#network_player.h)
- [NetworkPlayerType](#NetworkPlayerType) - [enum NetworkPlayerType](#enum-NetworkPlayerType)
- [object_constants.h](#object_constants.h) - [object_constants.h](#object_constants.h)
- [object_list_processor.h](#object_list_processor.h) - [object_list_processor.h](#object_list_processor.h)
- [ObjectList](#ObjectList) - [enum ObjectList](#enum-ObjectList)
- [os_cont.h](#os_cont.h) - [os_cont.h](#os_cont.h)
- [sm64.h](#sm64.h) - [sm64.h](#sm64.h)
- [smlua_hooks.h](#smlua_hooks.h) - [smlua_hooks.h](#smlua_hooks.h)
- [LuaHookedEventType](#LuaHookedEventType) - [enum LuaHookedEventType](#enum-LuaHookedEventType)
- [smlua_model_utils.h](#smlua_model_utils.h) - [smlua_model_utils.h](#smlua_model_utils.h)
- [ModelExtendedId](#ModelExtendedId) - [enum ModelExtendedId](#enum-ModelExtendedId)
- [types.h](#types.h) - [types.h](#types.h)
- [AreaTimerType](#AreaTimerType) - [enum AreaTimerType](#enum-AreaTimerType)
- [SpTaskState](#SpTaskState) - [enum SpTaskState](#enum-SpTaskState)
<br /> <br />
@ -1223,6 +1223,7 @@
<br /> <br />
## [characters.h](#characters.h) ## [characters.h](#characters.h)
- PALETTE_MAX
### [enum CharacterSound](#CharacterSound) ### [enum CharacterSound](#CharacterSound)
| Identifier | Value | | Identifier | Value |

View file

@ -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 | | behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) | Set to `0` to create a new behavior |
| objectList | [enum ObjectList](constants.md#enum-ObjectList) | | | objectList | [enum ObjectList](constants.md#enum-ObjectList) | |
| initFunction | Lua Function | Runs once per object | | initFunction([Object](structs.md#Object) obj) | Lua Function | Runs once per object |
| loopFunction | Lua Function | Runs once per frame per object | | loopFunction([Object](structs.md#Object) obj) | Lua Function | Runs once per frame per object |
### Returns ### Returns
- [enum BehaviorId](constants.md#enum-BehaviorId) - [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 | | command | string |
| description | string | | description | string |
| func | Lua Function | | func(`string` message) -> `bool` | Lua Function |
### Lua Example ### Lua Example
@ -101,7 +101,7 @@ The lua functions sent to `hook_event()` will be automatically called by SM64 wh
| Field | Type | | Field | Type |
| ----- | ---- | | ----- | ---- |
| hook_event_type | [HookEventType](#Hook-Event-Types) | | hook_event_type | [HookEventType](#Hook-Event-Types) |
| func | Lua Function | | func(`...`) | Lua Function |
### Lua Example ### Lua Example
@ -126,7 +126,7 @@ hook_event(HOOK_MARIO_UPDATE, mario_update)
| Field | Type | | Field | Type |
| ----- | ---- | | ----- | ---- |
| action_id | integer | | action_id | integer |
| func | Lua Function | | func([MarioState](structs.md#MarioState) m) | Lua Function |
| interaction_type | [enum InteractionFlag](constants.md#enum-InteractionFlag) <optional> | | interaction_type | [enum InteractionFlag](constants.md#enum-InteractionFlag) <optional> |
### Lua Example ### Lua Example
@ -207,7 +207,7 @@ hook_mario_action(ACT_WALL_SLIDE, act_wall_slide)
| syncTable | SyncTable | | syncTable | SyncTable |
| field | value | | field | value |
| tag | value | | tag | value |
| func | Lua Function | | func(`value` tag, `value` oldValue, `value` newValue) | Lua Function |
### Lua Example ### Lua Example

View file

@ -1311,6 +1311,7 @@ char gSmluaConstants[] = ""
"CAM_EVENT_START_ENDING = 11\n" "CAM_EVENT_START_ENDING = 11\n"
"CAM_EVENT_START_END_WAVING = 12\n" "CAM_EVENT_START_END_WAVING = 12\n"
"CAM_EVENT_START_CREDITS = 13\n" "CAM_EVENT_START_CREDITS = 13\n"
"PALETTE_MAX = 24\n"
"CT_MARIO = 0\n" "CT_MARIO = 0\n"
"CT_LUIGI = 1\n" "CT_LUIGI = 1\n"
"CT_TOAD = 2\n" "CT_TOAD = 2\n"