1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 17:32:54 +08:00

Resolve compile-time issues

This commit is contained in:
Dean Herbert 2019-05-13 00:36:05 +09:00
parent 943e1574a4
commit 34f54aa945
21 changed files with 82 additions and 56 deletions

View File

@ -1,5 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
// 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 NUnit.Framework;
using osu.Game.Online.API.Requests.Responses;

View File

@ -1,11 +1,11 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.UserInterface;
using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{

View File

@ -1,11 +1,11 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Overlays.Changelog.Header;
using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{

View File

@ -1,9 +1,9 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics;
using osu.Framework.Graphics.Colour;
using System.Collections.Generic;
using osuTK.Graphics;
namespace osu.Game.Graphics
{

View File

@ -1,5 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
// 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;
using osu.Framework.Graphics.Shapes;

View File

@ -1,7 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
@ -11,6 +10,8 @@ using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using System;
using osu.Framework.Graphics.Sprites;
using osuTK;
namespace osu.Game.Graphics.UserInterface
{
@ -43,10 +44,10 @@ namespace osu.Game.Graphics.UserInterface
}
}
public FontAwesome Icon
public IconUsage Icon
{
get { return icon.Icon; }
set { icon.Icon = value; }
get => icon.Icon;
set => icon.Icon = value;
}
public TooltipIconButton()

View File

@ -1,5 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Online.API.Requests.Responses;

View File

@ -1,5 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Online.API.Requests.Responses;

View File

@ -1,5 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Online.API.Requests.Responses;
using System.Collections.Generic;

View File

@ -1,5 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Online.API.Requests.Responses;

View File

@ -1,5 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
// 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 Newtonsoft.Json;
using System;

View File

@ -1,5 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
// 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 Newtonsoft.Json;
using System;

View File

@ -1,7 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
@ -9,6 +8,7 @@ using osu.Framework.Input.Events;
using osu.Game.Online.API.Requests.Responses;
using System;
using System.Collections.Generic;
using osuTK.Graphics;
namespace osu.Game.Overlays.Changelog
{
@ -58,6 +58,7 @@ namespace osu.Game.Overlays.Changelog
public void SelectNone()
{
selectedStreamId = -1;
if (badgesContainer != null)
{
foreach (StreamBadge streamBadge in badgesContainer)
@ -109,6 +110,7 @@ namespace osu.Game.Overlays.Changelog
else
streamBadge.Deactivate();
}
return base.OnHover(e);
}
@ -121,6 +123,7 @@ namespace osu.Game.Overlays.Changelog
else if (streamBadge.LatestBuild.UpdateStream.Id == selectedStreamId)
streamBadge.DisableDim();
}
base.OnHoverLost(e);
}
}

View File

@ -1,13 +1,13 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses;
using System;
using osuTK.Graphics;
namespace osu.Game.Overlays.Changelog
{
@ -25,7 +25,7 @@ namespace osu.Game.Overlays.Changelog
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FillDirection.Vertical;
Padding = new MarginPadding{ Bottom = 100 };
Padding = new MarginPadding { Bottom = 100 };
}
public void ShowListing(APIChangelogBuild[] changelog)
@ -47,6 +47,7 @@ namespace osu.Game.Overlays.Changelog
Margin = new MarginPadding { Top = 30 },
});
}
changelogContentGroup = new ChangelogContentGroup(build, true);
changelogContentGroup.BuildSelected += OnBuildSelected;
changelogContentGroup.GenerateText(build.ChangelogEntries);

View File

@ -1,8 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
@ -12,12 +10,15 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API.Requests.Responses;
using System;
using System.Collections.Generic;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Overlays.Changelog
{
public class ChangelogContentGroup : FillFlowContainer
{
private readonly TooltipIconButton chevronPrevious, chevronNext;
private readonly SortedDictionary<string, List<ChangelogEntry>> categories =
new SortedDictionary<string, List<ChangelogEntry>>();
@ -47,7 +48,7 @@ namespace osu.Game.Overlays.Changelog
chevronPrevious = new TooltipIconButton
{
IsEnabled = false,
Icon = FontAwesome.fa_chevron_left,
Icon = FontAwesome.Solid.ChevronLeft,
Size = new Vector2(24),
Action = () =>
{
@ -84,7 +85,7 @@ namespace osu.Game.Overlays.Changelog
chevronNext = new TooltipIconButton
{
IsEnabled = false,
Icon = FontAwesome.fa_chevron_right,
Icon = FontAwesome.Solid.ChevronRight,
Size = new Vector2(24),
Action = () =>
{
@ -181,7 +182,8 @@ namespace osu.Game.Overlays.Changelog
{
clickableBuildText.Action = null;
clickableBuildText.FadeTo(0.5f, 500);
Scheduler.AddDelayed(() => {
Scheduler.AddDelayed(() =>
{
clickableBuildText.Action = () => OnBuildSelected(build);
clickableBuildText.FadeIn(500);
}, 2000);
@ -195,6 +197,7 @@ namespace osu.Game.Overlays.Changelog
chevronPrevious.TooltipText = previousVersion;
chevronPrevious.IsEnabled = true;
}
if (!string.IsNullOrEmpty(nextVersion))
{
chevronNext.TooltipText = nextVersion;
@ -227,6 +230,7 @@ namespace osu.Game.Overlays.Changelog
Font = @"Exo2.0-Bold",
Margin = new MarginPadding { Top = 35, Bottom = 15 },
});
foreach (ChangelogEntry entry in category.Value)
{
LinkFlowContainer title = new LinkFlowContainer
@ -236,12 +240,13 @@ namespace osu.Game.Overlays.Changelog
AutoSizeAxes = Axes.Y,
Margin = new MarginPadding { Vertical = 5 },
};
title.AddIcon(FontAwesome.fa_check, t =>
title.AddIcon(FontAwesome.Solid.Check, t =>
{
t.TextSize = 12;
t.Padding = new MarginPadding { Left = -17, Right = 5 };
});
title.AddText(entry.Title, t => { t.TextSize = 18; });
if (!string.IsNullOrEmpty(entry.Repository))
{
title.AddText(" (", t => t.TextSize = 18);
@ -250,6 +255,7 @@ namespace osu.Game.Overlays.Changelog
null, t => { t.TextSize = 18; });
title.AddText(")", t => t.TextSize = 18);
}
title.AddText(" by ", t => t.TextSize = 14);
if (entry.GithubUser.GithubUrl != null)
title.AddLink(entry.GithubUser.DisplayName, entry.GithubUser.GithubUrl,

View File

@ -1,18 +1,17 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics;
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.Framework.Graphics.Textures;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays.Changelog.Header;
using System;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Overlays.Changelog
{
@ -141,7 +140,7 @@ namespace osu.Game.Overlays.Changelog
Origin = Anchor.Centre,
Size = new Vector2(7),
Colour = Purple,
Icon = FontAwesome.fa_chevron_right,
Icon = FontAwesome.Solid.ChevronRight,
Alpha = 0,
X = -200,
},

View File

@ -1,5 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
// 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.Allocation;
using osu.Framework.Audio;

View File

@ -1,10 +1,10 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
// 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 OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Input.Events;
using osuTK.Graphics;
namespace osu.Game.Overlays.Changelog.Header
{
@ -12,7 +12,8 @@ namespace osu.Game.Overlays.Changelog.Header
{
private readonly ColourInfo badgeColour;
public TextBadgePairListing(ColourInfo badgeColour) : base(badgeColour, "Listing", false)
public TextBadgePairListing(ColourInfo badgeColour)
: base(badgeColour, "Listing", false)
{
IsActivated = true;
this.badgeColour = badgeColour;
@ -27,13 +28,14 @@ namespace osu.Game.Overlays.Changelog.Header
// this doesn't work without the scheduler
// (because the text isn't yet fully drawn when it's loaded?)
Text.OnLoadComplete = d => Scheduler.Add(UpdateBadgeWidth);
Text.OnLoadComplete += d => Scheduler.Add(UpdateBadgeWidth);
}
public override void Activate()
{
if (IsActivated)
return;
IsActivated = true;
LineBadge.Uncollapse();
Text.Font = "Exo2.0-Bold";

View File

@ -1,5 +1,5 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
// 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.Colour;
@ -7,10 +7,10 @@ namespace osu.Game.Overlays.Changelog.Header
{
public class TextBadgePairRelease : TextBadgePair
{
private TextBadgePairListing listingBadge;
private const float transition_duration = 125;
public TextBadgePairRelease(ColourInfo badgeColour, string displayText) : base(badgeColour, displayText)
public TextBadgePairRelease(ColourInfo badgeColour, string displayText)
: base(badgeColour, displayText)
{
Text.Font = "Exo2.0-Bold";
Text.Y = 20;
@ -28,6 +28,7 @@ namespace osu.Game.Overlays.Changelog.Header
}
else
ShowText(transition_duration, displayText);
IsActivated = true;
}

View File

@ -1,7 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
@ -13,6 +12,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API.Requests.Responses;
using System;
using osuTK.Graphics;
namespace osu.Game.Overlays.Changelog
{
@ -66,9 +66,7 @@ namespace osu.Game.Overlays.Changelog
},
new SpriteText
{
Text = LatestBuild.Users > 0 ?
$"{LatestBuild.Users:N0} users online" :
null,
Text = LatestBuild.Users > 0 ? $"{LatestBuild.Users:N0} users online" : null,
TextSize = 12, // web: 10,
Font = @"Exo2.0-Regular",
Colour = new Color4(203, 164, 218, 255),
@ -100,6 +98,7 @@ namespace osu.Game.Overlays.Changelog
{
isActivated = false;
DisableDim();
if (!IsHovered)
{
this.FadeTo(0.5f, transition_duration);
@ -132,6 +131,7 @@ namespace osu.Game.Overlays.Changelog
}
else
EnableDim();
base.OnHoverLost(e);
}

View File

@ -1,12 +1,9 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
@ -18,13 +15,19 @@ using osu.Game.Online.API.Requests;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Overlays.Changelog;
using System;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics.Effects;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Overlays
{
public class ChangelogOverlay : WaveOverlayContainer
{
private readonly ChangelogHeader header;
private readonly ChangelogBadges badges;
//private readonly ChangelogChart chart;
private readonly ChangelogContent listing;
private readonly ChangelogContent content;
@ -35,7 +38,7 @@ namespace osu.Game.Overlays
private SampleChannel sampleBack;
private APIAccess api;
private IAPIProvider api;
private bool isAtListing;
private float savedScrollPosition;
@ -99,7 +102,7 @@ namespace osu.Game.Overlays
}
[BackgroundDependencyLoader]
private void load(APIAccess api, AudioManager audio)
private void load(IAPIProvider api, AudioManager audio)
{
this.api = api;
sampleBack = audio.Sample.Get(@"UI/generic-select-soft"); // @"UI/screen-back" feels non-fitting here
@ -146,6 +149,7 @@ namespace osu.Game.Overlays
ShowListing();
sampleBack?.Play();
}
return true;
}