1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-16 03:31:52 +00:00

Use the new super cool inline FormElements

Signed-off-by: Daan Breur <git@daanbreur.systems>
This commit is contained in:
Daan Breur 2021-11-22 21:53:35 +01:00
parent 839be106fc
commit 78c8e805f2
No known key found for this signature in database
GPG Key ID: FAD44580052ECA57

View File

@ -682,6 +682,7 @@ export class MainMenuState extends GameState {
placeholder: "", placeholder: "",
defaultValue: "Unnamed", defaultValue: "Unnamed",
validator: val => val.match(regex) && trim(val).length > 0, validator: val => val.match(regex) && trim(val).length > 0,
inline: true,
}); });
const seedInput = new FormElementInput({ const seedInput = new FormElementInput({
@ -691,13 +692,15 @@ export class MainMenuState extends GameState {
placeholder: "", placeholder: "",
defaultValue: randomInt(0, 100000).toString(), defaultValue: randomInt(0, 100000).toString(),
validator: val => Number.isInteger(Number(val)) && Number(val) >= 0 && Number(val) <= 100000, validator: val => Number.isInteger(Number(val)) && Number(val) >= 0 && Number(val) <= 100000,
inline: true,
}); });
const allowColorsCheckbox = new FormElementCheckbox({ const allowColorsCheckbox = new FormElementCheckbox({
id: "allowColorsCheckbox", id: "allowColorsCheckbox",
// @TODO: Add translation (T.dialogs.newSavegame.allowColorsCheckboxLabel) // @TODO: Add translation (T.dialogs.newSavegame.allowColorsCheckboxLabel)
label: "Allow non-primarycolors", label: "Allow non-primarycolors: ",
defaultValue: false, defaultValue: false,
inline: true,
}); });
const advancedContainer = new FormElementDetails({ const advancedContainer = new FormElementDetails({