diff options
| author | @syxhe <https://t.me/syxhe> | 2024-08-30 16:23:06 -0500 |
|---|---|---|
| committer | @syxhe <https://t.me/syxhe> | 2024-08-30 16:23:06 -0500 |
| commit | b1b00b4a8aad8ea97c318aab597b9468c536e656 (patch) | |
| tree | 2b74c230b212a655b1e55d192e71e0f4ced7650b /src/screen.h | |
| parent | 9497cdd0d6d1483f559aacf3f8f2bbb6a11716ab (diff) | |
Restructure screen & add header defs
Diffstat (limited to 'src/screen.h')
| -rw-r--r-- | src/screen.h | 150 |
1 files changed, 142 insertions, 8 deletions
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 @@ | |||
| 3 | 3 | ||
| 4 | #include <menu.h> | 4 | #include <menu.h> |
| 5 | #include <curses.h> | 5 | #include <curses.h> |
| 6 | #include <signal.h> | ||
| 6 | 7 | ||
| 7 | #define STATIC_ARRSIZE(arr) (sizeof((arr)) / sizeof((arr)[0])) | 8 | const char *phrases[] = { |
| 9 | // By @syxhe on telegram | ||
| 10 | "WE CLOWN IN THIS MF, TAKE YO SENSITIVE ASS BACK TO @GENTOOMEMES", | ||
| 11 | "R.I.P VxHeaven", | ||
| 12 | "tmp(2) nuked by Smelly", | ||
| 13 | "99% of Ransomware Operators quit before compromising a bank", | ||
| 14 | "Equation Group wuz here", | ||
| 15 | "Lazarus wuz here", | ||
| 16 | "LockBit wuz here", | ||
| 17 | "Sponsored by Equation Group", | ||
| 18 | "Sponsored by Lazarus", | ||
| 19 | "Sponsored by LockBit", | ||
| 20 | "Free my boy Ross Ulbricht he did nothing wrong", | ||
| 21 | "Stay off the dark web, kids", | ||
| 22 | "FREE BITCOIN JUST 3 SPINS AWAY", | ||
| 23 | "We all glow in the dark", | ||
| 24 | "Shoutouts to Simpleflips", | ||
| 25 | "Shoutouts to BugHunter", | ||
| 26 | "Shoutouts to EyeDeeKay", | ||
| 27 | ":beecat:", | ||
| 28 | ":3", | ||
| 29 | "You think Jack Rhysider will interview me now?", | ||
| 30 | "Check out \"Darknet Diaries\"", | ||
| 31 | "Chill and losing it since 2016", | ||
| 32 | "POOL'S CLOSED", | ||
| 33 | "I've been diagnosed with snaids", | ||
| 34 | "My balls itch", | ||
| 35 | "We killin filez and shiit", | ||
| 36 | "lonix users BTFO once again", | ||
| 37 | "This space left intentionally blank", | ||
| 38 | "Thinking of a way out is self-centered at best", | ||
| 39 | "Searching for the punchline to an infinite jest?", | ||
| 40 | "Still learning what it means to feel", | ||
| 41 | "Killroy was NOT here", | ||
| 42 | "Go fuck yourself lmao", | ||
| 43 | "It's so over", | ||
| 44 | "We're so back", | ||
| 45 | "It never even began", | ||
| 46 | "Pepito they shot Trump", | ||
| 47 | "This shit ain't nothing to me man", | ||
| 48 | "I'm him, I will continue to be him", | ||
| 49 | "THERE ARE MOSQUITOS IN YOUR URETHRA, GET THEM OUT!!!", | ||
| 50 | "Something wicked this way comes", | ||
| 51 | "Schizo hour", | ||
| 52 | "Man I could really use some Chicken Bouillon rn", | ||
| 53 | "Fuck my digital footprint, I need a digital footjob", | ||
| 54 | "Having my weekly \"Ted was right\" moment", | ||
| 55 | "Why aren't you in the gym?", | ||
| 56 | "Proof?", | ||
| 57 | "I've gone completely mental", | ||
| 58 | "The rage consumes me", | ||
| 59 | "Go outside. Now.", | ||
| 60 | "Beautiful Day Sunny Morning", | ||
| 61 | "Fuck crypto all my homies hate crypto", | ||
| 62 | "stfu fedsmoker is my dad he'll eat you alive", | ||
| 63 | "Almost dog in hot car'd myself", | ||
| 8 | 64 | ||
| 9 | #define RGB_MIN 0 | 65 | // by @danielsprofile on telegram |
| 10 | #define RGB_MAX 255 | 66 | "Daniel Spears loves femboys", |
| 11 | #define CURSESCOLOR_MIN 0 | 67 | "LizardSquad > Razer", |
| 12 | #define CURSESCOLOR_MAX 1000 | 68 | "Sponsored by Major League Gaming", |
| 69 | "Sponsored by LemonParty.org", | ||
| 70 | "Sponsored by FTX", | ||
| 71 | "RIP Harambe", | ||
| 72 | "Shoutout Elliot Alderson", | ||
| 73 | "Ted Kaczynski was right", | ||
| 74 | "The FBI watches me jerk off to MILFs lol", | ||
| 75 | "robux generator free online 2024 100% working undetected", | ||
| 76 | "Doge wuz here", | ||
| 77 | "We like Fortnite we like Fortnite", | ||
| 78 | "We live in a society", | ||
| 79 | "Hab you seen a alien pls?", | ||
| 80 | "using a flipperzero makes me an APT, right?", | ||
| 81 | "Subscribe to PewDiePie", | ||
| 82 | }; | ||
| 83 | |||
| 84 | const char *menu_choices[] = { | ||
| 85 | "Spin", | ||
| 86 | "Buy spins", | ||
| 87 | "Quit" | ||
| 88 | }; | ||
| 89 | |||
| 90 | #define STATIC_ARRSIZE(arr) (sizeof((arr)) / sizeof((arr)[0])) | ||
| 13 | 91 | ||
| 14 | #define FUCKED_UP_ENTER 10 | 92 | #define FUCKED_UP_ENTER 10 |
| 15 | 93 | ||
| 94 | // functions for the userpointer for each menu item. Defines callbacks and type of function called | ||
| 95 | #define userfuncs (struct funcholder []){ \ | ||
| 96 | {.callback = spin, .type = FH_SPIN}, \ | ||
| 97 | {.callback = buy, .type = FH_BUY}, \ | ||
| 98 | {.callback = quit, .type = FH_QUIT} \ | ||
| 99 | } | ||
| 100 | |||
| 16 | enum custom_colors { | 101 | enum custom_colors { |
| 17 | // Unspecified color | 102 | // Unspecified color |
| 18 | CC_UNSPEC = -1, | 103 | CC_UNSPEC = -1, |
| @@ -108,17 +193,66 @@ struct params { | |||
| 108 | int numspins; | 193 | int numspins; |
| 109 | } params; | 194 | } params; |
| 110 | 195 | ||
| 196 | |||
| 197 | //////////////////////////////////// SPECIFICALLY USEFUL FUNCS //////////////////////////////////// | ||
| 198 | |||
| 199 | |||
| 200 | // Catch SIGINT and SIGWINCH signals | ||
| 201 | void catcher(int signum, siginfo_t *info, void *ucontext); | ||
| 202 | |||
| 203 | // Initialize sodium, curses, and set the proper locale. Exits on error, returns 0 otherwise | ||
| 204 | int doinit(const struct sigaction *handler); | ||
| 205 | |||
| 206 | // Initialize colors & define a few custom colors & color pairs. Exits on error, returns 0 otherwise | ||
| 207 | int docolors(void); | ||
| 208 | |||
| 209 | // Initialize a set of items using an array of items, an array of menu options, and an array of funcholder structs | ||
| 210 | int init_items(ITEM *items[], const char *menuopts[], size_t menuopts_size, struct funcholder usrptrs[]); | ||
| 211 | |||
| 212 | // Initialize the individual slot wheels & the window they sit on | ||
| 213 | int init_slotholder(struct slotholder *slots); | ||
| 214 | |||
| 215 | // Set a specific, custom menu format | ||
| 216 | int init_custom_menu_format(WINDOW *menuholder, MENU *menu, const int fmtdim[2], Menu_Options toggleon, Menu_Options toggleoff); | ||
| 217 | |||
| 218 | // Create the vx-gambleground banner | ||
| 219 | WINDOW* create_banner(int col, int randomnum); | ||
| 220 | |||
| 221 | // Deal with menu items when a user hits enter | ||
| 222 | int handle_menuitem(MENU *menu, struct params *params); | ||
| 223 | |||
| 224 | // Deal with switching menu contexts | ||
| 225 | int handle_input(WINDOW *menuholder, MENU *menu, struct params *params); | ||
| 226 | |||
| 227 | // Spin the wheel | ||
| 228 | int spin(void *params); | ||
| 229 | |||
| 230 | // Increase number of spins | ||
| 231 | int buy(void *params); | ||
| 232 | |||
| 233 | // Quit out | ||
| 234 | int quit(void *params); | ||
| 235 | |||
| 236 | |||
| 237 | //////////////////////////////////// GENERALLY USEFUL FUNCTIONS //////////////////////////////////// | ||
| 238 | |||
| 239 | |||
| 240 | |||
| 111 | // Converts value from within the range of [oldmin, oldmax] to a value within the range [newmin, newmax] | 241 | // Converts value from within the range of [oldmin, oldmax] to a value within the range [newmin, newmax] |
| 112 | float normalize(float value, float oldmin, float oldmax, float newmin, float newmax); | 242 | float normalize(float value, float oldmin, float oldmax, float newmin, float newmax); |
| 113 | 243 | ||
| 114 | // Find the result of x + offset and constrain it to the range [min, max]. x must be >= min | 244 | // Find the result of x + offset and constrain it to the range [min, max]. x must be >= min |
| 115 | int rangemod(int x, int offset, int min, int max); | 245 | int rangemod(int x, int offset, int min, int max); |
| 116 | 246 | ||
| 247 | |||
| 117 | // Initialize a new curses color using standard rgb values (0-255) instead of curses' 0-1000 range | 248 | // Initialize a new curses color using standard rgb values (0-255) instead of curses' 0-1000 range |
| 118 | static int init_rgb_color(int colornum, int red, int green, int blue); | 249 | static int init_rgb_color(int colornum, int red, int green, int blue); |
| 250 | #define RGB_MIN 0 | ||
| 251 | #define RGB_MAX 255 | ||
| 252 | #define CURSESCOLOR_MIN 0 | ||
| 253 | #define CURSESCOLOR_MAX 1000 | ||
| 119 | 254 | ||
| 120 | int spin(void *params); | 255 | // Create a box starting at (x, y) with a specified width and height |
| 121 | int buy(void *params); | 256 | int mvwcreate_box(WINDOW *win, int y, int x, int height, int width, const chtype chars[6]); |
| 122 | int quit(void *params); | ||
| 123 | 257 | ||
| 124 | #endif \ No newline at end of file | 258 | #endif \ No newline at end of file |
