Review ergonomy

This commit is contained in:
Shadow15510 2022-01-19 21:06:16 +01:00
parent 838b80bd14
commit 74fdeb71a1
3 changed files with 8 additions and 8 deletions

View File

@ -100,12 +100,12 @@ int get_inputs(const int background, int *mutation_menu, int *boost)
return 2;
}
if (key == KEY_ALPHA)
if (key == KEY_ALPHA || key == KEY_EXIT)
{
if (background == 4) return 2;
if (background == 1) return -1;
else return 1;
}
if (key == KEY_EXIT && background == 1) return -1;
if (background == 2)
{
@ -141,7 +141,7 @@ int rtc_key(void)
int timeout = 1;
key_event_t ev = getkey_opt(opt, &timeout);
if(ev.type == KEYEV_NONE) return 0;
if (ev.type == KEYEV_NONE) return 0;
return ev.key;
}
@ -160,5 +160,5 @@ void message(char *msg)
key_event_t ev = {0};
display_message(msg);
while (ev.key != KEY_ALPHA) ev = getkey_opt(opt, NULL);
while (ev.key != KEY_ALPHA && ev.key != KEY_EXIT) ev = getkey_opt(opt, NULL);
}

View File

@ -20,7 +20,7 @@
#include "mutation_engine.h"
#include "save.h"
const char *VERSION = "1.3.9";
const char *VERSION = "1.3.10";
// title_screen : display the title screen
static void title_screen(void);

View File

@ -76,7 +76,7 @@ void mutation_select(struct game *current_game, const int mutation_menu)
if (key) {tick = 1; c.display = 1;}
// Manage input
if (key == KEY_ALPHA) end = 1;
if (key == KEY_ALPHA || key == KEY_EXIT) end = 1;
if (key == KEY_SHIFT && table[c.y][c.x] != 15 && table[c.y][c.x] != 0)
{
mutation_buy(current_game, c, mutation_menu, table);
@ -111,11 +111,11 @@ void mutation_buy(struct game *current_game, const struct cursor c, const int mu
key = ev.key;
if (key == KEY_DOWN || key == KEY_UP) button_selected = (button_selected + 1) % 2;
if (key == KEY_ALPHA) break;
if (key == KEY_ALPHA || key == KEY_EXIT) break;
if (key == KEY_OPTN)
{
display_mutation_description(mutation_data->name, mutation_data->description, mutation_menu, id);
while (ev.key != KEY_ALPHA) ev = getkey_opt(opt, NULL);
while (ev.key != KEY_ALPHA && ev.key != KEY_EXIT) ev = getkey_opt(opt, NULL);
}
if (key == KEY_SHIFT)
{