I'm trying to fix up an old addon, but I'm not sure what I should replace add control with, the wiki doesn't mention any alternatives and it errors in gmod 13.
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4c60.html[/url]
its a combo box, and it errors with
[code]
[@gamemodes\sandbox\gamemode\spawnmenu\controlpanel.lua:360] bad argument #1 to 'SetText' (string expected, got nil) SetText [C]:-1
AddControl gamemodes\sandbox\gamemode\spawnmenu\controlpanel.lua:360
func addons\anti-noclip\lua\weapons\gmod_tool\stools\rt_antinoclip.lua:130
FillViaFunction gamemodes\sandbox\gamemode\spawnmenu\controlpanel.lua:107
FillViaTable gamemodes\sandbox\gamemode\spawnmenu\controlpanel.lua:92
DoClick gamemodes\sandbox\gamemode\spawnmenu\toolpanel.lua:73
unknown lua\vgui\dlabel.lua:196
unknown (tail call):-1
]
[/code]
replacing it with MultiChoice errors with
[code]
UNHANDLED CONTROL: nil
[/code]
is there some other alternative in G13?
Before: [CODE]CPanel.plane_window = CPanel:AddControl("PA_Tool_Plane_Panel", {})[/CODE]
After: [CODE]CPanel.plane_window = CPanel:AddItem(vgui.Create("PA_Tool_Plane_Panel", CPanel))[/CODE]
Works fine for me.
Sorry, you need to Log In to post a reply to this thread.