mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Merge branch 'master' into beatmap_parsing
Conflicts: osu.Desktop.VisualTests/app.config osu.Game.Modes.Catch/CatchRuleset.cs osu.Game.Modes.Mania/ManiaRuleset.cs osu.Game.Modes.Mania/app.config osu.Game.Modes.Osu/OsuRuleset.cs osu.Game.Modes.Osu/app.config osu.Game.Modes.Taiko/TaikoRuleset.cs osu.Game/Modes/Ruleset.cs osu.Game/app.config osu.Game/osu.Game.csproj
This commit is contained in:
@ -1,9 +1,6 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
@ -11,6 +8,10 @@ using osu.Game.Beatmaps.Formats;
|
||||
using osu.Game.Beatmaps.IO;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Modes.Mods;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace osu.Game.Beatmaps
|
||||
{
|
||||
|
@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Game.Input.Handlers;
|
||||
@ -95,24 +96,17 @@ namespace osu.Game.Modes
|
||||
|
||||
public override List<InputState> GetPendingStates()
|
||||
{
|
||||
var buttons = new HashSet<MouseButton>();
|
||||
if (CurrentFrame?.MouseLeft ?? false)
|
||||
buttons.Add(MouseButton.Left);
|
||||
if (CurrentFrame?.MouseRight ?? false)
|
||||
buttons.Add(MouseButton.Right);
|
||||
|
||||
return new List<InputState>
|
||||
{
|
||||
new InputState
|
||||
{
|
||||
Mouse = new ReplayMouseState(
|
||||
ToScreenSpace(position ?? Vector2.Zero),
|
||||
new List<MouseState.ButtonState>
|
||||
{
|
||||
new MouseState.ButtonState(MouseButton.Left)
|
||||
{
|
||||
State = CurrentFrame?.MouseLeft ?? false
|
||||
},
|
||||
new MouseState.ButtonState(MouseButton.Right)
|
||||
{
|
||||
State = CurrentFrame?.MouseRight ?? false
|
||||
},
|
||||
}
|
||||
),
|
||||
Mouse = new ReplayMouseState(ToScreenSpace(position ?? Vector2.Zero), buttons),
|
||||
Keyboard = new ReplayKeyboardState(new List<Key>())
|
||||
}
|
||||
};
|
||||
@ -171,10 +165,10 @@ namespace osu.Game.Modes
|
||||
|
||||
private class ReplayMouseState : MouseState
|
||||
{
|
||||
public ReplayMouseState(Vector2 position, List<ButtonState> list)
|
||||
public ReplayMouseState(Vector2 position, IEnumerable<MouseButton> list)
|
||||
{
|
||||
Position = position;
|
||||
ButtonStates = list;
|
||||
list.ForEach(b => PressedButtons.Add(b));
|
||||
}
|
||||
}
|
||||
|
||||
|
23
osu.Game/Modes/Mods/IApplicableMod.cs
Normal file
23
osu.Game/Modes/Mods/IApplicableMod.cs
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
|
||||
using osu.Game.Modes.Objects;
|
||||
using osu.Game.Modes.UI;
|
||||
|
||||
namespace osu.Game.Modes.Mods
|
||||
{
|
||||
/// <summary>
|
||||
/// An interface for mods that are applied to a HitRenderer.
|
||||
/// </summary>
|
||||
/// <typeparam name="TObject">The type of HitObject the HitRenderer contains.</typeparam>
|
||||
public interface IApplicableMod<TObject>
|
||||
where TObject : HitObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Applies the mod to a HitRenderer.
|
||||
/// </summary>
|
||||
/// <param name="hitRenderer">The HitRenderer to apply the mod to.</param>
|
||||
void Apply(HitRenderer<TObject> hitRenderer);
|
||||
}
|
||||
}
|
@ -1,11 +1,13 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Modes.Objects;
|
||||
using osu.Game.Modes.UI;
|
||||
using System;
|
||||
|
||||
namespace osu.Game.Modes
|
||||
namespace osu.Game.Modes.Mods
|
||||
{
|
||||
/// <summary>
|
||||
/// The base class for gameplay modifiers.
|
||||
@ -41,12 +43,6 @@ namespace osu.Game.Modes
|
||||
/// The mods this mod cannot be enabled with.
|
||||
/// </summary>
|
||||
public virtual Type[] IncompatibleMods => new Type[] { };
|
||||
|
||||
/// <summary>
|
||||
/// Direct access to the Player before load has run.
|
||||
/// </summary>
|
||||
/// <param name="player"></param>
|
||||
public virtual void PlayerLoading(Player player) { }
|
||||
}
|
||||
|
||||
public class MultiMod : Mod
|
||||
@ -151,11 +147,16 @@ namespace osu.Game.Modes
|
||||
public override string Description => "Watch a perfect automated play through the song";
|
||||
public override double ScoreMultiplier => 0;
|
||||
public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail) };
|
||||
}
|
||||
|
||||
public override void PlayerLoading(Player player)
|
||||
public abstract class ModAutoplay<T> : ModAutoplay, IApplicableMod<T>
|
||||
where T : HitObject
|
||||
{
|
||||
protected abstract Score CreateReplayScore(Beatmap<T> beatmap);
|
||||
|
||||
public void Apply(HitRenderer<T> hitRenderer)
|
||||
{
|
||||
base.PlayerLoading(player);
|
||||
player.ReplayInputHandler = Ruleset.GetRuleset(player.Beatmap.PlayMode).CreateAutoplayScore(player.Beatmap.Beatmap)?.Replay?.GetInputHandler();
|
||||
hitRenderer.InputManager.ReplayInputHandler = CreateReplayScore(hitRenderer.Beatmap)?.Replay?.GetInputHandler();
|
||||
}
|
||||
}
|
||||
|
||||
@ -170,11 +171,4 @@ namespace osu.Game.Modes
|
||||
public override string Name => "Cinema";
|
||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_cinema;
|
||||
}
|
||||
|
||||
public enum ModType
|
||||
{
|
||||
DifficultyReduction,
|
||||
DifficultyIncrease,
|
||||
Special,
|
||||
}
|
||||
}
|
12
osu.Game/Modes/Mods/ModType.cs
Normal file
12
osu.Game/Modes/Mods/ModType.cs
Normal file
@ -0,0 +1,12 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Modes.Mods
|
||||
{
|
||||
public enum ModType
|
||||
{
|
||||
DifficultyReduction,
|
||||
DifficultyIncrease,
|
||||
Special,
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@
|
||||
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Modes.Mods;
|
||||
using osu.Game.Modes.UI;
|
||||
using osu.Game.Screens.Play;
|
||||
using System;
|
||||
@ -30,7 +31,7 @@ namespace osu.Game.Modes
|
||||
|
||||
public abstract ScoreProcessor CreateScoreProcessor(int hitObjectCount = 0);
|
||||
|
||||
public abstract HitRenderer CreateHitRendererWith(Beatmap beatmap);
|
||||
public abstract HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap);
|
||||
|
||||
public abstract DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap);
|
||||
|
||||
@ -44,8 +45,6 @@ namespace osu.Game.Modes
|
||||
|
||||
public abstract IEnumerable<KeyCounter> CreateGameplayKeys();
|
||||
|
||||
public virtual Score CreateAutoplayScore(Beatmap beatmap) => null;
|
||||
|
||||
public static Ruleset GetRuleset(PlayMode mode)
|
||||
{
|
||||
Type type;
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Modes.Mods;
|
||||
using osu.Game.Modes.Objects;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Screens.Play;
|
||||
@ -22,11 +22,6 @@ namespace osu.Game.Modes.UI
|
||||
|
||||
internal readonly PlayerInputManager InputManager = new PlayerInputManager();
|
||||
|
||||
/// <summary>
|
||||
/// A function to convert coordinates from gamefield to screen space.
|
||||
/// </summary>
|
||||
public abstract Func<Vector2, Vector2> MapPlayfieldToScreenSpace { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether all the HitObjects have been judged.
|
||||
/// </summary>
|
||||
@ -44,20 +39,22 @@ namespace osu.Game.Modes.UI
|
||||
public abstract class HitRenderer<TObject> : HitRenderer
|
||||
where TObject : HitObject
|
||||
{
|
||||
public override Func<Vector2, Vector2> MapPlayfieldToScreenSpace => Playfield.ScaledContent.ToScreenSpace;
|
||||
public Beatmap<TObject> Beatmap;
|
||||
|
||||
public IEnumerable<DrawableHitObject> DrawableObjects => Playfield.HitObjects.Children;
|
||||
|
||||
protected override Container<Drawable> Content => content;
|
||||
protected override bool AllObjectsJudged => Playfield.HitObjects.Children.All(h => h.Judgement.Result.HasValue);
|
||||
|
||||
protected Playfield<TObject> Playfield;
|
||||
protected Beatmap<TObject> Beatmap;
|
||||
|
||||
private Container content;
|
||||
|
||||
protected HitRenderer(Beatmap beatmap)
|
||||
protected HitRenderer(WorkingBeatmap beatmap)
|
||||
{
|
||||
Beatmap = CreateBeatmapConverter().Convert(beatmap);
|
||||
Beatmap = CreateBeatmapConverter().Convert(beatmap.Beatmap);
|
||||
|
||||
applyMods(beatmap.Mods.Value);
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
@ -78,6 +75,9 @@ namespace osu.Game.Modes.UI
|
||||
private void load()
|
||||
{
|
||||
loadObjects();
|
||||
|
||||
if (InputManager?.ReplayInputHandler != null)
|
||||
InputManager.ReplayInputHandler.ToScreenSpace = Playfield.ScaledContent.ToScreenSpace;
|
||||
}
|
||||
|
||||
private void loadObjects()
|
||||
@ -97,6 +97,15 @@ namespace osu.Game.Modes.UI
|
||||
Playfield.PostProcess();
|
||||
}
|
||||
|
||||
private void applyMods(IEnumerable<Mod> mods)
|
||||
{
|
||||
if (mods == null)
|
||||
return;
|
||||
|
||||
foreach (var mod in mods.OfType<IApplicableMod<TObject>>())
|
||||
mod.Apply(this);
|
||||
}
|
||||
|
||||
private void onJudgement(DrawableHitObject<TObject> o, JudgementInfo j) => TriggerOnJudgement(j);
|
||||
|
||||
protected abstract DrawableHitObject<TObject> GetVisualRepresentation(TObject h);
|
||||
|
@ -258,13 +258,13 @@ namespace osu.Game
|
||||
return false;
|
||||
}
|
||||
|
||||
public event Action<Screen> ModeChanged;
|
||||
public event Action<Screen> ScreenChanged;
|
||||
|
||||
private Container mainContent;
|
||||
|
||||
private Container overlayContent;
|
||||
|
||||
private void modeChanged(Screen newScreen)
|
||||
private void screenChanged(Screen newScreen)
|
||||
{
|
||||
//central game mode change logic.
|
||||
if ((newScreen as OsuScreen)?.ShowOverlays != true)
|
||||
@ -281,7 +281,7 @@ namespace osu.Game
|
||||
if (newScreen is MainMenu)
|
||||
Cursor.FadeIn(100);
|
||||
|
||||
ModeChanged?.Invoke(newScreen);
|
||||
ScreenChanged?.Invoke(newScreen);
|
||||
|
||||
if (newScreen == null)
|
||||
Exit();
|
||||
@ -315,12 +315,12 @@ namespace osu.Game
|
||||
newScreen.ModePushed += screenAdded;
|
||||
newScreen.Exited += screenRemoved;
|
||||
|
||||
modeChanged(newScreen);
|
||||
screenChanged(newScreen);
|
||||
}
|
||||
|
||||
private void screenRemoved(Screen newScreen)
|
||||
{
|
||||
modeChanged(newScreen);
|
||||
screenChanged(newScreen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
using OpenTK.Input;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Modes.Mods;
|
||||
|
||||
namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
|
@ -4,7 +4,7 @@
|
||||
using OpenTK.Input;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Modes.Mods;
|
||||
|
||||
namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
|
@ -4,7 +4,7 @@
|
||||
using OpenTK.Input;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Modes.Mods;
|
||||
|
||||
namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
|
@ -1,8 +1,6 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK.Input;
|
||||
@ -15,8 +13,10 @@ using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Modes.Mods;
|
||||
using osu.Game.Modes.UI;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
|
@ -1,7 +1,6 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK.Input;
|
||||
@ -10,7 +9,8 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Modes.Mods;
|
||||
using System;
|
||||
|
||||
namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
|
@ -1,11 +1,9 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
@ -13,11 +11,14 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Backgrounds;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Modes.Mods;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
|
@ -210,7 +210,7 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.beatmaps = beatmaps;
|
||||
trackManager = osuGame.Audio.Track;
|
||||
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
|
||||
@ -247,6 +247,8 @@ namespace osu.Game.Overlays
|
||||
|
||||
if (current.Track.HasCompleted && !current.Track.Looping) next();
|
||||
}
|
||||
else
|
||||
playButton.Icon = FontAwesome.fa_play_circle_o;
|
||||
}
|
||||
|
||||
private void preferUnicode_changed(object sender, EventArgs e)
|
||||
@ -337,12 +339,16 @@ namespace osu.Game.Overlays
|
||||
Task.Run(() =>
|
||||
{
|
||||
if (beatmap?.Beatmap == null)
|
||||
//todo: we may need to display some default text here (currently in the constructor).
|
||||
return;
|
||||
|
||||
BeatmapMetadata metadata = beatmap.Beatmap.BeatmapInfo.Metadata;
|
||||
title.Text = unicodeString(metadata.Title, metadata.TitleUnicode);
|
||||
artist.Text = unicodeString(metadata.Artist, metadata.ArtistUnicode);
|
||||
{
|
||||
title.Text = @"Nothing to play";
|
||||
artist.Text = @"Nothing to play";
|
||||
}
|
||||
else
|
||||
{
|
||||
BeatmapMetadata metadata = beatmap.Beatmap.BeatmapInfo.Metadata;
|
||||
title.Text = unicodeString(metadata.Title, metadata.TitleUnicode);
|
||||
artist.Text = unicodeString(metadata.Artist, metadata.ArtistUnicode);
|
||||
}
|
||||
});
|
||||
|
||||
MusicControllerBackground newBackground;
|
||||
|
@ -7,7 +7,6 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
@ -69,8 +68,6 @@ namespace osu.Game.Screens.Play
|
||||
return;
|
||||
}
|
||||
|
||||
Beatmap.Mods.Value.ForEach(m => m.PlayerLoading(this));
|
||||
|
||||
dimLevel = config.GetBindable<int>(OsuConfig.DimLevel);
|
||||
mouseWheelDisabled = config.GetBindable<bool>(OsuConfig.MouseDisableWheel);
|
||||
|
||||
@ -128,13 +125,10 @@ namespace osu.Game.Screens.Play
|
||||
OnQuit = Exit
|
||||
};
|
||||
|
||||
hitRenderer = ruleset.CreateHitRendererWith(beatmap);
|
||||
hitRenderer = ruleset.CreateHitRendererWith(Beatmap);
|
||||
|
||||
if (ReplayInputHandler != null)
|
||||
{
|
||||
ReplayInputHandler.ToScreenSpace = hitRenderer.MapPlayfieldToScreenSpace;
|
||||
hitRenderer.InputManager.ReplayInputHandler = ReplayInputHandler;
|
||||
}
|
||||
|
||||
hudOverlay.BindHitRenderer(hitRenderer);
|
||||
|
||||
@ -305,7 +299,8 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
if (pauseOverlay == null) return false;
|
||||
|
||||
if (ReplayInputHandler != null) return false;
|
||||
if (hitRenderer.InputManager.ReplayInputHandler != null)
|
||||
return false;
|
||||
|
||||
if (pauseOverlay.State != Visibility.Visible && !canPause) return true;
|
||||
|
||||
|
@ -70,14 +70,14 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
if (mouseDisabled.Value)
|
||||
{
|
||||
mouse.ButtonStates.Find(s => s.Button == MouseButton.Left).State = false;
|
||||
mouse.ButtonStates.Find(s => s.Button == MouseButton.Right).State = false;
|
||||
mouse.PressedButtons.Remove(MouseButton.Left);
|
||||
mouse.PressedButtons.Remove(MouseButton.Right);
|
||||
}
|
||||
|
||||
if (leftViaKeyboard)
|
||||
mouse.ButtonStates.Find(s => s.Button == MouseButton.Left).State = true;
|
||||
mouse.PressedButtons.Add(MouseButton.Left);
|
||||
if (rightViaKeyboard)
|
||||
mouse.ButtonStates.Find(s => s.Button == MouseButton.Right).State = true;
|
||||
mouse.PressedButtons.Add(MouseButton.Right);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,6 @@ using osu.Game.Database;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using System.Linq;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
@ -58,8 +57,15 @@ namespace osu.Game.Screens.Select
|
||||
public void UpdateBeatmap(WorkingBeatmap beatmap)
|
||||
{
|
||||
if (beatmap?.BeatmapInfo == null)
|
||||
{
|
||||
FadeOut(250);
|
||||
beatmapInfoContainer?.FadeOut(250);
|
||||
beatmapInfoContainer?.Expire();
|
||||
beatmapInfoContainer = null;
|
||||
return;
|
||||
}
|
||||
|
||||
FadeIn(250);
|
||||
var lastContainer = beatmapInfoContainer;
|
||||
|
||||
float newDepth = lastContainer?.Depth + 1 ?? 0;
|
||||
@ -89,7 +95,7 @@ namespace osu.Game.Screens.Select
|
||||
}));
|
||||
|
||||
//get statistics fromt he current ruleset.
|
||||
Ruleset.GetRuleset(beatmap.BeatmapInfo.Mode).GetBeatmapStatistics(beatmap).ForEach(s => labels.Add(new InfoLabel(s)));
|
||||
labels.AddRange(Ruleset.GetRuleset(beatmap.BeatmapInfo.Mode).GetBeatmapStatistics(beatmap).Select(s => new InfoLabel(s)));
|
||||
}
|
||||
|
||||
(beatmapInfoContainer = new BufferedContainer
|
||||
@ -196,7 +202,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private string getBPMRange(Beatmap beatmap)
|
||||
{
|
||||
double bpmMax = beatmap.BPMMaximum;
|
||||
double bpmMax = beatmap.BPMMaximum;
|
||||
double bpmMin = beatmap.BPMMinimum;
|
||||
|
||||
if (Precision.AlmostEquals(bpmMin, bpmMax)) return Math.Round(bpmMin) + "bpm";
|
||||
|
@ -57,6 +57,7 @@ namespace osu.Game.Screens.Select
|
||||
public void RemoveGroup(BeatmapGroup group)
|
||||
{
|
||||
groups.Remove(group);
|
||||
panels.Remove(group.Header);
|
||||
foreach (var p in group.BeatmapPanels)
|
||||
panels.Remove(p);
|
||||
|
||||
|
@ -326,8 +326,7 @@ namespace osu.Game.Screens.Select
|
||||
backgroundModeBeatmap.FadeTo(1, 250);
|
||||
}
|
||||
|
||||
if (beatmap != null)
|
||||
beatmapInfoWedge.UpdateBeatmap(beatmap);
|
||||
beatmapInfoWedge.UpdateBeatmap(beatmap);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -337,11 +336,11 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
base.OnBeatmapChanged(beatmap);
|
||||
|
||||
beatmap.Mods.BindTo(modSelect.SelectedMods);
|
||||
beatmap?.Mods.BindTo(modSelect.SelectedMods);
|
||||
|
||||
//todo: change background in selectionChanged instead; support per-difficulty backgrounds.
|
||||
changeBackground(beatmap);
|
||||
carousel.SelectBeatmap(beatmap.BeatmapInfo);
|
||||
carousel.SelectBeatmap(beatmap?.BeatmapInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
-->
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
@ -91,6 +91,8 @@
|
||||
<Compile Include="IO\Legacy\SerializationWriter.cs" />
|
||||
<Compile Include="IPC\ScoreIPCChannel.cs" />
|
||||
<Compile Include="Modes\LegacyReplay.cs" />
|
||||
<Compile Include="Modes\Mods\IApplicableMod.cs" />
|
||||
<Compile Include="Modes\Mods\ModType.cs" />
|
||||
<Compile Include="Modes\Objects\Hit.cs" />
|
||||
<Compile Include="Modes\Objects\IHitObjectConverter.cs" />
|
||||
<Compile Include="Modes\Objects\LegacyHitObjectParser.cs" />
|
||||
@ -317,7 +319,7 @@
|
||||
<Compile Include="Screens\Play\Pause\RetryButton.cs" />
|
||||
<Compile Include="Screens\Play\Pause\QuitButton.cs" />
|
||||
<Compile Include="Overlays\Mods\ModSelectOverlay.cs" />
|
||||
<Compile Include="Modes\Mod.cs" />
|
||||
<Compile Include="Modes\Mods\Mod.cs" />
|
||||
<Compile Include="Overlays\Mods\ModButton.cs" />
|
||||
<Compile Include="Modes\UI\ModIcon.cs" />
|
||||
<Compile Include="Overlays\Mods\ModSection.cs" />
|
||||
@ -353,7 +355,6 @@
|
||||
<None Include="..\osu.licenseheader">
|
||||
<Link>osu.licenseheader</Link>
|
||||
</None>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
|
Reference in New Issue
Block a user