mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix some stuff add more clouds
This commit is contained in:
parent
95641bc249
commit
a091c88a93
BIN
NewHorizons/Assets/textures/CloudExit__PlayerShip_d.png
Normal file
BIN
NewHorizons/Assets/textures/CloudExit__PlayerShip_d.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 MiB |
@ -30,6 +30,8 @@ public class SplashColourizer : MonoBehaviour
|
||||
|
||||
private bool _probeInsideVolume;
|
||||
|
||||
private List<Texture> _customTextures = new();
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
var volume = new GameObject("Volume");
|
||||
@ -210,6 +212,12 @@ public class SplashColourizer : MonoBehaviour
|
||||
var meshRenderers = prefab.GetComponentsInChildren<MeshRenderer>(true);
|
||||
foreach (var meshRenderer in meshRenderers)
|
||||
{
|
||||
if (_customTextures.Contains(meshRenderer.material.mainTexture))
|
||||
{
|
||||
// Might be some shared material stuff? This image is already tinted, so skip it
|
||||
continue;
|
||||
}
|
||||
|
||||
// Can't access the textures in memory so we need to have our own copies
|
||||
var texture = ImageUtilities.GetTexture(Main.Instance, $"Assets/textures/{meshRenderer.material.mainTexture.name}.png");
|
||||
if (texture == null)
|
||||
@ -218,6 +226,9 @@ public class SplashColourizer : MonoBehaviour
|
||||
GameObject.Destroy(prefab);
|
||||
flagError = true;
|
||||
}
|
||||
|
||||
_customTextures.Add(texture);
|
||||
|
||||
meshRenderer.material = new(meshRenderer.material)
|
||||
{
|
||||
color = Color.white,
|
||||
@ -251,6 +262,16 @@ public class SplashColourizer : MonoBehaviour
|
||||
}
|
||||
|
||||
public void SetProbeSplashEffects(bool entering)
|
||||
{
|
||||
_probeInsideVolume = entering;
|
||||
|
||||
if (_probeDetector != null)
|
||||
{
|
||||
SetSplashEffects(_probeDetector, entering);
|
||||
}
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
// Probe detector keeps being null, I hate my life
|
||||
if (_probeDetector == null)
|
||||
@ -261,12 +282,5 @@ public class SplashColourizer : MonoBehaviour
|
||||
CachePrefabs(_probeDetector);
|
||||
}
|
||||
}
|
||||
|
||||
_probeInsideVolume = entering;
|
||||
|
||||
if (_probeDetector != null)
|
||||
{
|
||||
SetSplashEffects(_probeDetector, entering);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,17 @@ namespace NewHorizons.Utility.Files
|
||||
return null;
|
||||
}
|
||||
// Copied from OWML but without the print statement lol
|
||||
var path = Path.Combine(mod.ModHelper.Manifest.ModFolderPath, filename);
|
||||
string path;
|
||||
try
|
||||
{
|
||||
path = Path.Combine(mod.ModHelper.Manifest.ModFolderPath, filename);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
NHLogger.LogError($"Invalid path: Couldn't combine {mod.ModHelper.Manifest.ModFolderPath} {filename} - {e}");
|
||||
return null;
|
||||
}
|
||||
|
||||
var key = GetKey(path);
|
||||
if (_textureCache.TryGetValue(key, out var existingTexture))
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user