General > Developers Corner
DListView
Stickly Man!:
No problem! ;D
--- Quote from: chaos13125 on June 27, 2014, 07:01:38 AM ---For a DListView, is it possible to have it select a line, like as in when you open the menu, it already has a selected line selected, via listingID?
--- End quote ---
Not sure what you're asking here exactly- but DListView's do support multiselect, and you can force lines to be selected by using DListView:SelectItem(Panel Line), but you'll need to have a reference to the line object itself (or get it with :GetLine(id)).
--- Quote from: chaos13125 on June 27, 2014, 07:01:38 AM ---Secondly, how does one get a listing of all the current models in the server? Because I'm pretty sure it's possible?
--- End quote ---
I haven't looked at how Gmod13 handles models- I've only ever needed to get a list of playermodels, which I was able to do using player_manager.AllValidModels().
Hope that helps!
Bite That Apple:
I'll check out the second thing later, and hopefully get back to you on that. Though, as for the first part, I'm getting this error, and I'm not really sure why.
--- Code: ---[ERROR] lua/vgui/dlistview.lua:578: attempt to index local 'Item' (a number valu
e)
1. SelectItem - lua/vgui/dlistview.lua:578
2. unknown - gamemodes/tdm2/gamemode/menu/cl_menu.lua:1825
3. unknown - lua/includes/modules/concommand.lua:69
--- End code ---
Stickly Man!:
You're passing an integer to list:SelectItem(blah). If you're passing in the index of the line into the function, then you can instead do list:SelectItem(list:GetLine(blah))
Navigation
[0] Message Index
[*] Previous page
Go to full version