mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 10:02:59 +08:00
Set defaults on SkinnableHUDComponent to cancel out relative size default
Specifying locally on each HUD component looks to make more sense.
This commit is contained in:
parent
2540d6029c
commit
defa350aa7
@ -36,32 +36,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuConfigManager config { get; set; }
|
private OsuConfigManager config { get; set; }
|
||||||
|
|
||||||
protected override void LoadComplete()
|
|
||||||
{
|
|
||||||
base.LoadComplete();
|
|
||||||
|
|
||||||
Add(new Container
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Width = 0.3f,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new Box
|
|
||||||
{
|
|
||||||
Colour = Color4.Black,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Alpha = 0.9f,
|
|
||||||
},
|
|
||||||
new FillFlowContainer
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Direction = FillDirection.Vertical,
|
|
||||||
Children = createSkinSourceComponents(),
|
|
||||||
},
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestComboCounterIncrementing()
|
public void TestComboCounterIncrementing()
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.HUD
|
namespace osu.Game.Screens.Play.HUD
|
||||||
@ -14,6 +15,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
: base(new HUDSkinComponent(HUDSkinComponents.AccuracyCounter), _ => new DefaultAccuracyCounter())
|
: base(new HUDSkinComponent(HUDSkinComponents.AccuracyCounter), _ => new DefaultAccuracyCounter())
|
||||||
{
|
{
|
||||||
CentreComponent = false;
|
CentreComponent = false;
|
||||||
|
AutoSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IAccuracyCounter skinnedCounter;
|
private IAccuracyCounter skinnedCounter;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.HUD
|
namespace osu.Game.Screens.Play.HUD
|
||||||
@ -14,6 +15,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
: base(new HUDSkinComponent(HUDSkinComponents.ComboCounter), skinComponent => new DefaultComboCounter())
|
: base(new HUDSkinComponent(HUDSkinComponents.ComboCounter), skinComponent => new DefaultComboCounter())
|
||||||
{
|
{
|
||||||
CentreComponent = false;
|
CentreComponent = false;
|
||||||
|
AutoSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IComboCounter skinnedCounter;
|
private IComboCounter skinnedCounter;
|
||||||
|
@ -46,8 +46,11 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
SkinRotation.BindValueChanged(rotation => Rotation = rotation.NewValue);
|
SkinRotation.BindValueChanged(rotation => Rotation = rotation.NewValue);
|
||||||
SkinAnchor.BindValueChanged(anchor => { Anchor = anchor.NewValue; });
|
SkinAnchor.BindValueChanged(anchor => { Anchor = anchor.NewValue; });
|
||||||
|
|
||||||
|
// reset everything and require each component to specify what they want,
|
||||||
|
// as if they were just drawables. maybe we want to change SkinnableDrawable to not default
|
||||||
|
// to RelativeSizeAxes.Both...
|
||||||
RelativeSizeAxes = Axes.None;
|
RelativeSizeAxes = Axes.None;
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnInvalidate(Invalidation invalidation, InvalidationSource source)
|
protected override bool OnInvalidate(Invalidation invalidation, InvalidationSource source)
|
||||||
@ -58,6 +61,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
SkinPositionY.Value = Position.Y;
|
SkinPositionY.Value = Position.Y;
|
||||||
SkinRotation.Value = Rotation;
|
SkinRotation.Value = Rotation;
|
||||||
SkinAnchor.Value = Anchor;
|
SkinAnchor.Value = Anchor;
|
||||||
|
|
||||||
return base.OnInvalidate(invalidation, source);
|
return base.OnInvalidate(invalidation, source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
@ -35,6 +36,8 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
: base(new HUDSkinComponent(HUDSkinComponents.HealthDisplay), _ => new DefaultHealthDisplay())
|
: base(new HUDSkinComponent(HUDSkinComponents.HealthDisplay), _ => new DefaultHealthDisplay())
|
||||||
{
|
{
|
||||||
CentreComponent = false;
|
CentreComponent = false;
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IHealthDisplay skinnedCounter;
|
private IHealthDisplay skinnedCounter;
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
@ -22,6 +23,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
: base(new HUDSkinComponent(HUDSkinComponents.ScoreCounter), _ => new DefaultScoreCounter())
|
: base(new HUDSkinComponent(HUDSkinComponents.ScoreCounter), _ => new DefaultScoreCounter())
|
||||||
{
|
{
|
||||||
CentreComponent = false;
|
CentreComponent = false;
|
||||||
|
AutoSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
Loading…
Reference in New Issue
Block a user