1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-22 05:23:05 +08:00

Update other usages of OsuIcon.ModBg and remove

This commit is contained in:
Dean Herbert 2023-09-28 18:40:00 +09:00
parent 2ff376daa4
commit d4cf6e100f
2 changed files with 16 additions and 12 deletions

View File

@ -89,6 +89,8 @@ namespace osu.Game.Graphics
public static IconUsage ModSpunOut => Get(0xe046); public static IconUsage ModSpunOut => Get(0xe046);
public static IconUsage ModSuddenDeath => Get(0xe047); public static IconUsage ModSuddenDeath => Get(0xe047);
public static IconUsage ModTarget => Get(0xe048); public static IconUsage ModTarget => Get(0xe048);
public static IconUsage ModBg => Get(0xe04a);
// Use "Icons/BeatmapDetails/mod-icon" instead
// public static IconUsage ModBg => Get(0xe04a);
} }
} }

View File

@ -6,6 +6,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Utils; using osu.Framework.Utils;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays; using osu.Game.Overlays;
@ -23,8 +24,8 @@ namespace osu.Game.Rulesets.UI
private readonly IMod mod; private readonly IMod mod;
private readonly SpriteIcon background; private Drawable background = null!;
private readonly SpriteIcon? modIcon; private SpriteIcon? modIcon;
private Color4 activeForegroundColour; private Color4 activeForegroundColour;
private Color4 inactiveForegroundColour; private Color4 inactiveForegroundColour;
@ -36,19 +37,24 @@ namespace osu.Game.Rulesets.UI
{ {
this.mod = mod; this.mod = mod;
AutoSizeAxes = Axes.Both; Size = new Vector2(DEFAULT_SIZE);
}
[BackgroundDependencyLoader]
private void load(TextureStore textures, OsuColour colours, OverlayColourProvider? colourProvider)
{
FillFlowContainer contentFlow; FillFlowContainer contentFlow;
ModSwitchTiny tinySwitch; ModSwitchTiny tinySwitch;
InternalChildren = new Drawable[] InternalChildren = new[]
{ {
background = new SpriteIcon background = new Sprite
{ {
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fit,
Texture = textures.Get("Icons/BeatmapDetails/mod-icon"),
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Size = new Vector2(DEFAULT_SIZE),
Icon = OsuIcon.ModBg
}, },
contentFlow = new FillFlowContainer contentFlow = new FillFlowContainer
{ {
@ -78,11 +84,7 @@ namespace osu.Game.Rulesets.UI
}); });
tinySwitch.Scale = new Vector2(0.3f); tinySwitch.Scale = new Vector2(0.3f);
} }
}
[BackgroundDependencyLoader(true)]
private void load(OsuColour colours, OverlayColourProvider? colourProvider)
{
inactiveForegroundColour = colourProvider?.Background5 ?? colours.Gray3; inactiveForegroundColour = colourProvider?.Background5 ?? colours.Gray3;
activeForegroundColour = colours.ForModType(mod.Type); activeForegroundColour = colours.ForModType(mod.Type);