This commit is contained in:
_Bastler
2021-08-08 15:47:53 +02:00
parent e9e96c9e30
commit 73a2cec4df
5 changed files with 38 additions and 20 deletions
+20 -10
View File
@@ -1122,20 +1122,26 @@ export class GameScene extends DirtyScene {
this.iframeSubscriptionList.push(iframeListener.unregisterIFrameStream.subscribe(() => {
const allProps = this.gameMap.getCurrentProperties();
if(allProps.get("openWebsite") == null) {
layoutManager.removeActionButton('openWebsite', this.userInputManager);
layoutManagerActionStore.removeAction("openWebsite");
} else {
const openWebsiteFunction = () => {
coWebsiteManager.loadCoWebsite(allProps.get("openWebsite") as string, this.MapUrlFile, allProps.get('openWebsiteAllowApi') as boolean | undefined, allProps.get('openWebsitePolicy') as string | undefined);
layoutManager.removeActionButton('openWebsite', this.userInputManager);
layoutManagerActionStore.removeAction("openWebsite");
};
let message = allProps.get(WEBSITE_MESSAGE_PROPERTIES);
if(message === undefined) {
message = 'Press SPACE or touch here to open web site';
}
layoutManager.addActionButton('openWebsite', message.toString(), () => {
openWebsiteFunction();
}, this.userInputManager);
layoutManagerActionStore.addAction({
uuid: "openWebsite",
type: "message",
message: message,
callback: () => openWebsiteFunction(),
userInputManager: this.userInputManager,
});
}
}));
@@ -1886,7 +1892,7 @@ export class GameScene extends DirtyScene {
const allProps = this.gameMap.getCurrentProperties();
if(allProps.get("jitsiRoom") === undefined) {
layoutManager.removeActionButton('jitsiRoom', this.userInputManager);
layoutManagerActionStore.removeAction("jitsi");
} else {
const openJitsiRoomFunction = () => {
const roomName = jitsiFactory.getRoomName(allProps.get("jitsiRoom") as string, this.instance);
@@ -1898,16 +1904,20 @@ export class GameScene extends DirtyScene {
} else {
this.startJitsi(roomName, undefined);
}
layoutManager.removeActionButton('jitsiRoom', this.userInputManager);
layoutManagerActionStore.removeAction("jitsi");
}
let message = allProps.get(JITSI_MESSAGE_PROPERTIES);
if(message === undefined) {
message = 'Press SPACE or touch here to enter Jitsi Meet room';
}
layoutManager.addActionButton('jitsiRoom', message.toString(), () => {
openJitsiRoomFunction();
}, this.userInputManager);
layoutManagerActionStore.addAction({
uuid: "jitsi",
type: "message",
message: message,
callback: () => openJitsiRoomFunction(),
userInputManager: this.userInputManager,
});
}
}