1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2024-10-27 20:34:29 +00:00

Highlight focused text inputs, Show old signal (#1255)

* provide previous key when editing signal

* highlight text in focused text input
This commit is contained in:
Emerald Block 2021-08-04 05:19:58 -05:00 committed by GitHub
parent c11f571dd2
commit 0a15958af9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -124,6 +124,7 @@ export class FormElementInput extends FormElement {
focus() {
this.element.focus();
this.element.select();
}
}

View File

@ -49,11 +49,12 @@ export class ConstantSignalSystem extends GameSystemWithFilter {
// Ok, query, but also save the uid because it could get stale
const uid = entity.uid;
const signal = entity.components.ConstantSignal.signal;
const signalValueInput = new FormElementInput({
id: "signalValue",
label: fillInLinkIntoTranslation(T.dialogs.editSignal.descShortKey, THIRDPARTY_URLS.shapeViewer),
placeholder: "",
defaultValue: "",
defaultValue: signal ? signal.getAsCopyableKey() : "",
validator: val => this.parseSignalCode(entity, val),
});