36 lines
947 B
Lua
36 lines
947 B
Lua
---@class WB_MechanismInfo_C:UUserWidget
|
|
---@field Image_1 UImage
|
|
---@field Image_Icon UImage
|
|
---@field TextBlock_Name UTextBlock
|
|
--Edit Below--
|
|
---@type WB_MechanismInfo_C
|
|
local WB_MechanismInfo = { bInitDoOnce = false; };
|
|
|
|
--[==[ Construct
|
|
function WB_MechanismInfo:Construct()
|
|
|
|
end
|
|
-- Construct ]==]
|
|
|
|
-- function WB_MechanismInfo:Tick(MyGeometry, InDeltaTime)
|
|
|
|
-- end
|
|
|
|
-- function WB_MechanismInfo:Destruct()
|
|
|
|
-- end
|
|
|
|
function WB_MechanismInfo:UpdateInfo(MechanismType)
|
|
local IconInfo = MechanismConfig.MechanismIconInfo[MechanismType]
|
|
if IconInfo then
|
|
local IconTex = UGCSystemLibrary.LoadAsset(IconInfo.Icon, true)
|
|
if UE.IsValid(IconTex) then
|
|
self.Image_Icon:SetBrushFromTexture(IconTex)
|
|
self.Image_Icon:SetColorAndOpacity(IconInfo.Color)
|
|
end
|
|
end
|
|
local Name = MechanismConfig.MechanismTypeName[MechanismType]
|
|
self.TextBlock_Name:SetText(Name)
|
|
end
|
|
|
|
return WB_MechanismInfo; |