mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 00:16:27 +02:00
Remote const structure, test speed display
This commit is contained in:
13
cl_utils.lua
13
cl_utils.lua
@@ -15,6 +15,19 @@ end
|
||||
-- return string.format( "%03d", speed )
|
||||
-- end
|
||||
|
||||
function UTIL:FormatSpeed( speed )
|
||||
if ( speed < 0 or speed > 999 ) then return "Err" end
|
||||
|
||||
local text = tostring( speed )
|
||||
local pipes = ""
|
||||
|
||||
for i = 1, 3 - string.len( text ) do
|
||||
pipes = pipes .. "¦"
|
||||
end
|
||||
|
||||
return pipes .. text
|
||||
end
|
||||
|
||||
function UTIL:Clamp( val, min, max )
|
||||
if ( val < min ) then
|
||||
return min
|
||||
|
||||
Reference in New Issue
Block a user