mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Rename flow to better match its purpose
This commit is contained in:
@ -103,10 +103,10 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
AddStep("Hide judgement names", () => counterDisplay.ShowJudgementNames.Value = false);
|
AddStep("Hide judgement names", () => counterDisplay.ShowJudgementNames.Value = false);
|
||||||
AddWaitStep("wait some", 2);
|
AddWaitStep("wait some", 2);
|
||||||
AddAssert("Assert hidden", () => counterDisplay.JudgementContainer.Children.First().ResultName.Alpha == 0);
|
AddAssert("Assert hidden", () => counterDisplay.CounterFlow.Children.First().ResultName.Alpha == 0);
|
||||||
AddStep("Hide judgement names", () => counterDisplay.ShowJudgementNames.Value = true);
|
AddStep("Hide judgement names", () => counterDisplay.ShowJudgementNames.Value = true);
|
||||||
AddWaitStep("wait some", 2);
|
AddWaitStep("wait some", 2);
|
||||||
AddAssert("Assert shown", () => counterDisplay.JudgementContainer.Children.First().ResultName.Alpha == 1);
|
AddAssert("Assert shown", () => counterDisplay.CounterFlow.Children.First().ResultName.Alpha == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -114,7 +114,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
AddStep("Hide max judgement", () => counterDisplay.ShowMaxJudgement.Value = false);
|
AddStep("Hide max judgement", () => counterDisplay.ShowMaxJudgement.Value = false);
|
||||||
AddWaitStep("wait some", 2);
|
AddWaitStep("wait some", 2);
|
||||||
AddAssert("Check max hidden", () => counterDisplay.JudgementContainer.ChildrenOfType<JudgementCounter>().First().Alpha == 0);
|
AddAssert("Check max hidden", () => counterDisplay.CounterFlow.ChildrenOfType<JudgementCounter>().First().Alpha == 0);
|
||||||
AddStep("Show max judgement", () => counterDisplay.ShowMaxJudgement.Value = true);
|
AddStep("Show max judgement", () => counterDisplay.ShowMaxJudgement.Value = true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,22 +123,22 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
AddStep("Show basic judgements", () => counterDisplay.Mode.Value = JudgementCounterDisplay.DisplayMode.Simple);
|
AddStep("Show basic judgements", () => counterDisplay.Mode.Value = JudgementCounterDisplay.DisplayMode.Simple);
|
||||||
AddWaitStep("wait some", 2);
|
AddWaitStep("wait some", 2);
|
||||||
AddAssert("Check only basic", () => counterDisplay.JudgementContainer.ChildrenOfType<JudgementCounter>().Last().Alpha == 0);
|
AddAssert("Check only basic", () => counterDisplay.CounterFlow.ChildrenOfType<JudgementCounter>().Last().Alpha == 0);
|
||||||
AddStep("Show normal judgements", () => counterDisplay.Mode.Value = JudgementCounterDisplay.DisplayMode.Normal);
|
AddStep("Show normal judgements", () => counterDisplay.Mode.Value = JudgementCounterDisplay.DisplayMode.Normal);
|
||||||
AddStep("Show all judgements", () => counterDisplay.Mode.Value = JudgementCounterDisplay.DisplayMode.All);
|
AddStep("Show all judgements", () => counterDisplay.Mode.Value = JudgementCounterDisplay.DisplayMode.All);
|
||||||
AddWaitStep("wait some", 2);
|
AddWaitStep("wait some", 2);
|
||||||
AddAssert("Check all visible", () => counterDisplay.JudgementContainer.ChildrenOfType<JudgementCounter>().Last().Alpha == 1);
|
AddAssert("Check all visible", () => counterDisplay.CounterFlow.ChildrenOfType<JudgementCounter>().Last().Alpha == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int hiddenCount()
|
private int hiddenCount()
|
||||||
{
|
{
|
||||||
var num = counterDisplay.JudgementContainer.Children.First(child => child.Result.Type == HitResult.LargeTickHit);
|
var num = counterDisplay.CounterFlow.Children.First(child => child.Result.Type == HitResult.LargeTickHit);
|
||||||
return num.Result.ResultCount.Value;
|
return num.Result.ResultCount.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private partial class TestJudgementCounterDisplay : JudgementCounterDisplay
|
private partial class TestJudgementCounterDisplay : JudgementCounterDisplay
|
||||||
{
|
{
|
||||||
public new FillFlowContainer<JudgementCounter> JudgementContainer => base.JudgementContainer;
|
public new FillFlowContainer<JudgementCounter> CounterFlow => base.CounterFlow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,13 +34,13 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private JudgementTally tally { get; set; } = null!;
|
private JudgementTally tally { get; set; } = null!;
|
||||||
|
|
||||||
protected FillFlowContainer<JudgementCounter> JudgementContainer = null!;
|
protected FillFlowContainer<JudgementCounter> CounterFlow = null!;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
InternalChild = JudgementContainer = new FillFlowContainer<JudgementCounter>
|
InternalChild = CounterFlow = new FillFlowContainer<JudgementCounter>
|
||||||
{
|
{
|
||||||
Direction = getFillDirection(FlowDirection.Value),
|
Direction = getFillDirection(FlowDirection.Value),
|
||||||
Spacing = new Vector2(10),
|
Spacing = new Vector2(10),
|
||||||
@ -48,7 +48,7 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter
|
|||||||
};
|
};
|
||||||
|
|
||||||
foreach (var result in tally.Results)
|
foreach (var result in tally.Results)
|
||||||
JudgementContainer.Add(createCounter(result));
|
CounterFlow.Add(createCounter(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -57,23 +57,23 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter
|
|||||||
|
|
||||||
FlowDirection.BindValueChanged(direction =>
|
FlowDirection.BindValueChanged(direction =>
|
||||||
{
|
{
|
||||||
JudgementContainer.Direction = getFillDirection(direction.NewValue);
|
CounterFlow.Direction = getFillDirection(direction.NewValue);
|
||||||
|
|
||||||
//Can't pass directly due to Enum conversion
|
//Can't pass directly due to Enum conversion
|
||||||
foreach (var counter in JudgementContainer.Children)
|
foreach (var counter in CounterFlow.Children)
|
||||||
counter.Direction.Value = getFillDirection(direction.NewValue);
|
counter.Direction.Value = getFillDirection(direction.NewValue);
|
||||||
}, true);
|
}, true);
|
||||||
Mode.BindValueChanged(_ => updateMode(), true);
|
Mode.BindValueChanged(_ => updateMode(), true);
|
||||||
ShowMaxJudgement.BindValueChanged(value =>
|
ShowMaxJudgement.BindValueChanged(value =>
|
||||||
{
|
{
|
||||||
var firstChild = JudgementContainer.Children.FirstOrDefault();
|
var firstChild = CounterFlow.Children.FirstOrDefault();
|
||||||
firstChild.FadeTo(value.NewValue ? 1 : 0, TRANSFORM_DURATION, Easing.OutQuint);
|
firstChild.FadeTo(value.NewValue ? 1 : 0, TRANSFORM_DURATION, Easing.OutQuint);
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateMode()
|
private void updateMode()
|
||||||
{
|
{
|
||||||
foreach (var counter in JudgementContainer.Children.Where(counter => !counter.Result.Type.IsBasic()))
|
foreach (var counter in CounterFlow.Children.Where(counter => !counter.Result.Type.IsBasic()))
|
||||||
{
|
{
|
||||||
switch (Mode.Value)
|
switch (Mode.Value)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user