Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions custom/ControlPanel.AddControl.lua
Original file line number Diff line number Diff line change
@@ -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

37 changes: 36 additions & 1 deletion custom/class.CtrlColor.lua
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions custom/class.CtrlNumPad.lua
Original file line number Diff line number Diff line change
@@ -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 = {}
2 changes: 1 addition & 1 deletion custom/class.DCheckBoxLabel.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@class DCheckBoxLabel : Panel
---@class DCheckBoxLabel : DPanel
---@field Button DCheckBox
---@field Label DLabel
local DCheckBoxLabel = {}
2 changes: 1 addition & 1 deletion custom/class.DFileBrowser.lua
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion custom/class.DNumPad.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---@class DNumPad : Panel
---@class DNumPad : DPanel
--- Table of DButton panels for each keypad button (0-15).
---@field Buttons table<integer, DButton>
--- The currently selected button panel.
Expand Down
2 changes: 1 addition & 1 deletion custom/class.DTextEntry.lua
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
2 changes: 2 additions & 0 deletions custom/class.RopeMaterial.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---@class (partial) RopeMaterial : MatSelect
local RopeMaterial = {}
1 change: 1 addition & 0 deletions custom/class.SKIN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion custom/ents.Create.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading