38 lines
970 B
Lua
38 lines
970 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)
|
||
|
local ItemInfo = UGCItemSystem.GetItemData(InID);
|
||
|
if ItemInfo then
|
||
|
UGCSystemLibrary.AsyncLoadAsset(ItemInfo.ItemSmallIcon_n,
|
||
|
function(Tex)
|
||
|
self.Image_PartIcon:SetBrushFromTexture(Tex);
|
||
|
end , nil
|
||
|
,true)
|
||
|
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;
|