71 lines
2.3 KiB
Lua
71 lines
2.3 KiB
Lua
---@class W_WaitPlayJoin_C:UUserWidget
|
|
---@field CanvasPanel_IDPanel UCanvasPanel
|
|
---@field Overlay_WaitTime UOverlay
|
|
---@field REINST_WB_SelectMap_C_0 UWB_SelectMap_C
|
|
---@field TextBlock_BID UTextBlock
|
|
---@field TextBlock_EID UTextBlock
|
|
---@field TextBlock_MapName UTextBlock
|
|
---@field TextBlock_PID UTextBlock
|
|
---@field TextBlock_WaitTime UTextBlock
|
|
---@field WB_SelectChallenge UWB_SelectTeam_C
|
|
---@field WB_SelectMap UWB_SelectMap_C
|
|
--Edit Below--
|
|
---@type W_WaitPlayJoin_C
|
|
local W_WaitPlayJoin = {
|
|
bInitDoOnce = false;
|
|
bSelected = false;
|
|
SelectMapType = -1;
|
|
bLoading = false;
|
|
};
|
|
|
|
|
|
function W_WaitPlayJoin:Construct()
|
|
self.WB_SelectChallenge:LuaInit()
|
|
self.WB_SelectMap:LuaInit()
|
|
|
|
self.TextBlock_WaitTime:BindingProperty("Text", self.TextBlock_WaitTime_Text, self)
|
|
UGCEventSystem.AddListener(EventEnum.GameWillBegin, self.GameWillBegin, self)
|
|
UGCEventSystem.AddListener(EventEnum.UpdateMapKey, self.UpdateMapIndex, self)
|
|
|
|
self:UpdateMapIndex(UGCGameSystem.GameState:GetMapKey())
|
|
|
|
-- 设置对局ID
|
|
UGCEventSystem.SetTimer(self, function()
|
|
local PID, BID = WidgetLibrary.GetGameID();
|
|
UGCLogSystem.Log("[WB_SelectMap_LuaInit] PID = %s, BID = %s", tostring(PID), tostring(BID));
|
|
self.TextBlock_PID:SetText(PID);
|
|
self.TextBlock_BID:SetText(BID);
|
|
end, 5);
|
|
|
|
end
|
|
|
|
function W_WaitPlayJoin:UpdateMapIndex(InMapKey)
|
|
if InMapKey <= 0 then return end
|
|
self.WB_SelectChallenge:SetVisibility(ESlateVisibility.Collapsed)
|
|
self.Overlay_WaitTime:SetVisibility(ESlateVisibility.Collapsed)
|
|
|
|
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; |