From 78d7f29b532705c5997e565539d9c250449cd061 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Sat, 27 Jul 2024 01:06:08 -0500 Subject: Menu now also updates color --- src/screen.c | 11 ++++++++--- src/screen.h | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/screen.c b/src/screen.c index 626b1b1..749054b 100644 --- a/src/screen.c +++ b/src/screen.c @@ -138,7 +138,7 @@ static int docolors(void) { init_rgb_color(CC_WHITE, 255, 255, 255); init_pair(CCP_BANNER, CC_WHITE, CURSES_BLUE); - init_pair(CCP_TESTING, CC_WHITE, CC_RED); + init_pair(CCP_TESTING, CC_RED, CC_WHITE); } else { endwin(); error(1, ENOTSUP, "[VX-GAMBLEGROUND] Colors are not supported on your terminal"); @@ -248,6 +248,8 @@ int main() { userfuncs[0].params.spinp.bannerwin = banner; userfuncs[0].params.spinp.phrasenum = randomnum; + userfuncs[0].params.spinp.menuholder = menuholder; + userfuncs[0].params.spinp.menu = menu; // Get user input and deal with the menu while((c = wgetch(menuholder)) != KEY_F(4)) { @@ -312,10 +314,13 @@ int spin(void *spinp) { // Change the color to testing for the banner wbkgd(p->bannerwin, COLOR_PAIR(CCP_TESTING)); - mvwaddstr(p->bannerwin, 0, 1, "VX-GAMBLEGROUND: "); - waddstr(p->bannerwin, phrases[p->phrasenum]); wnoutrefresh(p->bannerwin); + // Change the color to testing for the menu + wbkgd(p->menuholder, COLOR_PAIR(CCP_TESTING)); + set_menu_back(p->menu, COLOR_PAIR(CCP_TESTING)); + wnoutrefresh(p->menuholder); + doupdate(); return 0; diff --git a/src/screen.h b/src/screen.h index 9419d5c..8b8c8f8 100644 --- a/src/screen.h +++ b/src/screen.h @@ -1,6 +1,7 @@ #ifndef __SLOTS__SCREEN_H__184802466018249 #define __SLOTS__SCREEN_H__184802466018249 +#include #include #define STATIC_ARRSIZE(arr) (sizeof((arr)) / sizeof((arr)[0])) @@ -68,6 +69,9 @@ struct funcholder { struct spinp { WINDOW *bannerwin; int phrasenum; + + WINDOW *menuholder; + MENU *menu; } spinp; struct buyp { -- cgit v1.2.3