1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-14 05:47:20 +08:00

Merge remote-tracking branch 'upstream/master' into fix-screen-tests

This commit is contained in:
Dean Herbert 2019-02-15 21:29:44 +09:00
commit 4777fd1334
7 changed files with 60 additions and 2 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

@ -337,6 +337,11 @@ namespace osu.Game
{
base.LoadComplete();
// The next time this is updated is in UpdateAfterChildren, which occurs too late and results
// in the cursor being shown for a few frames during the intro.
// This prevents the cursor from showing until we have a screen with CursorVisible = true
MenuCursorContainer.CanShowCursor = menuScreen?.CursorVisible ?? false;
// todo: all archive managers should be able to be looped here.
SkinManager.PostNotification = n => notifications?.Post(n);
SkinManager.GetStableStorage = GetStorageForStableInstall;

View File

@ -70,7 +70,10 @@ namespace osu.Game.Overlays
Colour = Color4.Black,
Alpha = 0.9f,
},
welcomeScreen = new ScreenWelcome(),
new ScreenStack(welcomeScreen = new ScreenWelcome())
{
RelativeSizeAxes = Axes.Both,
},
}
}
}

View File

@ -21,6 +21,8 @@ namespace osu.Game.Screens
public override OverlayActivation InitialOverlayActivationMode => OverlayActivation.Disabled;
public override bool CursorVisible => false;
protected override bool AllowBackButton => false;
public Loader()

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;
}
}