Files
TheracUE/Source/MyProject/Private/MyUserWidget.cpp
wonkyhonky2024 8e1b4928a9 float trash
2025-05-09 22:20:42 +01:00

27 lines
735 B
C++

// Fill out your copyright notice in the Description page of Project Settings.
#include "MyUserWidget.h"
#include <MyPlayerState.h>
void UMyUserWidget::NativeOnInitialized() {
auto ps = StaticCast<AMyPlayerState *>(GetOwningPlayerState());
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)));
}
}