diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-30 21:01:18 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-30 21:01:18 -0400 |
| commit | d62058fcdea5fc6736a2a373f47dc6c14c70c319 (patch) | |
| tree | 79a1325190e3f1f1b6d6a2dbcdfc1ba3fa866ac9 /gamemode/vgui/vgui_categorybutton.lua | |
| parent | c38f00182ba6c282806eecb39a42e64d5feafa37 (diff) | |
| download | redead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.tar.gz redead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.tar.bz2 redead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.zip | |
Removed exessive whitespace so future commits will be cleaner
Diffstat (limited to 'gamemode/vgui/vgui_categorybutton.lua')
| -rw-r--r-- | gamemode/vgui/vgui_categorybutton.lua | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/gamemode/vgui/vgui_categorybutton.lua b/gamemode/vgui/vgui_categorybutton.lua index 0b45c97..cbc00d1 100644 --- a/gamemode/vgui/vgui_categorybutton.lua +++ b/gamemode/vgui/vgui_categorybutton.lua @@ -10,21 +10,21 @@ function PANEL:Init() //self:SetTitle( "" ) //self:ShowCloseButton( false ) //self:SetDraggable( false ) - + self:SetCursor( "hand" ) - + self.Image = vgui.Create( "DImageButton", self ) self.Image:SetImage( "icon16/car.png" ) self.Image:SetStretchToFit( false ) self.Image.DoClick = function() - + self:Toggle() - + end - + self.Selected = false self.Text = "" - + end function PANEL:SetImage( img ) @@ -42,11 +42,11 @@ end function PANEL:Toggle( bool ) self:SetSelectedState( bool or !self.Selected ) - + if not bool then - + self:OnToggle( self.Selected ) - + end end @@ -58,13 +58,13 @@ end function PANEL:DoSound( bool ) if bool then - + surface.PlaySound( self.OnSound ) - + else - + surface.PlaySound( self.OffSound ) - + end end @@ -72,9 +72,9 @@ end function PANEL:SetSelectedState( bool, ignore ) self.Selected = tobool( bool ) - + if ignore then return end - + self:DoSound( bool ) end @@ -102,7 +102,7 @@ function PANEL:PerformLayout() self.Image:SetSize( imgsize, imgsize ) self.Image:SetPos( self:GetWide() - imgsize - self:GetPadding(), self:GetPadding() ) - + //self:SizeToContents() end @@ -114,29 +114,29 @@ function PANEL:Paint() local imgsize = self:GetTall() - ( 2 * self:GetPadding() ) draw.RoundedBox( 4, 0, 0, self:GetWide(), self:GetTall(), Color( 0, 0, 0, 180 ) ) - + if self.Selected then - + draw.RoundedBox( 4, self:GetWide() - imgsize - self:GetPadding(), self:GetPadding(), imgsize, imgsize, Color( 100, 100, 100, 100 ) ) - + draw.SimpleText( self.Text, "CategoryButton", tx+1, ty+1, Color( 0, 0, 0, 150 ), TEXT_ALIGN_LEFT ) draw.SimpleText( self.Text, "CategoryButton", tx-1, ty-1, Color( 0, 0, 0, 150 ), TEXT_ALIGN_LEFT ) draw.SimpleText( self.Text, "CategoryButton", tx+1, ty-1, Color( 0, 0, 0, 150 ), TEXT_ALIGN_LEFT ) draw.SimpleText( self.Text, "CategoryButton", tx-1, ty+1, Color( 0, 0, 0, 150 ), TEXT_ALIGN_LEFT ) - + draw.SimpleText( self.Text, "CategoryButton", tx, ty, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT ) - + else draw.RoundedBox( 4, self:GetWide() - imgsize - self:GetPadding(), self:GetPadding(), imgsize, imgsize, Color( 100, 100, 100, 100 ) ) - + draw.SimpleText( self.Text, "CategoryButton", tx+1, ty+1, Color( 0, 0, 0, 150 ), TEXT_ALIGN_LEFT ) draw.SimpleText( self.Text, "CategoryButton", tx-1, ty-1, Color( 0, 0, 0, 150 ), TEXT_ALIGN_LEFT ) draw.SimpleText( self.Text, "CategoryButton", tx+1, ty-1, Color( 0, 0, 0, 150 ), TEXT_ALIGN_LEFT ) draw.SimpleText( self.Text, "CategoryButton", tx-1, ty+1, Color( 0, 0, 0, 150 ), TEXT_ALIGN_LEFT ) - + draw.SimpleText( self.Text, "CategoryButton", tx, ty, Color( 100, 100, 100, 255 ), TEXT_ALIGN_LEFT ) - + end end |
