Improve ergonomy and add in-game short help

This commit is contained in:
Shadow15510 2022-01-19 21:48:09 +01:00
parent fb5615d018
commit 04f6fe80b4
3 changed files with 25 additions and 8 deletions

View File

@ -108,12 +108,12 @@ int get_inputs(const int background, int *mutation_menu, int *boost)
else if (background == 6) return 1;
}
if (key == KEY_ALPHA)
if (key == KEY_ALPHA || key == KEY_EXIT)
{
if (background == 5) return 3;
if (background == 1 || background == 2) return -1;
else return 1;
}
if (key == KEY_EXIT && (background == 1 || background == 2)) return -1;
if (background == 3)
{
@ -168,5 +168,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

@ -1,7 +1,7 @@
/*
Project name ......: Plague
Version ...........: 1.3.9
Last modification .: 8 June 2021
Version ...........: 1.3.10
Last modification .: 19 January 2022
code and assets provided with licence :
GNU General Public Licence v3.0
@ -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);
@ -77,6 +77,23 @@ int main(void)
gint_world_switch(GINT_CALL(read_save, (void *)&current_game));
if (current_game.total_time == 0)
{
dclear(C_WHITE);
dtext(10, 1, C_BLACK, "CONTROLES :");
dtext(1, 7, C_BLACK, "[REPLAY]:SELECTIONNER");
dtext(1, 14, C_BLACK, "[SHIFT]:VALIDER");
dtext(1, 21, C_BLACK, "[ALPHA/EXIT]:REVENIR");
dtext(1, 28, C_BLACK, "[VARS]:MUTATIONS");
dtext(1, 35, C_BLACK, "[OPTN]:RECHERCHE+ADN");
dtext(1, 42, C_BLACK, "[X^2]:STATISTIQUES");
dtext(1, 49, C_BLACK, "[->]:MODE RAPIDE");
dupdate();
getkey();
}
int to_save = main_loop(&current_game);
if (to_save) gint_world_switch(GINT_CALL(write_save, (void *)&current_game));

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)
{
end = mutation_buy(current_game, c, mutation_menu, table);
@ -115,7 +115,7 @@ int mutation_buy(struct game *current_game, const struct cursor c, const int mut
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)
{