Skip to content

Commit f636ead

Browse files
authored
1.6.2
- read artillery turret and artillery wagon inventories
1 parent 2f6884b commit f636ead

File tree

4 files changed

+41
-35
lines changed

4 files changed

+41
-35
lines changed

changelog.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
1.6.2
2+
- read artillery turret and artillery wagon inventories
3+
14
1.6.1
25
- updated graphics to match current constant combinator
36
- added hr graphics

control.lua

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ local FURNACE = "furnace"
66
local REACTOR = "reactor"
77
local ROBOPORT = "roboport"
88
local SILO = "rocket-silo"
9+
local ARTILLERY = "artillery-turret"
910
local CHEST = "logistic-container" -- requester: type = "logistic-container" && logistic_mode = "requester"
1011
local LOCO = "locomotive"
1112
local WAGON = "cargo-wagon"
1213
local WAGONFLUID = "fluid-wagon"
14+
local WAGONARTILLERY = "artillery-wagon"
1315
local CAR = "car"
1416
local TANK = "tank"
1517

@@ -20,11 +22,13 @@ local SupportedTypes = {
2022
[REACTOR] = true,
2123
[ROBOPORT] = true,
2224
[SILO] = true,
25+
[ARTILLERY] = true,
2326
[CHEST] = true,
2427
[CAR] = false,
2528
[LOCO] = false,
2629
[WAGON] = false,
27-
[WAGONFLUID] = false
30+
[WAGONFLUID] = false,
31+
[WAGONARTILLERY] = false,
2832
}
2933

3034
local floor = math.floor
@@ -256,7 +260,7 @@ function UpdateSensor(itemSensor)
256260
return
257261
end
258262

259-
elseif connectedEntity.type == WAGON or connectedEntity.type == WAGONFLUID then
263+
elseif connectedEntity.type == WAGON or connectedEntity.type == WAGONFLUID or connectedEntity.type == WAGONARTILLERY then
260264
if connectedEntity.train.state == defines.train_state.wait_station
261265
or connectedEntity.train.state == defines.train_state.wait_signal
262266
or connectedEntity.train.state == defines.train_state.manual_control then --keeps showing inventory for ScanInterval ticks after movement start > neglect able
@@ -319,7 +323,7 @@ function UpdateSensor(itemSensor)
319323
-- log("temp: "..tostring(temp))
320324
signals[signalIndex] = {index = signalIndex, signal = {type = "virtual",name = "inv-sensor-temperature"},count = floor(temp+0.5)}
321325
signalIndex = signalIndex+1
322-
end
326+
end
323327
end
324328

325329
-- get all fluids

info.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "Inventory Sensor",
3-
"version": "1.6.1",
3+
"version": "1.6.2",
44
"title": "Inventory Sensor",
55
"author": "Optera",
66
"contact": "https://forums.factorio.com/memberlist.php?mode=viewprofile&u=21729",
77
"homepage": "https://forums.factorio.com/viewtopic.php?f=97&t=30454",
88
"description": "Adds a combinator that reads inventories of locomotives, wagons, cars, furnaces, assemblers, roboports, rocket silos and reactors.",
99
"factorio_version": "0.16",
10-
"dependencies": ["base >= 0.16.3"]
10+
"dependencies": ["base >= 0.16.6"]
1111
}

prototypes/entity.lua

+29-30
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,45 @@ inv_sensor.name = "item-sensor"
33
inv_sensor.icon = "__Inventory Sensor__/graphics/icons/inventory-sensor.png"
44
inv_sensor.icon_size = 32
55
inv_sensor.minable.result = "item-sensor"
6-
7-
inv_sensor.sprites =
8-
make_4way_animation_from_spritesheet({ layers =
6+
inv_sensor.sprites = make_4way_animation_from_spritesheet(
7+
{ layers =
8+
{
99
{
10+
filename = "__Inventory Sensor__/graphics/entity/inventory-sensor.png",
11+
width = 58,
12+
height = 52,
13+
frame_count = 1,
14+
shift = util.by_pixel(0, 5),
15+
hr_version =
1016
{
11-
filename = "__Inventory Sensor__/graphics/entity/inventory-sensor.png",
12-
width = 58,
13-
height = 52,
17+
scale = 0.5,
18+
filename = "__Inventory Sensor__/graphics/entity/hr-inventory-sensor.png",
19+
width = 114,
20+
height = 102,
1421
frame_count = 1,
1522
shift = util.by_pixel(0, 5),
16-
hr_version =
17-
{
18-
scale = 0.5,
19-
filename = "__Inventory Sensor__/graphics/entity/hr-inventory-sensor.png",
20-
width = 114,
21-
height = 102,
22-
frame_count = 1,
23-
shift = util.by_pixel(0, 5),
24-
},
2523
},
24+
},
25+
{
26+
filename = "__base__/graphics/entity/combinator/constant-combinator-shadow.png",
27+
width = 50,
28+
height = 34,
29+
frame_count = 1,
30+
shift = util.by_pixel(9, 6),
31+
draw_as_shadow = true,
32+
hr_version =
2633
{
27-
filename = "__base__/graphics/entity/combinator/constant-combinator-shadow.png",
28-
width = 50,
29-
height = 34,
34+
scale = 0.5,
35+
filename = "__base__/graphics/entity/combinator/hr-constant-combinator-shadow.png",
36+
width = 98,
37+
height = 66,
3038
frame_count = 1,
31-
shift = util.by_pixel(9, 6),
39+
shift = util.by_pixel(8.5, 5.5),
3240
draw_as_shadow = true,
33-
hr_version =
34-
{
35-
scale = 0.5,
36-
filename = "__base__/graphics/entity/combinator/hr-constant-combinator-shadow.png",
37-
width = 98,
38-
height = 66,
39-
frame_count = 1,
40-
shift = util.by_pixel(8.5, 5.5),
41-
draw_as_shadow = true,
42-
},
4341
},
4442
},
45-
})
43+
},
44+
})
4645

4746
inv_sensor.item_slot_count = 1000
4847

0 commit comments

Comments
 (0)