diff options
Diffstat (limited to 'src/screen.c')
| -rw-r--r-- | src/screen.c | 107 |
1 files changed, 82 insertions, 25 deletions
diff --git a/src/screen.c b/src/screen.c index d79ec3c..b9e0b11 100644 --- a/src/screen.c +++ b/src/screen.c | |||
| @@ -7,27 +7,6 @@ | |||
| 7 | * | 7 | * |
| 8 | Example window layout | 8 | Example window layout |
| 9 | 9 | ||
| 10 | Random Phrases list: | ||
| 11 | > WE CLOWN IN THIS MF, TAKE YO SENSITIVE ASS BACK TO @GENTOOMEMES | ||
| 12 | > R.I.P VxHeaven | ||
| 13 | > tmp(2) nuked by Smelly | ||
| 14 | > 99% of Randomware Operators quit before compromising a bank | ||
| 15 | > Equation Group wuz here | ||
| 16 | > Lazarus wuz here | ||
| 17 | > LockBit wuz here | ||
| 18 | > Sponsored by Equation Group | ||
| 19 | > Sponsored by Lazarus | ||
| 20 | > Sponsored by LockBit | ||
| 21 | > Free my boy Ross Ulbricht he did nothing wrong | ||
| 22 | > Stay off the dark web, kids | ||
| 23 | > FREE BITCOIN JUST 3 SPINS AWAY | ||
| 24 | > We all glow in the dark | ||
| 25 | > Shoutouts to Simpleflips | ||
| 26 | > Shoutouts to BugHunter | ||
| 27 | > Shoutouts to EyeDeeKay | ||
| 28 | > :beecat: | ||
| 29 | > :3 | ||
| 30 | |||
| 31 | ======================================================== (Window 1) (One line long, top of screen) | 10 | ======================================================== (Window 1) (One line long, top of screen) |
| 32 | VX-GAMBLEGROUND: <Random phrase from list of phrases> | 11 | VX-GAMBLEGROUND: <Random phrase from list of phrases> |
| 33 | ======================================================== (End Window 1) (Takes up space between top & bottom windows) | 12 | ======================================================== (End Window 1) (Takes up space between top & bottom windows) |
| @@ -54,7 +33,50 @@ SLOTS HERE | |||
| 54 | #include <stdio.h> | 33 | #include <stdio.h> |
| 55 | #include <stdlib.h> | 34 | #include <stdlib.h> |
| 56 | 35 | ||
| 57 | #define STATIC_ARRSIZE(arr) (sizeof((arr)) / sizeof((arr)[0])) | 36 | static const char *phrases[] = { |
| 37 | // By @syxhe on telegram | ||
| 38 | "WE CLOWN IN THIS MF, TAKE YO SENSITIVE ASS BACK TO @GENTOOMEMES", | ||
| 39 | "R.I.P VxHeaven", | ||
| 40 | "tmp(2) nuked by Smelly", | ||
| 41 | "99% of Randomware Operators quit before compromising a bank", | ||
| 42 | "Equation Group wuz here", | ||
| 43 | "Lazarus wuz here", | ||
| 44 | "LockBit wuz here", | ||
| 45 | "Sponsored by Equation Group", | ||
| 46 | "Sponsored by Lazarus", | ||
| 47 | "Sponsored by LockBit", | ||
| 48 | "Free my boy Ross Ulbricht he did nothing wrong", | ||
| 49 | "Stay off the dark web, kids", | ||
| 50 | "FREE BITCOIN JUST 3 SPINS AWAY", | ||
| 51 | "We all glow in the dark", | ||
| 52 | "Shoutouts to Simpleflips", | ||
| 53 | "Shoutouts to BugHunter", | ||
| 54 | "Shoutouts to EyeDeeKay", | ||
| 55 | ":beecat:", | ||
| 56 | ":3", | ||
| 57 | "You think Jack Rhysider will interview me now?", | ||
| 58 | "Check out \"Darknet Diaries\"", | ||
| 59 | |||
| 60 | // by @danielsprofile on telegram | ||
| 61 | "Daniel Spears loves femboys", | ||
| 62 | "LizardSquad > Razer", | ||
| 63 | "Sponsored by Major League Gaming", | ||
| 64 | "Sponsored by LemonParty.org", | ||
| 65 | "Sponsored by FTX", | ||
| 66 | "RIP Harambe", | ||
| 67 | "Shoutout Elliot Alderson", | ||
| 68 | "Ted Kaczynski was right", | ||
| 69 | "The FBI watches me jerk off to MILFs lol", | ||
| 70 | "robux generator free online 2024 100% working undetected", | ||
| 71 | "Doge wuz here", | ||
| 72 | "We like Fortnite we like Fortnite", | ||
| 73 | "We live in a society", | ||
| 74 | "Hab you seen a alien pls?", | ||
| 75 | "using a flipperzero makes me an APT, right?", | ||
| 76 | "Subscribe to PewDiePie", | ||
| 77 | |||
| 78 | NULL | ||
| 79 | }; | ||
| 58 | 80 | ||
| 59 | static const char *menu_choices[] = { | 81 | static const char *menu_choices[] = { |
| 60 | "Spin", | 82 | "Spin", |
| @@ -63,6 +85,19 @@ static const char *menu_choices[] = { | |||
| 63 | NULL | 85 | NULL |
| 64 | }; | 86 | }; |
| 65 | 87 | ||
| 88 | static float normalize(float value, float oldmin, float oldmax, float newmin, float newmax) { | ||
| 89 | // x(normal) = (b - a) * ((x - x(min)) / (max x - min x)) + a, where [a, b] is the new range | ||
| 90 | return (newmax - newmin) * ((value - oldmin) / (oldmax - oldmin)) + newmin; | ||
| 91 | } | ||
| 92 | |||
| 93 | static int init_rgb_color(int colornum, int red, int green, int blue) { | ||
| 94 | int nred = normalize(red, RGB_MIN, RGB_MAX, CURSESCOLOR_MIN, CURSESCOLOR_MAX); | ||
| 95 | int ngreen = normalize(green, RGB_MIN, RGB_MAX, CURSESCOLOR_MIN, CURSESCOLOR_MAX); | ||
| 96 | int nblue = normalize(blue, RGB_MIN, RGB_MAX, CURSESCOLOR_MIN, CURSESCOLOR_MAX); | ||
| 97 | |||
| 98 | return init_color(colornum, nred, ngreen, nblue); | ||
| 99 | } | ||
| 100 | |||
| 66 | int main() { | 101 | int main() { |
| 67 | if(setlocale(LC_ALL, "") == NULL) // Clear out the locale so it doesn't default to ncurses' ISO-8859-1 setting | 102 | if(setlocale(LC_ALL, "") == NULL) // Clear out the locale so it doesn't default to ncurses' ISO-8859-1 setting |
| 68 | error(1, errno, "Could not set proper locale"); | 103 | error(1, errno, "Could not set proper locale"); |
| @@ -70,12 +105,21 @@ int main() { | |||
| 70 | if(initscr() == NULL) // Initialize curses | 105 | if(initscr() == NULL) // Initialize curses |
| 71 | error(1, errno, "Could not init standard screen"); | 106 | error(1, errno, "Could not init standard screen"); |
| 72 | 107 | ||
| 73 | if(has_colors()) { // Init colors if available & create color pairings | 108 | if(has_colors() && can_change_color()) { // Init colors if available & create color pairings |
| 74 | start_color(); | 109 | start_color(); |
| 75 | 110 | ||
| 76 | // Init colors here | 111 | // Init colors here |
| 77 | 112 | // TODO: FIGURE OUT WHY COLORS ARE SO FUCKEY | |
| 78 | //init_color(); | 113 | init_rgb_color(CC_RED, 255, 0, 0); |
| 114 | init_rgb_color(CC_ORANGE, 255, 128, 0); | ||
| 115 | init_rgb_color(CC_YELLOW, 255, 255, 0); | ||
| 116 | init_rgb_color(CC_GREEN, 0, 255, 0); | ||
| 117 | init_rgb_color(CC_BLUE, 0, 0, 255); | ||
| 118 | init_rgb_color(CC_PURPLE, 255, 0, 255); | ||
| 119 | init_rgb_color(CC_WHITE, 255, 255, 255); | ||
| 120 | |||
| 121 | init_pair(1, CC_WHITE, CURSES_BLUE); | ||
| 122 | |||
| 79 | } | 123 | } |
| 80 | 124 | ||
| 81 | cbreak(); // Disables character buffering | 125 | cbreak(); // Disables character buffering |
| @@ -130,7 +174,20 @@ int main() { | |||
| 130 | free_menu(menu); | 174 | free_menu(menu); |
| 131 | //*/ | 175 | //*/ |
| 132 | 176 | ||
| 177 | // Making this a subwindow of stdscr might be a good idea (maybe) | ||
| 178 | int height = 1; | ||
| 179 | int width = col; | ||
| 180 | int starty = 0; /* Calculating for a center placement */ | ||
| 181 | int startx = 0; /* of the window */ | ||
| 182 | |||
| 183 | WINDOW *phrase = NULL; | ||
| 184 | phrase = newwin(height, width, starty, startx); | ||
| 185 | wbkgd(phrase, COLOR_PAIR(1)); | ||
| 186 | mvwaddstr(phrase, 0, 1, "VX-GAMBLEGROUND: "); | ||
| 187 | waddstr(phrase, phrases[1]); | ||
| 188 | wrefresh(phrase); | ||
| 133 | 189 | ||
| 190 | wgetch(phrase); | ||
| 134 | 191 | ||
| 135 | endwin(); // Clean up curses | 192 | endwin(); // Clean up curses |
| 136 | return 0; | 193 | return 0; |
