mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 15:43:18 +08:00
Merge branch 'master' into beatmap-track-rework
This commit is contained in:
commit
357fb3a10e
@ -191,4 +191,7 @@ dotnet_diagnostic.IDE0052.severity = silent
|
|||||||
#Rules for disposable
|
#Rules for disposable
|
||||||
dotnet_diagnostic.IDE0067.severity = none
|
dotnet_diagnostic.IDE0067.severity = none
|
||||||
dotnet_diagnostic.IDE0068.severity = none
|
dotnet_diagnostic.IDE0068.severity = none
|
||||||
dotnet_diagnostic.IDE0069.severity = none
|
dotnet_diagnostic.IDE0069.severity = none
|
||||||
|
|
||||||
|
#Disable operator overloads requiring alternate named methods
|
||||||
|
dotnet_diagnostic.CA2225.severity = none
|
@ -113,7 +113,7 @@ platform :ios do
|
|||||||
|
|
||||||
souyuz(
|
souyuz(
|
||||||
platform: "ios",
|
platform: "ios",
|
||||||
plist_path: "../osu.iOS/Info.plist"
|
plist_path: "osu.iOS/Info.plist"
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ platform :ios do
|
|||||||
end
|
end
|
||||||
|
|
||||||
lane :update_version do |options|
|
lane :update_version do |options|
|
||||||
options[:plist_path] = '../osu.iOS/Info.plist'
|
options[:plist_path] = 'osu.iOS/Info.plist'
|
||||||
app_version(options)
|
app_version(options)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -52,6 +52,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.812.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.812.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.814.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.819.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -25,6 +25,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
|||||||
[TestCase("hardrock-stream", new[] { typeof(CatchModHardRock) })]
|
[TestCase("hardrock-stream", new[] { typeof(CatchModHardRock) })]
|
||||||
[TestCase("hardrock-repeat-slider", new[] { typeof(CatchModHardRock) })]
|
[TestCase("hardrock-repeat-slider", new[] { typeof(CatchModHardRock) })]
|
||||||
[TestCase("hardrock-spinner", new[] { typeof(CatchModHardRock) })]
|
[TestCase("hardrock-spinner", new[] { typeof(CatchModHardRock) })]
|
||||||
|
[TestCase("right-bound-hr-offset", new[] { typeof(CatchModHardRock) })]
|
||||||
public new void Test(string name, params Type[] mods) => base.Test(name, mods);
|
public new void Test(string name, params Type[] mods) => base.Test(name, mods);
|
||||||
|
|
||||||
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
|
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
|
||||||
|
@ -179,7 +179,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
|||||||
if (amount > 0)
|
if (amount > 0)
|
||||||
{
|
{
|
||||||
// Clamp to the right bound
|
// Clamp to the right bound
|
||||||
if (position + amount < 1)
|
if (position + amount < CatchPlayfield.WIDTH)
|
||||||
position += amount;
|
position += amount;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"Mappings": [{
|
||||||
|
"StartTime": 3368,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 3368,
|
||||||
|
"Position": 374
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 3501,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 3501,
|
||||||
|
"Position": 446
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
osu file format v14
|
||||||
|
|
||||||
|
[General]
|
||||||
|
StackLeniency: 0.7
|
||||||
|
Mode: 2
|
||||||
|
|
||||||
|
[Difficulty]
|
||||||
|
HPDrainRate:6
|
||||||
|
CircleSize:4
|
||||||
|
OverallDifficulty:9.6
|
||||||
|
ApproachRate:9.6
|
||||||
|
SliderMultiplier:1.9
|
||||||
|
SliderTickRate:1
|
||||||
|
|
||||||
|
[TimingPoints]
|
||||||
|
2169,266.666666666667,4,2,1,70,1,0
|
||||||
|
|
||||||
|
[HitObjects]
|
||||||
|
374,60,3368,1,0,0:0:0:0:
|
||||||
|
410,146,3501,1,2,0:1:0:0:
|
@ -10,15 +10,21 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
{
|
{
|
||||||
public class CatchPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
|
public class CatchPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
|
||||||
{
|
{
|
||||||
|
private const float playfield_size_adjust = 0.8f;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
private readonly Container content;
|
private readonly Container content;
|
||||||
|
|
||||||
public CatchPlayfieldAdjustmentContainer()
|
public CatchPlayfieldAdjustmentContainer()
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre;
|
// because we are using centre anchor/origin, we will need to limit visibility in the future
|
||||||
Origin = Anchor.TopCentre;
|
// to ensure tall windows do not get a readability advantage.
|
||||||
|
// it may be possible to bake the catch-specific offsets (-100..340 mentioned below) into new values
|
||||||
|
// which are compatible with TopCentre alignment.
|
||||||
|
Anchor = Anchor.Centre;
|
||||||
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Size = new Vector2(0.86f); // matches stable's vertical offset for catcher plate
|
Size = new Vector2(playfield_size_adjust);
|
||||||
|
|
||||||
InternalChild = new Container
|
InternalChild = new Container
|
||||||
{
|
{
|
||||||
@ -27,7 +33,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fit,
|
FillMode = FillMode.Fit,
|
||||||
FillAspectRatio = 4f / 3,
|
FillAspectRatio = 4f / 3,
|
||||||
Child = content = new ScalingContainer { RelativeSizeAxes = Axes.Both }
|
Child = content = new ScalingContainer { RelativeSizeAxes = Axes.Both, }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,8 +46,14 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
|
// in stable, fruit fall vertically from -100 to 340.
|
||||||
|
// to emulate this, we want to make our playfield 440 gameplay pixels high.
|
||||||
|
// we then offset it -100 vertically in the position set below.
|
||||||
|
const float stable_v_offset_ratio = 440 / 384f;
|
||||||
|
|
||||||
Scale = new Vector2(Parent.ChildSize.X / CatchPlayfield.WIDTH);
|
Scale = new Vector2(Parent.ChildSize.X / CatchPlayfield.WIDTH);
|
||||||
Size = Vector2.Divide(Vector2.One, Scale);
|
Position = new Vector2(0, -100 * stable_v_offset_ratio + Scale.X);
|
||||||
|
Size = Vector2.Divide(new Vector2(1, stable_v_offset_ratio), Scale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using NUnit.Framework;
|
||||||
|
using osu.Game.Rulesets.Mania.Mods;
|
||||||
|
using osu.Game.Tests.Visual;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Mania.Tests.Mods
|
||||||
|
{
|
||||||
|
public class TestSceneManiaModInvert : ModTestScene
|
||||||
|
{
|
||||||
|
protected override Ruleset CreatePlayerRuleset() => new ManiaRuleset();
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestInversion() => CreateModTest(new ModTestData
|
||||||
|
{
|
||||||
|
Mod = new ManiaModInvert(),
|
||||||
|
PassCondition = () => Player.ScoreProcessor.JudgedHits >= 2
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces;
|
using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces;
|
||||||
|
|
||||||
@ -15,7 +16,8 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints.Components
|
|||||||
AccentColour.Value = colours.Yellow;
|
AccentColour.Value = colours.Yellow;
|
||||||
|
|
||||||
Background.Alpha = 0.5f;
|
Background.Alpha = 0.5f;
|
||||||
Foreground.Alpha = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override Drawable CreateForeground() => base.CreateForeground().With(d => d.Alpha = 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ namespace osu.Game.Rulesets.Mania.Judgements
|
|||||||
{
|
{
|
||||||
public class HoldNoteTickJudgement : ManiaJudgement
|
public class HoldNoteTickJudgement : ManiaJudgement
|
||||||
{
|
{
|
||||||
protected override int NumericResultFor(HitResult result) => 20;
|
protected override int NumericResultFor(HitResult result) => result == MaxResult ? 20 : 0;
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result)
|
protected override double HealthIncreaseFor(HitResult result)
|
||||||
{
|
{
|
||||||
|
@ -220,6 +220,7 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
new ManiaModDualStages(),
|
new ManiaModDualStages(),
|
||||||
new ManiaModMirror(),
|
new ManiaModMirror(),
|
||||||
new ManiaModDifficultyAdjust(),
|
new ManiaModDifficultyAdjust(),
|
||||||
|
new ManiaModInvert(),
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.Automation:
|
case ModType.Automation:
|
||||||
|
81
osu.Game.Rulesets.Mania/Mods/ManiaModInvert.cs
Normal file
81
osu.Game.Rulesets.Mania/Mods/ManiaModInvert.cs
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Audio;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Mania.Objects;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Mania.Mods
|
||||||
|
{
|
||||||
|
public class ManiaModInvert : Mod, IApplicableAfterBeatmapConversion
|
||||||
|
{
|
||||||
|
public override string Name => "Invert";
|
||||||
|
|
||||||
|
public override string Acronym => "IN";
|
||||||
|
public override double ScoreMultiplier => 1;
|
||||||
|
|
||||||
|
public override string Description => "Hold the keys. To the beat.";
|
||||||
|
|
||||||
|
public override IconUsage? Icon => FontAwesome.Solid.YinYang;
|
||||||
|
|
||||||
|
public override ModType Type => ModType.Conversion;
|
||||||
|
|
||||||
|
public void ApplyToBeatmap(IBeatmap beatmap)
|
||||||
|
{
|
||||||
|
var maniaBeatmap = (ManiaBeatmap)beatmap;
|
||||||
|
|
||||||
|
var newObjects = new List<ManiaHitObject>();
|
||||||
|
|
||||||
|
foreach (var column in maniaBeatmap.HitObjects.GroupBy(h => h.Column))
|
||||||
|
{
|
||||||
|
var newColumnObjects = new List<ManiaHitObject>();
|
||||||
|
|
||||||
|
var locations = column.OfType<Note>().Select(n => (startTime: n.StartTime, samples: n.Samples))
|
||||||
|
.Concat(column.OfType<HoldNote>().SelectMany(h => new[]
|
||||||
|
{
|
||||||
|
(startTime: h.StartTime, samples: h.GetNodeSamples(0)),
|
||||||
|
(startTime: h.EndTime, samples: h.GetNodeSamples(1))
|
||||||
|
}))
|
||||||
|
.OrderBy(h => h.startTime).ToList();
|
||||||
|
|
||||||
|
for (int i = 0; i < locations.Count - 1; i++)
|
||||||
|
{
|
||||||
|
// Full duration of the hold note.
|
||||||
|
double duration = locations[i + 1].startTime - locations[i].startTime;
|
||||||
|
|
||||||
|
// Beat length at the end of the hold note.
|
||||||
|
double beatLength = beatmap.ControlPointInfo.TimingPointAt(locations[i + 1].startTime).BeatLength;
|
||||||
|
|
||||||
|
// Decrease the duration by at most a 1/4 beat to ensure there's no instantaneous notes.
|
||||||
|
duration = Math.Max(duration / 2, duration - beatLength / 4);
|
||||||
|
|
||||||
|
newColumnObjects.Add(new HoldNote
|
||||||
|
{
|
||||||
|
Column = column.Key,
|
||||||
|
StartTime = locations[i].startTime,
|
||||||
|
Duration = duration,
|
||||||
|
Samples = locations[i].samples,
|
||||||
|
NodeSamples = new List<IList<HitSampleInfo>>
|
||||||
|
{
|
||||||
|
locations[i].samples,
|
||||||
|
locations[i + 1].samples
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
newObjects.AddRange(newColumnObjects);
|
||||||
|
}
|
||||||
|
|
||||||
|
maniaBeatmap.HitObjects = newObjects.OrderBy(h => h.StartTime).ToList();
|
||||||
|
|
||||||
|
// No breaks
|
||||||
|
maniaBeatmap.Breaks.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
private readonly Container<DrawableHoldNoteTail> tailContainer;
|
private readonly Container<DrawableHoldNoteTail> tailContainer;
|
||||||
private readonly Container<DrawableHoldNoteTick> tickContainer;
|
private readonly Container<DrawableHoldNoteTick> tickContainer;
|
||||||
|
|
||||||
private readonly Drawable bodyPiece;
|
private readonly SkinnableDrawable bodyPiece;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Time at which the user started holding this hold note. Null if the user is not holding this hold note.
|
/// Time at which the user started holding this hold note. Null if the user is not holding this hold note.
|
||||||
@ -49,7 +49,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
|
|
||||||
AddRangeInternal(new[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
bodyPiece = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.HoldNoteBody, hitObject.Column), _ => new DefaultBodyPiece
|
bodyPiece = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.HoldNoteBody, hitObject.Column), _ => new DefaultBodyPiece
|
||||||
{
|
{
|
||||||
@ -135,6 +135,12 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
// Samples are played by the head/tail notes.
|
// Samples are played by the head/tail notes.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void OnKilled()
|
||||||
|
{
|
||||||
|
base.OnKilled();
|
||||||
|
(bodyPiece.Drawable as IHoldNoteBody)?.Recycle();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
@ -19,24 +19,17 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents length-wise portion of a hold note.
|
/// Represents length-wise portion of a hold note.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DefaultBodyPiece : CompositeDrawable
|
public class DefaultBodyPiece : CompositeDrawable, IHoldNoteBody
|
||||||
{
|
{
|
||||||
protected readonly Bindable<Color4> AccentColour = new Bindable<Color4>();
|
protected readonly Bindable<Color4> AccentColour = new Bindable<Color4>();
|
||||||
|
protected readonly IBindable<bool> IsHitting = new Bindable<bool>();
|
||||||
private readonly LayoutValue subtractionCache = new LayoutValue(Invalidation.DrawSize);
|
|
||||||
private readonly IBindable<bool> isHitting = new Bindable<bool>();
|
|
||||||
|
|
||||||
protected Drawable Background { get; private set; }
|
protected Drawable Background { get; private set; }
|
||||||
protected BufferedContainer Foreground { get; private set; }
|
private Container foregroundContainer;
|
||||||
|
|
||||||
private BufferedContainer subtractionContainer;
|
|
||||||
private Container subtractionLayer;
|
|
||||||
|
|
||||||
public DefaultBodyPiece()
|
public DefaultBodyPiece()
|
||||||
{
|
{
|
||||||
Blending = BlendingParameters.Additive;
|
Blending = BlendingParameters.Additive;
|
||||||
|
|
||||||
AddLayout(subtractionCache);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
@ -45,7 +38,54 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
|
|||||||
InternalChildren = new[]
|
InternalChildren = new[]
|
||||||
{
|
{
|
||||||
Background = new Box { RelativeSizeAxes = Axes.Both },
|
Background = new Box { RelativeSizeAxes = Axes.Both },
|
||||||
Foreground = new BufferedContainer
|
foregroundContainer = new Container { RelativeSizeAxes = Axes.Both }
|
||||||
|
};
|
||||||
|
|
||||||
|
if (drawableObject != null)
|
||||||
|
{
|
||||||
|
var holdNote = (DrawableHoldNote)drawableObject;
|
||||||
|
|
||||||
|
AccentColour.BindTo(drawableObject.AccentColour);
|
||||||
|
IsHitting.BindTo(holdNote.IsHitting);
|
||||||
|
}
|
||||||
|
|
||||||
|
AccentColour.BindValueChanged(onAccentChanged, true);
|
||||||
|
|
||||||
|
Recycle();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Recycle() => foregroundContainer.Child = CreateForeground();
|
||||||
|
|
||||||
|
protected virtual Drawable CreateForeground() => new ForegroundPiece
|
||||||
|
{
|
||||||
|
AccentColour = { BindTarget = AccentColour },
|
||||||
|
IsHitting = { BindTarget = IsHitting }
|
||||||
|
};
|
||||||
|
|
||||||
|
private void onAccentChanged(ValueChangedEvent<Color4> accent) => Background.Colour = accent.NewValue.Opacity(0.7f);
|
||||||
|
|
||||||
|
private class ForegroundPiece : CompositeDrawable
|
||||||
|
{
|
||||||
|
public readonly Bindable<Color4> AccentColour = new Bindable<Color4>();
|
||||||
|
public readonly IBindable<bool> IsHitting = new Bindable<bool>();
|
||||||
|
|
||||||
|
private readonly LayoutValue subtractionCache = new LayoutValue(Invalidation.DrawSize);
|
||||||
|
|
||||||
|
private BufferedContainer foregroundBuffer;
|
||||||
|
private BufferedContainer subtractionBuffer;
|
||||||
|
private Container subtractionLayer;
|
||||||
|
|
||||||
|
public ForegroundPiece()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
|
AddLayout(subtractionCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
InternalChild = foregroundBuffer = new BufferedContainer
|
||||||
{
|
{
|
||||||
Blending = BlendingParameters.Additive,
|
Blending = BlendingParameters.Additive,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -53,7 +93,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Box { RelativeSizeAxes = Axes.Both },
|
new Box { RelativeSizeAxes = Axes.Both },
|
||||||
subtractionContainer = new BufferedContainer
|
subtractionBuffer = new BufferedContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
// This is needed because we're blending with another object
|
// This is needed because we're blending with another object
|
||||||
@ -77,60 +117,51 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (drawableObject != null)
|
|
||||||
{
|
|
||||||
var holdNote = (DrawableHoldNote)drawableObject;
|
|
||||||
|
|
||||||
AccentColour.BindTo(drawableObject.AccentColour);
|
|
||||||
isHitting.BindTo(holdNote.IsHitting);
|
|
||||||
}
|
|
||||||
|
|
||||||
AccentColour.BindValueChanged(onAccentChanged, true);
|
|
||||||
isHitting.BindValueChanged(_ => onAccentChanged(new ValueChangedEvent<Color4>(AccentColour.Value, AccentColour.Value)), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onAccentChanged(ValueChangedEvent<Color4> accent)
|
|
||||||
{
|
|
||||||
Foreground.Colour = accent.NewValue.Opacity(0.5f);
|
|
||||||
Background.Colour = accent.NewValue.Opacity(0.7f);
|
|
||||||
|
|
||||||
const float animation_length = 50;
|
|
||||||
|
|
||||||
Foreground.ClearTransforms(false, nameof(Foreground.Colour));
|
|
||||||
|
|
||||||
if (isHitting.Value)
|
|
||||||
{
|
|
||||||
// wait for the next sync point
|
|
||||||
double synchronisedOffset = animation_length * 2 - Time.Current % (animation_length * 2);
|
|
||||||
using (Foreground.BeginDelayedSequence(synchronisedOffset))
|
|
||||||
Foreground.FadeColour(accent.NewValue.Lighten(0.2f), animation_length).Then().FadeColour(Foreground.Colour, animation_length).Loop();
|
|
||||||
}
|
|
||||||
|
|
||||||
subtractionCache.Invalidate();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Update()
|
|
||||||
{
|
|
||||||
base.Update();
|
|
||||||
|
|
||||||
if (!subtractionCache.IsValid)
|
|
||||||
{
|
|
||||||
subtractionLayer.Width = 5;
|
|
||||||
subtractionLayer.Height = Math.Max(0, DrawHeight - DrawWidth);
|
|
||||||
subtractionLayer.EdgeEffect = new EdgeEffectParameters
|
|
||||||
{
|
|
||||||
Colour = Color4.White,
|
|
||||||
Type = EdgeEffectType.Glow,
|
|
||||||
Radius = DrawWidth
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Foreground.ForceRedraw();
|
AccentColour.BindValueChanged(onAccentChanged, true);
|
||||||
subtractionContainer.ForceRedraw();
|
IsHitting.BindValueChanged(_ => onAccentChanged(new ValueChangedEvent<Color4>(AccentColour.Value, AccentColour.Value)), true);
|
||||||
|
}
|
||||||
|
|
||||||
subtractionCache.Validate();
|
private void onAccentChanged(ValueChangedEvent<Color4> accent)
|
||||||
|
{
|
||||||
|
foregroundBuffer.Colour = accent.NewValue.Opacity(0.5f);
|
||||||
|
|
||||||
|
const float animation_length = 50;
|
||||||
|
|
||||||
|
foregroundBuffer.ClearTransforms(false, nameof(foregroundBuffer.Colour));
|
||||||
|
|
||||||
|
if (IsHitting.Value)
|
||||||
|
{
|
||||||
|
// wait for the next sync point
|
||||||
|
double synchronisedOffset = animation_length * 2 - Time.Current % (animation_length * 2);
|
||||||
|
using (foregroundBuffer.BeginDelayedSequence(synchronisedOffset))
|
||||||
|
foregroundBuffer.FadeColour(accent.NewValue.Lighten(0.2f), animation_length).Then().FadeColour(foregroundBuffer.Colour, animation_length).Loop();
|
||||||
|
}
|
||||||
|
|
||||||
|
subtractionCache.Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
if (!subtractionCache.IsValid)
|
||||||
|
{
|
||||||
|
subtractionLayer.Width = 5;
|
||||||
|
subtractionLayer.Height = Math.Max(0, DrawHeight - DrawWidth);
|
||||||
|
subtractionLayer.EdgeEffect = new EdgeEffectParameters
|
||||||
|
{
|
||||||
|
Colour = Color4.White,
|
||||||
|
Type = EdgeEffectType.Glow,
|
||||||
|
Radius = DrawWidth
|
||||||
|
};
|
||||||
|
|
||||||
|
foregroundBuffer.ForceRedraw();
|
||||||
|
subtractionBuffer.ForceRedraw();
|
||||||
|
|
||||||
|
subtractionCache.Validate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interface for mania hold note bodies.
|
||||||
|
/// </summary>
|
||||||
|
public interface IHoldNoteBody
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Recycles the contents of this <see cref="IHoldNoteBody"/> to free used resources.
|
||||||
|
/// </summary>
|
||||||
|
void Recycle();
|
||||||
|
}
|
||||||
|
}
|
@ -102,14 +102,14 @@ namespace osu.Game.Rulesets.Mania.Objects
|
|||||||
{
|
{
|
||||||
StartTime = StartTime,
|
StartTime = StartTime,
|
||||||
Column = Column,
|
Column = Column,
|
||||||
Samples = getNodeSamples(0),
|
Samples = GetNodeSamples(0),
|
||||||
});
|
});
|
||||||
|
|
||||||
AddNested(Tail = new TailNote
|
AddNested(Tail = new TailNote
|
||||||
{
|
{
|
||||||
StartTime = EndTime,
|
StartTime = EndTime,
|
||||||
Column = Column,
|
Column = Column,
|
||||||
Samples = getNodeSamples((NodeSamples?.Count - 1) ?? 1),
|
Samples = GetNodeSamples((NodeSamples?.Count - 1) ?? 1),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ namespace osu.Game.Rulesets.Mania.Objects
|
|||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||||
|
|
||||||
private IList<HitSampleInfo> getNodeSamples(int nodeIndex) =>
|
public IList<HitSampleInfo> GetNodeSamples(int nodeIndex) =>
|
||||||
nodeIndex < NodeSamples?.Count ? NodeSamples[nodeIndex] : Samples;
|
nodeIndex < NodeSamples?.Count ? NodeSamples[nodeIndex] : Samples;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Animations;
|
using osu.Framework.Graphics.Animations;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
|
using osu.Game.Rulesets.Mania.Judgements;
|
||||||
using osu.Game.Rulesets.Mania.UI;
|
using osu.Game.Rulesets.Mania.UI;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
@ -66,6 +67,9 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
|||||||
|
|
||||||
public void Animate(JudgementResult result)
|
public void Animate(JudgementResult result)
|
||||||
{
|
{
|
||||||
|
if (result.Judgement is HoldNoteTickJudgement)
|
||||||
|
return;
|
||||||
|
|
||||||
(explosion as IFramedAnimation)?.GotoFrame(0);
|
(explosion as IFramedAnimation)?.GotoFrame(0);
|
||||||
|
|
||||||
explosion?.FadeInFromZero(80)
|
explosion?.FadeInFromZero(80)
|
||||||
|
@ -31,12 +31,12 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The minimum time range. This occurs at a <see cref="relativeTimeRange"/> of 40.
|
/// The minimum time range. This occurs at a <see cref="relativeTimeRange"/> of 40.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const double MIN_TIME_RANGE = 150;
|
public const double MIN_TIME_RANGE = 340;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum time range. This occurs at a <see cref="relativeTimeRange"/> of 1.
|
/// The maximum time range. This occurs at a <see cref="relativeTimeRange"/> of 1.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const double MAX_TIME_RANGE = 6000;
|
public const double MAX_TIME_RANGE = 13720;
|
||||||
|
|
||||||
protected new ManiaPlayfield Playfield => (ManiaPlayfield)base.Playfield;
|
protected new ManiaPlayfield Playfield => (ManiaPlayfield)base.Playfield;
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
|
|
||||||
public class OsuSpinnerBonusTickJudgement : OsuSpinnerTickJudgement
|
public class OsuSpinnerBonusTickJudgement : OsuSpinnerTickJudgement
|
||||||
{
|
{
|
||||||
protected override int NumericResultFor(HitResult result) => SCORE_PER_TICK;
|
protected override int NumericResultFor(HitResult result) => result == MaxResult ? SCORE_PER_TICK : 0;
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result) => base.HealthIncreaseFor(result) * 2;
|
protected override double HealthIncreaseFor(HitResult result) => base.HealthIncreaseFor(result) * 2;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
{
|
{
|
||||||
public override bool AffectsCombo => false;
|
public override bool AffectsCombo => false;
|
||||||
|
|
||||||
protected override int NumericResultFor(HitResult result) => SCORE_PER_TICK;
|
protected override int NumericResultFor(HitResult result) => result == MaxResult ? SCORE_PER_TICK : 0;
|
||||||
|
|
||||||
protected override double HealthIncreaseFor(HitResult result) => result == MaxResult ? 0.6 * base.HealthIncreaseFor(result) : 0;
|
protected override double HealthIncreaseFor(HitResult result) => result == MaxResult ? 0.6 * base.HealthIncreaseFor(result) : 0;
|
||||||
}
|
}
|
||||||
|
41
osu.Game.Tests/Gameplay/TestSceneScoreProcessor.cs
Normal file
41
osu.Game.Tests/Gameplay/TestSceneScoreProcessor.cs
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Testing;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Judgements;
|
||||||
|
using osu.Game.Rulesets.Objects;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
using osu.Game.Tests.Visual;
|
||||||
|
|
||||||
|
namespace osu.Game.Tests.Gameplay
|
||||||
|
{
|
||||||
|
[HeadlessTest]
|
||||||
|
public class TestSceneScoreProcessor : OsuTestScene
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public void TestNoScoreIncreaseFromMiss()
|
||||||
|
{
|
||||||
|
var beatmap = new Beatmap<TestHitObject> { HitObjects = { new TestHitObject() } };
|
||||||
|
|
||||||
|
var scoreProcessor = new ScoreProcessor();
|
||||||
|
scoreProcessor.ApplyBeatmap(beatmap);
|
||||||
|
|
||||||
|
// Apply a miss judgement
|
||||||
|
scoreProcessor.ApplyResult(new JudgementResult(new TestHitObject(), new TestJudgement()) { Type = HitResult.Miss });
|
||||||
|
|
||||||
|
Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(0.0));
|
||||||
|
}
|
||||||
|
|
||||||
|
private class TestHitObject : HitObject
|
||||||
|
{
|
||||||
|
public override Judgement CreateJudgement() => new TestJudgement();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class TestJudgement : Judgement
|
||||||
|
{
|
||||||
|
protected override int NumericResultFor(HitResult result) => 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -71,7 +71,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
AddStep("load dummy beatmap", () => ResetPlayer(false, () => SelectedMods.Value = new[] { new OsuModNightcore() }));
|
AddStep("load dummy beatmap", () => ResetPlayer(false, () => SelectedMods.Value = new[] { new OsuModNightcore() }));
|
||||||
AddUntilStep("wait for current", () => loader.IsCurrentScreen());
|
AddUntilStep("wait for current", () => loader.IsCurrentScreen());
|
||||||
AddAssert("mod rate applied", () => MusicController.CurrentTrack.Rate != 1);
|
|
||||||
AddStep("exit loader", () => loader.Exit());
|
AddStep("exit loader", () => loader.Exit());
|
||||||
AddUntilStep("wait for not current", () => !loader.IsCurrentScreen());
|
AddUntilStep("wait for not current", () => !loader.IsCurrentScreen());
|
||||||
AddAssert("player did not load", () => player == null);
|
AddAssert("player did not load", () => player == null);
|
||||||
|
@ -20,7 +20,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
TextSize = 40,
|
|
||||||
Margin = new MarginPadding(20),
|
Margin = new MarginPadding(20),
|
||||||
};
|
};
|
||||||
Add(score);
|
Add(score);
|
||||||
@ -30,7 +29,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Margin = new MarginPadding(10),
|
Margin = new MarginPadding(10),
|
||||||
TextSize = 40,
|
|
||||||
};
|
};
|
||||||
Add(comboCounter);
|
Add(comboCounter);
|
||||||
|
|
||||||
|
@ -4,8 +4,10 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.Toolbar;
|
using osu.Game.Overlays.Toolbar;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
@ -15,7 +17,7 @@ namespace osu.Game.Tests.Visual.Menus
|
|||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestSceneToolbar : OsuManualInputManagerTestScene
|
public class TestSceneToolbar : OsuManualInputManagerTestScene
|
||||||
{
|
{
|
||||||
private Toolbar toolbar;
|
private TestToolbar toolbar;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private RulesetStore rulesets { get; set; }
|
private RulesetStore rulesets { get; set; }
|
||||||
@ -23,7 +25,7 @@ namespace osu.Game.Tests.Visual.Menus
|
|||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp() => Schedule(() =>
|
public void SetUp() => Schedule(() =>
|
||||||
{
|
{
|
||||||
Child = toolbar = new Toolbar { State = { Value = Visibility.Visible } };
|
Child = toolbar = new TestToolbar { State = { Value = Visibility.Visible } };
|
||||||
});
|
});
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -72,5 +74,24 @@ namespace osu.Game.Tests.Visual.Menus
|
|||||||
AddUntilStep("ruleset switched", () => rulesetSelector.Current.Value.Equals(expected));
|
AddUntilStep("ruleset switched", () => rulesetSelector.Current.Value.Equals(expected));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestCase(OverlayActivation.All)]
|
||||||
|
[TestCase(OverlayActivation.Disabled)]
|
||||||
|
public void TestRespectsOverlayActivation(OverlayActivation mode)
|
||||||
|
{
|
||||||
|
AddStep($"set activation mode to {mode}", () => toolbar.OverlayActivationMode.Value = mode);
|
||||||
|
AddStep("hide toolbar", () => toolbar.Hide());
|
||||||
|
AddStep("try to show toolbar", () => toolbar.Show());
|
||||||
|
|
||||||
|
if (mode == OverlayActivation.Disabled)
|
||||||
|
AddAssert("toolbar still hidden", () => toolbar.State.Value == Visibility.Hidden);
|
||||||
|
else
|
||||||
|
AddAssert("toolbar is visible", () => toolbar.State.Value == Visibility.Visible);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TestToolbar : Toolbar
|
||||||
|
{
|
||||||
|
public new Bindable<OverlayActivation> OverlayActivationMode => base.OverlayActivationMode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Tournament.IPC;
|
using osu.Game.Tournament.IPC;
|
||||||
using osu.Game.Tournament.Models;
|
using osu.Game.Tournament.Models;
|
||||||
@ -127,21 +128,29 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
|
|||||||
|
|
||||||
private class MatchScoreCounter : ScoreCounter
|
private class MatchScoreCounter : ScoreCounter
|
||||||
{
|
{
|
||||||
|
private OsuSpriteText displayedSpriteText;
|
||||||
|
|
||||||
public MatchScoreCounter()
|
public MatchScoreCounter()
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Top = bar_height, Horizontal = 10 };
|
Margin = new MarginPadding { Top = bar_height, Horizontal = 10 };
|
||||||
|
|
||||||
Winning = false;
|
|
||||||
|
|
||||||
DisplayedCountSpriteText.Spacing = new Vector2(-6);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Winning
|
public bool Winning
|
||||||
{
|
{
|
||||||
set => DisplayedCountSpriteText.Font = value
|
set => updateFont(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override OsuSpriteText CreateSpriteText() => base.CreateSpriteText().With(s =>
|
||||||
|
{
|
||||||
|
displayedSpriteText = s;
|
||||||
|
displayedSpriteText.Spacing = new Vector2(-6);
|
||||||
|
updateFont(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
private void updateFont(bool winning)
|
||||||
|
=> displayedSpriteText.Font = winning
|
||||||
? OsuFont.Torus.With(weight: FontWeight.Bold, size: 50, fixedWidth: true)
|
? OsuFont.Torus.With(weight: FontWeight.Bold, size: 50, fixedWidth: true)
|
||||||
: OsuFont.Torus.With(weight: FontWeight.Regular, size: 40, fixedWidth: true);
|
: OsuFont.Torus.With(weight: FontWeight.Regular, size: 40, fixedWidth: true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ namespace osu.Game.Tournament
|
|||||||
public static readonly Color4 TEXT_COLOUR = Color4Extensions.FromHex("#fff");
|
public static readonly Color4 TEXT_COLOUR = Color4Extensions.FromHex("#fff");
|
||||||
private Drawable heightWarning;
|
private Drawable heightWarning;
|
||||||
private Bindable<Size> windowSize;
|
private Bindable<Size> windowSize;
|
||||||
|
private Bindable<WindowMode> windowMode;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(FrameworkConfigManager frameworkConfig)
|
private void load(FrameworkConfigManager frameworkConfig)
|
||||||
@ -43,6 +44,12 @@ namespace osu.Game.Tournament
|
|||||||
heightWarning.Alpha = size.NewValue.Width < minWidth ? 1 : 0;
|
heightWarning.Alpha = size.NewValue.Width < minWidth ? 1 : 0;
|
||||||
}), true);
|
}), true);
|
||||||
|
|
||||||
|
windowMode = frameworkConfig.GetBindable<WindowMode>(FrameworkSetting.WindowMode);
|
||||||
|
windowMode.BindValueChanged(mode => ScheduleAfterChildren(() =>
|
||||||
|
{
|
||||||
|
windowMode.Value = WindowMode.Windowed;
|
||||||
|
}), true);
|
||||||
|
|
||||||
AddRange(new[]
|
AddRange(new[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
|
@ -109,6 +109,15 @@ namespace osu.Game.Beatmaps
|
|||||||
// Convert
|
// Convert
|
||||||
IBeatmap converted = converter.Convert();
|
IBeatmap converted = converter.Convert();
|
||||||
|
|
||||||
|
// Apply conversion mods to the result
|
||||||
|
foreach (var mod in mods.OfType<IApplicableAfterBeatmapConversion>())
|
||||||
|
{
|
||||||
|
if (cancellationSource.IsCancellationRequested)
|
||||||
|
throw new BeatmapLoadTimeoutException(BeatmapInfo);
|
||||||
|
|
||||||
|
mod.ApplyToBeatmap(converted);
|
||||||
|
}
|
||||||
|
|
||||||
// Apply difficulty mods
|
// Apply difficulty mods
|
||||||
if (mods.Any(m => m is IApplicableToDifficulty))
|
if (mods.Any(m => m is IApplicableToDifficulty))
|
||||||
{
|
{
|
||||||
|
@ -74,9 +74,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected override Color4 SelectionColour => new Color4(249, 90, 255, 255);
|
protected override Color4 SelectionColour => new Color4(249, 90, 255, 255);
|
||||||
|
|
||||||
protected override void OnTextAdded(string added)
|
protected override void OnUserTextAdded(string added)
|
||||||
{
|
{
|
||||||
base.OnTextAdded(added);
|
base.OnUserTextAdded(added);
|
||||||
|
|
||||||
if (added.Any(char.IsUpper) && AllowUniqueCharacterSamples)
|
if (added.Any(char.IsUpper) && AllowUniqueCharacterSamples)
|
||||||
capsTextAddedSample?.Play();
|
capsTextAddedSample?.Play();
|
||||||
@ -84,9 +84,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
textAddedSamples[RNG.Next(0, 3)]?.Play();
|
textAddedSamples[RNG.Next(0, 3)]?.Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnTextRemoved(string removed)
|
protected override void OnUserTextRemoved(string removed)
|
||||||
{
|
{
|
||||||
base.OnTextRemoved(removed);
|
base.OnUserTextRemoved(removed);
|
||||||
|
|
||||||
textRemovedSample?.Play();
|
textRemovedSample?.Play();
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Utils;
|
using osu.Game.Utils;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
@ -23,12 +25,11 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
public PercentageCounter()
|
public PercentageCounter()
|
||||||
{
|
{
|
||||||
DisplayedCountSpriteText.Font = DisplayedCountSpriteText.Font.With(fixedWidth: true);
|
|
||||||
Current.Value = DisplayedCount = 1.0f;
|
Current.Value = DisplayedCount = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours) => AccentColour = colours.BlueLighter;
|
private void load(OsuColour colours) => Colour = colours.BlueLighter;
|
||||||
|
|
||||||
protected override string FormatCount(double count) => count.FormatAccuracy();
|
protected override string FormatCount(double count) => count.FormatAccuracy();
|
||||||
|
|
||||||
@ -37,6 +38,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
return Math.Abs(currentValue - newValue) * RollingDuration * 100.0f;
|
return Math.Abs(currentValue - newValue) * RollingDuration * 100.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override OsuSpriteText CreateSpriteText()
|
||||||
|
=> base.CreateSpriteText().With(s => s.Font = s.Font.With(size: 20f, fixedWidth: true));
|
||||||
|
|
||||||
public override void Increment(double amount)
|
public override void Increment(double amount)
|
||||||
{
|
{
|
||||||
Current.Value += amount;
|
Current.Value += amount;
|
||||||
|
@ -7,12 +7,12 @@ using osu.Framework.Graphics.Sprites;
|
|||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osuTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
public abstract class RollingCounter<T> : Container, IHasAccentColour
|
public abstract class RollingCounter<T> : Container
|
||||||
where T : struct, IEquatable<T>
|
where T : struct, IEquatable<T>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -20,7 +20,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Bindable<T> Current = new Bindable<T>();
|
public Bindable<T> Current = new Bindable<T>();
|
||||||
|
|
||||||
protected SpriteText DisplayedCountSpriteText;
|
private SpriteText displayedCountSpriteText;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If true, the roll-up duration will be proportional to change in value.
|
/// If true, the roll-up duration will be proportional to change in value.
|
||||||
@ -46,57 +46,39 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
public virtual T DisplayedCount
|
public virtual T DisplayedCount
|
||||||
{
|
{
|
||||||
get => displayedCount;
|
get => displayedCount;
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (EqualityComparer<T>.Default.Equals(displayedCount, value))
|
if (EqualityComparer<T>.Default.Equals(displayedCount, value))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
displayedCount = value;
|
displayedCount = value;
|
||||||
DisplayedCountSpriteText.Text = FormatCount(value);
|
if (displayedCountSpriteText != null)
|
||||||
|
displayedCountSpriteText.Text = FormatCount(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void Increment(T amount);
|
public abstract void Increment(T amount);
|
||||||
|
|
||||||
public float TextSize
|
|
||||||
{
|
|
||||||
get => DisplayedCountSpriteText.Font.Size;
|
|
||||||
set => DisplayedCountSpriteText.Font = DisplayedCountSpriteText.Font.With(size: value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Color4 AccentColour
|
|
||||||
{
|
|
||||||
get => DisplayedCountSpriteText.Colour;
|
|
||||||
set => DisplayedCountSpriteText.Colour = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Skeleton of a numeric counter which value rolls over time.
|
/// Skeleton of a numeric counter which value rolls over time.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected RollingCounter()
|
protected RollingCounter()
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
DisplayedCountSpriteText = new OsuSpriteText { Font = OsuFont.Numeric }
|
|
||||||
};
|
|
||||||
|
|
||||||
TextSize = 40;
|
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
DisplayedCount = Current.Value;
|
|
||||||
|
|
||||||
Current.ValueChanged += val =>
|
Current.ValueChanged += val =>
|
||||||
{
|
{
|
||||||
if (IsLoaded) TransformCount(displayedCount, val.NewValue);
|
if (IsLoaded)
|
||||||
|
TransformCount(DisplayedCount, val.NewValue);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
displayedCountSpriteText = CreateSpriteText();
|
||||||
|
displayedCountSpriteText.Text = FormatCount(DisplayedCount);
|
||||||
DisplayedCountSpriteText.Text = FormatCount(Current.Value);
|
Child = displayedCountSpriteText;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -167,5 +149,10 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
this.TransformTo(nameof(DisplayedCount), newValue, rollingTotalDuration, RollingEasing);
|
this.TransformTo(nameof(DisplayedCount), newValue, rollingTotalDuration, RollingEasing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual OsuSpriteText CreateSpriteText() => new OsuSpriteText
|
||||||
|
{
|
||||||
|
Font = OsuFont.Numeric.With(size: 40f),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
@ -24,12 +25,11 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
/// <param name="leading">How many leading zeroes the counter will have.</param>
|
/// <param name="leading">How many leading zeroes the counter will have.</param>
|
||||||
public ScoreCounter(uint leading = 0)
|
public ScoreCounter(uint leading = 0)
|
||||||
{
|
{
|
||||||
DisplayedCountSpriteText.Font = DisplayedCountSpriteText.Font.With(fixedWidth: true);
|
|
||||||
LeadingZeroes = leading;
|
LeadingZeroes = leading;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours) => AccentColour = colours.BlueLighter;
|
private void load(OsuColour colours) => Colour = colours.BlueLighter;
|
||||||
|
|
||||||
protected override double GetProportionalDuration(double currentValue, double newValue)
|
protected override double GetProportionalDuration(double currentValue, double newValue)
|
||||||
{
|
{
|
||||||
@ -49,6 +49,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
return ((long)count).ToString(format);
|
return ((long)count).ToString(format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override OsuSpriteText CreateSpriteText()
|
||||||
|
=> base.CreateSpriteText().With(s => s.Font = s.Font.With(fixedWidth: true));
|
||||||
|
|
||||||
public override void Increment(double amount)
|
public override void Increment(double amount)
|
||||||
{
|
{
|
||||||
Current.Value += amount;
|
Current.Value += amount;
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
@ -19,7 +21,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours) => AccentColour = colours.BlueLighter;
|
private void load(OsuColour colours) => Colour = colours.BlueLighter;
|
||||||
|
|
||||||
protected override string FormatCount(int count)
|
protected override string FormatCount(int count)
|
||||||
{
|
{
|
||||||
@ -35,5 +37,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
Current.Value += amount;
|
Current.Value += amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override OsuSpriteText CreateSpriteText()
|
||||||
|
=> base.CreateSpriteText().With(s => s.Font = s.Font.With(size: 20f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,7 @@ namespace osu.Game.Input.Bindings
|
|||||||
public IEnumerable<KeyBinding> InGameKeyBindings => new[]
|
public IEnumerable<KeyBinding> InGameKeyBindings => new[]
|
||||||
{
|
{
|
||||||
new KeyBinding(InputKey.Space, GlobalAction.SkipCutscene),
|
new KeyBinding(InputKey.Space, GlobalAction.SkipCutscene),
|
||||||
|
new KeyBinding(InputKey.ExtraMouseButton2, GlobalAction.SkipCutscene),
|
||||||
new KeyBinding(InputKey.Tilde, GlobalAction.QuickRetry),
|
new KeyBinding(InputKey.Tilde, GlobalAction.QuickRetry),
|
||||||
new KeyBinding(new[] { InputKey.Control, InputKey.Tilde }, GlobalAction.QuickExit),
|
new KeyBinding(new[] { InputKey.Control, InputKey.Tilde }, GlobalAction.QuickExit),
|
||||||
new KeyBinding(new[] { InputKey.Control, InputKey.Plus }, GlobalAction.IncreaseScrollSpeed),
|
new KeyBinding(new[] { InputKey.Control, InputKey.Plus }, GlobalAction.IncreaseScrollSpeed),
|
||||||
|
@ -82,20 +82,10 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new RankLabel(rank)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = rank_width,
|
Width = rank_width,
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Font = OsuFont.GetFont(size: 20, italics: true),
|
|
||||||
Text = rank == null ? "-" : rank.Value.ToMetric(decimals: rank < 100000 ? 1 : 0),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
content = new Container
|
content = new Container
|
||||||
{
|
{
|
||||||
@ -356,6 +346,25 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class RankLabel : Container, IHasTooltip
|
||||||
|
{
|
||||||
|
public RankLabel(int? rank)
|
||||||
|
{
|
||||||
|
if (rank >= 1000)
|
||||||
|
TooltipText = $"#{rank:N0}";
|
||||||
|
|
||||||
|
Child = new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Font = OsuFont.GetFont(size: 20, italics: true),
|
||||||
|
Text = rank == null ? "-" : rank.Value.ToMetric(decimals: rank < 100000 ? 1 : 0),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public string TooltipText { get; }
|
||||||
|
}
|
||||||
|
|
||||||
public class LeaderboardScoreStatistic
|
public class LeaderboardScoreStatistic
|
||||||
{
|
{
|
||||||
public IconUsage Icon;
|
public IconUsage Icon;
|
||||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
|
|
||||||
private const double transition_time = 500;
|
private const double transition_time = 500;
|
||||||
|
|
||||||
private readonly Bindable<OverlayActivation> overlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
|
protected readonly Bindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
|
||||||
|
|
||||||
// Toolbar components like RulesetSelector should receive keyboard input events even when the toolbar is hidden.
|
// Toolbar components like RulesetSelector should receive keyboard input events even when the toolbar is hidden.
|
||||||
public override bool PropagateNonPositionalInputSubTree => true;
|
public override bool PropagateNonPositionalInputSubTree => true;
|
||||||
@ -89,14 +89,8 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
// Bound after the selector is added to the hierarchy to give it a chance to load the available rulesets
|
// Bound after the selector is added to the hierarchy to give it a chance to load the available rulesets
|
||||||
rulesetSelector.Current.BindTo(parentRuleset);
|
rulesetSelector.Current.BindTo(parentRuleset);
|
||||||
|
|
||||||
State.ValueChanged += visibility =>
|
|
||||||
{
|
|
||||||
if (overlayActivationMode.Value == OverlayActivation.Disabled)
|
|
||||||
Hide();
|
|
||||||
};
|
|
||||||
|
|
||||||
if (osuGame != null)
|
if (osuGame != null)
|
||||||
overlayActivationMode.BindTo(osuGame.OverlayActivationMode);
|
OverlayActivationMode.BindTo(osuGame.OverlayActivationMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ToolbarBackground : Container
|
public class ToolbarBackground : Container
|
||||||
@ -137,6 +131,17 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void UpdateState(ValueChangedEvent<Visibility> state)
|
||||||
|
{
|
||||||
|
if (state.NewValue == Visibility.Visible && OverlayActivationMode.Value == OverlayActivation.Disabled)
|
||||||
|
{
|
||||||
|
State.Value = Visibility.Hidden;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
base.UpdateState(state);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void PopIn()
|
protected override void PopIn()
|
||||||
{
|
{
|
||||||
this.MoveToY(0, transition_time, Easing.OutQuint);
|
this.MoveToY(0, transition_time, Easing.OutQuint);
|
||||||
|
19
osu.Game/Rulesets/Mods/IApplicableAfterBeatmapConversion.cs
Normal file
19
osu.Game/Rulesets/Mods/IApplicableAfterBeatmapConversion.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Mods
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interface for a <see cref="Mod"/> that applies changes to the <see cref="IBeatmap"/> generated by the <see cref="BeatmapConverter{TObject}"/>.
|
||||||
|
/// </summary>
|
||||||
|
public interface IApplicableAfterBeatmapConversion : IApplicableMod
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Applies this <see cref="Mod"/> to the <see cref="IBeatmap"/> after conversion has taken place.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="beatmap">The converted <see cref="IBeatmap"/>.</param>
|
||||||
|
void ApplyToBeatmap(IBeatmap beatmap);
|
||||||
|
}
|
||||||
|
}
|
@ -133,17 +133,19 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double scoreIncrease = result.Type == HitResult.Miss ? 0 : result.Judgement.NumericResultFor(result);
|
||||||
|
|
||||||
if (result.Judgement.IsBonus)
|
if (result.Judgement.IsBonus)
|
||||||
{
|
{
|
||||||
if (result.IsHit)
|
if (result.IsHit)
|
||||||
bonusScore += result.Judgement.NumericResultFor(result);
|
bonusScore += scoreIncrease;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (result.HasResult)
|
if (result.HasResult)
|
||||||
scoreResultCounts[result.Type] = scoreResultCounts.GetOrDefault(result.Type) + 1;
|
scoreResultCounts[result.Type] = scoreResultCounts.GetOrDefault(result.Type) + 1;
|
||||||
|
|
||||||
baseScore += result.Judgement.NumericResultFor(result);
|
baseScore += scoreIncrease;
|
||||||
rollingMaxBaseScore += result.Judgement.MaxNumericResult;
|
rollingMaxBaseScore += result.Judgement.MaxNumericResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,17 +171,19 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
if (result.FailedAtJudgement)
|
if (result.FailedAtJudgement)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
double scoreIncrease = result.Type == HitResult.Miss ? 0 : result.Judgement.NumericResultFor(result);
|
||||||
|
|
||||||
if (result.Judgement.IsBonus)
|
if (result.Judgement.IsBonus)
|
||||||
{
|
{
|
||||||
if (result.IsHit)
|
if (result.IsHit)
|
||||||
bonusScore -= result.Judgement.NumericResultFor(result);
|
bonusScore -= scoreIncrease;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (result.HasResult)
|
if (result.HasResult)
|
||||||
scoreResultCounts[result.Type] = scoreResultCounts.GetOrDefault(result.Type) - 1;
|
scoreResultCounts[result.Type] = scoreResultCounts.GetOrDefault(result.Type) - 1;
|
||||||
|
|
||||||
baseScore -= result.Judgement.NumericResultFor(result);
|
baseScore -= scoreIncrease;
|
||||||
rollingMaxBaseScore -= result.Judgement.MaxNumericResult;
|
rollingMaxBaseScore -= result.Judgement.MaxNumericResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +232,6 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
protected virtual RollingCounter<double> CreateAccuracyCounter() => new PercentageCounter
|
protected virtual RollingCounter<double> CreateAccuracyCounter() => new PercentageCounter
|
||||||
{
|
{
|
||||||
TextSize = 20,
|
|
||||||
BypassAutoSizeAxes = Axes.X,
|
BypassAutoSizeAxes = Axes.X,
|
||||||
Anchor = Anchor.TopLeft,
|
Anchor = Anchor.TopLeft,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
@ -241,14 +240,12 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
protected virtual ScoreCounter CreateScoreCounter() => new ScoreCounter(6)
|
protected virtual ScoreCounter CreateScoreCounter() => new ScoreCounter(6)
|
||||||
{
|
{
|
||||||
TextSize = 40,
|
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected virtual RollingCounter<int> CreateComboCounter() => new SimpleComboCounter
|
protected virtual RollingCounter<int> CreateComboCounter() => new SimpleComboCounter
|
||||||
{
|
{
|
||||||
TextSize = 20,
|
|
||||||
BypassAutoSizeAxes = Axes.X,
|
BypassAutoSizeAxes = Axes.X,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopLeft,
|
Origin = Anchor.TopLeft,
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
||||||
using osu.Game.Utils;
|
using osu.Game.Utils;
|
||||||
@ -43,16 +44,16 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
|||||||
|
|
||||||
protected override Easing RollingEasing => AccuracyCircle.ACCURACY_TRANSFORM_EASING;
|
protected override Easing RollingEasing => AccuracyCircle.ACCURACY_TRANSFORM_EASING;
|
||||||
|
|
||||||
public Counter()
|
|
||||||
{
|
|
||||||
DisplayedCountSpriteText.Font = OsuFont.Torus.With(size: 20, fixedWidth: true);
|
|
||||||
DisplayedCountSpriteText.Spacing = new Vector2(-2, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override string FormatCount(double count) => count.FormatAccuracy();
|
protected override string FormatCount(double count) => count.FormatAccuracy();
|
||||||
|
|
||||||
public override void Increment(double amount)
|
public override void Increment(double amount)
|
||||||
=> Current.Value += amount;
|
=> Current.Value += amount;
|
||||||
|
|
||||||
|
protected override OsuSpriteText CreateSpriteText() => base.CreateSpriteText().With(s =>
|
||||||
|
{
|
||||||
|
s.Font = OsuFont.Torus.With(size: 20, fixedWidth: true);
|
||||||
|
s.Spacing = new Vector2(-2, 0);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -43,11 +44,11 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
|||||||
|
|
||||||
protected override Easing RollingEasing => AccuracyCircle.ACCURACY_TRANSFORM_EASING;
|
protected override Easing RollingEasing => AccuracyCircle.ACCURACY_TRANSFORM_EASING;
|
||||||
|
|
||||||
public Counter()
|
protected override OsuSpriteText CreateSpriteText() => base.CreateSpriteText().With(s =>
|
||||||
{
|
{
|
||||||
DisplayedCountSpriteText.Font = OsuFont.Torus.With(size: 20, fixedWidth: true);
|
s.Font = OsuFont.Torus.With(size: 20, fixedWidth: true);
|
||||||
DisplayedCountSpriteText.Spacing = new Vector2(-2, 0);
|
s.Spacing = new Vector2(-2, 0);
|
||||||
}
|
});
|
||||||
|
|
||||||
public override void Increment(int amount)
|
public override void Increment(int amount)
|
||||||
=> Current.Value += amount;
|
=> Current.Value += amount;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -23,15 +24,19 @@ namespace osu.Game.Screens.Ranking.Expanded
|
|||||||
// Todo: AutoSize X removed here due to https://github.com/ppy/osu-framework/issues/3369
|
// Todo: AutoSize X removed here due to https://github.com/ppy/osu-framework/issues/3369
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
DisplayedCountSpriteText.Anchor = Anchor.TopCentre;
|
|
||||||
DisplayedCountSpriteText.Origin = Anchor.TopCentre;
|
|
||||||
|
|
||||||
DisplayedCountSpriteText.Font = OsuFont.Torus.With(size: 60, weight: FontWeight.Light, fixedWidth: true);
|
|
||||||
DisplayedCountSpriteText.Spacing = new Vector2(-5, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string FormatCount(long count) => count.ToString("N0");
|
protected override string FormatCount(long count) => count.ToString("N0");
|
||||||
|
|
||||||
|
protected override OsuSpriteText CreateSpriteText() => base.CreateSpriteText().With(s =>
|
||||||
|
{
|
||||||
|
s.Anchor = Anchor.TopCentre;
|
||||||
|
s.Origin = Anchor.TopCentre;
|
||||||
|
|
||||||
|
s.Font = OsuFont.Torus.With(size: 60, weight: FontWeight.Light, fixedWidth: true);
|
||||||
|
s.Spacing = new Vector2(-5, 0);
|
||||||
|
});
|
||||||
|
|
||||||
public override void Increment(long amount)
|
public override void Increment(long amount)
|
||||||
=> Current.Value += amount;
|
=> Current.Value += amount;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.814.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.819.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.812.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.812.0" />
|
||||||
<PackageReference Include="Sentry" Version="2.1.5" />
|
<PackageReference Include="Sentry" Version="2.1.5" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.814.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.819.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.812.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.812.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
||||||
@ -80,7 +80,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.814.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.819.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user