clicking wip
This commit is contained in:
parent
d4ab9ccd47
commit
598f00bc03
51
kodiak.tal
51
kodiak.tal
|
@ -186,7 +186,7 @@
|
||||||
|
|
||||||
@on-mouse ( -> brk )
|
@on-mouse ( -> brk )
|
||||||
on-move
|
on-move
|
||||||
( on-click-down )
|
on-click-down
|
||||||
( on-click-up )
|
( on-click-up )
|
||||||
.Mouse/state DEI .prev-mouse-state STZ
|
.Mouse/state DEI .prev-mouse-state STZ
|
||||||
BRK
|
BRK
|
||||||
|
@ -201,8 +201,13 @@
|
||||||
.Mouse/x DEI2 .prev-mouse-x LDZ2 NEQ2 ?&redraw
|
.Mouse/x DEI2 .prev-mouse-x LDZ2 NEQ2 ?&redraw
|
||||||
.Mouse/y DEI2 .prev-mouse-y LDZ2 NEQ2 ?&redraw
|
.Mouse/y DEI2 .prev-mouse-y LDZ2 NEQ2 ?&redraw
|
||||||
JMP2r
|
JMP2r
|
||||||
&redraw #00 .Screen/auto DEO
|
&redraw ( #00 .Screen/auto DEO )
|
||||||
clear-prev-mouse draw-curr-mouse JMP2r
|
!draw-mouse
|
||||||
|
( clear-prev-mouse draw-curr-mouse JMP2r )
|
||||||
|
|
||||||
|
@draw-mouse ( -> )
|
||||||
|
#00 .Screen/auto DEO
|
||||||
|
clear-prev-mouse !draw-curr-mouse
|
||||||
|
|
||||||
@clear-prev-mouse ( -> )
|
@clear-prev-mouse ( -> )
|
||||||
.prev-mouse-x LDZ2 .Screen/x DEO2
|
.prev-mouse-x LDZ2 .Screen/x DEO2
|
||||||
|
@ -219,24 +224,36 @@
|
||||||
@on-click-down ( -> )
|
@on-click-down ( -> )
|
||||||
.Mouse/state DEI ( state^ )
|
.Mouse/state DEI ( state^ )
|
||||||
.prev-mouse-state LDZ #ff EOR AND ( down^ )
|
.prev-mouse-state LDZ #ff EOR AND ( down^ )
|
||||||
#01 AND ( TODO: support more than one button )
|
#01 AND ?{ JMP2r } !maybe-select-card
|
||||||
?&click JMP2r ( TODO: check particular button )
|
|
||||||
&click
|
@maybe-select-card ( -> )
|
||||||
( find-mouse-over-card
|
.Mouse/x DEI2 .Mouse/y DEI2
|
||||||
ORAk ?&found POP2 JMP2r
|
maybe-select-stock ?&done
|
||||||
&found
|
&done JMP2r
|
||||||
raise-cards .card-is-held STZ
|
|
||||||
!draw-cards ) JMP2r
|
@top-stock ( -> zp^ )
|
||||||
|
.stock #34 OVR ADD SWP
|
||||||
|
&loop LDZk ?&ok !&done &ok INC GTHk ?&loop &done NIP #01 SUB JMP2r
|
||||||
|
|
||||||
|
@maybe-select-stock ( x* y* -> bool^ )
|
||||||
|
top-stock STH ( [z^] )
|
||||||
|
OVR2 #0008 LTH2 ?&no1 ( x* y* [z^] ; x<8 )
|
||||||
|
SWP2 #0017 GTH2 ?&no2 ( y* [z^] ; x>=16 )
|
||||||
|
#00 STHkr .stock SUB #03 SFT2 ( y* d* [z^] )
|
||||||
|
SWP2 STH2 ( d* [z^ y*] )
|
||||||
|
#0020 ( d* max=32-d* [z^ y*] )
|
||||||
|
#0008 ROT2 SUB2 ( max* min=8-d* [z^ y*] )
|
||||||
|
STH2kr GTH2 ?&no3 ( max* [z^ y*] )
|
||||||
|
STH2r LTH2 ?&no4 ( [z^] )
|
||||||
|
STHr LDZk #80 EOR SWP STZ ( ; z<-z^0x80 )
|
||||||
|
draw-stock #01 JMP2r ( 1^ )
|
||||||
|
&no1 POP2 &no2 POP2 POPr #00 JMP2r ( 0^ )
|
||||||
|
&no3 POP2 POP2r &no4 POPr #00 JMP2r ( 0^ )
|
||||||
|
|
||||||
@on-click-up ( -> )
|
@on-click-up ( -> )
|
||||||
.Mouse/state DEI #ff EOR ( not-state^ )
|
.Mouse/state DEI #ff EOR ( not-state^ )
|
||||||
.prev-mouse-state LDZ AND ( up^ )
|
.prev-mouse-state LDZ AND ( up^ )
|
||||||
#01 AND ( TODO: support more than one button )
|
#01 AND ?{ JMP2r } JMP2r ( TODO: anything to do here? )
|
||||||
?&unclick JMP2r ( TODO: check particular button )
|
|
||||||
&unclick
|
|
||||||
( #00 .card-is-held STZ
|
|
||||||
draw-background draw-cards )
|
|
||||||
JMP2r
|
|
||||||
|
|
||||||
( @on-key ( -> brk )
|
( @on-key ( -> brk )
|
||||||
on-press on-release
|
on-press on-release
|
||||||
|
|
Loading…
Reference in New Issue