From b1b00b4a8aad8ea97c318aab597b9468c536e656 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Fri, 30 Aug 2024 16:23:06 -0500 Subject: Restructure screen & add header defs --- src/screen.h | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 142 insertions(+), 8 deletions(-) (limited to 'src/screen.h') diff --git a/src/screen.h b/src/screen.h index 25cd8fa..7c776e6 100644 --- a/src/screen.h +++ b/src/screen.h @@ -3,16 +3,101 @@ #include #include +#include -#define STATIC_ARRSIZE(arr) (sizeof((arr)) / sizeof((arr)[0])) +const char *phrases[] = { + // By @syxhe on telegram + "WE CLOWN IN THIS MF, TAKE YO SENSITIVE ASS BACK TO @GENTOOMEMES", + "R.I.P VxHeaven", + "tmp(2) nuked by Smelly", + "99% of Ransomware Operators quit before compromising a bank", + "Equation Group wuz here", + "Lazarus wuz here", + "LockBit wuz here", + "Sponsored by Equation Group", + "Sponsored by Lazarus", + "Sponsored by LockBit", + "Free my boy Ross Ulbricht he did nothing wrong", + "Stay off the dark web, kids", + "FREE BITCOIN JUST 3 SPINS AWAY", + "We all glow in the dark", + "Shoutouts to Simpleflips", + "Shoutouts to BugHunter", + "Shoutouts to EyeDeeKay", + ":beecat:", + ":3", + "You think Jack Rhysider will interview me now?", + "Check out \"Darknet Diaries\"", + "Chill and losing it since 2016", + "POOL'S CLOSED", + "I've been diagnosed with snaids", + "My balls itch", + "We killin filez and shiit", + "lonix users BTFO once again", + "This space left intentionally blank", + "Thinking of a way out is self-centered at best", + "Searching for the punchline to an infinite jest?", + "Still learning what it means to feel", + "Killroy was NOT here", + "Go fuck yourself lmao", + "It's so over", + "We're so back", + "It never even began", + "Pepito they shot Trump", + "This shit ain't nothing to me man", + "I'm him, I will continue to be him", + "THERE ARE MOSQUITOS IN YOUR URETHRA, GET THEM OUT!!!", + "Something wicked this way comes", + "Schizo hour", + "Man I could really use some Chicken Bouillon rn", + "Fuck my digital footprint, I need a digital footjob", + "Having my weekly \"Ted was right\" moment", + "Why aren't you in the gym?", + "Proof?", + "I've gone completely mental", + "The rage consumes me", + "Go outside. Now.", + "Beautiful Day Sunny Morning", + "Fuck crypto all my homies hate crypto", + "stfu fedsmoker is my dad he'll eat you alive", + "Almost dog in hot car'd myself", -#define RGB_MIN 0 -#define RGB_MAX 255 -#define CURSESCOLOR_MIN 0 -#define CURSESCOLOR_MAX 1000 + // by @danielsprofile on telegram + "Daniel Spears loves femboys", + "LizardSquad > Razer", + "Sponsored by Major League Gaming", + "Sponsored by LemonParty.org", + "Sponsored by FTX", + "RIP Harambe", + "Shoutout Elliot Alderson", + "Ted Kaczynski was right", + "The FBI watches me jerk off to MILFs lol", + "robux generator free online 2024 100% working undetected", + "Doge wuz here", + "We like Fortnite we like Fortnite", + "We live in a society", + "Hab you seen a alien pls?", + "using a flipperzero makes me an APT, right?", + "Subscribe to PewDiePie", +}; + +const char *menu_choices[] = { + "Spin", + "Buy spins", + "Quit" +}; + +#define STATIC_ARRSIZE(arr) (sizeof((arr)) / sizeof((arr)[0])) #define FUCKED_UP_ENTER 10 +// functions for the userpointer for each menu item. Defines callbacks and type of function called +#define userfuncs (struct funcholder []){ \ + {.callback = spin, .type = FH_SPIN}, \ + {.callback = buy, .type = FH_BUY}, \ + {.callback = quit, .type = FH_QUIT} \ +} + enum custom_colors { // Unspecified color CC_UNSPEC = -1, @@ -108,17 +193,66 @@ struct params { int numspins; } params; + +//////////////////////////////////// SPECIFICALLY USEFUL FUNCS //////////////////////////////////// + + +// Catch SIGINT and SIGWINCH signals +void catcher(int signum, siginfo_t *info, void *ucontext); + +// Initialize sodium, curses, and set the proper locale. Exits on error, returns 0 otherwise +int doinit(const struct sigaction *handler); + +// Initialize colors & define a few custom colors & color pairs. Exits on error, returns 0 otherwise +int docolors(void); + +// Initialize a set of items using an array of items, an array of menu options, and an array of funcholder structs +int init_items(ITEM *items[], const char *menuopts[], size_t menuopts_size, struct funcholder usrptrs[]); + +// Initialize the individual slot wheels & the window they sit on +int init_slotholder(struct slotholder *slots); + +// Set a specific, custom menu format +int init_custom_menu_format(WINDOW *menuholder, MENU *menu, const int fmtdim[2], Menu_Options toggleon, Menu_Options toggleoff); + +// Create the vx-gambleground banner +WINDOW* create_banner(int col, int randomnum); + +// Deal with menu items when a user hits enter +int handle_menuitem(MENU *menu, struct params *params); + +// Deal with switching menu contexts +int handle_input(WINDOW *menuholder, MENU *menu, struct params *params); + +// Spin the wheel +int spin(void *params); + +// Increase number of spins +int buy(void *params); + +// Quit out +int quit(void *params); + + +//////////////////////////////////// GENERALLY USEFUL FUNCTIONS //////////////////////////////////// + + + // Converts value from within the range of [oldmin, oldmax] to a value within the range [newmin, newmax] float normalize(float value, float oldmin, float oldmax, float newmin, float newmax); // Find the result of x + offset and constrain it to the range [min, max]. x must be >= min int rangemod(int x, int offset, int min, int max); + // Initialize a new curses color using standard rgb values (0-255) instead of curses' 0-1000 range static int init_rgb_color(int colornum, int red, int green, int blue); +#define RGB_MIN 0 +#define RGB_MAX 255 +#define CURSESCOLOR_MIN 0 +#define CURSESCOLOR_MAX 1000 -int spin(void *params); -int buy(void *params); -int quit(void *params); +// Create a box starting at (x, y) with a specified width and height +int mvwcreate_box(WINDOW *win, int y, int x, int height, int width, const chtype chars[6]); #endif \ No newline at end of file -- cgit v1.2.3