Skip to content

Commit

Permalink
Include SimInfo data when for recordings (omitted in API generation),…
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jun 18, 2021
1 parent 17645a7 commit d95fa57
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions js/SimInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Tandem from '../../tandem/js/Tandem.js';
import ArrayIO from '../../tandem/js/types/ArrayIO.js';
import IOType from '../../tandem/js/types/IOType.js';
import NullableIO from '../../tandem/js/types/NullableIO.js';
import NumberIO from '../../tandem/js/types/NumberIO.js';
import ObjectLiteralIO from '../../tandem/js/types/ObjectLiteralIO.js';
import StringIO from '../../tandem/js/types/StringIO.js';
import joist from './joist.js';
Expand Down Expand Up @@ -123,7 +124,14 @@ SimInfo.SimInfoIO = new IOType( 'SimInfoIO', {
screenPropertyValue: simInfo.info.screenPropertyValue,
wrapperMetadata: simInfo.info.wrapperMetadata,
dataStreamVersion: simInfo.info.dataStreamVersion,
phetioCommandProcessorProtocol: simInfo.info.phetioCommandProcessorProtocol
phetioCommandProcessorProtocol: simInfo.info.phetioCommandProcessorProtocol,

randomSeed: Tandem.API_GENERATION ? null : window.phet.chipper.queryParameters.randomSeed,
url: Tandem.API_GENERATION ? null : window.location.href,
userAgent: Tandem.API_GENERATION ? null : window.navigator.userAgent,
window: Tandem.API_GENERATION ? null : `${window.innerWidth}x${window.innerHeight}`,
referrer: Tandem.API_GENERATION ? null : document.referrer,
flags: Tandem.API_GENERATION ? null : simInfo.flags || null
};
},
stateSchema: {
Expand All @@ -135,7 +143,15 @@ SimInfo.SimInfoIO = new IOType( 'SimInfoIO', {
screenPropertyValue: StringIO,
wrapperMetadata: NullableIO( ObjectLiteralIO ),
dataStreamVersion: StringIO,
phetioCommandProcessorProtocol: StringIO
phetioCommandProcessorProtocol: StringIO,

// Parts that are omitted in API generation
randomSeed: NullableIO( NumberIO ),
url: NullableIO( StringIO ),
userAgent: NullableIO( StringIO ),
window: NullableIO( StringIO ),
referrer: NullableIO( StringIO ),
flags: NullableIO( StringIO )
}
} );

Expand Down

0 comments on commit d95fa57

Please sign in to comment.