Advertisement
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 pages to utilise its full length.
- // Usage: /amp_gen_pagelist <height> <width> $<*1 paged list> <*2 looplist button action> <*3 sidepane extras> <page var> <selection var>
- // *1) Requires a list formatted like this: list = ["text more what" "something else huh" "i'm the best"]
- // *2) Use like you normally would, but CRITICALLY avoid using the (format) function. The following are used as substitutes:
- // %1: paged list content, %2: page var content, %3: selection var content, %4: looplist var content.
- // *3) Extra stuff to be placed on the right side of the pagelist. Independent section, format freely.
- guipagelist = [
- guilist [
- guistrut $arg1 1
- guilist [
- guistrut $arg2 1
- guilist [
- guibutton "" [
- @arg6 = (max 0 (- $@arg6 1))
- ] left
- guispring
- guitext (format "^f2%1 / %2" (+ $$arg6 1) (listlen $arg3)) 0
- guispring
- guibutton "" [
- @arg6 = (min (- (listlen [@@arg3]) 1) (+ $@arg6 1))
- ] right
- ]
- guibar
- looplist a (at $arg3 $$arg6) [
- if (=s (concatword "^f7" $a) $guirollovername) [$arg7 = $a]
- guibutton (format "^f7%1%2" (? (=s $$arg7 $a) "^f6") $a) (
- format $arg4 $arg3 $$arg6 $$arg7 $a
- ) cube
- ]
- ]
- guibar
- guilist [arg5]
- ]
- ]
- // ---- GRAPHICAL EXAMPLE ----
- newgui test [
- guipagelist 10 32 $pagedlist [
- say "%4"
- ] [
- guiimage "smileyface" [] 4 0 "data/cube.png"
- ] "pagevar" "selvar"
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement