mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Allow more than one ring
This commit is contained in:
parent
2da1015620
commit
5ab727384b
@ -120,10 +120,13 @@ namespace NewHorizons.Builder.Body
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (body.Config.Ring != null)
|
if (body.Config.Rings != null)
|
||||||
{
|
{
|
||||||
RingBuilder.MakeRingGraphics(proxy, null, body.Config.Ring, body.Mod);
|
foreach (var ring in body.Config.Rings)
|
||||||
if (realSize < body.Config.Ring.outerRadius) realSize = body.Config.Ring.outerRadius;
|
{
|
||||||
|
RingBuilder.MakeRingGraphics(proxy, null, ring, body.Mod);
|
||||||
|
if (realSize < ring.outerRadius) realSize = ring.outerRadius;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Renderer starAtmosphere = null;
|
Renderer starAtmosphere = null;
|
||||||
|
|||||||
@ -73,7 +73,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ringGO = new GameObject("Ring");
|
var ringGO = new GameObject(!string.IsNullOrEmpty(ring.rename) ? ring.rename : "Ring");
|
||||||
ringGO.transform.parent = sector?.transform ?? rootObject.transform;
|
ringGO.transform.parent = sector?.transform ?? rootObject.transform;
|
||||||
ringGO.transform.position = rootObject.transform.position;
|
ringGO.transform.position = rootObject.transform.position;
|
||||||
ringGO.transform.rotation = rootObject.transform.rotation;
|
ringGO.transform.rotation = rootObject.transform.rotation;
|
||||||
|
|||||||
8
NewHorizons/External/Configs/PlanetConfig.cs
vendored
8
NewHorizons/External/Configs/PlanetConfig.cs
vendored
@ -67,6 +67,10 @@ namespace NewHorizons.External.Configs
|
|||||||
|
|
||||||
[Obsolete("Signal is deprecated, please use Props->signals")]
|
[Obsolete("Signal is deprecated, please use Props->signals")]
|
||||||
public SignalModule Signal;
|
public SignalModule Signal;
|
||||||
|
|
||||||
|
[Obsolete("Ring is deprecated, please use Rings")]
|
||||||
|
public RingModule Ring;
|
||||||
|
|
||||||
#endregion Obsolete
|
#endregion Obsolete
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -135,9 +139,9 @@ namespace NewHorizons.External.Configs
|
|||||||
public string[] removeChildren;
|
public string[] removeChildren;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a ring around the planet
|
/// Create rings around the planet
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public RingModule Ring;
|
public RingModule[] Rings;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add sand to this planet
|
/// Add sand to this planet
|
||||||
|
|||||||
5
NewHorizons/External/Modules/RingModule.cs
vendored
5
NewHorizons/External/Modules/RingModule.cs
vendored
@ -62,5 +62,10 @@ namespace NewHorizons.External.Modules
|
|||||||
/// Fade rings in/out over time. Optional. Value between 0-1, time is in minutes.
|
/// Fade rings in/out over time. Optional. Value between 0-1, time is in minutes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TimeValuePair[] opacityCurve;
|
public TimeValuePair[] opacityCurve;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// An optional rename of this object
|
||||||
|
/// </summary>
|
||||||
|
public string rename;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -547,9 +547,12 @@ namespace NewHorizons.Handlers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (body.Config.Ring != null)
|
if (body.Config.Rings != null)
|
||||||
{
|
{
|
||||||
RingBuilder.Make(go, sector, body.Config.Ring, body.Mod);
|
foreach (var ring in body.Config.Rings)
|
||||||
|
{
|
||||||
|
RingBuilder.Make(go, sector, ring, body.Mod);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (body.Config.AsteroidBelt != null)
|
if (body.Config.AsteroidBelt != null)
|
||||||
|
|||||||
@ -107,13 +107,16 @@ namespace NewHorizons.Handlers
|
|||||||
}
|
}
|
||||||
pivot.name = "Pivot";
|
pivot.name = "Pivot";
|
||||||
|
|
||||||
if (body.Config.Ring != null)
|
if (body.Config.Rings != null && body.Config.Rings.Length > 0)
|
||||||
{
|
{
|
||||||
RingModule newRing = new RingModule();
|
foreach (var ring in body.Config.Rings)
|
||||||
newRing.innerRadius = size * 1.2f;
|
{
|
||||||
newRing.outerRadius = size * 2f;
|
RingModule newRing = new RingModule();
|
||||||
newRing.texture = body.Config.Ring.texture;
|
newRing.innerRadius = size * 1.2f;
|
||||||
var ring = RingBuilder.Make(titleScreenGO, null, newRing, body.Mod);
|
newRing.outerRadius = size * 2f;
|
||||||
|
newRing.texture = ring.texture;
|
||||||
|
RingBuilder.Make(titleScreenGO, null, newRing, body.Mod);
|
||||||
|
}
|
||||||
titleScreenGO.transform.localScale = Vector3.one * 0.8f;
|
titleScreenGO.transform.localScale = Vector3.one * 0.8f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user