-
Notifications
You must be signed in to change notification settings - Fork 585
Director and Jukebox Plus Update #2090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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