Garry's Mod Wiki

Revision Difference

controlpanel.Get#529433

<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>⤶ <arg name="name" type="string">The name of the panel. For normal tools this will be equal to `TOOL.Mode` (the tool's filename without the extension).⤶ ⤶ When you create a tool/option via <page>spawnmenu.AddToolMenuOption</page>, the internal control panel name is `Tool.Mode .. "_" .. tool_tab:lower() .. "_" .. tool_category:lower()`.</arg>⤶ </args> <rets> <ret name="" type="Panel">ControlPanel</ret>⤶ <ret name="" type="Panel">The <page>ControlPanel</page> panel.</ret>⤶ </rets> </function> <example> <description>Get the Contextmenus panel for the weld tool.</description> <code>local ControlPanel = controlpanel.Get( "Weld" )</code> </example>