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

Merge pull request #14030 from Game4all/update-framework-changes

Update `TableContainer` usages in line with framework changes
This commit is contained in:
Dean Herbert 2021-07-29 15:36:15 +09:00 committed by GitHub
commit c67c763a92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 13 deletions

View File

@ -52,7 +52,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.722.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2021.723.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2021.728.0" />
</ItemGroup>
<ItemGroup Label="Transitive Dependencies">
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->

View File

@ -18,6 +18,8 @@ using osu.Game.Scoring;
using osu.Game.Users.Drawables;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Localisation;
using osu.Framework.Extensions.LocalisationExtensions;
namespace osu.Game.Overlays.BeatmapSet.Scores
{
@ -211,11 +213,11 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
return content.ToArray();
}
protected override Drawable CreateHeader(int index, TableColumn column) => new HeaderText(column?.Header ?? string.Empty);
protected override Drawable CreateHeader(int index, TableColumn column) => new HeaderText(column?.Header ?? default);
private class HeaderText : OsuSpriteText
{
public HeaderText(string text)
public HeaderText(LocalisableString text)
{
Text = text.ToUpper();
Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold);

View File

@ -13,6 +13,7 @@ using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Game.Users;
using osu.Game.Users.Drawables;
using osuTK;
using osu.Framework.Localisation;
namespace osu.Game.Overlays.Rankings.Tables
{
@ -74,7 +75,7 @@ namespace osu.Game.Overlays.Rankings.Tables
protected override Drawable CreateHeader(int index, TableColumn column)
{
var title = column?.Header ?? string.Empty;
var title = column?.Header ?? default;
return new HeaderText(title, title == HighlightedColumn);
}
@ -109,7 +110,7 @@ namespace osu.Game.Overlays.Rankings.Tables
{
private readonly bool isHighlighted;
public HeaderText(string text, bool isHighlighted)
public HeaderText(LocalisableString text, bool isHighlighted)
{
this.isHighlighted = isHighlighted;

View File

@ -9,6 +9,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Users;
using osu.Game.Scoring;
using osu.Framework.Localisation;
namespace osu.Game.Overlays.Rankings.Tables
{
@ -31,8 +32,8 @@ namespace osu.Game.Overlays.Rankings.Tables
protected override Drawable CreateHeader(int index, TableColumn column)
{
var title = column?.Header ?? string.Empty;
return new UserTableHeaderText(title, HighlightedColumn == title, GradeColumns.Contains(title));
var title = column?.Header ?? default;
return new UserTableHeaderText(title, HighlightedColumn == title, GradeColumns.Contains(title.ToString()));
}
protected sealed override Country GetCountry(UserStatistics item) => item.User.Country;
@ -66,7 +67,7 @@ namespace osu.Game.Overlays.Rankings.Tables
private class UserTableHeaderText : HeaderText
{
public UserTableHeaderText(string text, bool isHighlighted, bool isGrade)
public UserTableHeaderText(LocalisableString text, bool isHighlighted, bool isGrade)
: base(text, isHighlighted)
{
Margin = new MarginPadding

View File

@ -2,10 +2,12 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
@ -42,11 +44,11 @@ namespace osu.Game.Screens.Edit
});
}
protected override Drawable CreateHeader(int index, TableColumn column) => new HeaderText(column?.Header ?? string.Empty);
protected override Drawable CreateHeader(int index, TableColumn column) => new HeaderText(column?.Header ?? default);
private class HeaderText : OsuSpriteText
{
public HeaderText(string text)
public HeaderText(LocalisableString text)
{
Text = text.ToUpper();
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold);

View File

@ -36,7 +36,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Realm" Version="10.3.0" />
<PackageReference Include="ppy.osu.Framework" Version="2021.723.0" />
<PackageReference Include="ppy.osu.Framework" Version="2021.728.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.722.0" />
<PackageReference Include="Sentry" Version="3.8.2" />
<PackageReference Include="SharpCompress" Version="0.28.3" />

View File

@ -70,7 +70,7 @@
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup Label="Package References">
<PackageReference Include="ppy.osu.Framework.iOS" Version="2021.723.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2021.728.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.722.0" />
</ItemGroup>
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) -->
@ -93,7 +93,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="ppy.osu.Framework" Version="2021.723.0" />
<PackageReference Include="ppy.osu.Framework" Version="2021.728.0" />
<PackageReference Include="SharpCompress" Version="0.28.3" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="SharpRaven" Version="2.4.0" />