1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 04:02:57 +08:00

invert usage corresponding to previous description change

This commit is contained in:
Unknown 2019-07-05 09:16:50 +02:00
parent ee44caf964
commit d05512a12a
2 changed files with 8 additions and 11 deletions

View File

@ -112,10 +112,10 @@ namespace osu.Game.Tests.Visual.Gameplay
AddUntilStep("wait for graph", () => graph.CreationCount == 1);
AddStep("start", clock.Start);
AddStep("show bar", () => progress.AllowSeeking.Value = true);
AddStep("hide graph", () => progress.CollapseGraph.Value = true);
AddStep("hide graph", () => progress.ShowGraph.Value = false);
AddStep("hide Bar", () => progress.AllowSeeking.Value = false);
AddStep("show bar", () => progress.AllowSeeking.Value = true);
AddStep("show graph", () => progress.CollapseGraph.Value = false);
AddStep("show graph", () => progress.ShowGraph.Value = true);
AddStep("stop", clock.Stop);
}

View File

@ -38,10 +38,7 @@ namespace osu.Game.Screens.Play
/// </summary>
public readonly Bindable<bool> AllowSeeking = new Bindable<bool>();
/// <summary>
/// Whether the difficulty graph should be shown.
/// </summary>
public readonly Bindable<bool> CollapseGraph = new Bindable<bool>();
public readonly Bindable<bool> ShowGraph = new Bindable<bool>();
public override bool HandleNonPositionalInput => AllowSeeking.Value;
public override bool HandlePositionalInput => AllowSeeking.Value;
@ -107,7 +104,7 @@ namespace osu.Game.Screens.Play
if (clock != null)
gameplayClock = clock;
config.BindWith(OsuSetting.ShowProgressGraph, CollapseGraph);
config.BindWith(OsuSetting.ShowProgressGraph, ShowGraph);
graph.FillColour = bar.FillColour = colours.BlueLighter;
}
@ -117,7 +114,7 @@ namespace osu.Game.Screens.Play
Show();
AllowSeeking.BindValueChanged(_ => updateBarVisibility(), true);
CollapseGraph.BindValueChanged(_ => updateGraphVisibility(), true);
ShowGraph.BindValueChanged(_ => updateGraphVisibility(), true);
}
public void BindDrawableRuleset(DrawableRuleset drawableRuleset)
@ -163,15 +160,15 @@ namespace osu.Game.Screens.Play
{
float barHeight = bottom_bar_height + handle_size.Y;
bar.ResizeHeightTo(CollapseGraph.Value ? barHeight : barHeight + graph_height, transition_duration, Easing.In);
graph.MoveToY(CollapseGraph.Value ? bottom_bar_height + graph_height : 0, transition_duration, Easing.In);
bar.ResizeHeightTo(ShowGraph.Value ? barHeight + graph_height : barHeight, transition_duration, Easing.In);
graph.MoveToY(ShowGraph.Value ? 0 : bottom_bar_height + graph_height, transition_duration, Easing.In);
updateInfoMargin();
}
private void updateInfoMargin()
{
float finalMargin = bottom_bar_height + (AllowSeeking.Value ? handle_size.Y : 0) + (CollapseGraph.Value ? 0 : graph_height);
float finalMargin = bottom_bar_height + (AllowSeeking.Value ? handle_size.Y : 0) + (ShowGraph.Value ? graph_height : 0);
info.TransformTo(nameof(info.Margin), new MarginPadding { Bottom = finalMargin }, transition_duration, Easing.In);
}
}