Fix gap to left of InputDrum on legacy skins

This commit is contained in:
Dean Herbert 2020-04-23 13:07:30 +09:00
parent 2e022fbcb5
commit 61d2580e1c

View File

@ -20,36 +20,41 @@ namespace osu.Game.Rulesets.Taiko.Skinning
{
private LegacyHalfDrum left;
private LegacyHalfDrum right;
private Container content;
public LegacyInputDrum()
{
Size = new Vector2(180, 200);
RelativeSizeAxes = Axes.Both;
}
[BackgroundDependencyLoader]
private void load(ISkinSource skin)
{
Children = new Drawable[]
Child = content = new Container
{
new Sprite
Size = new Vector2(180, 200),
Children = new Drawable[]
{
Texture = skin.GetTexture("taiko-bar-left")
},
left = new LegacyHalfDrum(false)
{
Name = "Left Half",
RelativeSizeAxes = Axes.Both,
RimAction = TaikoAction.LeftRim,
CentreAction = TaikoAction.LeftCentre
},
right = new LegacyHalfDrum(true)
{
Name = "Right Half",
RelativeSizeAxes = Axes.Both,
Origin = Anchor.TopRight,
Scale = new Vector2(-1, 1),
RimAction = TaikoAction.RightRim,
CentreAction = TaikoAction.RightCentre
new Sprite
{
Texture = skin.GetTexture("taiko-bar-left")
},
left = new LegacyHalfDrum(false)
{
Name = "Left Half",
RelativeSizeAxes = Axes.Both,
RimAction = TaikoAction.LeftRim,
CentreAction = TaikoAction.LeftCentre
},
right = new LegacyHalfDrum(true)
{
Name = "Right Half",
RelativeSizeAxes = Axes.Both,
Origin = Anchor.TopRight,
Scale = new Vector2(-1, 1),
RimAction = TaikoAction.RightRim,
CentreAction = TaikoAction.RightCentre
}
}
};
@ -84,7 +89,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning
// Relying on RelativeSizeAxes.Both + FillMode.Fit doesn't work due to the precise pixel layout requirements.
// This is a bit ugly but makes the non-legacy implementations a lot cleaner to implement.
Scale = new Vector2(Parent.DrawHeight / Size.Y);
content.Scale = new Vector2(DrawHeight / content.Size.Y);
}
/// <summary>