Skip to content

Commit

Permalink
Moving the MeshEngine init to the end of the Loading Scene to allow i…
Browse files Browse the repository at this point in the history
…t to fectch any changes made to the GameDatabase by Module Manager. This will help solve problems for ReStock, but algo to everybody else that change models.

#1
  • Loading branch information
Lisias committed Apr 21, 2023
1 parent ca8e449 commit f4f586c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Source/DistantObject/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,28 @@ private void Awake()
{
KSPe.Util.Compatibility.Check<Startup>();
KSPe.Util.Installation.Check<Startup>();
GameEvents.onGameSceneSwitchRequested.Add(OnGameSceneSwitchRequested);
}
catch (KSPe.Util.InstallmentException e)
{
Log.error(e.ToShortMessage());
KSPe.Common.Dialogs.ShowStopperAlertBox.Show(e);
}

{
using (KSPe.Util.SystemTools.Assembly.Loader a = new KSPe.Util.SystemTools.Assembly.Loader<Startup>())
{
a.LoadAndStartup("MeshEngine");
}
}
}

[UsedImplicitly]
private void Start()
{
Log.force("Version {0}", Version.Text);
}

private void OnGameSceneSwitchRequested(GameEvents.FromToAction<GameScenes, GameScenes> data)
{
GameEvents.onGameSceneSwitchRequested.Remove(OnGameSceneSwitchRequested);
using (KSPe.Util.SystemTools.Assembly.Loader a = new KSPe.Util.SystemTools.Assembly.Loader<Startup>())
{
a.LoadAndStartup("MeshEngine");
}
}
}
}

0 comments on commit f4f586c

Please sign in to comment.