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

How to create alert on sheet open?

I'm working on a major overhaul for the skills in the BattleTech - A Time of War character sheet, which includes some attribute renaming. As such, I'm going to write a function to migrate the data, but I'm not confident I can migrate everything successfully, as I'll be going from user-typed values to fixed values. If a user has made a typo... well, that data probably won't migrate. Also, considering the skills are part of a repeating section, you can't simply go to the attributes tab to see what all your old values were. With that in mind, I wanted to add in some kind of alert/notification to users of this sheet, giving them at least a few weeks' notice of this change, so that they can make a backup record of all their skills, in case the migration doesn't properly migrate all their data. My initial thought was to use the standard JavaScript alert function on sheet open, but through testing and debugging, it seems I don't have access to that function from within the sheet worker sandbox. As such, is there a way to produce some kind of alert or something on sheet open? My fallback plan is to add some text to the top of the skills section warning people about the change, but I'd prefer some kind of pop up that requires active intervention to dismiss, in order to try and ensure that everyone who uses this sheet will be made aware of the upcoming change.
1555480019
GiGs
Pro
Sheet Author
API Scripter
There's no way to do an alert like this with a sheet worker. You have discovered the only way to do this: add a message on the character sheet itself. You can use CSS and a config attribute to create a popup notification-like effect. For instance, you could have a div which is above the character sheet (z-order), which shows on first launch, which has a message and a button. it gets hidden when the user clicks a button to acknowledge reading it. Or you could make it more subtle, just add a simple label describing the situation, at the top of the character sheet, and either leave it there or have a button to hide it.
Yeah ok, maybe a label with a button to hide it. I was hoping for a pop up but alas, it is not to be.