#I'm using a TextEdit node to create a commandline in C#. I need help opening different menus though.

1 messages · Page 1 of 1 (latest)

limpid eagle
#

In C#, C++, Python, etc., I have easily created commandlines in the Console. But using the TextEdit node in UI is more complicated, I need the user to be able to open different menus that allow different commands.

#

Example C# Code in Console:

#

``cs

``

#

uhm

#

what just happened

#

I'm using ``

#

cs while (command != "!") { }

#

what is this, it's not working in this server

pure ferry
limpid eagle
#
Console.WriteLine("<<<<<<----!!!!!This is an example!!!!!---->>>>>>");
var command = Console.ReadLine();
while (command != "!") {
  if (command.ToLower().Contains("help")) {
    Console.WriteLine("Available commands: FILE, HELP, RETURN, CLEAR");
    command = Console.ReadLine(); // Returns commands ReadLine()
  }
  else if (command.ToLower().Contains("")) {
    var fileMenu = Console.ReadLine();
    while (fileMenu != "<") {
      Console.WriteLine("Files: PC, PASSWORDS, GOOF");
      if (fileMenu.ToLower().Contains("PC")) {
        Console.WriteLine("PC/ > ");
        fileMenu = Console.ReadLine(); // Returns fileMenus ReadLine()
      }
      else if (fileMenu = "<") {
        fileMenu = "!"; // Exits fileMenus ReadLine()
        command = Console.ReadLine(); // Returns ReadLine to command Menu
      }
    }
  }
}
#

How would I replicate this in Godot TextEdit C#
(notes: i am aware of how to read only last line, i am aware how to make only last line editable, i am aware how to replace and add text on the TextEdit using Text = "";)

#

using while in godot freezes the engine

#

i can't redefine command

#

CAN I redefine command somehow?

#

hypothetical >>>

string fileMenu;
command = fileMenu;
```???
limpid eagle
#

Can I replicate while loops to create the commandline script somehow?

#

While loops freeze the program

#

is there another method of doing this?