mirror of
https://github.com/osukey/osukey.git
synced 2025-05-06 14:17:27 +09:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into mods_overlay_fix
This commit is contained in:
commit
ab8fb2edab
10
.vscode/tasks.json
vendored
10
.vscode/tasks.json
vendored
@ -9,15 +9,9 @@
|
|||||||
"showOutput": "silent",
|
"showOutput": "silent",
|
||||||
"args": [
|
"args": [
|
||||||
"/property:GenerateFullPaths=true",
|
"/property:GenerateFullPaths=true",
|
||||||
"/property:DebugType=portable"
|
"/property:DebugType=portable",
|
||||||
|
"/m" //parallel compiling support.
|
||||||
],
|
],
|
||||||
"windows": {
|
|
||||||
"args": [
|
|
||||||
"/property:GenerateFullPaths=true",
|
|
||||||
"/property:DebugType=portable",
|
|
||||||
"/m" //parallel compiling support. doesn't work well with mono atm
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
{
|
||||||
"taskName": "Build (Debug)",
|
"taskName": "Build (Debug)",
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit af9ffbd8b945e526801c469dd55464363e502962
|
Subproject commit 46a56e0e11d56c788ff8db089582718a606ed158
|
206
osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs
Normal file
206
osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs
Normal file
@ -0,0 +1,206 @@
|
|||||||
|
// 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.Testing;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Timing;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
using osu.Framework.Audio.Track;
|
||||||
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Framework.Lists;
|
||||||
|
using System;
|
||||||
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
|
|
||||||
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
|
{
|
||||||
|
internal class TestCaseBeatSyncedContainer : TestCase
|
||||||
|
{
|
||||||
|
public override string Description => @"Tests beat synced containers.";
|
||||||
|
|
||||||
|
private readonly MusicController mc;
|
||||||
|
|
||||||
|
public TestCaseBeatSyncedContainer()
|
||||||
|
{
|
||||||
|
Clock = new FramedClock();
|
||||||
|
Clock.ProcessFrame();
|
||||||
|
|
||||||
|
Add(new BeatContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.BottomCentre,
|
||||||
|
Origin = Anchor.BottomCentre,
|
||||||
|
});
|
||||||
|
|
||||||
|
Add(mc = new MusicController
|
||||||
|
{
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
mc.ToggleVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class BeatContainer : BeatSyncedContainer
|
||||||
|
{
|
||||||
|
private const int flash_layer_heigth = 150;
|
||||||
|
|
||||||
|
private readonly InfoString timingPointCount;
|
||||||
|
private readonly InfoString currentTimingPoint;
|
||||||
|
private readonly InfoString beatCount;
|
||||||
|
private readonly InfoString currentBeat;
|
||||||
|
private readonly InfoString beatsPerMinute;
|
||||||
|
private readonly InfoString adjustedBeatLength;
|
||||||
|
private readonly InfoString timeUntilNextBeat;
|
||||||
|
private readonly InfoString timeSinceLastBeat;
|
||||||
|
|
||||||
|
private readonly Box flashLayer;
|
||||||
|
|
||||||
|
public BeatContainer()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
Name = @"Info Layer",
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Margin = new MarginPadding { Bottom = flash_layer_heigth },
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = Color4.Black.Opacity(150),
|
||||||
|
},
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
timingPointCount = new InfoString(@"Timing points amount"),
|
||||||
|
currentTimingPoint = new InfoString(@"Current timing point"),
|
||||||
|
beatCount = new InfoString(@"Beats amount (in the current timing point)"),
|
||||||
|
currentBeat = new InfoString(@"Current beat"),
|
||||||
|
beatsPerMinute = new InfoString(@"BPM"),
|
||||||
|
adjustedBeatLength = new InfoString(@"Adjusted beat length"),
|
||||||
|
timeUntilNextBeat = new InfoString(@"Time until next beat"),
|
||||||
|
timeSinceLastBeat = new InfoString(@"Time since last beat"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
Name = @"Color indicator",
|
||||||
|
Anchor = Anchor.BottomCentre,
|
||||||
|
Origin = Anchor.BottomCentre,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Height = flash_layer_heigth,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = Color4.Black,
|
||||||
|
},
|
||||||
|
flashLayer = new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = Color4.White,
|
||||||
|
Alpha = 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Beatmap.ValueChanged += delegate
|
||||||
|
{
|
||||||
|
timingPointCount.Value = 0;
|
||||||
|
currentTimingPoint.Value = 0;
|
||||||
|
beatCount.Value = 0;
|
||||||
|
currentBeat.Value = 0;
|
||||||
|
beatsPerMinute.Value = 0;
|
||||||
|
adjustedBeatLength.Value = 0;
|
||||||
|
timeUntilNextBeat.Value = 0;
|
||||||
|
timeSinceLastBeat.Value = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private SortedList<TimingControlPoint> timingPoints => Beatmap.Value.Beatmap.ControlPointInfo.TimingPoints;
|
||||||
|
private TimingControlPoint getNextTimingPoint(TimingControlPoint current)
|
||||||
|
{
|
||||||
|
if (timingPoints[timingPoints.Count - 1] == current)
|
||||||
|
return current;
|
||||||
|
|
||||||
|
return timingPoints[timingPoints.IndexOf(current) + 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
private int calculateBeatCount(TimingControlPoint current)
|
||||||
|
{
|
||||||
|
if (timingPoints[timingPoints.Count - 1] == current)
|
||||||
|
return (int)Math.Ceiling((Beatmap.Value.Track.Length - current.Time) / current.BeatLength);
|
||||||
|
|
||||||
|
return (int)Math.Ceiling((getNextTimingPoint(current).Time - current.Time) / current.BeatLength);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
timeUntilNextBeat.Value = TimeUntilNextBeat;
|
||||||
|
timeSinceLastBeat.Value = TimeSinceLastBeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
|
||||||
|
{
|
||||||
|
base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);
|
||||||
|
|
||||||
|
timingPointCount.Value = timingPoints.Count;
|
||||||
|
currentTimingPoint.Value = timingPoints.IndexOf(timingPoint);
|
||||||
|
beatCount.Value = calculateBeatCount(timingPoint);
|
||||||
|
currentBeat.Value = beatIndex;
|
||||||
|
beatsPerMinute.Value = 60000 / timingPoint.BeatLength;
|
||||||
|
adjustedBeatLength.Value = timingPoint.BeatLength;
|
||||||
|
|
||||||
|
flashLayer.ClearTransforms();
|
||||||
|
flashLayer.FadeTo(1);
|
||||||
|
flashLayer.FadeTo(0, timingPoint.BeatLength);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class InfoString : FillFlowContainer
|
||||||
|
{
|
||||||
|
private const int text_size = 20;
|
||||||
|
private const int margin = 7;
|
||||||
|
|
||||||
|
private readonly OsuSpriteText valueText;
|
||||||
|
|
||||||
|
public double Value
|
||||||
|
{
|
||||||
|
set { valueText.Text = $"{value:G}"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public InfoString(string header)
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both;
|
||||||
|
Direction = FillDirection.Horizontal;
|
||||||
|
Add(new OsuSpriteText { Text = header + @": ", TextSize = text_size });
|
||||||
|
Add(valueText = new OsuSpriteText() { TextSize = text_size });
|
||||||
|
Margin = new MarginPadding(margin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,6 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
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.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
@ -21,10 +20,10 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
private const int start_time = 0;
|
private const int start_time = 0;
|
||||||
private const int duration = 1000;
|
private const int duration = 1000;
|
||||||
|
|
||||||
|
private readonly Container container;
|
||||||
|
|
||||||
public TestCaseContextMenu()
|
public TestCaseContextMenu()
|
||||||
{
|
{
|
||||||
MyContextMenuContainer container;
|
|
||||||
|
|
||||||
Add(container = new MyContextMenuContainer
|
Add(container = new MyContextMenuContainer
|
||||||
{
|
{
|
||||||
Size = new Vector2(200),
|
Size = new Vector2(200),
|
||||||
@ -54,43 +53,26 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
container.Transforms.Add(new TransformPosition
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
using (container.BeginLoopedSequence())
|
||||||
{
|
{
|
||||||
StartValue = Vector2.Zero,
|
container.MoveTo(new Vector2(0, 100), duration);
|
||||||
EndValue = new Vector2(0, 100),
|
using (container.BeginDelayedSequence(duration))
|
||||||
StartTime = start_time,
|
{
|
||||||
EndTime = start_time + duration,
|
container.MoveTo(new Vector2(100, 100), duration);
|
||||||
LoopCount = -1,
|
using (container.BeginDelayedSequence(duration))
|
||||||
LoopDelay = duration * 3
|
{
|
||||||
});
|
container.MoveTo(new Vector2(100, 0), duration);
|
||||||
container.Transforms.Add(new TransformPosition
|
using (container.BeginDelayedSequence(duration))
|
||||||
{
|
container.MoveTo(Vector2.Zero, duration);
|
||||||
StartValue = new Vector2(0, 100),
|
}
|
||||||
EndValue = new Vector2(100, 100),
|
}
|
||||||
StartTime = start_time + duration,
|
}
|
||||||
EndTime = start_time + duration * 2,
|
|
||||||
LoopCount = -1,
|
|
||||||
LoopDelay = duration * 3
|
|
||||||
});
|
|
||||||
container.Transforms.Add(new TransformPosition
|
|
||||||
{
|
|
||||||
StartValue = new Vector2(100, 100),
|
|
||||||
EndValue = new Vector2(100, 0),
|
|
||||||
StartTime = start_time + duration * 2,
|
|
||||||
EndTime = start_time + duration * 3,
|
|
||||||
LoopCount = -1,
|
|
||||||
LoopDelay = duration * 3
|
|
||||||
});
|
|
||||||
container.Transforms.Add(new TransformPosition
|
|
||||||
{
|
|
||||||
StartValue = new Vector2(100, 0),
|
|
||||||
EndValue = Vector2.Zero,
|
|
||||||
StartTime = start_time + duration * 3,
|
|
||||||
EndTime = start_time + duration * 4,
|
|
||||||
LoopCount = -1,
|
|
||||||
LoopDelay = duration * 3
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MyContextMenuContainer : Container, IHasContextMenu
|
private class MyContextMenuContainer : Container, IHasContextMenu
|
||||||
|
@ -76,7 +76,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
ControlPointInfo = controlPointInfo
|
ControlPointInfo = controlPointInfo
|
||||||
});
|
});
|
||||||
|
|
||||||
Add(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Position = new Vector2(20, -160),
|
Position = new Vector2(20, -160),
|
||||||
Count = 5,
|
CountStars = 5,
|
||||||
};
|
};
|
||||||
Add(stars);
|
Add(stars);
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Position = new Vector2(20, -190),
|
Position = new Vector2(20, -190),
|
||||||
Text = stars.Count.ToString("0.00"),
|
Text = stars.CountStars.ToString("0.00"),
|
||||||
};
|
};
|
||||||
Add(starsLabel);
|
Add(starsLabel);
|
||||||
|
|
||||||
@ -69,8 +69,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
comboCounter.Current.Value = 0;
|
comboCounter.Current.Value = 0;
|
||||||
numerator = denominator = 0;
|
numerator = denominator = 0;
|
||||||
accuracyCounter.SetFraction(0, 0);
|
accuracyCounter.SetFraction(0, 0);
|
||||||
stars.Count = 0;
|
stars.CountStars = 0;
|
||||||
starsLabel.Text = stars.Count.ToString("0.00");
|
starsLabel.Text = stars.CountStars.ToString("0.00");
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep(@"Hit! :D", delegate
|
AddStep(@"Hit! :D", delegate
|
||||||
@ -91,8 +91,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
AddStep(@"Alter stars", delegate
|
AddStep(@"Alter stars", delegate
|
||||||
{
|
{
|
||||||
stars.Count = RNG.NextSingle() * (stars.StarCount + 1);
|
stars.CountStars = RNG.NextSingle() * (stars.StarCount + 1);
|
||||||
starsLabel.Text = stars.Count.ToString("0.00");
|
starsLabel.Text = stars.CountStars.ToString("0.00");
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep(@"Stop counters", delegate
|
AddStep(@"Stop counters", delegate
|
||||||
|
@ -55,7 +55,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
timeRangeBindable.ValueChanged += v => timeRangeText.Text = $"Visible Range: {v:#,#.#}";
|
timeRangeBindable.ValueChanged += v => timeRangeText.Text = $"Visible Range: {v:#,#.#}";
|
||||||
timeRangeBindable.ValueChanged += v => bottomLabel.Text = $"t minus {v:#,#}";
|
timeRangeBindable.ValueChanged += v => bottomLabel.Text = $"t minus {v:#,#}";
|
||||||
|
|
||||||
Add(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
|
@ -187,6 +187,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AutomatedVisualTestGame.cs" />
|
<Compile Include="AutomatedVisualTestGame.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Tests\TestCaseBeatSyncedContainer.cs" />
|
||||||
<Compile Include="Tests\TestCaseChatDisplay.cs" />
|
<Compile Include="Tests\TestCaseChatDisplay.cs" />
|
||||||
<Compile Include="Tests\TestCaseBeatmapDetails.cs" />
|
<Compile Include="Tests\TestCaseBeatmapDetails.cs" />
|
||||||
<Compile Include="Tests\TestCaseContextMenu.cs" />
|
<Compile Include="Tests\TestCaseContextMenu.cs" />
|
||||||
|
@ -202,7 +202,7 @@ namespace osu.Desktop.Overlays
|
|||||||
{
|
{
|
||||||
this.game = game;
|
this.game = game;
|
||||||
|
|
||||||
IconContent.Add(new Drawable[]
|
IconContent.AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
|
@ -5,18 +5,17 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Graphics.Transforms;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||||
{
|
{
|
||||||
internal class DrawableFruit : Sprite
|
internal class DrawableFruit : Sprite
|
||||||
{
|
{
|
||||||
private readonly CatchBaseHit h;
|
//private readonly CatchBaseHit h;
|
||||||
|
|
||||||
public DrawableFruit(CatchBaseHit h)
|
public DrawableFruit(CatchBaseHit h)
|
||||||
{
|
{
|
||||||
this.h = h;
|
//this.h = h;
|
||||||
|
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
Scale = new Vector2(0.1f);
|
Scale = new Vector2(0.1f);
|
||||||
@ -29,10 +28,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
{
|
{
|
||||||
Texture = textures.Get(@"Menu/logo");
|
Texture = textures.Get(@"Menu/logo");
|
||||||
|
|
||||||
const double duration = 0;
|
//Transforms.Add(new TransformPosition { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(h.Position, -0.1f), EndValue = new Vector2(h.Position, 0.9f) });
|
||||||
|
//Transforms.Add(new TransformAlpha { StartTime = h.StartTime + duration + 200, EndTime = h.StartTime + duration + 400, StartValue = 1, EndValue = 0 });
|
||||||
Transforms.Add(new TransformPosition { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(h.Position, -0.1f), EndValue = new Vector2(h.Position, 0.9f) });
|
|
||||||
Transforms.Add(new TransformAlpha { StartTime = h.StartTime + duration + 200, EndTime = h.StartTime + duration + 400, StartValue = 1, EndValue = 0 });
|
|
||||||
Expire(true);
|
Expire(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
Height = (float)HitObject.Duration;
|
Height = (float)HitObject.Duration;
|
||||||
|
|
||||||
Add(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
// For now the body piece covers the entire height of the container
|
// For now the body piece covers the entire height of the container
|
||||||
// whereas possibly in the future we don't want to extend under the head/tail.
|
// whereas possibly in the future we don't want to extend under the head/tail.
|
||||||
|
@ -235,7 +235,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
|
|
||||||
private void transformVisibleTimeRangeTo(double newTimeRange, double duration = 0, EasingTypes easing = EasingTypes.None)
|
private void transformVisibleTimeRangeTo(double newTimeRange, double duration = 0, EasingTypes easing = EasingTypes.None)
|
||||||
{
|
{
|
||||||
TransformTo(() => visibleTimeRange.Value, newTimeRange, duration, easing, new TransformTimeSpan());
|
TransformTo(newTimeRange, duration, easing, new TransformTimeSpan());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
@ -247,7 +247,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
|
|
||||||
private class TransformTimeSpan : Transform<double, Drawable>
|
private class TransformTimeSpan : Transform<double, Drawable>
|
||||||
{
|
{
|
||||||
public override double CurrentValue
|
public double CurrentValue
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -259,13 +259,8 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Apply(Drawable d)
|
public override void Apply(Drawable d) => ((ManiaPlayfield)d).visibleTimeRange.Value = (float)CurrentValue;
|
||||||
{
|
public override void ReadIntoStartValue(Drawable d) => StartValue = ((ManiaPlayfield)d).visibleTimeRange.Value;
|
||||||
base.Apply(d);
|
|
||||||
|
|
||||||
var p = (ManiaPlayfield)d;
|
|
||||||
p.visibleTimeRange.Value = (float)CurrentValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,11 +89,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
base.UpdateInitialState();
|
base.UpdateInitialState();
|
||||||
|
|
||||||
//sane defaults
|
// sane defaults
|
||||||
ring.Alpha = circle.Alpha = number.Alpha = glow.Alpha = 1;
|
ring.Show();
|
||||||
ApproachCircle.Alpha = 0;
|
circle.Show();
|
||||||
ApproachCircle.Scale = new Vector2(4);
|
number.Show();
|
||||||
explode.Alpha = 0;
|
glow.Show();
|
||||||
|
|
||||||
|
ApproachCircle.Hide();
|
||||||
|
ApproachCircle.ScaleTo(new Vector2(4));
|
||||||
|
explode.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdatePreemptState()
|
protected override void UpdatePreemptState()
|
||||||
@ -106,43 +110,45 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
protected override void UpdateCurrentState(ArmedState state)
|
protected override void UpdateCurrentState(ArmedState state)
|
||||||
{
|
{
|
||||||
ApproachCircle.FadeOut();
|
double duration = ((HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime) - HitObject.StartTime;
|
||||||
|
|
||||||
double endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime;
|
using (glow.BeginDelayedSequence(duration))
|
||||||
double duration = endTime - HitObject.StartTime;
|
glow.FadeOut(400);
|
||||||
|
|
||||||
glow.Delay(duration);
|
|
||||||
glow.FadeOut(400);
|
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case ArmedState.Idle:
|
case ArmedState.Idle:
|
||||||
Delay(duration + TIME_PREEMPT);
|
using (BeginDelayedSequence(duration + TIME_PREEMPT))
|
||||||
FadeOut(TIME_FADEOUT);
|
FadeOut(TIME_FADEOUT);
|
||||||
Expire(true);
|
Expire(true);
|
||||||
break;
|
break;
|
||||||
case ArmedState.Miss:
|
case ArmedState.Miss:
|
||||||
|
ApproachCircle.FadeOut(50);
|
||||||
FadeOut(TIME_FADEOUT / 5);
|
FadeOut(TIME_FADEOUT / 5);
|
||||||
Expire();
|
Expire();
|
||||||
break;
|
break;
|
||||||
case ArmedState.Hit:
|
case ArmedState.Hit:
|
||||||
|
ApproachCircle.FadeOut(50);
|
||||||
|
|
||||||
const double flash_in = 40;
|
const double flash_in = 40;
|
||||||
|
|
||||||
flash.FadeTo(0.8f, flash_in);
|
flash.FadeTo(0.8f, flash_in);
|
||||||
flash.Delay(flash_in);
|
using (flash.BeginDelayedSequence(flash_in))
|
||||||
flash.FadeOut(100);
|
flash.FadeOut(100);
|
||||||
|
|
||||||
explode.FadeIn(flash_in);
|
explode.FadeIn(flash_in);
|
||||||
|
|
||||||
Delay(flash_in, true);
|
using (BeginDelayedSequence(flash_in, true))
|
||||||
|
{
|
||||||
|
//after the flash, we can hide some elements that were behind it
|
||||||
|
ring.FadeOut();
|
||||||
|
circle.FadeOut();
|
||||||
|
number.FadeOut();
|
||||||
|
|
||||||
//after the flash, we can hide some elements that were behind it
|
FadeOut(800);
|
||||||
ring.FadeOut();
|
ScaleTo(Scale * 1.5f, 400, EasingTypes.OutQuad);
|
||||||
circle.FadeOut();
|
}
|
||||||
number.FadeOut();
|
|
||||||
|
|
||||||
FadeOut(800);
|
|
||||||
ScaleTo(Scale * 1.5f, 400, EasingTypes.OutQuad);
|
|
||||||
Expire();
|
Expire();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
: base(hitObject)
|
: base(hitObject)
|
||||||
{
|
{
|
||||||
AccentColour = HitObject.ComboColour;
|
AccentColour = HitObject.ComboColour;
|
||||||
|
Alpha = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override OsuJudgement CreateJudgement() => new OsuJudgement { MaxScore = OsuScoreResult.Hit300 };
|
protected override OsuJudgement CreateJudgement() => new OsuJudgement { MaxScore = OsuScoreResult.Hit300 };
|
||||||
@ -25,10 +26,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
Flush();
|
Flush();
|
||||||
|
|
||||||
UpdateInitialState();
|
|
||||||
|
|
||||||
using (BeginAbsoluteSequence(HitObject.StartTime - TIME_PREEMPT, true))
|
using (BeginAbsoluteSequence(HitObject.StartTime - TIME_PREEMPT, true))
|
||||||
{
|
{
|
||||||
|
UpdateInitialState();
|
||||||
|
|
||||||
UpdatePreemptState();
|
UpdatePreemptState();
|
||||||
|
|
||||||
using (BeginDelayedSequence(TIME_PREEMPT + Judgement.TimeOffset, true))
|
using (BeginDelayedSequence(TIME_PREEMPT + Judgement.TimeOffset, true))
|
||||||
@ -36,8 +37,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void UpdateCurrentState(ArmedState state)
|
protected virtual void UpdateInitialState()
|
||||||
{
|
{
|
||||||
|
Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void UpdatePreemptState()
|
protected virtual void UpdatePreemptState()
|
||||||
@ -45,9 +47,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
FadeIn(TIME_FADEIN);
|
FadeIn(TIME_FADEIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void UpdateInitialState()
|
protected virtual void UpdateCurrentState(ArmedState state)
|
||||||
{
|
{
|
||||||
Alpha = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
icon.RotateTo(360, 1000);
|
using (icon.BeginLoopedSequence())
|
||||||
icon.Loop();
|
icon.RotateTo(360, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateProgress(double progress, int repeat)
|
public void UpdateProgress(double progress, int repeat)
|
||||||
|
@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Add(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
connectionLayer = new FollowPointRenderer
|
connectionLayer = new FollowPointRenderer
|
||||||
{
|
{
|
||||||
|
@ -68,7 +68,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
EarlyActivationMilliseconds = pre_beat_transition_time;
|
EarlyActivationMilliseconds = pre_beat_transition_time;
|
||||||
|
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
background = new CircularContainer
|
background = new CircularContainer
|
||||||
{
|
{
|
||||||
|
@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
|
|
||||||
public TaikoPlayfield()
|
public TaikoPlayfield()
|
||||||
{
|
{
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
new ScaleFixContainer
|
new ScaleFixContainer
|
||||||
{
|
{
|
||||||
|
@ -75,18 +75,16 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
|
|
||||||
var temp = prepareTempCopy(osz_path);
|
var temp = prepareTempCopy(osz_path);
|
||||||
|
|
||||||
Assert.IsTrue(File.Exists(temp));
|
Assert.IsTrue(File.Exists(temp), "Temporary file copy never substantiated");
|
||||||
|
|
||||||
using (File.OpenRead(temp))
|
using (File.OpenRead(temp))
|
||||||
host.Dependencies.Get<BeatmapDatabase>().Import(temp);
|
host.Dependencies.Get<BeatmapDatabase>().Import(temp);
|
||||||
|
|
||||||
ensureLoaded(host);
|
ensureLoaded(host);
|
||||||
|
|
||||||
Assert.IsTrue(File.Exists(temp));
|
|
||||||
|
|
||||||
File.Delete(temp);
|
File.Delete(temp);
|
||||||
|
|
||||||
Assert.IsFalse(File.Exists(temp));
|
Assert.IsFalse(File.Exists(temp), "We likely held a read lock on the file when we shouldn't");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +109,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
return osu;
|
return osu;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ensureLoaded(GameHost host, int timeout = 10000)
|
private void ensureLoaded(GameHost host, int timeout = 60000)
|
||||||
{
|
{
|
||||||
IEnumerable<BeatmapSetInfo> resultSets = null;
|
IEnumerable<BeatmapSetInfo> resultSets = null;
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
},
|
},
|
||||||
starCounter = new StarCounter
|
starCounter = new StarCounter
|
||||||
{
|
{
|
||||||
Count = (float)beatmap.StarDifficulty,
|
CountStars = (float)beatmap.StarDifficulty,
|
||||||
Scale = new Vector2(0.8f),
|
Scale = new Vector2(0.8f),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,6 +93,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
{
|
{
|
||||||
new BeatmapBackgroundSprite(working)
|
new BeatmapBackgroundSprite(working)
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
|
@ -26,6 +26,7 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
|
|
||||||
Add(Sprite = new Sprite
|
Add(Sprite = new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Colour = Color4.DarkGray,
|
Colour = Color4.DarkGray,
|
||||||
|
@ -23,6 +23,16 @@ namespace osu.Game.Graphics.Containers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected double EarlyActivationMilliseconds;
|
protected double EarlyActivationMilliseconds;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The time in milliseconds until the next beat.
|
||||||
|
/// </summary>
|
||||||
|
public double TimeUntilNextBeat { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The time in milliseconds since the last beat
|
||||||
|
/// </summary>
|
||||||
|
public double TimeSinceLastBeat { get; private set; }
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
if (Beatmap.Value?.Track == null)
|
if (Beatmap.Value?.Track == null)
|
||||||
@ -42,12 +52,16 @@ namespace osu.Game.Graphics.Containers
|
|||||||
if (currentTrackTime < timingPoint.Time)
|
if (currentTrackTime < timingPoint.Time)
|
||||||
beatIndex--;
|
beatIndex--;
|
||||||
|
|
||||||
|
TimeUntilNextBeat = (timingPoint.Time - currentTrackTime) % timingPoint.BeatLength;
|
||||||
|
if (TimeUntilNextBeat < 0)
|
||||||
|
TimeUntilNextBeat += timingPoint.BeatLength;
|
||||||
|
|
||||||
|
TimeSinceLastBeat = timingPoint.BeatLength - TimeUntilNextBeat;
|
||||||
|
|
||||||
if (timingPoint == lastTimingPoint && beatIndex == lastBeat)
|
if (timingPoint == lastTimingPoint && beatIndex == lastBeat)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
double offsetFromBeat = (timingPoint.Time - currentTrackTime) % timingPoint.BeatLength;
|
using (BeginDelayedSequence(-TimeSinceLastBeat, true))
|
||||||
|
|
||||||
using (BeginDelayedSequence(offsetFromBeat, true))
|
|
||||||
OnNewBeat(beatIndex, timingPoint, effectPoint, Beatmap.Value.Track.CurrentAmplitudes);
|
OnNewBeat(beatIndex, timingPoint, effectPoint, Beatmap.Value.Track.CurrentAmplitudes);
|
||||||
|
|
||||||
lastBeat = beatIndex;
|
lastBeat = beatIndex;
|
||||||
|
@ -8,9 +8,10 @@ using osu.Framework.Graphics.Containers;
|
|||||||
|
|
||||||
namespace osu.Game.Graphics.Containers
|
namespace osu.Game.Graphics.Containers
|
||||||
{
|
{
|
||||||
public class ReverseDepthFillFlowContainer<T> : FillFlowContainer<T> where T : Drawable
|
public class ReverseChildIDFillFlowContainer<T> : FillFlowContainer<T> where T : Drawable
|
||||||
{
|
{
|
||||||
protected override IComparer<Drawable> DepthComparer => new ReverseCreationOrderDepthComparer();
|
protected override int Compare(Drawable x, Drawable y) => CompareReverseChildID(x, y);
|
||||||
|
|
||||||
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
|
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -93,7 +93,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
sections = value.ToList();
|
sections = value.ToList();
|
||||||
if (sections.Count == 0) return;
|
if (sections.Count == 0) return;
|
||||||
|
|
||||||
sectionsContainer.Add(sections);
|
sectionsContainer.AddRange(sections);
|
||||||
SelectedSection.Value = sections[0];
|
SelectedSection.Value = sections[0];
|
||||||
lastKnownScroll = float.NaN;
|
lastKnownScroll = float.NaN;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ namespace osu.Game.Graphics
|
|||||||
public static void FadeAccent<T>(this T accentedDrawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None)
|
public static void FadeAccent<T>(this T accentedDrawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None)
|
||||||
where T : Transformable<Drawable>, IHasAccentColour
|
where T : Transformable<Drawable>, IHasAccentColour
|
||||||
{
|
{
|
||||||
accentedDrawable.TransformTo(() => accentedDrawable.AccentColour, newColour, duration, easing, new TransformAccent());
|
accentedDrawable.TransformTo(newColour, duration, easing, new TransformAccent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Graphics.Transforms
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Current value of the transformed colour in linear colour space.
|
/// Current value of the transformed colour in linear colour space.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override Color4 CurrentValue
|
public virtual Color4 CurrentValue
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -25,13 +25,7 @@ namespace osu.Game.Graphics.Transforms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Apply(Drawable d)
|
public override void Apply(Drawable d) => ((IHasAccentColour)d).AccentColour = CurrentValue;
|
||||||
{
|
public override void ReadIntoStartValue(Drawable d) => StartValue = ((IHasAccentColour)d).AccentColour;
|
||||||
base.Apply(d);
|
|
||||||
|
|
||||||
var accented = d as IHasAccentColour;
|
|
||||||
if (accented != null)
|
|
||||||
accented.AccentColour = CurrentValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Direction = Direction,
|
Direction = Direction,
|
||||||
});
|
});
|
||||||
//I'm using ToList() here because Where() returns an Enumerable which can change it's elements afterwards
|
//I'm using ToList() here because Where() returns an Enumerable which can change it's elements afterwards
|
||||||
Remove(Children.Where((bar, index) => index >= value.Count()).ToList());
|
RemoveRange(Children.Where((bar, index) => index >= value.Count()).ToList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,9 +34,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
spinner.RotateTo(360, 2000);
|
using (spinner.BeginLoopedSequence())
|
||||||
using (spinner.BeginDelayedSequence(2000))
|
spinner.RotateTo(360, 2000);
|
||||||
spinner.Loop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private const float transition_duration = 500;
|
private const float transition_duration = 500;
|
||||||
|
@ -49,7 +49,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Content.Masking = true;
|
Content.Masking = true;
|
||||||
Content.CornerRadius = 5;
|
Content.CornerRadius = 5;
|
||||||
|
|
||||||
Add(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
new Triangles
|
new Triangles
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected class TransformAccuracy : Transform<double, Drawable>
|
protected class TransformAccuracy : Transform<double, Drawable>
|
||||||
{
|
{
|
||||||
public override double CurrentValue
|
public virtual double CurrentValue
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -59,11 +59,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Apply(Drawable d)
|
public override void Apply(Drawable d) => ((PercentageCounter)d).DisplayedCount = CurrentValue;
|
||||||
{
|
public override void ReadIntoStartValue(Drawable d) => StartValue = ((PercentageCounter)d).DisplayedCount;
|
||||||
base.Apply(d);
|
|
||||||
((PercentageCounter)d).DisplayedCount = CurrentValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
transform.StartTime = TransformStartTime;
|
transform.StartTime = TransformStartTime;
|
||||||
transform.EndTime = TransformStartTime + rollingTotalDuration;
|
transform.EndTime = TransformStartTime + rollingTotalDuration;
|
||||||
transform.StartValue = currentValue;
|
|
||||||
transform.EndValue = newValue;
|
transform.EndValue = newValue;
|
||||||
transform.Easing = RollingEasing;
|
transform.Easing = RollingEasing;
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected class TransformScore : Transform<double, Drawable>
|
protected class TransformScore : Transform<double, Drawable>
|
||||||
{
|
{
|
||||||
public override double CurrentValue
|
public virtual double CurrentValue
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -70,11 +70,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Apply(Drawable d)
|
public override void Apply(Drawable d) => ((ScoreCounter)d).DisplayedCount = CurrentValue;
|
||||||
{
|
public override void ReadIntoStartValue(Drawable d) => StartValue = ((ScoreCounter)d).DisplayedCount;
|
||||||
base.Apply(d);
|
|
||||||
((ScoreCounter)d).DisplayedCount = CurrentValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
public SearchTextBox()
|
public SearchTextBox()
|
||||||
{
|
{
|
||||||
Height = 35;
|
Height = 35;
|
||||||
Add(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
new TextAwesome
|
new TextAwesome
|
||||||
{
|
{
|
||||||
|
@ -39,7 +39,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
private class TransformCounterCount : Transform<int, Drawable>
|
private class TransformCounterCount : Transform<int, Drawable>
|
||||||
{
|
{
|
||||||
public override int CurrentValue
|
public int CurrentValue
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -51,11 +51,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Apply(Drawable d)
|
public override void Apply(Drawable d) => ((SimpleComboCounter)d).DisplayedCount = CurrentValue;
|
||||||
{
|
public override void ReadIntoStartValue(Drawable d) => StartValue = ((SimpleComboCounter)d).DisplayedCount;
|
||||||
base.Apply(d);
|
|
||||||
((SimpleComboCounter)d).DisplayedCount = CurrentValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -33,25 +33,25 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
private const float star_size = 20;
|
private const float star_size = 20;
|
||||||
private const float star_spacing = 4;
|
private const float star_spacing = 4;
|
||||||
|
|
||||||
private float count;
|
private float countStars;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Amount of stars represented.
|
/// Amount of stars represented.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float Count
|
public float CountStars
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return count;
|
return countStars;
|
||||||
}
|
}
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (count == value) return;
|
if (countStars == value) return;
|
||||||
|
|
||||||
if (IsLoaded)
|
if (IsLoaded)
|
||||||
transformCount(value);
|
transformCount(value);
|
||||||
count = value;
|
countStars = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,15 +94,15 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
public void ResetCount()
|
public void ResetCount()
|
||||||
{
|
{
|
||||||
count = 0;
|
countStars = 0;
|
||||||
StopAnimation();
|
StopAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReplayAnimation()
|
public void ReplayAnimation()
|
||||||
{
|
{
|
||||||
var t = count;
|
var t = countStars;
|
||||||
ResetCount();
|
ResetCount();
|
||||||
Count = t;
|
CountStars = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StopAnimation()
|
public void StopAnimation()
|
||||||
@ -111,8 +111,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
foreach (var star in stars.Children)
|
foreach (var star in stars.Children)
|
||||||
{
|
{
|
||||||
star.ClearTransforms(true);
|
star.ClearTransforms(true);
|
||||||
star.FadeTo(i < count ? 1.0f : minStarAlpha);
|
star.FadeTo(i < countStars ? 1.0f : minStarAlpha);
|
||||||
star.Icon.ScaleTo(getStarScale(i, count));
|
star.Icon.ScaleTo(getStarScale(i, countStars));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
star.ClearTransforms(true);
|
star.ClearTransforms(true);
|
||||||
|
|
||||||
var delay = (count <= newValue ? Math.Max(i - count, 0) : Math.Max(count - 1 - i, 0)) * animationDelay;
|
var delay = (countStars <= newValue ? Math.Max(i - countStars, 0) : Math.Max(countStars - 1 - i, 0)) * animationDelay;
|
||||||
|
|
||||||
using (BeginDelayedSequence(delay, true))
|
using (BeginDelayedSequence(delay, true))
|
||||||
{
|
{
|
||||||
|
@ -141,7 +141,7 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
Add(new Drawable[] {
|
AddRange(new Drawable[] {
|
||||||
new VolumeControlReceptor
|
new VolumeControlReceptor
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
@ -67,7 +67,7 @@ namespace osu.Game.Overlays.Chat
|
|||||||
var displayMessages = newMessages.Skip(Math.Max(0, newMessages.Count() - Channel.MAX_HISTORY));
|
var displayMessages = newMessages.Skip(Math.Max(0, newMessages.Count() - Channel.MAX_HISTORY));
|
||||||
|
|
||||||
//up to last Channel.MAX_HISTORY messages
|
//up to last Channel.MAX_HISTORY messages
|
||||||
flow.Add(displayMessages.Select(m => new ChatLine(m)));
|
flow.AddRange(displayMessages.Select(m => new ChatLine(m)));
|
||||||
|
|
||||||
if (!IsLoaded) return;
|
if (!IsLoaded) return;
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
{
|
{
|
||||||
return new AsyncLoadWrapper(new BeatmapBackgroundSprite(new OnlineWorkingBeatmap(SetInfo.Beatmaps.FirstOrDefault(), textures, null))
|
return new AsyncLoadWrapper(new BeatmapBackgroundSprite(new OnlineWorkingBeatmap(SetInfo.Beatmaps.FirstOrDefault(), textures, null))
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out),
|
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out),
|
||||||
}) { RelativeSizeAxes = Axes.Both };
|
}) { RelativeSizeAxes = Axes.Both };
|
||||||
|
@ -75,7 +75,7 @@ namespace osu.Game.Overlays
|
|||||||
private void updatePosition(float position, bool easing = true)
|
private void updatePosition(float position, bool easing = true)
|
||||||
{
|
{
|
||||||
position = MathHelper.Clamp(position, 0, 1);
|
position = MathHelper.Clamp(position, 0, 1);
|
||||||
Fill.TransformTo(() => Fill.Width, position, easing ? 200 : 0, EasingTypes.OutQuint, new TransformSeek());
|
Fill.TransformTo(position, easing ? 200 : 0, EasingTypes.OutQuint, new TransformSeek());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
||||||
@ -100,11 +100,8 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private class TransformSeek : TransformFloat<Drawable>
|
private class TransformSeek : TransformFloat<Drawable>
|
||||||
{
|
{
|
||||||
public override void Apply(Drawable d)
|
public override void Apply(Drawable d) => d.Width = CurrentValue;
|
||||||
{
|
public override void ReadIntoStartValue(Drawable d) => StartValue = d.Width;
|
||||||
base.Apply(d);
|
|
||||||
d.Width = CurrentValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
iconsContainer.Clear();
|
iconsContainer.Clear();
|
||||||
if (Mods.Length > 1)
|
if (Mods.Length > 1)
|
||||||
{
|
{
|
||||||
iconsContainer.Add(new[]
|
iconsContainer.AddRange(new[]
|
||||||
{
|
{
|
||||||
backgroundIcon = new ModIcon(Mods[1])
|
backgroundIcon = new ModIcon(Mods[1])
|
||||||
{
|
{
|
||||||
|
@ -398,6 +398,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
sprite = new Sprite
|
sprite = new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = OsuColour.Gray(150),
|
Colour = OsuColour.Gray(150),
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
},
|
},
|
||||||
|
@ -7,7 +7,6 @@ using osu.Framework.Extensions.Color4Extensions;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Transforms;
|
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
@ -50,7 +49,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
|
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
Light = new NotificationLight
|
Light = new NotificationLight
|
||||||
{
|
{
|
||||||
@ -203,6 +202,8 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
get { return pulsate; }
|
get { return pulsate; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
if (pulsate == value) return;
|
||||||
|
|
||||||
pulsate = value;
|
pulsate = value;
|
||||||
|
|
||||||
pulsateLayer.ClearTransforms();
|
pulsateLayer.ClearTransforms();
|
||||||
@ -211,25 +212,12 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
if (pulsate)
|
if (pulsate)
|
||||||
{
|
{
|
||||||
const float length = 1000;
|
const float length = 1000;
|
||||||
pulsateLayer.Transforms.Add(new TransformAlpha
|
using (pulsateLayer.BeginLoopedSequence(length / 2))
|
||||||
{
|
{
|
||||||
StartTime = Time.Current,
|
pulsateLayer.FadeTo(0.4f, length, EasingTypes.In);
|
||||||
EndTime = Time.Current + length,
|
using (pulsateLayer.BeginDelayedSequence(length))
|
||||||
StartValue = 1,
|
pulsateLayer.FadeTo(1, length, EasingTypes.Out);
|
||||||
EndValue = 0.4f,
|
}
|
||||||
Easing = EasingTypes.In
|
|
||||||
});
|
|
||||||
pulsateLayer.Transforms.Add(new TransformAlpha
|
|
||||||
{
|
|
||||||
StartTime = Time.Current + length,
|
|
||||||
EndTime = Time.Current + length * 2,
|
|
||||||
StartValue = 0.4f,
|
|
||||||
EndValue = 1,
|
|
||||||
Easing = EasingTypes.Out
|
|
||||||
});
|
|
||||||
|
|
||||||
//todo: figure why we can't add arbitrary delays at the end of loop.
|
|
||||||
pulsateLayer.Loop(length * 2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
Left = 20,
|
Left = 20,
|
||||||
};
|
};
|
||||||
|
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
public SimpleNotification()
|
public SimpleNotification()
|
||||||
{
|
{
|
||||||
IconContent.Add(new Drawable[]
|
IconContent.AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
IconBackgound = new Box
|
IconBackgound = new Box
|
||||||
{
|
{
|
||||||
|
@ -260,8 +260,6 @@ namespace osu.Game.Overlays
|
|||||||
Radius = 8,
|
Radius = 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
FadeEdgeEffectTo(0);
|
|
||||||
|
|
||||||
updateGlow();
|
updateGlow();
|
||||||
Flush(true);
|
Flush(true);
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
const int header_size = 26;
|
const int header_size = 26;
|
||||||
const int header_margin = 25;
|
const int header_margin = 25;
|
||||||
const int border_size = 2;
|
const int border_size = 2;
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
Direction = FillDirection.Vertical;
|
Direction = FillDirection.Vertical;
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
|
@ -93,7 +93,7 @@ namespace osu.Game.Overlays
|
|||||||
new SidebarButton
|
new SidebarButton
|
||||||
{
|
{
|
||||||
Section = section,
|
Section = section,
|
||||||
Action = sectionsContainer.ScrollContainer.ScrollIntoView,
|
Action = b => sectionsContainer.ScrollContainer.ScrollTo(b),
|
||||||
}
|
}
|
||||||
).ToArray()
|
).ToArray()
|
||||||
}
|
}
|
||||||
|
@ -1,55 +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 osu.Framework.Graphics;
|
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Objects
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Compares two hit objects by their start time, falling back to creation order if their start time is equal.
|
|
||||||
/// </summary>
|
|
||||||
public class HitObjectStartTimeComparer : Drawable.CreationOrderDepthComparer
|
|
||||||
{
|
|
||||||
public override int Compare(Drawable x, Drawable y)
|
|
||||||
{
|
|
||||||
var hitObjectX = x as DrawableHitObject;
|
|
||||||
var hitObjectY = y as DrawableHitObject;
|
|
||||||
|
|
||||||
// If either of the two drawables are not hit objects, fall back to the base comparer
|
|
||||||
if (hitObjectX?.HitObject == null || hitObjectY?.HitObject == null)
|
|
||||||
return base.Compare(x, y);
|
|
||||||
|
|
||||||
// Compare by start time
|
|
||||||
int i = hitObjectX.HitObject.StartTime.CompareTo(hitObjectY.HitObject.StartTime);
|
|
||||||
if (i != 0)
|
|
||||||
return i;
|
|
||||||
|
|
||||||
return base.Compare(x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Compares two hit objects by their start time, falling back to creation order if their start time is equal.
|
|
||||||
/// This will compare the two hit objects in reverse order.
|
|
||||||
/// </summary>
|
|
||||||
public class HitObjectReverseStartTimeComparer : Drawable.ReverseCreationOrderDepthComparer
|
|
||||||
{
|
|
||||||
public override int Compare(Drawable x, Drawable y)
|
|
||||||
{
|
|
||||||
var hitObjectX = x as DrawableHitObject;
|
|
||||||
var hitObjectY = y as DrawableHitObject;
|
|
||||||
|
|
||||||
// If either of the two drawables are not hit objects, fall back to the base comparer
|
|
||||||
if (hitObjectX?.HitObject == null || hitObjectY?.HitObject == null)
|
|
||||||
return base.Compare(x, y);
|
|
||||||
|
|
||||||
// Compare by start time
|
|
||||||
int i = hitObjectY.HitObject.StartTime.CompareTo(hitObjectX.HitObject.StartTime);
|
|
||||||
if (i != 0)
|
|
||||||
return i;
|
|
||||||
|
|
||||||
return base.Compare(x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +1,11 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 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.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Caching;
|
using osu.Framework.Caching;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Rulesets.Objects;
|
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
@ -55,7 +53,22 @@ namespace osu.Game.Rulesets.Timing
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal MultiplierControlPoint ControlPoint;
|
internal MultiplierControlPoint ControlPoint;
|
||||||
|
|
||||||
protected override IComparer<Drawable> DepthComparer => new HitObjectReverseStartTimeComparer();
|
protected override int Compare(Drawable x, Drawable y)
|
||||||
|
{
|
||||||
|
var xHitObject = x as DrawableHitObject;
|
||||||
|
var yHitObject = y as DrawableHitObject;
|
||||||
|
|
||||||
|
// If either of the two drawables are not hit objects, fall back to the base comparer
|
||||||
|
if (xHitObject?.HitObject == null || yHitObject?.HitObject == null)
|
||||||
|
return base.Compare(x, y);
|
||||||
|
|
||||||
|
// Compare by start time
|
||||||
|
int i = yHitObject.HitObject.StartTime.CompareTo(xHitObject.HitObject.StartTime);
|
||||||
|
if (i != 0)
|
||||||
|
return i;
|
||||||
|
|
||||||
|
return base.Compare(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new <see cref="DrawableTimingSection"/>.
|
/// Creates a new <see cref="DrawableTimingSection"/>.
|
||||||
|
@ -33,7 +33,20 @@ namespace osu.Game.Rulesets.Timing
|
|||||||
set { visibleTimeRange.BindTo(value); }
|
set { visibleTimeRange.BindTo(value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IComparer<Drawable> DepthComparer => new SpeedAdjustmentContainerReverseStartTimeComparer();
|
protected override int Compare(Drawable x, Drawable y)
|
||||||
|
{
|
||||||
|
var xSpeedAdjust = x as SpeedAdjustmentContainer;
|
||||||
|
var ySpeedAdjust = y as SpeedAdjustmentContainer;
|
||||||
|
|
||||||
|
// If either of the two drawables are not hit objects, fall back to the base comparer
|
||||||
|
if (xSpeedAdjust?.ControlPoint == null || ySpeedAdjust?.ControlPoint == null)
|
||||||
|
return CompareReverseChildID(x, y);
|
||||||
|
|
||||||
|
// Compare by start time
|
||||||
|
int i = ySpeedAdjust.ControlPoint.StartTime.CompareTo(xSpeedAdjust.ControlPoint.StartTime);
|
||||||
|
|
||||||
|
return i != 0 ? i : CompareReverseChildID(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Hit objects that are to be re-processed on the next update.
|
/// Hit objects that are to be re-processed on the next update.
|
||||||
@ -116,27 +129,5 @@ namespace osu.Game.Rulesets.Timing
|
|||||||
/// <param name="time">The time to find the active <see cref="SpeedAdjustmentContainer"/> at.</param>
|
/// <param name="time">The time to find the active <see cref="SpeedAdjustmentContainer"/> at.</param>
|
||||||
/// <returns>The <see cref="SpeedAdjustmentContainer"/> active at <paramref name="time"/>. Null if there are no speed adjustments.</returns>
|
/// <returns>The <see cref="SpeedAdjustmentContainer"/> active at <paramref name="time"/>. Null if there are no speed adjustments.</returns>
|
||||||
private SpeedAdjustmentContainer adjustmentContainerAt(double time) => Children.FirstOrDefault(c => c.CanContain(time)) ?? Children.LastOrDefault();
|
private SpeedAdjustmentContainer adjustmentContainerAt(double time) => Children.FirstOrDefault(c => c.CanContain(time)) ?? Children.LastOrDefault();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Compares two speed adjustment containers by their control point start time, falling back to creation order
|
|
||||||
// if their control point start time is equal. This will compare the two speed adjustment containers in reverse order.
|
|
||||||
/// </summary>
|
|
||||||
private class SpeedAdjustmentContainerReverseStartTimeComparer : ReverseCreationOrderDepthComparer
|
|
||||||
{
|
|
||||||
public override int Compare(Drawable x, Drawable y)
|
|
||||||
{
|
|
||||||
var speedAdjustmentX = x as SpeedAdjustmentContainer;
|
|
||||||
var speedAdjustmentY = y as SpeedAdjustmentContainer;
|
|
||||||
|
|
||||||
// If either of the two drawables are not hit objects, fall back to the base comparer
|
|
||||||
if (speedAdjustmentX?.ControlPoint == null || speedAdjustmentY?.ControlPoint == null)
|
|
||||||
return base.Compare(x, y);
|
|
||||||
|
|
||||||
// Compare by start time
|
|
||||||
int i = speedAdjustmentY.ControlPoint.StartTime.CompareTo(speedAdjustmentX.ControlPoint.StartTime);
|
|
||||||
|
|
||||||
return i != 0 ? i : base.Compare(x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ using osu.Framework.Audio.Sample;
|
|||||||
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.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
@ -17,6 +16,9 @@ using OpenTK;
|
|||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
using osu.Framework.Audio.Track;
|
||||||
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Menu
|
namespace osu.Game.Screens.Menu
|
||||||
{
|
{
|
||||||
@ -24,7 +26,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
/// Button designed specifically for the osu!next main menu.
|
/// Button designed specifically for the osu!next main menu.
|
||||||
/// In order to correctly flow, we have to use a negative margin on the parent container (due to the parallelogram shape).
|
/// In order to correctly flow, we have to use a negative margin on the parent container (due to the parallelogram shape).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Button : Container, IStateful<ButtonState>
|
public class Button : BeatSyncedContainer, IStateful<ButtonState>
|
||||||
{
|
{
|
||||||
private readonly Container iconText;
|
private readonly Container iconText;
|
||||||
private readonly Container box;
|
private readonly Container box;
|
||||||
@ -117,6 +119,27 @@ namespace osu.Game.Screens.Menu
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
|
||||||
|
{
|
||||||
|
base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);
|
||||||
|
|
||||||
|
if (!IsHovered) return;
|
||||||
|
|
||||||
|
bool rightward = beatIndex % 2 == 1;
|
||||||
|
double duration = timingPoint.BeatLength / 2;
|
||||||
|
|
||||||
|
icon.RotateTo(rightward ? 10 : -10, duration * 2, EasingTypes.InOutSine);
|
||||||
|
|
||||||
|
icon.MoveToY(-10, duration, EasingTypes.Out);
|
||||||
|
icon.ScaleTo(Vector2.One, duration, EasingTypes.Out);
|
||||||
|
|
||||||
|
using (icon.BeginDelayedSequence(duration))
|
||||||
|
{
|
||||||
|
icon.MoveToY(0, duration, EasingTypes.In);
|
||||||
|
icon.ScaleTo(new Vector2(1, 0.9f), duration, EasingTypes.In);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override bool OnHover(InputState state)
|
protected override bool OnHover(InputState state)
|
||||||
{
|
{
|
||||||
if (State != ButtonState.Expanded) return true;
|
if (State != ButtonState.Expanded) return true;
|
||||||
@ -125,85 +148,11 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
box.ScaleTo(new Vector2(1.5f, 1), 500, EasingTypes.OutElastic);
|
box.ScaleTo(new Vector2(1.5f, 1), 500, EasingTypes.OutElastic);
|
||||||
|
|
||||||
int duration = 0; //(int)(Game.Audio.BeatLength / 2);
|
double duration = TimeUntilNextBeat;
|
||||||
if (duration == 0) duration = 250;
|
|
||||||
|
|
||||||
icon.ClearTransforms();
|
icon.ClearTransforms();
|
||||||
|
icon.RotateTo(10, duration, EasingTypes.InOutSine);
|
||||||
icon.ScaleTo(1, 500, EasingTypes.OutElasticHalf);
|
icon.ScaleTo(new Vector2(1, 0.9f), duration, EasingTypes.Out);
|
||||||
|
|
||||||
const double offset = 0; //(1 - Game.Audio.SyncBeatProgress) * duration;
|
|
||||||
double startTime = Time.Current + offset;
|
|
||||||
|
|
||||||
icon.RotateTo(10, offset, EasingTypes.InOutSine);
|
|
||||||
icon.ScaleTo(new Vector2(1, 0.9f), offset, EasingTypes.Out);
|
|
||||||
|
|
||||||
icon.Transforms.Add(new TransformRotation
|
|
||||||
{
|
|
||||||
StartValue = -10,
|
|
||||||
EndValue = 10,
|
|
||||||
StartTime = startTime,
|
|
||||||
EndTime = startTime + duration * 2,
|
|
||||||
Easing = EasingTypes.InOutSine,
|
|
||||||
LoopCount = -1,
|
|
||||||
LoopDelay = duration * 2
|
|
||||||
});
|
|
||||||
|
|
||||||
icon.Transforms.Add(new TransformPosition
|
|
||||||
{
|
|
||||||
StartValue = Vector2.Zero,
|
|
||||||
EndValue = new Vector2(0, -10),
|
|
||||||
StartTime = startTime,
|
|
||||||
EndTime = startTime + duration,
|
|
||||||
Easing = EasingTypes.Out,
|
|
||||||
LoopCount = -1,
|
|
||||||
LoopDelay = duration
|
|
||||||
});
|
|
||||||
|
|
||||||
icon.Transforms.Add(new TransformScale
|
|
||||||
{
|
|
||||||
StartValue = new Vector2(1, 0.9f),
|
|
||||||
EndValue = Vector2.One,
|
|
||||||
StartTime = startTime,
|
|
||||||
EndTime = startTime + duration,
|
|
||||||
Easing = EasingTypes.Out,
|
|
||||||
LoopCount = -1,
|
|
||||||
LoopDelay = duration
|
|
||||||
});
|
|
||||||
|
|
||||||
icon.Transforms.Add(new TransformPosition
|
|
||||||
{
|
|
||||||
StartValue = new Vector2(0, -10),
|
|
||||||
EndValue = Vector2.Zero,
|
|
||||||
StartTime = startTime + duration,
|
|
||||||
EndTime = startTime + duration * 2,
|
|
||||||
Easing = EasingTypes.In,
|
|
||||||
LoopCount = -1,
|
|
||||||
LoopDelay = duration
|
|
||||||
});
|
|
||||||
|
|
||||||
icon.Transforms.Add(new TransformScale
|
|
||||||
{
|
|
||||||
StartValue = Vector2.One,
|
|
||||||
EndValue = new Vector2(1, 0.9f),
|
|
||||||
StartTime = startTime + duration,
|
|
||||||
EndTime = startTime + duration * 2,
|
|
||||||
Easing = EasingTypes.In,
|
|
||||||
LoopCount = -1,
|
|
||||||
LoopDelay = duration
|
|
||||||
});
|
|
||||||
|
|
||||||
icon.Transforms.Add(new TransformRotation
|
|
||||||
{
|
|
||||||
StartValue = 10,
|
|
||||||
EndValue = -10,
|
|
||||||
StartTime = startTime + duration * 2,
|
|
||||||
EndTime = startTime + duration * 4,
|
|
||||||
Easing = EasingTypes.InOutSine,
|
|
||||||
LoopCount = -1,
|
|
||||||
LoopDelay = duration * 2
|
|
||||||
});
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +161,6 @@ namespace osu.Game.Screens.Menu
|
|||||||
icon.ClearTransforms();
|
icon.ClearTransforms();
|
||||||
icon.RotateTo(0, 500, EasingTypes.Out);
|
icon.RotateTo(0, 500, EasingTypes.Out);
|
||||||
icon.MoveTo(Vector2.Zero, 500, EasingTypes.Out);
|
icon.MoveTo(Vector2.Zero, 500, EasingTypes.Out);
|
||||||
icon.ScaleTo(0.7f, 500, EasingTypes.OutElasticHalf);
|
|
||||||
icon.ScaleTo(Vector2.One, 200, EasingTypes.Out);
|
icon.ScaleTo(Vector2.One, 200, EasingTypes.Out);
|
||||||
|
|
||||||
if (State == ButtonState.Expanded)
|
if (State == ButtonState.Expanded)
|
||||||
|
@ -114,8 +114,8 @@ namespace osu.Game.Screens.Menu
|
|||||||
buttonsTopLevel.Add(new Button(@"osu!direct", string.Empty, FontAwesome.fa_osu_chevron_down_o, new Color4(165, 204, 0, 255), () => OnDirect?.Invoke(), 0, Key.D));
|
buttonsTopLevel.Add(new Button(@"osu!direct", string.Empty, FontAwesome.fa_osu_chevron_down_o, new Color4(165, 204, 0, 255), () => OnDirect?.Invoke(), 0, Key.D));
|
||||||
buttonsTopLevel.Add(new Button(@"exit", string.Empty, FontAwesome.fa_osu_cross_o, new Color4(238, 51, 153, 255), onExit, 0, Key.Q));
|
buttonsTopLevel.Add(new Button(@"exit", string.Empty, FontAwesome.fa_osu_cross_o, new Color4(238, 51, 153, 255), onExit, 0, Key.Q));
|
||||||
|
|
||||||
buttonFlow.Add(buttonsPlay);
|
buttonFlow.AddRange(buttonsPlay);
|
||||||
buttonFlow.Add(buttonsTopLevel);
|
buttonFlow.AddRange(buttonsTopLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
@ -213,88 +213,89 @@ namespace osu.Game.Screens.Menu
|
|||||||
backButton.ContractStyle = 0;
|
backButton.ContractStyle = 0;
|
||||||
settingsButton.ContractStyle = 0;
|
settingsButton.ContractStyle = 0;
|
||||||
|
|
||||||
switch (state)
|
bool fromInitial = lastState == MenuState.Initial;
|
||||||
|
|
||||||
|
if (state == MenuState.TopLevel)
|
||||||
|
buttonArea.Flush(true);
|
||||||
|
|
||||||
|
using (buttonArea.BeginDelayedSequence(fromInitial ? 150 : 0, true))
|
||||||
{
|
{
|
||||||
case MenuState.Exit:
|
switch (state)
|
||||||
case MenuState.Initial:
|
{
|
||||||
toolbar?.Hide();
|
case MenuState.Exit:
|
||||||
|
case MenuState.Initial:
|
||||||
|
toolbar?.Hide();
|
||||||
|
|
||||||
buttonAreaBackground.ScaleTo(Vector2.One, 500, EasingTypes.Out);
|
buttonAreaBackground.ScaleTo(Vector2.One, 500, EasingTypes.Out);
|
||||||
buttonArea.FadeOut(300);
|
buttonArea.FadeOut(300);
|
||||||
|
|
||||||
osuLogo.Delay(150);
|
using (osuLogo.BeginDelayedSequence(150))
|
||||||
osuLogo.MoveTo(Vector2.Zero, 800, EasingTypes.OutExpo);
|
{
|
||||||
osuLogo.ScaleTo(1, 800, EasingTypes.OutExpo);
|
osuLogo.MoveTo(Vector2.Zero, 800, EasingTypes.OutExpo);
|
||||||
|
osuLogo.ScaleTo(1, 800, EasingTypes.OutExpo);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (Button b in buttonsTopLevel)
|
foreach (Button b in buttonsTopLevel)
|
||||||
b.State = ButtonState.Contracted;
|
b.State = ButtonState.Contracted;
|
||||||
|
|
||||||
foreach (Button b in buttonsPlay)
|
foreach (Button b in buttonsPlay)
|
||||||
b.State = ButtonState.Contracted;
|
b.State = ButtonState.Contracted;
|
||||||
|
|
||||||
if (state == MenuState.Exit)
|
if (state == MenuState.Exit)
|
||||||
{
|
{
|
||||||
osuLogo.RotateTo(20, EXIT_DELAY * 1.5f);
|
osuLogo.RotateTo(20, EXIT_DELAY * 1.5f);
|
||||||
osuLogo.FadeOut(EXIT_DELAY);
|
osuLogo.FadeOut(EXIT_DELAY);
|
||||||
}
|
}
|
||||||
else if (lastState == MenuState.TopLevel)
|
else if (lastState == MenuState.TopLevel)
|
||||||
sampleBack?.Play();
|
sampleBack?.Play();
|
||||||
break;
|
break;
|
||||||
case MenuState.TopLevel:
|
case MenuState.TopLevel:
|
||||||
buttonArea.Flush(true);
|
buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out);
|
||||||
|
|
||||||
buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out);
|
osuLogo.ClearTransforms();
|
||||||
|
osuLogo.MoveTo(buttonFlow.DrawPosition, 200, EasingTypes.In);
|
||||||
|
osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
|
||||||
|
|
||||||
osuLogo.MoveTo(buttonFlow.DrawPosition, 200, EasingTypes.In);
|
buttonArea.FadeIn(300);
|
||||||
osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
|
|
||||||
|
|
||||||
buttonArea.FadeIn(300);
|
if (fromInitial && osuLogo.Scale.X > 0.5f)
|
||||||
|
|
||||||
if (lastState == MenuState.Initial)
|
|
||||||
{
|
|
||||||
buttonArea.Delay(150, true);
|
|
||||||
|
|
||||||
if (osuLogo.Scale.X > 0.5f)
|
|
||||||
using (osuLogo.BeginDelayedSequence(200, true))
|
using (osuLogo.BeginDelayedSequence(200, true))
|
||||||
osuLogo.Impact();
|
osuLogo.Impact();
|
||||||
}
|
|
||||||
|
|
||||||
Scheduler.AddDelayed(() => toolbar?.Show(), 150);
|
Scheduler.AddDelayed(() => toolbar?.Show(), 150);
|
||||||
|
|
||||||
foreach (Button b in buttonsTopLevel)
|
foreach (Button b in buttonsTopLevel)
|
||||||
b.State = ButtonState.Expanded;
|
b.State = ButtonState.Expanded;
|
||||||
|
|
||||||
foreach (Button b in buttonsPlay)
|
foreach (Button b in buttonsPlay)
|
||||||
b.State = ButtonState.Contracted;
|
b.State = ButtonState.Contracted;
|
||||||
break;
|
break;
|
||||||
case MenuState.Play:
|
case MenuState.Play:
|
||||||
foreach (Button b in buttonsTopLevel)
|
foreach (Button b in buttonsTopLevel)
|
||||||
b.State = ButtonState.Exploded;
|
b.State = ButtonState.Exploded;
|
||||||
|
|
||||||
foreach (Button b in buttonsPlay)
|
foreach (Button b in buttonsPlay)
|
||||||
b.State = ButtonState.Expanded;
|
b.State = ButtonState.Expanded;
|
||||||
break;
|
break;
|
||||||
case MenuState.EnteringMode:
|
case MenuState.EnteringMode:
|
||||||
buttonAreaBackground.ScaleTo(new Vector2(2, 0), 300, EasingTypes.InSine);
|
buttonAreaBackground.ScaleTo(new Vector2(2, 0), 300, EasingTypes.InSine);
|
||||||
|
|
||||||
buttonsTopLevel.ForEach(b => b.ContractStyle = 1);
|
buttonsTopLevel.ForEach(b => b.ContractStyle = 1);
|
||||||
buttonsPlay.ForEach(b => b.ContractStyle = 1);
|
buttonsPlay.ForEach(b => b.ContractStyle = 1);
|
||||||
backButton.ContractStyle = 1;
|
backButton.ContractStyle = 1;
|
||||||
settingsButton.ContractStyle = 1;
|
settingsButton.ContractStyle = 1;
|
||||||
|
|
||||||
foreach (Button b in buttonsTopLevel)
|
foreach (Button b in buttonsTopLevel)
|
||||||
b.State = ButtonState.Contracted;
|
b.State = ButtonState.Contracted;
|
||||||
|
|
||||||
foreach (Button b in buttonsPlay)
|
foreach (Button b in buttonsPlay)
|
||||||
b.State = ButtonState.Contracted;
|
b.State = ButtonState.Contracted;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
backButton.State = state == MenuState.Play ? ButtonState.Expanded : ButtonState.Contracted;
|
||||||
|
settingsButton.State = state == MenuState.TopLevel ? ButtonState.Expanded : ButtonState.Contracted;
|
||||||
}
|
}
|
||||||
|
|
||||||
backButton.State = state == MenuState.Play ? ButtonState.Expanded : ButtonState.Contracted;
|
|
||||||
settingsButton.State = state == MenuState.TopLevel ? ButtonState.Expanded : ButtonState.Contracted;
|
|
||||||
|
|
||||||
if (lastState == MenuState.Initial)
|
|
||||||
buttonArea.DelayReset();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Drawable CentreTarget;
|
public Drawable CentreTarget;
|
||||||
|
|
||||||
protected override IComparer<Drawable> DepthComparer => new ReverseCreationOrderDepthComparer();
|
protected override int Compare(Drawable x, Drawable y) => CompareReverseChildID(x, y);
|
||||||
|
|
||||||
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
|
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
|
||||||
|
|
||||||
|
@ -438,6 +438,7 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
{
|
{
|
||||||
new AsyncLoadWrapper(new BeatmapBackgroundSprite(new OnlineWorkingBeatmap(value, textures, null))
|
new AsyncLoadWrapper(new BeatmapBackgroundSprite(new OnlineWorkingBeatmap(value, textures, null))
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
|
@ -198,7 +198,6 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
transform.StartTime = Time.Current;
|
transform.StartTime = Time.Current;
|
||||||
transform.EndTime = Time.Current + getProportionalDuration(currentValue, newValue);
|
transform.EndTime = Time.Current + getProportionalDuration(currentValue, newValue);
|
||||||
transform.StartValue = currentValue;
|
|
||||||
transform.EndValue = newValue;
|
transform.EndValue = newValue;
|
||||||
transform.Easing = RollingEasing;
|
transform.Easing = RollingEasing;
|
||||||
|
|
||||||
@ -207,7 +206,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
protected class TransformComboRoll : Transform<int, Drawable>
|
protected class TransformComboRoll : Transform<int, Drawable>
|
||||||
{
|
{
|
||||||
public override int CurrentValue
|
public virtual int CurrentValue
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -219,11 +218,8 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Apply(Drawable d)
|
public override void Apply(Drawable d) => ((ComboCounter)d).DisplayedCount = CurrentValue;
|
||||||
{
|
public override void ReadIntoStartValue(Drawable d) => StartValue = ((ComboCounter)d).DisplayedCount;
|
||||||
base.Apply(d);
|
|
||||||
((ComboCounter)d).DisplayedCount = CurrentValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void OnDisplayedCountRolling(int currentValue, int newValue);
|
protected abstract void OnDisplayedCountRolling(int currentValue, int newValue);
|
||||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
protected class TransformComboResult : Transform<ulong, Drawable>
|
protected class TransformComboResult : Transform<ulong, Drawable>
|
||||||
{
|
{
|
||||||
public override ulong CurrentValue
|
public virtual ulong CurrentValue
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -48,11 +48,8 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Apply(Drawable d)
|
public override void Apply(Drawable d) => ((ComboResultCounter)d).DisplayedCount = CurrentValue;
|
||||||
{
|
public override void ReadIntoStartValue(Drawable d) => StartValue = ((ComboResultCounter)d).DisplayedCount;
|
||||||
base.Apply(d);
|
|
||||||
((ComboResultCounter)d).DisplayedCount = CurrentValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
iconsContainer = new ReverseDepthFillFlowContainer<ModIcon>
|
iconsContainer = new ReverseChildIDFillFlowContainer<ModIcon>
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
|
@ -20,15 +20,15 @@ namespace osu.Game.Screens.Play
|
|||||||
private SpriteText countSpriteText;
|
private SpriteText countSpriteText;
|
||||||
|
|
||||||
public bool IsCounting { get; set; }
|
public bool IsCounting { get; set; }
|
||||||
private int count;
|
private int countPresses;
|
||||||
public int Count
|
public int CountPresses
|
||||||
{
|
{
|
||||||
get { return count; }
|
get { return countPresses; }
|
||||||
private set
|
private set
|
||||||
{
|
{
|
||||||
if (count != value)
|
if (countPresses != value)
|
||||||
{
|
{
|
||||||
count = value;
|
countPresses = value;
|
||||||
countSpriteText.Text = value.ToString(@"#,0");
|
countSpriteText.Text = value.ToString(@"#,0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ namespace osu.Game.Screens.Play
|
|||||||
isLit = value;
|
isLit = value;
|
||||||
updateGlowSprite(value);
|
updateGlowSprite(value);
|
||||||
if (value && IsCounting)
|
if (value && IsCounting)
|
||||||
Count++;
|
CountPresses++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ namespace osu.Game.Screens.Play
|
|||||||
},
|
},
|
||||||
countSpriteText = new OsuSpriteText
|
countSpriteText = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = Count.ToString(@"#,0"),
|
Text = CountPresses.ToString(@"#,0"),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
RelativePositionAxes = Axes.Both,
|
RelativePositionAxes = Axes.Both,
|
||||||
@ -128,6 +128,6 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetCount() => Count = 0;
|
public void ResetCount() => CountPresses = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
scoreProcessor = HitRenderer.CreateScoreProcessor();
|
scoreProcessor = HitRenderer.CreateScoreProcessor();
|
||||||
|
|
||||||
hudOverlay.KeyCounter.Add(rulesetInstance.CreateGameplayKeys());
|
hudOverlay.KeyCounter.AddRange(rulesetInstance.CreateGameplayKeys());
|
||||||
hudOverlay.BindProcessor(scoreProcessor);
|
hudOverlay.BindProcessor(scoreProcessor);
|
||||||
hudOverlay.BindHitRenderer(HitRenderer);
|
hudOverlay.BindHitRenderer(HitRenderer);
|
||||||
|
|
||||||
|
@ -227,6 +227,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
new Sprite
|
new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Texture = beatmap?.Background,
|
Texture = beatmap?.Background,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
@ -163,6 +163,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
{
|
{
|
||||||
new Sprite
|
new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Alpha = 0.2f,
|
Alpha = 0.2f,
|
||||||
Texture = Beatmap?.Background,
|
Texture = Beatmap?.Background,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
fill = new Box
|
fill = new Box
|
||||||
{
|
{
|
||||||
|
@ -343,6 +343,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
{
|
{
|
||||||
cover = new Sprite
|
cover = new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
@ -12,7 +12,6 @@ using osu.Game.Beatmaps.Drawables;
|
|||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using System.Collections;
|
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -22,7 +21,7 @@ using osu.Framework.Configuration;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
internal class BeatmapCarousel : ScrollContainer, IEnumerable<BeatmapGroup>
|
internal class BeatmapCarousel : ScrollContainer
|
||||||
{
|
{
|
||||||
public BeatmapInfo SelectedBeatmap => selectedPanel?.Beatmap;
|
public BeatmapInfo SelectedBeatmap => selectedPanel?.Beatmap;
|
||||||
|
|
||||||
@ -265,10 +264,6 @@ namespace osu.Game.Screens.Select
|
|||||||
perform();
|
perform();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerator<BeatmapGroup> GetEnumerator() => groups.GetEnumerator();
|
|
||||||
|
|
||||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
|
||||||
|
|
||||||
private BeatmapGroup createGroup(BeatmapSetInfo beatmapSet)
|
private BeatmapGroup createGroup(BeatmapSetInfo beatmapSet)
|
||||||
{
|
{
|
||||||
foreach (var b in beatmapSet.Beatmaps)
|
foreach (var b in beatmapSet.Beatmaps)
|
||||||
@ -307,7 +302,7 @@ namespace osu.Game.Screens.Select
|
|||||||
panels.Remove(p);
|
panels.Remove(p);
|
||||||
|
|
||||||
scrollableContent.Remove(group.Header);
|
scrollableContent.Remove(group.Header);
|
||||||
scrollableContent.Remove(group.BeatmapPanels);
|
scrollableContent.RemoveRange(group.BeatmapPanels);
|
||||||
|
|
||||||
if (selectedGroup == group)
|
if (selectedGroup == group)
|
||||||
SelectNext();
|
SelectNext();
|
||||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public BeatmapDetailArea()
|
public BeatmapDetailArea()
|
||||||
{
|
{
|
||||||
AddInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
new BeatmapDetailAreaTabControl
|
new BeatmapDetailAreaTabControl
|
||||||
{
|
{
|
||||||
@ -61,7 +61,7 @@ namespace osu.Game.Screens.Select
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Add(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
Details = new BeatmapDetails
|
Details = new BeatmapDetails
|
||||||
{
|
{
|
||||||
|
@ -152,6 +152,7 @@ namespace osu.Game.Screens.Select
|
|||||||
// Zoomed-in and cropped beatmap background
|
// Zoomed-in and cropped beatmap background
|
||||||
new BeatmapBackgroundSprite(beatmap)
|
new BeatmapBackgroundSprite(beatmap)
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
|
@ -31,6 +31,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
{
|
{
|
||||||
rankSprite = new Sprite
|
rankSprite = new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
FillMode = FillMode.Fit
|
FillMode = FillMode.Fit
|
||||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Screens.Select.Options
|
|||||||
Scale = new Vector2(1, 0),
|
Scale = new Vector2(1, 0),
|
||||||
Colour = Color4.Black.Opacity(0.5f),
|
Colour = Color4.Black.Opacity(0.5f),
|
||||||
},
|
},
|
||||||
buttonsContainer = new ReverseDepthFillFlowContainer<BeatmapOptionsButton>
|
buttonsContainer = new ReverseChildIDFillFlowContainer<BeatmapOptionsButton>
|
||||||
{
|
{
|
||||||
Height = height,
|
Height = height,
|
||||||
RelativePositionAxes = Axes.X,
|
RelativePositionAxes = Axes.X,
|
||||||
|
@ -82,6 +82,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
},
|
},
|
||||||
new Sprite
|
new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
Texture = textures.Get(@"Backgrounds/Drawings/background.png")
|
Texture = textures.Get(@"Backgrounds/Drawings/background.png")
|
||||||
},
|
},
|
||||||
|
@ -151,9 +151,9 @@ namespace osu.Game.Screens.Tournament
|
|||||||
{
|
{
|
||||||
flagSprite = new Sprite
|
flagSprite = new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
|
|
||||||
FillMode = FillMode.Fit
|
FillMode = FillMode.Fit
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
|
@ -297,7 +297,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void speedTo(float value, double duration = 0, EasingTypes easing = EasingTypes.None) => TransformTo(() => speed, value, duration, easing, new TransformScrollSpeed());
|
private void speedTo(float value, double duration = 0, EasingTypes easing = EasingTypes.None) => TransformTo(value, duration, easing, new TransformScrollSpeed());
|
||||||
|
|
||||||
private enum ScrollState
|
private enum ScrollState
|
||||||
{
|
{
|
||||||
@ -310,11 +310,8 @@ namespace osu.Game.Screens.Tournament
|
|||||||
|
|
||||||
public class TransformScrollSpeed : TransformFloat<Drawable>
|
public class TransformScrollSpeed : TransformFloat<Drawable>
|
||||||
{
|
{
|
||||||
public override void Apply(Drawable d)
|
public override void Apply(Drawable d) => ((ScrollingTeamContainer)d).speed = CurrentValue;
|
||||||
{
|
public override void ReadIntoStartValue(Drawable d) => StartValue = ((ScrollingTeamContainer)d).speed;
|
||||||
base.Apply(d);
|
|
||||||
((ScrollingTeamContainer)d).speed = CurrentValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ScrollingTeam : Container
|
public class ScrollingTeam : Container
|
||||||
|
@ -31,6 +31,7 @@ namespace osu.Game.Users
|
|||||||
|
|
||||||
Add(new Sprite
|
Add(new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Texture = texture,
|
Texture = texture,
|
||||||
FillMode = FillMode.Fit,
|
FillMode = FillMode.Fit,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
@ -46,6 +46,7 @@ namespace osu.Game.Users
|
|||||||
{
|
{
|
||||||
new AsyncLoadWrapper(new CoverBackgroundSprite(user)
|
new AsyncLoadWrapper(new CoverBackgroundSprite(user)
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
|
@ -190,7 +190,6 @@
|
|||||||
<Compile Include="Rulesets\Objects\Drawables\IScrollingHitObject.cs" />
|
<Compile Include="Rulesets\Objects\Drawables\IScrollingHitObject.cs" />
|
||||||
<Compile Include="Rulesets\Judgements\Judgement.cs" />
|
<Compile Include="Rulesets\Judgements\Judgement.cs" />
|
||||||
<Compile Include="Rulesets\Objects\HitObjectParser.cs" />
|
<Compile Include="Rulesets\Objects\HitObjectParser.cs" />
|
||||||
<Compile Include="Rulesets\Objects\HitObjectStartTimeComparer.cs" />
|
|
||||||
<Compile Include="Rulesets\Objects\Types\IHasCombo.cs" />
|
<Compile Include="Rulesets\Objects\Types\IHasCombo.cs" />
|
||||||
<Compile Include="Rulesets\Objects\Types\IHasEndTime.cs" />
|
<Compile Include="Rulesets\Objects\Types\IHasEndTime.cs" />
|
||||||
<Compile Include="Rulesets\Objects\Types\IHasDistance.cs" />
|
<Compile Include="Rulesets\Objects\Types\IHasDistance.cs" />
|
||||||
@ -476,7 +475,7 @@
|
|||||||
<Compile Include="Overlays\Direct\DirectListPanel.cs" />
|
<Compile Include="Overlays\Direct\DirectListPanel.cs" />
|
||||||
<Compile Include="Database\OnlineWorkingBeatmap.cs" />
|
<Compile Include="Database\OnlineWorkingBeatmap.cs" />
|
||||||
<Compile Include="Database\BeatmapOnlineInfo.cs" />
|
<Compile Include="Database\BeatmapOnlineInfo.cs" />
|
||||||
<Compile Include="Graphics\Containers\ReverseDepthFillFlowContainer.cs" />
|
<Compile Include="Graphics\Containers\ReverseChildIDFillFlowContainer.cs" />
|
||||||
<Compile Include="Database\RankStatus.cs" />
|
<Compile Include="Database\RankStatus.cs" />
|
||||||
<Compile Include="Overlays\SearchableList\SearchableListHeader.cs" />
|
<Compile Include="Overlays\SearchableList\SearchableListHeader.cs" />
|
||||||
<Compile Include="Overlays\SearchableList\HeaderTabControl.cs" />
|
<Compile Include="Overlays\SearchableList\HeaderTabControl.cs" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user