Skip to content

Commit 53d0ffb

Browse files
authored
Merge pull request #352 from ppy/master
Fix "Click to see what's new!" notification no longer appearing (ppy#37875)
2 parents 8679113 + 9684398 commit 53d0ffb

2 files changed

Lines changed: 33 additions & 33 deletions

File tree

osu.Game/OsuGame.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,10 +1322,17 @@ protected override void LoadComplete()
13221322

13231323
applyConfigMigrations();
13241324

1325+
string lastVersion = LocalConfig.Get<string>(OsuSetting.Version);
1326+
string version = Version;
1327+
1328+
// only show a notification if we've previously saved a version to the config file (ie. not the first run).
1329+
if (IsDeployedBuild && !string.IsNullOrEmpty(lastVersion) && version != lastVersion)
1330+
Notifications.Post(new UpdateCompleteNotification(version));
1331+
13251332
// finally, update the version stored to the configuration.
13261333
// this MUST happen after `applyConfigMigrations()` call, as it relies on comparing the previous version.
13271334
// debug / local compilations will reset to a non-release string.
1328-
LocalConfig.SetValue(OsuSetting.Version, Version);
1335+
LocalConfig.SetValue(OsuSetting.Version, version);
13291336
}
13301337

13311338
/// <summary>

osu.Game/Updater/UpdateManager.cs

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,8 @@ protected override void LoadComplete()
5656
{
5757
base.LoadComplete();
5858

59-
string version = game.Version;
60-
string lastVersion = config.Get<string>(OsuSetting.Version);
61-
6259
if (game.IsDeployedBuild)
6360
{
64-
// only show a notification if we've previously saved a version to the config file (ie. not the first run).
65-
if (!string.IsNullOrEmpty(lastVersion) && version != lastVersion)
66-
Notifications.Post(new UpdateCompleteNotification(version));
67-
6861
// make sure the release stream setting matches the build which was just run.
6962
if (FixedReleaseStream != null)
7063
config.SetValue(OsuSetting.ReleaseStream, FixedReleaseStream.Value);
@@ -137,31 +130,6 @@ protected override void Dispose(bool isDisposing)
137130
updateCancellationSource.Dispose();
138131
}
139132

140-
private partial class UpdateCompleteNotification : SimpleNotification
141-
{
142-
private readonly string version;
143-
144-
public UpdateCompleteNotification(string version)
145-
{
146-
this.version = version;
147-
Text = NotificationsStrings.GameVersionAfterUpdate(version);
148-
}
149-
150-
[BackgroundDependencyLoader]
151-
private void load(OsuColour colours, ChangelogOverlay changelog, INotificationOverlay notificationOverlay)
152-
{
153-
Icon = FontAwesome.Solid.CheckSquare;
154-
IconContent.Colour = colours.BlueDark;
155-
156-
Activated = delegate
157-
{
158-
notificationOverlay.Hide();
159-
changelog.ShowBuild(version);
160-
return true;
161-
};
162-
}
163-
}
164-
165133
public partial class UpdateDownloadProgressNotification : ProgressNotification
166134
{
167135
private readonly CancellationToken cancellationToken;
@@ -259,4 +227,29 @@ protected override void Update()
259227
}
260228
}
261229
}
230+
231+
public partial class UpdateCompleteNotification : SimpleNotification
232+
{
233+
private readonly string version;
234+
235+
public UpdateCompleteNotification(string version)
236+
{
237+
this.version = version;
238+
Text = NotificationsStrings.GameVersionAfterUpdate(version);
239+
}
240+
241+
[BackgroundDependencyLoader]
242+
private void load(OsuColour colours, ChangelogOverlay changelog, INotificationOverlay notificationOverlay)
243+
{
244+
Icon = FontAwesome.Solid.CheckSquare;
245+
IconContent.Colour = colours.BlueDark;
246+
247+
Activated = delegate
248+
{
249+
notificationOverlay.Hide();
250+
changelog.ShowBuild(version);
251+
return true;
252+
};
253+
}
254+
}
262255
}

0 commit comments

Comments
 (0)