From 516bdcabc4d97e09ecaad0122a0305c2364a7646 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Wed, 22 Jan 2025 06:05:52 +0900 Subject: [PATCH 1/3] Fix ExpUtil.extract_time_units (#362) * Update module_exports.lua * Add type annotation to prevent regression --------- Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> --- exp_util/module/module_exports.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exp_util/module/module_exports.lua b/exp_util/module/module_exports.lua index f7059c5f..3583847d 100644 --- a/exp_util/module/module_exports.lua +++ b/exp_util/module/module_exports.lua @@ -268,8 +268,9 @@ function ExpUtil.extract_time_units(ticks, units) -- Calculate the values to be determine the display values local max_days, max_hours, max_minutes, max_seconds = ticks / 5184000, ticks / 216000, ticks / 3600, ticks / 60 + --- @type Common.extract_time_units_return local rtn = { - day = floor(max_days), + days = floor(max_days), hours = floor(max_hours - floor(max_days) * 24), minutes = floor(max_minutes - floor(max_hours) * 60), seconds = floor(max_seconds - floor(max_minutes) * 60), From 9c5384f3f7f9e4cc5ef22faf5f974e039568c796 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Wed, 22 Jan 2025 06:07:45 +0900 Subject: [PATCH 2/3] Fix vlayer request logic in 2.0 (#359) * Update vlayer.lua * Update vlayer.lua --- exp_legacy/module/modules/control/vlayer.lua | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/exp_legacy/module/modules/control/vlayer.lua b/exp_legacy/module/modules/control/vlayer.lua index cff7aea8..0bdb9ba3 100644 --- a/exp_legacy/module/modules/control/vlayer.lua +++ b/exp_legacy/module/modules/control/vlayer.lua @@ -439,19 +439,20 @@ local function handle_output_interfaces() vlayer_data.entity_interfaces.storage_output[index] = nil else local inventory = interface.get_inventory(defines.inventory.chest) + local inventory_request_sections = interface.get_logistic_sections().sections - for i = 1, interface.request_slot_count do - local request = interface.get_request_slot(i) + for i = 1, #inventory_request_sections do + for _, v in pairs(inventory_request_sections[i].filters) do + if v.value and config.allowed_items[v.value.name] then + local current_amount = inventory.get_item_count(v.value.name) + local request_amount = math.min(v.min - current_amount, vlayer_data.storage.items[v.value.name]) - if request and config.allowed_items[request.name] then - local current_amount = inventory.get_item_count(request.name) - local request_amount = math.min(request.count - current_amount, vlayer_data.storage.items[request.name]) + if request_amount > 0 and inventory.can_insert{ name = v.value.name, count = request_amount } then + local removed_item_count = vlayer.remove_item(v.value.name, request_amount) - if request_amount > 0 and inventory.can_insert{ name = request.name, count = request_amount } then - local removed_item_count = vlayer.remove_item(request.name, request_amount) - - if removed_item_count > 0 then - inventory.insert{ name = request.name, count = removed_item_count } + if removed_item_count > 0 then + inventory.insert{ name = v.value.name, count = removed_item_count, quality = "normal" } + end end end end From 4ebb6275bb99452532a575b115f459aa567cc195 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Wed, 22 Jan 2025 06:08:36 +0900 Subject: [PATCH 3/3] Add follower robot count to research gui (#363) --- exp_legacy/module/config/research.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/exp_legacy/module/config/research.lua b/exp_legacy/module/config/research.lua index 07925afa..df106aa7 100644 --- a/exp_legacy/module/config/research.lua +++ b/exp_legacy/module/config/research.lua @@ -106,7 +106,9 @@ return { -- Artillery Range ["artillery-shell-range-1"] = 1, -- Artillery Speed - ["artillery-shell-speed-1"] = 1 + ["artillery-shell-speed-1"] = 1, + -- Follower Robot Count + ["follower-robot-count-5"] = 5, }, ["space-age"] = { -- Mining Productivity @@ -152,7 +154,9 @@ return { -- Rocket Fuel Productivity ["rocket-fuel-productivity"] = 1, -- Rocket Part Productivity - ["rocket-part-productivity"] = 1 + ["rocket-part-productivity"] = 1, + -- Follower Robot Count + ["follower-robot-count-5"] = 5, } }, }