Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/pregame/MainMenuPage.js
/** | /** | ||||
* This is the handler that coordinates all other handlers on this GUI page. | * This is the handler that coordinates all other handlers on this GUI page. | ||||
*/ | */ | ||||
class MainMenuPage | class MainMenuPage | ||||
{ | { | ||||
constructor(data, hotloadData, mainMenuItems, backgroundLayerData, projectInformation, communityButtons) | constructor(data, hotloadData, mainMenuItems, backgroundLayerData, projectInformation, communityButtons) | ||||
{ | { | ||||
this.backgroundHandler = new BackgroundHandler(pickRandom(backgroundLayerData)); | this.backgroundHandler = new BackgroundHandler(pickRandom(backgroundLayerData)); | ||||
this.menuHandler = new MainMenuItemHandler(mainMenuItems); | this.menuHandler = new MainMenuItemHandler(mainMenuItems); | ||||
this.splashScreenHandler = new SplashScreenHandler(data, hotloadData && hotloadData.splashScreenHandler); | this.splashScreenHandler = new SplashScreenHandler(data, hotloadData && hotloadData.splashScreenHandler); | ||||
let toto = Engine.GetGUIObjectByName("mainMenuPage"); | |||||
let doText = (caption, size) => ({ | |||||
"@type": "text", | |||||
"@size": size, | |||||
"@style": "ModernLabelText", | |||||
"@caption": caption, | |||||
}); | |||||
let added = toto.createChild({ | |||||
"@type": "image", | |||||
"@size": "200 200 500 500", | |||||
"@style": "ModernDialog", | |||||
"@z": 200, | |||||
"object": [ | |||||
doText("turlututu", "0 0 200 200"), | |||||
{ | |||||
"@type": "text", | |||||
"@size": "0 200 200 400", | |||||
"@style": "ModernLabelText", | |||||
"@caption": "ChapoPointu", | |||||
"object": { | |||||
"@type": "image", | |||||
"@size": "600 300 100% 600+40", | |||||
"@style": "ModernDialog", | |||||
"@z": 250, | |||||
} | |||||
}] | |||||
}); | |||||
added.deleteChild(added.children[0]); | |||||
toto.createChild({ | |||||
"script": { | |||||
"@file": "not_a_file.js", | |||||
}, | |||||
}); | |||||
toto.createChild({ | |||||
"script": "warn('Hey you')", | |||||
}); | |||||
new MusicHandler(); | new MusicHandler(); | ||||
Lint: no-use-before-define: 'MusicHandler' was used before it was defined. | |||||
new ProjectInformationHandler(projectInformation); | new ProjectInformationHandler(projectInformation); | ||||
Lint: no-use-before-define 'ProjectInformationHandler' was used before it was defined. Lint: no-use-before-define: 'ProjectInformationHandler' was used before it was defined. | |||||
new CommunityButtonHandler(communityButtons); | new CommunityButtonHandler(communityButtons); | ||||
Lint: no-use-before-define 'CommunityButtonHandler' was used before it was defined. Lint: no-use-before-define: 'CommunityButtonHandler' was used before it was defined. | |||||
} | } | ||||
getHotloadData() | getHotloadData() | ||||
{ | { | ||||
return { | return { | ||||
"splashScreenHandler": this.splashScreenHandler.getHotloadData() | "splashScreenHandler": this.splashScreenHandler.getHotloadData() | ||||
}; | }; | ||||
} | } | ||||
Show All 38 Lines |
Wildfire Games · Phabricator
'MusicHandler' was used before it was defined.