Skip to content

Commit 0cddf2d

Browse files
authored
1.4.9
- better icon for progress - better icon for temperature - fixed progress rounding to 101%
1 parent 1b0ea9b commit 0cddf2d

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

changelog.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
1.4.9
2+
- better icon for progress
3+
- better icon for temperature
4+
- fixed progress rounding to 101%
5+
16
1.4.8
27
- fixed missing localization keys
38

@@ -18,7 +23,7 @@
1823
1.4.3
1924
- read assembler/furnace progress in %
2025
- read rocket silo inventory and rocket parts as progress
21-
- checking all 8 possible inventories every entity when connecting. Nuclear fueled locomotives properly show burnt results.
26+
- checking all 8 possible inventories every entity when connecting. Nuclear fuelled locomotives properly show burnt results.
2227

2328
1.4.2
2429
- read Reactor temperature (requires 0.15.7+)

control.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ local SupportedTypes = {
2828
[WAGONFLUID] = false
2929
}
3030

31+
local floor = math.floor
3132
local ceil = math.ceil
3233

3334
---- Events ----
@@ -242,7 +243,7 @@ function updateSensor(itemSensor)
242243
if connectedEntity.type == ASSEMBLER or connectedEntity.type == FURNACE then
243244
local progress = connectedEntity.crafting_progress
244245
if progress then
245-
signals[signalIndex] = {index = signalIndex, signal = {type = "virtual",name = "inv-sensor-progress"},count = ceil(progress*100)}
246+
signals[signalIndex] = {index = signalIndex, signal = {type = "virtual",name = "inv-sensor-progress"},count = floor(progress*100)}
246247
signalIndex = signalIndex+1
247248
end
248249
end
@@ -268,7 +269,8 @@ function updateSensor(itemSensor)
268269
if connectedEntity.type == REACTOR then
269270
local temp = connectedEntity.temperature
270271
if temp then
271-
signals[signalIndex] = {index = signalIndex, signal = {type = "virtual",name = "inv-sensor-temperature"},count = ceil(temp-0.4)}
272+
log("temp: "..tostring(temp))
273+
signals[signalIndex] = {index = signalIndex, signal = {type = "virtual",name = "inv-sensor-temperature"},count = floor(temp+0.5)}
272274
signalIndex = signalIndex+1
273275
end
274276
end

graphics/icons/progress.png

1.36 KB
Loading

graphics/icons/temperature.png

-343 Bytes
Loading

info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Inventory Sensor",
3-
"version": "1.4.8",
3+
"version": "1.4.9",
44
"title": "Inventory Sensor",
55
"author": "Optera",
66
"contact": "https://forums.factorio.com/memberlist.php?mode=viewprofile&u=21729",

0 commit comments

Comments
 (0)