Merge branch 'develop' of github.com:thecodingmachine/workadventure
This commit is contained in:
@@ -7,32 +7,29 @@ import SoundConfig = Phaser.Types.Sound.SoundConfig;
|
|||||||
export class Sound {
|
export class Sound {
|
||||||
constructor(private url: string) {
|
constructor(private url: string) {
|
||||||
sendToWorkadventure({
|
sendToWorkadventure({
|
||||||
"type": 'loadSound',
|
type: "loadSound",
|
||||||
"data": {
|
data: {
|
||||||
url: this.url,
|
url: this.url,
|
||||||
} as LoadSoundEvent
|
} as LoadSoundEvent,
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public play(config: SoundConfig) {
|
public play(config: SoundConfig | undefined) {
|
||||||
sendToWorkadventure({
|
sendToWorkadventure({
|
||||||
"type": 'playSound',
|
type: "playSound",
|
||||||
"data": {
|
data: {
|
||||||
url: this.url,
|
url: this.url,
|
||||||
config
|
config,
|
||||||
} as PlaySoundEvent
|
} as PlaySoundEvent,
|
||||||
|
|
||||||
});
|
});
|
||||||
return this.url;
|
return this.url;
|
||||||
}
|
}
|
||||||
public stop() {
|
public stop() {
|
||||||
sendToWorkadventure({
|
sendToWorkadventure({
|
||||||
"type": 'stopSound',
|
type: "stopSound",
|
||||||
"data": {
|
data: {
|
||||||
url: this.url,
|
url: this.url,
|
||||||
} as StopSoundEvent
|
} as StopSoundEvent,
|
||||||
|
|
||||||
});
|
});
|
||||||
return this.url;
|
return this.url;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -992,6 +992,11 @@ export class GameScene extends DirtyScene {
|
|||||||
inputValue = HtmlUtils.getElementByIdOrFail<HTMLInputElement>(`popupinput-${openPopupEvent.popupId}`).value;
|
inputValue = HtmlUtils.getElementByIdOrFail<HTMLInputElement>(`popupinput-${openPopupEvent.popupId}`).value;
|
||||||
}
|
}
|
||||||
iframeListener.sendButtonClickedEvent(openPopupEvent.popupId, btnId, openPopupEvent.input, inputValue);
|
iframeListener.sendButtonClickedEvent(openPopupEvent.popupId, btnId, openPopupEvent.input, inputValue);
|
||||||
|
// Disable for a short amount of time to let time to the script to remove the popup
|
||||||
|
button.disabled = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
button.disabled = false;
|
||||||
|
}, 100);
|
||||||
};
|
};
|
||||||
id++;
|
id++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user