diff --git a/elepower_dynamics/craftitems.lua b/elepower_dynamics/craftitems.lua index 56a48af..45df210 100644 --- a/elepower_dynamics/craftitems.lua +++ b/elepower_dynamics/craftitems.lua @@ -47,6 +47,12 @@ minetest.register_craftitem("elepower_dynamics:zinc_ingot", { groups = {zinc = 1, ingot = 1} }) +minetest.register_craftitem("elepower_dynamics:graphite_ingot", { + description = "Graphite Ingot", + inventory_image = "elepower_graphite_ingot.png", + groups = {graphite = 1, ingot = 1} +}) + -- Lumps minetest.register_craftitem("elepower_dynamics:lead_lump", { diff --git a/elepower_dynamics/textures/elepower_graphite_ingot.png b/elepower_dynamics/textures/elepower_graphite_ingot.png new file mode 100644 index 0000000..9b321cc Binary files /dev/null and b/elepower_dynamics/textures/elepower_graphite_ingot.png differ diff --git a/elepower_dynamics/textures/elepower_lead_block.png b/elepower_dynamics/textures/elepower_lead_block.png index cc899a5..89f7772 100644 Binary files a/elepower_dynamics/textures/elepower_lead_block.png and b/elepower_dynamics/textures/elepower_lead_block.png differ diff --git a/elepower_farming/formspec.lua b/elepower_farming/formspec.lua deleted file mode 100644 index b242069..0000000 --- a/elepower_farming/formspec.lua +++ /dev/null @@ -1,75 +0,0 @@ - -elefarm.formspec = {} - -local function bar(x,y,metric) - return "image["..x..","..y..";0.25,2.8;elepower_gui_barbg.png".. - "^[lowpart:"..metric..":elefarming_gui_bar.png]" -end - -function elefarm.formspec.planter_formspec(timer, power) - return "size[8,10]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - ele.formspec.power_meter(power).. - bar(1, 0, 100-timer).. - "list[context;layout;2.5,0;3,3;]".. - "list[context;src;0,3.5;8,2;]".. - "list[current_player;main;0,5.75;8,1;]".. - "list[current_player;main;0,7;8,3;8]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 5.75) -end - -function elefarm.formspec.harvester_formspec(timer, power, sludge) - return "size[8,8.5]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - ele.formspec.power_meter(power).. - ele.formspec.fluid_bar(7, 0, sludge).. - bar(1, 0, 100-timer).. - "list[context;dst;1.5,0;5,3;]".. - "list[current_player;main;0,4.25;8,1;]".. - "list[current_player;main;0,5.5;8,3;8]".. - "listring[context;dst]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4.25) -end - -function elefarm.formspec.tree_processor(timer, power, fluid_buffer, water_buffer, output_buffer) - return "size[8,8.5]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - ele.formspec.power_meter(power).. - bar(1, 0, 100-timer).. - ele.formspec.fluid_bar(2, 0, fluid_buffer).. - ele.formspec.fluid_bar(3, 0, water_buffer).. - ele.formspec.fluid_bar(7, 0, output_buffer).. - "list[context;dst;5,1;1,1;]".. - "list[current_player;main;0,4.25;8,1;]".. - "list[current_player;main;0,5.5;8,3;8]".. - "listring[context;dst]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4.25) -end - -function elefarm.formspec.spawner_formspec(timer, power) - return "size[8,8.5]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - ele.formspec.power_meter(power).. - bar(1, 0, 100-timer).. - "list[context;src;3.5,1.5;1,1;]".. - "image[3.5,1.5;1,1;elefarming_egg_silhouette.png]".. - "list[current_player;main;0,4.25;8,1;]".. - "list[current_player;main;0,5.5;8,3;8]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4.25) -end diff --git a/elepower_farming/init.lua b/elepower_farming/init.lua index 8da07e4..8d6898a 100644 --- a/elepower_farming/init.lua +++ b/elepower_farming/init.lua @@ -6,7 +6,6 @@ local modpath = minetest.get_modpath(minetest.get_current_modname()) elefarm = rawget(_G, "elefarm") or {} elefarm.modpath = modpath -dofile(modpath.."/formspec.lua") dofile(modpath.."/craftitems.lua") dofile(modpath.."/nodes/init.lua") dofile(modpath.."/crafting.lua") diff --git a/elepower_farming/nodes/harvester.lua b/elepower_farming/nodes/harvester.lua index f2099de..1e1d3b3 100644 --- a/elepower_farming/nodes/harvester.lua +++ b/elepower_farming/nodes/harvester.lua @@ -71,6 +71,22 @@ local function harvest(pos, harvested, fdir) return harvested end +local function get_formspec(timer, power, sludge) + return "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + ele.formspec.power_meter(power).. + ele.formspec.fluid_bar(7, 0, sludge).. + ele.formspec.create_bar(1, 0, 100 - timer, "#00ff11", true).. + "list[context;dst;1.5,0;5,3;]".. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + "listring[context;dst]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0, 4.25) +end + local function on_timer(pos, elapsed) local refresh = false local meta = minetest.get_meta(pos) @@ -114,7 +130,7 @@ local function on_timer(pos, elapsed) local power_percent = math.floor((storage / capacity)*100) local work_percent = math.floor((work / HARVESTER_TICK)*100) - meta:set_string("formspec", elefarm.formspec.harvester_formspec(work_percent, power_percent, sludge)) + meta:set_string("formspec", get_formspec(work_percent, power_percent, sludge)) meta:set_int("storage", storage) meta:set_int("src_time", work) @@ -155,7 +171,7 @@ ele.register_machine("elepower_farming:harvester", { meta:set_int("src_time", 0) - meta:set_string("formspec", elefarm.formspec.harvester_formspec(0, 0)) + meta:set_string("formspec", get_formspec(0, 0)) local node = minetest.get_node(pos) end, diff --git a/elepower_farming/nodes/planter.lua b/elepower_farming/nodes/planter.lua index aa6806b..0de902f 100644 --- a/elepower_farming/nodes/planter.lua +++ b/elepower_farming/nodes/planter.lua @@ -51,6 +51,23 @@ local ranges = { }, } +local function get_formspec(timer, power) + return "size[8,10]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + ele.formspec.power_meter(power).. + ele.formspec.create_bar(1, 0, 100 - timer, "#00ff11", true).. + "list[context;layout;2.5,0;3,3;]".. + "list[context;src;0,3.5;8,2;]".. + "list[current_player;main;0,5.75;8,1;]".. + "list[current_player;main;0,7;8,3;8]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0, 5.75) +end + local function can_dig(pos, player) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -238,7 +255,7 @@ local function on_timer(pos, elapsed) local power_percent = math.floor((storage / capacity)*100) local work_percent = math.floor((work / PLANTER_TICK)*100) - meta:set_string("formspec", elefarm.formspec.planter_formspec(work_percent, power_percent)) + meta:set_string("formspec", get_formspec(work_percent, power_percent)) meta:set_int("storage", storage) meta:set_int("src_time", work) @@ -270,7 +287,7 @@ ele.register_base_device("elepower_farming:planter", { meta:set_int("src_time", 0) - meta:set_string("formspec", elefarm.formspec.planter_formspec(0,0)) + meta:set_string("formspec", get_formspec(0,0)) end, allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_take = allow_metadata_inventory_take, diff --git a/elepower_farming/nodes/spawner.lua b/elepower_farming/nodes/spawner.lua index df09dc3..1a44b40 100644 --- a/elepower_farming/nodes/spawner.lua +++ b/elepower_farming/nodes/spawner.lua @@ -89,6 +89,23 @@ local function spawn(pos, mob) return end +local function get_formspec(timer, power) + return "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + ele.formspec.power_meter(power).. + ele.formspec.create_bar(1, 0, 100 - timer, "#00ff11", true).. + "list[context;src;3.5,1.5;1,1;]".. + "image[3.5,1.5;1,1;elefarming_egg_silhouette.png]".. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0, 4.25) +end + local function on_timer(pos, elapsed) local refresh = false local meta = minetest.get_meta(pos) @@ -136,7 +153,7 @@ local function on_timer(pos, elapsed) local power_percent = math.floor((storage / capacity)*100) local work_percent = math.floor((work / SPAWNER_TICK)*100) - meta:set_string("formspec", elefarm.formspec.spawner_formspec(work_percent, power_percent)) + meta:set_string("formspec", get_formspec(work_percent, power_percent)) meta:set_int("storage", storage) meta:set_int("src_time", work) @@ -167,7 +184,7 @@ ele.register_machine("elepower_farming:spawner", { inv:set_size("src", 1) meta:set_int("src_time", 0) - meta:set_string("formspec", elefarm.formspec.spawner_formspec(0,0)) + meta:set_string("formspec", get_formspec(0,0)) end, can_dig = can_dig, on_timer = on_timer, diff --git a/elepower_farming/nodes/tree_processor.lua b/elepower_farming/nodes/tree_processor.lua index 6baceaa..2019849 100644 --- a/elepower_farming/nodes/tree_processor.lua +++ b/elepower_farming/nodes/tree_processor.lua @@ -21,6 +21,24 @@ local tree_fluid_recipes = { }, } +local function get_formspec(timer, power, fluid_buffer, water_buffer, output_buffer) + return "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + ele.formspec.power_meter(power).. + ele.formspec.create_bar(1, 0, 100 - timer, "#00ff11", true).. + ele.formspec.fluid_bar(2, 0, fluid_buffer).. + ele.formspec.fluid_bar(3, 0, water_buffer).. + ele.formspec.fluid_bar(7, 0, output_buffer).. + "list[context;dst;5,1;1,1;]".. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + "listring[context;dst]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0, 4.25) +end + local function on_timer(pos, elapsed) local refresh = false local meta = minetest.get_meta(pos) @@ -118,7 +136,7 @@ local function on_timer(pos, elapsed) timer = math.floor(100 * time / time_max) end - meta:set_string("formspec", elefarm.formspec.tree_processor(timer, power, tree_buffer, water_buffer, out_buffer)) + meta:set_string("formspec", get_formspec(timer, power, tree_buffer, water_buffer, out_buffer)) return refresh end @@ -149,7 +167,7 @@ ele.register_machine("elepower_farming:tree_processor", { local inv = meta:get_inventory() inv:set_size("dst", 1) - meta:set_string("formspec", elefarm.formspec.tree_processor(0, 0)) + meta:set_string("formspec", get_formspec(0, 0)) end, tiles = { "elefarming_machine_tree_processor.png", "elefarming_machine_base.png", "elefarming_machine_side.png", diff --git a/elepower_machines/crafting.lua b/elepower_machines/crafting.lua index 4609d45..626fae0 100644 --- a/elepower_machines/crafting.lua +++ b/elepower_machines/crafting.lua @@ -29,6 +29,10 @@ local alloy_recipes = { recipe = { "elepower_dynamics:silicon", "elepower_dynamics:gold_dust 4" }, output = "elepower_dynamics:silicon_wafer", }, + { + recipe = { "default:coal_lump", "elepower_dynamics:coal_dust 4" }, + output = "elepower_dynamics:graphite_ingot", + }, } -- Register alloy furnace recipes diff --git a/elepower_machines/formspec.lua b/elepower_machines/formspec.lua deleted file mode 100644 index a6dc2e5..0000000 --- a/elepower_machines/formspec.lua +++ /dev/null @@ -1,183 +0,0 @@ - --- Specialized formspec for crafters -function ele.formspec.get_crafter_formspec(craft_type, power, percent) - local craftstats = elepm.craft.types[craft_type] - local input_size = craftstats.inputs - - local gui_name = "gui_furnace_arrow" - if craftstats.gui_name then - gui_name = craftstats.gui_name - end - - local bar = "image[4,1.5;1,1;"..gui_name.."_bg.png^[transformR270]" - - if percent ~= nil then - bar = "image[4,1.5;1,1;"..gui_name.."_bg.png^[lowpart:".. - (percent)..":"..gui_name.."_fg.png^[transformR270]" - end - - local in_width = input_size - local in_height = 1 - - for n = 2, 4 do - if input_size % n == 0 and input_size ~= n then - in_width = input_size / n - in_height = input_size / n - end - end - - local y = 1.5 - local x = 1.5 - if in_height == 2 then - y = 1 - elseif in_height >= 3 then - y = 0.5 - end - - if in_width >= 2 then - x = 1 - end - - return "size[8,8.5]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - ele.formspec.power_meter(power).. - "list[context;src;"..x..","..y..";"..in_width..","..in_height..";]".. - bar.. - "list[context;dst;5,1;2,2;]".. - "list[current_player;main;0,4.25;8,1;]".. - "list[current_player;main;0,5.5;8,3;8]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - "listring[context;dst]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4.25) -end - -function ele.formspec.get_fluid_generator_formspec(power, percent, buffer) - return "size[8,8.5]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - ele.formspec.power_meter(power).. - ele.formspec.fluid_bar(7, 0, buffer).. - "image[3.5,1.5;1,1;default_furnace_fire_bg.png^[lowpart:".. - (percent)..":default_furnace_fire_fg.png]".. - "list[current_player;main;0,4.25;8,1;]".. - "list[current_player;main;0,5.5;8,3;8]".. - default.get_hotbar_bg(0, 4.25) -end - -function ele.formspec.get_generator_formspec(power, percent) - return "size[8,8.5]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - ele.formspec.power_meter(power).. - "list[context;src;3,1.5;1,1;]".. - "image[4,1.5;1,1;default_furnace_fire_bg.png^[lowpart:".. - percent..":default_furnace_fire_fg.png]".. - "list[current_player;main;0,4.25;8,1;]".. - "list[current_player;main;0,5.5;8,3;8]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4.25) -end - -function ele.formspec.get_storage_formspec(power) - return "size[8,8.5]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - ele.formspec.power_meter(power).. - "image[2,0.5;1,1;gui_furnace_arrow_bg.png^[transformR180]".. - "list[context;out;2,1.5;1,1;]".. - "image[5,0.5;1,1;gui_furnace_arrow_bg.png]".. - "list[context;in;5,1.5;1,1;]".. - "list[current_player;main;0,4.25;8,1;]".. - "list[current_player;main;0,5.5;8,3;8]".. - "listring[current_player;main]".. - "listring[context;out]".. - "listring[current_player;main]".. - "listring[context;in]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4.25) -end - -function elepm.get_coal_alloy_furnace_formspec(fuel_percent, item_percent) - return "size[8,8.5]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;src;2,0.5;2,1;]".. - "list[context;fuel;2.5,2.5;1,1;]".. - "image[2.5,1.5;1,1;default_furnace_fire_bg.png^[lowpart:".. - (100-fuel_percent)..":default_furnace_fire_fg.png]".. - "image[4,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:".. - (item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. - "list[context;dst;5,0.96;2,2;]".. - "list[current_player;main;0,4.25;8,1;]".. - "list[current_player;main;0,5.5;8,3;8]".. - "listring[context;dst]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - "listring[context;fuel]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4.25) -end - -function elepm.get_grindstone_formspec(item_percent) - return "size[8,8.5]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;src;1.6,1;1,1;]".. - "image[3.5,1;1,1;gui_furnace_arrow_bg.png^[lowpart:".. - (item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. - "list[context;dst;4.5,1;2,1;]".. - "list[current_player;main;0,4.25;8,1;]".. - "list[current_player;main;0,5.5;8,3;8]".. - "listring[context;dst]".. - "listring[current_player;main]".. - "listring[context;src]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4.25) -end - -function elepm.get_lava_cooler_formspec(item_percent, coolant_buffer, hot_buffer, power, recipes, recipe) - local rclist = {} - - local x = 2.5 - for j in pairs(recipes) do - if j == recipe then - rclist[#rclist + 1] = "item_image["..x..",0;1,1;"..j.."]" - else - rclist[#rclist + 1] = "item_image_button[".. x ..",0;1,1;"..j..";"..j..";]" - end - x = x + 1 - end - - return "size[8,8.5]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - ele.formspec.power_meter(power).. - ele.formspec.fluid_bar(1, 0, coolant_buffer).. - ele.formspec.fluid_bar(7, 0, hot_buffer).. - "list[context;dst;3.5,1.5;1,1;]".. - "image[2.5,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:".. - (item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. - "image[4.5,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:".. - (item_percent)..":gui_furnace_arrow_fg.png^[transformFXR90]".. - table.concat(rclist, "").. - "list[current_player;main;0,4.25;8,1;]".. - "list[current_player;main;0,5.5;8,3;8]".. - "listring[current_player;main]".. - "listring[context;dst]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0, 4.25) -end diff --git a/elepower_machines/init.lua b/elepower_machines/init.lua index 8bb03c9..b23d0df 100644 --- a/elepower_machines/init.lua +++ b/elepower_machines/init.lua @@ -8,7 +8,6 @@ elepm.modpath = modpath -- Utility dofile(modpath.."/craft.lua") -dofile(modpath.."/formspec.lua") -- Machines dofile(modpath.."/machines/init.lua") diff --git a/elepower_machines/machines/bases/crafter.lua b/elepower_machines/machines/bases/crafter.lua index a444e30..92ed3fa 100644 --- a/elepower_machines/machines/bases/crafter.lua +++ b/elepower_machines/machines/bases/crafter.lua @@ -1,6 +1,63 @@ -- This is a crafter type machine base. -- It accepts a recipe type registered beforehand. +-- Specialized formspec for crafters +function ele.formspec.get_crafter_formspec(craft_type, power, percent) + local craftstats = elepm.craft.types[craft_type] + local input_size = craftstats.inputs + + local gui_name = "gui_furnace_arrow" + if craftstats.gui_name then + gui_name = craftstats.gui_name + end + + local bar = "image[4,1.5;1,1;"..gui_name.."_bg.png^[transformR270]" + + if percent ~= nil then + bar = "image[4,1.5;1,1;"..gui_name.."_bg.png^[lowpart:".. + (percent)..":"..gui_name.."_fg.png^[transformR270]" + end + + local in_width = input_size + local in_height = 1 + + for n = 2, 4 do + if input_size % n == 0 and input_size ~= n then + in_width = input_size / n + in_height = input_size / n + end + end + + local y = 1.5 + local x = 1.5 + if in_height == 2 then + y = 1 + elseif in_height >= 3 then + y = 0.5 + end + + if in_width >= 2 then + x = 1 + end + + return "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + ele.formspec.power_meter(power).. + "list[context;src;"..x..","..y..";"..in_width..","..in_height..";]".. + bar.. + "list[context;dst;5,1;2,2;]".. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + "listring[context;dst]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0, 4.25) +end + function elepm.register_crafter(nodename, nodedef) local craft_type = nodedef.craft_type if not craft_type or not elepm.craft.types[craft_type] then diff --git a/elepower_machines/machines/bases/fluidgenerator.lua b/elepower_machines/machines/bases/fluidgenerator.lua index 579f1ee..2401841 100644 --- a/elepower_machines/machines/bases/fluidgenerator.lua +++ b/elepower_machines/machines/bases/fluidgenerator.lua @@ -1,4 +1,18 @@ +local function get_formspec(power, percent, buffer) + return "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + ele.formspec.power_meter(power).. + ele.formspec.fluid_bar(7, 0, buffer).. + "image[3.5,1.5;1,1;default_furnace_fire_bg.png^[lowpart:".. + (percent)..":default_furnace_fire_fg.png]".. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + default.get_hotbar_bg(0, 4.25) +end + -- A generator that creates power using a fuel function ele.register_fluid_generator(nodename, nodedef) local fuel = nodedef.fuel @@ -67,7 +81,7 @@ function ele.register_fluid_generator(nodename, nodedef) local active_node = nodename.."_active" ele.helpers.swap_node(pos, active_node) else - meta:set_string("formspec", ele.formspec.get_fluid_generator_formspec(pow_percent, 0, flbuffer)) + meta:set_string("formspec", get_formspec(pow_percent, 0, flbuffer)) meta:set_string("infotext", ("%s Idle\n%s\n%s"):format(nodedef.description, ele.capacity_text(capacity, storage), fluid_lib.buffer_to_string(flbuffer))) @@ -78,7 +92,7 @@ function ele.register_fluid_generator(nodename, nodedef) if burn_totaltime == 0 then burn_totaltime = 1 end local percent = math.floor((burn_time / burn_totaltime) * 100) - meta:set_string("formspec", ele.formspec.get_fluid_generator_formspec(pow_percent, percent, flbuffer)) + meta:set_string("formspec", get_formspec(pow_percent, percent, flbuffer)) meta:set_string("infotext", ("%s Active\n%s\n%s"):format(nodedef.description, ele.capacity_text(capacity, storage), fluid_lib.buffer_to_string(flbuffer))) @@ -92,7 +106,7 @@ function ele.register_fluid_generator(nodename, nodedef) local capacity = ele.helpers.get_node_property(meta, pos, "capacity") local storage = ele.helpers.get_node_property(meta, pos, "storage") - meta:set_string("formspec", ele.formspec.get_fluid_generator_formspec(math.floor((storage / capacity) * 100), 0)) + meta:set_string("formspec", get_formspec(math.floor((storage / capacity) * 100), 0)) end } diff --git a/elepower_machines/machines/bases/generator.lua b/elepower_machines/machines/bases/generator.lua index 47804d9..9ba3e6e 100644 --- a/elepower_machines/machines/bases/generator.lua +++ b/elepower_machines/machines/bases/generator.lua @@ -1,4 +1,21 @@ +local function get_formspec(power, percent) + return "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + ele.formspec.power_meter(power).. + "list[context;src;3,1.5;1,1;]".. + "image[4,1.5;1,1;default_furnace_fire_bg.png^[lowpart:".. + percent..":default_furnace_fire_fg.png]".. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0, 4.25) +end + function elepm.register_fuel_generator(nodename, nodedef) if not nodedef.groups then nodedef.groups = {} @@ -58,7 +75,7 @@ function elepm.register_fuel_generator(nodename, nodedef) ele.helpers.swap_node(pos, active_node) end else - meta:set_string("formspec", ele.formspec.get_generator_formspec(pow_percent, 0)) + meta:set_string("formspec", get_formspec(pow_percent, 0)) meta:set_string("infotext", ("%s Idle"):format(nodedef.description) .. "\n" .. ele.capacity_text(capacity, storage)) ele.helpers.swap_node(pos, nodename) @@ -68,7 +85,7 @@ function elepm.register_fuel_generator(nodename, nodedef) if burn_totaltime == 0 then burn_totaltime = 1 end local percent = math.floor((burn_time / burn_totaltime) * 100) - meta:set_string("formspec", ele.formspec.get_generator_formspec(pow_percent, percent)) + meta:set_string("formspec", get_formspec(pow_percent, percent)) meta:set_string("infotext", ("%s Active"):format(nodedef.description) .. "\n" .. ele.capacity_text(capacity, storage)) @@ -83,7 +100,7 @@ function elepm.register_fuel_generator(nodename, nodedef) local capacity = ele.helpers.get_node_property(meta, pos, "capacity") local storage = ele.helpers.get_node_property(meta, pos, "storage") - meta:set_string("formspec", ele.formspec.get_generator_formspec(math.floor((storage / capacity) * 100), 0)) + meta:set_string("formspec", get_formspec(math.floor((storage / capacity) * 100), 0)) end ele.register_machine(nodename, nodedef) diff --git a/elepower_machines/machines/bases/storage.lua b/elepower_machines/machines/bases/storage.lua index 4a11735..acbe178 100644 --- a/elepower_machines/machines/bases/storage.lua +++ b/elepower_machines/machines/bases/storage.lua @@ -1,4 +1,24 @@ +local function get_formspec(power) + return "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + ele.formspec.power_meter(power).. + "image[2,0.5;1,1;gui_furnace_arrow_bg.png^[transformR180]".. + "list[context;out;2,1.5;1,1;]".. + "image[5,0.5;1,1;gui_furnace_arrow_bg.png]".. + "list[context;in;5,1.5;1,1;]".. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + "listring[current_player;main]".. + "listring[context;out]".. + "listring[current_player;main]".. + "listring[context;in]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0, 4.25) +end + local function can_dig(pos, player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() @@ -34,7 +54,7 @@ function elepm.register_storage(nodename, nodedef) local rounded = math.floor(percent * 100) ele.helpers.swap_node(pos, nodename .. "_" .. level) - meta:set_string("formspec", ele.formspec.get_storage_formspec(rounded)) + meta:set_string("formspec", get_formspec(rounded)) meta:set_string("infotext", ("%s Active"):format(nodedef.description) .. "\n" .. ele.capacity_text(capacity, storage)) @@ -112,7 +132,7 @@ function elepm.register_storage(nodename, nodedef) local inv = meta:get_inventory() inv:set_size("out", 1) inv:set_size("in", 1) - meta:set_string("formspec", ele.formspec.get_storage_formspec(0)) + meta:set_string("formspec", get_formspec(0)) end for i = 0, levels do diff --git a/elepower_machines/machines/coal_alloy_furnace.lua b/elepower_machines/machines/coal_alloy_furnace.lua index e82ae31..c0cea65 100644 --- a/elepower_machines/machines/coal_alloy_furnace.lua +++ b/elepower_machines/machines/coal_alloy_furnace.lua @@ -1,4 +1,27 @@ +local function get_formspec(fuel_percent, item_percent) + return "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[context;src;2,0.5;2,1;]".. + "list[context;fuel;2.5,2.5;1,1;]".. + "image[2.5,1.5;1,1;default_furnace_fire_bg.png^[lowpart:".. + (100-fuel_percent)..":default_furnace_fire_fg.png]".. + "image[4,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:".. + (item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. + "list[context;dst;5,0.96;2,2;]".. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + "listring[context;dst]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + "listring[context;fuel]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0, 4.25) +end + local function can_dig(pos, player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() @@ -144,11 +167,11 @@ local function alloy_furnace_timer(pos, elapsed) if fuel_totaltime ~= 0 then active = "Active" local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100) - formspec = elepm.get_coal_alloy_furnace_formspec(fuel_percent, item_percent) + formspec = get_formspec(fuel_percent, item_percent) ele.helpers.swap_node(pos, "elepower_machines:coal_alloy_furnace_active") result = true else - formspec = elepm.get_coal_alloy_furnace_formspec(100, 0) + formspec = get_formspec(100, 0) ele.helpers.swap_node(pos, "elepower_machines:coal_alloy_furnace") minetest.get_node_timer(pos):stop() end @@ -205,7 +228,7 @@ ele.register_base_device("elepower_machines:coal_alloy_furnace", { inv:set_size("dst", 4) inv:set_size("fuel", 1) - meta:set_string("formspec", elepm.get_coal_alloy_furnace_formspec(100, 0)) + meta:set_string("formspec", get_formspec(100, 0)) end, allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_take = allow_metadata_inventory_take, diff --git a/elepower_machines/machines/grindstone.lua b/elepower_machines/machines/grindstone.lua index 1de28f8..ad1c27b 100644 --- a/elepower_machines/machines/grindstone.lua +++ b/elepower_machines/machines/grindstone.lua @@ -1,4 +1,22 @@ +local function get_formspec(item_percent) + return "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[context;src;1.6,1;1,1;]".. + "image[3.5,1;1,1;gui_furnace_arrow_bg.png^[lowpart:".. + (item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. + "list[context;dst;4.5,1;2,1;]".. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + "listring[context;dst]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0, 4.25) +end + local function can_dig(pos, player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() @@ -46,7 +64,7 @@ local function grindstone_timer(pos, elapsed) if not recipe or recipe.time == 0 then meta:set_int("src_time", 0) meta:set_int("src_time_max", 0) - meta:set_string("formspec", elepm.get_grindstone_formspec(0)) + meta:set_string("formspec", get_formspec(0)) meta:set_string("infotext", "No recipe") return end @@ -86,7 +104,7 @@ local function grindstone_timer(pos, elapsed) end local percentile = math.floor(100 * time / target_time) - meta:set_string("formspec", elepm.get_grindstone_formspec(percentile)) + meta:set_string("formspec", get_formspec(percentile)) meta:set_int("src_time", time) meta:set_int("src_time_max", target_time) meta:set_string("infotext", "Grindstone: ".. percentile .. "%\nPunch me to progress!") @@ -107,7 +125,7 @@ ele.register_base_device("elepower_machines:grindstone", { inv:set_size("src", 1) inv:set_size("dst", 2) - meta:set_string("formspec", elepm.get_grindstone_formspec(0)) + meta:set_string("formspec", get_formspec(0)) end, tube = false, allow_metadata_inventory_put = allow_metadata_inventory_put, diff --git a/elepower_machines/machines/init.lua b/elepower_machines/machines/init.lua index 5e71400..9babbd4 100644 --- a/elepower_machines/machines/init.lua +++ b/elepower_machines/machines/init.lua @@ -1,16 +1,28 @@ --- Basic -dofile(elepm.modpath.."/machines/bases/init.lua") -dofile(elepm.modpath.."/machines/accumulator.lua") -dofile(elepm.modpath.."/machines/furnace.lua") -dofile(elepm.modpath.."/machines/alloy_furnace.lua") -dofile(elepm.modpath.."/machines/coal_alloy_furnace.lua") -dofile(elepm.modpath.."/machines/pulverizer.lua") -dofile(elepm.modpath.."/machines/grindstone.lua") -dofile(elepm.modpath.."/machines/sawmill.lua") -dofile(elepm.modpath.."/machines/generator.lua") -dofile(elepm.modpath.."/machines/storage.lua") -dofile(elepm.modpath.."/machines/lava_cooler.lua") -dofile(elepm.modpath.."/machines/solderer.lua") -dofile(elepm.modpath.."/machines/lava_generator.lua") -dofile(elepm.modpath.."/machines/steam_turbine.lua") +local mp = elepm.modpath .. "/machines/" + +-- Bases +dofile(mp .. "bases/init.lua") + +-- Generation +dofile(mp .. "generator.lua") +dofile(mp .. "lava_generator.lua") +dofile(mp .. "steam_turbine.lua") + +-- Storage +dofile(mp .. "storage.lua") + +-- Processing +dofile(mp .. "furnace.lua") +dofile(mp .. "sawmill.lua") +dofile(mp .. "pulverizer.lua") +dofile(mp .. "grindstone.lua") + +-- Crafter +dofile(mp .. "alloy_furnace.lua") +dofile(mp .. "coal_alloy_furnace.lua") +dofile(mp .. "solderer.lua") + +-- Other +dofile(mp .. "accumulator.lua") +dofile(mp .. "lava_cooler.lua") diff --git a/elepower_machines/machines/lava_cooler.lua b/elepower_machines/machines/lava_cooler.lua index 369d52b..daa7c74 100644 --- a/elepower_machines/machines/lava_cooler.lua +++ b/elepower_machines/machines/lava_cooler.lua @@ -16,6 +16,41 @@ local cooler_recipes = { }, } +local function get_formspec(item_percent, coolant_buffer, hot_buffer, power, recipes, recipe) + local rclist = {} + + local x = 2.5 + for j in pairs(recipes) do + if j == recipe then + rclist[#rclist + 1] = "item_image["..x..",0;1,1;"..j.."]" + else + rclist[#rclist + 1] = "item_image_button[".. x ..",0;1,1;"..j..";"..j..";]" + end + x = x + 1 + end + + return "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + ele.formspec.power_meter(power).. + ele.formspec.fluid_bar(1, 0, coolant_buffer).. + ele.formspec.fluid_bar(7, 0, hot_buffer).. + "list[context;dst;3.5,1.5;1,1;]".. + "image[2.5,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:".. + (item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. + "image[4.5,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:".. + (item_percent)..":gui_furnace_arrow_fg.png^[transformFXR90]".. + table.concat(rclist, "").. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + "listring[current_player;main]".. + "listring[context;dst]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0, 4.25) +end + + local function lava_cooler_timer(pos, elapsed) local refresh = false @@ -77,7 +112,7 @@ local function lava_cooler_timer(pos, elapsed) meta:set_int("storage", storage) meta:set_string("infotext", ("Lava Cooler %s\n%s"):format(active, ele.capacity_text(capacity, storage))) - meta:set_string("formspec", elepm.get_lava_cooler_formspec(timer, coolant_buffer, hot_buffer, + meta:set_string("formspec", get_formspec(timer, coolant_buffer, hot_buffer, power, cooler_recipes, recipe)) return refresh @@ -107,7 +142,7 @@ ele.register_machine("elepower_machines:lava_cooler", { inv:set_size("dst", 1) meta:set_string("recipe", "default:cobble") - meta:set_string("formspec", elepm.get_lava_cooler_formspec(0,nil,nil,0,cooler_recipes, "default:cobble")) + meta:set_string("formspec", get_formspec(0,nil,nil,0,cooler_recipes, "default:cobble")) end, on_timer = lava_cooler_timer, on_receive_fields = function (pos, formname, fields, sender) diff --git a/elepower_machines/textures/elepower_gui_bar.png b/elepower_machines/textures/elepower_gui_bar.png deleted file mode 100644 index 45343f0..0000000 Binary files a/elepower_machines/textures/elepower_gui_bar.png and /dev/null differ diff --git a/elepower_nuclear/crafting.lua b/elepower_nuclear/crafting.lua new file mode 100644 index 0000000..b2ec281 --- /dev/null +++ b/elepower_nuclear/crafting.lua @@ -0,0 +1,27 @@ + +-- Radiation-shielded Lead Machine Chassis +minetest.register_craft({ + output = "elepower_nuclear:machine_block", + recipe = { + {"elepower_dynamics:induction_coil_advanced", "elepower_dynamics:graphite_ingot", "elepower_dynamics:induction_coil_advanced"}, + {"elepower_dynamics:graphite_ingot", "elepower_dynamics:lead_block", "elepower_dynamics:graphite_ingot"}, + {"elepower_dynamics:lead_block", "elepower_dynamics:graphite_ingot", "elepower_dynamics:lead_block"}, + } +}) + +-- Enrichment Plant +minetest.register_craft({ + output = "elepower_nuclear:enrichment_plant", + recipe = { + {"elepower_dynamics:induction_coil_advanced", "elepower_dynamics:soc", "elepower_dynamics:induction_coil_advanced"}, + {"elepower_nuclear:graphite_rod", "elepower_nuclear:machine_block", "elepower_nuclear:graphite_rod"}, + {"elepower_dynamics:wound_silver_coil", "elepower_dynamics:viridisium_gear", "elepower_dynamics:wound_silver_coil"}, + } +}) + +elepm.register_craft({ + type = "grind", + recipe = { "elepower_dynamics:graphite_ingot" }, + output = "elepower_nuclear:graphite_rod 3", + time = 6, +}) diff --git a/elepower_nuclear/fluids.lua b/elepower_nuclear/fluids.lua index f5361c3..dba797b 100644 --- a/elepower_nuclear/fluids.lua +++ b/elepower_nuclear/fluids.lua @@ -8,36 +8,36 @@ minetest.register_node("elepower_nuclear:coolant", { description = "Coolant (cold)", - groups = {not_in_creative_inventory = 1}, + groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = 1, coolant = 1}, tiles = {"elenuclear_cold_coolant.png"}, }) minetest.register_node("elepower_nuclear:coolant_hot", { description = "Coolant (hot)", - groups = {not_in_creative_inventory = 1}, + groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = 1, coolant = 1}, tiles = {"elenuclear_hot_coolant.png"}, }) minetest.register_node("elepower_nuclear:heavy_water", { description = "Heavy Water", - groups = {not_in_creative_inventory = 1}, - tiles = {"default_water.png"}, + groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = 1, water = 1}, + tiles = {"elenuclear_heavy_water.png"}, }) minetest.register_node("elepower_nuclear:tritium", { description = "Tritium Gas", - groups = {not_in_creative_inventory = 1}, - tiles = {"default_water.png"}, + groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = 1, gas = 1}, + tiles = {"elenuclear_gas.png"}, }) minetest.register_node("elepower_nuclear:deuterium", { description = "Deuterium Gas", - groups = {not_in_creative_inventory = 1}, - tiles = {"default_water.png"}, + groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = 1, gas = 1}, + tiles = {"elenuclear_gas.png"}, }) minetest.register_node("elepower_nuclear:helium", { description = "Helium Gas", - groups = {not_in_creative_inventory = 1}, + groups = {not_in_creative_inventory = 1, oddly_breakable_by_hand = 1, gas = 1}, tiles = {"elenuclear_helium.png"}, }) diff --git a/elepower_nuclear/init.lua b/elepower_nuclear/init.lua index 352a891..4584e55 100644 --- a/elepower_nuclear/init.lua +++ b/elepower_nuclear/init.lua @@ -9,3 +9,4 @@ elenuclear.modpath = modpath dofile(modpath.."/craftitems.lua") dofile(modpath.."/nodes.lua") dofile(modpath.."/fluids.lua") +dofile(modpath.."/crafting.lua") diff --git a/elepower_nuclear/machines/enrichment_plant.lua b/elepower_nuclear/machines/enrichment_plant.lua new file mode 100644 index 0000000..7177658 --- /dev/null +++ b/elepower_nuclear/machines/enrichment_plant.lua @@ -0,0 +1,60 @@ +-- Nuclear fuel enrichment plant + +local function get_formspec(power, heat, progress, water) + return "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + ele.formspec.power_meter(power).. + ele.formspec.create_bar(1, 0, heat, "#ffbb11", true).. + "list[context;src;2,0.75;1,1;]".. + "image[3.5,0.75;1,1;gui_furnace_arrow_bg.png^[lowpart:".. + (progress)..":gui_furnace_arrow_fg.png^[transformR270]".. + "list[context;dst;5,0.25;2,2;]".. + ele.formspec.fluid_bar(7, 0, water).. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + "image[7,3;1,1;elenuclear_radioactive.png]".. + "listring[current_player;main]".. + "listring[context;src]".. + "listring[current_player;main]".. + "listring[context;dst]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0, 4.25) +end + +local function enrichment_plant_timer (pos) + local meta = minetest.get_meta(pos) + local refresh = false + + return refresh +end + +ele.register_machine("elepower_nuclear:enrichment_plant", { + description = "Enrichment Plant", + tiles = { + "elenuclear_machine_top.png", "elenuclear_machine_top.png", "elenuclear_machine_side.png", + "elenuclear_machine_side.png", "elenuclear_machine_side.png", "elenuclear_enrichment_plant.png", + }, + groups = {ele_user = 1, cracky = 3, fluid_container = 1}, + ele_capacity = 16000, + ele_usage = 288, + ele_inrush = 288, + fluid_buffers = { + water = { + accepts = {"default:water_source"}, + capacity = 8000, + drainable = false, + } + }, + on_construct = function (pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + + inv:set_size("src", 1) + inv:set_size("dst", 4) + + meta:set_string("formspec", get_formspec(0, 25, 0, nil)) + end, + on_timer = enrichment_plant_timer, +}) diff --git a/elepower_nuclear/machines/init.lua b/elepower_nuclear/machines/init.lua index e69de29..85685b2 100644 --- a/elepower_nuclear/machines/init.lua +++ b/elepower_nuclear/machines/init.lua @@ -0,0 +1,13 @@ + +local mp = elenuclear.modpath .. "/machines/" + +minetest.register_node("elepower_nuclear:machine_block", { + description = "Radiation-shielded Lead Machine Chassis", + tiles = { + "elenuclear_machine_top.png", "elepower_lead_block.png", "elenuclear_machine_block.png", + "elenuclear_machine_block.png", "elenuclear_machine_block.png", "elenuclear_machine_block.png", + }, + groups = {cracky = 3}, +}) + +dofile(mp.."enrichment_plant.lua") diff --git a/elepower_nuclear/textures/elenuclear_enrichment_plant.png b/elepower_nuclear/textures/elenuclear_enrichment_plant.png new file mode 100644 index 0000000..4ee4e97 Binary files /dev/null and b/elepower_nuclear/textures/elenuclear_enrichment_plant.png differ diff --git a/elepower_nuclear/textures/elenuclear_gas.png b/elepower_nuclear/textures/elenuclear_gas.png new file mode 100644 index 0000000..b942997 Binary files /dev/null and b/elepower_nuclear/textures/elenuclear_gas.png differ diff --git a/elepower_nuclear/textures/elenuclear_heavy_water.png b/elepower_nuclear/textures/elenuclear_heavy_water.png new file mode 100644 index 0000000..6929134 Binary files /dev/null and b/elepower_nuclear/textures/elenuclear_heavy_water.png differ diff --git a/elepower_nuclear/textures/elenuclear_machine_block.png b/elepower_nuclear/textures/elenuclear_machine_block.png new file mode 100644 index 0000000..41901f8 Binary files /dev/null and b/elepower_nuclear/textures/elenuclear_machine_block.png differ diff --git a/elepower_nuclear/textures/elenuclear_machine_side.png b/elepower_nuclear/textures/elenuclear_machine_side.png new file mode 100644 index 0000000..239c464 Binary files /dev/null and b/elepower_nuclear/textures/elenuclear_machine_side.png differ diff --git a/elepower_nuclear/textures/elenuclear_machine_top.png b/elepower_nuclear/textures/elenuclear_machine_top.png new file mode 100644 index 0000000..96719be Binary files /dev/null and b/elepower_nuclear/textures/elenuclear_machine_top.png differ diff --git a/elepower_nuclear/textures/elenuclear_radioactive.png b/elepower_nuclear/textures/elenuclear_radioactive.png new file mode 100644 index 0000000..9ac3a0f Binary files /dev/null and b/elepower_nuclear/textures/elenuclear_radioactive.png differ diff --git a/elepower_papi/formspec.lua b/elepower_papi/formspec.lua index a7bc513..e6ecd02 100644 --- a/elepower_papi/formspec.lua +++ b/elepower_papi/formspec.lua @@ -1,9 +1,24 @@ --- Formspec helper: Add power bar +-- Formspec helpers ele.formspec = {} -function ele.formspec.power_meter(pw_percent) - return "image[0,0;1,2.8;elepower_gui_barbg.png".. - "^[lowpart:"..pw_percent..":elepower_gui_bar.png]".. - "image[0,0;1,2.8;elepower_gui_gauge.png]" +function ele.formspec.create_bar(x, y, metric, color, small) + if not metric or metric < 0 then metric = 0 end + + local width = 1 + local gauge = "image[0,0;1,2.8;elepower_gui_gauge.png]" + + -- Smaller width bar + if small then + width = 0.25 + gauge = "" + end + + return "image["..x..","..y..";"..width..",2.8;elepower_gui_barbg.png".. + "\\^[lowpart\\:"..metric.."\\:elepower_gui_bar.png\\\\^[multiply\\\\:"..color.."]".. + gauge +end + +function ele.formspec.power_meter(pw_percent) + return ele.formspec.create_bar(0, 0, pw_percent, "#00a1ff") end diff --git a/elepower_papi/textures/elepower_gui_bar.png b/elepower_papi/textures/elepower_gui_bar.png new file mode 100644 index 0000000..630ac5e Binary files /dev/null and b/elepower_papi/textures/elepower_gui_bar.png differ diff --git a/elepower_machines/textures/elepower_gui_barbg.png b/elepower_papi/textures/elepower_gui_barbg.png similarity index 100% rename from elepower_machines/textures/elepower_gui_barbg.png rename to elepower_papi/textures/elepower_gui_barbg.png diff --git a/elepower_machines/textures/elepower_gui_gauge.png b/elepower_papi/textures/elepower_gui_gauge.png similarity index 100% rename from elepower_machines/textures/elepower_gui_gauge.png rename to elepower_papi/textures/elepower_gui_gauge.png diff --git a/elepower_machines/textures/elepower_power_port.png b/elepower_papi/textures/elepower_power_port.png similarity index 100% rename from elepower_machines/textures/elepower_power_port.png rename to elepower_papi/textures/elepower_power_port.png