26 lines
886 B
Lua
Raw Permalink Normal View History

2025-01-04 23:00:19 +08:00
---@class WB_BuffDescItem_C:UUserWidget
---@field Image_God UImage
---@field Image_Icon UImage
---@field TextBlock_Desc UTextBlock
---@field WidgetSwitcher_IsGod UWidgetSwitcher
--Edit Below--
local WB_BuffDescItem = { bInitDoOnce = false; };
function WB_BuffDescItem:Init(IsGod, InIncreaseType)
if IsGod then
self.WidgetSwitcher_IsGod:SetActiveWidgetIndex(1)
self.TextBlock_Desc:SetText(GodOfWarConfig.GodOfWarDesc)
else
self.WidgetSwitcher_IsGod:SetActiveWidgetIndex(0)
-- 设置图案
UGCSystemLibrary.AsyncLoadAsset(GodOfWarConfig.IncreaseIcon[InIncreaseType], function(Tex)
if UE.IsValid(Tex) then
self.Image_Icon:SetBrushFromTexture(Tex, false)
end
end, nil, true)
self.TextBlock_Desc:SetText(GodOfWarConfig.IncreaseDesc[InIncreaseType])
end
end
return WB_BuffDescItem;