Skip to content

Commit

Permalink
Starpower SFX only on multitrack songs. (YARC-Official#699)
Browse files Browse the repository at this point in the history
* Starpower SFX only on multitrack songs.

* PR Comments

---------

Co-authored-by: Vinay Kapadia <[email protected]>
  • Loading branch information
vinaykapadia and Vinay Kapadia authored Feb 21, 2024
1 parent 92676b2 commit a9a47c4
Showing 5 changed files with 44 additions and 10 deletions.
10 changes: 8 additions & 2 deletions Assets/Script/Audio/AudioOptions.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
// using System;
// using System;

namespace YARG.Audio
{
public enum StarPowerFxMode
{
Off,
MultitrackOnly,
On
}

public class AudioOptions
{
public const int WHAMMY_FFT_DEFAULT = 2048;
public const int WHAMMY_OVERSAMPLE_DEFAULT = 8;

public const double MINIMUM_STEM_VOLUME = 0.15;

public bool UseStarpowerFx { get; set; }
public bool UseWhammyFx { get; set; }
public bool IsChipmunkSpeedup { get; set; }

5 changes: 4 additions & 1 deletion Assets/Script/Gameplay/GameManager.Audio.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using YARG.Audio;
using YARG.Core.Audio;
using YARG.Core.Chart;
using YARG.Helpers.Extensions;
@@ -102,7 +103,9 @@ public void ChangeStemMuteState(SongStem stem, bool muted)

public void ChangeStemReverbState(SongStem stem, bool reverb)
{
if (!SettingsManager.Settings.UseStarpowerFx.Value) return;
if (SettingsManager.Settings.UseStarpowerFx.Value == StarPowerFxMode.Off
|| (SettingsManager.Settings.UseStarpowerFx.Value == StarPowerFxMode.MultitrackOnly
&& stem == SongStem.Song)) return;

if (!_stemStates.TryGetValue(stem, out var state)) return;

15 changes: 8 additions & 7 deletions Assets/Script/Settings/SettingsManager.Settings.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
using YARG.Audio;
using YARG.Core.Audio;
using YARG.Gameplay.HUD;
using YARG.Helpers;
@@ -82,7 +83,12 @@ public void OpenCalibrator()
public SliderSetting MicrophoneSensitivity { get; } = new(2f, -50f, 50f);
public ToggleSetting MuteOnMiss { get; } = new(true);

public ToggleSetting UseStarpowerFx { get; } = new(true, UseStarpowerFxChange);
public DropdownSetting<StarPowerFxMode> UseStarpowerFx { get; } = new(StarPowerFxMode.On)
{
StarPowerFxMode.Off,
StarPowerFxMode.MultitrackOnly,
StarPowerFxMode.On
};
public ToggleSetting ClapsInStarpower { get; } = new(true);

// public ToggleSetting UseWhammyFx { get; } = new(true, UseWhammyFxChange);
@@ -354,11 +360,6 @@ private static void MusicPlayerVolumeCallback(float volume)
HelpBar.Instance.MusicPlayer.UpdateVolume();
}

private static void UseStarpowerFxChange(bool value)
{
GlobalVariables.AudioManager.Options.UseStarpowerFx = value;
}

// private static void UseWhammyFxChange(bool value)
// {
// GameManager.AudioManager.Options.UseWhammyFx = value;
12 changes: 12 additions & 0 deletions Assets/Settings/Localization/Settings Shared Data.asset
Original file line number Diff line number Diff line change
@@ -1047,6 +1047,18 @@ MonoBehaviour:
m_Key: Dropdown.StarPowerHighwayFx.Off
m_Metadata:
m_Items: []
- m_Id: 120322696970141696
m_Key: Dropdown.UseStarpowerFx.Off
m_Metadata:
m_Items: []
- m_Id: 120322832085450752
m_Key: Dropdown.UseStarpowerFx.MultitrackOnly
m_Metadata:
m_Items: []
- m_Id: 120322882958163968
m_Key: Dropdown.UseStarpowerFx.On
m_Metadata:
m_Items: []
m_Metadata:
m_Items: []
m_KeyGenerator:
12 changes: 12 additions & 0 deletions Assets/Settings/Localization/Settings_en-US.asset
Original file line number Diff line number Diff line change
@@ -1107,6 +1107,18 @@ MonoBehaviour:
m_Localized: Off
m_Metadata:
m_Items: []
- m_Id: 120322696970141696
m_Localized: Off
m_Metadata:
m_Items: []
- m_Id: 120322832085450752
m_Localized: Multitrack Only
m_Metadata:
m_Items: []
- m_Id: 120322882958163968
m_Localized: On
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []

0 comments on commit a9a47c4

Please sign in to comment.