mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add oxygen volumes
This commit is contained in:
parent
c4a256bd20
commit
439eebd2b5
18
NewHorizons/Builder/Volumes/OxygenVolumeBuilder.cs
Normal file
18
NewHorizons/Builder/Volumes/OxygenVolumeBuilder.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Builder.Volumes
|
||||
{
|
||||
public static class OxygenVolumeBuilder
|
||||
{
|
||||
public static OxygenVolume Make(GameObject planetGO, Sector sector, VolumesModule.OxygenVolumeInfo info)
|
||||
{
|
||||
var volume = VolumeBuilder.Make<OxygenVolume>(planetGO, sector, info);
|
||||
|
||||
volume._treeVolume = info.treeVolume;
|
||||
volume._playRefillAudio = info.playRefillAudio;
|
||||
|
||||
return volume;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -92,6 +92,13 @@ namespace NewHorizons.Builder.Volumes
|
||||
DestructionVolumeBuilder.Make(go, sector, destructionVolume);
|
||||
}
|
||||
}
|
||||
if (config.Volumes.oxygenVolumes != null)
|
||||
{
|
||||
foreach (var oxygenVolume in config.Volumes.oxygenVolumes)
|
||||
{
|
||||
OxygenVolumeBuilder.Make(go, sector, oxygenVolume);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
19
NewHorizons/External/Modules/VolumesModule.cs
vendored
19
NewHorizons/External/Modules/VolumesModule.cs
vendored
@ -50,6 +50,11 @@ namespace NewHorizons.External.Modules
|
||||
/// </summary>
|
||||
public NotificationVolumeInfo[] notificationVolumes;
|
||||
|
||||
/// <summary>
|
||||
/// Add oxygen volumes to this planet.
|
||||
/// </summary>
|
||||
public OxygenVolumeInfo[] oxygenVolumes;
|
||||
|
||||
/// <summary>
|
||||
/// Add triggers that reveal parts of the ship log on this planet.
|
||||
/// </summary>
|
||||
@ -319,6 +324,20 @@ namespace NewHorizons.External.Modules
|
||||
[EnumMember(Value = @"crushedByElevator")] CrushedByElevator
|
||||
}
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class OxygenVolumeInfo : VolumeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Does this volume contain trees? This will change the notification from "Oxygen tank refilled" to "Trees detected, oxygen tank refilled".
|
||||
/// </summary>
|
||||
public bool treeVolume;
|
||||
|
||||
/// <summary>
|
||||
/// Whether to play the oxygen tank refill sound or just fill quietly.
|
||||
/// </summary>
|
||||
[DefaultValue(true)] public bool playRefillAudio = true;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user