aboutsummaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2004-04-29 19:23:08 +0000
committerSimon Tatham <anakin@pobox.com>2004-04-29 19:23:08 +0000
commita8c8237bd0362e4fe44a451eb81544b451ae4444 (patch)
treec50e8ec0ef03edcdba50cd651076290f657ffa7e /net.c
parentfa7ef572c782c9394f60202d950d3380dfdce5c3 (diff)
downloadpuzzles-a8c8237bd0362e4fe44a451eb81544b451ae4444.zip
puzzles-a8c8237bd0362e4fe44a451eb81544b451ae4444.tar.gz
puzzles-a8c8237bd0362e4fe44a451eb81544b451ae4444.tar.bz2
puzzles-a8c8237bd0362e4fe44a451eb81544b451ae4444.tar.xz
Added a status bar.
[originally from svn r4174]
Diffstat (limited to 'net.c')
-rw-r--r--net.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/net.c b/net.c
index 268fbca..c345ecb 100644
--- a/net.c
+++ b/net.c
@@ -1189,6 +1189,24 @@ void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
}
}
+ /*
+ * Update the status bar.
+ */
+ {
+ char statusbuf[256];
+ int i, n, a;
+
+ n = state->width * state->height;
+ for (i = a = 0; i < n; i++)
+ if (active[i])
+ a++;
+
+ sprintf(statusbuf, "%sActive: %d/%d",
+ (state->completed ? "COMPLETED! " : ""), a, n);
+
+ status_bar(fe, statusbuf);
+ }
+
sfree(active);
}
@@ -1231,3 +1249,8 @@ float game_flash_length(game_state *oldstate, game_state *newstate)
return 0.0F;
}
+
+int game_wants_statusbar(void)
+{
+ return TRUE;
+}