My Derma menu is "faded" and all the elements are disabled.

(Yes I know the positioning is odd, but that is the least of my concerns)

I cannot select anything or press anything in the menu. I could not find anything wrong with the code at 5 readthroughs. It does not give me errors of any type whatsoever.
I made this menu using DermaDesigner and learned/copied a bit of code from an old garrysmod wiki mirror to make this. I have little knowledge of lua and I wish this script to be finished so I can add more stuff to it such as total weight count.

The code:

[lua]-- AddCSLuaFile( “autorun/client/cl_weaponselection.lua” )
– Lua generated by DermaDesigner

function WeaponSelectorDerma()

–Locals
local Frame = vgui.Create(“DFrame”)
local DLabel24 = vgui.Create(“DLabel”)
local DLabel23 = vgui.Create(“DLabel”)
local DLabel22 = vgui.Create(“DLabel”)
local DLabel21 = vgui.Create(“DLabel”)
local DLabel20 = vgui.Create(“DLabel”)
local DLabel12 = vgui.Create(“DLabel”)
local HintText = vgui.Create(“DTextEntry”)
local Max = vgui.Create(“DTextEntry”)
local DLabel10 = vgui.Create(“DLabel”)
local Num = vgui.Create(“DTextEntry”)
local DLabel8 = vgui.Create(“DLabel”)
local DPanel12 = vgui.Create(“DPanel”)
local DPanel11 = vgui.Create(“DPanel”)

– local CancelButton= vgui.Create(“DButton”)

local ApplyButton = vgui.Create(“DButton”)
local DLabel6 = vgui.Create(“DLabel”)

/*
local Img5
local Img4
local Img3
local Img2
local Img1
*/

local DPanel10 = vgui.Create(“DPanel”)
local DPanel9 = vgui.Create(“DPanel”)
local WS5 = vgui.Create(“DComboBox”)
local WS4 = vgui.Create(“DComboBox”)
local WS3 = vgui.Create(“DComboBox”)
local WS2 = vgui.Create(“DComboBox”)
local WS1 = vgui.Create(“DComboBox”)
local DPanel8 = vgui.Create(“DPanel”)
local DPanel7 = vgui.Create(“DPanel”)
local DPanel6 = vgui.Create(“DPanel”)
local DPanel5 = vgui.Create(“DPanel”)
local DPanel4 = vgui.Create(“DPanel”)

–Frame
–SetParent(Frame)

Frame:SetSize(570, 440)
Frame:SetPos(10,10)
Frame:SetTitle(“Weapon Selection”) --set the title of the menu
Frame:SetDraggable(true) --can you move it around
Frame:SetSizable(false) --can you resize it?
Frame:ShowCloseButton(true) --can you close it
Frame:MakePopup() --make it appear

–Weight
Num:SetPos(470, 330)
Num:SetText(“Num”)
Num:SizeToContents()
Num:SetParent(Frame)

Max = vgui.Create(“DLabel”)
Max:SetPos(520, 330)
Max:SetText(“Max”)
Max:SizeToContents()
Max:SetParent(Frame)

–Tips

HintText:SetSize(360, 60)
HintText:SetPos(30, 350)
HintText:SetText(“YOU ARE A KEMPING FEGGIT”)
HintText:SetParent(Frame)
HintText.OnEnter = function() end

–Combo Boxes

WS5:SetSize(80, 150)
WS5:SetPos(470, 60)
WS5:EnableHorizontal(false)
WS5:EnableVerticalScrollbar(true)
WS5:SetMultiple(false)
WS5:SetParent(Frame)
WS5.Doclick= function()
/*
Img5 = vgui.Create(“DImage”)
Img5:SetSize(60, 60)
Img5:SetPos(480, 240)
Img5:SetImage(“vgui/entities/”… WS5:GetSelectedItems()[1]:GetValue() …".vmt")
Img5:SizeToContents()
Img5:SetParent(Frame)
*/
end

WS4:SetSize(80, 150)
WS4:SetPos(360, 60)
WS4:EnableHorizontal(false)
WS4:EnableVerticalScrollbar(true)
WS4:SetMultiple(false)
WS4:SetParent(Frame)
WS4.Doclick= function()
/*
Img4 = vgui.Create(“DImage”)
Img4:SetSize(60, 60)
Img4:SetPos(370, 240)
Img4:SetImage(“vgui/entities/”… WS4:GetSelectedItems()[1]:GetValue() …".vmt")
Img4:SizeToContents()
Img4:SetParent(Frame)
*/
end

WS3:SetSize(80, 150)
WS3:SetPos(250, 60)
WS3:EnableHorizontal(false)
WS3:EnableVerticalScrollbar(true)
WS3:SetMultiple(false)
WS3:SetParent(Frame)
WS3.Doclick= function()
/*
Img3 = vgui.Create(“DImage”)
Img3:SetSize(60, 60)
Img3:SetPos(260, 240)
Img3:SetImage(“vgui/entities/”… WS3:GetSelectedItems()[1]:GetValue() …".vmt")
Img3:SizeToContents()
Img3:SetParent(Frame)
*/
end

WS2:SetSize(80, 150)
WS2:SetPos(140, 60)
WS2:EnableHorizontal(false)
WS2:EnableVerticalScrollbar(true)
WS2:SetMultiple(false)
WS2:SetParent(Frame)
WS2.Doclick= function()
/*
Img2 = vgui.Create(“DImage”)
Img2:SetSize(60, 60)
Img2:SetPos(150, 240)
Img2:SetImage(“vgui/entities/”… WS2:GetSelectedItems()[1]:GetValue() …".vmt")
Img2:SizeToContents()
Img2:SetParent(Frame)
*/
end

WS1:SetSize(80, 150)
WS1:SetPos(30, 60)
WS1:EnableHorizontal(false)
WS1:EnableVerticalScrollbar(true)
WS1:SetMultiple(false)
WS1:SetParent(Frame)
WS1.Doclick= function()
/*
Img1 = vgui.Create(“DImage”)
Img1:SetSize(60, 60)
Img1:SetPos(40, 240)
Img1:SetImage(“vgui/entities/”… WS1:GetSelectedItems()[1]:GetValue() …".vmt")
Img1:SizeToContents()
Img1:SetParent(Frame)
*/
end

–Fors
for i=1,12 do
WS1:AddItem( fpwn* )
end

for j=1,9 do
WS2:AddItem( fswn[j] )
end

for k=1,8 do
WS3:AddItem( fsan[k] )
end

for l=1,6 do
WS4:AddItem( fexn[l] )
end

for m=1,7 do
WS5:AddItem( fspecn[m] )
end

–Selections

–Images were moved in the OnClick functions
–“vgui/entities/”… var …".vmt"

–Apply and Cancel

ApplyButton:SetSize(60, 20)
ApplyButton:SetPos(490, 390)
ApplyButton:SetText(“Apply”)
ApplyButton.DoClick = function() RunConsoleCommand(“weapon_take”, WS1:GetSelectedItems()[1]:GetValue(), WS2:GetSelectedItems()[1]:GetValue(), WS3:GetSelectedItems()[1]:GetValue(), WS4:GetSelectedItems()[1]:GetValue(), WS5:GetSelectedItems()[1]:GetValue())
end
ApplyButton:SetParent(Frame)

/* YOU CAN NEVER CANCEL THIS ETERNAL NIGHTMARE
CancelButton:SetSize(60, 20)
CancelButton:SetPos(420, 390)
CancelButton:SetText(“Cancel”)
CancelButton.DoClick = function() end
CancelButton:SetParent(Frame)
*/

–Design
DLabel24:SetPos(470, 45)
DLabel24:SetText(“Special”)
DLabel24:SizeToContents()
DLabel24:SetParent(Frame)

DLabel23:SetPos(365, 45)
DLabel23:SetText(“Grenade”)
DLabel23:SizeToContents()
DLabel23:SetParent(Frame)

DLabel22:SetPos(255, 45)
DLabel22:SetText(“Sidearm”)
DLabel22:SizeToContents()
DLabel22:SetParent(Frame)

DLabel21:SetPos(145, 45)
DLabel21:SetText(“Secondary”)
DLabel21:SizeToContents()
DLabel21:SetParent(Frame)

DLabel20:SetPos(35, 45)
DLabel20:SetText(“Primary”)
DLabel20:SizeToContents()
DLabel20:SetParent(Frame)

DLabel12:SetPos(40, 330)
DLabel12:SetText(“Tips:”)
DLabel12:SizeToContents()
DLabel12:SetParent(Frame)

DLabel10:SetPos(500, 330)
DLabel10:SetText("/")
DLabel10:SizeToContents()
DLabel10:SetParent(Frame)

DLabel8:SetPos(420, 330)
DLabel8:SetText(“Weight :”)
DLabel8:SizeToContents()
DLabel8:SetParent(Frame)

DPanel12:SetSize(150, 30)
DPanel12:SetPos(410, 320)
DPanel12:SetParent(Frame)

DPanel11:SetSize(380, 100)
DPanel11:SetPos(20, 320)
DPanel11:SetParent(Frame)

DLabel6:SetPos(300, 425)
DLabel6:SetText(“Derma made by Bugger Burger using DermaDesinger”)
DLabel6:SizeToContents()
DLabel6:SetParent(Frame)

DPanel10:SetSize(150, 40)
DPanel10:SetPos(410, 380)
DPanel10:SetParent(Frame)

DPanel9:SetSize(540, 80)
DPanel9:SetPos(20, 230)
DPanel9:SetParent(Frame)

DPanel8:SetSize(100, 180)
DPanel8:SetPos(460, 40)
DPanel8:SetParent(Frame)

DPanel7:SetSize(100, 180)
DPanel7:SetPos(350, 40)
DPanel7:SetParent(Frame)

DPanel6:SetSize(100, 180)
DPanel6:SetPos(240, 40)
DPanel6:SetParent(Frame)

DPanel5:SetSize(100, 180)
DPanel5:SetPos(130, 40)
DPanel5:SetParent(Frame)

DPanel4:SetSize(100, 180)
DPanel4:SetPos(20, 40)
DPanel4:SetParent(Frame)

end

concommand.Add(“selectweapon”, WeaponSelectorDerma)[/lua]

If you require more info that would help me solve this problem I’m having I would be happy to provide.

The code looks okey, but if I got you right ( Assuming because i dont see the mouse on the screenshot ) try using gui.EnableScreenClicker(true).
Edit: Nevermind, just saw you said disabled.

I’ll do some debugging, give me 10minutes.

[editline]10th June 2012[/editline]

Found the problem, the panels you use as fancy backgrounds are laying above your controlls, you should really read about parenting properly.

If you wanna see what I mean.


lua_run_cl hook.Add("VGUIMousePressed", "bla", function(pnl) print(pnl:GetClassName(), pnl) end)

<- run that and watch the console, check the panel ID’s.

[editline]10th June 2012[/editline]

Also vgui_drawfocus 1

Parented everything correctly and it works perfectly. Thanks!