Adding placeHolder Popup tuto to Map2

need to cut player controller and simulate bobble
This commit is contained in:
DESKTOP-FMM8UI0\CLV 2021-03-11 10:58:48 +01:00
parent f9f618094d
commit 6441fa71d3
3 changed files with 618 additions and 17 deletions

View File

@ -79,11 +79,9 @@ window.WA = {
},
openPopup(targetObject: string, message: string, buttons: ButtonDescriptor[]): Popup {
popupId++;
const popup = new Popup(popupId);
const btnMap = new Map<number, () => void>();
popupCallbacks.set(popupId, btnMap);
targetObject = "tutoBobble";
let id = 0;
for (const button of buttons) {
const callback = button.callback;
@ -95,6 +93,7 @@ window.WA = {
id++;
}
window.parent.postMessage({
'type': 'openPopup',
'data': {

597
maps/tests/map2.json Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,5 @@
console.log('SCRIPT LAUNCHED');
WA.sendChatMessage('Hi, my name is Poly and I repeat what you say!', 'Poly Parrot');
//WA.sendChatMessage('Hi, my name is Poly and I repeat what you say!', 'Poly Parrot');
WA.onChatMessage((message => {
console.log('CHAT MESSAGE RECEIVED BY SCRIPT');
@ -11,8 +10,7 @@ WA.onEnterZone('myTrigger', () => {
WA.sendChatMessage("Don't step on my carpet!", 'Poly Parrot');
})
WA.onLeaveZone('myTrigger', () => {
WA.sendChatMessage("Thanks!", 'Poly Parrot');
WA.onLeaveZone('popupZone', () => {
})
WA.onEnterZone('notExist', () => {
@ -20,23 +18,30 @@ WA.onEnterZone('notExist', () => {
})
WA.onEnterZone('popupZone', () => {
WA.openPopup('foobar', 'This is a test message. Hi!', [
WA.openPopup('tutoBobble', 'Hey ! This is how to open start a discussion with someone ! You can be 4 max in a booble ', [
{
label: "Close",
label: "Next",
className: "normal",
callback: (popup) => {
popup.close();
}
},
{
label: "Next",
className: "success",
callback: (popup) => {
popup.close();
WA.openPopup('tutoChat', 'You can also use the chat to communicate ! ',[
{
label : "Open Chat",
className : "normal",
callback: (popup1)=> {
WA.sendChatMessage("Hey you can talk here too ! ", 'WA Guide');
popup1.close();
}
}
])
}
}
])
})
]);
});
/*WA.onLeaveZone('popupZone', () => {
WA.sendChatMessage("Thanks!", 'Poly Parrot');