Merge remote-tracking branch 'Joehuu/master' into drawnode-composability

# Conflicts:
#	osu.Game.Rulesets.Osu/UI/Cursor/OsuCursorContainer.cs
This commit is contained in:
smoogipoo
2019-04-08 23:01:12 +09:00
143 changed files with 1654 additions and 1127 deletions

View File

@ -39,7 +39,7 @@ namespace osu.Game.Screens.Edit.Components
Origin = Anchor.Centre,
Scale = new Vector2(1.4f),
IconScale = new Vector2(1.4f),
Icon = FontAwesome.PlayCircleOutline,
Icon = FontAwesome.Regular.PlayCircle,
Action = togglePause,
Padding = new MarginPadding { Left = 20 }
},
@ -89,7 +89,7 @@ namespace osu.Game.Screens.Edit.Components
{
base.Update();
playButton.Icon = adjustableClock.IsRunning ? FontAwesome.PauseCircleOutline : FontAwesome.PlayCircleOutline;
playButton.Icon = adjustableClock.IsRunning ? FontAwesome.Regular.PauseCircle : FontAwesome.Regular.PlayCircle;
}
private class PlaybackTabControl : OsuTabControl<double>

View File

@ -94,13 +94,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
{
new DivisorButton
{
Icon = FontAwesome.ChevronLeft,
Icon = FontAwesome.Solid.ChevronLeft,
Action = beatDivisor.Previous
},
new DivisorText(beatDivisor),
new DivisorButton
{
Icon = FontAwesome.ChevronRight,
Icon = FontAwesome.Solid.ChevronRight,
Action = beatDivisor.Next
}
},

View File

@ -91,7 +91,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
RelativeSizeAxes = Axes.Y,
Height = 0.5f,
Icon = FontAwesome.SearchPlus,
Icon = FontAwesome.Solid.SearchPlus,
Action = () => changeZoom(1)
},
new TimelineButton
@ -100,7 +100,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
Origin = Anchor.BottomLeft,
RelativeSizeAxes = Axes.Y,
Height = 0.5f,
Icon = FontAwesome.SearchMinus,
Icon = FontAwesome.Solid.SearchMinus,
Action = () => changeZoom(-1)
},
}

View File

@ -64,6 +64,8 @@ namespace osu.Game.Screens.Menu
{
box = new Container
{
// box needs to be always present to ensure the button is always sized correctly for flow
AlwaysPresent = true,
Masking = true,
MaskingSmoothness = 2,
EdgeEffect = new EdgeEffectParameters

View File

@ -80,7 +80,7 @@ namespace osu.Game.Screens.Menu
buttonArea.AddRange(new[]
{
new Button(@"settings", string.Empty, FontAwesome.Gear, new Color4(85, 85, 85, 255), () => OnSettings?.Invoke(), -WEDGE_WIDTH, Key.O),
new Button(@"settings", string.Empty, FontAwesome.Solid.Cog, new Color4(85, 85, 85, 255), () => OnSettings?.Invoke(), -WEDGE_WIDTH, Key.O),
backButton = new Button(@"back", @"button-back-select", OsuIcon.LeftCircle, new Color4(51, 58, 94, 255), () => State = ButtonSystemState.TopLevel, -WEDGE_WIDTH)
{
VisibleState = ButtonSystemState.Play,
@ -103,11 +103,14 @@ namespace osu.Game.Screens.Menu
[Resolved(CanBeNull = true)]
private NotificationOverlay notifications { get; set; }
[Resolved(CanBeNull = true)]
private LoginOverlay loginOverlay { get; set; }
[BackgroundDependencyLoader(true)]
private void load(AudioManager audio, IdleTracker idleTracker, GameHost host)
{
buttonsPlay.Add(new Button(@"solo", @"button-solo-select", FontAwesome.User, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), WEDGE_WIDTH, Key.P));
buttonsPlay.Add(new Button(@"multi", @"button-generic-select", FontAwesome.Users, new Color4(94, 63, 186, 255), onMulti, 0, Key.M));
buttonsPlay.Add(new Button(@"solo", @"button-solo-select", FontAwesome.Solid.User, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), WEDGE_WIDTH, Key.P));
buttonsPlay.Add(new Button(@"multi", @"button-generic-select", FontAwesome.Solid.Users, new Color4(94, 63, 186, 255), onMulti, 0, Key.M));
buttonsPlay.Add(new Button(@"chart", @"button-generic-select", OsuIcon.Charts, new Color4(80, 53, 160, 255), () => OnChart?.Invoke()));
buttonsPlay.ForEach(b => b.VisibleState = ButtonSystemState.Play);
@ -135,7 +138,12 @@ namespace osu.Game.Screens.Menu
notifications?.Post(new SimpleNotification
{
Text = "You gotta be logged in to multi 'yo!",
Icon = FontAwesome.Globe
Icon = FontAwesome.Solid.Globe,
Activated = () =>
{
loginOverlay?.Show();
return true;
}
});
return;

View File

@ -54,7 +54,7 @@ namespace osu.Game.Screens.Menu
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Icon = FontAwesome.Warning,
Icon = FontAwesome.Solid.ExclamationTriangle,
Size = new Vector2(icon_size),
Y = icon_y,
},
@ -128,7 +128,7 @@ namespace osu.Game.Screens.Menu
supportFlow.AddText(" to help support the game", format);
}
heart = supportFlow.AddIcon(FontAwesome.Heart, t =>
heart = supportFlow.AddIcon(FontAwesome.Solid.Heart, t =>
{
t.Padding = new MarginPadding { Left = 5 };
t.Font = t.Font.With(size: 12);

View File

@ -6,7 +6,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Online.Chat;
using osuTK;
namespace osu.Game.Screens.Multi.Components
@ -60,7 +59,7 @@ namespace osu.Game.Screens.Multi.Components
if (beatmap != null)
{
beatmapAuthor.AddText("mapped by ", s => s.Colour = OsuColour.Gray(0.8f));
beatmapAuthor.AddLink(beatmap.Metadata.Author.Username, null, LinkAction.OpenUserProfile, beatmap.Metadata.Author.Id.ToString(), "View Profile");
beatmapAuthor.AddUserLink(beatmap.Metadata.Author);
}
}, true);
}

View File

@ -8,7 +8,6 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.Chat;
using osu.Game.Users;
using osuTK;
@ -95,8 +94,8 @@ namespace osu.Game.Screens.Multi.Lounge.Components
if (host.NewValue != null)
{
hostText.AddText("hosted by ");
hostText.AddLink(host.NewValue.Username, null, LinkAction.OpenUserProfile, host.NewValue.Id.ToString(), "Open profile",
s => s.Font = s.Font.With(Typeface.Exo, weight: FontWeight.Bold, italics: true));
hostText.AddUserLink(host.NewValue, s => s.Font = s.Font.With(Typeface.Exo, weight: FontWeight.Bold, italics: true));
flagContainer.Child = new DrawableFlag(host.NewValue.Country) { RelativeSizeAxes = Axes.Both };
}
}, true);

View File

@ -6,7 +6,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Online.Chat;
using osu.Game.Users;
using osuTK;
@ -54,8 +53,7 @@ namespace osu.Game.Screens.Multi.Match.Components
{
linkContainer.AddText("hosted by");
linkContainer.NewLine();
linkContainer.AddLink(host.Username, null, LinkAction.OpenUserProfile, host.Id.ToString(), "View Profile",
s => s.Font = s.Font.With(Typeface.Exo, weight: FontWeight.Bold, italics: true));
linkContainer.AddUserLink(host, s => s.Font = s.Font.With(Typeface.Exo, weight: FontWeight.Bold, italics: true));
}
}
}

View File

@ -25,9 +25,9 @@ namespace osu.Game.Screens.Multi.Match.Components
protected override IEnumerable<LeaderboardScoreStatistic> GetStatistics(ScoreInfo model) => new[]
{
new LeaderboardScoreStatistic(FontAwesome.Crosshairs, "Accuracy", string.Format(model.Accuracy % 1 == 0 ? @"{0:P0}" : @"{0:P2}", model.Accuracy)),
new LeaderboardScoreStatistic(FontAwesome.Refresh, "Total Attempts", ((APIRoomScoreInfo)model).TotalAttempts.ToString()),
new LeaderboardScoreStatistic(FontAwesome.Check, "Completed Beatmaps", ((APIRoomScoreInfo)model).CompletedBeatmaps.ToString()),
new LeaderboardScoreStatistic(FontAwesome.Solid.Crosshairs, "Accuracy", string.Format(model.Accuracy % 1 == 0 ? @"{0:P0}" : @"{0:P2}", model.Accuracy)),
new LeaderboardScoreStatistic(FontAwesome.Solid.Sync, "Total Attempts", ((APIRoomScoreInfo)model).TotalAttempts.ToString()),
new LeaderboardScoreStatistic(FontAwesome.Solid.Check, "Completed Beatmaps", ((APIRoomScoreInfo)model).CompletedBeatmaps.ToString()),
};
}
}

View File

@ -20,7 +20,7 @@ namespace osu.Game.Screens.Multi.Ranking.Types
this.beatmap = beatmap;
}
public IconUsage Icon => FontAwesome.Users;
public IconUsage Icon => FontAwesome.Solid.Users;
public string Name => "Room Leaderboard";

View File

@ -42,7 +42,7 @@ namespace osu.Game.Screens.Play.Break
Anchor = Anchor.Centre,
Origin = Anchor.CentreRight,
X = -glow_icon_offscreen_offset,
Icon = FontAwesome.ChevronRight,
Icon = FontAwesome.Solid.ChevronRight,
BlurSigma = new Vector2(glow_icon_blur_sigma),
Size = new Vector2(glow_icon_size),
},
@ -51,7 +51,7 @@ namespace osu.Game.Screens.Play.Break
Anchor = Anchor.Centre,
Origin = Anchor.CentreLeft,
X = glow_icon_offscreen_offset,
Icon = FontAwesome.ChevronLeft,
Icon = FontAwesome.Solid.ChevronLeft,
BlurSigma = new Vector2(glow_icon_blur_sigma),
Size = new Vector2(glow_icon_size),
},
@ -68,7 +68,7 @@ namespace osu.Game.Screens.Play.Break
Origin = Anchor.CentreRight,
Alpha = 0.7f,
X = -blurred_icon_offscreen_offset,
Icon = FontAwesome.ChevronRight,
Icon = FontAwesome.Solid.ChevronRight,
BlurSigma = new Vector2(blurred_icon_blur_sigma),
Size = new Vector2(blurred_icon_size),
},
@ -78,7 +78,7 @@ namespace osu.Game.Screens.Play.Break
Origin = Anchor.CentreLeft,
Alpha = 0.7f,
X = blurred_icon_offscreen_offset,
Icon = FontAwesome.ChevronLeft,
Icon = FontAwesome.Solid.ChevronLeft,
BlurSigma = new Vector2(blurred_icon_blur_sigma),
Size = new Vector2(blurred_icon_size),
},

View File

@ -129,7 +129,7 @@ namespace osu.Game.Screens.Play.HUD
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(15),
Icon = FontAwesome.Close
Icon = FontAwesome.Solid.TimesCircle
},
}
};

View File

@ -43,6 +43,8 @@ namespace osu.Game.Screens.Play
public bool HasFailed { get; private set; }
public bool PauseOnFocusLost { get; set; } = true;
private Bindable<bool> mouseWheelDisabled;
private readonly Bindable<bool> storyboardReplacesBackground = new Bindable<bool>();
@ -382,7 +384,7 @@ namespace osu.Game.Screens.Play
base.Update();
// eagerly pause when we lose window focus (if we are locally playing).
if (!Game.IsActive.Value)
if (PauseOnFocusLost && !Game.IsActive.Value)
Pause();
}

View File

@ -104,7 +104,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
Origin = Anchor.Centre,
Anchor = Anchor.CentreRight,
Position = new Vector2(-15, 0),
Icon = FontAwesome.Bars,
Icon = FontAwesome.Solid.Bars,
Scale = new Vector2(0.75f),
Action = () => Expanded = !Expanded,
},

View File

@ -0,0 +1,74 @@
// 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 System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Screens.Play
{
/// <summary>
/// An overlay which can be used to require further user actions before gameplay is resumed.
/// </summary>
public abstract class ResumeOverlay : OverlayContainer
{
public CursorContainer GameplayCursor { get; set; }
/// <summary>
/// The action to be performed to complete resuming.
/// </summary>
public Action ResumeAction { private get; set; }
public virtual CursorContainer LocalCursor => null;
protected const float TRANSITION_TIME = 500;
protected override bool BlockPositionalInput => false;
protected abstract string Message { get; }
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
protected ResumeOverlay()
{
RelativeSizeAxes = Axes.Both;
}
protected void Resume()
{
ResumeAction?.Invoke();
Hide();
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
AddRange(new Drawable[]
{
new OsuSpriteText
{
RelativePositionAxes = Axes.Both,
Y = 0.4f,
Text = Message,
Font = OsuFont.GetFont(size: 30),
Spacing = new Vector2(5, 0),
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Colour = colours.Yellow,
Shadow = true,
ShadowColour = new Color4(0, 0, 0, 0.25f)
}
});
}
protected override void PopIn() => this.FadeIn(TRANSITION_TIME, Easing.OutQuint);
protected override void PopOut() => this.FadeOut(TRANSITION_TIME, Easing.OutQuint);
}
}

View File

@ -259,9 +259,9 @@ namespace osu.Game.Screens.Play
Direction = FillDirection.Horizontal,
Children = new[]
{
new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.ChevronRight },
new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.ChevronRight },
new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.ChevronRight },
new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.Solid.ChevronRight },
new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.Solid.ChevronRight },
new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.Solid.ChevronRight },
}
},
new OsuSpriteText

View File

@ -19,7 +19,7 @@ namespace osu.Game.Screens.Ranking.Types
this.beatmap = beatmap;
}
public IconUsage Icon => FontAwesome.User;
public IconUsage Icon => FontAwesome.Solid.User;
public string Name => @"Local Leaderboard";

View File

@ -10,7 +10,7 @@ namespace osu.Game.Screens.Ranking.Types
{
public class ScoreOverviewPageInfo : IResultPageInfo
{
public IconUsage Icon => FontAwesome.Asterisk;
public IconUsage Icon => FontAwesome.Solid.Asterisk;
public string Name => "Overview";
private readonly ScoreInfo score;

View File

@ -113,7 +113,7 @@ namespace osu.Game.Screens
{
new SpriteIcon
{
Icon = FontAwesome.UniversalAccess,
Icon = FontAwesome.Solid.UniversalAccess,
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Size = new Vector2(50),

View File

@ -19,7 +19,7 @@ namespace osu.Game.Screens.Select
public BeatmapClearScoresDialog(BeatmapInfo beatmap, Action onCompletion)
{
BodyText = $@"{beatmap.Metadata?.Artist} - {beatmap.Metadata?.Title}";
Icon = FontAwesome.Eraser;
Icon = FontAwesome.Solid.Eraser;
HeaderText = @"Clearing all local scores. Are you sure?";
Buttons = new PopupDialogButton[]
{

View File

@ -22,7 +22,7 @@ namespace osu.Game.Screens.Select
{
BodyText = $@"{beatmap.Metadata?.Artist} - {beatmap.Metadata?.Title}";
Icon = FontAwesome.TrashOutline;
Icon = FontAwesome.Regular.TrashAlt;
HeaderText = @"Confirm deletion of";
Buttons = new PopupDialogButton[]
{

View File

@ -294,14 +294,14 @@ namespace osu.Game.Screens.Select
labels.Add(new InfoLabel(new BeatmapStatistic
{
Name = "Length",
Icon = FontAwesome.ClockOutline,
Icon = FontAwesome.Regular.Clock,
Content = TimeSpan.FromMilliseconds(endTime - b.HitObjects.First().StartTime).ToString(@"m\:ss"),
}));
labels.Add(new InfoLabel(new BeatmapStatistic
{
Name = "BPM",
Icon = FontAwesome.Circle,
Icon = FontAwesome.Regular.Circle,
Content = getBPMRange(b),
}));
@ -379,7 +379,7 @@ namespace osu.Game.Screens.Select
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Colour = OsuColour.FromHex(@"441288"),
Icon = FontAwesome.Square,
Icon = FontAwesome.Solid.Square,
Rotation = 45,
},
new SpriteIcon

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
@ -168,15 +169,22 @@ namespace osu.Game.Screens.Select.Carousel
base.ApplyState();
}
public MenuItem[] ContextMenuItems => new MenuItem[]
public MenuItem[] ContextMenuItems
{
new OsuMenuItem("Play", MenuItemType.Highlighted, () => startRequested?.Invoke(beatmap)),
new OsuMenuItem("Edit", MenuItemType.Standard, () => editRequested?.Invoke(beatmap)),
new OsuMenuItem("Hide", MenuItemType.Destructive, () => hideRequested?.Invoke(beatmap)),
new OsuMenuItem("Details", MenuItemType.Standard, () =>
get
{
if (beatmap.OnlineBeatmapID.HasValue) beatmapOverlay?.FetchAndShowBeatmap(beatmap.OnlineBeatmapID.Value);
}),
};
List<MenuItem> items = new List<MenuItem>
{
new OsuMenuItem("Play", MenuItemType.Highlighted, () => startRequested?.Invoke(beatmap)),
new OsuMenuItem("Edit", MenuItemType.Standard, () => editRequested?.Invoke(beatmap)),
new OsuMenuItem("Hide", MenuItemType.Destructive, () => hideRequested?.Invoke(beatmap)),
};
if (beatmap.OnlineBeatmapID.HasValue)
items.Add(new OsuMenuItem("Details", MenuItemType.Standard, () => beatmapOverlay?.FetchAndShowBeatmap(beatmap.OnlineBeatmapID.Value)));
return items.ToArray();
}
}
}
}

View File

@ -14,7 +14,7 @@ namespace osu.Game.Screens.Select
HeaderText = @"You have no beatmaps!";
BodyText = "An existing copy of osu! was found, though.\nWould you like to import your beatmaps (and skins)?";
Icon = FontAwesome.Plane;
Icon = FontAwesome.Solid.Plane;
Buttons = new PopupDialogButton[]
{

View File

@ -55,7 +55,7 @@ namespace osu.Game.Screens.Select.Leaderboards
{
if (Scope == BeatmapLeaderboardScope.Local)
{
Scores = scoreManager.QueryScores(s => !s.DeletePending && s.Beatmap.ID == Beatmap.ID).ToArray();
Scores = scoreManager.QueryScores(s => !s.DeletePending && s.Beatmap.ID == Beatmap.ID).OrderByDescending(s => s.TotalScore).ToArray();
PlaceholderState = Scores.Any() ? PlaceholderState.Successful : PlaceholderState.NoScores;
return null;
}

View File

@ -142,7 +142,7 @@ namespace osu.Game.Screens.Select.Options
Anchor = Anchor.TopCentre,
Size = new Vector2(30),
Shadow = true,
Icon = FontAwesome.Close,
Icon = FontAwesome.Solid.TimesCircle,
Margin = new MarginPadding
{
Bottom = 5,

View File

@ -21,7 +21,7 @@ namespace osu.Game.Screens.Select
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
BeatmapOptions.AddButton(@"Edit", @"beatmap", FontAwesome.Pencil, colours.Yellow, () =>
BeatmapOptions.AddButton(@"Edit", @"beatmap", FontAwesome.Solid.PencilAlt, colours.Yellow, () =>
{
ValidForResume = false;
Edit();

View File

@ -228,9 +228,9 @@ namespace osu.Game.Screens.Select
Footer.AddButton(@"random", colours.Green, triggerRandom, Key.F2);
Footer.AddButton(@"options", colours.Blue, BeatmapOptions, Key.F3);
BeatmapOptions.AddButton(@"Delete", @"all difficulties", FontAwesome.Trash, colours.Pink, () => delete(Beatmap.Value.BeatmapSetInfo), Key.Number4, float.MaxValue);
BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.TimesCircleOutline, colours.Purple, null, Key.Number1);
BeatmapOptions.AddButton(@"Clear", @"local scores", FontAwesome.Eraser, colours.Purple, () => clearScores(Beatmap.Value.BeatmapInfo), Key.Number2);
BeatmapOptions.AddButton(@"Delete", @"all difficulties", FontAwesome.Solid.Trash, colours.Pink, () => delete(Beatmap.Value.BeatmapSetInfo), Key.Number4, float.MaxValue);
BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.Regular.TimesCircle, colours.Purple, null, Key.Number1);
BeatmapOptions.AddButton(@"Clear", @"local scores", FontAwesome.Solid.Eraser, colours.Purple, () => clearScores(Beatmap.Value.BeatmapInfo), Key.Number2);
}
if (this.beatmaps == null)