20 lines
541 B
C#
20 lines
541 B
C#
using ReLogic.Utilities;
|
|
using Terraria.Audio;
|
|
|
|
namespace CalamityMod.UI.DialogueDisplay.DialogueEvents
|
|
{
|
|
public class SoundEvent : DialogueEvent
|
|
{
|
|
SoundStyle style;
|
|
SlotId soundSlot;
|
|
|
|
public override void UpdateEvent()
|
|
{
|
|
if (EventCounter == 0)
|
|
soundSlot = SoundEngine.PlaySound(style = new SoundStyle(Args[0]));
|
|
else if (!SoundEngine.TryGetActiveSound(soundSlot, out var result) || result.Style != style)
|
|
EventOver = true;
|
|
}
|
|
}
|
|
}
|