Skip to content

Commit 3eff6cf

Browse files
committed
Finalizing tweaks
Clean up comments and TODO's Fix ChartLooped getting called multiple times due to modulo of int instead of float
1 parent 9ac9c42 commit 3eff6cf

20 files changed

Lines changed: 37 additions & 44 deletions

File tree

Classes/Notes/Note.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public partial class Note : Resource, IDisplayable
1313
public string Name { get; set; }
1414
private int _baseVal;
1515
public float CostModifier { get; private set; }
16-
private Action<BattleDirector, Note, Timing> NoteEffect; //TODO: Where/How to deal with timing.
16+
private Action<BattleDirector, Note, Timing> NoteEffect;
1717

1818
public string Tooltip { get; set; }
1919
public Texture2D Texture { get; set; }

Classes/Relics/RelicTemplate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ public RelicTemplate(
1616
string name = "",
1717
string tooltip = "",
1818
Texture2D texture = null,
19-
RelicEffect[] EffectTags = null
19+
RelicEffect[] effectTags = null
2020
)
2121
{
2222
Id = id;
23-
Effects = EffectTags;
23+
Effects = effectTags;
2424
Name = name;
2525
Tooltip = tooltip;
2626
Texture = texture;

Globals/StageProducer.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public partial class StageProducer : Node
1010
public static RandomNumberGenerator GlobalRng = new RandomNumberGenerator();
1111
public static bool IsInitialized;
1212

13-
private Stages _curStage = Stages.Title; //TODO: State Machine kinda deal?
13+
private Stages _curStage = Stages.Title;
1414
private Node _curScene;
1515
public static int CurRoom { get; private set; }
1616

@@ -20,7 +20,6 @@ public partial class StageProducer : Node
2020
public static BattleConfig Config;
2121

2222
//Hold here to persist between changes
23-
//TODO: Allow for permanent changes and battle temporary stat changes.
2423
public static PlayerStats PlayerStats;
2524

2625
public static CanvasLayer ContrastFilter;

SaveData/SaveSystem.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private static void LoadConfigData()
106106
VerifyConfig();
107107
if (_curConfigData.Load(UserConfigPath) == Error.Ok)
108108
return;
109-
GD.Print("No config could be found, creating a new one.");
109+
GD.PushWarning("Safe. No config could be found, creating a new one.");
110110
InitConfig();
111111
SaveConfig();
112112
}
@@ -187,8 +187,6 @@ public static void SaveGame()
187187

188188
FileAccess file = FileAccess.Open(UserSavePath, FileAccess.ModeFlags.Write);
189189

190-
GD.Print(json);
191-
192190
file.StoreLine(json);
193191
file.Close();
194192
}
@@ -200,8 +198,6 @@ public static SaveFile LoadGame()
200198
FileAccess file = FileAccess.Open(UserSavePath, FileAccess.ModeFlags.Read);
201199
string json = file.GetAsText();
202200

203-
GD.Print(json);
204-
205201
file.Close();
206202
SaveFile sv;
207203
try

scenes/BattleDirector/scripts/BattleDirector.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @brief Higher priority director to manage battle effects. Can directly access managers, which should signal up to Director WIP
1111
*/
1212
public partial class BattleDirector : Node2D
13-
{ //TODO: Maybe move some Director functionality to a sub node.
13+
{
1414
#region Declarations
1515

1616
public PlayerPuppet Player;
@@ -70,7 +70,6 @@ public PuppetTemplate GetTarget(Note note)
7070
#region Initialization
7171
public override void _Ready()
7272
{
73-
//TODO: Should come from transition into battle
7473
_curSong = StageProducer.Config.CurSong.SongData;
7574
Audio.SetStream(GD.Load<AudioStream>(StageProducer.Config.CurSong.AudioLocation));
7675
if (_curSong.SongLength <= 0)
@@ -110,7 +109,6 @@ public override void _Ready()
110109
};
111110
}
112111

113-
//TODO: This will all change
114112
private void Begin()
115113
{
116114
CM.BeginTweens();
@@ -127,10 +125,13 @@ public override void _Process(double delta)
127125
{
128126
_focusedButton?.GrabFocus();
129127
TimeKeeper.CurrentTime = Audio.GetPlaybackPosition();
130-
double realBeat = TimeKeeper.CurrentTime / (60 / (double)TimeKeeper.Bpm) % CM.BeatsPerLoop;
128+
double realBeat =
129+
TimeKeeper.CurrentTime / (60 / (double)TimeKeeper.Bpm) % CM.TrueBeatsPerLoop;
131130
CD.CheckMiss(realBeat);
132131
if (realBeat < _lastBeat)
132+
{
133133
ChartLooped?.Invoke(this);
134+
}
134135
_lastBeat = realBeat;
135136
}
136137
#endregion

scenes/BattleDirector/scripts/Conductor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public override void _Ready()
7070
MM = new MidiMaestro(StageProducer.Config.CurSong.MIDILocation);
7171
}
7272

73-
public void Prep() //TODO: Streamline battle initialization
73+
public void Prep()
7474
{
7575
_laneData = new NoteArrow[][]
7676
{
@@ -79,10 +79,10 @@ public void Prep() //TODO: Streamline battle initialization
7979
new NoteArrow[CM.BeatsPerLoop],
8080
new NoteArrow[CM.BeatsPerLoop],
8181
};
82-
AddExampleNotes();
82+
AddInitialNotes();
8383
}
8484

85-
private void AddExampleNotes()
85+
private void AddInitialNotes()
8686
{
8787
foreach (ArrowType type in Enum.GetValues(typeof(ArrowType)))
8888
{

scenes/BattleDirector/scripts/NotePlacementBar.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ public Note PlacedNote(BattleDirector BD)
192192
_currentBarValue -= (int)(_currentNoteInstance.CostModifier * MaxValue);
193193

194194
UpdateNotePlacementBar(_currentBarValue);
195-
//fullBarParticles.Emitting = false;
196195

197196
Note placedNote = GetNote(Input.IsActionPressed("Secondary"));
198197
placedNote?.OnHit(BD, Timing.Okay); //Hardcode for now, eventually the note itself could have its default

scenes/ChartViewport/scripts/ChartManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public NoteArrow AddArrowToLane(
9595
Color colorOverride = default
9696
)
9797
{
98-
var newNote = CreateNote(type, note, beat); //TODO: Notes on track have unqiue visuals
98+
var newNote = CreateNote(type, note, beat);
9999
var loopArrow = CreateNote(type, note, beat, 1); //Create a dummy arrow for looping visuals
100100
if (colorOverride != default)
101101
{

scenes/ChartViewport/scripts/HitParticles.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ public void Emit(int particleAmount)
1111

1212
// Stop particles after a short delay using a Timer
1313
Timer timer = new Timer();
14-
timer.WaitTime = 0.25f; // Stop emitting after 0.5 seconds
14+
timer.WaitTime = 0.25f;
1515
timer.OneShot = true;
1616
timer.Timeout += () =>
1717
{
1818
Emitting = false;
19-
timer.QueueFree(); // Clean up the timer
19+
timer.QueueFree();
2020
};
2121

2222
AddChild(timer);

scenes/ChartViewport/scripts/Loopable.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public partial class Loopable : Sprite2D
1010
[Export]
1111
public float LoopOffset = 700f; //px Pos to loop or do something at.
1212

13-
// Called every frame. 'delta' is the elapsed time since the previous frame.
1413
public override void _Process(double delta)
1514
{
1615
Vector2 newPos = Position;

0 commit comments

Comments
 (0)