mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge branch 'dev' of https://github.com/Outer-Wilds-New-Horizons/new-horizons into dev
This commit is contained in:
commit
1eb3e04729
@ -1,6 +1,7 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.Files;
|
||||
using OWML.Common;
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
@ -35,7 +36,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
if (_dbImpostorMaterials == null) _dbImpostorMaterials = SearchUtilities.Find("DarkBramble_Body/Atmosphere_DB/FogLOD").GetComponent<MeshRenderer>().sharedMaterials.MakePrefabMaterials();
|
||||
}
|
||||
|
||||
public static PlanetaryFogController Make(GameObject planetGO, Sector sector, AtmosphereModule atmo)
|
||||
public static PlanetaryFogController Make(GameObject planetGO, Sector sector, AtmosphereModule atmo, IModBehaviour mod)
|
||||
{
|
||||
InitPrefabs();
|
||||
|
||||
@ -58,7 +59,10 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
PFC.lodFadeDistance = PFC.fogRadius * 0.5f;
|
||||
PFC.fogDensity = atmo.fogDensity;
|
||||
PFC.fogExponent = 1f;
|
||||
var colorRampTexture = atmo.fogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor());
|
||||
var colorRampTexture =
|
||||
atmo.fogRampPath != null ? ImageUtilities.GetTexture(mod, atmo.fogRampPath) :
|
||||
atmo.fogTint != null ? ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor()) :
|
||||
_ramp;
|
||||
PFC.fogColorRampTexture = colorRampTexture;
|
||||
PFC.fogColorRampIntensity = 1f;
|
||||
if (atmo.fogTint != null)
|
||||
@ -78,7 +82,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
return PFC;
|
||||
}
|
||||
|
||||
public static Renderer MakeProxy(GameObject proxyGO, AtmosphereModule atmo)
|
||||
public static Renderer MakeProxy(GameObject proxyGO, AtmosphereModule atmo, IModBehaviour mod)
|
||||
{
|
||||
InitPrefabs();
|
||||
|
||||
@ -94,7 +98,10 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
MR.materials = _dbImpostorMaterials;
|
||||
MR.allowOcclusionWhenDynamic = true;
|
||||
|
||||
var colorRampTexture = atmo.fogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor());
|
||||
var colorRampTexture =
|
||||
atmo.fogRampPath != null ? ImageUtilities.GetTexture(mod, atmo.fogRampPath) :
|
||||
atmo.fogTint != null ? ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor()) :
|
||||
_ramp;
|
||||
if (atmo.fogTint != null)
|
||||
{
|
||||
MR.material.SetColor(Tint, atmo.fogTint.ToColor());
|
||||
|
||||
@ -120,7 +120,7 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
if (body.Config.Atmosphere.fogSize != 0)
|
||||
{
|
||||
fog = FogBuilder.MakeProxy(proxy, body.Config.Atmosphere);
|
||||
fog = FogBuilder.MakeProxy(proxy, body.Config.Atmosphere, body.Mod);
|
||||
fogCurveMaxVal = body.Config.Atmosphere.fogDensity;
|
||||
}
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ namespace NewHorizons.External.Modules
|
||||
/// <summary>
|
||||
/// How dense the fog is, if you put fog.
|
||||
/// </summary>
|
||||
[Range(0f, 1f)] public float fogDensity;
|
||||
[Range(0f, double.MaxValue)] public float fogDensity;
|
||||
|
||||
/// <summary>
|
||||
/// Radius of fog sphere, independent of the atmosphere. This has to be set for there to be fog.
|
||||
@ -57,6 +57,12 @@ namespace NewHorizons.External.Modules
|
||||
/// Colour of fog on the planet, if you put fog.
|
||||
/// </summary>
|
||||
public MColor fogTint;
|
||||
|
||||
/// <summary>
|
||||
/// Relative filepath to the fog color ramp texture, if you put fog.
|
||||
/// x axis is angle to sun (left at midnight, right at noon), y axis is distance to camera (close at bottom, far at top).
|
||||
/// </summary>
|
||||
public string fogRampPath;
|
||||
|
||||
/// <summary>
|
||||
/// Lets you survive on the planet without a suit.
|
||||
|
||||
2
NewHorizons/External/Modules/SpawnModule.cs
vendored
2
NewHorizons/External/Modules/SpawnModule.cs
vendored
@ -29,7 +29,7 @@ namespace NewHorizons.External.Modules
|
||||
/// <summary>
|
||||
/// Offsets the player/ship by this local vector when spawning. Used to prevent spawning in the floor. Optional: defaults to (0, 4, 0).
|
||||
/// </summary>
|
||||
public MVector3? offset;
|
||||
public MVector3 offset;
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
|
||||
@ -652,7 +652,7 @@ namespace NewHorizons.Handlers
|
||||
|
||||
if (body.Config.Atmosphere.fogSize != 0)
|
||||
{
|
||||
fog = FogBuilder.Make(go, sector, body.Config.Atmosphere);
|
||||
fog = FogBuilder.Make(go, sector, body.Config.Atmosphere, body.Mod);
|
||||
}
|
||||
|
||||
atmosphere = AtmosphereBuilder.Make(go, sector, body.Config.Atmosphere, surfaceSize).GetComponentInChildren<LODGroup>();
|
||||
|
||||
@ -345,7 +345,6 @@
|
||||
"type": "number",
|
||||
"description": "How dense the fog is, if you put fog.",
|
||||
"format": "float",
|
||||
"maximum": 1.0,
|
||||
"minimum": 0.0
|
||||
},
|
||||
"fogSize": {
|
||||
@ -358,6 +357,10 @@
|
||||
"description": "Colour of fog on the planet, if you put fog.",
|
||||
"$ref": "#/definitions/MColor"
|
||||
},
|
||||
"fogRampPath": {
|
||||
"type": "string",
|
||||
"description": "Relative filepath to the fog color ramp texture, if you put fog.\nx axis is angle to sun (left at midnight, right at noon), y axis is distance to camera (close at bottom, far at top)."
|
||||
},
|
||||
"hasOxygen": {
|
||||
"type": "boolean",
|
||||
"description": "Lets you survive on the planet without a suit."
|
||||
@ -3050,14 +3053,7 @@
|
||||
"properties": {
|
||||
"offset": {
|
||||
"description": "Offsets the player/ship by this local vector when spawning. Used to prevent spawning in the floor. Optional: defaults to (0, 4, 0).",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/MVector3"
|
||||
}
|
||||
]
|
||||
"$ref": "#/definitions/MVector3"
|
||||
},
|
||||
"rotation": {
|
||||
"description": "Rotation of the object",
|
||||
@ -3102,14 +3098,7 @@
|
||||
"properties": {
|
||||
"offset": {
|
||||
"description": "Offsets the player/ship by this local vector when spawning. Used to prevent spawning in the floor. Optional: defaults to (0, 4, 0).",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/MVector3"
|
||||
}
|
||||
]
|
||||
"$ref": "#/definitions/MVector3"
|
||||
},
|
||||
"rotation": {
|
||||
"description": "Rotation of the object",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user