38 lines
1.1 KiB
Lua
38 lines
1.1 KiB
Lua
---@class WB_RoundStartTip_C:UUserWidget
|
|
---@field ShowRound UWidgetAnimation
|
|
---@field TextBlock_GamePoint UTextBlock
|
|
---@field TextBlock_Round UTextBlock
|
|
--Edit Below--
|
|
local WB_RoundStartTip = { bInitDoOnce = false }
|
|
|
|
|
|
function WB_RoundStartTip:Construct()
|
|
UGCEventSystem.AddListener(EventEnum.UpdateTeamScore, self.UpdateGamePoint, self)
|
|
UGCEventSystem.AddListener(EventEnum.NewRound, self.UpdateRoundCount, self)
|
|
end
|
|
|
|
function WB_RoundStartTip:UpdateGamePoint()
|
|
local LeftTeamScore = UGCGameSystem.GameState:GetTeamScore(1)
|
|
local RightTeamScore = UGCGameSystem.GameState:GetTeamScore(2)
|
|
if math.max(LeftTeamScore, RightTeamScore) >= GlobalConfigs.GameSetting.MaxRound // 2 then
|
|
self.TextBlock_GamePoint:SetVisibility(ESlateVisibility.SelfHitTestInvisible)
|
|
end
|
|
end
|
|
|
|
function WB_RoundStartTip:UpdateRoundCount(InRound)
|
|
self.TextBlock_Round:SetText(InRound)
|
|
end
|
|
|
|
function WB_RoundStartTip:OnShowPanel()
|
|
self:PlayAnimation(self.ShowRound, 0, 1, EUMGSequencePlayMode.Forward, 1);
|
|
end
|
|
|
|
-- function WB_RoundStartTip:Tick(MyGeometry, InDeltaTime)
|
|
|
|
-- end
|
|
|
|
-- function WB_RoundStartTip:Destruct()
|
|
|
|
-- end
|
|
|
|
return WB_RoundStartTip |