Still Coding

Still hammering away at the big GMod update. And I’m loving it. It feels good to fix all of the stuff that has annoyed me over the years – but I’ve been too scared to touch. I don’t think I’m going to break as much stuff as people expect – I haven’t come across anything on toybox that has broken in the new update.

One of the things I’m changing is DPanelList. If you’ve done a lot of GUI work in Lua you probably know what this is. It’s a panel that organises panels inside itself, and adds a scrollbar if it overflows. It’s also a huge mess. Over the years it’s been added to and bent to be used in situations it really shouldn’t have been.

In the new update I’m phasing it out. I’m phasing the way it works out too. We have a panel:GetChildren() now – so there’s no need for a panel like DPanelList to keep track of its children in an .Items table. Because we’re using GetChildren the order they’re stored in becomes important (the first one will be at the top, then the second one etc).

Instead of having a one size fits all solution like DPanelList – I’m moving towards general layout panels (DLineLayout, DIconLayout). These new layout panels don’t automatically add a scrollbar, so you have to dock them to a DScrollPanel to get scrolling functionality. This cleans everything up.

I probably won’t chop DPanelList out of the next update completely – but it won’t be updated with the newer derma features like the new style or the drag and drop stuff – and it’s usage will be discouraged.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s