This commit is contained in:
wonkyhonky2024
2025-05-15 19:28:04 +01:00
parent 23691e77c2
commit ff30856c60
16 changed files with 109 additions and 33 deletions

View File

@ -1,37 +1,53 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "ModeInputTextBox.h"
#include <Logging/StructuredLog.h>
void UModeInputTextBox::HandleOnTextChanged(FText const & inText) {
Text = Text.GetEmpty();
auto & s = inText.ToString();
auto lastChar = s.LeftChop(1);
lastChar.ToUpperInline();
// UE_LOGFMT(LogTemp, Warning, "kill me {inText}", s);
auto lastChar = s.ToUpper().Right(1);
// UE_LOGFMT(LogTemp, Warning, "fucking {lastChar}", lastChar);
SetText(FText::FromString(lastChar));
if (!lastChar.IsEmpty()) {
switch (myTarget) {
case THSModeTarget::Energy:
switch (lastChar[0]) {
switch (lastChar[lastChar.Len() - 1]) {
case 'E':
break;
case 'X':
break;
default:
lastChar[lastChar.Len() - 1] = '\0';
break;
}
break;
case THSModeTarget::OpMode:
switch (lastChar[0]) {
switch (lastChar[lastChar.Len() - 1]) {
case 'T':
break;
case 'R':
break;
case 'P':
break;
default:
lastChar = "";
}
break;
default:
break;
}
}
// UE_LOGFMT(LogTemp, Warning, "wat {lastChar}", lastChar);
SetText(FText::FromString(lastChar));
// SetText(FText::FromString(FString::Printf(TEXT("%c"), lastChar)));
}