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)
|
foreach (var destinationDimension in allDimensions)
|
||||||
{
|
{
|
||||||
if (destinationDimension.Signal?.signals == null) continue;
|
if (destinationDimension.Props?.signals == null) continue;
|
||||||
|
|
||||||
var destinationIndex = dimensionNameToIndex[destinationDimension.name];
|
var destinationIndex = dimensionNameToIndex[destinationDimension.name];
|
||||||
if (access[dimensionIndex, destinationIndex])
|
if (access[dimensionIndex, destinationIndex])
|
||||||
{
|
{
|
||||||
_propogatedSignals[dimension.name].AddRange(destinationDimension.Signal.signals);
|
_propogatedSignals[dimension.name].AddRange(destinationDimension.Props.signals);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -212,6 +212,13 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
AudioVolumeBuilder.Make(go, sector, audioVolume, mod);
|
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;
|
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)
|
public static GameObject Make(GameObject planetGO, Sector sector, SignalModule.SignalInfo info, IModBehaviour mod)
|
||||||
{
|
{
|
||||||
var signalGO = new GameObject($"Signal_{info.name}");
|
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")]
|
[Obsolete("Singularity is deprecated, please use Props->singularities")]
|
||||||
public SingularityModule Singularity;
|
public SingularityModule Singularity;
|
||||||
|
|
||||||
|
[Obsolete("Signal is deprecated, please use Props->signals")]
|
||||||
|
public SignalModule Signal;
|
||||||
#endregion Obsolete
|
#endregion Obsolete
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -138,11 +140,6 @@ namespace NewHorizons.External.Configs
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ShipLogModule ShipLog;
|
public ShipLogModule ShipLog;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add signals that can be heard via the signal-scope to this planet
|
|
||||||
/// </summary>
|
|
||||||
public SignalModule Signal;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Spawn the player at this planet
|
/// Spawn the player at this planet
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -342,10 +339,17 @@ namespace NewHorizons.External.Configs
|
|||||||
Props.singularities = Props.singularities.Append(Singularity).ToArray();
|
Props.singularities = Props.singularities.Append(Singularity).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Signal
|
// Signals are now in props
|
||||||
if (Signal?.signals != null)
|
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.audioClip)) signal.audio = signal.audioClip;
|
||||||
if (!string.IsNullOrEmpty(signal.audioFilePath)) signal.audio = signal.audioFilePath;
|
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>
|
/// </summary>
|
||||||
public AudioVolumeInfo[] audioVolumes;
|
public AudioVolumeInfo[] audioVolumes;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add signalscope signals to this planet
|
||||||
|
/// </summary>
|
||||||
|
public SignalModule.SignalInfo[] signals;
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class ScatterInfo
|
public class ScatterInfo
|
||||||
{
|
{
|
||||||
|
|||||||
@ -558,11 +558,6 @@ namespace NewHorizons.Handlers
|
|||||||
PropBuildManager.Make(go, sector, rb, body.Config, body.Mod);
|
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)
|
if (body.Config.Funnel != null)
|
||||||
{
|
{
|
||||||
FunnelBuilder.Make(go, go.GetComponentInChildren<ConstantForceDetector>(), rb, body.Config.Funnel);
|
FunnelBuilder.Make(go, go.GetComponentInChildren<ConstantForceDetector>(), rb, body.Config.Funnel);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user