added item.deconstructed hook, misc registers and luacs is now initialized before campaign/sub editor is loaded

This commit is contained in:
Evil Factory
2022-05-10 13:55:10 -03:00
parent 45efbd8e08
commit 2630c8354c
5 changed files with 12 additions and 6 deletions
@@ -1115,6 +1115,8 @@ namespace Barotrauma
return;
}
GameMain.LuaCs.Initialize();
selectedSub = new SubmarineInfo(Path.Combine(SaveUtil.TempPath, selectedSub.Name + ".sub"));
GameMain.GameSession = new GameSession(selectedSub, savePath, GameModePreset.SinglePlayerCampaign, settings, mapSeed);
@@ -1124,14 +1126,14 @@ namespace Barotrauma
GameMain.GameSession.CrewManager.AddCharacterInfo(characterInfo);
}
((SinglePlayerCampaign)GameMain.GameSession.GameMode).LoadNewLevel();
GameMain.LuaCs.Initialize();
}
private void LoadGame(string saveFile)
{
if (string.IsNullOrWhiteSpace(saveFile)) return;
GameMain.LuaCs.Initialize();
try
{
SaveUtil.LoadGame(saveFile);
@@ -1144,8 +1146,6 @@ namespace Barotrauma
//TODO
//GameMain.LobbyScreen.Select();
GameMain.LuaCs.Initialize();
}
#region UI Methods