mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge branch 'master' into musiccontroller-canbeatmapchange
This commit is contained in:
@ -39,7 +39,7 @@ namespace osu.Game.Overlays.Chat
|
||||
{
|
||||
set
|
||||
{
|
||||
FadeTo(value ? 1f : 0f, 100);
|
||||
this.FadeTo(value ? 1f : 0f, 100);
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,7 +156,7 @@ namespace osu.Game.Overlays.Chat
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
if (!channel.Joined.Value)
|
||||
name.FadeColour(hoverColour, 50, EasingTypes.OutQuint);
|
||||
name.FadeColour(hoverColour, 50, Easing.OutQuint);
|
||||
|
||||
return base.OnHover(state);
|
||||
}
|
||||
@ -175,14 +175,14 @@ namespace osu.Game.Overlays.Chat
|
||||
joinedCheckmark.FadeTo(1f, transition_duration);
|
||||
topic.FadeTo(0.8f, transition_duration);
|
||||
topic.FadeColour(Color4.White, transition_duration);
|
||||
FadeColour(joinedColour, transition_duration);
|
||||
this.FadeColour(joinedColour, transition_duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
joinedCheckmark.FadeTo(0f, transition_duration);
|
||||
topic.FadeTo(1f, transition_duration);
|
||||
topic.FadeColour(topicColour, transition_duration);
|
||||
FadeColour(Color4.White, transition_duration);
|
||||
this.FadeColour(Color4.White, transition_duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Chat
|
||||
{
|
||||
set
|
||||
{
|
||||
FadeTo(value ? 1f : 0f, 100);
|
||||
this.FadeTo(value ? 1f : 0f, 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ namespace osu.Game.Overlays.Chat
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Vertical,
|
||||
LayoutDuration = 200,
|
||||
LayoutEasing = EasingTypes.OutQuint,
|
||||
LayoutEasing = Easing.OutQuint,
|
||||
Spacing = new Vector2(0f, 20f),
|
||||
Padding = new MarginPadding { Vertical = 20, Left = WIDTH_PADDING },
|
||||
},
|
||||
@ -158,10 +158,10 @@ namespace osu.Game.Overlays.Chat
|
||||
|
||||
protected override void PopIn()
|
||||
{
|
||||
if (Alpha == 0) MoveToY(DrawHeight);
|
||||
if (Alpha == 0) this.MoveToY(DrawHeight);
|
||||
|
||||
FadeIn(transition_duration, EasingTypes.OutQuint);
|
||||
MoveToY(0, transition_duration, EasingTypes.OutQuint);
|
||||
this.FadeIn(transition_duration, Easing.OutQuint);
|
||||
this.MoveToY(0, transition_duration, Easing.OutQuint);
|
||||
|
||||
search.HoldFocus = true;
|
||||
base.PopIn();
|
||||
@ -169,8 +169,8 @@ namespace osu.Game.Overlays.Chat
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
FadeOut(transition_duration, EasingTypes.InSine);
|
||||
MoveToY(DrawHeight, transition_duration, EasingTypes.InSine);
|
||||
this.FadeOut(transition_duration, Easing.InSine);
|
||||
this.MoveToY(DrawHeight, transition_duration, Easing.InSine);
|
||||
|
||||
search.HoldFocus = false;
|
||||
base.PopOut();
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
@ -11,6 +12,8 @@ using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics.Effects;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays.Chat
|
||||
{
|
||||
@ -62,6 +65,8 @@ namespace osu.Game.Overlays.Chat
|
||||
private const float message_padding = 200;
|
||||
private const float text_size = 20;
|
||||
|
||||
private Action<User> loadProfile;
|
||||
|
||||
private Color4 customUsernameColour;
|
||||
|
||||
public ChatLine(Message message)
|
||||
@ -74,10 +79,11 @@ namespace osu.Game.Overlays.Chat
|
||||
Padding = new MarginPadding { Left = padding, Right = padding };
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuColour colours, UserProfileOverlay profile)
|
||||
{
|
||||
customUsernameColour = colours.ChatBlue;
|
||||
loadProfile = u => profile?.ShowUser(u);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -87,8 +93,6 @@ namespace osu.Game.Overlays.Chat
|
||||
bool hasBackground = !string.IsNullOrEmpty(Message.Sender.Colour);
|
||||
Drawable username = new OsuSpriteText
|
||||
{
|
||||
Origin = Anchor.TopRight,
|
||||
Anchor = Anchor.TopRight,
|
||||
Font = @"Exo2.0-BoldItalic",
|
||||
Text = $@"{Message.Sender.Username}" + (hasBackground ? "" : ":"),
|
||||
Colour = hasBackground ? customUsernameColour : username_colours[Message.UserId % username_colours.Length],
|
||||
@ -132,7 +136,7 @@ namespace osu.Game.Overlays.Chat
|
||||
new Container
|
||||
{
|
||||
Size = new Vector2(message_padding, text_size),
|
||||
Children = new[]
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
@ -144,7 +148,14 @@ namespace osu.Game.Overlays.Chat
|
||||
TextSize = text_size * 0.75f,
|
||||
Alpha = 0.4f,
|
||||
},
|
||||
username
|
||||
new ClickableContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Origin = Anchor.TopRight,
|
||||
Anchor = Anchor.TopRight,
|
||||
Child = username,
|
||||
Action = () => loadProfile(Message.Sender),
|
||||
},
|
||||
}
|
||||
},
|
||||
new Container
|
||||
@ -154,10 +165,12 @@ namespace osu.Game.Overlays.Chat
|
||||
Padding = new MarginPadding { Left = message_padding + padding },
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new OsuSpriteText
|
||||
new OsuTextFlowContainer(t =>
|
||||
{
|
||||
t.TextSize = text_size;
|
||||
})
|
||||
{
|
||||
Text = Message.Content,
|
||||
TextSize = text_size,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
}
|
||||
|
@ -86,30 +86,30 @@ namespace osu.Game.Overlays.Chat
|
||||
|
||||
private void fadeActive()
|
||||
{
|
||||
ResizeTo(new Vector2(Width, 1.1f), transition_length, EasingTypes.OutQuint);
|
||||
this.ResizeTo(new Vector2(Width, 1.1f), transition_length, Easing.OutQuint);
|
||||
|
||||
box.FadeColour(backgroundActive, transition_length, EasingTypes.OutQuint);
|
||||
highlightBox.FadeIn(transition_length, EasingTypes.OutQuint);
|
||||
box.FadeColour(backgroundActive, transition_length, Easing.OutQuint);
|
||||
highlightBox.FadeIn(transition_length, Easing.OutQuint);
|
||||
|
||||
text.FadeOut(transition_length, EasingTypes.OutQuint);
|
||||
textBold.FadeIn(transition_length, EasingTypes.OutQuint);
|
||||
text.FadeOut(transition_length, Easing.OutQuint);
|
||||
textBold.FadeIn(transition_length, Easing.OutQuint);
|
||||
}
|
||||
|
||||
private void fadeInactive()
|
||||
{
|
||||
ResizeTo(new Vector2(Width, 1), transition_length, EasingTypes.OutQuint);
|
||||
this.ResizeTo(new Vector2(Width, 1), transition_length, Easing.OutQuint);
|
||||
|
||||
box.FadeColour(backgroundInactive, transition_length, EasingTypes.OutQuint);
|
||||
highlightBox.FadeOut(transition_length, EasingTypes.OutQuint);
|
||||
box.FadeColour(backgroundInactive, transition_length, Easing.OutQuint);
|
||||
highlightBox.FadeOut(transition_length, Easing.OutQuint);
|
||||
|
||||
text.FadeIn(transition_length, EasingTypes.OutQuint);
|
||||
textBold.FadeOut(transition_length, EasingTypes.OutQuint);
|
||||
text.FadeIn(transition_length, Easing.OutQuint);
|
||||
textBold.FadeOut(transition_length, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
if (!Active)
|
||||
box.FadeColour(backgroundHover, transition_length, EasingTypes.OutQuint);
|
||||
box.FadeColour(backgroundHover, transition_length, Easing.OutQuint);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -52,6 +52,7 @@ namespace osu.Game.Overlays
|
||||
private readonly ChatTabControl channelTabs;
|
||||
|
||||
private readonly Container chatContainer;
|
||||
private readonly Container tabsArea;
|
||||
private readonly Box chatBackground;
|
||||
private readonly Box tabBackground;
|
||||
|
||||
@ -144,7 +145,7 @@ namespace osu.Game.Overlays
|
||||
loading = new LoadingAnimation(),
|
||||
}
|
||||
},
|
||||
new Container
|
||||
tabsArea = new Container
|
||||
{
|
||||
Name = @"tabs area",
|
||||
RelativeSizeAxes = Axes.X,
|
||||
@ -177,8 +178,8 @@ namespace osu.Game.Overlays
|
||||
inputTextBox.HoldFocus = false;
|
||||
if (1f - chatHeight.Value < channel_selection_min_height)
|
||||
{
|
||||
chatContainer.ResizeHeightTo(1f - channel_selection_min_height, 800, EasingTypes.OutQuint);
|
||||
channelSelectionContainer.ResizeHeightTo(channel_selection_min_height, 800, EasingTypes.OutQuint);
|
||||
chatContainer.ResizeHeightTo(1f - channel_selection_min_height, 800, Easing.OutQuint);
|
||||
channelSelectionContainer.ResizeHeightTo(channel_selection_min_height, 800, Easing.OutQuint);
|
||||
channelSelection.Show();
|
||||
chatHeight.Value = 1f - channel_selection_min_height;
|
||||
}
|
||||
@ -191,10 +192,13 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
|
||||
private double startDragChatHeight;
|
||||
private bool isDragging;
|
||||
|
||||
protected override bool OnDragStart(InputState state)
|
||||
{
|
||||
if (!channelTabs.IsHovered)
|
||||
isDragging = tabsArea.IsHovered;
|
||||
|
||||
if (!isDragging)
|
||||
return base.OnDragStart(state);
|
||||
|
||||
startDragChatHeight = chatHeight.Value;
|
||||
@ -203,10 +207,20 @@ namespace osu.Game.Overlays
|
||||
|
||||
protected override bool OnDrag(InputState state)
|
||||
{
|
||||
Trace.Assert(state.Mouse.PositionMouseDown != null);
|
||||
if (isDragging)
|
||||
{
|
||||
Trace.Assert(state.Mouse.PositionMouseDown != null);
|
||||
|
||||
chatHeight.Value = startDragChatHeight - (state.Mouse.Position.Y - state.Mouse.PositionMouseDown.Value.Y) / Parent.DrawSize.Y;
|
||||
return base.OnDrag(state);
|
||||
chatHeight.Value = startDragChatHeight - (state.Mouse.Position.Y - state.Mouse.PositionMouseDown.Value.Y) / Parent.DrawSize.Y;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool OnDragEnd(InputState state)
|
||||
{
|
||||
isDragging = false;
|
||||
return base.OnDragEnd(state);
|
||||
}
|
||||
|
||||
public void APIStateChanged(APIAccess api, APIState state)
|
||||
@ -235,8 +249,8 @@ namespace osu.Game.Overlays
|
||||
|
||||
protected override void PopIn()
|
||||
{
|
||||
MoveToY(0, transition_length, EasingTypes.OutQuint);
|
||||
FadeIn(transition_length, EasingTypes.OutQuint);
|
||||
this.MoveToY(0, transition_length, Easing.OutQuint);
|
||||
this.FadeIn(transition_length, Easing.OutQuint);
|
||||
|
||||
inputTextBox.HoldFocus = true;
|
||||
base.PopIn();
|
||||
@ -244,8 +258,8 @@ namespace osu.Game.Overlays
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
MoveToY(Height, transition_length, EasingTypes.InSine);
|
||||
FadeOut(transition_length, EasingTypes.InSine);
|
||||
this.MoveToY(Height, transition_length, Easing.InSine);
|
||||
this.FadeOut(transition_length, Easing.InSine);
|
||||
|
||||
inputTextBox.HoldFocus = false;
|
||||
base.PopOut();
|
||||
@ -328,7 +342,7 @@ namespace osu.Game.Overlays
|
||||
var loaded = loadedChannels.Find(d => d.Channel == value);
|
||||
if (loaded == null)
|
||||
{
|
||||
currentChannelContainer.FadeOut(500, EasingTypes.OutQuint);
|
||||
currentChannelContainer.FadeOut(500, Easing.OutQuint);
|
||||
loading.Show();
|
||||
|
||||
loaded = new DrawableChannel(currentChannel);
|
||||
@ -340,7 +354,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
currentChannelContainer.Clear(false);
|
||||
currentChannelContainer.Add(loaded);
|
||||
currentChannelContainer.FadeIn(500, EasingTypes.OutQuint);
|
||||
currentChannelContainer.FadeIn(500, Easing.OutQuint);
|
||||
});
|
||||
}
|
||||
else
|
||||
|
@ -115,17 +115,17 @@ namespace osu.Game.Overlays.Dialog
|
||||
ring.ResizeTo(ringMinifiedSize);
|
||||
}
|
||||
|
||||
content.FadeIn(ENTER_DURATION, EasingTypes.OutQuint);
|
||||
ring.ResizeTo(ringSize, ENTER_DURATION, EasingTypes.OutQuint);
|
||||
buttonsContainer.TransformSpacingTo(Vector2.Zero, ENTER_DURATION, EasingTypes.OutQuint);
|
||||
buttonsContainer.MoveToY(0, ENTER_DURATION, EasingTypes.OutQuint);
|
||||
content.FadeIn(ENTER_DURATION, Easing.OutQuint);
|
||||
ring.ResizeTo(ringSize, ENTER_DURATION, Easing.OutQuint);
|
||||
buttonsContainer.TransformSpacingTo(Vector2.Zero, ENTER_DURATION, Easing.OutQuint);
|
||||
buttonsContainer.MoveToY(0, ENTER_DURATION, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
base.PopOut();
|
||||
|
||||
content.FadeOut(EXIT_DURATION, EasingTypes.InSine);
|
||||
content.FadeOut(EXIT_DURATION, Easing.InSine);
|
||||
}
|
||||
|
||||
public PopupDialog()
|
||||
|
@ -35,8 +35,7 @@ namespace osu.Game.Overlays
|
||||
if (v != Visibility.Hidden) return;
|
||||
|
||||
//handle the dialog being dismissed.
|
||||
dialog.Delay(PopupDialog.EXIT_DURATION);
|
||||
dialog.Expire();
|
||||
dialog.Delay(PopupDialog.EXIT_DURATION).Expire();
|
||||
|
||||
if (dialog == currentDialog)
|
||||
State = Visibility.Hidden;
|
||||
@ -45,13 +44,13 @@ namespace osu.Game.Overlays
|
||||
protected override void PopIn()
|
||||
{
|
||||
base.PopIn();
|
||||
FadeIn(PopupDialog.ENTER_DURATION, EasingTypes.OutQuint);
|
||||
this.FadeIn(PopupDialog.ENTER_DURATION, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
base.PopOut();
|
||||
FadeOut(PopupDialog.EXIT_DURATION, EasingTypes.InSine);
|
||||
this.FadeOut(PopupDialog.EXIT_DURATION, Easing.InSine);
|
||||
}
|
||||
|
||||
public DialogOverlay()
|
||||
|
@ -8,10 +8,10 @@ using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Beatmaps;
|
||||
|
||||
namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
@ -41,9 +41,9 @@ namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
FadeInFromZero(200, EasingTypes.Out);
|
||||
this.FadeInFromZero(200, Easing.Out);
|
||||
bottomPanel.LayoutDuration = 200;
|
||||
bottomPanel.LayoutEasing = EasingTypes.Out;
|
||||
bottomPanel.LayoutEasing = Easing.Out;
|
||||
bottomPanel.Origin = Anchor.BottomLeft;
|
||||
}
|
||||
|
||||
|
@ -9,11 +9,11 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Database;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays.Direct
|
||||
@ -43,7 +43,7 @@ namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
FadeInFromZero(200, EasingTypes.Out);
|
||||
this.FadeInFromZero(200, Easing.Out);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Direct
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
ColourInfo = ColourInfo.GradientHorizontal(Color4.Black.Opacity(0.25f), Color4.Black.Opacity(0.75f)),
|
||||
Colour = ColourInfo.GradientHorizontal(Color4.Black.Opacity(0.25f), Color4.Black.Opacity(0.75f)),
|
||||
},
|
||||
new Container
|
||||
{
|
||||
@ -171,25 +171,25 @@ namespace osu.Game.Overlays.Direct
|
||||
|
||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
||||
{
|
||||
icon.ScaleTo(0.9f, 1000, EasingTypes.Out);
|
||||
icon.ScaleTo(0.9f, 1000, Easing.Out);
|
||||
return base.OnMouseDown(state, args);
|
||||
}
|
||||
|
||||
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
|
||||
{
|
||||
icon.ScaleTo(1f, 500, EasingTypes.OutElastic);
|
||||
icon.ScaleTo(1f, 500, Easing.OutElastic);
|
||||
return base.OnMouseUp(state, args);
|
||||
}
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
icon.ScaleTo(1.1f, 500, EasingTypes.OutElastic);
|
||||
icon.ScaleTo(1.1f, 500, Easing.OutElastic);
|
||||
return base.OnHover(state);
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(InputState state)
|
||||
{
|
||||
icon.ScaleTo(1f, 500, EasingTypes.OutElastic);
|
||||
icon.ScaleTo(1f, 500, Easing.OutElastic);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ using OpenTK;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
|
||||
@ -38,7 +38,7 @@ namespace osu.Game.Overlays.Direct
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out),
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
|
||||
})
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
|
@ -7,10 +7,11 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Overlays.SearchableList;
|
||||
using osu.Game.Rulesets;
|
||||
|
||||
namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
@ -33,7 +34,7 @@ namespace osu.Game.Overlays.Direct
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuGame game, RulesetDatabase rulesets, OsuColour colours)
|
||||
private void load(OsuGame game, RulesetStore rulesets, OsuColour colours)
|
||||
{
|
||||
DisplayStyleControl.Dropdown.AccentColour = colours.BlueDark;
|
||||
|
||||
|
@ -9,13 +9,14 @@ using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Overlays.Direct;
|
||||
using osu.Game.Overlays.SearchableList;
|
||||
using osu.Game.Rulesets;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
@ -25,7 +26,7 @@ namespace osu.Game.Overlays
|
||||
private const float panel_padding = 10f;
|
||||
|
||||
private APIAccess api;
|
||||
private RulesetDatabase rulesets;
|
||||
private RulesetStore rulesets;
|
||||
|
||||
private readonly FillFlowContainer resultCountsContainer;
|
||||
private readonly OsuSpriteText resultCountsText;
|
||||
@ -160,7 +161,7 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours, APIAccess api, RulesetDatabase rulesets)
|
||||
private void load(OsuColour colours, APIAccess api, RulesetStore rulesets)
|
||||
{
|
||||
this.api = api;
|
||||
this.rulesets = rulesets;
|
||||
@ -169,7 +170,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
private void updateResultCounts()
|
||||
{
|
||||
resultCountsContainer.FadeTo(ResultAmounts == null ? 0f : 1f, 200, EasingTypes.OutQuint);
|
||||
resultCountsContainer.FadeTo(ResultAmounts == null ? 0f : 1f, 200, Easing.OutQuint);
|
||||
if (ResultAmounts == null) return;
|
||||
|
||||
resultCountsText.Text = pluralize("Artist", ResultAmounts.Artists) + ", " +
|
||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Overlays
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Masking = true,
|
||||
AutoSizeDuration = transition_time,
|
||||
AutoSizeEasing = EasingTypes.OutQuint,
|
||||
AutoSizeEasing = Easing.OutQuint,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
settingsSection = new LoginSettings
|
||||
@ -67,7 +67,7 @@ namespace osu.Game.Overlays
|
||||
base.PopIn();
|
||||
|
||||
settingsSection.Bounding = true;
|
||||
FadeIn(transition_time, EasingTypes.OutQuint);
|
||||
this.FadeIn(transition_time, Easing.OutQuint);
|
||||
|
||||
InputManager.ChangeFocus(settingsSection);
|
||||
}
|
||||
@ -77,7 +77,7 @@ namespace osu.Game.Overlays
|
||||
base.PopOut();
|
||||
|
||||
settingsSection.Bounding = false;
|
||||
FadeOut(transition_time);
|
||||
this.FadeOut(transition_time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -194,38 +194,43 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
base.PopIn();
|
||||
|
||||
FadeIn(200);
|
||||
this.FadeIn(200);
|
||||
background.FlashColour(Color4.White.Opacity(0.25f), 400);
|
||||
|
||||
getSample.Play();
|
||||
|
||||
using (innerSpin.BeginLoopedSequence())
|
||||
innerSpin.RotateTo(360, 20000);
|
||||
|
||||
using (outerSpin.BeginLoopedSequence())
|
||||
outerSpin.RotateTo(360, 40000);
|
||||
innerSpin.Spin(20000, RotationDirection.Clockwise);
|
||||
outerSpin.Spin(40000, RotationDirection.Clockwise);
|
||||
|
||||
using (BeginDelayedSequence(200, true))
|
||||
{
|
||||
disc.FadeIn(initial_duration);
|
||||
disc.FadeIn(initial_duration)
|
||||
.ScaleTo(1f, initial_duration * 2, Easing.OutElastic);
|
||||
|
||||
particleContainer.FadeIn(initial_duration);
|
||||
outerSpin.FadeTo(0.1f, initial_duration * 2);
|
||||
disc.ScaleTo(1f, initial_duration * 2, EasingTypes.OutElastic);
|
||||
|
||||
using (BeginDelayedSequence(initial_duration + 200, true))
|
||||
{
|
||||
backgroundStrip.FadeIn(step_duration);
|
||||
leftStrip.ResizeWidthTo(1f, step_duration, EasingTypes.OutQuint);
|
||||
rightStrip.ResizeWidthTo(1f, step_duration, EasingTypes.OutQuint);
|
||||
Schedule(() => { if (drawableMedal.State != DisplayState.Full) drawableMedal.State = DisplayState.Icon; });
|
||||
leftStrip.ResizeWidthTo(1f, step_duration, Easing.OutQuint);
|
||||
rightStrip.ResizeWidthTo(1f, step_duration, Easing.OutQuint);
|
||||
|
||||
using (BeginDelayedSequence(step_duration, true))
|
||||
this.Animate().Schedule(() =>
|
||||
{
|
||||
Schedule(() => { if (drawableMedal.State != DisplayState.Full) drawableMedal.State = DisplayState.MedalUnlocked; });
|
||||
|
||||
using (BeginDelayedSequence(step_duration, true))
|
||||
Schedule(() => { if (drawableMedal.State != DisplayState.Full) drawableMedal.State = DisplayState.Full; });
|
||||
}
|
||||
if (drawableMedal.State != DisplayState.Full)
|
||||
drawableMedal.State = DisplayState.Icon;
|
||||
})
|
||||
.Delay(step_duration).Schedule(() =>
|
||||
{
|
||||
if (drawableMedal.State != DisplayState.Full)
|
||||
drawableMedal.State = DisplayState.MedalUnlocked;
|
||||
})
|
||||
.Delay(step_duration).Schedule(() =>
|
||||
{
|
||||
if (drawableMedal.State != DisplayState.Full)
|
||||
drawableMedal.State = DisplayState.Full;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -233,7 +238,7 @@ namespace osu.Game.Overlays
|
||||
protected override void PopOut()
|
||||
{
|
||||
base.PopOut();
|
||||
FadeOut(200);
|
||||
this.FadeOut(200);
|
||||
}
|
||||
|
||||
private void dismiss()
|
||||
@ -242,7 +247,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
// if we haven't yet, play out the animation fully
|
||||
drawableMedal.State = DisplayState.Full;
|
||||
Flush(true);
|
||||
FinishTransforms(true);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -256,7 +261,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
Width = 0f;
|
||||
ColourInfo = ColourInfo.GradientHorizontal(Color4.White.Opacity(start), Color4.White.Opacity(end));
|
||||
Colour = ColourInfo.GradientHorizontal(Color4.White.Opacity(start), Color4.White.Opacity(end));
|
||||
Masking = true;
|
||||
|
||||
Children = new[]
|
||||
@ -295,8 +300,8 @@ namespace osu.Game.Overlays
|
||||
Radius = 5,
|
||||
};
|
||||
|
||||
MoveTo(positionForOffset(DISC_SIZE / 2 + 200), 500);
|
||||
FadeOut(500);
|
||||
this.MoveTo(positionForOffset(DISC_SIZE / 2 + 200), 500);
|
||||
this.FadeOut(500);
|
||||
Expire();
|
||||
}
|
||||
}
|
||||
|
@ -147,23 +147,26 @@ namespace osu.Game.Overlays.MedalSplash
|
||||
medalContainer.ScaleTo(0);
|
||||
break;
|
||||
case DisplayState.Icon:
|
||||
medalContainer.ScaleTo(1, duration, EasingTypes.OutElastic);
|
||||
medalContainer.FadeIn(duration);
|
||||
medalContainer
|
||||
.FadeIn(duration)
|
||||
.ScaleTo(1, duration, Easing.OutElastic);
|
||||
break;
|
||||
case DisplayState.MedalUnlocked:
|
||||
medalContainer.ScaleTo(1);
|
||||
medalContainer.Show();
|
||||
medalContainer
|
||||
.FadeTo(1)
|
||||
.ScaleTo(1);
|
||||
|
||||
ScaleTo(scale_when_unlocked, duration, EasingTypes.OutExpo);
|
||||
MoveToY(MedalOverlay.DISC_SIZE / 2 - 30, duration, EasingTypes.OutExpo);
|
||||
this.ScaleTo(scale_when_unlocked, duration, Easing.OutExpo);
|
||||
this.MoveToY(MedalOverlay.DISC_SIZE / 2 - 30, duration, Easing.OutExpo);
|
||||
unlocked.FadeInFromZero(duration);
|
||||
break;
|
||||
case DisplayState.Full:
|
||||
medalContainer.ScaleTo(1);
|
||||
medalContainer.Show();
|
||||
medalContainer
|
||||
.FadeTo(1)
|
||||
.ScaleTo(1);
|
||||
|
||||
ScaleTo(scale_when_full, duration, EasingTypes.OutExpo);
|
||||
MoveToY(MedalOverlay.DISC_SIZE / 2 - 60, duration, EasingTypes.OutExpo);
|
||||
this.ScaleTo(scale_when_full, duration, Easing.OutExpo);
|
||||
this.MoveToY(MedalOverlay.DISC_SIZE / 2 - 60, duration, Easing.OutExpo);
|
||||
name.FadeInFromZero(duration + 100);
|
||||
description.FadeInFromZero(duration * 2);
|
||||
break;
|
||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
public string TooltipText => (SelectedMod?.Description ?? Mods.FirstOrDefault()?.Description) ?? string.Empty;
|
||||
|
||||
private const EasingTypes mod_switch_easing = EasingTypes.InOutSine;
|
||||
private const Easing mod_switch_easing = Easing.InOutSine;
|
||||
private const double mod_switch_duration = 120;
|
||||
|
||||
// A selected index of -1 means not selected.
|
||||
@ -67,8 +67,8 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
if (beforeSelected != Selected)
|
||||
{
|
||||
iconsContainer.RotateTo(Selected ? 5f : 0f, 300, EasingTypes.OutElastic);
|
||||
iconsContainer.ScaleTo(Selected ? 1.1f : 1f, 300, EasingTypes.OutElastic);
|
||||
iconsContainer.RotateTo(Selected ? 5f : 0f, 300, Easing.OutElastic);
|
||||
iconsContainer.ScaleTo(Selected ? 1.1f : 1f, 300, Easing.OutElastic);
|
||||
}
|
||||
|
||||
if (modBefore != modAfter)
|
||||
@ -81,11 +81,13 @@ namespace osu.Game.Overlays.Mods
|
||||
backgroundIcon.Icon = modAfter.Icon;
|
||||
using (BeginDelayedSequence(mod_switch_duration, true))
|
||||
{
|
||||
foregroundIcon.RotateTo(-rotate_angle * direction);
|
||||
foregroundIcon.RotateTo(0f, mod_switch_duration, mod_switch_easing);
|
||||
foregroundIcon
|
||||
.RotateTo(-rotate_angle * direction)
|
||||
.RotateTo(0f, mod_switch_duration, mod_switch_easing);
|
||||
|
||||
backgroundIcon.RotateTo(rotate_angle * direction);
|
||||
backgroundIcon.RotateTo(0f, mod_switch_duration, mod_switch_easing);
|
||||
backgroundIcon
|
||||
.RotateTo(rotate_angle * direction)
|
||||
.RotateTo(0f, mod_switch_duration, mod_switch_easing);
|
||||
|
||||
Schedule(() => displayMod(modAfter));
|
||||
}
|
||||
|
@ -15,8 +15,8 @@ using osu.Game.Rulesets.Mods;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Game.Database;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Rulesets;
|
||||
|
||||
namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
@ -48,7 +48,7 @@ namespace osu.Game.Overlays.Mods
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(permitNulls: true)]
|
||||
private void load(OsuColour colours, OsuGame osu, RulesetDatabase rulesets)
|
||||
private void load(OsuColour colours, OsuGame osu, RulesetStore rulesets)
|
||||
{
|
||||
lowMultiplierColour = colours.Red;
|
||||
highMultiplierColour = colours.Green;
|
||||
@ -66,14 +66,14 @@ namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
base.PopOut();
|
||||
|
||||
rankedMultiplerContainer.MoveToX(rankedMultiplerContainer.DrawSize.X, APPEAR_DURATION, EasingTypes.InSine);
|
||||
rankedMultiplerContainer.FadeOut(APPEAR_DURATION, EasingTypes.InSine);
|
||||
rankedMultiplerContainer.MoveToX(rankedMultiplerContainer.DrawSize.X, APPEAR_DURATION, Easing.InSine);
|
||||
rankedMultiplerContainer.FadeOut(APPEAR_DURATION, Easing.InSine);
|
||||
|
||||
foreach (ModSection section in modSectionsContainer.Children)
|
||||
{
|
||||
section.ButtonsContainer.TransformSpacingTo(new Vector2(100f, 0f), APPEAR_DURATION, EasingTypes.InSine);
|
||||
section.ButtonsContainer.MoveToX(100f, APPEAR_DURATION, EasingTypes.InSine);
|
||||
section.ButtonsContainer.FadeOut(APPEAR_DURATION, EasingTypes.InSine);
|
||||
section.ButtonsContainer.TransformSpacingTo(new Vector2(100f, 0f), APPEAR_DURATION, Easing.InSine);
|
||||
section.ButtonsContainer.MoveToX(100f, APPEAR_DURATION, Easing.InSine);
|
||||
section.ButtonsContainer.FadeOut(APPEAR_DURATION, Easing.InSine);
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,14 +81,14 @@ namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
base.PopIn();
|
||||
|
||||
rankedMultiplerContainer.MoveToX(0, ranked_multiplier_duration, EasingTypes.OutQuint);
|
||||
rankedMultiplerContainer.FadeIn(ranked_multiplier_duration, EasingTypes.OutQuint);
|
||||
rankedMultiplerContainer.MoveToX(0, ranked_multiplier_duration, Easing.OutQuint);
|
||||
rankedMultiplerContainer.FadeIn(ranked_multiplier_duration, Easing.OutQuint);
|
||||
|
||||
foreach (ModSection section in modSectionsContainer.Children)
|
||||
{
|
||||
section.ButtonsContainer.TransformSpacingTo(new Vector2(50f, 0f), button_duration, EasingTypes.OutQuint);
|
||||
section.ButtonsContainer.MoveToX(0, button_duration, EasingTypes.OutQuint);
|
||||
section.ButtonsContainer.FadeIn(button_duration, EasingTypes.OutQuint);
|
||||
section.ButtonsContainer.TransformSpacingTo(new Vector2(50f, 0f), button_duration, Easing.OutQuint);
|
||||
section.ButtonsContainer.MoveToX(0, button_duration, Easing.OutQuint);
|
||||
section.ButtonsContainer.FadeIn(button_duration, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Music
|
||||
if (value == selected) return;
|
||||
selected = value;
|
||||
|
||||
Flush(true);
|
||||
FinishTransforms(true);
|
||||
foreach (SpriteText s in titleSprites)
|
||||
s.FadeColour(Selected ? hoverColour : Color4.White, fade_duration);
|
||||
}
|
||||
@ -145,7 +145,7 @@ namespace osu.Game.Overlays.Music
|
||||
|
||||
matching = value;
|
||||
|
||||
FadeTo(matching ? 1 : 0, 200);
|
||||
this.FadeTo(matching ? 1 : 0, 200);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays.Music
|
||||
@ -73,6 +73,17 @@ namespace osu.Game.Overlays.Music
|
||||
};
|
||||
}
|
||||
|
||||
public void AddBeatmapSet(BeatmapSetInfo beatmapSet)
|
||||
{
|
||||
items.Add(new PlaylistItem(beatmapSet) { OnSelect = itemSelected });
|
||||
}
|
||||
|
||||
public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet)
|
||||
{
|
||||
PlaylistItem itemToRemove = items.Children.FirstOrDefault(item => item.BeatmapSetInfo.ID == beatmapSet.ID);
|
||||
if (itemToRemove != null) items.Remove(itemToRemove);
|
||||
}
|
||||
|
||||
private class ItemSearchContainer : FillFlowContainer<PlaylistItem>, IHasFilterableChildren
|
||||
{
|
||||
public string[] FilterTerms => new string[] { };
|
||||
@ -90,7 +101,7 @@ namespace osu.Game.Overlays.Music
|
||||
public ItemSearchContainer()
|
||||
{
|
||||
LayoutDuration = 200;
|
||||
LayoutEasing = EasingTypes.OutQuint;
|
||||
LayoutEasing = Easing.OutQuint;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
@ -14,10 +12,11 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
|
||||
namespace osu.Game.Overlays.Music
|
||||
{
|
||||
@ -30,8 +29,7 @@ namespace osu.Game.Overlays.Music
|
||||
private FilterControl filter;
|
||||
private PlaylistList list;
|
||||
|
||||
private TrackManager trackManager;
|
||||
private BeatmapDatabase beatmaps;
|
||||
private BeatmapManager beatmaps;
|
||||
|
||||
private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>();
|
||||
|
||||
@ -39,11 +37,10 @@ namespace osu.Game.Overlays.Music
|
||||
private InputManager inputManager;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuGameBase game, BeatmapDatabase beatmaps, OsuColour colours, UserInputManager inputManager)
|
||||
private void load(OsuGameBase game, BeatmapManager beatmaps, OsuColour colours, UserInputManager inputManager)
|
||||
{
|
||||
this.inputManager = inputManager;
|
||||
this.beatmaps = beatmaps;
|
||||
trackManager = game.Audio.Track;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@ -83,7 +80,11 @@ namespace osu.Game.Overlays.Music
|
||||
},
|
||||
};
|
||||
|
||||
list.BeatmapSets = BeatmapSets = beatmaps.GetAllWithChildren<BeatmapSetInfo>(b => !b.DeletePending).ToList();
|
||||
beatmaps.BeatmapSetAdded += s => Schedule(() => list.AddBeatmapSet(s));
|
||||
beatmaps.BeatmapSetRemoved += s => Schedule(() => list.RemoveBeatmapSet(s));
|
||||
|
||||
list.BeatmapSets = BeatmapSets = beatmaps.GetAllUsableBeatmapSets();
|
||||
|
||||
|
||||
beatmapBacking.BindTo(game.Beatmap);
|
||||
|
||||
@ -106,16 +107,16 @@ namespace osu.Game.Overlays.Music
|
||||
filter.Search.HoldFocus = true;
|
||||
Schedule(() => inputManager.ChangeFocus(filter.Search));
|
||||
|
||||
ResizeTo(new Vector2(1, playlist_height), transition_duration, EasingTypes.OutQuint);
|
||||
FadeIn(transition_duration, EasingTypes.OutQuint);
|
||||
this.ResizeTo(new Vector2(1, playlist_height), transition_duration, Easing.OutQuint);
|
||||
this.FadeIn(transition_duration, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
filter.Search.HoldFocus = false;
|
||||
|
||||
ResizeTo(new Vector2(1, 0), transition_duration, EasingTypes.OutQuint);
|
||||
FadeOut(transition_duration);
|
||||
this.ResizeTo(new Vector2(1, 0), transition_duration, Easing.OutQuint);
|
||||
this.FadeOut(transition_duration);
|
||||
}
|
||||
|
||||
private void itemSelected(BeatmapSetInfo set)
|
||||
@ -154,13 +155,7 @@ namespace osu.Game.Overlays.Music
|
||||
private void playSpecified(BeatmapInfo info)
|
||||
{
|
||||
beatmapBacking.Value = beatmaps.GetWorkingBeatmap(info, beatmapBacking);
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
var track = beatmapBacking.Value.Track;
|
||||
trackManager.SetExclusive(track);
|
||||
track.Start();
|
||||
}).ContinueWith(task => Schedule(task.ThrowIfFaulted), TaskContinuationOptions.OnlyOnFaulted);
|
||||
beatmapBacking.Value.Track.Start();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ using osu.Framework.Input;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Overlays.Music;
|
||||
@ -84,7 +83,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
protected override bool OnDragEnd(InputState state)
|
||||
{
|
||||
dragContainer.MoveTo(Vector2.Zero, 800, EasingTypes.OutElastic);
|
||||
dragContainer.MoveTo(Vector2.Zero, 800, Easing.OutElastic);
|
||||
return base.OnDragEnd(state);
|
||||
}
|
||||
|
||||
@ -206,7 +205,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
beatmapBacking.BindTo(game.Beatmap);
|
||||
|
||||
playlist.StateChanged += (c, s) => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, EasingTypes.OutQuint);
|
||||
playlist.StateChanged += (c, s) => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -356,13 +355,13 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
case TransformDirection.Next:
|
||||
d.Position = new Vector2(400, 0);
|
||||
d.MoveToX(0, 500, EasingTypes.OutCubic);
|
||||
currentBackground.MoveToX(-400, 500, EasingTypes.OutCubic);
|
||||
d.MoveToX(0, 500, Easing.OutCubic);
|
||||
currentBackground.MoveToX(-400, 500, Easing.OutCubic);
|
||||
break;
|
||||
case TransformDirection.Prev:
|
||||
d.Position = new Vector2(-400, 0);
|
||||
d.MoveToX(0, 500, EasingTypes.OutCubic);
|
||||
currentBackground.MoveToX(400, 500, EasingTypes.OutCubic);
|
||||
d.MoveToX(0, 500, Easing.OutCubic);
|
||||
currentBackground.MoveToX(400, 500, Easing.OutCubic);
|
||||
break;
|
||||
}
|
||||
currentBackground.Expire();
|
||||
@ -379,16 +378,16 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
base.PopIn();
|
||||
|
||||
FadeIn(transition_length, EasingTypes.OutQuint);
|
||||
dragContainer.ScaleTo(1, transition_length, EasingTypes.OutElastic);
|
||||
this.FadeIn(transition_length, Easing.OutQuint);
|
||||
dragContainer.ScaleTo(1, transition_length, Easing.OutElastic);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
base.PopOut();
|
||||
|
||||
FadeOut(transition_length, EasingTypes.OutQuint);
|
||||
dragContainer.ScaleTo(0.9f, transition_length, EasingTypes.OutQuint);
|
||||
this.FadeOut(transition_length, Easing.OutQuint);
|
||||
dragContainer.ScaleTo(0.9f, transition_length, Easing.OutQuint);
|
||||
}
|
||||
|
||||
private enum TransformDirection
|
||||
|
@ -13,7 +13,7 @@ using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class NotificationManager : OsuFocusedOverlayContainer
|
||||
public class NotificationOverlay : OsuFocusedOverlayContainer
|
||||
{
|
||||
private const float width = 320;
|
||||
|
||||
@ -28,6 +28,8 @@ namespace osu.Game.Overlays
|
||||
Width = width;
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
|
||||
AlwaysPresent = true;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
@ -72,26 +74,29 @@ namespace osu.Game.Overlays
|
||||
|
||||
public void Post(Notification notification)
|
||||
{
|
||||
State = Visibility.Visible;
|
||||
Schedule(() =>
|
||||
{
|
||||
State = Visibility.Visible;
|
||||
|
||||
++runningDepth;
|
||||
notification.Depth = notification.DisplayOnTop ? runningDepth : -runningDepth;
|
||||
++runningDepth;
|
||||
notification.Depth = notification.DisplayOnTop ? runningDepth : -runningDepth;
|
||||
|
||||
var hasCompletionTarget = notification as IHasCompletionTarget;
|
||||
if (hasCompletionTarget != null)
|
||||
hasCompletionTarget.CompletionTarget = Post;
|
||||
var hasCompletionTarget = notification as IHasCompletionTarget;
|
||||
if (hasCompletionTarget != null)
|
||||
hasCompletionTarget.CompletionTarget = Post;
|
||||
|
||||
var ourType = notification.GetType();
|
||||
sections.Children.FirstOrDefault(s => s.AcceptTypes.Any(accept => accept.IsAssignableFrom(ourType)))?.Add(notification);
|
||||
var ourType = notification.GetType();
|
||||
sections.Children.FirstOrDefault(s => s.AcceptTypes.Any(accept => accept.IsAssignableFrom(ourType)))?.Add(notification);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void PopIn()
|
||||
{
|
||||
base.PopIn();
|
||||
|
||||
scrollContainer.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||
MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||
FadeTo(1, TRANSITION_LENGTH / 2);
|
||||
scrollContainer.MoveToX(0, TRANSITION_LENGTH, Easing.OutQuint);
|
||||
this.MoveToX(0, TRANSITION_LENGTH, Easing.OutQuint);
|
||||
this.FadeTo(1, TRANSITION_LENGTH / 2);
|
||||
}
|
||||
|
||||
private void markAllRead()
|
||||
@ -105,8 +110,8 @@ namespace osu.Game.Overlays
|
||||
|
||||
markAllRead();
|
||||
|
||||
MoveToX(width, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||
FadeTo(0, TRANSITION_LENGTH / 2);
|
||||
this.MoveToX(width, TRANSITION_LENGTH, Easing.OutQuint);
|
||||
this.FadeTo(0, TRANSITION_LENGTH / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -63,6 +63,8 @@ namespace osu.Game.Overlays.Notifications
|
||||
Masking = true,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
AutoSizeDuration = 400,
|
||||
AutoSizeEasing = Easing.OutQuint,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
@ -74,7 +76,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Padding = new MarginPadding(5),
|
||||
Height = 60,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
IconContent = new Container
|
||||
@ -135,9 +137,9 @@ namespace osu.Game.Overlays.Notifications
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
FadeInFromZero(200);
|
||||
this.FadeInFromZero(200);
|
||||
NotificationContent.MoveToX(DrawSize.X);
|
||||
NotificationContent.MoveToX(0, 500, EasingTypes.OutQuint);
|
||||
NotificationContent.MoveToX(0, 500, Easing.OutQuint);
|
||||
}
|
||||
|
||||
private bool wasClosed;
|
||||
@ -148,7 +150,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
wasClosed = true;
|
||||
|
||||
Closed?.Invoke();
|
||||
FadeOut(100);
|
||||
this.FadeOut(100);
|
||||
Expire();
|
||||
}
|
||||
|
||||
@ -181,13 +183,13 @@ namespace osu.Game.Overlays.Notifications
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
FadeColour(hoverColour, 200);
|
||||
this.FadeColour(hoverColour, 200);
|
||||
return base.OnHover(state);
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(InputState state)
|
||||
{
|
||||
FadeColour(OsuColour.Gray(0.2f), 200);
|
||||
this.FadeColour(OsuColour.Gray(0.2f), 200);
|
||||
base.OnHoverLost(state);
|
||||
}
|
||||
}
|
||||
@ -212,12 +214,9 @@ namespace osu.Game.Overlays.Notifications
|
||||
if (pulsate)
|
||||
{
|
||||
const float length = 1000;
|
||||
using (pulsateLayer.BeginLoopedSequence(length / 2))
|
||||
{
|
||||
pulsateLayer.FadeTo(0.4f, length, EasingTypes.In);
|
||||
using (pulsateLayer.BeginDelayedSequence(length))
|
||||
pulsateLayer.FadeTo(1, length, EasingTypes.Out);
|
||||
}
|
||||
pulsateLayer.Loop(length / 2,
|
||||
p => p.FadeTo(0.4f, length, Easing.In).Then().FadeTo(1, length, Easing.Out)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
LayoutDuration = 150,
|
||||
LayoutEasing = EasingTypes.OutQuart,
|
||||
LayoutEasing = Easing.OutQuart,
|
||||
Spacing = new Vector2(3),
|
||||
}
|
||||
});
|
||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
IconBackgound.ColourInfo = ColourInfo.GradientVertical(colours.GreenDark, colours.GreenLight);
|
||||
IconBackgound.Colour = ColourInfo.GradientVertical(colours.GreenDark, colours.GreenLight);
|
||||
}
|
||||
}
|
||||
}
|
@ -6,9 +6,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
@ -18,10 +16,9 @@ namespace osu.Game.Overlays.Notifications
|
||||
{
|
||||
public string Text
|
||||
{
|
||||
get { return textDrawable.Text; }
|
||||
set
|
||||
{
|
||||
textDrawable.Text = value;
|
||||
Schedule(() => textDrawable.Text = value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,11 +74,8 @@ namespace osu.Game.Overlays.Notifications
|
||||
switch (state)
|
||||
{
|
||||
case ProgressNotificationState.Completed:
|
||||
NotificationContent.MoveToY(-DrawSize.Y / 2, 200, EasingTypes.OutQuint);
|
||||
FadeTo(0.01f, 200); //don't completely fade out or our scheduled task won't run.
|
||||
|
||||
Delay(100);
|
||||
Schedule(Completed);
|
||||
NotificationContent.MoveToY(-DrawSize.Y / 2, 200, Easing.OutQuint);
|
||||
this.FadeOut(200).Finally(d => Completed());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -93,7 +87,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification
|
||||
{
|
||||
Activated = CompletionClickAction,
|
||||
Text = $"Task \"{Text}\" has completed!"
|
||||
Text = "Task has completed!"
|
||||
};
|
||||
|
||||
protected virtual void Completed()
|
||||
@ -109,7 +103,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
private Color4 colourActive;
|
||||
private Color4 colourCancelled;
|
||||
|
||||
private readonly SpriteText textDrawable;
|
||||
private readonly TextFlowContainer textDrawable;
|
||||
|
||||
public ProgressNotification()
|
||||
{
|
||||
@ -118,9 +112,11 @@ namespace osu.Game.Overlays.Notifications
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
});
|
||||
|
||||
Content.Add(textDrawable = new OsuSpriteText
|
||||
Content.Add(textDrawable = new TextFlowContainer(t =>
|
||||
{
|
||||
t.TextSize = 16;
|
||||
})
|
||||
{
|
||||
TextSize = 16,
|
||||
Colour = OsuColour.Gray(128),
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
@ -134,6 +130,9 @@ namespace osu.Game.Overlays.Notifications
|
||||
});
|
||||
|
||||
State = ProgressNotificationState.Queued;
|
||||
|
||||
// don't close on click by default.
|
||||
Activated = () => false;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -170,7 +169,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
|
||||
private class ProgressBar : Container
|
||||
{
|
||||
private Box box;
|
||||
private readonly Box box;
|
||||
|
||||
private Color4 colourActive;
|
||||
private Color4 colourInactive;
|
||||
@ -184,7 +183,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
if (progress == value) return;
|
||||
|
||||
progress = value;
|
||||
box.ResizeTo(new Vector2(progress, 1), 100, EasingTypes.OutQuad);
|
||||
box.ResizeTo(new Vector2(progress, 1), 100, Easing.OutQuad);
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,19 +195,12 @@ namespace osu.Game.Overlays.Notifications
|
||||
set
|
||||
{
|
||||
active = value;
|
||||
FadeColour(active ? colourActive : colourInactive, 100);
|
||||
this.FadeColour(active ? colourActive : colourInactive, 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
public ProgressBar()
|
||||
{
|
||||
colourActive = colours.Blue;
|
||||
Colour = colourInactive = OsuColour.Gray(0.5f);
|
||||
|
||||
Height = 5;
|
||||
|
||||
Children = new[]
|
||||
{
|
||||
box = new Box
|
||||
@ -218,6 +210,15 @@ namespace osu.Game.Overlays.Notifications
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
colourActive = colours.Blue;
|
||||
Colour = colourInactive = OsuColour.Gray(0.5f);
|
||||
Height = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
IconBackgound = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
ColourInfo = ColourInfo.GradientVertical(OsuColour.Gray(0.2f), OsuColour.Gray(0.6f))
|
||||
Colour = ColourInfo.GradientVertical(OsuColour.Gray(0.2f), OsuColour.Gray(0.6f))
|
||||
},
|
||||
iconDrawable = new TextAwesome
|
||||
{
|
||||
|
@ -154,14 +154,13 @@ namespace osu.Game.Overlays
|
||||
textLine2.Text = settingValue;
|
||||
textLine3.Text = shortcut.ToUpper();
|
||||
|
||||
box.FadeIn(500, EasingTypes.OutQuint);
|
||||
box.ResizeHeightTo(height, 500, EasingTypes.OutQuint);
|
||||
|
||||
using (box.BeginDelayedSequence(500))
|
||||
{
|
||||
box.FadeOutFromOne(1500, EasingTypes.InQuint);
|
||||
box.ResizeHeightTo(height_contracted, 1500, EasingTypes.InQuint);
|
||||
}
|
||||
box.Animate(
|
||||
b => b.FadeIn(500, Easing.OutQuint),
|
||||
b => b.ResizeHeightTo(height, 500, Easing.OutQuint)
|
||||
).Then(
|
||||
b => b.FadeOutFromOne(1500, Easing.InQuint),
|
||||
b => b.ResizeHeightTo(height_contracted, 1500, Easing.InQuint)
|
||||
);
|
||||
|
||||
int optionCount = 0;
|
||||
int selectedOption = -1;
|
||||
@ -232,13 +231,13 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
if (glowing)
|
||||
{
|
||||
fill.FadeColour(glowingColour, transition_speed, EasingTypes.OutQuint);
|
||||
FadeEdgeEffectTo(glow_strength, transition_speed, EasingTypes.OutQuint);
|
||||
fill.FadeColour(glowingColour, transition_speed, Easing.OutQuint);
|
||||
FadeEdgeEffectTo(glow_strength, transition_speed, Easing.OutQuint);
|
||||
}
|
||||
else
|
||||
{
|
||||
FadeEdgeEffectTo(0, transition_speed, EasingTypes.OutQuint);
|
||||
fill.FadeColour(idleColour, transition_speed, EasingTypes.OutQuint);
|
||||
FadeEdgeEffectTo(0, transition_speed, Easing.OutQuint);
|
||||
fill.FadeColour(idleColour, transition_speed, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
|
||||
@ -261,7 +260,7 @@ namespace osu.Game.Overlays
|
||||
};
|
||||
|
||||
updateGlow();
|
||||
Flush(true);
|
||||
FinishTransforms(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,16 +12,20 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Users;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
|
||||
namespace osu.Game.Overlays.Profile
|
||||
{
|
||||
public class ProfileHeader : Container
|
||||
{
|
||||
private readonly OsuTextFlowContainer infoTextLeft, infoTextRight;
|
||||
private readonly OsuTextFlowContainer infoTextLeft;
|
||||
private readonly LinkFlowContainer infoTextRight;
|
||||
private readonly FillFlowContainer<SpriteText> scoreText, scoreNumberText;
|
||||
|
||||
private readonly Container coverContainer, chartContainer, supporterTag;
|
||||
@ -29,6 +33,7 @@ namespace osu.Game.Overlays.Profile
|
||||
private readonly SpriteText levelText;
|
||||
private readonly GradeBadge gradeSSPlus, gradeSS, gradeSPlus, gradeS, gradeA;
|
||||
private readonly Box colourBar;
|
||||
private readonly DrawableFlag countryFlag;
|
||||
|
||||
private const float cover_height = 350;
|
||||
private const float info_height = 150;
|
||||
@ -53,7 +58,7 @@ namespace osu.Game.Overlays.Profile
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
ColourInfo = ColourInfo.GradientVertical(Color4.Black.Opacity(0.1f), Color4.Black.Opacity(0.75f))
|
||||
Colour = ColourInfo.GradientVertical(Color4.Black.Opacity(0.1f), Color4.Black.Opacity(0.75f))
|
||||
},
|
||||
new Container
|
||||
{
|
||||
@ -114,16 +119,17 @@ namespace osu.Game.Overlays.Profile
|
||||
}
|
||||
}
|
||||
},
|
||||
new OsuSpriteText
|
||||
new LinkFlowContainer.LinkText
|
||||
{
|
||||
Text = user.Username,
|
||||
Url = $@"https://osu.ppy.sh/users/{user.Id}",
|
||||
TextSize = 30,
|
||||
Font = @"Exo2.0-RegularItalic",
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
Y = -48
|
||||
},
|
||||
new DrawableFlag(user.Country?.FlagName ?? "__")
|
||||
countryFlag = new DrawableFlag(user.Country?.FlagName)
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
@ -158,7 +164,7 @@ namespace osu.Game.Overlays.Profile
|
||||
ParagraphSpacing = 0.8f,
|
||||
LineSpacing = 0.2f
|
||||
},
|
||||
infoTextRight = new OsuTextFlowContainer(t =>
|
||||
infoTextRight = new LinkFlowContainer(t =>
|
||||
{
|
||||
t.TextSize = 14;
|
||||
t.Font = @"Exo2.0-RegularItalic";
|
||||
@ -350,6 +356,7 @@ namespace osu.Game.Overlays.Profile
|
||||
{
|
||||
infoTextLeft.AddText("from ");
|
||||
infoTextLeft.AddText(user.Country.FullName, boldItalic);
|
||||
countryFlag.FlagName = user.Country.FlagName;
|
||||
}
|
||||
infoTextLeft.NewParagraph();
|
||||
|
||||
@ -373,14 +380,22 @@ namespace osu.Game.Overlays.Profile
|
||||
infoTextLeft.AddText(string.Join(", ", user.PlayStyle), boldItalic);
|
||||
}
|
||||
|
||||
string websiteWithoutProtcol = user.Website;
|
||||
if (!string.IsNullOrEmpty(websiteWithoutProtcol))
|
||||
{
|
||||
int protocolIndex = websiteWithoutProtcol.IndexOf("//", StringComparison.Ordinal);
|
||||
if (protocolIndex >= 0)
|
||||
websiteWithoutProtcol = websiteWithoutProtcol.Substring(protocolIndex + 2);
|
||||
}
|
||||
|
||||
tryAddInfoRightLine(FontAwesome.fa_map_marker, user.Location);
|
||||
tryAddInfoRightLine(FontAwesome.fa_heart_o, user.Intrerests);
|
||||
tryAddInfoRightLine(FontAwesome.fa_suitcase, user.Occupation);
|
||||
infoTextRight.NewParagraph();
|
||||
if (!string.IsNullOrEmpty(user.Twitter))
|
||||
tryAddInfoRightLine(FontAwesome.fa_twitter, "@" + user.Twitter);
|
||||
tryAddInfoRightLine(FontAwesome.fa_globe, user.Website);
|
||||
tryAddInfoRightLine(FontAwesome.fa_skype, user.Skype);
|
||||
tryAddInfoRightLine(FontAwesome.fa_twitter, "@" + user.Twitter, $@"https://twitter.com/{user.Twitter}");
|
||||
tryAddInfoRightLine(FontAwesome.fa_globe, websiteWithoutProtcol, user.Website);
|
||||
tryAddInfoRightLine(FontAwesome.fa_skype, user.Skype, @"skype:" + user.Skype + @"?chat");
|
||||
|
||||
if (user.Statistics != null)
|
||||
{
|
||||
@ -390,7 +405,7 @@ namespace osu.Game.Overlays.Profile
|
||||
scoreText.Add(createScoreText("Ranked Score"));
|
||||
scoreNumberText.Add(createScoreNumberText(user.Statistics.RankedScore.ToString(@"#,0")));
|
||||
scoreText.Add(createScoreText("Accuracy"));
|
||||
scoreNumberText.Add(createScoreNumberText($"{user.Statistics.Accuracy}%"));
|
||||
scoreNumberText.Add(createScoreNumberText($"{user.Statistics.Accuracy.ToString("0.##", CultureInfo.CurrentCulture)}%"));
|
||||
scoreText.Add(createScoreText("Play Count"));
|
||||
scoreNumberText.Add(createScoreNumberText(user.Statistics.PlayCount.ToString(@"#,0")));
|
||||
scoreText.Add(createScoreText("Total Score"));
|
||||
@ -433,12 +448,12 @@ namespace osu.Game.Overlays.Profile
|
||||
Text = text
|
||||
};
|
||||
|
||||
private void tryAddInfoRightLine(FontAwesome icon, string str)
|
||||
private void tryAddInfoRightLine(FontAwesome icon, string str, string url = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(str)) return;
|
||||
|
||||
infoTextRight.AddIcon(icon);
|
||||
infoTextRight.AddText(" " + str);
|
||||
infoTextRight.AddLink(" " + str, url);
|
||||
infoTextRight.NewLine();
|
||||
}
|
||||
|
||||
@ -479,5 +494,51 @@ namespace osu.Game.Overlays.Profile
|
||||
badge.Texture = textures.Get($"Grades/{grade}");
|
||||
}
|
||||
}
|
||||
|
||||
private class LinkFlowContainer : OsuTextFlowContainer
|
||||
{
|
||||
public override bool HandleInput => true;
|
||||
|
||||
public LinkFlowContainer(Action<SpriteText> defaultCreationParameters = null) : base(defaultCreationParameters)
|
||||
{
|
||||
}
|
||||
|
||||
protected override SpriteText CreateSpriteText() => new LinkText();
|
||||
|
||||
public void AddLink(string text, string url) => AddText(text, link => ((LinkText)link).Url = url);
|
||||
|
||||
public class LinkText : OsuSpriteText
|
||||
{
|
||||
public override bool HandleInput => Url != null;
|
||||
|
||||
public string Url;
|
||||
|
||||
private Color4 hoverColour;
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
this.FadeColour(hoverColour, 500, Easing.OutQuint);
|
||||
return base.OnHover(state);
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(InputState state)
|
||||
{
|
||||
this.FadeColour(Color4.White, 500, Easing.OutQuint);
|
||||
base.OnHoverLost(state);
|
||||
}
|
||||
|
||||
protected override bool OnClick(InputState state)
|
||||
{
|
||||
Process.Start(Url);
|
||||
return true;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
hoverColour = colours.Yellow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ namespace osu.Game.Overlays.Profile
|
||||
|
||||
public void ResetBall()
|
||||
{
|
||||
ball.MoveTo(new Vector2(1, GetYPosition(Values.Last())), ballShown ? transform_duration : 0, EasingTypes.OutQuint);
|
||||
ball.MoveTo(new Vector2(1, GetYPosition(Values.Last())), ballShown ? transform_duration : 0, Easing.OutQuint);
|
||||
ball.Show();
|
||||
BallRelease();
|
||||
ballShown = true;
|
||||
@ -158,7 +158,7 @@ namespace osu.Game.Overlays.Profile
|
||||
float y = GetYPosition(values[i]);
|
||||
if (Math.Abs(y * DrawHeight - position.Y) <= 8f)
|
||||
{
|
||||
ball.MoveTo(new Vector2(index / (float)(count - 1), y), transform_duration, EasingTypes.OutQuint);
|
||||
ball.MoveTo(new Vector2(index / (float)(count - 1), y), transform_duration, Easing.OutQuint);
|
||||
BallMove(i);
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Overlays.Settings.Sections.Gameplay;
|
||||
using osu.Game.Rulesets;
|
||||
@ -26,7 +25,7 @@ namespace osu.Game.Overlays.Settings.Sections
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(RulesetDatabase rulesets)
|
||||
private void load(RulesetStore rulesets)
|
||||
{
|
||||
foreach(Ruleset ruleset in rulesets.AllRulesets.Select(info => info.CreateInstance()))
|
||||
{
|
||||
|
@ -291,7 +291,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
{
|
||||
set
|
||||
{
|
||||
statusIcon.FadeColour(value, 500, EasingTypes.OutQuint);
|
||||
statusIcon.FadeColour(value, 500, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
AutoSizeDuration = transition_duration,
|
||||
AutoSizeEasing = EasingTypes.OutQuint,
|
||||
AutoSizeEasing = Easing.OutQuint,
|
||||
Masking = true,
|
||||
|
||||
Children = new Drawable[]
|
||||
@ -66,7 +66,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
letterboxSettings.AutoSizeAxes = isVisible ? Axes.Y : Axes.None;
|
||||
|
||||
if (!isVisible)
|
||||
letterboxSettings.ResizeHeightTo(0, transition_duration, EasingTypes.OutQuint);
|
||||
letterboxSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
|
||||
};
|
||||
letterboxing.TriggerChange();
|
||||
}
|
||||
|
@ -0,0 +1,47 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
{
|
||||
public class GeneralSettings : SettingsSubsection
|
||||
{
|
||||
private OsuButton importButton;
|
||||
private OsuButton deleteButton;
|
||||
|
||||
protected override string Header => "General";
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(BeatmapManager beatmaps)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
importButton = new OsuButton
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Text = "Import beatmaps from stable",
|
||||
Action = () =>
|
||||
{
|
||||
importButton.Enabled.Value = false;
|
||||
Task.Run(() => beatmaps.ImportFromStable()).ContinueWith(t => Schedule(() => importButton.Enabled.Value = true));
|
||||
}
|
||||
},
|
||||
deleteButton = new OsuButton
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Text = "Delete ALL beatmaps",
|
||||
Action = () =>
|
||||
{
|
||||
deleteButton.Enabled.Value = false;
|
||||
Task.Run(() => beatmaps.DeleteAll()).ContinueWith(t => Schedule(() => deleteButton.Enabled.Value = true));
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Overlays.Settings.Sections.Maintenance;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Overlays.Settings.Sections
|
||||
@ -17,6 +18,7 @@ namespace osu.Game.Overlays.Settings.Sections
|
||||
FlowContent.Spacing = new Vector2(0, 5);
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new GeneralSettings()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -5,9 +5,9 @@ using System.Collections.Generic;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Rulesets;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Settings
|
||||
public class SettingsFooter : FillFlowContainer
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuGameBase game, OsuColour colours, RulesetDatabase rulesets)
|
||||
private void load(OsuGameBase game, OsuColour colours, RulesetStore rulesets)
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
|
@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Settings
|
||||
set
|
||||
{
|
||||
// probably needs a better transition.
|
||||
FadeTo(value ? 1 : 0);
|
||||
this.FadeTo(value ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Settings
|
||||
{
|
||||
set
|
||||
{
|
||||
FadeTo(value ? 1 : 0);
|
||||
this.FadeTo(value ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Settings
|
||||
{
|
||||
set
|
||||
{
|
||||
FadeTo(value ? 1 : 0);
|
||||
this.FadeTo(value ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -94,10 +94,10 @@ namespace osu.Game.Overlays.Settings
|
||||
switch (state)
|
||||
{
|
||||
default:
|
||||
ResizeTo(new Vector2(DEFAULT_WIDTH, Height), 500, EasingTypes.OutQuint);
|
||||
this.ResizeTo(new Vector2(DEFAULT_WIDTH, Height), 500, Easing.OutQuint);
|
||||
break;
|
||||
case ExpandedState.Expanded:
|
||||
ResizeTo(new Vector2(EXPANDED_WIDTH, Height), 500, EasingTypes.OutQuint);
|
||||
this.ResizeTo(new Vector2(EXPANDED_WIDTH, Height), 500, Easing.OutQuint);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -125,9 +125,9 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
base.PopIn();
|
||||
|
||||
sectionsContainer.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||
sidebar.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||
FadeTo(1, TRANSITION_LENGTH / 2);
|
||||
sectionsContainer.MoveToX(0, TRANSITION_LENGTH, Easing.OutQuint);
|
||||
sidebar.MoveToX(0, TRANSITION_LENGTH, Easing.OutQuint);
|
||||
this.FadeTo(1, TRANSITION_LENGTH / 2);
|
||||
|
||||
searchTextBox.HoldFocus = true;
|
||||
}
|
||||
@ -136,9 +136,9 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
base.PopOut();
|
||||
|
||||
sectionsContainer.MoveToX(-width, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||
sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, EasingTypes.OutQuint);
|
||||
FadeTo(0, TRANSITION_LENGTH / 2);
|
||||
sectionsContainer.MoveToX(-width, TRANSITION_LENGTH, Easing.OutQuint);
|
||||
sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, Easing.OutQuint);
|
||||
this.FadeTo(0, TRANSITION_LENGTH / 2);
|
||||
|
||||
searchTextBox.HoldFocus = false;
|
||||
if (searchTextBox.HasFocus)
|
||||
|
@ -99,7 +99,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Alpha = 0,
|
||||
Height = 90,
|
||||
ColourInfo = ColourInfo.GradientVertical(
|
||||
Colour = ColourInfo.GradientVertical(
|
||||
OsuColour.Gray(0.1f).Opacity(0.5f), OsuColour.Gray(0.1f).Opacity(0)),
|
||||
},
|
||||
};
|
||||
@ -107,30 +107,30 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
solidBackground.FadeTo(alpha_hovering, transition_time, EasingTypes.OutQuint);
|
||||
gradientBackground.FadeIn(transition_time, EasingTypes.OutQuint);
|
||||
solidBackground.FadeTo(alpha_hovering, transition_time, Easing.OutQuint);
|
||||
gradientBackground.FadeIn(transition_time, Easing.OutQuint);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(InputState state)
|
||||
{
|
||||
solidBackground.FadeTo(alpha_normal, transition_time, EasingTypes.OutQuint);
|
||||
gradientBackground.FadeOut(transition_time, EasingTypes.OutQuint);
|
||||
solidBackground.FadeTo(alpha_normal, transition_time, Easing.OutQuint);
|
||||
gradientBackground.FadeOut(transition_time, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void PopIn()
|
||||
{
|
||||
MoveToY(0, transition_time, EasingTypes.OutQuint);
|
||||
FadeIn(transition_time / 2, EasingTypes.OutQuint);
|
||||
this.MoveToY(0, transition_time, Easing.OutQuint);
|
||||
this.FadeIn(transition_time / 2, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
userArea?.LoginOverlay.Hide();
|
||||
|
||||
MoveToY(-DrawSize.Y, transition_time, EasingTypes.OutQuint);
|
||||
FadeOut(transition_time);
|
||||
this.MoveToY(-DrawSize.Y, transition_time, Easing.OutQuint);
|
||||
this.FadeOut(transition_time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
protected override bool OnClick(InputState state)
|
||||
{
|
||||
HoverBackground.FlashColour(Color4.White.Opacity(100), 500, EasingTypes.OutQuint);
|
||||
HoverBackground.FlashColour(Color4.White.Opacity(100), 500, Easing.OutQuint);
|
||||
return base.OnClick(state);
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Rulesets;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
|
@ -6,11 +6,11 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Caching;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Database;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Rulesets;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
@ -65,7 +65,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(RulesetDatabase rulesets, OsuGame game)
|
||||
private void load(RulesetStore rulesets, OsuGame game)
|
||||
{
|
||||
foreach (var r in rulesets.AllRulesets)
|
||||
{
|
||||
@ -86,7 +86,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
public override bool HandleInput => !ruleset.Disabled;
|
||||
|
||||
private void disabledChanged(bool isDisabled) => FadeColour(isDisabled ? Color4.Gray : Color4.White, 300);
|
||||
private void disabledChanged(bool isDisabled) => this.FadeColour(isDisabled ? Color4.Gray : Color4.White, 300);
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
@ -115,7 +115,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
if (!activeMode.IsValid)
|
||||
{
|
||||
modeButtonLine.MoveToX(activeButton.DrawPosition.X, 200, EasingTypes.OutQuint);
|
||||
modeButtonLine.MoveToX(activeButton.DrawPosition.X, 200, Easing.OutQuint);
|
||||
activeMode.Validate();
|
||||
}
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ namespace osu.Game.Overlays.Toolbar
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(NotificationManager notificationManager)
|
||||
private void load(NotificationOverlay notificationOverlay)
|
||||
{
|
||||
StateContainer = notificationManager;
|
||||
StateContainer = notificationOverlay;
|
||||
}
|
||||
}
|
||||
}
|
@ -73,13 +73,13 @@ namespace osu.Game.Overlays
|
||||
protected override void PopIn()
|
||||
{
|
||||
base.PopIn();
|
||||
FadeEdgeEffectTo(0.5f, APPEAR_DURATION, EasingTypes.In);
|
||||
FadeEdgeEffectTo(0.5f, APPEAR_DURATION, Easing.In);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
base.PopOut();
|
||||
FadeEdgeEffectTo(0, DISAPPEAR_DURATION, EasingTypes.Out);
|
||||
FadeEdgeEffectTo(0, DISAPPEAR_DURATION, Easing.Out);
|
||||
}
|
||||
|
||||
public void ShowUser(User user, bool fetchOnline = true)
|
||||
|
@ -17,8 +17,8 @@ namespace osu.Game.Overlays
|
||||
protected const float APPEAR_DURATION = 800;
|
||||
protected const float DISAPPEAR_DURATION = 500;
|
||||
|
||||
private const EasingTypes easing_show = EasingTypes.OutSine;
|
||||
private const EasingTypes easing_hide = EasingTypes.InSine;
|
||||
private const Easing easing_show = Easing.OutSine;
|
||||
private const Easing easing_hide = Easing.InSine;
|
||||
|
||||
private readonly Wave firstWave;
|
||||
private readonly Wave secondWave;
|
||||
@ -137,23 +137,23 @@ namespace osu.Game.Overlays
|
||||
foreach (var w in wavesContainer.Children)
|
||||
w.State = Visibility.Visible;
|
||||
|
||||
FadeIn(100, EasingTypes.OutQuint);
|
||||
contentContainer.MoveToY(0, APPEAR_DURATION, EasingTypes.OutQuint);
|
||||
this.FadeIn(100, Easing.OutQuint);
|
||||
contentContainer.MoveToY(0, APPEAR_DURATION, Easing.OutQuint);
|
||||
|
||||
FadeIn(100, EasingTypes.OutQuint);
|
||||
this.FadeIn(100, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
base.PopOut();
|
||||
|
||||
FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint);
|
||||
contentContainer.MoveToY(DrawHeight * 2f, DISAPPEAR_DURATION, EasingTypes.In);
|
||||
this.FadeOut(DISAPPEAR_DURATION, Easing.InQuint);
|
||||
contentContainer.MoveToY(DrawHeight * 2f, DISAPPEAR_DURATION, Easing.In);
|
||||
|
||||
foreach (var w in wavesContainer.Children)
|
||||
w.State = Visibility.Hidden;
|
||||
|
||||
FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint);
|
||||
this.FadeOut(DISAPPEAR_DURATION, Easing.InQuint);
|
||||
}
|
||||
|
||||
protected override void UpdateAfterChildren()
|
||||
@ -210,10 +210,10 @@ namespace osu.Game.Overlays
|
||||
switch (value)
|
||||
{
|
||||
case Visibility.Hidden:
|
||||
MoveToY(Parent.Parent.DrawSize.Y, DISAPPEAR_DURATION, easing_hide);
|
||||
this.MoveToY(Parent.Parent.DrawSize.Y, DISAPPEAR_DURATION, easing_hide);
|
||||
break;
|
||||
case Visibility.Visible:
|
||||
MoveToY(FinalPosition, APPEAR_DURATION, easing_show);
|
||||
this.MoveToY(FinalPosition, APPEAR_DURATION, easing_show);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user