mirror of
https://github.com/ppy/osu
synced 2025-01-03 12:52:10 +00: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;
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user