mirror of
https://github.com/LibertyForce-Gmod/Enhanced-PlayerModel-Selector.git
synced 2025-03-04 03:03:08 -05:00
2.0.1
Fixed: Menu would break, if cl_playercolor value was invalid.
This commit is contained in:
parent
e2aca6a4e5
commit
2fd0fea18f
@ -268,7 +268,14 @@ function Menu.Setup()
|
||||
local r, g, b = 97, 100, 102
|
||||
if GetConVar( "cl_playermodel_selector_bgcolor_custom" ):GetBool() then
|
||||
local bgcolor = string.Explode( " ", GetConVar( "cl_playercolor" ):GetString() )
|
||||
r, g, b = math.Round( bgcolor[1] * 255 ), math.Round( bgcolor[2] * 255 ), math.Round( bgcolor[3] * 255 )
|
||||
bgcolor[1] = tonumber( bgcolor[1] )
|
||||
bgcolor[2] = tonumber( bgcolor[2] )
|
||||
bgcolor[3] = tonumber( bgcolor[3] )
|
||||
if isnumber( bgcolor[1] ) and isnumber( bgcolor[2] ) and isnumber( bgcolor[3] ) then
|
||||
r, g, b = math.Round( bgcolor[1] * 255 ), math.Round( bgcolor[2] * 255 ), math.Round( bgcolor[3] * 255 )
|
||||
else
|
||||
timer.Simple( 0.1, function() RunConsoleCommand( "cl_playercolor", "0.24 0.34 0.41" ) end )
|
||||
end
|
||||
end
|
||||
Frame.Paint = function( self, w, h )
|
||||
draw.RoundedBox( 10, 0, 0, w, h, Color( r, g, b, 127 ) ) return true
|
||||
|
Loading…
Reference in New Issue
Block a user