Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Sheet Worker Scripts: Action Buttons

1545177382
Cassie
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Action buttons were added a bit ago and I have updated the wiki with the documentation, Sheet Worker Scripts 3.1.5 .  <button type="action" name="act_activate">Activate!</button> on("clicked:activate", function() {        console.log("Activate button clicked"); }); I wasn't sure if this was announced so I wanted to let you lovely sheet authors know. :)
1545186367
So, I can have a sheet worker lower a ammo supply, expendable resource, etc. without activating the Aaron symbol?  Interesting....
1545214913
Natha
Forum Champion
Sheet Author
API Scripter
Coal Powered Puppet said: So, I can have a sheet worker lower a ammo supply, expendable resource, etc. without activating the Aaron symbol?  Interesting.... Yes, but note that nothing will be display in the chat so it will be "transparent" except in a diplayed attribute is obviously changed on the sheet.
1545222712
...So there is no way to combine Action buttons and roll buttons (other than API)?  At least, not yet? This doesn't limit theAaron at all...
1545226600
Natha
Forum Champion
Sheet Author
API Scripter
>> ...So there is no way to combine Action buttons and roll buttons (other than API)?  At least, not yet? That's right, there is not.
1547761103
Is there a way for an "on:clicked" event listener to know what repeating section the triggering button was in? It appears that no eventInfo gets passed, so the usual trick for plucking a rowID out of eventInfo.sourceAttribute (which works for on:change) is not an option. (Yes... I understand that there isn't a "sourceAttribute" for a clicked event, but there is a "sourceButton" (whatever it may be called). Can its ID be accessed?
1547766460
GiGs
Pro
Sheet Author
API Scripter
what is your sheet worker doing? If the sheet worker only interacts with its own row, you don't need the id. If you give a snippet of code, we can convert it into an id-less version.
1547770681
Andreas J.
Forum Champion
Sheet Author
Translator
Wow, I missed this update. Gotta see if I'll make some button to reduce ammo count or similar when I reactivate Pro.
1547857502
Cassie
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Greetings Bob O. Can you share a snippit of your code as GiGs suggested? Rather than sourceAttribute, you'll typically use 'eventinfo.triggerName' for action buttons. I have not yet tried to add them to a repeating fields so I don't know the answer off the top of my head.