1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 21:07:33 +08:00

Merge branch 'master' into fix-opentk-hint

This commit is contained in:
Dean Herbert 2017-03-31 08:44:20 +09:00 committed by GitHub
commit 6e88e30442
135 changed files with 1117 additions and 533 deletions

@ -1 +1 @@
Subproject commit 51737ec1320b4ea9dce4978f24e1d77a28f0a98e
Subproject commit 269a1fd192c573d558a5ab0ff990a8b462947287

@ -1 +1 @@
Subproject commit 2d8a6c1699ff1acd3915fc28e8906dabf1b145a3
Subproject commit 12bbab717d372dadbd3220d38da862276ac97e98

View File

@ -3,7 +3,7 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Game;
namespace osu.Desktop.VisualTests

View File

@ -3,7 +3,7 @@
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Game.Screens.Select;
namespace osu.Desktop.VisualTests.Tests

View File

@ -3,7 +3,7 @@
using OpenTK.Graphics;
using OpenTK.Input;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Game.Graphics;
using osu.Game.Screens.Select.Options;

View File

@ -1,7 +1,7 @@
// 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.Testing;
using osu.Framework.Testing;
using osu.Framework.Graphics.Containers;
using osu.Framework.Threading;
using osu.Game.Overlays;

View File

@ -1,7 +1,7 @@
// 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.Testing;
using osu.Framework.Testing;
using osu.Game.Graphics;
using osu.Game.Overlays;
using osu.Game.Overlays.Dialog;

View File

@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Game.Screens.Tournament;
using osu.Game.Screens.Tournament.Teams;
using osu.Game.Users;

View File

@ -5,7 +5,7 @@ using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.MathUtils;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Database;

View File

@ -8,7 +8,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Framework.Timing;
using osu.Game.Modes.Objects;
using osu.Game.Modes.Objects.Drawables;

View File

@ -1,7 +1,7 @@
// 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.Testing;
using osu.Framework.Testing;
using osu.Framework.Graphics;
using OpenTK.Input;
using osu.Framework.Graphics.UserInterface;
@ -10,7 +10,6 @@ using OpenTK;
using OpenTK.Graphics;
using osu.Framework.MathUtils;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Screens.Play;
namespace osu.Desktop.VisualTests.Tests

View File

@ -3,7 +3,7 @@
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Game.Modes.Mods;
using osu.Game.Modes.Osu.Mods;
using osu.Game.Modes.Scoring;

View File

@ -1,7 +1,7 @@
// 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.Testing;
using osu.Framework.Testing;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Sprites;
using osu.Game.Screens.Menu;

View File

@ -3,7 +3,7 @@
using osu.Framework.Graphics;
using osu.Game.Overlays.Mods;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Game.Modes;
namespace osu.Desktop.VisualTests.Tests

View File

@ -1,7 +1,7 @@
// 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.Testing;
using osu.Framework.Testing;
using osu.Framework.Graphics;
using osu.Framework.Timing;
using osu.Game.Overlays;

View File

@ -3,7 +3,7 @@
using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Framework.MathUtils;
using osu.Game.Overlays;
using System.Linq;

View File

@ -1,7 +1,7 @@
// 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.Testing;
using osu.Framework.Testing;
using osu.Game.Overlays;
namespace osu.Desktop.VisualTests.Tests

View File

@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Logging;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Game.Screens.Play;
namespace osu.Desktop.VisualTests.Tests

View File

@ -3,7 +3,7 @@
using System.Collections.Generic;
using osu.Desktop.VisualTests.Platform;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Framework.MathUtils;
using osu.Game.Database;
using osu.Game.Modes;

View File

@ -4,7 +4,7 @@
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using OpenTK;
using osu.Framework.Graphics.Sprites;

View File

@ -6,7 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.MathUtils;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Game.Graphics.UserInterface;
using osu.Game.Modes.UI;

View File

@ -3,7 +3,7 @@
using OpenTK;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Select.Filter;

View File

@ -6,10 +6,8 @@ using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Game.Graphics;
using osu.Game.Modes.Taiko.Objects;
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
namespace osu.Desktop.VisualTests.Tests
@ -30,39 +28,55 @@ namespace osu.Desktop.VisualTests.Tests
Reset();
});
Add(new CentreHitCircle(new CirclePiece()
Add(new CirclePiece
{
KiaiMode = kiai
})
{
Position = new Vector2(100, 100)
Position = new Vector2(100, 100),
Width = 0,
AccentColour = Color4.DarkRed,
KiaiMode = kiai,
Children = new[]
{
new CentreHitSymbolPiece()
}
});
Add(new CentreHitCircle(new AccentedCirclePiece()
Add(new StrongCirclePiece
{
KiaiMode = kiai
})
{
Position = new Vector2(350, 100)
Position = new Vector2(350, 100),
Width = 0,
AccentColour = Color4.DarkRed,
KiaiMode = kiai,
Children = new[]
{
new CentreHitSymbolPiece()
}
});
Add(new RimHitCircle(new CirclePiece()
Add(new CirclePiece
{
KiaiMode = kiai
})
{
Position = new Vector2(100, 300)
Position = new Vector2(100, 300),
Width = 0,
AccentColour = Color4.DarkBlue,
KiaiMode = kiai,
Children = new[]
{
new RimHitSymbolPiece()
}
});
Add(new RimHitCircle(new AccentedCirclePiece()
Add(new StrongCirclePiece
{
KiaiMode = kiai
})
{
Position = new Vector2(350, 300)
Position = new Vector2(350, 300),
Width = 0,
AccentColour = Color4.DarkBlue,
KiaiMode = kiai,
Children = new[]
{
new RimHitSymbolPiece()
}
});
Add(new SwellCircle(new CirclePiece()
Add(new SwellCircle(new CirclePiece
{
KiaiMode = kiai
})
@ -70,7 +84,7 @@ namespace osu.Desktop.VisualTests.Tests
Position = new Vector2(100, 500)
});
Add(new SwellCircle(new AccentedCirclePiece()
Add(new SwellCircle(new StrongCirclePiece
{
KiaiMode = kiai
})
@ -78,7 +92,7 @@ namespace osu.Desktop.VisualTests.Tests
Position = new Vector2(350, 500)
});
Add(new DrumRollCircle(new CirclePiece()
Add(new DrumRollCircle(new CirclePiece
{
KiaiMode = kiai
})
@ -87,7 +101,7 @@ namespace osu.Desktop.VisualTests.Tests
Position = new Vector2(575, 100)
});
Add(new DrumRollCircle(new AccentedCirclePiece()
Add(new DrumRollCircle(new StrongCirclePiece
{
KiaiMode = kiai
})
@ -99,8 +113,6 @@ namespace osu.Desktop.VisualTests.Tests
private class SwellCircle : BaseCircle
{
private const float symbol_size = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.35f;
public SwellCircle(CirclePiece piece)
: base(piece)
{
@ -108,7 +120,8 @@ namespace osu.Desktop.VisualTests.Tests
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
TextSize = symbol_size,
TextSize = CirclePiece.SYMBOL_INNER_SIZE,
Icon = FontAwesome.fa_asterisk,
Shadow = false
});
}
@ -134,70 +147,6 @@ namespace osu.Desktop.VisualTests.Tests
}
}
private class CentreHitCircle : BaseCircle
{
private const float symbol_size = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.35f;
public CentreHitCircle(CirclePiece piece)
: base(piece)
{
Piece.Add(new CircularContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(symbol_size),
Masking = true,
Children = new[]
{
new Box
{
RelativeSizeAxes = Axes.Both
}
}
});
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Piece.AccentColour = colours.PinkDarker;
}
}
private class RimHitCircle : BaseCircle
{
private const float symbol_size = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f;
public RimHitCircle(CirclePiece piece)
: base(piece)
{
Piece.Add(new CircularContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(symbol_size),
BorderThickness = 8,
BorderColour = Color4.White,
Masking = true,
Children = new[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true
}
}
});
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Piece.AccentColour = colours.BlueDarker;
}
}
private abstract class BaseCircle : Container
{
protected readonly CirclePiece Piece;

View File

@ -1,11 +1,15 @@
// 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.Primitives;
using osu.Framework.MathUtils;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Taiko.Judgements;
using osu.Game.Modes.Taiko.Objects;
using osu.Game.Modes.Taiko.Objects.Drawable;
using osu.Game.Modes.Taiko.UI;
namespace osu.Desktop.VisualTests.Tests
@ -22,10 +26,20 @@ namespace osu.Desktop.VisualTests.Tests
AddButton("Hit!", addHitJudgement);
AddButton("Miss :(", addMissJudgement);
AddButton("Centre", () => addCentreHit(false));
AddButton("Strong Centre", () => addCentreHit(true));
AddButton("Rim", () => addRimHit(false));
AddButton("Strong Rim", () => addRimHit(true));
Add(playfield = new TaikoPlayfield
Add(new Container
{
Y = 200
RelativeSizeAxes = Axes.X,
Y = 200,
Padding = new MarginPadding { Left = 200 },
Children = new[]
{
playfield = new TaikoPlayfield()
}
});
}
@ -60,6 +74,34 @@ namespace osu.Desktop.VisualTests.Tests
});
}
private void addCentreHit(bool strong)
{
Hit h = new Hit
{
StartTime = Time.Current + 1000,
PreEmpt = 1000
};
if (strong)
playfield.Add(new DrawableStrongCentreHit(h));
else
playfield.Add(new DrawableCentreHit(h));
}
private void addRimHit(bool strong)
{
Hit h = new Hit
{
StartTime = Time.Current + 1000,
PreEmpt = 1000
};
if (strong)
playfield.Add(new DrawableStrongRimHit(h));
else
playfield.Add(new DrawableRimHit(h));
}
private class DrawableTestHit : DrawableHitObject<TaikoHitObject, TaikoJudgement>
{
public DrawableTestHit(TaikoHitObject hitObject)

View File

@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.MathUtils;

View File

@ -1,7 +1,7 @@
// 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.Testing;
using osu.Framework.Testing;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Play;

View File

@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Platform;
using osu.Framework.Screens.Testing;
using osu.Framework.Testing;
using osu.Game;
using osu.Game.Screens.Backgrounds;
@ -24,6 +24,11 @@ namespace osu.Desktop.VisualTests
public override void SetHost(GameHost host)
{
base.SetHost(host);
host.UpdateThread.InactiveHz = host.UpdateThread.ActiveHz;
host.DrawThread.InactiveHz = host.DrawThread.ActiveHz;
host.InputThread.InactiveHz = host.InputThread.ActiveHz;
host.Window.CursorState = CursorState.Hidden;
}
}

View File

@ -150,6 +150,10 @@
<Project>{65dc628f-a640-4111-ab35-3a5652bc1e17}</Project>
<Name>osu.Framework.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\osu-framework\osu.Framework.Testing\osu.Framework.Testing.csproj">
<Project>{007b2356-ab6f-4bd9-96d5-116fc2dce69a}</Project>
<Name>osu.Framework.Testing</Name>
</ProjectReference>
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj">
<Project>{c76bf5b3-985e-4d39-95fe-97c9c879b83a}</Project>
<Name>osu.Framework</Name>
@ -212,9 +216,7 @@
</ItemGroup>
<ItemGroup />
<ItemGroup />
<ItemGroup>
<Folder Include="Beatmaps\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -7,7 +7,6 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
namespace osu.Game.Modes.Osu.Objects.Drawables.Connections
{

View File

@ -3,7 +3,6 @@
using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Osu.Objects.Drawables.Pieces;
using OpenTK;

View File

@ -1,7 +1,7 @@
// 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.Transforms;
using osu.Framework.Graphics;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Osu.Judgements;
using OpenTK;

View File

@ -7,7 +7,6 @@ using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Beatmaps.Samples;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Osu.Judgements;

View File

@ -4,7 +4,6 @@
using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Osu.Objects.Drawables.Pieces;

View File

@ -4,7 +4,6 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using OpenTK.Graphics;

View File

@ -2,7 +2,6 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
using osu.Game.Beatmaps;
using osu.Game.Modes.Osu.Objects;
@ -10,6 +9,7 @@ using osu.Game.Modes.Osu.Objects.Drawables;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using osu.Framework.Graphics;
using osu.Game.Modes.Objects.Types;
namespace osu.Game.Modes.Osu
@ -29,7 +29,7 @@ namespace osu.Game.Modes.Osu
createAutoReplay();
}
internal class LegacyReplayFrameComparer : IComparer<LegacyReplayFrame>
private class LegacyReplayFrameComparer : IComparer<LegacyReplayFrame>
{
public int Compare(LegacyReplayFrame f1, LegacyReplayFrame f2)
{

View File

@ -44,7 +44,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps
IHasRepeats repeatsData = original as IHasRepeats;
IHasEndTime endTimeData = original as IHasEndTime;
bool accented = ((original.Sample?.Type ?? SampleType.None) & SampleType.Finish) > 0;
bool strong = ((original.Sample?.Type ?? SampleType.None) & SampleType.Finish) > 0;
if (distanceData != null)
{
@ -52,7 +52,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps
{
StartTime = original.StartTime,
Sample = original.Sample,
Accented = accented,
IsStrong = strong,
Distance = distanceData.Distance * (repeatsData?.RepeatCount ?? 1)
};
@ -61,11 +61,11 @@ namespace osu.Game.Modes.Taiko.Beatmaps
if (endTimeData != null)
{
// We compute the end time manually to add in the Bash convert factor
return new Bash
return new Swell
{
StartTime = original.StartTime,
Sample = original.Sample,
Accented = accented,
IsStrong = strong,
EndTime = original.StartTime + endTimeData.Duration * bash_convert_factor
};
@ -75,7 +75,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps
{
StartTime = original.StartTime,
Sample = original.Sample,
Accented = accented
IsStrong = strong
};
}
}

View File

@ -0,0 +1,35 @@
// 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.Objects.Drawable.Pieces;
using osu.Game.Graphics;
using osu.Framework.Allocation;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
public class DrawableCentreHit : DrawableHit
{
protected override Key[] HitKeys { get; } = { Key.F, Key.J };
private readonly CirclePiece circlePiece;
public DrawableCentreHit(Hit hit)
: base(hit)
{
Add(circlePiece = new CirclePiece
{
Children = new[]
{
new CentreHitSymbolPiece()
}
});
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
circlePiece.AccentColour = colours.PinkDarker;
}
}
}

View File

@ -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.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Taiko.Judgements;
using System.Linq;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
public class DrawableDrumRoll : DrawableTaikoHitObject
{
private readonly DrumRoll drumRoll;
public DrawableDrumRoll(DrumRoll drumRoll)
: base(drumRoll)
{
this.drumRoll = drumRoll;
int tickIndex = 0;
foreach (var tick in drumRoll.Ticks)
{
var newTick = new DrawableDrumRollTick(tick)
{
Depth = tickIndex,
X = (float)((tick.StartTime - HitObject.StartTime) / drumRoll.Duration)
};
AddNested(newTick);
tickIndex++;
}
}
protected override void UpdateState(ArmedState state)
{
}
protected override void CheckJudgement(bool userTriggered)
{
if (userTriggered)
return;
if (Judgement.TimeOffset < 0)
return;
int countHit = NestedHitObjects.Count(o => o.Judgement.Result == HitResult.Hit);
if (countHit > drumRoll.RequiredGoodHits)
{
Judgement.Result = HitResult.Hit;
Judgement.TaikoResult = countHit >= drumRoll.RequiredGreatHits ? TaikoHitResult.Great : TaikoHitResult.Good;
}
else
Judgement.Result = HitResult.Miss;
}
}
}

View File

@ -0,0 +1,53 @@
// 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;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
public class DrawableDrumRollTick : DrawableTaikoHitObject
{
private readonly DrumRollTick tick;
public DrawableDrumRollTick(DrumRollTick tick)
: base(tick)
{
this.tick = tick;
}
protected override TaikoJudgement CreateJudgement() => new TaikoDrumRollTickJudgement();
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)
{
}
protected override void UpdateScrollPosition(double time)
{
// Drum roll ticks shouldn't move
}
protected override bool HandleKeyPress(Key key)
{
return !Judgement.Result.HasValue && UpdateJudgement(true);
}
}
}

View File

@ -0,0 +1,104 @@
// 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.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Taiko.Judgements;
using System;
using System.Linq;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
public abstract class DrawableHit : DrawableTaikoHitObject
{
/// <summary>
/// A list of keys which can result in hits for this HitObject.
/// </summary>
protected abstract Key[] HitKeys { get; }
protected override Container<Framework.Graphics.Drawable> Content => bodyContainer;
private readonly Hit hit;
/// <summary>
/// Whether the last key pressed is a valid hit key.
/// </summary>
private bool validKeyPressed;
private readonly Container bodyContainer;
protected DrawableHit(Hit hit)
: base(hit)
{
this.hit = hit;
AddInternal(bodyContainer = new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
});
}
protected override void CheckJudgement(bool userTriggered)
{
if (!userTriggered)
{
if (Judgement.TimeOffset > hit.HitWindowGood)
Judgement.Result = HitResult.Miss;
return;
}
double hitOffset = Math.Abs(Judgement.TimeOffset);
if (hitOffset > hit.HitWindowMiss)
return;
if (!validKeyPressed)
Judgement.Result = HitResult.Miss;
else if (hitOffset < hit.HitWindowGood)
{
Judgement.Result = HitResult.Hit;
Judgement.TaikoResult = hitOffset < hit.HitWindowGreat ? TaikoHitResult.Great : TaikoHitResult.Good;
}
else
Judgement.Result = HitResult.Miss;
}
protected override bool HandleKeyPress(Key key)
{
if (Judgement.Result.HasValue)
return false;
validKeyPressed = HitKeys.Contains(key);
return UpdateJudgement(true);
}
protected override void UpdateState(ArmedState state)
{
Delay(HitObject.StartTime - Time.Current + Judgement.TimeOffset, true);
switch (State)
{
case ArmedState.Idle:
Delay(hit.HitWindowMiss);
break;
case ArmedState.Miss:
FadeOut(100);
break;
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);
break;
}
Expire();
}
}
}

View File

@ -0,0 +1,35 @@
// 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.Game.Graphics;
using OpenTK.Input;
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
public class DrawableRimHit : DrawableHit
{
protected override Key[] HitKeys { get; } = { Key.D, Key.K };
private readonly CirclePiece circlePiece;
public DrawableRimHit(Hit hit)
: base(hit)
{
Add(circlePiece = new CirclePiece
{
Children = new[]
{
new RimHitSymbolPiece()
}
});
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
circlePiece.AccentColour = colours.BlueDarker;
}
}
}

View File

@ -0,0 +1,35 @@
// 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.Objects.Drawable.Pieces;
using osu.Framework.Allocation;
using osu.Game.Graphics;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
public class DrawableStrongCentreHit : DrawableStrongHit
{
protected override Key[] HitKeys { get; } = { Key.F, Key.J };
private readonly CirclePiece circlePiece;
public DrawableStrongCentreHit(Hit hit)
: base(hit)
{
Add(circlePiece = new StrongCirclePiece
{
Children = new []
{
new CentreHitSymbolPiece()
}
});
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
circlePiece.AccentColour = colours.PinkDarker;
}
}
}

View File

@ -0,0 +1,85 @@
// 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 System;
using System.Linq;
using osu.Framework.Input;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
public abstract class DrawableStrongHit : DrawableHit
{
/// <summary>
/// The lenience for the second key press.
/// This does not adjust by map difficulty in ScoreV2 yet.
/// </summary>
private const double second_hit_window = 30;
private double firstHitTime;
private bool firstKeyHeld;
private Key firstHitKey;
protected DrawableStrongHit(Hit hit)
: base(hit)
{
}
protected override void CheckJudgement(bool userTriggered)
{
if (!Judgement.Result.HasValue)
{
base.CheckJudgement(userTriggered);
return;
}
if (!userTriggered)
return;
// If we get here, we're assured that the key pressed is the correct secondary key
if (Math.Abs(firstHitTime - Time.Current) < second_hit_window)
Judgement.SecondHit = true;
}
protected override bool HandleKeyPress(Key key)
{
// Check if we've handled the first key
if (!Judgement.Result.HasValue)
{
// First key hasn't been handled yet, attempt to handle it
bool handled = base.HandleKeyPress(key);
if (handled)
{
firstHitTime = Time.Current;
firstHitKey = key;
}
return handled;
}
// If we've already hit the second key, don't handle this object any further
if (Judgement.SecondHit)
return false;
// Don't handle represses of the first key
if (firstHitKey == key)
return false;
// Don't handle invalid hit key presses
if (!HitKeys.Contains(key))
return false;
// Assume the intention was to hit the strong hit with both keys only if the first key is still being held down
return firstKeyHeld && UpdateJudgement(true);
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
firstKeyHeld = state.Keyboard.Keys.Contains(firstHitKey);
return base.OnKeyDown(state, args);
}
}
}

View File

@ -0,0 +1,35 @@
// 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.Game.Graphics;
using OpenTK.Input;
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
public class DrawableStrongRimHit : DrawableStrongHit
{
protected override Key[] HitKeys { get; } = { Key.D, Key.K };
private readonly CirclePiece circlePiece;
public DrawableStrongRimHit(Hit hit)
: base(hit)
{
Add(circlePiece = new StrongCirclePiece
{
Children = new[]
{
new RimHitSymbolPiece()
}
});
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
circlePiece.AccentColour = colours.BlueDarker;
}
}
}

View File

@ -0,0 +1,75 @@
// 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.Objects.Drawables;
using osu.Game.Modes.Taiko.Judgements;
using System;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
public class DrawableSwell : DrawableTaikoHitObject
{
/// <summary>
/// The amount of times the user has hit this swell.
/// </summary>
private int userHits;
private readonly Swell swell;
public DrawableSwell(Swell swell)
: base(swell)
{
this.swell = swell;
}
protected override void CheckJudgement(bool userTriggered)
{
if (userTriggered)
{
if (Time.Current < HitObject.StartTime)
return;
userHits++;
if (userHits == swell.RequiredHits)
{
Judgement.Result = HitResult.Hit;
Judgement.TaikoResult = TaikoHitResult.Great;
}
}
else
{
if (Judgement.TimeOffset < 0)
return;
if (userHits > swell.RequiredHits / 2)
{
Judgement.Result = HitResult.Hit;
Judgement.TaikoResult = TaikoHitResult.Good;
}
else
Judgement.Result = HitResult.Miss;
}
}
protected override void UpdateState(ArmedState state)
{
}
protected override void UpdateScrollPosition(double time)
{
base.UpdateScrollPosition(Math.Min(time, HitObject.StartTime));
}
protected override bool HandleKeyPress(Key key)
{
if (Judgement.Result.HasValue)
return false;
UpdateJudgement(true);
return true;
}
}
}

View File

@ -1,15 +1,23 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Input;
using osu.Framework.Graphics;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Taiko.Judgements;
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
using System.Collections.Generic;
using osu.Framework.Input;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
public abstract class DrawableTaikoHitObject : DrawableHitObject<TaikoHitObject, TaikoJudgement>
{
/// <summary>
/// A list of keys which this hit object will accept. These are the standard Taiko keys for now.
/// These should be moved to bindings later.
/// </summary>
private readonly List<Key> validKeys = new List<Key>(new[] { Key.D, Key.F, Key.J, Key.K });
protected DrawableTaikoHitObject(TaikoHitObject hitObject)
: base(hitObject)
{
@ -17,17 +25,11 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
Origin = Anchor.Centre;
RelativePositionAxes = Axes.X;
Children = new[]
{
CreateCircle()
};
}
protected override void LoadComplete()
{
LifetimeStart = HitObject.StartTime - HitObject.PreEmpt * 2;
LifetimeEnd = HitObject.StartTime + HitObject.PreEmpt;
base.LoadComplete();
}
@ -49,6 +51,20 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
UpdateScrollPosition(Time.Current);
}
protected abstract CirclePiece CreateCircle();
protected virtual bool HandleKeyPress(Key key) => false;
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
// Make sure we don't handle held-down keys
if (args.Repeat)
return false;
// Check if we've pressed a valid taiko key
if (!validKeys.Contains(args.Key))
return false;
// Handle it!
return HandleKeyPress(args.Key);
}
}
}

View File

@ -0,0 +1,31 @@
// 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.Graphics;
using osu.Framework.Graphics.Sprites;
using OpenTK;
namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
{
/// <summary>
/// The symbol used for centre hit pieces.
/// </summary>
public class CentreHitSymbolPiece : CircularContainer
{
public CentreHitSymbolPiece()
{
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Size = new Vector2(CirclePiece.SYMBOL_INNER_SIZE);
Masking = true;
Children = new[]
{
new Box
{
RelativeSizeAxes = Axes.Both
}
};
}
}
}

View File

@ -20,6 +20,10 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
/// </summary>
public class CirclePiece : Container
{
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.

View File

@ -0,0 +1,36 @@
// 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.Graphics;
using osu.Framework.Graphics.Sprites;
using OpenTK;
using OpenTK.Graphics;
namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
{
/// <summary>
/// The symbol used for rim hit pieces.
/// </summary>
public class RimHitSymbolPiece : CircularContainer
{
public RimHitSymbolPiece()
{
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Size = new Vector2(CirclePiece.SYMBOL_SIZE);
BorderThickness = CirclePiece.SYMBOL_BORDER;
BorderColour = Color4.White;
Masking = true;
Children = new[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true
}
};
}
}
}

View File

@ -6,20 +6,20 @@ using OpenTK;
namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
{
/// <summary>
/// A type of circle piece which is drawn at a higher scale as an "accent".
/// A type of circle piece which is drawn at a higher scale to represent a "strong" piece.
/// </summary>
public class AccentedCirclePiece : CirclePiece
public class StrongCirclePiece : CirclePiece
{
/// <summary>
/// The amount to scale up the base circle to show it as an "accented" piece.
/// The amount to scale up the base circle to show it as a "strong" piece.
/// </summary>
private const float accent_scale = 1.5f;
private const float strong_scale = 1.5f;
public AccentedCirclePiece()
public StrongCirclePiece()
{
SymbolContainer.Scale = new Vector2(accent_scale);
SymbolContainer.Scale = new Vector2(strong_scale);
}
public override Vector2 Size => new Vector2(base.Size.X, base.Size.Y * accent_scale);
public override Vector2 Size => new Vector2(base.Size.X, base.Size.Y * strong_scale);
}
}

View File

@ -101,4 +101,4 @@ namespace osu.Game.Modes.Taiko.Objects
return ret;
}
}
}
}

View File

@ -15,5 +15,10 @@ namespace osu.Game.Modes.Taiko.Objects
/// <para>Half of this value is the hit window of the tick.</para>
/// </summary>
public double TickTimeDistance;
/// <summary>
/// The time allowed to hit this tick.
/// </summary>
public double HitWindow => TickTimeDistance / 2;
}
}

View File

@ -8,14 +8,14 @@ using osu.Game.Modes.Objects.Types;
namespace osu.Game.Modes.Taiko.Objects
{
public class Bash : TaikoHitObject, IHasEndTime
public class Swell : TaikoHitObject, IHasEndTime
{
public double EndTime { get; set; }
public double Duration => EndTime - StartTime;
/// <summary>
/// The number of hits required to complete the bash successfully.
/// The number of hits required to complete the swell successfully.
/// </summary>
public int RequiredHits { get; protected set; }

View File

@ -12,7 +12,7 @@ namespace osu.Game.Modes.Taiko.Objects
/// <summary>
/// HitCircle radius.
/// </summary>
public const float CIRCLE_RADIUS = 64;
public const float CIRCLE_RADIUS = 42f;
/// <summary>
/// The time to scroll in the HitObject.
@ -20,10 +20,10 @@ namespace osu.Game.Modes.Taiko.Objects
public double PreEmpt;
/// <summary>
/// Whether this HitObject is accented.
/// Accented hit objects give more points for hitting the hit object with both keys.
/// Whether this HitObject is a "strong" type.
/// Strong hit objects give more points for hitting the hit object with both keys.
/// </summary>
public bool Accented;
public bool IsStrong;
/// <summary>
/// Whether this HitObject is in Kiai time.

View File

@ -128,7 +128,7 @@ namespace osu.Game.Modes.Taiko.Scoring
hpIncreaseGood = hpMultiplierNormal * hp_hit_good;
hpIncreaseMiss = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.Difficulty.DrainRate, hp_miss_min, hp_miss_mid, hp_miss_max);
var accentedHits = beatmap.HitObjects.FindAll(o => o is Hit && o.Accented);
var accentedHits = beatmap.HitObjects.FindAll(o => o is Hit && o.IsStrong);
// This is a linear function that awards:
// 10 times bonus points for hitting an accented hit object with both keys with 30 accented hit objects in the map
@ -143,7 +143,7 @@ namespace osu.Game.Modes.Taiko.Scoring
{
Result = HitResult.Hit,
TaikoResult = TaikoHitResult.Great,
SecondHit = obj.Accented
SecondHit = obj.IsStrong
});
}
else if (obj is DrumRoll)
@ -154,7 +154,7 @@ namespace osu.Game.Modes.Taiko.Scoring
{
Result = HitResult.Hit,
TaikoResult = TaikoHitResult.Great,
SecondHit = obj.Accented
SecondHit = obj.IsStrong
});
}
@ -162,10 +162,10 @@ namespace osu.Game.Modes.Taiko.Scoring
{
Result = HitResult.Hit,
TaikoResult = TaikoHitResult.Great,
SecondHit = obj.Accented
SecondHit = obj.IsStrong
});
}
else if (obj is Bash)
else if (obj is Swell)
{
AddJudgement(new TaikoJudgement
{

View File

@ -7,7 +7,6 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics;
using osu.Game.Modes.Taiko.Judgements;
using osu.Game.Modes.Taiko.Objects;

View File

@ -18,7 +18,7 @@ namespace osu.Game.Modes.Taiko.UI
/// <summary>
/// Diameter of normal hit object circles.
/// </summary>
private const float normal_diameter = TaikoHitObject.CIRCLE_RADIUS * 2 * TaikoPlayfield.PLAYFIELD_SCALE;
private const float normal_diameter = TaikoHitObject.CIRCLE_RADIUS * 2;
/// <summary>
/// Diameter of finisher hit object circles.
@ -47,7 +47,7 @@ namespace osu.Game.Modes.Taiko.UI
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Y = border_offset,
Size = new Vector2(border_thickness, (TaikoPlayfield.PlayfieldHeight - finisher_diameter) / 2f - border_offset),
Size = new Vector2(border_thickness, (TaikoPlayfield.PLAYFIELD_HEIGHT - finisher_diameter) / 2f - border_offset),
Alpha = 0.1f
},
new CircularContainer
@ -96,7 +96,7 @@ namespace osu.Game.Modes.Taiko.UI
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
Y = -border_offset,
Size = new Vector2(border_thickness, (TaikoPlayfield.PlayfieldHeight - finisher_diameter) / 2f - border_offset),
Size = new Vector2(border_thickness, (TaikoPlayfield.PLAYFIELD_HEIGHT - finisher_diameter) / 2f - border_offset),
Alpha = 0.1f
},
};

View File

@ -9,7 +9,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using osu.Game.Graphics;
@ -22,7 +21,7 @@ namespace osu.Game.Modes.Taiko.UI
{
public InputDrum()
{
Size = new Vector2(TaikoPlayfield.PlayfieldHeight);
Size = new Vector2(TaikoPlayfield.PLAYFIELD_HEIGHT);
const float middle_split = 10;
@ -139,7 +138,7 @@ namespace osu.Game.Modes.Taiko.UI
{
target.FadeTo(Math.Min(target.Alpha + 0.4f, 1), 40, EasingTypes.OutQuint);
target.Delay(40);
target.FadeOut(600, EasingTypes.OutQuint);
target.FadeOut(1000, EasingTypes.OutQuint);
}
return false;

View File

@ -20,24 +20,15 @@ namespace osu.Game.Modes.Taiko.UI
public class TaikoPlayfield : Playfield<TaikoHitObject, TaikoJudgement>
{
/// <summary>
/// The default play field height.
/// The play field height. This is relative to the size of hit objects
/// such that the playfield is just a bit larger than finishers.
/// </summary>
public const float PLAYFIELD_BASE_HEIGHT = 242;
/// <summary>
/// The play field height scale.
/// </summary>
public const float PLAYFIELD_SCALE = 0.65f;
/// <summary>
/// The play field height after scaling.
/// </summary>
public static float PlayfieldHeight => PLAYFIELD_BASE_HEIGHT * PLAYFIELD_SCALE;
public const float PLAYFIELD_HEIGHT = TaikoHitObject.CIRCLE_RADIUS * 2 * 2;
/// <summary>
/// The offset from <see cref="left_area_size"/> which the center of the hit target lies at.
/// </summary>
private const float hit_target_offset = 80;
private const float hit_target_offset = TaikoHitObject.CIRCLE_RADIUS * 1.5f + 40;
/// <summary>
/// The size of the left area of the playfield. This area contains the input drum.
@ -60,7 +51,7 @@ namespace osu.Game.Modes.Taiko.UI
public TaikoPlayfield()
{
RelativeSizeAxes = Axes.X;
Height = PlayfieldHeight;
Height = PLAYFIELD_HEIGHT;
AddInternal(new Drawable[]
{
@ -101,7 +92,6 @@ namespace osu.Game.Modes.Taiko.UI
Anchor = Anchor.CentreLeft,
Origin = Anchor.Centre,
Size = new Vector2(TaikoHitObject.CIRCLE_RADIUS * 2),
Scale = new Vector2(PLAYFIELD_SCALE),
BlendingMode = BlendingMode.Additive
},
//barLineContainer = new Container<DrawableBarLine>
@ -128,7 +118,7 @@ namespace osu.Game.Modes.Taiko.UI
},
leftBackgroundContainer = new Container
{
Size = new Vector2(left_area_size, PlayfieldHeight),
Size = new Vector2(left_area_size, PLAYFIELD_HEIGHT),
BorderThickness = 1,
Children = new Drawable[]
{

View File

@ -52,15 +52,26 @@
<Compile Include="Judgements\TaikoDrumRollTickJudgement.cs" />
<Compile Include="Judgements\TaikoJudgement.cs" />
<Compile Include="Judgements\TaikoHitResult.cs" />
<Compile Include="Objects\Drawable\DrawableRimHit.cs" />
<Compile Include="Objects\Drawable\DrawableStrongRimHit.cs" />
<Compile Include="Objects\Drawable\DrawableCentreHit.cs" />
<Compile Include="Objects\Drawable\DrawableHit.cs" />
<Compile Include="Objects\Drawable\DrawableStrongCentreHit.cs" />
<Compile Include="Objects\Drawable\DrawableStrongHit.cs" />
<Compile Include="Objects\Drawable\Pieces\CentreHitSymbolPiece.cs" />
<Compile Include="Objects\Drawable\DrawableDrumRoll.cs" />
<Compile Include="Objects\Drawable\DrawableDrumRollTick.cs" />
<Compile Include="Objects\Drawable\DrawableSwell.cs" />
<Compile Include="Objects\Drawable\DrawableTaikoHitObject.cs" />
<Compile Include="Objects\Bash.cs" />
<Compile Include="Objects\Drawable\Pieces\AccentedCirclePiece.cs" />
<Compile Include="Objects\Drawable\Pieces\RimHitSymbolPiece.cs" />
<Compile Include="Objects\Drawable\Pieces\StrongCirclePiece.cs" />
<Compile Include="Objects\Drawable\Pieces\CirclePiece.cs" />
<Compile Include="Objects\DrumRoll.cs" />
<Compile Include="Objects\DrumRollTick.cs" />
<Compile Include="Objects\Hit.cs" />
<Compile Include="Objects\Drawable\Pieces\CirclePiece.cs" />
<Compile Include="TaikoDifficultyCalculator.cs" />
<Compile Include="Objects\Swell.cs" />
<Compile Include="Objects\TaikoHitObject.cs" />
<Compile Include="TaikoDifficultyCalculator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Scoring\TaikoScoreProcessor.cs" />
<Compile Include="UI\HitTarget.cs" />

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

View File

@ -33,12 +33,26 @@ namespace osu.Game.Beatmaps.Drawables
Children = new Drawable[]
{
new DelayedLoadContainer
{
RelativeSizeAxes = Axes.Both,
TimeBeforeLoad = 300,
FinishedLoading = d => d.FadeInFromZero(400, EasingTypes.Out),
Children = new[]
{
new PanelBackground(beatmap)
{
RelativeSizeAxes = Axes.Both,
Depth = 1,
}
}
},
new FillFlowContainer
{
Direction = FillDirection.Vertical,
Padding = new MarginPadding { Top = 5, Left = 18, Right = 10, Bottom = 10 },
AutoSizeAxes = Axes.Both,
Children = new[]
Children = new Drawable[]
{
title = new OsuSpriteText
{
@ -71,23 +85,13 @@ namespace osu.Game.Beatmaps.Drawables
}
[BackgroundDependencyLoader]
private void load(OsuConfigManager config, OsuGameBase game)
private void load(OsuConfigManager config)
{
this.config = config;
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
preferUnicode.ValueChanged += preferUnicode_changed;
preferUnicode_changed(preferUnicode, null);
new PanelBackground(beatmap)
{
RelativeSizeAxes = Axes.Both,
Depth = 1,
}.LoadAsync(game, b =>
{
Add(b);
b.FadeInFromZero(200);
});
}
private void preferUnicode_changed(object sender, EventArgs e)

View File

@ -4,7 +4,6 @@
using osu.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using OpenTK;
using OpenTK.Graphics;

View File

@ -101,7 +101,7 @@ namespace osu.Game.Database
using (var lzma = new LzmaStream(properties, replayInStream, compressedSize, outSize))
using (var reader = new StreamReader(lzma))
score.Replay = new LegacyReplay(reader);
score.Replay = score.CreateLegacyReplayFrom(reader);
}
}

View File

@ -6,7 +6,6 @@ using osu.Framework.Graphics;
using osu.Framework.Input;
using OpenTK;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Transforms;
using osu.Game.Configuration;
using osu.Framework.Configuration;

View File

@ -10,7 +10,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using osu.Game.Configuration;
using System;

View File

@ -12,7 +12,6 @@ using osu.Framework.Input;
using osu.Game.Configuration;
using System;
using osu.Framework.Graphics.Textures;
using osu.Framework.Graphics.Transforms;
namespace osu.Game.Graphics.Cursor
{
@ -20,9 +19,11 @@ namespace osu.Game.Graphics.Cursor
{
protected override Drawable CreateCursor() => new Cursor();
private bool dragging;
protected override bool OnMouseMove(InputState state)
{
if (state.Mouse.HasMainButtonPressed)
if (dragging)
{
Vector2 offset = state.Mouse.Position - state.Mouse.PositionMouseDown ?? state.Mouse.Delta;
float degrees = (float)MathHelper.RadiansToDegrees(Math.Atan2(-offset.X, offset.Y)) + 24.3f;
@ -39,6 +40,12 @@ namespace osu.Game.Graphics.Cursor
return base.OnMouseMove(state);
}
protected override bool OnDragStart(InputState state)
{
dragging = true;
return base.OnDragStart(state);
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{
ActiveCursor.Scale = new Vector2(1);
@ -53,6 +60,8 @@ namespace osu.Game.Graphics.Cursor
{
if (!state.Mouse.HasMainButtonPressed)
{
dragging = false;
((Cursor)ActiveCursor).AdditiveLayer.FadeOut(500, EasingTypes.OutQuint);
ActiveCursor.RotateTo(0, 600 * (1 + Math.Abs(ActiveCursor.Rotation / 720)), EasingTypes.OutElasticHalf);
ActiveCursor.ScaleTo(1, 500, EasingTypes.OutElastic);

View File

@ -4,7 +4,6 @@
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Containers;

View File

@ -8,7 +8,6 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Graphics.UserInterface;
namespace osu.Game.Graphics.UserInterface

View File

@ -6,7 +6,6 @@ using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics.Backgrounds;

View File

@ -6,7 +6,6 @@ using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Graphics.UserInterface;
namespace osu.Game.Graphics.UserInterface

View File

@ -4,7 +4,6 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using OpenTK;
using OpenTK.Graphics;

View File

@ -8,7 +8,6 @@ using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;

View File

@ -11,7 +11,6 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;

View File

@ -9,7 +9,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;

View File

@ -4,7 +4,6 @@
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
using System;

View File

@ -5,7 +5,6 @@ using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
using OpenTK;

View File

@ -7,7 +7,6 @@ using osu.Framework.Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Modes.Objects.Drawables;

View File

@ -46,13 +46,13 @@ namespace osu.Game.Modes
}
}
public override ReplayInputHandler GetInputHandler() => new LegacyReplayInputHandler(Frames);
public override ReplayInputHandler CreateInputHandler() => new LegacyReplayInputHandler(Frames);
/// <summary>
/// The ReplayHandler will take a replay and handle the propagation of updates to the input stack.
/// It handles logic of any frames which *must* be executed.
/// </summary>
public class LegacyReplayInputHandler : ReplayInputHandler
protected class LegacyReplayInputHandler : ReplayInputHandler
{
private readonly List<LegacyReplayFrame> replayContent;
@ -163,7 +163,7 @@ namespace osu.Game.Modes
return currentTime = time;
}
private class ReplayMouseState : MouseState
protected class ReplayMouseState : MouseState
{
public ReplayMouseState(Vector2 position, IEnumerable<MouseButton> list)
{
@ -172,7 +172,7 @@ namespace osu.Game.Modes
}
}
private class ReplayKeyboardState : KeyboardState
protected class ReplayKeyboardState : KeyboardState
{
public ReplayKeyboardState(List<Key> keys)
{
@ -182,7 +182,7 @@ namespace osu.Game.Modes
}
[Flags]
public enum LegacyButtonState
protected enum LegacyButtonState
{
None = 0,
Left1 = 1,
@ -192,7 +192,7 @@ namespace osu.Game.Modes
Smoke = 16
}
public class LegacyReplayFrame
protected class LegacyReplayFrame
{
public Vector2 Position => new Vector2(MouseX, MouseY);

View File

@ -157,7 +157,7 @@ namespace osu.Game.Modes.Mods
public void Apply(HitRenderer<T> hitRenderer)
{
hitRenderer.InputManager.ReplayInputHandler = CreateReplayScore(hitRenderer.Beatmap)?.Replay?.GetInputHandler();
hitRenderer.InputManager.ReplayInputHandler = CreateReplayScore(hitRenderer.Beatmap)?.Replay?.CreateInputHandler();
}
}

View File

@ -7,6 +7,6 @@ namespace osu.Game.Modes
{
public abstract class Replay
{
public virtual ReplayInputHandler GetInputHandler() => null;
public virtual ReplayInputHandler CreateInputHandler() => null;
}
}

View File

@ -6,6 +6,7 @@ using Newtonsoft.Json;
using osu.Game.Database;
using osu.Game.Modes.Mods;
using osu.Game.Users;
using System.IO;
namespace osu.Game.Modes.Scoring
{
@ -43,6 +44,13 @@ namespace osu.Game.Modes.Scoring
[JsonProperty(@"date")]
public DateTime Date;
/// <summary>
/// Creates a legacy replay which is read from a stream.
/// </summary>
/// <param name="reader">The stream reader.</param>
/// <returns>The replay.</returns>
public virtual Replay CreateLegacyReplayFrom(StreamReader reader) => new LegacyReplay(reader);
// [JsonProperty(@"count50")] 0,
//[JsonProperty(@"count100")] 0,
//[JsonProperty(@"count300")] 100,

View File

@ -152,6 +152,8 @@ namespace osu.Game.Modes.Scoring
protected override void Reset()
{
base.Reset();
Judgements.Clear();
}

View File

@ -8,7 +8,6 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics;
namespace osu.Game.Modes.UI

View File

@ -12,6 +12,7 @@ using osu.Framework.Configuration;
using osu.Framework.Logging;
using osu.Framework.Threading;
using osu.Game.Online.API.Requests;
using osu.Game.Users;
namespace osu.Game.Online.API
{
@ -118,7 +119,7 @@ namespace osu.Game.Online.API
//todo: this fails even on network-related issues. we should probably handle those differently.
//NotificationManager.ShowMessage("Login failed!");
log.Add(@"Login failed!");
clearCredentials();
Password = null;
continue;
}

View File

@ -1,6 +1,8 @@
// 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.Users;
namespace osu.Game.Online.API.Requests
{
public class GetUserRequest : APIRequest<User>

View File

@ -91,7 +91,7 @@ namespace osu.Game.Online.Chat.Drawables
new OsuSpriteText
{
Font = @"Exo2.0-BoldItalic",
Text = $@"{Message.User.Name}:",
Text = $@"{Message.User.Username}:",
Colour = getUsernameColour(Message),
TextSize = text_size,
Origin = Anchor.TopRight,

View File

@ -3,6 +3,7 @@
using System;
using Newtonsoft.Json;
using osu.Game.Users;
namespace osu.Game.Online.Chat
{

View File

@ -1,19 +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 Newtonsoft.Json;
namespace osu.Game.Online
{
public class User
{
[JsonProperty(@"username")]
public string Name;
[JsonProperty(@"id")]
public int Id;
[JsonProperty(@"colour")]
public string Colour;
}
}

View File

@ -14,7 +14,6 @@ using OpenTK.Input;
using osu.Framework.Logging;
using osu.Game.Graphics.UserInterface.Volume;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Timing;
using osu.Game.Modes;
using osu.Game.Overlays.Toolbar;
@ -126,7 +125,7 @@ namespace osu.Game
Beatmap.Value = BeatmapDatabase.GetWorkingBeatmap(s.Beatmap);
menu.Push(new PlayerLoader(new Player { ReplayInputHandler = s.Replay.GetInputHandler() }));
menu.Push(new PlayerLoader(new Player { ReplayInputHandler = s.Replay.CreateInputHandler() }));
}
protected override void LoadComplete()
@ -200,7 +199,7 @@ namespace osu.Game
{
Depth = -3,
OnHome = delegate { intro?.ChildScreen?.MakeCurrent(); },
OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; },
OnPlayModeChange = m => PlayMode.Value = m,
}).LoadAsync(this, t =>
{
PlayMode.ValueChanged += delegate { Toolbar.SetGameMode(PlayMode.Value); };

View File

@ -10,7 +10,6 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Threading;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.API;

View File

@ -8,7 +8,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;

View File

@ -5,7 +5,6 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Overlays.Dialog;
using OpenTK.Graphics;

View File

@ -6,7 +6,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.General;
using OpenTK.Graphics;
@ -67,6 +66,8 @@ namespace osu.Game.Overlays
optionsSection.Bounding = true;
FadeIn(transition_time, EasingTypes.OutQuint);
optionsSection.TriggerFocus();
}
protected override void PopOut()

View File

@ -10,7 +10,6 @@ using osu.Framework.Audio.Sample;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
using osu.Game.Modes.Mods;

View File

@ -10,7 +10,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Sprites;

View File

@ -14,7 +14,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using osu.Framework.MathUtils;
using osu.Game.Beatmaps;
@ -29,7 +28,7 @@ namespace osu.Game.Overlays
{
public class MusicController : FocusedOverlayContainer
{
private MusicControllerBackground backgroundSprite;
private Drawable currentBackground;
private DragBar progress;
private TextAwesome playButton;
private SpriteText title, artist;
@ -44,7 +43,6 @@ namespace osu.Game.Overlays
private Bindable<bool> preferUnicode;
private WorkingBeatmap current;
private BeatmapDatabase beatmaps;
private Framework.Game game;
private Container dragContainer;
@ -78,10 +76,8 @@ namespace osu.Game.Overlays
}
[BackgroundDependencyLoader]
private void load(OsuGameBase osuGame, OsuConfigManager config, BeatmapDatabase beatmaps, OsuColour colours)
private void load(OsuGameBase game, OsuConfigManager config, BeatmapDatabase beatmaps, OsuColour colours)
{
game = osuGame;
unicodeString = config.GetUnicodeString;
Children = new Drawable[]
@ -212,15 +208,15 @@ namespace osu.Game.Overlays
};
this.beatmaps = beatmaps;
trackManager = osuGame.Audio.Track;
trackManager = game.Audio.Track;
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
preferUnicode.ValueChanged += preferUnicode_changed;
beatmapSource = osuGame.Beatmap ?? new Bindable<WorkingBeatmap>();
beatmapSource = game.Beatmap ?? new Bindable<WorkingBeatmap>();
playList = beatmaps.GetAllWithChildren<BeatmapSetInfo>();
backgroundSprite = new MusicControllerBackground();
dragContainer.Add(backgroundSprite);
currentBackground = new MusicControllerBackground();
dragContainer.Add(currentBackground);
}
protected override void LoadComplete()
@ -351,29 +347,29 @@ namespace osu.Game.Overlays
}
});
MusicControllerBackground newBackground;
(newBackground = new MusicControllerBackground(beatmap)).LoadAsync(game, delegate
dragContainer.Add(new AsyncLoadContainer
{
dragContainer.Add(newBackground);
switch (direction)
RelativeSizeAxes = Axes.Both,
Depth = float.MaxValue,
Children = new[] { new MusicControllerBackground(beatmap) },
FinishedLoading = d =>
{
case TransformDirection.Next:
newBackground.Position = new Vector2(400, 0);
newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
backgroundSprite.MoveToX(-400, 500, EasingTypes.OutCubic);
break;
case TransformDirection.Prev:
newBackground.Position = new Vector2(-400, 0);
newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
backgroundSprite.MoveToX(400, 500, EasingTypes.OutCubic);
break;
switch (direction)
{
case TransformDirection.Next:
d.Position = new Vector2(400, 0);
d.MoveToX(0, 500, EasingTypes.OutCubic);
currentBackground.MoveToX(-400, 500, EasingTypes.OutCubic);
break;
case TransformDirection.Prev:
d.Position = new Vector2(-400, 0);
d.MoveToX(0, 500, EasingTypes.OutCubic);
currentBackground.MoveToX(400, 500, EasingTypes.OutCubic);
break;
}
currentBackground.Expire();
currentBackground = d;
}
backgroundSprite.Expire();
backgroundSprite = newBackground;
});
};
}
@ -422,8 +418,8 @@ namespace osu.Game.Overlays
{
this.beatmap = beatmap;
CacheDrawnFrameBuffer = true;
RelativeSizeAxes = Axes.Both;
Depth = float.MaxValue;
RelativeSizeAxes = Axes.Both;
Children = new Drawable[]
{

View File

@ -8,7 +8,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Overlays.Notifications;
using OpenTK.Graphics;

View File

@ -9,7 +9,6 @@ using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using OpenTK;

View File

@ -6,7 +6,6 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using OpenTK;

Some files were not shown because too many files have changed in this diff Show More