Fix Mod Menu panel height bug

This commit is contained in:
Agent X 2024-08-31 22:26:33 -04:00
parent a6d56efa33
commit 256539a925
2 changed files with 6 additions and 1 deletions

View File

@ -3,7 +3,7 @@
#include "djui_panel_menu.h" #include "djui_panel_menu.h"
#include "pc/lua/utils/smlua_misc_utils.h" #include "pc/lua/utils/smlua_misc_utils.h"
static char sInfo[512]; static char sInfo[512] = { 0 };
void djui_panel_info_create(struct DjuiBase *caller) { void djui_panel_info_create(struct DjuiBase *caller) {
struct DjuiThreePanel *panel = djui_panel_menu_create(DLANG(INFORMATION, INFORMATION_TITLE), false); struct DjuiThreePanel *panel = djui_panel_menu_create(DLANG(INFORMATION, INFORMATION_TITLE), false);

View File

@ -105,12 +105,17 @@ void djui_panel_mod_menu_mod_create(struct DjuiBase* caller) {
{ {
struct DjuiPaginated* paginated = djui_paginated_create(body, 8); struct DjuiPaginated* paginated = djui_paginated_create(body, 8);
struct DjuiBase* layoutBase = &paginated->layout->base; struct DjuiBase* layoutBase = &paginated->layout->base;
s32 count = 0;
for (int i = 0; i < gHookedModMenuElementsCount; i++) { for (int i = 0; i < gHookedModMenuElementsCount; i++) {
if (gHookedModMenuElements[i].mod == mod) { if (gHookedModMenuElements[i].mod == mod) {
djui_panel_mod_menu_mod_create_element(layoutBase, i); djui_panel_mod_menu_mod_create_element(layoutBase, i);
count++;
} }
} }
djui_paginated_calculate_height(paginated); djui_paginated_calculate_height(paginated);
if (count == 8) {
djui_base_set_size(layoutBase, layoutBase->width.value, layoutBase->height.value + 16);
}
djui_button_create(body, DLANG(MENU, BACK), DJUI_BUTTON_STYLE_BACK, djui_panel_menu_back); djui_button_create(body, DLANG(MENU, BACK), DJUI_BUTTON_STYLE_BACK, djui_panel_menu_back);
} }