Add is_playerlist_open()

This commit is contained in:
Agent X 2024-05-12 08:28:33 -04:00
parent 4fc0cc92e6
commit 3c86c0c83b
6 changed files with 52 additions and 3 deletions

View file

@ -9178,6 +9178,11 @@ function is_game_paused()
-- ...
end
--- @return boolean
function is_playerlist_open()
-- ...
end
--- @return boolean
function is_transition_playing()
-- ...

View file

@ -1329,7 +1329,7 @@
- `integer`
### C Prototype
`s32 get_dialog_response();`
`s32 get_dialog_response(void);`
[:arrow_up_small:](#)
@ -1955,6 +1955,24 @@
<br />
## [is_playerlist_open](#is_playerlist_open)
### Lua Example
`local booleanValue = is_playerlist_open()`
### Parameters
- None
### Returns
- `boolean`
### C Prototype
`bool is_playerlist_open(void);`
[:arrow_up_small:](#)
<br />
## [is_transition_playing](#is_transition_playing)
### Lua Example

View file

@ -1699,6 +1699,7 @@
- [hud_set_value](functions-5.md#hud_set_value)
- [hud_show](functions-5.md#hud_show)
- [is_game_paused](functions-5.md#is_game_paused)
- [is_playerlist_open](functions-5.md#is_playerlist_open)
- [is_transition_playing](functions-5.md#is_transition_playing)
- [movtexqc_register](functions-5.md#movtexqc_register)
- [play_transition](functions-5.md#play_transition)

View file

@ -30072,6 +30072,21 @@ int smlua_func_is_game_paused(UNUSED lua_State* L) {
return 1;
}
int smlua_func_is_playerlist_open(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", "is_playerlist_open", 0, top);
return 0;
}
lua_pushboolean(L, is_playerlist_open());
return 1;
}
int smlua_func_is_transition_playing(UNUSED lua_State* L) {
if (L == NULL) { return 0; }
@ -33761,6 +33776,7 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "hud_set_value", smlua_func_hud_set_value);
smlua_bind_function(L, "hud_show", smlua_func_hud_show);
smlua_bind_function(L, "is_game_paused", smlua_func_is_game_paused);
smlua_bind_function(L, "is_playerlist_open", smlua_func_is_playerlist_open);
smlua_bind_function(L, "is_transition_playing", smlua_func_is_transition_playing);
smlua_bind_function(L, "movtexqc_register", smlua_func_movtexqc_register);
smlua_bind_function(L, "play_transition", smlua_func_play_transition);

View file

@ -18,6 +18,7 @@
#include "game/level_update.h"
#include "pc/djui/djui_console.h"
#include "pc/djui/djui_hud_utils.h"
#include "pc/djui/djui_panel_playerlist.h"
#include "game/skybox.h"
#include "pc/gfx/gfx_pc.h"
#include "include/course_table.h"
@ -631,12 +632,18 @@ u32 get_global_timer(void) {
///
s32 get_dialog_response() {
s32 get_dialog_response(void) {
return gDialogResponse;
}
///
bool is_playerlist_open(void) {
return gDjuiPlayerList->base.visible;
}
///
void set_window_title(const char* title) {
WAPI.set_window_title(title);
}

View file

@ -156,7 +156,9 @@ void set_override_envfx(s32 envfx);
u32 get_global_timer(void);
s32 get_dialog_response();
s32 get_dialog_response(void);
bool is_playerlist_open(void);
void set_window_title(const char* title);
void reset_window_title(void);