1
0
mirror of https://github.com/CPunch/Laika.git synced 2025-10-10 09:50:06 +00:00

Re-added variadic packets

- minor refacotring
This commit is contained in:
2022-02-16 17:58:07 -06:00
parent c21be8dfee
commit 9a15ce1463
8 changed files with 520 additions and 40 deletions

View File

@@ -13,6 +13,7 @@ typedef enum {
LIST_LIST,
LIST_TABS,
LIST_MENU,
LIST_TEXT,
LIST_NONE
} LISTTYPE;
@@ -45,6 +46,12 @@ typedef struct sPanel_menu {
char *title;
} tPanel_menu;
typedef struct sPanel_text {
COMMONPANELLIST;
char *title;
char *text;
} tPanel_text;
extern WINDOW *wmain;
extern tPanel_list *panel_botList;
extern tPanel_tabs *panel_tabList;
@@ -88,6 +95,10 @@ void panelL_freeTabs(tPanel_tabs *tabs);
tPanel_menu *panelL_newMenu(char *title);
void panelL_freeMenu(tPanel_menu *menu);
/* textbot popup */
tPanel_text *panelL_newText(char *title, char *text);
void panelL_freeText(tPanel_text *text);
#undef COMMONPANELLIST
#endif

View File

@@ -348,7 +348,21 @@ bool panelL_tickMenu(tPanel_menu *menu, int ch) {
return true;
}
/* ==================================================[[ Panel Direct ]]================================================== */
/* ==================================================[[ Text ]]================================================== */
tPanel_text *panelL_newText(char *title, char *text) {
tPanel_text *textP = (tPanel_text*)panel_newBaseList(sizeof(tPanel_text), LIST_TEXT);
textP->title = title;
textP->list.width = strlen(title) + 4;
return textP;
}
void panelL_freeText(tPanel_text *textP) {
panel_freeBaseList((tPanel_list*)textP);
}
/* ==============================================[[ Panel Direct ]]============================================== */
tPanel_listItem *panelL_newListItem(tPanel_list *list, tPanel_list *child, char *name, panelCallback callback, void *uData) {
tPanel_listItem *item = laikaM_malloc(sizeof(tPanel_listItem));