diff --git a/basic_machines/distributor.lua b/basic_machines/distributor.lua index c6b4707..578fc43 100644 --- a/basic_machines/distributor.lua +++ b/basic_machines/distributor.lua @@ -99,17 +99,17 @@ local function get_filter_settings(pos) return FilterCache[hash].ItemFilter, FilterCache[hash].OpenPorts end -local function blocking_checkbox(pos, filter) +local function blocking_checkbox(pos, filter, is_hp) local cnt = 0 local _, open_ports = get_filter_settings(pos) - + local fs_pos = is_hp and "0.25,5" or "3,3.9" for _,val in ipairs(filter) do if val then cnt = cnt + 1 end end if cnt > 1 and #open_ports > 0 then local blocking = M(pos):get_int("blocking") == 1 and "true" or "false" - return "checkbox[3,3.9;blocking;"..S("blocking mode")..";"..blocking.."]".. - "tooltip[3,3.9;1,1;"..S("Block configured items for open ports")..";#0C3D32;#FFFFFF]" + return "checkbox["..fs_pos..";blocking;"..S("blocking mode")..";"..blocking.."]".. + "tooltip["..fs_pos..";1,1;"..S("Block configured items for open ports")..";#0C3D32;#FFFFFF]" else M(pos):set_int("blocking", 0) -- disable blocking end @@ -118,32 +118,57 @@ end local function formspec(self, pos, nvm) local filter = minetest.deserialize(M(pos):get_string("filter")) or {false,false,false,false} - local blocking = blocking_checkbox(pos, filter) - return "size[10.5,8.5]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;src;0,0;2,4;]".. - blocking.. - "image[2,1.5;1,1;techage_form_arrow.png]".. - "image_button[0,4.8;1,1;"..self:get_state_button_image(nvm)..";state_button;]".. - "tooltip[0,4.8;1,1;"..self:get_state_tooltip(nvm).."]".. - "checkbox[3,0;filter1;On;"..dump(filter[1]).."]".. - "checkbox[3,1;filter2;On;"..dump(filter[2]).."]".. - "checkbox[3,2;filter3;On;"..dump(filter[3]).."]".. - "checkbox[3,3;filter4;On;"..dump(filter[4]).."]".. - "image[4,0;0.3,1;techage_inv_red.png]".. - "image[4,1;0.3,1;techage_inv_green.png]".. - "image[4,2;0.3,1;techage_inv_blue.png]".. - "image[4,3;0.3,1;techage_inv_yellow.png]".. - "list[context;red;4.5,0;6,1;]".. - "list[context;green;4.5,1;6,1;]".. - "list[context;blue;4.5,2;6,1;]".. - "list[context;yellow;4.5,3;6,1;]".. - "list[current_player;main;1.25,4.8;8,4;]".. - "listring[context;src]".. - "listring[current_player;main]".. - default.get_hotbar_bg(1.25,4.8) + local is_hp = nvm.high_performance == true + local blocking = blocking_checkbox(pos, filter, is_hp) + + if is_hp then + return "size[10.5,9.5]".. + "box[0.25,-0.1;9.6,1.1;#005500]".. + "label[0.6,0.2;"..S("Input").."]".. + "list[context;src;1.75,0;8,1;]".. + blocking.. + "image_button[0.25,5.8;1,1;"..self:get_state_button_image(nvm)..";state_button;]".. + "tooltip[0.25,5.8;1,1;"..self:get_state_tooltip(nvm).."]".. + "checkbox[0.25,1.2;filter1;On;"..dump(filter[1]).."]".. + "checkbox[0.25,2.2;filter2;On;"..dump(filter[2]).."]".. + "checkbox[0.25,3.2;filter3;On;"..dump(filter[3]).."]".. + "checkbox[0.25,4.2;filter4;On;"..dump(filter[4]).."]".. + "image[1.25,1.2;0.3,1;techage_inv_red.png]".. + "image[1.25,2.2;0.3,1;techage_inv_green.png]".. + "image[1.25,3.2;0.3,1;techage_inv_blue.png]".. + "image[1.25,4.2;0.3,1;techage_inv_yellow.png]".. + "list[context;red;1.75,1.2;8,1;]".. + "list[context;green;1.75,2.2;8,1;]".. + "list[context;blue;1.75,3.2;8,1;]".. + "list[context;yellow;1.75,4.2;8,1;]".. + "list[current_player;main;1.75,5.8;8,4;]".. + "listring[context;src]".. + "listring[current_player;main]".. + default.get_hotbar_bg(1.75,5.8) + else + return "size[10.5,8.5]".. + "list[context;src;0,0;2,4;]".. + blocking.. + "image[2,1.5;1,1;techage_form_arrow.png]".. + "image_button[0,4.8;1,1;"..self:get_state_button_image(nvm)..";state_button;]".. + "tooltip[0,4.8;1,1;"..self:get_state_tooltip(nvm).."]".. + "checkbox[3,0;filter1;On;"..dump(filter[1]).."]".. + "checkbox[3,1;filter2;On;"..dump(filter[2]).."]".. + "checkbox[3,2;filter3;On;"..dump(filter[3]).."]".. + "checkbox[3,3;filter4;On;"..dump(filter[4]).."]".. + "image[4,0;0.3,1;techage_inv_red.png]".. + "image[4,1;0.3,1;techage_inv_green.png]".. + "image[4,2;0.3,1;techage_inv_blue.png]".. + "image[4,3;0.3,1;techage_inv_yellow.png]".. + "list[context;red;4.5,0;6,1;]".. + "list[context;green;4.5,1;6,1;]".. + "list[context;blue;4.5,2;6,1;]".. + "list[context;yellow;4.5,3;6,1;]".. + "list[current_player;main;1.25,4.8;8,4;]".. + "listring[context;src]".. + "listring[current_player;main]".. + default.get_hotbar_bg(1.25,4.8) + end end local function allow_metadata_inventory_put(pos, listname, index, stack, player) @@ -357,36 +382,40 @@ local function can_dig(pos, player) return inv:is_empty("src") end -local tiles = {} --- '#' will be replaced by the stage number --- '{power}' will be replaced by the power PNG -tiles.pas = { - -- up, down, right, left, back, front - "techage_filling_ta#.png^techage_appl_distri.png^techage_frame_ta#_top.png^techage_appl_color_top.png", - "techage_filling_ta#.png^techage_frame_ta#.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_yellow.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_green.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_red.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_blue.png", -} -tiles.act = { - -- up, down, right, left, back, front - { - image = "techage_filling4_ta#.png^techage_appl_distri4.png^techage_frame4_ta#_top.png^techage_appl_color_top4.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 32, - aspect_h = 32, - length = 1.0, +local get_tiles = function(is_hp) + local variant = is_hp and "_hp" or "" + local tiles = {} + -- '#' will be replaced by the stage number + -- '{power}' will be replaced by the power PNG + tiles.pas = { + -- up, down, right, left, back, front + "techage_filling_ta#.png^techage_appl_distri.png^techage_frame_ta#_top"..variant..".png^techage_appl_color_top.png", + "techage_filling_ta#.png^techage_frame_ta#_top"..variant..".png^(techage_appl_color_top.png^[transformFY)", + "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_yellow.png", + "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_green.png", + "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_red.png", + "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_blue.png", + } + tiles.act = { + -- up, down, right, left, back, front + { + image = "techage_filling4_ta#.png^techage_appl_distri4.png^techage_frame4_ta#_top"..variant..".png^techage_appl_color_top4.png", + backface_culling = false, + animation = { + type = "vertical_frames", + aspect_w = 32, + aspect_h = 32, + length = 1.0, + }, }, - }, - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_color_top.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_yellow.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_green.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_red.png", - "techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_blue.png", -} + "techage_filling_ta#.png^techage_frame_ta#_top"..variant..".png^(techage_appl_color_top.png^[transformFY)", + "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_yellow.png", + "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_green.png", + "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_red.png", + "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_blue.png", + } + return tiles +end local tubing = { on_pull_item = function(pos, in_dir, num) @@ -419,57 +448,87 @@ local tubing = { end, } -local node_name_ta2, node_name_ta3, node_name_ta4 = - techage.register_consumer("distributor", S("Distributor"), tiles, { - cycle_time = CYCLE_TIME, - standby_ticks = STANDBY_TICKS, - formspec = formspec, - tubing = tubing, - after_place_node = function(pos, placer) - local meta = M(pos) - local filter = {false,false,false,false} - meta:set_string("filter", minetest.serialize(filter)) - local inv = meta:get_inventory() - inv:set_size('src', 8) - inv:set_size('yellow', 6) - inv:set_size('green', 6) - inv:set_size('red', 6) - inv:set_size('blue', 6) - end, - can_dig = can_dig, - node_timer = keep_running, - on_receive_fields = on_receive_fields, - allow_metadata_inventory_put = allow_metadata_inventory_put, - allow_metadata_inventory_move = allow_metadata_inventory_move, - allow_metadata_inventory_take = allow_metadata_inventory_take, - tubelib2_on_update2 = tubelib2_on_update2, - - on_metadata_inventory_move = function(pos, from_list, from_index, to_list) - if from_list ~= "src" or to_list ~= "src" then - filter_settings(pos) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - end - end, - on_metadata_inventory_put = function(pos, listname) - if listname ~= "src" then - filter_settings(pos) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - end - end, - on_metadata_inventory_take = function(pos, listname) - if listname ~= "src" then - filter_settings(pos) - local nvm = techage.get_nvm(pos) - M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) - end - end, - - groups = {choppy=2, cracky=2, crumbly=2}, - sounds = default.node_sound_wood_defaults(), - num_items = {0,4,12,24}, - }) +local def = { + cycle_time = CYCLE_TIME, + standby_ticks = STANDBY_TICKS, + formspec = formspec, + tubing = tubing, + after_place_node = function(pos, placer) + local meta = M(pos) + local filter = {false,false,false,false} + meta:set_string("filter", minetest.serialize(filter)) + local inv = meta:get_inventory() + inv:set_size('src', 8) + inv:set_size('yellow', 6) + inv:set_size('green', 6) + inv:set_size('red', 6) + inv:set_size('blue', 6) + end, + can_dig = can_dig, + node_timer = keep_running, + on_receive_fields = on_receive_fields, + allow_metadata_inventory_put = allow_metadata_inventory_put, + allow_metadata_inventory_move = allow_metadata_inventory_move, + allow_metadata_inventory_take = allow_metadata_inventory_take, + tubelib2_on_update2 = tubelib2_on_update2, + + on_metadata_inventory_move = function(pos, from_list, from_index, to_list) + if from_list ~= "src" or to_list ~= "src" then + filter_settings(pos) + local nvm = techage.get_nvm(pos) + M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) + end + end, + on_metadata_inventory_put = function(pos, listname) + if listname ~= "src" then + filter_settings(pos) + local nvm = techage.get_nvm(pos) + M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) + end + end, + on_metadata_inventory_take = function(pos, listname) + if listname ~= "src" then + filter_settings(pos) + local nvm = techage.get_nvm(pos) + M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) + end + end, + + groups = {choppy=2, cracky=2, crumbly=2}, + sounds = default.node_sound_wood_defaults(), + num_items = {0,4,12,24}, +} + +local node_name_ta2, node_name_ta3, node_name_ta4 = techage.register_consumer( + "distributor", + S("Distributor"), + get_tiles(false), + def +) + +local hp_def = table.copy(def) + +hp_def.after_place_node = function(pos, placer) + local meta = M(pos) + local nvm = techage.get_nvm(pos) + nvm.high_performance = true + local filter = {false,false,false,false} + meta:set_string("filter", minetest.serialize(filter)) + local inv = meta:get_inventory() + inv:set_size('src', 8) + inv:set_size('yellow', 8) + inv:set_size('green', 8) + inv:set_size('red', 8) + inv:set_size('blue', 8) +end +hp_def.num_items = {0,0,0,36} + +local _, _, node_name_ta4_hp = techage.register_consumer( + "high_performance_distributor", S("High Performance Distributor"), + get_tiles(true), + hp_def, + {false, false, false, true} +) minetest.register_craft({ output = node_name_ta2.." 2", @@ -497,3 +556,12 @@ minetest.register_craft({ {"", "techage:ta4_wlanchip", ""}, }, }) + + +minetest.register_craft({ + output = node_name_ta4_hp, + recipe = { + {node_name_ta4, "default:copper_ingot"}, + {"default:mese_crystal_fragment", node_name_ta4}, + }, +}) diff --git a/doc/items.lua b/doc/items.lua index 034fd1c..b7b91d1 100644 --- a/doc/items.lua +++ b/doc/items.lua @@ -161,6 +161,7 @@ techage.Items = { ta4_collector = "techage:ta4_collector", ta4_pusher = "techage:ta4_pusher_pas", ta4_distributor = "techage:ta4_distributor_pas", + ta4_high_performance_distributor = "techage:ta4_high_performance_distributor_pas", ta4_gravelsieve = "techage:ta4_gravelsieve_pas", ta4_grinder = "techage:ta4_grinder_pas", ta4_detector = "techage:ta4_detector_off", diff --git a/doc/manual_DE.lua b/doc/manual_DE.lua index 1761303..b6caafc 100644 --- a/doc/manual_DE.lua +++ b/doc/manual_DE.lua @@ -184,6 +184,7 @@ techage.manual_DE.aTitel = { "3,TA4 Kiste / TA4 Chest", "3,TA4 8x2000 Kiste / TA4 8x2000 Chest", "3,TA4 Verteiler / Distributor", + "3,TA4 Hochleistungs-Verteiler / High Performance Distributor", "3,TA4 Kiessieb / Gravel Sieve", "3,TA4 Mühle / Grinder", "3,TA4 Steinbrecher / Quarry", @@ -1505,6 +1506,12 @@ techage.manual_DE.aText = { "\n".. "\n".. "\n", + "Die Funktion entspricht dem normalen TA4 Verteiler\\, mit zwei Unterschieden:\n".. + "Die Verarbeitungsleistung beträgt 36 Items alle 4 s\\, sofern auf allen Seiten TA4 Röhren verwendet werden. Anderenfalls sind es nur 18 Items alle 4 s.\n".. + "Außerdem können pro Ausgang bis zu 8 Items konfiguriert werden.\n".. + "\n".. + "\n".. + "\n", "Die Funktion entspricht der von TA2.\n".. "Die Verarbeitungsleistung beträgt 4 Items alle 4 s. Der Block benötigt 5 ku Strom.\n".. "\n".. @@ -1721,6 +1728,7 @@ techage.manual_DE.aItemName = { "ta4_chest", "ta4_8x2000_chest", "ta4_distributor", + "ta4_high_performance_distributor", "ta4_gravelsieve", "ta4_grinder", "ta4_quarry", @@ -1917,5 +1925,6 @@ techage.manual_DE.aPlanTable = { "", "", "", + "", } diff --git a/doc/manual_EN.lua b/doc/manual_EN.lua index 4b24d6c..0e03aaf 100644 --- a/doc/manual_EN.lua +++ b/doc/manual_EN.lua @@ -184,6 +184,7 @@ techage.manual_EN.aTitel = { "3,TA4 Chest", "3,TA4 8x2000 Chest", "3,TA4 Distributor", + "3,TA4 High Performance Distributor", "3,TA4 Gravel Sieve", "3,TA4 Grinder", "3,TA4 Quarry", @@ -1496,6 +1497,12 @@ techage.manual_EN.aText = { "\n".. "\n".. "\n", + "The function corresponds to that of the normal TA4 distributor\\, with two differences:\n".. + "The processing power is 36 items every 4 s\\, provided TA4 tubes are used on all sides. Otherwise there are only 18 items every 4 s.\n".. + "Furthermore\\, up to 8 items can be configured per direction.\n".. + "\n".. + "\n".. + "\n", "The function corresponds to that of TA2.\n".. "The processing power is 4 items every 4 s. The block requires 5 ku of electricity.\n".. "\n".. @@ -1712,6 +1719,7 @@ techage.manual_EN.aItemName = { "ta4_chest", "ta4_8x2000_chest", "ta4_distributor", + "ta4_high_performance_distributor", "ta4_gravelsieve", "ta4_grinder", "ta4_quarry", @@ -1908,5 +1916,6 @@ techage.manual_EN.aPlanTable = { "", "", "", + "", } diff --git a/locale/techage.de.tr b/locale/techage.de.tr index 6d139ab..fd5419f 100644 --- a/locale/techage.de.tr +++ b/locale/techage.de.tr @@ -85,11 +85,13 @@ Grinder=Mühle Grinding=Mahlen Heat=Hitze Heat Exchanger=Wärmetauscher +High Performance Distributor=Hochleistungs-Verteiler Hole size=Lochgröße Hydrogen Cylinder Large=Wasserstoffflasche groß Hydrogen Cylinder Small=Wasserstoffflasche klein In use:=In Benutzung: Injector=Injektor +Input=Einspeisung Insert destination node number(s)=Gebe Zielnummer(n) ein Insert door/gate block number(s)=Gebe Tür-/Tornummer(n) ein Intake=Stromaufnahme @@ -455,5 +457,4 @@ storage empty?=Speicher leer? water temperature=Wassertemperatur wrong catalyst=falscher Katalysator wrong storage diameter=Falscher Wärmespeicher-Durchmesser -##### not used anymore ##### - +##### not used anymore ##### \ No newline at end of file diff --git a/locale/template.txt b/locale/template.txt index 31ccf96..024cbf0 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -83,11 +83,13 @@ Grinder= Grinding= Heat= Heat Exchanger= +High Performance Distributor= Hole size= Hydrogen Cylinder Large= Hydrogen Cylinder Small= In use:= Injector= +Input= Insert destination node number(s)= Insert door/gate block number(s)= Intake= diff --git a/manuals/manual_ta4_DE.md b/manuals/manual_ta4_DE.md index 2afd3da..e9360e8 100644 --- a/manuals/manual_ta4_DE.md +++ b/manuals/manual_ta4_DE.md @@ -610,6 +610,14 @@ Die Verarbeitungsleistung beträgt 24 Items alle 4 s, sofern auf allen Seiten TA [ta4_distributor|image] +### TA4 Hochleistungs-Verteiler / High Performance Distributor + +Die Funktion entspricht dem normalen TA4 Verteiler, mit zwei Unterschieden: +Die Verarbeitungsleistung beträgt 36 Items alle 4 s, sofern auf allen Seiten TA4 Röhren verwendet werden. Anderenfalls sind es nur 18 Items alle 4 s. +Außerdem können pro Ausgang bis zu 8 Items konfiguriert werden. + +[ta4_high_performance_distributor|image] + ### TA4 Kiessieb / Gravel Sieve Die Funktion entspricht der von TA2. diff --git a/manuals/manual_ta4_EN.md b/manuals/manual_ta4_EN.md index 8ae2363..595f71c 100644 --- a/manuals/manual_ta4_EN.md +++ b/manuals/manual_ta4_EN.md @@ -611,6 +611,14 @@ The processing power is 24 items every 4 s, provided TA4 tubes are used on all s [ta4_distributor|image] +### TA4 High Performance Distributor + +The function corresponds to that of the normal TA4 distributor, with two differences: +The processing power is 36 items every 4 s, provided TA4 tubes are used on all sides. Otherwise there are only 18 items every 4 s. +Furthermore, up to 8 items can be configured per direction. + +[ta4_high_performance_distributor|image] + ### TA4 Gravel Sieve The function corresponds to that of TA2. diff --git a/manuals/toc_DE.md b/manuals/toc_DE.md index 8e26dda..c018a99 100644 --- a/manuals/toc_DE.md +++ b/manuals/toc_DE.md @@ -183,6 +183,7 @@ - [TA4 Kiste / TA4 Chest](./manual_ta4_DE.md#ta4-kiste--ta4-chest) - [TA4 8x2000 Kiste / TA4 8x2000 Chest](./manual_ta4_DE.md#ta4-8x2000-kiste--ta4-8x2000-chest) - [TA4 Verteiler / Distributor](./manual_ta4_DE.md#ta4-verteiler--distributor) + - [TA4 Hochleistungs-Verteiler / High Performance Distributor](./manual_ta4_DE.md#ta4-hochleistungs-verteiler--high-performance-distributor) - [TA4 Kiessieb / Gravel Sieve](./manual_ta4_DE.md#ta4-kiessieb--gravel-sieve) - [TA4 Mühle / Grinder](./manual_ta4_DE.md#ta4-mühle--grinder) - [TA4 Steinbrecher / Quarry](./manual_ta4_DE.md#ta4-steinbrecher--quarry) diff --git a/manuals/toc_EN.md b/manuals/toc_EN.md index f5d2dda..f22bfad 100644 --- a/manuals/toc_EN.md +++ b/manuals/toc_EN.md @@ -183,6 +183,7 @@ - [TA4 Chest](./manual_ta4_EN.md#ta4-chest) - [TA4 8x2000 Chest](./manual_ta4_EN.md#ta4-8x2000-chest) - [TA4 Distributor](./manual_ta4_EN.md#ta4-distributor) + - [TA4 High Performance Distributor](./manual_ta4_EN.md#ta4-high-performance-distributor) - [TA4 Gravel Sieve](./manual_ta4_EN.md#ta4-gravel-sieve) - [TA4 Grinder](./manual_ta4_EN.md#ta4-grinder) - [TA4 Quarry](./manual_ta4_EN.md#ta4-quarry) diff --git a/textures/techage_frame14_ta4_hp.png b/textures/techage_frame14_ta4_hp.png new file mode 100644 index 0000000..a7d048d Binary files /dev/null and b/textures/techage_frame14_ta4_hp.png differ diff --git a/textures/techage_frame4_ta4_hp.png b/textures/techage_frame4_ta4_hp.png new file mode 100644 index 0000000..5c25bc7 Binary files /dev/null and b/textures/techage_frame4_ta4_hp.png differ diff --git a/textures/techage_frame4_ta4_top_hp.png b/textures/techage_frame4_ta4_top_hp.png new file mode 100644 index 0000000..29d2447 Binary files /dev/null and b/textures/techage_frame4_ta4_top_hp.png differ diff --git a/textures/techage_frame8_ta4_hp.png b/textures/techage_frame8_ta4_hp.png new file mode 100644 index 0000000..2c6886a Binary files /dev/null and b/textures/techage_frame8_ta4_hp.png differ diff --git a/textures/techage_frame_ta4_hp.png b/textures/techage_frame_ta4_hp.png new file mode 100644 index 0000000..26c0410 Binary files /dev/null and b/textures/techage_frame_ta4_hp.png differ diff --git a/textures/techage_frame_ta4_top_hp.png b/textures/techage_frame_ta4_top_hp.png new file mode 100644 index 0000000..ed29393 Binary files /dev/null and b/textures/techage_frame_ta4_top_hp.png differ