diff --git a/custom/ControlPanel.AddControl.lua b/custom/ControlPanel.AddControl.lua index ef03fbf..d2e37b6 100644 --- a/custom/ControlPanel.AddControl.lua +++ b/custom/ControlPanel.AddControl.lua @@ -1,10 +1,21 @@ ---Adds a control to the control panel. ---@realm client ---@source https://wiki.facepunch.com/gmod/ControlPanel:AddControl ----@overload fun(self: ControlPanel, type: "color", controlinfo: table): CtrlColor +---@overload fun(self: ControlPanel, type: "textbox"|"TextBox", controlinfo: table): DTextEntry +---@overload fun(self: ControlPanel, type: "label"|"Label", controlinfo: table): DLabel +---@overload fun(self: ControlPanel, type: "checkbox"|"CheckBox"|"toggle"|"Toggle", controlinfo: table): DCheckBoxLabel +---@overload fun(self: ControlPanel, type: "slider"|"Slider", controlinfo: table): DNumSlider +---@overload fun(self: ControlPanel, type: "button"|"Button", controlinfo: table): DButton +---@overload fun(self: ControlPanel, type: "numpad"|"Numpad"|"NumPad", controlinfo: table): CtrlNumPad +---@overload fun(self: ControlPanel, type: "color"|"Color", controlinfo: table): CtrlColor +---@overload fun(self: ControlPanel, type: "propselect"|"PropSelect", controlinfo: table): PropSelect +---@overload fun(self: ControlPanel, type: "matselect"|"MatSelect"|"materialgallery"|"MaterialGallery", controlinfo: table): MatSelect +---@overload fun(self: ControlPanel, type: "ropematerial"|"RopeMaterial", controlinfo: table): RopeMaterial +---@overload fun(self: ControlPanel, type: "header"|"Header", controlinfo: table): DLabel? +---@overload fun(self: ControlPanel, type: "listbox"|"ListBox", controlinfo: table): DListView|CtrlListBox +---@overload fun(self: ControlPanel, type: "combobox"|"ComboBox", controlinfo: table): ControlPresets|DListView|CtrlListBox ---@param type string The control type to add. ---@param controlinfo table Each control takes their own table structure. ---@return Panel control The created control. ---@deprecated It is recommended to use DForm's members instead. function ControlPanel:AddControl(type, controlinfo) end - diff --git a/custom/class.CtrlColor.lua b/custom/class.CtrlColor.lua index f765525..7eb23ef 100644 --- a/custom/class.CtrlColor.lua +++ b/custom/class.CtrlColor.lua @@ -1,4 +1,39 @@ ----@class CtrlColor : Panel +---@class CtrlColor : DPanel ---@field Mixer DColorMixer The embedded color mixer panel. local CtrlColor = {} +---Sets the label of the embedded color mixer. +---@param text? string Set to non empty string to show the label and its text. +function CtrlColor:SetLabel(text) end + +---Sets the ConVar the red channel of the embedded color mixer sets. +---@param convar string The ConVar name for the red channel of the color. +function CtrlColor:SetConVarR(convar) end + +---Sets the ConVar the green channel of the embedded color mixer sets. +---@param convar string The ConVar name for the green channel of the color. +function CtrlColor:SetConVarG(convar) end + +---Sets the ConVar the blue channel of the embedded color mixer sets. +---@param convar string The ConVar name for the blue channel of the color. +function CtrlColor:SetConVarB(convar) end + +---Sets the ConVar the alpha channel of the embedded color mixer sets. +---@param convar string The ConVar name for the alpha channel of the color. +function CtrlColor:SetConVarA(convar) end + +---The ConVar the red channel of the embedded color mixer sets. +---@return string # The ConVar name for the red channel of the color. +function CtrlColor:GetConVarR() end + +---The ConVar the green channel of the embedded color mixer sets. +---@return string # The ConVar name for the green channel of the color. +function CtrlColor:GetConVarG() end + +---The ConVar the blue channel of the embedded color mixer sets. +---@return string # The ConVar name for the blue channel of the color. +function CtrlColor:GetConVarB() end + +---The ConVar the alpha channel of the embedded color mixer sets. +---@return string # The ConVar name for the alpha channel of the color. +function CtrlColor:GetConVarA() end diff --git a/custom/class.CtrlNumPad.lua b/custom/class.CtrlNumPad.lua new file mode 100644 index 0000000..28f673e --- /dev/null +++ b/custom/class.CtrlNumPad.lua @@ -0,0 +1,6 @@ +---@class (partial) CtrlNumPad : DPanel +---@field NumPad1 DBinder The binder for the first ConVar. +---@field NumPad2 DBinder The binder for the second ConVar, shown only when it is set. +---@field Label1 DLabel The label of the first binder. +---@field Label2 DLabel The label of the second binder. +local CtrlNumPad = {} diff --git a/custom/class.DCheckBoxLabel.lua b/custom/class.DCheckBoxLabel.lua index 340e5a9..2dbc77d 100644 --- a/custom/class.DCheckBoxLabel.lua +++ b/custom/class.DCheckBoxLabel.lua @@ -1,4 +1,4 @@ ----@class DCheckBoxLabel : Panel +---@class DCheckBoxLabel : DPanel ---@field Button DCheckBox ---@field Label DLabel local DCheckBoxLabel = {} diff --git a/custom/class.DFileBrowser.lua b/custom/class.DFileBrowser.lua index 3b83f6e..7c9f69e 100644 --- a/custom/class.DFileBrowser.lua +++ b/custom/class.DFileBrowser.lua @@ -1,4 +1,4 @@ ----@class DFileBrowser : Panel +---@class DFileBrowser : DPanel --- The horizontal divider separating the tree and file list. ---@field Divider DHorizontalDivider --- The directory tree panel. diff --git a/custom/class.DNumPad.lua b/custom/class.DNumPad.lua index f0a249a..e9cad66 100644 --- a/custom/class.DNumPad.lua +++ b/custom/class.DNumPad.lua @@ -1,4 +1,4 @@ ----@class DNumPad : Panel +---@class DNumPad : DPanel --- Table of DButton panels for each keypad button (0-15). ---@field Buttons table --- The currently selected button panel. diff --git a/custom/class.DTextEntry.lua b/custom/class.DTextEntry.lua index d11b722..c260ef3 100644 --- a/custom/class.DTextEntry.lua +++ b/custom/class.DTextEntry.lua @@ -1,4 +1,4 @@ ----@class DTextEntry : Panel +---@class DTextEntry : TextEntry --- Text entry input history table, used for up/down arrow navigation. ---@field History table --- Current position in the history table (0 = none selected). diff --git a/custom/class.RopeMaterial.lua b/custom/class.RopeMaterial.lua new file mode 100644 index 0000000..eb5bffe --- /dev/null +++ b/custom/class.RopeMaterial.lua @@ -0,0 +1,2 @@ +---@class (partial) RopeMaterial : MatSelect +local RopeMaterial = {} diff --git a/custom/class.SKIN.lua b/custom/class.SKIN.lua index 7e04507..621e82a 100644 --- a/custom/class.SKIN.lua +++ b/custom/class.SKIN.lua @@ -68,6 +68,7 @@ ---@field Properties SKINColoursProperties ---@field Category SKINColoursCategory ---@field TooltipText Color +---@field [string] Color Colours a skin adds by name, read with derma.GetColor or SKIN.Colours. ---@class SKINTexScroller ---@field TrackV fun(x: number, y: number, w: number, h: number, col?: Color) Vertical scrollbar track texture. diff --git a/custom/ents.Create.lua b/custom/ents.Create.lua index 5c1345a..5ae677b 100644 --- a/custom/ents.Create.lua +++ b/custom/ents.Create.lua @@ -31,7 +31,7 @@ ---| "widget_axis_disc" ---| "widget_bone" ---| "widget_bones" ----@overload fun(class: KnownEngineEntityClass): Entity +---@overload fun(class: KnownEngineEntityClass): Entity|NULL ---@generic T : Entity ---@param class `T` The classname of the entity to create. ---@return (instance) T|NULL # The created entity, or `NULL` if failed.