Safer handling of NONE

This commit is contained in:
Henrik Rydgård committed 2023-08-01 00:28:54 +02:00
1 parent 3563d625b9
commit a28ae79ef7
2 files changed
+6

No files matched your search

+2
View File
@@ -171,6 +171,8 @@ void OnScreenDisplay::ShowLeaderboardTracker(int leaderboardTrackerID, const cha
if (show) {
// Just an update.
entry.text = trackerText ? trackerText : "";
// Bump the end-time, in case it was fading out.
entry.endTime = now + forever_s;
} else {
// Keep the current text, hide and eventually delete it.
entry.endTime = now + (double)FadeoutTime();
+4
View File
@@ -281,6 +281,10 @@ void OnScreenMessagesView::Draw(UIContext &dc) {
auto &measuredEntry = measuredEntries[i];
ScreenEdgePosition pos = typeEdges[(size_t)entry.type];
if (pos == ScreenEdgePosition::VALUE_COUNT) {
// NONE.
continue;
}
measuredEntry.align = 0;
measuredEntry.align2 = 0;