Skip to content

Commit 9591507

Browse files
committed
Add manual overrides for CreateConVar & Panel.Add
1 parent feb169b commit 9591507

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

custom/Global.CreateConVar.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---[SHARED AND MENU] Creates a console variable (ConVar), in general these are for things like gamemode/server settings.
2+
--- Do not use the FCVAR_NEVER_AS_STRING and FCVAR_REPLICATED flags together, as this can cause the console variable to have strange values on the client.
3+
---
4+
---[(View on wiki)](https://wiki.facepunch.com/gmod/Global.CreateConVar)
5+
---@param name string Name of the ConVar.
6+
---
7+
--- This cannot be a name of an engine console command or console variable. It will throw an error if it is. If it is the same name as another lua ConVar, it will return that ConVar object.
8+
---@param value string Default value of the convar. Can also be a number.
9+
---@param flags?|table? number Flags of the convar, see Enums/FCVAR, either as bitflag or as table.
10+
---@param helptext? string The help text to show in the console.
11+
---@param min? number If set, the ConVar cannot be changed to a number lower than this value.
12+
---@param max? number If set, the ConVar cannot be changed to a number higher than this value.
13+
---@return ConVar # The convar created.
14+
function _G.CreateConVar(name, value, flags, helptext, min, max) end

custom/Panel.Add.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---[CLIENT AND MENU] Adds the specified object to the panel.
2+
---
3+
---[(View on wiki)](https://wiki.facepunch.com/gmod/Panel:Add)
4+
---@generic T : Panel
5+
---@param object `T` The panel to be added (parented). Can also be:
6+
--- * string Class Name - creates panel with the specified name and adds it to the panel.
7+
--- * table PANEL table - creates a panel from table and adds it to the panel.
8+
---@return `T` # The added or created panel
9+
function Panel:Add(object) end

0 commit comments

Comments
 (0)