mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 07:23:14 +08:00
Merge pull request #8623 from swoolcock/display-modes
Use DisplayModes rather than AvailableResolutions
This commit is contained in:
commit
078e633459
@ -52,6 +52,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.427.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.421.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.501.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -209,15 +209,16 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
private IReadOnlyList<Size> getResolutions()
|
||||
{
|
||||
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
|
||||
.Where(r => r.Width >= 800 && r.Height >= 600)
|
||||
.OrderByDescending(r => r.Width)
|
||||
.ThenByDescending(r => r.Height)
|
||||
.Select(res => new Size(res.Width, res.Height))
|
||||
.Distinct());
|
||||
resolutions.AddRange(currentDisplay.DisplayModes
|
||||
.Where(m => m.Size.Width >= 800 && m.Size.Height >= 600)
|
||||
.OrderByDescending(m => m.Size.Width)
|
||||
.ThenByDescending(m => m.Size.Height)
|
||||
.Select(m => m.Size)
|
||||
.Distinct());
|
||||
}
|
||||
|
||||
return resolutions;
|
||||
|
@ -23,7 +23,7 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.421.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.501.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.427.0" />
|
||||
<PackageReference Include="Sentry" Version="2.1.1" />
|
||||
<PackageReference Include="SharpCompress" Version="0.25.0" />
|
||||
|
@ -70,7 +70,7 @@
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.421.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.501.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.427.0" />
|
||||
</ItemGroup>
|
||||
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
||||
@ -80,7 +80,7 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.421.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.501.0" />
|
||||
<PackageReference Include="SharpCompress" Version="0.25.0" />
|
||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||
|
Loading…
Reference in New Issue
Block a user