clarify quit message
This commit is contained in:
parent
9a15a2d5ba
commit
c5bad6bf85
8
main.fs
8
main.fs
|
@ -5,11 +5,11 @@
|
||||||
: hide-cursor esc[ ." ?25l" ;
|
: hide-cursor esc[ ." ?25l" ;
|
||||||
: show-cursor esc[ ." ?25h" ;
|
: show-cursor esc[ ." ?25h" ;
|
||||||
: clear-line esc[ ." K" ;
|
: clear-line esc[ ." K" ;
|
||||||
: move-right ( x -- ) esc[ 0 .R ." C" ;
|
: move-right ( x -- ) esc[ 0 .R ." C" ; \ 0 .R : print a number without trailing space
|
||||||
|
|
||||||
\ some of these values (member cost, device count) have two cells.
|
\ some of these values (member cost, device count) have two cells.
|
||||||
\ the first cell stores the value, the second cell stores if the value has changed.
|
\ the first cell stores the value, the second cell stores if the value has changed.
|
||||||
\ this is useful as it means we only redraw the display if the relevant value has changed.
|
\ this is useful as it means we only redraw the display if a relevant value has changed.
|
||||||
\ the word "changed" sets one of these values as being changed.
|
\ the word "changed" sets one of these values as being changed.
|
||||||
: changed ( addr -- ) 1 cells + -1 swap ! ;
|
: changed ( addr -- ) 1 cells + -1 swap ! ;
|
||||||
\ the word "cleared" sets one of these values as having been used, clearing the change flag.
|
\ the word "cleared" sets one of these values as having been used, clearing the change flag.
|
||||||
|
@ -31,7 +31,7 @@ create membercost 0 , 0 ,
|
||||||
variable membercount
|
variable membercount
|
||||||
|
|
||||||
\ any-change? leaves a -1 on the stack if any value has changed, 0 otherwise
|
\ any-change? leaves a -1 on the stack if any value has changed, 0 otherwise
|
||||||
: any-change? ( -- flag ) membercost changed? devices changed? or ;
|
: any-change? ( -- flag ) membercost changed? devices changed? ;
|
||||||
\ clear-all clears the change flag on all values.
|
\ clear-all clears the change flag on all values.
|
||||||
: clear-all membercost cleared devices cleared ;
|
: clear-all membercost cleared devices cleared ;
|
||||||
\ the word !0= tests if something is non-zero
|
\ the word !0= tests if something is non-zero
|
||||||
|
@ -101,7 +101,7 @@ variable membercount
|
||||||
membercost @ dup !0= if \ if membercost is non-zero (members have been unlocked)
|
membercost @ dup !0= if \ if membercost is non-zero (members have been unlocked)
|
||||||
." (h)ire a chat member [" . ." Devices] (you have " membercount @ . ." chat members helping you)" cr
|
." (h)ire a chat member [" . ." Devices] (you have " membercount @ . ." chat members helping you)" cr
|
||||||
else drop then
|
else drop then
|
||||||
1 move-right ." (q)uit" ;
|
1 move-right ." (q)uit (without saving)" ;
|
||||||
|
|
||||||
\ draw-screen redraws the screen, but only if there's been a change.
|
\ draw-screen redraws the screen, but only if there's been a change.
|
||||||
: draw-screen any-change? if draw-devices draw-actions clear-all then ;
|
: draw-screen any-change? if draw-devices draw-actions clear-all then ;
|
||||||
|
|
Reference in New Issue