Jump to content

Inventory slot color


Recommended Posts

Hi,

 

I would like to ask what affects the inventory slot color? Like for example the inventory slot color for the icebox and insulated pack are blue. Is it possible to add other colors? Thanks

Link to comment
Share on other sites

@vteam7 @Mobbstar
How bout this?

inv_slot.bgimage:SetTint()

Used in this mod.


For reference:
local function TintingPostInit(self, num, atlas, bgim, owner, container)	if container.widgetbgimagetint then		self.bgimage:SetTint(container.widgetbgimagetint.r, container.widgetbgimagetint.g, container.widgetbgimagetint.b, container.widgetbgimagetint.a)	endendAddClassPostConstruct("widgets/invslot", TintingPostInit) 
inst.components.container.widgetbgimagetint = {r=.44,g=.74,b=1,a=1} 

 

Two differences in this approach:

  • Uses internal tint function instead of swapping the image completely
  • Overrides the invslot widget beforehand instead of indexing through tables to find the already-created widget.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...