List Input with Images

From RPTools Wiki
Revision as of 19:10, 27 December 2008 by Cclouser (talk | contribs) (New page: ==Full Code of List Input With Images Macro== <source lang="mtmacro" line> [H: tokenList=getExposedTokenNames()] [H: imgList = tokenList] [H: Num = listCount(imgList)] [h,COUNT(Num),CODE:...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Full Code of List Input With Images Macro

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

[h,COUNT(Num),CODE:
{
[h:tokenName=listGet(imgList,roll.count)]
[h,token(tokenName): image=getTokenImage()]
[h:imgList=listReplace(imgList,roll.count,tokenName+" "+image)]
}]

[h:status=input(
		"Target|"+imgList+"|Select Target|LIST|SELECT=0 ICON=TRUE ICONSIZE=30",
		"newName| |Enter a new name for this token"
)]
[h:abort(status)]


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

[h:switchToken(targetName)]

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