List Input with Images

From RPTools Wiki
Jump to navigation Jump to search

The following is the full code for the Creating a List Input with Names and Images tutorial.

[H: tokenList=getExposedTokenNames()]
[H: imgList = tokenList]

[H: Num = listCount(imgList)]

[h,token(tokenName): image=getTokenImage()]
[h:imgList=listReplace(imgList,roll.count,tokenName+" "+image)]

    "Target|"+imgList+"|Select Target|LIST|SELECT=0 ICON=TRUE ICONSIZE=30",
    "newName| |Enter a new name for this token"

[h:targetName = listGet(tokenList,Target)]


The token's name has been changed to <i>[r:newName]</i>.