Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable SP in practice #827

Merged
merged 4 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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