Permalink
Browse files

DProperty_Combo.Setup() 2nd parameter - optional

  • Loading branch information...
1 parent 59c72cf commit 8f6b50b143d9f61ecba3bce1ba5a6e04d0ef1e7c @robotboy655 robotboy655 committed May 6, 2015
Showing with 5 additions and 8 deletions.
  1. +2 −0 garrysmod/lua/vgui/prop_combo.lua
  2. +3 −8 garrysmod/lua/vgui/prop_vectorcolor.lua
@@ -6,6 +6,8 @@ end
function PANEL:Setup( vars )
+ vars = vars or {}
+
self:Clear()
local combo = vgui.Create( "DComboBox", self )
@@ -7,12 +7,9 @@
DEFINE_BASECLASS( "DProperty_Generic" )
-
local PANEL = {}
function PANEL:Init()
-
-
end
--
@@ -26,14 +23,14 @@ function PANEL:ValueChanged( newval, bForce )
end
-
function PANEL:Setup( vars )
+ vars = vars or {}
+
BaseClass.Setup( self, vars )
local __SetValue = self.SetValue
-
local btn = self:Add( "DButton" )
btn:Dock( LEFT )
btn:DockMargin( 0, 2, 4, 2 )
@@ -71,15 +68,13 @@ function PANEL:Setup( vars )
local col = Color( 255 * self.VectorValue.r, 255 * self.VectorValue.g, 255 * self.VectorValue.b, 255 )
color:SetColor( col )
-
local menu = DermaMenu()
- menu:AddPanel( color );
+ menu:AddPanel( color )
menu:SetDrawBackground( false )
menu:Open( gui.MouseX() + 8, gui.MouseY() + 10 )
end
-
-- Set the value
self.SetValue = function( self, val )
__SetValue( self, val )

0 comments on commit 8f6b50b

Please sign in to comment.