mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
1.18.2 (#765)
## Bug fixes - Fix looping crash of obsolete effects builder method - Re-added even more missing method signatures that were breaking Dreamstalker (just update your mod xen!) - Tessellated renderers in asset bundles will now have their shaders replaced just like normal renderers
This commit is contained in:
commit
e8aecf2890
@ -1,6 +1,7 @@
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.OWML;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
@ -55,15 +56,15 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
|
||||
|
||||
#region obsolete
|
||||
// Never change method signatures, people directly reference the NH dll and it can break backwards compatability
|
||||
// Never change method signatures, people directly reference the NH dll and it can break backwards compatibility
|
||||
// Dreamstalker needed this one
|
||||
[Obsolete]
|
||||
public static void Make(GameObject planetGO, Sector sector, PlanetConfig config, float surfaceHeight)
|
||||
=> Make(planetGO, sector, config, surfaceHeight);
|
||||
=> InternalMake(planetGO, sector, config, surfaceHeight);
|
||||
#endregion
|
||||
|
||||
public static void Make(GameObject planetGO, Sector sector, PlanetConfig config)
|
||||
=> Make(planetGO, sector, config, null);
|
||||
=> InternalMake(planetGO, sector, config, null);
|
||||
|
||||
/// <summary>
|
||||
/// Nullable surface height for backwards compat
|
||||
@ -72,7 +73,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
/// <param name="sector"></param>
|
||||
/// <param name="config"></param>
|
||||
/// <param name="surfaceHeight"></param>
|
||||
private static void Make(GameObject planetGO, Sector sector, PlanetConfig config, float? surfaceHeight)
|
||||
private static void InternalMake(GameObject planetGO, Sector sector, PlanetConfig config, float? surfaceHeight)
|
||||
{
|
||||
InitPrefabs();
|
||||
|
||||
@ -92,6 +93,8 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
// min height override for backwards compat
|
||||
minHeight = surfaceHeight ?? minHeight;
|
||||
|
||||
if (config.ParticleFields != null)
|
||||
{
|
||||
foreach (var particleField in config.ParticleFields)
|
||||
{
|
||||
var prefab = GetPrefabByType(particleField.type);
|
||||
@ -114,6 +117,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
|
||||
emitter.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
effectsGO.transform.position = planetGO.transform.position;
|
||||
effectsGO.SetActive(true);
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.External.Modules.Props;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.Files;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
@ -36,6 +38,14 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
if (_dbImpostorMaterials == null) _dbImpostorMaterials = SearchUtilities.Find("DarkBramble_Body/Atmosphere_DB/FogLOD").GetComponent<MeshRenderer>().sharedMaterials.MakePrefabMaterials();
|
||||
}
|
||||
|
||||
#region obsolete
|
||||
// Never change method signatures, people directly reference the NH dll and it can break backwards compatibility
|
||||
// Dreamstalker needs this method signature
|
||||
[Obsolete]
|
||||
public static PlanetaryFogController Make(GameObject planetGO, Sector sector, AtmosphereModule atmo)
|
||||
=> Make(planetGO, sector, atmo, null);
|
||||
#endregion
|
||||
|
||||
public static PlanetaryFogController Make(GameObject planetGO, Sector sector, AtmosphereModule atmo, IModBehaviour mod)
|
||||
{
|
||||
InitPrefabs();
|
||||
|
||||
@ -28,7 +28,7 @@ namespace NewHorizons.Builder.Props
|
||||
}
|
||||
|
||||
#region obsolete
|
||||
// Never change method signatures, people directly reference the NH dll and it can break backwards compatability
|
||||
// Never change method signatures, people directly reference the NH dll and it can break backwards compatibility
|
||||
// In particular, Outer Wives needs this method signature
|
||||
[Obsolete]
|
||||
public static GameObject Make(GameObject go, Sector sector, GameObject prefab, DetailInfo detail)
|
||||
|
||||
2
NewHorizons/External/Configs/PlanetConfig.cs
vendored
2
NewHorizons/External/Configs/PlanetConfig.cs
vendored
@ -281,7 +281,7 @@ namespace NewHorizons.External.Configs
|
||||
|
||||
public void Migrate()
|
||||
{
|
||||
// Backwards compatability
|
||||
// Backwards compatibility
|
||||
// Should be the only place that obsolete things are referenced
|
||||
#pragma warning disable 612, 618
|
||||
if (Base.waterSize != 0)
|
||||
|
||||
@ -309,7 +309,7 @@ namespace NewHorizons.External.Configs
|
||||
|
||||
public void Migrate()
|
||||
{
|
||||
// Backwards compatability
|
||||
// Backwards compatibility
|
||||
// Should be the only place that obsolete things are referenced
|
||||
#pragma warning disable 612, 618
|
||||
if (!string.IsNullOrEmpty(travelAudioClip)) travelAudio = travelAudioClip;
|
||||
|
||||
@ -949,7 +949,13 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
flag = false;
|
||||
// idk why we wait here but we do
|
||||
Delay.FireInNUpdates(() => childObj.gameObject.SetActive(false), 2);
|
||||
Delay.FireInNUpdates(() =>
|
||||
{
|
||||
if (childObj != null && childObj.gameObject != null)
|
||||
{
|
||||
childObj.gameObject.SetActive(false);
|
||||
}
|
||||
}, 2);
|
||||
}
|
||||
|
||||
if (flag) NHLogger.LogWarning($"Couldn't find \"{childPath}\".");
|
||||
|
||||
@ -96,6 +96,32 @@ namespace NewHorizons.Utility.Files
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var trenderer in prefab.GetComponentsInChildren<TessellatedRenderer>(true))
|
||||
{
|
||||
foreach (var material in trenderer.sharedMaterials)
|
||||
{
|
||||
if (material == null) continue;
|
||||
|
||||
var replacementShader = Shader.Find(material.shader.name);
|
||||
if (replacementShader == null) continue;
|
||||
|
||||
// preserve override tag and render queue (for Standard shader)
|
||||
// keywords and properties are already preserved
|
||||
if (material.renderQueue != material.shader.renderQueue)
|
||||
{
|
||||
var renderType = material.GetTag("RenderType", false);
|
||||
var renderQueue = material.renderQueue;
|
||||
material.shader = replacementShader;
|
||||
material.SetOverrideTag("RenderType", renderType);
|
||||
material.renderQueue = renderQueue;
|
||||
}
|
||||
else
|
||||
{
|
||||
material.shader = replacementShader;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,6 +33,11 @@ namespace NewHorizons.Utility.Files
|
||||
// bug: cache only considers file path, not wrap/mips/linear. oh well
|
||||
public static Texture2D GetTexture(IModBehaviour mod, string filename, bool useMipmaps = true, bool wrap = false, bool linear = false)
|
||||
{
|
||||
if (mod == null)
|
||||
{
|
||||
NHLogger.LogError("Couldn't get texture, mod is null.");
|
||||
return null;
|
||||
}
|
||||
// Copied from OWML but without the print statement lol
|
||||
var path = Path.Combine(mod.ModHelper.Manifest.ModFolderPath, filename);
|
||||
var key = GetKey(path);
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
"author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book",
|
||||
"name": "New Horizons",
|
||||
"uniqueName": "xen.NewHorizons",
|
||||
"version": "1.18.1",
|
||||
"version": "1.18.2",
|
||||
"owmlVersion": "2.9.8",
|
||||
"dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ],
|
||||
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user