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

[Library] psGui

1487072008

Edited 1487092086
plexsoup
Marketplace Creator
Sheet Author
API Scripter
Not sure if anyone else needs/wants this, but I was getting tired of constantly writing buttons, input prompts, help files, input handlers, etc. So I made a little GUI library to streamline it. Here's the first beta release. <a href="https://github.com/plexsoup/roll20-api-scripts/blo" rel="nofollow">https://github.com/plexsoup/roll20-api-scripts/blo</a>... Some sample button styles: To use it, include it in your script and make a list of new psGUI.userCommand Then register the list with psGUI.RegisterUserCommands. And build helpfiles with psGUI.BuildHelpFiles. var newUserCommands = []; var myCommand = new psGUI.userCommand; myCommand.listener = "!moduleName"; myCommand.commandName = "--commandName"; myCommand.functionToCall = function(parameter1, parameter2, ... ) { blah blah blah }; myCommand.parameters = ["paramType1", "paramType2", ..."paramTypeN"]; // "string", "num", "token_id", "page_id", "character_id", "imgsrc", "current_page_id" myCommand.shortDesc = "Button Name"; myCommand.longDesc = "This is the Helpfile blurb for the command."; myCommand.inputOverrides = ["foo", "bar"] // eg: normally a parameter of type "string" will present the player with an input window. If you don't want that dialog, put values in inputOverrides. myCommand.group = "Section title"; myCommand.style = "buttonstyle" // aqua, material, neon, fantasy newUserCommands.push(myCommand); psGUI.RegisterUserCommands(newUserCommands); psGUI.BuildHelpFiles(newUserCommands); Let me know if anything breaks, if you have any requests, or if anything just looks weird.
I just don't include help files and menus. :D &nbsp;This is cool though.
1487084520
The Aaron
Pro
API Scripter
Wow Plex, nice!