mirror of
https://github.com/ppy/osu.git
synced 2025-03-12 10:27:20 +08:00
fix :
1. Add space before {, before Duration, and after 1000 2. How about just ManiaStage? 3. This is really just Columns.Count, you're not saving much with this extra variable here.
This commit is contained in:
parent
561c9f2233
commit
e947e46566
@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
RelativeChildSize = new Vector2(1, 10000),
|
||||
Children = new[]
|
||||
{
|
||||
new DrawableHoldNote(new HoldNote{Duration = 1000}, ManiaAction.Key1)
|
||||
new DrawableHoldNote(new HoldNote { Duration = 1000 } , ManiaAction.Key1)
|
||||
{
|
||||
Y = 5000,
|
||||
Height = 1000,
|
||||
|
@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
{
|
||||
Name = "Hit target + hit objects",
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding { Top = ManiaColumnStage.HIT_TARGET_POSITION },
|
||||
Padding = new MarginPadding { Top = ManiaStage.HIT_TARGET_POSITION },
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Container
|
||||
@ -115,7 +115,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
{
|
||||
Name = "Key",
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = ManiaColumnStage.HIT_TARGET_POSITION,
|
||||
Height = ManiaStage.HIT_TARGET_POSITION,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
|
@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
/// <summary>
|
||||
/// list mania column stages
|
||||
/// </summary>
|
||||
private readonly FillFlowContainer<ManiaColumnStage> listColumnStages;
|
||||
private readonly FillFlowContainer<ManiaStage> Stages;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this playfield should be inverted. This flips everything inside the playfield.
|
||||
@ -37,17 +37,17 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
/// </summary>
|
||||
public SpecialColumnPosition SpecialColumnPosition
|
||||
{
|
||||
get => listColumnStages.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal;
|
||||
get => Stages.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal;
|
||||
set
|
||||
{
|
||||
foreach (var singleStage in listColumnStages)
|
||||
foreach (var singleStage in Stages)
|
||||
{
|
||||
singleStage.SpecialColumnPosition = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<Column> Columns => listColumnStages.SelectMany(x => x.Columns).ToList();
|
||||
public List<Column> Columns => Stages.SelectMany(x => x.Columns).ToList();
|
||||
|
||||
private readonly int columnCount;
|
||||
|
||||
@ -63,7 +63,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
listColumnStages = new FillFlowContainer<ManiaColumnStage>
|
||||
Stages = new FillFlowContainer<ManiaStage>
|
||||
{
|
||||
Name="Stages",
|
||||
Direction = FillDirection.Horizontal,
|
||||
@ -78,10 +78,10 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
|
||||
foreach (var stage in stages)
|
||||
{
|
||||
var drawableStage = new ManiaColumnStage(stage.Columns);
|
||||
var drawableStage = new ManiaStage();
|
||||
drawableStage.VisibleTimeRange.BindTo(VisibleTimeRange);
|
||||
|
||||
listColumnStages.Add(drawableStage);
|
||||
Stages.Add(drawableStage);
|
||||
AddNested(drawableStage);
|
||||
|
||||
for (int i = 0; i < stage.Columns; i++)
|
||||
@ -105,7 +105,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
{
|
||||
Scale = new Vector2(1, newValue ? -1 : 1);
|
||||
|
||||
foreach (var single in listColumnStages)
|
||||
foreach (var single in Stages)
|
||||
{
|
||||
single.Judgements.Scale = Scale;
|
||||
}
|
||||
@ -124,18 +124,18 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
|
||||
public void Add(BarLine barline)
|
||||
{
|
||||
foreach (var single in listColumnStages)
|
||||
foreach (var single in Stages)
|
||||
{
|
||||
single.HitObjects.Add(new DrawableBarLine(barline));
|
||||
}
|
||||
}
|
||||
|
||||
private ManiaColumnStage getFallDownControlContainerByActualColumn(int actualColumn)
|
||||
private ManiaStage getFallDownControlContainerByActualColumn(int actualColumn)
|
||||
{
|
||||
int sum = 0;
|
||||
foreach (var single in listColumnStages)
|
||||
foreach (var single in Stages)
|
||||
{
|
||||
sum = sum + single.ColumnCount;
|
||||
sum = sum + single.Columns.Count();
|
||||
if (sum > actualColumn)
|
||||
{
|
||||
return single;
|
||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
/// <summary>
|
||||
/// A collection of <see cref="Column"/>s.
|
||||
/// </summary>
|
||||
internal class ManiaColumnStage : ScrollingPlayfield
|
||||
internal class ManiaStage : ScrollingPlayfield
|
||||
{
|
||||
public const float HIT_TARGET_POSITION = 50;
|
||||
|
||||
@ -53,12 +53,9 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
private List<Color4> normalColumnColours = new List<Color4>();
|
||||
private Color4 specialColumnColour;
|
||||
|
||||
public readonly int ColumnCount;
|
||||
|
||||
public ManiaColumnStage(int columnCount)
|
||||
public ManiaStage()
|
||||
: base(ScrollingDirection.Up)
|
||||
{
|
||||
ColumnCount = columnCount;
|
||||
Name = "Playfield elements";
|
||||
Anchor = Anchor.TopCentre;
|
||||
Origin = Anchor.TopCentre;
|
||||
@ -142,11 +139,11 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
{
|
||||
default:
|
||||
case SpecialColumnPosition.Normal:
|
||||
return ColumnCount % 2 == 1 && column == ColumnCount / 2;
|
||||
return columns.Count % 2 == 1 && column == columns.Count / 2;
|
||||
case SpecialColumnPosition.Left:
|
||||
return column == 0;
|
||||
case SpecialColumnPosition.Right:
|
||||
return column == ColumnCount - 1;
|
||||
return column == columns.Count - 1;
|
||||
}
|
||||
}
|
||||
|
@ -115,7 +115,7 @@
|
||||
<Compile Include="Tests\TestCasePerformancePoints.cs" />
|
||||
<Compile Include="UI\Column.cs" />
|
||||
<Compile Include="UI\DrawableManiaJudgement.cs" />
|
||||
<Compile Include="UI\ManiaColumnStage.cs" />
|
||||
<Compile Include="UI\ManiaStage.cs" />
|
||||
<Compile Include="UI\HitExplosion.cs" />
|
||||
<Compile Include="UI\ManiaRulesetContainer.cs" />
|
||||
<Compile Include="UI\ManiaPlayfield.cs" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user