mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 05:42:56 +08:00
Merge branch 'master' into fix-fade-discrepancies
This commit is contained in:
commit
808754a191
@ -93,13 +93,11 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
new CatchModHidden(),
|
new CatchModHidden(),
|
||||||
new CatchModFlashlight(),
|
new CatchModFlashlight(),
|
||||||
};
|
};
|
||||||
case ModType.Special:
|
case ModType.Automation:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
new CatchModRelax(),
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
new MultiMod(new CatchModAutoplay(), new ModCinema()),
|
new MultiMod(new CatchModAutoplay(), new ModCinema()),
|
||||||
|
new CatchModRelax(),
|
||||||
};
|
};
|
||||||
default:
|
default:
|
||||||
return new Mod[] { };
|
return new Mod[] { };
|
||||||
|
@ -120,7 +120,7 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
new MultiMod(new ManiaModFadeIn(), new ManiaModHidden()),
|
new MultiMod(new ManiaModFadeIn(), new ManiaModHidden()),
|
||||||
new ManiaModFlashlight(),
|
new ManiaModFlashlight(),
|
||||||
};
|
};
|
||||||
case ModType.Special:
|
case ModType.Conversion:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
new MultiMod(new ManiaModKey4(),
|
new MultiMod(new ManiaModKey4(),
|
||||||
@ -135,6 +135,10 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
new ManiaModRandom(),
|
new ManiaModRandom(),
|
||||||
new ManiaModDualStages(),
|
new ManiaModDualStages(),
|
||||||
new ManiaModMirror(),
|
new ManiaModMirror(),
|
||||||
|
};
|
||||||
|
case ModType.Automation:
|
||||||
|
return new Mod[]
|
||||||
|
{
|
||||||
new MultiMod(new ManiaModAutoplay(), new ModCinema()),
|
new MultiMod(new ManiaModAutoplay(), new ModCinema()),
|
||||||
};
|
};
|
||||||
default:
|
default:
|
||||||
|
@ -13,6 +13,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
|||||||
{
|
{
|
||||||
public override string ShortenedName => Name;
|
public override string ShortenedName => Name;
|
||||||
public abstract int KeyCount { get; }
|
public abstract int KeyCount { get; }
|
||||||
|
public override ModType Type => ModType.Conversion;
|
||||||
public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier
|
public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier
|
||||||
public override bool Ranked => true;
|
public override bool Ranked => true;
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
|||||||
public override string Name => "Dual Stages";
|
public override string Name => "Dual Stages";
|
||||||
public override string ShortenedName => "DS";
|
public override string ShortenedName => "DS";
|
||||||
public override string Description => @"Double the stages, double the fun!";
|
public override string Description => @"Double the stages, double the fun!";
|
||||||
|
public override ModType Type => ModType.Conversion;
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
|
|
||||||
private bool isForCurrentRuleset;
|
private bool isForCurrentRuleset;
|
||||||
|
@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
|||||||
{
|
{
|
||||||
public override string Name => "Mirror";
|
public override string Name => "Mirror";
|
||||||
public override string ShortenedName => "MR";
|
public override string ShortenedName => "MR";
|
||||||
public override ModType Type => ModType.Special;
|
public override ModType Type => ModType.Conversion;
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
public override bool Ranked => true;
|
public override bool Ranked => true;
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
|||||||
{
|
{
|
||||||
public override string Name => "Random";
|
public override string Name => "Random";
|
||||||
public override string ShortenedName => "RD";
|
public override string ShortenedName => "RD";
|
||||||
|
public override ModType Type => ModType.Conversion;
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_dice;
|
public override FontAwesome Icon => FontAwesome.fa_osu_dice;
|
||||||
public override string Description => @"Shuffle around the keys!";
|
public override string Description => @"Shuffle around the keys!";
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
|
@ -12,6 +12,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public override string Name => "Autopilot";
|
public override string Name => "Autopilot";
|
||||||
public override string ShortenedName => "AP";
|
public override string ShortenedName => "AP";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot;
|
||||||
|
public override ModType Type => ModType.Automation;
|
||||||
public override string Description => @"Automatic cursor movement - just follow the rhythm.";
|
public override string Description => @"Automatic cursor movement - just follow the rhythm.";
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
public override Type[] IncompatibleMods => new[] { typeof(OsuModSpunOut), typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail), typeof(ModAutoplay) };
|
public override Type[] IncompatibleMods => new[] { typeof(OsuModSpunOut), typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail), typeof(ModAutoplay) };
|
||||||
|
@ -12,6 +12,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public override string Name => "Spun Out";
|
public override string Name => "Spun Out";
|
||||||
public override string ShortenedName => "SO";
|
public override string ShortenedName => "SO";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout;
|
||||||
|
public override ModType Type => ModType.DifficultyReduction;
|
||||||
public override string Description => @"Spinners will be automatically completed.";
|
public override string Description => @"Spinners will be automatically completed.";
|
||||||
public override double ScoreMultiplier => 0.9;
|
public override double ScoreMultiplier => 0.9;
|
||||||
public override bool Ranked => true;
|
public override bool Ranked => true;
|
||||||
|
@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
{
|
{
|
||||||
public override string Name => "Target";
|
public override string Name => "Target";
|
||||||
public override string ShortenedName => "TP";
|
public override string ShortenedName => "TP";
|
||||||
|
public override ModType Type => ModType.Conversion;
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_target;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_target;
|
||||||
public override string Description => @"Practice keeping up with the beat of the song.";
|
public override string Description => @"Practice keeping up with the beat of the song.";
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
|
@ -94,6 +94,7 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
new OsuModEasy(),
|
new OsuModEasy(),
|
||||||
new OsuModNoFail(),
|
new OsuModNoFail(),
|
||||||
new MultiMod(new OsuModHalfTime(), new OsuModDaycore()),
|
new MultiMod(new OsuModHalfTime(), new OsuModDaycore()),
|
||||||
|
new OsuModSpunOut(),
|
||||||
};
|
};
|
||||||
case ModType.DifficultyIncrease:
|
case ModType.DifficultyIncrease:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
@ -104,14 +105,17 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
new OsuModHidden(),
|
new OsuModHidden(),
|
||||||
new OsuModFlashlight(),
|
new OsuModFlashlight(),
|
||||||
};
|
};
|
||||||
case ModType.Special:
|
case ModType.Conversion:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
|
new OsuModTarget(),
|
||||||
|
};
|
||||||
|
case ModType.Automation:
|
||||||
|
return new Mod[]
|
||||||
|
{
|
||||||
|
new MultiMod(new OsuModAutoplay(), new ModCinema()),
|
||||||
new OsuModRelax(),
|
new OsuModRelax(),
|
||||||
new OsuModAutopilot(),
|
new OsuModAutopilot(),
|
||||||
new OsuModSpunOut(),
|
|
||||||
new MultiMod(new OsuModAutoplay(), new ModCinema()),
|
|
||||||
new OsuModTarget(),
|
|
||||||
};
|
};
|
||||||
default:
|
default:
|
||||||
return new Mod[] { };
|
return new Mod[] { };
|
||||||
|
@ -93,13 +93,11 @@ namespace osu.Game.Rulesets.Taiko
|
|||||||
new TaikoModHidden(),
|
new TaikoModHidden(),
|
||||||
new TaikoModFlashlight(),
|
new TaikoModFlashlight(),
|
||||||
};
|
};
|
||||||
case ModType.Special:
|
case ModType.Automation:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
new TaikoModRelax(),
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
new MultiMod(new TaikoModAutoplay(), new ModCinema()),
|
new MultiMod(new TaikoModAutoplay(), new ModCinema()),
|
||||||
|
new TaikoModRelax(),
|
||||||
};
|
};
|
||||||
default:
|
default:
|
||||||
return new Mod[] { };
|
return new Mod[] { };
|
||||||
|
@ -16,6 +16,7 @@ using System.Collections.Generic;
|
|||||||
using osu.Game.Rulesets.Osu;
|
using osu.Game.Rulesets.Osu;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Game.Overlays.Mods.Sections;
|
||||||
using osu.Game.Rulesets.Mania;
|
using osu.Game.Rulesets.Mania;
|
||||||
using osu.Game.Rulesets.Mania.Mods;
|
using osu.Game.Rulesets.Mania.Mods;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
@ -36,7 +37,9 @@ namespace osu.Game.Tests.Visual
|
|||||||
typeof(ModButtonEmpty),
|
typeof(ModButtonEmpty),
|
||||||
typeof(DifficultyReductionSection),
|
typeof(DifficultyReductionSection),
|
||||||
typeof(DifficultyIncreaseSection),
|
typeof(DifficultyIncreaseSection),
|
||||||
typeof(SpecialSection),
|
typeof(AutomationSection),
|
||||||
|
typeof(ConversionSection),
|
||||||
|
typeof(FunSection),
|
||||||
};
|
};
|
||||||
|
|
||||||
private RulesetStore rulesets;
|
private RulesetStore rulesets;
|
||||||
@ -95,7 +98,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
var easierMods = ruleset.GetModsFor(ModType.DifficultyReduction);
|
var easierMods = ruleset.GetModsFor(ModType.DifficultyReduction);
|
||||||
var harderMods = ruleset.GetModsFor(ModType.DifficultyIncrease);
|
var harderMods = ruleset.GetModsFor(ModType.DifficultyIncrease);
|
||||||
var assistMods = ruleset.GetModsFor(ModType.Special);
|
var assistMods = ruleset.GetModsFor(ModType.Automation);
|
||||||
|
|
||||||
var noFailMod = easierMods.FirstOrDefault(m => m is OsuModNoFail);
|
var noFailMod = easierMods.FirstOrDefault(m => m is OsuModNoFail);
|
||||||
var hiddenMod = harderMods.FirstOrDefault(m => m is OsuModHidden);
|
var hiddenMod = harderMods.FirstOrDefault(m => m is OsuModHidden);
|
||||||
@ -119,7 +122,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
private void testManiaMods(ManiaRuleset ruleset)
|
private void testManiaMods(ManiaRuleset ruleset)
|
||||||
{
|
{
|
||||||
testRankedText(ruleset.GetModsFor(ModType.Special).First(m => m is ManiaModRandom));
|
testRankedText(ruleset.GetModsFor(ModType.Conversion).First(m => m is ManiaModRandom));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void testSingleMod(Mod mod)
|
private void testSingleMod(Mod mod)
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -45,7 +44,6 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
return new ModButton(m)
|
return new ModButton(m)
|
||||||
{
|
{
|
||||||
SelectedColour = selectedColour,
|
|
||||||
SelectionChanged = Action,
|
SelectionChanged = Action,
|
||||||
};
|
};
|
||||||
}).ToArray();
|
}).ToArray();
|
||||||
@ -57,25 +55,14 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
private ModButton[] buttons = { };
|
private ModButton[] buttons = { };
|
||||||
|
|
||||||
private Color4 selectedColour = Color4.White;
|
|
||||||
public Color4 SelectedColour
|
|
||||||
{
|
|
||||||
get => selectedColour;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value == selectedColour) return;
|
|
||||||
selectedColour = value;
|
|
||||||
|
|
||||||
foreach (ModButton button in buttons)
|
|
||||||
button.SelectedColour = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||||
{
|
{
|
||||||
var index = Array.IndexOf(ToggleKeys, args.Key);
|
if (ToggleKeys != null)
|
||||||
if (index > -1 && index < buttons.Length)
|
{
|
||||||
buttons[index].SelectNext(state.Keyboard.ShiftPressed ? -1 : 1);
|
var index = Array.IndexOf(ToggleKeys, args.Key);
|
||||||
|
if (index > -1 && index < buttons.Length)
|
||||||
|
buttons[index].SelectNext(state.Keyboard.ShiftPressed ? -1 : 1);
|
||||||
|
}
|
||||||
|
|
||||||
return base.OnKeyDown(state, args);
|
return base.OnKeyDown(state, args);
|
||||||
}
|
}
|
||||||
@ -125,6 +112,10 @@ namespace osu.Game.Overlays.Mods
|
|||||||
protected ModSection()
|
protected ModSection()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
|
||||||
|
Origin = Anchor.TopCentre;
|
||||||
|
Anchor = Anchor.TopCentre;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
@ -21,6 +21,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osu.Game.Overlays.Mods.Sections;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Mods
|
namespace osu.Game.Overlays.Mods
|
||||||
{
|
{
|
||||||
@ -188,6 +189,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
Waves.FourthWaveColour = OsuColour.FromHex(@"003a4e");
|
Waves.FourthWaveColour = OsuColour.FromHex(@"003a4e");
|
||||||
|
|
||||||
Height = 510;
|
Height = 510;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
@ -211,178 +213,172 @@ namespace osu.Game.Overlays.Mods
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
new GridContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.Both,
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Anchor = Anchor.BottomCentre,
|
Anchor = Anchor.BottomCentre,
|
||||||
Origin = Anchor.BottomCentre,
|
Origin = Anchor.BottomCentre,
|
||||||
Direction = FillDirection.Vertical,
|
RowDimensions = new[]
|
||||||
Spacing = new Vector2(0f, 10f),
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
{
|
||||||
// Header
|
new Dimension(GridSizeMode.Absolute, 90),
|
||||||
new Container
|
new Dimension(GridSizeMode.Distributed),
|
||||||
|
new Dimension(GridSizeMode.Absolute, 70),
|
||||||
|
},
|
||||||
|
Content = new[]
|
||||||
|
{
|
||||||
|
new Drawable[]
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
new Container
|
||||||
Height = 82,
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
{
|
||||||
new Box
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
new Box
|
||||||
Colour = OsuColour.Gray(10).Opacity(100),
|
|
||||||
},
|
|
||||||
new FillFlowContainer
|
|
||||||
{
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Direction = FillDirection.Vertical,
|
|
||||||
Width = content_width,
|
|
||||||
Padding = new MarginPadding
|
|
||||||
{
|
{
|
||||||
Top = 10,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Bottom = 10,
|
Colour = OsuColour.Gray(10).Opacity(100),
|
||||||
},
|
},
|
||||||
Children = new Drawable[]
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
new OsuSpriteText
|
Origin = Anchor.Centre,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
Width = content_width,
|
||||||
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
Font = @"Exo2.0-Bold",
|
new OsuSpriteText
|
||||||
Text = @"Gameplay Mods",
|
|
||||||
TextSize = 22,
|
|
||||||
Shadow = true,
|
|
||||||
Margin = new MarginPadding
|
|
||||||
{
|
{
|
||||||
Bottom = 4,
|
Font = @"Exo2.0-Bold",
|
||||||
|
Text = @"Gameplay Mods",
|
||||||
|
TextSize = 22,
|
||||||
|
Shadow = true,
|
||||||
|
Margin = new MarginPadding
|
||||||
|
{
|
||||||
|
Bottom = 4,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
new OsuTextFlowContainer(text =>
|
||||||
|
{
|
||||||
|
text.TextSize = 18;
|
||||||
|
text.Shadow = true;
|
||||||
|
})
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Text = "Mods provide different ways to enjoy gameplay. Some have an effect on the score you can achieve during ranked play.\nOthers are just for fun.",
|
||||||
},
|
},
|
||||||
},
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Text = @"Mods provide different ways to enjoy gameplay. Some have an effect on the score you can achieve during ranked play.",
|
|
||||||
TextSize = 18,
|
|
||||||
Shadow = true,
|
|
||||||
},
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Text = @"Others are just for fun.",
|
|
||||||
TextSize = 18,
|
|
||||||
Shadow = true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Body
|
new Drawable[]
|
||||||
ModSectionsContainer = new FillFlowContainer<ModSection>
|
|
||||||
{
|
{
|
||||||
Origin = Anchor.TopCentre,
|
// Body
|
||||||
Anchor = Anchor.TopCentre,
|
new OsuScrollContainer
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Spacing = new Vector2(0f, 10f),
|
|
||||||
Width = content_width,
|
|
||||||
Children = new ModSection[]
|
|
||||||
{
|
{
|
||||||
new DifficultyReductionSection
|
ScrollbarVisible = false,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Padding = new MarginPadding { Vertical = 10 },
|
||||||
|
Child = ModSectionsContainer = new FillFlowContainer<ModSection>
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Action = modButtonPressed,
|
|
||||||
},
|
|
||||||
new DifficultyIncreaseSection
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Action = modButtonPressed,
|
|
||||||
},
|
|
||||||
new SpecialSection
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Action = modButtonPressed,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// Footer
|
|
||||||
new Container
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Height = 70,
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Colour = new Color4(172, 20, 116, 255),
|
|
||||||
Alpha = 0.5f,
|
|
||||||
},
|
|
||||||
footerContainer = new FillFlowContainer
|
|
||||||
{
|
|
||||||
Origin = Anchor.BottomCentre,
|
|
||||||
Anchor = Anchor.BottomCentre,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
RelativeSizeAxes = Axes.X,
|
Spacing = new Vector2(0f, 10f),
|
||||||
Width = content_width,
|
Width = content_width,
|
||||||
Direction = FillDirection.Horizontal,
|
Children = new ModSection[]
|
||||||
Padding = new MarginPadding
|
|
||||||
{
|
{
|
||||||
Vertical = 15
|
new DifficultyReductionSection { Action = modButtonPressed },
|
||||||
|
new DifficultyIncreaseSection { Action = modButtonPressed },
|
||||||
|
new AutomationSection { Action = modButtonPressed },
|
||||||
|
new ConversionSection { Action = modButtonPressed },
|
||||||
|
new FunSection { Action = modButtonPressed },
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
new Drawable[]
|
||||||
|
{
|
||||||
|
// Footer
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = new Color4(172, 20, 116, 255),
|
||||||
|
Alpha = 0.5f,
|
||||||
},
|
},
|
||||||
Children = new Drawable[]
|
footerContainer = new FillFlowContainer
|
||||||
{
|
{
|
||||||
DeselectAllButton = new TriangleButton
|
Origin = Anchor.BottomCentre,
|
||||||
|
Anchor = Anchor.BottomCentre,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Width = content_width,
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
Padding = new MarginPadding
|
||||||
{
|
{
|
||||||
Width = 180,
|
Vertical = 15
|
||||||
Text = "Deselect All",
|
|
||||||
Action = DeselectAll,
|
|
||||||
Margin = new MarginPadding
|
|
||||||
{
|
|
||||||
Right = 20
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
Text = @"Score Multiplier:",
|
DeselectAllButton = new TriangleButton
|
||||||
TextSize = 30,
|
|
||||||
Margin = new MarginPadding
|
|
||||||
{
|
{
|
||||||
Top = 5,
|
Width = 180,
|
||||||
Right = 10
|
Text = "Deselect All",
|
||||||
}
|
Action = DeselectAll,
|
||||||
},
|
Margin = new MarginPadding
|
||||||
MultiplierLabel = new OsuSpriteText
|
{
|
||||||
{
|
Right = 20
|
||||||
Font = @"Exo2.0-Bold",
|
}
|
||||||
TextSize = 30,
|
},
|
||||||
Margin = new MarginPadding
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Top = 5
|
Text = @"Score Multiplier:",
|
||||||
}
|
TextSize = 30,
|
||||||
},
|
Margin = new MarginPadding
|
||||||
UnrankedLabel = new OsuSpriteText
|
{
|
||||||
{
|
Top = 5,
|
||||||
Font = @"Exo2.0-Bold",
|
Right = 10
|
||||||
Text = @"(Unranked)",
|
}
|
||||||
TextSize = 30,
|
},
|
||||||
Margin = new MarginPadding
|
MultiplierLabel = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Top = 5,
|
Font = @"Exo2.0-Bold",
|
||||||
Left = 10
|
TextSize = 30,
|
||||||
|
Margin = new MarginPadding
|
||||||
|
{
|
||||||
|
Top = 5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
UnrankedLabel = new OsuSpriteText
|
||||||
|
{
|
||||||
|
Font = @"Exo2.0-Bold",
|
||||||
|
Text = @"(Unranked)",
|
||||||
|
TextSize = 30,
|
||||||
|
Margin = new MarginPadding
|
||||||
|
{
|
||||||
|
Top = 5,
|
||||||
|
Left = 10
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
19
osu.Game/Overlays/Mods/Sections/AutomationSection.cs
Normal file
19
osu.Game/Overlays/Mods/Sections/AutomationSection.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using OpenTK.Input;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.Mods.Sections
|
||||||
|
{
|
||||||
|
public class AutomationSection : ModSection
|
||||||
|
{
|
||||||
|
protected override Key[] ToggleKeys => new[] { Key.Z, Key.X, Key.C, Key.V, Key.B, Key.N, Key.M };
|
||||||
|
public override ModType ModType => ModType.Automation;
|
||||||
|
|
||||||
|
public AutomationSection()
|
||||||
|
{
|
||||||
|
Header = @"Automation";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
19
osu.Game/Overlays/Mods/Sections/ConversionSection.cs
Normal file
19
osu.Game/Overlays/Mods/Sections/ConversionSection.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using OpenTK.Input;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.Mods.Sections
|
||||||
|
{
|
||||||
|
public class ConversionSection : ModSection
|
||||||
|
{
|
||||||
|
protected override Key[] ToggleKeys => null;
|
||||||
|
public override ModType ModType => ModType.Conversion;
|
||||||
|
|
||||||
|
public ConversionSection()
|
||||||
|
{
|
||||||
|
Header = @"Conversion";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using OpenTK.Input;
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using OpenTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Mods
|
namespace osu.Game.Overlays.Mods.Sections
|
||||||
{
|
{
|
||||||
public class DifficultyIncreaseSection : ModSection
|
public class DifficultyIncreaseSection : ModSection
|
||||||
{
|
{
|
||||||
protected override Key[] ToggleKeys => new[] { Key.A, Key.S, Key.D, Key.F, Key.G, Key.H, Key.J, Key.K, Key.L };
|
protected override Key[] ToggleKeys => new[] { Key.A, Key.S, Key.D, Key.F, Key.G, Key.H, Key.J, Key.K, Key.L };
|
||||||
public override ModType ModType => ModType.DifficultyIncrease;
|
public override ModType ModType => ModType.DifficultyIncrease;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colours)
|
|
||||||
{
|
|
||||||
SelectedColour = colours.YellowLight;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DifficultyIncreaseSection()
|
public DifficultyIncreaseSection()
|
||||||
{
|
{
|
||||||
Header = @"Difficulty Increase";
|
Header = @"Difficulty Increase";
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using OpenTK.Input;
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using OpenTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Mods
|
namespace osu.Game.Overlays.Mods.Sections
|
||||||
{
|
{
|
||||||
public class DifficultyReductionSection : ModSection
|
public class DifficultyReductionSection : ModSection
|
||||||
{
|
{
|
||||||
protected override Key[] ToggleKeys => new[] { Key.Q, Key.W, Key.E, Key.R, Key.T, Key.Y, Key.U, Key.I, Key.O, Key.P };
|
protected override Key[] ToggleKeys => new[] { Key.Q, Key.W, Key.E, Key.R, Key.T, Key.Y, Key.U, Key.I, Key.O, Key.P };
|
||||||
public override ModType ModType => ModType.DifficultyReduction;
|
public override ModType ModType => ModType.DifficultyReduction;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colours)
|
|
||||||
{
|
|
||||||
SelectedColour = colours.GreenLight;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DifficultyReductionSection()
|
public DifficultyReductionSection()
|
||||||
{
|
{
|
||||||
Header = @"Difficulty Reduction";
|
Header = @"Difficulty Reduction";
|
19
osu.Game/Overlays/Mods/Sections/FunSection.cs
Normal file
19
osu.Game/Overlays/Mods/Sections/FunSection.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using OpenTK.Input;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.Mods.Sections
|
||||||
|
{
|
||||||
|
public class FunSection : ModSection
|
||||||
|
{
|
||||||
|
protected override Key[] ToggleKeys => null;
|
||||||
|
public override ModType ModType => ModType.Fun;
|
||||||
|
|
||||||
|
public FunSection()
|
||||||
|
{
|
||||||
|
Header = @"Fun";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,27 +0,0 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
||||||
|
|
||||||
using OpenTK.Input;
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Rulesets.Mods;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Mods
|
|
||||||
{
|
|
||||||
public class SpecialSection : ModSection
|
|
||||||
{
|
|
||||||
protected override Key[] ToggleKeys => new[] { Key.Z, Key.X, Key.C, Key.V, Key.B, Key.N, Key.M };
|
|
||||||
public override ModType ModType => ModType.Special;
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colours)
|
|
||||||
{
|
|
||||||
SelectedColour = colours.BlueLight;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SpecialSection()
|
|
||||||
{
|
|
||||||
Header = @"Special";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of this mod.
|
/// The type of this mod.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual ModType Type => ModType.Special;
|
public virtual ModType Type => ModType.Fun;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The user readable description of this mod.
|
/// The user readable description of this mod.
|
||||||
|
@ -26,6 +26,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public override string Name => "Autoplay";
|
public override string Name => "Autoplay";
|
||||||
public override string ShortenedName => "AT";
|
public override string ShortenedName => "AT";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_auto;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_auto;
|
||||||
|
public override ModType Type => ModType.Automation;
|
||||||
public override string Description => "Watch a perfect automated play through the song.";
|
public override string Description => "Watch a perfect automated play through the song.";
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
public bool AllowFail => false;
|
public bool AllowFail => false;
|
||||||
|
@ -11,6 +11,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public override string Name => "Relax";
|
public override string Name => "Relax";
|
||||||
public override string ShortenedName => "RX";
|
public override string ShortenedName => "RX";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_relax;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_relax;
|
||||||
|
public override ModType Type => ModType.Automation;
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModSuddenDeath) };
|
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModSuddenDeath) };
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
{
|
{
|
||||||
DifficultyReduction,
|
DifficultyReduction,
|
||||||
DifficultyIncrease,
|
DifficultyIncrease,
|
||||||
Special
|
Conversion,
|
||||||
|
Automation,
|
||||||
|
Fun
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,10 +79,18 @@ namespace osu.Game.Rulesets.UI
|
|||||||
backgroundColour = colours.Green;
|
backgroundColour = colours.Green;
|
||||||
highlightedColour = colours.GreenLight;
|
highlightedColour = colours.GreenLight;
|
||||||
break;
|
break;
|
||||||
case ModType.Special:
|
case ModType.Automation:
|
||||||
backgroundColour = colours.Blue;
|
backgroundColour = colours.Blue;
|
||||||
highlightedColour = colours.BlueLight;
|
highlightedColour = colours.BlueLight;
|
||||||
break;
|
break;
|
||||||
|
case ModType.Conversion:
|
||||||
|
backgroundColour = colours.Purple;
|
||||||
|
highlightedColour = colours.PurpleLight;
|
||||||
|
break;
|
||||||
|
case ModType.Fun:
|
||||||
|
backgroundColour = colours.Pink;
|
||||||
|
highlightedColour = colours.PinkLight;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
applyStyle();
|
applyStyle();
|
||||||
@ -92,10 +100,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
public bool Highlighted
|
public bool Highlighted
|
||||||
{
|
{
|
||||||
get
|
get { return highlighted; }
|
||||||
{
|
|
||||||
return highlighted;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
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.Input.States;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
@ -20,6 +22,8 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
public class PlayerLoader : ScreenWithBeatmapBackground
|
public class PlayerLoader : ScreenWithBeatmapBackground
|
||||||
{
|
{
|
||||||
|
private static readonly Vector2 background_blur = new Vector2(15);
|
||||||
|
|
||||||
private Player player;
|
private Player player;
|
||||||
|
|
||||||
private BeatmapMetadataDisplay info;
|
private BeatmapMetadataDisplay info;
|
||||||
@ -60,7 +64,7 @@ namespace osu.Game.Screens.Play
|
|||||||
Margin = new MarginPadding(25),
|
Margin = new MarginPadding(25),
|
||||||
Children = new PlayerSettingsGroup[]
|
Children = new PlayerSettingsGroup[]
|
||||||
{
|
{
|
||||||
new VisualSettings(),
|
visualSettings = new VisualSettings(),
|
||||||
new InputSettings()
|
new InputSettings()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -122,9 +126,33 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ScheduledDelegate pushDebounce;
|
private ScheduledDelegate pushDebounce;
|
||||||
|
private VisualSettings visualSettings;
|
||||||
|
|
||||||
private bool readyForPush => player.LoadState == LoadState.Ready && IsHovered && GetContainingInputManager()?.DraggedDrawable == null;
|
private bool readyForPush => player.LoadState == LoadState.Ready && IsHovered && GetContainingInputManager()?.DraggedDrawable == null;
|
||||||
|
|
||||||
|
protected override bool OnHover(InputState state)
|
||||||
|
{
|
||||||
|
// restore our screen defaults
|
||||||
|
InitializeBackgroundElements();
|
||||||
|
return base.OnHover(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnHoverLost(InputState state)
|
||||||
|
{
|
||||||
|
if (GetContainingInputManager().HoveredDrawables.Contains(visualSettings))
|
||||||
|
{
|
||||||
|
// show user setting preview
|
||||||
|
UpdateBackgroundElements();
|
||||||
|
}
|
||||||
|
base.OnHoverLost(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void InitializeBackgroundElements()
|
||||||
|
{
|
||||||
|
Background?.FadeTo(1, BACKGROUND_FADE_DURATION, Easing.OutQuint);
|
||||||
|
Background?.BlurTo(background_blur, BACKGROUND_FADE_DURATION, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
|
||||||
private void pushWhenLoaded()
|
private void pushWhenLoaded()
|
||||||
{
|
{
|
||||||
if (!IsCurrentScreen) return;
|
if (!IsCurrentScreen) return;
|
||||||
@ -215,7 +243,7 @@ namespace osu.Game.Screens.Play
|
|||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
Margin = new MarginPadding { Right = 5 },
|
Margin = new MarginPadding { Right = 5 },
|
||||||
Colour = OsuColour.Gray(0.5f),
|
Colour = OsuColour.Gray(0.8f),
|
||||||
Text = left,
|
Text = left,
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
|
@ -128,6 +128,27 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private const float fade_duration = 800;
|
||||||
|
private const float inactive_alpha = 0.5f;
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
this.Delay(600).FadeTo(inactive_alpha, fade_duration, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool OnHover(InputState state)
|
||||||
|
{
|
||||||
|
this.FadeIn(fade_duration, Easing.OutQuint);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnHoverLost(InputState state)
|
||||||
|
{
|
||||||
|
this.FadeTo(inactive_alpha, fade_duration, Easing.OutQuint);
|
||||||
|
base.OnHoverLost(state);
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
@ -140,7 +161,6 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
protected override bool OnHover(InputState state) => true;
|
|
||||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,8 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap.Value);
|
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap.Value);
|
||||||
|
|
||||||
|
protected new BackgroundScreenBeatmap Background => (BackgroundScreenBeatmap)base.Background;
|
||||||
|
|
||||||
public override bool AllowBeatmapRulesetChange => false;
|
public override bool AllowBeatmapRulesetChange => false;
|
||||||
|
|
||||||
protected const float BACKGROUND_FADE_DURATION = 800;
|
protected const float BACKGROUND_FADE_DURATION = 800;
|
||||||
@ -43,21 +45,30 @@ namespace osu.Game.Screens.Play
|
|||||||
DimLevel.ValueChanged += _ => UpdateBackgroundElements();
|
DimLevel.ValueChanged += _ => UpdateBackgroundElements();
|
||||||
BlurLevel.ValueChanged += _ => UpdateBackgroundElements();
|
BlurLevel.ValueChanged += _ => UpdateBackgroundElements();
|
||||||
ShowStoryboard.ValueChanged += _ => UpdateBackgroundElements();
|
ShowStoryboard.ValueChanged += _ => UpdateBackgroundElements();
|
||||||
UpdateBackgroundElements();
|
InitializeBackgroundElements();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnResuming(Screen last)
|
protected override void OnResuming(Screen last)
|
||||||
{
|
{
|
||||||
base.OnResuming(last);
|
base.OnResuming(last);
|
||||||
UpdateBackgroundElements();
|
InitializeBackgroundElements();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called once on entering screen. By Default, performs a full <see cref="UpdateBackgroundElements"/> call.
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void InitializeBackgroundElements() => UpdateBackgroundElements();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called wen background elements require updates, usually due to a user changing a setting.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userChange"></param>
|
||||||
protected virtual void UpdateBackgroundElements()
|
protected virtual void UpdateBackgroundElements()
|
||||||
{
|
{
|
||||||
if (!IsCurrentScreen) return;
|
if (!IsCurrentScreen) return;
|
||||||
|
|
||||||
Background?.FadeTo(BackgroundOpacity, BACKGROUND_FADE_DURATION, Easing.OutQuint);
|
Background?.FadeTo(BackgroundOpacity, BACKGROUND_FADE_DURATION, Easing.OutQuint);
|
||||||
(Background as BackgroundScreenBeatmap)?.BlurTo(new Vector2((float)BlurLevel.Value * 25), BACKGROUND_FADE_DURATION, Easing.OutQuint);
|
Background?.BlurTo(new Vector2((float)BlurLevel.Value * 25), BACKGROUND_FADE_DURATION, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.1" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2018.801.1" />
|
<PackageReference Include="ppy.osu.Framework" Version="2018.803.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.10.1" />
|
<PackageReference Include="NUnit" Version="3.10.1" />
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user