mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Use property instead of type checking
This commit is contained in:
@ -22,6 +22,8 @@ namespace osu.Desktop.Updater
|
|||||||
{
|
{
|
||||||
public class SquirrelUpdateManager : osu.Game.Updater.UpdateManager
|
public class SquirrelUpdateManager : osu.Game.Updater.UpdateManager
|
||||||
{
|
{
|
||||||
|
public override bool CanPerformUpdate => true;
|
||||||
|
|
||||||
private UpdateManager updateManager;
|
private UpdateManager updateManager;
|
||||||
private NotificationOverlay notificationOverlay;
|
private NotificationOverlay notificationOverlay;
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
Bindable = config.GetBindable<ReleaseStream>(OsuSetting.ReleaseStream),
|
Bindable = config.GetBindable<ReleaseStream>(OsuSetting.ReleaseStream),
|
||||||
});
|
});
|
||||||
|
|
||||||
// We shouldn't display the button for the base UpdateManager (without updating logic)
|
// We should only display the button for UpdateManagers that do update the client
|
||||||
if (updateManager != null && updateManager.GetType() != typeof(UpdateManager))
|
if (updateManager != null && updateManager.CanPerformUpdate)
|
||||||
{
|
{
|
||||||
Add(new SettingsButton
|
Add(new SettingsButton
|
||||||
{
|
{
|
||||||
|
@ -19,6 +19,8 @@ namespace osu.Game.Updater
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class SimpleUpdateManager : UpdateManager
|
public class SimpleUpdateManager : UpdateManager
|
||||||
{
|
{
|
||||||
|
public override bool CanPerformUpdate => true;
|
||||||
|
|
||||||
private string version;
|
private string version;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
|
@ -17,6 +17,8 @@ namespace osu.Game.Updater
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class UpdateManager : CompositeDrawable
|
public class UpdateManager : CompositeDrawable
|
||||||
{
|
{
|
||||||
|
public virtual bool CanPerformUpdate => false;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuConfigManager config { get; set; }
|
private OsuConfigManager config { get; set; }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user