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",
ele_upgrade = {
capacity = {
multiplier = 10,
multiplier = 1,
},
},
})
@ -49,7 +49,7 @@ minetest.register_craftitem("elepower_machines:resonant_capacitor", {
inventory_image = "elepower_upgrade_resonant_capacitor.png",
ele_upgrade = {
capacity = {
multiplier = 100,
multiplier = 10,
},
},
})
@ -60,7 +60,7 @@ minetest.register_craftitem("elepower_machines:super_capacitor", {
inventory_image = "elepower_upgrade_supercapacitor.png",
ele_upgrade = {
capacity = {
multiplier = 1000,
multiplier = 100,
},
},
})

View File

@ -1,7 +1,11 @@
local metasets = {
"capacity", "usage", "craft_speed", "inrush", "output"
}
-- Convenience for i18n later on
elepm.upgrading = {
dict = {
machine_chip = "Machine Chip",
capacitor = "Capacitor",
pump_filter = "Pump Filter",
}
}
function elepm.handle_machine_upgrades (pos)
local meta = minetest.get_meta(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 posY = 0.5
local fspec = ""
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;]"
posY = posY + 1
end