1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-17 04:01:51 +00:00

Temp UI for new shape-percentages

This commit is contained in:
Daan Breur 2021-11-27 15:35:05 +01:00
parent 37c7ffb6f7
commit dfe90426ce
No known key found for this signature in database
GPG Key ID: FAD44580052ECA57

View File

@ -703,11 +703,34 @@ export class MainMenuState extends GameState {
inline: true, inline: true,
}); });
const fullShapePercentageInput = new FormElementInput({
id: "fullShapePercentageInput",
label: "fullShape %:",
placeholder: "",
defaultValue: Number(0).toString(),
validator: val => Number.isInteger(Number(val)) && Number(val) >= 0 && Number(val) <= 100,
inline: true,
});
const wierdShapePercentageInput = new FormElementInput({
id: "wierdShapePercentageInput",
label: "wierdShape %:",
placeholder: "",
defaultValue: Number(0).toString(),
validator: val => Number.isInteger(Number(val)) && Number(val) >= 0 && Number(val) <= 100,
inline: true,
});
const advancedContainer = new FormElementDetails({ const advancedContainer = new FormElementDetails({
id: "advancedContainer", id: "advancedContainer",
// @TODO Add translation (T.dialogs.newSavegame.advanced) // @TODO Add translation (T.dialogs.newSavegame.advanced)
label: "Advanced Options", label: "Advanced Options",
formElements: [seedInput, allowColorsCheckbox], formElements: [
seedInput,
allowColorsCheckbox,
fullShapePercentageInput,
wierdShapePercentageInput,
],
}); });
const dialog = new DialogWithForm({ const dialog = new DialogWithForm({
@ -735,6 +758,8 @@ export class MainMenuState extends GameState {
savegame, savegame,
seed: Number(seedInput.getValue()), seed: Number(seedInput.getValue()),
allowNonPrimaryColors: allowColorsCheckbox.getValue(), allowNonPrimaryColors: allowColorsCheckbox.getValue(),
fullShapePercentage: Number(fullShapePercentageInput.getValue()),
wierdShapePercentage: Number(wierdShapePercentageInput.getValue()),
}); });
this.app.analytics.trackUiClick("startgame_adcomplete"); this.app.analytics.trackUiClick("startgame_adcomplete");
}); });