Skip to content

Commit

Permalink
Update dform.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdvideo1234 authored Aug 7, 2020
1 parent 3ba1c3d commit 8428f02
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions garrysmod/lua/vgui/dform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,25 @@ function PANEL:ControlPresets( strDir, cvList )
return preset
end

function PANEL:NumpadControl( strLab1, strVar1, strLab2, strVar2 )

if ( strLab1 == nil or strVar1 == nil ) then return nil end

local numpad = vgui.Create( "CtrlNumPad", self )

numpad:SetLabel1( tostring( strLabel1 or "" ) )
numpad:SetConVar1( tostring( strConVar1 or "" ) )

if ( strLab2 != nil and strVar2 != nil) then
numpad:SetLabel2( tostring( strLab2 or "" ) )
numpad:SetConVar2( tostring( strVar2 or "" ) )
end

self:AddPanel(numpad)

return numpad
end

function PANEL:ComboBox( strLabel, strConVar )

local left = vgui.Create( "DLabel", self )
Expand Down

0 comments on commit 8428f02

Please sign in to comment.