mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Added a status bar.
[originally from svn r4174]
This commit is contained in:
23
net.c
23
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user