Add option to prevent bringing items into other systems #997

This commit is contained in:
xen-42 2024-11-27 15:18:08 -05:00
parent acc2cfc016
commit 6e254cd10a
2 changed files with 11 additions and 1 deletions

View File

@ -21,6 +21,12 @@ namespace NewHorizons.External.Configs
/// </summary>
public string name;
/// <summary>
/// When changing star systems are you allowed to bring items into this system?
/// </summary>
[DefaultValue(true)]
public bool allowOutsideItems = true;
/// <summary>
/// In this system should the player be able to rotate their map camera freely or be stuck above the plane of the solar system?
/// </summary>

View File

@ -89,10 +89,14 @@ public static class HeldItemHandler
_pathOfItemTakenFromSystem[Main.Instance.CurrentStarSystem].Add(path);
}
private static void OnStarSystemChanging(string _)
private static void OnStarSystemChanging(string newSystem)
{
// Double check we're still holding it
_currentlyHeldItem = Locator.GetToolModeSwapper().GetItemCarryTool().GetHeldItem()?.gameObject;
if (!Main.SystemDict[newSystem].Config.allowOutsideItems)
{
_currentlyHeldItem = null;
}
if (_currentlyHeldItem != null)
{