mirror of https://github.com/ppy/osu
Use DisplayModes rather than AvailableResolutions
This commit is contained in:
parent
e012af6616
commit
2fec8b7b85
|
@ -209,15 +209,16 @@ private void showPreview()
|
||||||
private IReadOnlyList<Size> getResolutions()
|
private IReadOnlyList<Size> getResolutions()
|
||||||
{
|
{
|
||||||
var resolutions = new List<Size> { new Size(9999, 9999) };
|
var resolutions = new List<Size> { new Size(9999, 9999) };
|
||||||
|
var currentDisplay = game.Window?.CurrentDisplay.Value;
|
||||||
|
|
||||||
if (game.Window != null)
|
if (currentDisplay != null)
|
||||||
{
|
{
|
||||||
resolutions.AddRange(game.Window.AvailableResolutions
|
resolutions.AddRange(currentDisplay.DisplayModes
|
||||||
.Where(r => r.Width >= 800 && r.Height >= 600)
|
.Where(m => m.Size.Width >= 800 && m.Size.Height >= 600)
|
||||||
.OrderByDescending(r => r.Width)
|
.OrderByDescending(m => m.Size.Width)
|
||||||
.ThenByDescending(r => r.Height)
|
.ThenByDescending(m => m.Size.Height)
|
||||||
.Select(res => new Size(res.Width, res.Height))
|
.Select(m => m.Size)
|
||||||
.Distinct());
|
.Distinct());
|
||||||
}
|
}
|
||||||
|
|
||||||
return resolutions;
|
return resolutions;
|
||||||
|
|
Loading…
Reference in New Issue