Lost_Edge/Source/Lost_Edge/Private/Widgets/AutohideWidget.cpp

22 lines
696 B
C++

// Oleg Petruny proprietary.
#include "AutohideWidget.h"
#include "Animation/WidgetAnimation.h"
#include "Engine/World.h"
#include "TimerManager.h"
void UAutohideWidget::Show()
{
SetVisibility(ESlateVisibility::Visible);
if(!showTimer.IsValid())
PlayAnimation(showAnimation, GetAnimationCurrentTime(showAnimation), 1, EUMGSequencePlayMode::Forward, 1, false);
GetWorld()->GetTimerManager().SetTimer(showTimer, this, &UAutohideWidget::Hide, showDuration, false);
}
void UAutohideWidget::Hide()
{
GetWorld()->GetTimerManager().ClearTimer(showTimer);
PlayAnimation(showAnimation, GetAnimationCurrentTime(showAnimation), 1, EUMGSequencePlayMode::Reverse, 1, false);
}