Skip to content

Commit

Permalink
Cleaning stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoAverty committed Apr 30, 2024
1 parent fad5e90 commit 6f316b7
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
Binary file added map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
17 changes: 0 additions & 17 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,16 @@ import { bootstrapExtra } from "@workadventure/scripting-api-extra";

console.log('Script started successfully');

let currentPopup: any = undefined;

// Waiting for the API to be ready
WA.onInit().then(() => {
console.log('Scripting API ready');
console.log('Player tags: ',WA.player.tags)

WA.room.area.onEnter('clock').subscribe(() => {
const today = new Date();
const time = today.getHours() + ":" + today.getMinutes();
currentPopup = WA.ui.openPopup("clockPopup", "It's " + time, []);
})

WA.room.area.onLeave('clock').subscribe(closePopup)

// The line below bootstraps the Scripting API Extra library that adds a number of advanced properties/features to WorkAdventure
bootstrapExtra().then(() => {
console.log('Scripting API Extra ready');
}).catch(e => console.error(e));

}).catch(e => console.error(e));

function closePopup(){
if (currentPopup !== undefined) {
currentPopup.close();
currentPopup = undefined;
}
}

export {};

0 comments on commit 6f316b7

Please sign in to comment.