summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/runscreen.sh2
-rw-r--r--src/screen.c21
-rw-r--r--src/screen.h1
3 files changed, 17 insertions, 7 deletions
diff --git a/src/runscreen.sh b/src/runscreen.sh
index 14dabe5..f0dac47 100755
--- a/src/runscreen.sh
+++ b/src/runscreen.sh
@@ -21,7 +21,7 @@ main() {
21 fi 21 fi
22 22
23 # Run the thing in gnome terminal 23 # Run the thing in gnome terminal
24 gnome-terminal --hide-menubar --geometry=132x24 --wait -- "$SCRIPT_DIR/screen" \ 24 gnome-terminal --hide-menubar --geometry=156x27 --wait -- "$SCRIPT_DIR/screen" \
25 && return $? 25 && return $?
26 26
27} 27}
diff --git a/src/screen.c b/src/screen.c
index d6806ad..85bc031 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -231,7 +231,8 @@ static int init_slotholder(struct slotholder *slots) {
231 const int height = my - 2, width = mx - 2; 231 const int height = my - 2, width = mx - 2;
232 mvwcreate_box(slots->subslot[i], 1, 1, height, width, NULL); 232 mvwcreate_box(slots->subslot[i], 1, 1, height, width, NULL);
233 for(int j = 0; j < 3; j++) { 233 for(int j = 0; j < 3; j++) {
234 mvwcreate_box(slots->subslot[i], 2 + (j * (height / 3)), width / 4, height / 3, width / 2, NULL); 234 slots->slotchar[i][j] = randombytes_uniform('~' - '!' + 1) + '!';
235 mvwcreate_box(slots->subslot[i], 2 + (j * (height / 3)), (width / 4) - 1, height / 3, (width / 2) + 5 /*???????????*/, NULL);
235 } 236 }
236 237
237 wnoutrefresh(slots->subslot[i]); 238 wnoutrefresh(slots->subslot[i]);
@@ -276,7 +277,7 @@ int main() {
276 struct funcholder *p = NULL; // Function pointer used for callbacks in the menu driver 277 struct funcholder *p = NULL; // Function pointer used for callbacks in the menu driver
277 WINDOW *menuholder = NULL; // The window for displaying the menu 278 WINDOW *menuholder = NULL; // The window for displaying the menu
278 int row = -1, col = -1; // The rows and columns of the main screen 279 int row = -1, col = -1; // The rows and columns of the main screen
279 int randomnum; // A random number for getting the banner phrase 280 uint32_t randomnum; // A random number for getting the banner phrase
280 MENU *menu; // The actual menu object 281 MENU *menu; // The actual menu object
281 int c; // Integer for storing keys from user input 282 int c; // Integer for storing keys from user input
282 283
@@ -289,10 +290,6 @@ int main() {
289 } 290 }
290 291
291 randomnum = randombytes_uniform(STATIC_ARRSIZE(phrases)); 292 randomnum = randombytes_uniform(STATIC_ARRSIZE(phrases));
292 if(randomnum < 0) {
293 endwin();
294 error(1, errno, "[VX-GAMBLEGROUND] Call to randombytes_uniform failed, can't get random phrase");
295 }
296 293
297 WINDOW *banner = create_banner(col, randomnum); 294 WINDOW *banner = create_banner(col, randomnum);
298 init_items(items, menu_choices, STATIC_ARRSIZE(menu_choices), userfuncs); 295 init_items(items, menu_choices, STATIC_ARRSIZE(menu_choices), userfuncs);
@@ -405,6 +402,18 @@ int spin(void *spinp) {
405 /* Previous solution fucked it by changing the actual color when it's supposed to be the default color to revert back to 402 /* Previous solution fucked it by changing the actual color when it's supposed to be the default color to revert back to
406 // This works better, but is also more ugly. So be it */ 403 // This works better, but is also more ugly. So be it */
407 wbkgd(p->slots->subslot[subs], COLOR_PAIR(rangemod(CCP_CURSES_DEFAULT, i + CCP_RED, CCP_RED, CCP_WHITE))); 404 wbkgd(p->slots->subslot[subs], COLOR_PAIR(rangemod(CCP_CURSES_DEFAULT, i + CCP_RED, CCP_RED, CCP_WHITE)));
405
406 p->slots->slotchar[subs][2] = p->slots->slotchar[subs][1];
407 p->slots->slotchar[subs][1] = p->slots->slotchar[subs][0];
408 p->slots->slotchar[subs][0] = randombytes_uniform('~' - '!' + 1) + '!';
409
410 // Update characters & draw them
411 int my, mx;
412 getmaxyx(p->slots->subslot[subs], my, mx);
413 for(int j = 0; j < 3; j++) {
414 mvwaddch(p->slots->subslot[subs], 2 + ((my - 2) / 6) + (((my - 2) / 3) * j), (mx - 1) / 2, p->slots->slotchar[subs][j]);
415 }
416
408 wnoutrefresh(p->slots->subslot[subs]); 417 wnoutrefresh(p->slots->subslot[subs]);
409 } 418 }
410 419
diff --git a/src/screen.h b/src/screen.h
index 9ffff20..094aa40 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -74,6 +74,7 @@ struct slotholder {
74 int sloty; 74 int sloty;
75 75
76 WINDOW *subslot[3]; 76 WINDOW *subslot[3];
77 char slotchar[3][3];
77}; 78};
78 79
79struct funcholder { 80struct funcholder {