Skip to content

Commit

Permalink
feat: add gui sound when interacting with prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
Trap committed Dec 28, 2024
1 parent 935681f commit 66400c4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
42 changes: 42 additions & 0 deletions PTT-Plugin/Helpers/Sound.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using Comfort.Common;
using EFT.UI;

namespace PTT.Helpers;

internal static class Sound
{
static public void PlayMenuEnter()
{

Singleton<GUISounds>.Instance.PlayUISound(EUISoundType.MenuCheckBox);
// alternative sound
// Singleton<GUISounds>.Instance.PlayUISound(EUISoundType.MenuCheckBox);
}

static public void PlayMenuCancel()
{
Singleton<GUISounds>.Instance.PlayUISound(EUISoundType.MenuDropdownSelect);

// alternative sound
// Singleton<GUISounds>.Instance.PlayUISound(EUISoundType.MenuContextMenu);
// Singleton<GUISounds>.Instance.PlayUISound(EUISoundType.MenuEscape);
}

static public void PlayExtractConfirm()
{
Singleton<GUISounds>.Instance.PlayUISound(EUISoundType.ChatSelect);

// alternative sound
// Singleton<GUISounds>.Instance.PlayUISound(EUISoundType.MenuInspectorWindowOpen);
// Singleton<GUISounds>.Instance.PlayUISound(EUISoundType.ButtonClick);
}

static public void PlayTransitConfirm()
{
Singleton<GUISounds>.Instance.PlayUISound(EUISoundType.ChatSelect);

// alternative sound
// Singleton<GUISounds>.Instance.PlayUISound(EUISoundType.MenuInspectorWindowOpen);
// Singleton<GUISounds>.Instance.PlayUISound(EUISoundType.ButtonClick);
}
}
4 changes: 4 additions & 0 deletions PTT-Plugin/Services/ExfilPromptService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using System.Collections.Generic;
using PTT.Data;
using PTT.Helpers;
using Comfort.Common;
using EFT.UI;

namespace PTT.Services;

Expand Down Expand Up @@ -33,11 +35,13 @@ private CustomExfilAction CreateCustomExfilAction(ExfiltrationPoint exfil, Exfil
case true:
return new CustomExfilAction(customActionName, false, () =>
{
Sound.PlayTransitConfirm();
CustomExfilService.TransitTo(exfil, exfilTarget);
});
case false:
return new CustomExfilAction(customActionName, false, () =>
{
Sound.PlayExtractConfirm();
CustomExfilService.ExtractTo(exfil, exfilTarget);
});
}
Expand Down

0 comments on commit 66400c4

Please sign in to comment.