mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-10 12:08:12 -06:00
added debug revision numbers
This commit is contained in:
6
cybersyn/info.lua
Normal file
6
cybersyn/info.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
--- The number below is the debug revision number.
|
||||||
|
--- It is used in migrations.lua to determine if any migrations need to be run for beta testers.
|
||||||
|
--- It is expected these are only meaningful between releases during beta testing.
|
||||||
|
--- It should be set to nil for any release version.
|
||||||
|
return 1
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
--By Mami
|
--By Mami
|
||||||
local flib_migration = require("__flib__.migration")
|
local flib_migration = require("__flib__.migration")
|
||||||
local manager_gui = require('gui.main')
|
local manager_gui = require('gui.main')
|
||||||
|
local debug_revision = require('info')
|
||||||
|
local check_debug_revision
|
||||||
|
|
||||||
|
|
||||||
local migrations_table = {
|
local migrations_table = {
|
||||||
@@ -298,7 +300,9 @@ local migrations_table = {
|
|||||||
---@type MapData
|
---@type MapData
|
||||||
local map_data = global
|
local map_data = global
|
||||||
|
|
||||||
manager_gui.on_init()
|
map_data.manager = {
|
||||||
|
players = {},
|
||||||
|
}
|
||||||
for i, v in pairs(game.players) do
|
for i, v in pairs(game.players) do
|
||||||
manager_gui.on_player_created({player_index = i})
|
manager_gui.on_player_created({player_index = i})
|
||||||
end
|
end
|
||||||
@@ -318,7 +322,6 @@ local migrations_table = {
|
|||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
--STATUS_R_TO_D = 5
|
--STATUS_R_TO_D = 5
|
||||||
|
|
||||||
---@param data ConfigurationChangedData
|
---@param data ConfigurationChangedData
|
||||||
function on_config_changed(data)
|
function on_config_changed(data)
|
||||||
global.tick_state = STATE_INIT
|
global.tick_state = STATE_INIT
|
||||||
@@ -333,4 +336,31 @@ function on_config_changed(data)
|
|||||||
if IS_SE_PRESENT and not global.se_tele_old_id then
|
if IS_SE_PRESENT and not global.se_tele_old_id then
|
||||||
global.se_tele_old_id = {}
|
global.se_tele_old_id = {}
|
||||||
end
|
end
|
||||||
|
if global.debug_revision ~= debug_revision then
|
||||||
|
global.debug_revision = debug_revision
|
||||||
|
if debug_revision then
|
||||||
|
on_debug_revision_change()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
---NOTE: this runs before on_config_changed
|
||||||
|
---It does not have access to game
|
||||||
|
function on_debug_revision_change()
|
||||||
|
local map_data = global
|
||||||
|
|
||||||
|
if debug_revision == 1 then
|
||||||
|
for _, e in pairs(map_data.refuelers) do
|
||||||
|
e.network_mask = e.network_flag
|
||||||
|
e.network_flag = nil
|
||||||
|
end
|
||||||
|
for _, e in pairs(map_data.stations) do
|
||||||
|
e.network_mask = e.network_flag
|
||||||
|
e.network_flag = nil
|
||||||
|
end
|
||||||
|
for _, e in pairs(map_data.trains) do
|
||||||
|
e.network_mask = e.network_flag
|
||||||
|
e.network_flag = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user