Skip to content

Commit

Permalink
removed generator formspec dupes
Browse files Browse the repository at this point in the history
  • Loading branch information
nonfreegithub committed Dec 23, 2023
1 parent c3a7434 commit ef9ed6b
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions technic/machines/register/generator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ local function update_generator_formspec(meta, desc, percent, form_buttons)
"list[context;src;3,1;1,1;]"..
"listring[context;src]"..
"image[4,1;1,1;default_furnace_fire_bg.png^[lowpart:"..
(percent)..":default_furnace_fire_fg.png]"..
(percent or 0)..":default_furnace_fire_fg.png]"..
form_buttons

if minetest.get_modpath("mcl_formspec") then
Expand Down Expand Up @@ -62,28 +62,6 @@ function technic.register_generator(data)
local active_groups = {not_in_creative_inventory = 1}
for k, v in pairs(groups) do active_groups[k] = v end

local generator_formspec =
size..
"label[0,0;"..S("Fuel-Fired @1 Generator", S(tier)).."]"..
"list[context;src;3,1;1,1;]"..
"listring[context;src]"..
"image[4,1;1,1;default_furnace_fire_bg.png]"

if minetest.get_modpath("mcl_formspec") then
generator_formspec = generator_formspec..
mcl_formspec.get_itemslot_bg(3,1,1,1)..
-- player inventory
"list[current_player;main;0,5.5;9,3;9]"..
mcl_formspec.get_itemslot_bg(0,5.5,9,3)..
"list[current_player;main;0,8.74;9,1;]"..
mcl_formspec.get_itemslot_bg(0,8.74,9,1)..
"listring[current_player;main]"
else
generator_formspec = generator_formspec..
"list[current_player;main;0,5;8,4;]"..
"listring[current_player;main]"
end

local desc = S("Fuel-Fired @1 Generator", S(tier))

local run = function(pos, node)
Expand Down Expand Up @@ -181,7 +159,7 @@ function technic.register_generator(data)
}
)..pipeworks.button_label
end
meta:set_string("formspec", generator_formspec..form_buttons)
update_generator_formspec(meta, desc, percent, form_buttons)
local inv = meta:get_inventory()
inv:set_size("src", 1)
end,
Expand Down Expand Up @@ -209,7 +187,7 @@ function technic.register_generator(data)
}
)..pipeworks.button_label
end
meta:set_string("formspec", generator_formspec..form_buttons)
update_generator_formspec(meta, desc, percent, form_buttons)
end,
})

Expand Down

0 comments on commit ef9ed6b

Please sign in to comment.