Adding placeHolder Popup tuto to Map2
need to cut player controller and simulate bobble
This commit is contained in:
parent
f9f618094d
commit
6441fa71d3
@ -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
597
maps/tests/map2.json
Normal file
File diff suppressed because one or more lines are too long
@ -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();
|
||||
}
|
||||
},
|
||||
|
||||
WA.openPopup('tutoChat', 'You can also use the chat to communicate ! ',[
|
||||
{
|
||||
label: "Next",
|
||||
className: "success",
|
||||
callback: (popup) => {
|
||||
popup.close();
|
||||
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');
|
||||
|
Loading…
Reference in New Issue
Block a user