Skip to content

Commit

Permalink
Launcher resolution list: sorted and defaults to highest (Albeoris#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
snouz authored Jan 27, 2024
1 parent 5d8952c commit 63990b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Memoria.Launcher/Memoria/GameSettingsControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public GameSettingsControl()

AddUiElement(UiTextBlockFactory.Create(Lang.Settings.Resolution), row: 10, col: 0, rowSpan: 3, colSpan: 3).Margin = rowMargin;
UiComboBox resolution = AddUiElement(UiComboBoxFactory.Create(), row: 10, col: 3, rowSpan: 3, colSpan: 5);
resolution.ItemsSource = EnumerateDisplaySettings().ToArray().Reverse();
resolution.ItemsSource = EnumerateDisplaySettings().OrderByDescending(x => Convert.ToInt32(x.Split('x')[0])).ToArray();
resolution.SetBinding(Selector.SelectedItemProperty, new Binding(nameof(ScreenResolution)) {Mode = BindingMode.TwoWay});
resolution.Margin = rowMargin;

Expand Down Expand Up @@ -403,11 +403,11 @@ private void LoadSettings()
try
{
IniFile iniFile = new IniFile(IniPath);
String resolutionBest = EnumerateDisplaySettings().OrderByDescending(x => Convert.ToInt32(x.Split('x')[0])).ToArray()[0];

String value = iniFile.ReadValue("Settings", nameof(ScreenResolution));
if (String.IsNullOrEmpty(value))
value = "1280x960";
_resolution = value;
_resolution = resolutionBest ?? "1280x960";

value = iniFile.ReadValue("Settings", nameof(ActiveMonitor));
if (!String.IsNullOrEmpty(value))
Expand Down

0 comments on commit 63990b6

Please sign in to comment.