Implement INPUTNAME string opcodes

This commit is contained in:
gamer147
2026-07-29 13:21:15 -04:00
parent 862b74ecbc
commit feef18d411
12 changed files with 443 additions and 4 deletions

View File

@@ -69,6 +69,7 @@ public partial class Main : Godot.Control
private Sys4RegIniStore? _sys4RegIniStore;
private VirtualMachine _vm = null!;
private GodotAdvHost _host = null!;
private FullwidthTextEditorDialog? _fullwidthTextEditor;
private Sys4ScriptProvider? _scripts;
private DebugSceneLauncher? _debugSceneLauncher;
private IReadOnlyList<DebugSceneEntry> _debugSceneEntries = System.Array.Empty<DebugSceneEntry>();
@@ -928,6 +929,26 @@ public partial class Main : Godot.Control
}
}
public void ShowAgeFullwidthTextEditor(string initialText)
{
if (_fullwidthTextEditor != null)
{
GD.PushWarning("[inputname] replaced an already-open full-width text editor");
_fullwidthTextEditor.QueueFree();
}
var editor = new FullwidthTextEditorDialog();
_fullwidthTextEditor = editor;
editor.EditCompleted += (accepted, text) =>
{
if (_fullwidthTextEditor == editor) _fullwidthTextEditor = null;
_host?.CompleteFullwidthTextEdit(accepted, text);
editor.QueueFree();
};
AddChild(editor);
editor.Open(initialText);
}
public override void _ExitTree()
{
bool vmStopped = true;