mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-21 19:45:10 +00:00
Add djui_attempting_to_open_playerlist
(#195)
This commit is contained in:
parent
8636d26726
commit
39e035239c
9 changed files with 57 additions and 6 deletions
|
@ -8181,6 +8181,11 @@ function deref_s32_pointer(pointer)
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- @return boolean
|
||||
function djui_attempting_to_open_playerlist()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @return boolean
|
||||
function djui_is_playerlist_open()
|
||||
-- ...
|
||||
|
|
|
@ -1953,6 +1953,24 @@
|
|||
|
||||
<br />
|
||||
|
||||
## [djui_attempting_to_open_playerlist](#djui_attempting_to_open_playerlist)
|
||||
|
||||
### Lua Example
|
||||
`local booleanValue = djui_attempting_to_open_playerlist()`
|
||||
|
||||
### Parameters
|
||||
- None
|
||||
|
||||
### Returns
|
||||
- `boolean`
|
||||
|
||||
### C Prototype
|
||||
`bool djui_attempting_to_open_playerlist(void);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [djui_is_playerlist_open](#djui_is_playerlist_open)
|
||||
|
||||
### Lua Example
|
||||
|
|
|
@ -1719,6 +1719,7 @@
|
|||
- [allocate_mario_action](functions-5.md#allocate_mario_action)
|
||||
- [course_is_main_course](functions-5.md#course_is_main_course)
|
||||
- [deref_s32_pointer](functions-5.md#deref_s32_pointer)
|
||||
- [djui_attempting_to_open_playerlist](functions-5.md#djui_attempting_to_open_playerlist)
|
||||
- [djui_is_playerlist_open](functions-5.md#djui_is_playerlist_open)
|
||||
- [djui_is_popup_disabled](functions-5.md#djui_is_popup_disabled)
|
||||
- [djui_menu_get_font](functions-5.md#djui_menu_get_font)
|
||||
|
|
|
@ -235,15 +235,18 @@ bool djui_interactable_on_key_down(int scancode) {
|
|||
}
|
||||
}
|
||||
|
||||
if ((gDjuiPlayerList != NULL || gDjuiModList != NULL) && gServerSettings.enablePlayerList) {
|
||||
if ((gDjuiPlayerList != NULL || gDjuiModList != NULL)) {
|
||||
for (int i = 0; i < MAX_BINDS; i++) {
|
||||
if (scancode == (int)configKeyPlayerList[i] && !gDjuiInMainMenu && gNetworkType != NT_NONE) {
|
||||
if (gDjuiPlayerList != NULL) {
|
||||
djui_base_set_visible(&gDjuiPlayerList->base, true);
|
||||
}
|
||||
if (gDjuiModList != NULL) {
|
||||
djui_base_set_visible(&gDjuiModList->base, true);
|
||||
if (gServerSettings.enablePlayerList) {
|
||||
if (gDjuiPlayerList != NULL) {
|
||||
djui_base_set_visible(&gDjuiPlayerList->base, true);
|
||||
}
|
||||
if (gDjuiModList != NULL) {
|
||||
djui_base_set_visible(&gDjuiModList->base, true);
|
||||
}
|
||||
}
|
||||
gAttemptingToOpenPlayerlist = true;
|
||||
break;
|
||||
}
|
||||
if (gDjuiPlayerList->base.visible) {
|
||||
|
@ -295,6 +298,7 @@ void djui_interactable_on_key_up(int scancode) {
|
|||
if (gDjuiModList != NULL) {
|
||||
djui_base_set_visible(&gDjuiModList->base, false);
|
||||
}
|
||||
gAttemptingToOpenPlayerlist = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "pc/utils/misc.h"
|
||||
|
||||
struct DjuiThreePanel* gDjuiPlayerList = NULL;
|
||||
bool gAttemptingToOpenPlayerlist = false;
|
||||
|
||||
static struct DjuiFlowLayout* djuiRow[MAX_PLAYERS] = { 0 };
|
||||
static struct DjuiImage* djuiImages[MAX_PLAYERS] = { 0 };
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "djui.h"
|
||||
|
||||
extern struct DjuiThreePanel* gDjuiPlayerList;
|
||||
extern bool gAttemptingToOpenPlayerlist;
|
||||
|
||||
extern const u8 sPlayerListSize;
|
||||
extern u8 sPageIndex;
|
||||
|
|
|
@ -30152,6 +30152,21 @@ int smlua_func_deref_s32_pointer(lua_State* L) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int smlua_func_djui_attempting_to_open_playerlist(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", "djui_attempting_to_open_playerlist", 0, top);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
lua_pushboolean(L, djui_attempting_to_open_playerlist());
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int smlua_func_djui_is_playerlist_open(UNUSED lua_State* L) {
|
||||
if (L == NULL) { return 0; }
|
||||
|
||||
|
@ -34668,6 +34683,7 @@ void smlua_bind_functions_autogen(void) {
|
|||
smlua_bind_function(L, "allocate_mario_action", smlua_func_allocate_mario_action);
|
||||
smlua_bind_function(L, "course_is_main_course", smlua_func_course_is_main_course);
|
||||
smlua_bind_function(L, "deref_s32_pointer", smlua_func_deref_s32_pointer);
|
||||
smlua_bind_function(L, "djui_attempting_to_open_playerlist", smlua_func_djui_attempting_to_open_playerlist);
|
||||
smlua_bind_function(L, "djui_is_playerlist_open", smlua_func_djui_is_playerlist_open);
|
||||
smlua_bind_function(L, "djui_is_popup_disabled", smlua_func_djui_is_popup_disabled);
|
||||
smlua_bind_function(L, "djui_menu_get_font", smlua_func_djui_menu_get_font);
|
||||
|
|
|
@ -91,6 +91,10 @@ bool djui_is_playerlist_open(void) {
|
|||
return gDjuiPlayerList->base.visible;
|
||||
}
|
||||
|
||||
bool djui_attempting_to_open_playerlist(void) {
|
||||
return gAttemptingToOpenPlayerlist;
|
||||
}
|
||||
|
||||
enum DjuiFontType djui_menu_get_font(void) {
|
||||
return configDjuiThemeFont == 0 ? FONT_NORMAL : FONT_ALIASED;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ bool djui_is_popup_disabled(void);
|
|||
void djui_set_popup_disabled_override(bool value);
|
||||
void djui_reset_popup_disabled_override(void);
|
||||
bool djui_is_playerlist_open(void);
|
||||
bool djui_attempting_to_open_playerlist(void);
|
||||
enum DjuiFontType djui_menu_get_font(void);
|
||||
|
||||
s8 get_dialog_box_state(void);
|
||||
|
|
Loading…
Reference in a new issue