about summary refs log tree commit diff homepage
path: root/client.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2017-08-29 18:33:59 -0400
committerJune McEnroe <june@causal.agency>2017-08-29 18:33:59 -0400
commitaf645c09089d1ed8e99c760f05234ac3df402901 (patch)
tree34d0e446f96cd3c9944b651ad98cf07dfe7a3df7 /client.c
parentAdd respawning (diff)
downloadtorus-af645c09089d1ed8e99c760f05234ac3df402901.tar.gz
torus-af645c09089d1ed8e99c760f05234ac3df402901.zip
Add four additional spawns
Diffstat (limited to '')
-rw-r--r--client.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/client.c b/client.c
index f477602..5a41dbc 100644
--- a/client.c
+++ b/client.c
@@ -65,8 +65,11 @@ static void clientPut(uint8_t color, char cell) {
     clientMessage(&msg);
 }
 
-static void clientSpawn(void) {
-    struct ClientMessage msg = { .type = CLIENT_SPAWN };
+static void clientSpawn(uint8_t spawn) {
+    struct ClientMessage msg = {
+        .type = CLIENT_SPAWN,
+        .data.s.spawn = spawn,
+    };
     clientMessage(&msg);
 }
 
@@ -185,7 +188,7 @@ static void readInput(void) {
         case ESC: mode = MODE_NORMAL; break;
 
         case 'q': endwin(); exit(EX_OK);
-        case 'Q': clientSpawn(); break;
+        case 'Q': clientSpawn(inputColor < SPAWN_COUNT ? inputColor : 0); break;
 
         case 'a': clientMove(1, 0); // fallthrough
         case 'i': insertMode(1, 0); break;
Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe For some reason I haven't been able to figure out, trying to poll /dev/tty returns POLLNVAL (and this was using 100% CPU looping), but using stderr instead works fine. 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe