v2.3
This commit is contained in:
parent
ff0d0c0d8d
commit
29614e6d26
|
@ -1,4 +1,9 @@
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 0.2.3
|
||||||
|
Date: 2020.01.04
|
||||||
|
Fixes:
|
||||||
|
- Register on_tick event on a different callback.
|
||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 0.2.2
|
Version: 0.2.2
|
||||||
Date: 2020.01.03
|
Date: 2020.01.03
|
||||||
Fixes:
|
Fixes:
|
||||||
|
|
|
@ -557,16 +557,13 @@ end
|
||||||
|
|
||||||
function load()
|
function load()
|
||||||
refreshMetatables()
|
refreshMetatables()
|
||||||
|
if INTERVAL ~= settings.global["baf-update-interval"].value then
|
||||||
INTERVAL = settings.global["baf-update-interval"].value
|
setup()
|
||||||
|
end
|
||||||
onTick = spreadOverTicks(functions, INTERVAL)
|
|
||||||
script.on_event(defines.events.on_tick, onTick)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
script.on_load(load)
|
script.on_load(load)
|
||||||
|
|
||||||
|
|
||||||
function init()
|
function init()
|
||||||
-- gather all filters on every surface
|
-- gather all filters on every surface
|
||||||
global.air_filtered_chunks_map = {}
|
global.air_filtered_chunks_map = {}
|
||||||
|
@ -587,13 +584,18 @@ script.on_configuration_changed(init)
|
||||||
|
|
||||||
function onSettingsChanged(event)
|
function onSettingsChanged(event)
|
||||||
if event.setting == "baf-update-interval" then
|
if event.setting == "baf-update-interval" then
|
||||||
INTERVAL = settings.global["baf-update-interval"].value
|
setup()
|
||||||
|
|
||||||
onTick = spreadOverTicks(functions, INTERVAL)
|
|
||||||
script.on_event(defines.events.on_tick, onTick)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
script.on_event(defines.events.on_runtime_mod_setting_changed, onSettingsChanged)
|
script.on_event(defines.events.on_runtime_mod_setting_changed, onSettingsChanged)
|
||||||
|
|
||||||
|
|
||||||
|
function setup()
|
||||||
|
INTERVAL = settings.global["baf-update-interval"].value
|
||||||
|
|
||||||
|
onTick = spreadOverTicks(functions, INTERVAL)
|
||||||
|
script.on_event(defines.events.on_tick, onTick)
|
||||||
|
end
|
||||||
|
|
||||||
|
setup()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "better-air-filtering",
|
"name": "better-air-filtering",
|
||||||
"version": "0.2.2",
|
"version": "0.2.3",
|
||||||
"title": "Better Air Filtering",
|
"title": "Better Air Filtering",
|
||||||
"author": "Joey De Pauw",
|
"author": "Joey De Pauw",
|
||||||
"contact": "joeydepauw@gmail.com",
|
"contact": "joeydepauw@gmail.com",
|
||||||
|
|
Reference in New Issue