mirror of
https://github.com/minetest-mods/technic.git
synced 2024-12-22 13:52:31 +01:00
pipeworks has button on/off, button label, and button "base" cached
used them wherever possible
This commit is contained in:
parent
54004f4951
commit
fab2c492c4
@ -66,13 +66,13 @@ local function set_injector_formspec(meta)
|
|||||||
"listring[]"..
|
"listring[]"..
|
||||||
fs_helpers.cycling_button(
|
fs_helpers.cycling_button(
|
||||||
meta,
|
meta,
|
||||||
"image_button[0,4.3;1,0.6",
|
pipeworks.button_base,
|
||||||
"splitstacks",
|
"splitstacks",
|
||||||
{
|
{
|
||||||
{text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
|
pipeworks.button_off,
|
||||||
{text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
|
pipeworks.button_on
|
||||||
}
|
}
|
||||||
).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
|
)..pipeworks.button_label
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -79,8 +79,8 @@ local function add_on_off_buttons(meta, ltier, charge_percent)
|
|||||||
"image_button[3,2.0;1,0.6",
|
"image_button[3,2.0;1,0.6",
|
||||||
"split_src_stacks",
|
"split_src_stacks",
|
||||||
{
|
{
|
||||||
{text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
|
pipeworks.button_off,
|
||||||
{text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
|
pipeworks.button_on
|
||||||
}
|
}
|
||||||
).."label[3.9,2.01;Allow splitting incoming 'charge' stacks from tubes]"..
|
).."label[3.9,2.01;Allow splitting incoming 'charge' stacks from tubes]"..
|
||||||
fs_helpers.cycling_button(
|
fs_helpers.cycling_button(
|
||||||
@ -88,8 +88,8 @@ local function add_on_off_buttons(meta, ltier, charge_percent)
|
|||||||
"image_button[3,2.5;1,0.6",
|
"image_button[3,2.5;1,0.6",
|
||||||
"split_dst_stacks",
|
"split_dst_stacks",
|
||||||
{
|
{
|
||||||
{text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
|
pipeworks.button_off,
|
||||||
{text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
|
pipeworks.button_on
|
||||||
}
|
}
|
||||||
).."label[3.9,2.51;Allow splitting incoming 'discharge' stacks]"
|
).."label[3.9,2.51;Allow splitting incoming 'discharge' stacks]"
|
||||||
end
|
end
|
||||||
|
@ -88,13 +88,13 @@ function technic.register_generator(data)
|
|||||||
if ltier ~= "lv" then
|
if ltier ~= "lv" then
|
||||||
form_buttons = fs_helpers.cycling_button(
|
form_buttons = fs_helpers.cycling_button(
|
||||||
meta,
|
meta,
|
||||||
"image_button[0,4.3;1,0.6",
|
pipeworks.button_base,
|
||||||
"splitstacks",
|
"splitstacks",
|
||||||
{
|
{
|
||||||
{text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
|
pipeworks.button_off,
|
||||||
{text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
|
pipeworks.button_on
|
||||||
}
|
}
|
||||||
).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
|
)..pipeworks.button_label
|
||||||
end
|
end
|
||||||
meta:set_string("formspec",
|
meta:set_string("formspec",
|
||||||
"size[8, 9]"..
|
"size[8, 9]"..
|
||||||
@ -135,13 +135,13 @@ function technic.register_generator(data)
|
|||||||
if not string.find(node.name, ":lv_") then
|
if not string.find(node.name, ":lv_") then
|
||||||
form_buttons = fs_helpers.cycling_button(
|
form_buttons = fs_helpers.cycling_button(
|
||||||
meta,
|
meta,
|
||||||
"image_button[0,4.3;1,0.6",
|
pipeworks.button_base,
|
||||||
"splitstacks",
|
"splitstacks",
|
||||||
{
|
{
|
||||||
{text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
|
pipeworks.button_off,
|
||||||
{text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
|
pipeworks.button_on
|
||||||
}
|
}
|
||||||
).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
|
)..pipeworks.button_label
|
||||||
end
|
end
|
||||||
meta:set_string("formspec", generator_formspec..form_buttons)
|
meta:set_string("formspec", generator_formspec..form_buttons)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
@ -164,13 +164,13 @@ function technic.register_generator(data)
|
|||||||
if not string.find(node.name, ":lv_") then
|
if not string.find(node.name, ":lv_") then
|
||||||
form_buttons = fs_helpers.cycling_button(
|
form_buttons = fs_helpers.cycling_button(
|
||||||
meta,
|
meta,
|
||||||
"image_button[0,4.3;1,0.6",
|
pipeworks.button_base,
|
||||||
"splitstacks",
|
"splitstacks",
|
||||||
{
|
{
|
||||||
{text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
|
pipeworks.button_off,
|
||||||
{text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
|
pipeworks.button_on
|
||||||
}
|
}
|
||||||
).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
|
)..pipeworks.button_label
|
||||||
end
|
end
|
||||||
meta:set_string("formspec", generator_formspec..form_buttons)
|
meta:set_string("formspec", generator_formspec..form_buttons)
|
||||||
end,
|
end,
|
||||||
@ -229,13 +229,13 @@ function technic.register_generator(data)
|
|||||||
if not string.find(node.name, ":lv_") then
|
if not string.find(node.name, ":lv_") then
|
||||||
form_buttons = fs_helpers.cycling_button(
|
form_buttons = fs_helpers.cycling_button(
|
||||||
meta,
|
meta,
|
||||||
"image_button[0,4.3;1,0.6",
|
pipeworks.button_base,
|
||||||
"splitstacks",
|
"splitstacks",
|
||||||
{
|
{
|
||||||
{text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
|
pipeworks.button_off,
|
||||||
{text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
|
pipeworks.button_on
|
||||||
}
|
}
|
||||||
).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
|
)..pipeworks.button_label
|
||||||
end
|
end
|
||||||
meta:set_string("formspec",
|
meta:set_string("formspec",
|
||||||
"size[8, 9]"..
|
"size[8, 9]"..
|
||||||
@ -258,13 +258,13 @@ function technic.register_generator(data)
|
|||||||
if not string.find(node.name, ":lv_") then
|
if not string.find(node.name, ":lv_") then
|
||||||
form_buttons = fs_helpers.cycling_button(
|
form_buttons = fs_helpers.cycling_button(
|
||||||
meta,
|
meta,
|
||||||
"image_button[0,4.3;1,0.6",
|
pipeworks.button_base,
|
||||||
"splitstacks",
|
"splitstacks",
|
||||||
{
|
{
|
||||||
{text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
|
pipeworks.button_off,
|
||||||
{text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
|
pipeworks.button_on
|
||||||
}
|
}
|
||||||
).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
|
)..pipeworks.button_label
|
||||||
end
|
end
|
||||||
|
|
||||||
local burn_totaltime = meta:get_int("burn_totaltime") or 0
|
local burn_totaltime = meta:get_int("burn_totaltime") or 0
|
||||||
|
@ -168,13 +168,13 @@ function technic.register_base_machine(data)
|
|||||||
if not string.find(node.name, ":lv_") then
|
if not string.find(node.name, ":lv_") then
|
||||||
form_buttons = fs_helpers.cycling_button(
|
form_buttons = fs_helpers.cycling_button(
|
||||||
meta,
|
meta,
|
||||||
"image_button[0,4.3;1,0.6",
|
pipeworks.button_base,
|
||||||
"splitstacks",
|
"splitstacks",
|
||||||
{
|
{
|
||||||
{text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
|
pipeworks.button_off,
|
||||||
{text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
|
pipeworks.button_on
|
||||||
}
|
}
|
||||||
).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
|
)..pipeworks.button_label
|
||||||
end
|
end
|
||||||
|
|
||||||
meta:set_string("infotext", machine_desc:format(tier))
|
meta:set_string("infotext", machine_desc:format(tier))
|
||||||
@ -202,13 +202,13 @@ function technic.register_base_machine(data)
|
|||||||
if not string.find(node.name, ":lv_") then
|
if not string.find(node.name, ":lv_") then
|
||||||
form_buttons = fs_helpers.cycling_button(
|
form_buttons = fs_helpers.cycling_button(
|
||||||
meta,
|
meta,
|
||||||
"image_button[0,4.3;1,0.6",
|
pipeworks.button_base,
|
||||||
"splitstacks",
|
"splitstacks",
|
||||||
{
|
{
|
||||||
{text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
|
pipeworks.button_off,
|
||||||
{text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
|
pipeworks.button_on
|
||||||
}
|
}
|
||||||
).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
|
)..pipeworks.button_label
|
||||||
end
|
end
|
||||||
meta:set_string("formspec", formspec..form_buttons)
|
meta:set_string("formspec", formspec..form_buttons)
|
||||||
end,
|
end,
|
||||||
@ -246,13 +246,13 @@ function technic.register_base_machine(data)
|
|||||||
if not string.find(node.name, ":lv_") then
|
if not string.find(node.name, ":lv_") then
|
||||||
form_buttons = fs_helpers.cycling_button(
|
form_buttons = fs_helpers.cycling_button(
|
||||||
meta,
|
meta,
|
||||||
"image_button[0,4.3;1,0.6",
|
pipeworks.button_base,
|
||||||
"splitstacks",
|
"splitstacks",
|
||||||
{
|
{
|
||||||
{text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
|
pipeworks.button_off,
|
||||||
{text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
|
pipeworks.button_on
|
||||||
}
|
}
|
||||||
).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
|
)..pipeworks.button_label
|
||||||
end
|
end
|
||||||
meta:set_string("formspec", formspec..form_buttons)
|
meta:set_string("formspec", formspec..form_buttons)
|
||||||
end,
|
end,
|
||||||
|
@ -90,8 +90,8 @@ local function set_formspec(pos, data, page)
|
|||||||
"image_button[0,0.35;1,0.6",
|
"image_button[0,0.35;1,0.6",
|
||||||
"splitstacks",
|
"splitstacks",
|
||||||
{
|
{
|
||||||
{text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
|
pipeworks.button_off,
|
||||||
{text="", texture="pipeworks_button_on.png", addopts="false;false;pipeworks_button_interm.png"}
|
pipeworks.button_off
|
||||||
}
|
}
|
||||||
)..allow_label
|
)..allow_label
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user