okey-dokey
This commit is contained in:
@ -6,5 +6,32 @@ void UModeInputTextBox::HandleOnTextChanged(FText const & inText) {
|
||||
auto & s = inText.ToString();
|
||||
auto lastChar = s.LeftChop(1);
|
||||
lastChar.ToUpperInline();
|
||||
if (!lastChar.IsEmpty()) {
|
||||
|
||||
switch (myTarget) {
|
||||
case THSModeTarget::Energy:
|
||||
switch (lastChar[0]) {
|
||||
case 'E':
|
||||
break;
|
||||
case 'X':
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case THSModeTarget::OpMode:
|
||||
switch (lastChar[0]) {
|
||||
case 'T':
|
||||
break;
|
||||
case 'R':
|
||||
break;
|
||||
case 'P':
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
SetText(FText::FromString(lastChar));
|
||||
}
|
||||
|
34
Source/MyProject/Private/TheracSimComponent.cpp
Normal file
34
Source/MyProject/Private/TheracSimComponent.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "TheracSimComponent.h"
|
||||
|
||||
// Sets default values for this component's properties
|
||||
UTheracSimComponent::UTheracSimComponent()
|
||||
{
|
||||
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
|
||||
// off to improve performance if you don't need them.
|
||||
PrimaryComponentTick.bCanEverTick = true;
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
// Called when the game starts
|
||||
void UTheracSimComponent::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
// ...
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Called every frame
|
||||
void UTheracSimComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
||||
{
|
||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
||||
|
||||
// ...
|
||||
}
|
||||
|
@ -6,6 +6,12 @@
|
||||
#include "CoreMinimal.h"
|
||||
#include "ModeInputTextBox.generated.h"
|
||||
|
||||
UENUM()
|
||||
enum class THSModeTarget : uint8 {
|
||||
Energy,
|
||||
OpMode
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ -14,5 +20,8 @@ class MYPROJECT_API UModeInputTextBox : public UEditableTextBox {
|
||||
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere)
|
||||
THSModeTarget myTarget;
|
||||
|
||||
void HandleOnTextChanged(FText const & inText) override;
|
||||
};
|
||||
|
28
Source/MyProject/Public/TheracSimComponent.h
Normal file
28
Source/MyProject/Public/TheracSimComponent.h
Normal file
@ -0,0 +1,28 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Components/ActorComponent.h"
|
||||
#include "TheracSimComponent.generated.h"
|
||||
|
||||
|
||||
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
|
||||
class MYPROJECT_API UTheracSimComponent : public UActorComponent
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Sets default values for this component's properties
|
||||
UTheracSimComponent();
|
||||
|
||||
protected:
|
||||
// Called when the game starts
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
// Called every frame
|
||||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||
|
||||
|
||||
};
|
Reference in New Issue
Block a user