mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Fix being able to create constant signals without value
This commit is contained in:
parent
7cbe5bb8e7
commit
a67448fbdf
@ -368,9 +368,18 @@ export class DialogWithForm extends Dialog {
|
||||
* @param {array=} param0.buttons
|
||||
* @param {string=} param0.confirmButtonId
|
||||
* @param {string=} param0.extraButton
|
||||
* @param {boolean=} param0.closeButton
|
||||
* @param {Array<FormElement>} param0.formElements
|
||||
*/
|
||||
constructor({ app, title, desc, formElements, buttons = ["cancel", "ok:good"], confirmButtonId = "ok" }) {
|
||||
constructor({
|
||||
app,
|
||||
title,
|
||||
desc,
|
||||
formElements,
|
||||
buttons = ["cancel", "ok:good"],
|
||||
confirmButtonId = "ok",
|
||||
closeButton = true,
|
||||
}) {
|
||||
let html = "";
|
||||
html += desc + "<br>";
|
||||
for (let i = 0; i < formElements.length; ++i) {
|
||||
@ -383,7 +392,7 @@ export class DialogWithForm extends Dialog {
|
||||
contentHTML: html,
|
||||
buttons: buttons,
|
||||
type: "info",
|
||||
closeButton: true,
|
||||
closeButton,
|
||||
});
|
||||
this.confirmButtonId = confirmButtonId;
|
||||
this.formElements = formElements;
|
||||
|
@ -52,6 +52,7 @@ export class ConstantSignalSystem extends GameSystemWithFilter {
|
||||
desc: "Enter a shape code, color or '0' or '1'",
|
||||
formElements: [signalValueInput],
|
||||
buttons: ["cancel:bad:escape", "ok:good:enter"],
|
||||
closeButton: false,
|
||||
});
|
||||
this.root.hud.parts.dialogs.internalShowDialog(dialog);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user