mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Dialog instructions refer to tablet or window as appropriate
This commit is contained in:
parent
54a0bea8c0
commit
b29bfd4bb4
2 changed files with 19 additions and 1 deletions
|
@ -14,13 +14,18 @@ var elEnableRecording,
|
|||
elInstructions,
|
||||
EVENT_BRIDGE_TYPE = "record",
|
||||
BODY_LOADED_ACTION = "bodyLoaded",
|
||||
ENABLE_RECORDING_ACTION = "enableRecording";
|
||||
USING_TOOLBAR_ACTION = "usingToolbar",
|
||||
ENABLE_RECORDING_ACTION = "enableRecording",
|
||||
TABLET_INSTRUCTIONS = "Close the tablet to start recording",
|
||||
WINDOW_INSTRUCTIONS = "Close the window to start recording";
|
||||
|
||||
function onScriptEventReceived(data) {
|
||||
var message = JSON.parse(data);
|
||||
if (message.type === EVENT_BRIDGE_TYPE) {
|
||||
if (message.action === ENABLE_RECORDING_ACTION) {
|
||||
elEnableRecording.checked = message.value;
|
||||
} else if (message.action === USING_TOOLBAR_ACTION) {
|
||||
elInstructions.innerHTML = message.value ? WINDOW_INSTRUCTIONS : TABLET_INSTRUCTIONS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +43,8 @@ function onBodyLoaded() {
|
|||
}));
|
||||
};
|
||||
|
||||
elInstructions = document.getElementById("instructions");
|
||||
|
||||
EventBridge.emitWebEvent(JSON.stringify({
|
||||
type: EVENT_BRIDGE_TYPE,
|
||||
action: BODY_LOADED_ACTION
|
||||
|
|
|
@ -22,8 +22,14 @@
|
|||
button,
|
||||
EVENT_BRIDGE_TYPE = "record",
|
||||
BODY_LOADED_ACTION = "bodyLoaded",
|
||||
USING_TOOLBAR_ACTION = "usingToolbar",
|
||||
ENABLE_RECORDING_ACTION = "enableRecording";
|
||||
|
||||
function usingToolbar() {
|
||||
return ((HMD.active && Settings.getValue("hmdTabletBecomesToolbar"))
|
||||
|| (!HMD.active && Settings.getValue("desktopTabletBecomesToolbar")));
|
||||
}
|
||||
|
||||
function startRecording() {
|
||||
isRecording = true;
|
||||
print("Start recording");
|
||||
|
@ -87,6 +93,11 @@
|
|||
action: ENABLE_RECORDING_ACTION,
|
||||
value: isRecordingEnabled
|
||||
}));
|
||||
tablet.emitScriptEvent(JSON.stringify({
|
||||
type: EVENT_BRIDGE_TYPE,
|
||||
action: USING_TOOLBAR_ACTION,
|
||||
value: usingToolbar()
|
||||
}));
|
||||
} else if (message.action === ENABLE_RECORDING_ACTION) {
|
||||
isRecordingEnabled = message.value;
|
||||
button.editProperties({ isActive: isRecordingEnabled || isRecording });
|
||||
|
|
Loading…
Reference in a new issue