Director and Jukebox Plus Update#2090
Conversation
A script for running Theater of the Mind playstyle.
1.0.1 Added min/Max intervals, bug fixes, and simple Director integration.
1.0.1 Added min/Max intervals, bug fixes, and simple Director integration.
aikepah
left a comment
There was a problem hiding this comment.
There's some unused code, but seems fine in general. Found one issue with unescaped double quotes when put in your template literals that prevents users from being able to add handouts or characters when there's a double quote in the name.
| const tracks = findObjs({ _type: 'jukeboxtrack' }).sort((a, b) => a.get('title').localeCompare(b.get('title'))); | ||
|
|
||
| const buildOpts = (objs, labelFn = o => o.get('name')) => | ||
| objs.map(o => `${labelFn(o)},${o.id}`).join('|'); |
There was a problem hiding this comment.
If the object's name contains a double quote, ie: Thomas "Tommy" Boy it will cause the button's href to terminate early. If we escape or replace the " with " here in buildOpts it should avoid this issue.
| objs.map(o => `${labelFn(o)},${o.id}`).join('|'); | |
| objs.map(o => `${labelFn(o).replace(/"/g, """)},${o.id}`).join('|'); |
There was a problem hiding this comment.
Thanks. I'll make those changes. I wasn't too concerned about breaking characters in names, because those even break vanilla macros half the time. I usually suggest to people not to include "control characters" in character and token names for that reason:
"':/(){}[], etc.
And, yeah, there was a lot of iteration on this, and it could use a cleanup sweep for abandoned code. Good catch.
Director, new script to run Theater of the Mind style games
Jukebox Plus update: Added Min/Max intervals to Mix mode, bug and display fixes, and simple Director integration