Files
TheracUE/Source/MyProject/Private/MyUserWidget.cpp

46 lines
1.1 KiB
C++
Raw Normal View History

2025-05-06 21:24:10 +01:00
// Fill out your copyright notice in the Description page of Project Settings.
#include "MyUserWidget.h"
#include <MyPlayerState.h>
2025-05-06 21:24:10 +01:00
2025-05-15 19:28:04 +01:00
bool UMyUserWidget::AllVerified() {
UTextBlock * myVerifiers[9] = {
URM_Verifier,
MU_Verifier,
Time_Verifier,
GR_Verifier,
CR_Verifier,
ColX_Verifier,
ColY_Verifier,
WN_Verifier,
AN_Verifier
};
for (auto & v : myVerifiers) {
if (v->GetText().IsEmpty())
return false;
}
return true;
}
2025-05-06 21:24:10 +01:00
void UMyUserWidget::NativeOnInitialized() {
2025-05-09 16:02:07 +01:00
auto ps = StaticCast<AMyPlayerState *>(GetOwningPlayerState());
if (ps == nullptr)
return;
opIdTextBlock->SetText(FText::FromString(ps->GetPlayerName()));
2025-05-09 22:20:16 +01:00
UTextBlock * arcaneNumbers[9] = {
URM_TextBlock,
MU_TextBlock,
Time_TextBlock,
GR_TextBlock,
CR_TextBlock,
ColX_TextBlock,
ColY_TextBlock,
WN_TextBlock,
2025-05-09 22:20:16 +01:00
AN_TextBlock
};
for (auto * n : arcaneNumbers) {
auto x = FCString::Atod(*n->GetText().ToString());
n->SetText(FText::FromString(FString::Printf(TEXT("%.7f"), x)));
}
2025-05-09 16:02:07 +01:00
}