1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 13:22:55 +08:00

Merge branch 'master' into flashlight_movement_delay

This commit is contained in:
Dan Balasescu 2019-05-14 10:36:04 +09:00 committed by GitHub
commit 8c07f6b8ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 66 deletions

View File

@ -57,33 +57,20 @@ namespace osu.Game.Rulesets.Catch.Difficulty
CatchHitObject lastObject = null; CatchHitObject lastObject = null;
foreach (var hitObject in beatmap.HitObjects.OfType<CatchHitObject>()) // In 2B beatmaps, it is possible that a normal Fruit is placed in the middle of a JuiceStream.
foreach (var hitObject in beatmap.HitObjects
.SelectMany(obj => obj is JuiceStream stream ? stream.NestedHitObjects : new[] { obj })
.Cast<CatchHitObject>()
.OrderBy(x => x.StartTime))
{ {
if (lastObject == null) // We want to only consider fruits that contribute to the combo.
{ if (hitObject is BananaShower || hitObject is TinyDroplet)
lastObject = hitObject;
continue; continue;
}
switch (hitObject) if (lastObject != null)
{ yield return new CatchDifficultyHitObject(hitObject, lastObject, clockRate, halfCatchWidth);
// We want to only consider fruits that contribute to the combo. Droplets are addressed as accuracy and spinners are not relevant for "skill" calculations.
case Fruit fruit:
yield return new CatchDifficultyHitObject(fruit, lastObject, clockRate, halfCatchWidth);
lastObject = hitObject; lastObject = hitObject;
break;
case JuiceStream _:
foreach (var nested in hitObject.NestedHitObjects.OfType<CatchHitObject>().Where(o => !(o is TinyDroplet)))
{
yield return new CatchDifficultyHitObject(nested, lastObject, clockRate, halfCatchWidth);
lastObject = nested;
}
break;
}
} }
} }

View File

@ -86,8 +86,8 @@ namespace osu.Game.Tests.Visual.Gameplay
AddStep("move cursor outside", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.TopLeft - new Vector2(10))); AddStep("move cursor outside", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.TopLeft - new Vector2(10)));
pauseAndConfirm(); pauseAndConfirm();
resumeAndConfirm();
resume();
pause(); pause();
confirmClockRunning(true); confirmClockRunning(true);

View File

@ -1,16 +0,0 @@
// 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.Graphics.Sprites;
namespace osu.Game.Tests.Visual
{
public class TestCaseCharLookup : OsuTestCase
{
public TestCaseCharLookup()
{
AddStep("null", () => { });
AddStep("display acharacter", () => Add(new OsuSpriteText { Text = "振込申請" }));
}
}
}

View File

@ -4,21 +4,20 @@
using System; using System;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Overlays.Volume namespace osu.Game.Overlays.Volume
{ {
public class MuteButton : Container, IHasCurrentValue<bool> public class MuteButton : OsuButton, IHasCurrentValue<bool>
{ {
private readonly Bindable<bool> current = new Bindable<bool>(); private readonly Bindable<bool> current = new Bindable<bool>();
@ -36,63 +35,57 @@ namespace osu.Game.Overlays.Volume
} }
private Color4 hoveredColour, unhoveredColour; private Color4 hoveredColour, unhoveredColour;
private const float width = 100; private const float width = 100;
public const float HEIGHT = 35; public const float HEIGHT = 35;
public MuteButton() public MuteButton()
{ {
Masking = true; Content.BorderThickness = 3;
BorderThickness = 3; Content.CornerRadius = HEIGHT / 2;
CornerRadius = HEIGHT / 2;
Size = new Vector2(width, HEIGHT); Size = new Vector2(width, HEIGHT);
Action = () => Current.Value = !Current.Value;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
hoveredColour = colours.YellowDark; hoveredColour = colours.YellowDark;
BorderColour = unhoveredColour = colours.Gray1.Opacity(0.9f);
Content.BorderColour = unhoveredColour = colours.Gray1;
BackgroundColour = colours.Gray1;
SpriteIcon icon; SpriteIcon icon;
AddRange(new Drawable[] AddRange(new Drawable[]
{ {
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colours.Gray1,
Alpha = 0.9f,
},
icon = new SpriteIcon icon = new SpriteIcon
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.Centre,
Origin = Anchor.CentreLeft, Origin = Anchor.Centre,
Size = new Vector2(20), Size = new Vector2(20),
} }
}); });
Current.ValueChanged += muted => Current.ValueChanged += muted =>
{ {
icon.Icon = muted.NewValue ? FontAwesome.Solid.VolumeOff : FontAwesome.Solid.VolumeUp; icon.Icon = muted.NewValue ? FontAwesome.Solid.VolumeMute : FontAwesome.Solid.VolumeUp;
icon.Margin = new MarginPadding { Left = muted.NewValue ? width / 2 - 15 : width / 2 - 10 }; //Magic numbers to line up both icons because they're different widths
}; };
Current.TriggerChange(); Current.TriggerChange();
} }
protected override bool OnHover(HoverEvent e) protected override bool OnHover(HoverEvent e)
{ {
this.TransformTo<MuteButton, SRGBColour>("BorderColour", hoveredColour, 500, Easing.OutQuint); Content.TransformTo<Container<Drawable>, SRGBColour>("BorderColour", hoveredColour, 500, Easing.OutQuint);
return false; return false;
} }
protected override void OnHoverLost(HoverLostEvent e) protected override void OnHoverLost(HoverLostEvent e)
{ {
this.TransformTo<MuteButton, SRGBColour>("BorderColour", unhoveredColour, 500, Easing.OutQuint); Content.TransformTo<Container<Drawable>, SRGBColour>("BorderColour", unhoveredColour, 500, Easing.OutQuint);
}
protected override bool OnClick(ClickEvent e)
{
Current.Value = !Current.Value;
return true;
} }
} }
} }

View File

@ -9,7 +9,7 @@ namespace osu.iOS
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
UIApplication.Main(args, null, "AppDelegate"); UIApplication.Main(args, "GameUIApplication", "AppDelegate");
} }
} }
} }