mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 19:22:56 +08:00
Merge branch 'master' into better-hitsounds
This commit is contained in:
commit
4783d17d94
@ -1 +1 @@
|
|||||||
Subproject commit 1c08c1fec496e9d64ba8f30ff0464cd5cdf567b6
|
Subproject commit a7c99e06ff4c3f56fad24bec170eb93f42b1e149
|
@ -1 +1 @@
|
|||||||
Subproject commit 12bbab717d372dadbd3220d38da862276ac97e98
|
Subproject commit 0d6dc294738d433999c6c68ff61169d3a8e6ce5f
|
@ -3,15 +3,12 @@
|
|||||||
|
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Threading;
|
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
|
|
||||||
namespace osu.Desktop.VisualTests.Tests
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
{
|
{
|
||||||
internal class TestCaseChatDisplay : TestCase
|
internal class TestCaseChatDisplay : TestCase
|
||||||
{
|
{
|
||||||
private ScheduledDelegate messageRequest;
|
|
||||||
|
|
||||||
public override string Description => @"Testing chat api and overlay";
|
public override string Description => @"Testing chat api and overlay";
|
||||||
|
|
||||||
public override void Reset()
|
public override void Reset()
|
||||||
|
@ -112,7 +112,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Width = 150,
|
Width = 150,
|
||||||
Height = 10,
|
Height = 10,
|
||||||
SelectionColor = Color4.Orange,
|
SelectionColor = Color4.Orange,
|
||||||
Bindable = playbackSpeed
|
Value = playbackSpeed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
65
osu.Desktop.VisualTests/Tests/TestCaseInGameOverlays.cs
Normal file
65
osu.Desktop.VisualTests/Tests/TestCaseInGameOverlays.cs
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
// 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.Containers;
|
||||||
|
using osu.Framework.Logging;
|
||||||
|
using osu.Framework.Testing;
|
||||||
|
using osu.Game.Screens.Play;
|
||||||
|
|
||||||
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
|
{
|
||||||
|
internal class TestCaseInGameOverlays : TestCase
|
||||||
|
{
|
||||||
|
public override string Description => @"Tests pause and fail overlays";
|
||||||
|
|
||||||
|
private PauseOverlay pauseOverlay;
|
||||||
|
private FailOverlay failOverlay;
|
||||||
|
private int retryCount;
|
||||||
|
|
||||||
|
public override void Reset()
|
||||||
|
{
|
||||||
|
base.Reset();
|
||||||
|
|
||||||
|
pauseOverlay = new PauseOverlay
|
||||||
|
{
|
||||||
|
Depth = -1,
|
||||||
|
OnResume = () => Logger.Log(@"Resume"),
|
||||||
|
OnRetry = () => Logger.Log(@"Retry"),
|
||||||
|
OnQuit = () => Logger.Log(@"Quit"),
|
||||||
|
};
|
||||||
|
|
||||||
|
failOverlay = new FailOverlay
|
||||||
|
{
|
||||||
|
Depth = -1,
|
||||||
|
OnRetry = () => Logger.Log(@"Retry"),
|
||||||
|
OnQuit = () => Logger.Log(@"Quit"),
|
||||||
|
};
|
||||||
|
|
||||||
|
Add(pauseOverlay);
|
||||||
|
Add(failOverlay);
|
||||||
|
|
||||||
|
AddStep(@"Pause", delegate {
|
||||||
|
if(failOverlay.State == Visibility.Visible)
|
||||||
|
{
|
||||||
|
failOverlay.Hide();
|
||||||
|
}
|
||||||
|
pauseOverlay.Show();
|
||||||
|
});
|
||||||
|
AddStep("Fail", delegate {
|
||||||
|
if (pauseOverlay.State == Visibility.Visible)
|
||||||
|
{
|
||||||
|
pauseOverlay.Hide();
|
||||||
|
}
|
||||||
|
failOverlay.Show();
|
||||||
|
});
|
||||||
|
AddStep("Add Retry", delegate
|
||||||
|
{
|
||||||
|
retryCount++;
|
||||||
|
pauseOverlay.Retries = retryCount;
|
||||||
|
failOverlay.Retries = retryCount;
|
||||||
|
});
|
||||||
|
|
||||||
|
retryCount = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -57,7 +57,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Width = 150,
|
Width = 150,
|
||||||
Height = 10,
|
Height = 10,
|
||||||
SelectionColor = Color4.Orange,
|
SelectionColor = Color4.Orange,
|
||||||
Bindable = bindable
|
Value = bindable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,38 +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.Logging;
|
|
||||||
using osu.Framework.Testing;
|
|
||||||
using osu.Game.Screens.Play;
|
|
||||||
|
|
||||||
namespace osu.Desktop.VisualTests.Tests
|
|
||||||
{
|
|
||||||
internal class TestCasePauseOverlay : TestCase
|
|
||||||
{
|
|
||||||
public override string Description => @"Tests the pause overlay";
|
|
||||||
|
|
||||||
private PauseOverlay pauseOverlay;
|
|
||||||
private int retryCount;
|
|
||||||
|
|
||||||
public override void Reset()
|
|
||||||
{
|
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(pauseOverlay = new PauseOverlay
|
|
||||||
{
|
|
||||||
Depth = -1,
|
|
||||||
OnResume = () => Logger.Log(@"Resume"),
|
|
||||||
OnRetry = () => Logger.Log(@"Retry"),
|
|
||||||
OnQuit = () => Logger.Log(@"Quit")
|
|
||||||
});
|
|
||||||
AddStep("Pause", pauseOverlay.Show);
|
|
||||||
AddStep("Add Retry", delegate
|
|
||||||
{
|
|
||||||
retryCount++;
|
|
||||||
pauseOverlay.Retries = retryCount;
|
|
||||||
});
|
|
||||||
|
|
||||||
retryCount = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -14,7 +14,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
internal class TestCasePlaySongSelect : TestCase
|
internal class TestCasePlaySongSelect : TestCase
|
||||||
{
|
{
|
||||||
private BeatmapDatabase db, oldDb;
|
private BeatmapDatabase db;
|
||||||
private TestStorage storage;
|
private TestStorage storage;
|
||||||
private PlaySongSelect songSelect;
|
private PlaySongSelect songSelect;
|
||||||
|
|
||||||
@ -44,13 +44,13 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
AddStep(@"Sort by Difficulty", delegate { songSelect.FilterControl.Sort = SortMode.Difficulty; });
|
AddStep(@"Sort by Difficulty", delegate { songSelect.FilterControl.Sort = SortMode.Difficulty; });
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
//protected override void Dispose(bool isDisposing)
|
||||||
{
|
//{
|
||||||
if (oldDb != null)
|
// if (oldDb != null)
|
||||||
db = null;
|
// db = null;
|
||||||
|
|
||||||
base.Dispose(isDisposing);
|
// base.Dispose(isDisposing);
|
||||||
}
|
//}
|
||||||
|
|
||||||
private BeatmapSetInfo createTestBeatmapSet(int i)
|
private BeatmapSetInfo createTestBeatmapSet(int i)
|
||||||
{
|
{
|
||||||
|
@ -1,24 +1,15 @@
|
|||||||
// 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 osu.Framework.Input.Handlers;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Modes.Mods;
|
using osu.Game.Modes.Mods;
|
||||||
using osu.Game.Modes.Osu.Mods;
|
using osu.Game.Modes.Osu.Mods;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace osu.Desktop.VisualTests.Tests
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
{
|
{
|
||||||
internal class TestCaseReplay : TestCasePlayer
|
internal class TestCaseReplay : TestCasePlayer
|
||||||
{
|
{
|
||||||
private WorkingBeatmap beatmap;
|
|
||||||
|
|
||||||
private InputHandler replay;
|
|
||||||
|
|
||||||
private Func<Stream> getReplayStream;
|
|
||||||
|
|
||||||
public override string Description => @"Testing replay playback.";
|
public override string Description => @"Testing replay playback.";
|
||||||
|
|
||||||
protected override Player CreatePlayer(WorkingBeatmap beatmap)
|
protected override Player CreatePlayer(WorkingBeatmap beatmap)
|
||||||
|
@ -22,8 +22,6 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
int numerator = 0, denominator = 0;
|
int numerator = 0, denominator = 0;
|
||||||
|
|
||||||
bool maniaHold = false;
|
|
||||||
|
|
||||||
ScoreCounter score = new ScoreCounter(7)
|
ScoreCounter score = new ScoreCounter(7)
|
||||||
{
|
{
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
|
@ -36,9 +36,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
filter.PinItem(GroupMode.All);
|
filter.PinItem(GroupMode.All);
|
||||||
filter.PinItem(GroupMode.RecentlyPlayed);
|
filter.PinItem(GroupMode.RecentlyPlayed);
|
||||||
|
|
||||||
filter.ItemChanged += (sender, mode) =>
|
filter.SelectedItem.ValueChanged += newFilter =>
|
||||||
{
|
{
|
||||||
text.Text = "Currently Selected: " + mode.ToString();
|
text.Text = "Currently Selected: " + newFilter.ToString();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ using OpenTK;
|
|||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
|
||||||
|
|
||||||
namespace osu.Desktop.VisualTests.Tests
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
{
|
{
|
||||||
@ -29,7 +29,6 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Add(new CirclePiece
|
Add(new CirclePiece
|
||||||
{
|
{
|
||||||
Position = new Vector2(100, 100),
|
Position = new Vector2(100, 100),
|
||||||
Width = 0,
|
|
||||||
AccentColour = Color4.DarkRed,
|
AccentColour = Color4.DarkRed,
|
||||||
KiaiMode = kiai,
|
KiaiMode = kiai,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
@ -38,10 +37,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Add(new StrongCirclePiece
|
Add(new CirclePiece(true)
|
||||||
{
|
{
|
||||||
Position = new Vector2(350, 100),
|
Position = new Vector2(350, 100),
|
||||||
Width = 0,
|
|
||||||
AccentColour = Color4.DarkRed,
|
AccentColour = Color4.DarkRed,
|
||||||
KiaiMode = kiai,
|
KiaiMode = kiai,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
@ -53,7 +51,6 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Add(new CirclePiece
|
Add(new CirclePiece
|
||||||
{
|
{
|
||||||
Position = new Vector2(100, 300),
|
Position = new Vector2(100, 300),
|
||||||
Width = 0,
|
|
||||||
AccentColour = Color4.DarkBlue,
|
AccentColour = Color4.DarkBlue,
|
||||||
KiaiMode = kiai,
|
KiaiMode = kiai,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
@ -62,10 +59,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Add(new StrongCirclePiece
|
Add(new CirclePiece(true)
|
||||||
{
|
{
|
||||||
Position = new Vector2(350, 300),
|
Position = new Vector2(350, 300),
|
||||||
Width = 0,
|
|
||||||
AccentColour = Color4.DarkBlue,
|
AccentColour = Color4.DarkBlue,
|
||||||
KiaiMode = kiai,
|
KiaiMode = kiai,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
@ -77,7 +73,6 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Add(new CirclePiece
|
Add(new CirclePiece
|
||||||
{
|
{
|
||||||
Position = new Vector2(100, 500),
|
Position = new Vector2(100, 500),
|
||||||
Width = 0,
|
|
||||||
AccentColour = Color4.Orange,
|
AccentColour = Color4.Orange,
|
||||||
KiaiMode = kiai,
|
KiaiMode = kiai,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
@ -86,20 +81,22 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Add(new CirclePiece
|
Add(new ElongatedCirclePiece
|
||||||
{
|
{
|
||||||
Position = new Vector2(575, 100),
|
Position = new Vector2(575, 100),
|
||||||
Width = 0.25f,
|
|
||||||
AccentColour = Color4.Orange,
|
AccentColour = Color4.Orange,
|
||||||
KiaiMode = kiai,
|
KiaiMode = kiai,
|
||||||
|
Length = 0.10f,
|
||||||
|
PlayfieldLengthReference = () => DrawSize.X
|
||||||
});
|
});
|
||||||
|
|
||||||
Add(new StrongCirclePiece
|
Add(new ElongatedCirclePiece(true)
|
||||||
{
|
{
|
||||||
Position = new Vector2(575, 300),
|
Position = new Vector2(575, 300),
|
||||||
Width = 0.25f,
|
|
||||||
AccentColour = Color4.Orange,
|
AccentColour = Color4.Orange,
|
||||||
KiaiMode = kiai
|
KiaiMode = kiai,
|
||||||
|
Length = 0.10f,
|
||||||
|
PlayfieldLengthReference = () => DrawSize.X
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,10 +5,11 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
|
using osu.Framework.Timing;
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
using osu.Game.Modes.Taiko.Judgements;
|
using osu.Game.Modes.Taiko.Judgements;
|
||||||
using osu.Game.Modes.Taiko.Objects;
|
using osu.Game.Modes.Taiko.Objects;
|
||||||
using osu.Game.Modes.Taiko.Objects.Drawable;
|
using osu.Game.Modes.Taiko.Objects.Drawables;
|
||||||
using osu.Game.Modes.Taiko.UI;
|
using osu.Game.Modes.Taiko.UI;
|
||||||
|
|
||||||
namespace osu.Desktop.VisualTests.Tests
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
@ -19,6 +20,12 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private TaikoPlayfield playfield;
|
private TaikoPlayfield playfield;
|
||||||
|
|
||||||
|
protected override double TimePerAction => default_duration * 2;
|
||||||
|
|
||||||
|
private const double default_duration = 300;
|
||||||
|
|
||||||
|
private const float scroll_time = 1000;
|
||||||
|
|
||||||
public override void Reset()
|
public override void Reset()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.Reset();
|
||||||
@ -27,14 +34,20 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
AddStep("Miss :(", addMissJudgement);
|
AddStep("Miss :(", addMissJudgement);
|
||||||
AddStep("DrumRoll", () => addDrumRoll(false));
|
AddStep("DrumRoll", () => addDrumRoll(false));
|
||||||
AddStep("Strong DrumRoll", () => addDrumRoll(true));
|
AddStep("Strong DrumRoll", () => addDrumRoll(true));
|
||||||
AddStep("Swell", addSwell);
|
AddStep("Swell", () => addSwell());
|
||||||
AddStep("Centre", () => addCentreHit(false));
|
AddStep("Centre", () => addCentreHit(false));
|
||||||
AddStep("Strong Centre", () => addCentreHit(true));
|
AddStep("Strong Centre", () => addCentreHit(true));
|
||||||
AddStep("Rim", () => addRimHit(false));
|
AddStep("Rim", () => addRimHit(false));
|
||||||
AddStep("Strong Rim", () => addRimHit(true));
|
AddStep("Strong Rim", () => addRimHit(true));
|
||||||
|
AddStep("Add bar line", () => addBarLine(false));
|
||||||
|
AddStep("Add major bar line", () => addBarLine(true));
|
||||||
|
|
||||||
|
|
||||||
|
var rateAdjustClock = new StopwatchClock(true) { Rate = 1 };
|
||||||
|
|
||||||
Add(new Container
|
Add(new Container
|
||||||
{
|
{
|
||||||
|
Clock = new FramedClock(rateAdjustClock),
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Y = 200,
|
Y = 200,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
@ -73,38 +86,53 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addSwell()
|
private void addBarLine(bool major, double delay = scroll_time)
|
||||||
|
{
|
||||||
|
BarLine bl = new BarLine
|
||||||
|
{
|
||||||
|
StartTime = playfield.Time.Current + delay,
|
||||||
|
ScrollTime = scroll_time
|
||||||
|
};
|
||||||
|
|
||||||
|
playfield.AddBarLine(major ? new DrawableBarLineMajor(bl) : new DrawableBarLine(bl));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addSwell(double duration = default_duration)
|
||||||
{
|
{
|
||||||
playfield.Add(new DrawableSwell(new Swell
|
playfield.Add(new DrawableSwell(new Swell
|
||||||
{
|
{
|
||||||
StartTime = Time.Current + 1000,
|
StartTime = playfield.Time.Current + scroll_time,
|
||||||
EndTime = Time.Current + 5000,
|
Duration = duration,
|
||||||
PreEmpt = 1000
|
ScrollTime = scroll_time
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addDrumRoll(bool strong)
|
private void addDrumRoll(bool strong, double duration = default_duration)
|
||||||
{
|
{
|
||||||
|
addBarLine(true);
|
||||||
|
addBarLine(true, scroll_time + duration);
|
||||||
|
|
||||||
var d = new DrumRoll
|
var d = new DrumRoll
|
||||||
{
|
{
|
||||||
StartTime = Time.Current + 1000,
|
StartTime = playfield.Time.Current + scroll_time,
|
||||||
Distance = 20000,
|
IsStrong = strong,
|
||||||
PreEmpt = 1000,
|
Duration = duration,
|
||||||
|
ScrollTime = scroll_time,
|
||||||
};
|
};
|
||||||
|
|
||||||
playfield.Add(strong ? new DrawableStrongDrumRoll(d) : new DrawableDrumRoll(d));
|
playfield.Add(new DrawableDrumRoll(d));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addCentreHit(bool strong)
|
private void addCentreHit(bool strong)
|
||||||
{
|
{
|
||||||
Hit h = new Hit
|
Hit h = new Hit
|
||||||
{
|
{
|
||||||
StartTime = Time.Current + 1000,
|
StartTime = playfield.Time.Current + scroll_time,
|
||||||
PreEmpt = 1000
|
ScrollTime = scroll_time
|
||||||
};
|
};
|
||||||
|
|
||||||
if (strong)
|
if (strong)
|
||||||
playfield.Add(new DrawableStrongCentreHit(h));
|
playfield.Add(new DrawableCentreHitStrong(h));
|
||||||
else
|
else
|
||||||
playfield.Add(new DrawableCentreHit(h));
|
playfield.Add(new DrawableCentreHit(h));
|
||||||
}
|
}
|
||||||
@ -113,12 +141,12 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
Hit h = new Hit
|
Hit h = new Hit
|
||||||
{
|
{
|
||||||
StartTime = Time.Current + 1000,
|
StartTime = playfield.Time.Current + scroll_time,
|
||||||
PreEmpt = 1000
|
ScrollTime = scroll_time
|
||||||
};
|
};
|
||||||
|
|
||||||
if (strong)
|
if (strong)
|
||||||
playfield.Add(new DrawableStrongRimHit(h));
|
playfield.Add(new DrawableRimHitStrong(h));
|
||||||
else
|
else
|
||||||
playfield.Add(new DrawableRimHit(h));
|
playfield.Add(new DrawableRimHit(h));
|
||||||
}
|
}
|
||||||
|
@ -189,6 +189,7 @@
|
|||||||
<Compile Include="Tests\TestCaseChatDisplay.cs" />
|
<Compile Include="Tests\TestCaseChatDisplay.cs" />
|
||||||
<Compile Include="Tests\TestCaseDrawings.cs" />
|
<Compile Include="Tests\TestCaseDrawings.cs" />
|
||||||
<Compile Include="Tests\TestCaseGamefield.cs" />
|
<Compile Include="Tests\TestCaseGamefield.cs" />
|
||||||
|
<Compile Include="Tests\TestCaseInGameOverlays.cs" />
|
||||||
<Compile Include="Tests\TestCaseMusicController.cs" />
|
<Compile Include="Tests\TestCaseMusicController.cs" />
|
||||||
<Compile Include="Tests\TestCaseNotificationManager.cs" />
|
<Compile Include="Tests\TestCaseNotificationManager.cs" />
|
||||||
<Compile Include="Tests\TestCasePlayer.cs" />
|
<Compile Include="Tests\TestCasePlayer.cs" />
|
||||||
@ -206,7 +207,6 @@
|
|||||||
<Compile Include="VisualTestGame.cs" />
|
<Compile Include="VisualTestGame.cs" />
|
||||||
<Compile Include="Platform\TestStorage.cs" />
|
<Compile Include="Platform\TestStorage.cs" />
|
||||||
<Compile Include="Tests\TestCaseOptions.cs" />
|
<Compile Include="Tests\TestCaseOptions.cs" />
|
||||||
<Compile Include="Tests\TestCasePauseOverlay.cs" />
|
|
||||||
<Compile Include="Tests\TestCaseModSelectOverlay.cs" />
|
<Compile Include="Tests\TestCaseModSelectOverlay.cs" />
|
||||||
<Compile Include="Tests\TestCaseDialogOverlay.cs" />
|
<Compile Include="Tests\TestCaseDialogOverlay.cs" />
|
||||||
<Compile Include="Tests\TestCaseBeatmapOptionsOverlay.cs" />
|
<Compile Include="Tests\TestCaseBeatmapOptionsOverlay.cs" />
|
||||||
|
@ -21,6 +21,8 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
private readonly Container judgementLayer;
|
private readonly Container judgementLayer;
|
||||||
private readonly ConnectionRenderer<OsuHitObject> connectionLayer;
|
private readonly ConnectionRenderer<OsuHitObject> connectionLayer;
|
||||||
|
|
||||||
|
public override bool ProvidingUserCursor => true;
|
||||||
|
|
||||||
public override Vector2 Size
|
public override Vector2 Size
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -8,6 +8,8 @@ using osu.Game.Modes.Taiko.Objects;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Game.Beatmaps.Legacy;
|
||||||
|
using osu.Game.Beatmaps.Timing;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
|
|
||||||
@ -41,6 +43,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
|||||||
{
|
{
|
||||||
return new Beatmap<TaikoHitObject>(original)
|
return new Beatmap<TaikoHitObject>(original)
|
||||||
{
|
{
|
||||||
|
TimingInfo = original is LegacyBeatmap ? new LegacyTimingInfo(original.TimingInfo) : original.TimingInfo,
|
||||||
HitObjects = original.HitObjects.SelectMany(h => convertHitObject(h, original)).ToList()
|
HitObjects = original.HitObjects.SelectMany(h => convertHitObject(h, original)).ToList()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -100,7 +103,6 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
|||||||
StartTime = j,
|
StartTime = j,
|
||||||
Samples = obj.Samples,
|
Samples = obj.Samples,
|
||||||
IsStrong = strong,
|
IsStrong = strong,
|
||||||
VelocityMultiplier = legacy_velocity_multiplier
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -111,9 +113,8 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
|||||||
StartTime = obj.StartTime,
|
StartTime = obj.StartTime,
|
||||||
Samples = obj.Samples,
|
Samples = obj.Samples,
|
||||||
IsStrong = strong,
|
IsStrong = strong,
|
||||||
Distance = distance,
|
Duration = taikoDuration,
|
||||||
TickRate = beatmap.BeatmapInfo.Difficulty.SliderTickRate == 3 ? 3 : 4,
|
TickRate = beatmap.BeatmapInfo.Difficulty.SliderTickRate == 3 ? 3 : 4,
|
||||||
VelocityMultiplier = legacy_velocity_multiplier
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -126,9 +127,8 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
|||||||
StartTime = obj.StartTime,
|
StartTime = obj.StartTime,
|
||||||
Samples = obj.Samples,
|
Samples = obj.Samples,
|
||||||
IsStrong = strong,
|
IsStrong = strong,
|
||||||
EndTime = endTimeData.EndTime,
|
Duration = endTimeData.Duration,
|
||||||
RequiredHits = (int)Math.Max(1, endTimeData.Duration / 1000 * hitMultiplier),
|
RequiredHits = (int)Math.Max(1, endTimeData.Duration / 1000 * hitMultiplier),
|
||||||
VelocityMultiplier = legacy_velocity_multiplier
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -142,7 +142,6 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
|||||||
StartTime = obj.StartTime,
|
StartTime = obj.StartTime,
|
||||||
Samples = obj.Samples,
|
Samples = obj.Samples,
|
||||||
IsStrong = strong,
|
IsStrong = strong,
|
||||||
VelocityMultiplier = legacy_velocity_multiplier
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -152,10 +151,25 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
|||||||
StartTime = obj.StartTime,
|
StartTime = obj.StartTime,
|
||||||
Samples = obj.Samples,
|
Samples = obj.Samples,
|
||||||
IsStrong = strong,
|
IsStrong = strong,
|
||||||
VelocityMultiplier = legacy_velocity_multiplier
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class LegacyTimingInfo : TimingInfo
|
||||||
|
{
|
||||||
|
public LegacyTimingInfo(TimingInfo original)
|
||||||
|
{
|
||||||
|
if (original is LegacyTimingInfo)
|
||||||
|
ControlPoints.AddRange(original.ControlPoints);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ControlPoints.AddRange(original.ControlPoints.Select(c => c.Clone()));
|
||||||
|
|
||||||
|
foreach (var c in ControlPoints)
|
||||||
|
c.SpeedMultiplier *= legacy_velocity_multiplier;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
9
osu.Game.Modes.Taiko/Objects/BarLine.cs
Normal file
9
osu.Game.Modes.Taiko/Objects/BarLine.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.Taiko.Objects
|
||||||
|
{
|
||||||
|
public class BarLine : TaikoHitObject
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -1,105 +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 OpenTK.Input;
|
|
||||||
using osu.Game.Modes.Taiko.Judgements;
|
|
||||||
using System;
|
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using OpenTK;
|
|
||||||
using OpenTK.Graphics;
|
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|
||||||
{
|
|
||||||
public class DrawableDrumRollTick : DrawableTaikoHitObject
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The size of a tick.
|
|
||||||
/// </summary>
|
|
||||||
private const float tick_size = TaikoHitObject.CIRCLE_RADIUS / 2;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Any tick that is not the first for a drumroll is not filled, but is instead displayed
|
|
||||||
/// as a hollow circle. This is what controls the border width of that circle.
|
|
||||||
/// </summary>
|
|
||||||
private const float tick_border_width = tick_size / 4;
|
|
||||||
|
|
||||||
private readonly DrumRollTick tick;
|
|
||||||
|
|
||||||
private readonly CircularContainer bodyContainer;
|
|
||||||
|
|
||||||
public DrawableDrumRollTick(DrumRollTick tick)
|
|
||||||
: base(tick)
|
|
||||||
{
|
|
||||||
this.tick = tick;
|
|
||||||
|
|
||||||
Anchor = Anchor.CentreLeft;
|
|
||||||
Origin = Anchor.Centre;
|
|
||||||
|
|
||||||
RelativePositionAxes = Axes.X;
|
|
||||||
Size = new Vector2(tick_size);
|
|
||||||
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
bodyContainer = new CircularContainer
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Masking = true,
|
|
||||||
BorderThickness = tick_border_width,
|
|
||||||
BorderColour = Color4.White,
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Alpha = tick.FirstTick ? 1 : 0,
|
|
||||||
AlwaysPresent = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override TaikoJudgement CreateJudgement() => new TaikoDrumRollTickJudgement { SecondHit = tick.IsStrong };
|
|
||||||
|
|
||||||
protected override void CheckJudgement(bool userTriggered)
|
|
||||||
{
|
|
||||||
if (!userTriggered)
|
|
||||||
{
|
|
||||||
if (Judgement.TimeOffset > tick.HitWindow)
|
|
||||||
Judgement.Result = HitResult.Miss;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Math.Abs(Judgement.TimeOffset) < tick.HitWindow)
|
|
||||||
{
|
|
||||||
Judgement.Result = HitResult.Hit;
|
|
||||||
Judgement.TaikoResult = TaikoHitResult.Great;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void UpdateState(ArmedState state)
|
|
||||||
{
|
|
||||||
switch (state)
|
|
||||||
{
|
|
||||||
case ArmedState.Hit:
|
|
||||||
bodyContainer.ScaleTo(0, 100, EasingTypes.OutQuint);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void UpdateScrollPosition(double time)
|
|
||||||
{
|
|
||||||
// Ticks don't move
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool HandleKeyPress(Key key)
|
|
||||||
{
|
|
||||||
return Judgement.Result == HitResult.None && UpdateJudgement(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +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.Game.Modes.Taiko.Judgements;
|
|
||||||
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|
||||||
{
|
|
||||||
public class DrawableStrongDrumRoll : DrawableDrumRoll
|
|
||||||
{
|
|
||||||
public DrawableStrongDrumRoll(DrumRoll drumRoll)
|
|
||||||
: base(drumRoll)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override TaikoJudgement CreateJudgement() => new TaikoJudgement { SecondHit = true };
|
|
||||||
|
|
||||||
protected override CirclePiece CreateCirclePiece() => new StrongCirclePiece();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,158 +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.Extensions.Color4Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Game.Graphics.Backgrounds;
|
|
||||||
using OpenTK.Graphics;
|
|
||||||
using System;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// A circle piece which is used uniformly through osu!taiko to visualise hitobjects.
|
|
||||||
/// <para>
|
|
||||||
/// The body of this piece will overshoot its parent by <see cref="CirclePiece.Height"/> to form
|
|
||||||
/// a rounded (_[-Width-]_) figure such that a regular "circle" is the result of a parent with Width = 0.
|
|
||||||
/// </para>
|
|
||||||
/// </summary>
|
|
||||||
public class CirclePiece : Container, IHasAccentColour
|
|
||||||
{
|
|
||||||
public const float SYMBOL_SIZE = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f;
|
|
||||||
public const float SYMBOL_BORDER = 8;
|
|
||||||
public const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER;
|
|
||||||
|
|
||||||
private Color4 accentColour;
|
|
||||||
/// <summary>
|
|
||||||
/// The colour of the inner circle and outer glows.
|
|
||||||
/// </summary>
|
|
||||||
public Color4 AccentColour
|
|
||||||
{
|
|
||||||
get { return accentColour; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
accentColour = value;
|
|
||||||
|
|
||||||
background.Colour = AccentColour;
|
|
||||||
|
|
||||||
resetEdgeEffects();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool kiaiMode;
|
|
||||||
/// <summary>
|
|
||||||
/// Whether Kiai mode effects are enabled for this circle piece.
|
|
||||||
/// </summary>
|
|
||||||
public bool KiaiMode
|
|
||||||
{
|
|
||||||
get { return kiaiMode; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
kiaiMode = value;
|
|
||||||
|
|
||||||
resetEdgeEffects();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Anchor Origin
|
|
||||||
{
|
|
||||||
get { return Anchor.CentreLeft; }
|
|
||||||
set { throw new InvalidOperationException($"{nameof(CirclePiece)} must always use CentreLeft origin."); }
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Container<Framework.Graphics.Drawable> Content => SymbolContainer;
|
|
||||||
protected readonly Container SymbolContainer;
|
|
||||||
|
|
||||||
private readonly Container background;
|
|
||||||
private readonly Container innerLayer;
|
|
||||||
|
|
||||||
public CirclePiece()
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X;
|
|
||||||
Height = TaikoHitObject.CIRCLE_RADIUS * 2;
|
|
||||||
|
|
||||||
// The "inner layer" is the body of the CirclePiece that overshoots it by Height/2 px on both sides
|
|
||||||
AddInternal(innerLayer = new Container
|
|
||||||
{
|
|
||||||
Name = "Inner Layer",
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
RelativeSizeAxes = Axes.Y,
|
|
||||||
Children = new Framework.Graphics.Drawable[]
|
|
||||||
{
|
|
||||||
background = new CircularContainer
|
|
||||||
{
|
|
||||||
Name = "Background",
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Masking = true,
|
|
||||||
Children = new Framework.Graphics.Drawable[]
|
|
||||||
{
|
|
||||||
new Box
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
},
|
|
||||||
new Triangles
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
ColourLight = Color4.White,
|
|
||||||
ColourDark = Color4.White.Darken(0.1f)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new CircularContainer
|
|
||||||
{
|
|
||||||
Name = "Ring",
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
BorderThickness = 8,
|
|
||||||
BorderColour = Color4.White,
|
|
||||||
Masking = true,
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
new Box
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Alpha = 0,
|
|
||||||
AlwaysPresent = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
SymbolContainer = new Container
|
|
||||||
{
|
|
||||||
Name = "Symbol",
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Update()
|
|
||||||
{
|
|
||||||
// Add the overshoot to compensate for corner radius
|
|
||||||
innerLayer.Width = DrawWidth + DrawHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void resetEdgeEffects()
|
|
||||||
{
|
|
||||||
background.EdgeEffect = new EdgeEffect
|
|
||||||
{
|
|
||||||
Type = EdgeEffectType.Glow,
|
|
||||||
Colour = AccentColour,
|
|
||||||
Radius = KiaiMode ? 50 : 8
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,25 +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 OpenTK;
|
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// A type of circle piece which is drawn at a higher scale to represent a "strong" piece.
|
|
||||||
/// </summary>
|
|
||||||
public class StrongCirclePiece : CirclePiece
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The amount to scale up the base circle to show it as a "strong" piece.
|
|
||||||
/// </summary>
|
|
||||||
private const float strong_scale = 1.5f;
|
|
||||||
|
|
||||||
public StrongCirclePiece()
|
|
||||||
{
|
|
||||||
SymbolContainer.Scale = new Vector2(strong_scale);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Vector2 Size => new Vector2(base.Size.X, base.Size.Y * strong_scale);
|
|
||||||
}
|
|
||||||
}
|
|
80
osu.Game.Modes.Taiko/Objects/Drawables/DrawableBarLine.cs
Normal file
80
osu.Game.Modes.Taiko/Objects/Drawables/DrawableBarLine.cs
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
// 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.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.Taiko.Objects.Drawables
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A line that scrolls alongside hit objects in the playfield and visualises control points.
|
||||||
|
/// </summary>
|
||||||
|
public class DrawableBarLine : Container
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The width of the line tracker.
|
||||||
|
/// </summary>
|
||||||
|
private const float tracker_width = 2f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fade out time calibrated to a pre-empt of 1000ms.
|
||||||
|
/// </summary>
|
||||||
|
private const float base_fadeout_time = 100f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The visual line tracker.
|
||||||
|
/// </summary>
|
||||||
|
protected Box Tracker;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The bar line.
|
||||||
|
/// </summary>
|
||||||
|
protected readonly BarLine BarLine;
|
||||||
|
|
||||||
|
public DrawableBarLine(BarLine barLine)
|
||||||
|
{
|
||||||
|
BarLine = barLine;
|
||||||
|
|
||||||
|
Anchor = Anchor.CentreLeft;
|
||||||
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
|
RelativePositionAxes = Axes.X;
|
||||||
|
RelativeSizeAxes = Axes.Y;
|
||||||
|
|
||||||
|
Width = tracker_width;
|
||||||
|
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
Tracker = new Box
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
EdgeSmoothness = new Vector2(0.5f, 0),
|
||||||
|
Alpha = 0.75f
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
LifetimeStart = BarLine.StartTime - BarLine.ScrollTime * 2;
|
||||||
|
LifetimeEnd = BarLine.StartTime + BarLine.ScrollTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
Delay(BarLine.StartTime - Time.Current);
|
||||||
|
FadeOut(base_fadeout_time * BarLine.ScrollTime / 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateScrollPosition(double time) => MoveToX((float)((BarLine.StartTime - time) / BarLine.ScrollTime));
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
updateScrollPosition(Time.Current);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
// 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.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.Taiko.Objects.Drawables
|
||||||
|
{
|
||||||
|
public class DrawableBarLineMajor : DrawableBarLine
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The vertical offset of the triangles from the line tracker.
|
||||||
|
/// </summary>
|
||||||
|
private const float triangle_offfset = 10f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The size of the triangles.
|
||||||
|
/// </summary>
|
||||||
|
private const float triangle_size = 20f;
|
||||||
|
|
||||||
|
public DrawableBarLineMajor(BarLine barLine)
|
||||||
|
: base(barLine)
|
||||||
|
{
|
||||||
|
Add(new Container
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
new EquilateralTriangle
|
||||||
|
{
|
||||||
|
Name = "Top",
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Position = new Vector2(0, -triangle_offfset),
|
||||||
|
Size = new Vector2(-triangle_size),
|
||||||
|
EdgeSmoothness = new Vector2(1),
|
||||||
|
},
|
||||||
|
new EquilateralTriangle
|
||||||
|
{
|
||||||
|
Name = "Bottom",
|
||||||
|
Anchor = Anchor.BottomCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Position = new Vector2(0, triangle_offfset),
|
||||||
|
Size = new Vector2(triangle_size),
|
||||||
|
EdgeSmoothness = new Vector2(1),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Tracker.Alpha = 1f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +1,12 @@
|
|||||||
// 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 OpenTK.Input;
|
|
||||||
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
|
||||||
|
using OpenTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
namespace osu.Game.Modes.Taiko.Objects.Drawables
|
||||||
{
|
{
|
||||||
public class DrawableCentreHit : DrawableHit
|
public class DrawableCentreHit : DrawableHit
|
||||||
{
|
{
|
||||||
@ -15,17 +15,13 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
public DrawableCentreHit(Hit hit)
|
public DrawableCentreHit(Hit hit)
|
||||||
: base(hit)
|
: base(hit)
|
||||||
{
|
{
|
||||||
|
MainPiece.Add(new CentreHitSymbolPiece());
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
Circle.AccentColour = colours.PinkDarker;
|
MainPiece.AccentColour = colours.PinkDarker;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override CirclePiece CreateCirclePiece() => new CirclePiece
|
|
||||||
{
|
|
||||||
Children = new[] { new CentreHitSymbolPiece() }
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,31 +1,27 @@
|
|||||||
// 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 OpenTK.Input;
|
|
||||||
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
|
||||||
|
using OpenTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
namespace osu.Game.Modes.Taiko.Objects.Drawables
|
||||||
{
|
{
|
||||||
public class DrawableStrongCentreHit : DrawableStrongHit
|
public class DrawableCentreHitStrong : DrawableHitStrong
|
||||||
{
|
{
|
||||||
protected override Key[] HitKeys { get; } = { Key.F, Key.J };
|
protected override Key[] HitKeys { get; } = { Key.F, Key.J };
|
||||||
|
|
||||||
public DrawableStrongCentreHit(Hit hit)
|
public DrawableCentreHitStrong(Hit hit)
|
||||||
: base(hit)
|
: base(hit)
|
||||||
{
|
{
|
||||||
|
MainPiece.Add(new CentreHitSymbolPiece());
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
Circle.AccentColour = colours.PinkDarker;
|
MainPiece.AccentColour = colours.PinkDarker;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override CirclePiece CreateCirclePiece() => new StrongCirclePiece
|
|
||||||
{
|
|
||||||
Children = new[] { new CentreHitSymbolPiece() }
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,30 +1,25 @@
|
|||||||
// 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 OpenTK;
|
using System.Linq;
|
||||||
using OpenTK.Graphics;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
using osu.Game.Modes.Taiko.Judgements;
|
using osu.Game.Modes.Taiko.Judgements;
|
||||||
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
using OpenTK;
|
||||||
using System.Linq;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
namespace osu.Game.Modes.Taiko.Objects.Drawables
|
||||||
{
|
{
|
||||||
public class DrawableDrumRoll : DrawableTaikoHitObject
|
public class DrawableDrumRoll : DrawableTaikoHitObject<DrumRoll>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of rolling hits required to reach the dark/final accent colour.
|
/// Number of rolling hits required to reach the dark/final accent colour.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const int rolling_hits_for_dark_accent = 5;
|
private const int rolling_hits_for_dark_accent = 5;
|
||||||
|
|
||||||
private readonly DrumRoll drumRoll;
|
|
||||||
|
|
||||||
private readonly CirclePiece circle;
|
|
||||||
|
|
||||||
private Color4 accentDarkColour;
|
private Color4 accentDarkColour;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -35,32 +30,32 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
public DrawableDrumRoll(DrumRoll drumRoll)
|
public DrawableDrumRoll(DrumRoll drumRoll)
|
||||||
: base(drumRoll)
|
: base(drumRoll)
|
||||||
{
|
{
|
||||||
this.drumRoll = drumRoll;
|
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.X;
|
|
||||||
Width = (float)(drumRoll.Duration / drumRoll.PreEmpt);
|
|
||||||
|
|
||||||
Add(circle = CreateCirclePiece());
|
|
||||||
circle.KiaiMode = HitObject.Kiai;
|
|
||||||
|
|
||||||
foreach (var tick in drumRoll.Ticks)
|
foreach (var tick in drumRoll.Ticks)
|
||||||
{
|
{
|
||||||
var newTick = new DrawableDrumRollTick(tick)
|
var newTick = new DrawableDrumRollTick(tick)
|
||||||
{
|
{
|
||||||
X = (float)((tick.StartTime - HitObject.StartTime) / drumRoll.Duration)
|
X = (float)((tick.StartTime - HitObject.StartTime) / HitObject.Duration)
|
||||||
};
|
};
|
||||||
|
|
||||||
newTick.OnJudgement += onTickJudgement;
|
newTick.OnJudgement += onTickJudgement;
|
||||||
|
|
||||||
AddNested(newTick);
|
AddNested(newTick);
|
||||||
Add(newTick);
|
MainPiece.Add(newTick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override TaikoJudgement CreateJudgement() => new TaikoJudgement { SecondHit = HitObject.IsStrong };
|
||||||
|
|
||||||
|
protected override TaikoPiece CreateMainPiece() => new ElongatedCirclePiece(HitObject.IsStrong)
|
||||||
|
{
|
||||||
|
Length = (float)(HitObject.Duration / HitObject.ScrollTime),
|
||||||
|
PlayfieldLengthReference = () => Parent.DrawSize.X
|
||||||
|
};
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
circle.AccentColour = AccentColour = colours.YellowDark;
|
MainPiece.AccentColour = AccentColour = colours.YellowDark;
|
||||||
accentDarkColour = colours.YellowDarker;
|
accentDarkColour = colours.YellowDarker;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +67,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
// is further than mid point of the play field, so the time taken to scroll in should always
|
// is further than mid point of the play field, so the time taken to scroll in should always
|
||||||
// be greater than the time taken to scroll out to the left of the screen.
|
// be greater than the time taken to scroll out to the left of the screen.
|
||||||
// Thus, using PreEmpt here is enough for the drum roll to completely scroll out.
|
// Thus, using PreEmpt here is enough for the drum roll to completely scroll out.
|
||||||
LifetimeEnd = drumRoll.EndTime + drumRoll.PreEmpt;
|
LifetimeEnd = HitObject.EndTime + HitObject.ScrollTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onTickJudgement(DrawableHitObject<TaikoHitObject, TaikoJudgement> obj)
|
private void onTickJudgement(DrawableHitObject<TaikoHitObject, TaikoJudgement> obj)
|
||||||
@ -85,7 +80,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
rollingHits = MathHelper.Clamp(rollingHits, 0, rolling_hits_for_dark_accent);
|
rollingHits = MathHelper.Clamp(rollingHits, 0, rolling_hits_for_dark_accent);
|
||||||
|
|
||||||
Color4 newAccent = Interpolation.ValueAt((float)rollingHits / rolling_hits_for_dark_accent, AccentColour, accentDarkColour, 0, 1);
|
Color4 newAccent = Interpolation.ValueAt((float)rollingHits / rolling_hits_for_dark_accent, AccentColour, accentDarkColour, 0, 1);
|
||||||
circle.FadeAccent(newAccent, 100);
|
MainPiece.FadeAccent(newAccent, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void CheckJudgement(bool userTriggered)
|
protected override void CheckJudgement(bool userTriggered)
|
||||||
@ -98,10 +93,10 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
|
|
||||||
int countHit = NestedHitObjects.Count(o => o.Judgement.Result == HitResult.Hit);
|
int countHit = NestedHitObjects.Count(o => o.Judgement.Result == HitResult.Hit);
|
||||||
|
|
||||||
if (countHit > drumRoll.RequiredGoodHits)
|
if (countHit > HitObject.RequiredGoodHits)
|
||||||
{
|
{
|
||||||
Judgement.Result = HitResult.Hit;
|
Judgement.Result = HitResult.Hit;
|
||||||
Judgement.TaikoResult = countHit >= drumRoll.RequiredGreatHits ? TaikoHitResult.Great : TaikoHitResult.Good;
|
Judgement.TaikoResult = countHit >= HitObject.RequiredGreatHits ? TaikoHitResult.Great : TaikoHitResult.Good;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Judgement.Result = HitResult.Miss;
|
Judgement.Result = HitResult.Miss;
|
||||||
@ -110,7 +105,5 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
protected override void UpdateState(ArmedState state)
|
protected override void UpdateState(ArmedState state)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual CirclePiece CreateCirclePiece() => new CirclePiece();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
// 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;
|
||||||
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
|
using osu.Game.Modes.Taiko.Judgements;
|
||||||
|
using OpenTK.Input;
|
||||||
|
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.Taiko.Objects.Drawables
|
||||||
|
{
|
||||||
|
public class DrawableDrumRollTick : DrawableTaikoHitObject<DrumRollTick>
|
||||||
|
{
|
||||||
|
public DrawableDrumRollTick(DrumRollTick tick)
|
||||||
|
: base(tick)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override TaikoPiece CreateMainPiece() => new TickPiece
|
||||||
|
{
|
||||||
|
Filled = HitObject.FirstTick
|
||||||
|
};
|
||||||
|
|
||||||
|
protected override TaikoJudgement CreateJudgement() => new TaikoDrumRollTickJudgement { SecondHit = HitObject.IsStrong };
|
||||||
|
|
||||||
|
protected override void CheckJudgement(bool userTriggered)
|
||||||
|
{
|
||||||
|
if (!userTriggered)
|
||||||
|
{
|
||||||
|
if (Judgement.TimeOffset > HitObject.HitWindow)
|
||||||
|
Judgement.Result = HitResult.Miss;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Math.Abs(Judgement.TimeOffset) < HitObject.HitWindow)
|
||||||
|
{
|
||||||
|
Judgement.Result = HitResult.Hit;
|
||||||
|
Judgement.TaikoResult = TaikoHitResult.Great;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void UpdateState(ArmedState state)
|
||||||
|
{
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case ArmedState.Hit:
|
||||||
|
Content.ScaleTo(0, 100, EasingTypes.OutQuint);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void UpdateScrollPosition(double time)
|
||||||
|
{
|
||||||
|
// Ticks don't move
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool HandleKeyPress(Key key)
|
||||||
|
{
|
||||||
|
return Judgement.Result == HitResult.None && UpdateJudgement(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,32 +1,22 @@
|
|||||||
// 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 OpenTK.Input;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
|
||||||
using osu.Game.Modes.Taiko.Judgements;
|
|
||||||
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
|
using osu.Game.Modes.Taiko.Judgements;
|
||||||
|
using OpenTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
namespace osu.Game.Modes.Taiko.Objects.Drawables
|
||||||
{
|
{
|
||||||
public abstract class DrawableHit : DrawableTaikoHitObject
|
public abstract class DrawableHit : DrawableTaikoHitObject<Hit>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A list of keys which can result in hits for this HitObject.
|
/// A list of keys which can result in hits for this HitObject.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected abstract Key[] HitKeys { get; }
|
protected abstract Key[] HitKeys { get; }
|
||||||
|
|
||||||
protected override Container<Framework.Graphics.Drawable> Content => bodyContainer;
|
|
||||||
|
|
||||||
protected readonly CirclePiece Circle;
|
|
||||||
|
|
||||||
private readonly Hit hit;
|
|
||||||
|
|
||||||
private readonly Container bodyContainer;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the last key pressed is a valid hit key.
|
/// Whether the last key pressed is a valid hit key.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -35,41 +25,28 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
protected DrawableHit(Hit hit)
|
protected DrawableHit(Hit hit)
|
||||||
: base(hit)
|
: base(hit)
|
||||||
{
|
{
|
||||||
this.hit = hit;
|
|
||||||
|
|
||||||
AddInternal(bodyContainer = new Container
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
Circle = CreateCirclePiece()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Circle.KiaiMode = HitObject.Kiai;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void CheckJudgement(bool userTriggered)
|
protected override void CheckJudgement(bool userTriggered)
|
||||||
{
|
{
|
||||||
if (!userTriggered)
|
if (!userTriggered)
|
||||||
{
|
{
|
||||||
if (Judgement.TimeOffset > hit.HitWindowGood)
|
if (Judgement.TimeOffset > HitObject.HitWindowGood)
|
||||||
Judgement.Result = HitResult.Miss;
|
Judgement.Result = HitResult.Miss;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
double hitOffset = Math.Abs(Judgement.TimeOffset);
|
double hitOffset = Math.Abs(Judgement.TimeOffset);
|
||||||
|
|
||||||
if (hitOffset > hit.HitWindowMiss)
|
if (hitOffset > HitObject.HitWindowMiss)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!validKeyPressed)
|
if (!validKeyPressed)
|
||||||
Judgement.Result = HitResult.Miss;
|
Judgement.Result = HitResult.Miss;
|
||||||
else if (hitOffset < hit.HitWindowGood)
|
else if (hitOffset < HitObject.HitWindowGood)
|
||||||
{
|
{
|
||||||
Judgement.Result = HitResult.Hit;
|
Judgement.Result = HitResult.Hit;
|
||||||
Judgement.TaikoResult = hitOffset < hit.HitWindowGreat ? TaikoHitResult.Great : TaikoHitResult.Good;
|
Judgement.TaikoResult = hitOffset < HitObject.HitWindowGreat ? TaikoHitResult.Great : TaikoHitResult.Good;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Judgement.Result = HitResult.Miss;
|
Judgement.Result = HitResult.Miss;
|
||||||
@ -92,24 +69,26 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
switch (State)
|
switch (State)
|
||||||
{
|
{
|
||||||
case ArmedState.Idle:
|
case ArmedState.Idle:
|
||||||
Delay(hit.HitWindowMiss);
|
Delay(HitObject.HitWindowMiss);
|
||||||
break;
|
break;
|
||||||
case ArmedState.Miss:
|
case ArmedState.Miss:
|
||||||
FadeOut(100);
|
FadeOut(100);
|
||||||
break;
|
break;
|
||||||
case ArmedState.Hit:
|
case ArmedState.Hit:
|
||||||
bodyContainer.ScaleTo(0.8f, 400, EasingTypes.OutQuad);
|
|
||||||
bodyContainer.MoveToY(-200, 250, EasingTypes.Out);
|
|
||||||
bodyContainer.Delay(250);
|
|
||||||
bodyContainer.MoveToY(0, 500, EasingTypes.In);
|
|
||||||
|
|
||||||
FadeOut(600);
|
FadeOut(600);
|
||||||
|
|
||||||
|
const float gravity_time = 300;
|
||||||
|
const float gravity_travel_height = 200;
|
||||||
|
|
||||||
|
Content.ScaleTo(0.8f, gravity_time * 2, EasingTypes.OutQuad);
|
||||||
|
|
||||||
|
MoveToY(-gravity_travel_height, gravity_time, EasingTypes.Out);
|
||||||
|
Delay(gravity_time, true);
|
||||||
|
MoveToY(gravity_travel_height * 2, gravity_time * 2, EasingTypes.In);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Expire();
|
Expire();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract CirclePiece CreateCirclePiece();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,16 +1,17 @@
|
|||||||
// 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 OpenTK.Input;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
using osu.Game.Modes.Taiko.Judgements;
|
using osu.Game.Modes.Taiko.Judgements;
|
||||||
|
using OpenTK.Input;
|
||||||
|
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
namespace osu.Game.Modes.Taiko.Objects.Drawables
|
||||||
{
|
{
|
||||||
public abstract class DrawableStrongHit : DrawableHit
|
public abstract class DrawableHitStrong : DrawableHit
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The lenience for the second key press.
|
/// The lenience for the second key press.
|
||||||
@ -22,11 +23,13 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
private bool firstKeyHeld;
|
private bool firstKeyHeld;
|
||||||
private Key firstHitKey;
|
private Key firstHitKey;
|
||||||
|
|
||||||
protected DrawableStrongHit(Hit hit)
|
protected DrawableHitStrong(Hit hit)
|
||||||
: base(hit)
|
: base(hit)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override TaikoPiece CreateMainPiece() => new CirclePiece(true);
|
||||||
|
|
||||||
protected override TaikoJudgement CreateJudgement() => new TaikoStrongHitJudgement();
|
protected override TaikoJudgement CreateJudgement() => new TaikoStrongHitJudgement();
|
||||||
|
|
||||||
protected override void CheckJudgement(bool userTriggered)
|
protected override void CheckJudgement(bool userTriggered)
|
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
namespace osu.Game.Modes.Taiko.Objects.Drawables
|
||||||
{
|
{
|
||||||
public class DrawableRimHit : DrawableHit
|
public class DrawableRimHit : DrawableHit
|
||||||
{
|
{
|
||||||
@ -15,17 +15,13 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
public DrawableRimHit(Hit hit)
|
public DrawableRimHit(Hit hit)
|
||||||
: base(hit)
|
: base(hit)
|
||||||
{
|
{
|
||||||
|
MainPiece.Add(new RimHitSymbolPiece());
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
Circle.AccentColour = colours.BlueDarker;
|
MainPiece.AccentColour = colours.BlueDarker;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override CirclePiece CreateCirclePiece() => new CirclePiece
|
|
||||||
{
|
|
||||||
Children = new[] { new RimHitSymbolPiece() }
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,29 +3,25 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
namespace osu.Game.Modes.Taiko.Objects.Drawables
|
||||||
{
|
{
|
||||||
public class DrawableStrongRimHit : DrawableStrongHit
|
public class DrawableRimHitStrong : DrawableHitStrong
|
||||||
{
|
{
|
||||||
protected override Key[] HitKeys { get; } = { Key.D, Key.K };
|
protected override Key[] HitKeys { get; } = { Key.D, Key.K };
|
||||||
|
|
||||||
public DrawableStrongRimHit(Hit hit)
|
public DrawableRimHitStrong(Hit hit)
|
||||||
: base(hit)
|
: base(hit)
|
||||||
{
|
{
|
||||||
|
MainPiece.Add(new RimHitSymbolPiece());
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
Circle.AccentColour = colours.BlueDarker;
|
MainPiece.AccentColour = colours.BlueDarker;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override CirclePiece CreateCirclePiece() => new StrongCirclePiece
|
|
||||||
{
|
|
||||||
Children = new[] { new RimHitSymbolPiece() }
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,9 +1,8 @@
|
|||||||
// 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 OpenTK;
|
using System;
|
||||||
using OpenTK.Graphics;
|
using System.Linq;
|
||||||
using OpenTK.Input;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -12,13 +11,14 @@ using osu.Framework.Graphics.Sprites;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
using osu.Game.Modes.Taiko.Judgements;
|
using osu.Game.Modes.Taiko.Judgements;
|
||||||
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
|
||||||
using System;
|
using OpenTK;
|
||||||
using System.Linq;
|
using OpenTK.Graphics;
|
||||||
|
using OpenTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
namespace osu.Game.Modes.Taiko.Objects.Drawables
|
||||||
{
|
{
|
||||||
public class DrawableSwell : DrawableTaikoHitObject
|
public class DrawableSwell : DrawableTaikoHitObject<Swell>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked when the swell has reached the hit target, i.e. when CurrentTime >= StartTime.
|
/// Invoked when the swell has reached the hit target, i.e. when CurrentTime >= StartTime.
|
||||||
@ -31,8 +31,6 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
private const float target_ring_scale = 5f;
|
private const float target_ring_scale = 5f;
|
||||||
private const float inner_ring_alpha = 0.65f;
|
private const float inner_ring_alpha = 0.65f;
|
||||||
|
|
||||||
private readonly Swell swell;
|
|
||||||
|
|
||||||
private readonly Container bodyContainer;
|
private readonly Container bodyContainer;
|
||||||
private readonly CircularContainer targetRing;
|
private readonly CircularContainer targetRing;
|
||||||
private readonly CircularContainer expandingRing;
|
private readonly CircularContainer expandingRing;
|
||||||
@ -54,13 +52,12 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
public DrawableSwell(Swell swell)
|
public DrawableSwell(Swell swell)
|
||||||
: base(swell)
|
: base(swell)
|
||||||
{
|
{
|
||||||
this.swell = swell;
|
Children = new Drawable[]
|
||||||
|
|
||||||
Children = new Framework.Graphics.Drawable[]
|
|
||||||
{
|
{
|
||||||
bodyContainer = new Container
|
bodyContainer = new Container
|
||||||
{
|
{
|
||||||
Children = new Framework.Graphics.Drawable[]
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
expandingRing = new CircularContainer
|
expandingRing = new CircularContainer
|
||||||
{
|
{
|
||||||
@ -89,7 +86,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
Masking = true,
|
Masking = true,
|
||||||
BorderThickness = target_ring_thick_border,
|
BorderThickness = target_ring_thick_border,
|
||||||
BlendingMode = BlendingMode.Additive,
|
BlendingMode = BlendingMode.Additive,
|
||||||
Children = new Framework.Graphics.Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
@ -120,6 +117,8 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
},
|
},
|
||||||
circlePiece = new CirclePiece
|
circlePiece = new CirclePiece
|
||||||
{
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
Children = new []
|
Children = new []
|
||||||
{
|
{
|
||||||
symbol = new SwellSymbolPiece()
|
symbol = new SwellSymbolPiece()
|
||||||
@ -146,18 +145,18 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
{
|
{
|
||||||
userHits++;
|
userHits++;
|
||||||
|
|
||||||
var completion = (float)userHits / swell.RequiredHits;
|
var completion = (float)userHits / HitObject.RequiredHits;
|
||||||
|
|
||||||
expandingRing.FadeTo(expandingRing.Alpha + MathHelper.Clamp(completion / 16, 0.1f, 0.6f), 50);
|
expandingRing.FadeTo(expandingRing.Alpha + MathHelper.Clamp(completion / 16, 0.1f, 0.6f), 50);
|
||||||
expandingRing.Delay(50);
|
expandingRing.Delay(50);
|
||||||
expandingRing.FadeTo(completion / 8, 2000, EasingTypes.OutQuint);
|
expandingRing.FadeTo(completion / 8, 2000, EasingTypes.OutQuint);
|
||||||
expandingRing.DelayReset();
|
expandingRing.DelayReset();
|
||||||
|
|
||||||
symbol.RotateTo((float)(completion * swell.Duration / 8), 4000, EasingTypes.OutQuint);
|
symbol.RotateTo((float)(completion * HitObject.Duration / 8), 4000, EasingTypes.OutQuint);
|
||||||
|
|
||||||
expandingRing.ScaleTo(1f + Math.Min(target_ring_scale - 1f, (target_ring_scale - 1f) * completion * 1.3f), 260, EasingTypes.OutQuint);
|
expandingRing.ScaleTo(1f + Math.Min(target_ring_scale - 1f, (target_ring_scale - 1f) * completion * 1.3f), 260, EasingTypes.OutQuint);
|
||||||
|
|
||||||
if (userHits == swell.RequiredHits)
|
if (userHits == HitObject.RequiredHits)
|
||||||
{
|
{
|
||||||
Judgement.Result = HitResult.Hit;
|
Judgement.Result = HitResult.Hit;
|
||||||
Judgement.TaikoResult = TaikoHitResult.Great;
|
Judgement.TaikoResult = TaikoHitResult.Great;
|
||||||
@ -169,7 +168,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
//TODO: THIS IS SHIT AND CAN'T EXIST POST-TAIKO WORLD CUP
|
//TODO: THIS IS SHIT AND CAN'T EXIST POST-TAIKO WORLD CUP
|
||||||
if (userHits > swell.RequiredHits / 2)
|
if (userHits > HitObject.RequiredHits / 2)
|
||||||
{
|
{
|
||||||
Judgement.Result = HitResult.Hit;
|
Judgement.Result = HitResult.Hit;
|
||||||
Judgement.TaikoResult = TaikoHitResult.Good;
|
Judgement.TaikoResult = TaikoHitResult.Good;
|
||||||
@ -189,7 +188,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
|
|
||||||
Delay(preempt, true);
|
Delay(preempt, true);
|
||||||
|
|
||||||
Delay(Judgement.TimeOffset + swell.Duration, true);
|
Delay(Judgement.TimeOffset + HitObject.Duration, true);
|
||||||
|
|
||||||
const float out_transition_time = 300;
|
const float out_transition_time = 300;
|
||||||
|
|
@ -1,16 +1,20 @@
|
|||||||
// 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 OpenTK.Input;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Input;
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
using osu.Game.Modes.Taiko.Judgements;
|
using osu.Game.Modes.Taiko.Judgements;
|
||||||
using System.Collections.Generic;
|
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
|
||||||
using osu.Framework.Input;
|
using OpenTK;
|
||||||
|
using OpenTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
namespace osu.Game.Modes.Taiko.Objects.Drawables
|
||||||
{
|
{
|
||||||
public abstract class DrawableTaikoHitObject : DrawableHitObject<TaikoHitObject, TaikoJudgement>
|
public abstract class DrawableTaikoHitObject<TaikoHitType> : DrawableHitObject<TaikoHitObject, TaikoJudgement>
|
||||||
|
where TaikoHitType : TaikoHitObject
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A list of keys which this hit object will accept. These are the standard Taiko keys for now.
|
/// A list of keys which this hit object will accept. These are the standard Taiko keys for now.
|
||||||
@ -18,33 +22,52 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly List<Key> validKeys = new List<Key>(new[] { Key.D, Key.F, Key.J, Key.K });
|
private readonly List<Key> validKeys = new List<Key>(new[] { Key.D, Key.F, Key.J, Key.K });
|
||||||
|
|
||||||
protected DrawableTaikoHitObject(TaikoHitObject hitObject)
|
public override Vector2 OriginPosition => new Vector2(DrawHeight / 2);
|
||||||
|
|
||||||
|
protected override Container<Drawable> Content => bodyContainer;
|
||||||
|
|
||||||
|
protected readonly TaikoPiece MainPiece;
|
||||||
|
|
||||||
|
private readonly Container bodyContainer;
|
||||||
|
|
||||||
|
public new TaikoHitType HitObject;
|
||||||
|
|
||||||
|
protected DrawableTaikoHitObject(TaikoHitType hitObject)
|
||||||
: base(hitObject)
|
: base(hitObject)
|
||||||
{
|
{
|
||||||
|
HitObject = hitObject;
|
||||||
|
|
||||||
Anchor = Anchor.CentreLeft;
|
Anchor = Anchor.CentreLeft;
|
||||||
Origin = Anchor.CentreLeft;
|
Origin = Anchor.Custom;
|
||||||
|
|
||||||
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
RelativePositionAxes = Axes.X;
|
RelativePositionAxes = Axes.X;
|
||||||
}
|
|
||||||
|
|
||||||
protected override void LoadComplete()
|
AddInternal(bodyContainer = new Container
|
||||||
{
|
{
|
||||||
LifetimeStart = HitObject.StartTime - HitObject.PreEmpt * 2;
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
MainPiece = CreateMainPiece()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
base.LoadComplete();
|
MainPiece.KiaiMode = HitObject.Kiai;
|
||||||
|
|
||||||
|
LifetimeStart = HitObject.StartTime - HitObject.ScrollTime * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override TaikoJudgement CreateJudgement() => new TaikoJudgement();
|
protected override TaikoJudgement CreateJudgement() => new TaikoJudgement();
|
||||||
|
|
||||||
|
protected virtual TaikoPiece CreateMainPiece() => new CirclePiece(HitObject.IsStrong);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the scroll position of the DrawableHitObject relative to the offset between
|
/// Sets the scroll position of the DrawableHitObject relative to the offset between
|
||||||
/// a time value and the HitObject's StartTime.
|
/// a time value and the HitObject's StartTime.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="time"></param>
|
/// <param name="time"></param>
|
||||||
protected virtual void UpdateScrollPosition(double time)
|
protected virtual void UpdateScrollPosition(double time) => X = (float)((HitObject.StartTime - time) / HitObject.ScrollTime);
|
||||||
{
|
|
||||||
MoveToX((float)((HitObject.StartTime - time) / HitObject.PreEmpt));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
@ -1,12 +1,12 @@
|
|||||||
// 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 osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
|
namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The symbol used for centre hit pieces.
|
/// The symbol used for centre hit pieces.
|
153
osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CirclePiece.cs
Normal file
153
osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CirclePiece.cs
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
// 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.Extensions.Color4Extensions;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Graphics.Backgrounds;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A circle piece which is used uniformly through osu!taiko to visualise hitobjects.
|
||||||
|
/// <para>
|
||||||
|
/// Note that this can actually be non-circle if the width is changed. See <see cref="ElongatedCirclePiece"/>
|
||||||
|
/// for a usage example.
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
public class CirclePiece : TaikoPiece
|
||||||
|
{
|
||||||
|
public const float SYMBOL_SIZE = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f;
|
||||||
|
public const float SYMBOL_BORDER = 8;
|
||||||
|
public const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The amount to scale up the base circle to show it as a "strong" piece.
|
||||||
|
/// </summary>
|
||||||
|
private const float strong_scale = 1.5f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The colour of the inner circle and outer glows.
|
||||||
|
/// </summary>
|
||||||
|
public override Color4 AccentColour
|
||||||
|
{
|
||||||
|
get { return base.AccentColour; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
base.AccentColour = value;
|
||||||
|
|
||||||
|
background.Colour = AccentColour;
|
||||||
|
|
||||||
|
resetEdgeEffects();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether Kiai mode effects are enabled for this circle piece.
|
||||||
|
/// </summary>
|
||||||
|
public override bool KiaiMode
|
||||||
|
{
|
||||||
|
get { return base.KiaiMode; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
base.KiaiMode = value;
|
||||||
|
|
||||||
|
resetEdgeEffects();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
|
private readonly Container content;
|
||||||
|
|
||||||
|
private readonly Container background;
|
||||||
|
|
||||||
|
public CirclePiece(bool isStrong = false)
|
||||||
|
{
|
||||||
|
AddInternal(new Drawable[]
|
||||||
|
{
|
||||||
|
background = new CircularContainer
|
||||||
|
{
|
||||||
|
Name = "Background",
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Masking = true,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
|
new Triangles
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
ColourLight = Color4.White,
|
||||||
|
ColourDark = Color4.White.Darken(0.1f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new CircularContainer
|
||||||
|
{
|
||||||
|
Name = "Ring",
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
BorderThickness = 8,
|
||||||
|
BorderColour = Color4.White,
|
||||||
|
Masking = true,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Alpha = 0,
|
||||||
|
AlwaysPresent = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
content = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Name = "Content",
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (isStrong)
|
||||||
|
{
|
||||||
|
Size *= strong_scale;
|
||||||
|
|
||||||
|
//default for symbols etc.
|
||||||
|
Content.Scale *= strong_scale;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
//we want to allow for width of content to remain mapped to the area inside us, regardless of the scale applied above.
|
||||||
|
Content.Width = 1 / Content.Scale.X;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetEdgeEffects()
|
||||||
|
{
|
||||||
|
background.EdgeEffect = new EdgeEffect
|
||||||
|
{
|
||||||
|
Type = EdgeEffectType.Glow,
|
||||||
|
Colour = AccentColour,
|
||||||
|
Radius = KiaiMode ? 50 : 8
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
// 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.Primitives;
|
||||||
|
using osu.Game.Modes.Taiko.UI;
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces
|
||||||
|
{
|
||||||
|
public class ElongatedCirclePiece : CirclePiece
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// As we are being used to define the absolute size of hits, we need to be given a relative reference of our containing <see cref="TaikoPlayfield"/>.
|
||||||
|
/// </summary>
|
||||||
|
public Func<float> PlayfieldLengthReference;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The length of this piece as a multiple of the value returned by <see cref="PlayfieldLengthReference"/>
|
||||||
|
/// </summary>
|
||||||
|
public float Length;
|
||||||
|
|
||||||
|
public ElongatedCirclePiece(bool isStrong = false) : base(isStrong)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
var padding = Content.DrawHeight * Content.Width / 2;
|
||||||
|
|
||||||
|
Content.Padding = new MarginPadding
|
||||||
|
{
|
||||||
|
Left = padding,
|
||||||
|
Right = padding,
|
||||||
|
};
|
||||||
|
|
||||||
|
Width = (PlayfieldLengthReference?.Invoke() ?? 0) * Length + DrawHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,13 +1,13 @@
|
|||||||
// 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 osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
|
namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The symbol used for rim hit pieces.
|
/// The symbol used for rim hit pieces.
|
@ -1,10 +1,10 @@
|
|||||||
// 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 osu.Game.Graphics;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
|
namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The symbol used for swell pieces.
|
/// The symbol used for swell pieces.
|
45
osu.Game.Modes.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs
Normal file
45
osu.Game.Modes.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
// 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.Containers;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces
|
||||||
|
{
|
||||||
|
public class TaikoPiece : Container, IHasAccentColour
|
||||||
|
{
|
||||||
|
private Color4 accentColour;
|
||||||
|
/// <summary>
|
||||||
|
/// The colour of the inner circle and outer glows.
|
||||||
|
/// </summary>
|
||||||
|
public virtual Color4 AccentColour
|
||||||
|
{
|
||||||
|
get { return accentColour; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
accentColour = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool kiaiMode;
|
||||||
|
/// <summary>
|
||||||
|
/// Whether Kiai mode effects are enabled for this circle piece.
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool KiaiMode
|
||||||
|
{
|
||||||
|
get { return kiaiMode; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
kiaiMode = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public TaikoPiece()
|
||||||
|
{
|
||||||
|
//just a default
|
||||||
|
Size = new Vector2(TaikoHitObject.CIRCLE_RADIUS * 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
60
osu.Game.Modes.Taiko/Objects/Drawables/Pieces/TickPiece.cs
Normal file
60
osu.Game.Modes.Taiko/Objects/Drawables/Pieces/TickPiece.cs
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
// 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.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces
|
||||||
|
{
|
||||||
|
public class TickPiece : TaikoPiece
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Any tick that is not the first for a drumroll is not filled, but is instead displayed
|
||||||
|
/// as a hollow circle. This is what controls the border width of that circle.
|
||||||
|
/// </summary>
|
||||||
|
private const float tick_border_width = TaikoHitObject.CIRCLE_RADIUS / 2 / 4;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The size of a tick.
|
||||||
|
/// </summary>
|
||||||
|
private const float tick_size = TaikoHitObject.CIRCLE_RADIUS / 2;
|
||||||
|
|
||||||
|
private bool filled;
|
||||||
|
public bool Filled
|
||||||
|
{
|
||||||
|
get { return filled; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
filled = value;
|
||||||
|
fillBox.Alpha = filled ? 1 : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly Box fillBox;
|
||||||
|
|
||||||
|
public TickPiece()
|
||||||
|
{
|
||||||
|
Size = new Vector2(tick_size);
|
||||||
|
|
||||||
|
Add(new CircularContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Masking = true,
|
||||||
|
BorderThickness = tick_border_width,
|
||||||
|
BorderColour = Color4.White,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
fillBox = new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Alpha = 0,
|
||||||
|
AlwaysPresent = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -11,26 +11,16 @@ using osu.Game.Audio;
|
|||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects
|
namespace osu.Game.Modes.Taiko.Objects
|
||||||
{
|
{
|
||||||
public class DrumRoll : TaikoHitObject, IHasDistance
|
public class DrumRoll : TaikoHitObject, IHasEndTime
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Drum roll distance that results in a duration of 1 speed-adjusted beat length.
|
/// Drum roll distance that results in a duration of 1 speed-adjusted beat length.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const float base_distance = 100;
|
private const float base_distance = 100;
|
||||||
|
|
||||||
public double EndTime => StartTime + Distance / Velocity;
|
public double EndTime => StartTime + Duration;
|
||||||
|
|
||||||
public double Duration => EndTime - StartTime;
|
public double Duration { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Raw length of the drum roll in positional length units.
|
|
||||||
/// </summary>
|
|
||||||
public double Distance { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Velocity of the drum roll in positional length units per millisecond.
|
|
||||||
/// </summary>
|
|
||||||
public double Velocity { get; protected set; } = 5;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Numer of ticks per beat length.
|
/// Numer of ticks per beat length.
|
||||||
@ -69,9 +59,6 @@ namespace osu.Game.Modes.Taiko.Objects
|
|||||||
{
|
{
|
||||||
base.ApplyDefaults(timing, difficulty);
|
base.ApplyDefaults(timing, difficulty);
|
||||||
|
|
||||||
double speedAdjutedBeatLength = timing.SpeedMultiplierAt(StartTime) * timing.BeatLengthAt(StartTime);
|
|
||||||
|
|
||||||
Velocity = base_distance * difficulty.SliderMultiplier / speedAdjutedBeatLength * VelocityMultiplier;
|
|
||||||
tickSpacing = timing.BeatLengthAt(StartTime) / TickRate;
|
tickSpacing = timing.BeatLengthAt(StartTime) / TickRate;
|
||||||
|
|
||||||
RequiredGoodHits = TotalTicks * Math.Min(0.15, 0.05 + 0.10 / 6 * difficulty.OverallDifficulty);
|
RequiredGoodHits = TotalTicks * Math.Min(0.15, 0.05 + 0.10 / 6 * difficulty.OverallDifficulty);
|
||||||
@ -86,12 +73,12 @@ namespace osu.Game.Modes.Taiko.Objects
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
bool first = true;
|
bool first = true;
|
||||||
for (double t = StartTime; t < EndTime + (int)tickSpacing; t += tickSpacing)
|
for (double t = StartTime; t < EndTime + tickSpacing / 2; t += tickSpacing)
|
||||||
{
|
{
|
||||||
ret.Add(new DrumRollTick
|
ret.Add(new DrumRollTick
|
||||||
{
|
{
|
||||||
FirstTick = first,
|
FirstTick = first,
|
||||||
PreEmpt = PreEmpt,
|
ScrollTime = ScrollTime,
|
||||||
TickSpacing = tickSpacing,
|
TickSpacing = tickSpacing,
|
||||||
StartTime = t,
|
StartTime = t,
|
||||||
IsStrong = IsStrong,
|
IsStrong = IsStrong,
|
||||||
|
@ -7,9 +7,9 @@ namespace osu.Game.Modes.Taiko.Objects
|
|||||||
{
|
{
|
||||||
public class Swell : TaikoHitObject, IHasEndTime
|
public class Swell : TaikoHitObject, IHasEndTime
|
||||||
{
|
{
|
||||||
public double EndTime { get; set; }
|
public double EndTime => StartTime + Duration;
|
||||||
|
|
||||||
public double Duration => EndTime - StartTime;
|
public double Duration { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The number of hits required to complete the swell successfully.
|
/// The number of hits required to complete the swell successfully.
|
||||||
|
@ -15,19 +15,14 @@ namespace osu.Game.Modes.Taiko.Objects
|
|||||||
public const float CIRCLE_RADIUS = 42f;
|
public const float CIRCLE_RADIUS = 42f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Time (in milliseconds) to scroll in the hit object with a speed-adjusted beat length of 1 second.
|
/// The time taken from the initial (off-screen) spawn position to the centre of the hit target for a <see cref="ControlPoint.BeatLength"/> of 1000ms.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const double base_scroll_time = 6000;
|
private const double scroll_time = 6000;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The velocity multiplier applied to this hit object.
|
/// Our adjusted <see cref="scroll_time"/> taking into consideration local <see cref="ControlPoint.BeatLength"/> and other speed multipliers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float VelocityMultiplier = 1;
|
public double ScrollTime;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The time to scroll in the HitObject.
|
|
||||||
/// </summary>
|
|
||||||
public double PreEmpt;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether this HitObject is a "strong" type.
|
/// Whether this HitObject is a "strong" type.
|
||||||
@ -44,7 +39,7 @@ namespace osu.Game.Modes.Taiko.Objects
|
|||||||
{
|
{
|
||||||
base.ApplyDefaults(timing, difficulty);
|
base.ApplyDefaults(timing, difficulty);
|
||||||
|
|
||||||
PreEmpt = base_scroll_time / difficulty.SliderMultiplier * timing.BeatLengthAt(StartTime) * timing.SpeedMultiplierAt(StartTime) / VelocityMultiplier / 1000;
|
ScrollTime = scroll_time * (timing.BeatLengthAt(StartTime) / 1000) / (difficulty.SliderMultiplier * timing.SpeedMultiplierAt(StartTime));
|
||||||
|
|
||||||
ControlPoint overridePoint;
|
ControlPoint overridePoint;
|
||||||
Kiai = timing.TimingPointAt(StartTime, out overridePoint).KiaiMode;
|
Kiai = timing.TimingPointAt(StartTime, out overridePoint).KiaiMode;
|
||||||
|
@ -128,17 +128,36 @@ namespace osu.Game.Modes.Taiko.UI
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
Drawable target = null;
|
Drawable target = null;
|
||||||
|
Drawable back = null;
|
||||||
|
|
||||||
if (args.Key == CentreKey)
|
if (args.Key == CentreKey)
|
||||||
|
{
|
||||||
target = centreHit;
|
target = centreHit;
|
||||||
|
back = centre;
|
||||||
|
}
|
||||||
else if (args.Key == RimKey)
|
else if (args.Key == RimKey)
|
||||||
|
{
|
||||||
target = rimHit;
|
target = rimHit;
|
||||||
|
back = rim;
|
||||||
|
}
|
||||||
|
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
target.FadeTo(Math.Min(target.Alpha + 0.4f, 1), 40, EasingTypes.OutQuint);
|
const float scale_amount = 0.05f;
|
||||||
target.Delay(40);
|
const float alpha_amount = 0.5f;
|
||||||
target.FadeOut(1000, EasingTypes.OutQuint);
|
|
||||||
|
const float down_time = 40;
|
||||||
|
const float up_time = 1000;
|
||||||
|
|
||||||
|
back.ScaleTo(target.Scale.X - scale_amount, down_time, EasingTypes.OutQuint);
|
||||||
|
back.Delay(down_time);
|
||||||
|
back.ScaleTo(1, up_time, EasingTypes.OutQuint);
|
||||||
|
|
||||||
|
target.ScaleTo(target.Scale.X - scale_amount, down_time, EasingTypes.OutQuint);
|
||||||
|
target.FadeTo(Math.Min(target.Alpha + alpha_amount, 1), down_time, EasingTypes.OutQuint);
|
||||||
|
target.Delay(down_time);
|
||||||
|
target.ScaleTo(1, up_time, EasingTypes.OutQuint);
|
||||||
|
target.FadeOut(up_time, EasingTypes.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -1,17 +1,21 @@
|
|||||||
// 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 osu.Game.Beatmaps;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.MathUtils;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Beatmaps.Timing;
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
|
using osu.Game.Modes.Objects.Types;
|
||||||
|
using osu.Game.Modes.Replays;
|
||||||
using osu.Game.Modes.Scoring;
|
using osu.Game.Modes.Scoring;
|
||||||
using osu.Game.Modes.Taiko.Beatmaps;
|
using osu.Game.Modes.Taiko.Beatmaps;
|
||||||
using osu.Game.Modes.Taiko.Judgements;
|
using osu.Game.Modes.Taiko.Judgements;
|
||||||
using osu.Game.Modes.Taiko.Objects;
|
using osu.Game.Modes.Taiko.Objects;
|
||||||
using osu.Game.Modes.Taiko.Objects.Drawable;
|
using osu.Game.Modes.Taiko.Objects.Drawables;
|
||||||
using osu.Game.Modes.Taiko.Scoring;
|
using osu.Game.Modes.Taiko.Scoring;
|
||||||
using osu.Game.Modes.UI;
|
using osu.Game.Modes.UI;
|
||||||
using osu.Game.Modes.Replays;
|
|
||||||
using osu.Game.Modes.Taiko.Replays;
|
using osu.Game.Modes.Taiko.Replays;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.UI
|
namespace osu.Game.Modes.Taiko.UI
|
||||||
@ -23,6 +27,79 @@ namespace osu.Game.Modes.Taiko.UI
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
loadBarLines();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadBarLines()
|
||||||
|
{
|
||||||
|
var taikoPlayfield = Playfield as TaikoPlayfield;
|
||||||
|
|
||||||
|
if (taikoPlayfield == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
TaikoHitObject lastObject = Beatmap.HitObjects[Beatmap.HitObjects.Count - 1];
|
||||||
|
double lastHitTime = 1 + (lastObject as IHasEndTime)?.EndTime ?? lastObject.StartTime;
|
||||||
|
|
||||||
|
var timingPoints = Beatmap.TimingInfo.ControlPoints.FindAll(cp => cp.TimingChange);
|
||||||
|
|
||||||
|
if (timingPoints.Count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int currentIndex = 0;
|
||||||
|
|
||||||
|
while (currentIndex < timingPoints.Count && Precision.AlmostEquals(timingPoints[currentIndex].BeatLength, 0))
|
||||||
|
currentIndex++;
|
||||||
|
|
||||||
|
double time = timingPoints[currentIndex].Time;
|
||||||
|
double measureLength = timingPoints[currentIndex].BeatLength * (int)timingPoints[currentIndex].TimeSignature;
|
||||||
|
|
||||||
|
// Find the bar line time closest to 0
|
||||||
|
time -= measureLength * (int)(time / measureLength);
|
||||||
|
|
||||||
|
// Always start barlines from a positive time
|
||||||
|
while (time < 0)
|
||||||
|
time += measureLength;
|
||||||
|
|
||||||
|
int currentBeat = 0;
|
||||||
|
while (time <= lastHitTime)
|
||||||
|
{
|
||||||
|
ControlPoint current = timingPoints[currentIndex];
|
||||||
|
|
||||||
|
if (time > current.Time || current.OmitFirstBarLine)
|
||||||
|
{
|
||||||
|
bool isMajor = currentBeat % (int)current.TimeSignature == 0;
|
||||||
|
|
||||||
|
var barLine = new BarLine
|
||||||
|
{
|
||||||
|
StartTime = time,
|
||||||
|
};
|
||||||
|
|
||||||
|
barLine.ApplyDefaults(Beatmap.TimingInfo, Beatmap.BeatmapInfo.Difficulty);
|
||||||
|
|
||||||
|
taikoPlayfield.AddBarLine(isMajor ? new DrawableBarLineMajor(barLine) : new DrawableBarLine(barLine));
|
||||||
|
|
||||||
|
currentBeat++;
|
||||||
|
}
|
||||||
|
|
||||||
|
double bl = current.BeatLength;
|
||||||
|
|
||||||
|
if (bl < 800)
|
||||||
|
bl *= (int)current.TimeSignature;
|
||||||
|
|
||||||
|
time += bl;
|
||||||
|
|
||||||
|
if (currentIndex + 1 >= timingPoints.Count || time < timingPoints[currentIndex + 1].Time)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
currentBeat = 0;
|
||||||
|
currentIndex++;
|
||||||
|
time = timingPoints[currentIndex].Time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override ScoreProcessor CreateScoreProcessor() => new TaikoScoreProcessor(this);
|
public override ScoreProcessor CreateScoreProcessor() => new TaikoScoreProcessor(this);
|
||||||
|
|
||||||
protected override IBeatmapConverter<TaikoHitObject> CreateBeatmapConverter() => new TaikoBeatmapConverter();
|
protected override IBeatmapConverter<TaikoHitObject> CreateBeatmapConverter() => new TaikoBeatmapConverter();
|
||||||
@ -41,7 +118,7 @@ namespace osu.Game.Modes.Taiko.UI
|
|||||||
if (centreHit != null)
|
if (centreHit != null)
|
||||||
{
|
{
|
||||||
if (h.IsStrong)
|
if (h.IsStrong)
|
||||||
return new DrawableStrongCentreHit(centreHit);
|
return new DrawableCentreHitStrong(centreHit);
|
||||||
return new DrawableCentreHit(centreHit);
|
return new DrawableCentreHit(centreHit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,15 +126,13 @@ namespace osu.Game.Modes.Taiko.UI
|
|||||||
if (rimHit != null)
|
if (rimHit != null)
|
||||||
{
|
{
|
||||||
if (h.IsStrong)
|
if (h.IsStrong)
|
||||||
return new DrawableStrongRimHit(rimHit);
|
return new DrawableRimHitStrong(rimHit);
|
||||||
return new DrawableRimHit(rimHit);
|
return new DrawableRimHit(rimHit);
|
||||||
}
|
}
|
||||||
|
|
||||||
var drumRoll = h as DrumRoll;
|
var drumRoll = h as DrumRoll;
|
||||||
if (drumRoll != null)
|
if (drumRoll != null)
|
||||||
{
|
{
|
||||||
if (h.IsStrong)
|
|
||||||
return new DrawableStrongDrumRoll(drumRoll);
|
|
||||||
return new DrawableDrumRoll(drumRoll);
|
return new DrawableDrumRoll(drumRoll);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@ using osu.Game.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
using osu.Game.Modes.Taiko.Objects.Drawable;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Game.Modes.Taiko.Objects.Drawables;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.UI
|
namespace osu.Game.Modes.Taiko.UI
|
||||||
{
|
{
|
||||||
@ -40,7 +40,7 @@ namespace osu.Game.Modes.Taiko.UI
|
|||||||
protected override Container<Drawable> Content => hitObjectContainer;
|
protected override Container<Drawable> Content => hitObjectContainer;
|
||||||
|
|
||||||
private readonly Container<HitExplosion> hitExplosionContainer;
|
private readonly Container<HitExplosion> hitExplosionContainer;
|
||||||
//private Container<DrawableBarLine> barLineContainer;
|
private readonly Container<DrawableBarLine> barLineContainer;
|
||||||
private readonly Container<DrawableTaikoJudgement> judgementContainer;
|
private readonly Container<DrawableTaikoJudgement> judgementContainer;
|
||||||
|
|
||||||
private readonly Container hitObjectContainer;
|
private readonly Container hitObjectContainer;
|
||||||
@ -85,7 +85,7 @@ namespace osu.Game.Modes.Taiko.UI
|
|||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Padding = new MarginPadding { Left = hit_target_offset },
|
X = hit_target_offset,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -96,10 +96,10 @@ namespace osu.Game.Modes.Taiko.UI
|
|||||||
Size = new Vector2(TaikoHitObject.CIRCLE_RADIUS * 2),
|
Size = new Vector2(TaikoHitObject.CIRCLE_RADIUS * 2),
|
||||||
BlendingMode = BlendingMode.Additive
|
BlendingMode = BlendingMode.Additive
|
||||||
},
|
},
|
||||||
//barLineContainer = new Container<DrawableBarLine>
|
barLineContainer = new Container<DrawableBarLine>
|
||||||
//{
|
{
|
||||||
// RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
//},
|
},
|
||||||
new HitTarget
|
new HitTarget
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
@ -174,6 +174,11 @@ namespace osu.Game.Modes.Taiko.UI
|
|||||||
swell.OnStart += () => topLevelHitContainer.Add(swell.CreateProxy());
|
swell.OnStart += () => topLevelHitContainer.Add(swell.CreateProxy());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddBarLine(DrawableBarLine barLine)
|
||||||
|
{
|
||||||
|
barLineContainer.Add(barLine);
|
||||||
|
}
|
||||||
|
|
||||||
public override void OnJudgement(DrawableHitObject<TaikoHitObject, TaikoJudgement> judgedObject)
|
public override void OnJudgement(DrawableHitObject<TaikoHitObject, TaikoJudgement> judgedObject)
|
||||||
{
|
{
|
||||||
bool wasHit = judgedObject.Judgement.Result == HitResult.Hit;
|
bool wasHit = judgedObject.Judgement.Result == HitResult.Hit;
|
||||||
|
@ -53,23 +53,27 @@
|
|||||||
<Compile Include="Judgements\TaikoStrongHitJudgement.cs" />
|
<Compile Include="Judgements\TaikoStrongHitJudgement.cs" />
|
||||||
<Compile Include="Judgements\TaikoJudgement.cs" />
|
<Compile Include="Judgements\TaikoJudgement.cs" />
|
||||||
<Compile Include="Judgements\TaikoHitResult.cs" />
|
<Compile Include="Judgements\TaikoHitResult.cs" />
|
||||||
|
<Compile Include="Objects\BarLine.cs" />
|
||||||
|
<Compile Include="Objects\Drawables\DrawableBarLine.cs" />
|
||||||
|
<Compile Include="Objects\Drawables\DrawableBarLineMajor.cs" />
|
||||||
<Compile Include="Objects\CentreHit.cs" />
|
<Compile Include="Objects\CentreHit.cs" />
|
||||||
<Compile Include="Objects\Drawable\DrawableRimHit.cs" />
|
<Compile Include="Objects\Drawables\DrawableRimHit.cs" />
|
||||||
<Compile Include="Objects\Drawable\DrawableStrongRimHit.cs" />
|
<Compile Include="Objects\Drawables\DrawableRimHitStrong.cs" />
|
||||||
<Compile Include="Objects\Drawable\DrawableCentreHit.cs" />
|
<Compile Include="Objects\Drawables\DrawableCentreHit.cs" />
|
||||||
<Compile Include="Objects\Drawable\DrawableHit.cs" />
|
<Compile Include="Objects\Drawables\DrawableHit.cs" />
|
||||||
<Compile Include="Objects\Drawable\DrawableStrongDrumRoll.cs" />
|
<Compile Include="Objects\Drawables\DrawableCentreHitStrong.cs" />
|
||||||
<Compile Include="Objects\Drawable\DrawableStrongCentreHit.cs" />
|
<Compile Include="Objects\Drawables\DrawableHitStrong.cs" />
|
||||||
<Compile Include="Objects\Drawable\DrawableStrongHit.cs" />
|
<Compile Include="Objects\Drawables\Pieces\ElongatedCirclePiece.cs" />
|
||||||
<Compile Include="Objects\Drawable\Pieces\CentreHitSymbolPiece.cs" />
|
<Compile Include="Objects\Drawables\Pieces\CentreHitSymbolPiece.cs" />
|
||||||
<Compile Include="Objects\Drawable\DrawableDrumRoll.cs" />
|
<Compile Include="Objects\Drawables\DrawableDrumRoll.cs" />
|
||||||
<Compile Include="Objects\Drawable\DrawableDrumRollTick.cs" />
|
<Compile Include="Objects\Drawables\DrawableDrumRollTick.cs" />
|
||||||
<Compile Include="Objects\Drawable\DrawableSwell.cs" />
|
<Compile Include="Objects\Drawables\DrawableSwell.cs" />
|
||||||
<Compile Include="Objects\Drawable\DrawableTaikoHitObject.cs" />
|
<Compile Include="Objects\Drawables\DrawableTaikoHitObject.cs" />
|
||||||
<Compile Include="Objects\Drawable\Pieces\RimHitSymbolPiece.cs" />
|
<Compile Include="Objects\Drawables\Pieces\RimHitSymbolPiece.cs" />
|
||||||
<Compile Include="Objects\Drawable\Pieces\StrongCirclePiece.cs" />
|
<Compile Include="Objects\Drawables\Pieces\CirclePiece.cs" />
|
||||||
<Compile Include="Objects\Drawable\Pieces\CirclePiece.cs" />
|
<Compile Include="Objects\Drawables\Pieces\SwellSymbolPiece.cs" />
|
||||||
<Compile Include="Objects\Drawable\Pieces\SwellSymbolPiece.cs" />
|
<Compile Include="Objects\Drawables\Pieces\TaikoPiece.cs" />
|
||||||
|
<Compile Include="Objects\Drawables\Pieces\TickPiece.cs" />
|
||||||
<Compile Include="Objects\DrumRoll.cs" />
|
<Compile Include="Objects\DrumRoll.cs" />
|
||||||
<Compile Include="Objects\DrumRollTick.cs" />
|
<Compile Include="Objects\DrumRollTick.cs" />
|
||||||
<Compile Include="Objects\Hit.cs" />
|
<Compile Include="Objects\Hit.cs" />
|
||||||
|
@ -22,8 +22,9 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
public Action<BeatmapSetHeader> GainedSelection;
|
public Action<BeatmapSetHeader> GainedSelection;
|
||||||
private readonly SpriteText title;
|
private readonly SpriteText title;
|
||||||
private readonly SpriteText artist;
|
private readonly SpriteText artist;
|
||||||
private OsuConfigManager config;
|
|
||||||
private Bindable<bool> preferUnicode;
|
private Bindable<bool> preferUnicode;
|
||||||
|
|
||||||
private readonly WorkingBeatmap beatmap;
|
private readonly WorkingBeatmap beatmap;
|
||||||
private readonly FillFlowContainer difficultyIcons;
|
private readonly FillFlowContainer difficultyIcons;
|
||||||
|
|
||||||
@ -83,24 +84,13 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager config)
|
private void load(OsuConfigManager config)
|
||||||
{
|
{
|
||||||
this.config = config;
|
|
||||||
|
|
||||||
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
|
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
|
||||||
preferUnicode.ValueChanged += preferUnicode_changed;
|
preferUnicode.ValueChanged += unicode =>
|
||||||
preferUnicode_changed(preferUnicode, null);
|
{
|
||||||
}
|
title.Text = unicode ? beatmap.BeatmapSetInfo.Metadata.TitleUnicode : beatmap.BeatmapSetInfo.Metadata.Title;
|
||||||
|
artist.Text = unicode ? beatmap.BeatmapSetInfo.Metadata.ArtistUnicode : beatmap.BeatmapSetInfo.Metadata.Artist;
|
||||||
private void preferUnicode_changed(object sender, EventArgs e)
|
};
|
||||||
{
|
preferUnicode.TriggerChange();
|
||||||
title.Text = config.GetUnicodeString(beatmap.BeatmapSetInfo.Metadata.Title, beatmap.BeatmapSetInfo.Metadata.TitleUnicode);
|
|
||||||
artist.Text = config.GetUnicodeString(beatmap.BeatmapSetInfo.Metadata.Artist, beatmap.BeatmapSetInfo.Metadata.ArtistUnicode);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
|
||||||
{
|
|
||||||
if (preferUnicode != null)
|
|
||||||
preferUnicode.ValueChanged -= preferUnicode_changed;
|
|
||||||
base.Dispose(isDisposing);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class PanelBackground : BufferedContainer
|
private class PanelBackground : BufferedContainer
|
||||||
|
@ -5,21 +5,16 @@ namespace osu.Game.Beatmaps.Timing
|
|||||||
{
|
{
|
||||||
public class ControlPoint
|
public class ControlPoint
|
||||||
{
|
{
|
||||||
public static ControlPoint Default = new ControlPoint
|
|
||||||
{
|
|
||||||
BeatLength = 500,
|
|
||||||
TimingChange = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
public string SampleBank;
|
public string SampleBank;
|
||||||
public int SampleVolume;
|
public int SampleVolume;
|
||||||
|
|
||||||
public TimeSignatures TimeSignature;
|
public TimeSignatures TimeSignature;
|
||||||
public double Time;
|
public double Time;
|
||||||
public double BeatLength;
|
public double BeatLength = 500;
|
||||||
public double VelocityAdjustment;
|
public double SpeedMultiplier = 1;
|
||||||
public bool TimingChange;
|
public bool TimingChange = true;
|
||||||
public bool KiaiMode;
|
public bool KiaiMode;
|
||||||
public bool OmitFirstBarLine;
|
public bool OmitFirstBarLine;
|
||||||
|
|
||||||
|
public ControlPoint Clone() => (ControlPoint)MemberwiseClone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,8 @@ namespace osu.Game.Beatmaps.Timing
|
|||||||
{
|
{
|
||||||
public readonly List<ControlPoint> ControlPoints = new List<ControlPoint>();
|
public readonly List<ControlPoint> ControlPoints = new List<ControlPoint>();
|
||||||
|
|
||||||
public double BPMMaximum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderBy(c => c.BeatLength).FirstOrDefault() ?? ControlPoint.Default).BeatLength;
|
public double BPMMaximum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderBy(c => c.BeatLength).FirstOrDefault() ?? new ControlPoint()).BeatLength;
|
||||||
public double BPMMinimum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderByDescending(c => c.BeatLength).FirstOrDefault() ?? ControlPoint.Default).BeatLength;
|
public double BPMMinimum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderByDescending(c => c.BeatLength).FirstOrDefault() ?? new ControlPoint()).BeatLength;
|
||||||
public double BPMMode => BPMAt(ControlPoints.Where(c => c.BeatLength != 0).GroupBy(c => c.BeatLength).OrderByDescending(grp => grp.Count()).First().First().Time);
|
public double BPMMode => BPMAt(ControlPoints.Where(c => c.BeatLength != 0).GroupBy(c => c.BeatLength).OrderByDescending(grp => grp.Count()).First().First().Time);
|
||||||
|
|
||||||
public double BPMAt(double time)
|
public double BPMAt(double time)
|
||||||
@ -29,7 +29,7 @@ namespace osu.Game.Beatmaps.Timing
|
|||||||
ControlPoint overridePoint;
|
ControlPoint overridePoint;
|
||||||
ControlPoint timingPoint = TimingPointAt(time, out overridePoint);
|
ControlPoint timingPoint = TimingPointAt(time, out overridePoint);
|
||||||
|
|
||||||
return overridePoint?.VelocityAdjustment ?? timingPoint?.VelocityAdjustment ?? 1;
|
return overridePoint?.SpeedMultiplier ?? timingPoint?.SpeedMultiplier ?? 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -74,7 +74,7 @@ namespace osu.Game.Beatmaps.Timing
|
|||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return timingPoint ?? ControlPoint.Default;
|
return timingPoint ?? new ControlPoint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -35,6 +35,7 @@ namespace osu.Game.Configuration
|
|||||||
|
|
||||||
Set(OsuConfig.MenuParallax, true);
|
Set(OsuConfig.MenuParallax, true);
|
||||||
|
|
||||||
|
Set(OsuConfig.ShowInterface, true);
|
||||||
Set(OsuConfig.KeyOverlay, false);
|
Set(OsuConfig.KeyOverlay, false);
|
||||||
//todo: implement all settings below this line (remove the Disabled set when doing so).
|
//todo: implement all settings below this line (remove the Disabled set when doing so).
|
||||||
|
|
||||||
@ -89,7 +90,6 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuConfig.LastVersionPermissionsFailed, string.Empty).Disabled = true;
|
Set(OsuConfig.LastVersionPermissionsFailed, string.Empty).Disabled = true;
|
||||||
Set(OsuConfig.LoadSubmittedThread, true).Disabled = true;
|
Set(OsuConfig.LoadSubmittedThread, true).Disabled = true;
|
||||||
Set(OsuConfig.LobbyPlayMode, -1).Disabled = true;
|
Set(OsuConfig.LobbyPlayMode, -1).Disabled = true;
|
||||||
Set(OsuConfig.ShowInterface, true).Disabled = true;
|
|
||||||
Set(OsuConfig.ShowInterfaceDuringRelax, false).Disabled = true;
|
Set(OsuConfig.ShowInterfaceDuringRelax, false).Disabled = true;
|
||||||
Set(OsuConfig.LobbyShowExistingOnly, false).Disabled = true;
|
Set(OsuConfig.LobbyShowExistingOnly, false).Disabled = true;
|
||||||
Set(OsuConfig.LobbyShowFriendsOnly, false).Disabled = true;
|
Set(OsuConfig.LobbyShowFriendsOnly, false).Disabled = true;
|
||||||
@ -187,10 +187,6 @@ namespace osu.Game.Configuration
|
|||||||
#pragma warning restore CS0612 // Type or member is obsolete
|
#pragma warning restore CS0612 // Type or member is obsolete
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo: make a UnicodeString class/struct rather than requiring this helper method.
|
|
||||||
public string GetUnicodeString(string nonunicode, string unicode)
|
|
||||||
=> Get<bool>(OsuConfig.ShowUnicode) ? unicode ?? nonunicode : nonunicode ?? unicode;
|
|
||||||
|
|
||||||
public OsuConfigManager(Storage storage) : base(storage)
|
public OsuConfigManager(Storage storage) : base(storage)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -9,12 +9,12 @@ namespace osu.Game.Database
|
|||||||
{
|
{
|
||||||
[PrimaryKey, AutoIncrement]
|
[PrimaryKey, AutoIncrement]
|
||||||
public int ID { get; set; }
|
public int ID { get; set; }
|
||||||
public float DrainRate { get; set; }
|
public float DrainRate { get; set; } = 5;
|
||||||
public float CircleSize { get; set; }
|
public float CircleSize { get; set; } = 5;
|
||||||
public float OverallDifficulty { get; set; }
|
public float OverallDifficulty { get; set; } = 5;
|
||||||
public float ApproachRate { get; set; }
|
public float ApproachRate { get; set; } = 5;
|
||||||
public float SliderMultiplier { get; set; }
|
public float SliderMultiplier { get; set; } = 1;
|
||||||
public float SliderTickRate { get; set; }
|
public float SliderTickRate { get; set; } = 1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Maps a difficulty value [0, 10] to a two-piece linear range of values.
|
/// Maps a difficulty value [0, 10] to a two-piece linear range of values.
|
||||||
|
@ -14,6 +14,7 @@ namespace osu.Game.Database
|
|||||||
[PrimaryKey, AutoIncrement]
|
[PrimaryKey, AutoIncrement]
|
||||||
public int ID { get; set; }
|
public int ID { get; set; }
|
||||||
|
|
||||||
|
//TODO: should be in database
|
||||||
public int BeatmapVersion;
|
public int BeatmapVersion;
|
||||||
|
|
||||||
public int? OnlineBeatmapID { get; set; }
|
public int? OnlineBeatmapID { get; set; }
|
||||||
|
@ -60,8 +60,8 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
for (int i = 0; i < aimTriangleCount; i++)
|
|
||||||
addTriangle(true);
|
addTriangles(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int aimTriangleCount => (int)(DrawWidth * DrawHeight * 0.002f / (triangleScale * triangleScale) * SpawnRatio);
|
private int aimTriangleCount => (int)(DrawWidth * DrawHeight * 0.002f / (triangleScale * triangleScale) * SpawnRatio);
|
||||||
@ -83,8 +83,8 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
t.Expire();
|
t.Expire();
|
||||||
}
|
}
|
||||||
|
|
||||||
while (CreateNewTriangles && Children.Count() < aimTriangleCount)
|
if (CreateNewTriangles)
|
||||||
addTriangle(false);
|
addTriangles(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual Triangle CreateTriangle()
|
protected virtual Triangle CreateTriangle()
|
||||||
@ -113,12 +113,16 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
|
|
||||||
protected virtual Color4 GetTriangleShade() => Interpolation.ValueAt(RNG.NextSingle(), ColourDark, ColourLight, 0, 1);
|
protected virtual Color4 GetTriangleShade() => Interpolation.ValueAt(RNG.NextSingle(), ColourDark, ColourLight, 0, 1);
|
||||||
|
|
||||||
private void addTriangle(bool randomY)
|
private void addTriangles(bool randomY)
|
||||||
{
|
{
|
||||||
var sprite = CreateTriangle();
|
int addCount = aimTriangleCount - Children.Count();
|
||||||
float triangleHeight = sprite.DrawHeight / DrawHeight;
|
for (int i = 0; i < addCount; i++)
|
||||||
sprite.Position = new Vector2(RNG.NextSingle(), randomY ? RNG.NextSingle() * (1 + triangleHeight) - triangleHeight : 1);
|
{
|
||||||
Add(sprite);
|
var sprite = CreateTriangle();
|
||||||
|
float triangleHeight = sprite.DrawHeight / DrawHeight;
|
||||||
|
sprite.Position = new Vector2(RNG.NextSingle(), randomY ? RNG.NextSingle() * (1 + triangleHeight) - triangleHeight : 1);
|
||||||
|
Add(sprite);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ using osu.Framework.Graphics.Cursor;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Cursor
|
namespace osu.Game.Graphics.Cursor
|
||||||
{
|
{
|
||||||
@ -116,14 +115,9 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
};
|
};
|
||||||
|
|
||||||
cursorScale = config.GetBindable<double>(OsuConfig.GameplayCursorSize);
|
cursorScale = config.GetBindable<double>(OsuConfig.GameplayCursorSize);
|
||||||
cursorScale.ValueChanged += scaleChanged;
|
cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)cursorScale);
|
||||||
cursorScale.TriggerChange();
|
cursorScale.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void scaleChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
cursorContainer.Scale = new Vector2((float)cursorScale);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,14 +131,9 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
};
|
};
|
||||||
|
|
||||||
cursorScale = config.GetBindable<double>(OsuConfig.MenuCursorSize);
|
cursorScale = config.GetBindable<double>(OsuConfig.MenuCursorSize);
|
||||||
cursorScale.ValueChanged += scaleChanged;
|
cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale);
|
||||||
cursorScale.TriggerChange();
|
cursorScale.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void scaleChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
cursorContainer.Scale = new Vector2((float)cursorScale);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// 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;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
@ -86,9 +85,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindableValueChanged(object sender, EventArgs e)
|
private void bindableValueChanged(bool isChecked)
|
||||||
{
|
{
|
||||||
State = bindable.Value ? CheckboxState.Checked : CheckboxState.Unchecked;
|
State = isChecked ? CheckboxState.Checked : CheckboxState.Unchecked;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
protected override Dropdown<T> CreateDropdown() => new OsuTabDropdown();
|
protected override Dropdown<T> CreateDropdown() => new OsuTabDropdown();
|
||||||
|
|
||||||
protected override TabItem<T> CreateTabItem(T value) => new OsuTabItem { Value = value };
|
protected override TabItem<T> CreateTabItem(T value) => new OsuTabItem(value);
|
||||||
|
|
||||||
protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || Dropdown.Contains(screenSpacePos);
|
protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || Dropdown.Contains(screenSpacePos);
|
||||||
|
|
||||||
@ -75,16 +75,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public new T Value
|
|
||||||
{
|
|
||||||
get { return base.Value; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
base.Value = value;
|
|
||||||
text.Text = (value as Enum)?.GetDescription();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Active
|
public override bool Active
|
||||||
{
|
{
|
||||||
get { return base.Active; }
|
get { return base.Active; }
|
||||||
@ -134,30 +124,31 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
AccentColour = colours.Blue;
|
AccentColour = colours.Blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OsuTabItem()
|
public OsuTabItem(T value) : base(value)
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.X;
|
AutoSizeAxes = Axes.X;
|
||||||
RelativeSizeAxes = Axes.Y;
|
RelativeSizeAxes = Axes.Y;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
text = new OsuSpriteText
|
text = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Top = 5, Bottom = 5 },
|
Margin = new MarginPadding { Top = 5, Bottom = 5 },
|
||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
TextSize = 14,
|
Text = (value as Enum)?.GetDescription(),
|
||||||
Font = @"Exo2.0-Bold", // Font should only turn bold when active?
|
TextSize = 14,
|
||||||
},
|
Font = @"Exo2.0-Bold", // Font should only turn bold when active?
|
||||||
box = new Box
|
},
|
||||||
{
|
box = new Box
|
||||||
RelativeSizeAxes = Axes.X,
|
{
|
||||||
Height = 1,
|
RelativeSizeAxes = Axes.X,
|
||||||
Alpha = 0,
|
Height = 1,
|
||||||
Colour = Color4.White,
|
Alpha = 0,
|
||||||
Origin = Anchor.BottomLeft,
|
Colour = Color4.White,
|
||||||
Anchor = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
}
|
Anchor = Anchor.BottomLeft,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,13 +98,10 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
DisplayedCount = Current;
|
DisplayedCount = Current;
|
||||||
|
|
||||||
Current.ValueChanged += currentChanged;
|
Current.ValueChanged += newValue =>
|
||||||
}
|
{
|
||||||
|
if (IsLoaded) TransformCount(displayedCount, newValue);
|
||||||
private void currentChanged(object sender, EventArgs e)
|
};
|
||||||
{
|
|
||||||
if (IsLoaded)
|
|
||||||
TransformCount(displayedCount, Current);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// 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;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
@ -19,7 +18,7 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
|
|
||||||
protected override bool HideOnEscape => false;
|
protected override bool HideOnEscape => false;
|
||||||
|
|
||||||
private void volumeChanged(object sender, EventArgs e)
|
private void volumeChanged(double newVolume)
|
||||||
{
|
{
|
||||||
Show();
|
Show();
|
||||||
schedulePopOut();
|
schedulePopOut();
|
||||||
|
@ -56,13 +56,17 @@ namespace osu.Game.Modes.Objects.Drawables
|
|||||||
Samples.ForEach(s => s?.Play());
|
Samples.ForEach(s => s?.Play());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
|
||||||
|
|
||||||
//we may be setting a custom judgement in test cases or what not.
|
//we may be setting a custom judgement in test cases or what not.
|
||||||
if (Judgement == null)
|
if (Judgement == null)
|
||||||
Judgement = CreateJudgement();
|
Judgement = CreateJudgement();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
//force application of the state that was set before we loaded.
|
//force application of the state that was set before we loaded.
|
||||||
UpdateState(State);
|
UpdateState(State);
|
||||||
|
@ -66,12 +66,7 @@ namespace osu.Game.Modes.UI
|
|||||||
|
|
||||||
TextSize = 80;
|
TextSize = 80;
|
||||||
|
|
||||||
Current.ValueChanged += comboChanged;
|
Current.ValueChanged += newValue => updateCount(newValue == 0);
|
||||||
}
|
|
||||||
|
|
||||||
private void comboChanged(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
updateCount(Current.Value == 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Modes.UI
|
|||||||
|
|
||||||
protected HealthDisplay()
|
protected HealthDisplay()
|
||||||
{
|
{
|
||||||
Current.ValueChanged += (s, e) => SetHealth((float)Current);
|
Current.ValueChanged += newValue => SetHealth((float)newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void SetHealth(float value);
|
protected abstract void SetHealth(float value);
|
||||||
|
@ -42,6 +42,16 @@ namespace osu.Game.Modes.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected readonly KeyConversionInputManager KeyConversionInputManager;
|
protected readonly KeyConversionInputManager KeyConversionInputManager;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether we are currently providing the local user a gameplay cursor.
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool ProvidingUserCursor => false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether we have a replay loaded currently.
|
||||||
|
/// </summary>
|
||||||
|
public bool HasReplayLoaded => InputManager.ReplayInputHandler != null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether all the HitObjects have been judged.
|
/// Whether all the HitObjects have been judged.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -157,6 +167,8 @@ namespace osu.Game.Modes.UI
|
|||||||
{
|
{
|
||||||
public event Action<TJudgement> OnJudgement;
|
public event Action<TJudgement> OnJudgement;
|
||||||
|
|
||||||
|
public sealed override bool ProvidingUserCursor => !HasReplayLoaded && Playfield.ProvidingUserCursor;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
protected override bool AllObjectsJudged => Playfield.HitObjects.Children.All(h => h.Judgement.Result != HitResult.None);
|
protected override bool AllObjectsJudged => Playfield.HitObjects.Children.All(h => h.Judgement.Result != HitResult.None);
|
||||||
|
|
||||||
|
@ -8,13 +8,19 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using System;
|
|
||||||
using osu.Game.Modes.Scoring;
|
using osu.Game.Modes.Scoring;
|
||||||
|
using osu.Framework.Input;
|
||||||
|
using OpenTK.Input;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Overlays.Notifications;
|
||||||
|
|
||||||
namespace osu.Game.Modes.UI
|
namespace osu.Game.Modes.UI
|
||||||
{
|
{
|
||||||
public abstract class HudOverlay : Container
|
public abstract class HudOverlay : Container
|
||||||
{
|
{
|
||||||
|
private const int duration = 100;
|
||||||
|
|
||||||
|
private readonly Container content;
|
||||||
public readonly KeyCounterCollection KeyCounter;
|
public readonly KeyCounterCollection KeyCounter;
|
||||||
public readonly ComboCounter ComboCounter;
|
public readonly ComboCounter ComboCounter;
|
||||||
public readonly ScoreCounter ScoreCounter;
|
public readonly ScoreCounter ScoreCounter;
|
||||||
@ -22,6 +28,9 @@ namespace osu.Game.Modes.UI
|
|||||||
public readonly HealthDisplay HealthDisplay;
|
public readonly HealthDisplay HealthDisplay;
|
||||||
|
|
||||||
private Bindable<bool> showKeyCounter;
|
private Bindable<bool> showKeyCounter;
|
||||||
|
private Bindable<bool> showHud;
|
||||||
|
|
||||||
|
private static bool hasShownNotificationOnce;
|
||||||
|
|
||||||
protected abstract KeyCounterCollection CreateKeyCounter();
|
protected abstract KeyCounterCollection CreateKeyCounter();
|
||||||
protected abstract ComboCounter CreateComboCounter();
|
protected abstract ComboCounter CreateComboCounter();
|
||||||
@ -33,36 +42,57 @@ namespace osu.Game.Modes.UI
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Add(content = new Container
|
||||||
{
|
{
|
||||||
KeyCounter = CreateKeyCounter(),
|
RelativeSizeAxes = Axes.Both,
|
||||||
ComboCounter = CreateComboCounter(),
|
|
||||||
ScoreCounter = CreateScoreCounter(),
|
Children = new Drawable[]
|
||||||
AccuracyCounter = CreateAccuracyCounter(),
|
{
|
||||||
HealthDisplay = CreateHealthDisplay(),
|
KeyCounter = CreateKeyCounter(),
|
||||||
};
|
ComboCounter = CreateComboCounter(),
|
||||||
|
ScoreCounter = CreateScoreCounter(),
|
||||||
|
AccuracyCounter = CreateAccuracyCounter(),
|
||||||
|
HealthDisplay = CreateHealthDisplay(),
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(OsuConfigManager config)
|
private void load(OsuConfigManager config, NotificationManager notificationManager)
|
||||||
{
|
{
|
||||||
showKeyCounter = config.GetBindable<bool>(OsuConfig.KeyOverlay);
|
showKeyCounter = config.GetBindable<bool>(OsuConfig.KeyOverlay);
|
||||||
showKeyCounter.ValueChanged += visibilityChanged;
|
showKeyCounter.ValueChanged += keyCounterVisibility =>
|
||||||
|
{
|
||||||
|
if (keyCounterVisibility)
|
||||||
|
KeyCounter.FadeIn(duration);
|
||||||
|
else
|
||||||
|
KeyCounter.FadeOut(duration);
|
||||||
|
};
|
||||||
showKeyCounter.TriggerChange();
|
showKeyCounter.TriggerChange();
|
||||||
}
|
|
||||||
|
|
||||||
private void visibilityChanged(object sender, EventArgs e)
|
showHud = config.GetBindable<bool>(OsuConfig.ShowInterface);
|
||||||
{
|
showHud.ValueChanged += hudVisibility =>
|
||||||
if (showKeyCounter)
|
{
|
||||||
KeyCounter.Show();
|
if (hudVisibility)
|
||||||
else
|
content.FadeIn(duration);
|
||||||
KeyCounter.Hide();
|
else
|
||||||
|
content.FadeOut(duration);
|
||||||
|
};
|
||||||
|
showHud.TriggerChange();
|
||||||
|
|
||||||
|
if (!showHud && !hasShownNotificationOnce)
|
||||||
|
{
|
||||||
|
hasShownNotificationOnce = true;
|
||||||
|
|
||||||
|
notificationManager?.Post(new SimpleNotification
|
||||||
|
{
|
||||||
|
Text = @"The score overlay is currently disabled. You can toggle this by pressing Shift+Tab."
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BindProcessor(ScoreProcessor processor)
|
public void BindProcessor(ScoreProcessor processor)
|
||||||
{
|
{
|
||||||
//bind processor bindables to combocounter, score display etc.
|
|
||||||
//TODO: these should be bindable binds, not events!
|
|
||||||
ScoreCounter?.Current.BindTo(processor.TotalScore);
|
ScoreCounter?.Current.BindTo(processor.TotalScore);
|
||||||
AccuracyCounter?.Current.BindTo(processor.Accuracy);
|
AccuracyCounter?.Current.BindTo(processor.Accuracy);
|
||||||
ComboCounter?.Current.BindTo(processor.Combo);
|
ComboCounter?.Current.BindTo(processor.Combo);
|
||||||
@ -73,5 +103,22 @@ namespace osu.Game.Modes.UI
|
|||||||
{
|
{
|
||||||
hitRenderer.InputManager.Add(KeyCounter.GetReceptor());
|
hitRenderer.InputManager.Add(KeyCounter.GetReceptor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.Repeat) return false;
|
||||||
|
|
||||||
|
if (state.Keyboard.ShiftPressed)
|
||||||
|
{
|
||||||
|
switch (args.Key)
|
||||||
|
{
|
||||||
|
case Key.Tab:
|
||||||
|
showHud.Value = !showHud.Value;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.OnKeyDown(state, args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,11 @@ namespace osu.Game.Modes.UI
|
|||||||
|
|
||||||
internal Container<Drawable> ScaledContent;
|
internal Container<Drawable> ScaledContent;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether we are currently providing the local user a gameplay cursor.
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool ProvidingUserCursor => false;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
private readonly Container<Drawable> content;
|
private readonly Container<Drawable> content;
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ namespace osu.Game
|
|||||||
if (intro?.ChildScreen != null)
|
if (intro?.ChildScreen != null)
|
||||||
intro.ChildScreen.Padding = new MarginPadding { Top = Toolbar.Position.Y + Toolbar.DrawHeight };
|
intro.ChildScreen.Padding = new MarginPadding { Top = Toolbar.Position.Y + Toolbar.DrawHeight };
|
||||||
|
|
||||||
Cursor.State = currentScreen == null || currentScreen.HasLocalCursorDisplayed ? Visibility.Hidden : Visibility.Visible;
|
Cursor.State = currentScreen?.HasLocalCursorDisplayed == false ? Visibility.Visible : Visibility.Hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void screenAdded(Screen newScreen)
|
private void screenAdded(Screen newScreen)
|
||||||
|
@ -92,7 +92,10 @@ namespace osu.Game
|
|||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Medium"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Medium"));
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-MediumItalic"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-MediumItalic"));
|
||||||
|
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Noto"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Noto-Basic"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Noto-Hangul"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Noto-CJK-Basic"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Noto-CJK-Compatibility"));
|
||||||
|
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular"));
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-RegularItalic"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-RegularItalic"));
|
||||||
|
@ -39,9 +39,9 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
public readonly Bindable<PlayMode> PlayMode = new Bindable<PlayMode>();
|
public readonly Bindable<PlayMode> PlayMode = new Bindable<PlayMode>();
|
||||||
|
|
||||||
private void modeChanged(object sender, EventArgs eventArgs)
|
private void modeChanged(PlayMode newMode)
|
||||||
{
|
{
|
||||||
var ruleset = Ruleset.GetRuleset(PlayMode);
|
var ruleset = Ruleset.GetRuleset(newMode);
|
||||||
foreach (ModSection section in modSectionsContainer.Children)
|
foreach (ModSection section in modSectionsContainer.Children)
|
||||||
section.Buttons = ruleset.GetModsFor(section.ModType).Select(m => new ModButton(m)).ToArray();
|
section.Buttons = ruleset.GetModsFor(section.ModType).Select(m => new ModButton(m)).ToArray();
|
||||||
refreshSelectedMods();
|
refreshSelectedMods();
|
||||||
@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
if (osu != null)
|
if (osu != null)
|
||||||
PlayMode.BindTo(osu.PlayMode);
|
PlayMode.BindTo(osu.PlayMode);
|
||||||
PlayMode.ValueChanged += modeChanged;
|
PlayMode.ValueChanged += modeChanged;
|
||||||
modeChanged(null, null);
|
PlayMode.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PopOut()
|
protected override void PopOut()
|
||||||
|
@ -78,8 +78,6 @@ namespace osu.Game.Overlays
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuGameBase game, OsuConfigManager config, BeatmapDatabase beatmaps, OsuColour colours)
|
private void load(OsuGameBase game, OsuConfigManager config, BeatmapDatabase beatmaps, OsuColour colours)
|
||||||
{
|
{
|
||||||
unicodeString = config.GetUnicodeString;
|
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
dragContainer = new Container
|
dragContainer = new Container
|
||||||
@ -210,7 +208,7 @@ namespace osu.Game.Overlays
|
|||||||
this.beatmaps = beatmaps;
|
this.beatmaps = beatmaps;
|
||||||
trackManager = game.Audio.Track;
|
trackManager = game.Audio.Track;
|
||||||
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
|
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
|
||||||
preferUnicode.ValueChanged += preferUnicode_changed;
|
preferUnicode.ValueChanged += unicode => updateDisplay(current, TransformDirection.None);
|
||||||
|
|
||||||
beatmapSource = game.Beatmap ?? new Bindable<WorkingBeatmap>();
|
beatmapSource = game.Beatmap ?? new Bindable<WorkingBeatmap>();
|
||||||
playList = beatmaps.GetAllWithChildren<BeatmapSetInfo>();
|
playList = beatmaps.GetAllWithChildren<BeatmapSetInfo>();
|
||||||
@ -222,7 +220,8 @@ namespace osu.Game.Overlays
|
|||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
beatmapSource.ValueChanged += workingChanged;
|
beatmapSource.ValueChanged += workingChanged;
|
||||||
workingChanged();
|
beatmapSource.TriggerChange();
|
||||||
|
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,17 +246,12 @@ namespace osu.Game.Overlays
|
|||||||
playButton.Icon = FontAwesome.fa_play_circle_o;
|
playButton.Icon = FontAwesome.fa_play_circle_o;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void preferUnicode_changed(object sender, EventArgs e)
|
private void workingChanged(WorkingBeatmap beatmap)
|
||||||
{
|
{
|
||||||
updateDisplay(current, TransformDirection.None);
|
progress.IsEnabled = beatmap != null;
|
||||||
}
|
if (beatmap == current) return;
|
||||||
|
bool audioEquals = current?.BeatmapInfo?.AudioEquals(beatmap?.BeatmapInfo) ?? false;
|
||||||
private void workingChanged(object sender = null, EventArgs e = null)
|
current = beatmap;
|
||||||
{
|
|
||||||
progress.IsEnabled = beatmapSource.Value != null;
|
|
||||||
if (beatmapSource.Value == current) return;
|
|
||||||
bool audioEquals = current?.BeatmapInfo?.AudioEquals(beatmapSource?.Value?.BeatmapInfo) ?? false;
|
|
||||||
current = beatmapSource.Value;
|
|
||||||
updateDisplay(current, audioEquals ? TransformDirection.None : TransformDirection.Next);
|
updateDisplay(current, audioEquals ? TransformDirection.None : TransformDirection.Next);
|
||||||
appendToHistory(current?.BeatmapInfo);
|
appendToHistory(current?.BeatmapInfo);
|
||||||
}
|
}
|
||||||
@ -342,8 +336,8 @@ namespace osu.Game.Overlays
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
BeatmapMetadata metadata = beatmap.Beatmap.BeatmapInfo.Metadata;
|
BeatmapMetadata metadata = beatmap.Beatmap.BeatmapInfo.Metadata;
|
||||||
title.Text = unicodeString(metadata.Title, metadata.TitleUnicode);
|
title.Text = preferUnicode ? metadata.TitleUnicode : metadata.Title;
|
||||||
artist.Text = unicodeString(metadata.Artist, metadata.ArtistUnicode);
|
artist.Text = preferUnicode ? metadata.ArtistUnicode : metadata.Artist;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -374,21 +368,12 @@ namespace osu.Game.Overlays
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private Func<string, string, string> unicodeString;
|
|
||||||
|
|
||||||
private void seek(float position)
|
private void seek(float position)
|
||||||
{
|
{
|
||||||
current?.Track?.Seek(current.Track.Length * position);
|
current?.Track?.Seek(current.Track.Length * position);
|
||||||
current?.Track?.Start();
|
current?.Track?.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
|
||||||
{
|
|
||||||
if (preferUnicode != null)
|
|
||||||
preferUnicode.ValueChanged -= preferUnicode_changed;
|
|
||||||
base.Dispose(isDisposing);
|
|
||||||
}
|
|
||||||
|
|
||||||
private const float transition_length = 800;
|
private const float transition_length = 800;
|
||||||
|
|
||||||
protected override void PopIn()
|
protected override void PopIn()
|
||||||
|
@ -155,7 +155,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
public void MarkAllRead()
|
public void MarkAllRead()
|
||||||
{
|
{
|
||||||
notifications.Children.ForEach(n => n.Read = true);
|
notifications?.Children.ForEach(n => n.Read = true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -29,10 +29,10 @@ namespace osu.Game.Overlays.Options
|
|||||||
|
|
||||||
public BindableNumber<T> Bindable
|
public BindableNumber<T> Bindable
|
||||||
{
|
{
|
||||||
get { return slider.Bindable; }
|
get { return slider.Value; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
slider.Bindable = value;
|
slider.Value = value;
|
||||||
if (value?.Disabled ?? true)
|
if (value?.Disabled ?? true)
|
||||||
Alpha = 0.3f;
|
Alpha = 0.3f;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// 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;
|
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
@ -41,10 +40,7 @@ namespace osu.Game.Overlays.Options
|
|||||||
bindable.Value = Text;
|
bindable.Value = Text;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindableValueChanged(object sender, EventArgs e)
|
private void bindableValueChanged(string newValue) => Text = newValue;
|
||||||
{
|
|
||||||
Text = bindable.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
{
|
{
|
||||||
|
@ -39,6 +39,11 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay
|
|||||||
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.ScoreMeterScale)
|
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.ScoreMeterScale)
|
||||||
},
|
},
|
||||||
new OsuCheckbox
|
new OsuCheckbox
|
||||||
|
{
|
||||||
|
LabelText = "Show score overlay",
|
||||||
|
Bindable = config.GetBindable<bool>(OsuConfig.ShowInterface)
|
||||||
|
},
|
||||||
|
new OsuCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Always show key overlay",
|
LabelText = "Always show key overlay",
|
||||||
Bindable = config.GetBindable<bool>(OsuConfig.KeyOverlay)
|
Bindable = config.GetBindable<bool>(OsuConfig.KeyOverlay)
|
||||||
|
@ -5,7 +5,6 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Options.Sections.Graphics
|
namespace osu.Game.Overlays.Options.Sections.Graphics
|
||||||
{
|
{
|
||||||
@ -52,9 +51,9 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
|
|||||||
letterboxing.TriggerChange();
|
letterboxing.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void visibilityChanged(object sender, EventArgs e)
|
private void visibilityChanged(bool newVisibility)
|
||||||
{
|
{
|
||||||
if (letterboxing)
|
if (newVisibility)
|
||||||
{
|
{
|
||||||
letterboxPositionX.Show();
|
letterboxPositionX.Show();
|
||||||
letterboxPositionY.Show();
|
letterboxPositionY.Show();
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// 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;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
@ -40,11 +39,6 @@ namespace osu.Game.Screens
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void beatmap_ValueChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
OnBeatmapChanged(beatmap.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader(permitNulls: true)]
|
[BackgroundDependencyLoader(permitNulls: true)]
|
||||||
private void load(OsuGameBase game)
|
private void load(OsuGameBase game)
|
||||||
{
|
{
|
||||||
@ -57,7 +51,7 @@ namespace osu.Game.Screens
|
|||||||
beatmap.Value = localMap;
|
beatmap.Value = localMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
beatmap.ValueChanged += beatmap_ValueChanged;
|
beatmap.ValueChanged += OnBeatmapChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnBeatmapChanged(WorkingBeatmap beatmap)
|
protected virtual void OnBeatmapChanged(WorkingBeatmap beatmap)
|
||||||
|
@ -1,42 +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.Screens;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Game.Graphics.Sprites;
|
|
||||||
using osu.Game.Screens.Backgrounds;
|
|
||||||
using OpenTK;
|
|
||||||
using OpenTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
|
||||||
{
|
|
||||||
internal class FailDialog : OsuScreen
|
|
||||||
{
|
|
||||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
|
|
||||||
|
|
||||||
private static readonly Vector2 background_blur = new Vector2(20);
|
|
||||||
|
|
||||||
public FailDialog()
|
|
||||||
{
|
|
||||||
Add(new OsuSpriteText
|
|
||||||
{
|
|
||||||
Text = "You failed!",
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
TextSize = 50
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnEntering(Screen last)
|
|
||||||
{
|
|
||||||
base.OnEntering(last);
|
|
||||||
Background.Schedule(() => (Background as BackgroundScreenBeatmap)?.BlurTo(background_blur, 1000));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool OnExiting(Screen next)
|
|
||||||
{
|
|
||||||
Background.Schedule(() => Background.FadeColour(Color4.White, 500));
|
|
||||||
return base.OnExiting(next);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
37
osu.Game/Screens/Play/FailOverlay.cs
Normal file
37
osu.Game/Screens/Play/FailOverlay.cs
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
// 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.Containers;
|
||||||
|
using osu.Framework.Input;
|
||||||
|
using OpenTK.Input;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
|
||||||
|
namespace osu.Game.Screens.Play
|
||||||
|
{
|
||||||
|
public class FailOverlay : MenuOverlay
|
||||||
|
{
|
||||||
|
|
||||||
|
public override string Header => "failed";
|
||||||
|
public override string Description => "you're dead, try again?";
|
||||||
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.Key == Key.Escape)
|
||||||
|
{
|
||||||
|
if (State == Visibility.Hidden) return false;
|
||||||
|
OnQuit();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.OnKeyDown(state, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colours)
|
||||||
|
{
|
||||||
|
AddButton("Retry", colours.YellowDark, OnRetry);
|
||||||
|
AddButton("Quit", new Color4(170, 27, 39, 255), OnQuit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
194
osu.Game/Screens/Play/MenuOverlay.cs
Normal file
194
osu.Game/Screens/Play/MenuOverlay.cs
Normal file
@ -0,0 +1,194 @@
|
|||||||
|
// 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.Extensions.Color4Extensions;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Input;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Game.Screens.Play.Pause;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
|
||||||
|
namespace osu.Game.Screens.Play
|
||||||
|
{
|
||||||
|
public abstract class MenuOverlay : OverlayContainer
|
||||||
|
{
|
||||||
|
private const int transition_duration = 200;
|
||||||
|
private const int button_height = 70;
|
||||||
|
private const float background_alpha = 0.75f;
|
||||||
|
|
||||||
|
protected override bool HideOnEscape => false;
|
||||||
|
|
||||||
|
public Action OnRetry;
|
||||||
|
public Action OnQuit;
|
||||||
|
|
||||||
|
public abstract string Header { get; }
|
||||||
|
public abstract string Description { get; }
|
||||||
|
|
||||||
|
private FillFlowContainer buttons;
|
||||||
|
|
||||||
|
public int Retries
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (retryCounterContainer != null)
|
||||||
|
{
|
||||||
|
// "You've retried 1,065 times in this session"
|
||||||
|
// "You've retried 1 time in this session"
|
||||||
|
|
||||||
|
retryCounterContainer.Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Text = "You've retried ",
|
||||||
|
Shadow = true,
|
||||||
|
ShadowColour = new Color4(0, 0, 0, 0.25f),
|
||||||
|
TextSize = 18
|
||||||
|
},
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Text = $"{value:n0}",
|
||||||
|
Font = @"Exo2.0-Bold",
|
||||||
|
Shadow = true,
|
||||||
|
ShadowColour = new Color4(0, 0, 0, 0.25f),
|
||||||
|
TextSize = 18
|
||||||
|
},
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Text = $" time{(value == 1 ? "" : "s")} in this session",
|
||||||
|
Shadow = true,
|
||||||
|
ShadowColour = new Color4(0, 0, 0, 0.25f),
|
||||||
|
TextSize = 18
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private FillFlowContainer retryCounterContainer;
|
||||||
|
|
||||||
|
public override bool HandleInput => State == Visibility.Visible;
|
||||||
|
|
||||||
|
protected override void PopIn() => FadeIn(transition_duration, EasingTypes.In);
|
||||||
|
protected override void PopOut() => FadeOut(transition_duration, EasingTypes.In);
|
||||||
|
|
||||||
|
// Don't let mouse down events through the overlay or people can click circles while paused.
|
||||||
|
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
||||||
|
|
||||||
|
protected override bool OnMouseMove(InputState state) => true;
|
||||||
|
|
||||||
|
protected void AddButton(string text, Color4 colour, Action action)
|
||||||
|
{
|
||||||
|
buttons.Add(new PauseButton
|
||||||
|
{
|
||||||
|
Text = text,
|
||||||
|
ButtonColour = colour,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Height = button_height,
|
||||||
|
Action = delegate {
|
||||||
|
action?.Invoke();
|
||||||
|
Hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colours)
|
||||||
|
{
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = Color4.Black,
|
||||||
|
Alpha = background_alpha,
|
||||||
|
},
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
Spacing = new Vector2(0, 50),
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
Spacing = new Vector2(0, 20),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Text = Header,
|
||||||
|
Font = @"Exo2.0-Medium",
|
||||||
|
Spacing = new Vector2(5, 0),
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
TextSize = 30,
|
||||||
|
Colour = colours.Yellow,
|
||||||
|
Shadow = true,
|
||||||
|
ShadowColour = new Color4(0, 0, 0, 0.25f)
|
||||||
|
},
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Text = Description,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Shadow = true,
|
||||||
|
ShadowColour = new Color4(0, 0, 0, 0.25f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buttons = new FillFlowContainer
|
||||||
|
{
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
Masking = true,
|
||||||
|
EdgeEffect = new EdgeEffect
|
||||||
|
{
|
||||||
|
Type = EdgeEffectType.Shadow,
|
||||||
|
Colour = Color4.Black.Opacity(0.6f),
|
||||||
|
Radius = 50
|
||||||
|
},
|
||||||
|
},
|
||||||
|
retryCounterContainer = new FillFlowContainer
|
||||||
|
{
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new PauseProgressBar
|
||||||
|
{
|
||||||
|
Origin = Anchor.BottomCentre,
|
||||||
|
Anchor = Anchor.BottomCentre,
|
||||||
|
Width = 1f
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Retries = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected MenuOverlay()
|
||||||
|
{
|
||||||
|
AlwaysReceiveInput = true;
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -4,23 +4,16 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using OpenTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.Pause
|
namespace osu.Game.Screens.Play.Pause
|
||||||
{
|
{
|
||||||
public class QuitButton : DialogButton
|
public class PauseButton : DialogButton
|
||||||
{
|
{
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
ButtonColour = new Color4(170, 27, 39, 255); // The red from the design isn't in the palette so it's used directly
|
|
||||||
SampleHover = audio.Sample.Get(@"Menu/menuclick");
|
SampleHover = audio.Sample.Get(@"Menu/menuclick");
|
||||||
SampleClick = audio.Sample.Get(@"Menu/menuback");
|
SampleClick = audio.Sample.Get(@"Menu/menuback");
|
||||||
}
|
}
|
||||||
|
|
||||||
public QuitButton()
|
|
||||||
{
|
|
||||||
Text = @"Quit to Main Menu";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,26 +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.Allocation;
|
|
||||||
using osu.Framework.Audio;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Graphics.UserInterface;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.Pause
|
|
||||||
{
|
|
||||||
public class ResumeButton : DialogButton
|
|
||||||
{
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(AudioManager audio, OsuColour colours)
|
|
||||||
{
|
|
||||||
ButtonColour = colours.Green;
|
|
||||||
SampleHover = audio.Sample.Get(@"Menu/menuclick");
|
|
||||||
SampleClick = audio.Sample.Get(@"Menu/menuback");
|
|
||||||
}
|
|
||||||
|
|
||||||
public ResumeButton()
|
|
||||||
{
|
|
||||||
Text = @"Continue";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,26 +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.Allocation;
|
|
||||||
using osu.Framework.Audio;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Graphics.UserInterface;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.Pause
|
|
||||||
{
|
|
||||||
public class RetryButton : DialogButton
|
|
||||||
{
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(AudioManager audio, OsuColour colours)
|
|
||||||
{
|
|
||||||
ButtonColour = colours.YellowDark;
|
|
||||||
SampleHover = audio.Sample.Get(@"Menu/menuclick");
|
|
||||||
SampleClick = audio.Sample.Get(@"Menu/menu-play-click");
|
|
||||||
}
|
|
||||||
|
|
||||||
public RetryButton()
|
|
||||||
{
|
|
||||||
Text = @"Retry";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,89 +2,28 @@
|
|||||||
// 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;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
|
||||||
using osu.Game.Screens.Play.Pause;
|
|
||||||
using OpenTK;
|
|
||||||
using OpenTK.Graphics;
|
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
{
|
{
|
||||||
public class PauseOverlay : OverlayContainer
|
public class PauseOverlay : MenuOverlay
|
||||||
{
|
{
|
||||||
private const int transition_duration = 200;
|
|
||||||
private const int button_height = 70;
|
|
||||||
private const float background_alpha = 0.75f;
|
|
||||||
|
|
||||||
protected override bool HideOnEscape => false;
|
|
||||||
|
|
||||||
public Action OnResume;
|
public Action OnResume;
|
||||||
public Action OnRetry;
|
|
||||||
public Action OnQuit;
|
|
||||||
|
|
||||||
public int Retries
|
public override string Header => "paused";
|
||||||
{
|
public override string Description => "you're not going to do what i think you're going to do, are ya?";
|
||||||
set
|
|
||||||
{
|
|
||||||
if (retryCounterContainer != null)
|
|
||||||
{
|
|
||||||
// "You've retried 1,065 times in this session"
|
|
||||||
// "You've retried 1 time in this session"
|
|
||||||
|
|
||||||
retryCounterContainer.Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Text = "You've retried ",
|
|
||||||
Shadow = true,
|
|
||||||
ShadowColour = new Color4(0, 0, 0, 0.25f),
|
|
||||||
TextSize = 18
|
|
||||||
},
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Text = $"{value:n0}",
|
|
||||||
Font = @"Exo2.0-Bold",
|
|
||||||
Shadow = true,
|
|
||||||
ShadowColour = new Color4(0, 0, 0, 0.25f),
|
|
||||||
TextSize = 18
|
|
||||||
},
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Text = $" time{(value == 1 ? "" : "s")} in this session",
|
|
||||||
Shadow = true,
|
|
||||||
ShadowColour = new Color4(0, 0, 0, 0.25f),
|
|
||||||
TextSize = 18
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private FillFlowContainer retryCounterContainer;
|
|
||||||
|
|
||||||
public override bool HandleInput => State == Visibility.Visible;
|
|
||||||
|
|
||||||
protected override void PopIn() => FadeIn(transition_duration, EasingTypes.In);
|
|
||||||
protected override void PopOut() => FadeOut(transition_duration, EasingTypes.In);
|
|
||||||
|
|
||||||
// Don't let mouse down events through the overlay or people can click circles while paused.
|
|
||||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
|
||||||
|
|
||||||
protected override bool OnMouseMove(InputState state) => true;
|
|
||||||
|
|
||||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.Key == Key.Escape)
|
if (args.Key == Key.Escape)
|
||||||
{
|
{
|
||||||
if (State == Visibility.Hidden) return false;
|
if (State == Visibility.Hidden) return false;
|
||||||
resume();
|
OnResume();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,131 +33,10 @@ namespace osu.Game.Screens.Play
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
AddButton("Continue", colours.Green, OnResume);
|
||||||
{
|
AddButton("Retry", colours.YellowDark, OnRetry);
|
||||||
new Box
|
AddButton("Quit", new Color4(170, 27, 39, 255), OnQuit);
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Colour = Color4.Black,
|
|
||||||
Alpha = background_alpha,
|
|
||||||
},
|
|
||||||
new FillFlowContainer
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Direction = FillDirection.Vertical,
|
|
||||||
Spacing = new Vector2(0, 50),
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new FillFlowContainer
|
|
||||||
{
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Direction = FillDirection.Vertical,
|
|
||||||
Spacing = new Vector2(0, 20),
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Text = @"paused",
|
|
||||||
Font = @"Exo2.0-Medium",
|
|
||||||
Spacing = new Vector2(5, 0),
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
TextSize = 30,
|
|
||||||
Colour = colours.Yellow,
|
|
||||||
Shadow = true,
|
|
||||||
ShadowColour = new Color4(0, 0, 0, 0.25f)
|
|
||||||
},
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Text = @"you're not going to do what i think you're going to do, are ya?",
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Shadow = true,
|
|
||||||
ShadowColour = new Color4(0, 0, 0, 0.25f)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new FillFlowContainer
|
|
||||||
{
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Masking = true,
|
|
||||||
EdgeEffect = new EdgeEffect
|
|
||||||
{
|
|
||||||
Type = EdgeEffectType.Shadow,
|
|
||||||
Colour = Color4.Black.Opacity(0.6f),
|
|
||||||
Radius = 50
|
|
||||||
},
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new ResumeButton
|
|
||||||
{
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Height = button_height,
|
|
||||||
Action = resume
|
|
||||||
},
|
|
||||||
new RetryButton
|
|
||||||
{
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Height = button_height,
|
|
||||||
Action = delegate
|
|
||||||
{
|
|
||||||
OnRetry?.Invoke();
|
|
||||||
Hide();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new QuitButton
|
|
||||||
{
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Height = button_height,
|
|
||||||
Action = delegate
|
|
||||||
{
|
|
||||||
OnQuit?.Invoke();
|
|
||||||
Hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
retryCounterContainer = new FillFlowContainer
|
|
||||||
{
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new PauseProgressBar
|
|
||||||
{
|
|
||||||
Origin = Anchor.BottomCentre,
|
|
||||||
Anchor = Anchor.BottomCentre,
|
|
||||||
Width = 1f
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Retries = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void resume()
|
|
||||||
{
|
|
||||||
OnResume?.Invoke();
|
|
||||||
Hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
public PauseOverlay()
|
|
||||||
{
|
|
||||||
AlwaysReceiveInput = true;
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
@ -31,14 +30,14 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
internal override bool ShowOverlays => false;
|
internal override bool ShowOverlays => false;
|
||||||
|
|
||||||
internal override bool HasLocalCursorDisplayed => !hasReplayLoaded && !IsPaused;
|
internal override bool HasLocalCursorDisplayed => !IsPaused && !HasFailed && HitRenderer.ProvidingUserCursor;
|
||||||
|
|
||||||
private bool hasReplayLoaded => HitRenderer.InputManager.ReplayInputHandler != null;
|
|
||||||
|
|
||||||
public BeatmapInfo BeatmapInfo;
|
public BeatmapInfo BeatmapInfo;
|
||||||
|
|
||||||
public bool IsPaused { get; private set; }
|
public bool IsPaused { get; private set; }
|
||||||
|
|
||||||
|
public bool HasFailed { get; private set; }
|
||||||
|
|
||||||
public int RestartCount;
|
public int RestartCount;
|
||||||
|
|
||||||
private const double pause_cooldown = 1000;
|
private const double pause_cooldown = 1000;
|
||||||
@ -58,6 +57,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private HudOverlay hudOverlay;
|
private HudOverlay hudOverlay;
|
||||||
private PauseOverlay pauseOverlay;
|
private PauseOverlay pauseOverlay;
|
||||||
|
private FailOverlay failOverlay;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config)
|
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config)
|
||||||
@ -118,20 +118,6 @@ namespace osu.Game.Screens.Play
|
|||||||
hudOverlay = new StandardHudOverlay();
|
hudOverlay = new StandardHudOverlay();
|
||||||
hudOverlay.KeyCounter.Add(ruleset.CreateGameplayKeys());
|
hudOverlay.KeyCounter.Add(ruleset.CreateGameplayKeys());
|
||||||
hudOverlay.BindProcessor(scoreProcessor);
|
hudOverlay.BindProcessor(scoreProcessor);
|
||||||
|
|
||||||
pauseOverlay = new PauseOverlay
|
|
||||||
{
|
|
||||||
Depth = -1,
|
|
||||||
OnResume = delegate
|
|
||||||
{
|
|
||||||
Delay(400);
|
|
||||||
Schedule(Resume);
|
|
||||||
},
|
|
||||||
OnRetry = Restart,
|
|
||||||
OnQuit = Exit
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
hudOverlay.BindHitRenderer(HitRenderer);
|
hudOverlay.BindHitRenderer(HitRenderer);
|
||||||
|
|
||||||
//bind HitRenderer to ScoreProcessor and ourselves (for a pass situation)
|
//bind HitRenderer to ScoreProcessor and ourselves (for a pass situation)
|
||||||
@ -156,7 +142,21 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
hudOverlay,
|
hudOverlay,
|
||||||
pauseOverlay
|
pauseOverlay = new PauseOverlay
|
||||||
|
{
|
||||||
|
OnResume = delegate
|
||||||
|
{
|
||||||
|
Delay(400);
|
||||||
|
Schedule(Resume);
|
||||||
|
},
|
||||||
|
OnRetry = Restart,
|
||||||
|
OnQuit = Exit,
|
||||||
|
},
|
||||||
|
failOverlay = new FailOverlay
|
||||||
|
{
|
||||||
|
OnRetry = Restart,
|
||||||
|
OnQuit = Exit,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,15 +256,13 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private void onFail()
|
private void onFail()
|
||||||
{
|
{
|
||||||
Content.FadeColour(Color4.Red, 500);
|
|
||||||
sourceClock.Stop();
|
sourceClock.Stop();
|
||||||
|
|
||||||
Delay(500);
|
Delay(500);
|
||||||
Schedule(delegate
|
|
||||||
{
|
HasFailed = true;
|
||||||
ValidForResume = false;
|
failOverlay.Retries = RestartCount;
|
||||||
Push(new FailDialog());
|
failOverlay.Show();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnEntering(Screen last)
|
protected override void OnEntering(Screen last)
|
||||||
@ -275,7 +273,8 @@ namespace osu.Game.Screens.Play
|
|||||||
Background?.FadeTo((100f - dimLevel) / 100, 1500, EasingTypes.OutQuint);
|
Background?.FadeTo((100f - dimLevel) / 100, 1500, EasingTypes.OutQuint);
|
||||||
|
|
||||||
Content.Alpha = 0;
|
Content.Alpha = 0;
|
||||||
dimLevel.ValueChanged += dimChanged;
|
|
||||||
|
dimLevel.ValueChanged += newDim => Background?.FadeTo((100f - newDim) / 100, 800);
|
||||||
|
|
||||||
Content.ScaleTo(0.7f);
|
Content.ScaleTo(0.7f);
|
||||||
|
|
||||||
@ -304,7 +303,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
if (pauseOverlay == null) return false;
|
if (pauseOverlay == null) return false;
|
||||||
|
|
||||||
if (hasReplayLoaded)
|
if (HitRenderer.HasReplayLoaded)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (pauseOverlay.State != Visibility.Visible && !canPause) return true;
|
if (pauseOverlay.State != Visibility.Visible && !canPause) return true;
|
||||||
@ -318,18 +317,11 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
FadeOut(250);
|
FadeOut(250);
|
||||||
Content.ScaleTo(0.7f, 750, EasingTypes.InQuint);
|
Content.ScaleTo(0.7f, 750, EasingTypes.InQuint);
|
||||||
|
|
||||||
dimLevel.ValueChanged -= dimChanged;
|
|
||||||
Background?.FadeTo(1f, 200);
|
Background?.FadeTo(1f, 200);
|
||||||
return base.OnExiting(next);
|
return base.OnExiting(next);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dimChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Background?.FadeTo((100f - dimLevel) / 100, 800);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Bindable<bool> mouseWheelDisabled;
|
private Bindable<bool> mouseWheelDisabled;
|
||||||
|
|
||||||
protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused;
|
protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused;
|
||||||
|
@ -179,11 +179,11 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public void Filter(FilterCriteria newCriteria = null, bool debounce = true)
|
public void Filter(FilterCriteria newCriteria = null, bool debounce = true)
|
||||||
{
|
{
|
||||||
if (!IsLoaded) return;
|
|
||||||
|
|
||||||
if (newCriteria != null)
|
if (newCriteria != null)
|
||||||
criteria = newCriteria;
|
criteria = newCriteria;
|
||||||
|
|
||||||
|
if (!IsLoaded) return;
|
||||||
|
|
||||||
Action perform = delegate
|
Action perform = delegate
|
||||||
{
|
{
|
||||||
filterTask = null;
|
filterTask = null;
|
||||||
|
@ -61,10 +61,10 @@ namespace osu.Game.Screens.Select
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
tabs.ItemChanged += (sender, e) => invokeOnFilter();
|
tabs.SelectedItem.ValueChanged += item => invokeOnFilter();
|
||||||
modsCheckbox.Action += (sender, e) => invokeOnFilter();
|
modsCheckbox.Action += (sender, e) => invokeOnFilter();
|
||||||
|
|
||||||
tabs.SelectedItem = BeatmapDetailTab.Global;
|
tabs.SelectedItem.Value = BeatmapDetailTab.Global;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,8 +151,8 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
groupTabs.PinItem(GroupMode.All);
|
groupTabs.PinItem(GroupMode.All);
|
||||||
groupTabs.PinItem(GroupMode.RecentlyPlayed);
|
groupTabs.PinItem(GroupMode.RecentlyPlayed);
|
||||||
groupTabs.ItemChanged += (sender, value) => Group = value;
|
groupTabs.SelectedItem.ValueChanged += val => Group = val;
|
||||||
sortTabs.ItemChanged += (sender, value) => Sort = value;
|
sortTabs.SelectedItem.ValueChanged += val => Sort = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Deactivate()
|
public void Deactivate()
|
||||||
@ -173,9 +173,9 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
sortTabs.AccentColour = colours.GreenLight;
|
sortTabs.AccentColour = colours.GreenLight;
|
||||||
|
|
||||||
if (osu != null)
|
if (osu != null) playMode.BindTo(osu.PlayMode);
|
||||||
playMode.BindTo(osu.PlayMode);
|
playMode.ValueChanged += val => FilterChanged?.Invoke(CreateCriteria());
|
||||||
playMode.ValueChanged += (s, e) => FilterChanged?.Invoke(CreateCriteria());
|
playMode.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
||||||
|
@ -157,6 +157,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
})
|
})
|
||||||
{
|
{
|
||||||
TimeBeforeLoad = 500,
|
TimeBeforeLoad = 500,
|
||||||
|
RelativeSizeAxes = Axes.None,
|
||||||
Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2),
|
Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2),
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// 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;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
@ -168,13 +167,12 @@ namespace osu.Game.Screens.Select
|
|||||||
BeatmapOptions.AddButton(@"Delete", @"Beatmap", FontAwesome.fa_trash, colours.Pink, promptDelete, Key.Number4, float.MaxValue);
|
BeatmapOptions.AddButton(@"Delete", @"Beatmap", FontAwesome.fa_trash, colours.Pink, promptDelete, Key.Number4, float.MaxValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (osu != null)
|
|
||||||
playMode.BindTo(osu.PlayMode);
|
|
||||||
playMode.ValueChanged += playMode_ValueChanged;
|
|
||||||
|
|
||||||
if (database == null)
|
if (database == null)
|
||||||
database = beatmaps;
|
database = beatmaps;
|
||||||
|
|
||||||
|
playMode.ValueChanged += val => { if (Beatmap != null) Beatmap.PreferredPlayMode = val; };
|
||||||
|
if (osu != null) playMode.BindTo(osu.PlayMode);
|
||||||
|
|
||||||
database.BeatmapSetAdded += onBeatmapSetAdded;
|
database.BeatmapSetAdded += onBeatmapSetAdded;
|
||||||
database.BeatmapSetRemoved += onBeatmapSetRemoved;
|
database.BeatmapSetRemoved += onBeatmapSetRemoved;
|
||||||
|
|
||||||
@ -276,8 +274,6 @@ namespace osu.Game.Screens.Select
|
|||||||
initialAddSetsTask.Cancel();
|
initialAddSetsTask.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void playMode_ValueChanged(object sender, EventArgs e) => Beatmap.PreferredPlayMode = playMode;
|
|
||||||
|
|
||||||
private void changeBackground(WorkingBeatmap beatmap)
|
private void changeBackground(WorkingBeatmap beatmap)
|
||||||
{
|
{
|
||||||
var backgroundModeBeatmap = Background as BackgroundScreenBeatmap;
|
var backgroundModeBeatmap = Background as BackgroundScreenBeatmap;
|
||||||
|
@ -192,8 +192,11 @@
|
|||||||
<Compile Include="Screens\Multiplayer\Lobby.cs" />
|
<Compile Include="Screens\Multiplayer\Lobby.cs" />
|
||||||
<Compile Include="Screens\Multiplayer\Match.cs" />
|
<Compile Include="Screens\Multiplayer\Match.cs" />
|
||||||
<Compile Include="Screens\Multiplayer\MatchCreate.cs" />
|
<Compile Include="Screens\Multiplayer\MatchCreate.cs" />
|
||||||
<Compile Include="Screens\Play\FailDialog.cs" />
|
<Compile Include="Screens\Play\FailOverlay.cs" />
|
||||||
|
<Compile Include="Screens\Play\MenuOverlay.cs" />
|
||||||
<Compile Include="Screens\Play\KeyConversionInputManager.cs" />
|
<Compile Include="Screens\Play\KeyConversionInputManager.cs" />
|
||||||
|
<Compile Include="Screens\Play\PauseOverlay.cs" />
|
||||||
|
<Compile Include="Screens\Play\Pause\PauseButton.cs" />
|
||||||
<Compile Include="Screens\Play\PlayerInputManager.cs" />
|
<Compile Include="Screens\Play\PlayerInputManager.cs" />
|
||||||
<Compile Include="Screens\Play\PlayerLoader.cs" />
|
<Compile Include="Screens\Play\PlayerLoader.cs" />
|
||||||
<Compile Include="Screens\Play\ReplayPlayer.cs" />
|
<Compile Include="Screens\Play\ReplayPlayer.cs" />
|
||||||
@ -330,12 +333,8 @@
|
|||||||
<Compile Include="Screens\Select\SearchTextBox.cs" />
|
<Compile Include="Screens\Select\SearchTextBox.cs" />
|
||||||
<Compile Include="Screens\Select\FooterButton.cs" />
|
<Compile Include="Screens\Select\FooterButton.cs" />
|
||||||
<Compile Include="Screens\Select\Footer.cs" />
|
<Compile Include="Screens\Select\Footer.cs" />
|
||||||
<Compile Include="Screens\Play\PauseOverlay.cs" />
|
|
||||||
<Compile Include="Screens\Play\Pause\PauseProgressBar.cs" />
|
<Compile Include="Screens\Play\Pause\PauseProgressBar.cs" />
|
||||||
<Compile Include="Screens\Play\Pause\PauseProgressGraph.cs" />
|
<Compile Include="Screens\Play\Pause\PauseProgressGraph.cs" />
|
||||||
<Compile Include="Screens\Play\Pause\ResumeButton.cs" />
|
|
||||||
<Compile Include="Screens\Play\Pause\RetryButton.cs" />
|
|
||||||
<Compile Include="Screens\Play\Pause\QuitButton.cs" />
|
|
||||||
<Compile Include="Overlays\Mods\ModSelectOverlay.cs" />
|
<Compile Include="Overlays\Mods\ModSelectOverlay.cs" />
|
||||||
<Compile Include="Modes\Mods\Mod.cs" />
|
<Compile Include="Modes\Mods\Mod.cs" />
|
||||||
<Compile Include="Overlays\Mods\ModButton.cs" />
|
<Compile Include="Overlays\Mods\ModButton.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user