58 lines
1.5 KiB
Lua
58 lines
1.5 KiB
Lua
|
---@class WBP_NoticeBase_C:UUserWidget
|
||
|
--Edit Below--
|
||
|
local WBP_NoticeBase = {
|
||
|
bInitDoOnce = false,
|
||
|
}
|
||
|
|
||
|
function WBP_NoticeBase:Construct()
|
||
|
WBP_NoticeBase.SuperClass.Construct(self)
|
||
|
end
|
||
|
|
||
|
function WBP_NoticeBase:Destruct()
|
||
|
WBP_NoticeBase.SuperClass.Destruct(self)
|
||
|
end
|
||
|
|
||
|
function WBP_NoticeBase:InitNoticeFromParam(InParams)
|
||
|
end
|
||
|
|
||
|
function WBP_NoticeBase:GetEnterAnimation()
|
||
|
return nil
|
||
|
end
|
||
|
|
||
|
function WBP_NoticeBase:GetExitAnimation()
|
||
|
return nil
|
||
|
end
|
||
|
|
||
|
function WBP_NoticeBase:ShowEnterAnimation()
|
||
|
self:SetVisibility(ESlateVisibility.SelfHitTestInvisible)
|
||
|
local ExitAnim = self:GetExitAnimation()
|
||
|
if ExitAnim and self:IsAnimationPlaying(ExitAnim) then
|
||
|
self:UnbindAllFromAnimationFinished(ExitAnim)
|
||
|
self:StopAnimation(ExitAnim)
|
||
|
end
|
||
|
|
||
|
local EnterAnim = self:GetEnterAnimation()
|
||
|
if EnterAnim then
|
||
|
self:PlayAnimation(EnterAnim, 0.0, 1, EUMGSequencePlayMode.Forward, 1.0)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
function WBP_NoticeBase:DefaultClose()
|
||
|
local ExitAnim = self:GetExitAnimation()
|
||
|
if ExitAnim then
|
||
|
local AnimFinishDelegate = ObjectExtend.CreateDelegate(self,
|
||
|
function()
|
||
|
self:CloseNotice()
|
||
|
end)
|
||
|
self:BindToAnimationFinished(ExitAnim, AnimFinishDelegate)
|
||
|
self:PlayAnimation(ExitAnim, 0.0, 1, EUMGSequencePlayMode.Forward, 1.0)
|
||
|
else
|
||
|
self:CloseNotice()
|
||
|
end
|
||
|
end
|
||
|
|
||
|
function WBP_NoticeBase:CloseNotice()
|
||
|
self:SetVisibility(ESlateVisibility.Collapsed)
|
||
|
end
|
||
|
|
||
|
return WBP_NoticeBase;
|