diff --git a/autogen/convert_functions.py b/autogen/convert_functions.py index 865605c50..9027ef196 100644 --- a/autogen/convert_functions.py +++ b/autogen/convert_functions.py @@ -103,7 +103,7 @@ override_disallowed_functions = { "src/game/mario_actions_submerged.c": [ "^[us]32 act_.*" ], "src/game/mario_step.h": [ " stub_mario_step", "transfer_bully_speed" ], "src/game/mario.h": [ " init_mario" ], - "src/pc/djui/djui_console.h": [ " djui_console_create", "djui_console_message_create" ], + "src/pc/djui/djui_console.h": [ " djui_console_create", "djui_console_message_create", "djui_console_message_dequeue" ], "src/pc/djui/djui_chat_message.h": [ "create_from" ], "src/game/interaction.h": [ "process_interaction", "_handle_" ], "src/game/sound_init.h": [ "_loop_", "thread4_", "set_sound_mode" ], diff --git a/autogen/lua_definitions/functions.lua b/autogen/lua_definitions/functions.lua index 5a72f4d37..3bae7722a 100644 --- a/autogen/lua_definitions/functions.lua +++ b/autogen/lua_definitions/functions.lua @@ -3051,85 +3051,97 @@ function update_character_anim_offset(m) end --- @param message string +--- Creates a `message` in the game's chat box function djui_chat_message_create(message) -- ... end -function djui_console_message_dequeue() - -- ... -end - +--- Toggles the visibility of the DJUI console function djui_console_toggle() -- ... end --- @return DjuiColor +--- Gets the current DJUI HUD color function djui_hud_get_color() -- ... end --- @return integer +--- Gets the current DJUI HUD texture filter function djui_hud_get_filter() -- ... end --- @return integer +--- Gets the current DJUI HUD font function djui_hud_get_font() -- ... end --- @return number +--- Gets the camera FOV coefficient function djui_hud_get_fov_coeff() -- ... end --- @return number +--- Returns the x coordinate of the mouse relative to the window function djui_hud_get_mouse_x() -- ... end --- @return number +--- Returns the y coordinate of the mouse relative to the window function djui_hud_get_mouse_y() -- ... end --- @return number +--- Returns the x coordinate of the mouse relative to the screen function djui_hud_get_raw_mouse_x() -- ... end --- @return number +--- Returns the y coordinate of the mouse relative to the screen function djui_hud_get_raw_mouse_y() -- ... end --- @return integer +--- Gets the current DJUI HUD resolution function djui_hud_get_resolution() -- ... end --- @return HudUtilsRotation +--- Gets the current DJUI HUD rotation function djui_hud_get_rotation() -- ... end --- @return integer +--- Gets the screen height in the current DJUI HUD resolution function djui_hud_get_screen_height() -- ... end --- @return integer +--- Gets the screen width in the current DJUI HUD resolution function djui_hud_get_screen_width() -- ... end --- @return boolean +--- Checks if the DJUI pause menu is created function djui_hud_is_pause_menu_created() -- ... end --- @param message string --- @return number +--- Measures the length of `message` in the current font function djui_hud_measure_text(message) -- ... end @@ -3138,6 +3150,7 @@ end --- @param x number --- @param y number --- @param scale number +--- Prints DJUI HUD text onto the screen function djui_hud_print_text(message, x, y, scale) -- ... end @@ -3149,6 +3162,7 @@ end --- @param x number --- @param y number --- @param scale number +--- Prints interpolated DJUI HUD text onto the screen function djui_hud_print_text_interpolated(message, prevX, prevY, prevScale, x, y, scale) -- ... end @@ -3157,6 +3171,7 @@ end --- @param y number --- @param width number --- @param height number +--- Renders a DJUI HUD rect onto the screen function djui_hud_render_rect(x, y, width, height) -- ... end @@ -3169,10 +3184,12 @@ end --- @param y number --- @param width number --- @param height number +--- Renders an interpolated DJUI HUD rect onto the screen function djui_hud_render_rect_interpolated(prevX, prevY, prevWidth, prevHeight, x, y, width, height) -- ... end +--- Resets the current DJUI HUD color function djui_hud_reset_color() -- ... end @@ -3181,26 +3198,31 @@ end --- @param g integer --- @param b integer --- @param a integer +--- Sets the current DJUI HUD color function djui_hud_set_color(r, g, b, a) -- ... end --- @param filterType HudUtilsFilter +--- Sets the current DJUI HUD texture filter function djui_hud_set_filter(filterType) -- ... end --- @param fontType integer +--- Sets the current DJUI HUD font function djui_hud_set_font(fontType) -- ... end --- @param locked boolean +--- Sets if the cursor is hidden and constrainted to the window function djui_hud_set_mouse_locked(locked) -- ... end --- @param resolutionType HudUtilsResolution +--- Sets the current DJUI HUD resolution function djui_hud_set_resolution(resolutionType) -- ... end @@ -3208,6 +3230,7 @@ end --- @param rotation integer --- @param pivotX number --- @param pivotY number +--- Sets the current DJUI HUD rotation function djui_hud_set_rotation(rotation, pivotX, pivotY) -- ... end @@ -3218,6 +3241,7 @@ end --- @param rotation integer --- @param pivotX number --- @param pivotY number +--- Sets the current DJUI HUD rotation interpolated function djui_hud_set_rotation_interpolated(prevRotation, prevPivotX, prevPivotY, rotation, pivotX, pivotY) -- ... end @@ -3225,15 +3249,18 @@ end --- @param pos Vec3f --- @param out Vec3f --- @return boolean +--- Converts a world position to screen position function djui_hud_world_pos_to_screen_pos(pos, out) -- ... end +--- Opens the DJUI pause menu function djui_open_pause_menu() -- ... end --- @return number +--- Gets the current camera FOV function get_current_fov() -- ... end @@ -3241,12 +3268,14 @@ end --- @param section string --- @param key string --- @return string +--- Gets a language `key` from a `section` function djui_language_get(section, key) -- ... end --- @param message string --- @param lines integer +--- Creates a popup that says `message` and has `lines` function djui_popup_create(message, lines) -- ... end @@ -3424,20 +3453,24 @@ end --- @param m MarioState --- @return boolean +--- Checks common cancels for first person function first_person_check_cancels(m) -- ... end +--- Resets first person function first_person_reset() -- ... end --- @return boolean +--- Checks if first person is enabled function get_first_person_enabled() -- ... end --- @param enable boolean +--- Sets if first person is enabled function set_first_person_enabled(enable) -- ... end @@ -3876,6 +3909,7 @@ end --- @param levelNum integer --- @param areaIndex integer --- @return string +--- Returns the name of the level corresponding to `courseNum`, `levelNum` and `areaIndex` as a decapitalized ASCII (human readable) string function get_level_name(courseNum, levelNum, areaIndex) -- ... end @@ -3885,6 +3919,7 @@ end --- @param areaIndex integer --- @param charCase integer --- @return string +--- Returns the name of the level corresponding to `courseNum`, `levelNum` and `areaIndex` as an ASCII (human readable) string. Set `charCase` to 1 to capitalize or -1 to decapitalize the returned string function get_level_name_ascii(courseNum, levelNum, areaIndex, charCase) -- ... end @@ -3901,6 +3936,7 @@ end --- @param courseNum integer --- @param starNum integer --- @return string +--- Returns the name of the star corresponding to `courseNum` and `starNum` as a decapitalized ASCII (human readable) string function get_star_name(courseNum, starNum) -- ... end @@ -3909,6 +3945,7 @@ end --- @param starNum integer --- @param charCase integer --- @return string +--- Returns the name of the star corresponding to `courseNum` and `starNum` as an ASCII (human readable) string. Set `charCase` to 1 to capitalize or -1 to decapitalize the returned string function get_star_name_ascii(courseNum, starNum, charCase) -- ... end @@ -3928,6 +3965,7 @@ end --- @param checkpoint integer --- @param o Object --- @return ObjectWarpNode +--- Creates a warp node in the current level and area with id `id` that goes to the warp node `destNode` in level `destLevel` and area `destArea`, and attach it to the object `o`. To work properly, object `o` must be able to trigger a warp (for example, with interact type set to `INTERACT_WARP`.) `checkpoint` should be set only to WARP_NO_CHECKPOINT (0x00) or WARP_CHECKPOINT (0x80.) If `checkpoint` is set to `0x80`, Mario will warp directly to this node if he enters the level again (after a death for example) function area_create_warp_node(id, destLevel, destArea, destNode, checkpoint, o) -- ... end diff --git a/docs/lua/functions-3.md b/docs/lua/functions-3.md index 7c894d7bf..3b2b98382 100644 --- a/docs/lua/functions-3.md +++ b/docs/lua/functions-3.md @@ -2068,6 +2068,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_chat_message_create](#djui_chat_message_create) +### Description +Creates a `message` in the game's chat box + ### Lua Example `djui_chat_message_create(message)` @@ -2092,26 +2095,11 @@ Updates Mario's current animation offset. This adjusts Mario's position based on
-## [djui_console_message_dequeue](#djui_console_message_dequeue) - -### Lua Example -`djui_console_message_dequeue()` - -### Parameters -- None - -### Returns -- None - -### C Prototype -`void djui_console_message_dequeue(void);` - -[:arrow_up_small:](#) - -
- ## [djui_console_toggle](#djui_console_toggle) +### Description +Toggles the visibility of the DJUI console + ### Lua Example `djui_console_toggle()` @@ -2136,6 +2124,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_get_color](#djui_hud_get_color) +### Description +Gets the current DJUI HUD color + ### Lua Example `local DjuiColorValue = djui_hud_get_color()` @@ -2154,6 +2145,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_get_filter](#djui_hud_get_filter) +### Description +Gets the current DJUI HUD texture filter + ### Lua Example `local integerValue = djui_hud_get_filter()` @@ -2172,6 +2166,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_get_font](#djui_hud_get_font) +### Description +Gets the current DJUI HUD font + ### Lua Example `local integerValue = djui_hud_get_font()` @@ -2190,6 +2187,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_get_fov_coeff](#djui_hud_get_fov_coeff) +### Description +Gets the camera FOV coefficient + ### Lua Example `local numberValue = djui_hud_get_fov_coeff()` @@ -2208,6 +2208,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_get_mouse_x](#djui_hud_get_mouse_x) +### Description +Returns the x coordinate of the mouse relative to the window + ### Lua Example `local numberValue = djui_hud_get_mouse_x()` @@ -2226,6 +2229,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_get_mouse_y](#djui_hud_get_mouse_y) +### Description +Returns the y coordinate of the mouse relative to the window + ### Lua Example `local numberValue = djui_hud_get_mouse_y()` @@ -2244,6 +2250,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_get_raw_mouse_x](#djui_hud_get_raw_mouse_x) +### Description +Returns the x coordinate of the mouse relative to the screen + ### Lua Example `local numberValue = djui_hud_get_raw_mouse_x()` @@ -2262,6 +2271,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_get_raw_mouse_y](#djui_hud_get_raw_mouse_y) +### Description +Returns the y coordinate of the mouse relative to the screen + ### Lua Example `local numberValue = djui_hud_get_raw_mouse_y()` @@ -2280,6 +2292,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_get_resolution](#djui_hud_get_resolution) +### Description +Gets the current DJUI HUD resolution + ### Lua Example `local integerValue = djui_hud_get_resolution()` @@ -2298,6 +2313,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_get_rotation](#djui_hud_get_rotation) +### Description +Gets the current DJUI HUD rotation + ### Lua Example `local HudUtilsRotationValue = djui_hud_get_rotation()` @@ -2316,6 +2334,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_get_screen_height](#djui_hud_get_screen_height) +### Description +Gets the screen height in the current DJUI HUD resolution + ### Lua Example `local integerValue = djui_hud_get_screen_height()` @@ -2334,6 +2355,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_get_screen_width](#djui_hud_get_screen_width) +### Description +Gets the screen width in the current DJUI HUD resolution + ### Lua Example `local integerValue = djui_hud_get_screen_width()` @@ -2352,6 +2376,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_is_pause_menu_created](#djui_hud_is_pause_menu_created) +### Description +Checks if the DJUI pause menu is created + ### Lua Example `local booleanValue = djui_hud_is_pause_menu_created()` @@ -2370,6 +2397,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_measure_text](#djui_hud_measure_text) +### Description +Measures the length of `message` in the current font + ### Lua Example `local numberValue = djui_hud_measure_text(message)` @@ -2390,6 +2420,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_print_text](#djui_hud_print_text) +### Description +Prints DJUI HUD text onto the screen + ### Lua Example `djui_hud_print_text(message, x, y, scale)` @@ -2413,6 +2446,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_print_text_interpolated](#djui_hud_print_text_interpolated) +### Description +Prints interpolated DJUI HUD text onto the screen + ### Lua Example `djui_hud_print_text_interpolated(message, prevX, prevY, prevScale, x, y, scale)` @@ -2439,6 +2475,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_render_rect](#djui_hud_render_rect) +### Description +Renders a DJUI HUD rect onto the screen + ### Lua Example `djui_hud_render_rect(x, y, width, height)` @@ -2462,6 +2501,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_render_rect_interpolated](#djui_hud_render_rect_interpolated) +### Description +Renders an interpolated DJUI HUD rect onto the screen + ### Lua Example `djui_hud_render_rect_interpolated(prevX, prevY, prevWidth, prevHeight, x, y, width, height)` @@ -2489,6 +2531,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_reset_color](#djui_hud_reset_color) +### Description +Resets the current DJUI HUD color + ### Lua Example `djui_hud_reset_color()` @@ -2507,6 +2552,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_set_color](#djui_hud_set_color) +### Description +Sets the current DJUI HUD color + ### Lua Example `djui_hud_set_color(r, g, b, a)` @@ -2530,6 +2578,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_set_filter](#djui_hud_set_filter) +### Description +Sets the current DJUI HUD texture filter + ### Lua Example `djui_hud_set_filter(filterType)` @@ -2550,6 +2601,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_set_font](#djui_hud_set_font) +### Description +Sets the current DJUI HUD font + ### Lua Example `djui_hud_set_font(fontType)` @@ -2570,6 +2624,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_set_mouse_locked](#djui_hud_set_mouse_locked) +### Description +Sets if the cursor is hidden and constrainted to the window + ### Lua Example `djui_hud_set_mouse_locked(locked)` @@ -2590,6 +2647,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_set_resolution](#djui_hud_set_resolution) +### Description +Sets the current DJUI HUD resolution + ### Lua Example `djui_hud_set_resolution(resolutionType)` @@ -2610,6 +2670,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_set_rotation](#djui_hud_set_rotation) +### Description +Sets the current DJUI HUD rotation + ### Lua Example `djui_hud_set_rotation(rotation, pivotX, pivotY)` @@ -2632,6 +2695,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_set_rotation_interpolated](#djui_hud_set_rotation_interpolated) +### Description +Sets the current DJUI HUD rotation interpolated + ### Lua Example `djui_hud_set_rotation_interpolated(prevRotation, prevPivotX, prevPivotY, rotation, pivotX, pivotY)` @@ -2657,6 +2723,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_hud_world_pos_to_screen_pos](#djui_hud_world_pos_to_screen_pos) +### Description +Converts a world position to screen position + ### Lua Example `local booleanValue = djui_hud_world_pos_to_screen_pos(pos, out)` @@ -2678,6 +2747,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_open_pause_menu](#djui_open_pause_menu) +### Description +Opens the DJUI pause menu + ### Lua Example `djui_open_pause_menu()` @@ -2696,6 +2768,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [get_current_fov](#get_current_fov) +### Description +Gets the current camera FOV + ### Lua Example `local numberValue = get_current_fov()` @@ -2720,6 +2795,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_language_get](#djui_language_get) +### Description +Gets a language `key` from a `section` + ### Lua Example `local stringValue = djui_language_get(section, key)` @@ -2747,6 +2825,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [djui_popup_create](#djui_popup_create) +### Description +Creates a popup that says `message` and has `lines` + ### Lua Example `djui_popup_create(message, lines)` @@ -3412,6 +3493,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [first_person_check_cancels](#first_person_check_cancels) +### Description +Checks common cancels for first person + ### Lua Example `local booleanValue = first_person_check_cancels(m)` @@ -3432,6 +3516,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [first_person_reset](#first_person_reset) +### Description +Resets first person + ### Lua Example `first_person_reset()` @@ -3450,6 +3537,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [get_first_person_enabled](#get_first_person_enabled) +### Description +Checks if first person is enabled + ### Lua Example `local booleanValue = get_first_person_enabled()` @@ -3468,6 +3558,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [set_first_person_enabled](#set_first_person_enabled) +### Description +Sets if first person is enabled + ### Lua Example `set_first_person_enabled(enable)` @@ -4837,6 +4930,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [get_level_name](#get_level_name) +### Description +Returns the name of the level corresponding to `courseNum`, `levelNum` and `areaIndex` as a decapitalized ASCII (human readable) string + ### Lua Example `local stringValue = get_level_name(courseNum, levelNum, areaIndex)` @@ -4859,6 +4955,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [get_level_name_ascii](#get_level_name_ascii) +### Description +Returns the name of the level corresponding to `courseNum`, `levelNum` and `areaIndex` as an ASCII (human readable) string. Set `charCase` to 1 to capitalize or -1 to decapitalize the returned string + ### Lua Example `local stringValue = get_level_name_ascii(courseNum, levelNum, areaIndex, charCase)` @@ -4905,6 +5004,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [get_star_name](#get_star_name) +### Description +Returns the name of the star corresponding to `courseNum` and `starNum` as a decapitalized ASCII (human readable) string + ### Lua Example `local stringValue = get_star_name(courseNum, starNum)` @@ -4926,6 +5028,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [get_star_name_ascii](#get_star_name_ascii) +### Description +Returns the name of the star corresponding to `courseNum` and `starNum` as an ASCII (human readable) string. Set `charCase` to 1 to capitalize or -1 to decapitalize the returned string + ### Lua Example `local stringValue = get_star_name_ascii(courseNum, starNum, charCase)` @@ -4976,6 +5081,9 @@ Updates Mario's current animation offset. This adjusts Mario's position based on ## [area_create_warp_node](#area_create_warp_node) +### Description +Creates a warp node in the current level and area with id `id` that goes to the warp node `destNode` in level `destLevel` and area `destArea`, and attach it to the object `o`. To work properly, object `o` must be able to trigger a warp (for example, with interact type set to `INTERACT_WARP`.) `checkpoint` should be set only to WARP_NO_CHECKPOINT (0x00) or WARP_CHECKPOINT (0x80.) If `checkpoint` is set to `0x80`, Mario will warp directly to this node if he enters the level again (after a death for example) + ### Lua Example `local ObjectWarpNodeValue = area_create_warp_node(id, destLevel, destArea, destNode, checkpoint, o)` diff --git a/docs/lua/functions.md b/docs/lua/functions.md index 215dba39c..b57b36d3e 100644 --- a/docs/lua/functions.md +++ b/docs/lua/functions.md @@ -739,7 +739,6 @@
- djui_console.h - - [djui_console_message_dequeue](functions-3.md#djui_console_message_dequeue) - [djui_console_toggle](functions-3.md#djui_console_toggle)
diff --git a/src/engine/level_script.h b/src/engine/level_script.h index 2ee8ba895..0bdee27a1 100644 --- a/src/engine/level_script.h +++ b/src/engine/level_script.h @@ -14,6 +14,11 @@ extern LevelScript* gLevelScriptActive; extern u8 level_script_entry[]; +/* |description| +Creates a warp node in the current level and area with id `id` that goes to the warp node `destNode` in level `destLevel` and area `destArea`, and attach it to the object `o`. +To work properly, object `o` must be able to trigger a warp (for example, with interact type set to `INTERACT_WARP`.) +`checkpoint` should be set only to WARP_NO_CHECKPOINT (0x00) or WARP_CHECKPOINT (0x80.) If `checkpoint` is set to `0x80`, Mario will warp directly to this node if he enters the level again (after a death for example) +|descriptionEnd| */ struct ObjectWarpNode *area_create_warp_node(u8 id, u8 destLevel, u8 destArea, u8 destNode, u8 checkpoint, struct Object *o); struct LevelCommand *level_script_execute(struct LevelCommand *cmd); diff --git a/src/game/first_person_cam.h b/src/game/first_person_cam.h index d63a03c57..42bfeaf8f 100644 --- a/src/game/first_person_cam.h +++ b/src/game/first_person_cam.h @@ -23,12 +23,16 @@ struct FirstPersonCamera { extern struct FirstPersonCamera gFirstPersonCamera; +/* |description|Checks common cancels for first person|descriptionEnd| */ bool first_person_check_cancels(struct MarioState *m); +/* |description|Checks if first person is enabled|descriptionEnd| */ bool get_first_person_enabled(void); +/* |description|Sets if first person is enabled|descriptionEnd| */ void set_first_person_enabled(bool enable); void first_person_update(void); +/* |description|Resets first person|descriptionEnd| */ void first_person_reset(void); #endif // FIRST_PERSON_CAM_H \ No newline at end of file diff --git a/src/game/level_info.h b/src/game/level_info.h index 1086ce8ef..2dfafde74 100644 --- a/src/game/level_info.h +++ b/src/game/level_info.h @@ -5,11 +5,35 @@ void *get_course_name_table(void); void *get_act_name_table(void); +/* |description| +Returns the name of the level corresponding to `courseNum`, `levelNum` and `areaIndex` as an ASCII (human readable) string. +Set `charCase` to 1 to capitalize or -1 to decapitalize the returned string +|descriptionEnd| */ const char *get_level_name_ascii(s16 courseNum, s16 levelNum, s16 areaIndex, s16 charCase); +/* |description| +Returns the name of the level corresponding to `courseNum`, `levelNum` and `areaIndex` as an SM64 encoded string. +This function should not be used in Lua mods. +Set `charCase` to 1 to capitalize or -1 to decapitalize the returned string +|descriptionEnd| */ const u8 *get_level_name_sm64(s16 courseNum, s16 levelNum, s16 areaIndex, s16 charCase); +/* |description| +Returns the name of the level corresponding to `courseNum`, `levelNum` and `areaIndex` as a decapitalized ASCII (human readable) string +|descriptionEnd| */ const char *get_level_name(s16 courseNum, s16 levelNum, s16 areaIndex); +/* |description| +Returns the name of the star corresponding to `courseNum` and `starNum` as an ASCII (human readable) string. +Set `charCase` to 1 to capitalize or -1 to decapitalize the returned string +|descriptionEnd| */ const char *get_star_name_ascii(s16 courseNum, s16 starNum, s16 charCase); +/* |description| +Returns the name of the star corresponding to `courseNum` and `starNum` as an SM64 encoded string. +This function should not be used in Lua mods. +Set `charCase` to 1 to capitalize or -1 to decapitalize the returned string +|descriptionEnd| */ const u8 *get_star_name_sm64(s16 courseNum, s16 starNum, s16 charCase); +/* |description| +Returns the name of the star corresponding to `courseNum` and `starNum` as a decapitalized ASCII (human readable) string +|descriptionEnd| */ const char *get_star_name(s16 courseNum, s16 starNum); #endif // LEVEL_INFO_H diff --git a/src/pc/djui/djui_chat_message.h b/src/pc/djui/djui_chat_message.h index a6d215d7a..5eb451b48 100644 --- a/src/pc/djui/djui_chat_message.h +++ b/src/pc/djui/djui_chat_message.h @@ -11,4 +11,5 @@ struct DjuiChatMessage { }; void djui_chat_message_create_from(u8 globalIndex, const char* message); +/* |description|Creates a `message` in the game's chat box|descriptionEnd| */ void djui_chat_message_create(const char* message); diff --git a/src/pc/djui/djui_console.h b/src/pc/djui/djui_console.h index 8d1874579..224fad6a8 100644 --- a/src/pc/djui/djui_console.h +++ b/src/pc/djui/djui_console.h @@ -20,5 +20,6 @@ extern char gDjuiConsoleTmpBuffer[]; void djui_console_message_dequeue(void); void djui_console_message_create(const char* message, enum ConsoleMessageLevel level); +/* |description|Toggles the visibility of the DJUI console|descriptionEnd| */ void djui_console_toggle(void); struct DjuiConsole* djui_console_create(void); diff --git a/src/pc/djui/djui_hud_utils.h b/src/pc/djui/djui_hud_utils.h index f2a382299..a85c0eb26 100644 --- a/src/pc/djui/djui_hud_utils.h +++ b/src/pc/djui/djui_hud_utils.h @@ -53,45 +53,78 @@ extern struct GlobalTextures gGlobalTextures; extern f32 gDjuiHudUtilsZ; extern u8 gDjuiHudLockMouse; +/* |description|Gets the current DJUI HUD resolution|descriptionEnd| */ u8 djui_hud_get_resolution(void); +/* |description|Sets the current DJUI HUD resolution|descriptionEnd| */ void djui_hud_set_resolution(enum HudUtilsResolution resolutionType); +/* |description|Gets the current DJUI HUD texture filter|descriptionEnd| */ u8 djui_hud_get_filter(void); +/* |description|Sets the current DJUI HUD texture filter|descriptionEnd| */ void djui_hud_set_filter(enum HudUtilsFilter filterType); +/* |description|Gets the current DJUI HUD font|descriptionEnd| */ u8 djui_hud_get_font(void); +/* |description|Sets the current DJUI HUD font|descriptionEnd| */ void djui_hud_set_font(s8 fontType); +/* |description|Gets the current DJUI HUD color|descriptionEnd| */ struct DjuiColor* djui_hud_get_color(void); +/* |description|Sets the current DJUI HUD color|descriptionEnd| */ void djui_hud_set_color(u8 r, u8 g, u8 b, u8 a); +/* |description|Resets the current DJUI HUD color|descriptionEnd| */ void djui_hud_reset_color(void); +/* |description|Gets the current DJUI HUD rotation|descriptionEnd| */ struct HudUtilsRotation* djui_hud_get_rotation(void); +/* |description|Sets the current DJUI HUD rotation|descriptionEnd| */ void djui_hud_set_rotation(s16 rotation, f32 pivotX, f32 pivotY); +/* |description|Sets the current DJUI HUD rotation interpolated|descriptionEnd| */ void djui_hud_set_rotation_interpolated(s32 prevRotation, f32 prevPivotX, f32 prevPivotY, s32 rotation, f32 pivotX, f32 pivotY); +/* |description|Gets the screen width in the current DJUI HUD resolution|descriptionEnd| */ u32 djui_hud_get_screen_width(void); +/* |description|Gets the screen height in the current DJUI HUD resolution|descriptionEnd| */ u32 djui_hud_get_screen_height(void); +/* |description|Returns the x coordinate of the mouse relative to the window|descriptionEnd| */ f32 djui_hud_get_mouse_x(void); +/* |description|Returns the y coordinate of the mouse relative to the window|descriptionEnd| */ f32 djui_hud_get_mouse_y(void); +/* |description|Returns the x coordinate of the mouse relative to the screen|descriptionEnd| */ f32 djui_hud_get_raw_mouse_x(void); +/* |description|Returns the y coordinate of the mouse relative to the screen|descriptionEnd| */ f32 djui_hud_get_raw_mouse_y(void); +/* |description|Sets if the cursor is hidden and constrainted to the window|descriptionEnd| */ void djui_hud_set_mouse_locked(bool locked); +/* |description|Measures the length of `message` in the current font|descriptionEnd| */ f32 djui_hud_measure_text(const char* message); +/* |description|Prints DJUI HUD text onto the screen|descriptionEnd| */ void djui_hud_print_text(const char* message, f32 x, f32 y, f32 scale); +/* |description|Prints interpolated DJUI HUD text onto the screen|descriptionEnd| */ void djui_hud_print_text_interpolated(const char* message, f32 prevX, f32 prevY, f32 prevScale, f32 x, f32 y, f32 scale); +/* |description|Renders a DJUI HUD texture onto the screen|descriptionEnd| */ void djui_hud_render_texture(struct TextureInfo* texInfo, f32 x, f32 y, f32 scaleW, f32 scaleH); void djui_hud_render_texture_raw(const u8* texture, u32 bitSize, u32 width, u32 height, f32 x, f32 y, f32 scaleW, f32 scaleH); +/* |description|Renders a DJUI HUD texture tile onto the screen|descriptionEnd| */ void djui_hud_render_texture_tile(struct TextureInfo* texInfo, f32 x, f32 y, f32 scaleW, f32 scaleH, u32 tileX, u32 tileY, u32 tileW, u32 tileH); void djui_hud_render_texture_tile_raw(const u8* texture, u32 bitSize, u32 width, u32 height, f32 x, f32 y, f32 scaleW, f32 scaleH, u32 tileX, u32 tileY, u32 tileW, u32 tileH); +/* |description|Renders an interpolated DJUI HUD texture onto the screen|descriptionEnd| */ void djui_hud_render_texture_interpolated(struct TextureInfo* texInfo, f32 prevX, f32 prevY, f32 prevScaleW, f32 prevScaleH, f32 x, f32 y, f32 scaleW, f32 scaleH); +/* |description|Renders an interpolated DJUI HUD texture tile onto the screen|descriptionEnd| */ void djui_hud_render_texture_tile_interpolated(struct TextureInfo* texInfo, f32 prevX, f32 prevY, f32 prevScaleW, f32 prevScaleH, f32 x, f32 y, f32 scaleW, f32 scaleH, u32 tileX, u32 tileY, u32 tileW, u32 tileH); +/* |description|Renders a DJUI HUD rect onto the screen|descriptionEnd| */ void djui_hud_render_rect(f32 x, f32 y, f32 width, f32 height); +/* |description|Renders an interpolated DJUI HUD rect onto the screen|descriptionEnd| */ void djui_hud_render_rect_interpolated(f32 prevX, f32 prevY, f32 prevWidth, f32 prevHeight, f32 x, f32 y, f32 width, f32 height); +/* |description|Gets the current camera FOV|descriptionEnd| */ f32 get_current_fov(); +/* |description|Gets the camera FOV coefficient|descriptionEnd| */ f32 djui_hud_get_fov_coeff(); +/* |description|Converts a world position to screen position|descriptionEnd| */ bool djui_hud_world_pos_to_screen_pos(Vec3f pos, Vec3f out); +/* |description|Checks if the DJUI pause menu is created|descriptionEnd| */ bool djui_hud_is_pause_menu_created(void); +/* |description|Opens the DJUI pause menu|descriptionEnd| */ void djui_open_pause_menu(void); #endif \ No newline at end of file diff --git a/src/pc/djui/djui_language.h b/src/pc/djui/djui_language.h index 2546368cf..31e5c7bfb 100644 --- a/src/pc/djui/djui_language.h +++ b/src/pc/djui/djui_language.h @@ -2,6 +2,7 @@ #define DLANG(_SECTION, _KEY) djui_language_get(#_SECTION, #_KEY) bool djui_language_init(char* lang); +/* |description|Gets a language `key` from a `section`|descriptionEnd| */ char* djui_language_get(const char *section, const char *key); void djui_language_replace(char* src, char* dst, int size, char key, char* value); void djui_language_replace2(char* src, char* dst, int size, char key1, char* value1, char key2, char* value2); diff --git a/src/pc/djui/djui_popup.h b/src/pc/djui/djui_popup.h index f4bb472b9..c823baa87 100644 --- a/src/pc/djui/djui_popup.h +++ b/src/pc/djui/djui_popup.h @@ -6,5 +6,6 @@ struct DjuiPopup { struct DjuiText* text; }; +/* |description|Creates a popup that says `message` and has `lines`|descriptionEnd| */ void djui_popup_create(const char* message, int lines); void djui_popup_update(void); diff --git a/src/pc/lua/smlua_functions_autogen.c b/src/pc/lua/smlua_functions_autogen.c index 451187a62..f4bac0ed2 100644 --- a/src/pc/lua/smlua_functions_autogen.c +++ b/src/pc/lua/smlua_functions_autogen.c @@ -12217,21 +12217,6 @@ int smlua_func_djui_chat_message_create(lua_State* L) { // djui_console.h // //////////////////// -int smlua_func_djui_console_message_dequeue(UNUSED lua_State* L) { - if (L == NULL) { return 0; } - - int top = lua_gettop(L); - if (top != 0) { - LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_console_message_dequeue", 0, top); - return 0; - } - - - djui_console_message_dequeue(); - - return 1; -} - int smlua_func_djui_console_toggle(UNUSED lua_State* L) { if (L == NULL) { return 0; } @@ -34156,7 +34141,6 @@ void smlua_bind_functions_autogen(void) { smlua_bind_function(L, "djui_chat_message_create", smlua_func_djui_chat_message_create); // djui_console.h - smlua_bind_function(L, "djui_console_message_dequeue", smlua_func_djui_console_message_dequeue); smlua_bind_function(L, "djui_console_toggle", smlua_func_djui_console_toggle); // djui_hud_utils.h