mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix null item audio types breaking custom items
This commit is contained in:
parent
3270580422
commit
8b49f94bd4
@ -59,10 +59,18 @@ namespace NewHorizons.Builder.Props
|
||||
{
|
||||
item.PickupAudio = AudioTypeHandler.GetAudioType(info.pickupAudio, mod);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.PickupAudio = AudioType.ToolItemWarpCorePickUp;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(info.dropAudio))
|
||||
{
|
||||
item.DropAudio = AudioTypeHandler.GetAudioType(info.dropAudio, mod);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.DropAudio = AudioType.ToolItemWarpCoreDrop;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(info.socketAudio))
|
||||
{
|
||||
item.SocketAudio = AudioTypeHandler.GetAudioType(info.socketAudio, mod);
|
||||
|
||||
@ -90,6 +90,7 @@ namespace NewHorizons.Components.Props
|
||||
|
||||
void PlayCustomSound(AudioType audioType)
|
||||
{
|
||||
if (audioType == AudioType.None) return;
|
||||
if (ItemBuilder.IsCustomItemType(ItemType))
|
||||
{
|
||||
Locator.GetPlayerAudioController()._oneShotExternalSource.PlayOneShot(audioType);
|
||||
|
||||
@ -62,21 +62,25 @@ namespace NewHorizons.External.Modules.Props.Item
|
||||
/// <summary>
|
||||
/// The audio to play when this item is picked up. Only applies to custom/non-vanilla item types.
|
||||
/// Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list.
|
||||
/// Defaults to "ToolItemWarpCorePickUp". Set to "None" to disable the sound entirely.
|
||||
/// </summary>
|
||||
public string pickupAudio;
|
||||
/// <summary>
|
||||
/// The audio to play when this item is dropped. Only applies to custom/non-vanilla item types.
|
||||
/// Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list.
|
||||
/// Defaults to "ToolItemWarpCoreDrop". Set to "None" to disable the sound entirely.
|
||||
/// </summary>
|
||||
public string dropAudio;
|
||||
/// <summary>
|
||||
/// The audio to play when this item is inserted into a socket. Only applies to custom/non-vanilla item types.
|
||||
/// Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list.
|
||||
/// Defaults to the pickup audio. Set to "None" to disable the sound entirely.
|
||||
/// </summary>
|
||||
public string socketAudio;
|
||||
/// <summary>
|
||||
/// The audio to play when this item is removed from a socket. Only applies to custom/non-vanilla item types.
|
||||
/// Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list.
|
||||
/// Defaults to the drop audio. Set to "None" to disable the sound entirely.
|
||||
/// </summary>
|
||||
public string unsocketAudio;
|
||||
/// <summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user