1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 04:13:00 +08:00

Merge branch 'master' into editor-wheel-movement

This commit is contained in:
Dean Herbert 2018-03-16 18:19:42 +09:00 committed by GitHub
commit e8f7f2c8ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 49 additions and 58 deletions

View File

@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
Origin = Anchor.BottomLeft;
X = 0;
Child = bananaContainer = new Container { RelativeSizeAxes = Axes.Both };
InternalChild = bananaContainer = new Container { RelativeSizeAxes = Axes.Both };
foreach (var b in s.NestedHitObjects.Cast<BananaShower.Banana>())
AddNested(getVisualRepresentation?.Invoke(b));

View File

@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
[BackgroundDependencyLoader]
private void load()
{
Child = new Pulp
InternalChild = new Pulp
{
AccentColour = AccentColour,
Size = Size

View File

@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
[BackgroundDependencyLoader]
private void load()
{
Children = new[]
InternalChildren = new[]
{
createPulp(HitObject.VisualRepresentation),
border = new Circle
@ -65,7 +65,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
if (HitObject.HyperDash)
{
Add(new Pulp
AddInternal(new Pulp
{
RelativePositionAxes = Axes.Both,
Anchor = Anchor.Centre,

View File

@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
Origin = Anchor.BottomLeft;
X = 0;
Child = dropletContainer = new Container { RelativeSizeAxes = Axes.Both, };
InternalChild = dropletContainer = new Container { RelativeSizeAxes = Axes.Both, };
foreach (var o in s.NestedHitObjects.Cast<CatchHitObject>())
AddNested(getVisualRepresentation?.Invoke(o));

View File

@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
RelativeSizeAxes = Axes.X;
Height = 1;
Add(new Box
AddInternal(new Box
{
Name = "Bar line",
Anchor = Anchor.BottomCentre,
@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
if (isMajor)
{
Add(new EquilateralTriangle
AddInternal(new EquilateralTriangle
{
Name = "Left triangle",
Anchor = Anchor.BottomLeft,
@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
Rotation = 90
});
Add(new EquilateralTriangle
AddInternal(new EquilateralTriangle
{
Name = "Right triangle",
Anchor = Anchor.BottomRight,

View File

@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
{
RelativeSizeAxes = Axes.X;
AddRange(new Drawable[]
InternalChildren = new Drawable[]
{
// The hit object itself cannot be used for various elements because the tail overshoots it
// So a specialized container that is updated to contain the tail height is used
@ -68,7 +68,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre
}
});
};
foreach (var tick in HitObject.NestedHitObjects.OfType<HoldNoteTick>())
{

View File

@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
RelativeSizeAxes = Axes.X;
Size = new Vector2(1);
Children = new[]
InternalChildren = new[]
{
glowContainer = new CircularContainer
{

View File

@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Children = new Drawable[]
InternalChildren = new Drawable[]
{
laneGlowPiece = new LaneGlowPiece
{

View File

@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Position = HitObject.StackedPosition;
Scale = new Vector2(h.Scale);
Children = new Drawable[]
InternalChildren = new Drawable[]
{
glow = new GlowPiece
{

View File

@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Blending = BlendingMode.Additive;
Origin = Anchor.Centre;
Children = new Drawable[]
InternalChildren = new Drawable[]
{
new SpriteIcon
{

View File

@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Container<DrawableSliderTick> ticks;
Container<DrawableRepeatPoint> repeatPoints;
Children = new Drawable[]
InternalChildren = new Drawable[]
{
Body = new SliderBody(s)
{

View File

@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
BorderThickness = 2;
BorderColour = Color4.White;
Children = new Drawable[]
InternalChildren = new Drawable[]
{
new Box
{

View File

@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Spinner = s;
Children = new Drawable[]
InternalChildren = new Drawable[]
{
circleContainer = new Container
{

View File

@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
RelativeSizeAxes = Axes.Y;
Width = tracker_width;
Children = new[]
InternalChildren = new[]
{
Tracker = new Box
{

View File

@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
public DrawableBarLineMajor(BarLine barLine)
: base(barLine)
{
Add(triangleContainer = new Container
AddInternal(triangleContainer = new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,

View File

@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
switch (state)
{
case ArmedState.Hit:
Content.ScaleTo(0, 100, Easing.OutQuint).Expire();
this.ScaleTo(0, 100, Easing.OutQuint).Expire();
break;
}
}

View File

@ -103,7 +103,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
const float gravity_time = 300;
const float gravity_travel_height = 200;
Content.ScaleTo(0.8f, gravity_time * 2, Easing.OutQuad);
this.ScaleTo(0.8f, gravity_time * 2, Easing.OutQuad);
this.MoveToY(-gravity_travel_height, gravity_time, Easing.Out)
.Then()

View File

@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
FillMode = FillMode.Fit;
Add(bodyContainer = new Container
AddInternal(bodyContainer = new Container
{
RelativeSizeAxes = Axes.Both,
Depth = 1,

View File

@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
RelativeSizeAxes = Axes.Both;
Size = BaseSize = new Vector2(HitObject.IsStrong ? TaikoHitObject.DEFAULT_STRONG_SIZE : TaikoHitObject.DEFAULT_SIZE);
Add(MainPiece = CreateMainPiece());
InternalChild = MainPiece = CreateMainPiece();
MainPiece.KiaiMode = HitObject.Kiai;
}

View File

@ -140,12 +140,12 @@ namespace osu.Game.Tests.Visual
{
Origin = Anchor.Centre;
Add(new Box
InternalChild = new Box
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both
});
};
switch (direction)
{
@ -175,7 +175,7 @@ namespace osu.Game.Tests.Visual
Origin = Anchor.Centre;
AutoSizeAxes = Axes.Both;
Add(new Box { Size = new Vector2(75) });
InternalChild = new Box { Size = new Vector2(75) };
}
protected override void UpdateState(ArmedState state)

View File

@ -27,14 +27,8 @@ namespace osu.Game.Overlays.Mods
public string Header
{
get
{
return headerLabel.Text;
}
set
{
headerLabel.Text = value;
}
get => headerLabel.Text;
set => headerLabel.Text = value;
}
public IEnumerable<Mod> SelectedMods => buttons.Select(b => b.SelectedMod).Where(m => m != null);
@ -47,12 +41,12 @@ namespace osu.Game.Overlays.Mods
{
if (m == null)
return new ModButtonEmpty();
else
return new ModButton(m)
{
SelectedColour = selectedColour,
SelectionChanged = Action,
};
return new ModButton(m)
{
SelectedColour = selectedColour,
SelectionChanged = Action,
};
}).ToArray();
ButtonsContainer.Children = modContainers;
@ -65,10 +59,7 @@ namespace osu.Game.Overlays.Mods
private Color4 selectedColour = Color4.White;
public Color4 SelectedColour
{
get
{
return selectedColour;
}
get => selectedColour;
set
{
if (value == selectedColour) return;
@ -102,31 +93,31 @@ namespace osu.Game.Overlays.Mods
{
Mod selected = button.SelectedMod;
if (selected == null) continue;
foreach (Type type in modTypes)
foreach (var type in modTypes)
if (type.IsInstanceOfType(selected))
{
if (immediate)
button.Deselect();
else
Scheduler.AddDelayed(() => button.Deselect(), delay += 50);
Scheduler.AddDelayed(button.Deselect, delay += 50);
}
}
}
/// <summary>
/// Select one or more mods in this section.
/// Select one or more mods in this section and deselects all other ones.
/// </summary>
/// <param name="mods">The types of <see cref="Mod"/>s which should be deselected.</param>
public void SelectTypes(IEnumerable<Mod> mods)
/// <param name="modTypes">The types of <see cref="Mod"/>s which should be selected.</param>
public void SelectTypes(IEnumerable<Type> modTypes)
{
foreach (var button in buttons)
{
for (int i = 0; i < button.Mods.Length; i++)
{
foreach (var mod in mods)
if (mod.GetType().IsInstanceOfType(button.Mods[i]))
button.SelectAt(i);
}
int i = Array.FindIndex(button.Mods, m => modTypes.Any(t => t.IsInstanceOfType(m)));
if (i >= 0)
button.SelectAt(i);
else
button.Deselect();
}
}

View File

@ -76,7 +76,7 @@ namespace osu.Game.Overlays.Mods
private void selectedModsChanged(IEnumerable<Mod> obj)
{
foreach (ModSection section in ModSectionsContainer.Children)
section.SelectTypes(obj);
section.SelectTypes(obj.Select(m => m.GetType()).ToList());
updateMods();
}

View File

@ -19,7 +19,7 @@ using OpenTK.Graphics;
namespace osu.Game.Rulesets.Objects.Drawables
{
public abstract class DrawableHitObject : Container, IHasAccentColour
public abstract class DrawableHitObject : CompositeDrawable, IHasAccentColour
{
public readonly HitObject HitObject;

View File

@ -99,7 +99,7 @@ namespace osu.Game.Screens.Select
if (removeAutoModOnResume)
{
var autoType = Ruleset.Value.CreateInstance().GetAutoplayMod().GetType();
SelectedMods.Value = SelectedMods.Value.Where(m => m.GetType() != autoType).ToArray();
modSelect.DeselectTypes(new[] { autoType }, true);
removeAutoModOnResume = false;
}