Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
plally committed Feb 2, 2024
1 parent 599a2b5 commit 4b5c084
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 32 deletions.
31 changes: 2 additions & 29 deletions lua/mapvote/client/vgui/frame.lua
Original file line number Diff line number Diff line change
@@ -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 ) )
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lua/mapvote/client/vgui/switch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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
Expand Down

0 comments on commit 4b5c084

Please sign in to comment.