mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-19 15:02:15 +01:00
Drop the update check - Steam updates the starter
The daily GitHub check, the top-bar button, the stable/staging channel and "check now" go, with their settings and texts.
This commit is contained in:
@@ -260,8 +260,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
VirtualShuntingCb.IsChecked = s.VirtualShunting;
|
||||
LogMissingVehicleFilesCb.IsChecked = s.LogMissingVehicleFiles;
|
||||
DeveloperToolsCb.IsChecked = s.DeveloperTools;
|
||||
CheckUpdatesCb.IsChecked = s.CheckForUpdates;
|
||||
UpdateChannelCb.SelectedIndex = s.UpdateChannel == UpdateChannel.Staging ? 1 : 0;
|
||||
|
||||
RenderEngineCb.SelectedIndex = s.RenderEngine;
|
||||
SelectResolution(s.Width, s.Height);
|
||||
@@ -361,8 +359,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
s.VirtualShunting = IsChecked(VirtualShuntingCb);
|
||||
s.LogMissingVehicleFiles = IsChecked(LogMissingVehicleFilesCb);
|
||||
s.DeveloperTools = IsChecked(DeveloperToolsCb);
|
||||
s.CheckForUpdates = IsChecked(CheckUpdatesCb);
|
||||
s.UpdateChannel = SelectedChannel();
|
||||
|
||||
s.RenderEngine = Math.Max(0, RenderEngineCb.SelectedIndex);
|
||||
ReadResolution(s);
|
||||
@@ -455,36 +451,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
SimulatorSettings.RenderEngines.ElementAtOrDefault(RenderEngineCb.SelectedIndex) == "experimental";
|
||||
}
|
||||
|
||||
private UpdateChannel SelectedChannel() =>
|
||||
UpdateChannelCb.SelectedIndex == 1 ? UpdateChannel.Staging : UpdateChannel.Stable;
|
||||
|
||||
private void UpdateChannelCb_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (UpdateChannelWarning is not null)
|
||||
UpdateChannelWarning.IsVisible = SelectedChannel() == UpdateChannel.Staging;
|
||||
}
|
||||
|
||||
/// <summary>Checks the channel picked in the list, saved or not, so it can be tried first.</summary>
|
||||
private async void CheckUpdatesNowButton_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
var updates = AppServices.Current.Updates;
|
||||
CheckUpdatesNowButton.IsEnabled = false;
|
||||
CheckUpdatesStatus.Text = App.Loc["UpdateChecking"];
|
||||
try
|
||||
{
|
||||
CheckUpdatesStatus.Text = await updates.CheckNowAsync(SelectedChannel()) switch
|
||||
{
|
||||
UpdateCheckOutcome.UpdateAvailable => string.Format(App.Loc["UpdateFound"], updates.Available!.Label),
|
||||
UpdateCheckOutcome.UpToDate => string.Format(App.Loc["UpdateUpToDate"], updates.Current),
|
||||
_ => App.Loc["UpdateCheckFailed"]
|
||||
};
|
||||
}
|
||||
finally
|
||||
{
|
||||
CheckUpdatesNowButton.IsEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void RedrawNavIfNeeded()
|
||||
{
|
||||
bool developer = AppServices.Current.Settings.DeveloperTools;
|
||||
|
||||
Reference in New Issue
Block a user