Add djui_is_chatbox_open

This commit is contained in:
Agent X 2025-11-15 10:30:32 -05:00
parent cdf3ad4e66
commit 89c8650091
8 changed files with 52 additions and 60 deletions

View file

@ -11086,6 +11086,12 @@ function djui_get_playerlist_page_index()
-- ...
end
--- @return boolean
--- Checks if the DJUI chatbox is open
function djui_is_chatbox_open()
-- ...
end
--- @return DjuiFontType
--- Gets the DJUI menu font
function djui_menu_get_font()

View file

@ -300,62 +300,6 @@ function get_texture_info(textureName)
-- ...
end
--- @param texInfo TextureInfo The texture
--- @param x number Where the texture is horizontally (left anchored)
--- @param y number Where the texture is vertically (top anchored)
--- @param scaleW number The scaled width of the texture
--- @param scaleH number The scaled height of the texture
--- Renders a texture to the screen
function djui_hud_render_texture(texInfo, x, y, scaleW, scaleH)
-- ...
end
--- @param texInfo TextureInfo The texture
--- @param x number Where the texture is horizontally (left anchored)
--- @param y number Where the texture is vertically (top anchored)
--- @param scaleW number The scaled width of the texture
--- @param scaleH number The scaled height of the texture
--- @param tileX number Where the tile is horizontally (left anchored)
--- @param tileY number Where the tile is vertically (top anchored)
--- @param tileW number The width of the tile
--- @param tileH number The height of the tile
--- Renders a tile of a texture to the screen
function djui_hud_render_texture_tile(texInfo, x, y, scaleW, scaleH, tileX, tileY, tileW, tileH)
-- ...
end
--- @param texInfo TextureInfo The texture
--- @param prevX number Where the texture previously was horizontally (left anchored)
--- @param prevY number Where the texture previously was vertically (top anchored)
--- @param prevScaleW number The previous scaled width of the texture
--- @param prevScaleH number The previous scaled height of the texture
--- @param x number Where the texture is horizontally (left anchored)
--- @param y number Where the texture is vertically (top anchored)
--- @param scaleW number The scaled width of the texture
--- @param scaleH number The scaled height of the texture
--- Renders an interpolated texture to the screen
function djui_hud_render_texture_interpolated(texInfo, prevX, prevY, prevScaleW, prevScaleH, x, y, scaleW, scaleH)
-- ...
end
--- @param texInfo TextureInfo The texture
--- @param prevX number Where the texture previously was horizontally (left anchored)
--- @param prevY number Where the texture previously was vertically (top anchored)
--- @param prevScaleW number The previous scaled width of the texture
--- @param prevScaleH number The previous scaled height of the texture
--- @param x number Where the texture is horizontally (left anchored)
--- @param y number Where the texture is vertically (top anchored)
--- @param scaleW number The scaled width of the texture
--- @param scaleH number The scaled height of the texture
--- @param tileX number Where the tile is horizontally (left anchored)
--- @param tileY number Where the tile is vertically (top anchored)
--- @param tileW number The width of the tile
--- @param tileH number The height of the tile
--- Renders an interpolated tile of a texture to the screen
function djui_hud_render_texture_tile_interpolated(texInfo, prevX, prevY, prevScaleW, prevScaleH, x, y, scaleW, scaleH, tileX, tileY, tileW, tileH)
-- ...
end
--- @param textureName string The name of the texture
--- @param overrideTexInfo TextureInfo The texture to override with
--- Overrides a texture with a custom `TextureInfo`

View file

@ -541,6 +541,27 @@ Gets the DJUI playerlist's page index
<br />
## [djui_is_chatbox_open](#djui_is_chatbox_open)
### Description
Checks if the DJUI chatbox is open
### Lua Example
`local booleanValue = djui_is_chatbox_open()`
### Parameters
- None
### Returns
- `boolean`
### C Prototype
`bool djui_is_chatbox_open(void);`
[:arrow_up_small:](#)
<br />
## [djui_menu_get_font](#djui_menu_get_font)
### Description

View file

@ -1986,6 +1986,7 @@
- [djui_is_playerlist_open](functions-7.md#djui_is_playerlist_open)
- [djui_attempting_to_open_playerlist](functions-7.md#djui_attempting_to_open_playerlist)
- [djui_get_playerlist_page_index](functions-7.md#djui_get_playerlist_page_index)
- [djui_is_chatbox_open](functions-7.md#djui_is_chatbox_open)
- [djui_menu_get_font](functions-7.md#djui_menu_get_font)
- [djui_menu_get_theme](functions-7.md#djui_menu_get_theme)
- [djui_is_playerlist_ping_visible](functions-7.md#djui_is_playerlist_ping_visible)

View file

@ -63,8 +63,6 @@ static void first_person_camera_update(void) {
struct MarioState *m = &gMarioStates[0];
f32 sensX = 0.3f * camera_config_get_x_sensitivity();
f32 sensY = 0.4f * camera_config_get_y_sensitivity();
s16 invX = camera_config_is_x_inverted() ? 1 : -1;
s16 invY = camera_config_is_y_inverted() ? 1 : -1;
if (mouse_relative_enabled) {
// hack: make c buttons work for moving the camera
@ -79,7 +77,7 @@ static void first_person_camera_update(void) {
// update pitch
if (!gFirstPersonCamera.forcePitch) {
gFirstPersonCamera.pitch -= sensY * (invY * extStickY - 1.5f * mouse_y);
gFirstPersonCamera.pitch -= sensY * (extStickY - 1.5f * mouse_y);
gFirstPersonCamera.pitch = clamp(gFirstPersonCamera.pitch, -0x3F00, 0x3F00);
}
@ -88,7 +86,7 @@ static void first_person_camera_update(void) {
if (m->controller->buttonDown & L_TRIG && gFirstPersonCamera.centerL) {
gFirstPersonCamera.yaw = m->faceAngle[1] + 0x8000;
} else {
gFirstPersonCamera.yaw += sensX * (invX * extStickX - 1.5f * mouse_x);
gFirstPersonCamera.yaw += sensX * (extStickX - 1.5f * mouse_x);
}
}
}

View file

@ -33317,6 +33317,21 @@ int smlua_func_djui_get_playerlist_page_index(UNUSED lua_State* L) {
return 1;
}
int smlua_func_djui_is_chatbox_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", "djui_is_chatbox_open", 0, top);
return 0;
}
lua_pushboolean(L, djui_is_chatbox_open());
return 1;
}
int smlua_func_djui_menu_get_font(UNUSED lua_State* L) {
if (L == NULL) { return 0; }
@ -38649,6 +38664,7 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "djui_is_playerlist_open", smlua_func_djui_is_playerlist_open);
smlua_bind_function(L, "djui_attempting_to_open_playerlist", smlua_func_djui_attempting_to_open_playerlist);
smlua_bind_function(L, "djui_get_playerlist_page_index", smlua_func_djui_get_playerlist_page_index);
smlua_bind_function(L, "djui_is_chatbox_open", smlua_func_djui_is_chatbox_open);
smlua_bind_function(L, "djui_menu_get_font", smlua_func_djui_menu_get_font);
smlua_bind_function(L, "djui_menu_get_theme", smlua_func_djui_menu_get_theme);
smlua_bind_function(L, "djui_is_playerlist_ping_visible", smlua_func_djui_is_playerlist_ping_visible);

View file

@ -110,6 +110,10 @@ u8 djui_get_playerlist_page_index(void) {
return sPageIndex;
}
bool djui_is_chatbox_open(void) {
return gDjuiChatBox->base.visible;
}
enum DjuiFontType djui_menu_get_font(void) {
return configDjuiThemeFont == 0 ? FONT_NORMAL : FONT_ALIASED;
}

View file

@ -75,6 +75,8 @@ bool djui_is_playerlist_open(void);
bool djui_attempting_to_open_playerlist(void);
/* |description|Gets the DJUI playerlist's page index|descriptionEnd| */
u8 djui_get_playerlist_page_index(void);
/* |description|Checks if the DJUI chatbox is open|descriptionEnd| */
bool djui_is_chatbox_open(void);
/* |description|Gets the DJUI menu font|descriptionEnd| */
enum DjuiFontType djui_menu_get_font(void);
/* |description|Gets the DJUI menu theme|descriptionEnd| */