mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge branch 'master' into 14421-multi-password-error-handling
This commit is contained in:
@ -87,23 +87,25 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
private void createLink(IEnumerable<Drawable> drawables, LinkDetails link, string tooltipText, Action action = null)
|
||||
{
|
||||
AddInternal(new DrawableLinkCompiler(drawables.OfType<SpriteText>().ToList())
|
||||
var linkCompiler = CreateLinkCompiler(drawables.OfType<SpriteText>());
|
||||
linkCompiler.RelativeSizeAxes = Axes.Both;
|
||||
linkCompiler.TooltipText = tooltipText;
|
||||
linkCompiler.Action = () =>
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
TooltipText = tooltipText,
|
||||
Action = () =>
|
||||
{
|
||||
if (action != null)
|
||||
action();
|
||||
else if (game != null)
|
||||
game.HandleLink(link);
|
||||
// fallback to handle cases where OsuGame is not available, ie. tournament client.
|
||||
else if (link.Action == LinkAction.External)
|
||||
host.OpenUrlExternally(link.Argument);
|
||||
},
|
||||
});
|
||||
if (action != null)
|
||||
action();
|
||||
else if (game != null)
|
||||
game.HandleLink(link);
|
||||
// fallback to handle cases where OsuGame is not available, ie. tournament client.
|
||||
else if (link.Action == LinkAction.External)
|
||||
host.OpenUrlExternally(link.Argument);
|
||||
};
|
||||
|
||||
AddInternal(linkCompiler);
|
||||
}
|
||||
|
||||
protected virtual DrawableLinkCompiler CreateLinkCompiler(IEnumerable<SpriteText> parts) => new DrawableLinkCompiler(parts);
|
||||
|
||||
// We want the compilers to always be visible no matter where they are, so RelativeSizeAxes is used.
|
||||
// However due to https://github.com/ppy/osu-framework/issues/2073, it's possible for the compilers to be relative size in the flow's auto-size axes - an unsupported operation.
|
||||
// Since the compilers don't display any content and don't affect the layout, it's simplest to exclude them from the flow.
|
||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
return base.OnKeyDown(e);
|
||||
}
|
||||
|
||||
public bool OnPressed(GlobalAction action)
|
||||
public virtual bool OnPressed(GlobalAction action)
|
||||
{
|
||||
if (!HasFocus) return false;
|
||||
|
||||
|
@ -46,7 +46,11 @@ namespace osu.Game.Graphics.UserInterface
|
||||
},
|
||||
};
|
||||
|
||||
Current.ValueChanged += filled => fill.FadeTo(filled.NewValue ? 1 : 0, 200, Easing.OutQuint);
|
||||
Current.ValueChanged += filled =>
|
||||
{
|
||||
fill.FadeTo(filled.NewValue ? 1 : 0, 200, Easing.OutQuint);
|
||||
this.TransformTo(nameof(BorderThickness), filled.NewValue ? 8.5f : border_width, 200, Easing.OutQuint);
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -4,14 +4,17 @@
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Effects;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Input.Bindings;
|
||||
using osu.Game.Overlays;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterfaceV2
|
||||
{
|
||||
public class OsuPopover : Popover
|
||||
public class OsuPopover : Popover, IKeyBindingHandler<GlobalAction>
|
||||
{
|
||||
private const float fade_duration = 250;
|
||||
private const double scale_duration = 500;
|
||||
@ -51,5 +54,23 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
||||
this.ScaleTo(0.7f, scale_duration, Easing.OutQuint);
|
||||
this.FadeOut(fade_duration, Easing.OutQuint);
|
||||
}
|
||||
|
||||
public bool OnPressed(GlobalAction action)
|
||||
{
|
||||
if (State.Value == Visibility.Hidden)
|
||||
return false;
|
||||
|
||||
if (action == GlobalAction.Back)
|
||||
{
|
||||
Hide();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void OnReleased(GlobalAction action)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user