diff --git a/autogen/convert_functions.py b/autogen/convert_functions.py index 9ce4ed54..9ac1a683 100644 --- a/autogen/convert_functions.py +++ b/autogen/convert_functions.py @@ -70,7 +70,7 @@ override_allowed_functions = { "src/audio/external.h": [ " play_", "fade", "current_background", "stop_", "sound_banks", "drop_queued_background_music", "sound_get_level_intensity" ], "src/game/rumble_init.c": [ "queue_rumble_", "reset_rumble_timers" ], "src/pc/djui/djui_popup.h" : [ "create" ], - "src/game/save_file.h": [ "save_file_get_", "save_file_set_flags", "save_file_clear_flags", "save_file_reload", "save_file_erase_current_backup_save", "save_file_set_star_flags", "save_file_is_cannon_unlocked", "touch_coin_score_age", "save_file_set_course_coin_score", "save_file_do_save", "save_file_remove_star_flags" ], + "src/game/save_file.h": [ "save_file_get_", "save_file_set_flags", "save_file_clear_flags", "save_file_reload", "save_file_erase_current_backup_save", "save_file_set_star_flags", "save_file_is_cannon_unlocked", "touch_coin_score_age", "save_file_set_course_coin_score", "save_file_do_save", "save_file_remove_star_flags", "save_file_erase" ], "src/pc/lua/utils/smlua_model_utils.h": [ "smlua_model_util_get_id" ], "src/game/object_list_processor.h": [ "set_object_respawn_info_bits" ], "src/game/mario_misc.h": [ "bhv_toad.*", "bhv_unlock_door.*" ], diff --git a/autogen/lua_definitions/functions.lua b/autogen/lua_definitions/functions.lua index f02c12a9..3986a6ab 100644 --- a/autogen/lua_definitions/functions.lua +++ b/autogen/lua_definitions/functions.lua @@ -7357,6 +7357,11 @@ function save_file_do_save(fileIndex, forceSave) -- ... end +--- @param fileIndex integer +function save_file_erase(fileIndex) + -- ... +end + function save_file_erase_current_backup_save() -- ... end diff --git a/docs/lua/functions-4.md b/docs/lua/functions-4.md index ca9212b3..09b2d332 100644 --- a/docs/lua/functions-4.md +++ b/docs/lua/functions-4.md @@ -8068,6 +8068,26 @@
+## [save_file_erase](#save_file_erase) + +### Lua Example +`save_file_erase(fileIndex)` + +### Parameters +| Field | Type | +| ----- | ---- | +| fileIndex | `integer` | + +### Returns +- None + +### C Prototype +`void save_file_erase(s32 fileIndex);` + +[:arrow_up_small:](#) + +
+ ## [save_file_erase_current_backup_save](#save_file_erase_current_backup_save) ### Lua Example diff --git a/docs/lua/functions.md b/docs/lua/functions.md index 3b597eac..a37907fa 100644 --- a/docs/lua/functions.md +++ b/docs/lua/functions.md @@ -1541,6 +1541,7 @@ - save_file.h - [save_file_clear_flags](functions-4.md#save_file_clear_flags) - [save_file_do_save](functions-4.md#save_file_do_save) + - [save_file_erase](functions-4.md#save_file_erase) - [save_file_erase_current_backup_save](functions-4.md#save_file_erase_current_backup_save) - [save_file_get_cap_pos](functions-4.md#save_file_get_cap_pos) - [save_file_get_course_coin_score](functions-4.md#save_file_get_course_coin_score) diff --git a/src/pc/lua/smlua_functions_autogen.c b/src/pc/lua/smlua_functions_autogen.c index 4ebbe312..2d63e897 100644 --- a/src/pc/lua/smlua_functions_autogen.c +++ b/src/pc/lua/smlua_functions_autogen.c @@ -27592,6 +27592,23 @@ int smlua_func_save_file_do_save(lua_State* L) { return 1; } +int smlua_func_save_file_erase(lua_State* L) { + if (L == NULL) { return 0; } + + int top = lua_gettop(L); + if (top != 1) { + LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_erase", 1, top); + return 0; + } + + s32 fileIndex = smlua_to_integer(L, 1); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_erase"); return 0; } + + save_file_erase(fileIndex); + + return 1; +} + int smlua_func_save_file_erase_current_backup_save(UNUSED lua_State* L) { if (L == NULL) { return 0; } @@ -34078,6 +34095,7 @@ void smlua_bind_functions_autogen(void) { // save_file.h smlua_bind_function(L, "save_file_clear_flags", smlua_func_save_file_clear_flags); smlua_bind_function(L, "save_file_do_save", smlua_func_save_file_do_save); + smlua_bind_function(L, "save_file_erase", smlua_func_save_file_erase); smlua_bind_function(L, "save_file_erase_current_backup_save", smlua_func_save_file_erase_current_backup_save); smlua_bind_function(L, "save_file_get_cap_pos", smlua_func_save_file_get_cap_pos); smlua_bind_function(L, "save_file_get_course_coin_score", smlua_func_save_file_get_course_coin_score);