implement show/hide layer with scripting
This commit is contained in:
parent
5605e63e5f
commit
a6ba8d41b9
5 changed files with 97 additions and 5 deletions
|
@ -9,6 +9,7 @@ import {ClosePopupEvent} from "./Api/Events/ClosePopupEvent";
|
|||
import {OpenTabEvent} from "./Api/Events/OpenTabEvent";
|
||||
import {GoToPageEvent} from "./Api/Events/GoToPageEvent";
|
||||
import {OpenCoWebSiteEvent} from "./Api/Events/OpenCoWebSiteEvent";
|
||||
import {LayerEvent} from "./Api/Events/LayerEvent";
|
||||
|
||||
interface WorkAdventureApi {
|
||||
sendChatMessage(message: string, author: string): void;
|
||||
|
@ -24,6 +25,8 @@ interface WorkAdventureApi {
|
|||
restorePlayerControl() : void;
|
||||
displayBubble() : void;
|
||||
removeBubble() : void;
|
||||
showLayer(layer: string) : void;
|
||||
hideLayer(layer: string) : void;
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
@ -88,6 +91,24 @@ window.WA = {
|
|||
} as ChatEvent
|
||||
}, '*');
|
||||
},
|
||||
showLayer(layer: string) : void {
|
||||
console.log('showLayer');
|
||||
window.parent.postMessage({
|
||||
'type' : 'showLayer',
|
||||
'data' : {
|
||||
'name' : layer
|
||||
} as LayerEvent
|
||||
}, '*');
|
||||
},
|
||||
hideLayer(layer: string) : void {
|
||||
console.log('hideLayer');
|
||||
window.parent.postMessage({
|
||||
'type' : 'hideLayer',
|
||||
'data' : {
|
||||
'name' : layer
|
||||
} as LayerEvent
|
||||
}, '*');
|
||||
},
|
||||
disablePlayerControl() : void {
|
||||
window.parent.postMessage({'type' : 'disablePlayerControl'},'*');
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue