1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 19:12:54 +08:00

Merge pull request #4264 from nekodex/legacy-hitcircleoverlap-support

Add support for the HitCircleOverlap property of legacy skins
This commit is contained in:
Dean Herbert 2019-02-15 21:27:56 +09:00 committed by GitHub
commit bd4e8e132b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,36 @@
// 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.Beatmaps;
using osu.Game.Rulesets.Osu.Objects;
using osuTK;
namespace osu.Game.Rulesets.Osu.Tests
{
[TestFixture]
public class TestCaseHitCircleLongCombo : Game.Tests.Visual.TestCasePlayer
{
public TestCaseHitCircleLongCombo()
: base(new OsuRuleset())
{
}
protected override IBeatmap CreateBeatmap(Ruleset ruleset)
{
var beatmap = new Beatmap
{
BeatmapInfo = new BeatmapInfo
{
BaseDifficulty = new BeatmapDifficulty { CircleSize = 6 },
Ruleset = ruleset.RulesetInfo
}
};
for (int i = 0; i < 512; i++)
beatmap.HitObjects.Add(new HitCircle { Position = new Vector2(256, 192), StartTime = i * 100 });
return beatmap;
}
}
}

View File

@ -58,7 +58,14 @@ namespace osu.Game.Skinning
componentName = "hit300";
break;
case "Play/osu/number-text":
return !hasFont(Configuration.HitCircleFont) ? null : new LegacySpriteText(Textures, Configuration.HitCircleFont) { Scale = new Vector2(0.96f) };
return !hasFont(Configuration.HitCircleFont)
? null
: new LegacySpriteText(Textures, Configuration.HitCircleFont)
{
Scale = new Vector2(0.96f),
// Spacing value was reverse-engineered from the ratio of the rendered sprite size in the visual inspector vs the actual texture size
Spacing = new Vector2(-Configuration.HitCircleOverlap * 0.89f, 0)
};
}
var texture = GetTexture(componentName);

View File

@ -46,6 +46,9 @@ namespace osu.Game.Skinning
case "HitCirclePrefix":
skin.HitCircleFont = pair.Value;
break;
case "HitCircleOverlap":
skin.HitCircleOverlap = int.Parse(pair.Value);
break;
}
break;

View File

@ -23,6 +23,8 @@ namespace osu.Game.Skinning
public string HitCircleFont { get; set; } = "default";
public int HitCircleOverlap { get; set; }
public bool? CursorExpand { get; set; } = true;
}
}