2025-01-04 23:00:19 +08:00

34 lines
881 B
Lua

---@class WB_OtherPartItem_C:UUserWidget
---@field Image_PartIcon UImage
---@field TextBlock_Count UTextBlock
--Edit Below--
local WB_OtherPartItem = { bInitDoOnce = false; };
--[==[ Construct
function WB_OtherPartItem:Construct()
end
-- Construct ]==]
-- function WB_OtherPartItem:Tick(MyGeometry, InDeltaTime)
-- end
-- function WB_OtherPartItem:Destruct()
-- end
function WB_OtherPartItem:SetItemID(InID, Count)
if ItemTable.AllItem[InID] then
local Tex = UGCSystemLibrary.LoadAsset(ItemTable.AllItem[InID].SmallPic, true)
self.Image_PartIcon:SetBrushFromTexture(Tex);
end
if Count <= 1 then
self.TextBlock_Count:SetVisibility(ESlateVisibility.Collapsed)
else
self.TextBlock_Count:SetText(tostring(Count))
self.TextBlock_Count:SetVisibility(ESlateVisibility.HitTestInvisible)
end
end
return WB_OtherPartItem;