Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
pindab0ter committed Nov 29, 2024
2 parents 7040d40 + 0e22e0d commit f8ebdcc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
9 changes: 7 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
---------------------------------------------------------------------------------------------------
Version: 0.2.6
Date: 2024-11-29
Bugfixes:
- Fixed displays not rendering when there is only a little bit of power available
---------------------------------------------------------------------------------------------------
Version: 0.2.5
Date: 2024-11-24
Date: 2024-11-28
Bugfixes:
- Fixed Nixie Tubes not updating correctly when placed to the left or in the middle of a row
---------------------------------------------------------------------------------------------------
Version: 0.2.4
Date: 2024-11-24
Date: 2024-11-28
Bugfixes:
- Fixed a crash when there were no observable Nixie Tubes, e.g. when all connected players are in map view
---------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "UPSFriendlyNixieTubeDisplay",
"version": "0.2.5",
"version": "0.2.6",
"factorio_version": "2.0",
"title": "UPS Friendly Nixie Tubes",
"author": "Red_Wizard, pindab0ter",
Expand Down
22 changes: 18 additions & 4 deletions scripts/nixie_tube.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ local state_display = {
["9"] = "XOR",
}

----------------------
-- Nixie Tube logic --
----------------------

------------------------
-- Nixie Tube updates --
------------------------


--- Set the digit(s) and update the sprite for a nixie tube
--- @param display NixieTubeDisplay
Expand Down Expand Up @@ -190,7 +192,7 @@ local function update_controller(controller)
controller.previous_value = nil
end

local has_enough_energy = display.entity.energy >= 50 or script.level.is_simulation
local has_enough_energy = display.entity.energy > 0

if not selected_signal or not has_enough_energy then
display_characters(display, "off")
Expand All @@ -212,6 +214,12 @@ local function update_controller(controller)
display_characters(display, ("%i"):format(signal_value))
end


------------------------------
-- Nixie Tube configuration --
------------------------------


--- Invalidate the remaining characters cache, causing the value(s) to be redrawn
--- @param display NixieTubeDisplay
--- @param direction "east"|"west"
Expand Down Expand Up @@ -340,10 +348,12 @@ local function reconfigure_nixie_tubes()
end
end


--------------
-- Commands --
--------------


commands.add_command(
"reconfigure-nixie-tubes",
"Reconfigure all Nixie Tubes",
Expand All @@ -353,18 +363,22 @@ commands.add_command(
end
)


-------------
-- Filters --
-------------


local filters = {}
filters[#filters + 1] = { filter = "name", name = "nixie_tube" }
filters[#filters + 1] = { filter = "ghost_name", name = "nixie_tube" }


--------------------
-- Event handlers --
--------------------


--- @param _ EventData.on_tick
local function on_tick(_)
storage.invalidated_this_tick = {}
Expand Down

0 comments on commit f8ebdcc

Please sign in to comment.