mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Hoist ModState
to column level
This commit is contained in:
@ -57,9 +57,9 @@ namespace osu.Game.Overlays.Mods
|
||||
private Sample? sampleOff;
|
||||
private Sample? sampleOn;
|
||||
|
||||
public ModPanel(Mod mod)
|
||||
public ModPanel(ModState modState)
|
||||
{
|
||||
modState = new ModState(mod);
|
||||
this.modState = modState;
|
||||
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Height = 42;
|
||||
@ -81,7 +81,7 @@ namespace osu.Game.Overlays.Mods
|
||||
SwitchContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Child = new ModSwitchSmall(mod)
|
||||
Child = new ModSwitchSmall(Mod)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
@ -117,7 +117,7 @@ namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = mod.Name,
|
||||
Text = Mod.Name,
|
||||
Font = OsuFont.TorusAlternate.With(size: 18, weight: FontWeight.SemiBold),
|
||||
Shear = new Vector2(-ShearedOverlayContainer.SHEAR, 0),
|
||||
Margin = new MarginPadding
|
||||
@ -127,7 +127,7 @@ namespace osu.Game.Overlays.Mods
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = mod.Description,
|
||||
Text = Mod.Description,
|
||||
Font = OsuFont.Default.With(size: 12),
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Truncate = true,
|
||||
@ -143,6 +143,11 @@ namespace osu.Game.Overlays.Mods
|
||||
Action = Active.Toggle;
|
||||
}
|
||||
|
||||
public ModPanel(Mod mod)
|
||||
: this(new ModState(mod))
|
||||
{
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(AudioManager audio, OsuColour colours, ISamplePlaybackDisabler? samplePlaybackDisabler)
|
||||
{
|
||||
|
Reference in New Issue
Block a user