This commit is contained in:
Evert Prants 2019-01-23 18:49:43 +02:00
parent 7de297dace
commit 9678da2e97
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
3 changed files with 17 additions and 15 deletions

View File

@ -38,7 +38,7 @@ minetest.register_craftitem("elepower_machines:reinforced_capacitor", {
inventory_image = "elepower_upgrade_reinforced_capacitor.png", inventory_image = "elepower_upgrade_reinforced_capacitor.png",
ele_upgrade = { ele_upgrade = {
capacity = { capacity = {
multiplier = 10, multiplier = 1,
}, },
}, },
}) })
@ -49,7 +49,7 @@ minetest.register_craftitem("elepower_machines:resonant_capacitor", {
inventory_image = "elepower_upgrade_resonant_capacitor.png", inventory_image = "elepower_upgrade_resonant_capacitor.png",
ele_upgrade = { ele_upgrade = {
capacity = { capacity = {
multiplier = 100, multiplier = 10,
}, },
}, },
}) })
@ -60,7 +60,7 @@ minetest.register_craftitem("elepower_machines:super_capacitor", {
inventory_image = "elepower_upgrade_supercapacitor.png", inventory_image = "elepower_upgrade_supercapacitor.png",
ele_upgrade = { ele_upgrade = {
capacity = { capacity = {
multiplier = 1000, multiplier = 100,
}, },
}, },
}) })

View File

@ -1,6 +1,10 @@
-- Convenience for i18n later on
local metasets = { elepm.upgrading = {
"capacity", "usage", "craft_speed", "inrush", "output" dict = {
machine_chip = "Machine Chip",
capacitor = "Capacitor",
pump_filter = "Pump Filter",
}
} }
function elepm.handle_machine_upgrades (pos) function elepm.handle_machine_upgrades (pos)

View File

@ -1,17 +1,15 @@
-- Convenience for i18n later on
local dict = {
machine_chip = "Machine Chip",
capacitor = "Capacitor",
pump_filter = "Pump Filter",
}
local function upgrade_formspec (upgrades, desc) local function upgrade_formspec (upgrades, desc)
local posY = 0.5 local posY = 0.5
local fspec = "" local fspec = ""
for k in pairs(upgrades) do for k in pairs(upgrades) do
fspec = fspec .. "label[1,"..(posY + 0.25)..";"..dict[k].."]" local scrib = elepm.upgrading.dict[k]
if not scrib then
scrib = k
end
fspec = fspec .. "label[1,"..(posY + 0.25)..";"..scrib.."]"
fspec = fspec .. "list[detached:soldering;"..k..";7,"..posY..";1,1;]" fspec = fspec .. "list[detached:soldering;"..k..";7,"..posY..";1,1;]"
posY = posY + 1 posY = posY + 1
end end