44 lines
957 B
Lua
Raw Normal View History

2025-01-04 23:00:19 +08:00
---@class WB_PID_C:UUserWidget
---@field CanvasPanel_IDPanel UCanvasPanel
---@field TextBlock_BID UTextBlock
---@field TextBlock_EID UTextBlock
---@field TextBlock_PID UTextBlock
--Edit Below--
local WB_PID = { bInitDoOnce = false }
function WB_PID:Construct()
self:LuaInit();
end
function WB_PID:LuaInit()
if self.bInitDoOnce then return ; end
self.bInitDoOnce = true;
if GameDataTable.PID then
self.TextBlock_PID:SetText(GameDataTable.PID);
self.TextBlock_BID:SetText(GameDataTable.BID);
else
self:SetIDs();
-- 延迟获取
UGCEventSystem.SetTimer(self, function()
self:SetIDs();
end, 5)
end
end
function WB_PID:SetIDs()
local PID, BID = UITool.GetGameID();
UGCLogSystem.Log("[WB_PID:SetIDs] PID = %s, BID = %s", tostring(PID), tostring(BID));
self.TextBlock_PID:SetText(PID);
self.TextBlock_BID:SetText(BID);
end
-- function WB_PID:Tick(MyGeometry, InDeltaTime)
-- end
-- function WB_PID:Destruct()
-- end
return WB_PID