Merge pull request #17698 from Joehuu/fix-replay-button-local-being-disabled

Fix replay button being disabled when available locally but not online
This commit is contained in:
Dean Herbert
2022-04-07 14:18:02 +09:00
committed by GitHub
2 changed files with 8 additions and 4 deletions

View File

@ -87,31 +87,33 @@ namespace osu.Game.Screens.Ranking
});
}
button.Enabled.Value = replayAvailability != ReplayAvailability.NotAvailable;
updateTooltip();
updateState();
}, true);
State.BindValueChanged(state =>
{
button.State.Value = state.NewValue;
updateTooltip();
updateState();
}, true);
}
private void updateTooltip()
private void updateState()
{
switch (replayAvailability)
{
case ReplayAvailability.Local:
button.TooltipText = @"watch replay";
button.Enabled.Value = true;
break;
case ReplayAvailability.Online:
button.TooltipText = @"download replay";
button.Enabled.Value = true;
break;
default:
button.TooltipText = @"replay unavailable";
button.Enabled.Value = false;
break;
}
}