mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-13 02:01:51 +00:00
Integrate mods into gui
This commit is contained in:
parent
643ebb6067
commit
87139872f7
@ -207,6 +207,10 @@
|
||||
@include S(margin-top, 15px);
|
||||
}
|
||||
|
||||
.modsButton {
|
||||
@include S(margin-top, 15px);
|
||||
}
|
||||
|
||||
.savegames {
|
||||
@include S(max-height, 105px);
|
||||
overflow-y: auto;
|
||||
|
||||
@ -3,6 +3,7 @@ const options = queryString.parse(location.search);
|
||||
|
||||
export let queryParamOptions = {
|
||||
embedProvider: null,
|
||||
modDeveloper: true,
|
||||
};
|
||||
|
||||
if (options.embed) {
|
||||
|
||||
@ -38,6 +38,10 @@ export class HUDSettingsMenu extends BaseHUDPart {
|
||||
title: T.ingame.settingsMenu.buttons.settings,
|
||||
action: () => this.goToSettings(),
|
||||
},
|
||||
{
|
||||
title: T.ingame.settingsMenu.buttons.mods,
|
||||
action: () => this.goToMods(),
|
||||
},
|
||||
{
|
||||
title: T.ingame.settingsMenu.buttons.menu,
|
||||
action: () => this.returnToMenu(),
|
||||
@ -73,6 +77,10 @@ export class HUDSettingsMenu extends BaseHUDPart {
|
||||
this.root.gameState.goToSettings();
|
||||
}
|
||||
|
||||
goToMods() {
|
||||
this.root.gameState.goToMods();
|
||||
}
|
||||
|
||||
shouldPauseGame() {
|
||||
return this.visible;
|
||||
}
|
||||
|
||||
@ -154,6 +154,13 @@ export class InGameState extends GameState {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Goes back to the mods state
|
||||
*/
|
||||
goToMods() {
|
||||
this.saveThenGoToState("ModsState");
|
||||
}
|
||||
|
||||
/**
|
||||
* Goes back to the settings state
|
||||
*/
|
||||
|
||||
@ -74,6 +74,7 @@ export class MainMenuState extends GameState {
|
||||
}
|
||||
<button class="playButton styledButton">${T.mainMenu.play}</button>
|
||||
<button class="importButton styledButton">${T.mainMenu.importSavegame}</button>
|
||||
<button class="modsButton styledButton">${T.mainMenu.mods}</button>
|
||||
</div>
|
||||
|
||||
|
||||
@ -196,6 +197,7 @@ export class MainMenuState extends GameState {
|
||||
const qs = this.htmlElement.querySelector.bind(this.htmlElement);
|
||||
this.trackClicks(qs(".mainContainer .playButton"), this.onPlayButtonClicked);
|
||||
this.trackClicks(qs(".mainContainer .importButton"), this.requestImportSavegame);
|
||||
this.trackClicks(qs(".mainContainer .modsButton"), this.onModsButtonClicked);
|
||||
|
||||
if (G_IS_DEV && globalConfig.debug.fastGameEnter) {
|
||||
const games = this.app.savegameMgr.getSavegamesMetaData();
|
||||
@ -375,6 +377,10 @@ export class MainMenuState extends GameState {
|
||||
this.moveToState("SettingsState");
|
||||
}
|
||||
|
||||
onModsButtonClicked() {
|
||||
this.moveToState("ModsState");
|
||||
}
|
||||
|
||||
doStartNewGame() {
|
||||
this.app.analytics.trackUiClick("startgame");
|
||||
|
||||
|
||||
@ -114,6 +114,7 @@ mainMenu:
|
||||
play: Play
|
||||
changelog: Changelog
|
||||
importSavegame: Import
|
||||
mods: Mods
|
||||
openSourceHint: This game is open source!
|
||||
discordLink: Official Discord Server
|
||||
|
||||
@ -337,6 +338,7 @@ ingame:
|
||||
buttons:
|
||||
continue: Continue
|
||||
settings: Settings
|
||||
mods: Mods
|
||||
menu: Return to menu
|
||||
|
||||
# Bottom left tutorial hints
|
||||
|
||||
Loading…
Reference in New Issue
Block a user