Files
TheracUE/Source/MyProject/Private/ModeInputTextBox.cpp
wonkyhonky2024 ff30856c60 Phuket
2025-05-15 19:28:18 +01:00

54 lines
1.2 KiB
C++

// 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();
// 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[lastChar.Len() - 1]) {
case 'E':
break;
case 'X':
break;
default:
lastChar[lastChar.Len() - 1] = '\0';
break;
}
break;
case THSModeTarget::OpMode:
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)));
}