mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Signals are in props now
This commit is contained in:
parent
e24dd0459e
commit
2bb3c4e813
@ -138,12 +138,12 @@ namespace NewHorizons.Builder.Props
|
||||
|
||||
foreach (var destinationDimension in allDimensions)
|
||||
{
|
||||
if (destinationDimension.Signal?.signals == null) continue;
|
||||
if (destinationDimension.Props?.signals == null) continue;
|
||||
|
||||
var destinationIndex = dimensionNameToIndex[destinationDimension.name];
|
||||
if (access[dimensionIndex, destinationIndex])
|
||||
{
|
||||
_propogatedSignals[dimension.name].AddRange(destinationDimension.Signal.signals);
|
||||
_propogatedSignals[dimension.name].AddRange(destinationDimension.Props.signals);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -213,6 +213,13 @@ namespace NewHorizons.Builder.Props
|
||||
AudioVolumeBuilder.Make(go, sector, audioVolume, mod);
|
||||
}
|
||||
}
|
||||
if (config.Props.signals != null)
|
||||
{
|
||||
foreach (var signal in config.Props.signals)
|
||||
{
|
||||
SignalBuilder.Make(go, sector, signal, mod);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,14 +125,6 @@ namespace NewHorizons.Builder.Props
|
||||
return name;
|
||||
}
|
||||
|
||||
public static void Make(GameObject body, Sector sector, SignalModule module, IModBehaviour mod)
|
||||
{
|
||||
foreach (var info in module.signals)
|
||||
{
|
||||
Make(body, sector, info, mod);
|
||||
}
|
||||
}
|
||||
|
||||
public static GameObject Make(GameObject planetGO, Sector sector, SignalModule.SignalInfo info, IModBehaviour mod)
|
||||
{
|
||||
var signalGO = new GameObject($"Signal_{info.name}");
|
||||
|
||||
18
NewHorizons/External/Configs/PlanetConfig.cs
vendored
18
NewHorizons/External/Configs/PlanetConfig.cs
vendored
@ -55,6 +55,8 @@ namespace NewHorizons.External.Configs
|
||||
[Obsolete("Singularity is deprecated, please use Props->singularities")]
|
||||
public SingularityModule Singularity;
|
||||
|
||||
[Obsolete("Signal is deprecated, please use Props->signals")]
|
||||
public SignalModule Signal;
|
||||
#endregion Obsolete
|
||||
|
||||
/// <summary>
|
||||
@ -138,11 +140,6 @@ namespace NewHorizons.External.Configs
|
||||
/// </summary>
|
||||
public ShipLogModule ShipLog;
|
||||
|
||||
/// <summary>
|
||||
/// Add signals that can be heard via the signal-scope to this planet
|
||||
/// </summary>
|
||||
public SignalModule Signal;
|
||||
|
||||
/// <summary>
|
||||
/// Spawn the player at this planet
|
||||
/// </summary>
|
||||
@ -342,10 +339,17 @@ namespace NewHorizons.External.Configs
|
||||
Props.singularities = Props.singularities.Append(Singularity).ToArray();
|
||||
}
|
||||
|
||||
// Signal
|
||||
// Signals are now in props
|
||||
if (Signal?.signals != null)
|
||||
{
|
||||
foreach (var signal in Signal.signals)
|
||||
if (Props == null) Props = new PropModule();
|
||||
if (Props.signals == null) Props.signals = new SignalModule.SignalInfo[0];
|
||||
Props.signals = Props.signals.Concat(Signal.signals).ToArray();
|
||||
}
|
||||
// Signals no longer use two differen variables for audio
|
||||
if (Props?.signals != null)
|
||||
{
|
||||
foreach (var signal in Props.signals)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(signal.audioClip)) signal.audio = signal.audioClip;
|
||||
if (!string.IsNullOrEmpty(signal.audioFilePath)) signal.audio = signal.audioFilePath;
|
||||
|
||||
5
NewHorizons/External/Modules/PropModule.cs
vendored
5
NewHorizons/External/Modules/PropModule.cs
vendored
@ -88,6 +88,11 @@ namespace NewHorizons.External.Modules
|
||||
/// </summary>
|
||||
public AudioVolumeInfo[] audioVolumes;
|
||||
|
||||
/// <summary>
|
||||
/// Add signalscope signals to this planet
|
||||
/// </summary>
|
||||
public SignalModule.SignalInfo[] signals;
|
||||
|
||||
[JsonObject]
|
||||
public class ScatterInfo
|
||||
{
|
||||
|
||||
@ -558,11 +558,6 @@ namespace NewHorizons.Handlers
|
||||
PropBuildManager.Make(go, sector, rb, body.Config, body.Mod);
|
||||
}
|
||||
|
||||
if (body.Config.Signal != null)
|
||||
{
|
||||
SignalBuilder.Make(go, sector, body.Config.Signal, body.Mod);
|
||||
}
|
||||
|
||||
if (body.Config.Funnel != null)
|
||||
{
|
||||
FunnelBuilder.Make(go, go.GetComponentInChildren<ConstantForceDetector>(), rb, body.Config.Funnel);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user