File tree Expand file tree Collapse file tree 4 files changed +36
-20
lines changed
Iframes/TutorialV1/Launcher Expand file tree Collapse file tree 4 files changed +36
-20
lines changed Original file line number Diff line number Diff line change 1+ import { defaultAssetsUrl } from "./default_assets_url" ;
2+
3+ export function launchTutorialv1 ( ) : void {
4+ const hots = defaultAssetsUrl ;
5+
6+ const tutoUrl = `${ hots } /tutorialv1.html` ;
7+ if (
8+ process . env . NODE_ENV != undefined &&
9+ process . env . NODE_ENV === "development" &&
10+ process . env . WORKADVENTURE_URL != undefined
11+ ) {
12+ process . env . WORKADVENTURE_URL ?. replace ( "play." , "extra." ) ;
13+ }
14+ console . info ( "Start onboarding application!" , tutoUrl ) ;
15+
16+ console . info ( "Player tutorial done information: " , WA . player . state . tutorialDone ) ;
17+ if ( WA . player . state . tutorialDone ) return ;
18+
19+ //open modal and show onboarding tuto
20+ //TODO delete ts-ignore when new scripting release is up
21+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
22+ // @ts -ignore
23+ WA . ui . modal . openModal ( {
24+ src : tutoUrl ,
25+ allow : "fullscreen; clipboard-read; clipboard-write" ,
26+ allowApi : true ,
27+ } ) ;
28+ }
Original file line number Diff line number Diff line change 1- import { defaultAssetsUrl } from "../../../Features/default_assets_url " ;
1+ import { launchTutorialv1 } from "../../../Features/tutorialv1 " ;
22
33console . info ( "Onboarding script initialized!" ) ;
44document . addEventListener ( "DOMContentLoaded" , ( ) => {
5- const tutoUrl = `${ defaultAssetsUrl } /tutorialv1.html` ;
6- console . info ( "Start onboarding application!" , tutoUrl ) ;
7-
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- if ( WA . player . state . tutorialDone ) return ;
12-
13- //open modal and show onboarding tuto
14- //TODO delete ts-ignore when new scripting release is up
15- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
16- // @ts -ignore
17- WA . ui . modal . openModal ( {
18- src : tutoUrl ,
19- allow : "fullscreen; clipboard-read; clipboard-write" ,
20- allowApi : true ,
21- } ) ;
5+ launchTutorialv1 ( ) ;
226} ) ;
237
248export { } ;
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import { initDoors } from "./Features/doors";
22import { initSpecialProperties } from "./Features/special_properties" ;
33import { initConfiguration } from "./Features/configuration" ;
44import { initPropertiesTemplates } from "./Features/properties_templates" ;
5- import { initTutorial } from "./Features/tutorial" ;
65
76/**
87 * Bootstraps all the features of the extra library.
@@ -15,7 +14,6 @@ export function bootstrapExtra(): Promise<void> {
1514 initSpecialProperties ( ) . catch ( ( e ) => console . error ( e ) ) ;
1615 initConfiguration ( ) . catch ( ( e ) => console . error ( e ) ) ;
1716 initPropertiesTemplates ( ) . catch ( ( e ) => console . error ( e ) ) ;
18- initTutorial ( ) . catch ( ( e ) => console . error ( e ) ) ;
1917 } )
2018 . catch ( ( e ) => console . error ( e ) ) ;
2119}
Original file line number Diff line number Diff line change @@ -292,5 +292,11 @@ module.exports = {
292292 new CopyPlugin ( {
293293 patterns : resources ,
294294 } ) ,
295+ new webpack . EnvironmentPlugin ( {
296+ "process.env.WORKADVENTURE_URL" : process . env . WORKADVENTURE_URL
297+ ? JSON . stringify ( process . env . WORKADVENTURE_URL )
298+ : null ,
299+ "process.env.NODE_ENV" : process . env . NODE_ENV ,
300+ } ) ,
295301 ] ,
296302} as Configuration & WebpackDevServer . Configuration ;
You can’t perform that action at this time.
0 commit comments