Skip to content

Commit

Permalink
Non-activator notes are no longer purple
Browse files Browse the repository at this point in the history
* Non-activator notes in a fill segment are no longer highlighted purple.

* To allow for this, a new overload for NoteComponent.SetInfo has been created.
  • Loading branch information
EscapeNumber001 committed Apr 17, 2023
1 parent bfdde33 commit 93c7fc8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Assets/Script/PlayMode/DrumsTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ private void SpawnNote(NoteInfo noteInfo, float time) {

// Set note info
var noteComp = notePool.AddNote(noteInfo, pos);
noteComp.SetInfo(drumColors[noteInfo.fret], noteInfo.length, model);
noteComp.SetInfo(drumColors[noteInfo.fret], noteInfo.length, model, noteInfo.isActivator);
}
}
}
12 changes: 10 additions & 2 deletions Assets/Script/Pools/NoteComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private Color ColorCache {
}

// DEBUG: Temporary test code
if (pool.player.track.FillSection?.EndTime > pool.player.track.RelativeTime && pool.player.track.starpowerCharge >= 0.5f) {
if (isActivatorNote) {
return Color.magenta;
}

Expand All @@ -51,6 +51,8 @@ private Color ColorCache {

private State state = State.WAITING;

private bool isActivatorNote;

private void OnEnable() {
if (pool != null) {
pool.player.track.StarpowerMissEvent += UpdateColor;
Expand All @@ -63,7 +65,7 @@ private void OnDisable() {
}
}

public void SetInfo(Color c, float length, ModelType hopo) {
public void SetInfo(Color c, float length, ModelType hopo, bool isDrumActivator) {
noteGroup.SetActive(hopo == ModelType.NOTE);
hopoGroup.SetActive(hopo == ModelType.HOPO);
fullGroup.SetActive(hopo == ModelType.FULL);
Expand All @@ -72,10 +74,16 @@ public void SetInfo(Color c, float length, ModelType hopo) {

SetLength(length);

isActivatorNote = isDrumActivator;

ColorCache = c;
UpdateColor();
}

public void SetInfo(Color c, float length, ModelType hopo) {
SetInfo(c, length, hopo, false);
}

public void SetFretNumber(string str) {
fretNumber.gameObject.SetActive(true);
fretNumber.text = str;
Expand Down

0 comments on commit 93c7fc8

Please sign in to comment.