From 9aa5b1fb3b1d90d7dc2e537b58a74d3b57d248f3 Mon Sep 17 00:00:00 2001 From: Austin Hicks Date: Mon, 25 Nov 2024 18:25:31 -0800 Subject: [PATCH] fa-info: fix toggling personal logistics by reverting the toggle to the vanilla keystroke, and reporting on what it did with the new logistics API --- control.lua | 17 ++++++++--------- data.lua | 7 ------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/control.lua b/control.lua index 9aa42e95..3179bcfe 100644 --- a/control.lua +++ b/control.lua @@ -7675,7 +7675,7 @@ script.on_event("logistic-request-decrement-max", function(event) local pindex = event.player_index if not check_for_player(pindex) then return end if game.get_player(pindex).character == nil then return end - fa_bot_logistics.logistics_request_decrement_max_handler(pindex) + fa_bot_logistics.logistics_request_decrem_max_handler(pindex) end) script.on_event("logistic-request-clear", function(event) @@ -7688,20 +7688,19 @@ end) script.on_event("vanilla-toggle-personal-logistics-info", function(event) local pindex = event.player_index local p = game.get_player(pindex) - if p.character_personal_logistic_requests_enabled then + local c = p.character + if not c then return end + + local p = c.get_logistic_point(defines.logistic_member_index.character_requester) + if not p then return end + + if p.enabled then printout("Resumed personal logistics requests", pindex) else printout("Paused personal logistics requests", pindex) end end) -script.on_event("logistic-request-toggle-personal-logistics", function(event) - local pindex = event.player_index - if not check_for_player(pindex) then return end - if game.get_player(pindex).character == nil then return end - fa_bot_logistics.logistics_request_toggle_handler(pindex) -end) - script.on_event("send-selected-stack-to-logistic-trash", function(event) local pindex = event.player_index if not check_for_player(pindex) then return end diff --git a/data.lua b/data.lua index 02784d85..bd68fd9c 100644 --- a/data.lua +++ b/data.lua @@ -1976,13 +1976,6 @@ data:extend({ consuming = "none", }, - { - type = "custom-input", - name = "logistic-request-toggle-personal-logistics", - key_sequence = "CONTROL + SHIFT + L", - consuming = "none", - }, - { type = "custom-input", name = "send-selected-stack-to-logistic-trash",