1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-22 21:00:33 +08:00

Merge remote-tracking branch 'origin/master' into taiko_drumroll_tick_judgements

Conflicts:
	osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj
This commit is contained in:
smoogipooo 2017-03-23 19:35:36 +09:00
commit 11fb404574
44 changed files with 201 additions and 163 deletions

View File

@ -136,7 +136,7 @@ namespace osu.Desktop.VisualTests.Tests
if (auto)
{
h.State = ArmedState.Hit;
h.Judgement = new OsuJudgementInfo { Result = HitResult.Hit };
h.Judgement = new OsuJudgement { Result = HitResult.Hit };
}
playfieldContainer.Add(h);

View File

@ -36,7 +36,7 @@ namespace osu.Desktop.VisualTests.Tests
playfield.OnJudgement(new DrawableTestHit(new Hit())
{
X = RNG.NextSingle(hitResult == TaikoHitResult.Good ? -0.1f : -0.05f, hitResult == TaikoHitResult.Good ? 0.1f : 0.05f),
Judgement = new TaikoJudgementInfo
Judgement = new TaikoJudgement
{
Result = HitResult.Hit,
TaikoResult = hitResult,
@ -51,7 +51,7 @@ namespace osu.Desktop.VisualTests.Tests
{
playfield.OnJudgement(new DrawableTestHit(new Hit())
{
Judgement = new TaikoJudgementInfo
Judgement = new TaikoJudgement
{
Result = HitResult.Miss,
TimeOffset = 0,
@ -60,14 +60,14 @@ namespace osu.Desktop.VisualTests.Tests
});
}
private class DrawableTestHit : DrawableHitObject<TaikoHitObject, TaikoJudgementInfo>
private class DrawableTestHit : DrawableHitObject<TaikoHitObject, TaikoJudgement>
{
public DrawableTestHit(TaikoHitObject hitObject)
: base(hitObject)
{
}
protected override TaikoJudgementInfo CreateJudgementInfo() => new TaikoJudgementInfo();
protected override TaikoJudgement CreateJudgement() => new TaikoJudgement();
protected override void UpdateState(ArmedState state)
{

View File

@ -7,18 +7,18 @@ using osu.Game.Modes.UI;
namespace osu.Game.Modes.Catch
{
internal class CatchScoreProcessor : ScoreProcessor<CatchBaseHit, CatchJudgementInfo>
internal class CatchScoreProcessor : ScoreProcessor<CatchBaseHit, CatchJudgement>
{
public CatchScoreProcessor()
{
}
public CatchScoreProcessor(HitRenderer<CatchBaseHit, CatchJudgementInfo> hitRenderer)
public CatchScoreProcessor(HitRenderer<CatchBaseHit, CatchJudgement> hitRenderer)
: base(hitRenderer)
{
}
protected override void UpdateCalculations(CatchJudgementInfo newJudgement)
protected override void UpdateCalculations(CatchJudgement newJudgement)
{
}
}

View File

@ -5,7 +5,7 @@ using osu.Game.Modes.Judgements;
namespace osu.Game.Modes.Catch.Judgements
{
public class CatchJudgementInfo : JudgementInfo
public class CatchJudgement : Judgement
{
public override string ScoreString => string.Empty;

View File

@ -10,7 +10,7 @@ using osu.Game.Modes.UI;
namespace osu.Game.Modes.Catch.UI
{
public class CatchHitRenderer : HitRenderer<CatchBaseHit, CatchJudgementInfo>
public class CatchHitRenderer : HitRenderer<CatchBaseHit, CatchJudgement>
{
public CatchHitRenderer(WorkingBeatmap beatmap)
: base(beatmap)
@ -23,8 +23,8 @@ namespace osu.Game.Modes.Catch.UI
protected override IBeatmapProcessor<CatchBaseHit> CreateBeatmapProcessor() => new CatchBeatmapProcessor();
protected override Playfield<CatchBaseHit, CatchJudgementInfo> CreatePlayfield() => new CatchPlayfield();
protected override Playfield<CatchBaseHit, CatchJudgement> CreatePlayfield() => new CatchPlayfield();
protected override DrawableHitObject<CatchBaseHit, CatchJudgementInfo> GetVisualRepresentation(CatchBaseHit h) => null;
protected override DrawableHitObject<CatchBaseHit, CatchJudgement> GetVisualRepresentation(CatchBaseHit h) => null;
}
}

View File

@ -10,7 +10,7 @@ using osu.Game.Modes.Catch.Judgements;
namespace osu.Game.Modes.Catch.UI
{
public class CatchPlayfield : Playfield<CatchBaseHit, CatchJudgementInfo>
public class CatchPlayfield : Playfield<CatchBaseHit, CatchJudgement>
{
public CatchPlayfield()
{

View File

@ -51,7 +51,7 @@
<Compile Include="Beatmaps\CatchBeatmapProcessor.cs" />
<Compile Include="CatchDifficultyCalculator.cs" />
<Compile Include="CatchScoreProcessor.cs" />
<Compile Include="Judgements\CatchJudgementInfo.cs" />
<Compile Include="Judgements\CatchJudgement.cs" />
<Compile Include="Objects\CatchBaseHit.cs" />
<Compile Include="Objects\Drawable\DrawableFruit.cs" />
<Compile Include="Objects\Droplet.cs" />

View File

@ -5,7 +5,7 @@ using osu.Game.Modes.Judgements;
namespace osu.Game.Modes.Mania.Judgements
{
public class ManiaJudgementInfo : JudgementInfo
public class ManiaJudgement : Judgement
{
public override string ScoreString => string.Empty;

View File

@ -7,18 +7,18 @@ using osu.Game.Modes.UI;
namespace osu.Game.Modes.Mania
{
internal class ManiaScoreProcessor : ScoreProcessor<ManiaBaseHit, ManiaJudgementInfo>
internal class ManiaScoreProcessor : ScoreProcessor<ManiaBaseHit, ManiaJudgement>
{
public ManiaScoreProcessor()
{
}
public ManiaScoreProcessor(HitRenderer<ManiaBaseHit, ManiaJudgementInfo> hitRenderer)
public ManiaScoreProcessor(HitRenderer<ManiaBaseHit, ManiaJudgement> hitRenderer)
: base(hitRenderer)
{
}
protected override void UpdateCalculations(ManiaJudgementInfo newJudgement)
protected override void UpdateCalculations(ManiaJudgement newJudgement)
{
}
}

View File

@ -10,7 +10,7 @@ using osu.Game.Modes.UI;
namespace osu.Game.Modes.Mania.UI
{
public class ManiaHitRenderer : HitRenderer<ManiaBaseHit, ManiaJudgementInfo>
public class ManiaHitRenderer : HitRenderer<ManiaBaseHit, ManiaJudgement>
{
private readonly int columns;
@ -26,8 +26,8 @@ namespace osu.Game.Modes.Mania.UI
protected override IBeatmapProcessor<ManiaBaseHit> CreateBeatmapProcessor() => new ManiaBeatmapProcessor();
protected override Playfield<ManiaBaseHit, ManiaJudgementInfo> CreatePlayfield() => new ManiaPlayfield(columns);
protected override Playfield<ManiaBaseHit, ManiaJudgement> CreatePlayfield() => new ManiaPlayfield(columns);
protected override DrawableHitObject<ManiaBaseHit, ManiaJudgementInfo> GetVisualRepresentation(ManiaBaseHit h) => null;
protected override DrawableHitObject<ManiaBaseHit, ManiaJudgement> GetVisualRepresentation(ManiaBaseHit h) => null;
}
}

View File

@ -11,7 +11,7 @@ using osu.Game.Modes.Mania.Judgements;
namespace osu.Game.Modes.Mania.UI
{
public class ManiaPlayfield : Playfield<ManiaBaseHit, ManiaJudgementInfo>
public class ManiaPlayfield : Playfield<ManiaBaseHit, ManiaJudgement>
{
public ManiaPlayfield(int columns)
{

View File

@ -49,7 +49,7 @@
<ItemGroup>
<Compile Include="Beatmaps\ManiaBeatmapConverter.cs" />
<Compile Include="Beatmaps\ManiaBeatmapProcessor.cs" />
<Compile Include="Judgements\ManiaJudgementInfo.cs" />
<Compile Include="Judgements\ManiaJudgement.cs" />
<Compile Include="ManiaDifficultyCalculator.cs" />
<Compile Include="ManiaScoreProcessor.cs" />
<Compile Include="Objects\Drawable\DrawableNote.cs" />

View File

@ -44,11 +44,8 @@ namespace osu.Game.Modes.Osu.Beatmaps
{
StartTime = original.StartTime,
Sample = original.Sample,
CurveObject = curveData,
Position = positionData?.Position ?? Vector2.Zero,
NewCombo = comboData?.NewCombo ?? false
};
}
@ -60,7 +57,6 @@ namespace osu.Game.Modes.Osu.Beatmaps
StartTime = original.StartTime,
Sample = original.Sample,
Position = new Vector2(512, 384) / 2,
EndTime = endTimeData.EndTime
};
}
@ -69,9 +65,7 @@ namespace osu.Game.Modes.Osu.Beatmaps
{
StartTime = original.StartTime,
Sample = original.Sample,
Position = positionData?.Position ?? Vector2.Zero,
NewCombo = comboData?.NewCombo ?? false
};
}

View File

@ -8,7 +8,7 @@ using osu.Framework.Extensions;
namespace osu.Game.Modes.Osu.Judgements
{
public class OsuJudgementInfo : JudgementInfo
public class OsuJudgement : Judgement
{
/// <summary>
/// The positional hit offset.

View File

@ -13,8 +13,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
{
public class DrawableHitCircle : DrawableOsuHitObject, IDrawableHitObjectWithProxiedApproach
{
private readonly OsuHitObject osuObject;
public ApproachCircle ApproachCircle;
private readonly CirclePiece circle;
private readonly RingPiece ring;
@ -27,20 +25,18 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
{
Origin = Anchor.Centre;
osuObject = h;
Position = osuObject.StackedPosition;
Scale = new Vector2(osuObject.Scale);
Position = HitObject.StackedPosition;
Scale = new Vector2(HitObject.Scale);
Children = new Drawable[]
{
glow = new GlowPiece
{
Colour = osuObject.ComboColour
Colour = AccentColour
},
circle = new CirclePiece
{
Colour = osuObject.ComboColour,
Colour = AccentColour,
Hit = () =>
{
if (Judgement.Result.HasValue) return false;
@ -58,11 +54,11 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
flash = new FlashPiece(),
explode = new ExplodePiece
{
Colour = osuObject.ComboColour,
Colour = AccentColour,
},
ApproachCircle = new ApproachCircle
{
Colour = osuObject.ComboColour,
Colour = AccentColour,
}
};
@ -115,8 +111,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
ApproachCircle.FadeOut();
double endTime = (osuObject as IHasEndTime)?.EndTime ?? osuObject.StartTime;
double duration = endTime - osuObject.StartTime;
double endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime;
double duration = endTime - HitObject.StartTime;
glow.Delay(duration);
glow.FadeOut(400);

View File

@ -7,18 +7,19 @@ using osu.Game.Modes.Osu.Judgements;
namespace osu.Game.Modes.Osu.Objects.Drawables
{
public class DrawableOsuHitObject : DrawableHitObject<OsuHitObject, OsuJudgementInfo>
public class DrawableOsuHitObject : DrawableHitObject<OsuHitObject, OsuJudgement>
{
public const float TIME_PREEMPT = 600;
public const float TIME_FADEIN = 400;
public const float TIME_FADEOUT = 500;
public DrawableOsuHitObject(OsuHitObject hitObject)
protected DrawableOsuHitObject(OsuHitObject hitObject)
: base(hitObject)
{
AccentColour = HitObject.ComboColour;
}
protected override OsuJudgementInfo CreateJudgementInfo() => new OsuJudgementInfo { MaxScore = OsuScoreResult.Hit300 };
protected override OsuJudgement CreateJudgement() => new OsuJudgement { MaxScore = OsuScoreResult.Hit300 };
protected override void UpdateState(ArmedState state)
{

View File

@ -9,23 +9,18 @@ using osu.Game.Modes.Judgements;
namespace osu.Game.Modes.Osu.Objects.Drawables
{
public class DrawableOsuJudgementInfo : DrawableJudgementInfo<OsuJudgementInfo>
public class DrawableOsuJudgement : DrawableJudgement<OsuJudgement>
{
public DrawableOsuJudgementInfo(OsuJudgementInfo judgement) : base(judgement)
public DrawableOsuJudgement(OsuJudgement judgement) : base(judgement)
{
}
protected override void LoadComplete()
{
base.LoadComplete();
if (Judgement.Result != HitResult.Miss)
{
JudgementText.TransformSpacingTo(new Vector2(14, 0), 1800, EasingTypes.OutQuint);
FadeOut(500);
}
Expire();
base.LoadComplete();
}
}
}

View File

@ -39,6 +39,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
{
body = new SliderBody(s)
{
AccentColour = AccentColour,
Position = s.StackedPosition,
PathWidth = s.Scale * 64,
},
@ -56,6 +57,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
ball = new SliderBall(s)
{
Scale = new Vector2(s.Scale),
AccentColour = AccentColour
},
initialCircle = new DrawableHitCircle(new HitCircle
{

View File

@ -27,7 +27,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
public override bool RemoveWhenNotAlive => false;
protected override OsuJudgementInfo CreateJudgementInfo() => new OsuJudgementInfo { MaxScore = OsuScoreResult.SliderTick };
protected override OsuJudgement CreateJudgement() => new OsuJudgement { MaxScore = OsuScoreResult.SliderTick };
public DrawableSliderTick(SliderTick sliderTick) : base(sliderTick)
{
@ -48,7 +48,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = sliderTick.ComboColour,
Colour = AccentColour,
Alpha = 0.3f,
}
};

View File

@ -48,7 +48,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
Alpha = 0,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
DiscColour = s.ComboColour
DiscColour = AccentColour
},
circleContainer = new Container
{

View File

@ -12,10 +12,26 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
{
public class SliderBall : CircularContainer, ISliderProgress
{
private const float width = 128;
private Color4 accentColour = Color4.Black;
/// <summary>
/// The colour that is used for the slider ball.
/// </summary>
public Color4 AccentColour
{
get { return accentColour; }
set
{
accentColour = value;
if (ball != null)
ball.Colour = value;
}
}
private readonly Slider slider;
private readonly Box follow;
private const float width = 128;
private readonly Box ball;
public SliderBall(Slider slider)
{
@ -49,9 +65,9 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
Alpha = 1,
Children = new[]
{
new Box
ball = new Box
{
Colour = slider.ComboColour,
Colour = AccentColour,
Alpha = 0.4f,
Width = width,
Height = width,

View File

@ -13,6 +13,7 @@ using osu.Framework.Graphics.Textures;
using osu.Game.Configuration;
using OpenTK;
using OpenTK.Graphics.ES30;
using OpenTK.Graphics;
namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
{
@ -24,15 +25,32 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
public float PathWidth
{
get { return path.PathWidth; }
set
{
path.PathWidth = value;
}
set { path.PathWidth = value; }
}
public double? SnakedStart { get; private set; }
public double? SnakedEnd { get; private set; }
private Color4 accentColour;
/// <summary>
/// Used to colour the path.
/// </summary>
public Color4 AccentColour
{
get { return accentColour; }
set
{
if (accentColour == value)
return;
accentColour = value;
if (LoadState == LoadState.Loaded)
Schedule(reloadTexture);
}
}
private int textureWidth => (int)PathWidth * 2;
private readonly Slider slider;
public SliderBody(Slider s)
{
@ -82,7 +100,12 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
snakingIn = config.GetBindable<bool>(OsuConfig.SnakingInSliders);
snakingOut = config.GetBindable<bool>(OsuConfig.SnakingOutSliders);
int textureWidth = (int)PathWidth * 2;
reloadTexture();
}
private void reloadTexture()
{
var texture = new Texture(textureWidth, 1);
//initialise background
var upload = new TextureUpload(textureWidth * 4);
@ -110,14 +133,13 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
{
progress -= border_portion;
bytes[i * 4] = (byte)(slider.ComboColour.R * 255);
bytes[i * 4 + 1] = (byte)(slider.ComboColour.G * 255);
bytes[i * 4 + 2] = (byte)(slider.ComboColour.B * 255);
bytes[i * 4 + 3] = (byte)((opacity_at_edge - (opacity_at_edge - opacity_at_centre) * progress / gradient_portion) * (slider.ComboColour.A * 255));
bytes[i * 4] = (byte)(AccentColour.R * 255);
bytes[i * 4 + 1] = (byte)(AccentColour.G * 255);
bytes[i * 4 + 2] = (byte)(AccentColour.B * 255);
bytes[i * 4 + 3] = (byte)((opacity_at_edge - (opacity_at_edge - opacity_at_centre) * progress / gradient_portion) * (AccentColour.A * 255));
}
}
var texture = new Texture(textureWidth, 1);
texture.SetData(upload);
path.Texture = texture;
}

View File

@ -36,7 +36,7 @@ namespace osu.Game.Modes.Osu.Objects
public float Scale { get; set; } = 1;
public Color4 ComboColour { get; set; }
public Color4 ComboColour { get; set; } = Color4.Gray;
public virtual bool NewCombo { get; set; }
public int ComboIndex { get; set; }

View File

@ -8,13 +8,13 @@ using osu.Game.Modes.UI;
namespace osu.Game.Modes.Osu
{
internal class OsuScoreProcessor : ScoreProcessor<OsuHitObject, OsuJudgementInfo>
internal class OsuScoreProcessor : ScoreProcessor<OsuHitObject, OsuJudgement>
{
public OsuScoreProcessor()
{
}
public OsuScoreProcessor(HitRenderer<OsuHitObject, OsuJudgementInfo> hitRenderer)
public OsuScoreProcessor(HitRenderer<OsuHitObject, OsuJudgement> hitRenderer)
: base(hitRenderer)
{
}
@ -27,7 +27,7 @@ namespace osu.Game.Modes.Osu
Accuracy.Value = 1;
}
protected override void UpdateCalculations(OsuJudgementInfo judgement)
protected override void UpdateCalculations(OsuJudgement judgement)
{
if (judgement != null)
{
@ -47,9 +47,8 @@ namespace osu.Game.Modes.Osu
int score = 0;
int maxScore = 0;
foreach (var judgementInfo in Judgements)
foreach (var j in Judgements)
{
var j = judgementInfo;
score += j.ScoreValue;
maxScore += j.MaxScoreValue;
}

View File

@ -12,7 +12,7 @@ using osu.Game.Screens.Play;
namespace osu.Game.Modes.Osu.UI
{
public class OsuHitRenderer : HitRenderer<OsuHitObject, OsuJudgementInfo>
public class OsuHitRenderer : HitRenderer<OsuHitObject, OsuJudgement>
{
public OsuHitRenderer(WorkingBeatmap beatmap)
: base(beatmap)
@ -25,11 +25,11 @@ namespace osu.Game.Modes.Osu.UI
protected override IBeatmapProcessor<OsuHitObject> CreateBeatmapProcessor() => new OsuBeatmapProcessor();
protected override Playfield<OsuHitObject, OsuJudgementInfo> CreatePlayfield() => new OsuPlayfield();
protected override Playfield<OsuHitObject, OsuJudgement> CreatePlayfield() => new OsuPlayfield();
protected override KeyConversionInputManager CreateKeyConversionInputManager() => new OsuKeyConversionInputManager();
protected override DrawableHitObject<OsuHitObject, OsuJudgementInfo> GetVisualRepresentation(OsuHitObject h)
protected override DrawableHitObject<OsuHitObject, OsuJudgement> GetVisualRepresentation(OsuHitObject h)
{
var circle = h as HitCircle;
if (circle != null)

View File

@ -15,7 +15,7 @@ using osu.Game.Modes.Osu.Judgements;
namespace osu.Game.Modes.Osu.UI
{
public class OsuPlayfield : Playfield<OsuHitObject, OsuJudgementInfo>
public class OsuPlayfield : Playfield<OsuHitObject, OsuJudgement>
{
private readonly Container approachCircles;
private readonly Container judgementLayer;
@ -65,7 +65,7 @@ namespace osu.Game.Modes.Osu.UI
AddInternal(new GameplayCursor());
}
public override void Add(DrawableHitObject<OsuHitObject, OsuJudgementInfo> h)
public override void Add(DrawableHitObject<OsuHitObject, OsuJudgement> h)
{
h.Depth = (float)h.HitObject.StartTime;
@ -83,9 +83,9 @@ namespace osu.Game.Modes.Osu.UI
.OrderBy(h => h.StartTime);
}
public override void OnJudgement(DrawableHitObject<OsuHitObject, OsuJudgementInfo> judgedObject)
public override void OnJudgement(DrawableHitObject<OsuHitObject, OsuJudgement> judgedObject)
{
DrawableOsuJudgementInfo explosion = new DrawableOsuJudgementInfo(judgedObject.Judgement)
DrawableOsuJudgement explosion = new DrawableOsuJudgement(judgedObject.Judgement)
{
Origin = Anchor.Centre,
Position = judgedObject.HitObject.StackedEndPosition + judgedObject.Judgement.PositionOffset

View File

@ -48,7 +48,7 @@
<Compile Include="Objects\Drawables\DrawableOsuHitObject.cs" />
<Compile Include="Objects\Drawables\Connections\ConnectionRenderer.cs" />
<Compile Include="Objects\Drawables\Connections\FollowPointRenderer.cs" />
<Compile Include="Judgements\OsuJudgementInfo.cs" />
<Compile Include="Judgements\OsuJudgement.cs" />
<Compile Include="Objects\Drawables\Pieces\ApproachCircle.cs" />
<Compile Include="Objects\Drawables\Pieces\SpinnerBackground.cs" />
<Compile Include="Objects\Drawables\Pieces\CirclePiece.cs" />
@ -58,7 +58,7 @@
<Compile Include="Objects\Drawables\Pieces\ExplodePiece.cs" />
<Compile Include="Objects\Drawables\Pieces\FlashPiece.cs" />
<Compile Include="Objects\Drawables\Pieces\GlowPiece.cs" />
<Compile Include="Objects\Drawables\DrawableOsuJudgementInfo.cs" />
<Compile Include="Objects\Drawables\DrawableOsuJudgement.cs" />
<Compile Include="Objects\Drawables\Pieces\NumberPiece.cs" />
<Compile Include="Objects\Drawables\DrawableSliderTick.cs" />
<Compile Include="Objects\Drawables\Pieces\RingPiece.cs" />

View File

@ -6,7 +6,7 @@ using osu.Framework.Extensions;
namespace osu.Game.Modes.Taiko.Judgements
{
public class TaikoJudgementInfo : JudgementInfo
public class TaikoJudgement : Judgement
{
/// <summary>
/// The maximum score value.

View File

@ -1,39 +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.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Graphics.Transforms;
using OpenTK;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
internal class DrawableTaikoHit : Sprite
{
private readonly TaikoHitObject h;
public DrawableTaikoHit(TaikoHitObject h)
{
this.h = h;
Origin = Anchor.Centre;
Scale = new Vector2(0.2f);
RelativePositionAxes = Axes.Both;
Position = new Vector2(1.1f, 0.5f);
}
[BackgroundDependencyLoader]
private void load(TextureStore textures)
{
Texture = textures.Get(@"Menu/logo");
const double duration = 0;
Transforms.Add(new TransformPositionX { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 1.1f, EndValue = 0.1f });
Transforms.Add(new TransformAlpha { StartTime = h.StartTime + duration + 200, EndTime = h.StartTime + duration + 400, StartValue = 1, EndValue = 0 });
Expire(true);
}
}
}

View File

@ -0,0 +1,46 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Taiko.Judgements;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
public abstract class DrawableTaikoHitObject : DrawableHitObject<TaikoHitObject, TaikoJudgement>
{
protected DrawableTaikoHitObject(TaikoHitObject hitObject)
: base(hitObject)
{
Anchor = Anchor.CentreLeft;
Origin = Anchor.Centre;
RelativePositionAxes = Axes.X;
}
protected override void LoadComplete()
{
LifetimeStart = HitObject.StartTime - HitObject.PreEmpt * 2;
LifetimeEnd = HitObject.StartTime + HitObject.PreEmpt;
base.LoadComplete();
}
protected override TaikoJudgement CreateJudgement() => new TaikoJudgement();
/// <summary>
/// Sets the scroll position of the DrawableHitObject relative to the offset between
/// a time value and the HitObject's StartTime.
/// </summary>
/// <param name="time"></param>
protected virtual void UpdateScrollPosition(double time)
{
MoveToX((float)((HitObject.StartTime - time) / HitObject.PreEmpt));
}
protected override void Update()
{
UpdateScrollPosition(Time.Current);
}
}
}

View File

@ -7,18 +7,18 @@ using osu.Game.Modes.UI;
namespace osu.Game.Modes.Taiko
{
internal class TaikoScoreProcessor : ScoreProcessor<TaikoHitObject, TaikoJudgementInfo>
internal class TaikoScoreProcessor : ScoreProcessor<TaikoHitObject, TaikoJudgement>
{
public TaikoScoreProcessor()
{
}
public TaikoScoreProcessor(HitRenderer<TaikoHitObject, TaikoJudgementInfo> hitRenderer)
public TaikoScoreProcessor(HitRenderer<TaikoHitObject, TaikoJudgement> hitRenderer)
: base(hitRenderer)
{
}
protected override void UpdateCalculations(TaikoJudgementInfo newJudgement)
protected override void UpdateCalculations(TaikoJudgement newJudgement)
{
}
}

View File

@ -12,13 +12,13 @@ namespace osu.Game.Modes.Taiko.UI
/// <summary>
/// Text that is shown as judgement when a hit object is hit or missed.
/// </summary>
public class DrawableTaikoJudgementInfo : DrawableJudgementInfo<TaikoJudgementInfo>
public class DrawableTaikoJudgement : DrawableJudgement<TaikoJudgement>
{
/// <summary>
/// Creates a new judgement text.
/// </summary>
/// <param name="judgement">The judgement to visualise.</param>
public DrawableTaikoJudgementInfo(TaikoJudgementInfo judgement)
public DrawableTaikoJudgement(TaikoJudgement judgement)
: base(judgement)
{
}

View File

@ -19,10 +19,10 @@ namespace osu.Game.Modes.Taiko.UI
/// </summary>
internal class HitExplosion : CircularContainer
{
private readonly TaikoJudgementInfo judgement;
private readonly TaikoJudgement judgement;
private readonly Box innerFill;
public HitExplosion(TaikoJudgementInfo judgement)
public HitExplosion(TaikoJudgement judgement)
{
this.judgement = judgement;

View File

@ -10,7 +10,7 @@ using osu.Game.Modes.UI;
namespace osu.Game.Modes.Taiko.UI
{
public class TaikoHitRenderer : HitRenderer<TaikoHitObject, TaikoJudgementInfo>
public class TaikoHitRenderer : HitRenderer<TaikoHitObject, TaikoJudgement>
{
public TaikoHitRenderer(WorkingBeatmap beatmap)
: base(beatmap)
@ -23,8 +23,8 @@ namespace osu.Game.Modes.Taiko.UI
protected override IBeatmapProcessor<TaikoHitObject> CreateBeatmapProcessor() => new TaikoBeatmapProcessor();
protected override Playfield<TaikoHitObject, TaikoJudgementInfo> CreatePlayfield() => new TaikoPlayfield();
protected override Playfield<TaikoHitObject, TaikoJudgement> CreatePlayfield() => new TaikoPlayfield();
protected override DrawableHitObject<TaikoHitObject, TaikoJudgementInfo> GetVisualRepresentation(TaikoHitObject h) => null;
protected override DrawableHitObject<TaikoHitObject, TaikoJudgement> GetVisualRepresentation(TaikoHitObject h) => null;
}
}

View File

@ -17,7 +17,7 @@ using osu.Framework.Graphics.Primitives;
namespace osu.Game.Modes.Taiko.UI
{
public class TaikoPlayfield : Playfield<TaikoHitObject, TaikoJudgementInfo>
public class TaikoPlayfield : Playfield<TaikoHitObject, TaikoJudgement>
{
/// <summary>
/// The default play field height.
@ -48,7 +48,7 @@ namespace osu.Game.Modes.Taiko.UI
private readonly Container<HitExplosion> hitExplosionContainer;
//private Container<DrawableBarLine> barLineContainer;
private readonly Container<DrawableTaikoJudgementInfo> judgementContainer;
private readonly Container<DrawableTaikoJudgement> judgementContainer;
private readonly Container hitObjectContainer;
//private Container topLevelHitContainer;
@ -117,7 +117,7 @@ namespace osu.Game.Modes.Taiko.UI
{
RelativeSizeAxes = Axes.Both,
},
judgementContainer = new Container<DrawableTaikoJudgementInfo>
judgementContainer = new Container<DrawableTaikoJudgement>
{
RelativeSizeAxes = Axes.Both,
BlendingMode = BlendingMode.Additive
@ -170,21 +170,21 @@ namespace osu.Game.Modes.Taiko.UI
rightBackground.Colour = colours.Gray0;
}
public override void Add(DrawableHitObject<TaikoHitObject, TaikoJudgementInfo> h)
public override void Add(DrawableHitObject<TaikoHitObject, TaikoJudgement> h)
{
h.Depth = (float)h.HitObject.StartTime;
base.Add(h);
}
public override void OnJudgement(DrawableHitObject<TaikoHitObject, TaikoJudgementInfo> judgedObject)
public override void OnJudgement(DrawableHitObject<TaikoHitObject, TaikoJudgement> judgedObject)
{
bool wasHit = judgedObject.Judgement.Result == HitResult.Hit;
if (wasHit)
hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement));
judgementContainer.Add(new DrawableTaikoJudgementInfo(judgedObject.Judgement)
judgementContainer.Add(new DrawableTaikoJudgement(judgedObject.Judgement)
{
Anchor = wasHit ? Anchor.TopLeft : Anchor.CentreLeft,
Origin = wasHit ? Anchor.BottomCentre : Anchor.Centre,

View File

@ -50,20 +50,20 @@
<Compile Include="Beatmaps\TaikoBeatmapConverter.cs" />
<Compile Include="Beatmaps\TaikoBeatmapProcessor.cs" />
<Compile Include="Judgements\TaikoDrumRollTickJudgementInfo.cs" />
<Compile Include="Judgements\TaikoJudgementInfo.cs" />
<Compile Include="Judgements\TaikoJudgement.cs" />
<Compile Include="Judgements\TaikoHitResult.cs" />
<Compile Include="Objects\Drawable\DrawableTaikoHitObject.cs" />
<Compile Include="Objects\Bash.cs" />
<Compile Include="Objects\DrumRoll.cs" />
<Compile Include="Objects\DrumRollTick.cs" />
<Compile Include="Objects\Hit.cs" />
<Compile Include="TaikoDifficultyCalculator.cs" />
<Compile Include="Objects\Drawable\DrawableTaikoHit.cs" />
<Compile Include="Objects\TaikoHitObject.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TaikoScoreProcessor.cs" />
<Compile Include="UI\HitTarget.cs" />
<Compile Include="UI\InputDrum.cs" />
<Compile Include="UI\DrawableTaikoJudgementInfo.cs" />
<Compile Include="UI\DrawableTaikoJudgement.cs" />
<Compile Include="UI\HitExplosion.cs" />
<Compile Include="UI\TaikoHitRenderer.cs" />
<Compile Include="UI\TaikoPlayfield.cs" />

View File

@ -70,7 +70,7 @@ namespace osu.Game.Tests.Beatmaps.IO
Assert.IsTrue(File.Exists(temp));
var importer = new BeatmapIPCChannel(client);
if (!importer.ImportAsync(temp).Wait(1000))
if (!importer.ImportAsync(temp).Wait(5000))
Assert.Fail(@"IPC took too long to send");
ensureLoaded(osu);

View File

@ -15,21 +15,21 @@ using osu.Game.Modes.Objects.Drawables;
namespace osu.Game.Modes.Judgements
{
/// <summary>
/// A drawable object which visualises the hit result of a <see cref="JudgementInfo"/>.
/// A drawable object which visualises the hit result of a <see cref="Judgements.Judgement"/>.
/// </summary>
/// <typeparam name="TJudgement">The type of judgement to visualise.</typeparam>
public class DrawableJudgementInfo<TJudgement> : Container
where TJudgement : JudgementInfo
public class DrawableJudgement<TJudgement> : Container
where TJudgement : Judgement
{
protected readonly TJudgement Judgement;
protected readonly SpriteText JudgementText;
/// <summary>
/// Creates a drawable which visualises a <see cref="JudgementInfo"/>.
/// Creates a drawable which visualises a <see cref="Judgements.Judgement"/>.
/// </summary>
/// <param name="judgement">The judgement to visualise.</param>
public DrawableJudgementInfo(TJudgement judgement)
public DrawableJudgement(TJudgement judgement)
{
Judgement = judgement;
@ -83,8 +83,8 @@ namespace osu.Game.Modes.Judgements
ScaleTo(0.9f);
ScaleTo(1, 500, EasingTypes.OutElastic);
Delay(250);
FadeOut(250, EasingTypes.OutQuint);
Delay(100);
FadeOut(400);
break;
}

View File

@ -5,7 +5,7 @@ using osu.Game.Modes.Objects.Drawables;
namespace osu.Game.Modes.Judgements
{
public abstract class JudgementInfo
public abstract class Judgement
{
/// <summary>
/// Whether this judgement is the result of a hit or a miss.

View File

@ -11,11 +11,12 @@ using osu.Game.Beatmaps.Samples;
using osu.Game.Modes.Judgements;
using Container = osu.Framework.Graphics.Containers.Container;
using osu.Game.Modes.Objects.Types;
using OpenTK.Graphics;
namespace osu.Game.Modes.Objects.Drawables
{
public abstract class DrawableHitObject<TJudgement> : Container, IStateful<ArmedState>
where TJudgement : JudgementInfo
where TJudgement : Judgement
{
public override bool HandleInput => Interactive;
@ -23,7 +24,7 @@ namespace osu.Game.Modes.Objects.Drawables
public TJudgement Judgement;
protected abstract TJudgement CreateJudgementInfo();
protected abstract TJudgement CreateJudgement();
protected abstract void UpdateState(ArmedState state);
@ -61,7 +62,7 @@ namespace osu.Game.Modes.Objects.Drawables
//we may be setting a custom judgement in test cases or what not.
if (Judgement == null)
Judgement = CreateJudgementInfo();
Judgement = CreateJudgement();
//force application of the state that was set before we loaded.
UpdateState(State);
@ -70,12 +71,17 @@ namespace osu.Game.Modes.Objects.Drawables
public abstract class DrawableHitObject<TObject, TJudgement> : DrawableHitObject<TJudgement>
where TObject : HitObject
where TJudgement : JudgementInfo
where TJudgement : Judgement
{
public event Action<DrawableHitObject<TObject, TJudgement>> OnJudgement;
public TObject HitObject;
/// <summary>
/// The colour used for various elements of this DrawableHitObject.
/// </summary>
public Color4 AccentColour { get; protected set; }
protected DrawableHitObject(TObject hitObject)
{
HitObject = hitObject;

View File

@ -105,7 +105,7 @@ namespace osu.Game.Modes
public abstract class ScoreProcessor<TObject, TJudgement> : ScoreProcessor
where TObject : HitObject
where TJudgement : JudgementInfo
where TJudgement : Judgement
{
/// <summary>
/// All judgements held by this ScoreProcessor.
@ -158,7 +158,7 @@ namespace osu.Game.Modes
/// <summary>
/// Update any values that potentially need post-processing on a judgement change.
/// </summary>
/// <param name="newJudgement">A new JudgementInfo that triggered this calculation. May be null.</param>
/// <param name="newJudgement">A new Judgement that triggered this calculation. May be null.</param>
protected abstract void UpdateCalculations(TJudgement newJudgement);
}
}

View File

@ -143,7 +143,7 @@ namespace osu.Game.Modes.UI
/// <typeparam name="TJudgement">The type of Judgement of DrawableHitObjects contained by this HitRenderer.</typeparam>
public abstract class HitRenderer<TObject, TJudgement> : HitRenderer<TObject>
where TObject : HitObject
where TJudgement : JudgementInfo
where TJudgement : Judgement
{
public event Action<TJudgement> OnJudgement;

View File

@ -13,7 +13,7 @@ namespace osu.Game.Modes.UI
{
public abstract class Playfield<TObject, TJudgement> : Container
where TObject : HitObject
where TJudgement : JudgementInfo
where TJudgement : Judgement
{
/// <summary>
/// The HitObjects contained in this Playfield.

View File

@ -96,7 +96,7 @@
<Compile Include="IO\Legacy\SerializationReader.cs" />
<Compile Include="IO\Legacy\SerializationWriter.cs" />
<Compile Include="IPC\ScoreIPCChannel.cs" />
<Compile Include="Modes\Judgements\DrawableJudgementInfo.cs" />
<Compile Include="Modes\Judgements\DrawableJudgement.cs" />
<Compile Include="Modes\LegacyReplay.cs" />
<Compile Include="Modes\Mods\IApplicableMod.cs" />
<Compile Include="Modes\Mods\ModType.cs" />
@ -113,7 +113,7 @@
<Compile Include="Modes\Objects\SliderCurve.cs" />
<Compile Include="Modes\Objects\Types\CurveType.cs" />
<Compile Include="Modes\Objects\Drawables\IDrawableHitObjectWithProxiedApproach.cs" />
<Compile Include="Modes\Judgements\JudgementInfo.cs" />
<Compile Include="Modes\Judgements\Judgement.cs" />
<Compile Include="Modes\Objects\HitObjectParser.cs" />
<Compile Include="Modes\Objects\Types\IHasCombo.cs" />
<Compile Include="Modes\Objects\Types\IHasEndTime.cs" />