mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2026-01-31 04:25:21 -06:00
moved migration logic into manager
This commit is contained in:
@@ -50,9 +50,9 @@ function manager_gui.on_lua_shortcut(e)
|
||||
if e.prototype_name == "cybersyn-toggle-gui" or e.input_name == "cybersyn-toggle-gui" or e.element then
|
||||
if e.element then
|
||||
if e.element.name == "manager_window" then
|
||||
manager.wrapper(e, manager.handle.manager_toggle)
|
||||
manager.wrapper(e, manager.handle.manager_toggle)
|
||||
end
|
||||
else
|
||||
else
|
||||
manager.wrapper(e, manager.handle.manager_toggle)
|
||||
end
|
||||
end
|
||||
@@ -147,7 +147,14 @@ end
|
||||
|
||||
|
||||
function manager_gui.on_migration()
|
||||
init_items(global.manager)
|
||||
if global.manager then
|
||||
for i, v in pairs(global.manager.players) do
|
||||
manager_gui.reset_player(i, v)
|
||||
end
|
||||
init_items(global.manager)
|
||||
else
|
||||
manager_gui.on_init()
|
||||
end
|
||||
end
|
||||
|
||||
function manager_gui.on_init()
|
||||
|
||||
@@ -328,19 +328,6 @@ function on_config_changed(data)
|
||||
global.tick_data = {}
|
||||
global.perf_cache = {}
|
||||
|
||||
if global.manager then
|
||||
for i, v in pairs(global.manager.players) do
|
||||
manager_gui.reset_player(i, v)
|
||||
end
|
||||
else
|
||||
global.manager = {
|
||||
players = {},
|
||||
}
|
||||
for i, v in pairs(game.players) do
|
||||
manager_gui.on_player_created({player_index = i})
|
||||
end
|
||||
end
|
||||
|
||||
flib_migration.on_config_changed(data, migrations_table)
|
||||
|
||||
IS_SE_PRESENT = remote.interfaces["space-exploration"] ~= nil
|
||||
|
||||
Reference in New Issue
Block a user