float trash
This commit is contained in:
@ -6,12 +6,13 @@ void UMagicFloatInput::HandleOnTextCommitted(
|
||||
FText const & inText,
|
||||
ETextCommit::Type inCommitMethod
|
||||
) {
|
||||
double x = 0.0;
|
||||
if (inText.IsEmptyOrWhitespace()) {
|
||||
if (sourceInput != nullptr) {
|
||||
SetText(sourceInput->GetText());
|
||||
} else {
|
||||
auto x = FCString::Atof(*inText.ToString());
|
||||
SetText(FText::FromString(FString::Printf(TEXT("%.7f"), x)));
|
||||
x = FCString::Atod(*sourceInput->GetText().ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
x = FCString::Atod(*inText.ToString());
|
||||
|
||||
SetText(FText::FromString(FString::Printf(TEXT("%.7f"), x)));
|
||||
}
|
||||
|
@ -8,4 +8,19 @@ void UMyUserWidget::NativeOnInitialized() {
|
||||
if (ps == nullptr)
|
||||
return;
|
||||
opIdTextBlock->SetText(FText::FromString(ps->GetPlayerName()));
|
||||
UTextBlock * arcaneNumbers[9] = {
|
||||
URM_TextBlock,
|
||||
MU_TextBlock,
|
||||
Time_TextBlock,
|
||||
GR_TextBlock,
|
||||
CR_TextBlock,
|
||||
ColX_TextBlock,
|
||||
ColY_TextBlock,
|
||||
WR_TextBlock,
|
||||
AN_TextBlock
|
||||
};
|
||||
for (auto * n : arcaneNumbers) {
|
||||
auto x = FCString::Atod(*n->GetText().ToString());
|
||||
n->SetText(FText::FromString(FString::Printf(TEXT("%.7f"), x)));
|
||||
}
|
||||
}
|
||||
|
5
Source/MyProject/Private/VerifierTextBlock.cpp
Normal file
5
Source/MyProject/Private/VerifierTextBlock.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "VerifierTextBlock.h"
|
||||
|
Reference in New Issue
Block a user