Garry's Mod Wiki

Revision Difference

controlpanel.Get#529432

<function name="Get" parent="controlpanel" type="libraryfunc"> <description>Returns (or creates if not exists) a control panel.</description> <realm>Client</realm> <file line="6">lua/includes/modules/constraint.lua</file> <args> <arg name="name" type="string">The name of the panel. Usually the same value as `ControlPanel.Name`. Main panels for tool names are automatically assigned by `Tool.Mode`. When you create the control panel via <page>spawnmenu.AddToolMenuOption</page>, the internal tool panel name is `Tool.Mode.."_"..tab:lower().."_"..category:lower()`.</arg> </args> <rets> <ret name="" type="Panel">ControlPanel</ret> </rets> </function> <example> <description>Get the Contextmenus panel for the weld tool.</description> <code>`local ControlPanel = controlpanel.Get( "Weld" )`</code>⤶ <code>local ControlPanel = controlpanel.Get( "Weld" )</code>⤶ </example>