@@ -28,6 +28,7 @@ public partial class ChartManager : SubViewportContainer
2828 //Might move this to be song specific? For now, should never go below ~2000, else visual break because there isn't enough room to loop.
2929 private double ChartLength = 5000 ;
3030 private double _loopLen ; //secs
31+ public double TrueBeatsPerLoop ;
3132 public int BeatsPerLoop ;
3233
3334 public void OnNotePressed ( ArrowType type )
@@ -44,7 +45,8 @@ public void PrepChart(SongData songData)
4445 {
4546 _loopLen = songData . SongLength / songData . NumLoops ;
4647 TimeKeeper . LoopLength = ( float ) _loopLen ;
47- BeatsPerLoop = ( int ) ( _loopLen / ( 60f / songData . Bpm ) ) ;
48+ TrueBeatsPerLoop = ( _loopLen / ( 60f / songData . Bpm ) ) ;
49+ BeatsPerLoop = ( int ) TrueBeatsPerLoop ;
4850 ChartLength = ( float ) _loopLen * ( float ) Math . Floor ( ChartLength / _loopLen ) ;
4951 TimeKeeper . ChartLength = ( float ) ChartLength ;
5052 TimeKeeper . Bpm = songData . Bpm ;
@@ -112,7 +114,7 @@ private NoteArrow CreateNote(ArrowType arrow, Note note, int beat = 0)
112114 newArrow . OutlineSprite . Modulate = IH . Arrows [ ( int ) arrow ] . Color ;
113115
114116 _arrowGroup . AddChild ( newArrow ) ;
115- newArrow . Bounds = ( float ) ( ( double ) beat / BeatsPerLoop * ( ChartLength / 2 ) ) ;
117+ newArrow . Bounds = ( float ) ( beat / TrueBeatsPerLoop * ( ChartLength / 2 ) ) ;
116118 newArrow . Position += Vector2 . Right * newArrow . Bounds * 10 ; //temporary fix for notes spawning and instantly calling loop from originating at 0,0
117119 return newArrow ;
118120 }
0 commit comments