mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Simplify changes to RulesetContainer
This commit is contained in:
@ -35,8 +35,8 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
|
|
||||||
public void ApplyToRulesetContainer(RulesetContainer<OsuHitObject> rulesetContainer)
|
public void ApplyToRulesetContainer(RulesetContainer<OsuHitObject> rulesetContainer)
|
||||||
{
|
{
|
||||||
bool hasEasy = rulesetContainer.ActiveMods.Any(m => m is ModEasy);
|
bool hasEasy = rulesetContainer.Mods.Any(m => m is ModEasy);
|
||||||
bool hasHardrock = rulesetContainer.ActiveMods.Any(m => m is ModHardRock);
|
bool hasHardrock = rulesetContainer.Mods.Any(m => m is ModHardRock);
|
||||||
|
|
||||||
rulesetContainer.Overlays.Add(blinds = new DrawableOsuBlinds(rulesetContainer.Playfield.HitObjectContainer, hasEasy, hasHardrock, rulesetContainer.Beatmap));
|
rulesetContainer.Overlays.Add(blinds = new DrawableOsuBlinds(rulesetContainer.Playfield.HitObjectContainer, hasEasy, hasHardrock, rulesetContainer.Beatmap));
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Place to put drawables above hit objects but below UI.
|
/// Place to put drawables above hit objects but below UI.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly Container Overlays;
|
public Container Overlays { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The cursor provided by this <see cref="RulesetContainer"/>. May be null if no cursor is provided.
|
/// The cursor provided by this <see cref="RulesetContainer"/>. May be null if no cursor is provided.
|
||||||
@ -92,12 +92,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
{
|
{
|
||||||
Ruleset = ruleset;
|
Ruleset = ruleset;
|
||||||
playfield = new Lazy<Playfield>(CreatePlayfield);
|
playfield = new Lazy<Playfield>(CreatePlayfield);
|
||||||
Overlays = new Container
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Width = 1,
|
|
||||||
Height = 1
|
|
||||||
};
|
|
||||||
|
|
||||||
IsPaused.ValueChanged += paused =>
|
IsPaused.ValueChanged += paused =>
|
||||||
{
|
{
|
||||||
@ -215,7 +209,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The mods which are to be applied.
|
/// The mods which are to be applied.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected IEnumerable<Mod> Mods;
|
public IEnumerable<Mod> Mods { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The <see cref="WorkingBeatmap"/> this <see cref="RulesetContainer{TObject}"/> was created with.
|
/// The <see cref="WorkingBeatmap"/> this <see cref="RulesetContainer{TObject}"/> was created with.
|
||||||
@ -226,7 +220,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
private Container content;
|
private Container content;
|
||||||
private IEnumerable<Mod> mods;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether to assume the beatmap passed into this <see cref="RulesetContainer{TObject}"/> is for the current ruleset.
|
/// Whether to assume the beatmap passed into this <see cref="RulesetContainer{TObject}"/> is for the current ruleset.
|
||||||
@ -256,17 +249,24 @@ namespace osu.Game.Rulesets.UI
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager config)
|
private void load(OsuConfigManager config)
|
||||||
{
|
{
|
||||||
KeyBindingInputManager.Add(content = new Container
|
KeyBindingInputManager.Children = new Drawable[]
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
content = new Container
|
||||||
});
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
AddInternal(KeyBindingInputManager);
|
},
|
||||||
KeyBindingInputManager.Add(Playfield);
|
Playfield
|
||||||
|
};
|
||||||
|
|
||||||
if (Cursor != null)
|
if (Cursor != null)
|
||||||
KeyBindingInputManager.Add(Cursor);
|
KeyBindingInputManager.Add(Cursor);
|
||||||
|
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
KeyBindingInputManager,
|
||||||
|
Overlays = new Container { RelativeSizeAxes = Axes.Both }
|
||||||
|
};
|
||||||
|
|
||||||
// Apply mods
|
// Apply mods
|
||||||
applyRulesetMods(Mods, config);
|
applyRulesetMods(Mods, config);
|
||||||
|
|
||||||
@ -324,11 +324,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
mod.ApplyToDrawableHitObjects(Playfield.HitObjectContainer.Objects);
|
mod.ApplyToDrawableHitObjects(Playfield.HitObjectContainer.Objects);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the currently selected mods for this ruleset container.
|
|
||||||
/// </summary>
|
|
||||||
public IEnumerable<Mod> ActiveMods { get => Mods; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates and adds the visual representation of a <see cref="TObject"/> to this <see cref="RulesetContainer{TObject}"/>.
|
/// Creates and adds the visual representation of a <see cref="TObject"/> to this <see cref="RulesetContainer{TObject}"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -184,7 +184,6 @@ namespace osu.Game.Screens.Play
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = RulesetContainer
|
Child = RulesetContainer
|
||||||
},
|
},
|
||||||
RulesetContainer.Overlays,
|
|
||||||
new BreakOverlay(beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
|
new BreakOverlay(beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
Reference in New Issue
Block a user