Add First Version of Tuto
PopUp Player Control disable Fake bubble displayed
This commit is contained in:
parent
fa4d917729
commit
c5c8770a60
8 changed files with 174 additions and 65 deletions
|
@ -1,6 +1,37 @@
|
|||
console.log('SCRIPT LAUNCHED');
|
||||
//WA.sendChatMessage('Hi, my name is Poly and I repeat what you say!', 'Poly Parrot');
|
||||
var isFirstTimeTuto = false;
|
||||
var textFirstPopup = 'Hey ! This is how to open start a discussion with someone ! You can be 4 max in a booble';
|
||||
var textSecondPopup = 'You can also use the chat to communicate ! ';
|
||||
var targetObjectTutoBubble ='tutoBobble';
|
||||
var targetObjectTutoChat ='tutoChat';
|
||||
var popUpExplanation = undefined;
|
||||
function launchTuto (){
|
||||
WA.openPopup(targetObjectTutoBubble, textFirstPopup, [
|
||||
{
|
||||
label: "Next",
|
||||
className: "normal",
|
||||
callback: (popup) => {
|
||||
popup.close();
|
||||
|
||||
WA.openPopup(targetObjectTutoChat, textSecondPopup, [
|
||||
{
|
||||
label: "Open Chat",
|
||||
className: "normal",
|
||||
callback: (popup1) => {
|
||||
WA.sendChatMessage("Hey you can talk here too ! ", 'WA Guide');
|
||||
popup1.close();
|
||||
WA.enablePlayerControl();
|
||||
}
|
||||
}
|
||||
|
||||
])
|
||||
}
|
||||
}
|
||||
]);
|
||||
WA.disablePlayerControl();
|
||||
|
||||
}
|
||||
WA.onChatMessage((message => {
|
||||
console.log('CHAT MESSAGE RECEIVED BY SCRIPT');
|
||||
WA.sendChatMessage('Poly Parrot says: "'+message+'"', 'Poly Parrot');
|
||||
|
@ -18,31 +49,31 @@ WA.onEnterZone('notExist', () => {
|
|||
})
|
||||
|
||||
WA.onEnterZone('popupZone', () => {
|
||||
WA.openPopup('tutoBobble', 'Hey ! This is how to open start a discussion with someone ! You can be 4 max in a booble ', [
|
||||
WA.displayBubble();
|
||||
if (!isFirstTimeTuto) {
|
||||
isFirstTimeTuto = true;
|
||||
launchTuto();
|
||||
}
|
||||
else popUpExplanation = WA.openPopup(targetObjectTutoBubble,'Do you want to review the explantion', [
|
||||
{
|
||||
label: "Next",
|
||||
label: "No",
|
||||
className: "normal",
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
])
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "Yes",
|
||||
className: "normal",
|
||||
callback: (popup) => {
|
||||
popup.close();
|
||||
launchTuto();
|
||||
}
|
||||
}
|
||||
]);
|
||||
])
|
||||
});
|
||||
|
||||
/*WA.onLeaveZone('popupZone', () => {
|
||||
WA.sendChatMessage("Thanks!", 'Poly Parrot');
|
||||
})*/
|
||||
WA.onLeaveZone('popupZone', () => {
|
||||
if (popUpExplanation !== undefined) popUpExplanation.close();
|
||||
WA.removeBubble();
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue