mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 13:37:25 +08:00
Fix sizing of ModIcon
This commit is contained in:
parent
eaf1a60fe1
commit
f912744acc
@ -207,14 +207,12 @@ namespace osu.Game.Overlays.Mods
|
|||||||
{
|
{
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Position = new Vector2(1.5f),
|
Position = new Vector2(1.5f),
|
||||||
},
|
},
|
||||||
foregroundIcon = new ModIcon(Mods[0])
|
foregroundIcon = new ModIcon(Mods[0])
|
||||||
{
|
{
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Position = new Vector2(-1.5f),
|
Position = new Vector2(-1.5f),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -225,7 +223,6 @@ namespace osu.Game.Overlays.Mods
|
|||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -163,11 +163,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
|||||||
});
|
});
|
||||||
|
|
||||||
foreach (Mod mod in Score.Mods)
|
foreach (Mod mod in Score.Mods)
|
||||||
modsContainer.Add(new ModIcon(mod)
|
modsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.5f) });
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Scale = new Vector2(0.5f),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnClick(InputState state) => true;
|
protected override bool OnClick(InputState state) => true;
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
private readonly SpriteIcon modIcon;
|
private readonly SpriteIcon modIcon;
|
||||||
private readonly SpriteIcon background;
|
private readonly SpriteIcon background;
|
||||||
|
|
||||||
private const float background_size = 80;
|
private const float size = 80;
|
||||||
|
|
||||||
public FontAwesome Icon
|
public FontAwesome Icon
|
||||||
{
|
{
|
||||||
@ -38,23 +38,25 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
TooltipText = mod.Name;
|
TooltipText = mod.Name;
|
||||||
|
|
||||||
|
Size = new Vector2(size);
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
background = new SpriteIcon
|
background = new SpriteIcon
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Size = new Vector2(background_size),
|
Size = new Vector2(size),
|
||||||
Icon = FontAwesome.fa_osu_mod_bg,
|
Icon = FontAwesome.fa_osu_mod_bg,
|
||||||
|
Y = -6.5f,
|
||||||
Shadow = true,
|
Shadow = true,
|
||||||
},
|
},
|
||||||
modIcon = new SpriteIcon
|
modIcon = new SpriteIcon
|
||||||
{
|
{
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.Centre,
|
||||||
Colour = OsuColour.Gray(84),
|
Colour = OsuColour.Gray(84),
|
||||||
Size = new Vector2(background_size - 35),
|
Size = new Vector2(size - 35),
|
||||||
Y = 25,
|
|
||||||
Icon = mod.Icon
|
Icon = mod.Icon
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -55,11 +55,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
iconsContainer.Clear();
|
iconsContainer.Clear();
|
||||||
foreach (Mod mod in mods)
|
foreach (Mod mod in mods)
|
||||||
{
|
{
|
||||||
iconsContainer.Add(new ModIcon(mod)
|
iconsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.6f) });
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Scale = new Vector2(0.6f),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsLoaded)
|
if (IsLoaded)
|
||||||
|
@ -264,11 +264,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
|
|
||||||
foreach (Mod mod in Score.Mods)
|
foreach (Mod mod in Score.Mods)
|
||||||
{
|
{
|
||||||
modsContainer.Add(new ModIcon(mod)
|
modsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.375f) });
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Scale = new Vector2(0.375f)
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user