4fc4a39aa6
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
45 lines
991 B
C++
45 lines
991 B
C++
// ChildHood Project - 收集进度 UI 实现
|
|
|
|
#include "Collection/CollectionProgressWidget.h"
|
|
#include "Components/TextBlock.h"
|
|
|
|
void UCollectionProgressWidget::NativeOnInitialized()
|
|
{
|
|
Super::NativeOnInitialized();
|
|
}
|
|
|
|
void UCollectionProgressWidget::UpdateProgress(int32 Current, int32 Total)
|
|
{
|
|
if (ProgressTextBlock)
|
|
{
|
|
// 格式:「📦 杂物 X/Y」(执行案第三节)。图标 emoji 在文本中,品类名 v0.1 固定「杂物」。
|
|
ProgressTextBlock->SetText(FText::FromString(
|
|
FString::Printf(TEXT("📦 杂物 %d/%d"), Current, Total)));
|
|
}
|
|
}
|
|
|
|
void UCollectionProgressWidget::SetCompleteStyle()
|
|
{
|
|
if (ProgressTextBlock)
|
|
{
|
|
// 文字变金色(全部收集完成表现)
|
|
ProgressTextBlock->SetColorAndOpacity(CompleteColor);
|
|
}
|
|
}
|
|
|
|
void UCollectionProgressWidget::PlayBounceAnimation()
|
|
{
|
|
if (BounceAnim)
|
|
{
|
|
PlayAnimation(BounceAnim);
|
|
}
|
|
}
|
|
|
|
void UCollectionProgressWidget::PlayCompleteAnimation()
|
|
{
|
|
if (CompleteAnim)
|
|
{
|
|
PlayAnimation(CompleteAnim);
|
|
}
|
|
}
|