ha I see all questions are solved now?
I have some thoughts I wanted to share.
FText is used for visual output. FText can be gathered for localization and linked to a key. Never tested it to run “opposite” from say chinese to english for command processing but you might be onto something. I’d just go with english, CLI is always in english afaik?
You are conflicting with the default focusing system and with Slate its navigation input here (up down, right left, tab, shift tab, enter, esc etc.). Widgets do have a delegate for when they lose focus, so you could let the HUD say “when this widget loses focus, attempt to focus it again!” which is still hacky but much less than the current approach, because you still have the opportunity to change focus to another button (close game for example). You might still run into the original problem with the original text input widget handling input differently than you want then.
I never use std, UE has built in libs. For example you can do:
const FString YourString = "SomeText";
for (const TCHAR& CharX : YourString.GetCharArray()) {
if (FChar::IsAlpha(CharX)
// Process a b c d e
}
else if (FChar::IsDigit(CharX)) {
// Process 1 2 3 4
}
}
You could split up the string used as input in the textbox by whitespace using FString methods into a new string array, then parse that array as arguments for your custom console.
A list? Aren’t they mapped directly to methods or to classes? I would probably create utility classes mapped to the first word in the command string. Something like:
TMap<FString, UCommandUtility*> Utilities;
Utilities.Add(TEXT("Screenshot"), NewObject<UScreenshotUtility>(this));
const FString MyCommand = TEXT("Screenshot -x 1920 -y 1080");
// ProcessCommand(MyCommand):
// Get first argument of string split by whitespace.
// Find utility in utility map by using first argument as key
// Pass other arguments to utility.
You don’t need to optimize this, the engine is a million times heavy itself for a console program.