Fix replay download button always being disabled when initial score's replay is unavailable

This commit is contained in:
Joehu 2020-08-29 09:33:01 -07:00
parent 69fae0f412
commit 0a643fd5e5

View File

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