Skip to content

Commit

Permalink
Disable SP in practice (#827)
Browse files Browse the repository at this point in the history
* Found an unrelated missing quote in the localization file

* Setting to disable SP phrases in practice mode

* Fixed display of Vocals lyric color when SP is disabled

* Correct setting description
  • Loading branch information
Purplo-cf authored Aug 3, 2024
1 parent a9f3a23 commit 25219eb
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private void SpawnLyricsInPhrase(PhraseNoteTracker tracker, int harmonyIndex)
if (!_lyricContainer.TrySpawnLyric(
tracker.CurrentLyric,
tracker.GetProbableNoteAtLyric(),
tracker.CurrentPhrase.IsStarPower,
AllowStarPower && tracker.CurrentPhrase.IsStarPower,
harmonyIndex))
{
tracker.NextLyric();
Expand Down
4 changes: 4 additions & 0 deletions Assets/Script/Gameplay/Player/Vocals/VocalTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public Range(float min, float max)

public bool HarmonyShowing => _vocalsTrack.Instrument == Instrument.Harmony;

public bool AllowStarPower;

public float CurrentNoteWidth =>
((_currentTrackTop - TRACK_BOTTOM) / (_viewRange.Max - _viewRange.Min)) * NOTE_WIDTH_MULTIPLIER;

Expand Down Expand Up @@ -193,6 +195,8 @@ public void Initialize(VocalsTrack vocalsTrack, YargPlayer primaryPlayer)

// Hide overlay
_starpowerMaterial.SetFloat(_alphaMultiplier, 0f);

AllowStarPower = true;
}

public VocalsPlayer CreatePlayer()
Expand Down
5 changes: 5 additions & 0 deletions Assets/Script/Gameplay/PracticeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using YARG.Core.Input;
using YARG.Gameplay.HUD;
using YARG.Menu.Navigation;
using YARG.Settings;

namespace YARG.Gameplay
{
Expand Down Expand Up @@ -141,10 +142,14 @@ public void SetPracticeSection(uint tickStart, uint tickEnd, double timeStart, d
TimeStart = timeStart;
TimeEnd = timeEnd;

bool allowPracticeSP = SettingsManager.Settings.EnablePracticeSP.Value;
foreach (var player in GameManager.Players)
{
player.SetPracticeSection(tickStart, tickEnd);
player.BaseEngine.AllowStarPower(allowPracticeSP);
}

GameManager.VocalTrack.AllowStarPower = allowPracticeSP;
GameManager.VocalTrack.SetPracticeSection(tickStart, tickEnd);

GameManager.SetSongTime(timeStart);
Expand Down
1 change: 1 addition & 0 deletions Assets/Script/Settings/SettingsManager.Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ public void OpenVenueFolder()

public ToggleSetting ShowHitWindow { get; } = new(false, ShowHitWindowCallback);
public ToggleSetting DisableTextNotifications { get; } = new(false);
public ToggleSetting EnablePracticeSP { get; } = new(false);

public DropdownSetting<NoteStreakFrequencyMode> NoteStreakFrequency { get; }
= new(NoteStreakFrequencyMode.Frequent)
Expand Down
1 change: 1 addition & 0 deletions Assets/Script/Settings/SettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public static partial class SettingsManager
new HeaderMetadata("Other"),
nameof(Settings.ShowHitWindow),
nameof(Settings.DisableTextNotifications),
nameof(Settings.EnablePracticeSP),
nameof(Settings.NoteStreakFrequency),
nameof(Settings.LyricDisplay),
nameof(Settings.SongTimeOnScoreBox),
Expand Down
6 changes: 5 additions & 1 deletion Assets/StreamingAssets/lang/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@
},
"DisableTextNotifications": {
"Name": "Disable Text Notifications",
"Description": "Disables text notification on the track such as \"100-Note Streak\" and \"Full Combo."
"Description": "Disables text notification on the track such as \"100-Note Streak\" and \"Full Combo.\""
},
"DMXBlueChannels": {
"Name": "DMX Blue",
Expand Down Expand Up @@ -535,6 +535,10 @@
"PauseName": "Drums",
"Description": "Adjusts the song's drum track volume. Only does something if the song is multi-track."
},
"EnablePracticeSP": {
"Name": "Star Power in Practice",
"Description": "Allow Star Power phrases while in Practice Mode."
},
"FpsCap": {
"Name": "FPS Cap",
"Description": "The framerate cap. <color=white>YOU DO NOT NEED TO PLAY YARG ON 1000FPS.</color> VSync recommended."
Expand Down

0 comments on commit 25219eb

Please sign in to comment.