I use two following macros and come up with 32 image buttons in a grid (6x6)
Spoiler
Code: Select all
[h, MACRO("getTTImages@Lib:DQ"):""]
<html>
<form>
[h: num = 1]
<table border = "1" align = "center" style="background-color:yellow;">
[r,count(6,""),code:
{
<tr>
[r, for(i,1,6,1,""), code:{
[h: tokenName = listGet(macro.return, num)]
[r: button = strformat('<td><input type="image" src="%s" name="btnChoice" value="TreasureValue"></td>',getImage(tokenName))]
[h: num = num +1]
} ]
</tr>
}]
</table>
</form>
</html>
Spoiler
Code: Select all
[h: ttDeck = getLibProperty("DECK_TT", "Lib:DQ")]
[h: tokenNameList = ""]
[h: deckCount = listCount(ttDeck)]
[r, for(i,1,deckCount +1,1,""), code:{
[h: tokenName = "image:Treasure_Token_" + i]
[h: tokenNameList = listAppend(tokenNameList, tokenName)]
}]
[h: treasureTokenImages = json.fromList(tokenNameList)]
[h: newTreasureTokenImages = json.shuffle(treasureTokenImages)]
[r: macro.return = newTreasureTokenImages]
Is there anything I can do to speed this process up?