Update feedback @moufmouf

This commit is contained in:
Gregoire Parant 2020-11-04 13:33:58 +01:00
parent 6051e5f46a
commit 968787555f
2 changed files with 41 additions and 8 deletions

View file

@ -467,24 +467,33 @@ export class GameScene extends ResizableScene implements CenterListener {
// From now, this game scene will be notified of reposition events
layoutManager.setListener(this);
this.gameMap.onPropertyChange('openWebsite', (newValue, oldValue) => {
this.gameMap.onPropertyChange('openWebsite', (newValue, oldValue, allProps) => {
if (newValue === undefined) {
layoutManager.removeActionButton('openWebsite', this.userInputManager);
coWebsiteManager.closeCoWebsite();
}else{
layoutManager.addActionButton('openWebsite', 'Clik on SPACE to open web site', () => {
const openWebsiteFunction = () => {
coWebsiteManager.loadCoWebsite(newValue as string);
layoutManager.removeActionButton('openWebsite', this.userInputManager);
}, this.userInputManager);
};
const openWebsiteTriggerValue = allProps.get('openWebsiteTrigger');
if(openWebsiteTriggerValue && openWebsiteTriggerValue === 'onaction') {
layoutManager.addActionButton('openWebsite', 'Clik on SPACE to open web site', () => {
openWebsiteFunction();
}, this.userInputManager);
}else{
openWebsiteFunction();
}
}
});
this.gameMap.onPropertyChange('jitsiRoom', (newValue, oldValue, allProps) => {
if (newValue === undefined) {
layoutManager.removeActionButton('jitsiRoom', this.userInputManager);
this.stopJitsi();
}else{
layoutManager.addActionButton('jitsiRoom', 'Clik on SPACE to enter in jitsi meet room', () => {
const openJitsiRoomFunction = () => {
if (JITSI_PRIVATE_MODE) {
const adminTag = allProps.get("jitsiRoomAdminTag") as string|undefined;
@ -493,7 +502,16 @@ export class GameScene extends ResizableScene implements CenterListener {
this.startJitsi(newValue as string);
}
layoutManager.removeActionButton('jitsiRoom', this.userInputManager);
}, this.userInputManager);
}
const jitsiTriggerValue = allProps.get('jitsiTrigger');
if(jitsiTriggerValue && jitsiTriggerValue === 'onaction') {
layoutManager.addActionButton('jitsiRoom', 'Clik on SPACE to enter in jitsi meet room', () => {
openJitsiRoomFunction();
}, this.userInputManager);
}else{
openJitsiRoomFunction();
}
}
});
@ -678,7 +696,7 @@ export class GameScene extends ResizableScene implements CenterListener {
if (!properties) {
return undefined;
}
const obj = properties.find((property: ITiledMapLayerProperty) => property.name === name);
const obj = properties.find((property: ITiledMapLayerProperty) => property.name.toLowerCase() === name.toLowerCase());
if (obj === undefined) {
return undefined;
}

View file

@ -44,6 +44,11 @@
"name":"jitsiRoom",
"type":"string",
"value":"tcm-chillzone-2"
},
{
"name":"jitsiTrigger",
"type":"string",
"value":"auto"
}],
"type":"tilelayer",
"visible":true,
@ -61,7 +66,12 @@
{
"name":"jitsiRoom",
"type":"string",
"value":"tcm-chillzone-1"
"value":"tcm-chillzone-11"
},
{
"name":"jitsiTrigger",
"type":"string",
"value":"onaction"
}],
"type":"tilelayer",
"visible":true,
@ -128,6 +138,11 @@
"name":"openWebsite",
"type":"string",
"value":"https:\/\/app.swile.co\/"
},
{
"name":"openWebsiteTrigger",
"type":"string",
"value":"auto"
}],
"type":"tilelayer",
"visible":true,