Wondering is there a way to tell if a combo box item is selected, i know you could do what the wiki says and output the name, but that's not what i'm wanting, see i've made a combo box for categories, when they click say...Cars or w/e...it shows only cars in the table, not drinks or food, so im wondering if it's possible to say
if ListCombo:GetSelectedItems()[1] then
but the problem is, when i click other choices, it's still showing everything, not that one table..
[code]
local ShopItems = vgui.Create( "DPanel", nInv )
ShopItems:SetPos( 125, 50 )
ShopItems:SetSize( nInv:GetWide() - 25, nInv:GetTall() - 25 )
ShopItems.Paint = function()
if ListCombo:GetSelectedItems()[1] then
for k,v in pairs(iScript.Items.Drinks) do
local nItemB = vgui.Create("DPanel")
nItemB:SetSize(60,60)
nItemB.Paint = function()
surface.SetDrawColor(Color(215,186,0,255))
surface.DrawRect(0,0,nItemB:GetWide(),nItemB:GetTall())
end
local nItemB2 = vgui.Create("DPanel", nItemB)
nItemB2:SetPos(5,5)
nItemB2:SetSize(50,50)
nItemB2.Paint = function()
surface.SetDrawColor(Color(40,110,4,220))
surface.DrawRect(0,0,nItemB2:GetWide(),nItemB2:GetTall())
end
local nIcon = vgui.Create("DModelPanel",nItemB2)
nIcon:SetSize(50,50)
nIcon:SetPos(0,0)
nIcon:SetModel(v.Model)
nIcon:SetCamPos( Vector( 0, 0, 30 ) )
nIcon:SetLookAt( Vector( 0, 0, 30 ) )
function nIcon:LayoutEntity( ent )
ent:SetAngles( Angle( 90, 0, 0 ) );
end
nIcon.DoClick = function(btn)
SelModel = v.Model
NameText = v.Name
WeightText = v.Weight
DesText = v.Desc
Class = v.Class
ButtonShow = true;
UpdateModelData()
end
nInv:AddItem(nItemB)
end
end
end[/code]
This is urgent, thanks in advance
Bump, no replies?, damn
Sorry, you need to Log In to post a reply to this thread.