Skip to content

Commit

Permalink
Coop Guitar/Rhythm again (#143)
Browse files Browse the repository at this point in the history
* Coop Guitar and Rhythm.

* Coop Guitar and Rhythm.

* update icons
  • Loading branch information
NarrikSynthfox authored Apr 20, 2023
1 parent 4474619 commit b13538c
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 36 deletions.
4 changes: 2 additions & 2 deletions Assets/Art/UI/FontSprites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 71 additions & 27 deletions Assets/Art/UI/FontSprites.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Assets/Script/Data/Chart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public sealed class Chart {
#pragma warning disable format

public List<NoteInfo>[] guitar = CreateArray();
public List<NoteInfo>[] guitar_coop = CreateArray();
public List<NoteInfo>[] rhythm = CreateArray();
public List<NoteInfo>[] bass = CreateArray();
public List<NoteInfo>[] keys = CreateArray();
public List<NoteInfo>[] realGuitar = CreateArray();
Expand Down Expand Up @@ -39,13 +41,15 @@ public sealed class Chart {

public Chart() {
allParts = new() {
guitar, bass, keys, realGuitar, realBass, drums, realDrums, ghDrums
guitar, guitar_coop, rhythm,bass, keys, realGuitar, realBass, drums, realDrums, ghDrums
};
}

public List<NoteInfo>[] GetChartByName(string name) {
return name switch {
"guitar" => guitar,
"guitar_coop" => guitar_coop,
"rhythm" => rhythm,
"bass" => bass,
"keys" => keys,
"realGuitar" => realGuitar,
Expand Down
2 changes: 2 additions & 0 deletions Assets/Script/Data/SongInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public enum DrumType
private static readonly Dictionary<string, int> DEFAULT_DIFFS = new()
{
{ "guitar", -1 },
{ "guitar_coop", -1 },
{ "rhythm", -1 },
{ "bass", -1 },
{ "keys", -1 },
{ "drums", -1 },
Expand Down
2 changes: 2 additions & 0 deletions Assets/Script/Input/FiveFretInputStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ public override void UpdateNavigationMode() {
public override string[] GetAllowedInstruments() {
return new string[] {
"guitar",
"guitar_coop",
"rhythm",
"bass",
"keys"
};
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/PlayMode/AbstractTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ private void UpdateInfo() {
}

// Update solo note count
if (Play.Instance.SongTime >= SoloSection?.time - 5 && Play.Instance.SongTime <= SoloSection?.time) {
if (Play.Instance.SongTime >= SoloSection?.time - 2 && Play.Instance.SongTime <= SoloSection?.time) {
soloNoteCount = 0;

for (int i = hitChartIndex; i < Chart.Count; i++) {
Expand Down
4 changes: 3 additions & 1 deletion Assets/Script/PlayMode/FiveFretTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ public override void SetReverb(bool on) {
case "guitar":
Play.Instance.ReverbAudio("guitar", on);
break;
case "rhythm":
Play.Instance.ReverbAudio("rhythm", on);
break;
case "bass":
Play.Instance.ReverbAudio("bass", on);
Play.Instance.ReverbAudio("rhythm", on);
break;
case "keys":
Play.Instance.ReverbAudio("keys", on);
Expand Down
7 changes: 5 additions & 2 deletions Assets/Script/PlayMode/Play.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,17 @@ private void Update() {
}, new string[] {
"guitar"
});

UpdateAudio(new string[] {
"rhythm",
}, new string[] {
"rhythm"
});
// Mute bass
UpdateAudio(new string[] {
"bass",
"realBass"
}, new string[] {
"bass",
"rhythm"
});

// Mute keys
Expand Down
15 changes: 14 additions & 1 deletion Assets/Script/Serialization/Parser/MidiParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,20 @@ public override void Parse(Chart chart) {
ParseStarpower(eventIR, trackChunk, "guitar");
ParseSolo(eventIR, trackChunk, "guitar");
break;
case "PART GUITAR COOP":
for (int i = 0; i < 4; i++) {
chart.guitar_coop[i] = ParseFiveFret(trackChunk, i);
}
ParseStarpower(eventIR, trackChunk, "guitar_coop");
ParseSolo(eventIR, trackChunk, "guitar_coop");
break;
case "PART RHYTHM":
for (int i = 0; i < 4; i++) {
chart.rhythm[i] = ParseFiveFret(trackChunk, i);
}
ParseStarpower(eventIR, trackChunk, "rhythm");
ParseSolo(eventIR, trackChunk, "rhythm");
break;
case "PART BASS":
for (int i = 0; i < 4; i++) {
chart.bass[i] = ParseFiveFret(trackChunk, i);
Expand Down Expand Up @@ -355,7 +369,6 @@ private void ParseSolo(List<EventIR> eventIR, TrackChunk trackChunk, string inst
}
}
}

private SongInfo.DrumType GetDrumType(TrackChunk trackChunk) {
if (songInfo.drumType != SongInfo.DrumType.UNKNOWN) {
return songInfo.drumType;
Expand Down
2 changes: 2 additions & 0 deletions Assets/Script/ThirdParty/DiscordController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ private void OnInstrumentSelection(YARG.PlayerManager.Player playerInfo) {
"realDrums" => "Really working the skins",
"ghDrums" => "Working the skins +1",
"guitar" => "Making it talk",
"guitar_coop" => "GTR_COOP_PLACEHOLDER",
"rhythm" => "RHYTHM_PLACEHOLDER",
"realGuitar" => "Really making it talk",
"bass" => "In the groove",
"realBass" => "Really in the groove",
Expand Down
4 changes: 3 additions & 1 deletion Assets/Script/UI/DifficultySelect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,16 @@ private void UpdateInstrument() {
"drums" => "Drums",
"realDrums" => "Pro Drums",
"guitar" => "Guitar",
"realGuitar" => "Pro Guitar",
"guitar_coop" => "Coop Guitar",
"bass" => "Bass",
"realBass" => "Pro Bass",
"keys" => "Keys",
"realKeys" => "Pro Keys",
"vocals" => "Vocals",
"harmVocals" => "Vocals (Harmony)",
"ghDrums" => "Drums (5-lane)",
"rhythm" => "Rhythm",
"realGuitar" => "Pro Guitar",
_ => "Unknown"
};
}
Expand Down
2 changes: 2 additions & 0 deletions Assets/Script/UI/SelectedSongView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public void UpdateSongView(SongInfo songInfo) {
"realKeys",
"harmVocals",
null,
"guitar_coop",
"rhythm",
"ghDrums"
};

Expand Down

0 comments on commit b13538c

Please sign in to comment.