mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Merge remote-tracking branch 'upstream/master' into screen-title-class
This commit is contained in:
@ -35,7 +35,7 @@ namespace osu.Game.Graphics.Containers
|
||||
showNotImplementedError = () => notifications?.Post(new SimpleNotification
|
||||
{
|
||||
Text = @"This link type is not yet supported!",
|
||||
Icon = FontAwesome.fa_life_saver,
|
||||
Icon = FontAwesome.LifeSaver,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,6 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
public void AddArbitraryDrawable(Drawable drawable) => AddInternal(drawable);
|
||||
|
||||
public IEnumerable<Drawable> AddIcon(FontAwesome icon, Action<SpriteText> creationParameters = null) => AddText(((char)icon).ToString(), creationParameters);
|
||||
public IEnumerable<Drawable> AddIcon(IconUsage icon, Action<SpriteText> creationParameters = null) => AddText(icon.Icon.ToString(), creationParameters);
|
||||
}
|
||||
}
|
||||
|
@ -5,8 +5,10 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.Backgrounds;
|
||||
using osu.Game.Screens;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Graphics.Containers
|
||||
@ -32,7 +34,7 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
private readonly Container sizableContainer;
|
||||
|
||||
private Drawable backgroundLayer;
|
||||
private BackgroundScreenStack backgroundStack;
|
||||
|
||||
/// <summary>
|
||||
/// Create a new instance.
|
||||
@ -112,27 +114,29 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
private void updateSize()
|
||||
{
|
||||
const float fade_time = 500;
|
||||
|
||||
if (targetMode == ScalingMode.Everything)
|
||||
{
|
||||
// the top level scaling container manages the background to be displayed while scaling.
|
||||
if (requiresBackgroundVisible)
|
||||
{
|
||||
if (backgroundLayer == null)
|
||||
LoadComponentAsync(backgroundLayer = new Background("Menu/menu-background-1")
|
||||
if (backgroundStack == null)
|
||||
{
|
||||
AddInternal(backgroundStack = new BackgroundScreenStack
|
||||
{
|
||||
Colour = OsuColour.Gray(0.1f),
|
||||
Alpha = 0,
|
||||
Depth = float.MaxValue
|
||||
}, d =>
|
||||
{
|
||||
AddInternal(d);
|
||||
d.FadeTo(requiresBackgroundVisible ? 1 : 0, 4000, Easing.OutQuint);
|
||||
});
|
||||
else
|
||||
backgroundLayer.FadeIn(500);
|
||||
|
||||
backgroundStack.Push(new ScalingBackgroundScreen());
|
||||
}
|
||||
|
||||
backgroundStack.FadeIn(fade_time);
|
||||
}
|
||||
else
|
||||
backgroundLayer?.FadeOut(500);
|
||||
backgroundStack?.FadeOut(fade_time);
|
||||
}
|
||||
|
||||
bool scaling = targetMode == null || scalingMode.Value == targetMode;
|
||||
@ -148,6 +152,14 @@ namespace osu.Game.Graphics.Containers
|
||||
sizableContainer.ResizeTo(targetSize, 500, Easing.OutQuart).OnComplete(_ => { sizableContainer.Masking = requiresMasking; });
|
||||
}
|
||||
|
||||
private class ScalingBackgroundScreen : BackgroundScreenDefault
|
||||
{
|
||||
public override void OnEntering(IScreen last)
|
||||
{
|
||||
this.FadeInFromZero(4000, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
|
||||
private class AlwaysInputContainer : Container
|
||||
{
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
|
||||
|
@ -8,6 +8,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.Backgrounds;
|
||||
using osu.Game.Screens.Play;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
|
@ -5,7 +5,7 @@ using osu.Framework.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Graphics
|
||||
{
|
||||
public struct OsuFont
|
||||
public static class OsuFont
|
||||
{
|
||||
/// <summary>
|
||||
/// The default font size.
|
||||
|
94
osu.Game/Graphics/OsuIcon.cs
Normal file
94
osu.Game/Graphics/OsuIcon.cs
Normal file
@ -0,0 +1,94 @@
|
||||
// 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.Framework.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Graphics
|
||||
{
|
||||
public static class OsuIcon
|
||||
{
|
||||
public static IconUsage Get(int icon) => new IconUsage((char)icon, "OsuFont");
|
||||
|
||||
// ruleset icons in circles
|
||||
public static IconUsage RulesetOsu => Get(0xe000);
|
||||
public static IconUsage RulesetMania => Get(0xe001);
|
||||
public static IconUsage RulesetCatch => Get(0xe002);
|
||||
public static IconUsage RulesetTaiko => Get(0xe003);
|
||||
|
||||
// ruleset icons without circles
|
||||
public static IconUsage FilledCircle => Get(0xe004);
|
||||
public static IconUsage CrossCircle => Get(0xe005);
|
||||
public static IconUsage Logo => Get(0xe006);
|
||||
public static IconUsage ChevronDownCircle => Get(0xe007);
|
||||
public static IconUsage EditCircle => Get(0xe033);
|
||||
public static IconUsage LeftCircle => Get(0xe034);
|
||||
public static IconUsage RightCircle => Get(0xe035);
|
||||
public static IconUsage Charts => Get(0xe036);
|
||||
public static IconUsage Solo => Get(0xe037);
|
||||
public static IconUsage Multi => Get(0xe038);
|
||||
public static IconUsage Gear => Get(0xe039);
|
||||
|
||||
// misc icons
|
||||
public static IconUsage Bat => Get(0xe008);
|
||||
public static IconUsage Bubble => Get(0xe009);
|
||||
public static IconUsage BubblePop => Get(0xe02e);
|
||||
public static IconUsage Dice => Get(0xe011);
|
||||
public static IconUsage Heart => Get(0xe02f);
|
||||
public static IconUsage HeartBreak => Get(0xe030);
|
||||
public static IconUsage Hot => Get(0xe031);
|
||||
public static IconUsage ListSearch => Get(0xe032);
|
||||
|
||||
//osu! playstyles
|
||||
public static IconUsage PlaystyleTablet => Get(0xe02a);
|
||||
public static IconUsage PlaystyleMouse => Get(0xe029);
|
||||
public static IconUsage PlaystyleKeyboard => Get(0xe02b);
|
||||
public static IconUsage PlaystyleTouch => Get(0xe02c);
|
||||
|
||||
// osu! difficulties
|
||||
public static IconUsage EasyOsu => Get(0xe015);
|
||||
public static IconUsage NormalOsu => Get(0xe016);
|
||||
public static IconUsage HardOsu => Get(0xe017);
|
||||
public static IconUsage InsaneOsu => Get(0xe018);
|
||||
public static IconUsage ExpertOsu => Get(0xe019);
|
||||
|
||||
// taiko difficulties
|
||||
public static IconUsage EasyTaiko => Get(0xe01a);
|
||||
public static IconUsage NormalTaiko => Get(0xe01b);
|
||||
public static IconUsage HardTaiko => Get(0xe01c);
|
||||
public static IconUsage InsaneTaiko => Get(0xe01d);
|
||||
public static IconUsage ExpertTaiko => Get(0xe01e);
|
||||
|
||||
// fruits difficulties
|
||||
public static IconUsage EasyFruits => Get(0xe01f);
|
||||
public static IconUsage NormalFruits => Get(0xe020);
|
||||
public static IconUsage HardFruits => Get(0xe021);
|
||||
public static IconUsage InsaneFruits => Get(0xe022);
|
||||
public static IconUsage ExpertFruits => Get(0xe023);
|
||||
|
||||
// mania difficulties
|
||||
public static IconUsage EasyMania => Get(0xe024);
|
||||
public static IconUsage NormalMania => Get(0xe025);
|
||||
public static IconUsage HardMania => Get(0xe026);
|
||||
public static IconUsage InsaneMania => Get(0xe027);
|
||||
public static IconUsage ExpertMania => Get(0xe028);
|
||||
|
||||
// mod icons
|
||||
public static IconUsage ModPerfect => Get(0xe049);
|
||||
public static IconUsage ModAutopilot => Get(0xe03a);
|
||||
public static IconUsage ModAuto => Get(0xe03b);
|
||||
public static IconUsage ModCinema => Get(0xe03c);
|
||||
public static IconUsage ModDoubletime => Get(0xe03d);
|
||||
public static IconUsage ModEasy => Get(0xe03e);
|
||||
public static IconUsage ModFlashlight => Get(0xe03f);
|
||||
public static IconUsage ModHalftime => Get(0xe040);
|
||||
public static IconUsage ModHardrock => Get(0xe041);
|
||||
public static IconUsage ModHidden => Get(0xe042);
|
||||
public static IconUsage ModNightcore => Get(0xe043);
|
||||
public static IconUsage ModNofail => Get(0xe044);
|
||||
public static IconUsage ModRelax => Get(0xe045);
|
||||
public static IconUsage ModSpunout => Get(0xe046);
|
||||
public static IconUsage ModSuddendeath => Get(0xe047);
|
||||
public static IconUsage ModTarget => Get(0xe048);
|
||||
public static IconUsage ModBg => Get(0xe04a);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
public BackButton()
|
||||
{
|
||||
Text = @"back";
|
||||
Icon = FontAwesome.fa_osu_left_o;
|
||||
Icon = OsuIcon.LeftCircle;
|
||||
Anchor = Anchor.BottomLeft;
|
||||
Origin = Anchor.BottomLeft;
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
@ -92,7 +93,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
Anchor = Anchor.CentreRight,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Size = new Vector2(item_chevron_size),
|
||||
Icon = FontAwesome.fa_chevron_right,
|
||||
Icon = FontAwesome.ChevronRight,
|
||||
Margin = new MarginPadding { Left = padding },
|
||||
Alpha = 0f,
|
||||
});
|
||||
|
@ -5,6 +5,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Platform;
|
||||
using osuTK;
|
||||
@ -25,7 +26,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
Size = new Vector2(12);
|
||||
InternalChild = new SpriteIcon
|
||||
{
|
||||
Icon = FontAwesome.fa_external_link,
|
||||
Icon = FontAwesome.ExternalLink,
|
||||
RelativeSizeAxes = Axes.Both
|
||||
};
|
||||
}
|
||||
|
@ -16,9 +16,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
/// </summary>
|
||||
public class FocusedTextBox : OsuTextBox
|
||||
{
|
||||
protected override Color4 BackgroundUnfocused => new Color4(10, 10, 10, 255);
|
||||
protected override Color4 BackgroundFocused => new Color4(10, 10, 10, 255);
|
||||
|
||||
public Action Exit;
|
||||
|
||||
private bool focus;
|
||||
@ -47,6 +44,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
private void load(GameHost host)
|
||||
{
|
||||
this.host = host;
|
||||
|
||||
BackgroundUnfocused = new Color4(10, 10, 10, 255);
|
||||
BackgroundFocused = new Color4(10, 10, 10, 255);
|
||||
}
|
||||
|
||||
// We may not be focused yet, but we need to handle keyboard input to be able to request focus
|
||||
|
@ -4,6 +4,7 @@
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input.Events;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
@ -41,7 +42,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
/// <summary>
|
||||
/// The icon.
|
||||
/// </summary>
|
||||
public FontAwesome Icon
|
||||
public IconUsage Icon
|
||||
{
|
||||
get => icon.Icon;
|
||||
set => icon.Icon = value;
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -36,14 +37,14 @@ namespace osu.Game.Graphics.UserInterface
|
||||
Position = new Vector2(1, 1),
|
||||
Colour = Color4.Black,
|
||||
Alpha = 0.4f,
|
||||
Icon = FontAwesome.fa_circle_o_notch
|
||||
Icon = FontAwesome.CircleONotch
|
||||
},
|
||||
spinner = new SpriteIcon
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Icon = FontAwesome.fa_circle_o_notch
|
||||
Icon = FontAwesome.CircleONotch
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
Chevron = new SpriteIcon
|
||||
{
|
||||
AlwaysPresent = true,
|
||||
Icon = FontAwesome.fa_chevron_right,
|
||||
Icon = FontAwesome.ChevronRight,
|
||||
Colour = Color4.Black,
|
||||
Alpha = 0.5f,
|
||||
Size = new Vector2(8),
|
||||
@ -244,7 +244,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
},
|
||||
Icon = new SpriteIcon
|
||||
{
|
||||
Icon = FontAwesome.fa_chevron_down,
|
||||
Icon = FontAwesome.ChevronDown,
|
||||
Anchor = Anchor.CentreRight,
|
||||
Origin = Anchor.CentreRight,
|
||||
Margin = new MarginPadding { Right = 4 },
|
||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Platform;
|
||||
@ -107,7 +108,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
public CapsWarning()
|
||||
{
|
||||
Icon = FontAwesome.fa_warning;
|
||||
Icon = FontAwesome.Warning;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -254,7 +254,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
new SpriteIcon
|
||||
{
|
||||
Icon = FontAwesome.fa_ellipsis_h,
|
||||
Icon = FontAwesome.EllipsisH,
|
||||
Size = new Vector2(14),
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
|
@ -99,7 +99,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
icon = new SpriteIcon
|
||||
{
|
||||
Size = new Vector2(14),
|
||||
Icon = FontAwesome.fa_circle_o,
|
||||
Icon = FontAwesome.CircleOutline,
|
||||
Shadow = true,
|
||||
},
|
||||
},
|
||||
@ -120,12 +120,12 @@ namespace osu.Game.Graphics.UserInterface
|
||||
if (selected.NewValue)
|
||||
{
|
||||
fadeIn();
|
||||
icon.Icon = FontAwesome.fa_check_circle_o;
|
||||
icon.Icon = FontAwesome.CheckCircleOutline;
|
||||
}
|
||||
else
|
||||
{
|
||||
fadeOut();
|
||||
icon.Icon = FontAwesome.fa_circle_o;
|
||||
icon.Icon = FontAwesome.CircleOutline;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -16,10 +16,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public class OsuTextBox : TextBox, IKeyBindingHandler<GlobalAction>
|
||||
{
|
||||
protected override Color4 BackgroundUnfocused => Color4.Black.Opacity(0.5f);
|
||||
protected override Color4 BackgroundFocused => OsuColour.Gray(0.3f).Opacity(0.8f);
|
||||
protected override Color4 BackgroundCommit => BorderColour;
|
||||
|
||||
protected override float LeftRightPadding => 10;
|
||||
|
||||
protected override SpriteText CreatePlaceholder() => new OsuSpriteText
|
||||
@ -41,7 +37,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colour)
|
||||
{
|
||||
BorderColour = colour.Yellow;
|
||||
BackgroundUnfocused = Color4.Black.Opacity(0.5f);
|
||||
BackgroundFocused = OsuColour.Gray(0.3f).Opacity(0.8f);
|
||||
BackgroundCommit = BorderColour = colour.Yellow;
|
||||
}
|
||||
|
||||
protected override void OnFocus(FocusEvent e)
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input.Events;
|
||||
using osuTK;
|
||||
using osuTK.Input;
|
||||
@ -21,7 +22,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
new SpriteIcon
|
||||
{
|
||||
Icon = FontAwesome.fa_search,
|
||||
Icon = FontAwesome.Search,
|
||||
Origin = Anchor.CentreRight,
|
||||
Anchor = Anchor.CentreRight,
|
||||
Margin = new MarginPadding { Right = 10 },
|
||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.MathUtils;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
@ -142,7 +143,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
Child = Icon = new SpriteIcon
|
||||
{
|
||||
Size = new Vector2(star_size),
|
||||
Icon = FontAwesome.fa_star,
|
||||
Icon = FontAwesome.Star,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
};
|
||||
|
@ -33,5 +33,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
set => this.FadeTo(value ? 1 : 0);
|
||||
}
|
||||
|
||||
public bool FilteringActive { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
};
|
||||
}
|
||||
|
||||
public FontAwesome Icon
|
||||
public IconUsage Icon
|
||||
{
|
||||
set => bouncingIcon.Icon = value;
|
||||
}
|
||||
@ -207,7 +207,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
private readonly SpriteIcon icon;
|
||||
|
||||
public FontAwesome Icon
|
||||
public IconUsage Icon
|
||||
{
|
||||
set => icon.Icon = value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user