1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-27 07:09:54 +08:00

Fix "Click to see what's new!" notification no longer appearing (#37875)

- Regressed with https://github.com/ppy/osu/pull/37839.
- Closes https://github.com/ppy/osu/issues/37870

I feel like `UpdateManager` should remain a background component, so
moving this notification into a new stable execution path is best to me.
This commit is contained in:
Dean Herbert
2026-05-24 00:33:47 +09:00
committed by GitHub
Unverified
parent 6ccef8736c
commit 9684398d14
2 changed files with 33 additions and 33 deletions
+8 -1
View File
@@ -1301,10 +1301,17 @@ namespace osu.Game
applyConfigMigrations();
string lastVersion = LocalConfig.Get<string>(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);
}
/// <summary>
+25 -32
View File
@@ -56,15 +56,8 @@ namespace osu.Game.Updater
{
base.LoadComplete();
string version = game.Version;
string lastVersion = config.Get<string>(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;
};
}
}
}