From 4b5c084b1ebae7e9f2e80f20aecb120a13dc7214 Mon Sep 17 00:00:00 2001 From: Pierce Date: Fri, 2 Feb 2024 17:36:19 -0500 Subject: [PATCH] fix linter errors --- lua/mapvote/client/vgui/frame.lua | 31 ++---------------------------- lua/mapvote/client/vgui/switch.lua | 6 +++--- 2 files changed, 5 insertions(+), 32 deletions(-) diff --git a/lua/mapvote/client/vgui/frame.lua b/lua/mapvote/client/vgui/frame.lua index 4e0d125..eb72d2a 100644 --- a/lua/mapvote/client/vgui/frame.lua +++ b/lua/mapvote/client/vgui/frame.lua @@ -1,33 +1,6 @@ ---@class MapVote_Frame : DFrame local PANEL = {} -local function disableColor( c ) - return Color( c.r / 2, c.g / 2, c.b / 2 ) -end - -local function drawCircle( x, y, radius, seg ) - draw.NoTexture() - local cir = {} - - table.insert( cir, { x = x, y = y, u = 0.5, v = 0.5 } ) - for i = 0, seg do - local a = math.rad( (i / seg) * -360 ) - table.insert( cir, - { - x = x + math.sin( a ) * radius, - y = y + math.cos( a ) * radius, - } ) - end - - local a = math.rad( 0 ) -- This is needed for non absolute segment counts - table.insert( cir, - { - x = x + math.sin( a ) * radius, - y = y + math.cos( a ) * radius, - } ) - - surface.DrawPoly( cir ) -end function surface.DrawTexturedRectRotatedPoint( x, y, w, h, rot, x0, y0 ) local c = math.cos( math.rad( rot ) ) local s = math.sin( math.rad( rot ) ) @@ -73,12 +46,12 @@ function PANEL:Init() self.btnMaxim:SetSize( 25, 25 ) ---@diagnostic disable-next-line: duplicate-set-field - self.btnMaxim.Paint = function( _, w, h ) + self.btnMaxim.Paint = function() end self.btnMinim:SetSize( 25, 25 ) ---@diagnostic disable-next-line: duplicate-set-field - self.btnMinim.Paint = function( _, w, h ) + self.btnMinim.Paint = function() end self.btnClose.DoClick = function() if self.hideOnClose then diff --git a/lua/mapvote/client/vgui/switch.lua b/lua/mapvote/client/vgui/switch.lua index fa4f7b4..b793033 100644 --- a/lua/mapvote/client/vgui/switch.lua +++ b/lua/mapvote/client/vgui/switch.lua @@ -25,7 +25,7 @@ function PANEL:SetOn( on ) self:OnChange( self.On ) end -function PANEL:OnChange( on ) +function PANEL:OnChange( _on ) end function PANEL:Paint( w, h ) @@ -38,10 +38,10 @@ function PANEL:Paint( w, h ) local timeSince = SysTime() - self.LastClicked local fraction = math.min( timeSince / 0.2, 1 ) if self.On then - local x = Lerp( fraction, 0, (w - h) ) + local x = Lerp( fraction, 0, w - h ) draw.RoundedBox( 180, x + 2, 2, h - 4, h - 4, self.ColorSwitch ) else - local x = Lerp( fraction, (w - h), 0 ) + local x = Lerp( fraction, w - h, 0 ) draw.RoundedBox( 180, x + 2, 2, h - 4, h - 4, self.ColorSwitch ) end end