git.shiar.nl
/
netris.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
875286b
)
handle key commands in single function
author
Mischa POSLAWSKY
<netris@shiar.org>
Mon, 5 Mar 2007 09:01:07 +0000
(10:01 +0100)
committer
Mischa POSLAWSKY
<netris@shiar.org>
Mon, 5 Mar 2007 09:01:07 +0000
(10:01 +0100)
client.c
patch
|
blob
|
history
diff --git
a/client.c
b/client.c
index 6c45fc3af617b77146c3ebd5e1c3fa896e68ff88..7f589c06551434d91179fbc1077021d203ea83e8 100644
(file)
--- a/
client.c
+++ b/
client.c
@@
-420,7
+420,7
@@
void OneGame(void)
if (!(p = strchr(keyTable, tolower(key)))) return;
key = p - keyTable;
if (!(p = strchr(keyTable, tolower(key)))) return;
key = p - keyTable;
-
bool handle_key
(char key)
+
void handle_keycmd
(char key)
{
switch (key) {
case KT_redraw:
{
switch (key) {
case KT_redraw:
@@
-428,23
+428,18
@@
void OneGame(void)
InitFields();
// ScheduleFullRedraw();
refresh();
InitFields();
// ScheduleFullRedraw();
refresh();
- return
1
;
+ return;
case KT_say:
chatMode = 1;
Messagetype(key, strlen(chatText) - 1, chatText);
case KT_say:
chatMode = 1;
Messagetype(key, strlen(chatText) - 1, chatText);
- return
1
;
+ return;
case KT_quit:
handle_cmd(CT_quit, NULL);
case KT_quit:
handle_cmd(CT_quit, NULL);
- return
1
;
+ return;
case KT_pause:
handle_cmd(CT_pause, NULL);
case KT_pause:
handle_cmd(CT_pause, NULL);
- return 1;
- default:
- return 0;
+ return;
}
}
- }
- // global actions (always possible, even if not playing)
- if (handle_key(key)) return;
if (Players[me].alive <= 0 || paused) return;
// actions only available while actually playing
if (Players[me].alive <= 0 || paused) return;
// actions only available while actually playing
@@
-493,7
+488,8
@@
void OneGame(void)
changed = 1;
break;
}
changed = 1;
break;
}
- return;
+ }
+ handle_keycmd(key);
} //GameKey
int oldPaused = 0;
} //GameKey
int oldPaused = 0;