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

Change the view on the sidebar

1658110215
Jiboux
Pro
Sheet Author
Compendium Curator
Hello all, I am currently working on compendium integration for a sheet with a custom sheet and a related API. When an inventory item is dropped on a sheet, the sheetworker sends a message to the API informing it of the drop, and of the monetary value of teh  that in return will post a message to the chat "attempting to buy {itemName} for {Cost} silver pieces. Do you want to confirm ?} and a button [Record Transaction] that would decrese the amount of silver pieces owned by the character. It works, BUT, users will certainly miss this feature, because by design, the chat button will appear in the chat, and by design the situation where it happens is one where the sidebar is set on the compendium. Is there a way for the API to change the view for this specific player, and change the sidebar to the chat ? I didn't see any corresponding property for the Player Object
1658126019
The Aaron
Roll20 Production Team
API Scripter
There isn't a way to do that with mod scripts. 
1658152278
Jiboux
Pro
Sheet Author
Compendium Curator
Thanks ! At least I can stop searching ;)
1658154830

Edited 1658154889
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Also, just double checking, your sheetworker is doing all this, not an API script right? And, with custom roll parsing, you could trigger a roll query to pop up with the prompt and yes/no options instead of the button in chat.
1658155431
Jiboux
Pro
Sheet Author
Compendium Curator
Currently it is a mic between the API and sheetworker. Sheetworker receives the compendium drop and processes it. When it detects the appropriate category and a cost, it sends a "message" to the API (we have a paired API and sheetworker, that communicate via 2 attributes APIflag and SWflag) API processes the cost request and posts the button... Until now, (maybe we didn't update our knowledge after the release of some new developments) we always considered that anything that needed a chat interaction had to go through the API.. If I understand you correct, there is a certain custom roll parsing that we could use to be able to prompt the user for a yes/no confirmation ? That would be in fact better because it avoids the communication API/sheetworker and gives a better functionality for non-pro users. I'll look into it, but if you have any pointers (example or article in the wiki) would be greatly appreciated !
1658155905

Edited 1658155948
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
The wiki on it is pretty up to date and includes links to relevant posts. I'll also point out that it currently sounds like the API is required for drag and drop to work, which would prevent this from being part of the repo. <a href="https://wiki.roll20.net/Custom_Roll_Parsing" rel="nofollow">https://wiki.roll20.net/Custom_Roll_Parsing</a>
1658194623
Jiboux
Pro
Sheet Author
Compendium Curator
Thanks Scott, Just to clarify, API would only be necessary for accounting the cost of an item following a drag and drop... Which is only one of the many things that happen on a drag and drop.
1658265663
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, gotcha. I'd bet that you can do all of that with custom roll parsing instead of requiring an API for it.