44 lines
1.2 KiB
Lua
44 lines
1.2 KiB
Lua
|
---@class WB_ShowMapInfo_C:UUserWidget
|
||
|
---@field HorizontalBox_Recommend UHorizontalBox
|
||
|
---@field VerticalBox_MechanismInfo UVerticalBox
|
||
|
--Edit Below--
|
||
|
local WB_ShowMapInfo = { bInitDoOnce = false; };
|
||
|
|
||
|
--[==[ Construct
|
||
|
function WB_ShowMapInfo:Construct()
|
||
|
|
||
|
end
|
||
|
-- Construct ]==]
|
||
|
|
||
|
-- function WB_ShowMapInfo:Tick(MyGeometry, InDeltaTime)
|
||
|
|
||
|
-- end
|
||
|
|
||
|
-- function WB_ShowMapInfo:Destruct()
|
||
|
|
||
|
-- end
|
||
|
|
||
|
function WB_ShowMapInfo:UpdateMapInfo(MapInfo)
|
||
|
local Index = 0;
|
||
|
for i = 1, self.HorizontalBox_Recommend:GetChildrenCount() do
|
||
|
local Item = self.HorizontalBox_Recommend:GetChildAt(i - 1)
|
||
|
if i <= MapInfo.Recommend then
|
||
|
Item:SetVisibility(ESlateVisibility.Visible)
|
||
|
else
|
||
|
Item:SetVisibility(ESlateVisibility.Hidden)
|
||
|
end
|
||
|
end
|
||
|
for i, MechanismType in pairs(MapInfo.MapMechanisms) do
|
||
|
if table.hasValue(MechanismConfig.TriggerMechanismType, MechanismType) then
|
||
|
local Item = self.VerticalBox_MechanismInfo:GetChildAt(Index)
|
||
|
if Item then
|
||
|
Item:UpdateInfo(MechanismType)
|
||
|
else
|
||
|
break
|
||
|
end
|
||
|
Index = Index + 1
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
return WB_ShowMapInfo;
|