mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 19:42:55 +08:00
Merge remote-tracking branch 'origin/master' into ruleset-beatmap-statistics
# Conflicts: # osu.Game/Beatmaps/Beatmap.cs
This commit is contained in:
commit
73465c35fa
@ -11,7 +11,7 @@ install:
|
|||||||
- cmd: git submodule update --init --recursive --depth=5
|
- cmd: git submodule update --init --recursive --depth=5
|
||||||
- cmd: choco install resharper-clt -y
|
- cmd: choco install resharper-clt -y
|
||||||
- cmd: choco install nvika -y
|
- cmd: choco install nvika -y
|
||||||
- cmd: appveyor DownloadFile https://github.com/peppy/CodeFileSanity/releases/download/v0.2.4/CodeFileSanity.exe
|
- cmd: appveyor DownloadFile https://github.com/peppy/CodeFileSanity/releases/download/v0.2.5/CodeFileSanity.exe
|
||||||
before_build:
|
before_build:
|
||||||
- cmd: CodeFileSanity.exe
|
- cmd: CodeFileSanity.exe
|
||||||
- cmd: nuget restore -verbosity quiet
|
- cmd: nuget restore -verbosity quiet
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// 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 osu.Framework.Timing;
|
|
||||||
using osu.Game.Beatmaps.Timing;
|
using osu.Game.Beatmaps.Timing;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
@ -16,8 +15,6 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
public TestCaseBreakOverlay()
|
public TestCaseBreakOverlay()
|
||||||
{
|
{
|
||||||
Clock = new FramedClock();
|
|
||||||
|
|
||||||
Child = breakOverlay = new BreakOverlay(true);
|
Child = breakOverlay = new BreakOverlay(true);
|
||||||
|
|
||||||
AddStep("2s break", () => startBreak(2000));
|
AddStep("2s break", () => startBreak(2000));
|
||||||
|
@ -12,50 +12,49 @@ using osu.Game.IO.Serialization.Converters;
|
|||||||
|
|
||||||
namespace osu.Game.Beatmaps
|
namespace osu.Game.Beatmaps
|
||||||
{
|
{
|
||||||
public interface IBeatmap : IJsonSerializable
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// This beatmap's info.
|
|
||||||
/// </summary>
|
|
||||||
BeatmapInfo BeatmapInfo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This beatmap's metadata.
|
|
||||||
/// </summary>
|
|
||||||
BeatmapMetadata Metadata { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The control points in this beatmap.
|
|
||||||
/// </summary>
|
|
||||||
ControlPointInfo ControlPointInfo { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The breaks in this beatmap.
|
|
||||||
/// </summary>
|
|
||||||
List<BreakPeriod> Breaks { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Total amount of break time in the beatmap.
|
|
||||||
/// </summary>
|
|
||||||
double TotalBreakTime { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The hitobjects contained by this beatmap.
|
|
||||||
/// </summary>
|
|
||||||
IEnumerable<HitObject> HitObjects { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns statistics of the <see cref="HitObjects"/> contained in this beatmap.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
IEnumerable<BeatmapStatistic> GetStatistics();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a shallow-clone of this beatmap and returns it.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>The shallow-cloned beatmap.</returns>
|
|
||||||
IBeatmap Clone();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Beatmap containing converted HitObjects.
|
/// A Beatmap containing converted HitObjects.
|
||||||
|
50
osu.Game/Beatmaps/IBeatmap.cs
Normal file
50
osu.Game/Beatmaps/IBeatmap.cs
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
using osu.Game.Beatmaps.Timing;
|
||||||
|
using osu.Game.IO.Serialization;
|
||||||
|
using osu.Game.Rulesets.Objects;
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps
|
||||||
|
{
|
||||||
|
public interface IBeatmap : IJsonSerializable
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This beatmap's info.
|
||||||
|
/// </summary>
|
||||||
|
BeatmapInfo BeatmapInfo { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This beatmap's metadata.
|
||||||
|
/// </summary>
|
||||||
|
BeatmapMetadata Metadata { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The control points in this beatmap.
|
||||||
|
/// </summary>
|
||||||
|
ControlPointInfo ControlPointInfo { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The breaks in this beatmap.
|
||||||
|
/// </summary>
|
||||||
|
List<BreakPeriod> Breaks { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Total amount of break time in the beatmap.
|
||||||
|
/// </summary>
|
||||||
|
double TotalBreakTime { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The hitobjects contained by this beatmap.
|
||||||
|
/// </summary>
|
||||||
|
IEnumerable<HitObject> HitObjects { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a shallow-clone of this beatmap and returns it.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The shallow-cloned beatmap.</returns>
|
||||||
|
IBeatmap Clone();
|
||||||
|
}
|
||||||
|
}
|
@ -12,10 +12,8 @@ using osu.Framework.Configuration;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Transforms;
|
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.MathUtils;
|
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
@ -181,7 +179,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
textbox.HoldFocus = false;
|
textbox.HoldFocus = false;
|
||||||
if (1f - ChatHeight.Value < channel_selection_min_height)
|
if (1f - ChatHeight.Value < channel_selection_min_height)
|
||||||
transformChatHeightTo(1f - channel_selection_min_height, 800, Easing.OutQuint);
|
this.TransformBindableTo(ChatHeight, 1f - channel_selection_min_height, 800, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
textbox.HoldFocus = true;
|
textbox.HoldFocus = true;
|
||||||
@ -533,26 +531,5 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
api.Queue(req);
|
api.Queue(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformChatHeightTo(double newChatHeight, double duration = 0, Easing easing = Easing.None)
|
|
||||||
{
|
|
||||||
this.TransformTo(this.PopulateTransform(new TransformChatHeight(), newChatHeight, duration, easing));
|
|
||||||
}
|
|
||||||
|
|
||||||
private class TransformChatHeight : Transform<double, ChatOverlay>
|
|
||||||
{
|
|
||||||
private double valueAt(double time)
|
|
||||||
{
|
|
||||||
if (time < StartTime) return StartValue;
|
|
||||||
if (time >= EndTime) return EndValue;
|
|
||||||
|
|
||||||
return Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string TargetMember => "ChatHeight.Value";
|
|
||||||
|
|
||||||
protected override void Apply(ChatOverlay d, double time) => d.ChatHeight.Value = valueAt(time);
|
|
||||||
protected override void ReadIntoStartValue(ChatOverlay d) => StartValue = d.ChatHeight.Value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// 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;
|
|
||||||
using OpenTK.Graphics;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -12,6 +10,8 @@ using osu.Game.Graphics.Containers;
|
|||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
using osu.Game.Overlays.SearchableList;
|
using osu.Game.Overlays.SearchableList;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Direct
|
namespace osu.Game.Overlays.Direct
|
||||||
{
|
{
|
||||||
@ -22,6 +22,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
|
|
||||||
protected override Color4 BackgroundColour => OsuColour.FromHex(@"384552");
|
protected override Color4 BackgroundColour => OsuColour.FromHex(@"384552");
|
||||||
protected override DirectSortCriteria DefaultTab => DirectSortCriteria.Ranked;
|
protected override DirectSortCriteria DefaultTab => DirectSortCriteria.Ranked;
|
||||||
|
|
||||||
protected override Drawable CreateSupplementaryControls()
|
protected override Drawable CreateSupplementaryControls()
|
||||||
{
|
{
|
||||||
modeButtons = new FillFlowContainer<RulesetToggleButton>
|
modeButtons = new FillFlowContainer<RulesetToggleButton>
|
||||||
@ -38,7 +39,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
{
|
{
|
||||||
DisplayStyleControl.Dropdown.AccentColour = colours.BlueDark;
|
DisplayStyleControl.Dropdown.AccentColour = colours.BlueDark;
|
||||||
|
|
||||||
Ruleset.BindTo(game?.Ruleset ?? new Bindable<RulesetInfo> { Value = rulesets.GetRuleset(0) });
|
Ruleset.Value = game?.Ruleset.Value ?? rulesets.GetRuleset(0);
|
||||||
foreach (var r in rulesets.AvailableRulesets)
|
foreach (var r in rulesets.AvailableRulesets)
|
||||||
{
|
{
|
||||||
modeButtons.Add(new RulesetToggleButton(Ruleset, r));
|
modeButtons.Add(new RulesetToggleButton(Ruleset, r));
|
||||||
@ -49,14 +50,15 @@ namespace osu.Game.Overlays.Direct
|
|||||||
{
|
{
|
||||||
private Drawable icon
|
private Drawable icon
|
||||||
{
|
{
|
||||||
get { return iconContainer.Icon; }
|
get => iconContainer.Icon;
|
||||||
set { iconContainer.Icon = value; }
|
set => iconContainer.Icon = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private RulesetInfo ruleset;
|
private RulesetInfo ruleset;
|
||||||
|
|
||||||
public RulesetInfo Ruleset
|
public RulesetInfo Ruleset
|
||||||
{
|
{
|
||||||
get { return ruleset; }
|
get => ruleset;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
ruleset = value;
|
ruleset = value;
|
||||||
@ -73,6 +75,9 @@ namespace osu.Game.Overlays.Direct
|
|||||||
iconContainer.FadeTo(Ruleset.ID == obj?.ID ? 1f : 0.5f, 100);
|
iconContainer.FadeTo(Ruleset.ID == obj?.ID ? 1f : 0.5f, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool HandleKeyboardInput => !bindable.Disabled && base.HandleKeyboardInput;
|
||||||
|
public override bool HandleMouseInput => !bindable.Disabled && base.HandleMouseInput;
|
||||||
|
|
||||||
public RulesetToggleButton(Bindable<RulesetInfo> bindable, RulesetInfo ruleset)
|
public RulesetToggleButton(Bindable<RulesetInfo> bindable, RulesetInfo ruleset)
|
||||||
{
|
{
|
||||||
this.bindable = bindable;
|
this.bindable = bindable;
|
||||||
|
@ -87,8 +87,8 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
ruleset.Value = rulesets.AvailableRulesets.FirstOrDefault();
|
ruleset.Value = rulesets.AvailableRulesets.FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleKeyboardInput => !ruleset.Disabled;
|
public override bool HandleKeyboardInput => !ruleset.Disabled && base.HandleKeyboardInput;
|
||||||
public override bool HandleMouseInput => !ruleset.Disabled;
|
public override bool HandleMouseInput => !ruleset.Disabled && base.HandleMouseInput;
|
||||||
|
|
||||||
private void disabledChanged(bool isDisabled) => this.FadeColour(isDisabled ? Color4.Gray : Color4.White, 300);
|
private void disabledChanged(bool isDisabled) => this.FadeColour(isDisabled ? Color4.Gray : Color4.White, 300);
|
||||||
|
|
||||||
|
@ -4,9 +4,7 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Transforms;
|
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.MathUtils;
|
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
|
|
||||||
@ -90,10 +88,10 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
switch (args.Key)
|
switch (args.Key)
|
||||||
{
|
{
|
||||||
case Key.Minus:
|
case Key.Minus:
|
||||||
transformVisibleTimeRangeTo(VisibleTimeRange + time_span_step, 200, Easing.OutQuint);
|
this.TransformBindableTo(VisibleTimeRange, VisibleTimeRange + time_span_step, 200, Easing.OutQuint);
|
||||||
break;
|
break;
|
||||||
case Key.Plus:
|
case Key.Plus:
|
||||||
transformVisibleTimeRangeTo(VisibleTimeRange - time_span_step, 200, Easing.OutQuint);
|
this.TransformBindableTo(VisibleTimeRange, VisibleTimeRange - time_span_step, 200, Easing.OutQuint);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,27 +99,6 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformVisibleTimeRangeTo(double newTimeRange, double duration = 0, Easing easing = Easing.None)
|
|
||||||
{
|
|
||||||
this.TransformTo(this.PopulateTransform(new TransformVisibleTimeRange(), newTimeRange, duration, easing));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected sealed override HitObjectContainer CreateHitObjectContainer() => new ScrollingHitObjectContainer(direction);
|
protected sealed override HitObjectContainer CreateHitObjectContainer() => new ScrollingHitObjectContainer(direction);
|
||||||
|
|
||||||
private class TransformVisibleTimeRange : Transform<double, ScrollingPlayfield>
|
|
||||||
{
|
|
||||||
private double valueAt(double time)
|
|
||||||
{
|
|
||||||
if (time < StartTime) return StartValue;
|
|
||||||
if (time >= EndTime) return EndValue;
|
|
||||||
|
|
||||||
return Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string TargetMember => "VisibleTimeRange.Value";
|
|
||||||
|
|
||||||
protected override void Apply(ScrollingPlayfield d, double time) => d.VisibleTimeRange.Value = valueAt(time);
|
|
||||||
protected override void ReadIntoStartValue(ScrollingPlayfield d) => StartValue = d.VisibleTimeRange.Value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4");
|
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4");
|
||||||
|
|
||||||
public override bool ShowOverlaysOnEnter => false;
|
public override bool ShowOverlaysOnEnter => false;
|
||||||
|
public override bool AllowBeatmapRulesetChange => false;
|
||||||
|
|
||||||
private Box bottomBackground;
|
private Box bottomBackground;
|
||||||
private Container screenContainer;
|
private Container screenContainer;
|
||||||
|
Loading…
Reference in New Issue
Block a user