fix title menu
This commit is contained in:
parent
9c91ed8230
commit
cdf99a01ce
2
defs.jor
2
defs.jor
|
@ -75,7 +75,7 @@
|
|||
>r dup r@ @ <= if
|
||||
drop 0 r@ !
|
||||
else r@ @ 0 < if
|
||||
r@ !
|
||||
1 - r@ !
|
||||
else drop then then rdrop ;
|
||||
|
||||
: +!cycle ( n var lim -- )
|
||||
|
|
BIN
entity.jim
BIN
entity.jim
Binary file not shown.
BIN
footer.jim
BIN
footer.jim
Binary file not shown.
BIN
lev00001.jim
BIN
lev00001.jim
Binary file not shown.
BIN
lev00002.jim
Executable file
BIN
lev00002.jim
Executable file
Binary file not shown.
BIN
lev00003.jim
Executable file
BIN
lev00003.jim
Executable file
Binary file not shown.
BIN
lev00004.jim
Executable file
BIN
lev00004.jim
Executable file
Binary file not shown.
BIN
lev00005.jim
Executable file
BIN
lev00005.jim
Executable file
Binary file not shown.
BIN
neuttowr.exe
BIN
neuttowr.exe
Binary file not shown.
BIN
neuttowr.prj
BIN
neuttowr.prj
Binary file not shown.
13
testbed.c
13
testbed.c
|
@ -357,11 +357,16 @@ void f_textc() { // ( col line c color -- )
|
|||
}
|
||||
|
||||
void f_rawtextc() { // ( offset c color -- )
|
||||
unsigned int color = TOP().u;
|
||||
unsigned int inverse = (~color) & 0x0f;
|
||||
setWriteMode(0);
|
||||
setPlaneColor(TOP().u);
|
||||
DROP(1);
|
||||
text_draw_char(ST1().u, TOP().i, 40);
|
||||
DROP(2);
|
||||
if (inverse) {
|
||||
setPlaneColor(inverse);
|
||||
text_draw_char(ST2().u, ' ', 40);
|
||||
}
|
||||
setPlaneColor(color);
|
||||
text_draw_char(ST2().u, ST1().i, 40);
|
||||
DROP(3);
|
||||
}
|
||||
|
||||
void f_text() { // ( col line s color -- )
|
||||
|
|
18
title.jor
18
title.jor
|
@ -16,25 +16,27 @@
|
|||
|
||||
: strlen ( s -- n ) 0 swap begin dup b@ while 1 + swap 1 + swap repeat drop ;
|
||||
: titles ( s -- ) begin dup b@ dup while titlec 1 + repeat drop drop ;
|
||||
: optionbg ( y -- ) texty ! 20 boxmid -8 texty +! ;
|
||||
: optionbg ( c -- ) dup 10 textx ! titlec 27 textx ! titlec ;
|
||||
: option ( s -- ) dup strlen 1 >> 19 swap - textx ! titles ;
|
||||
|
||||
: startgame ( n -- ) s" title" loadscr s" start.jor" loadjor ;
|
||||
: menu-opts
|
||||
s" New Game" :| 1 startgame |; yield
|
||||
s" Continue" ' noop yield
|
||||
s" Register Today!" ' noop yield
|
||||
s" Help" ' noop yield
|
||||
s" Register" ' noop yield
|
||||
s" Quit" ' quit yield
|
||||
done ;
|
||||
var menu-selected
|
||||
: menu-y ( i -- y ) 10 * 90 + ;
|
||||
: menu-y ( i -- y ) 12 * 90 + ;
|
||||
: draw-menu
|
||||
0 menu-opts each drop
|
||||
over menu-y optionbg
|
||||
over menu-selected @ = if LCYAN else WHITE then text-color !
|
||||
option
|
||||
over menu-y texty !
|
||||
over menu-selected @ = if LGREEN else WHITE then text-color ! option
|
||||
dup menu-selected @ = if 15 else sp then optionbg
|
||||
1 +
|
||||
more drop ;
|
||||
: redraw-menu 21 11 8 72 box draw-menu ;
|
||||
|
||||
: exec-selected 0 menu-opts each swap drop
|
||||
over menu-selected @ = if execute break else drop then
|
||||
|
@ -45,9 +47,7 @@ var menu-selected
|
|||
: menu-select ( di -- ) menu-selected menu-count +!cycle draw-menu ;
|
||||
|
||||
:noname
|
||||
fuck s" title" loadscr
|
||||
20 9 9 72 box
|
||||
draw-menu
|
||||
fuck s" title" loadscr redraw-menu
|
||||
:| ^ENTER key-pressed if exec-selected then
|
||||
^UP key-pressed if -1 menu-select then
|
||||
^DOWN key-pressed if 1 menu-select then
|
||||
|
|
Loading…
Reference in a new issue