1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-16 11:41:50 +00:00

Edit GameCreationPayload

- `fullShapePercentage` and `wierdShapePercentage` added to `GameCreationPayload`
- Use the updated `GameCreationPayload`

Signed-off-by: Daan Breur <git@daanbreur.systems>
This commit is contained in:
Daan Breur 2021-11-27 15:33:46 +01:00
parent ceb54c69b6
commit 37c7ffb6f7
No known key found for this signature in database
GPG Key ID: FAD44580052ECA57

View File

@ -54,6 +54,12 @@ export class GameCreationPayload {
/** @type {boolean} */
this.allowNonPrimaryColors;
/** @type {number} */
this.fullShapePercentage;
/** @type {number} */
this.wierdShapePercentage;
}
}
@ -85,6 +91,12 @@ export class InGameState extends GameState {
/** @type {boolean} */
this.allowNonPrimaryColors = null;
/** @type {number} */
this.fullShapePercentage = null;
/** @type {number} */
this.wierdShapePercentage = null;
this.boundInputFilter = this.filterInput.bind(this);
/**
@ -262,7 +274,12 @@ export class InGameState extends GameState {
*/
stage4aInitEmptyGame() {
if (this.switchStage(stages.s4_A_initEmptyGame)) {
this.core.initNewGame({ seed: this.seed, allowNonPrimaryColors: this.allowNonPrimaryColors });
this.core.initNewGame({
seed: this.seed,
allowNonPrimaryColors: this.allowNonPrimaryColors,
fullShapePercentage: this.fullShapePercentage,
wierdShapePercentage: this.wierdShapePercentage,
});
this.stage5FirstUpdate();
}
}
@ -383,6 +400,8 @@ export class InGameState extends GameState {
this.gameModeId = payload.gameModeId;
this.seed = payload.seed;
this.allowNonPrimaryColors = payload.allowNonPrimaryColors;
this.fullShapePercentage = payload.fullShapePercentage;
this.wierdShapePercentage = payload.wierdShapePercentage;
this.loadingOverlay = new GameLoadingOverlay(this.app, this.getDivElement());
this.loadingOverlay.showBasic();