- Renomeia ~50 classes UCLASS/USTRUCT/UENUM/UINTERFACE pra Zeus* (AZeusGameMode, AZeusCharacter, UZeusGameInstance, IZeusEntityInterface, UZeusWorldSubsystem, FZeusEntitySnapshot, etc.) - Encurta AZMMOPlayerCharacter -> AZeusCharacter - Renomeia módulos satélite ZMMOAttributes -> ZeusAttributes e ZMMOJobs -> ZeusJobs (pasta + .Build.cs + .uproject) - Mantém módulo principal ZMMO (renomeia depois quando jogo ganhar nome) - DefaultEngine.ini: ActiveClassRedirects ZMMOX -> ZeusX (preserva BPs/assets) - DefaultGame.ini: sections atualizadas pra ZeusThemeSubsystem/ZeusPlayerState - Category="ZMMO|..." -> "Zeus|..." em UPROPERTYs - Preserva LogZMMO, ZMMO_API, /Script/ZMMO., /Game/ZMMO/, classes Target Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#include "ZeusHudHpSpWidget.h"
|
|
|
|
#include "Components/ProgressBar.h"
|
|
#include "Components/TextBlock.h"
|
|
#include "Internationalization/Text.h"
|
|
|
|
void UZeusHudHpSpWidget::ApplySnapshot(const FZeusAttributesSnapshot& Snapshot)
|
|
{
|
|
LastSnapshot = Snapshot;
|
|
OnSnapshotApplied(Snapshot);
|
|
}
|
|
|
|
void UZeusHudHpSpWidget::ApplyHpSp(int32 Hp, int32 MaxHp, int32 Sp, int32 MaxSp)
|
|
{
|
|
LastSnapshot.Hp = Hp;
|
|
LastSnapshot.MaxHp = MaxHp;
|
|
LastSnapshot.Sp = Sp;
|
|
LastSnapshot.MaxSp = MaxSp;
|
|
|
|
if (HpBar)
|
|
{
|
|
HpBar->SetPercent(MaxHp > 0 ? static_cast<float>(Hp) / static_cast<float>(MaxHp) : 0.f);
|
|
}
|
|
if (SpBar)
|
|
{
|
|
SpBar->SetPercent(MaxSp > 0 ? static_cast<float>(Sp) / static_cast<float>(MaxSp) : 0.f);
|
|
}
|
|
if (HpText)
|
|
{
|
|
HpText->SetText(FText::FromString(FString::Printf(TEXT("%d / %d"), Hp, MaxHp)));
|
|
}
|
|
if (SpText)
|
|
{
|
|
SpText->SetText(FText::FromString(FString::Printf(TEXT("%d / %d"), Sp, MaxSp)));
|
|
}
|
|
}
|
|
|
|
void UZeusHudHpSpWidget::OnSnapshotApplied_Implementation(const FZeusAttributesSnapshot& Snapshot)
|
|
{
|
|
ApplyHpSp(Snapshot.Hp, Snapshot.MaxHp, Snapshot.Sp, Snapshot.MaxSp);
|
|
if (LevelText)
|
|
{
|
|
LevelText->SetText(FText::FromString(FString::Printf(TEXT("Lv %d"), Snapshot.BaseLevel)));
|
|
}
|
|
}
|