Advertisement
AnthonyCagliano

Untitled

Nov 5th, 2022
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. void io_keydetect(void){
  2. key = getKey();
  3. if (key){
  4. uint8_t sel = gamestate.screendata[gamestate.screen_up].selected,
  5. num_opts = gamestate.screendata[gamestate.screen_up].num_opts;
  6. bool _skip = false;
  7. switch(gamestate.screen_up){
  8. case SCRN_SPLASH:
  9. if ((key == sk_Enter) || (key == sk_2nd)) {
  10. if (sel == 0) gamestate.screen_up = SCRN_SERVERLIST;
  11. else if (sel == 1) gamestate.screen_up = SCRN_SETTINGS;
  12. else exit(EXIT_OK);
  13. }
  14. _skip = true;
  15. case SCRN_SERVERLIST:
  16. if(!_skip){
  17. //placehold
  18. }
  19. case SCRN_SETTINGS:
  20. if{!_skip){
  21. //placehold
  22. }
  23. default:
  24. if (key == sk_Down) {
  25. sel++;
  26. sel %= num_opts;
  27. } else if (key == sk_Up) {
  28. sel += (num_opts-1);
  29. sel %= num_opts;
  30. } else
  31. else if (key == sk_Clear) exit(EXIT_OK);
  32. }
  33. gamestate.screendata[gamestate.screen_up].selected = sel;
  34. gamestate.gameflags |= (1<<FRAME_DIRTY);
  35. }
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement