mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 16:23:17 +02:00
working on mini tablet
This commit is contained in:
parent
96f32a9f72
commit
a9767e4c22
2 changed files with 18 additions and 10 deletions
|
@ -61,6 +61,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (message.type) {
|
switch (message.type) {
|
||||||
|
case READY_MESSAGE:
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
type: READY_MESSAGE
|
||||||
|
}));
|
||||||
|
break;
|
||||||
case MUTE_MESSAGE:
|
case MUTE_MESSAGE:
|
||||||
muteImage.src = message.icon;
|
muteImage.src = message.icon;
|
||||||
break;
|
break;
|
||||||
|
@ -114,9 +119,6 @@
|
||||||
|
|
||||||
function connectEventBridge() {
|
function connectEventBridge() {
|
||||||
EventBridge.scriptEventReceived.connect(onScriptEventReceived);
|
EventBridge.scriptEventReceived.connect(onScriptEventReceived);
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
|
||||||
type: READY_MESSAGE
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function disconnectEventBridge() {
|
function disconnectEventBridge() {
|
||||||
|
|
|
@ -124,6 +124,7 @@
|
||||||
miniUIOverlayEnabled = false,
|
miniUIOverlayEnabled = false,
|
||||||
MINI_UI_OVERLAY_ENABLED_DELAY = 500,
|
MINI_UI_OVERLAY_ENABLED_DELAY = 500,
|
||||||
miniOverlayObject = null,
|
miniOverlayObject = null,
|
||||||
|
isReady = false,
|
||||||
|
|
||||||
// Button icons.
|
// Button icons.
|
||||||
MUTE_ON_ICON = Script.resourcesPath() + "icons/tablet-icons/mic-mute-a.svg",
|
MUTE_ON_ICON = Script.resourcesPath() + "icons/tablet-icons/mic-mute-a.svg",
|
||||||
|
@ -203,6 +204,7 @@
|
||||||
switch (message.type) {
|
switch (message.type) {
|
||||||
case READY_MESSAGE:
|
case READY_MESSAGE:
|
||||||
// Send initial button statuses.
|
// Send initial button statuses.
|
||||||
|
isReady = true;
|
||||||
updateMutedStatus();
|
updateMutedStatus();
|
||||||
setGotoIcon();
|
setGotoIcon();
|
||||||
break;
|
break;
|
||||||
|
@ -979,13 +981,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateState() {
|
function updateState() {
|
||||||
if (!ui.miniOverlayObject) {
|
if (!ui.isReady) {
|
||||||
// Keep trying to connect the event bridge until we succeed
|
if (!ui.miniOverlayObject) {
|
||||||
ui.miniOverlayObject = Overlays.getOverlayObject(ui.miniUIOverlay);
|
// Keep trying to connect the event bridge until we succeed
|
||||||
if (ui.miniOverlayObject) {
|
ui.miniOverlayObject = Overlays.getOverlayObject(ui.miniUIOverlay);
|
||||||
ui.miniOverlayObject.webEventReceived.connect(ui.onWebEventReceived);
|
if (ui.miniOverlayObject) {
|
||||||
ui.updateMutedStatus();
|
ui.miniOverlayObject.webEventReceived.connect(ui.onWebEventReceived);
|
||||||
ui.setGotoIcon();
|
}
|
||||||
|
} else {
|
||||||
|
ui.miniOverlayObject.emitScriptEvent(JSON.stringify({
|
||||||
|
type: READY_MESSAGE
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue