Correct (almost) all luacheck warnings

Also includes a few code opimizations:
- Combined mining drill functions
- Shorter alias registration (unused?)
- Add TODOs to address later
This commit is contained in:
SmallJoker
2022-06-06 21:04:13 +02:00
parent 0211c582e9
commit 0f6bdb1bde
22 changed files with 260 additions and 250 deletions

View File

@ -10,7 +10,17 @@ technic_cnc.use_technic = technic_cnc.technic_modpath
if rawget(_G, "intllib") then
technic_cnc.getter = intllib.Getter()
else
technic_cnc.getter = function(s,a,...)if a==nil then return s end a={a,...}return s:gsub("(@?)@(%(?)(%d+)(%)?)",function(e,o,n,c)if e==""then return a[tonumber(n)]..(o==""and c or"")else return"@"..o..n..c end end) end
-- Intllib copypasta: TODO replace with the client-side translation API
technic.getter = function(s,a,...)
if a==nil then return s end
a={a,...}
return s:gsub("(@?)@(%(?)(%d+)(%)?)", function(e,o,n,c)
if e==""then
return a[tonumber(n)]..(o==""and c or"")
end
return "@"..o..n..c
end)
end
end
dofile(modpath.."/cnc.lua")