use mouse to get selection index
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmFgsZ0ACgkQO3+8IhRO Y5hYlQ/+NiW3QQYMhKM9cu8qBvwlYLf9TZod6vLM5/WNPegxbR0mBRLKwepNYgvH NXBfPU2eVn7OGfJZU1NSt7OmiQSHKgEzbzOkOJbf0vRFowQlaJLxhH3WkvPHkU82 ci3PPp4hehchxcpNoVreejiiDDk44qiJZ3L9P5FcMs+IgUEd8l+VRKgub8C0Finu 11gyFkxQ2YH+94N8n3yXECu6rzHwelYI4ZIog3/aiQCpMej8Zap2MHGM09BB0vxI k/O/VIXlY1f/3Vh4UQ9MnWlgNkO7lonGRTomDf5gTLf/9kBl7UlnXmDZgV8cb/3/ AWigrzKCwDdQihbUQ5FqzjJMDnN23zsNN/2bAI9AIzKrJhaTKAuMGLH6s/mfMeWk TD92am7Oo0NMErbfD0GZJIdj7ePztDPVH1RjqxORvXeItMuQOeWU5iMknpEiz3dn J8iPz9ktSJkNcVJEJo7Hqu8PGUju8j1RJkgWhy4Fi+ujHUlI/GV5Ta37cD5DHgv8 lSwAUs3y6vfalT88BY/xCyD96WwjGKhHHKayLwRjsOMDImnpyVtUSwzn5JlCRE2U lOJ8+n/xDGkKYico3STiiYENONmxn6WYx5B5vZeL7vid8bTVnsID+3fsxkCw8746 2jZHT0B72tZtdbZdI5oI2fD2YFG5ajf6wyv/e6w5aV2Ak3mtUWM= =UQi9 -----END PGP SIGNATURE-----
1 files changed,
32 insertions(+),
2 deletions(-)
jump to
M
uxn-client/xrxs.tal
→
uxn-client/xrxs.tal
@@ -51,6 +51,7 @@ @list-elem-offset $1
@list-elem $32 @list-top $1 @list-height $1 +@select-index $1 @cart $32 @realm $32@@ -141,7 +142,8 @@ ;cartlist .File/name DEO2
#2000 .File/length DEO2 ;listbuf .File/load DEO2 .File/success DEI2 .list-len STZ2 - INC .state STZ BRK + INC .state STZ + ;get-select-idx-by-mouse .Mouse/vector DEO2 BRK &keep-state POP BRK@@ -437,7 +439,7 @@ ;shouldnt-draw-word JSR2 ,&no-draw JCN
[ ;word .Screen/x DEI2 .Screen/y DEI2 - #02 ] ;draw-string JSR2 + ;get-entry-color JSR2 ] ;draw-string JSR2 #0040 .Screen/x DEO2 &no-draw .list-offset LDZ INC .list-offset STZ@@ -450,6 +452,34 @@ #00 .list-elem-offset STZ
&continue INC2 ,&while JMP &end POP2 POP2 RTN + +@get-entry-color ( -- colorByte ) + + .list-offset LDZ + .select-index LDZ + + NEQ ,&normal JCN + + ( selected ) + #0c RTN + &normal + #02 +RTN + +@get-select-idx-by-mouse ( -> ) + + .Mouse/x DEI2 #0040 LTH2 ,&done JCN + .Mouse/x DEI2 .Screen/width DEI2 #0040 SUB2 GTH2 ,&done JCN + + .Mouse/y DEI2 #0028 LTH2 ,&done JCN + .Mouse/y DEI2 .Screen/height DEI2 #0028 SUB2 GTH2 ,&done JCN + + .Mouse/y DEI2 #0028 SUB2 8// TOB .list-top LDZ ADD .select-index STZ + BRK + + &done + #ff .select-index STZ +BRK ( constants ) @spritesheet "xrxs.chr 00