Skip to content

Commit

Permalink
Properly fix solos, and fix Pro Drums/5-lane drums SP/solos/activatio…
Browse files Browse the repository at this point in the history
…ns not showing up (YARC-Official#508)

* Properly fix guitar solos, and fix drum solos too

* Fix Pro/5-lane drums SP/solos/fills not loading
  • Loading branch information
TheNathannator authored Jul 2, 2023
1 parent 83dda42 commit 0513398
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Assets/Script/Obsolete/Data/YargChart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public List<NoteInfo>[] GhDrums

#pragma warning restore format

private List<MoonSong.MoonInstrument> _loadedEvents = new();
private List<string> _loadedEvents = new();

public List<EventInfo> events = new();
public List<Beat> beats = new();
Expand Down Expand Up @@ -251,14 +251,14 @@ private List<NoteInfo>[] LoadArray(ChartLoader<NoteInfo> loader)
notes[(int) diff] = loader.GetNotesFromChart(_song, diff);
}

if (_loadedEvents.Contains(instrument))
if (_loadedEvents.Contains(instrumentName))
{
return notes;
}

events.AddRange(loader.GetEventsFromChart(_song));
events.Sort((e1, e2) => e1.time.CompareTo(e2.time));
_loadedEvents.Add(instrument);
_loadedEvents.Add(instrumentName);

return notes;
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Track/AbstractTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ const float
// Solos and SP cannot share notes, so we can save some iteration time and only go start-to-end once overall
int spNoteIndex = 0;
int soloNoteIndex = 0;
bool chordsAreSingleNote = player.chosenInstrument is "drums" or "realDrums" or "ghDrums";
bool chordsAreSingleNote = player.chosenInstrument is not ("drums" or "realDrums" or "ghDrums");
foreach (var eventInfo in Play.Instance.chart.events)
{
if (eventInfo.name == spName)
Expand Down
6 changes: 6 additions & 0 deletions Assets/Script/Track/DrumsTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,12 @@ private void DrumHitAction(int drum, bool cymbal)
notePool.HitNote(hit);
StopAudio = false;

// Solo stuff
if (soloInProgress)
{
soloNotesHit++;
}

// Play particles
if (hit.fret != kickIndex)
{
Expand Down
12 changes: 6 additions & 6 deletions Assets/Script/Track/FiveFretTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -464,14 +464,14 @@ private void UpdateInput()
StopAudio = false;
lastHitNote = chord;

foreach (var hit in chord)
// Solo stuff
if (soloInProgress)
{
// Solo stuff
if (soloInProgress)
{
soloNotesHit++;
}
soloNotesHit++;
}

foreach (var hit in chord)
{
hitChartIndex++;
// Hit notes
notePool.HitNote(hit);
Expand Down

0 comments on commit 0513398

Please sign in to comment.