50 lines
1.6 KiB
Lua
50 lines
1.6 KiB
Lua
|
---@class WB_RoundStartTip_C:UUserWidget
|
||
|
---@field ShowRound UWidgetAnimation
|
||
|
---@field Image_5 UImage
|
||
|
---@field TextBlock_GamePoint UTextBlock
|
||
|
---@field TextBlock_Round UTextBlock
|
||
|
---@field TextBlock_Tip 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);
|
||
|
|
||
|
local IsAttacker = UGCGameSystem.GameState:PlayerIsAttacker(UGCSystemLibrary.GetLocalPlayerKey())
|
||
|
local MapModeType = UGCGameSystem.GameState:GetMapModeType()
|
||
|
|
||
|
if MapModeType == MapConfig.EModeType.AttackPoint and IsAttacker then
|
||
|
self.TextBlock_Tip:SetText("目标:淘汰敌方所有玩家或成功占点")
|
||
|
else
|
||
|
self.TextBlock_Tip:SetText("目标:淘汰敌方所有玩家")
|
||
|
end
|
||
|
|
||
|
end
|
||
|
|
||
|
-- function WB_RoundStartTip:Tick(MyGeometry, InDeltaTime)
|
||
|
|
||
|
-- end
|
||
|
|
||
|
-- function WB_RoundStartTip:Destruct()
|
||
|
|
||
|
-- end
|
||
|
|
||
|
return WB_RoundStartTip
|