mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 20:52:54 +08:00
Fix replay download button always being disabled when initial score's replay is unavailable
This commit is contained in:
parent
69fae0f412
commit
0a643fd5e5
@ -74,23 +74,33 @@ namespace osu.Game.Screens.Ranking
|
|||||||
{
|
{
|
||||||
button.State.Value = state.NewValue;
|
button.State.Value = state.NewValue;
|
||||||
|
|
||||||
switch (replayAvailability)
|
updateTooltip();
|
||||||
{
|
|
||||||
case ReplayAvailability.Local:
|
|
||||||
button.TooltipText = @"watch replay";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ReplayAvailability.Online:
|
|
||||||
button.TooltipText = @"download replay";
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
button.TooltipText = @"replay unavailable";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}, true);
|
}, 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
|
private enum ReplayAvailability
|
||||||
|
Loading…
Reference in New Issue
Block a user