mirror of
https://github.com/ppy/osu
synced 2024-12-23 23:33:36 +00:00
Initial commit
This commit is contained in:
parent
c8134162b5
commit
836efe3f7c
@ -37,10 +37,12 @@ namespace osu.Desktop.Updater
|
||||
if (game.IsDeployedBuild)
|
||||
{
|
||||
Splat.Locator.CurrentMutable.Register(() => new SquirrelLogger(), typeof(Splat.ILogger));
|
||||
Schedule(() => Task.Run(() => checkForUpdateAsync()));
|
||||
CheckForUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public override void CheckForUpdate() => Schedule(() => Task.Run(() => checkForUpdateAsync()));
|
||||
|
||||
private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null)
|
||||
{
|
||||
// should we schedule a retry on completion of this check?
|
||||
|
@ -5,15 +5,19 @@ using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Updater;
|
||||
|
||||
namespace osu.Game.Overlays.Settings.Sections.General
|
||||
{
|
||||
public class UpdateSettings : SettingsSubsection
|
||||
{
|
||||
[Resolved(CanBeNull = true)]
|
||||
private UpdateManager updateManager { get; set; }
|
||||
|
||||
protected override string Header => "Updates";
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(Storage storage, OsuConfigManager config)
|
||||
private void load(Storage storage, OsuConfigManager config, OsuGameBase game)
|
||||
{
|
||||
Add(new SettingsEnumDropdown<ReleaseStream>
|
||||
{
|
||||
@ -21,6 +25,13 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
Bindable = config.GetBindable<ReleaseStream>(OsuSetting.ReleaseStream),
|
||||
});
|
||||
|
||||
Add(new SettingsButton
|
||||
{
|
||||
Text = "Check for updates",
|
||||
Action = () => updateManager?.CheckForUpdate(),
|
||||
Enabled = { Value = game.IsDeployedBuild }
|
||||
});
|
||||
|
||||
if (RuntimeInfo.IsDesktop)
|
||||
{
|
||||
Add(new SettingsButton
|
||||
|
@ -30,9 +30,11 @@ namespace osu.Game.Updater
|
||||
version = game.Version;
|
||||
|
||||
if (game.IsDeployedBuild)
|
||||
Schedule(() => Task.Run(checkForUpdateAsync));
|
||||
CheckForUpdate();
|
||||
}
|
||||
|
||||
public override void CheckForUpdate() => Schedule(() => Task.Run(checkForUpdateAsync));
|
||||
|
||||
private async void checkForUpdateAsync()
|
||||
{
|
||||
try
|
||||
|
@ -4,6 +4,7 @@
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Overlays;
|
||||
@ -44,6 +45,11 @@ namespace osu.Game.Updater
|
||||
config.Set(OsuSetting.Version, version);
|
||||
}
|
||||
|
||||
public virtual void CheckForUpdate()
|
||||
{
|
||||
Logger.Log("CheckForUpdate was called on the base class (UpdateManager)", LoggingTarget.Information);
|
||||
}
|
||||
|
||||
private class UpdateCompleteNotification : SimpleNotification
|
||||
{
|
||||
private readonly string version;
|
||||
|
Loading…
Reference in New Issue
Block a user