Error problem open new map

This commit is contained in:
Gregoire Parant 2021-01-25 13:18:57 +01:00
parent 5f88a1a0b9
commit beb53df364
3 changed files with 64 additions and 11 deletions

View file

@ -631,22 +631,24 @@ export class GameScene extends ResizableScene implements CenterListener {
if (newValue) this.onMapExit(newValue as string);
});*/
this.gameMap.onPropertyChange('exitUrl', (newValue, oldValue, allProps) => {
if (newValue === undefined) {
if (newValue) this.onMapExit(newValue as string);
/*if (newValue === undefined) {
layoutManager.removeActionButton('exitUrl', this.userInputManager);
} else {
const exitTriggerValue = allProps.get(TRIGGER_EXIT_PROPERTIES);
if (exitTriggerValue && exitTriggerValue === ON_ACTION_TRIGGER_BUTTON) {
let message = allProps.get(EXIT_MESSAGE_PROPERTIES);
if(message === undefined){
message = 'Click on SPACE to entrer in next map';
if (message === undefined) {
message = 'Click on SPACE to enter in next map';
}
layoutManager.addActionButton('exitUrl', message.toString(), () => {
layoutManager.removeActionButton('exitUrl', this.userInputManager);
this.onMapExit(newValue as string);
}, this.userInputManager);
} else {
this.onMapExit(newValue as string);
}
}
}*/
});
this.gameMap.onPropertyChange('openWebsite', (newValue, oldValue, allProps) => {
if (newValue === undefined) {