50 lines
1.6 KiB
Lua
50 lines
1.6 KiB
Lua
---@class W_WaitPlayJoin_C:UUserWidget
|
|
---@field Overlay_WaitTime UOverlay
|
|
---@field TextBlock_MapName UTextBlock
|
|
---@field TextBlock_WaitTime UTextBlock
|
|
---@field WB_SelectChallenge UWB_SelectChallenge_C
|
|
--Edit Below--
|
|
---@type W_WaitPlayJoin_C
|
|
local W_WaitPlayJoin = {
|
|
bInitDoOnce = false;
|
|
bSelected = false;
|
|
SelectMapType = -1;
|
|
bLoading = false;
|
|
};
|
|
|
|
|
|
function W_WaitPlayJoin:Construct()
|
|
self.TextBlock_WaitTime:BindingProperty("Text", self.TextBlock_WaitTime_Text, self)
|
|
UGCEventSystem.AddListener(EventEnum.GameWillBegin, self.GameWillBegin, self)
|
|
UGCEventSystem.AddListener(EventEnum.UpdateMapKey, self.UpdateMapName, self)
|
|
|
|
self:UpdateMapName(UGCGameSystem.GameState:GetMapKey())
|
|
|
|
end
|
|
|
|
function W_WaitPlayJoin:UpdateMapName(InMapKey)
|
|
local MiniMapInfo = MapConfig.MapInfo[InMapKey]
|
|
if MiniMapInfo then
|
|
local SpecialModeName = ""
|
|
if MiniMapInfo.SpecialModeType ~= MapConfig.ESpecialModeType.Default then
|
|
SpecialModeName = " - " .. MapConfig.SpecialModeName[MiniMapInfo.SpecialModeType]
|
|
end
|
|
local ShowName = MiniMapInfo.ShowName .. SpecialModeName
|
|
self.TextBlock_MapName:SetText(ShowName)
|
|
end
|
|
end
|
|
|
|
function W_WaitPlayJoin:OnClosePanel()
|
|
self.bLoading = false
|
|
WidgetManager:DestroyPanel(WidgetConfig.EUIType.WaitingTime)
|
|
end
|
|
|
|
function W_WaitPlayJoin:TextBlock_WaitTime_Text(ReturnValue)
|
|
return tostring(UGCGameSystem.GameState:GetGameTime())
|
|
end
|
|
|
|
function W_WaitPlayJoin:GameWillBegin()
|
|
UGCEventSystem.SendEvent(EventEnum.AddTip, TipConfig.TipType.GameWillStart)
|
|
end
|
|
|
|
return W_WaitPlayJoin; |