Document smlua_*_utils.h files (16.94%)

This commit is contained in:
Agent X 2024-12-07 21:53:08 -05:00
parent 58de87d1c1
commit e9039df03e
19 changed files with 2346 additions and 1715 deletions

View file

@ -1377,6 +1377,9 @@ def def_function(function):
if rtype == None:
rtype = 'nil'
if function['description'].startswith("[DEPRECATED"):
s += "--- @deprecated\n"
for param in function['params']:
pid = param['identifier']
ptype = param['type']

View file

@ -331,6 +331,7 @@ COURSE_MIN = 1
--- @param np NetworkPlayer
--- @param part PlayerPart
--- @return Color
--- Gets the palette color of `part` on `np`
function network_player_get_palette_color(np, part)
local color = {
r = network_player_get_palette_color_channel(np, part, 0),
@ -343,6 +344,7 @@ end
--- @param np NetworkPlayer
--- @param part PlayerPart
--- @return Color
--- Gets the override palette color of `part` on `np`
function network_player_get_override_palette_color(np, part)
local color = {
r = network_player_get_override_palette_color_channel(np, part, 0),

View file

@ -2,14 +2,14 @@
--- @param id integer
--- @return ObjectWarpNode
--- Finds a warp node in the current area by its ID. The warp node must exist in the list of warp nodes for the current area. Useful for locating a specific warp point in the level, such as teleportation zones or connections to other areas.
--- Finds a warp node in the current area by its ID. The warp node must exist in the list of warp nodes for the current area. Useful for locating a specific warp point in the level, such as teleportation zones or connections to other areas
function area_get_warp_node(id)
-- ...
end
--- @param o Object
--- @return ObjectWarpNode
--- Finds a warp node in the current area using parameters from the provided object. The object's behavior parameters are used to determine the warp node ID. Useful for associating an object (like a door or warp pipe) with its corresponding warp node in the area.
--- Finds a warp node in the current area using parameters from the provided object. The object's behavior parameters are used to determine the warp node ID. Useful for associating an object (like a door or warp pipe) with its corresponding warp node in the area
function area_get_warp_node_from_params(o)
-- ...
end
@ -7694,29 +7694,34 @@ end
--- @param index integer
--- @return Animation
--- Gets a vanilla mario Animation with `index`
function get_mario_vanilla_animation(index)
-- ...
end
--- @param obj Object
--- @return string
--- Gets the name of the current animation playing on `obj`, returns `nil` if there's no name
function smlua_anim_util_get_current_animation_name(obj)
-- ...
end
--- @param obj Object
--- @param name string
--- Sets the animation of `obj` to the animation `name` corresponds to
function smlua_anim_util_set_animation(obj, name)
-- ...
end
--- @param audio ModAudio
--- Destroys an `audio` sample
function audio_sample_destroy(audio)
-- ...
end
--- @param filename string
--- @return ModAudio
--- Loads an `audio` sample
function audio_sample_load(filename)
-- ...
end
@ -7724,51 +7729,60 @@ end
--- @param audio ModAudio
--- @param position Vec3f
--- @param volume number
--- Plays an `audio` sample at `position` with `volume`
function audio_sample_play(audio, position, volume)
-- ...
end
--- @param audio ModAudio
--- Stops an `audio` sample
function audio_sample_stop(audio)
-- ...
end
--- @param audio ModAudio
--- Destroys an `audio` stream
function audio_stream_destroy(audio)
-- ...
end
--- @param audio ModAudio
--- @return number
--- Gets the frequency of an `audio` stream
function audio_stream_get_frequency(audio)
-- ...
end
--- @param audio ModAudio
--- @return boolean
--- Gets if an `audio` stream is looping or not
function audio_stream_get_looping(audio)
-- ...
end
--- @param audio ModAudio
--- @return number
--- Gets the position of an `audio` stream
function audio_stream_get_position(audio)
-- ...
end
--- @param audio ModAudio
--- @return number
--- Gets the volume of an `audio` stream
function audio_stream_get_volume(audio)
-- ...
end
--- @param filename string
--- @return ModAudio
--- Loads an `audio` stream by `filename` (with extension)
function audio_stream_load(filename)
-- ...
end
--- @param audio ModAudio
--- Pauses an `audio` stream
function audio_stream_pause(audio)
-- ...
end
@ -7776,35 +7790,41 @@ end
--- @param audio ModAudio
--- @param restart boolean
--- @param volume number
--- Plays an `audio` stream with `volume`. `restart` sets the elapsed time back to 0.
function audio_stream_play(audio, restart, volume)
-- ...
end
--- @param audio ModAudio
--- @param freq number
--- Sets the frequency of an `audio` stream
function audio_stream_set_frequency(audio, freq)
-- ...
end
--- @param audio ModAudio
--- @param looping boolean
--- Sets if an `audio` stream is looping or not
function audio_stream_set_looping(audio, looping)
-- ...
end
--- @param audio ModAudio
--- @param pos number
--- Sets the position of an `audio` stream
function audio_stream_set_position(audio, pos)
-- ...
end
--- @param audio ModAudio
--- @param volume number
--- Sets the volume of an `audio` stream
function audio_stream_set_volume(audio, volume)
-- ...
end
--- @param audio ModAudio
--- Stops an `audio` stream
function audio_stream_stop(audio)
-- ...
end
@ -7822,21 +7842,25 @@ function smlua_audio_utils_reset_all()
end
--- @param allow integer
--- Sets if the romhack camera should fly above poison gas
function camera_allow_toxic_gas_camera(allow)
-- ...
end
--- @param enable boolean
--- Overrides if Analog Camera is enabled
function camera_config_enable_analog_cam(enable)
-- ...
end
--- @param enable boolean
--- Overrides if Free Camera is enabled
function camera_config_enable_free_cam(enable)
-- ...
end
--- @param enable boolean
--- Overrides if camera mouse look is enabled
function camera_config_enable_mouse_look(enable)
-- ...
end
@ -7867,103 +7891,124 @@ function camera_config_get_y_sensitivity()
end
--- @param invert boolean
--- Overrides if camera X is inverted
function camera_config_invert_x(invert)
-- ...
end
--- @param invert boolean
--- Overrides if camera Y is inverted
function camera_config_invert_y(invert)
-- ...
end
--- @return boolean
--- Checks if Analog Camera is enabled
function camera_config_is_analog_cam_enabled()
-- ...
end
--- @return boolean
--- Checks if Free Camera is enabled
function camera_config_is_free_cam_enabled()
-- ...
end
--- @return boolean
--- Checks if Mouse Look is enabled
function camera_config_is_mouse_look_enabled()
-- ...
end
--- @return boolean
--- Checks if camera X is inverted
function camera_config_is_x_inverted()
-- ...
end
--- @return boolean
--- Checks if camera Y is inverted
function camera_config_is_y_inverted()
-- ...
end
--- @param value integer
--- Overrides camera aggression
function camera_config_set_aggression(value)
-- ...
end
--- @param value integer
--- Overrides camera deceleration
function camera_config_set_deceleration(value)
-- ...
end
--- @param value integer
--- Overrides camera pan level
function camera_config_set_pan_level(value)
-- ...
end
--- @param value integer
--- Overrides camera X sensitivity
function camera_config_set_x_sensitivity(value)
-- ...
end
--- @param value integer
--- Overrides camera Y sensitivity
function camera_config_set_y_sensitivity(value)
-- ...
end
--- Freezes the camera by not updating it
function camera_freeze()
-- ...
end
--- @return boolean
--- Checks if the camera should account for surfaces
function camera_get_checking_surfaces()
-- ...
end
--- @return boolean
--- Checks if the camera is frozen
function camera_is_frozen()
-- ...
end
--- Resets camera config overrides
function camera_reset_overrides()
-- ...
end
--- @param allow integer
--- Sets if the romhack camera should allow centering
function camera_romhack_allow_centering(allow)
-- ...
end
--- @param allow integer
--- Sets if the romhack camera should allow D-Pad movement
function camera_romhack_allow_dpad_usage(allow)
-- ...
end
--- @param value boolean
--- Sets if the camera should account for surfaces
function camera_set_checking_surfaces(value)
-- ...
end
--- @param rco RomhackCameraOverride
--- Sets the romhack camera override status
function camera_set_romhack_override(rco)
-- ...
end
--- Unfreezes the camera
function camera_unfreeze()
-- ...
end
@ -7972,6 +8017,7 @@ end
--- @param y number
--- @param z number
--- @return Surface
--- Finds a potential ceiling at the given `x`, `y`, and `z` values
function collision_find_ceil(x, y, z)
-- ...
end
@ -7980,11 +8026,13 @@ end
--- @param y number
--- @param z number
--- @return Surface
--- Finds a potential floor at the given `x`, `y`, and `z` values
function collision_find_floor(x, y, z)
-- ...
end
--- @return WallCollisionData
--- Returns a temporary wall collision data pointer
function collision_get_temp_wall_collision_data()
-- ...
end
@ -7992,27 +8040,32 @@ end
--- @param wcd WallCollisionData
--- @param index integer
--- @return Surface
--- Gets the surface corresponding to `index` from `wcd`
function get_surface_from_wcd_index(wcd, index)
-- ...
end
--- @return Surface
--- Finds a potential ceiling at the given `x`, `y`, and `z` values
function get_water_surface_pseudo_floor()
-- ...
end
--- @param data Pointer_Collision
--- Gets a table of the surface types from `data`
function smlua_collision_util_find_surface_types(data)
-- ...
end
--- @param name string
--- @return Pointer_Collision
--- Gets the `Collision` with `name`
function smlua_collision_util_get(name)
-- ...
end
--- @return Pointer_Collision
--- Gets the current level terrain collision
function smlua_collision_util_get_current_terrain_collision()
-- ...
end
@ -8020,51 +8073,58 @@ end
--- @param level integer
--- @param area integer
--- @return Pointer_Collision
--- Gets the `level` terrain collision from `area`
function smlua_collision_util_get_level_collision(level, area)
-- ...
end
--- @deprecated
--- @param audio ModAudio
--- @return number
--- [DEPRECATED: There may be a replacement for this function in the future]
function audio_stream_get_tempo(audio)
-- ...
end
--- @param url string
--- @return ModAudio
function audio_stream_load_url(url)
-- ...
end
--- @deprecated
--- @param audio ModAudio
--- @param initial_freq number
--- @param speed number
--- @param pitch boolean
--- [DEPRECATED: There may be a replacement for this function in the future]
function audio_stream_set_speed(audio, initial_freq, speed, pitch)
-- ...
end
--- @deprecated
--- @param audio ModAudio
--- @param tempo number
--- [DEPRECATED: There may be a replacement for this function in the future]
function audio_stream_set_tempo(audio, tempo)
-- ...
end
--- @deprecated
--- @param enable boolean
--- [DEPRECATED: Use `HOOK_ON_HUD_RENDER_BEHIND` instead] Sets if DJUI should render behind the vanilla HUD
function djui_hud_set_render_behind_hud(enable)
-- ...
end
--- @deprecated
--- @param np NetworkPlayer
--- @param part PlayerPart
--- @param color Color
--- [DEPRECATED: Use `network_player_set_override_palette_color` instead]
function network_player_color_to_palette(np, part, color)
-- ...
end
--- @deprecated
--- @param np NetworkPlayer
--- @param part PlayerPart
--- @param out Color
--- [DEPRECATED: Use `network_player_get_palette_color` or `network_player_get_override_palette_color` instead]
function network_player_palette_to_color(np, part, out)
-- ...
end
@ -8197,6 +8257,7 @@ end
--- @param levelNum integer
--- @return boolean
--- Checks if `levelNum` is a vanilla level
function level_is_vanilla_level(levelNum)
-- ...
end
@ -8210,46 +8271,54 @@ end
--- @param echoLevel2 integer
--- @param echoLevel3 integer
--- @return integer
--- Registers a fully custom level. Level ID begins at 50
function level_register(scriptEntryName, courseNum, fullName, shortName, acousticReach, echoLevel1, echoLevel2, echoLevel3)
-- ...
end
--- @param areaIndex integer
--- Instantly changes the current area to `areaIndex`
function smlua_level_util_change_area(areaIndex)
-- ...
end
--- @param levelNum integer
--- @return CustomLevelInfo
--- Gets information on a custom level from `levelNum`
function smlua_level_util_get_info(levelNum)
-- ...
end
--- @param courseNum integer
--- @return CustomLevelInfo
--- Gets information on a custom level from `courseNum`
function smlua_level_util_get_info_from_course_num(courseNum)
-- ...
end
--- @param shortName string
--- @return CustomLevelInfo
--- Gets information on a custom level from `shortName`
function smlua_level_util_get_info_from_short_name(shortName)
-- ...
end
--- @param aDelay integer
--- @return boolean
--- Exits the current level after `aDelay`
function warp_exit_level(aDelay)
-- ...
end
--- @return boolean
--- Restarts the current level
function warp_restart_level()
-- ...
end
--- @param aLevel integer
--- @return boolean
--- Warps back to the castle from `aLevel`
function warp_to_castle(aLevel)
-- ...
end
@ -8258,11 +8327,13 @@ end
--- @param aArea integer
--- @param aAct integer
--- @return boolean
--- Warps to `aArea` of `aLevel` in `aAct`
function warp_to_level(aLevel, aArea, aAct)
-- ...
end
--- @return boolean
--- Warps to the start level (Castle Grounds by default)
function warp_to_start_level()
-- ...
end
@ -8272,6 +8343,7 @@ end
--- @param aAct integer
--- @param aWarpId integer
--- @return boolean
--- Warps to `aWarpId` of `aArea` in `aLevel` during `aAct`
function warp_to_warpnode(aLevel, aArea, aAct, aWarpId)
-- ...
end
@ -8392,7 +8464,7 @@ end
--- @param pointer Pointer_integer
--- @return integer
--- Gets the 32-bit integer value from the pointer
--- Gets the signed 32-bit integer value from `pointer`
function deref_s32_pointer(pointer)
-- ...
end
@ -8447,7 +8519,7 @@ end
--- @param localIndex integer
--- @return string
--- Gets the CoopNet ID of a player if CoopNet is being used and the player is connected, otherwise "-1" is returned
--- Gets the CoopNet ID of a player with `localIndex` if CoopNet is being used and the player is connected, otherwise "-1" is returned
function get_coopnet_id(localIndex)
-- ...
end
@ -8518,7 +8590,7 @@ end
--- @param m MarioState
--- @param index integer
--- @return number
--- Gets the Y coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen
--- Gets the Y coordinate of Mario's hand (0-1) or foot (2-3) but It is important to note that the positions are not updated off-screen
function get_hand_foot_pos_y(m, index)
-- ...
end
@ -8575,7 +8647,7 @@ end
--- @param initialValue integer
--- @return Pointer_integer
--- Returns a temporary 32-bit integer pointer
--- Returns a temporary signed 32-bit integer pointer with its value set to `initialValue`
function get_temp_s32_pointer(initialValue)
-- ...
end
@ -8832,17 +8904,20 @@ end
--- @param name string
--- @return ModelExtendedId
--- Gets the extended model ID for the `name` of a `GeoLayout`
function smlua_model_util_get_id(name)
-- ...
end
--- @return ObjectHitbox
--- Returns a temporary object hitbox pointer
function get_temp_object_hitbox()
-- ...
end
--- @param name string
--- @return Pointer_Trajectory
--- Gets a trajectory by `name`
function get_trajectory(name)
-- ...
end
@ -8850,6 +8925,7 @@ end
--- @param o1 Object
--- @param o2 Object
--- @return boolean
--- Checks if `o1`'s hitbox is colliding with `o2`'s hitbox
function obj_check_hitbox_overlap(o1, o2)
-- ...
end
@ -8862,12 +8938,14 @@ end
--- @param r number
--- @param d number
--- @return boolean
--- Checks if `o`'s hitbox is colliding with the parameters of a hitbox
function obj_check_overlap_with_hitbox_params(o, x, y, z, h, r, d)
-- ...
end
--- @param behaviorId BehaviorId
--- @return integer
--- Counts every object with `behaviorId`
function obj_count_objects_with_behavior_id(behaviorId)
-- ...
end
@ -8875,6 +8953,7 @@ end
--- @param o Object
--- @param index integer
--- @return Object
--- Gets the corresponding collided object to an index from `o`
function obj_get_collided_object(o, index)
-- ...
end
@ -8882,6 +8961,7 @@ end
--- @param o Object
--- @param fieldIndex integer
--- @return number
--- Sets the float value from the field corresponding to `fieldIndex`
function obj_get_field_f32(o, fieldIndex)
-- ...
end
@ -8890,6 +8970,7 @@ end
--- @param fieldIndex integer
--- @param fieldSubIndex integer
--- @return integer
--- Gets the signed 32-bit integer value from the sub field corresponding to `fieldSubIndex` from the field corresponding to `fieldIndex`
function obj_get_field_s16(o, fieldIndex, fieldSubIndex)
-- ...
end
@ -8897,6 +8978,7 @@ end
--- @param o Object
--- @param fieldIndex integer
--- @return integer
--- Gets the signed 32-bit integer value from the field corresponding to `fieldIndex`
function obj_get_field_s32(o, fieldIndex)
-- ...
end
@ -8904,18 +8986,21 @@ end
--- @param o Object
--- @param fieldIndex integer
--- @return integer
--- Gets the unsigned 32-bit integer value from the field corresponding to `fieldIndex`
function obj_get_field_u32(o, fieldIndex)
-- ...
end
--- @param objList ObjectList
--- @return Object
--- Gets the first object in an object list
function obj_get_first(objList)
-- ...
end
--- @param behaviorId BehaviorId
--- @return Object
--- Gets the first object loaded with `behaviorId`
function obj_get_first_with_behavior_id(behaviorId)
-- ...
end
@ -8924,6 +9009,7 @@ end
--- @param fieldIndex integer
--- @param value number
--- @return Object
--- Gets the first object loaded with `behaviorId` and object float field (look in `object_fields.h` to get the index of a field)
function obj_get_first_with_behavior_id_and_field_f32(behaviorId, fieldIndex, value)
-- ...
end
@ -8932,6 +9018,7 @@ end
--- @param fieldIndex integer
--- @param value integer
--- @return Object
--- Gets the first object loaded with `behaviorId` and object signed 32-bit integer field (look in `object_fields.h` to get the index of a field)
function obj_get_first_with_behavior_id_and_field_s32(behaviorId, fieldIndex, value)
-- ...
end
@ -8939,18 +9026,21 @@ end
--- @param o Object
--- @param behaviorId BehaviorId
--- @return Object
--- Gets the nearest object with `behaviorId` to `o`
function obj_get_nearest_object_with_behavior_id(o, behaviorId)
-- ...
end
--- @param o Object
--- @return Object
--- Gets the next object in an object list
function obj_get_next(o)
-- ...
end
--- @param o Object
--- @return Object
--- Gets the next object loaded with the same behavior ID
function obj_get_next_with_same_behavior_id(o)
-- ...
end
@ -8959,6 +9049,7 @@ end
--- @param fieldIndex integer
--- @param value number
--- @return Object
--- Gets the next object loaded with the same behavior ID and object float field (look in `object_fields.h` to get the index of a field)
function obj_get_next_with_same_behavior_id_and_field_f32(o, fieldIndex, value)
-- ...
end
@ -8967,12 +9058,14 @@ end
--- @param fieldIndex integer
--- @param value integer
--- @return Object
--- Gets the next object loaded with the same behavior ID and object signed 32-bit integer field (look in `object_fields.h` to get the index of a field)
function obj_get_next_with_same_behavior_id_and_field_s32(o, fieldIndex, value)
-- ...
end
--- @param modelId ModelExtendedId
--- @return SpawnParticlesInfo
--- Returns a temporary particle spawn info pointer with its model loaded in from `modelId`
function obj_get_temp_spawn_particles_info(modelId)
-- ...
end
@ -8980,6 +9073,7 @@ end
--- @param o Object
--- @param behaviorId BehaviorId
--- @return integer
--- Checks if an object has `behaviorId`
function obj_has_behavior_id(o, behaviorId)
-- ...
end
@ -8987,60 +9081,70 @@ end
--- @param o Object
--- @param modelId ModelExtendedId
--- @return integer
--- Checks if an object's model is equal to `modelId`
function obj_has_model_extended(o, modelId)
-- ...
end
--- @param o Object
--- @return boolean
--- Checks if `o` is attackable
function obj_is_attackable(o)
-- ...
end
--- @param o Object
--- @return boolean
--- Checks if `o` is breakable
function obj_is_breakable_object(o)
-- ...
end
--- @param o Object
--- @return boolean
--- Checks if `o` is a Bully
function obj_is_bully(o)
-- ...
end
--- @param o Object
--- @return boolean
--- Checks if `o` is a coin
function obj_is_coin(o)
-- ...
end
--- @param o Object
--- @return boolean
--- Checks if `o` is an exclamation box
function obj_is_exclamation_box(o)
-- ...
end
--- @param o Object
--- @return boolean
--- Checks if `o` is grabbable
function obj_is_grabbable(o)
-- ...
end
--- @param o Object
--- @return boolean
--- Checks if `o` is a 1-Up Mushroom
function obj_is_mushroom_1up(o)
-- ...
end
--- @param o Object
--- @return boolean
--- Checks if `o` is a secret
function obj_is_secret(o)
-- ...
end
--- @param o Object
--- @return boolean
--- Checks if `o` is activated, tangible, and interactible
function obj_is_valid_for_interaction(o)
-- ...
end
@ -9049,6 +9153,7 @@ end
--- @param dx number
--- @param dy number
--- @param dz number
--- Moves the object in the direction of `dx`, `dy`, and `dz`
function obj_move_xyz(o, dx, dy, dz)
-- ...
end
@ -9056,6 +9161,7 @@ end
--- @param o Object
--- @param fieldIndex integer
--- @param value number
--- Sets the float value from the field corresponding to `fieldIndex`
function obj_set_field_f32(o, fieldIndex, value)
-- ...
end
@ -9064,6 +9170,7 @@ end
--- @param fieldIndex integer
--- @param fieldSubIndex integer
--- @param value integer
--- Sets the signed 32-bit integer value from the sub field corresponding to `fieldSubIndex` from the field corresponding to `fieldIndex`
function obj_set_field_s16(o, fieldIndex, fieldSubIndex, value)
-- ...
end
@ -9071,6 +9178,7 @@ end
--- @param o Object
--- @param fieldIndex integer
--- @param value integer
--- Sets the signed 32-bit integer value from the field corresponding to `fieldIndex`
function obj_set_field_s32(o, fieldIndex, value)
-- ...
end
@ -9078,12 +9186,14 @@ end
--- @param o Object
--- @param fieldIndex integer
--- @param value integer
--- Sets the unsigned 32-bit integer value from the field corresponding to `fieldIndex`
function obj_set_field_u32(o, fieldIndex, value)
-- ...
end
--- @param o Object
--- @param modelId ModelExtendedId
--- Sets an object's model to `modelId`
function obj_set_model_extended(o, modelId)
-- ...
end
@ -9092,6 +9202,7 @@ end
--- @param vx number
--- @param vy number
--- @param vz number
--- Sets an object's velocity to `vx`, `vy`, and `vz`
function obj_set_vel(o, vx, vy, vz)
-- ...
end
@ -9102,6 +9213,7 @@ end
--- @param strength integer
--- @param area integer
--- @param index integer
--- Sets the parameters of one of the two whirlpools (0-indexed) in an area
function set_whirlpools(x, y, z, strength, area, index)
-- ...
end
@ -9113,6 +9225,7 @@ end
--- @param z number
--- @param objSetupFunction function
--- @return Object
--- Spawns a synchronized object in at `x`, `y`, and `z` as a child object of the local Mario with his rotation. You can change the fields of the object in `objSetupFunction`
function spawn_non_sync_object(behaviorId, modelId, x, y, z, objSetupFunction)
-- ...
end
@ -9124,6 +9237,7 @@ end
--- @param z number
--- @param objSetupFunction function
--- @return Object
--- Spawns a synchronized object in at `x`, `y`, and `z` as a child object of the local Mario with his rotation. You can change the fields of the object in `objSetupFunction`
function spawn_sync_object(behaviorId, modelId, x, y, z, objSetupFunction)
-- ...
end
@ -9131,6 +9245,7 @@ end
--- @param courseNum integer
--- @param actNum integer
--- @return string
--- Gets the act name of `actNum` in `courseNum`
function smlua_text_utils_act_name_get(courseNum, actNum)
-- ...
end
@ -9138,6 +9253,7 @@ end
--- @param courseNum integer
--- @param actNum integer
--- @return integer
--- Gets the index of the mod that replaced the act name of `actNum` in `courseNum`
function smlua_text_utils_act_name_mod_index(courseNum, actNum)
-- ...
end
@ -9145,17 +9261,20 @@ end
--- @param courseNum integer
--- @param actNum integer
--- @param name string
--- Replaces the act name of `actNum` in `courseNum` with `name`
function smlua_text_utils_act_name_replace(courseNum, actNum, name)
-- ...
end
--- @param courseNum integer
--- @param actNum integer
--- Resets the act name of `actNum` in `courseNum`
function smlua_text_utils_act_name_reset(courseNum, actNum)
-- ...
end
--- @param name string
--- Replaces the castle secret stars text with `name`
function smlua_text_utils_castle_secret_stars_replace(name)
-- ...
end
@ -9168,29 +9287,34 @@ end
--- @param act4 string
--- @param act5 string
--- @param act6 string
--- Replaces the act names of `courseNum`
function smlua_text_utils_course_acts_replace(courseNum, courseName, act1, act2, act3, act4, act5, act6)
-- ...
end
--- @param courseNum integer
--- @return string
--- Gets the name of `courseNum`
function smlua_text_utils_course_name_get(courseNum)
-- ...
end
--- @param courseNum integer
--- @return integer
--- Gets the index of the mod that replaced the name of `courseNum`
function smlua_text_utils_course_name_mod_index(courseNum)
-- ...
end
--- @param courseNum integer
--- @param name string
--- Replaces the name of `courseNum` with `name`
function smlua_text_utils_course_name_replace(courseNum, name)
-- ...
end
--- @param courseNum integer
--- Resets the name of `courseNum`
function smlua_text_utils_course_name_reset(courseNum)
-- ...
end
@ -9201,23 +9325,27 @@ end
--- @param leftOffset integer
--- @param width integer
--- @param str string
--- Replaces `dialogId` with a custom one
function smlua_text_utils_dialog_replace(dialogId, unused, linesPerBox, leftOffset, width, str)
-- ...
end
--- @param index integer
--- @param text string
--- Replace extra text (e.g. one of the castle's secret stars) with `text`
function smlua_text_utils_extra_text_replace(index, text)
-- ...
end
--- @return string
--- Gets the current language
function smlua_text_utils_get_language()
-- ...
end
--- @param courseNum integer
--- @param courseName string
--- Replaces the secret star course name of `courseNum` with `courseName`
function smlua_text_utils_secret_star_replace(courseNum, courseName)
-- ...
end

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1742,81 +1742,81 @@
<br />
- smlua_misc_utils.h
- [allocate_mario_action](functions-5.md#allocate_mario_action)
- [course_is_main_course](functions-5.md#course_is_main_course)
- [deref_s32_pointer](functions-5.md#deref_s32_pointer)
- [djui_attempting_to_open_playerlist](functions-5.md#djui_attempting_to_open_playerlist)
- [djui_is_playerlist_open](functions-5.md#djui_is_playerlist_open)
- [djui_is_popup_disabled](functions-5.md#djui_is_popup_disabled)
- [djui_menu_get_font](functions-5.md#djui_menu_get_font)
- [djui_menu_get_theme](functions-5.md#djui_menu_get_theme)
- [djui_popup_create_global](functions-5.md#djui_popup_create_global)
- [djui_reset_popup_disabled_override](functions-5.md#djui_reset_popup_disabled_override)
- [djui_set_popup_disabled_override](functions-5.md#djui_set_popup_disabled_override)
- [get_coopnet_id](functions-5.md#get_coopnet_id)
- [get_current_save_file_num](functions-5.md#get_current_save_file_num)
- [get_date_and_time](functions-5.md#get_date_and_time)
- [get_dialog_box_state](functions-5.md#get_dialog_box_state)
- [get_dialog_id](functions-5.md#get_dialog_id)
- [get_dialog_response](functions-5.md#get_dialog_response)
- [get_envfx](functions-5.md#get_envfx)
- [get_environment_region](functions-5.md#get_environment_region)
- [get_global_timer](functions-5.md#get_global_timer)
- [get_got_file_coin_hi_score](functions-5.md#get_got_file_coin_hi_score)
- [get_hand_foot_pos_x](functions-5.md#get_hand_foot_pos_x)
- [get_hand_foot_pos_y](functions-5.md#get_hand_foot_pos_y)
- [get_hand_foot_pos_z](functions-5.md#get_hand_foot_pos_z)
- [get_last_completed_course_num](functions-5.md#get_last_completed_course_num)
- [get_last_completed_star_num](functions-5.md#get_last_completed_star_num)
- [get_last_star_or_key](functions-5.md#get_last_star_or_key)
- [get_local_discord_id](functions-5.md#get_local_discord_id)
- [get_network_area_timer](functions-5.md#get_network_area_timer)
- [get_os_name](functions-5.md#get_os_name)
- [get_save_file_modified](functions-5.md#get_save_file_modified)
- [get_temp_s32_pointer](functions-5.md#get_temp_s32_pointer)
- [get_time](functions-5.md#get_time)
- [get_ttc_speed_setting](functions-5.md#get_ttc_speed_setting)
- [get_volume_env](functions-5.md#get_volume_env)
- [get_volume_level](functions-5.md#get_volume_level)
- [get_volume_master](functions-5.md#get_volume_master)
- [get_volume_sfx](functions-5.md#get_volume_sfx)
- [get_water_level](functions-5.md#get_water_level)
- [hud_get_flash](functions-5.md#hud_get_flash)
- [hud_get_value](functions-5.md#hud_get_value)
- [hud_hide](functions-5.md#hud_hide)
- [hud_is_hidden](functions-5.md#hud_is_hidden)
- [hud_render_power_meter](functions-5.md#hud_render_power_meter)
- [hud_render_power_meter_interpolated](functions-5.md#hud_render_power_meter_interpolated)
- [hud_set_flash](functions-5.md#hud_set_flash)
- [hud_set_value](functions-5.md#hud_set_value)
- [hud_show](functions-5.md#hud_show)
- [is_game_paused](functions-5.md#is_game_paused)
- [is_transition_playing](functions-5.md#is_transition_playing)
- [mod_file_exists](functions-5.md#mod_file_exists)
- [movtexqc_register](functions-5.md#movtexqc_register)
- [play_transition](functions-5.md#play_transition)
- [reset_window_title](functions-5.md#reset_window_title)
- [save_file_get_using_backup_slot](functions-5.md#save_file_get_using_backup_slot)
- [save_file_set_using_backup_slot](functions-5.md#save_file_set_using_backup_slot)
- [set_environment_region](functions-5.md#set_environment_region)
- [set_got_file_coin_hi_score](functions-5.md#set_got_file_coin_hi_score)
- [set_last_completed_course_num](functions-5.md#set_last_completed_course_num)
- [set_last_completed_star_num](functions-5.md#set_last_completed_star_num)
- [set_last_star_or_key](functions-5.md#set_last_star_or_key)
- [set_override_envfx](functions-5.md#set_override_envfx)
- [set_save_file_modified](functions-5.md#set_save_file_modified)
- [set_ttc_speed_setting](functions-5.md#set_ttc_speed_setting)
- [set_volume_env](functions-5.md#set_volume_env)
- [set_volume_level](functions-5.md#set_volume_level)
- [set_volume_master](functions-5.md#set_volume_master)
- [set_volume_sfx](functions-5.md#set_volume_sfx)
- [set_water_level](functions-5.md#set_water_level)
- [set_window_title](functions-5.md#set_window_title)
- [allocate_mario_action](functions-6.md#allocate_mario_action)
- [course_is_main_course](functions-6.md#course_is_main_course)
- [deref_s32_pointer](functions-6.md#deref_s32_pointer)
- [djui_attempting_to_open_playerlist](functions-6.md#djui_attempting_to_open_playerlist)
- [djui_is_playerlist_open](functions-6.md#djui_is_playerlist_open)
- [djui_is_popup_disabled](functions-6.md#djui_is_popup_disabled)
- [djui_menu_get_font](functions-6.md#djui_menu_get_font)
- [djui_menu_get_theme](functions-6.md#djui_menu_get_theme)
- [djui_popup_create_global](functions-6.md#djui_popup_create_global)
- [djui_reset_popup_disabled_override](functions-6.md#djui_reset_popup_disabled_override)
- [djui_set_popup_disabled_override](functions-6.md#djui_set_popup_disabled_override)
- [get_coopnet_id](functions-6.md#get_coopnet_id)
- [get_current_save_file_num](functions-6.md#get_current_save_file_num)
- [get_date_and_time](functions-6.md#get_date_and_time)
- [get_dialog_box_state](functions-6.md#get_dialog_box_state)
- [get_dialog_id](functions-6.md#get_dialog_id)
- [get_dialog_response](functions-6.md#get_dialog_response)
- [get_envfx](functions-6.md#get_envfx)
- [get_environment_region](functions-6.md#get_environment_region)
- [get_global_timer](functions-6.md#get_global_timer)
- [get_got_file_coin_hi_score](functions-6.md#get_got_file_coin_hi_score)
- [get_hand_foot_pos_x](functions-6.md#get_hand_foot_pos_x)
- [get_hand_foot_pos_y](functions-6.md#get_hand_foot_pos_y)
- [get_hand_foot_pos_z](functions-6.md#get_hand_foot_pos_z)
- [get_last_completed_course_num](functions-6.md#get_last_completed_course_num)
- [get_last_completed_star_num](functions-6.md#get_last_completed_star_num)
- [get_last_star_or_key](functions-6.md#get_last_star_or_key)
- [get_local_discord_id](functions-6.md#get_local_discord_id)
- [get_network_area_timer](functions-6.md#get_network_area_timer)
- [get_os_name](functions-6.md#get_os_name)
- [get_save_file_modified](functions-6.md#get_save_file_modified)
- [get_temp_s32_pointer](functions-6.md#get_temp_s32_pointer)
- [get_time](functions-6.md#get_time)
- [get_ttc_speed_setting](functions-6.md#get_ttc_speed_setting)
- [get_volume_env](functions-6.md#get_volume_env)
- [get_volume_level](functions-6.md#get_volume_level)
- [get_volume_master](functions-6.md#get_volume_master)
- [get_volume_sfx](functions-6.md#get_volume_sfx)
- [get_water_level](functions-6.md#get_water_level)
- [hud_get_flash](functions-6.md#hud_get_flash)
- [hud_get_value](functions-6.md#hud_get_value)
- [hud_hide](functions-6.md#hud_hide)
- [hud_is_hidden](functions-6.md#hud_is_hidden)
- [hud_render_power_meter](functions-6.md#hud_render_power_meter)
- [hud_render_power_meter_interpolated](functions-6.md#hud_render_power_meter_interpolated)
- [hud_set_flash](functions-6.md#hud_set_flash)
- [hud_set_value](functions-6.md#hud_set_value)
- [hud_show](functions-6.md#hud_show)
- [is_game_paused](functions-6.md#is_game_paused)
- [is_transition_playing](functions-6.md#is_transition_playing)
- [mod_file_exists](functions-6.md#mod_file_exists)
- [movtexqc_register](functions-6.md#movtexqc_register)
- [play_transition](functions-6.md#play_transition)
- [reset_window_title](functions-6.md#reset_window_title)
- [save_file_get_using_backup_slot](functions-6.md#save_file_get_using_backup_slot)
- [save_file_set_using_backup_slot](functions-6.md#save_file_set_using_backup_slot)
- [set_environment_region](functions-6.md#set_environment_region)
- [set_got_file_coin_hi_score](functions-6.md#set_got_file_coin_hi_score)
- [set_last_completed_course_num](functions-6.md#set_last_completed_course_num)
- [set_last_completed_star_num](functions-6.md#set_last_completed_star_num)
- [set_last_star_or_key](functions-6.md#set_last_star_or_key)
- [set_override_envfx](functions-6.md#set_override_envfx)
- [set_save_file_modified](functions-6.md#set_save_file_modified)
- [set_ttc_speed_setting](functions-6.md#set_ttc_speed_setting)
- [set_volume_env](functions-6.md#set_volume_env)
- [set_volume_level](functions-6.md#set_volume_level)
- [set_volume_master](functions-6.md#set_volume_master)
- [set_volume_sfx](functions-6.md#set_volume_sfx)
- [set_water_level](functions-6.md#set_water_level)
- [set_window_title](functions-6.md#set_window_title)
<br />
- smlua_model_utils.h
- [smlua_model_util_get_id](functions-5.md#smlua_model_util_get_id)
- [smlua_model_util_get_id](functions-6.md#smlua_model_util_get_id)
<br />
@ -2424,7 +2424,7 @@ N/A
## [area_get_warp_node](#area_get_warp_node)
### Description
Finds a warp node in the current area by its ID. The warp node must exist in the list of warp nodes for the current area. Useful for locating a specific warp point in the level, such as teleportation zones or connections to other areas.
Finds a warp node in the current area by its ID. The warp node must exist in the list of warp nodes for the current area. Useful for locating a specific warp point in the level, such as teleportation zones or connections to other areas
### Lua Example
`local ObjectWarpNodeValue = area_get_warp_node(id)`
@ -2447,7 +2447,7 @@ Finds a warp node in the current area by its ID. The warp node must exist in the
## [area_get_warp_node_from_params](#area_get_warp_node_from_params)
### Description
Finds a warp node in the current area using parameters from the provided object. The object's behavior parameters are used to determine the warp node ID. Useful for associating an object (like a door or warp pipe) with its corresponding warp node in the area.
Finds a warp node in the current area using parameters from the provided object. The object's behavior parameters are used to determine the warp node ID. Useful for associating an object (like a door or warp pipe) with its corresponding warp node in the area
### Lua Example
`local ObjectWarpNodeValue = area_get_warp_node_from_params(o)`

View file

@ -161,14 +161,14 @@ u32 get_mario_spawn_type(struct Object *o);
/* |description|
Finds a warp node in the current area by its ID. The warp node must exist in the list of warp nodes for the current area.
Useful for locating a specific warp point in the level, such as teleportation zones or connections to other areas.
Useful for locating a specific warp point in the level, such as teleportation zones or connections to other areas
|descriptionEnd| */
struct ObjectWarpNode *area_get_warp_node(u8 id);
struct ObjectWarpNode *area_get_any_warp_node(void);
/* |description|
Finds a warp node in the current area using parameters from the provided object. The object's behavior parameters are used to determine the warp node ID.
Useful for associating an object (like a door or warp pipe) with its corresponding warp node in the area.
Useful for associating an object (like a door or warp pipe) with its corresponding warp node in the area
|descriptionEnd| */
struct ObjectWarpNode *area_get_warp_node_from_params(struct Object *o);
void clear_areas(void);

View file

@ -29533,23 +29533,6 @@ int smlua_func_audio_stream_get_tempo(lua_State* L) {
return 1;
}
int smlua_func_audio_stream_load_url(lua_State* L) {
if (L == NULL) { return 0; }
int top = lua_gettop(L);
if (top != 1) {
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_load_url", 1, top);
return 0;
}
const char* url = smlua_to_string(L, 1);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_load_url"); return 0; }
smlua_push_object(L, LOT_MODAUDIO, audio_stream_load_url(url));
return 1;
}
int smlua_func_audio_stream_set_speed(lua_State* L) {
if (L == NULL) { return 0; }
@ -35058,7 +35041,6 @@ void smlua_bind_functions_autogen(void) {
// smlua_deprecated.h
smlua_bind_function(L, "audio_stream_get_tempo", smlua_func_audio_stream_get_tempo);
smlua_bind_function(L, "audio_stream_load_url", smlua_func_audio_stream_load_url);
smlua_bind_function(L, "audio_stream_set_speed", smlua_func_audio_stream_set_speed);
smlua_bind_function(L, "audio_stream_set_tempo", smlua_func_audio_stream_set_tempo);
smlua_bind_function(L, "djui_hud_set_render_behind_hud", smlua_func_djui_hud_set_render_behind_hud);

View file

@ -66,11 +66,14 @@ struct GlobalObjectAnimations {
extern struct GlobalObjectAnimations gGlobalObjectAnimations;
/* |description|Gets a vanilla mario Animation with `index`|descriptionEnd| */
struct Animation *get_mario_vanilla_animation(u16 index);
void smlua_anim_util_reset();
void smlua_anim_util_register_animation(const char *name, s16 flags, s16 animYTransDivisor, s16 startFrame, s16 loopStart, s16 loopEnd, u16 *values, u32 valuesLength, u16 *index, u32 indexLength);
/* |description|Sets the animation of `obj` to the animation `name` corresponds to|descriptionEnd| */
void smlua_anim_util_set_animation(struct Object *obj, const char *name);
/* |description|Gets the name of the current animation playing on `obj`, returns `nil` if there's no name|descriptionEnd| */
const char *smlua_anim_util_get_current_animation_name(struct Object *obj);
#endif

View file

@ -31,24 +31,41 @@ struct ModAudio {
bool loaded;
};
/* |description|Loads an `audio` stream by `filename` (with extension)|descriptionEnd| */
struct ModAudio* audio_stream_load(const char* filename);
/* |description|Destroys an `audio` stream|descriptionEnd| */
void audio_stream_destroy(struct ModAudio* audio);
/* |description|Plays an `audio` stream with `volume`. `restart` sets the elapsed time back to 0.|descriptionEnd| */
void audio_stream_play(struct ModAudio* audio, bool restart, f32 volume);
/* |description|Pauses an `audio` stream|descriptionEnd| */
void audio_stream_pause(struct ModAudio* audio);
/* |description|Stops an `audio` stream|descriptionEnd| */
void audio_stream_stop(struct ModAudio* audio);
/* |description|Gets the position of an `audio` stream|descriptionEnd| */
f32 audio_stream_get_position(struct ModAudio* audio);
/* |description|Sets the position of an `audio` stream|descriptionEnd| */
void audio_stream_set_position(struct ModAudio* audio, f32 pos);
/* |description|Gets if an `audio` stream is looping or not|descriptionEnd| */
bool audio_stream_get_looping(struct ModAudio* audio);
/* |description|Sets if an `audio` stream is looping or not|descriptionEnd| */
void audio_stream_set_looping(struct ModAudio* audio, bool looping);
/* |description|Gets the frequency of an `audio` stream|descriptionEnd| */
f32 audio_stream_get_frequency(struct ModAudio* audio);
/* |description|Sets the frequency of an `audio` stream|descriptionEnd| */
void audio_stream_set_frequency(struct ModAudio* audio, f32 freq);
/* |description|Gets the volume of an `audio` stream|descriptionEnd| */
f32 audio_stream_get_volume(struct ModAudio* audio);
/* |description|Sets the volume of an `audio` stream|descriptionEnd| */
void audio_stream_set_volume(struct ModAudio* audio, f32 volume);
void audio_sample_destroy_pending_copies(void);
/* |description|Loads an `audio` sample|descriptionEnd| */
struct ModAudio* audio_sample_load(const char* filename);
/* |description|Destroys an `audio` sample|descriptionEnd| */
void audio_sample_destroy(struct ModAudio* audio);
/* |description|Stops an `audio` sample|descriptionEnd| */
void audio_sample_stop(struct ModAudio* audio);
/* |description|Plays an `audio` sample at `position` with `volume`|descriptionEnd| */
void audio_sample_play(struct ModAudio* audio, Vec3f position, f32 volume);
void audio_custom_update_volume(void);

View file

@ -9,38 +9,68 @@ struct CameraOverride {
bool override;
};
/* |description|Resets camera config overrides|descriptionEnd| */
void camera_reset_overrides(void);
/* |description|Freezes the camera by not updating it|descriptionEnd| */
void camera_freeze(void);
/* |description|Unfreezes the camera|descriptionEnd| */
void camera_unfreeze(void);
/* |description|Checks if the camera is frozen|descriptionEnd| */
bool camera_is_frozen(void);
/* |description|Sets the romhack camera override status|descriptionEnd| */
void camera_set_romhack_override(enum RomhackCameraOverride rco);
/* |description|Sets if the romhack camera should allow centering|descriptionEnd| */
void camera_romhack_allow_centering(u8 allow);
/* |description|Sets if the romhack camera should fly above poison gas|descriptionEnd| */
void camera_allow_toxic_gas_camera(u8 allow);
/* |description|Sets if the romhack camera should allow D-Pad movement|descriptionEnd| */
void camera_romhack_allow_dpad_usage(u8 allow);
/* |description|Checks if Free Camera is enabled|descriptionEnd| */
bool camera_config_is_free_cam_enabled(void);
/* |description|Checks if Analog Camera is enabled|descriptionEnd| */
bool camera_config_is_analog_cam_enabled(void);
/* |description|Checks if Mouse Look is enabled|descriptionEnd| */
bool camera_config_is_mouse_look_enabled(void);
/* |description|Checks if camera X is inverted|descriptionEnd| */
bool camera_config_is_x_inverted(void);
/* |description|Checks if camera Y is inverted|descriptionEnd| */
bool camera_config_is_y_inverted(void);
/* |description|Gets camera X sensitivity|descriptionEnd| */
u32 camera_config_get_x_sensitivity(void);
/* |description|Gets camera Y sensitivity|descriptionEnd| */
u32 camera_config_get_y_sensitivity(void);
/* |description|Gets camera aggression|descriptionEnd| */
u32 camera_config_get_aggression(void);
/* |description|Gets camera pan level|descriptionEnd| */
u32 camera_config_get_pan_level(void);
/* |description|Gets camera deceleration|descriptionEnd| */
u32 camera_config_get_deceleration(void);
/* |description|Overrides if Free Camera is enabled|descriptionEnd| */
void camera_config_enable_free_cam(bool enable);
/* |description|Overrides if Analog Camera is enabled|descriptionEnd| */
void camera_config_enable_analog_cam(bool enable);
/* |description|Overrides if camera mouse look is enabled|descriptionEnd| */
void camera_config_enable_mouse_look(bool enable);
/* |description|Overrides if camera X is inverted|descriptionEnd| */
void camera_config_invert_x(bool invert);
/* |description|Overrides if camera Y is inverted|descriptionEnd| */
void camera_config_invert_y(bool invert);
/* |description|Overrides camera X sensitivity|descriptionEnd| */
void camera_config_set_x_sensitivity(u32 value);
/* |description|Overrides camera Y sensitivity|descriptionEnd| */
void camera_config_set_y_sensitivity(u32 value);
/* |description|Overrides camera aggression|descriptionEnd| */
void camera_config_set_aggression(u32 value);
/* |description|Overrides camera pan level|descriptionEnd| */
void camera_config_set_pan_level(u32 value);
/* |description|Overrides camera deceleration|descriptionEnd| */
void camera_config_set_deceleration(u32 value);
/* |description|Checks if the camera should account for surfaces|descriptionEnd| */
bool camera_get_checking_surfaces(void);
/* |description|Sets if the camera should account for surfaces|descriptionEnd| */
void camera_set_checking_surfaces(bool value);
#endif

View file

@ -115,21 +115,29 @@ struct GlobalObjectCollisionData {
extern struct GlobalObjectCollisionData gGlobalObjectCollisionData;
struct RayIntersectionInfo* collision_find_surface_on_ray(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f32 dirZ, f32 precision);
/* |description|Finds a potential floor at the given `x`, `y`, and `z` values|descriptionEnd| */
struct Surface* collision_find_floor(f32 x, f32 y, f32 z);
/* |description|Finds a potential ceiling at the given `x`, `y`, and `z` values|descriptionEnd| */
struct Surface* collision_find_ceil(f32 x, f32 y, f32 z);
struct Surface* get_water_surface_pseudo_floor(void);
/* |description|Gets the `Collision` with `name`|descriptionEnd| */
Collision* smlua_collision_util_get(const char* name);
/* |description|Returns a temporary wall collision data pointer|descriptionEnd| */
struct WallCollisionData* collision_get_temp_wall_collision_data(void);
/* |description|Gets the surface corresponding to `index` from `wcd`|descriptionEnd| */
struct Surface* get_surface_from_wcd_index(struct WallCollisionData* wcd, s8 index);
/* |description|Gets the current level terrain collision|descriptionEnd| */
Collision* smlua_collision_util_get_current_terrain_collision(void);
/* |description|Gets the `level` terrain collision from `area`|descriptionEnd| */
Collision *smlua_collision_util_get_level_collision(u32 level, u16 area);
/* |description|Gets a table of the surface types from `data`|descriptionEnd| */
void smlua_collision_util_find_surface_types(Collision* data);
#endif

View file

@ -10,11 +10,6 @@ void djui_hud_set_render_behind_hud(bool enable) {
gLuaActiveMod->renderBehindHud = enable;
}
struct ModAudio* audio_stream_load_url(UNUSED const char* url) {
LOG_LUA_LINE_WARNING("[LUA] audio_stream_load_url() is deprecated! There is no replacement for this function.");
return NULL;
}
f32 audio_stream_get_tempo(UNUSED struct ModAudio* audio) {
LOG_LUA_LINE_WARNING("[LUA] audio_stream_get_tempo() is deprecated! There may be a replacement for this function in the future.");
return 1;

View file

@ -1,11 +1,16 @@
#pragma once
/* |description|[DEPRECATED: Use `HOOK_ON_HUD_RENDER_BEHIND` instead] Sets if DJUI should render behind the vanilla HUD|descriptionEnd| */
void djui_hud_set_render_behind_hud(bool enable);
struct ModAudio* audio_stream_load_url(const char* url);
/* |description|[DEPRECATED: There may be a replacement for this function in the future]|descriptionEnd| */
f32 audio_stream_get_tempo(struct ModAudio* audio);
/* |description|[DEPRECATED: There may be a replacement for this function in the future]|descriptionEnd| */
void audio_stream_set_tempo(struct ModAudio* audio, f32 tempo);
/* |description|[DEPRECATED: There may be a replacement for this function in the future]|descriptionEnd| */
void audio_stream_set_speed(struct ModAudio* audio, f32 initial_freq, f32 speed, bool pitch);
/* |description|[DEPRECATED: Use `network_player_set_override_palette_color` instead]|descriptionEnd| */
void network_player_color_to_palette(struct NetworkPlayer *np, enum PlayerPart part, Color color);
/* |description|[DEPRECATED: Use `network_player_get_palette_color` or `network_player_get_override_palette_color` instead]|descriptionEnd| */
void network_player_palette_to_color(struct NetworkPlayer *np, enum PlayerPart part, Color out);

View file

@ -19,17 +19,29 @@ struct CustomLevelInfo {
#define CUSTOM_LEVEL_NUM_START 50
void smlua_level_util_reset(void);
/* |description|Instantly changes the current area to `areaIndex`|descriptionEnd| */
void smlua_level_util_change_area(s32 areaIndex);
/* |description|Gets information on a custom level from `levelNum`|descriptionEnd| */
struct CustomLevelInfo* smlua_level_util_get_info(s16 levelNum);
/* |description|Gets information on a custom level from `shortName`|descriptionEnd| */
struct CustomLevelInfo* smlua_level_util_get_info_from_short_name(const char* shortName);
/* |description|Gets information on a custom level from `courseNum`|descriptionEnd| */
struct CustomLevelInfo* smlua_level_util_get_info_from_course_num(u8 courseNum);
/* |description|Registers a fully custom level. Level ID begins at 50|descriptionEnd| */
s16 level_register(const char* scriptEntryName, s16 courseNum, const char* fullName, const char* shortName, u32 acousticReach, u32 echoLevel1, u32 echoLevel2, u32 echoLevel3);
/* |description|Checks if `levelNum` is a vanilla level|descriptionEnd| */
bool level_is_vanilla_level(s16 levelNum);
/* |description|Warps to `aWarpId` of `aArea` in `aLevel` during `aAct`|descriptionEnd| */
bool warp_to_warpnode(s32 aLevel, s32 aArea, s32 aAct, s32 aWarpId);
/* |description|Warps to `aArea` of `aLevel` in `aAct`|descriptionEnd| */
bool warp_to_level(s32 aLevel, s32 aArea, s32 aAct);
/* |description|Restarts the current level|descriptionEnd| */
bool warp_restart_level(void);
/* |description|Warps to the start level (Castle Grounds by default)|descriptionEnd| */
bool warp_to_start_level(void);
/* |description|Exits the current level after `aDelay`|descriptionEnd| */
bool warp_exit_level(s32 aDelay);
/* |description|Warps back to the castle from `aLevel`|descriptionEnd| */
bool warp_to_castle(s32 aLevel);
#endif

View file

@ -42,9 +42,9 @@ struct DateTime {
/* |description|Gets the current area's networked timer|descriptionEnd| */
u32 get_network_area_timer(void);
/* |description|Returns a temporary 32-bit integer pointer|descriptionEnd| */
/* |description|Returns a temporary signed 32-bit integer pointer with its value set to `initialValue`|descriptionEnd| */
s32* get_temp_s32_pointer(s32 initialValue);
/* |description|Gets the 32-bit integer value from the pointer|descriptionEnd| */
/* |description|Gets the signed 32-bit integer value from `pointer`|descriptionEnd| */
s32 deref_s32_pointer(s32* pointer);
/* |description|Creates a DJUI popup that is broadcasted to every client|descriptionEnd| */
@ -117,11 +117,17 @@ bool is_transition_playing(void);
/* |description|Allocates an action ID with bitwise flags|descriptionEnd| */
u32 allocate_mario_action(u32 actFlags);
/* |description|Gets the X coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen|descriptionEnd| */
/* |description|
Gets the X coordinate of Mario's hand (0-1) or foot (2-3)
but it is important to note that the positions are not updated off-screen|descriptionEnd| */
f32 get_hand_foot_pos_x(struct MarioState* m, u8 index);
/* |description|Gets the Y coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen|descriptionEnd| */
/* |description|
Gets the Y coordinate of Mario's hand (0-1) or foot (2-3)
but It is important to note that the positions are not updated off-screen|descriptionEnd| */
f32 get_hand_foot_pos_y(struct MarioState* m, u8 index);
/* |description|Gets the Z coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen|descriptionEnd| */
/* |description|
Gets the Z coordinate of Mario's hand (0-1) or foot (2-3)
but it is important to note that the positions are not updated off-screen|descriptionEnd| */
f32 get_hand_foot_pos_z(struct MarioState* m, u8 index);
/* |description|Gets the current save file number (1-indexed)|descriptionEnd| */
@ -167,7 +173,7 @@ s32 get_dialog_response(void);
/* |description|Gets the local discord ID if it isn't disabled, otherwise "0" is returned|descriptionEnd| */
const char* get_local_discord_id(void);
/* |description|Gets the CoopNet ID of a player if CoopNet is being used and the player is connected, otherwise "-1" is returned|descriptionEnd| */
/* |description|Gets the CoopNet ID of a player with `localIndex` if CoopNet is being used and the player is connected, otherwise "-1" is returned|descriptionEnd| */
const char* get_coopnet_id(s8 localIndex);
/* |description|Gets the master volume level|descriptionEnd| */

View file

@ -398,6 +398,7 @@ enum ModelExtendedId {
void smlua_model_util_clear(void);
void smlua_model_util_store_in_slot(u32 slot, const char* name);
u16 smlua_model_util_load(enum ModelExtendedId extId);
/* |description|Gets the extended model ID for the `name` of a `GeoLayout`|descriptionEnd| */
enum ModelExtendedId smlua_model_util_get_id(const char* name);
#endif

View file

@ -5,72 +5,131 @@
#include "smlua_model_utils.h"
#include "game/object_list_processor.h"
/* |description|
Spawns a synchronized object in at `x`, `y`, and `z` as a child object of the local Mario with his rotation.
You can change the fields of the object in `objSetupFunction`
|descriptionEnd| */
struct Object* spawn_sync_object(enum BehaviorId behaviorId, enum ModelExtendedId modelId, f32 x, f32 y, f32 z, LuaFunction objSetupFunction);
/* |description|
Spawns a synchronized object in at `x`, `y`, and `z` as a child object of the local Mario with his rotation.
You can change the fields of the object in `objSetupFunction`
|descriptionEnd| */
struct Object* spawn_non_sync_object(enum BehaviorId behaviorId, enum ModelExtendedId modelId, f32 x, f32 y, f32 z, LuaFunction objSetupFunction);
/* |description|Checks if an object has `behaviorId`|descriptionEnd| */
s32 obj_has_behavior_id(struct Object *o, enum BehaviorId behaviorId);
/* |description|Checks if an object's model is equal to `modelId`|descriptionEnd| */
s32 obj_has_model_extended(struct Object *o, enum ModelExtendedId modelId);
/* |description|Sets an object's model to `modelId`|descriptionEnd| */
void obj_set_model_extended(struct Object *o, enum ModelExtendedId modelId);
/* |description|Gets a trajectory by `name`|descriptionEnd| */
Trajectory* get_trajectory(const char* name);
//
// Helpers to iterate through the object table
//
/* |description|Gets the first object in an object list|descriptionEnd| */
struct Object *obj_get_first(enum ObjectList objList);
/* |description|Gets the first object loaded with `behaviorId`|descriptionEnd| */
struct Object *obj_get_first_with_behavior_id(enum BehaviorId behaviorId);
/* |description|
Gets the first object loaded with `behaviorId` and object signed 32-bit integer field
(look in `object_fields.h` to get the index of a field)
|descriptionEnd| */
struct Object *obj_get_first_with_behavior_id_and_field_s32(enum BehaviorId behaviorId, s32 fieldIndex, s32 value);
/* |description|
Gets the first object loaded with `behaviorId` and object float field
(look in `object_fields.h` to get the index of a field)
|descriptionEnd| */
struct Object *obj_get_first_with_behavior_id_and_field_f32(enum BehaviorId behaviorId, s32 fieldIndex, f32 value);
/* |description|Gets the next object in an object list|descriptionEnd| */
struct Object *obj_get_next(struct Object *o);
/* |description|Gets the next object loaded with the same behavior ID|descriptionEnd| */
struct Object *obj_get_next_with_same_behavior_id(struct Object *o);
/* |description|
Gets the next object loaded with the same behavior ID and object signed 32-bit integer field
(look in `object_fields.h` to get the index of a field)
|descriptionEnd| */
struct Object *obj_get_next_with_same_behavior_id_and_field_s32(struct Object *o, s32 fieldIndex, s32 value);
/* |description|
Gets the next object loaded with the same behavior ID and object float field
(look in `object_fields.h` to get the index of a field)
|descriptionEnd| */
struct Object *obj_get_next_with_same_behavior_id_and_field_f32(struct Object *o, s32 fieldIndex, f32 value);
/* |description|Gets the nearest object with `behaviorId` to `o`|descriptionEnd| */
struct Object *obj_get_nearest_object_with_behavior_id(struct Object *o, enum BehaviorId behaviorId);
/* |description|Counts every object with `behaviorId`|descriptionEnd| */
s32 obj_count_objects_with_behavior_id(enum BehaviorId behaviorId);
/* |description|Gets the corresponding collided object to an index from `o`|descriptionEnd| */
struct Object *obj_get_collided_object(struct Object *o, s16 index);
//
// Object fields
//
/* |description|Gets the unsigned 32-bit integer value from the field corresponding to `fieldIndex`|descriptionEnd| */
u32 obj_get_field_u32(struct Object *o, s32 fieldIndex);
/* |description|Gets the signed 32-bit integer value from the field corresponding to `fieldIndex`|descriptionEnd| */
s32 obj_get_field_s32(struct Object *o, s32 fieldIndex);
/* |description|Sets the float value from the field corresponding to `fieldIndex`|descriptionEnd| */
f32 obj_get_field_f32(struct Object *o, s32 fieldIndex);
/* |description|Gets the signed 32-bit integer value from the sub field corresponding to `fieldSubIndex` from the field corresponding to `fieldIndex`|descriptionEnd| */
s16 obj_get_field_s16(struct Object *o, s32 fieldIndex, s32 fieldSubIndex);
/* |description|Sets the unsigned 32-bit integer value from the field corresponding to `fieldIndex`|descriptionEnd| */
void obj_set_field_u32(struct Object *o, s32 fieldIndex, u32 value);
/* |description|Sets the signed 32-bit integer value from the field corresponding to `fieldIndex`|descriptionEnd| */
void obj_set_field_s32(struct Object *o, s32 fieldIndex, s32 value);
/* |description|Sets the float value from the field corresponding to `fieldIndex`|descriptionEnd| */
void obj_set_field_f32(struct Object *o, s32 fieldIndex, f32 value);
/* |description|Sets the signed 32-bit integer value from the sub field corresponding to `fieldSubIndex` from the field corresponding to `fieldIndex`|descriptionEnd| */
void obj_set_field_s16(struct Object *o, s32 fieldIndex, s32 fieldSubIndex, s16 value);
//
// Misc object helpers
//
/* |description|Returns a temporary particle spawn info pointer with its model loaded in from `modelId`|descriptionEnd| */
struct SpawnParticlesInfo* obj_get_temp_spawn_particles_info(enum ModelExtendedId modelId);
/* |description|Returns a temporary object hitbox pointer|descriptionEnd| */
struct ObjectHitbox* get_temp_object_hitbox(void);
/* |description|Checks if `o` is attackable|descriptionEnd| */
bool obj_is_attackable(struct Object *o);
/* |description|Checks if `o` is breakable|descriptionEnd| */
bool obj_is_breakable_object(struct Object *o);
/* |description|Checks if `o` is a Bully|descriptionEnd| */
bool obj_is_bully(struct Object *o);
/* |description|Checks if `o` is a coin|descriptionEnd| */
bool obj_is_coin(struct Object *o);
/* |description|Checks if `o` is an exclamation box|descriptionEnd| */
bool obj_is_exclamation_box(struct Object *o);
bool obj_is_grabbable(struct Object *o) ;
/* |description|Checks if `o` is grabbable|descriptionEnd| */
bool obj_is_grabbable(struct Object *o);
/* |description|Checks if `o` is a 1-Up Mushroom|descriptionEnd| */
bool obj_is_mushroom_1up(struct Object *o);
/* |description|Checks if `o` is a secret|descriptionEnd| */
bool obj_is_secret(struct Object *o);
/* |description|Checks if `o` is activated, tangible, and interactible|descriptionEnd| */
bool obj_is_valid_for_interaction(struct Object *o);
/* |description|Checks if `o1`'s hitbox is colliding with `o2`'s hitbox|descriptionEnd| */
bool obj_check_hitbox_overlap(struct Object *o1, struct Object *o2);
/* |description|Checks if `o`'s hitbox is colliding with the parameters of a hitbox|descriptionEnd| */
bool obj_check_overlap_with_hitbox_params(struct Object *o, f32 x, f32 y, f32 z, f32 h, f32 r, f32 d);
/* |description|Sets an object's velocity to `vx`, `vy`, and `vz`|descriptionEnd| */
void obj_set_vel(struct Object *o, f32 vx, f32 vy, f32 vz);
/* |description|Moves the object in the direction of `dx`, `dy`, and `dz`|descriptionEnd| */
void obj_move_xyz(struct Object *o, f32 dx, f32 dy, f32 dz);
/* |description|Sets the parameters of one of the two whirlpools (0-indexed) in an area|descriptionEnd| */
void set_whirlpools(f32 x, f32 y, f32 z, s16 strength, s16 area, s32 index);
#endif

View file

@ -25,19 +25,33 @@ extern struct CourseName *gReplacedActNameTable[];
void smlua_text_utils_init(void);
void smlua_text_utils_shutdown(void);
void smlua_text_utils_reset_all(void);
/* |description|Replaces `dialogId` with a custom one|descriptionEnd| */
void smlua_text_utils_dialog_replace(enum DialogId dialogId, u32 unused, s8 linesPerBox, s16 leftOffset, s16 width, const char* str);
/* |description|Replaces the act names of `courseNum`|descriptionEnd| */
void smlua_text_utils_course_acts_replace(s16 courseNum, const char* courseName, const char* act1, const char* act2, const char* act3, const char* act4, const char* act5, const char* act6);
/* |description|Replaces the secret star course name of `courseNum` with `courseName`|descriptionEnd| */
void smlua_text_utils_secret_star_replace(s16 courseNum, const char* courseName);
/* |description|Replaces the name of `courseNum` with `name`|descriptionEnd| */
void smlua_text_utils_course_name_replace(s16 courseNum, const char* name);
/* |description|Gets the name of `courseNum`|descriptionEnd| */
const char* smlua_text_utils_course_name_get(s16 courseNum);
/* |description|Gets the index of the mod that replaced the name of `courseNum`|descriptionEnd| */
s32 smlua_text_utils_course_name_mod_index(s16 courseNum);
/* |description|Resets the name of `courseNum`|descriptionEnd| */
void smlua_text_utils_course_name_reset(s16 courseNum);
/* |description|Replaces the act name of `actNum` in `courseNum` with `name`|descriptionEnd| */
void smlua_text_utils_act_name_replace(s16 courseNum, u8 actNum, const char* name);
/* |description|Gets the act name of `actNum` in `courseNum`|descriptionEnd| */
const char* smlua_text_utils_act_name_get(s16 courseNum, u8 actNum);
/* |description|Gets the index of the mod that replaced the act name of `actNum` in `courseNum`|descriptionEnd| */
s32 smlua_text_utils_act_name_mod_index(s16 courseNum, u8 actNum);
/* |description|Resets the act name of `actNum` in `courseNum`|descriptionEnd| */
void smlua_text_utils_act_name_reset(s16 courseNum, u8 actNum);
/* |description|Replaces the castle secret stars text with `name`|descriptionEnd| */
void smlua_text_utils_castle_secret_stars_replace(const char* name);
/* |description|Replace extra text (e.g. one of the castle's secret stars) with `text`|descriptionEnd| */
void smlua_text_utils_extra_text_replace(s16 index, const char* text);
/* |description|Gets the current language|descriptionEnd| */
const char* smlua_text_utils_get_language(void);
#endif