Skip to content

Commit 59465fd

Browse files
author
Optera
committedJan 2, 2023
Version: 1.6.7
Date: 2023-01-02 Features: - option to adjust scan area reduction for tiles, cliffs and request proxies (modules)
1 parent 4d380e8 commit 59465fd

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed
 

‎changelog.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
---------------------------------------------------------------------------------------------------
2+
Version: 1.6.7
3+
Date: 2023-01-02
4+
Features:
5+
- option to adjust scan area reduction for tiles, cliffs and request proxies (modules)
6+
---------------------------------------------------------------------------------------------------
27
Version: 1.6.6
38
Date: 2022-10-22
49
Bugfixes:

‎control.lua

+6-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ local ShowHidden = settings.global["ghost-scanner-show-hidden"].value
4040
local InvertSign = settings.global["ghost-scanner-negative-output"].value
4141
local RoundToStack = settings.global["ghost-scanner-round2stack"].value
4242
local ShowCellCount = settings.global["ghost-scanner-cell-count"].value
43+
local AreaReduction = settings.global["ghost-scanner-area-reduction"].value
4344

4445
script.on_event(defines.events.on_runtime_mod_setting_changed, function(event)
4546
if event.setting == "ghost-scanner-update-interval" then
@@ -63,6 +64,9 @@ script.on_event(defines.events.on_runtime_mod_setting_changed, function(event)
6364
if event.setting == "ghost-scanner-cell-count" then
6465
ShowCellCount = settings.global["ghost-scanner-cell-count"].value
6566
end
67+
if event.setting == "ghost-scanner-area-reduction" then
68+
AreaReduction = settings.global["ghost-scanner-area-reduction"].value
69+
end
6670
end)
6771

6872

@@ -233,8 +237,8 @@ local function get_ghosts_as_signals(logsiticNetwork)
233237
right_bottom={ x=pos.x+r, y=pos.y+r }
234238
}
235239
local inner_bounds = { -- hack to skip checking if position is inside bounds for tiles
236-
left_top={ x=pos.x-r+0.001, y=pos.y-r+0.001, },
237-
right_bottom={ x=pos.x+r-0.001, y=pos.y+r-0.001 }
240+
left_top={ x=pos.x-r+AreaReduction, y=pos.y-r+AreaReduction },
241+
right_bottom={ x=pos.x+r-AreaReduction, y=pos.y+r-AreaReduction }
238242
}
239243
search_areas[#search_areas+1] = {
240244
bounds=bounds,

‎info.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "GhostScanner",
3-
"version": "1.6.6",
3+
"version": "1.6.7",
44
"title": "Ghost Scanner",
55
"author": "Optera",
66
"contact": "https://forums.factorio.com/memberlist.php?mode=viewprofile&u=21729",

‎locale/en/en.cfg

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ ghost-scanner-show-hidden=Show hidden items
1717
ghost-scanner-negative-output=Invert output
1818
ghost-scanner-round2stack=Round to stacks
1919
ghost-scanner-cell-count=Show cell count
20+
ghost-scanner-area-reduction=Scan area reduction
2021

2122
[mod-setting-description]
2223
ghost-scanner-update-interval=How often for new/changed ghosts is scanned.\nDefault = 120
2324
ghost-scanner-max-results=Limits ghosts found per Ghost Scanner. Modules are not counted individually.\nLower numbers greatly improve performance.\nSet to 0 to remove limit.\nDefault = 1000
2425
ghost-scanner-show-hidden=Enable to show hidden items e.g. LTN input/output.
2526
ghost-scanner-negative-output=Output as negative numbers for use as LTN requests.
2627
ghost-scanner-round2stack=Rounds item counts up (down with Invert output) to next full item stack.
27-
ghost-scanner-cell-count=Shows number of cells (Roboports) in Logistics Network.
28+
ghost-scanner-cell-count=Shows number of cells (Roboports) in Logistics Network.
29+
ghost-scanner-area-reduction=Reduces scan area by this value to filter bordering tiles, cliffs or request proxies.

‎settings.lua

+9
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,13 @@ data:extend({
4444
setting_type = "runtime-global",
4545
default_value = true,
4646
},
47+
{
48+
type = "double-setting",
49+
name = "ghost-scanner-area-reduction",
50+
order = "bd",
51+
setting_type = "runtime-global",
52+
default_value = 0.001,
53+
minimum_value = 0.0,
54+
maximum_value = 0.1,
55+
},
4756
})

0 commit comments

Comments
 (0)
Please sign in to comment.