Add djui_menu_get_font

This commit is contained in:
Agent X 2024-06-29 16:15:44 -04:00
parent 8a5a23a8a6
commit 20d2e3de6b
6 changed files with 50 additions and 8 deletions

View file

@ -8144,6 +8144,11 @@ function djui_is_popup_disabled()
-- ...
end
--- @return DjuiFontType
function djui_menu_get_font()
-- ...
end
--- @param message string
--- @param lines integer
function djui_popup_create_global(message, lines)

View file

@ -1989,6 +1989,24 @@
<br />
## [djui_menu_get_font](#djui_menu_get_font)
### Lua Example
`local enumValue = djui_menu_get_font()`
### Parameters
- None
### Returns
[enum DjuiFontType](constants.md#enum-DjuiFontType)
### C Prototype
`enum DjuiFontType djui_menu_get_font(void);`
[:arrow_up_small:](#)
<br />
## [djui_popup_create_global](#djui_popup_create_global)
### Lua Example

View file

@ -1709,6 +1709,7 @@
- [deref_s32_pointer](functions-5.md#deref_s32_pointer)
- [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)
- [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)

View file

@ -30042,6 +30042,21 @@ int smlua_func_djui_is_popup_disabled(UNUSED lua_State* L) {
return 1;
}
int smlua_func_djui_menu_get_font(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_menu_get_font", 0, top);
return 0;
}
lua_pushinteger(L, djui_menu_get_font());
return 1;
}
int smlua_func_djui_popup_create_global(lua_State* L) {
if (L == NULL) { return 0; }
@ -34470,6 +34485,7 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "deref_s32_pointer", smlua_func_deref_s32_pointer);
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);
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);

View file

@ -86,6 +86,14 @@ void djui_reset_popup_disabled_override(void) {
sAllowDjuiPopupOverride.override = false;
}
bool djui_is_playerlist_open(void) {
return gDjuiPlayerList->base.visible;
}
enum DjuiFontType djui_menu_get_font(void) {
return configDjuiThemeFont == 0 ? FONT_NORMAL : FONT_ALIASED;
}
///
extern s8 gDialogBoxState;
@ -403,12 +411,6 @@ s32 get_dialog_response(void) {
///
bool djui_is_playerlist_open(void) {
return gDjuiPlayerList->base.visible;
}
///
const char* get_local_discord_id(void) {
#ifdef DISCORD_SDK
static char sDiscordId[64] = "";

View file

@ -49,6 +49,8 @@ void djui_popup_create_global(const char* message, int lines);
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);
enum DjuiFontType djui_menu_get_font(void);
s8 get_dialog_box_state(void);
s16 get_dialog_id(void);
@ -108,8 +110,6 @@ u32 get_global_timer(void);
s32 get_dialog_response(void);
bool djui_is_playerlist_open(void);
const char* get_local_discord_id(void);
f32 get_volume_master(void);