mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Add default resolution to avoid crashing
This commit is contained in:
@ -102,13 +102,18 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<KeyValuePair<string, Size>> getResolutions() =>
|
private IEnumerable<KeyValuePair<string, Size>> getResolutions()
|
||||||
game.Window?.AvailableResolutions?
|
{
|
||||||
.Where(r => r.Width >= 800 && r.Height >= 600)
|
var resolutions = new KeyValuePair<string, Size>("Default", new Size(9999, 9999)).Yield();
|
||||||
.OrderByDescending(r => r.Width)
|
|
||||||
.ThenByDescending(r => r.Height)
|
if (game.Window != null)
|
||||||
.Select(res => new KeyValuePair<string, Size>($"{res.Width}x{res.Height}", new Size(res.Width, res.Height)))
|
resolutions = resolutions.Concat(game.Window.AvailableResolutions
|
||||||
.Distinct()
|
.Where(r => r.Width >= 800 && r.Height >= 600)
|
||||||
.ToList() ?? new KeyValuePair<string, Size>("Default", new Size(9999, 9999)).Yield();
|
.OrderByDescending(r => r.Width)
|
||||||
|
.ThenByDescending(r => r.Height)
|
||||||
|
.Select(res => new KeyValuePair<string, Size>($"{res.Width}x{res.Height}", new Size(res.Width, res.Height)))
|
||||||
|
.Distinct()).ToList();
|
||||||
|
return resolutions;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user