Skip to content

Commit 0d80ee2

Browse files
authored
Support text box editing via setting text attribute (#2483)
1 parent fa8f44e commit 0d80ee2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

OpenDreamClient/Interface/Controls/ControlInput.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ private void TextBox_OnSubmit(LineEdit.LineEditEventArgs lineEditEventArgs) {
2222
if (InputDescriptor.NoCommand.Value)
2323
return;
2424

25+
ResetText();
26+
2527
var command = InputDescriptor.Command.Value;
2628
if (command.StartsWith('!')) {
2729
_interfaceManager.RunCommand(lineEditEventArgs.Text);
2830
} else {
2931
_interfaceManager.RunCommand(command + lineEditEventArgs.Text);
3032
}
31-
32-
ResetText();
3333
}
3434

3535
protected override void UpdateElementDescriptor() {
@@ -55,6 +55,9 @@ public override void SetProperty(string property, string value, bool manualWinse
5555
if (focusValue.Value)
5656
_textBox.GrabKeyboardFocus();
5757
break;
58+
case "text":
59+
_textBox.Text = value;
60+
break;
5861
default:
5962
base.SetProperty(property, value, manualWinset);
6063
break;

0 commit comments

Comments
 (0)