summaryrefslogtreecommitdiff
path: root/magies.c
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-01-07 13:06:57 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-01-07 13:06:57 +0100
commitf4dee994b5f9019d805328d1019b4456f6bb4b2d (patch)
tree08bf5258c69a539380cefb2fa697b770efaa43f3 /magies.c
parente984a172127c3d13ac85c29511c68784ca43984c (diff)
game: added vim key bindings to UP/DOWN/LEFT/RIGHT
h/j/k/l are mapped to behave like arrow keys so that the navigation is easier in the menus. F and A are respectiverly used to validate and cancel as well. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'magies.c')
-rw-r--r--magies.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/magies.c b/magies.c
index 35d2b00..8d0460d 100644
--- a/magies.c
+++ b/magies.c
@@ -30,6 +30,7 @@ int Fmagieelement (SURFACES *surfaces,POSITIONS *positions,PERSONNAGES persos[],
switch (event.key.keysym.sym)
{
case SDLK_ESCAPE:
+ case SDLK_a:
continuer = 0;
if(clan==ENNEMI)
{
@@ -42,6 +43,7 @@ int Fmagieelement (SURFACES *surfaces,POSITIONS *positions,PERSONNAGES persos[],
break;
SELECTION_CIBLE()
case SDLK_RETURN:
+ case SDLK_f:
continuer=0;
max=Fcalculerdegats(persos,Vtourallie,&min,ennemis,selection,clan,TYPE_MAGIE);
degats=(rand()%(max-min+1))+min;
@@ -151,6 +153,7 @@ int Fmagiesoin(SURFACES *surfaces,POSITIONS *positions,PERSONNAGES persos[],int
switch(event.key.keysym.sym)
{
case SDLK_ESCAPE:
+ case SDLK_a:
continuer = 0;
if(clan==ENNEMI)
{
@@ -163,6 +166,7 @@ int Fmagiesoin(SURFACES *surfaces,POSITIONS *positions,PERSONNAGES persos[],int
break;
SELECTION_CIBLE()
case SDLK_RETURN:
+ case SDLK_f:
max=Fcalculersoins(persos,Vtourallie,&min,ennemis,selection);
soins=(rand()%(max-min+1))+min;
if(soins<0)