Jump to content

Recommended Posts

Hi, I have made new item tile, but I can't make it to update itself if some item enters/leaves inventory...

Function Inventory:SetOverflow(over), is updating it, but I can't use it... because it have important use...

Alternatively I can use it with changing overflow to same overflow...

Edited by zetake
Link to comment
https://forums.kleientertainment.com/forums/topic/110300-solved-item-tile/
Share on other sites

I don't know how I missed it, but updating is doing listener setoverflow.

widgets/inventorybar:

self.inst:ListenForEvent("setoverflow", function(inst, data) self:Rebuild() end, self.owner)

self:Rebuild()

Ok Solved.

Spoiler

AddClassPostConstruct("widgets/inventorybar", function(self, inst)
	self.inst:ListenForEvent("my_event", function(inst, data) self:Rebuild() end, self.owner)
end)

 

Edited by zetake

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...