Deicon Posted September 3, 2020 Share Posted September 3, 2020 Hello. I'm trying to understand how widgets work, someone could give a didactic explanation. An explanation of when to use AddClassPostConstruct (); Class (Widget, function (self, ...)). For example, if I want to remove that inventory bar, image below, and add another image, what should I do? Thanks in advance. Link to comment Share on other sites More sharing options...
Deicon Posted September 4, 2020 Author Share Posted September 4, 2020 For the example above, I solved it with the code below. But I still want an explanation of how the widgets work, if anyone can do this favor, I appreciate it. AddClassPostConstruct("widgets/inventorybar", function(self, owner) self.bgcover:Kill() self.bg:Kill() repeat table.remove(self.equipslotinfo) until #self.equipslotinfo==0 function Inv:SelectDefaultSlot() end end) Link to comment Share on other sites More sharing options...
penguin0616 Posted September 6, 2020 Share Posted September 6, 2020 (edited) Widgets are UI elements. AddClassPostConstruct is called whenever the specified widget type is made. Beyond that, there isn't really anything super special. The Class function is just used for making a class. Edited September 6, 2020 by penguin0616 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now