19 lines
512 B
Markdown
19 lines
512 B
Markdown
|
# how to render lists
|
||
|
|
||
|
1. start at top of list area
|
||
|
2. seek until ;list-offset \n have been read
|
||
|
3. drawstr until \n (if y index is hihglihgt index, draw highlighted)
|
||
|
4. increment y and reset x
|
||
|
5. if y > height/8 - 80, break
|
||
|
|
||
|
# how to highlight list elements
|
||
|
|
||
|
1. if .Mouse/x > 64 && < width - 64 && .Mouse/y > 40 && < height - 40
|
||
|
2. index = ((.Mouse/y - 40)/8) + ;list-offset
|
||
|
|
||
|
# on click
|
||
|
|
||
|
1. take highlight index
|
||
|
2. seek listbuf until as many \n have been read
|
||
|
3. read until next \n into loadcmdbuf + len(load )
|