Skip to content

Commit faed662

Browse files
committed
Fix chapter panel display issue if a speed berry PB is registered and the level wasn't beaten
1 parent b65245f commit faed662

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

UI/InGameOverworldHelper.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,14 @@ private static bool OnSaveDataFoundAnyCheckpoints(On.Celeste.SaveData.orig_Found
187187
}
188188

189189
private static int OnChapterPanelGetModeHeight(On.Celeste.OuiChapterPanel.orig_GetModeHeight orig, OuiChapterPanel self) {
190+
// force the chapter panel to be bigger if deaths > 0 (we force deaths to display even if the player didn't beat the map) or if there is a speed berry PB,
191+
// because in these cases we have stuff to display in the chapter panel, and vanilla wouldn't display anything.
190192
AreaModeStats areaModeStats = self.RealStats.Modes[(int) self.Area.Mode];
191-
if (Engine.Scene == overworldWrapper?.Scene && areaModeStats.Deaths > 0 && !AreaData.Get(self.Area).Interlude_Safe)
192-
return 540;
193+
if (Engine.Scene == overworldWrapper?.Scene && !AreaData.Get(self.Area).Interlude_Safe
194+
&& (areaModeStats.Deaths > 0 || CollabModule.Instance.SaveData.SpeedBerryPBs.ContainsKey(self.Area.GetSID()))) {
195+
196+
return 540;
197+
}
193198

194199
return orig(self);
195200
}

0 commit comments

Comments
 (0)