Merge pull request from ericrosenbaum/bugfix/video-state

Import and store video state
This commit is contained in:
Eric Rosenbaum 2018-04-04 19:59:14 -04:00 committed by GitHub
commit 21ae14c499
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 3 deletions
src/serialization

View file

@ -341,6 +341,18 @@ const parseScratchObject = function (object, runtime, extensions, topLevel) {
if (object.hasOwnProperty('tempoBPM')) {
target.tempo = object.tempoBPM;
}
if (object.hasOwnProperty('videoAlpha')) {
// SB2 stores alpha as opacity, where 1.0 is opaque.
// We convert to a percentage, and invert it so 100% is full transparency.
target.videoTransparency = 100 - (100 * object.videoAlpha);
}
if (object.hasOwnProperty('info')) {
if (object.info.hasOwnProperty('videoOn')) {
if (object.info.videoOn) {
target.videoState = RenderedTarget.VIDEO_STATE.ON;
}
}
}
target.isStage = topLevel;