I've got a fairly simple custom context menu for quick selection of tools and props, but the spawn icons aren't functioning correctly. Putting the mouse over or clicking them returns no results.
They're parented to a DPanel, which is parented to a DFrame. Although even without the DPanel, they're not functioning correctly.
Without parenting, they work fine.
Other things to note is that I'm overriding the paint function, but stopping that doesn't help. I'm genorating them from a table, so it's only a temp variable.
[code]
local Area2 = vgui.Create("DPanel",Panel)
Area2:SetSize(558,130)
Area2:SetPos(21,143)
Area2.Paint = function()
draw.RoundedBox(8,0,0,558,130,Color(150,150,150,255))
end
for Indx,Mdl in pairs(Props) do
local Y = math.floor(Indx/9)
local Tmp = vgui.Create("SpawnIcon",Area2)
Tmp:SetModel(Mdl)
Tmp:SetPos(-69+70*Indx,70*Y)
Tmp:SetIconSize(64)
Tmp.DoClick = function() RunConsoleCommand("gm_spawn",Mdl) end
Tmp:SetToolTip(Mdl)
end
[/code]
Has anyone come across this problem, and/or have a solution of theory?
[editline]5th December 2010[/editline]
Fixed.
[code]
Panel:SetMouseInputEnabled(false)
[/code]
Before I had it hooked for debugging. Seemed to be the problem.
Sorry, you need to Log In to post a reply to this thread.