mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:52:53 +08:00
Merge remote-tracking branch 'upstream/master' into catch-improvements
This commit is contained in:
commit
d234791bdd
@ -1 +1 @@
|
||||
Subproject commit 07e84f60b0d2ee443f366cb2e34bf25b680983dd
|
||||
Subproject commit 255b94f5dde0188db1a5b37daf9649659e2b8366
|
@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
if (records.Count > 0)
|
||||
{
|
||||
var record = records.Peek();
|
||||
while (Time.Current - records.Peek().Time > spm_count_duration)
|
||||
while (records.Count > 0 && Time.Current - records.Peek().Time > spm_count_duration)
|
||||
record = records.Dequeue();
|
||||
SpinsPerMinute = (currentRotation - record.Rotation) / (Time.Current - record.Time) * 1000 * 60 / 360;
|
||||
}
|
||||
|
@ -573,6 +573,8 @@ namespace osu.Game.Beatmaps
|
||||
}
|
||||
catch { return new TrackVirtual(); }
|
||||
}
|
||||
|
||||
protected override Waveform GetWaveform() => new Waveform(store.GetStream(getPathForFile(Metadata.AudioFile)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -43,6 +43,7 @@ namespace osu.Game.Beatmaps
|
||||
protected abstract Beatmap GetBeatmap();
|
||||
protected abstract Texture GetBackground();
|
||||
protected abstract Track GetTrack();
|
||||
protected virtual Waveform GetWaveform() => new Waveform();
|
||||
|
||||
private Beatmap beatmap;
|
||||
private readonly object beatmapLock = new object();
|
||||
@ -96,6 +97,17 @@ namespace osu.Game.Beatmaps
|
||||
}
|
||||
}
|
||||
|
||||
private Waveform waveform;
|
||||
private readonly object waveformLock = new object();
|
||||
public Waveform Waveform
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (waveformLock)
|
||||
return waveform ?? (waveform = GetWaveform());
|
||||
}
|
||||
}
|
||||
|
||||
public bool TrackLoaded => track != null;
|
||||
|
||||
public void TransferTo(WorkingBeatmap other)
|
||||
@ -114,6 +126,8 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
background?.Dispose();
|
||||
background = null;
|
||||
|
||||
waveform?.Dispose();
|
||||
}
|
||||
|
||||
public void DisposeTrack()
|
||||
|
@ -1,27 +0,0 @@
|
||||
// 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.Framework.Graphics.Containers;
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics;
|
||||
|
||||
namespace osu.Game.Graphics.Processing
|
||||
{
|
||||
internal class RatioAdjust : Container
|
||||
{
|
||||
public RatioAdjust()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
Vector2 parent = Parent.DrawSize;
|
||||
|
||||
Scale = new Vector2(Math.Min(parent.Y / 768f, parent.X / 1024f));
|
||||
Size = new Vector2(1 / Scale.X);
|
||||
}
|
||||
}
|
||||
}
|
@ -27,13 +27,28 @@ namespace osu.Game.Graphics.UserInterface
|
||||
set { flashColour = value; }
|
||||
}
|
||||
|
||||
private Color4? iconColour;
|
||||
/// <summary>
|
||||
/// The icon colour. This does not affect <see cref="IconButton.Colour"/>.
|
||||
/// </summary>
|
||||
public Color4 IconColour
|
||||
{
|
||||
get { return icon.Colour; }
|
||||
set { icon.Colour = value; }
|
||||
get { return iconColour ?? Color4.White; }
|
||||
set
|
||||
{
|
||||
iconColour = value;
|
||||
icon.Colour = value;
|
||||
}
|
||||
}
|
||||
|
||||
private Color4? iconHoverColour;
|
||||
/// <summary>
|
||||
/// The icon colour while the <see cref="IconButton"/> is hovered.
|
||||
/// </summary>
|
||||
public Color4 IconHoverColour
|
||||
{
|
||||
get { return iconHoverColour ?? IconColour; }
|
||||
set { iconHoverColour = value; }
|
||||
}
|
||||
|
||||
private Color4? hoverColour;
|
||||
@ -133,12 +148,14 @@ namespace osu.Game.Graphics.UserInterface
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
hover.FadeIn(500, Easing.OutQuint);
|
||||
icon.FadeColour(IconHoverColour, 500, Easing.OutQuint);
|
||||
return base.OnHover(state);
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(InputState state)
|
||||
{
|
||||
hover.FadeOut(500, Easing.OutQuint);
|
||||
icon.FadeColour(IconColour, 500, Easing.OutQuint);
|
||||
base.OnHoverLost(state);
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace osu.Game.Online.API.Requests
|
||||
private int onlineId { get; set; }
|
||||
|
||||
[JsonProperty(@"creator")]
|
||||
private string creatorUsername;
|
||||
private string creatorUsername { get; set; }
|
||||
|
||||
[JsonProperty(@"user_id")]
|
||||
private long creatorId = 1;
|
||||
|
@ -15,7 +15,6 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Graphics.Processing;
|
||||
using osu.Game.Online.API;
|
||||
using SQLite.Net;
|
||||
using osu.Framework.Graphics.Performance;
|
||||
@ -186,7 +185,7 @@ namespace osu.Game
|
||||
|
||||
GlobalKeyBindingInputManager globalBinding;
|
||||
|
||||
base.Content.Add(new RatioAdjust
|
||||
base.Content.Add(new DrawSizePreservingFillContainer
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
|
@ -159,7 +159,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -90,6 +90,7 @@ namespace osu.Game.Overlays.MedalSplash
|
||||
},
|
||||
description = new TextFlowContainer
|
||||
{
|
||||
TextAnchor = Anchor.TopCentre,
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
@ -115,15 +116,16 @@ namespace osu.Game.Overlays.MedalSplash
|
||||
medalSprite.Texture = textures.Get(medal.ImageUrl);
|
||||
medalGlow.Texture = textures.Get(@"MedalSplash/medal-glow");
|
||||
description.Colour = colours.BlueLight;
|
||||
|
||||
unlocked.Position = new Vector2(0f, medalContainer.Size.Y / 2 + 10);
|
||||
infoFlow.Position = new Vector2(0f, unlocked.Position.Y + 90);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
updateState();
|
||||
|
||||
unlocked.Position = new Vector2(0f, medalContainer.DrawSize.Y / 2 + 10);
|
||||
infoFlow.Position = new Vector2(0f, unlocked.Position.Y + 90);
|
||||
}
|
||||
|
||||
public DisplayState State
|
||||
@ -172,6 +174,7 @@ namespace osu.Game.Overlays.MedalSplash
|
||||
|
||||
this.ScaleTo(scale_when_full, duration, Easing.OutExpo);
|
||||
this.MoveToY(MedalOverlay.DISC_SIZE / 2 - 60, duration, Easing.OutExpo);
|
||||
unlocked.Show();
|
||||
name.FadeInFromZero(duration + 100);
|
||||
description.FadeInFromZero(duration * 2);
|
||||
break;
|
||||
|
@ -6,6 +6,7 @@ using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Screens.Edit.Screens.Compose.Timeline;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Screens.Compose
|
||||
{
|
||||
@ -13,6 +14,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose
|
||||
{
|
||||
public Compose()
|
||||
{
|
||||
ScrollableTimeline timeline;
|
||||
Children = new[]
|
||||
{
|
||||
new Container
|
||||
@ -31,11 +33,22 @@ namespace osu.Game.Screens.Edit.Screens.Compose
|
||||
{
|
||||
Name = "Content",
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding { Horizontal = 17, Vertical = 10 }
|
||||
Padding = new MarginPadding { Horizontal = 17, Vertical = 10 },
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding { Right = 115 },
|
||||
Child = timeline = new ScrollableTimeline { RelativeSizeAxes = Axes.Both }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
timeline.Beatmap.BindTo(Beatmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
// 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.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Audio;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Beatmaps;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
|
||||
{
|
||||
public class BeatmapWaveformGraph : CompositeDrawable
|
||||
{
|
||||
public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
private readonly WaveformGraph graph;
|
||||
|
||||
public BeatmapWaveformGraph()
|
||||
{
|
||||
InternalChild = graph = new WaveformGraph { RelativeSizeAxes = Axes.Both };
|
||||
Beatmap.ValueChanged += b => graph.Waveform = b.Waveform;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="WaveformGraph.Resolution"/>.
|
||||
/// </summary>
|
||||
public float Resolution
|
||||
{
|
||||
get { return graph.Resolution; }
|
||||
set { graph.Resolution = value; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
// 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.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
|
||||
{
|
||||
public class ScrollableTimeline : CompositeDrawable
|
||||
{
|
||||
public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
private readonly ScrollingTimelineContainer timelineContainer;
|
||||
|
||||
public ScrollableTimeline()
|
||||
{
|
||||
Masking = true;
|
||||
CornerRadius = 5;
|
||||
|
||||
OsuCheckbox hitObjectsCheckbox;
|
||||
OsuCheckbox hitSoundsCheckbox;
|
||||
OsuCheckbox waveformCheckbox;
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = OsuColour.FromHex("111")
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Container
|
||||
{
|
||||
AutoSizeAxes = Axes.X,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = OsuColour.FromHex("222")
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Width = 160,
|
||||
Padding = new MarginPadding { Horizontal = 15 },
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, 4),
|
||||
Children = new[]
|
||||
{
|
||||
hitObjectsCheckbox = new OsuCheckbox { LabelText = "Hitobjects" },
|
||||
hitSoundsCheckbox = new OsuCheckbox { LabelText = "Hitsounds" },
|
||||
waveformCheckbox = new OsuCheckbox { LabelText = "Waveform" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
new Container
|
||||
{
|
||||
AutoSizeAxes = Axes.X,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = OsuColour.FromHex("333")
|
||||
},
|
||||
new Container<TimelineButton>
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
AutoSizeAxes = Axes.X,
|
||||
Masking = true,
|
||||
Children = new[]
|
||||
{
|
||||
new TimelineButton
|
||||
{
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Height = 0.5f,
|
||||
Icon = FontAwesome.fa_search_plus,
|
||||
Action = () => timelineContainer.Zoom++
|
||||
},
|
||||
new TimelineButton
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Height = 0.5f,
|
||||
Icon = FontAwesome.fa_search_minus,
|
||||
Action = () => timelineContainer.Zoom--
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
timelineContainer = new ScrollingTimelineContainer { RelativeSizeAxes = Axes.Y }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
hitObjectsCheckbox.Current.Value = true;
|
||||
hitSoundsCheckbox.Current.Value = true;
|
||||
waveformCheckbox.Current.Value = true;
|
||||
|
||||
timelineContainer.Beatmap.BindTo(Beatmap);
|
||||
timelineContainer.WaveformVisible.BindTo(waveformCheckbox.Current);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
timelineContainer.Size = new Vector2(DrawSize.X - timelineContainer.DrawPosition.X, 1);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
// 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 osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
|
||||
{
|
||||
internal class ScrollingTimelineContainer : ScrollContainer
|
||||
{
|
||||
public readonly Bindable<bool> HitObjectsVisible = new Bindable<bool>();
|
||||
public readonly Bindable<bool> HitSoundsVisible = new Bindable<bool>();
|
||||
public readonly Bindable<bool> WaveformVisible = new Bindable<bool>();
|
||||
public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
private readonly BeatmapWaveformGraph waveform;
|
||||
|
||||
public ScrollingTimelineContainer()
|
||||
: base(Direction.Horizontal)
|
||||
{
|
||||
Masking = true;
|
||||
|
||||
Add(waveform = new BeatmapWaveformGraph
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = OsuColour.FromHex("222"),
|
||||
Depth = float.MaxValue
|
||||
});
|
||||
|
||||
Content.AutoSizeAxes = Axes.None;
|
||||
Content.RelativeSizeAxes = Axes.Both;
|
||||
|
||||
waveform.Beatmap.BindTo(Beatmap);
|
||||
WaveformVisible.ValueChanged += waveformVisibilityChanged;
|
||||
|
||||
Zoom = 10;
|
||||
}
|
||||
|
||||
private float minZoom = 1;
|
||||
/// <summary>
|
||||
/// The minimum zoom level allowed.
|
||||
/// </summary>
|
||||
public float MinZoom
|
||||
{
|
||||
get { return minZoom; }
|
||||
set
|
||||
{
|
||||
if (value <= 0)
|
||||
throw new ArgumentOutOfRangeException(nameof(value));
|
||||
if (minZoom == value)
|
||||
return;
|
||||
minZoom = value;
|
||||
|
||||
// Update the zoom level
|
||||
Zoom = Zoom;
|
||||
}
|
||||
}
|
||||
|
||||
private float maxZoom = 30;
|
||||
/// <summary>
|
||||
/// The maximum zoom level allowed.
|
||||
/// </summary>
|
||||
public float MaxZoom
|
||||
{
|
||||
get { return maxZoom; }
|
||||
set
|
||||
{
|
||||
if (value <= 0)
|
||||
throw new ArgumentOutOfRangeException(nameof(value));
|
||||
if (maxZoom == value)
|
||||
return;
|
||||
maxZoom = value;
|
||||
|
||||
// Update the zoom level
|
||||
Zoom = Zoom;
|
||||
}
|
||||
}
|
||||
|
||||
private float zoom = 1;
|
||||
/// <summary>
|
||||
/// The current zoom level.
|
||||
/// </summary>
|
||||
public float Zoom
|
||||
{
|
||||
get { return zoom; }
|
||||
set
|
||||
{
|
||||
value = MathHelper.Clamp(value, MinZoom, MaxZoom);
|
||||
if (zoom == value)
|
||||
return;
|
||||
zoom = value;
|
||||
|
||||
// Make the zoom target default to the center of the graph if it hasn't been set
|
||||
if (relativeContentZoomTarget == null)
|
||||
relativeContentZoomTarget = ToSpaceOfOtherDrawable(DrawSize / 2, Content).X / Content.DrawSize.X;
|
||||
if (localZoomTarget == null)
|
||||
localZoomTarget = DrawSize.X / 2;
|
||||
|
||||
Content.ResizeWidthTo(Zoom);
|
||||
|
||||
// Update the scroll position to focus on the zoom target
|
||||
float scrollPos = Content.DrawSize.X * relativeContentZoomTarget.Value - localZoomTarget.Value;
|
||||
ScrollTo(scrollPos, false);
|
||||
|
||||
relativeContentZoomTarget = null;
|
||||
localZoomTarget = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Zoom target as a relative position in the <see cref="Content"/> space.
|
||||
/// </summary>
|
||||
private float? relativeContentZoomTarget;
|
||||
|
||||
/// <summary>
|
||||
/// Zoom target as a position in our local space.
|
||||
/// </summary>
|
||||
private float? localZoomTarget;
|
||||
|
||||
protected override bool OnWheel(InputState state)
|
||||
{
|
||||
if (!state.Keyboard.ControlPressed)
|
||||
return base.OnWheel(state);
|
||||
|
||||
relativeContentZoomTarget = Content.ToLocalSpace(state.Mouse.NativeState.Position).X / Content.DrawSize.X;
|
||||
localZoomTarget = ToLocalSpace(state.Mouse.NativeState.Position).X;
|
||||
|
||||
Zoom += state.Mouse.WheelDelta;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void waveformVisibilityChanged(bool visible) => waveform.FadeTo(visible ? 1 : 0, 200, Easing.OutQuint);
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
// 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 osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
|
||||
{
|
||||
public class TimelineButton : CompositeDrawable
|
||||
{
|
||||
public Action Action;
|
||||
public readonly BindableBool Enabled = new BindableBool(true);
|
||||
|
||||
public FontAwesome Icon
|
||||
{
|
||||
get { return button.Icon; }
|
||||
set { button.Icon = value; }
|
||||
}
|
||||
|
||||
private readonly IconButton button;
|
||||
|
||||
public TimelineButton()
|
||||
{
|
||||
InternalChild = button = new IconButton
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
IconColour = OsuColour.Gray(0.35f),
|
||||
IconHoverColour = Color4.White,
|
||||
HoverColour = OsuColour.Gray(0.25f),
|
||||
FlashColour = OsuColour.Gray(0.5f),
|
||||
Action = () => Action?.Invoke()
|
||||
};
|
||||
|
||||
button.Enabled.BindTo(Enabled);
|
||||
Width = button.ButtonSize.X;
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
button.ButtonSize = new Vector2(button.ButtonSize.X, DrawHeight);
|
||||
}
|
||||
}
|
||||
}
|
46
osu.Game/Tests/Visual/TestCaseEditorComposeTimeline.cs
Normal file
46
osu.Game/Tests/Visual/TestCaseEditorComposeTimeline.cs
Normal file
@ -0,0 +1,46 @@
|
||||
// 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 OpenTK;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Screens.Edit.Screens.Compose.Timeline;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
{
|
||||
public class TestCaseEditorComposeTimeline : OsuTestCase
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(ScrollableTimeline), typeof(ScrollingTimelineContainer), typeof(BeatmapWaveformGraph), typeof(TimelineButton) };
|
||||
|
||||
private readonly ScrollableTimeline timeline;
|
||||
|
||||
public TestCaseEditorComposeTimeline()
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new MusicController
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
State = Visibility.Visible
|
||||
},
|
||||
timeline = new ScrollableTimeline
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(1000, 100)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuGameBase osuGame)
|
||||
{
|
||||
timeline.Beatmap.BindTo(osuGame.Beatmap);
|
||||
}
|
||||
}
|
||||
}
|
@ -25,14 +25,18 @@ namespace osu.Game.Tests.Visual
|
||||
Children = new[]
|
||||
{
|
||||
new NamedIconButton("No change", new IconButton()),
|
||||
new NamedIconButton("Green colours", new IconButton
|
||||
new NamedIconButton("Background colours", new IconButton
|
||||
{
|
||||
IconColour = Color4.LightGreen,
|
||||
FlashColour = Color4.DarkGreen,
|
||||
HoverColour = Color4.Green
|
||||
HoverColour = Color4.Green,
|
||||
}),
|
||||
new NamedIconButton("Full-width", new IconButton { ButtonSize = new Vector2(200, 30) }),
|
||||
new NamedIconButton("Unchanging size", new IconButton(), false)
|
||||
new NamedIconButton("Unchanging size", new IconButton(), false),
|
||||
new NamedIconButton("Icon colours", new IconButton
|
||||
{
|
||||
IconColour = Color4.Green,
|
||||
IconHoverColour = Color4.Red
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
// 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 osu.Game.Overlays;
|
||||
using osu.Game.Overlays.MedalSplash;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
@ -10,6 +13,12 @@ namespace osu.Game.Tests.Visual
|
||||
{
|
||||
public override string Description => @"medal get!";
|
||||
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
typeof(MedalOverlay),
|
||||
typeof(DrawableMedal),
|
||||
};
|
||||
|
||||
public TestCaseMedalOverlay()
|
||||
{
|
||||
AddStep(@"display", () =>
|
||||
|
88
osu.Game/Tests/Visual/TestCaseWaveform.cs
Normal file
88
osu.Game/Tests/Visual/TestCaseWaveform.cs
Normal file
@ -0,0 +1,88 @@
|
||||
// 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 OpenTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Screens.Edit.Screens.Compose.Timeline;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
{
|
||||
internal class TestCaseWaveform : OsuTestCase
|
||||
{
|
||||
private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>();
|
||||
|
||||
public TestCaseWaveform()
|
||||
{
|
||||
FillFlowContainer flow;
|
||||
Child = flow = new FillFlowContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, 10),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new MusicController
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Y = 100,
|
||||
State = Visibility.Visible
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
for (int i = 1; i <= 16; i *= 2)
|
||||
{
|
||||
var newDisplay = new BeatmapWaveformGraph
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Resolution = 1f / i
|
||||
};
|
||||
|
||||
newDisplay.Beatmap.BindTo(beatmapBacking);
|
||||
|
||||
flow.Add(new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = 100,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
newDisplay,
|
||||
new Container
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.Black,
|
||||
Alpha = 0.75f
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Text = $"Resolution: {1f / i:0.00}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuGameBase osuGame) => beatmapBacking.BindTo(osuGame.Beatmap);
|
||||
}
|
||||
}
|
@ -57,7 +57,6 @@
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
@ -77,7 +76,6 @@
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
@ -103,7 +101,6 @@
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<LangVersion>6</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<StartArguments>--tests</StartArguments>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
@ -266,6 +263,7 @@
|
||||
<Compile Include="Beatmaps\Drawables\BeatmapPanel.cs" />
|
||||
<Compile Include="Beatmaps\Drawables\BeatmapSetCover.cs" />
|
||||
<Compile Include="Beatmaps\Drawables\BeatmapSetHeader.cs" />
|
||||
<Compile Include="Screens\Edit\Screens\Compose\Timeline\BeatmapWaveformGraph.cs" />
|
||||
<Compile Include="Beatmaps\Drawables\DifficultyColouredContainer.cs" />
|
||||
<Compile Include="Beatmaps\Drawables\DifficultyIcon.cs" />
|
||||
<Compile Include="Beatmaps\Drawables\Panel.cs" />
|
||||
@ -274,6 +272,7 @@
|
||||
<Compile Include="Beatmaps\Formats\OsuLegacyDecoder.cs" />
|
||||
<Compile Include="Beatmaps\IO\ArchiveReader.cs" />
|
||||
<Compile Include="Beatmaps\IO\LegacyFilesystemReader.cs" />
|
||||
<Compile Include="Screens\Edit\Screens\Compose\Timeline\TimelineButton.cs" />
|
||||
<Compile Include="Screens\Play\BreaksOverlay\ArrowsOverlay.cs" />
|
||||
<Compile Include="Screens\Play\BreaksOverlay\BlurredIcon.cs" />
|
||||
<Compile Include="Screens\Play\BreaksOverlay\BreakOverlay.cs" />
|
||||
@ -312,7 +311,6 @@
|
||||
<Compile Include="Graphics\Cursor\OsuTooltipContainer.cs" />
|
||||
<Compile Include="Graphics\IHasAccentColour.cs" />
|
||||
<Compile Include="Graphics\OsuColour.cs" />
|
||||
<Compile Include="Graphics\Processing\RatioAdjust.cs" />
|
||||
<Compile Include="Graphics\SpriteIcon.cs" />
|
||||
<Compile Include="Graphics\Sprites\OsuSpriteText.cs" />
|
||||
<Compile Include="Graphics\UserInterface\BackButton.cs" />
|
||||
@ -629,6 +627,8 @@
|
||||
<Compile Include="Screens\Edit\Screens\Design\Design.cs" />
|
||||
<Compile Include="Screens\Edit\Screens\EditorScreen.cs" />
|
||||
<Compile Include="Screens\Edit\Screens\Compose\Compose.cs" />
|
||||
<Compile Include="Screens\Edit\Screens\Compose\Timeline\ScrollableTimeline.cs" />
|
||||
<Compile Include="Screens\Edit\Screens\Compose\Timeline\ScrollingTimelineContainer.cs" />
|
||||
<Compile Include="Screens\Loader.cs" />
|
||||
<Compile Include="Screens\Menu\Button.cs" />
|
||||
<Compile Include="Screens\Menu\ButtonSystem.cs" />
|
||||
@ -755,6 +755,7 @@
|
||||
<Compile Include="Tests\Visual\TestCaseDrawableRoom.cs" />
|
||||
<Compile Include="Tests\Visual\TestCaseDrawings.cs" />
|
||||
<Compile Include="Tests\Visual\TestCaseEditor.cs" />
|
||||
<Compile Include="Tests\Visual\TestCaseEditorComposeTimeline.cs" />
|
||||
<Compile Include="Tests\Visual\TestCaseEditorMenuBar.cs" />
|
||||
<Compile Include="Tests\Visual\TestCaseEditorSummaryTimeline.cs" />
|
||||
<Compile Include="Tests\Visual\TestCaseGamefield.cs" />
|
||||
@ -788,6 +789,7 @@
|
||||
<Compile Include="Tests\Visual\TestCaseTwoLayerButton.cs" />
|
||||
<Compile Include="Tests\Visual\TestCaseUserPanel.cs" />
|
||||
<Compile Include="Tests\Visual\TestCaseUserProfile.cs" />
|
||||
<Compile Include="Tests\Visual\TestCaseWaveform.cs" />
|
||||
<Compile Include="Users\Avatar.cs" />
|
||||
<Compile Include="Users\Country.cs" />
|
||||
<Compile Include="Users\Medal.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user