Skip to content

Commit d4c11db

Browse files
authored
Change feature launcher script for tutorial v1 (#185)
1 parent f980c88 commit d4c11db

File tree

4 files changed

+14
-10787
lines changed

4 files changed

+14
-10787
lines changed

src/Iframes/TutorialV1/Launcher/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1+
import { defaultAssetsUrl } from "../../../Features/default_assets_url";
2+
13
console.info("Onboarding script initialized!");
24
document.addEventListener("DOMContentLoaded", () => {
3-
console.info("Start onboarding application!");
5+
const tutoUrl = `${
6+
defaultAssetsUrl !== "" ? defaultAssetsUrl : "http://extra.workadventure.localhost"
7+
}/tutorialv1.html`;
8+
console.info("Start onboarding application!", tutoUrl);
9+
410
if (WA.player.state.tutorialDone) return;
11+
512
//TODO delete @ts-ignore when new scripting release is up
613
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
714
// @ts-ignore
815
WA.ui.modal.openModal({
9-
src: process.env.WORKADVENTURE_URL + "/tutorialv1.html",
16+
src: tutoUrl,
1017
allow: "fullscreen; clipboard-read; clipboard-write",
1118
allowApi: true,
1219
});

src/Iframes/TutorialV1/Launcher/script.ejs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
<script src="<%= workadventure_url %>/iframe_api.js" ></script>
66
</head>
77
<body class="tw-bg-dark-purple/95">
8+
Tutu v1 script launcher
89
</body>
910
</html>

src/Iframes/TutorialV1/Tuto/Components/App.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
import Steps from "./Steps.svelte";
55
66
function close(){
7-
WA.ui.modal.closeModal();
87
WA.player.state.tutorialDone = true;
8+
//TODO delete @ts-ignore when new scripting release is up
9+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
10+
// @ts-ignore
11+
WA.ui.modal.closeModal();
912
}
1013
</script>
1114

0 commit comments

Comments
 (0)