Re-add missing method signatures used by Dreamstalker

This commit is contained in:
Nick 2023-12-29 16:38:20 -05:00
parent 8e0fbbb69d
commit 1f53e460b8
3 changed files with 30 additions and 3 deletions

View File

@ -1,6 +1,7 @@
using NewHorizons.External.Configs;
using NewHorizons.External.Modules;
using NewHorizons.Utility;
using System;
using UnityEngine;
namespace NewHorizons.Builder.Atmosphere
@ -52,7 +53,26 @@ namespace NewHorizons.Builder.Atmosphere
if (_fogEmitterPrefab == null) _fogEmitterPrefab = SearchUtilities.Find("DB_EscapePodDimension_Body/Sector_EscapePodDimension/Effects_EscapePodDimension/Effects_DB_Fog (1)").InstantiateInactive().Rename("Prefab_Effects_Fog").DontDestroyOnLoad();
}
#region obsolete
// Never change method signatures, people directly reference the NH dll and it can break backwards compatability
// Dreamstalker needed this one
[Obsolete]
public static void Make(GameObject planetGO, Sector sector, PlanetConfig config, float surfaceHeight)
=> Make(planetGO, sector, config, surfaceHeight);
#endregion
public static void Make(GameObject planetGO, Sector sector, PlanetConfig config)
=> Make(planetGO, sector, config, null);
/// <summary>
/// Nullable surface height for backwards compat
/// </summary>
/// <param name="planetGO"></param>
/// <param name="sector"></param>
/// <param name="config"></param>
/// <param name="surfaceHeight"></param>
private static void Make(GameObject planetGO, Sector sector, PlanetConfig config, float? surfaceHeight)
{
InitPrefabs();
@ -69,11 +89,13 @@ namespace NewHorizons.Builder.Atmosphere
sectorCullGroup._waitForStreaming = false;
var (minHeight, maxHeight) = GetDefaultHeightRange(config);
// min height override for backwards compat
minHeight = surfaceHeight ?? minHeight;
foreach (var particleField in config.ParticleFields)
{
var prefab = GetPrefabByType(particleField.type);
var emitter = Object.Instantiate(prefab, effectsGO.transform);
var emitter = GameObject.Instantiate(prefab, effectsGO.transform);
emitter.name = !string.IsNullOrWhiteSpace(particleField.rename) ? particleField.rename : prefab.name.Replace("Prefab_", "");
emitter.transform.position = planetGO.transform.position;

View File

@ -32,7 +32,12 @@ namespace NewHorizons.Builder.Props
// In particular, Outer Wives needs this method signature
[Obsolete]
public static GameObject Make(GameObject go, Sector sector, GameObject prefab, DetailInfo detail)
=> Make(go, sector, null, prefab, detail);
=> Make(go, sector, mod: null, prefab, detail);
// Dreamstalker needed this one
[Obsolete]
public static GameObject Make(GameObject go, Sector sector, DetailInfo detail)
=> Make(go, sector, mod: null, detail);
#endregion
private static void SceneManager_sceneUnloaded(Scene scene)

View File

@ -4,7 +4,7 @@
"author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book",
"name": "New Horizons",
"uniqueName": "xen.NewHorizons",
"version": "1.18.0",
"version": "1.18.1",
"owmlVersion": "2.9.8",
"dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ],
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ],