Add Missing Command Locales (#331)

* Update lawnmower.lua

* Update bonus.lua

* Update greetings.lua

* Update personal-logistic.lua

* Update quickbar.lua

* Update personal_logistic.lua

* Update tag.lua

* Update commands.cfg

* Update commands.cfg

* Update commands.cfg
This commit is contained in:
2024-09-24 22:41:27 +09:00
committed by GitHub
parent 00fb38fdc5
commit 2f13aa7e11
10 changed files with 84 additions and 25 deletions

View File

@@ -1,7 +1,9 @@
local Commands = require 'expcore.commands' --- @dep expcore.commands
local config = require 'config.personal_logistic' --- @dep config.personal-logistic
local function pl(type, target, amount)
local pl = {}
function pl.pl(type, target, amount)
local c
local s
@@ -18,7 +20,7 @@ local function pl(type, target, amount)
end
for _, v in pairs(config.request) do
c(config.start + v.key)
c(v.key)
end
if (amount < 0) then
@@ -31,13 +33,13 @@ local function pl(type, target, amount)
local v_min = math.ceil(v.min * amount)
local v_max = math.ceil(v.max * amount)
if v.stack ~= nil and v.stack ~= 1 and v.type ~= 'weapon' then
if v.stack and v.stack ~= 1 and v.type ~= 'weapon' then
v_min = math.floor(v_min / v.stack) * v.stack
v_max = math.ceil(v_max / v.stack) * v.stack
end
if v.upgrade_of == nil then
if v.type ~= nil then
if v.type then
if stats.get_input_count(k) < config.production_required[v.type] then
if v_min > 0 then
if v_min == v_max then
@@ -50,40 +52,40 @@ local function pl(type, target, amount)
end
end
s(config.start + v.key, {name=k, min=v_min, max=v_max})
s(v.key, {name=k, min=v_min, max=v_max})
else
if v.type ~= nil then
if v.type then
if stats.get_input_count(k) >= config.production_required[v.type] then
s(config.start + v.key, {name=k, min=v_min, max=v_max})
s(v.key, {name=k, min=v_min, max=v_max})
local vuo = v.upgrade_of
while (vuo ~= nil) do
s(config.start + config.request[vuo].key, {name=vuo, min=0, max=0})
while vuo do
s(config.request[vuo].key, {name=vuo, min=0, max=0})
vuo = config.request[vuo].upgrade_of
end
else
s(config.start + v.key, {name=k, min=0, max=v_max})
s(v.key, {name=k, min=0, max=v_max})
end
end
end
end
end
Commands.new_command('personal-logistic', 'Set Personal Logistic (-1 to cancel all) (Select spidertron to edit spidertron)')
Commands.new_command('personal-logistic', {'expcom-personal-logistics'}, 'Set Personal Logistic (-1 to cancel all) (Select spidertron to edit spidertron)')
:add_param('amount', 'integer-range', -1, 10)
:add_alias('pl')
:register(function(player, amount)
if player.force.technologies['logistic-robotics'].researched then
if player.selected ~= nil then
if player.selected then
if player.selected.name == 'spidertron' then
pl('s', player.selected, amount / 10)
pl.pl('s', player.selected, amount / 10)
return Commands.success
end
else
pl('p', player, amount / 10)
pl.pl('p', player, amount / 10)
return Commands.success
end
@@ -91,3 +93,5 @@ Commands.new_command('personal-logistic', 'Set Personal Logistic (-1 to cancel a
player.print('Personal Logistic not researched')
end
end)
return pl