diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index aa49a450b2..b9a13ac368 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -1301,10 +1301,17 @@ namespace osu.Game applyConfigMigrations(); + string lastVersion = LocalConfig.Get(OsuSetting.Version); + string version = Version; + + // only show a notification if we've previously saved a version to the config file (ie. not the first run). + if (IsDeployedBuild && !string.IsNullOrEmpty(lastVersion) && version != lastVersion) + Notifications.Post(new UpdateCompleteNotification(version)); + // finally, update the version stored to the configuration. // this MUST happen after `applyConfigMigrations()` call, as it relies on comparing the previous version. // debug / local compilations will reset to a non-release string. - LocalConfig.SetValue(OsuSetting.Version, Version); + LocalConfig.SetValue(OsuSetting.Version, version); } /// diff --git a/osu.Game/Updater/UpdateManager.cs b/osu.Game/Updater/UpdateManager.cs index 1db509bd52..091fe7061f 100644 --- a/osu.Game/Updater/UpdateManager.cs +++ b/osu.Game/Updater/UpdateManager.cs @@ -56,15 +56,8 @@ namespace osu.Game.Updater { base.LoadComplete(); - string version = game.Version; - string lastVersion = config.Get(OsuSetting.Version); - if (game.IsDeployedBuild) { - // only show a notification if we've previously saved a version to the config file (ie. not the first run). - if (!string.IsNullOrEmpty(lastVersion) && version != lastVersion) - Notifications.Post(new UpdateCompleteNotification(version)); - // make sure the release stream setting matches the build which was just run. if (FixedReleaseStream != null) config.SetValue(OsuSetting.ReleaseStream, FixedReleaseStream.Value); @@ -137,31 +130,6 @@ namespace osu.Game.Updater updateCancellationSource.Dispose(); } - private partial class UpdateCompleteNotification : SimpleNotification - { - private readonly string version; - - public UpdateCompleteNotification(string version) - { - this.version = version; - Text = NotificationsStrings.GameVersionAfterUpdate(version); - } - - [BackgroundDependencyLoader] - private void load(OsuColour colours, ChangelogOverlay changelog, INotificationOverlay notificationOverlay) - { - Icon = FontAwesome.Solid.CheckSquare; - IconContent.Colour = colours.BlueDark; - - Activated = delegate - { - notificationOverlay.Hide(); - changelog.ShowBuild(version); - return true; - }; - } - } - public partial class UpdateDownloadProgressNotification : ProgressNotification { private readonly CancellationToken cancellationToken; @@ -259,4 +227,29 @@ namespace osu.Game.Updater } } } + + public partial class UpdateCompleteNotification : SimpleNotification + { + private readonly string version; + + public UpdateCompleteNotification(string version) + { + this.version = version; + Text = NotificationsStrings.GameVersionAfterUpdate(version); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours, ChangelogOverlay changelog, INotificationOverlay notificationOverlay) + { + Icon = FontAwesome.Solid.CheckSquare; + IconContent.Colour = colours.BlueDark; + + Activated = delegate + { + notificationOverlay.Hide(); + changelog.ShowBuild(version); + return true; + }; + } + } }