Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Specialised function that serves as a simple yet complex list selector that uses a slider scroll to utilise its full length.
- // Usage: /guiscrolllist <height> <width> $<list> <*1 looplist button action> <*2 sidepane extras> <index var> <selection var>
- // *1) Use like you normally would, but CRITICALLY avoid using the (format) function. The following are used as substitutes:
- // %1: list content, %2: index var content, %3: selection var content, %4: looplist var content.
- // *2) Extra stuff to be placed on the right side of the pagelist. Independent section, format freely.
- guiscrolllist = [
- guilist [
- if (!=s $arg5 "") [
- guilist [arg5]
- guibar
- ]
- guilist [
- guistrut (- $arg2 3) 1
- looplist s (sublist $arg3 $$arg6 $arg1) [
- if (=s (concatword "^f7" $s) $guirollovername) [$arg7 = $s]
- guibutton (format "^f7%1%2" (? (=s $$arg7 $s) "^f6") $s) (
- format $arg4 $arg3 $$arg6 $$arg7 $s
- ) cube
- ]
- ]
- guistrut 1
- guislider $arg6 0 (max (- (listlen $arg3) $arg1) 0)
- ]
- ]
- // ---- GRAPHICAL EXAMPLE ----
- newgui test [
- guiscrolllist 10 32 $list [
- say "%4"
- ] [
- guiimage "smileyface" [] 4 0 "data/cube.png"
- ] "indexvar" "selvar"
- ]
Advertisement
Add Comment
Please, Sign In to add comment