Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void io_keydetect(void){
- key = getKey();
- if (key){
- uint8_t sel = gamestate.screendata[gamestate.screen_up].selected,
- num_opts = gamestate.screendata[gamestate.screen_up].num_opts;
- switch(gamestate.screen_up){
- case SCRN_SPLASH:
- if ((key == sk_Enter) || (key == sk_2nd)) {
- if (sel == 0) gamestate.screen_up = SCRN_SERVERLIST;
- else if (sel == 1) gamestate.screen_up = SCRN_SETTINGS;
- else exit(EXIT_OK);
- }
- break;
- case SCRN_SERVERLIST:
- {
- break;
- }
- case SCRN_SETTINGS:
- {
- break;
- }
- default:
- if (key == sk_Down) {
- sel++;
- sel %= num_opts;
- } else if (key == sk_Up) {
- sel += (num_opts-1);
- sel %= num_opts;
- } else
- else if (key == sk_Clear) exit(EXIT_OK);
- }
- gamestate.screendata[gamestate.screen_up].selected = sel;
- gamestate.gameflags |= (1<<FRAME_DIRTY);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement