Compare commits

..

No commits in common. "1bc85f970aa5a2a25480a7aef82e4a96df01cd28" and "079fba5d8b24bd6f43e242619d25f8c00ad8fb50" have entirely different histories.

3 changed files with 4 additions and 30 deletions

BIN
Content/Widgets/HUD/BP_HUDWidget.uasset (Stored with Git LFS)

Binary file not shown.

View File

@ -15,35 +15,17 @@ UEXPComponent::UEXPComponent()
void UEXPComponent::IncrementEXP(int value)
{
int oldEXP = CurrentEXP;
int oldLevel = CurrentLevel;
// TODO: I should be updating the level here
CurrentEXP += value;
OnEXPGained.ExecuteIfBound(value);
CurrentLevel = FMath::Floor(CurrentEXP / 100.0f);
if (CurrentLevel != oldLevel)
{
OnEXPLevelUp.ExecuteIfBound(CurrentLevel);
}
OnEXPLevelUp.ExecuteIfBound(CurrentLevel);
}
void UEXPComponent::SetCurrentEXP(int value)
{
int oldEXP = CurrentEXP;
int oldLevel = CurrentLevel;
// TODO: I should be updating the level here
CurrentEXP = value;
OnEXPGained.ExecuteIfBound(value);
CurrentLevel = FMath::Floor(CurrentEXP / 100.0f);
if (CurrentLevel != oldLevel)
{
OnEXPLevelUp.ExecuteIfBound(CurrentLevel);
}
}
int UEXPComponent::GetCurrentEXP()
@ -64,11 +46,6 @@ void UEXPComponent::Reset()
OnEXPLevelUp.ExecuteIfBound(CurrentLevel);
}
float UEXPComponent::GetCurrentLevelPercent()
{
return (CurrentEXP % 100) / 100.0f;
}
// Called when the game starts
void UEXPComponent::BeginPlay()
{

View File

@ -42,9 +42,6 @@ public:
UFUNCTION(BlueprintCallable)
void Reset();
UFUNCTION(BlueprintCallable, BlueprintPure)
float GetCurrentLevelPercent();
protected:
// Called when the game starts
virtual void BeginPlay() override;