diff --git a/src/shaka-contest.ts b/src/shaka-contest.ts index 75d3937..6957f93 100644 --- a/src/shaka-contest.ts +++ b/src/shaka-contest.ts @@ -19,6 +19,25 @@ WA.onInit().then(() => { new Info1(); new Info2(); + // Open invetory + WA.ui.website.open({ + url: `${discussion.rootLink}/views/inventory/inventory.html`, + visible: true, + position: { + vertical: "bottom", + horizontal: "right" + }, + allowApi: true, + size: { + height: "200px", + width: "100px" + }, + margin: { + bottom: "180px", + right: "10px" + } + }); + console.info('Shaka contest script initialized...'); }); diff --git a/src/utils/discussion.ts b/src/utils/discussion.ts index 0093cba..6f98f14 100644 --- a/src/utils/discussion.ts +++ b/src/utils/discussion.ts @@ -1,12 +1,12 @@ import { CreateUIWebsiteEvent, UIWebsite } from "@workadventure/iframe-api-typings"; class Discussion{ - private rootLink: string; + private _rootLink: string; private uiWebSite?: UIWebsite; constructor(){ const prodRootLink = "https://workadventure.github.io/nftbiarritz-game/" const devRootLink = 'http://localhost:5173'; - this.rootLink = process.env.NODE_ENV === 'production' ? prodRootLink : devRootLink; + this._rootLink = process.env.NODE_ENV === 'production' ? prodRootLink : devRootLink; } async openDiscussionWebsite(view: string, callbackWhenClosed: Function|null = null){ @@ -48,12 +48,16 @@ class Discussion{ openModal(title: string, view: string){ WA.ui.modal.openModal({ - title: title, - src: `${this.rootLink}/views/${view}/modal.html`, - allowApi: true, - allow: "fullscreen;camera;microphone", - position: "center", - }); + title: title, + src: `${this.rootLink}/views/${view}/modal.html`, + allowApi: true, + allow: "fullscreen;camera;microphone", + position: "center", + }); + } + + get rootLink(){ + return this._rootLink; } } diff --git a/views/inventory/avatar.webp b/views/inventory/avatar.webp new file mode 100644 index 0000000..52b5db9 Binary files /dev/null and b/views/inventory/avatar.webp differ diff --git a/views/inventory/inventory.html b/views/inventory/inventory.html new file mode 100644 index 0000000..d604576 --- /dev/null +++ b/views/inventory/inventory.html @@ -0,0 +1,56 @@ + + + +
+ + + + + +