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

[Help] Checkboxes in Chat Menu?

1670488837
Julexar
Pro
API Scripter
Hey, I have a rather simple question to which I couldn't find an answer so far: Is it possible to use checkboxes in Chat Menus? More specifically, I want to use it for quickly enabling/disabling certain features of my Script. I don't know if such a thing is possible or how one would read a value from the checkbox. Any Help is very much appreciated ^^
1670488990
Julexar
Pro
API Scripter
I am not talking about checkboxes from character sheets. I specifically want to send a Menu in the Chat that contains checkboxes, that upon toggling change values in the Script
1670490246
GiGs
Pro
Sheet Author
API Scripter
It's not possible to do what you want. You can create chat buttons in chat, which then launch a script to change a value and adds a new entry to chat: see how many scripts handle configuration options. But you can't add checkboxes. The script's CSS could have the chat menu appear to look like a checkbox, but it isn't really one.
1670511758
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Basically, all buttons can do in chat is issue a string to the chat input. In order to get something to behave like a checkbox, it would need to send a message to the script moderator to rebuild the chat menu with the button toggled to an on state. I.e. a second chat menu.
1670516970
timmaugh
Forum Champion
API Scripter
That said, you could build your interface not as a chat menu but as a handout interface, and you can redraw your handout ad hoc if the user clicks on a "checkbox" (which would really be an <a> tag link reference sending a command through the chat). You'd have to account for circumstances a UI doesn't normally have to account for -- like users getting behind the scenes and editing the interface. So you might have to double-check that the property-that-is-about-to-be-set is of a value that is accurately represented by the state of your "checkbox" and will actually be changed by the command the "checkbox" is about to issue. If it isn't, report that fact and give the user the ability to rebuild the interface so that it accurately represents the configuration of your script. I used a handout interface for my TableToTable script, if you wanted to see some of the code I used, or you can see the interface in action in the series of videos I made demonstrating the script.
1670574530
Julexar
Pro
API Scripter
timmaugh said: That said, you could build your interface not as a chat menu but as a handout interface, and you can redraw your handout ad hoc if the user clicks on a "checkbox" (which would really be an <a> tag link reference sending a command through the chat). You'd have to account for circumstances a UI doesn't normally have to account for -- like users getting behind the scenes and editing the interface. So you might have to double-check that the property-that-is-about-to-be-set is of a value that is accurately represented by the state of your "checkbox" and will actually be changed by the command the "checkbox" is about to issue. If it isn't, report that fact and give the user the ability to rebuild the interface so that it accurately represents the configuration of your script. I used a handout interface for my TableToTable script, if you wanted to see some of the code I used, or you can see the interface in action in the series of videos I made demonstrating the script. Thank you, I will most definitely check it out. It's a bit sad that it's not entirely possible to do it the way I hoped though.