mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add SetDefaultSystem to API
This commit is contained in:
parent
a622404e23
commit
0354a3081c
@ -370,7 +370,11 @@ namespace NewHorizons
|
||||
if (starSystemConfig.startHere)
|
||||
{
|
||||
// We always want to allow mods to overwrite setting the main SolarSystem as default but not the other way around
|
||||
if (name != "SolarSystem") SetDefaultSystem(name);
|
||||
if (name != "SolarSystem")
|
||||
{
|
||||
SetDefaultSystem(name);
|
||||
_currentStarSystem = name;
|
||||
}
|
||||
}
|
||||
|
||||
if (SystemDict.ContainsKey(name))
|
||||
@ -494,7 +498,6 @@ namespace NewHorizons
|
||||
public void SetDefaultSystem(string defaultSystem)
|
||||
{
|
||||
_defaultStarSystem = defaultSystem;
|
||||
_currentStarSystem = defaultSystem;
|
||||
}
|
||||
|
||||
#endregion Load
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using NewHorizons.Builder.Props;
|
||||
using NewHorizons.Builder.Props;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using OWML.Utils;
|
||||
@ -77,6 +77,14 @@ namespace NewHorizons
|
||||
return Main.Instance.OnStarSystemLoaded;
|
||||
}
|
||||
|
||||
public bool SetDefaultSystem(string name)
|
||||
{
|
||||
if (!Main.SystemDict.ContainsKey(name)) return false;
|
||||
|
||||
Main.Instance.SetDefaultSystem(name);
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool ChangeCurrentStarSystem(string name)
|
||||
{
|
||||
if (!Main.SystemDict.ContainsKey(name)) return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user