diff --git a/autogen/convert_functions.py b/autogen/convert_functions.py index 6aaf9811..20b0a6c2 100644 --- a/autogen/convert_functions.py +++ b/autogen/convert_functions.py @@ -1227,7 +1227,8 @@ def def_function(function): if rtype.startswith('Pointer_') and rtype not in def_pointers: def_pointers.append(rtype) - s += '--- @return %s\n' % rtype + if rtype != "nil": + s += '--- @return %s\n' % rtype s += "function %s(%s)\n -- ...\nend\n\n" % (fid, param_str) return s diff --git a/autogen/lua_definitions/constants.lua b/autogen/lua_definitions/constants.lua index 1fb74298..b49c4ee2 100644 --- a/autogen/lua_definitions/constants.lua +++ b/autogen/lua_definitions/constants.lua @@ -9228,7 +9228,27 @@ HOOK_ON_SEQ_LOAD = 42 HOOK_ON_ATTACK_OBJECT = 43 --- @type LuaHookedEventType -HOOK_MAX = 44 +HOOK_ON_LANGUAGE_CHANGED = 44 + +--- @type LuaHookedEventType +HOOK_MAX = 45 + +--- @class LuaModMenuElementType + +--- @type LuaModMenuElementType +MOD_MENU_ELEMENT_BUTTON = 0 + +--- @type LuaModMenuElementType +MOD_MENU_ELEMENT_CHECKBOX = 1 + +--- @type LuaModMenuElementType +MOD_MENU_ELEMENT_SLIDER = 2 + +--- @type LuaModMenuElementType +MOD_MENU_ELEMENT_INPUTBOX = 3 + +--- @type LuaModMenuElementType +MOD_MENU_ELEMENT_MAX = 4 --- @class HudDisplayFlags diff --git a/autogen/lua_definitions/functions.lua b/autogen/lua_definitions/functions.lua index 9734fb4a..870ad337 100644 --- a/autogen/lua_definitions/functions.lua +++ b/autogen/lua_definitions/functions.lua @@ -21,2082 +21,1666 @@ function arc_to_goal_pos(a0, a1, yVel, gravity) -- ... end ---- @return nil function bhv_1up_common_init() -- ... end ---- @return nil function bhv_1up_hidden_in_pole_loop() -- ... end ---- @return nil function bhv_1up_hidden_in_pole_spawner_loop() -- ... end ---- @return nil function bhv_1up_hidden_in_pole_trigger_loop() -- ... end ---- @return nil function bhv_1up_hidden_loop() -- ... end ---- @return nil function bhv_1up_hidden_trigger_loop() -- ... end ---- @return nil function bhv_1up_init() -- ... end ---- @return nil function bhv_1up_jump_on_approach_loop() -- ... end ---- @return nil function bhv_1up_loop() -- ... end ---- @return nil function bhv_1up_running_away_loop() -- ... end ---- @return nil function bhv_1up_sliding_loop() -- ... end ---- @return nil function bhv_1up_trigger_init() -- ... end ---- @return nil function bhv_1up_walking_loop() -- ... end ---- @return nil function bhv_act_selector_init() -- ... end ---- @return nil function bhv_act_selector_loop() -- ... end ---- @return nil function bhv_act_selector_star_type_loop() -- ... end ---- @return nil function bhv_activated_back_and_forth_platform_init() -- ... end ---- @return nil function bhv_activated_back_and_forth_platform_update() -- ... end ---- @return nil function bhv_alpha_boo_key_loop() -- ... end ---- @return nil function bhv_ambient_sounds_init() -- ... end ---- @return nil function bhv_animated_texture_loop() -- ... end ---- @return nil function bhv_animates_on_floor_switch_press_init() -- ... end ---- @return nil function bhv_animates_on_floor_switch_press_loop() -- ... end ---- @return nil function bhv_arrow_lift_loop() -- ... end ---- @return nil function bhv_bbh_tilting_trap_platform_loop() -- ... end ---- @return nil function bhv_beta_boo_key_loop() -- ... end ---- @return nil function bhv_beta_bowser_anchor_loop() -- ... end ---- @return nil function bhv_beta_chest_bottom_init() -- ... end ---- @return nil function bhv_beta_chest_bottom_loop() -- ... end ---- @return nil function bhv_beta_chest_lid_loop() -- ... end ---- @return nil function bhv_beta_fish_splash_spawner_loop() -- ... end ---- @return nil function bhv_beta_holdable_object_init() -- ... end ---- @return nil function bhv_beta_holdable_object_loop() -- ... end ---- @return nil function bhv_beta_moving_flames_loop() -- ... end ---- @return nil function bhv_beta_moving_flames_spawn_loop() -- ... end ---- @return nil function bhv_beta_trampoline_spring_loop() -- ... end ---- @return nil function bhv_beta_trampoline_top_loop() -- ... end ---- @return nil function bhv_big_boo_loop() -- ... end ---- @return nil function bhv_big_boulder_generator_loop() -- ... end ---- @return nil function bhv_big_boulder_init() -- ... end ---- @return nil function bhv_big_boulder_loop() -- ... end ---- @return nil function bhv_big_bully_init() -- ... end ---- @return nil function bhv_big_bully_with_minions_init() -- ... end ---- @return nil function bhv_big_bully_with_minions_loop() -- ... end ---- @return nil function bhv_bird_update() -- ... end ---- @return nil function bhv_birds_sound_loop() -- ... end ---- @return nil function bhv_bitfs_sinking_cage_platform_loop() -- ... end ---- @return nil function bhv_bitfs_sinking_platform_loop() -- ... end ---- @return nil function bhv_black_smoke_bowser_loop() -- ... end ---- @return nil function bhv_black_smoke_mario_loop() -- ... end ---- @return nil function bhv_black_smoke_upward_loop() -- ... end ---- @return nil function bhv_blue_bowser_flame_init() -- ... end ---- @return nil function bhv_blue_bowser_flame_loop() -- ... end ---- @return nil function bhv_blue_coin_jumping_loop() -- ... end ---- @return nil function bhv_blue_coin_number_loop() -- ... end ---- @return nil function bhv_blue_coin_sliding_jumping_init() -- ... end ---- @return nil function bhv_blue_coin_sliding_loop() -- ... end ---- @return nil function bhv_blue_coin_switch_init() -- ... end ---- @return nil function bhv_blue_coin_switch_loop() -- ... end ---- @return nil function bhv_blue_fish_movement_loop() -- ... end ---- @return nil function bhv_blue_flames_group_loop() -- ... end ---- @return nil function bhv_bob_pit_bowling_ball_init() -- ... end ---- @return nil function bhv_bob_pit_bowling_ball_loop() -- ... end ---- @return nil function bhv_bobomb_anchor_mario_loop() -- ... end ---- @return nil function bhv_bobomb_buddy_init() -- ... end ---- @return nil function bhv_bobomb_buddy_loop() -- ... end ---- @return nil function bhv_bobomb_bully_death_smoke_init() -- ... end ---- @return nil function bhv_bobomb_explosion_bubble_init() -- ... end ---- @return nil function bhv_bobomb_explosion_bubble_loop() -- ... end ---- @return nil function bhv_bobomb_fuse_smoke_init() -- ... end ---- @return nil function bhv_bobomb_init() -- ... end ---- @return nil function bhv_bobomb_loop() -- ... end ---- @return nil function bhv_boo_boss_spawned_bridge_loop() -- ... end ---- @return nil function bhv_boo_cage_init() -- ... end ---- @return nil function bhv_boo_cage_loop() -- ... end ---- @return nil function bhv_boo_in_castle_loop() -- ... end ---- @return nil function bhv_boo_init() -- ... end ---- @return nil function bhv_boo_loop() -- ... end ---- @return nil function bhv_boo_with_cage_init() -- ... end ---- @return nil function bhv_boo_with_cage_loop() -- ... end ---- @return nil function bhv_book_switch_loop() -- ... end ---- @return nil function bhv_bookend_spawn_loop() -- ... end ---- @return nil function bhv_bouncing_fireball_flame_loop() -- ... end ---- @return nil function bhv_bouncing_fireball_loop() -- ... end ---- @return nil function bhv_bowling_ball_init() -- ... end ---- @return nil function bhv_bowling_ball_loop() -- ... end ---- @return nil function bhv_bowser_body_anchor_init() -- ... end ---- @return nil function bhv_bowser_body_anchor_loop() -- ... end ---- @return nil function bhv_bowser_bomb_explosion_loop() -- ... end ---- @return nil function bhv_bowser_bomb_loop() -- ... end ---- @return nil function bhv_bowser_bomb_smoke_loop() -- ... end ---- @return nil function bhv_bowser_course_red_coin_star_loop() -- ... end ---- @return nil function bhv_bowser_flame_spawn_loop() -- ... end ---- @return nil function bhv_bowser_init() -- ... end ---- @return nil function bhv_bowser_key_course_exit_loop() -- ... end ---- @return nil function bhv_bowser_key_init() -- ... end ---- @return nil function bhv_bowser_key_loop() -- ... end ---- @return nil function bhv_bowser_key_unlock_door_loop() -- ... end ---- @return nil function bhv_bowser_loop() -- ... end ---- @return nil function bhv_bowser_shock_wave_loop() -- ... end ---- @return nil function bhv_bowser_tail_anchor_init() -- ... end ---- @return nil function bhv_bowser_tail_anchor_loop() -- ... end ---- @return nil function bhv_bowsers_sub_loop() -- ... end ---- @return nil function bhv_breakable_box_loop() -- ... end ---- @return nil function bhv_breakable_box_small_init() -- ... end ---- @return nil function bhv_breakable_box_small_loop() -- ... end ---- @return nil function bhv_bub_loop() -- ... end ---- @return nil function bhv_bub_spawner_loop() -- ... end ---- @return nil function bhv_bubba_loop() -- ... end ---- @return nil function bhv_bubble_cannon_barrel_loop() -- ... end ---- @return nil function bhv_bubble_maybe_loop() -- ... end ---- @return nil function bhv_bubble_player_loop() -- ... end ---- @return nil function bhv_bubble_splash_init() -- ... end ---- @return nil function bhv_bubble_wave_init() -- ... end ---- @return nil function bhv_bullet_bill_init() -- ... end ---- @return nil function bhv_bullet_bill_loop() -- ... end ---- @return nil function bhv_bully_loop() -- ... end ---- @return nil function bhv_butterfly_init() -- ... end ---- @return nil function bhv_butterfly_loop() -- ... end ---- @return nil function bhv_camera_lakitu_init() -- ... end ---- @return nil function bhv_camera_lakitu_update() -- ... end ---- @return nil function bhv_cannon_barrel_loop() -- ... end ---- @return nil function bhv_cannon_base_loop() -- ... end ---- @return nil function bhv_cannon_base_unused_loop() -- ... end ---- @return nil function bhv_cannon_closed_init() -- ... end ---- @return nil function bhv_cannon_closed_loop() -- ... end ---- @return nil function bhv_cap_switch_loop() -- ... end ---- @return nil function bhv_castle_cannon_grate_init() -- ... end ---- @return nil function bhv_castle_flag_init() -- ... end ---- @return nil function bhv_castle_floor_trap_init() -- ... end ---- @return nil function bhv_castle_floor_trap_loop() -- ... end ---- @return nil function bhv_ccm_touched_star_spawn_loop() -- ... end ---- @return nil function bhv_celebration_star_init() -- ... end ---- @return nil function bhv_celebration_star_loop() -- ... end ---- @return nil function bhv_celebration_star_sparkle_loop() -- ... end ---- @return nil function bhv_chain_chomp_chain_part_update() -- ... end ---- @return nil function bhv_chain_chomp_gate_init() -- ... end ---- @return nil function bhv_chain_chomp_gate_update() -- ... end ---- @return nil function bhv_chain_chomp_update() -- ... end ---- @return nil function bhv_checkerboard_elevator_group_init() -- ... end ---- @return nil function bhv_checkerboard_elevator_group_loop() -- ... end ---- @return nil function bhv_checkerboard_platform_init() -- ... end ---- @return nil function bhv_checkerboard_platform_loop() -- ... end ---- @return nil function bhv_chuckya_anchor_mario_loop() -- ... end ---- @return nil function bhv_chuckya_loop() -- ... end ---- @return nil function bhv_circling_amp_init() -- ... end ---- @return nil function bhv_circling_amp_loop() -- ... end ---- @return nil function bhv_clam_loop() -- ... end ---- @return nil function bhv_cloud_part_update() -- ... end ---- @return nil function bhv_cloud_update() -- ... end ---- @return nil function bhv_coffin_loop() -- ... end ---- @return nil function bhv_coffin_spawner_loop() -- ... end ---- @return nil function bhv_coin_formation_init() -- ... end ---- @return nil function bhv_coin_formation_loop() -- ... end ---- @return nil function bhv_coin_formation_spawn_loop() -- ... end ---- @return nil function bhv_coin_init() -- ... end ---- @return nil function bhv_coin_inside_boo_loop() -- ... end ---- @return nil function bhv_coin_loop() -- ... end ---- @return nil function bhv_coin_sparkles_loop() -- ... end ---- @return nil function bhv_collect_star_init() -- ... end ---- @return nil function bhv_collect_star_loop() -- ... end ---- @return nil function bhv_controllable_platform_init() -- ... end ---- @return nil function bhv_controllable_platform_loop() -- ... end ---- @return nil function bhv_controllable_platform_sub_loop() -- ... end ---- @return nil function bhv_courtyard_boo_triplet_init() -- ... end ---- @return nil function bhv_ddd_moving_pole_loop() -- ... end ---- @return nil function bhv_ddd_pole_init() -- ... end ---- @return nil function bhv_ddd_pole_update() -- ... end ---- @return nil function bhv_ddd_warp_loop() -- ... end ---- @return nil function bhv_decorative_pendulum_init() -- ... end ---- @return nil function bhv_decorative_pendulum_loop() -- ... end ---- @return nil function bhv_donut_platform_spawner_update() -- ... end ---- @return nil function bhv_donut_platform_update() -- ... end ---- @return nil function bhv_door_init() -- ... end ---- @return nil function bhv_door_loop() -- ... end ---- @return nil function bhv_dorrie_update() -- ... end ---- @return nil function bhv_elevator_init() -- ... end ---- @return nil function bhv_elevator_loop() -- ... end ---- @return nil function bhv_end_birds_1_loop() -- ... end ---- @return nil function bhv_end_birds_2_loop() -- ... end ---- @return nil function bhv_enemy_lakitu_update() -- ... end ---- @return nil function bhv_exclamation_box_init() -- ... end ---- @return nil function bhv_exclamation_box_loop() -- ... end ---- @return nil function bhv_explosion_init() -- ... end ---- @return nil function bhv_explosion_loop() -- ... end ---- @return nil function bhv_eyerok_boss_init() -- ... end ---- @return nil function bhv_eyerok_boss_loop() -- ... end ---- @return nil function bhv_eyerok_hand_loop() -- ... end ---- @return nil function bhv_fading_warp_loop() -- ... end ---- @return nil function bhv_falling_bowser_platform_loop() -- ... end ---- @return nil function bhv_falling_pillar_hitbox_loop() -- ... end ---- @return nil function bhv_falling_pillar_init() -- ... end ---- @return nil function bhv_falling_pillar_loop() -- ... end ---- @return nil function bhv_ferris_wheel_axle_init() -- ... end ---- @return nil function bhv_ferris_wheel_platform_update() -- ... end ---- @return nil function bhv_fire_piranha_plant_init() -- ... end ---- @return nil function bhv_fire_piranha_plant_update() -- ... end ---- @return nil function bhv_fire_spitter_update() -- ... end ---- @return nil function bhv_fish_group_loop() -- ... end ---- @return nil function bhv_fish_loop() -- ... end ---- @return nil function bhv_fish_spawner_loop() -- ... end ---- @return nil function bhv_flame_bouncing_init() -- ... end ---- @return nil function bhv_flame_bouncing_loop() -- ... end ---- @return nil function bhv_flame_bowser_init() -- ... end ---- @return nil function bhv_flame_bowser_loop() -- ... end ---- @return nil function bhv_flame_floating_landing_init() -- ... end ---- @return nil function bhv_flame_floating_landing_loop() -- ... end ---- @return nil function bhv_flame_large_burning_out_init() -- ... end ---- @return nil function bhv_flame_mario_loop() -- ... end ---- @return nil function bhv_flame_moving_forward_growing_init() -- ... end ---- @return nil function bhv_flame_moving_forward_growing_loop() -- ... end ---- @return nil function bhv_flamethrower_flame_loop() -- ... end ---- @return nil function bhv_flamethrower_loop() -- ... end ---- @return nil function bhv_floating_platform_loop() -- ... end ---- @return nil function bhv_floor_trap_in_castle_loop() -- ... end ---- @return nil function bhv_fly_guy_flame_loop() -- ... end ---- @return nil function bhv_fly_guy_update() -- ... end ---- @return nil function bhv_flying_bookend_loop() -- ... end ---- @return nil function bhv_free_bowling_ball_init() -- ... end ---- @return nil function bhv_free_bowling_ball_loop() -- ... end ---- @return nil function bhv_generic_bowling_ball_spawner_init() -- ... end ---- @return nil function bhv_generic_bowling_ball_spawner_loop() -- ... end ---- @return nil function bhv_giant_pole_loop() -- ... end ---- @return nil function bhv_golden_coin_sparkles_loop() -- ... end ---- @return nil function bhv_goomba_init() -- ... end ---- @return nil function bhv_goomba_triplet_spawner_update() -- ... end ---- @return nil function bhv_goomba_update() -- ... end ---- @return nil function bhv_grand_star_init() -- ... end ---- @return nil function bhv_grand_star_loop() -- ... end ---- @return nil function bhv_grindel_thwomp_loop() -- ... end ---- @return nil function bhv_ground_sand_init() -- ... end ---- @return nil function bhv_ground_snow_init() -- ... end ---- @return nil function bhv_haunted_bookshelf_loop() -- ... end ---- @return nil function bhv_haunted_bookshelf_manager_loop() -- ... end ---- @return nil function bhv_haunted_chair_init() -- ... end ---- @return nil function bhv_haunted_chair_loop() -- ... end ---- @return nil function bhv_heave_ho_loop() -- ... end ---- @return nil function bhv_heave_ho_throw_mario_loop() -- ... end ---- @return nil function bhv_hidden_blue_coin_loop() -- ... end ---- @return nil function bhv_hidden_object_loop() -- ... end ---- @return nil function bhv_hidden_red_coin_star_init() -- ... end ---- @return nil function bhv_hidden_red_coin_star_loop() -- ... end ---- @return nil function bhv_hidden_star_init() -- ... end ---- @return nil function bhv_hidden_star_loop() -- ... end ---- @return nil function bhv_hidden_star_trigger_loop() -- ... end ---- @return nil function bhv_homing_amp_init() -- ... end ---- @return nil function bhv_homing_amp_loop() -- ... end ---- @return nil function bhv_hoot_init() -- ... end ---- @return nil function bhv_hoot_loop() -- ... end ---- @return nil function bhv_horizontal_grindel_init() -- ... end ---- @return nil function bhv_horizontal_grindel_update() -- ... end ---- @return nil function bhv_idle_water_wave_loop() -- ... end ---- @return nil function bhv_init_changing_water_level_loop() -- ... end ---- @return nil function bhv_intro_lakitu_loop() -- ... end ---- @return nil function bhv_intro_peach_loop() -- ... end ---- @return nil function bhv_intro_scene_loop() -- ... end ---- @return nil function bhv_invisible_objects_under_bridge_init() -- ... end ---- @return nil function bhv_invisible_objects_under_bridge_loop() -- ... end ---- @return nil function bhv_jet_stream_loop() -- ... end ---- @return nil function bhv_jet_stream_ring_spawner_loop() -- ... end ---- @return nil function bhv_jet_stream_water_ring_init() -- ... end ---- @return nil function bhv_jet_stream_water_ring_loop() -- ... end ---- @return nil function bhv_jrb_floating_box_loop() -- ... end ---- @return nil function bhv_jrb_sliding_box_loop() -- ... end ---- @return nil function bhv_jumping_box_loop() -- ... end ---- @return nil function bhv_kickable_board_loop() -- ... end ---- @return nil function bhv_king_bobomb_loop() -- ... end ---- @return nil function bhv_klepto_init() -- ... end ---- @return nil function bhv_klepto_update() -- ... end ---- @return nil function bhv_koopa_init() -- ... end ---- @return nil function bhv_koopa_race_endpoint_update() -- ... end ---- @return nil function bhv_koopa_shell_flame_loop() -- ... end ---- @return nil function bhv_koopa_shell_loop() -- ... end ---- @return nil function bhv_koopa_shell_underwater_loop() -- ... end ---- @return nil function bhv_koopa_update() -- ... end ---- @return nil function bhv_large_bomp_init() -- ... end ---- @return nil function bhv_large_bomp_loop() -- ... end ---- @return nil function bhv_lll_bowser_puzzle_loop() -- ... end ---- @return nil function bhv_lll_bowser_puzzle_piece_loop() -- ... end ---- @return nil function bhv_lll_drawbridge_loop() -- ... end ---- @return nil function bhv_lll_drawbridge_spawner_init() -- ... end ---- @return nil function bhv_lll_drawbridge_spawner_loop() -- ... end ---- @return nil function bhv_lll_floating_wood_bridge_loop() -- ... end ---- @return nil function bhv_lll_moving_octagonal_mesh_platform_loop() -- ... end ---- @return nil function bhv_lll_rolling_log_init() -- ... end ---- @return nil function bhv_lll_rotating_block_fire_bars_loop() -- ... end ---- @return nil function bhv_lll_rotating_hex_flame_loop() -- ... end ---- @return nil function bhv_lll_rotating_hexagonal_ring_loop() -- ... end ---- @return nil function bhv_lll_sinking_rectangular_platform_loop() -- ... end ---- @return nil function bhv_lll_sinking_rock_block_loop() -- ... end ---- @return nil function bhv_lll_sinking_square_platforms_loop() -- ... end ---- @return nil function bhv_lll_wood_piece_loop() -- ... end ---- @return nil function bhv_mad_piano_update() -- ... end ---- @return nil function bhv_manta_ray_init() -- ... end ---- @return nil function bhv_manta_ray_loop() -- ... end ---- @return nil function bhv_manta_ray_water_ring_init() -- ... end ---- @return nil function bhv_manta_ray_water_ring_loop() -- ... end ---- @return nil function bhv_menu_button_init() -- ... end ---- @return nil function bhv_menu_button_loop() -- ... end ---- @return nil function bhv_menu_button_manager_init() -- ... end ---- @return nil function bhv_menu_button_manager_loop() -- ... end ---- @return nil function bhv_merry_go_round_boo_manager_loop() -- ... end ---- @return nil function bhv_merry_go_round_loop() -- ... end ---- @return nil function bhv_metal_cap_init() -- ... end ---- @return nil function bhv_metal_cap_loop() -- ... end ---- @return nil function bhv_mips_init() -- ... end ---- @return nil function bhv_mips_loop() -- ... end ---- @return nil function bhv_moat_grills_loop() -- ... end ---- @return nil function bhv_moneybag_hidden_loop() -- ... end ---- @return nil function bhv_moneybag_init() -- ... end ---- @return nil function bhv_moneybag_loop() -- ... end ---- @return nil function bhv_monty_mole_hole_update() -- ... end ---- @return nil function bhv_monty_mole_init() -- ... end ---- @return nil function bhv_monty_mole_rock_update() -- ... end ---- @return nil function bhv_monty_mole_update() -- ... end ---- @return nil function bhv_moving_blue_coin_init() -- ... end ---- @return nil function bhv_moving_blue_coin_loop() -- ... end ---- @return nil function bhv_moving_yellow_coin_init() -- ... end ---- @return nil function bhv_moving_yellow_coin_loop() -- ... end ---- @return nil function bhv_mr_blizzard_init() -- ... end ---- @return nil function bhv_mr_blizzard_snowball() -- ... end ---- @return nil function bhv_mr_blizzard_update() -- ... end ---- @return nil function bhv_mr_i_body_loop() -- ... end ---- @return nil function bhv_mr_i_loop() -- ... end ---- @return nil function bhv_mr_i_particle_loop() -- ... end ---- @return nil function bhv_normal_cap_init() -- ... end ---- @return nil function bhv_normal_cap_loop() -- ... end ---- @return nil function bhv_object_bubble_init() -- ... end ---- @return nil function bhv_object_bubble_loop() -- ... end ---- @return nil function bhv_object_water_wave_init() -- ... end ---- @return nil function bhv_object_water_wave_loop() -- ... end ---- @return nil function bhv_openable_cage_door_loop() -- ... end ---- @return nil function bhv_openable_grill_loop() -- ... end ---- @return nil function bhv_orange_number_init() -- ... end ---- @return nil function bhv_orange_number_loop() -- ... end ---- @return nil function bhv_particle_init() -- ... end ---- @return nil function bhv_particle_loop() -- ... end ---- @return nil function bhv_penguin_race_finish_line_update() -- ... end ---- @return nil function bhv_penguin_race_shortcut_check_update() -- ... end ---- @return nil function bhv_piranha_particle_loop() -- ... end ---- @return nil function bhv_piranha_plant_bubble_loop() -- ... end ---- @return nil function bhv_piranha_plant_loop() -- ... end ---- @return nil function bhv_piranha_plant_waking_bubbles_loop() -- ... end ---- @return nil function bhv_platform_normals_init() -- ... end ---- @return nil function bhv_platform_on_track_init() -- ... end ---- @return nil function bhv_platform_on_track_update() -- ... end ---- @return nil function bhv_play_music_track_when_touched_loop() -- ... end ---- @return nil function bhv_pokey_body_part_update() -- ... end ---- @return nil function bhv_pokey_update() -- ... end ---- @return nil function bhv_pole_base_loop() -- ... end ---- @return nil function bhv_pole_init() -- ... end ---- @return nil function bhv_pound_tiny_star_particle_init() -- ... end ---- @return nil function bhv_pound_tiny_star_particle_loop() -- ... end ---- @return nil function bhv_pound_white_puffs_init() -- ... end ---- @return nil function bhv_punch_tiny_triangle_init() -- ... end ---- @return nil function bhv_punch_tiny_triangle_loop() -- ... end ---- @return nil function bhv_purple_switch_loop() -- ... end ---- @return nil function bhv_pushable_loop() -- ... end ---- @return nil function bhv_pyramid_elevator_init() -- ... end ---- @return nil function bhv_pyramid_elevator_loop() -- ... end ---- @return nil function bhv_pyramid_elevator_trajectory_marker_ball_loop() -- ... end ---- @return nil function bhv_pyramid_pillar_touch_detector_loop() -- ... end ---- @return nil function bhv_pyramid_top_fragment_init() -- ... end ---- @return nil function bhv_pyramid_top_fragment_loop() -- ... end ---- @return nil function bhv_pyramid_top_init() -- ... end ---- @return nil function bhv_pyramid_top_loop() -- ... end ---- @return nil function bhv_racing_penguin_init() -- ... end ---- @return nil function bhv_racing_penguin_update() -- ... end ---- @return nil function bhv_recovery_heart_loop() -- ... end ---- @return nil function bhv_red_coin_init() -- ... end ---- @return nil function bhv_red_coin_loop() -- ... end ---- @return nil function bhv_red_coin_star_marker_init() -- ... end ---- @return nil function bhv_respawner_loop() -- ... end ---- @return nil function bhv_rolling_log_loop() -- ... end ---- @return nil function bhv_rotating_clock_arm_loop() -- ... end ---- @return nil function bhv_rotating_exclamation_box_loop() -- ... end ---- @return nil function bhv_rotating_octagonal_plat_init() -- ... end ---- @return nil function bhv_rotating_octagonal_plat_loop() -- ... end ---- @return nil function bhv_rotating_platform_loop() -- ... end ---- @return nil function bhv_rr_cruiser_wing_init() -- ... end ---- @return nil function bhv_rr_cruiser_wing_loop() -- ... end ---- @return nil function bhv_rr_rotating_bridge_platform_loop() -- ... end ---- @return nil function bhv_sand_sound_loop() -- ... end ---- @return nil function bhv_scuttlebug_loop() -- ... end ---- @return nil function bhv_scuttlebug_spawn_loop() -- ... end ---- @return nil function bhv_seaweed_bundle_init() -- ... end ---- @return nil function bhv_seaweed_init() -- ... end ---- @return nil function bhv_seesaw_platform_init() -- ... end ---- @return nil function bhv_seesaw_platform_update() -- ... end ---- @return nil function bhv_shallow_water_splash_init() -- ... end ---- @return nil function bhv_ship_part_3_loop() -- ... end ---- @return nil function bhv_skeeter_update() -- ... end ---- @return nil function bhv_skeeter_wave_update() -- ... end ---- @return nil function bhv_sl_snowman_wind_loop() -- ... end ---- @return nil function bhv_sl_walking_penguin_loop() -- ... end ---- @return nil function bhv_sliding_plat_2_init() -- ... end ---- @return nil function bhv_sliding_plat_2_loop() -- ... end ---- @return nil function bhv_sliding_snow_mound_loop() -- ... end ---- @return nil function bhv_small_bomp_init() -- ... end ---- @return nil function bhv_small_bomp_loop() -- ... end ---- @return nil function bhv_small_bubbles_loop() -- ... end ---- @return nil function bhv_small_bully_init() -- ... end ---- @return nil function bhv_small_penguin_loop() -- ... end ---- @return nil function bhv_small_piranha_flame_loop() -- ... end ---- @return nil function bhv_small_water_wave_loop() -- ... end ---- @return nil function bhv_snow_leaf_particle_spawn_init() -- ... end ---- @return nil function bhv_snow_mound_spawn_loop() -- ... end ---- @return nil function bhv_snowmans_body_checkpoint_loop() -- ... end ---- @return nil function bhv_snowmans_bottom_init() -- ... end ---- @return nil function bhv_snowmans_bottom_loop() -- ... end ---- @return nil function bhv_snowmans_head_init() -- ... end ---- @return nil function bhv_snowmans_head_loop() -- ... end ---- @return nil function bhv_snufit_balls_loop() -- ... end ---- @return nil function bhv_snufit_loop() -- ... end ---- @return nil function bhv_sound_spawner_init() -- ... end ---- @return nil function bhv_sparkle_spawn_loop() -- ... end @@ -2104,667 +1688,534 @@ end --- @param object Object --- @param params integer --- @param networkSendEvent integer ---- @return nil function bhv_spawn_star_no_level_exit(object, params, networkSendEvent) -- ... end ---- @return nil function bhv_spawned_star_init() -- ... end ---- @return nil function bhv_spawned_star_loop() -- ... end ---- @return nil function bhv_spindel_init() -- ... end ---- @return nil function bhv_spindel_loop() -- ... end ---- @return nil function bhv_spindrift_loop() -- ... end ---- @return nil function bhv_spiny_update() -- ... end ---- @return nil function bhv_squarish_path_moving_loop() -- ... end ---- @return nil function bhv_squarish_path_parent_init() -- ... end ---- @return nil function bhv_squarish_path_parent_loop() -- ... end ---- @return nil function bhv_squishable_platform_loop() -- ... end ---- @return nil function bhv_ssl_moving_pyramid_wall_init() -- ... end ---- @return nil function bhv_ssl_moving_pyramid_wall_loop() -- ... end ---- @return nil function bhv_star_door_loop() -- ... end ---- @return nil function bhv_star_door_loop_2() -- ... end ---- @return nil function bhv_star_key_collection_puff_spawner_loop() -- ... end ---- @return nil function bhv_star_number_loop() -- ... end ---- @return nil function bhv_star_spawn_init() -- ... end ---- @return nil function bhv_star_spawn_loop() -- ... end ---- @return nil function bhv_static_checkered_platform_loop() -- ... end ---- @return nil function bhv_strong_wind_particle_loop() -- ... end ---- @return nil function bhv_sunken_ship_part_loop() -- ... end ---- @return nil function bhv_sushi_shark_collision_loop() -- ... end ---- @return nil function bhv_sushi_shark_loop() -- ... end ---- @return nil function bhv_swing_platform_init() -- ... end ---- @return nil function bhv_swing_platform_update() -- ... end ---- @return nil function bhv_swoop_update() -- ... end ---- @return nil function bhv_tank_fish_group_loop() -- ... end ---- @return nil function bhv_temp_coin_loop() -- ... end ---- @return nil function bhv_thi_bowling_ball_spawner_loop() -- ... end ---- @return nil function bhv_thi_huge_island_top_loop() -- ... end ---- @return nil function bhv_thi_tiny_island_top_loop() -- ... end ---- @return nil function bhv_tilting_bowser_lava_platform_init() -- ... end ---- @return nil function bhv_tilting_inverted_pyramid_loop() -- ... end ---- @return nil function bhv_tiny_star_particles_init() -- ... end ---- @return nil function bhv_tower_door_loop() -- ... end ---- @return nil function bhv_tower_platform_group_init() -- ... end ---- @return nil function bhv_tower_platform_group_loop() -- ... end ---- @return nil function bhv_tox_box_loop() -- ... end ---- @return nil function bhv_track_ball_update() -- ... end ---- @return nil function bhv_treasure_chest_bottom_init() -- ... end ---- @return nil function bhv_treasure_chest_bottom_loop() -- ... end ---- @return nil function bhv_treasure_chest_init() -- ... end ---- @return nil function bhv_treasure_chest_jrb_init() -- ... end ---- @return nil function bhv_treasure_chest_jrb_loop() -- ... end ---- @return nil function bhv_treasure_chest_loop() -- ... end ---- @return nil function bhv_treasure_chest_ship_init() -- ... end ---- @return nil function bhv_treasure_chest_ship_loop() -- ... end ---- @return nil function bhv_treasure_chest_top_loop() -- ... end ---- @return nil function bhv_tree_snow_or_leaf_loop() -- ... end ---- @return nil function bhv_triplet_butterfly_update() -- ... end ---- @return nil function bhv_ttc_2d_rotator_init() -- ... end ---- @return nil function bhv_ttc_2d_rotator_update() -- ... end ---- @return nil function bhv_ttc_cog_init() -- ... end ---- @return nil function bhv_ttc_cog_update() -- ... end ---- @return nil function bhv_ttc_elevator_init() -- ... end ---- @return nil function bhv_ttc_elevator_update() -- ... end ---- @return nil function bhv_ttc_moving_bar_init() -- ... end ---- @return nil function bhv_ttc_moving_bar_update() -- ... end ---- @return nil function bhv_ttc_pendulum_init() -- ... end ---- @return nil function bhv_ttc_pendulum_update() -- ... end ---- @return nil function bhv_ttc_pit_block_init() -- ... end ---- @return nil function bhv_ttc_pit_block_update() -- ... end ---- @return nil function bhv_ttc_rotating_solid_init() -- ... end ---- @return nil function bhv_ttc_rotating_solid_update() -- ... end ---- @return nil function bhv_ttc_spinner_update() -- ... end ---- @return nil function bhv_ttc_treadmill_init() -- ... end ---- @return nil function bhv_ttc_treadmill_update() -- ... end ---- @return nil function bhv_ttm_rolling_log_init() -- ... end ---- @return nil function bhv_tumbling_bridge_loop() -- ... end ---- @return nil function bhv_tumbling_bridge_platform_loop() -- ... end ---- @return nil function bhv_tuxies_mother_loop() -- ... end ---- @return nil function bhv_tweester_loop() -- ... end ---- @return nil function bhv_tweester_sand_particle_loop() -- ... end ---- @return nil function bhv_ukiki_cage_loop() -- ... end ---- @return nil function bhv_ukiki_cage_star_loop() -- ... end ---- @return nil function bhv_ukiki_init() -- ... end ---- @return nil function bhv_ukiki_loop() -- ... end ---- @return nil function bhv_unagi_init() -- ... end ---- @return nil function bhv_unagi_loop() -- ... end ---- @return nil function bhv_unagi_subobject_loop() -- ... end ---- @return nil function bhv_unused_particle_spawn_loop() -- ... end ---- @return nil function bhv_unused_poundable_platform() -- ... end ---- @return nil function bhv_vanish_cap_init() -- ... end ---- @return nil function bhv_volcano_flames_loop() -- ... end ---- @return nil function bhv_volcano_sound_loop() -- ... end ---- @return nil function bhv_volcano_trap_loop() -- ... end ---- @return nil function bhv_wall_tiny_star_particle_loop() -- ... end ---- @return nil function bhv_warp_loop() -- ... end ---- @return nil function bhv_water_air_bubble_init() -- ... end ---- @return nil function bhv_water_air_bubble_loop() -- ... end ---- @return nil function bhv_water_bomb_cannon_loop() -- ... end ---- @return nil function bhv_water_bomb_shadow_update() -- ... end ---- @return nil function bhv_water_bomb_spawner_update() -- ... end ---- @return nil function bhv_water_bomb_update() -- ... end ---- @return nil function bhv_water_droplet_loop() -- ... end ---- @return nil function bhv_water_droplet_splash_init() -- ... end ---- @return nil function bhv_water_level_diamond_loop() -- ... end ---- @return nil function bhv_water_level_pillar_init() -- ... end ---- @return nil function bhv_water_level_pillar_loop() -- ... end ---- @return nil function bhv_water_mist_2_loop() -- ... end ---- @return nil function bhv_water_mist_loop() -- ... end ---- @return nil function bhv_water_mist_spawn_loop() -- ... end ---- @return nil function bhv_water_splash_spawn_droplets() -- ... end ---- @return nil function bhv_water_waves_init() -- ... end ---- @return nil function bhv_waterfall_sound_loop() -- ... end ---- @return nil function bhv_wave_trail_shrink() -- ... end ---- @return nil function bhv_wdw_express_elevator_loop() -- ... end ---- @return nil function bhv_wf_breakable_wall_loop() -- ... end ---- @return nil function bhv_wf_elevator_tower_platform_loop() -- ... end ---- @return nil function bhv_wf_rotating_wooden_platform_init() -- ... end ---- @return nil function bhv_wf_rotating_wooden_platform_loop() -- ... end ---- @return nil function bhv_wf_sliding_platform_init() -- ... end ---- @return nil function bhv_wf_sliding_platform_loop() -- ... end ---- @return nil function bhv_wf_sliding_tower_platform_loop() -- ... end ---- @return nil function bhv_wf_solid_tower_platform_loop() -- ... end ---- @return nil function bhv_whirlpool_init() -- ... end ---- @return nil function bhv_whirlpool_loop() -- ... end ---- @return nil function bhv_white_puff_1_loop() -- ... end ---- @return nil function bhv_white_puff_2_loop() -- ... end ---- @return nil function bhv_white_puff_exploding_loop() -- ... end ---- @return nil function bhv_white_puff_smoke_init() -- ... end ---- @return nil function bhv_whomp_loop() -- ... end ---- @return nil function bhv_wiggler_body_part_update() -- ... end ---- @return nil function bhv_wiggler_update() -- ... end ---- @return nil function bhv_wind_loop() -- ... end ---- @return nil function bhv_wing_cap_init() -- ... end ---- @return nil function bhv_wing_vanish_cap_loop() -- ... end ---- @return nil function bhv_wooden_post_update() -- ... end ---- @return nil function bhv_yellow_coin_init() -- ... end ---- @return nil function bhv_yellow_coin_loop() -- ... end ---- @return nil function bhv_yoshi_init() -- ... end ---- @return nil function bhv_yoshi_loop() -- ... end @@ -2777,7 +2228,6 @@ function check_if_moving_over_floor(a0, a1) end --- @param flags integer ---- @return nil function clear_particle_flags(flags) -- ... end @@ -2785,7 +2235,6 @@ end --- @param sp28 number --- @param sp2C number --- @param sp30 integer ---- @return nil function common_anchor_mario_behavior(sp28, sp2C, sp30) -- ... end @@ -2795,7 +2244,6 @@ end --- @param relPosX number --- @param relPosY number --- @param relPosZ number ---- @return nil function cur_obj_spawn_strong_wind_particles(windSpread, scale, relPosX, relPosY, relPosZ) -- ... end @@ -2805,13 +2253,11 @@ function mario_moving_fast_enough_to_make_piranha_plant_bite() -- ... end ---- @return nil function obj_set_secondary_camera_focus() -- ... end --- @param walk integer ---- @return nil function play_penguin_walking_sound(walk) -- ... end @@ -2824,7 +2270,6 @@ function spawn_default_star(x, y, z) -- ... end ---- @return nil function spawn_mist_from_global() -- ... end @@ -2832,7 +2277,6 @@ end --- @param count integer --- @param offsetY integer --- @param size number ---- @return nil function spawn_mist_particles_variable(count, offsetY, size) -- ... end @@ -2853,7 +2297,6 @@ function spawn_red_coin_cutscene_star(x, y, z) -- ... end ---- @return nil function spawn_star_number() -- ... end @@ -2862,14 +2305,12 @@ end --- @param triModel integer --- @param triSize number --- @param triAnimState integer ---- @return nil function spawn_triangle_break_particles(numTris, triModel, triSize, triAnimState) -- ... end --- @param pitch integer --- @param yaw integer ---- @return nil function spawn_wind_particles(pitch, yaw) -- ... end @@ -2878,7 +2319,6 @@ end --- @param a1 number --- @param deltaPitch integer --- @param deltaRoll integer ---- @return nil function tox_box_move(forwardVel, a1, deltaPitch, deltaRoll) -- ... end @@ -2889,14 +2329,12 @@ function update_angle_from_move_flags(angle) -- ... end ---- @return nil function uv_update_scroll() -- ... end --- @param dest Vec3f --- @param src Vec3f ---- @return nil function vec3f_copy_2(dest, src) -- ... end @@ -2934,7 +2372,6 @@ end --- @param c Camera --- @param goal number --- @param inc number ---- @return nil function approach_camera_height(c, goal, inc) -- ... end @@ -2976,7 +2413,6 @@ end --- @param xMul number --- @param yMul number --- @param zMul number ---- @return nil function approach_vec3f_asymptotic(current, target, xMul, yMul, zMul) -- ... end @@ -2999,7 +2435,6 @@ end --- @param to Vec3f --- @param pitch Pointer_integer --- @param yaw Pointer_integer ---- @return nil function calculate_angles(from, to, pitch, yaw) -- ... end @@ -3055,12 +2490,10 @@ function camera_course_processing(c) end --- @param enable integer ---- @return nil function camera_set_use_course_specific_settings(enable) -- ... end ---- @return nil function center_rom_hack_camera() -- ... end @@ -3116,7 +2549,6 @@ function cutscene_object_without_dialog(cutscene, o) end --- @param preset integer ---- @return nil function cutscene_set_fov_shake_preset(preset) -- ... end @@ -3137,7 +2569,6 @@ function find_c_buttons_pressed(currentState, buttonsPressed, buttonsDown) end --- @param pg PlayerGeometry ---- @return nil function find_mario_floor_and_ceil(pg) -- ... end @@ -3149,7 +2580,6 @@ function get_cutscene_from_mario_status(c) end --- @param c Camera ---- @return nil function handle_c_button_movement(c) -- ... end @@ -3173,7 +2603,6 @@ function is_within_100_units_of_mario(posX, posY, posZ) end --- @param c Camera ---- @return nil function move_mario_head_c_up(c) -- ... end @@ -3196,14 +2625,12 @@ end --- @param yawOff integer --- @param pitchDiv integer --- @param yawDiv integer ---- @return nil function obj_rotate_towards_point(o, point, pitchOff, yawOff, pitchDiv, yawDiv) -- ... end --- @param dst Vec3f --- @param o Object ---- @return nil function object_pos_to_vec3f(dst, o) -- ... end @@ -3212,7 +2639,6 @@ end --- @param from Vec3f --- @param to Vec3f --- @param rotation Vec3s ---- @return nil function offset_rotated(dst, from, to, rotation) -- ... end @@ -3224,53 +2650,43 @@ function offset_yaw_outward_radial(c, areaYaw) -- ... end ---- @return nil function play_camera_buzz_if_c_sideways() -- ... end ---- @return nil function play_camera_buzz_if_cbutton() -- ... end ---- @return nil function play_camera_buzz_if_cdown() -- ... end --- @param c Camera ---- @return nil function play_cutscene(c) -- ... end ---- @return nil function play_sound_button_change_blocked() -- ... end ---- @return nil function play_sound_cbutton_down() -- ... end ---- @return nil function play_sound_cbutton_side() -- ... end ---- @return nil function play_sound_cbutton_up() -- ... end ---- @return nil function play_sound_if_cam_switched_to_lakitu_or_mario() -- ... end ---- @return nil function play_sound_rbutton_changed() -- ... end @@ -3286,26 +2702,22 @@ end --- @param xRange integer --- @param yRange integer --- @param zRange integer ---- @return nil function random_vec3s(dst, xRange, yRange, zRange) -- ... end --- @param c Camera ---- @return nil function reset_camera(c) -- ... end --- @param pos Vec3f --- @param lastGood Vec3f ---- @return nil function resolve_geometry_collisions(pos, lastGood) -- ... end --- @param enable integer ---- @return nil function rom_hack_cam_set_collisions(enable) -- ... end @@ -3322,7 +2734,6 @@ end --- @param dst Vec3f --- @param src Vec3f --- @param yaw integer ---- @return nil function rotate_in_xz(dst, src, yaw) -- ... end @@ -3330,7 +2741,6 @@ end --- @param dst Vec3f --- @param src Vec3f --- @param pitch integer ---- @return nil function rotate_in_yz(dst, src, pitch) -- ... end @@ -3339,12 +2749,10 @@ end --- @param from Vec3f --- @param to Vec3f --- @param scale number ---- @return nil function scale_along_line(dest, from, to, scale) -- ... end ---- @return nil function select_mario_cam_mode() -- ... end @@ -3358,7 +2766,6 @@ end --- @param c Camera --- @param mode integer --- @param frames integer ---- @return nil function set_camera_mode(c, mode, frames) -- ... end @@ -3375,7 +2782,6 @@ end --- @param mag integer --- @param decay integer --- @param inc integer ---- @return nil function set_camera_pitch_shake(mag, decay, inc) -- ... end @@ -3383,13 +2789,11 @@ end --- @param mag integer --- @param decay integer --- @param inc integer ---- @return nil function set_camera_roll_shake(mag, decay, inc) -- ... end --- @param shake integer ---- @return nil function set_camera_shake_from_hit(shake) -- ... end @@ -3398,7 +2802,6 @@ end --- @param posX number --- @param posY number --- @param posZ number ---- @return nil function set_camera_shake_from_point(shake, posX, posY, posZ) -- ... end @@ -3406,25 +2809,21 @@ end --- @param mag integer --- @param decay integer --- @param inc integer ---- @return nil function set_camera_yaw_shake(mag, decay, inc) -- ... end --- @param shake integer ---- @return nil function set_environmental_camera_shake(shake) -- ... end --- @param preset integer ---- @return nil function set_fixed_cam_axis_sa_lobby(preset) -- ... end --- @param func integer ---- @return nil function set_fov_function(func) -- ... end @@ -3432,7 +2831,6 @@ end --- @param amplitude integer --- @param decay integer --- @param shakeSpeed integer ---- @return nil function set_fov_shake(amplitude, decay, shakeSpeed) -- ... end @@ -3441,13 +2839,11 @@ end --- @param posX number --- @param posY number --- @param posZ number ---- @return nil function set_fov_shake_from_point_preset(preset, posX, posY, posZ) -- ... end --- @param mode integer ---- @return nil function set_handheld_shake(mode) -- ... end @@ -3473,7 +2869,6 @@ end --- @param xMul number --- @param yMul number --- @param zMul number ---- @return nil function set_or_approach_vec3f_asymptotic(dst, goal, xMul, yMul, zMul) -- ... end @@ -3485,47 +2880,40 @@ end --- @param posX number --- @param posY number --- @param posZ number ---- @return nil function set_pitch_shake_from_point(mag, decay, inc, maxDist, posX, posY, posZ) -- ... end --- @param pos Vec3f --- @param focus Vec3f ---- @return nil function shake_camera_handheld(pos, focus) -- ... end --- @param pos Vec3f --- @param focus Vec3f ---- @return nil function shake_camera_pitch(pos, focus) -- ... end --- @param roll Pointer_integer ---- @return nil function shake_camera_roll(roll) -- ... end --- @param pos Vec3f --- @param focus Vec3f ---- @return nil function shake_camera_yaw(pos, focus) -- ... end --- @param c Camera ---- @return nil function soft_reset_camera(c) -- ... end --- @param c Camera --- @param cutscene integer ---- @return nil function start_cutscene(c, cutscene) -- ... end @@ -3538,7 +2926,6 @@ end --- @param c Camera --- @param frames integer ---- @return nil function transition_next_state(c, frames) -- ... end @@ -3551,14 +2938,12 @@ end --- @param dst Vec3f --- @param src Vec3f ---- @return nil function vec3f_sub(dst, src) -- ... end --- @param o Object --- @param src Vec3f ---- @return nil function vec3f_to_object_pos(o, src) -- ... end @@ -3566,7 +2951,6 @@ end --- @param displacementX number --- @param displacementY number --- @param displacementZ number ---- @return nil function warp_camera(displacementX, displacementY, displacementZ) -- ... end @@ -3592,7 +2976,6 @@ end --- @param m MarioState --- @param characterSound CharacterSound ---- @return nil function play_character_sound(m, characterSound) -- ... end @@ -3600,7 +2983,6 @@ end --- @param m MarioState --- @param characterSound CharacterSound --- @param flags integer ---- @return nil function play_character_sound_if_no_flag(m, characterSound, flags) -- ... end @@ -3608,29 +2990,24 @@ end --- @param m MarioState --- @param characterSound CharacterSound --- @param offset integer ---- @return nil function play_character_sound_offset(m, characterSound, offset) -- ... end --- @param m MarioState ---- @return nil function update_character_anim_offset(m) -- ... end --- @param message string ---- @return nil function djui_chat_message_create(message) -- ... end ---- @return nil function djui_console_message_dequeue() -- ... end ---- @return nil function djui_console_toggle() -- ... end @@ -3705,7 +3082,6 @@ end --- @param x number --- @param y number --- @param scale number ---- @return nil function djui_hud_print_text(message, x, y, scale) -- ... end @@ -3717,7 +3093,6 @@ end --- @param x number --- @param y number --- @param scale number ---- @return nil function djui_hud_print_text_interpolated(message, prevX, prevY, prevScale, x, y, scale) -- ... end @@ -3726,7 +3101,6 @@ end --- @param y number --- @param width number --- @param height number ---- @return nil function djui_hud_render_rect(x, y, width, height) -- ... end @@ -3739,12 +3113,10 @@ end --- @param y number --- @param width number --- @param height number ---- @return nil function djui_hud_render_rect_interpolated(prevX, prevY, prevWidth, prevHeight, x, y, width, height) -- ... end ---- @return nil function djui_hud_reset_color() -- ... end @@ -3753,31 +3125,26 @@ end --- @param g integer --- @param b integer --- @param a integer ---- @return nil function djui_hud_set_color(r, g, b, a) -- ... end --- @param filterType HudUtilsFilter ---- @return nil function djui_hud_set_filter(filterType) -- ... end --- @param fontType integer ---- @return nil function djui_hud_set_font(fontType) -- ... end --- @param locked boolean ---- @return nil function djui_hud_set_mouse_locked(locked) -- ... end --- @param resolutionType HudUtilsResolution ---- @return nil function djui_hud_set_resolution(resolutionType) -- ... end @@ -3785,7 +3152,6 @@ end --- @param rotation integer --- @param pivotX number --- @param pivotY number ---- @return nil function djui_hud_set_rotation(rotation, pivotX, pivotY) -- ... end @@ -3797,19 +3163,16 @@ function djui_hud_world_pos_to_screen_pos(pos, out) -- ... end ---- @return nil function djui_open_pause_menu() -- ... end --- @param message string --- @param lines integer ---- @return nil function djui_popup_create(message, lines) -- ... end ---- @return nil function drop_queued_background_music() -- ... end @@ -3817,14 +3180,12 @@ end --- @param player integer --- @param targetScale integer --- @param fadeDuration integer ---- @return nil function fade_volume_scale(player, targetScale, fadeDuration) -- ... end --- @param arg0 integer --- @param fadeOut integer ---- @return nil function fadeout_background_music(arg0, fadeOut) -- ... end @@ -3854,13 +3215,11 @@ function is_current_background_music_volume_lowered() -- ... end ---- @return nil function play_course_clear() -- ... end --- @param dialogID integer ---- @return nil function play_dialog_sound(dialogID) -- ... end @@ -3868,28 +3227,23 @@ end --- @param player integer --- @param seqArgs integer --- @param fadeTimer integer ---- @return nil function play_music(player, seqArgs, fadeTimer) -- ... end ---- @return nil function play_peachs_jingle() -- ... end --- @param arg0 integer ---- @return nil function play_power_star_jingle(arg0) -- ... end ---- @return nil function play_puzzle_jingle() -- ... end ---- @return nil function play_race_fanfare() -- ... end @@ -3898,14 +3252,12 @@ end --- @param bgMusicVolume integer --- @param volume integer --- @param fadeTimer integer ---- @return nil function play_secondary_music(seqId, bgMusicVolume, volume, fadeTimer) -- ... end --- @param soundBits integer --- @param pos Vec3f ---- @return nil function play_sound(soundBits, pos) -- ... end @@ -3913,24 +3265,20 @@ end --- @param soundBits integer --- @param pos Vec3f --- @param freqScale number ---- @return nil function play_sound_with_freq_scale(soundBits, pos, freqScale) -- ... end ---- @return nil function play_star_fanfare() -- ... end ---- @return nil function play_toads_jingle() -- ... end --- @param player integer --- @param fadeDuration integer ---- @return nil function seq_player_fade_out(player, fadeDuration) -- ... end @@ -3938,64 +3286,54 @@ end --- @param player integer --- @param fadeDuration integer --- @param percentage integer ---- @return nil function seq_player_lower_volume(player, fadeDuration, percentage) -- ... end --- @param player integer --- @param fadeDuration integer ---- @return nil function seq_player_unlower_volume(player, fadeDuration) -- ... end --- @param fadeOutTime integer ---- @return nil function set_audio_fadeout(fadeOutTime) -- ... end --- @param player integer --- @param bankMask integer ---- @return nil function sound_banks_disable(player, bankMask) -- ... end --- @param player integer --- @param bankMask integer ---- @return nil function sound_banks_enable(player, bankMask) -- ... end --- @param seqId integer ---- @return nil function stop_background_music(seqId) -- ... end --- @param fadeTimer integer ---- @return nil function stop_secondary_music(fadeTimer) -- ... end --- @param soundBits integer --- @param pos Vec3f ---- @return nil function stop_sound(soundBits, pos) -- ... end --- @param pos Vec3f ---- @return nil function stop_sounds_from_source(pos) -- ... end ---- @return nil function stop_sounds_in_continuous_banks() -- ... end @@ -4006,7 +3344,6 @@ function first_person_check_cancels(m) -- ... end ---- @return nil function first_person_reset() -- ... end @@ -4017,47 +3354,39 @@ function get_first_person_enabled() end --- @param enable boolean ---- @return nil function set_first_person_enabled(enable) -- ... end --- @param dialog integer ---- @return nil function create_dialog_box(dialog) -- ... end --- @param dialog integer ---- @return nil function create_dialog_box_with_response(dialog) -- ... end --- @param dialog integer --- @param dialogVar integer ---- @return nil function create_dialog_box_with_var(dialog, dialogVar) -- ... end --- @param dialog integer ---- @return nil function create_dialog_inverted_box(dialog) -- ... end ---- @return nil function reset_dialog_override_color() -- ... end ---- @return nil function reset_dialog_override_pos() -- ... end ---- @return nil function reset_dialog_render_state() -- ... end @@ -4070,26 +3399,22 @@ end --- @param textG integer --- @param textB integer --- @param textA integer ---- @return nil function set_dialog_override_color(bgR, bgG, bgB, bgA, textR, textG, textB, textA) -- ... end --- @param x integer --- @param y integer ---- @return nil function set_dialog_override_pos(x, y) -- ... end --- @param mode integer ---- @return nil function set_menu_mode(mode) -- ... end --- @param width integer ---- @return nil function set_min_dialog_width(width) -- ... end @@ -4355,7 +3680,6 @@ end --- @param m MarioState --- @param capSpeed number ---- @return nil function mario_blow_off_cap(m, capSpeed) -- ... end @@ -4367,7 +3691,6 @@ function mario_check_object_grab(m) end --- @param m MarioState ---- @return nil function mario_drop_held_object(m) -- ... end @@ -4380,7 +3703,6 @@ function mario_get_collided_object(m, interactType) end --- @param m MarioState ---- @return nil function mario_grab_used_object(m) -- ... end @@ -4400,25 +3722,21 @@ function mario_obj_angle_to_object(m, o) end --- @param m MarioState ---- @return nil function mario_retrieve_cap(m) -- ... end --- @param m MarioState ---- @return nil function mario_stop_riding_and_holding(m) -- ... end --- @param m MarioState ---- @return nil function mario_stop_riding_object(m) -- ... end --- @param m MarioState ---- @return nil function mario_throw_held_object(m) -- ... end @@ -4505,7 +3823,6 @@ end --- @param arg integer --- @param color integer ---- @return nil function fade_into_special_warp(arg, color) -- ... end @@ -4516,7 +3833,6 @@ function get_painting_warp_node() end --- @param paintingIndex integer ---- @return nil function initiate_painting_warp(paintingIndex) -- ... end @@ -4541,13 +3857,11 @@ function lvl_set_current_level(arg0, levelNum) end --- @param arg integer ---- @return nil function warp_special(arg) -- ... end --- @param m MarioState ---- @return nil function adjust_sound_for_speed(m) -- ... end @@ -4617,7 +3931,6 @@ function hurt_and_set_mario_action(m, action, actionArg, hurtCounter) end --- @param m MarioState ---- @return nil function init_single_mario(m) -- ... end @@ -4691,21 +4004,18 @@ function mario_is_crouching(m) end --- @param m MarioState ---- @return nil function mario_set_bubbled(m) -- ... end --- @param m MarioState --- @param speed number ---- @return nil function mario_set_forward_vel(m, speed) -- ... end --- @param m MarioState --- @param wcd WallCollisionData ---- @return nil function mario_update_wall(m, wcd) -- ... end @@ -4713,41 +4023,35 @@ end --- @param m MarioState --- @param soundBits integer --- @param waveParticleType integer ---- @return nil function play_mario_action_sound(m, soundBits, waveParticleType) -- ... end --- @param m MarioState --- @param soundBits integer ---- @return nil function play_mario_heavy_landing_sound(m, soundBits) -- ... end --- @param m MarioState --- @param soundBits integer ---- @return nil function play_mario_heavy_landing_sound_once(m, soundBits) -- ... end --- @param m MarioState ---- @return nil function play_mario_jump_sound(m) -- ... end --- @param m MarioState --- @param soundBits integer ---- @return nil function play_mario_landing_sound(m, soundBits) -- ... end --- @param m MarioState --- @param soundBits integer ---- @return nil function play_mario_landing_sound_once(m, soundBits) -- ... end @@ -4755,7 +4059,6 @@ end --- @param m MarioState --- @param primarySoundBits integer --- @param scondarySoundBits integer ---- @return nil function play_mario_sound(m, primarySoundBits, scondarySoundBits) -- ... end @@ -4763,7 +4066,6 @@ end --- @param m MarioState --- @param soundBits integer --- @param waveParticleType integer ---- @return nil function play_sound_and_spawn_particles(m, soundBits, waveParticleType) -- ... end @@ -4771,7 +4073,6 @@ end --- @param m MarioState --- @param soundBits integer --- @param flags integer ---- @return nil function play_sound_if_no_flag(m, soundBits, flags) -- ... end @@ -4788,7 +4089,6 @@ end --- @param offset number --- @param radius number --- @param collisionData WallCollisionData ---- @return nil function resolve_and_return_wall_collisions_data(pos, offset, radius, collisionData) -- ... end @@ -4801,7 +4101,6 @@ end --- @param m MarioState --- @param animFrame integer ---- @return nil function set_anim_to_frame(m, animFrame) -- ... end @@ -4861,7 +4160,6 @@ end --- @param m MarioState --- @param flags integer --- @param clear integer ---- @return nil function set_mario_particle_flags(m, flags, clear) -- ... end @@ -4869,13 +4167,11 @@ end --- @param m MarioState --- @param initialVelY number --- @param multiplier number ---- @return nil function set_mario_y_vel_based_on_fspeed(m, initialVelY, multiplier) -- ... end --- @param m MarioState ---- @return nil function set_steep_jump_action(m) -- ... end @@ -4893,13 +4189,11 @@ function transition_submerged_to_walking(m) end --- @param m MarioState ---- @return nil function update_mario_pos_for_anim(m) -- ... end --- @param m MarioState ---- @return nil function update_mario_sound_and_camera(m) -- ... end @@ -4974,7 +4268,6 @@ function mario_execute_airborne_action(m) end --- @param m MarioState ---- @return nil function play_far_fall_sound(m) -- ... end @@ -4983,13 +4276,11 @@ end --- @param frame1 integer --- @param frame2 integer --- @param frame3 integer ---- @return nil function play_flip_sounds(m, frame1, frame2, frame3) -- ... end --- @param m MarioState ---- @return nil function play_knockback_sound(m) -- ... end @@ -5001,43 +4292,36 @@ function should_get_stuck_in_ground(m) end --- @param m MarioState ---- @return nil function update_air_with_turn(m) -- ... end --- @param m MarioState ---- @return nil function update_air_without_turn(m) -- ... end --- @param m MarioState ---- @return nil function update_flying(m) -- ... end --- @param m MarioState ---- @return nil function update_flying_pitch(m) -- ... end --- @param m MarioState ---- @return nil function update_flying_yaw(m) -- ... end --- @param m MarioState ---- @return nil function update_lava_boost_or_twirling(m) -- ... end --- @param m MarioState ---- @return nil function add_tree_leaf_particles(m) -- ... end @@ -5049,7 +4333,6 @@ function check_common_automatic_cancels(m) end --- @param m MarioState ---- @return nil function climb_up_ledge(m) -- ... end @@ -5075,7 +4358,6 @@ end --- @param m MarioState --- @param b integer ---- @return nil function play_climbing_sounds(m, b) -- ... end @@ -5094,7 +4376,6 @@ function update_hang_moving(m) end --- @param m MarioState ---- @return nil function update_hang_stationary(m) -- ... end @@ -5102,23 +4383,19 @@ end --- @param m MarioState --- @param animation integer --- @param endAction integer ---- @return nil function update_ledge_climb(m, animation, endAction) -- ... end --- @param m MarioState ---- @return nil function update_ledge_climb_camera(m) -- ... end ---- @return nil function bhv_end_peach_loop() -- ... end ---- @return nil function bhv_end_toad_loop() -- ... end @@ -5132,20 +4409,17 @@ function common_death_handler(m, animation, frameToDeathWarp) end --- @param m MarioState ---- @return nil function cutscene_put_cap_on(m) -- ... end --- @param m MarioState ---- @return nil function cutscene_take_cap_off(m) -- ... end --- @param m MarioState --- @param isInWater integer ---- @return nil function general_star_dance_handler(m, isInWater) -- ... end @@ -5154,7 +4428,6 @@ end --- @param y integer --- @param z integer --- @param radius number ---- @return nil function generate_yellow_sparkles(x, y, z, radius) -- ... end @@ -5172,7 +4445,6 @@ function get_star_collection_dialog(m) end --- @param m MarioState ---- @return nil function handle_save_menu(m) -- ... end @@ -5211,13 +4483,11 @@ end --- @param target2 integer --- @param target3 integer --- @param endAction integer ---- @return nil function stuck_in_ground_handler(m, animation, unstuckFrame, target2, target3, endAction) -- ... end --- @param m MarioState ---- @return nil function align_with_floor(m) -- ... end @@ -5229,19 +4499,16 @@ function analog_stick_held_back(m) end --- @param m MarioState ---- @return nil function anim_and_audio_for_heavy_walk(m) -- ... end --- @param m MarioState ---- @return nil function anim_and_audio_for_hold_walk(m) -- ... end --- @param m MarioState ---- @return nil function anim_and_audio_for_walk(m) -- ... end @@ -5254,7 +4521,6 @@ function apply_landing_accel(m, frictionFactor) end --- @param m MarioState ---- @return nil function apply_slope_accel(m) -- ... end @@ -5294,7 +4560,6 @@ function check_ground_dive_or_punch(m) end --- @param m MarioState ---- @return nil function check_ledge_climb_down(m) -- ... end @@ -5321,7 +4586,6 @@ end --- @param endAction integer --- @param airAction integer --- @param animation integer ---- @return nil function common_slide_action(m, endAction, airAction, animation) -- ... end @@ -5345,14 +4609,12 @@ end --- @param m MarioState --- @param frame1 integer --- @param frame2 integer ---- @return nil function play_step_sound(m, frame1, frame2) -- ... end --- @param m MarioState --- @param startPos Vec3f ---- @return nil function push_or_sidle_wall(m, startPos) -- ... end @@ -5384,7 +4646,6 @@ end --- @param m MarioState --- @param fastAction integer --- @param slowAction integer ---- @return nil function slide_bonk(m, fastAction, slowAction) -- ... end @@ -5399,14 +4660,12 @@ function stomach_slide_action(m, stopAction, airAction, animation) end --- @param m MarioState ---- @return nil function tilt_body_butt_slide(m) -- ... end --- @param m MarioState --- @param startYaw integer ---- @return nil function tilt_body_ground_shell(m, startYaw) -- ... end @@ -5419,7 +4678,6 @@ end --- @param m MarioState --- @param startYaw integer ---- @return nil function tilt_body_walking(m, startYaw) -- ... end @@ -5431,7 +4689,6 @@ function update_decelerating_speed(m) end --- @param m MarioState ---- @return nil function update_shell_speed(m) -- ... end @@ -5446,13 +4703,11 @@ end --- @param m MarioState --- @param accel number --- @param lossFactor number ---- @return nil function update_sliding_angle(m, accel, lossFactor) -- ... end --- @param m MarioState ---- @return nil function update_walking_speed(m) -- ... end @@ -5460,7 +4715,6 @@ end --- @param m MarioState --- @param animation integer --- @param endAction integer ---- @return nil function animated_stationary_ground_step(m, animation, endAction) -- ... end @@ -5526,7 +4780,6 @@ end --- @param actionState integer --- @param animFrame integer --- @param sound integer ---- @return nil function play_anim_sound(m, actionState, animFrame, sound) -- ... end @@ -5534,20 +4787,17 @@ end --- @param m MarioState --- @param animID integer --- @param action integer ---- @return nil function stopping_step(m, animID, action) -- ... end --- @param m MarioState --- @param step Vec3f ---- @return nil function apply_water_current(m, step) -- ... end --- @param m MarioState ---- @return nil function float_surface_gfx(m) -- ... end @@ -5573,27 +4823,22 @@ end --- @param m MarioState --- @param particleFlag integer ---- @return nil function set_swimming_at_surface_particles(m, particleFlag) -- ... end ---- @return nil function bhv_toad_message_init() -- ... end ---- @return nil function bhv_toad_message_loop() -- ... end ---- @return nil function bhv_unlock_door_star_init() -- ... end ---- @return nil function bhv_unlock_door_star_loop() -- ... end @@ -5610,14 +4855,12 @@ end --- @param yaw integer --- @param conversionRatio number --- @param radius number ---- @return nil function init_bully_collision_data(data, posX, posZ, forwardVel, yaw, conversionRatio, radius) -- ... end --- @param arg0 MarioState --- @param arg1 integer ---- @return nil function mario_bonk_reflection(arg0, arg1) -- ... end @@ -5663,7 +4906,6 @@ function perform_ground_step(arg0) end --- @param m MarioState ---- @return nil function set_vel_from_pitch_and_yaw(m) -- ... end @@ -5675,14 +4917,12 @@ function stationary_ground_step(arg0) end --- @param arg0 MarioState ---- @return nil function stop_and_set_height_to_floor(arg0) -- ... end --- @param m MarioState --- @param keyFrames Pointer_Vec4s ---- @return nil function anim_spline_init(m, keyFrames) -- ... end @@ -5724,7 +4964,6 @@ end --- @param dest Vec3f --- @param objMtx Mat4 --- @param camMtx Mat4 ---- @return nil function get_pos_from_transform_mtx(dest, objMtx, camMtx) -- ... end @@ -5733,7 +4972,6 @@ end --- @param upDir Vec3f --- @param pos Vec3f --- @param yaw integer ---- @return nil function mtxf_align_terrain_normal(dest, upDir, pos, yaw) -- ... end @@ -5742,7 +4980,6 @@ end --- @param pos Vec3f --- @param yaw integer --- @param radius number ---- @return nil function mtxf_align_terrain_triangle(mtx, pos, yaw, radius) -- ... end @@ -5751,14 +4988,12 @@ end --- @param mtx Mat4 --- @param position Vec3f --- @param angle integer ---- @return nil function mtxf_billboard(dest, mtx, position, angle) -- ... end --- @param dest Mat4 --- @param src Mat4 ---- @return nil function mtxf_copy(dest, src) -- ... end @@ -5767,20 +5002,17 @@ end --- @param mtx Mat4 --- @param position Vec3f --- @param angle integer ---- @return nil function mtxf_cylboard(dest, mtx, position, angle) -- ... end --- @param mtx Mat4 ---- @return nil function mtxf_identity(mtx) -- ... end --- @param dest Mat4 --- @param src Mat4 ---- @return nil function mtxf_inverse(dest, src) -- ... end @@ -5789,7 +5021,6 @@ end --- @param from Vec3f --- @param to Vec3f --- @param roll integer ---- @return nil function mtxf_lookat(mtx, from, to, roll) -- ... end @@ -5797,21 +5028,18 @@ end --- @param dest Mat4 --- @param a Mat4 --- @param b Mat4 ---- @return nil function mtxf_mul(dest, a, b) -- ... end --- @param mtx Mat4 --- @param b Vec3s ---- @return nil function mtxf_mul_vec3s(mtx, b) -- ... end --- @param mtx Pointer_Mtx --- @param angle integer ---- @return nil function mtxf_rotate_xy(mtx, angle) -- ... end @@ -5819,7 +5047,6 @@ end --- @param dest Mat4 --- @param b Vec3f --- @param c Vec3s ---- @return nil function mtxf_rotate_xyz_and_translate(dest, b, c) -- ... end @@ -5827,7 +5054,6 @@ end --- @param dest Mat4 --- @param translate Vec3f --- @param rotate Vec3s ---- @return nil function mtxf_rotate_zxy_and_translate(dest, translate, rotate) -- ... end @@ -5835,21 +5061,18 @@ end --- @param dest Mat4 --- @param mtx Mat4 --- @param s Vec3f ---- @return nil function mtxf_scale_vec3f(dest, mtx, s) -- ... end --- @param dest Pointer_Mtx --- @param src Mat4 ---- @return nil function mtxf_to_mtx(dest, src) -- ... end --- @param dest Mat4 --- @param b Vec3f ---- @return nil function mtxf_translate(dest, b) -- ... end @@ -5865,7 +5088,6 @@ end --- @param result Vec4f --- @param t number --- @param c integer ---- @return nil function spline_get_weights(m, result, t, c) -- ... end @@ -5882,7 +5104,6 @@ end --- @param vecB Vec3f --- @param sclA number --- @param sclB number ---- @return nil function vec3f_combine(dest, vecA, vecB, sclA, sclB) -- ... end @@ -5929,7 +5150,6 @@ end --- @param dist Pointer_number --- @param pitch Pointer_integer --- @param yaw Pointer_integer ---- @return nil function vec3f_get_dist_and_angle(from, to, dist, pitch, yaw) -- ... end @@ -5956,7 +5176,6 @@ end --- @param vec Vec3f --- @param onto Vec3f --- @param out Vec3f ---- @return nil function vec3f_project(vec, onto, out) -- ... end @@ -5982,7 +5201,6 @@ end --- @param dist number --- @param pitch integer --- @param yaw integer ---- @return nil function vec3f_set_dist_and_angle(from, to, dist, pitch, yaw) -- ... end @@ -6040,7 +5258,6 @@ function vec3s_to_vec3f(dest, a) -- ... end ---- @return nil function update_all_mario_stars() -- ... end @@ -6151,7 +5368,6 @@ function network_player_is_override_palette_same(np) end --- @param np NetworkPlayer ---- @return nil function network_player_reset_override_palette_color(np) -- ... end @@ -6162,7 +5378,6 @@ end --- @param g integer --- @param b integer --- @param a integer ---- @return nil function network_player_set_description(np, description, r, g, b, a) -- ... end @@ -6170,7 +5385,6 @@ end --- @param np NetworkPlayer --- @param part PlayerPart --- @param color Color ---- @return nil function network_player_set_override_palette_color(np, part, color) -- ... end @@ -6218,7 +5432,6 @@ end --- @param objFloorY number --- @param objVelX number --- @param objVelZ number ---- @return nil function calc_new_obj_vel_and_pos_y(objFloor, objFloorY, objVelX, objVelZ) -- ... end @@ -6228,14 +5441,12 @@ end --- @param objVelX number --- @param objVelZ number --- @param waterY number ---- @return nil function calc_new_obj_vel_and_pos_y_underwater(objFloor, floorY, objVelX, objVelZ, waterY) -- ... end --- @param objFriction Pointer_number --- @param floor_nY number ---- @return nil function calc_obj_friction(objFriction, floor_nY) -- ... end @@ -6337,7 +5548,6 @@ end --- @param collisionFlags integer --- @param floor Surface ---- @return nil function obj_check_floor_death(collisionFlags, floor) -- ... end @@ -6383,7 +5593,6 @@ function obj_lava_death() end --- @param obj Object ---- @return nil function obj_move_xyz_using_fvel_and_yaw(obj) -- ... end @@ -6392,7 +5601,6 @@ end --- @param normalX number --- @param normalY number --- @param normalZ number ---- @return nil function obj_orient_graph(obj, normalX, normalY, normalZ) -- ... end @@ -6402,7 +5610,6 @@ end --- @param homeY number --- @param homeZ number --- @param baseDisp integer ---- @return nil function obj_return_and_displace_home(obj, homeX, homeY, homeZ, baseDisp) -- ... end @@ -6419,19 +5626,16 @@ end --- @param obj Object --- @param nCoins integer ---- @return nil function obj_spawn_yellow_coins(obj, nCoins) -- ... end --- @param waterY integer --- @param objY integer ---- @return nil function obj_splash(waterY, objY) -- ... end ---- @return nil function obj_update_pos_vel_xz() -- ... end @@ -6448,12 +5652,10 @@ end --- @param obj Object --- @param dist integer ---- @return nil function set_object_visibility(obj, dist) -- ... end ---- @return nil function set_yoshi_as_not_dead() -- ... end @@ -6462,7 +5664,6 @@ end --- @param relX integer --- @param relY integer --- @param relZ integer ---- @return nil function spawn_orange_number(behParam, relX, relY, relZ) -- ... end @@ -6483,7 +5684,6 @@ end --- @param nZ number --- @param objYawX Pointer_number --- @param objYawZ Pointer_number ---- @return nil function turn_obj_away_from_surface(velX, velZ, nX, nY, nZ, objYawX, objYawZ) -- ... end @@ -6510,7 +5710,6 @@ function cur_obj_init_anim_check_frame(arg0, arg1) end --- @param arg0 integer ---- @return nil function cur_obj_init_anim_extend(arg0) -- ... end @@ -6531,19 +5730,16 @@ end --- @param arg0 number --- @param arg1 number ---- @return nil function cur_obj_spin_all_dimensions(arg0, arg1) -- ... end --- @param baseScale number ---- @return nil function obj_act_knockback(baseScale) -- ... end --- @param baseScale number ---- @return nil function obj_act_squished(baseScale) -- ... end @@ -6562,7 +5758,6 @@ function obj_check_attacks(hitbox, attackedMarioAction) end --- @param speed number ---- @return nil function obj_compute_vel_from_move_pitch(speed) -- ... end @@ -6572,7 +5767,6 @@ function obj_die_if_above_lava_and_health_non_positive() -- ... end ---- @return nil function obj_die_if_health_non_positive() -- ... end @@ -6680,31 +5874,26 @@ end --- @param targetYaw integer --- @param maxRoll integer --- @param rollSpeed integer ---- @return nil function obj_roll_to_match_yaw_turn(targetYaw, maxRoll, rollSpeed) -- ... end --- @param targetYaw integer --- @param turnAmount integer ---- @return nil function obj_rotate_yaw_and_bounce_off_walls(targetYaw, turnAmount) -- ... end --- @param distFromHome number ---- @return nil function obj_set_dist_from_home(distFromHome) -- ... end --- @param attackType integer ---- @return nil function obj_set_knockback_action(attackType) -- ... end ---- @return nil function obj_set_squished_action() -- ... end @@ -6742,7 +5931,6 @@ function obj_turn_pitch_toward_mario(m, targetOffsetY, turnAmount) -- ... end ---- @return nil function obj_unused_die() -- ... end @@ -6751,7 +5939,6 @@ end --- @param baseCycleLength integer --- @param cycleLengthRange integer --- @param blinkLength integer ---- @return nil function obj_update_blinking(blinkTimer, baseCycleLength, cycleLengthRange, blinkLength) -- ... end @@ -6784,7 +5971,6 @@ end --- @param x number --- @param y number --- @param z number ---- @return nil function platform_on_track_update_pos_or_spawn_ball(ballIndex, x, y, z) -- ... end @@ -6807,7 +5993,6 @@ end --- @param threshold number --- @param distanceToPlayer Pointer_integer --- @param angleToPlayer Pointer_integer ---- @return nil function treat_far_home_as_mario(threshold, distanceToPlayer, angleToPlayer) -- ... end @@ -6821,7 +6006,6 @@ end --- @param value Pointer_number --- @param dragStrength number ---- @return nil function apply_drag_to_value(value, dragStrength) -- ... end @@ -6850,12 +6034,10 @@ function approach_s16_symmetric(value, target, increment) -- ... end ---- @return nil function bhv_dust_smoke_loop() -- ... end ---- @return nil function bhv_init_room() -- ... end @@ -6867,7 +6049,6 @@ function bit_shift_left(a0) end --- @param segment ChainSegment ---- @return nil function chain_segment_init(segment) -- ... end @@ -6880,7 +6061,6 @@ function clear_move_flag(bitSet, flag) end --- @param flags integer ---- @return nil function clear_time_stop_flags(flags) -- ... end @@ -6899,7 +6079,6 @@ end --- @param a0 Mat4 --- @param a1 Mat4 --- @param a2 Mat4 ---- @return nil function create_transformation_from_matrices(a0, a1, a2) -- ... end @@ -6914,7 +6093,6 @@ function cur_obj_advance_looping_anim() -- ... end ---- @return nil function cur_obj_align_gfx_with_floor() -- ... end @@ -6925,17 +6103,14 @@ function cur_obj_angle_to_home() end --- @param dragStrength number ---- @return nil function cur_obj_apply_drag_xz(dragStrength) -- ... end ---- @return nil function cur_obj_become_intangible() -- ... end ---- @return nil function cur_obj_become_tangible() -- ... end @@ -6958,7 +6133,6 @@ function cur_obj_can_mario_activate_textbox_2(m, radius, height) end --- @param action integer ---- @return nil function cur_obj_change_action(action) -- ... end @@ -7008,7 +6182,6 @@ function cur_obj_clear_interact_status_flag(flag) -- ... end ---- @return nil function cur_obj_compute_vel_xz() -- ... end @@ -7026,18 +6199,15 @@ function cur_obj_detect_steep_floor(steepAngleDegrees) -- ... end ---- @return nil function cur_obj_disable() -- ... end ---- @return nil function cur_obj_disable_rendering() -- ... end --- @param obj Object ---- @return nil function cur_obj_disable_rendering_and_become_intangible(obj) -- ... end @@ -7048,23 +6218,19 @@ function cur_obj_dist_to_nearest_object_with_behavior(behavior) -- ... end ---- @return nil function cur_obj_enable_rendering() -- ... end ---- @return nil function cur_obj_enable_rendering_2() -- ... end --- @param obj Object ---- @return nil function cur_obj_enable_rendering_and_become_tangible(obj) -- ... end ---- @return nil function cur_obj_enable_rendering_if_mario_in_room() -- ... end @@ -7072,12 +6238,10 @@ end --- @param m MarioState --- @param dialogFlags integer --- @param dialogResult integer ---- @return nil function cur_obj_end_dialog(m, dialogFlags, dialogResult) -- ... end ---- @return nil function cur_obj_extend_animation_if_at_end() -- ... end @@ -7109,12 +6273,10 @@ end --- @param target number --- @param increment number ---- @return nil function cur_obj_forward_vel_approach_upward(target, increment) -- ... end ---- @return nil function cur_obj_get_dropped() -- ... end @@ -7122,7 +6284,6 @@ end --- @param forwardVel number --- @param velY number --- @param thrownAction integer ---- @return nil function cur_obj_get_thrown_or_placed(forwardVel, velY, thrownAction) -- ... end @@ -7139,7 +6300,6 @@ function cur_obj_has_model(modelID) -- ... end ---- @return nil function cur_obj_hide() -- ... end @@ -7150,20 +6310,17 @@ function cur_obj_hide_if_mario_far_away_y(distY) -- ... end ---- @return nil function cur_obj_if_hit_wall_bounce_away() -- ... end --- @param animIndex integer ---- @return nil function cur_obj_init_animation(animIndex) -- ... end --- @param animIndex integer --- @param animFrame integer ---- @return nil function cur_obj_init_animation_and_anim_frame(animIndex, animFrame) -- ... end @@ -7175,20 +6332,17 @@ function cur_obj_init_animation_and_check_if_near_end(animIndex) end --- @param animIndex integer ---- @return nil function cur_obj_init_animation_and_extend_if_at_end(animIndex) -- ... end --- @param animIndex integer --- @param accel number ---- @return nil function cur_obj_init_animation_with_accel_and_sound(animIndex, accel) -- ... end --- @param animIndex integer ---- @return nil function cur_obj_init_animation_with_sound(animIndex) -- ... end @@ -7231,13 +6385,11 @@ end --- @param forwardVel number --- @param velY number ---- @return nil function cur_obj_move_after_thrown_or_dropped(forwardVel, velY) -- ... end --- @param steepSlopeAngleDegrees integer ---- @return nil function cur_obj_move_standard(steepSlopeAngleDegrees) -- ... end @@ -7250,27 +6402,22 @@ end --- @param gravity number --- @param bounciness number ---- @return nil function cur_obj_move_update_ground_air_flags(gravity, bounciness) -- ... end ---- @return nil function cur_obj_move_update_underwater_flags() -- ... end ---- @return nil function cur_obj_move_using_fvel_and_gravity() -- ... end ---- @return nil function cur_obj_move_using_vel() -- ... end ---- @return nil function cur_obj_move_using_vel_and_gravity() -- ... end @@ -7282,7 +6429,6 @@ function cur_obj_move_xz(steepSlopeNormalY, careAboutEdgesAndSteepSlopes) -- ... end ---- @return nil function cur_obj_move_xz_using_fvel_and_yaw() -- ... end @@ -7290,7 +6436,6 @@ end --- @param gravity number --- @param bounciness number --- @param buoyancy number ---- @return nil function cur_obj_move_y(gravity, bounciness, buoyancy) -- ... end @@ -7302,7 +6447,6 @@ function cur_obj_move_y_and_get_water_level(gravity, buoyancy) -- ... end ---- @return nil function cur_obj_move_y_with_terminal_vel() -- ... end @@ -7329,14 +6473,12 @@ function cur_obj_outside_home_square(halfLength) end --- @param radius number ---- @return nil function cur_obj_push_mario_away(radius) -- ... end --- @param radius number --- @param extentY number ---- @return nil function cur_obj_push_mario_away_from_cylinder(radius, extentY) -- ... end @@ -7346,7 +6488,6 @@ function cur_obj_reflect_move_angle_off_wall() -- ... end ---- @return nil function cur_obj_reset_timer_and_subaction() -- ... end @@ -7356,17 +6497,14 @@ function cur_obj_resolve_wall_collisions() -- ... end ---- @return nil function cur_obj_reverse_animation() -- ... end ---- @return nil function cur_obj_rotate_face_angle_using_vel() -- ... end ---- @return nil function cur_obj_rotate_move_angle_using_vel() -- ... end @@ -7379,7 +6517,6 @@ function cur_obj_rotate_yaw_toward(target, increment) end --- @param scale number ---- @return nil function cur_obj_scale(scale) -- ... end @@ -7388,23 +6525,19 @@ end --- @param a1 integer --- @param sp10 number --- @param sp14 number ---- @return nil function cur_obj_scale_over_time(a0, a1, sp10, sp14) -- ... end --- @param behavior Pointer_BehaviorScript ---- @return nil function cur_obj_set_behavior(behavior) -- ... end ---- @return nil function cur_obj_set_billboard_if_vanilla_cam() -- ... end ---- @return nil function cur_obj_set_face_angle_to_move_angle() -- ... end @@ -7419,19 +6552,16 @@ end --- @param radius number --- @param height number ---- @return nil function cur_obj_set_hitbox_radius_and_height(radius, height) -- ... end ---- @return nil function cur_obj_set_home_once() -- ... end --- @param radius number --- @param height number ---- @return nil function cur_obj_set_hurtbox_radius_and_height(radius, height) -- ... end @@ -7440,7 +6570,6 @@ end --- @param dleft number --- @param dy number --- @param dforward number ---- @return nil function cur_obj_set_pos_relative(other, dleft, dy, dforward) -- ... end @@ -7448,27 +6577,22 @@ end --- @param dleft number --- @param dy number --- @param dforward number ---- @return nil function cur_obj_set_pos_relative_to_parent(dleft, dy, dforward) -- ... end ---- @return nil function cur_obj_set_pos_to_home() -- ... end ---- @return nil function cur_obj_set_pos_to_home_and_stop() -- ... end ---- @return nil function cur_obj_set_pos_to_home_with_debug() -- ... end ---- @return nil function cur_obj_set_pos_via_transform() -- ... end @@ -7476,26 +6600,22 @@ end --- @param m MarioState --- @param f12 number --- @param f14 number ---- @return nil function cur_obj_set_vel_from_mario_vel(m, f12, f14) -- ... end --- @param sp18 number --- @param sp1C integer ---- @return nil function cur_obj_set_y_vel_and_animation(sp18, sp1C) -- ... end --- @param shake integer ---- @return nil function cur_obj_shake_screen(shake) -- ... end --- @param amount number ---- @return nil function cur_obj_shake_y(amount) -- ... end @@ -7507,19 +6627,16 @@ function cur_obj_shake_y_until(cycles, amount) -- ... end ---- @return nil function cur_obj_spawn_loot_blue_coin() -- ... end --- @param m MarioState ---- @return nil function cur_obj_spawn_loot_coin_at_mario_pos(m) -- ... end --- @param info SpawnParticlesInfo ---- @return nil function cur_obj_spawn_particles(info) -- ... end @@ -7528,31 +6645,26 @@ end --- @param targetY number --- @param targetZ number --- @param offsetY number ---- @return nil function cur_obj_spawn_star_at_y_offset(targetX, targetY, targetZ, offsetY) -- ... end --- @param obj Object --- @param cameraEvent integer ---- @return nil function cur_obj_start_cam_event(obj, cameraEvent) -- ... end ---- @return nil function cur_obj_unhide() -- ... end --- @param sp18 integer --- @param sp1C integer ---- @return nil function cur_obj_unrender_and_reset_state(sp18, sp1C) -- ... end ---- @return nil function cur_obj_unused_init_on_floor() -- ... end @@ -7560,35 +6672,29 @@ end --- @param animFrame1 integer --- @param animFrame2 integer --- @param sound integer ---- @return nil function cur_obj_unused_play_footstep_sound(animFrame1, animFrame2, sound) -- ... end --- @param offsetY number --- @param radius number ---- @return nil function cur_obj_unused_resolve_wall_collisions(offsetY, radius) -- ... end ---- @return nil function cur_obj_update_floor() -- ... end --- @param steepSlopeDegrees integer ---- @return nil function cur_obj_update_floor_and_resolve_wall_collisions(steepSlopeDegrees) -- ... end ---- @return nil function cur_obj_update_floor_and_walls() -- ... end ---- @return nil function cur_obj_update_floor_height() -- ... end @@ -7615,12 +6721,10 @@ function cur_obj_within_12k_bounds() -- ... end ---- @return nil function disable_time_stop() -- ... end ---- @return nil function disable_time_stop_including_mario() -- ... end @@ -7641,17 +6745,14 @@ function dist_between_objects(obj1, obj2) -- ... end ---- @return nil function enable_time_stop() -- ... end ---- @return nil function enable_time_stop_if_alone() -- ... end ---- @return nil function enable_time_stop_including_mario() -- ... end @@ -7719,7 +6820,6 @@ end --- @param m Mat4 --- @param dst Vec3f --- @param v Vec3f ---- @return nil function linear_mtxf_mul_vec3f(m, dst, v) -- ... end @@ -7727,7 +6827,6 @@ end --- @param m Mat4 --- @param dst Vec3f --- @param v Vec3f ---- @return nil function linear_mtxf_transpose_mul_vec3f(m, dst, v) -- ... end @@ -7754,7 +6853,6 @@ function mario_is_within_rectangle(minX, maxX, minZ, maxZ) end --- @param flag integer ---- @return nil function mario_set_flag(flag) -- ... end @@ -7777,13 +6875,11 @@ end --- @param obj Object --- @param dst Mat4 --- @param src Mat4 ---- @return nil function obj_apply_scale_to_matrix(obj, dst, src) -- ... end --- @param obj Object ---- @return nil function obj_apply_scale_to_transform(obj) -- ... end @@ -7795,13 +6891,11 @@ function obj_attack_collided_from_other_object(obj) end --- @param obj Object ---- @return nil function obj_become_tangible(obj) -- ... end --- @param obj Object ---- @return nil function obj_build_relative_transform(obj) -- ... end @@ -7809,19 +6903,16 @@ end --- @param obj Object --- @param posIndex integer --- @param angleIndex integer ---- @return nil function obj_build_transform_from_pos_and_angle(obj, posIndex, angleIndex) -- ... end --- @param obj Object ---- @return nil function obj_build_transform_relative_to_parent(obj) -- ... end --- @param a0 Object ---- @return nil function obj_build_vel_from_transform(a0) -- ... end @@ -7835,55 +6926,47 @@ end --- @param dst Object --- @param src Object ---- @return nil function obj_copy_angle(dst, src) -- ... end --- @param dst Object --- @param src Object ---- @return nil function obj_copy_behavior_params(dst, src) -- ... end --- @param dst Object --- @param src Object ---- @return nil function obj_copy_graph_y_offset(dst, src) -- ... end --- @param dst Object --- @param src Object ---- @return nil function obj_copy_pos(dst, src) -- ... end --- @param dst Object --- @param src Object ---- @return nil function obj_copy_pos_and_angle(dst, src) -- ... end --- @param dst Object --- @param src Object ---- @return nil function obj_copy_scale(dst, src) -- ... end --- @param obj Object ---- @return nil function obj_create_transform_from_self(obj) -- ... end --- @param sp18 number --- @param sp1C integer ---- @return nil function obj_explode_and_spawn_coins(sp18, sp1C) -- ... end @@ -7897,7 +6980,6 @@ end --- @param obj Object --- @param animIndex integer ---- @return nil function obj_init_animation(obj, animIndex) -- ... end @@ -7905,7 +6987,6 @@ end --- @param obj Object --- @param animIndex integer --- @param accel number ---- @return nil function obj_init_animation_with_accel_and_sound(obj, animIndex, accel) -- ... end @@ -7913,7 +6994,6 @@ end --- @param obj Object --- @param animations AnimationTable --- @param animIndex integer ---- @return nil function obj_init_animation_with_sound(obj, animations, animIndex) -- ... end @@ -7925,7 +7005,6 @@ function obj_is_hidden(obj) end --- @param obj Object ---- @return nil function obj_mark_for_deletion(obj) -- ... end @@ -7939,7 +7018,6 @@ end --- @param obj Object --- @param scale number ---- @return nil function obj_scale(obj, scale) -- ... end @@ -7947,7 +7025,6 @@ end --- @param obj Object --- @param rangeLength number --- @param minScale number ---- @return nil function obj_scale_random(obj, rangeLength, minScale) -- ... end @@ -7956,7 +7033,6 @@ end --- @param xScale number --- @param yScale number --- @param zScale number ---- @return nil function obj_scale_xyz(obj, xScale, yScale, zScale) -- ... end @@ -7965,26 +7041,22 @@ end --- @param pitch integer --- @param yaw integer --- @param roll integer ---- @return nil function obj_set_angle(obj, pitch, yaw, roll) -- ... end --- @param obj Object --- @param behavior Pointer_BehaviorScript ---- @return nil function obj_set_behavior(obj, behavior) -- ... end --- @param obj Object ---- @return nil function obj_set_billboard(obj) -- ... end --- @param obj Object ---- @return nil function obj_set_cylboard(obj) -- ... end @@ -7993,13 +7065,11 @@ end --- @param pitch integer --- @param yaw integer --- @param roll integer ---- @return nil function obj_set_face_angle(obj, pitch, yaw, roll) -- ... end --- @param obj Object ---- @return nil function obj_set_face_angle_to_move_angle(obj) -- ... end @@ -8008,7 +7078,6 @@ end --- @param pitch integer --- @param yaw integer --- @param roll integer ---- @return nil function obj_set_gfx_angle(obj, pitch, yaw, roll) -- ... end @@ -8017,20 +7086,17 @@ end --- @param x number --- @param y number --- @param z number ---- @return nil function obj_set_gfx_pos(obj, x, y, z) -- ... end --- @param obj1 Object --- @param obj2 Object ---- @return nil function obj_set_gfx_pos_at_obj_pos(obj1, obj2) -- ... end --- @param obj Object ---- @return nil function obj_set_gfx_pos_from_pos(obj) -- ... end @@ -8039,21 +7105,18 @@ end --- @param x number --- @param y number --- @param z number ---- @return nil function obj_set_gfx_scale(obj, x, y, z) -- ... end --- @param obj Object --- @param heldBehavior Pointer_BehaviorScript ---- @return nil function obj_set_held_state(obj, heldBehavior) -- ... end --- @param obj Object --- @param hitbox ObjectHitbox ---- @return nil function obj_set_hitbox(obj, hitbox) -- ... end @@ -8061,7 +7124,6 @@ end --- @param o Object --- @param radius number --- @param height number ---- @return nil function obj_set_hitbox_radius_and_height(o, radius, height) -- ... end @@ -8069,7 +7131,6 @@ end --- @param o Object --- @param radius number --- @param height number ---- @return nil function obj_set_hurtbox_radius_and_height(o, radius, height) -- ... end @@ -8078,7 +7139,6 @@ end --- @param pitch integer --- @param yaw integer --- @param roll integer ---- @return nil function obj_set_move_angle(obj, pitch, yaw, roll) -- ... end @@ -8087,7 +7147,6 @@ end --- @param relX integer --- @param relY integer --- @param relZ integer ---- @return nil function obj_set_parent_relative_pos(obj, relX, relY, relZ) -- ... end @@ -8096,7 +7155,6 @@ end --- @param x integer --- @param y integer --- @param z integer ---- @return nil function obj_set_pos(obj, x, y, z) -- ... end @@ -8106,13 +7164,11 @@ end --- @param dleft number --- @param dy number --- @param dforward number ---- @return nil function obj_set_pos_relative(obj, other, dleft, dy, dforward) -- ... end --- @param obj Object ---- @return nil function obj_set_throw_matrix_from_transform(obj) -- ... end @@ -8121,7 +7177,6 @@ end --- @param numCoins integer --- @param sp28 number --- @param posJitter integer ---- @return nil function obj_spawn_loot_blue_coins(obj, numCoins, sp28, posJitter) -- ... end @@ -8132,7 +7187,6 @@ end --- @param coinBehavior Pointer_BehaviorScript --- @param posJitter integer --- @param model integer ---- @return nil function obj_spawn_loot_coins(obj, numCoins, sp30, coinBehavior, posJitter, model) -- ... end @@ -8140,7 +7194,6 @@ end --- @param obj Object --- @param numCoins integer --- @param sp28 number ---- @return nil function obj_spawn_loot_yellow_coins(obj, numCoins, sp28) -- ... end @@ -8148,21 +7201,18 @@ end --- @param obj Object --- @param posIndex integer --- @param localTranslateIndex integer ---- @return nil function obj_translate_local(obj, posIndex, localTranslateIndex) -- ... end --- @param obj Object --- @param rangeLength number ---- @return nil function obj_translate_xyz_random(obj, rangeLength) -- ... end --- @param obj Object --- @param rangeLength number ---- @return nil function obj_translate_xz_random(obj, rangeLength) -- ... end @@ -8178,7 +7228,6 @@ end --- @param a0 Mat4 --- @param a1 Object ---- @return nil function obj_update_pos_from_parent_transformation(a0, a1) -- ... end @@ -8197,19 +7246,16 @@ end --- @param sp0 integer --- @param sp4 integer --- @param sp8 number ---- @return nil function set_mario_interact_hoot_if_in_range(sp0, sp4, sp8) -- ... end --- @param flags integer ---- @return nil function set_time_stop_flags(flags) -- ... end --- @param flags integer ---- @return nil function set_time_stop_flags_if_alone(flags) -- ... end @@ -8220,18 +7266,15 @@ function signum_positive(x) -- ... end ---- @return nil function spawn_base_star_with_no_lvl_exit() -- ... end ---- @return nil function spawn_mist_particles() -- ... end --- @param sp18 integer ---- @return nil function spawn_mist_particles_with_sound(sp18) -- ... end @@ -8252,26 +7295,22 @@ end --- @param sp0 integer --- @param sp4 integer ---- @return nil function stub_obj_helpers_3(sp0, sp4) -- ... end ---- @return nil function stub_obj_helpers_4() -- ... end --- @param obj Object --- @param bits integer ---- @return nil function set_object_respawn_info_bits(obj, bits) -- ... end --- @param a0 integer --- @param a1 integer ---- @return nil function queue_rumble_data(a0, a1) -- ... end @@ -8279,7 +7318,6 @@ end --- @param m MarioState --- @param a0 integer --- @param a1 integer ---- @return nil function queue_rumble_data_mario(m, a0, a1) -- ... end @@ -8287,38 +7325,32 @@ end --- @param object Object --- @param a0 integer --- @param a1 integer ---- @return nil function queue_rumble_data_object(object, a0, a1) -- ... end --- @param m MarioState ---- @return nil function reset_rumble_timers(m) -- ... end --- @param m MarioState --- @param a0 integer ---- @return nil function reset_rumble_timers_2(m, a0) -- ... end --- @param flags integer ---- @return nil function save_file_clear_flags(flags) -- ... end --- @param fileIndex integer --- @param forceSave integer ---- @return nil function save_file_do_save(fileIndex, forceSave) -- ... end ---- @return nil function save_file_erase_current_backup_save() -- ... end @@ -8382,7 +7414,6 @@ function save_file_is_cannon_unlocked(fileIndex, courseIndex) end --- @param load_all integer ---- @return nil function save_file_reload(load_all) -- ... end @@ -8390,7 +7421,6 @@ end --- @param fileIndex integer --- @param courseIndex integer --- @param starFlagsToRemove integer ---- @return nil function save_file_remove_star_flags(fileIndex, courseIndex, starFlagsToRemove) -- ... end @@ -8398,13 +7428,11 @@ end --- @param fileIndex integer --- @param courseIndex integer --- @param coinScore integer ---- @return nil function save_file_set_course_coin_score(fileIndex, courseIndex, coinScore) -- ... end --- @param flags integer ---- @return nil function save_file_set_flags(flags) -- ... end @@ -8412,14 +7440,12 @@ end --- @param fileIndex integer --- @param courseIndex integer --- @param starFlags integer ---- @return nil function save_file_set_star_flags(fileIndex, courseIndex, starFlags) -- ... end --- @param fileIndex integer --- @param courseIndex integer ---- @return nil function touch_coin_score_age(fileIndex, courseIndex) -- ... end @@ -8438,13 +7464,11 @@ end --- @param obj Object --- @param name string ---- @return nil function smlua_anim_util_set_animation(obj, name) -- ... end --- @param audio ModAudio ---- @return nil function audio_sample_destroy(audio) -- ... end @@ -8458,19 +7482,16 @@ end --- @param audio ModAudio --- @param position Vec3f --- @param volume number ---- @return nil function audio_sample_play(audio, position, volume) -- ... end --- @param audio ModAudio ---- @return nil function audio_sample_stop(audio) -- ... end --- @param audio ModAudio ---- @return nil function audio_stream_destroy(audio) -- ... end @@ -8506,7 +7527,6 @@ function audio_stream_load(filename) end --- @param audio ModAudio ---- @return nil function audio_stream_pause(audio) -- ... end @@ -8514,41 +7534,35 @@ end --- @param audio ModAudio --- @param restart boolean --- @param volume number ---- @return nil function audio_stream_play(audio, restart, volume) -- ... end --- @param audio ModAudio --- @param freq number ---- @return nil function audio_stream_set_frequency(audio, freq) -- ... end --- @param audio ModAudio --- @param looping boolean ---- @return nil function audio_stream_set_looping(audio, looping) -- ... end --- @param audio ModAudio --- @param pos number ---- @return nil function audio_stream_set_position(audio, pos) -- ... end --- @param audio ModAudio --- @param volume number ---- @return nil function audio_stream_set_volume(audio, volume) -- ... end --- @param audio ModAudio ---- @return nil function audio_stream_stop(audio) -- ... end @@ -8557,12 +7571,10 @@ end --- @param bankId integer --- @param defaultVolume integer --- @param m64Name string ---- @return nil function smlua_audio_utils_replace_sequence(sequenceId, bankId, defaultVolume, m64Name) -- ... end ---- @return nil function smlua_audio_utils_reset_all() -- ... end @@ -8626,20 +7638,17 @@ end --- @param initial_freq number --- @param speed number --- @param pitch boolean ---- @return nil function audio_stream_set_speed(audio, initial_freq, speed, pitch) -- ... end --- @param audio ModAudio --- @param tempo number ---- @return nil function audio_stream_set_tempo(audio, tempo) -- ... end --- @param enable boolean ---- @return nil function djui_hud_set_render_behind_hud(enable) -- ... end @@ -8659,7 +7668,6 @@ end --- @param np NetworkPlayer --- @param part PlayerPart --- @param color Color ---- @return nil function network_player_color_to_palette(np, part, color) -- ... end @@ -8667,14 +7675,12 @@ end --- @param np NetworkPlayer --- @param part PlayerPart --- @param out Color ---- @return nil function network_player_palette_to_color(np, part, out) -- ... end --- @param index integer --- @param value integer ---- @return nil function set_environment_region(index, value) -- ... end @@ -8699,7 +7705,6 @@ function level_register(scriptEntryName, courseNum, fullName, shortName, acousti end --- @param areaIndex integer ---- @return nil function smlua_level_util_change_area(areaIndex) -- ... end @@ -8824,25 +7829,21 @@ function allocate_mario_action(actFlags) end --- @param allow integer ---- @return nil function camera_allow_toxic_gas_camera(allow) -- ... end --- @param enable boolean ---- @return nil function camera_config_enable_analog_cam(enable) -- ... end --- @param enable boolean ---- @return nil function camera_config_enable_free_cam(enable) -- ... end --- @param enable boolean ---- @return nil function camera_config_enable_mouse_look(enable) -- ... end @@ -8873,13 +7874,11 @@ function camera_config_get_y_sensitivity() end --- @param invert boolean ---- @return nil function camera_config_invert_x(invert) -- ... end --- @param invert boolean ---- @return nil function camera_config_invert_y(invert) -- ... end @@ -8910,36 +7909,30 @@ function camera_config_is_y_inverted() end --- @param value integer ---- @return nil function camera_config_set_aggression(value) -- ... end --- @param value integer ---- @return nil function camera_config_set_deceleration(value) -- ... end --- @param value integer ---- @return nil function camera_config_set_pan_level(value) -- ... end --- @param value integer ---- @return nil function camera_config_set_x_sensitivity(value) -- ... end --- @param value integer ---- @return nil function camera_config_set_y_sensitivity(value) -- ... end ---- @return nil function camera_freeze() -- ... end @@ -8949,30 +7942,25 @@ function camera_is_frozen() -- ... end ---- @return nil function camera_reset_overrides() -- ... end --- @param allow integer ---- @return nil function camera_romhack_allow_centering(allow) -- ... end --- @param allow integer ---- @return nil function camera_romhack_allow_dpad_usage(allow) -- ... end --- @param rco RomhackCameraOverride ---- @return nil function camera_set_romhack_override(rco) -- ... end ---- @return nil function camera_unfreeze() -- ... end @@ -9001,18 +7989,15 @@ end --- @param message string --- @param lines integer ---- @return nil function djui_popup_create_global(message, lines) -- ... end ---- @return nil function djui_reset_popup_disabled_override() -- ... end --- @param value boolean ---- @return nil function djui_set_popup_disabled_override(value) -- ... end @@ -9175,7 +8160,6 @@ function hud_get_value(type) -- ... end ---- @return nil function hud_hide() -- ... end @@ -9190,7 +8174,6 @@ end --- @param y number --- @param width number --- @param height number ---- @return nil function hud_render_power_meter(health, x, y, width, height) -- ... end @@ -9204,25 +8187,21 @@ end --- @param y number --- @param width number --- @param height number ---- @return nil function hud_render_power_meter_interpolated(health, prevX, prevY, prevWidth, prevHeight, x, y, width, height) -- ... end --- @param value integer ---- @return nil function hud_set_flash(value) -- ... end --- @param type HudDisplayValue --- @param value integer ---- @return nil function hud_set_value(type, value) -- ... end ---- @return nil function hud_show() -- ... end @@ -9241,7 +8220,6 @@ end --- @param level integer --- @param area integer --- @param type integer ---- @return nil function movtexqc_register(name, level, area, type) -- ... end @@ -9251,12 +8229,10 @@ end --- @param red integer --- @param green integer --- @param blue integer ---- @return nil function play_transition(transType, time, red, green, blue) -- ... end ---- @return nil function reset_window_title() -- ... end @@ -9267,107 +8243,90 @@ function save_file_get_using_backup_slot() end --- @param usingBackupSlot boolean ---- @return nil function save_file_set_using_backup_slot(usingBackupSlot) -- ... end --- @param index integer --- @param value integer ---- @return nil function set_fog_color(index, value) -- ... end --- @param intensity number ---- @return nil function set_fog_intensity(intensity) -- ... end --- @param value boolean ---- @return nil function set_got_file_coin_hi_score(value) -- ... end --- @param courseNum integer ---- @return nil function set_last_completed_course_num(courseNum) -- ... end --- @param starNum integer ---- @return nil function set_last_completed_star_num(starNum) -- ... end --- @param value integer ---- @return nil function set_last_star_or_key(value) -- ... end --- @param index integer --- @param value integer ---- @return nil function set_lighting_color(index, value) -- ... end --- @param index integer --- @param value number ---- @return nil function set_lighting_dir(index, value) -- ... end --- @param envfx integer ---- @return nil function set_override_envfx(envfx) -- ... end --- @param far number ---- @return nil function set_override_far(far) -- ... end --- @param fov number ---- @return nil function set_override_fov(fov) -- ... end --- @param near number ---- @return nil function set_override_near(near) -- ... end --- @param background integer ---- @return nil function set_override_skybox(background) -- ... end --- @param value boolean ---- @return nil function set_save_file_modified(value) -- ... end --- @param speed integer ---- @return nil function set_ttc_speed_setting(speed) -- ... end --- @param index integer --- @param value integer ---- @return nil function set_vertex_color(index, value) -- ... end @@ -9375,13 +8334,11 @@ end --- @param index integer --- @param height integer --- @param sync boolean ---- @return nil function set_water_level(index, height, sync) -- ... end --- @param title string ---- @return nil function set_window_title(title) -- ... end @@ -9605,7 +8562,6 @@ end --- @param dx number --- @param dy number --- @param dz number ---- @return nil function obj_move_xyz(o, dx, dy, dz) -- ... end @@ -9613,7 +8569,6 @@ end --- @param o Object --- @param fieldIndex integer --- @param value number ---- @return nil function obj_set_field_f32(o, fieldIndex, value) -- ... end @@ -9622,7 +8577,6 @@ end --- @param fieldIndex integer --- @param fieldSubIndex integer --- @param value integer ---- @return nil function obj_set_field_s16(o, fieldIndex, fieldSubIndex, value) -- ... end @@ -9630,7 +8584,6 @@ end --- @param o Object --- @param fieldIndex integer --- @param value integer ---- @return nil function obj_set_field_s32(o, fieldIndex, value) -- ... end @@ -9638,14 +8591,12 @@ end --- @param o Object --- @param fieldIndex integer --- @param value integer ---- @return nil function obj_set_field_u32(o, fieldIndex, value) -- ... end --- @param o Object --- @param modelId ModelExtendedId ---- @return nil function obj_set_model_extended(o, modelId) -- ... end @@ -9654,7 +8605,6 @@ end --- @param vx number --- @param vy number --- @param vz number ---- @return nil function obj_set_vel(o, vx, vy, vz) -- ... end @@ -9665,7 +8615,6 @@ end --- @param strength integer --- @param area integer --- @param index integer ---- @return nil function set_whirlpools(x, y, z, strength, area, index) -- ... end @@ -9709,20 +8658,17 @@ end --- @param courseNum integer --- @param actNum integer --- @param name string ---- @return nil function smlua_text_utils_act_name_replace(courseNum, actNum, name) -- ... end --- @param courseNum integer --- @param actNum integer ---- @return nil function smlua_text_utils_act_name_reset(courseNum, actNum) -- ... end --- @param name string ---- @return nil function smlua_text_utils_castle_secret_stars_replace(name) -- ... end @@ -9735,7 +8681,6 @@ end --- @param act4 string --- @param act5 string --- @param act6 string ---- @return nil function smlua_text_utils_course_acts_replace(courseNum, courseName, act1, act2, act3, act4, act5, act6) -- ... end @@ -9754,13 +8699,11 @@ end --- @param courseNum integer --- @param name string ---- @return nil function smlua_text_utils_course_name_replace(courseNum, name) -- ... end --- @param courseNum integer ---- @return nil function smlua_text_utils_course_name_reset(courseNum) -- ... end @@ -9771,14 +8714,12 @@ end --- @param leftOffset integer --- @param width integer --- @param str string ---- @return nil function smlua_text_utils_dialog_replace(dialogId, unused, linesPerBox, leftOffset, width, str) -- ... end --- @param index integer --- @param text string ---- @return nil function smlua_text_utils_extra_text_replace(index, text) -- ... end @@ -9790,84 +8731,69 @@ end --- @param courseNum integer --- @param courseName string ---- @return nil function smlua_text_utils_secret_star_replace(courseNum, courseName) -- ... end ---- @return nil function disable_background_sound() -- ... end ---- @return nil function enable_background_sound() -- ... end ---- @return nil function fadeout_cap_music() -- ... end --- @param fadeTimer integer ---- @return nil function fadeout_level_music(fadeTimer) -- ... end --- @param fadeOutTime integer ---- @return nil function fadeout_music(fadeOutTime) -- ... end --- @param a integer ---- @return nil function lower_background_noise(a) -- ... end --- @param seqArgs integer ---- @return nil function play_cap_music(seqArgs) -- ... end --- @param seqArgs integer ---- @return nil function play_cutscene_music(seqArgs) -- ... end ---- @return nil function play_infinite_stairs_music() -- ... end --- @param soundMenuFlags integer ---- @return nil function play_menu_sounds(soundMenuFlags) -- ... end ---- @return nil function play_painting_eject_sound() -- ... end ---- @return nil function play_shell_music() -- ... end --- @param a integer ---- @return nil function raise_background_noise(a) -- ... end ---- @return nil function reset_volume() -- ... end @@ -9875,17 +8801,14 @@ end --- @param a integer --- @param seqArgs integer --- @param fadeTimer integer ---- @return nil function set_background_music(a, seqArgs, fadeTimer) -- ... end ---- @return nil function stop_cap_music() -- ... end ---- @return nil function stop_shell_music() -- ... end @@ -9903,20 +8826,17 @@ function calc_dist_to_volume_range_2(distance) end --- @param soundMagic integer ---- @return nil function cur_obj_play_sound_1(soundMagic) -- ... end --- @param soundMagic integer ---- @return nil function cur_obj_play_sound_2(soundMagic) -- ... end --- @param soundStates SoundState --- @param maxSoundStates integer ---- @return nil function exec_anim_sound_state(soundStates, maxSoundStates) -- ... end @@ -9957,12 +8877,10 @@ function find_water_level(x, z) -- ... end ---- @return nil function alloc_surface_pools() -- ... end ---- @return nil function clear_dynamic_surfaces() -- ... end @@ -9977,12 +8895,10 @@ end --- @param data Pointer_integer --- @param surfaceRooms Pointer_integer --- @param macroObjects Pointer_integer ---- @return nil function load_area_terrain(index, data, surfaceRooms, macroObjects) -- ... end ---- @return nil function load_object_collision_model() -- ... end diff --git a/autogen/lua_definitions/manual.lua b/autogen/lua_definitions/manual.lua index fa823c41..ed27d15c 100644 --- a/autogen/lua_definitions/manual.lua +++ b/autogen/lua_definitions/manual.lua @@ -3,13 +3,13 @@ ------------- --- @type MarioState[] ---- Array of MarioStates, from 0 to MAX_PLAYERS - 1 +--- Array of `MarioState`s, from 0 to `MAX_PLAYERS` - 1 --- - Uses the local index, which is different between every player --- - Index 0 always refers to the local player gMarioStates = {} --- @type NetworkPlayer[] ---- Array of NetworkPlayers, from 0 to MAX_PLAYERS - 1 +--- Array of `NetworkPlayer`s, from 0 to `MAX_PLAYERS` - 1 --- - Uses the local index, which is different between every player --- - Index 0 always refers to the local player gNetworkPlayers = {} @@ -21,45 +21,56 @@ gNetworkPlayers = {} gActiveMods = {} --- @type Character[] +--- Array of every character, from 0 to `CT_MAX` - 1 +--- - The contents or order of the characters can never change gCharacters = {} --- @type Controller[] +--- Array of every controller, from 0 to `MAX_PLAYERS` - 1 +--- - Uses the local index, which is different between every player +--- - Index 0 always refers to the local player gControllers = {} --- @type GlobalTextures +--- Struct containing HUD glyph textures gTextures = {} --- @type GlobalObjectAnimations +--- Struct containing every object animation gObjectAnimations = {} --- @type GlobalObjectCollisionData +--- Struct containing all object collision data gGlobalObjectCollisionData = {} --- @type PaintingValues +--- Struct containing all paintings and their fields gPaintingValues = {} --- @alias SyncTable table --- @type SyncTable --- Any keys added and modified to this table will be synced among everyone. ---- - This shouldn't be used to sync player-specific values; Use gPlayerSyncTable for that +--- - This shouldn't be used to sync player-specific values; Use `gPlayerSyncTable` for that --- - Note: Does not support tables as keys gGlobalSyncTable = {} --- @type SyncTable[] ---- An array of sync tables. Any change to any sync tables will be synced to everyone else. +--- Array of sync tables. Any change to any sync tables will be synced to everyone else. --- - This array takes in a local index, however it automatically translates to the global index --- - Note: Does not support tables as keys gPlayerSyncTable = {} --- @type LevelValues +--- Struct containing fields that modify specific gameplay or level properties gLevelValues = {} --- @type BehaviorValues +--- Struct containing fields that modify specific object behavior properties gBehaviorValues = {} --- @type FirstPersonCamera ---- The struct that contains the values for the first person camera +--- Struct that contains the fields for the first person camera gFirstPersonCamera = {} --- @type LakituState @@ -68,9 +79,12 @@ gFirstPersonCamera = {} gLakituState = {} --- @type ServerSettings +--- Struct containing the settings for the server +--- - enablePlayersInLevelDisplay and enablePlayerList are not synced gServerSettings = {} --- @type NametagsSettings +--- Struct containing the settings for Nametags gNametagsSettings = {} ----------- @@ -92,7 +106,6 @@ end --- @param command string The command to run. Should be easy to type --- @param description string Should describe what the command does and how to use it --- @param func fun(msg:string): boolean Run upon activating the command. Return `true` to confirm the command has succeeded ---- @return nil function hook_chat_command(command, description, func) -- ... end @@ -132,6 +145,48 @@ function hook_on_sync_table_change(syncTable, field, tag, func) -- ... end +--- @param name string The text to show on the button +--- @param func fun(index:integer) The function that is called when the button is pressed +--- Hooks a DJUI button into the mod menu. If you want to unpause the game when the button is pressed, return `true` from `func` to do so +function hook_mod_menu_button(name, func) + -- ... +end + +--- @param name string The text to show on the left +--- @param defaultValue boolean The default state of the checkbox +--- @param func fun(index:integer, value:boolean) The function that is called when the checkbox is changed +--- Hooks a DJUI checkbox into the mod menu +function hook_mod_menu_checkbox(name, defaultValue, func) + -- ... +end + +--- @param name string The text to show on the left +--- @param defaultValue integer The default value of the slider +--- @param min integer The lowest the slider can go +--- @param max integer The highest the slider can go +--- @param func fun(index:integer, value:integer) The function that is called when the value of the slider changes +--- Hooks a DJUI slider into the mod menu +function hook_mod_menu_slider(name, defaultValue, min, max, func) + -- ... +end + +--- @param name string The text to show on the left +--- @param defaultValue string The default text in the inputbox +--- @param stringLength integer The max length of the inputbox +--- @param func fun(index:integer, value:string) The function that is called when the value of the inputbox changes +--- Hooks a DJUI inputbox into the mod menu +function hook_mod_menu_inputbox(name, defaultValue, stringLength, func) + -- ... +end + +--- @param index integer The index of the element in the order in which they were hooked +--- @param name string The name to change to +--- Updates a mod menu element's text +--- - NOTE: `index` is zero-indexed +function update_mod_menu_element_name(index, name) + -- ... +end + --------------- -- functions -- --------------- @@ -156,7 +211,6 @@ function atan2s(y, x) end --- @param objFieldTable table ---- @return nil --- Keys must start with `o` and values must be `"u32"`, `"s32"`, or `"f32"` function define_custom_obj_fields(objFieldTable) -- ... @@ -165,7 +219,6 @@ end --- @param object Object Object to sync --- @param standardSync boolean Automatically syncs common fields and syncs with distance. If `false`, all syncing must be done with `network_send_object`. --- @param fieldTable table The fields to sync ---- @return nil --- All synced fields must start with `o` and there should not be any keys, just values function network_init_object(object, standardSync, fieldTable) -- ... @@ -173,7 +226,6 @@ end --- @param object Object Object to sync --- @param reliable boolean Whether or not the game should try to resend the packet in case it gets lost, good for important packets ---- @return nil --- Sends a sync packet to sync up the object with everyone else function network_send_object(object, reliable) -- ... @@ -181,7 +233,6 @@ end --- @param reliable boolean Whether or not the game should try to resend the packet in case its lost, good for important packets --- @param dataTable table Table of values to be included in the packet ---- @return nil --- `dataTable` can only contain strings, integers, numbers, booleans, and nil function network_send(reliable, dataTable) -- ... @@ -190,13 +241,12 @@ end --- @param toLocalIndex integer The local index to send the packet to --- @param reliable boolean Whether or not the game should try to resend the packet in case its lost, good for important packets --- @param dataTable table Table of values to be included in the packet ---- @return nil --- `dataTable` can only contain strings, integers, numbers, booleans, and nil function network_send_to(toLocalIndex, reliable, dataTable) -- ... end ---- @param textureName string +--- @param textureName string The texture name --- @return TextureInfo --- Gets the `TextureInfo` of a texture by name --- - Note: This also works with vanilla textures @@ -204,78 +254,72 @@ function get_texture_info(textureName) -- ... end ---- @param texInfo TextureInfo ---- @param x number ---- @param y number ---- @param scaleW number ---- @param scaleH number ---- @return nil +--- @param texInfo TextureInfo The texture +--- @param x number Where the texture is horizontally (left anchored) +--- @param y number Where the texture is vertically (top anchored) +--- @param scaleW number The scaled width of the texture +--- @param scaleH number The scaled height of the texture --- Renders a texture to the screen function djui_hud_render_texture(texInfo, x, y, scaleW, scaleH) -- ... end ---- @param texInfo TextureInfo ---- @param x number ---- @param y number ---- @param scaleW number ---- @param scaleH number ---- @param tileX number ---- @param tileY number ---- @param tileW number ---- @param tileH number ---- @return nil +--- @param texInfo TextureInfo The texture +--- @param x number Where the texture is horizontally (left anchored) +--- @param y number Where the texture is vertically (top anchored) +--- @param scaleW number The scaled width of the texture +--- @param scaleH number The scaled height of the texture +--- @param tileX number Where the tile is horizontally (left anchored) +--- @param tileY number Where the tile is vertically (top anchored) +--- @param tileW number The width of the tile +--- @param tileH number The height of the tile --- Renders a tile of a texture to the screen function djui_hud_render_texture_tile(texInfo, x, y, scaleW, scaleH, tileX, tileY, tileW, tileH) -- ... end ---- @param texInfo TextureInfo ---- @param prevX number ---- @param prevY number ---- @param prevScaleW number ---- @param prevScaleH number ---- @param x number ---- @param y number ---- @param scaleW number ---- @param scaleH number ---- @return nil +--- @param texInfo TextureInfo The texture +--- @param prevX number Where the texture previously was horizontally (left anchored) +--- @param prevY number Where the texture previously was vertically (top anchored) +--- @param prevScaleW number The previous scaled width of the texture +--- @param prevScaleH number The previous scaled height of the texture +--- @param x number Where the texture is horizontally (left anchored) +--- @param y number Where the texture is vertically (top anchored) +--- @param scaleW number The scaled width of the texture +--- @param scaleH number The scaled height of the texture --- Renders an interpolated texture to the screen function djui_hud_render_texture_interpolated(texInfo, prevX, prevY, prevScaleW, prevScaleH, x, y, scaleW, scaleH) -- ... end ---- @param texInfo TextureInfo ---- @param prevX number ---- @param prevY number ---- @param prevScaleW number ---- @param prevScaleH number ---- @param x number ---- @param y number ---- @param scaleW number ---- @param scaleH number ---- @param tileX number ---- @param tileY number ---- @param tileW number ---- @param tileH number ---- @return nil +--- @param texInfo TextureInfo The texture +--- @param prevX number Where the texture previously was horizontally (left anchored) +--- @param prevY number Where the texture previously was vertically (top anchored) +--- @param prevScaleW number The previous scaled width of the texture +--- @param prevScaleH number The previous scaled height of the texture +--- @param x number Where the texture is horizontally (left anchored) +--- @param y number Where the texture is vertically (top anchored) +--- @param scaleW number The scaled width of the texture +--- @param scaleH number The scaled height of the texture +--- @param tileX number Where the tile is horizontally (left anchored) +--- @param tileY number Where the tile is vertically (top anchored) +--- @param tileW number The width of the tile +--- @param tileH number The height of the tile --- Renders an interpolated tile of a texture to the screen function djui_hud_render_texture_tile_interpolated(texInfo, prevX, prevY, prevScaleW, prevScaleH, x, y, scaleW, scaleH, tileX, tileY, tileW, tileH) -- ... end ---- @param textureName string ---- @param overrideTexInfo TextureInfo ---- @return nil +--- @param textureName string The name of the texture +--- @param overrideTexInfo TextureInfo The texture to override with --- Overrides a texture with a custom `TextureInfo` ---- * textureName must be the codename of a vanilla texture, you can find these in files such as `texture.inc.c`s ---- * overrideTexInfo can be any TextureInfo +--- - `textureName` must be the codename of a vanilla texture, you can find these in files such as `texture.inc.c`s +--- - `overrideTexInfo` can be any TextureInfo function texture_override_set(textureName, overrideTexInfo) -- ... end ---- @param textureName string ---- @return nil +--- @param textureName string The name of the texture --- Resets an overridden texture function texture_override_reset(textureName) -- ... @@ -287,7 +331,6 @@ end --- @param levelNum LevelNum | integer --- @param func fun(areaIndex:number, bhvData:bhvData, macroBhvIds:BehaviorId[], macroBhvArgs:integer[]) ---- @return nil --- When `func` is called, arguments are filled depending on the level command: --- - `AREA` command: only `areaIndex` is filled. It's a number. --- - `OBJECT` command: only `bhvData` is filled. `bhvData` is a table with two fields: `behavior` and `behaviorArg`. @@ -296,15 +339,14 @@ function level_script_parse(levelNum, func) -- ... end ---- @param name string ---- @param flags integer ---- @param animYTransDivisor integer ---- @param startFrame integer ---- @param loopStart integer ---- @param loopEnd integer ---- @param values table ---- @param index table ---- @return nil +--- @param name string The name of the animation +--- @param flags integer The flags of the animation (`ANIM_FLAG_*`) +--- @param animYTransDivisor integer The vertical animation translation divisor +--- @param startFrame integer What frame the animation starts on +--- @param loopStart integer When the loop starts +--- @param loopEnd integer When the loop ends +--- @param values table The table containing animation values +--- @param index table The table containing animation indices --- Registers an animation that can be used in objects if `smlua_anim_util_set_animation` is called function smlua_anim_util_register_animation(name, flags, animYTransDivisor, startFrame, loopStart, loopEnd, values, index) -- ... @@ -312,7 +354,6 @@ end --- @param message string The message to log --- @param level? ConsoleMessageLevel Optional; Determines whether the message should appear as info, a warning or an error. ---- @return nil --- Logs a message to the in-game console function log_to_console(message, level) -- ... @@ -320,7 +361,6 @@ end --- @param index integer The index of the scroll target, should match up with the behavior param of RM_Scroll_Texture or editor_Scroll_Texture --- @param name string The name of the vertex buffer that should be used while scrolling the texture ---- @return nil --- Registers a vertex buffer to be used for a scrolling texture. Should be used with RM_Scroll_Texture or editor_Scroll_Texture function add_scroll_target(index, name) -- ... diff --git a/docs/lua/constants.md b/docs/lua/constants.md index fe70e914..c8a20795 100644 --- a/docs/lua/constants.md +++ b/docs/lua/constants.md @@ -63,6 +63,7 @@ - [smlua_hooks.h](#smlua_hooksh) - [enum LuaActionHookType](#enum-LuaActionHookType) - [enum LuaHookedEventType](#enum-LuaHookedEventType) + - [enum LuaModMenuElementType](#enum-LuaModMenuElementType) - [smlua_misc_utils.h](#smlua_misc_utilsh) - [enum HudDisplayFlags](#enum-HudDisplayFlags) - [enum HudDisplayValue](#enum-HudDisplayValue) @@ -3293,7 +3294,17 @@ | HOOK_ON_PLAY_SOUND | 41 | | HOOK_ON_SEQ_LOAD | 42 | | HOOK_ON_ATTACK_OBJECT | 43 | -| HOOK_MAX | 44 | +| HOOK_ON_LANGUAGE_CHANGED | 44 | +| HOOK_MAX | 45 | + +### [enum LuaModMenuElementType](#LuaModMenuElementType) +| Identifier | Value | +| :--------- | :---- | +| MOD_MENU_ELEMENT_BUTTON | 0 | +| MOD_MENU_ELEMENT_CHECKBOX | 1 | +| MOD_MENU_ELEMENT_SLIDER | 2 | +| MOD_MENU_ELEMENT_INPUTBOX | 3 | +| MOD_MENU_ELEMENT_MAX | 4 | [:arrow_up_small:](#) diff --git a/docs/lua/functions-4.md b/docs/lua/functions-4.md index 4da34462..ca9212b3 100644 --- a/docs/lua/functions-4.md +++ b/docs/lua/functions-4.md @@ -8401,6 +8401,26 @@
+## [get_mario_vanilla_animation](#get_mario_vanilla_animation) + +### Lua Example +`local AnimationValue = get_mario_vanilla_animation(index)` + +### Parameters +| Field | Type | +| ----- | ---- | +| index | `integer` | + +### Returns +[Animation](structs.md#Animation) + +### C Prototype +`struct Animation *get_mario_vanilla_animation(u16 index);` + +[:arrow_up_small:](#) + +
+ ## [smlua_anim_util_get_current_animation_name](#smlua_anim_util_get_current_animation_name) ### Lua Example diff --git a/docs/lua/guides/hooks.md b/docs/lua/guides/hooks.md index fbec8363..b7155bd8 100644 --- a/docs/lua/guides/hooks.md +++ b/docs/lua/guides/hooks.md @@ -9,6 +9,10 @@ Hooks are a way for SM64 to trigger Lua code, whereas the functions listed in [f - [hook_event](#hook_event) - [hook_mario_action](#hook_mario_action) - [hook_on_sync_table_change](#hook_on_sync_table_change) +- [hook_mod_menu_button](#hook_mod_menu_button) +- [hook_mod_menu_checkbox](#hook_mod_menu_checkbox) +- [hook_mod_menu_slider](#hook_mod_menu_slider) +- [hook_mod_menu_inputbox](#hook_mod_menu_inputbox)
@@ -63,17 +67,17 @@ id_bhvExample = hook_behavior(nil, OBJ_LIST_DEFAULT, true, bhv_example_init, bhv ```lua function on_test_command(msg) - if msg == 'on' then - djui_chat_message_create('Test: enabled') + if msg == "on" then + djui_chat_message_create("Test: enabled") return true - elseif msg == 'off' then - djui_chat_message_create('Test: disabled') + elseif msg == "off" then + djui_chat_message_create("Test: disabled") return true end return false end -hook_chat_command('test', "[on|off] turn test on or off", on_hide_and_seek_command) +hook_chat_command("test", "[on|off] turn test on or off", on_hide_and_seek_command) ``` [:arrow_up_small:](#) @@ -131,6 +135,7 @@ The lua functions sent to `hook_event()` will be automatically called by SM64 wh | HOOK_ON_PLAY_SOUND | Called when a sound is going to play, return a `SOUND_*` constant or `NO_SOUND` to override the sound | `integer` soundBits, `Vec3f` pos | | HOOK_ON_SEQ_LOAD | Called when a sequence is going to play, return a `SEQ_*` constant to override the sequence. `SEQ_SOUND_PLAYER` (0) is silence. | `integer` player, `integer` seqID | | HOOK_ON_ATTACK_OBJECT | Called when a player attacks an object. May be double-fired in some cases, you'll need to write special code for this | [MarioState](structs.md#MarioState) attacker, [Object](structs.md#Object) victim, `integer` interactionId | +| HOOK_ON_LANGUAGE_CHANGED | Called when the language is changed | `string` language | ### Parameters @@ -144,7 +149,7 @@ The lua functions sent to `hook_event()` will be automatically called by SM64 wh The following example will print out a message 16 times per frame (once for every possible player). ```lua function mario_update(m) - print('Mario update was called for player index ', m.playerIndex) + print("Mario update was called for player index ", m.playerIndex) end hook_event(HOOK_MARIO_UPDATE, mario_update) @@ -261,14 +266,140 @@ hook_mario_action(ACT_WALL_SLIDE, { every_frame = act_wall_slide, gravity = act_ ```lua function on_testing_field_changed(tag, oldVal, newVal) - print('testingField changed:', tag, ',', oldVal, '->', newVal) + print("testingField changed:", tag, ",", oldVal, "->", newVal) end -hook_on_sync_table_change(gGlobalSyncTable, 'testingField', 'tag', on_testing_field_changed) - --- now when testingField is set, either locally or over the network, on_testing_field_changed() will be called -gGlobalSyncTable.testingField = 'hello' +hook_on_sync_table_change(gGlobalSyncTable, "testingField", "tag", on_testing_field_changed) +-- now when testingField is set, either locally or over the network on_testing_field_changed() will be called +gGlobalSyncTable.testingField = "hello" ``` [:arrow_up_small:](#) + +
+ +## [hook_mod_menu_button](#hook_mod_menu_button) +`hook_mod_menu_button()` allows Lua to add buttons to their designated mod menu submenu. + +### Parameters + +| Field | Type | +| ----- | ---- | +| message | `string` | +| func | `Lua Function` (`integer` index) | + +### Lua Example + +```lua +local menu1Open = false +local menu2Open = false + +--- @param index integer +local function on_open_menu(index) + if index == 0 then + menu1Open = true + menu2Open = false + else + menu1Open = false + menu2Open = true + end +end + +-- you can always do separate functions too! +hook_mod_menu_button("Open Menu 1", on_open_menu) +hook_mod_menu_button("Open Menu 2", on_open_menu) +``` + +[:arrow_up_small:](#) + +
+ +## [hook_mod_menu_checkbox](#hook_mod_menu_checkbox) +`hook_mod_menu_checkbox()` allows Lua to add checkboxes to their designated mod menu submenu. + +### Parameters + +| Field | Type | +| ----- | ---- | +| message | `string` | +| defaultValue | `boolean` | +| func | `Lua Function` (`integer` index, `boolean` value) | + +### Lua Example + +```lua +local flyMode = false +local noclipMode = false + +--- @param index integer +--- @param value boolean +local function on_set_player_mode(index, value) + if index == 0 then + flyMode = value + else + noclipMode = value + end +end + +-- you can always do separate functions too! +hook_mod_menu_checkbox("Fly Mode", false, on_set_player_mode) +hook_mod_menu_checkbox("Noclip Mode", false, on_set_player_mode) +``` + +[:arrow_up_small:](#) + +
+ +## [hook_mod_menu_slider](#hook_mod_menu_slider) +`hook_mod_menu_slider()` allows Lua to add sliders to their designated mod menu submenu. + +### Parameters + +| Field | Type | +| ----- | ---- | +| message | `string` | +| defaultValue | `integer` | +| min | `integer` | +| max | `integer` | +| func | `Lua Function` (`integer` index, `integer` value) | + +### Lua Example + +```lua +local timeScale = 0.0 + +local function on_set_time_scale(index, value) + timeScale = value +end + +hook_mod_menu_slider("Time Scale", 1, 0, 10, on_set_time_scale) +``` + +[:arrow_up_small:](#) + +
+ +## [hook_mod_menu_inputbox](#hook_mod_menu_inputbox) +`hook_mod_menu_inputbox()` allows Lua to add textboxes to their designated mod menu submenu. + +### Parameters + +| Field | Type | +| ----- | ---- | +| message | `string` | +| defaultValue | `string` | +| stringLength | `integer` | +| func | `Lua Function` (`integer` index, `string` value) | + +### Lua Example + +```lua +--- @param index integer +--- @param value string +local function on_set_network_player_description(index, value) + network_player_set_description(gNetworkPlayers[0], value, 255, 255, 255, 255) +end + +hook_mod_menu_inputbox("Network Player Description", on_set_network_player_description) +``` \ No newline at end of file diff --git a/lang/Czech.ini b/lang/Czech.ini index f6ea83ff..0894bf31 100644 --- a/lang/Czech.ini +++ b/lang/Czech.ini @@ -305,6 +305,8 @@ SERVER_SETTINGS = "Nastavení serveru" RESUME = "Pokračovat" STOP_HOSTING = "Vypnout server" DISCONNECT = "Odpojit se" +MOD_MENU = "Menu modů" +MOD_MENU_TITLE = "MENU MODŮ" [PLAYER] PLAYER_TITLE = "HRAC" diff --git a/lang/Dutch.ini b/lang/Dutch.ini index 6098b2a0..86eda474 100644 --- a/lang/Dutch.ini +++ b/lang/Dutch.ini @@ -305,6 +305,8 @@ SERVER_SETTINGS = "Server Instellingen" RESUME = "Verder gaan" STOP_HOSTING = "Stop Met Organizeren" DISCONNECT = "Verbinding Verbreken" +MOD_MENU = "Modusmenu" +MOD_MENU_TITLE = "MODUSMENU" [PLAYER] PLAYER_TITLE = "Speler" diff --git a/lang/English.ini b/lang/English.ini index 09cbab4a..4b8e14fd 100644 --- a/lang/English.ini +++ b/lang/English.ini @@ -305,6 +305,8 @@ SERVER_SETTINGS = "Server Settings" RESUME = "Resume" STOP_HOSTING = "Stop Hosting" DISCONNECT = "Disconnect" +MOD_MENU = "Mod Menu" +MOD_MENU_TITLE = "MOD MENU" [PLAYER] PLAYER_TITLE = "PLAYER" diff --git a/lang/French.ini b/lang/French.ini index b23e9846..bdade2b8 100644 --- a/lang/French.ini +++ b/lang/French.ini @@ -305,6 +305,8 @@ SERVER_SETTINGS = "Paramètres du serveur" RESUME = "Reprendre" STOP_HOSTING = "Arrêter d'héberger" DISCONNECT = "Se déconnecter" +MOD_MENU = "Menu des mods" +MOD_MENU_TITLE = "MENU DES MODS" [PLAYER] PLAYER_TITLE = "JOUEUR" diff --git a/lang/German.ini b/lang/German.ini index ad91dcc6..29eef449 100644 --- a/lang/German.ini +++ b/lang/German.ini @@ -305,6 +305,8 @@ SERVER_SETTINGS = "Servereinstellungen" RESUME = "Zurück zum Spiel" STOP_HOSTING = "Hosting beenden" DISCONNECT = "Verbindung trennen" +MOD_MENU = "Mod-Menü" +MOD_MENU_TITLE = "MOD-MENÜ" [PLAYER] PLAYER_TITLE = "SPIELER" diff --git a/lang/Italian.ini b/lang/Italian.ini index 9838480e..ab2c99ee 100644 --- a/lang/Italian.ini +++ b/lang/Italian.ini @@ -303,6 +303,8 @@ SERVER_SETTINGS = "Impostazioni Server" RESUME = "Riprendi" STOP_HOSTING = "Interrompi la connessione" DISCONNECT = "Disconnettiti" +MOD_MENU = "Menu delle mod" +MOD_MENU_TITLE = "MENU DELLE MOD" [PLAYER] PLAYER_TITLE = "GICATORE" diff --git a/lang/Polish.ini b/lang/Polish.ini index 1bdfbc27..bc501af9 100644 --- a/lang/Polish.ini +++ b/lang/Polish.ini @@ -305,6 +305,8 @@ SERVER_SETTINGS = "Ustawienia Serwera" RESUME = "Kontynuuj" STOP_HOSTING = "Przerwij Hostowanie" DISCONNECT = "Rozlacz" +MOD_MENU = "Menu modyfikacji" +MOD_MENU_TITLE = "MENU MODYFIKACJI" [PLAYER] PLAYER_TITLE = "GRACZ" diff --git a/lang/Portuguese.ini b/lang/Portuguese.ini index 1eac2ff7..7d09bcce 100644 --- a/lang/Portuguese.ini +++ b/lang/Portuguese.ini @@ -305,6 +305,8 @@ SERVER_SETTINGS = "Configurações de servidor" RESUME = "Resumo" STOP_HOSTING = "Parar a partida" DISCONNECT = "Desconectar" +MOD_MENU = "Menu de mods" +MOD_MENU_TITLE = "MENU DE MODS" [PLAYER] PLAYER_TITLE = "JOGADOR" diff --git a/lang/Russian.ini b/lang/Russian.ini index e044e12c..a1d4ec54 100644 --- a/lang/Russian.ini +++ b/lang/Russian.ini @@ -304,6 +304,8 @@ SERVER_SETTINGS = "Настройки сервера" RESUME = "Продолжить" STOP_HOSTING = "Остановить хостинг" DISCONNECT = "Отключиться" +MOD_MENU = "Меню модов" +MOD_MENU_TITLE = "МЕНЮ МОДОВ" [PLAYER] PLAYER_TITLE = "PLAYER" diff --git a/lang/Spanish.ini b/lang/Spanish.ini index 8fbe9042..3ec4f40c 100644 --- a/lang/Spanish.ini +++ b/lang/Spanish.ini @@ -305,6 +305,8 @@ SERVER_SETTINGS = "Ajustes de la partida" RESUME = "Continuar" STOP_HOSTING = "Finalizar partida" DISCONNECT = "Desconectarse" +MOD_MENU = "Menú de mods" +MOD_MENU_TITLE = "MENÚ DE MODS" [PLAYER] PLAYER_TITLE = "JUGADOR" diff --git a/mods/cheats.lua b/mods/cheats.lua new file mode 100644 index 00000000..5f6f94a3 --- /dev/null +++ b/mods/cheats.lua @@ -0,0 +1,366 @@ +-- name: Cheats +-- incompatible: cheats +-- description: Cheats\nA mod that adds a bunch of cheats to the mod menu, accessible through the pause menu. +-- pausable: true + +-- localize functions to improve performance +local math_floor,smlua_text_utils_get_language,table_insert,approach_s32,set_mario_action,get_network_area_timer = math.floor,smlua_text_utils_get_language,table.insert,approach_s32,set_mario_action,get_network_area_timer + +--- @class Cheat +--- @field public codename string +--- @field public names table +--- @field public hook LuaHookedEventType +--- @field public func function +--- @field public allowHazardSurfaces boolean + +--- @type Cheat[] +local sCheats = {} + +--- @param m MarioState +--- Checks if `m` is active +local function active_player(m) + local np = gNetworkPlayers[m.playerIndex] + if m.playerIndex == 0 then + return true + end + if not np.connected then + return false + end + if np.currCourseNum ~= gNetworkPlayers[0].currCourseNum then + return false + end + if np.currActNum ~= gNetworkPlayers[0].currActNum then + return false + end + if np.currLevelNum ~= gNetworkPlayers[0].currLevelNum then + return false + end + if np.currAreaIndex ~= gNetworkPlayers[0].currAreaIndex then + return false + end + return true +end + +--- @param num integer +--- Limits an integer in the s16 range +local function s16(num) + num = math_floor(num) & 0xFFFF + if num >= 32768 then return num - 65536 end + return num +end + +local function lang_string(strings) + local table = strings[smlua_text_utils_get_language()] + if table == nil then return strings["English"] end + return table +end + +--- @param codename string +--- @param names table +--- @param hook LuaHookedEventType +--- @param func function +--- @param allowHazardSurfaces boolean +--- Registers a cheat +--- +--- Supported hooks: +--- - `HOOK_MARIO_UPDATE` +--- - `HOOK_BEFORE_MARIO_UPDATE` +--- - `HOOK_BEFORE_PHYS_STEP` +local function register_cheat(codename, names, hook, func, allowHazardSurfaces) + table_insert(sCheats, { + codename = codename, + names = names, + hook = hook, + func = func, + allowHazardSurfaces = allowHazardSurfaces + }) + + for i = 0, MAX_PLAYERS - 1 do + gPlayerSyncTable[i][codename] = false + end +end + +--- @param m MarioState +local function moon_jump_update(m) + if m.controller.buttonDown & L_TRIG ~= 0 then + m.faceAngle.y = m.intendedYaw - approach_s32(s16(m.intendedYaw - m.faceAngle.y), 0, 0x800, 0x800) + m.vel.y = 40 + + if m.action == ACT_FORWARD_GROUND_KB or + m.action == ACT_BACKWARD_GROUND_KB or + m.action == ACT_SOFT_FORWARD_GROUND_KB or + m.action == ACT_HARD_BACKWARD_GROUND_KB or + m.action == ACT_FORWARD_AIR_KB or + m.action == ACT_BACKWARD_AIR_KB or + m.action == ACT_HARD_FORWARD_AIR_KB or + m.action == ACT_HARD_BACKWARD_AIR_KB or + m.action == ACT_AIR_HIT_WALL then + set_mario_action(m, ACT_FREEFALL, 0) + end + end +end + +--- @param m MarioState +local function god_mode_update(m) + m.health = 0x880 + m.healCounter = 0 + m.hurtCounter = 0 + m.peakHeight = m.pos.y +end + +--- @param m MarioState +local function infinite_lives_update(m) + m.numLives = 100 +end + +--- @param m MarioState +local function super_speed_update(m) + if m.action ~= ACT_BUBBLED and m.action ~= ACT_WATER_JUMP and m.action ~= ACT_HOLD_WATER_JUMP then + m.vel.x = m.vel.x * 4 + m.vel.z = m.vel.z * 4 + end +end + +--- @param m MarioState +local function responsive_controls_update(m) + if m.action == ACT_WALKING or + m.action == ACT_HOLD_WALKING or + m.action == ACT_HOLD_HEAVY_WALKING or + m.action == ACT_FINISH_TURNING_AROUND or + m.action == ACT_CRAWLING then + m.faceAngle.y = m.intendedYaw + end +end + +--- @param m MarioState +local function rapid_fire_update(m) + if (m.controller.buttonDown & A_BUTTON) ~= 0 and get_network_area_timer() % 2 == 0 then + m.controller.buttonPressed = m.controller.buttonPressed | A_BUTTON + end +end + +local function blj_anywhere_update(m) + if m.action == ACT_LONG_JUMP and + m.controller.buttonDown & Z_TRIG ~= 0 and + m.forwardVel < -15 then + m.vel.y = -30 + end +end + +local function always_triple_jump_update(m, action) + if m.forwardVel < 20 and m.action == ACT_DOUBLE_JUMP_LAND and action == ACT_JUMP then + return ACT_TRIPLE_JUMP + end +end + +register_cheat( + "moonJump", + { + ["Czech"] = "Nekonečný Skok", + ["Dutch"] = "Maan Sprong", + ["English"] = "Moon Jump", + ["French"] = "Saut Antigravité", + ["German"] = "Mond-Sprung", + ["Italian"] = "Salto della Luna", + ["Polish"] = "Skok Ksiezycowy", + ["Portuguese"] = "Pulo da Lua", + ["Russian"] = "Супер прыжок", + ["Spanish"] = "Salto Lunar" + }, + HOOK_MARIO_UPDATE, + moon_jump_update, + true +) + +register_cheat( + "godMode", + { + ["Czech"] = "Nenech Se Zranit", + ["Dutch"] = "God Modus", + ["English"] = "God Mode", + ["French"] = "Mode Invincible", + ["German"] = "Gott Modus", + ["Italian"] = "Modalità Dio", + ["Polish"] = "Tryb Boga", + ["Portuguese"] = "Modo Deus", + ["Russian"] = "Режим бога", + ["Spanish"] = "Modo Dios", + }, + HOOK_MARIO_UPDATE, + god_mode_update, + false +) + +register_cheat( + "infiniteLives", + { + ["Czech"] = "Nekonečné Životy", + ["Dutch"] = "Oneindige Levens", + ["English"] = "Infinite Lives", + ["French"] = "Vies Infinies", + ["German"] = "Unbegrenzte Leben", + ["Italian"] = "Vite Infinite", + ["Polish"] = "Nieskonczone Zycia", + ["Portuguese"] = "Vidas Infinitas", + ["Russian"] = "Бесконечные жизни", + ["Spanish"] = "Vidas Infinitas", + }, + HOOK_MARIO_UPDATE, + infinite_lives_update, + true +) + +register_cheat( + "superSpeed", + { + ["Czech"] = "Super Rychlost", + ["Dutch"] = "Super Snelheid", + ["English"] = "Super Speed", + ["French"] = "Super Vitesse", + ["German"] = "Supergeschwindigkeit", + ["Italian"] = "Super Velocità", + ["Polish"] = "Super Szybkosc", + ["Portuguese"] = "Super Velocidade", + ["Russian"] = "Супер cкорость", + ["Spanish"] = "Super Velocidad", + }, + HOOK_BEFORE_PHYS_STEP, + super_speed_update, + true +) + +register_cheat( + "responsiveControls", + { + ["Czech"] = "Citlivé Ovládání", + ["Dutch"] = "Snel Reagerende Controles", + ["English"] = "Responsive Controls", + ["French"] = "Contrôles Réactifs", + ["German"] = "Reaktionsschnelle Steuerung", + ["Italian"] = "Controlli Reattivi", + ["Polish"] = "Responsywne Sterowanie", + ["Portuguese"] = "Controle Responsivos", + ["Russian"] = "Отзывчивое управление", + ["Spanish"] = "Controles Responsivos", + }, + HOOK_MARIO_UPDATE, + responsive_controls_update, + true +) + +register_cheat( + "rapidFire", + { + ["Czech"] = "Rychle Mačkat Tlačítko", + ["Dutch"] = "Snel Vuur", + ["English"] = "Rapid Fire", + ["French"] = "Tir Rapide", + ["German"] = "Schnellfeuer", + ["Italian"] = "Fuoco Rapido", + ["Polish"] = "Szybkostrzelnosc", + ["Portuguese"] = "Fogo Rápido", + ["Russian"] = "Быстрый огонь", + ["Spanish"] = "Pulsación Rápida", + }, + HOOK_BEFORE_MARIO_UPDATE, + rapid_fire_update, + true +) + +register_cheat( + "bljAnywhere", + { + ["Czech"] = "BLJ Všude", + ["Dutch"] = "BLJ Overal", + ["English"] = "BLJ Anywhere", + ["French"] = "BLJ N'importe Où", + ["German"] = "Überall Rückwertsweitspringen", + ["Italian"] = "BLJ Ovunque", + ["Polish"] = "BLJ Gdziekolwiek", + ["Portuguese"] = "BLJ Em Qualquer Lugar", + ["Russian"] = "BLJ в любом месте", + ["Spanish"] = "BLJ Donde Sea", + }, + HOOK_BEFORE_MARIO_UPDATE, + blj_anywhere_update, + true +) + +register_cheat( + "alwaysTripleJump", + { + ["Czech"] = "Vždy Trojitý Skok", + ["Dutch"] = "Altijd Drievoudige Sprong", + ["English"] = "Always Triple Jump", + ["French"] = "Triple Sauts Infinis", + ["German"] = "Immer Dreisprung", + ["Italian"] = "Sempre Salto Triplo", + ["Polish"] = "Potrojny Skok Zawsze", + ["Portuguese"] = "Sempre Fazer Triple Jump", + ["Russian"] = "Всегда тройной прыжок", + ["Spanish"] = "Siempre Hacer Salto Triple", + }, + HOOK_BEFORE_SET_MARIO_ACTION, + always_triple_jump_update, + true +) + +--- @param hookType LuaHookedEventType +local function generate_mario_hook_function(hookType) + --- @param m MarioState + return function(m) + if not active_player(m) then return end + + for _, cheat in ipairs(sCheats) do + if cheat.hook == hookType and gPlayerSyncTable[m.playerIndex][cheat.codename] then + cheat.func(m) + end + end + end +end + +local function before_set_mario_action(m, action) + if not active_player(m) then return end + + for _, cheat in ipairs(sCheats) do + if cheat.hook == HOOK_BEFORE_SET_MARIO_ACTION and gPlayerSyncTable[m.playerIndex][cheat.codename] then + return cheat.func(m, action) + end + end +end + +--- @param m MarioState +local function allow_hazard_surface(m) + for _, cheat in ipairs(sCheats) do + if gPlayerSyncTable[m.playerIndex][cheat.codename] and not cheat.allowHazardSurfaces then return false end + end + return true +end + +local function on_language_changed() + for i, cheat in ipairs(sCheats) do + update_mod_menu_element_name(i - 1, lang_string(cheat.names)) + end +end + + +--- @param index integer +--- @param value boolean +local function update_cheat(index, value) + for i, cheat in ipairs(sCheats) do + if i - 1 == index then + gPlayerSyncTable[0][cheat.codename] = value + end + end +end + +hook_event(HOOK_MARIO_UPDATE, generate_mario_hook_function(HOOK_MARIO_UPDATE)) +hook_event(HOOK_BEFORE_MARIO_UPDATE, generate_mario_hook_function(HOOK_BEFORE_MARIO_UPDATE)) +hook_event(HOOK_BEFORE_PHYS_STEP, generate_mario_hook_function(HOOK_BEFORE_PHYS_STEP)) +hook_event(HOOK_BEFORE_SET_MARIO_ACTION, before_set_mario_action) +hook_event(HOOK_ALLOW_HAZARD_SURFACE, allow_hazard_surface) +hook_event(HOOK_ON_LANGUAGE_CHANGED, on_language_changed) + +for _, cheat in ipairs(sCheats) do + hook_mod_menu_checkbox(lang_string(cheat.names), false, update_cheat) +end diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c index 895244c7..4eda892c 100644 --- a/src/game/ingame_menu.c +++ b/src/game/ingame_menu.c @@ -139,6 +139,7 @@ s8 gLastDialogResponse = 0; u8 gMenuHoldKeyIndex = 0; u8 gMenuHoldKeyTimer = 0; s32 gDialogResponse = 0; +bool gForceUnpause = false; #if defined(VERSION_JP) || defined(VERSION_SH) || defined(VERSION_EU) #ifdef VERSION_EU @@ -3103,16 +3104,19 @@ s16 render_pause_courses_and_castle(void) { } #ifdef VERSION_EU - if (gPlayer1Controller->buttonPressed & (A_BUTTON | Z_TRIG | START_BUTTON)) + if (gPlayer1Controller->buttonPressed & (A_BUTTON | Z_TRIG | START_BUTTON) + || gForceUnpause) #else if (gPlayer1Controller->buttonPressed & A_BUTTON - || gPlayer1Controller->buttonPressed & START_BUTTON) + || gPlayer1Controller->buttonPressed & START_BUTTON + || gForceUnpause) #endif { level_set_transition(0, NULL); play_sound(SOUND_MENU_PAUSE_2, gGlobalSoundSource); gDialogBoxState = DIALOG_STATE_OPENING; gMenuMode = -1; + gForceUnpause = false; if (gDialogLineNum == 2 || gDialogLineNum == 3) { num = gDialogLineNum; @@ -3138,16 +3142,19 @@ s16 render_pause_courses_and_castle(void) { } #ifdef VERSION_EU - if (gPlayer1Controller->buttonPressed & (A_BUTTON | Z_TRIG | START_BUTTON)) + if (gPlayer1Controller->buttonPressed & (A_BUTTON | Z_TRIG | START_BUTTON) + || gForceUnpause) #else if (gPlayer1Controller->buttonPressed & A_BUTTON - || gPlayer1Controller->buttonPressed & START_BUTTON) + || gPlayer1Controller->buttonPressed & START_BUTTON + || gForceUnpause) #endif { level_set_transition(0, NULL); play_sound(SOUND_MENU_PAUSE_2, gGlobalSoundSource); gMenuMode = -1; gDialogBoxState = DIALOG_STATE_OPENING; + gForceUnpause = false; return 1; } diff --git a/src/game/ingame_menu.h b/src/game/ingame_menu.h index b4a55a78..7ef5e78d 100644 --- a/src/game/ingame_menu.h +++ b/src/game/ingame_menu.h @@ -129,6 +129,7 @@ extern u8 gDialogTextColorR; extern u8 gDialogTextColorG; extern u8 gDialogTextColorB; extern u8 gDialogTextColorA; +extern bool gForceUnpause; void create_dl_identity_matrix(void); void create_dl_translation_matrix(s8 pushOp, f32 x, f32 y, f32 z); diff --git a/src/game/player_palette.c b/src/game/player_palette.c index 209556aa..89666c7b 100644 --- a/src/game/player_palette.c +++ b/src/game/player_palette.c @@ -60,7 +60,7 @@ void player_palettes_read(const char* palettesPath, bool appendPalettes) { if (appendPalettes) { snprintf(lpath, SYS_MAX_PATH, "%s/palettes", palettesPath); } else { - strncpy(lpath, palettesPath, SYS_MAX_PATH); + snprintf(lpath, SYS_MAX_PATH, "%s", palettesPath); } // open directory @@ -104,7 +104,7 @@ void player_palettes_read(const char* palettesPath, bool appendPalettes) { // free ini_free(sPalette); sPalette = NULL; - strncpy(gPresetPalettes[gPresetPaletteCount].name, path, 4096); + snprintf(gPresetPalettes[gPresetPaletteCount].name, 64, "%s", path); gPresetPalettes[gPresetPaletteCount].palette = palette; gPresetPaletteCount++; #ifdef DEVELOPMENT diff --git a/src/game/player_palette.h b/src/game/player_palette.h index 396c9f1e..139e2bbf 100644 --- a/src/game/player_palette.h +++ b/src/game/player_palette.h @@ -18,7 +18,7 @@ struct PlayerPalette { #pragma pack() struct PresetPalette { - char name[4096]; + char name[64]; struct PlayerPalette palette; }; diff --git a/src/pc/cliopts.c b/src/pc/cliopts.c index f8b2394d..53f3358b 100644 --- a/src/pc/cliopts.c +++ b/src/pc/cliopts.c @@ -79,7 +79,7 @@ bool parse_cli_opts(int argc, char* argv[]) { gCLIOpts.networkPort = 7777; } } else if (!strcmp(argv[i], "--playername") && (i + 1) < argc) { - arg_string("--playername", argv[++i], gCLIOpts.playerName, MAX_PLAYER_STRING); + arg_string("--playername", argv[++i], gCLIOpts.playerName, MAX_CONFIG_STRING); } else if (!strcmp(argv[i], "--help")) { print_help(); return false; diff --git a/src/pc/cliopts.h b/src/pc/cliopts.h index dd0fb009..88d03ccb 100644 --- a/src/pc/cliopts.h +++ b/src/pc/cliopts.h @@ -24,7 +24,7 @@ struct CLIOptions { enum NetworkType network; unsigned int networkPort; char joinIp[IP_MAX_LEN]; - char playerName[MAX_PLAYER_STRING]; + char playerName[MAX_CONFIG_STRING]; bool hideLoadingScreen; }; diff --git a/src/pc/configfile.c b/src/pc/configfile.c index 33ab4dab..65678023 100644 --- a/src/pc/configfile.c +++ b/src/pc/configfile.c @@ -144,7 +144,7 @@ bool configDebugError = false; bool configCtxProfiler = false; #endif // player settings -char configPlayerName[MAX_PLAYER_STRING] = ""; +char configPlayerName[MAX_CONFIG_STRING] = ""; unsigned int configPlayerModel = 0; struct PlayerPalette configPlayerPalette = { { { 0x00, 0x00, 0xff }, { 0xff, 0x00, 0x00 }, { 0xff, 0xff, 0xff }, { 0x72, 0x1c, 0x0e }, { 0x73, 0x06, 0x00 }, { 0xfe, 0xc1, 0x79 }, { 0xff, 0x00, 0x00 }, { 0xff, 0x00, 0x00 } } }; // coop settings @@ -257,7 +257,7 @@ static const struct ConfigOption options[] = { {.name = "ctx_profiler", .type = CONFIG_TYPE_BOOL, .boolValue = &configCtxProfiler}, #endif // player settings - {.name = "coop_player_name", .type = CONFIG_TYPE_STRING, .stringValue = (char*)&configPlayerName, .maxStringLength = MAX_PLAYER_STRING}, + {.name = "coop_player_name", .type = CONFIG_TYPE_STRING, .stringValue = (char*)&configPlayerName, .maxStringLength = MAX_CONFIG_STRING}, {.name = "coop_player_model", .type = CONFIG_TYPE_UINT, .uintValue = &configPlayerModel}, {.name = "coop_player_palette_pants", .type = CONFIG_TYPE_COLOR, .colorValue = &configPlayerPalette.parts[PANTS]}, {.name = "coop_player_palette_shirt", .type = CONFIG_TYPE_COLOR, .colorValue = &configPlayerPalette.parts[SHIRT]}, @@ -446,7 +446,7 @@ static void save_name_read(char** tokens, int numTokens) { } } - strncpy(configSaveNames[index], fullSaveName, MAX_SAVE_NAME_STRING); + snprintf(configSaveNames[index], MAX_SAVE_NAME_STRING, "%s", fullSaveName); } static void save_name_write(FILE* file) { @@ -679,7 +679,7 @@ NEXT_OPTION: if (configDjuiTheme >= DJUI_THEME_MAX) { configDjuiTheme = 0; } - if (!strcmp(configLastVersion, "")) { strncpy(configLastVersion, get_version(), MAX_CONFIG_STRING); } + if (!strcmp(configLastVersion, "")) { snprintf(configLastVersion, MAX_CONFIG_STRING, "%s", get_version()); } #ifndef COOPNET configNetworkSystem = NS_SOCKET; diff --git a/src/pc/configfile.h b/src/pc/configfile.h index 8d44f24d..992f6990 100644 --- a/src/pc/configfile.h +++ b/src/pc/configfile.h @@ -11,7 +11,6 @@ #define MAX_BINDS 3 #define MAX_VOLUME 127 #define MAX_CONFIG_STRING 64 -#define MAX_PLAYER_STRING 60 #define MAX_SAVE_NAME_STRING 32 #define DEFAULT_PORT 7777 @@ -96,7 +95,7 @@ extern bool configDebugError; extern bool configCtxProfiler; #endif // player settings -extern char configPlayerName[MAX_PLAYER_STRING]; +extern char configPlayerName[MAX_CONFIG_STRING]; extern unsigned int configPlayerModel; extern struct PlayerPalette configPlayerPalette; // coop settings diff --git a/src/pc/discord/discord.c b/src/pc/discord/discord.c index 431637e2..28fb0190 100644 --- a/src/pc/discord/discord.c +++ b/src/pc/discord/discord.c @@ -94,7 +94,7 @@ static void on_current_user_update(UNUSED void* data) { if (configPlayerName[0] == '\0' && strlen(user.username) > 0) { char* cname = configPlayerName; char* dname = user.username; - for (int i = 0; i < MAX_PLAYER_STRING - 1; i++) { + for (int i = 0; i < MAX_CONFIG_STRING - 1; i++) { if (*dname >= '!' && *dname <= '~') { *cname = *dname; cname++; diff --git a/src/pc/discord/discord_activity.c b/src/pc/discord/discord_activity.c index 8112c076..44f2bc90 100644 --- a/src/pc/discord/discord_activity.c +++ b/src/pc/discord/discord_activity.c @@ -93,10 +93,10 @@ static void discord_populate_details(char* buffer, int bufferLength) { void discord_activity_update(void) { sCurActivity.type = DiscordActivityType_Playing; - strncpy(sCurActivity.assets.large_image, "characters", 128); - strncpy(sCurActivity.assets.large_text, "sm64coopdx Characters", 128); - strncpy(sCurActivity.assets.small_image, "icon", 128); - strncpy(sCurActivity.assets.small_text, "sm64coopdx Icon", 128); + snprintf(sCurActivity.assets.large_image, 128, "characters"); + snprintf(sCurActivity.assets.large_text, 128, "sm64coopdx Characters"); + snprintf(sCurActivity.assets.small_image, 128, "icon"); + snprintf(sCurActivity.assets.small_text, 128, "sm64coopdx Icon"); if (gNetworkType != NT_NONE && gNetworkSystem) { gNetworkSystem->get_lobby_id(sCurActivity.party.id, 128); diff --git a/src/pc/djui/djui.c b/src/pc/djui/djui.c index a8febe8d..97d3016e 100644 --- a/src/pc/djui/djui.c +++ b/src/pc/djui/djui.c @@ -103,7 +103,7 @@ void djui_init_late(void) { djui_panel_language_create(NULL); } if (strcmp(configLastVersion, get_version())) { - strncpy(configLastVersion, get_version(), MAX_CONFIG_STRING); + snprintf(configLastVersion, MAX_CONFIG_STRING, "%s", get_version()); djui_panel_changelog_create(NULL); } diff --git a/src/pc/djui/djui_hud_utils.c b/src/pc/djui/djui_hud_utils.c index 8761d98f..09760edf 100644 --- a/src/pc/djui/djui_hud_utils.c +++ b/src/pc/djui/djui_hud_utils.c @@ -51,20 +51,20 @@ extern ALIGNED8 const u8 texture_hud_char_apostrophe[]; extern ALIGNED8 const u8 texture_hud_char_double_quote[]; struct GlobalTextures gGlobalTextures = { - .camera = { .texture = (u8*)texture_hud_char_camera, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_camera" }, - .lakitu = { .texture = (u8*)texture_hud_char_lakitu, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_lakitu" }, - .no_camera = { .texture = (u8*)texture_hud_char_no_camera, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_no_camera" }, - .arrow_up = { .texture = (u8*)texture_hud_char_arrow_up, .bitSize = 8, .width = 8, .height = 8, "texture_hud_char_arrow_up" }, - .arrow_down = { .texture = (u8*)texture_hud_char_arrow_down, .bitSize = 8, .width = 8, .height = 8, "texture_hud_char_arrow_down" }, - .coin = { .texture = (u8*)texture_hud_char_coin, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_coin" }, - .star = { .texture = (u8*)texture_hud_char_star, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_star" }, - .apostrophe = { .texture = (u8*)texture_hud_char_apostrophe, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_apostrophe" }, + .camera = { .texture = (u8*)texture_hud_char_camera, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_camera" }, + .lakitu = { .texture = (u8*)texture_hud_char_lakitu, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_lakitu" }, + .no_camera = { .texture = (u8*)texture_hud_char_no_camera, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_no_camera" }, + .arrow_up = { .texture = (u8*)texture_hud_char_arrow_up, .bitSize = 8, .width = 8, .height = 8, "texture_hud_char_arrow_up" }, + .arrow_down = { .texture = (u8*)texture_hud_char_arrow_down, .bitSize = 8, .width = 8, .height = 8, "texture_hud_char_arrow_down" }, + .coin = { .texture = (u8*)texture_hud_char_coin, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_coin" }, + .star = { .texture = (u8*)texture_hud_char_star, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_star" }, + .apostrophe = { .texture = (u8*)texture_hud_char_apostrophe, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_apostrophe" }, .double_quote = { .texture = (u8*)texture_hud_char_double_quote, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_double_quote" }, - .mario_head = { .texture = (u8*)texture_hud_char_mario_head, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_mario_head" }, - .luigi_head = { .texture = (u8*)texture_hud_char_luigi_head, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_luigi_head" }, - .toad_head = { .texture = (u8*)texture_hud_char_toad_head, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_toad_head" }, + .mario_head = { .texture = (u8*)texture_hud_char_mario_head, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_mario_head" }, + .luigi_head = { .texture = (u8*)texture_hud_char_luigi_head, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_luigi_head" }, + .toad_head = { .texture = (u8*)texture_hud_char_toad_head, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_toad_head" }, .waluigi_head = { .texture = (u8*)texture_hud_char_waluigi_head, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_waluigi_head" }, - .wario_head = { .texture = (u8*)texture_hud_char_wario_head, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_wario_head" } + .wario_head = { .texture = (u8*)texture_hud_char_wario_head, .bitSize = 8, .width = 16, .height = 16, "texture_hud_char_wario_head" } }; static void djui_hud_position_translate(f32* x, f32* y) { diff --git a/src/pc/djui/djui_panel_host_save.c b/src/pc/djui/djui_panel_host_save.c index 6045cb60..b2128a4e 100644 --- a/src/pc/djui/djui_panel_host_save.c +++ b/src/pc/djui/djui_panel_host_save.c @@ -16,7 +16,7 @@ static char* sSaveLetters[] = { "A", "B", "C", "D" }; static void djui_panel_host_save_update_button(struct DjuiButton* button, int slot); static void djui_panel_host_save_save_name_change(UNUSED struct DjuiBase* caller) { - strncpy(configSaveNames[sButtonTag], sSaveNameInputBox->buffer, MAX_SAVE_NAME_STRING); + snprintf(configSaveNames[sButtonTag], MAX_SAVE_NAME_STRING, "%s", sSaveNameInputBox->buffer); if (strlen(sSaveNameInputBox->buffer) >= 64) { djui_inputbox_set_text(sSaveNameInputBox, configSaveNames[sButtonTag]); } @@ -47,7 +47,7 @@ static void djui_panel_edit_create(struct DjuiBase* caller) { djui_base_set_size(&sSaveNameInputBox->base, 0.45f, 32); djui_base_set_alignment(&sSaveNameInputBox->base, DJUI_HALIGN_RIGHT, DJUI_VALIGN_TOP); char saveName[MAX_SAVE_NAME_STRING] = { 0 }; - strncpy(saveName, configSaveNames[sButtonTag], MAX_SAVE_NAME_STRING); + snprintf(saveName, MAX_SAVE_NAME_STRING, "%s", configSaveNames[sButtonTag]); djui_inputbox_set_text(sSaveNameInputBox, saveName); djui_interactable_hook_value_change(&sSaveNameInputBox->base, djui_panel_host_save_save_name_change); } diff --git a/src/pc/djui/djui_panel_language.c b/src/pc/djui/djui_panel_language.c index d09b7831..6025d9a5 100644 --- a/src/pc/djui/djui_panel_language.c +++ b/src/pc/djui/djui_panel_language.c @@ -9,6 +9,7 @@ #include "pc/utils/misc.h" #include "pc/configfile.h" #include "pc/os/os.h" +#include "pc/lua/smlua_hooks.h" extern bool directory_sanity_check(struct dirent* dir, char* dirPath, char* outPath); static bool sTrue = true; @@ -34,6 +35,7 @@ static void select_language(struct DjuiBase* caller) { if (strcmp(configLanguage, checkbox->text->message)) { snprintf(configLanguage, MAX_CONFIG_STRING, "%s", checkbox->text->message); sLanguageChanged = true; + smlua_call_event_hooks_string_param(HOOK_ON_LANGUAGE_CHANGED, configLanguage); } checkbox->value = &sTrue; diff --git a/src/pc/djui/djui_panel_menu.c b/src/pc/djui/djui_panel_menu.c index 03c41791..d9aa601c 100644 --- a/src/pc/djui/djui_panel_menu.c +++ b/src/pc/djui/djui_panel_menu.c @@ -83,7 +83,7 @@ struct DjuiThreePanel* djui_panel_menu_create(char* headerText) { djui_base_set_location(&header->base, 0, DJUI_PANEL_HEADER_OFFSET); djui_text_set_alignment(header, DJUI_HALIGN_CENTER, DJUI_VALIGN_BOTTOM); djui_text_set_font(header, hudFontHeader ? gDjuiFonts[2] : gDjuiFonts[1]); - djui_text_set_font_scale(header, gDjuiFonts[1]->defaultFontScale * (hudFontHeader ? 0.7f : 1.0f)); + djui_text_set_font_scale(header, gDjuiFonts[1]->defaultFontScale * (hudFontHeader ? 0.7f : 1.0f) * (strlen(headerText) > 15 ? 0.9f : 1.0f)); struct DjuiFlowLayout* body = djui_flow_layout_create(&panel->base); djui_base_set_alignment(&body->base, DJUI_HALIGN_CENTER, DJUI_VALIGN_CENTER); diff --git a/src/pc/djui/djui_panel_mod_menu.c b/src/pc/djui/djui_panel_mod_menu.c new file mode 100644 index 00000000..e1b49a6c --- /dev/null +++ b/src/pc/djui/djui_panel_mod_menu.c @@ -0,0 +1,106 @@ +#include "djui.h" +#include "djui_panel.h" +#include "djui_panel_menu.h" +#include "pc/lua/smlua_hooks.h" + +static char* sDjuiPanelModMenuModName = NULL; + +static char* to_uppercase(char* str) { + char* buffer = strdup(str); + int i = 0; + while (buffer[i] != '\0') { + buffer[i] = toupper(buffer[i]); + i++; + } + return buffer; +} + +// generic +void djui_panel_mod_menu_mod_element(struct DjuiBase* caller) { + struct LuaHookedModMenuElement* hooked = &gHookedModMenuElements[caller->tag]; + smlua_call_mod_menu_element_hook(hooked, caller->tag); +} + +static void djui_panel_mod_menu_mod_inputbox(struct DjuiBase* caller) { + struct DjuiInputbox* inputbox = (struct DjuiInputbox*)caller; + struct LuaHookedModMenuElement* hooked = &gHookedModMenuElements[caller->tag]; + snprintf(hooked->stringValue, 256, "%s", inputbox->buffer); + smlua_call_mod_menu_element_hook(hooked, caller->tag); +} + +static void djui_panel_mod_menu_mod_create_element(struct DjuiBase* parent, int i) { + struct LuaHookedModMenuElement* hooked = &gHookedModMenuElements[i]; + switch (hooked->element) { + case MOD_MENU_ELEMENT_BUTTON: + struct DjuiButton* button = djui_button_create(parent, hooked->name, DJUI_BUTTON_STYLE_NORMAL, djui_panel_mod_menu_mod_element); + button->base.tag = i; + break; + case MOD_MENU_ELEMENT_CHECKBOX: + struct DjuiCheckbox* checkbox = djui_checkbox_create(parent, hooked->name, &hooked->boolValue, djui_panel_mod_menu_mod_element); + checkbox->base.tag = i; + break; + case MOD_MENU_ELEMENT_SLIDER: + struct DjuiSlider* slider = djui_slider_create(parent, hooked->name, &hooked->uintValue, hooked->sliderMin, hooked->sliderMax, djui_panel_mod_menu_mod_element); + slider->base.tag = i; + break; + case MOD_MENU_ELEMENT_INPUTBOX: + struct DjuiRect* rect = djui_rect_container_create(parent, 32); + { + struct DjuiText* text1 = djui_text_create(&rect->base, hooked->name); + djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); + djui_base_set_color(&text1->base, 220, 220, 220, 255); + djui_base_set_size(&text1->base, 0.585f, 64); + djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP); + djui_text_set_drop_shadow(text1, 64, 64, 64, 100); + + struct DjuiInputbox* inputbox = djui_inputbox_create(&rect->base, hooked->length); + djui_base_set_size_type(&inputbox->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); + djui_base_set_size(&inputbox->base, 0.45f, 32); + djui_base_set_alignment(&inputbox->base, DJUI_HALIGN_RIGHT, DJUI_VALIGN_TOP); + djui_inputbox_set_text(inputbox, hooked->stringValue); + djui_interactable_hook_value_change(&inputbox->base, djui_panel_mod_menu_mod_inputbox); + inputbox->base.tag = i; + } + break; + case MOD_MENU_ELEMENT_MAX: + } +} + +void djui_panel_mod_menu_mod_create(struct DjuiBase* caller) { + struct DjuiThreePanel* panel = djui_panel_menu_create(to_uppercase(sDjuiPanelModMenuModName)); + struct DjuiBase* body = djui_three_panel_get_body(panel); + { + struct DjuiPaginated* paginated = djui_paginated_create(body, 8); + struct DjuiBase* layoutBase = &paginated->layout->base; + for (int i = 0; i < gHookedModMenuElementsCount; i++) { + djui_panel_mod_menu_mod_create_element(layoutBase, i); + } + djui_paginated_calculate_height(paginated); + + djui_button_create(body, DLANG(MENU, BACK), DJUI_BUTTON_STYLE_BACK, djui_panel_menu_back); + } + + djui_panel_add(caller, panel, NULL); +} + +void djui_panel_mod_menu_create(struct DjuiBase* caller) { + struct DjuiThreePanel* panel = djui_panel_menu_create(DLANG(PAUSE, MOD_MENU_TITLE)); + struct DjuiBase* body = djui_three_panel_get_body(panel); + { + struct DjuiPaginated* paginated = djui_paginated_create(body, 8); + struct DjuiBase* layoutBase = &paginated->layout->base; + struct Mod* lastMod = NULL; + for (int i = 0; i < gHookedModMenuElementsCount; i++) { + struct LuaHookedModMenuElement* hooked = &gHookedModMenuElements[i]; + if (lastMod == hooked->mod) { continue; } + lastMod = hooked->mod; + sDjuiPanelModMenuModName = lastMod->name; + djui_button_create(layoutBase, hooked->mod->name, DJUI_BUTTON_STYLE_NORMAL, djui_panel_mod_menu_mod_create); + } + djui_paginated_calculate_height(paginated); + + djui_button_create(body, DLANG(MENU, BACK), DJUI_BUTTON_STYLE_BACK, djui_panel_menu_back); + } + + djui_panel_add(caller, panel, NULL); +} diff --git a/src/pc/djui/djui_panel_mod_menu.h b/src/pc/djui/djui_panel_mod_menu.h new file mode 100644 index 00000000..e0179596 --- /dev/null +++ b/src/pc/djui/djui_panel_mod_menu.h @@ -0,0 +1,6 @@ +#pragma once +#include "djui.h" + +void djui_panel_mod_menu_mod_element(struct DjuiBase* caller); +void djui_panel_mod_menu_mod_create(struct DjuiBase* caller); +void djui_panel_mod_menu_create(struct DjuiBase* caller); \ No newline at end of file diff --git a/src/pc/djui/djui_panel_pause.c b/src/pc/djui/djui_panel_pause.c index 4d342a9c..a04b1f6f 100644 --- a/src/pc/djui/djui_panel_pause.c +++ b/src/pc/djui/djui_panel_pause.c @@ -1,3 +1,4 @@ +#include "sm64.h" #include "djui.h" #include "djui_panel.h" #include "djui_panel_player.h" @@ -6,11 +7,12 @@ #include "djui_panel_host.h" #include "djui_panel_menu.h" #include "djui_panel_confirm.h" +#include "djui_panel_mod_menu.h" #include "pc/pc_main.h" #include "pc/network/network.h" +#include "pc/lua/smlua_hooks.h" #include "game/object_helpers.h" #include "behavior_table.h" -#include "sm64.h" bool gDjuiPanelPauseCreated = false; @@ -56,7 +58,6 @@ void djui_panel_pause_create(struct DjuiBase* caller) { struct DjuiThreePanel* panel = djui_panel_menu_create(DLANG(PAUSE, PAUSE_TITLE)); struct DjuiBase* body = djui_three_panel_get_body(panel); { - struct DjuiRect* rect1 = djui_rect_container_create(body, 64); { djui_button_left_create(&rect1->base, DLANG(PAUSE, PLAYER), DJUI_BUTTON_STYLE_NORMAL, djui_panel_player_create); @@ -70,6 +71,20 @@ void djui_panel_pause_create(struct DjuiBase* caller) { djui_button_create(body, DLANG(PAUSE, SERVER_SETTINGS), DJUI_BUTTON_STYLE_NORMAL, djui_panel_host_create); } + if (gHookedModMenuElementsCount == 1 && gHookedModMenuElements[0].element == MOD_MENU_ELEMENT_BUTTON) { + struct LuaHookedModMenuElement* hooked = &gHookedModMenuElements[0]; + char buffer[256] = { 0 }; + if (strlen(hooked->name) > 0) { + snprintf(buffer, 256, "%s - %s", hooked->mod->name, hooked->name); + } else { + snprintf(buffer, 256, "%s", hooked->mod->name); + } + struct DjuiButton* button = djui_button_create(body, buffer, DJUI_BUTTON_STYLE_NORMAL, djui_panel_mod_menu_mod_element); + button->base.tag = 0; + } else if (gHookedModMenuElementsCount > 0) { + djui_button_create(body, DLANG(PAUSE, MOD_MENU), DJUI_BUTTON_STYLE_NORMAL, djui_panel_mod_menu_create); + } + djui_button_create(body, DLANG(PAUSE, RESUME), DJUI_BUTTON_STYLE_NORMAL, djui_panel_pause_resume); if (gNetworkType == NT_SERVER) { diff --git a/src/pc/djui/djui_panel_player.c b/src/pc/djui/djui_panel_player.c index fff96004..0a7d40d1 100644 --- a/src/pc/djui/djui_panel_player.c +++ b/src/pc/djui/djui_panel_player.c @@ -26,8 +26,8 @@ static struct DjuiInputbox* sPalettePresetNameTextBox = NULL; void djui_panel_player_create(struct DjuiBase* caller); -//////////////////////// -// edit palette panel // + //////////////////////// + // edit palette panel // //////////////////////// static unsigned int djui_panel_player_edit_palette_get_palette_index(struct PlayerPalette palette) { @@ -290,8 +290,8 @@ static void djui_panel_player_edit_palette_create(struct DjuiBase* caller) { } -////////////////// -// player panel // + ////////////////// + // player panel // ////////////////// static bool djui_panel_player_name_valid(char* buffer) { @@ -319,7 +319,7 @@ static void djui_panel_player_name_on_focus_end(struct DjuiBase* caller) { if (!djui_panel_player_name_valid(inputbox1->buffer)) { djui_inputbox_set_text(inputbox1, DLANG(PLAYER, PLAYER)); } - snprintf(configPlayerName, MAX_PLAYER_STRING, "%s", inputbox1->buffer); + snprintf(configPlayerName, MAX_CONFIG_STRING, "%s", inputbox1->buffer); djui_inputbox_set_text_color(inputbox1, 0, 0, 0, 255); if (gNetworkType != NT_NONE) { @@ -384,7 +384,7 @@ void djui_panel_player_create(struct DjuiBase* caller) { djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP); djui_text_set_drop_shadow(text1, 64, 64, 64, 100); - struct DjuiInputbox* inputbox1 = djui_inputbox_create(&rect1->base, MAX_PLAYER_STRING); + struct DjuiInputbox* inputbox1 = djui_inputbox_create(&rect1->base, MAX_CONFIG_STRING); djui_base_set_size_type(&inputbox1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size(&inputbox1->base, 0.45f, 32); djui_base_set_alignment(&inputbox1->base, DJUI_HALIGN_RIGHT, DJUI_VALIGN_TOP); diff --git a/src/pc/djui/djui_text.c b/src/pc/djui/djui_text.c index 57661ac4..3ee795ee 100644 --- a/src/pc/djui/djui_text.c +++ b/src/pc/djui/djui_text.c @@ -232,7 +232,23 @@ static char* djui_text_render_line_parse_escape(char* c1, char* c2) { } if (parsingColor) { - if (colorPieces == 6) { + if (colorPieces == 3) { + u32 r = (color >> 8) & 0xF; + u32 g = (color >> 4) & 0xF; + u32 b = (color >> 0) & 0xF; + sSavedR = (r << 4) | r; + sSavedG = (g << 4) | g; + sSavedB = (b << 4) | b; + } else if (colorPieces == 4) { + u32 r = (color >> 12) & 0xF; + u32 g = (color >> 8) & 0xF; + u32 b = (color >> 4) & 0xF; + u32 a = (color >> 0) & 0xF; + sSavedR = (r << 4) | r; + sSavedG = (g << 4) | g; + sSavedB = (b << 4) | b; + sSavedA = (a << 4) | a; + } else if (colorPieces == 6) { sSavedR = ((color >> 16) & 0xFF); sSavedG = ((color >> 8) & 0xFF); sSavedB = ((color >> 0) & 0xFF); diff --git a/src/pc/lua/smlua_constants_autogen.c b/src/pc/lua/smlua_constants_autogen.c index 94434d7a..a9c4e5ea 100644 --- a/src/pc/lua/smlua_constants_autogen.c +++ b/src/pc/lua/smlua_constants_autogen.c @@ -3291,10 +3291,16 @@ char gSmluaConstants[] = "" "HOOK_ON_PLAY_SOUND = 41\n" "HOOK_ON_SEQ_LOAD = 42\n" "HOOK_ON_ATTACK_OBJECT = 43\n" -"HOOK_MAX = 44\n" +"HOOK_ON_LANGUAGE_CHANGED = 44\n" +"HOOK_MAX = 45\n" "ACTION_HOOK_EVERY_FRAME = 0\n" "ACTION_HOOK_GRAVITY = 1\n" "ACTION_HOOK_MAX = 2\n" +"MOD_MENU_ELEMENT_BUTTON = 0\n" +"MOD_MENU_ELEMENT_CHECKBOX = 1\n" +"MOD_MENU_ELEMENT_SLIDER = 2\n" +"MOD_MENU_ELEMENT_INPUTBOX = 3\n" +"MOD_MENU_ELEMENT_MAX = 4\n" "HUD_DISPLAY_LIVES = 0\n" "HUD_DISPLAY_COINS = 1\n" "HUD_DISPLAY_STARS = 2\n" diff --git a/src/pc/lua/smlua_hooks.c b/src/pc/lua/smlua_hooks.c index 74e3dc35..219392e5 100644 --- a/src/pc/lua/smlua_hooks.c +++ b/src/pc/lua/smlua_hooks.c @@ -15,6 +15,7 @@ #include "pc/network/socket/socket.h" #include "pc/chat_commands.h" #include "pc/pc_main.h" +#include "pc/djui/djui_panel.h" #include "../mods/mods.h" #include "game/print.h" @@ -1116,6 +1117,25 @@ const char *smlua_call_event_hooks_int_ret_bool_and_string(enum LuaHookedEventTy return NULL; } +void smlua_call_event_hooks_string_param(enum LuaHookedEventType hookType, const char* string) { + lua_State* L = gLuaState; + if (L == NULL) { return; } + struct LuaHookedEvent* hook = &sHookedEvents[hookType]; + for (int i = 0; i < hook->count; i++) { + // push the callback onto the stack + lua_rawgeti(L, LUA_REGISTRYINDEX, hook->reference[i]); + + // push string + lua_pushstring(L, string); + + // call the callback + if (0 != smlua_call_hook(L, 1, 0, 0, hook->mod[i])) { + LOG_LUA("Failed to call the callback: %u", hookType); + continue; + } + } +} + //////////////////// // hooked actions // //////////////////// @@ -1213,7 +1233,6 @@ int smlua_hook_mario_action(lua_State* L) { hooked->action = action; hooked->interactionType = interactionType; hooked->mod = gLuaActiveMod; - if (!gSmLuaConvertSuccess) { return 0; } sHookedMarioActionsCount++; return 1; @@ -1633,7 +1652,6 @@ int smlua_hook_chat_command(lua_State* L) { hooked->description = strdup(description); hooked->reference = ref; hooked->mod = gLuaActiveMod; - if (!gSmLuaConvertSuccess) { return 0; } sHookedChatCommandsCount++; return 1; @@ -1966,6 +1984,292 @@ int smlua_hook_on_sync_table_change(lua_State* L) { return 1; } + + //////////////////////////// + // hooked mod menu button // +//////////////////////////// + +#define MAX_HOOKED_MOD_MENU_ELEMENTS 256 + +struct LuaHookedModMenuElement gHookedModMenuElements[MAX_HOOKED_MOD_MENU_ELEMENTS] = { 0 }; +int gHookedModMenuElementsCount = 0; + +int smlua_hook_mod_menu_button(lua_State* L) { + if (L == NULL) { return 0; } + if (!smlua_functions_valid_param_count(L, 2)) { return 0; } + + if (gLuaLoadingMod == NULL) { + LOG_LUA_LINE("hook_mod_menu_button() can only be called on load."); + return 0; + } + + if (gHookedModMenuElementsCount >= MAX_HOOKED_MOD_MENU_ELEMENTS) { + LOG_LUA_LINE("Hooked mod menu element exceeded maximum references!"); + return 0; + } + + const char* name = smlua_to_string(L, 1); + if (name == NULL || !gSmLuaConvertSuccess) { + LOG_LUA_LINE("Hook mod menu element: tried to hook invalid element"); + return 0; + } + + int ref = luaL_ref(L, LUA_REGISTRYINDEX); + if (ref == -1) { + LOG_LUA_LINE("Hook mod menu element: tried to hook undefined function '%s'", gLuaActiveMod->name); + return 0; + } + + struct LuaHookedModMenuElement* hooked = &gHookedModMenuElements[gHookedModMenuElementsCount]; + hooked->element = MOD_MENU_ELEMENT_BUTTON; + snprintf(hooked->name, 64, "%s", name); + hooked->boolValue = false; + hooked->uintValue = 0; + hooked->stringValue[0] = '\0'; + hooked->length = 0; + hooked->sliderMin = 0; + hooked->sliderMax = 0; + hooked->reference = ref; + hooked->mod = gLuaActiveMod; + + gHookedModMenuElementsCount++; + return 1; +} + +int smlua_hook_mod_menu_checkbox(lua_State* L) { + if (L == NULL) { return 0; } + if (!smlua_functions_valid_param_count(L, 3)) { return 0; } + + if (gLuaLoadingMod == NULL) { + LOG_LUA_LINE("hook_mod_menu_checkbox() can only be called on load."); + return 0; + } + + if (gHookedModMenuElementsCount >= MAX_HOOKED_MOD_MENU_ELEMENTS) { + LOG_LUA_LINE("Hooked mod menu element exceeded maximum references!"); + return 0; + } + + const char* name = smlua_to_string(L, 1); + if (name == NULL || strlen(name) == 0 || !gSmLuaConvertSuccess) { + LOG_LUA_LINE("Hook mod menu element: tried to hook invalid element"); + return 0; + } + + bool defaultValue = smlua_to_boolean(L, 2); + if (!gSmLuaConvertSuccess) { + LOG_LUA_LINE("Hook mod menu element: tried to hook invalid element"); + return 0; + } + + int ref = luaL_ref(L, LUA_REGISTRYINDEX); + if (ref == -1) { + LOG_LUA_LINE("Hook mod menu element: tried to hook undefined function '%s'", gLuaActiveMod->name); + return 0; + } + + struct LuaHookedModMenuElement* hooked = &gHookedModMenuElements[gHookedModMenuElementsCount]; + hooked->element = MOD_MENU_ELEMENT_CHECKBOX; + snprintf(hooked->name, 64, "%s", name); + hooked->boolValue = defaultValue; + hooked->uintValue = 0; + hooked->stringValue[0] = '\0'; + hooked->length = 0; + hooked->sliderMin = 0; + hooked->sliderMax = 0; + hooked->reference = ref; + hooked->mod = gLuaActiveMod; + + gHookedModMenuElementsCount++; + return 1; +} + +int smlua_hook_mod_menu_slider(lua_State* L) { + if (L == NULL) { return 0; } + if (!smlua_functions_valid_param_count(L, 5)) { return 0; } + + if (gLuaLoadingMod == NULL) { + LOG_LUA_LINE("hook_mod_menu_slider() can only be called on load."); + return 0; + } + + if (gHookedModMenuElementsCount >= MAX_HOOKED_MOD_MENU_ELEMENTS) { + LOG_LUA_LINE("Hooked mod menu element exceeded maximum references!"); + return 0; + } + + const char* name = smlua_to_string(L, 1); + if (name == NULL || strlen(name) == 0 || !gSmLuaConvertSuccess) { + LOG_LUA_LINE("Hook mod menu element: tried to hook invalid element"); + return 0; + } + + u32 defaultValue = smlua_to_integer(L, 2); + if (!gSmLuaConvertSuccess) { + LOG_LUA_LINE("Hook mod menu element: tried to hook invalid element"); + return 0; + } + + u32 sliderMin = smlua_to_integer(L, 3); + if (!gSmLuaConvertSuccess) { + LOG_LUA_LINE("Hook mod menu element: tried to hook invalid element"); + return 0; + } + + u32 sliderMax = smlua_to_integer(L, 4); + if (!gSmLuaConvertSuccess) { + LOG_LUA_LINE("Hook mod menu element: tried to hook invalid element"); + return 0; + } + + int ref = luaL_ref(L, LUA_REGISTRYINDEX); + if (ref == -1) { + LOG_LUA_LINE("Hook mod menu element: tried to hook undefined function '%s'", gLuaActiveMod->name); + return 0; + } + + struct LuaHookedModMenuElement* hooked = &gHookedModMenuElements[gHookedModMenuElementsCount]; + hooked->element = MOD_MENU_ELEMENT_SLIDER; + snprintf(hooked->name, 64, "%s", name); + hooked->boolValue = false; + hooked->uintValue = defaultValue; + hooked->stringValue[0] = '\0'; + hooked->length = 0; + hooked->sliderMin = sliderMin; + hooked->sliderMax = sliderMax; + hooked->reference = ref; + hooked->mod = gLuaActiveMod; + + gHookedModMenuElementsCount++; + return 1; +} + +int smlua_hook_mod_menu_inputbox(lua_State* L) { + if (L == NULL) { return 0; } + if (!smlua_functions_valid_param_count(L, 4)) { return 0; } + + if (gLuaLoadingMod == NULL) { + LOG_LUA_LINE("hook_mod_menu_inputbox() can only be called on load."); + return 0; + } + + if (gHookedModMenuElementsCount >= MAX_HOOKED_MOD_MENU_ELEMENTS) { + LOG_LUA_LINE("Hooked mod menu element exceeded maximum references!"); + return 0; + } + + const char* name = smlua_to_string(L, 1); + if (name == NULL || strlen(name) == 0 || !gSmLuaConvertSuccess) { + LOG_LUA_LINE("Hook mod menu element: tried to hook invalid element"); + return 0; + } + + const char* defaultValue = smlua_to_string(L, 2); + if (defaultValue == NULL || !gSmLuaConvertSuccess) { + LOG_LUA_LINE("Hook mod menu element: tried to hook invalid element"); + return 0; + } + + u32 length = smlua_to_integer(L, 3); + length = MIN(length, 256); + if (!gSmLuaConvertSuccess) { + LOG_LUA_LINE("Hook mod menu element: tried to hook invalid element"); + return 0; + } + + int ref = luaL_ref(L, LUA_REGISTRYINDEX); + if (ref == -1) { + LOG_LUA_LINE("Hook mod menu element: tried to hook undefined function '%s'", gLuaActiveMod->name); + return 0; + } + + struct LuaHookedModMenuElement* hooked = &gHookedModMenuElements[gHookedModMenuElementsCount]; + hooked->element = MOD_MENU_ELEMENT_INPUTBOX; + snprintf(hooked->name, 64, "%s", name); + hooked->boolValue = false; + hooked->uintValue = 0; + snprintf(hooked->stringValue, 256, "%s", defaultValue); + hooked->length = length; + hooked->sliderMin = 0; + hooked->sliderMax = 0; + hooked->reference = ref; + hooked->mod = gLuaActiveMod; + + gHookedModMenuElementsCount++; + return 1; +} + +int smlua_update_mod_menu_element_name(lua_State* L) { + if (L == NULL) { return 0; } + if (!smlua_functions_valid_param_count(L, 2)) { return 0; } + + int index = smlua_to_integer(L, 1); + if (index >= gHookedModMenuElementsCount || !gSmLuaConvertSuccess) { + LOG_LUA_LINE("Update mod menu element: tried to update invalid element"); + return 0; + } + + const char* name = smlua_to_string(L, 2); + if (name == NULL || !gSmLuaConvertSuccess) { + LOG_LUA_LINE("Update mod menu element: tried to update invalid name"); + return 0; + } + + if (gHookedModMenuElements[index].element != MOD_MENU_ELEMENT_BUTTON && strlen(name) == 0) { + LOG_LUA_LINE("Update mod menu element: tried to update invalid name"); + return 0; + } + + snprintf(gHookedModMenuElements[index].name, 64, "%s", name); + return 1; +} + +void smlua_call_mod_menu_element_hook(struct LuaHookedModMenuElement* hooked, int index) { + lua_State* L = gLuaState; + if (L == NULL) { return; } + + // push the callback onto the stack + lua_rawgeti(L, LUA_REGISTRYINDEX, hooked->reference); + + // push parameter + u8 params = 2; + lua_pushinteger(L, index); + switch (hooked->element) { + case MOD_MENU_ELEMENT_BUTTON: + params = 1; + break; + case MOD_MENU_ELEMENT_CHECKBOX: + lua_pushboolean(L, hooked->boolValue); + break; + case MOD_MENU_ELEMENT_SLIDER: + lua_pushinteger(L, hooked->uintValue); + break; + case MOD_MENU_ELEMENT_INPUTBOX: + lua_pushstring(L, hooked->stringValue); + break; + case MOD_MENU_ELEMENT_MAX: + } + + // call the callback + if (0 != smlua_call_hook(L, params, 1, 0, hooked->mod)) { + LOG_LUA("Failed to call the mod menu element callback: %s", hooked->name); + return; + } + + // output the return value + bool returnValue = false; + if (lua_type(L, -1) == LUA_TBOOLEAN) { + returnValue = smlua_to_boolean(L, -1); + } + lua_pop(L, 1); + + if (!gSmLuaConvertSuccess || !returnValue || hooked->element != MOD_MENU_ELEMENT_BUTTON) { return; } + + gForceUnpause = true; + djui_panel_shutdown(); +} + + ////////// // misc // ////////// @@ -2001,6 +2305,21 @@ void smlua_clear_hooks(void) { } sHookedChatCommandsCount = 0; + for (int i = 0; i < gHookedModMenuElementsCount; i++) { + struct LuaHookedModMenuElement* hooked = &gHookedModMenuElements[i]; + hooked->element = MOD_MENU_ELEMENT_BUTTON; + hooked->name[0] = '\0'; + hooked->boolValue = false; + hooked->uintValue = 0; + hooked->stringValue[0] = '\0'; + hooked->length = 0; + hooked->sliderMin = 0; + hooked->sliderMax = 0; + hooked->reference = 0; + hooked->mod = NULL; + } + gHookedModMenuElementsCount = 0; + for (int i = 0; i < sHookedBehaviorsCount; i++) { struct LuaHookedBehavior* hooked = &sHookedBehaviors[i]; @@ -2040,5 +2359,10 @@ void smlua_bind_hooks(void) { smlua_bind_function(L, "hook_chat_command", smlua_hook_chat_command); smlua_bind_function(L, "hook_on_sync_table_change", smlua_hook_on_sync_table_change); smlua_bind_function(L, "hook_behavior", smlua_hook_behavior); + smlua_bind_function(L, "hook_mod_menu_button", smlua_hook_mod_menu_button); + smlua_bind_function(L, "hook_mod_menu_checkbox", smlua_hook_mod_menu_checkbox); + smlua_bind_function(L, "hook_mod_menu_slider", smlua_hook_mod_menu_slider); + smlua_bind_function(L, "hook_mod_menu_inputbox", smlua_hook_mod_menu_inputbox); smlua_bind_function(L, "update_chat_command_description", smlua_update_chat_command_description); + smlua_bind_function(L, "update_mod_menu_element_name", smlua_update_mod_menu_element_name); } diff --git a/src/pc/lua/smlua_hooks.h b/src/pc/lua/smlua_hooks.h index 3d55399e..25aa4edb 100644 --- a/src/pc/lua/smlua_hooks.h +++ b/src/pc/lua/smlua_hooks.h @@ -55,6 +55,7 @@ enum LuaHookedEventType { HOOK_ON_PLAY_SOUND, HOOK_ON_SEQ_LOAD, HOOK_ON_ATTACK_OBJECT, + HOOK_ON_LANGUAGE_CHANGED, HOOK_MAX, }; @@ -103,6 +104,7 @@ static const char* LuaHookedEventTypeName[] = { "HOOK_ON_PLAY_SOUND", "HOOK_ON_SEQ_LOAD", "HOOK_ON_ATTACK_OBJECT", + "HOOK_ON_LANGUAGE_CHANGED", "HOOK_MAX" }; @@ -118,7 +120,31 @@ static const char* LuaActionHookTypeArgName[] = { "max (dummy)", }; +enum LuaModMenuElementType { + MOD_MENU_ELEMENT_BUTTON, + MOD_MENU_ELEMENT_CHECKBOX, + MOD_MENU_ELEMENT_SLIDER, + MOD_MENU_ELEMENT_INPUTBOX, + MOD_MENU_ELEMENT_MAX +}; + +struct LuaHookedModMenuElement { + enum LuaModMenuElementType element; + char name[64]; + // use a union here? + bool boolValue; + u32 uintValue; + char stringValue[256]; + u32 length; + u32 sliderMin; + u32 sliderMax; + int reference; + struct Mod* mod; +}; + extern u32 gLuaMarioActionIndex[]; +extern struct LuaHookedModMenuElement gHookedModMenuElements[]; +extern int gHookedModMenuElementsCount; int smlua_hook_custom_bhv(BehaviorScript *bhvScript, const char *bhvName); @@ -154,6 +180,7 @@ bool smlua_call_event_hooks_mario_param_and_int_and_int_ret_int(enum LuaHookedEv void smlua_call_event_hooks_graph_node_object_and_int_param(enum LuaHookedEventType hookType, struct GraphNodeObject* node, s32 param); void smlua_call_event_hooks_on_seq_load(enum LuaHookedEventType hookType, u32 player, u32 seqId, s32 loadAsync, u8* returnValue); const char *smlua_call_event_hooks_int_ret_bool_and_string(enum LuaHookedEventType hookType, s32 param, bool* returnValue); +void smlua_call_event_hooks_string_param(enum LuaHookedEventType hookType, const char* string); enum BehaviorId smlua_get_original_behavior_id(const BehaviorScript* behavior); const BehaviorScript* smlua_override_behavior(const BehaviorScript* behavior); @@ -174,6 +201,8 @@ char** smlua_get_chat_subcommands_list(const char* maincommand); bool smlua_maincommand_exists(const char* maincommand); bool smlua_subcommand_exists(const char* maincommand, const char* subcommand); +void smlua_call_mod_menu_element_hook(struct LuaHookedModMenuElement* hooked, int index); + void smlua_clear_hooks(void); void smlua_bind_hooks(void); diff --git a/src/pc/nametags.c b/src/pc/nametags.c index ac12be8d..5d683782 100644 --- a/src/pc/nametags.c +++ b/src/pc/nametags.c @@ -91,8 +91,8 @@ void nametags_render(void) { scale = clampf(1 - scale, 0, NAMETAG_MAX_SCALE); } - char name[MAX_PLAYER_STRING + 1]; - strncpy(name, np->name, MAX_PLAYER_STRING + 1); + char name[MAX_CONFIG_STRING]; + snprintf(name, MAX_CONFIG_STRING, "%s", np->name); name_without_hex(name); Color color = { np->palette.parts[CAP][0], diff --git a/src/pc/network/network_player.c b/src/pc/network/network_player.c index d05edb45..8cfb344e 100644 --- a/src/pc/network/network_player.c +++ b/src/pc/network/network_player.c @@ -259,7 +259,7 @@ u8 network_player_connected(enum NetworkPlayerType type, u8 globalIndex, u8 mode np->palette = *palette; network_player_update_model(localIndex); - snprintf(np->name, MAX_PLAYER_STRING, "%s", name); + snprintf(np->name, MAX_CONFIG_STRING, "%s", name); return localIndex; } @@ -289,7 +289,7 @@ u8 network_player_connected(enum NetworkPlayerType type, u8 globalIndex, u8 mode np->overrideModelIndex = modelIndex; np->overridePalette = *palette; - snprintf(np->name, MAX_PLAYER_STRING, "%s", name); + snprintf(np->name, MAX_CONFIG_STRING, "%s", name); network_player_update_model(localIndex); // clear networking fields diff --git a/src/pc/network/network_player.h b/src/pc/network/network_player.h index 953d3a48..7fbf4ae6 100644 --- a/src/pc/network/network_player.h +++ b/src/pc/network/network_player.h @@ -44,9 +44,9 @@ struct NetworkPlayer { u8 gag; u32 ping; struct PlayerPalette palette; - char name[MAX_PLAYER_STRING+1]; + char name[MAX_CONFIG_STRING]; - char description[MAX_DESCRIPTION_STRING+1]; + char description[MAX_DESCRIPTION_STRING]; u8 descriptionR; u8 descriptionG; u8 descriptionB; @@ -58,7 +58,7 @@ struct NetworkPlayer { u16 rxSeqIds[MAX_RX_SEQ_IDS]; u32 rxPacketHash[MAX_RX_SEQ_IDS]; - // legacy fields to allow mods not to break (they don't do anything anymore) + // legacy fields to allow mods not to fully break (they don't do anything anymore) u8 paletteIndex; u8 overridePaletteIndex; u8 overridePaletteIndexLp; diff --git a/src/pc/network/network_utils.c b/src/pc/network/network_utils.c index d2516921..1ef1fd40 100644 --- a/src/pc/network/network_utils.c +++ b/src/pc/network/network_utils.c @@ -1,5 +1,6 @@ #include #include "network_utils.h" +#include "game/level_update.h" #include "game/mario_misc.h" #include "pc/mods/mods.h" @@ -53,5 +54,5 @@ const char* network_get_player_text_color_string(u8 localIndex) { extern s16 gMenuMode; bool network_check_singleplayer_pause(void) { - return gMenuMode != -1 && network_player_connected_count() == 1 && mods_get_all_pausable(); + return gMenuMode != -1 && network_player_connected_count() == 1 && mods_get_all_pausable() && !gInPlayerMenu; } diff --git a/src/pc/network/packets/packet_join.c b/src/pc/network/packets/packet_join.c index 5f4eef0a..fefcf15f 100644 --- a/src/pc/network/packets/packet_join.c +++ b/src/pc/network/packets/packet_join.c @@ -31,7 +31,7 @@ static u8 eeprom[512] = { 0 }; static u8 sJoinRequestPlayerModel; static struct PlayerPalette sJoinRequestPlayerPalette; -static char sJoinRequestPlayerName[MAX_PLAYER_STRING]; +static char sJoinRequestPlayerName[MAX_CONFIG_STRING]; bool gCurrentlyJoining = false; void network_send_join_request(void) { @@ -48,7 +48,7 @@ void network_send_join_request(void) { packet_write(&p, &configPlayerModel, sizeof(u8)); packet_write(&p, &configPlayerPalette, sizeof(struct PlayerPalette)); - packet_write(&p, &configPlayerName, sizeof(u8) * MAX_PLAYER_STRING); + packet_write(&p, &configPlayerName, sizeof(u8) * MAX_CONFIG_STRING); network_send_to((gNetworkPlayerServer != NULL) ? gNetworkPlayerServer->localIndex : 0, &p); LOG_INFO("sending join request"); @@ -63,11 +63,11 @@ void network_receive_join_request(struct Packet* p) { packet_read(p, &version, sizeof(u8) * MAX_VERSION_LENGTH); packet_read(p, &sJoinRequestPlayerModel, sizeof(u8)); packet_read(p, &sJoinRequestPlayerPalette, sizeof(struct PlayerPalette)); - packet_read(p, &sJoinRequestPlayerName, sizeof(u8) * MAX_PLAYER_STRING); + packet_read(p, &sJoinRequestPlayerName, sizeof(u8) * MAX_CONFIG_STRING); } else { sJoinRequestPlayerModel = 0; sJoinRequestPlayerPalette = DEFAULT_MARIO_PALETTE; - snprintf(sJoinRequestPlayerName, MAX_PLAYER_STRING, "%s", "Player"); + snprintf(sJoinRequestPlayerName, MAX_CONFIG_STRING, "%s", "Player"); } network_send_join(p); diff --git a/src/pc/network/packets/packet_network_players.c b/src/pc/network/packets/packet_network_players.c index 68cc2cb8..c889f358 100644 --- a/src/pc/network/packets/packet_network_players.c +++ b/src/pc/network/packets/packet_network_players.c @@ -34,7 +34,7 @@ static void network_send_to_network_players(u8 sendToLocalIndex) { packet_write(&p, &networkId, sizeof(s64)); packet_write(&p, &gNetworkPlayers[i].modelIndex, sizeof(u8)); packet_write(&p, &gNetworkPlayers[i].palette, sizeof(struct PlayerPalette)); - packet_write(&p, &gNetworkPlayers[i].name, sizeof(u8) * MAX_PLAYER_STRING); + packet_write(&p, &gNetworkPlayers[i].name, sizeof(u8) * MAX_CONFIG_STRING); LOG_INFO("send network player [%d == %d]", gNetworkPlayers[i].globalIndex, npType); } @@ -91,7 +91,7 @@ void network_receive_network_players(struct Packet *p) { s64 networkId; u8 modelIndex; struct PlayerPalette palette; - char playerName[MAX_PLAYER_STRING] = { 0 }; + char playerName[MAX_CONFIG_STRING] = { 0 }; packet_read(p, &npType, sizeof(u8)); packet_read(p, &globalIndex, sizeof(u8)); @@ -105,7 +105,7 @@ void network_receive_network_players(struct Packet *p) { packet_read(p, &networkId, sizeof(s64)); packet_read(p, &modelIndex, sizeof(u8)); packet_read(p, &palette, sizeof(struct PlayerPalette)); - packet_read(p, &playerName, sizeof(u8) * MAX_PLAYER_STRING); + packet_read(p, &playerName, sizeof(u8) * MAX_CONFIG_STRING); u8 localIndex = network_player_connected(npType, globalIndex, modelIndex, &palette, playerName); LOG_INFO("received network player [%d == %d] (%d)", globalIndex, npType, localIndex); diff --git a/src/pc/network/packets/packet_player_settings.c b/src/pc/network/packets/packet_player_settings.c index cedd314e..2230e544 100644 --- a/src/pc/network/packets/packet_player_settings.c +++ b/src/pc/network/packets/packet_player_settings.c @@ -3,20 +3,20 @@ #include "pc/debuglog.h" void network_send_player_settings(void) { - char playerName[MAX_PLAYER_STRING+1] = { 0 }; - if (snprintf(playerName, MAX_PLAYER_STRING, "%s", configPlayerName) < 0) { + char playerName[MAX_CONFIG_STRING] = { 0 }; + if (snprintf(playerName, MAX_CONFIG_STRING, "%s", configPlayerName) < 0) { LOG_INFO("truncating player name"); } struct Packet p = { 0 }; packet_init(&p, PACKET_PLAYER_SETTINGS, true, PLMT_NONE); packet_write(&p, &gNetworkPlayers[0].globalIndex, sizeof(u8)); - packet_write(&p, playerName, MAX_PLAYER_STRING * sizeof(u8)); + packet_write(&p, playerName, MAX_CONFIG_STRING * sizeof(u8)); packet_write(&p, &configPlayerModel, sizeof(u8)); packet_write(&p, &configPlayerPalette, sizeof(struct PlayerPalette)); if (gNetworkPlayerLocal != NULL) { - if (snprintf(gNetworkPlayerLocal->name, MAX_PLAYER_STRING, "%s", playerName) < 0) { + if (snprintf(gNetworkPlayerLocal->name, MAX_CONFIG_STRING, "%s", playerName) < 0) { LOG_INFO("truncating player name"); } } @@ -26,12 +26,12 @@ void network_send_player_settings(void) { void network_receive_player_settings(struct Packet* p) { u8 globalId; - char playerName[MAX_PLAYER_STRING+1] = { 0 }; + char playerName[MAX_CONFIG_STRING] = { 0 }; u8 playerModel; struct PlayerPalette playerPalette; packet_read(p, &globalId, sizeof(u8)); - packet_read(p, &playerName, MAX_PLAYER_STRING * sizeof(u8)); + packet_read(p, &playerName, MAX_CONFIG_STRING * sizeof(u8)); packet_read(p, &playerModel, sizeof(u8)); packet_read(p, &playerPalette, sizeof(struct PlayerPalette)); @@ -51,7 +51,7 @@ void network_receive_player_settings(struct Packet* p) { struct NetworkPlayer* np = network_player_from_global_index(globalId); if (!np) { LOG_ERROR("Failed to retrieve network player."); return; } - if (snprintf(np->name, MAX_PLAYER_STRING, "%s", playerName) < 0) { + if (snprintf(np->name, MAX_CONFIG_STRING, "%s", playerName) < 0) { LOG_INFO("truncating player name"); } diff --git a/src/pc/platform.c b/src/pc/platform.c index 0c8007ce..2725159d 100644 --- a/src/pc/platform.c +++ b/src/pc/platform.c @@ -88,7 +88,7 @@ static const char *sys_old_user_path(void) { char *sdlPath = SDL_GetPrefPath("", "sm64ex-coop"); if (sdlPath) { const unsigned int len = strlen(sdlPath); - strncpy(path, sdlPath, sizeof(path)); + snprintf(path, sizeof(path), "%s", sdlPath); path[sizeof(path)-1] = 0; SDL_free(sdlPath); @@ -113,7 +113,7 @@ const char *sys_user_path(void) { } const unsigned int len = strlen(sdlPath); - strncpy(path, sdlPath, sizeof(path)); + snprintf(path, sizeof(path), "%s", sdlPath); path[sizeof(path)-1] = 0; SDL_free(sdlPath); @@ -131,7 +131,7 @@ const char *sys_exe_path(void) { if (sdlPath && sdlPath[0]) { // use the SDL path if it exists const unsigned int len = strlen(sdlPath); - strncpy(path, sdlPath, sizeof(path)); + snprintf(path, sizeof(path), "%s", sdlPath); path[sizeof(path)-1] = 0; SDL_free(sdlPath); if (path[len-1] == '/' || path[len-1] == '\\') diff --git a/src/pc/update_checker.c b/src/pc/update_checker.c index a36f7791..7e25c29f 100644 --- a/src/pc/update_checker.c +++ b/src/pc/update_checker.c @@ -75,7 +75,7 @@ void get_version_remote(void) { } buffer[bytesRead] = '\0'; - strncpy(sRemoteVersion, buffer, 8); + snprintf(sRemoteVersion, 8, "%s", buffer); // close handles InternetCloseHandle(hUrl); @@ -107,7 +107,7 @@ void get_version_remote(void) { if (!buffer) { return; } - strncpy(sRemoteVersion, buffer, 8); + snprintf(sRemoteVersion, 8, "%s", buffer); // Clean up curl_easy_cleanup(curl);