diff --git a/NewHorizons/Assets/translations/english.json b/NewHorizons/Assets/translations/english.json index 48df51ee..6eed88c3 100644 --- a/NewHorizons/Assets/translations/english.json +++ b/NewHorizons/Assets/translations/english.json @@ -22,7 +22,8 @@ "DEBUG_PLACE_TEXT": "Place Nomai Text", "DEBUG_UNDO": "Undo", "DEBUG_REDO": "Redo", - "Vessel": "Vessel" + "Vessel": "Vessel", + "DLC_REQUIRED": "WARNING\n\nYou have addons (like {0}) installed which require the DLC but it is not enabled.\n\nYour mods may not function as intended." }, "OtherDictionary": { "NOMAI_SHUTTLE_COMPUTER": "The shuttle]]> is currently resting at {0}]]>." diff --git a/NewHorizons/Assets/translations/french.json b/NewHorizons/Assets/translations/french.json index c268d415..ed7d553b 100644 --- a/NewHorizons/Assets/translations/french.json +++ b/NewHorizons/Assets/translations/french.json @@ -17,7 +17,8 @@ "RICH_PRESENCE_WARPING": "En route vers {0}.", "OUTDATED_VERSION_WARNING": "AVERTISSEMENT\n\nNew Horizons fonctionne seulement sur la version {0} ou plus récente. Vous êtes sur la version {1}.\n\nVeuillez mettre à jour votre jeu ou désinstaller NH.", "JSON_FAILED_TO_LOAD": "Fichier(s) invalide(s): {0}", - "Vessel": "Vaisseau" + "Vessel": "Vaisseau", + "DLC_REQUIRED": "AVERTISSEMENT\n\nVous avez installé des addons (par exemple, {0}) qui nécessitent le DLC mais il n'est pas activé.\n\nVos mods peuvent ne pas fonctionner." }, "AchievementTranslations": { "NH_EATEN_OUTSIDE_BRAMBLE": { diff --git a/NewHorizons/External/NewHorizonBody.cs b/NewHorizons/External/NewHorizonBody.cs index fa80de75..590c5b91 100644 --- a/NewHorizons/External/NewHorizonBody.cs +++ b/NewHorizons/External/NewHorizonBody.cs @@ -26,6 +26,15 @@ namespace NewHorizons.External public GameObject Object; + public bool RequiresDLC() + { + var detailPaths = Config.Props.details.Select(x => x.path); + return Config.Cloak != null + || Config.Props?.rafts != null + || Config.Props?.slideShows != null + || detailPaths.Any(x => x.StartsWith("Ringworld") || x.StartsWith("Dreamworld")); + } + #region Cache public void LoadCache() { diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 5d438e9d..92509469 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -99,6 +99,8 @@ namespace NewHorizons public bool PlayerSpawned { get; set; } public bool ForceClearCaches { get; set; } // for reloading configs + public bool FlagDLCRequired { get; set; } + public ShipWarpController ShipWarpController { get; private set; } // API events @@ -690,6 +692,14 @@ namespace NewHorizons var relativeDirectory = file.Replace(folder, ""); var body = LoadConfig(mod, relativeDirectory); + // Only bother checking if they need the DLC if they don't have it + if (!HasDLC && !FlagDLCRequired && body.RequiresDLC()) + { + FlagDLCRequired = true; + var popupText = TranslationHandler.GetTranslation("DLC_REQUIRED", TranslationHandler.TextType.UI).Replace("{0}", mod.ModHelper.Manifest.Name); + MenuHandler.RegisterOneTimePopup(this, popupText, true); + } + if (body != null) { // Wanna track the spawn point of each system @@ -921,8 +931,15 @@ namespace NewHorizons { CurrentStarSystem = _defaultSystemOverride; - // Sometimes the override will not support spawning regularly, so always warp in - IsWarpingFromShip = true; + if (BodyDict.TryGetValue(_defaultSystemOverride, out var bodies) && bodies.Any(x => x.Config?.Spawn?.shipSpawn != null)) + { + // #738 - Sometimes the override will not support spawning regularly, so always warp in if possible + IsWarpingFromShip = true; + } + else + { + IsWarpingFromShip = false; + } } else {