summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2021-02-26 15:15:34 +0000
committerCameron Katri <me@cameronkatri.com>2021-04-13 15:28:34 -0400
commit52ae241ee1f8584a23f94b47c59eb897b8c761a2 (patch)
tree1582b92f2a29a454f506f30f7e0544abee7a87ad
parenta92dd07897672b9d6ecfb6ab8353cf224a94e1f6 (diff)
downloadbsdgames-darwin-52ae241ee1f8584a23f94b47c59eb897b8c761a2.tar.gz
bsdgames-darwin-52ae241ee1f8584a23f94b47c59eb897b8c761a2.tar.zst
bsdgames-darwin-52ae241ee1f8584a23f94b47c59eb897b8c761a2.zip
cgram: place the 'solved' marker nearer to the text
This way, it cannot be overlooked as easily as before. It also doesn't change the position of the keyboard help text anymore. Only if there is not enough space, the 'solved' marker is put into the bottom line.
-rw-r--r--cgram/cgram.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/cgram/cgram.c b/cgram/cgram.c
index 47222384..87964014 100644
--- a/cgram/cgram.c
+++ b/cgram/cgram.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cgram.c,v 1.15 2021/02/26 14:55:37 rillig Exp $ */
+/* $NetBSD: cgram.c,v 1.16 2021/02/26 15:15:34 rillig Exp $ */
/*-
* Copyright (c) 2013, 2021 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.c,v 1.15 2021/02/26 14:55:37 rillig Exp $");
+__RCSID("$NetBSD: cgram.c,v 1.16 2021/02/26 15:15:34 rillig Exp $");
#endif
#include <assert.h>
@@ -342,13 +342,17 @@ redraw(void)
}
move(LINES - 1, 0);
+ addstr("~ to quit, * to cheat, ^pnfb to move");
+
if (is_solved()) {
+ if (extent_y + 1 - offset_y < LINES - 2)
+ move(extent_y + 1 - offset_y, 0);
+ else
+ addch(' ');
attron(A_BOLD | A_STANDOUT);
addstr("*solved*");
attroff(A_BOLD | A_STANDOUT);
- addch(' ');
}
- addstr("~ to quit, * to cheat, ^pnfb to move");
move(cursor_y - offset_y, cursor_x - offset_x);