Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ConsistencyTrackerSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2415,6 +2415,8 @@ public void CreateFAQEntry(TextMenu menu, bool inGame) {
public ButtonBinding ButtonAddRoomSuccess { get; set; }
public ButtonBinding ButtonRemoveRoomLastAttempt { get; set; }
public ButtonBinding ButtonRemoveRoomDeathStreak { get; set; }

public ButtonBinding ButtonRemoveLastGoldenBerryDeath { get; set; }

public ButtonBinding ButtonImportCustomRoomNameFromClipboard { get; set; }

Expand Down
4 changes: 4 additions & 0 deletions Entities/TextOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ public override void Update() {
Mod.Log($"Couldn't import custom room name from clipboard: {ex}");
}
}

if(Mod.ModSettings.ButtonRemoveLastGoldenBerryDeath.Pressed) {
Mod.CurrentChapterStats.RemoveLastGoldenBerryDeath();
}
}

public void InitStatTextOptions() {
Expand Down
14 changes: 14 additions & 0 deletions Models/ChapterStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ public void AddGoldenBerryDeath(string debugRoomName=null) {
rStats.GoldenBerryDeathsSession++;
}

public void RemoveLastGoldenBerryDeath() {
if (LastGoldenRuns.Count < 1) {
ConsistencyTrackerModule.Instance.Log($"No golden death to delete");
return;
}

RoomStats rStats = Rooms[LastGoldenRuns.Last()];

LastGoldenRuns.RemoveAt(LastGoldenRuns.Count - 1);
rStats.GoldenBerryDeaths--;
rStats.GoldenBerryDeathsSession--;
ConsistencyTrackerModule.Instance.Log($"Deleted last golden death");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to call SaveChapterStats() to save it and cause the stats to be updated im decently sure

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the stats do update without calling it from testing, the only thing that doesn't update immediately is the in game text overlay but that refreshes on any death/room transition (not that i am against refreshing that instantly)

}

public void CollectedGolden(GoldenType type) {
GoldenCollectedCount++;
GoldenCollectedCountSession++;
Expand Down