mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 13:35:12 +00:00
Add get_coop_compatibility_enabled and undefine SM64COOPDX_VERSION if it's on
This commit is contained in:
parent
e26f25e163
commit
0345a873b7
8 changed files with 50 additions and 2 deletions
|
@ -259,7 +259,7 @@ def build_to_c(built_files):
|
|||
txt = 'char gSmluaConstants[] = ""\n'
|
||||
for line in lines:
|
||||
txt += '"%s\\n"\n' % line
|
||||
txt += ';'
|
||||
txt += '"if get_coop_compatibility_enabled() then SM64COOPDX_VERSION = nil end";'
|
||||
return txt
|
||||
|
||||
############################################################################
|
||||
|
|
|
@ -8686,6 +8686,11 @@ function djui_set_popup_disabled_override(value)
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- @return boolean
|
||||
function get_coop_compatibility_enabled()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @return integer
|
||||
function get_current_save_file_num()
|
||||
-- ...
|
||||
|
|
|
@ -703,6 +703,24 @@
|
|||
|
||||
<br />
|
||||
|
||||
## [get_coop_compatibility_enabled](#get_coop_compatibility_enabled)
|
||||
|
||||
### Lua Example
|
||||
`local booleanValue = get_coop_compatibility_enabled()`
|
||||
|
||||
### Parameters
|
||||
- None
|
||||
|
||||
### Returns
|
||||
- `boolean`
|
||||
|
||||
### C Prototype
|
||||
`bool get_coop_compatibility_enabled(void);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [get_current_save_file_num](#get_current_save_file_num)
|
||||
|
||||
### Lua Example
|
||||
|
|
|
@ -1631,6 +1631,7 @@
|
|||
- [djui_popup_create_global](functions-5.md#djui_popup_create_global)
|
||||
- [djui_reset_popup_disabled_override](functions-5.md#djui_reset_popup_disabled_override)
|
||||
- [djui_set_popup_disabled_override](functions-5.md#djui_set_popup_disabled_override)
|
||||
- [get_coop_compatibility_enabled](functions-5.md#get_coop_compatibility_enabled)
|
||||
- [get_current_save_file_num](functions-5.md#get_current_save_file_num)
|
||||
- [get_date_and_time](functions-5.md#get_date_and_time)
|
||||
- [get_dialog_box_state](functions-5.md#get_dialog_box_state)
|
||||
|
|
|
@ -4393,4 +4393,4 @@ char gSmluaConstants[] = ""
|
|||
"VERSION_REGION = 'US'\n"
|
||||
"MAX_VERSION_LENGTH = 32\n"
|
||||
"MAX_LOCAL_VERSION_LENGTH = 36\n"
|
||||
;
|
||||
"if get_coop_compatibility_enabled() then SM64COOPDX_VERSION = nil end";
|
|
@ -28719,6 +28719,21 @@ int smlua_func_djui_set_popup_disabled_override(lua_State* L) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int smlua_func_get_coop_compatibility_enabled(UNUSED lua_State* L) {
|
||||
if (L == NULL) { return 0; }
|
||||
|
||||
int top = lua_gettop(L);
|
||||
if (top != 0) {
|
||||
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_coop_compatibility_enabled", 0, top);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
lua_pushboolean(L, get_coop_compatibility_enabled());
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int smlua_func_get_current_save_file_num(UNUSED lua_State* L) {
|
||||
if (L == NULL) { return 0; }
|
||||
|
||||
|
@ -32853,6 +32868,7 @@ void smlua_bind_functions_autogen(void) {
|
|||
smlua_bind_function(L, "djui_popup_create_global", smlua_func_djui_popup_create_global);
|
||||
smlua_bind_function(L, "djui_reset_popup_disabled_override", smlua_func_djui_reset_popup_disabled_override);
|
||||
smlua_bind_function(L, "djui_set_popup_disabled_override", smlua_func_djui_set_popup_disabled_override);
|
||||
smlua_bind_function(L, "get_coop_compatibility_enabled", smlua_func_get_coop_compatibility_enabled);
|
||||
smlua_bind_function(L, "get_current_save_file_num", smlua_func_get_current_save_file_num);
|
||||
smlua_bind_function(L, "get_date_and_time", smlua_func_get_date_and_time);
|
||||
smlua_bind_function(L, "get_dialog_box_state", smlua_func_get_dialog_box_state);
|
||||
|
|
|
@ -622,6 +622,12 @@ void set_override_envfx(s32 envfx) {
|
|||
|
||||
///
|
||||
|
||||
bool get_coop_compatibility_enabled(void) {
|
||||
return configCoopCompatibility;
|
||||
}
|
||||
|
||||
///
|
||||
|
||||
const char* get_os_name(void) {
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
return "Windows";
|
||||
|
|
|
@ -153,6 +153,8 @@ struct DateTime* get_date_and_time(void);
|
|||
u16 get_envfx(void);
|
||||
void set_override_envfx(s32 envfx);
|
||||
|
||||
bool get_coop_compatibility_enabled(void);
|
||||
|
||||
const char* get_os_name(void);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue