Skip to content

Commit 4820f7c

Browse files
committed
Compatibility with Dash Count Mod total / fewest dash count in journal
1 parent 6b98717 commit 4820f7c

File tree

4 files changed

+37
-20
lines changed

4 files changed

+37
-20
lines changed

UI/OuiJournalCollabProgressDashCountMod.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,17 @@ static class OuiJournalCollabProgressDashCountMod {
1111
internal static bool IsDashCountEnabled() {
1212
return false;
1313
}
14+
15+
// those depend on Dash Count Mod settings / save data, and will be implemented by Dash Count Mod itself.
16+
17+
[MethodImpl(MethodImplOptions.NoInlining)]
18+
internal static bool DisplaysTotalDashes() {
19+
return false;
20+
}
21+
22+
[MethodImpl(MethodImplOptions.NoInlining)]
23+
internal static int GetLevelDashesForJournalProgress(AreaStats stats) {
24+
return stats.BestTotalDashes;
25+
}
1426
}
1527
}

UI/OuiJournalCollabProgressInLobby.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ public static List<OuiJournalCollabProgressInLobby> GeneratePages(OuiJournal jou
185185
}
186186

187187
if (OuiJournalCollabProgressDashCountMod.IsDashCountEnabled()) {
188-
if (item.Modes[0].SingleRunCompleted) {
189-
row.Add(new TextCell(Dialog.Deaths(item.Modes[0].BestDashes), currentPage.TextJustify, 0.5f, currentPage.TextColor));
190-
sumOfBestDashes += item.Modes[0].BestDashes;
188+
if ((OuiJournalCollabProgressDashCountMod.DisplaysTotalDashes() && item.TotalTimePlayed > 0) || item.Modes[0].SingleRunCompleted) {
189+
row.Add(new TextCell(Dialog.Deaths(OuiJournalCollabProgressDashCountMod.GetLevelDashesForJournalProgress(item)),
190+
currentPage.TextJustify, 0.5f, currentPage.TextColor));
191+
sumOfBestDashes += OuiJournalCollabProgressDashCountMod.GetLevelDashesForJournalProgress(item);
191192
} else {
192193
row.Add(new IconCell("dot"));
193194
}
@@ -252,7 +253,8 @@ public static List<OuiJournalCollabProgressInLobby> GeneratePages(OuiJournal jou
252253
.Add(new TextCell(allLevelsDone ? Dialog.Deaths(sumOfBestDeaths) : "-", currentPage.TextJustify, 0.6f, currentPage.TextColor));
253254

254255
if (OuiJournalCollabProgressDashCountMod.IsDashCountEnabled()) {
255-
totalsRow.Add(new TextCell(allLevelsDone ? Dialog.Deaths(sumOfBestDashes) : "-", currentPage.TextJustify, 0.6f, currentPage.TextColor));
256+
totalsRow.Add(new TextCell(OuiJournalCollabProgressDashCountMod.DisplaysTotalDashes() || allLevelsDone ? Dialog.Deaths(sumOfBestDashes) : "-",
257+
currentPage.TextJustify, 0.6f, currentPage.TextColor));
256258
}
257259

258260
totalsRow

UI/OuiJournalCollabProgressInOverworld.cs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public OuiJournalCollabProgressInOverworld(OuiJournal journal)
8282
int lobbyTotalStrawberries = areaData.Mode[0].TotalStrawberries;
8383
int lobbyDeaths = item.Modes[0].Deaths;
8484
int lobbySumOfBestDeaths = 0;
85-
int lobbySumOfBestDashes = 0;
85+
int lobbySumOfBestDashes = OuiJournalCollabProgressDashCountMod.DisplaysTotalDashes() ? OuiJournalCollabProgressDashCountMod.GetLevelDashesForJournalProgress(item) : 0;
8686
long lobbyTotalTime = item.TotalTimePlayed;
8787
long lobbySumOfBestTimes = 0;
8888
bool lobbyLevelsDone = true;
@@ -125,7 +125,7 @@ public OuiJournalCollabProgressInOverworld(OuiJournal journal)
125125
lobbySumOfBestDeaths += lobbyMap.Modes[0].BestDeaths;
126126
}
127127

128-
lobbySumOfBestDashes += lobbyMap.Modes[0].BestDashes;
128+
lobbySumOfBestDashes += OuiJournalCollabProgressDashCountMod.GetLevelDashesForJournalProgress(lobbyMap);
129129

130130
if (!lobbyMap.Modes[0].HeartGem) {
131131
lobbyLevelsDone = false;
@@ -174,22 +174,24 @@ public OuiJournalCollabProgressInOverworld(OuiJournal journal)
174174
} else {
175175
row.Add(new IconCell("dot"));
176176
}
177-
178-
if (OuiJournalCollabProgressDashCountMod.IsDashCountEnabled()) {
179-
if (lobbyMapLevelSet == null) {
180-
row.Add(new TextCell(Dialog.Deaths(item.Modes[0].BestDashes), TextJustify, 0.5f, TextColor));
181-
sumOfBestDashes += item.Modes[0].BestDashes;
182-
} else if (lobbyAllMapsCompletedInSingleRun) {
183-
row.Add(new TextCell(Dialog.Deaths(lobbySumOfBestDashes), TextJustify, 0.5f, TextColor));
184-
} else {
185-
row.Add(new IconCell("dot"));
186-
}
187-
}
188177
} else {
189178
row.Add(new IconCell("dot"));
190179
allLevelsDone = false;
180+
}
191181

192-
if (OuiJournalCollabProgressDashCountMod.IsDashCountEnabled()) {
182+
183+
if (OuiJournalCollabProgressDashCountMod.IsDashCountEnabled()) {
184+
if (lobbyMapLevelSet == null) {
185+
if ((OuiJournalCollabProgressDashCountMod.DisplaysTotalDashes() && item.TotalTimePlayed > 0) || item.Modes[0].SingleRunCompleted) {
186+
row.Add(new TextCell(Dialog.Deaths(OuiJournalCollabProgressDashCountMod.GetLevelDashesForJournalProgress(item)),
187+
TextJustify, 0.5f, TextColor));
188+
sumOfBestDashes += OuiJournalCollabProgressDashCountMod.GetLevelDashesForJournalProgress(item);
189+
} else {
190+
row.Add(new IconCell("dot"));
191+
}
192+
} else if ((OuiJournalCollabProgressDashCountMod.DisplaysTotalDashes() && item.TotalTimePlayed > 0) || lobbyAllMapsCompletedInSingleRun) {
193+
row.Add(new TextCell(Dialog.Deaths(lobbySumOfBestDashes), TextJustify, 0.5f, TextColor));
194+
} else {
193195
row.Add(new IconCell("dot"));
194196
}
195197
}
@@ -238,7 +240,8 @@ public OuiJournalCollabProgressInOverworld(OuiJournal journal)
238240
.Add(new TextCell(allLevelsDone && allMapsCompletedInSingleRun ? Dialog.Deaths(sumOfBestDeaths) : "-", TextJustify, 0.6f, TextColor));
239241

240242
if (OuiJournalCollabProgressDashCountMod.IsDashCountEnabled()) {
241-
totalsRow.Add(new TextCell(allLevelsDone && allMapsCompletedInSingleRun ? Dialog.Deaths(sumOfBestDashes) : "-", TextJustify, 0.6f, TextColor));
243+
totalsRow.Add(new TextCell(OuiJournalCollabProgressDashCountMod.DisplaysTotalDashes() || (allLevelsDone && allMapsCompletedInSingleRun) ?
244+
Dialog.Deaths(sumOfBestDashes) : "-", TextJustify, 0.6f, TextColor));
242245
}
243246

244247
totalsRow

everest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
- Name: CollabUtils2
2-
Version: 1.6.9
2+
Version: 1.6.10
33
DLL: bin/Debug/net452/CollabUtils2.dll
44
Dependencies:
55
- Name: Everest

0 commit comments

Comments
 (0)