Skip to content

Commit

Permalink
fa-info: fix toggling personal logistics by reverting the toggle to t…
Browse files Browse the repository at this point in the history
…he vanilla keystroke, and reporting on what it did with the new logistics API
  • Loading branch information
ahicks92 committed Nov 26, 2024
1 parent 83d1835 commit 9aa5b1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
17 changes: 8 additions & 9 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
7 changes: 0 additions & 7 deletions data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9aa5b1f

Please sign in to comment.