diff --git a/changelog.txt b/changelog.txt index da89c39..d3a6d10 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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 --------------------------------------------------------------------------------------------------- diff --git a/info.json b/info.json index c91f04f..779e08b 100644 --- a/info.json +++ b/info.json @@ -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", diff --git a/scripts/nixie_tube.lua b/scripts/nixie_tube.lua index 57b7d13..6d63df9 100644 --- a/scripts/nixie_tube.lua +++ b/scripts/nixie_tube.lua @@ -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 @@ -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") @@ -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" @@ -340,10 +348,12 @@ local function reconfigure_nixie_tubes() end end + -------------- -- Commands -- -------------- + commands.add_command( "reconfigure-nixie-tubes", "Reconfigure all Nixie Tubes", @@ -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 = {}