Vanessa Ezekowitz
2017-04-12 fab2c492c4cfe8e0fbca2c62c0de45744436481f
pipeworks has button on/off, button label, and button "base" cached
used them wherever possible
5 files modified
84 ■■■■ changed files
technic/machines/other/injector.lua 8 ●●●● patch | view | raw | blame | history
technic/machines/register/battery_box.lua 8 ●●●● patch | view | raw | blame | history
technic/machines/register/generator.lua 40 ●●●● patch | view | raw | blame | history
technic/machines/register/machine_base.lua 24 ●●●● patch | view | raw | blame | history
technic_chests/register.lua 4 ●●●● patch | view | raw | blame | history
technic/machines/other/injector.lua
@@ -66,13 +66,13 @@
        "listring[]"..
        fs_helpers.cycling_button(
            meta,
            "image_button[0,4.3;1,0.6",
            pipeworks.button_base,
            "splitstacks",
            {
                {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
                {text="", texture="pipeworks_button_on.png",  addopts="false;false;pipeworks_button_interm.png"}
                pipeworks.button_off,
                pipeworks.button_on
            }
        ).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
        )..pipeworks.button_label
    )
end
technic/machines/register/battery_box.lua
@@ -79,8 +79,8 @@
                "image_button[3,2.0;1,0.6",
                "split_src_stacks",
                {
                    {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
                    {text="", texture="pipeworks_button_on.png",  addopts="false;false;pipeworks_button_interm.png"}
                    pipeworks.button_off,
                    pipeworks.button_on
                }
            ).."label[3.9,2.01;Allow splitting incoming 'charge' stacks from tubes]"..
            fs_helpers.cycling_button(
@@ -88,8 +88,8 @@
                "image_button[3,2.5;1,0.6",
                "split_dst_stacks",
                {
                    {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
                    {text="", texture="pipeworks_button_on.png",  addopts="false;false;pipeworks_button_interm.png"}
                    pipeworks.button_off,
                    pipeworks.button_on
                }
            ).."label[3.9,2.51;Allow splitting incoming 'discharge' stacks]"
    end
technic/machines/register/generator.lua
@@ -88,13 +88,13 @@
        if ltier ~= "lv" then
            form_buttons = fs_helpers.cycling_button(
                meta,
                "image_button[0,4.3;1,0.6",
                pipeworks.button_base,
                "splitstacks",
                {
                    {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
                    {text="", texture="pipeworks_button_on.png",  addopts="false;false;pipeworks_button_interm.png"}
                    pipeworks.button_off,
                    pipeworks.button_on
                }
            ).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
            )..pipeworks.button_label
        end
        meta:set_string("formspec", 
            "size[8, 9]"..
@@ -135,13 +135,13 @@
            if not string.find(node.name, ":lv_") then
                form_buttons = fs_helpers.cycling_button(
                        meta,
                        "image_button[0,4.3;1,0.6",
                        pipeworks.button_base,
                        "splitstacks",
                        {
                            {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
                            {text="", texture="pipeworks_button_on.png",  addopts="false;false;pipeworks_button_interm.png"}
                            pipeworks.button_off,
                            pipeworks.button_on
                        }
                    ).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
                    )..pipeworks.button_label
            end
            meta:set_string("formspec", generator_formspec..form_buttons)
            local inv = meta:get_inventory()
@@ -164,13 +164,13 @@
            if not string.find(node.name, ":lv_") then
                form_buttons = fs_helpers.cycling_button(
                        meta,
                        "image_button[0,4.3;1,0.6",
                        pipeworks.button_base,
                        "splitstacks",
                        {
                            {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
                            {text="", texture="pipeworks_button_on.png",  addopts="false;false;pipeworks_button_interm.png"}
                            pipeworks.button_off,
                            pipeworks.button_on
                        }
                    ).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
                    )..pipeworks.button_label
            end
            meta:set_string("formspec", generator_formspec..form_buttons)
        end,
@@ -229,13 +229,13 @@
            if not string.find(node.name, ":lv_") then
                form_buttons = fs_helpers.cycling_button(
                    meta,
                    "image_button[0,4.3;1,0.6",
                    pipeworks.button_base,
                    "splitstacks",
                    {
                        {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
                        {text="", texture="pipeworks_button_on.png",  addopts="false;false;pipeworks_button_interm.png"}
                        pipeworks.button_off,
                        pipeworks.button_on
                    }
                ).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
                )..pipeworks.button_label
            end
            meta:set_string("formspec", 
                "size[8, 9]"..
@@ -258,13 +258,13 @@
            if not string.find(node.name, ":lv_") then
                form_buttons = fs_helpers.cycling_button(
                        meta,
                        "image_button[0,4.3;1,0.6",
                        pipeworks.button_base,
                        "splitstacks",
                        {
                            {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
                            {text="", texture="pipeworks_button_on.png",  addopts="false;false;pipeworks_button_interm.png"}
                            pipeworks.button_off,
                            pipeworks.button_on
                        }
                    ).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
                    )..pipeworks.button_label
            end
            local burn_totaltime = meta:get_int("burn_totaltime") or 0
technic/machines/register/machine_base.lua
@@ -168,13 +168,13 @@
            if not string.find(node.name, ":lv_") then
                form_buttons = fs_helpers.cycling_button(
                    meta,
                    "image_button[0,4.3;1,0.6",
                    pipeworks.button_base,
                    "splitstacks",
                    {
                        {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
                        {text="", texture="pipeworks_button_on.png",  addopts="false;false;pipeworks_button_interm.png"}
                        pipeworks.button_off,
                        pipeworks.button_on
                    }
                ).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
                )..pipeworks.button_label
            end
            meta:set_string("infotext", machine_desc:format(tier))
@@ -202,13 +202,13 @@
            if not string.find(node.name, ":lv_") then
                form_buttons = fs_helpers.cycling_button(
                    meta,
                    "image_button[0,4.3;1,0.6",
                    pipeworks.button_base,
                    "splitstacks",
                    {
                        {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
                        {text="", texture="pipeworks_button_on.png",  addopts="false;false;pipeworks_button_interm.png"}
                        pipeworks.button_off,
                        pipeworks.button_on
                    }
                ).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
                )..pipeworks.button_label
            end
            meta:set_string("formspec", formspec..form_buttons)
        end,
@@ -246,13 +246,13 @@
            if not string.find(node.name, ":lv_") then
                form_buttons = fs_helpers.cycling_button(
                    meta,
                    "image_button[0,4.3;1,0.6",
                    pipeworks.button_base,
                    "splitstacks",
                    {
                        {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
                        {text="", texture="pipeworks_button_on.png",  addopts="false;false;pipeworks_button_interm.png"}
                        pipeworks.button_off,
                        pipeworks.button_on
                    }
                ).."label[0.9,4.31;Allow splitting incoming stacks from tubes]"
                )..pipeworks.button_label
            end
            meta:set_string("formspec", formspec..form_buttons)
        end,
technic_chests/register.lua
@@ -90,8 +90,8 @@
                "image_button[0,0.35;1,0.6",
                "splitstacks",
                {
                    {text="", texture="pipeworks_button_off.png", addopts="false;false;pipeworks_button_interm.png"},
                    {text="", texture="pipeworks_button_on.png",  addopts="false;false;pipeworks_button_interm.png"}
                    pipeworks.button_off,
                    pipeworks.button_off
                }
            )..allow_label