mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into user-cards-update
This commit is contained in:
2
.github/ISSUE_TEMPLATE/02-crash-issues.md
vendored
2
.github/ISSUE_TEMPLATE/02-crash-issues.md
vendored
@ -9,8 +9,10 @@ about: Issues regarding crashes or permanent freezes.
|
|||||||
**osu!lazer version:**
|
**osu!lazer version:**
|
||||||
|
|
||||||
**Logs:**
|
**Logs:**
|
||||||
|
<!--
|
||||||
*please attach logs here, which are located at:*
|
*please attach logs here, which are located at:*
|
||||||
- `%AppData%/osu/logs` *(on Windows),*
|
- `%AppData%/osu/logs` *(on Windows),*
|
||||||
- `~/.local/share/osu/logs` *(on Linux & macOS).*
|
- `~/.local/share/osu/logs` *(on Linux & macOS).*
|
||||||
|
-->
|
||||||
|
|
||||||
**Computer Specifications:**
|
**Computer Specifications:**
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
<Reference Include="Java.Interop" />
|
<Reference Include="Java.Interop" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.221.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.304.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.302.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.302.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
// 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.Game.Tournament.Models;
|
||||||
|
using osu.Game.Tournament.Screens.Editors;
|
||||||
|
|
||||||
|
namespace osu.Game.Tournament.Tests.Screens
|
||||||
|
{
|
||||||
|
public class TestSceneSeedingEditorScreen : LadderTestScene
|
||||||
|
{
|
||||||
|
[Cached]
|
||||||
|
private readonly LadderInfo ladder = new LadderInfo();
|
||||||
|
|
||||||
|
public TestSceneSeedingEditorScreen()
|
||||||
|
{
|
||||||
|
var match = TestSceneSeedingScreen.CreateSampleSeededMatch();
|
||||||
|
|
||||||
|
Add(new SeedingEditorScreen(match.Team1.Value)
|
||||||
|
{
|
||||||
|
Width = 0.85f // create room for control panel
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
127
osu.Game.Tournament.Tests/Screens/TestSceneSeedingScreen.cs
Normal file
127
osu.Game.Tournament.Tests/Screens/TestSceneSeedingScreen.cs
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
// 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.Graphics;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Tournament.Models;
|
||||||
|
using osu.Game.Tournament.Screens.TeamIntro;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
|
namespace osu.Game.Tournament.Tests.Screens
|
||||||
|
{
|
||||||
|
public class TestSceneSeedingScreen : LadderTestScene
|
||||||
|
{
|
||||||
|
[Cached]
|
||||||
|
private readonly LadderInfo ladder = new LadderInfo();
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
ladder.CurrentMatch.Value = CreateSampleSeededMatch();
|
||||||
|
|
||||||
|
Add(new SeedingScreen
|
||||||
|
{
|
||||||
|
FillMode = FillMode.Fit,
|
||||||
|
FillAspectRatio = 16 / 9f
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TournamentMatch CreateSampleSeededMatch() => new TournamentMatch
|
||||||
|
{
|
||||||
|
Team1 =
|
||||||
|
{
|
||||||
|
Value = new TournamentTeam
|
||||||
|
{
|
||||||
|
FlagName = { Value = "JP" },
|
||||||
|
FullName = { Value = "Japan" },
|
||||||
|
LastYearPlacing = { Value = 10 },
|
||||||
|
Seed = { Value = "Low" },
|
||||||
|
SeedingResults =
|
||||||
|
{
|
||||||
|
new SeedingResult
|
||||||
|
{
|
||||||
|
Mod = { Value = "NM" },
|
||||||
|
Seed = { Value = 10 },
|
||||||
|
Beatmaps =
|
||||||
|
{
|
||||||
|
new SeedingBeatmap
|
||||||
|
{
|
||||||
|
BeatmapInfo = new BeatmapInfo { Metadata = new BeatmapMetadata { Title = "Test Title", Artist = "Test Artist" } },
|
||||||
|
Score = 12345672,
|
||||||
|
Seed = { Value = 24 },
|
||||||
|
},
|
||||||
|
new SeedingBeatmap
|
||||||
|
{
|
||||||
|
BeatmapInfo = new BeatmapInfo { Metadata = new BeatmapMetadata { Title = "Test Title", Artist = "Test Artist" } },
|
||||||
|
Score = 1234567,
|
||||||
|
Seed = { Value = 12 },
|
||||||
|
},
|
||||||
|
new SeedingBeatmap
|
||||||
|
{
|
||||||
|
BeatmapInfo = new BeatmapInfo { Metadata = new BeatmapMetadata { Title = "Test Title", Artist = "Test Artist" } },
|
||||||
|
Score = 1234567,
|
||||||
|
Seed = { Value = 16 },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new SeedingResult
|
||||||
|
{
|
||||||
|
Mod = { Value = "DT" },
|
||||||
|
Seed = { Value = 5 },
|
||||||
|
Beatmaps =
|
||||||
|
{
|
||||||
|
new SeedingBeatmap
|
||||||
|
{
|
||||||
|
BeatmapInfo = new BeatmapInfo { Metadata = new BeatmapMetadata { Title = "Test Title", Artist = "Test Artist" } },
|
||||||
|
Score = 234567,
|
||||||
|
Seed = { Value = 3 },
|
||||||
|
},
|
||||||
|
new SeedingBeatmap
|
||||||
|
{
|
||||||
|
BeatmapInfo = new BeatmapInfo { Metadata = new BeatmapMetadata { Title = "Test Title", Artist = "Test Artist" } },
|
||||||
|
Score = 234567,
|
||||||
|
Seed = { Value = 6 },
|
||||||
|
},
|
||||||
|
new SeedingBeatmap
|
||||||
|
{
|
||||||
|
BeatmapInfo = new BeatmapInfo { Metadata = new BeatmapMetadata { Title = "Test Title", Artist = "Test Artist" } },
|
||||||
|
Score = 234567,
|
||||||
|
Seed = { Value = 12 },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Players =
|
||||||
|
{
|
||||||
|
new User { Username = "Hello", Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 12 } } },
|
||||||
|
new User { Username = "Hello", Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 16 } } },
|
||||||
|
new User { Username = "Hello", Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 20 } } },
|
||||||
|
new User { Username = "Hello", Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 24 } } },
|
||||||
|
new User { Username = "Hello", Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 30 } } },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Team2 =
|
||||||
|
{
|
||||||
|
Value = new TournamentTeam
|
||||||
|
{
|
||||||
|
FlagName = { Value = "US" },
|
||||||
|
FullName = { Value = "United States" },
|
||||||
|
Players =
|
||||||
|
{
|
||||||
|
new User { Username = "Hello" },
|
||||||
|
new User { Username = "Hello" },
|
||||||
|
new User { Username = "Hello" },
|
||||||
|
new User { Username = "Hello" },
|
||||||
|
new User { Username = "Hello" },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Round =
|
||||||
|
{
|
||||||
|
Value = new TournamentRound { Name = { Value = "Quarterfinals" } }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
23
osu.Game.Tournament/Models/SeedingBeatmap.cs
Normal file
23
osu.Game.Tournament/Models/SeedingBeatmap.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// 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.Bindables;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
|
||||||
|
namespace osu.Game.Tournament.Models
|
||||||
|
{
|
||||||
|
public class SeedingBeatmap
|
||||||
|
{
|
||||||
|
public int ID;
|
||||||
|
|
||||||
|
public BeatmapInfo BeatmapInfo;
|
||||||
|
|
||||||
|
public long Score;
|
||||||
|
|
||||||
|
public Bindable<int> Seed = new BindableInt
|
||||||
|
{
|
||||||
|
MinValue = 1,
|
||||||
|
MaxValue = 64
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
21
osu.Game.Tournament/Models/SeedingResult.cs
Normal file
21
osu.Game.Tournament/Models/SeedingResult.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
// 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.Collections.Generic;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
|
||||||
|
namespace osu.Game.Tournament.Models
|
||||||
|
{
|
||||||
|
public class SeedingResult
|
||||||
|
{
|
||||||
|
public List<SeedingBeatmap> Beatmaps = new List<SeedingBeatmap>();
|
||||||
|
|
||||||
|
public Bindable<string> Mod = new Bindable<string>();
|
||||||
|
|
||||||
|
public Bindable<int> Seed = new BindableInt
|
||||||
|
{
|
||||||
|
MinValue = 1,
|
||||||
|
MaxValue = 64
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
@ -29,6 +30,32 @@ namespace osu.Game.Tournament.Models
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Bindable<string> Acronym = new Bindable<string>(string.Empty);
|
public Bindable<string> Acronym = new Bindable<string>(string.Empty);
|
||||||
|
|
||||||
|
public BindableList<SeedingResult> SeedingResults = new BindableList<SeedingResult>();
|
||||||
|
|
||||||
|
public double AverageRank
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var ranks = Players.Select(p => p.Statistics?.Ranks.Global)
|
||||||
|
.Where(i => i.HasValue)
|
||||||
|
.Select(i => i.Value)
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
if (ranks.Length == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return ranks.Average();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Bindable<string> Seed = new Bindable<string>(string.Empty);
|
||||||
|
|
||||||
|
public Bindable<int> LastYearPlacing = new BindableInt
|
||||||
|
{
|
||||||
|
MinValue = 1,
|
||||||
|
MaxValue = 64
|
||||||
|
};
|
||||||
|
|
||||||
[JsonProperty]
|
[JsonProperty]
|
||||||
public BindableList<User> Players { get; set; } = new BindableList<User>();
|
public BindableList<User> Players { get; set; } = new BindableList<User>();
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 67 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 67 KiB |
288
osu.Game.Tournament/Screens/Editors/SeedingEditorScreen.cs
Normal file
288
osu.Game.Tournament/Screens/Editors/SeedingEditorScreen.cs
Normal file
@ -0,0 +1,288 @@
|
|||||||
|
// 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.Linq;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Online.API;
|
||||||
|
using osu.Game.Online.API.Requests;
|
||||||
|
using osu.Game.Overlays.Settings;
|
||||||
|
using osu.Game.Rulesets;
|
||||||
|
using osu.Game.Tournament.Components;
|
||||||
|
using osu.Game.Tournament.Models;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Tournament.Screens.Editors
|
||||||
|
{
|
||||||
|
public class SeedingEditorScreen : TournamentEditorScreen<SeedingEditorScreen.SeeingResultRow, SeedingResult>
|
||||||
|
{
|
||||||
|
private readonly TournamentTeam team;
|
||||||
|
|
||||||
|
protected override BindableList<SeedingResult> Storage => team.SeedingResults;
|
||||||
|
|
||||||
|
public SeedingEditorScreen(TournamentTeam team)
|
||||||
|
{
|
||||||
|
this.team = team;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SeeingResultRow : CompositeDrawable, IModelBacked<SeedingResult>
|
||||||
|
{
|
||||||
|
public SeedingResult Model { get; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private LadderInfo ladderInfo { get; set; }
|
||||||
|
|
||||||
|
public SeeingResultRow(TournamentTeam team, SeedingResult round)
|
||||||
|
{
|
||||||
|
Model = round;
|
||||||
|
|
||||||
|
Masking = true;
|
||||||
|
CornerRadius = 10;
|
||||||
|
|
||||||
|
SeedingBeatmapEditor beatmapEditor = new SeedingBeatmapEditor(round)
|
||||||
|
{
|
||||||
|
Width = 0.95f
|
||||||
|
};
|
||||||
|
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
Colour = OsuColour.Gray(0.1f),
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
Margin = new MarginPadding(5),
|
||||||
|
Padding = new MarginPadding { Right = 160 },
|
||||||
|
Spacing = new Vector2(5),
|
||||||
|
Direction = FillDirection.Full,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new SettingsTextBox
|
||||||
|
{
|
||||||
|
LabelText = "Mod",
|
||||||
|
Width = 0.33f,
|
||||||
|
Bindable = Model.Mod
|
||||||
|
},
|
||||||
|
new SettingsSlider<int>
|
||||||
|
{
|
||||||
|
LabelText = "Seed",
|
||||||
|
Width = 0.33f,
|
||||||
|
Bindable = Model.Seed
|
||||||
|
},
|
||||||
|
new SettingsButton
|
||||||
|
{
|
||||||
|
Width = 0.2f,
|
||||||
|
Margin = new MarginPadding(10),
|
||||||
|
Text = "Add beatmap",
|
||||||
|
Action = () => beatmapEditor.CreateNew()
|
||||||
|
},
|
||||||
|
beatmapEditor
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new DangerousSettingsButton
|
||||||
|
{
|
||||||
|
Anchor = Anchor.CentreRight,
|
||||||
|
Origin = Anchor.CentreRight,
|
||||||
|
RelativeSizeAxes = Axes.None,
|
||||||
|
Width = 150,
|
||||||
|
Text = "Delete result",
|
||||||
|
Action = () =>
|
||||||
|
{
|
||||||
|
Expire();
|
||||||
|
team.SeedingResults.Remove(Model);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SeedingBeatmapEditor : CompositeDrawable
|
||||||
|
{
|
||||||
|
private readonly SeedingResult round;
|
||||||
|
private readonly FillFlowContainer flow;
|
||||||
|
|
||||||
|
public SeedingBeatmapEditor(SeedingResult round)
|
||||||
|
{
|
||||||
|
this.round = round;
|
||||||
|
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
|
||||||
|
InternalChild = flow = new FillFlowContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
LayoutDuration = 200,
|
||||||
|
LayoutEasing = Easing.OutQuint,
|
||||||
|
ChildrenEnumerable = round.Beatmaps.Select(p => new SeedingBeatmapRow(round, p))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateNew()
|
||||||
|
{
|
||||||
|
var user = new SeedingBeatmap();
|
||||||
|
round.Beatmaps.Add(user);
|
||||||
|
flow.Add(new SeedingBeatmapRow(round, user));
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SeedingBeatmapRow : CompositeDrawable
|
||||||
|
{
|
||||||
|
private readonly SeedingResult result;
|
||||||
|
public SeedingBeatmap Model { get; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
protected IAPIProvider API { get; private set; }
|
||||||
|
|
||||||
|
private readonly Bindable<string> beatmapId = new Bindable<string>();
|
||||||
|
|
||||||
|
private readonly Bindable<string> score = new Bindable<string>();
|
||||||
|
|
||||||
|
private readonly Container drawableContainer;
|
||||||
|
|
||||||
|
public SeedingBeatmapRow(SeedingResult result, SeedingBeatmap beatmap)
|
||||||
|
{
|
||||||
|
this.result = result;
|
||||||
|
Model = beatmap;
|
||||||
|
|
||||||
|
Margin = new MarginPadding(10);
|
||||||
|
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
|
||||||
|
Masking = true;
|
||||||
|
CornerRadius = 5;
|
||||||
|
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
Colour = OsuColour.Gray(0.2f),
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
Margin = new MarginPadding(5),
|
||||||
|
Padding = new MarginPadding { Right = 160 },
|
||||||
|
Spacing = new Vector2(5),
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new SettingsNumberBox
|
||||||
|
{
|
||||||
|
LabelText = "Beatmap ID",
|
||||||
|
RelativeSizeAxes = Axes.None,
|
||||||
|
Width = 200,
|
||||||
|
Bindable = beatmapId,
|
||||||
|
},
|
||||||
|
new SettingsSlider<int>
|
||||||
|
{
|
||||||
|
LabelText = "Seed",
|
||||||
|
RelativeSizeAxes = Axes.None,
|
||||||
|
Width = 200,
|
||||||
|
Bindable = beatmap.Seed
|
||||||
|
},
|
||||||
|
new SettingsTextBox
|
||||||
|
{
|
||||||
|
LabelText = "Score",
|
||||||
|
RelativeSizeAxes = Axes.None,
|
||||||
|
Width = 200,
|
||||||
|
Bindable = score,
|
||||||
|
},
|
||||||
|
drawableContainer = new Container
|
||||||
|
{
|
||||||
|
Size = new Vector2(100, 70),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new DangerousSettingsButton
|
||||||
|
{
|
||||||
|
Anchor = Anchor.CentreRight,
|
||||||
|
Origin = Anchor.CentreRight,
|
||||||
|
RelativeSizeAxes = Axes.None,
|
||||||
|
Width = 150,
|
||||||
|
Text = "Delete Beatmap",
|
||||||
|
Action = () =>
|
||||||
|
{
|
||||||
|
Expire();
|
||||||
|
result.Beatmaps.Remove(beatmap);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(RulesetStore rulesets)
|
||||||
|
{
|
||||||
|
beatmapId.Value = Model.ID.ToString();
|
||||||
|
beatmapId.BindValueChanged(idString =>
|
||||||
|
{
|
||||||
|
int parsed;
|
||||||
|
|
||||||
|
int.TryParse(idString.NewValue, out parsed);
|
||||||
|
|
||||||
|
Model.ID = parsed;
|
||||||
|
|
||||||
|
if (idString.NewValue != idString.OldValue)
|
||||||
|
Model.BeatmapInfo = null;
|
||||||
|
|
||||||
|
if (Model.BeatmapInfo != null)
|
||||||
|
{
|
||||||
|
updatePanel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = Model.ID });
|
||||||
|
|
||||||
|
req.Success += res =>
|
||||||
|
{
|
||||||
|
Model.BeatmapInfo = res.ToBeatmap(rulesets);
|
||||||
|
updatePanel();
|
||||||
|
};
|
||||||
|
|
||||||
|
req.Failure += _ =>
|
||||||
|
{
|
||||||
|
Model.BeatmapInfo = null;
|
||||||
|
updatePanel();
|
||||||
|
};
|
||||||
|
|
||||||
|
API.Queue(req);
|
||||||
|
}, true);
|
||||||
|
|
||||||
|
score.Value = Model.Score.ToString();
|
||||||
|
score.BindValueChanged(str => long.TryParse(str.NewValue, out Model.Score));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updatePanel()
|
||||||
|
{
|
||||||
|
drawableContainer.Clear();
|
||||||
|
|
||||||
|
if (Model.BeatmapInfo != null)
|
||||||
|
{
|
||||||
|
drawableContainer.Child = new TournamentBeatmapPanel(Model.BeatmapInfo, result.Mod.Value)
|
||||||
|
{
|
||||||
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Origin = Anchor.CentreLeft,
|
||||||
|
Width = 300
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override SeeingResultRow CreateDrawable(SeedingResult model) => new SeeingResultRow(team, model);
|
||||||
|
}
|
||||||
|
}
|
@ -57,6 +57,9 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
|
|
||||||
private readonly Container drawableContainer;
|
private readonly Container drawableContainer;
|
||||||
|
|
||||||
|
[Resolved(canBeNull: true)]
|
||||||
|
private TournamentSceneManager sceneManager { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private LadderInfo ladderInfo { get; set; }
|
private LadderInfo ladderInfo { get; set; }
|
||||||
|
|
||||||
@ -113,6 +116,18 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
Width = 0.2f,
|
Width = 0.2f,
|
||||||
Bindable = Model.FlagName
|
Bindable = Model.FlagName
|
||||||
},
|
},
|
||||||
|
new SettingsTextBox
|
||||||
|
{
|
||||||
|
LabelText = "Seed",
|
||||||
|
Width = 0.2f,
|
||||||
|
Bindable = Model.Seed
|
||||||
|
},
|
||||||
|
new SettingsSlider<int>
|
||||||
|
{
|
||||||
|
LabelText = "Last Year Placement",
|
||||||
|
Width = 0.33f,
|
||||||
|
Bindable = Model.LastYearPlacing
|
||||||
|
},
|
||||||
new SettingsButton
|
new SettingsButton
|
||||||
{
|
{
|
||||||
Width = 0.11f,
|
Width = 0.11f,
|
||||||
@ -131,7 +146,17 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
ladderInfo.Teams.Remove(Model);
|
ladderInfo.Teams.Remove(Model);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
playerEditor
|
playerEditor,
|
||||||
|
new SettingsButton
|
||||||
|
{
|
||||||
|
Width = 0.2f,
|
||||||
|
Margin = new MarginPadding(10),
|
||||||
|
Text = "Edit seeding results",
|
||||||
|
Action = () =>
|
||||||
|
{
|
||||||
|
sceneManager?.SetScreen(new SeedingEditorScreen(team));
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -175,7 +175,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
|
|||||||
X = (flip ? -1 : 1) * 90,
|
X = (flip ? -1 : 1) * 90,
|
||||||
Y = -10,
|
Y = -10,
|
||||||
Colour = colour,
|
Colour = colour,
|
||||||
Font = TournamentFont.GetFont(typeface: TournamentTypeface.Aquatico, weight: FontWeight.Regular, size: 20),
|
Font = OsuFont.Torus.With(weight: FontWeight.Regular, size: 20),
|
||||||
Origin = anchor,
|
Origin = anchor,
|
||||||
Anchor = anchor,
|
Anchor = anchor,
|
||||||
},
|
},
|
||||||
@ -211,7 +211,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
|
|||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Colour = Color4.White,
|
Colour = Color4.White,
|
||||||
Text = match.NewValue.Round.Value?.Name.Value ?? "Unknown Round",
|
Text = match.NewValue.Round.Value?.Name.Value ?? "Unknown Round",
|
||||||
Font = TournamentFont.GetFont(typeface: TournamentTypeface.Aquatico, weight: FontWeight.Regular, size: 18),
|
Font = OsuFont.Torus.With(weight: FontWeight.Regular, size: 18),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -123,8 +123,8 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
|
|||||||
public bool Winning
|
public bool Winning
|
||||||
{
|
{
|
||||||
set => DisplayedCountSpriteText.Font = value
|
set => DisplayedCountSpriteText.Font = value
|
||||||
? TournamentFont.GetFont(typeface: TournamentTypeface.Aquatico, weight: FontWeight.Regular, size: 60)
|
? OsuFont.Torus.With(weight: FontWeight.Regular, size: 60)
|
||||||
: TournamentFont.GetFont(typeface: TournamentTypeface.Aquatico, weight: FontWeight.Light, size: 40);
|
: OsuFont.Torus.With(weight: FontWeight.Light, size: 40);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
316
osu.Game.Tournament/Screens/TeamIntro/SeedingScreen.cs
Normal file
316
osu.Game.Tournament/Screens/TeamIntro/SeedingScreen.cs
Normal file
@ -0,0 +1,316 @@
|
|||||||
|
// 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.Bindables;
|
||||||
|
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.Framework.Platform;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Game.Tournament.Components;
|
||||||
|
using osu.Game.Tournament.Models;
|
||||||
|
using osu.Game.Tournament.Screens.Ladder.Components;
|
||||||
|
using osuTK;
|
||||||
|
using osuTK.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Tournament.Screens.TeamIntro
|
||||||
|
{
|
||||||
|
public class SeedingScreen : TournamentScreen, IProvideVideo
|
||||||
|
{
|
||||||
|
private Container mainContainer;
|
||||||
|
|
||||||
|
private readonly Bindable<TournamentMatch> currentMatch = new Bindable<TournamentMatch>();
|
||||||
|
|
||||||
|
private readonly Bindable<TournamentTeam> currentTeam = new Bindable<TournamentTeam>();
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(Storage storage)
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
new TourneyVideo(storage.GetStream(@"videos/seeding.m4v"))
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Loop = true,
|
||||||
|
},
|
||||||
|
mainContainer = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
|
new ControlPanel
|
||||||
|
{
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new TourneyButton
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Text = "Show first team",
|
||||||
|
Action = () => currentTeam.Value = currentMatch.Value.Team1.Value,
|
||||||
|
},
|
||||||
|
new TourneyButton
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Text = "Show second team",
|
||||||
|
Action = () => currentTeam.Value = currentMatch.Value.Team2.Value,
|
||||||
|
},
|
||||||
|
new SettingsTeamDropdown(LadderInfo.Teams)
|
||||||
|
{
|
||||||
|
LabelText = "Show specific team",
|
||||||
|
Bindable = currentTeam,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
currentMatch.BindValueChanged(matchChanged);
|
||||||
|
currentMatch.BindTo(LadderInfo.CurrentMatch);
|
||||||
|
|
||||||
|
currentTeam.BindValueChanged(teamChanged, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void teamChanged(ValueChangedEvent<TournamentTeam> team)
|
||||||
|
{
|
||||||
|
if (team.NewValue == null)
|
||||||
|
{
|
||||||
|
mainContainer.Clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
showTeam(team.NewValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void matchChanged(ValueChangedEvent<TournamentMatch> match) =>
|
||||||
|
currentTeam.Value = currentMatch.Value.Team1.Value;
|
||||||
|
|
||||||
|
private void showTeam(TournamentTeam team)
|
||||||
|
{
|
||||||
|
mainContainer.Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new LeftInfo(team) { Position = new Vector2(55, 150), },
|
||||||
|
new RightInfo(team) { Position = new Vector2(500, 150), },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private class RightInfo : CompositeDrawable
|
||||||
|
{
|
||||||
|
public RightInfo(TournamentTeam team)
|
||||||
|
{
|
||||||
|
FillFlowContainer fill;
|
||||||
|
|
||||||
|
Width = 400;
|
||||||
|
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
fill = new FillFlowContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (var seeding in team.SeedingResults)
|
||||||
|
{
|
||||||
|
fill.Add(new ModRow(seeding.Mod.Value, seeding.Seed.Value));
|
||||||
|
foreach (var beatmap in seeding.Beatmaps)
|
||||||
|
fill.Add(new BeatmapScoreRow(beatmap));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class BeatmapScoreRow : CompositeDrawable
|
||||||
|
{
|
||||||
|
public BeatmapScoreRow(SeedingBeatmap beatmap)
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
Spacing = new Vector2(5),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new TournamentSpriteText { Text = beatmap.BeatmapInfo.Metadata.Title, Colour = Color4.Black, },
|
||||||
|
new TournamentSpriteText { Text = "by", Colour = Color4.Black, Font = OsuFont.Torus.With(weight: FontWeight.Regular) },
|
||||||
|
new TournamentSpriteText { Text = beatmap.BeatmapInfo.Metadata.Artist, Colour = Color4.Black, Font = OsuFont.Torus.With(weight: FontWeight.Regular) },
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
Spacing = new Vector2(40),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new TournamentSpriteText { Text = beatmap.Score.ToString("#,0"), Colour = Color4.Black, Width = 80 },
|
||||||
|
new TournamentSpriteText { Text = "#" + beatmap.Seed.Value.ToString("#,0"), Colour = Color4.Black, Font = OsuFont.Torus.With(weight: FontWeight.Regular) },
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ModRow : CompositeDrawable
|
||||||
|
{
|
||||||
|
private readonly string mods;
|
||||||
|
private readonly int seeding;
|
||||||
|
|
||||||
|
public ModRow(string mods, int seeding)
|
||||||
|
{
|
||||||
|
this.mods = mods;
|
||||||
|
this.seeding = seeding;
|
||||||
|
|
||||||
|
Padding = new MarginPadding { Vertical = 10 };
|
||||||
|
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(TextureStore textures)
|
||||||
|
{
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
Spacing = new Vector2(5),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Sprite
|
||||||
|
{
|
||||||
|
Texture = textures.Get($"mods/{mods.ToLower()}"),
|
||||||
|
Scale = new Vector2(0.5f)
|
||||||
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
Size = new Vector2(50, 16),
|
||||||
|
CornerRadius = 10,
|
||||||
|
Masking = true,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = Color4.Black,
|
||||||
|
},
|
||||||
|
new TournamentSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Text = seeding.ToString("#,0"),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class LeftInfo : CompositeDrawable
|
||||||
|
{
|
||||||
|
public LeftInfo(TournamentTeam team)
|
||||||
|
{
|
||||||
|
FillFlowContainer fill;
|
||||||
|
|
||||||
|
Width = 200;
|
||||||
|
|
||||||
|
if (team == null) return;
|
||||||
|
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
fill = new FillFlowContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new TeamDisplay(team) { Margin = new MarginPadding { Bottom = 30 } },
|
||||||
|
new RowDisplay("Average Rank:", $"#{team.AverageRank:#,0}"),
|
||||||
|
new RowDisplay("Seed:", team.Seed.Value),
|
||||||
|
new RowDisplay("Last year's placing:", team.LastYearPlacing.Value > 0 ? $"#{team.LastYearPlacing:#,0}" : "0"),
|
||||||
|
new Container { Margin = new MarginPadding { Bottom = 30 } },
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (var p in team.Players)
|
||||||
|
fill.Add(new RowDisplay(p.Username, p.Statistics?.Ranks.Global?.ToString("\\##,0") ?? "-"));
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class RowDisplay : CompositeDrawable
|
||||||
|
{
|
||||||
|
public RowDisplay(string left, string right)
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
|
||||||
|
var colour = OsuColour.Gray(0.3f);
|
||||||
|
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
new TournamentSpriteText
|
||||||
|
{
|
||||||
|
Text = left,
|
||||||
|
Colour = colour,
|
||||||
|
Font = OsuFont.Torus.With(size: 22),
|
||||||
|
},
|
||||||
|
new TournamentSpriteText
|
||||||
|
{
|
||||||
|
Text = right,
|
||||||
|
Colour = colour,
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
Origin = Anchor.TopLeft,
|
||||||
|
Font = OsuFont.Torus.With(size: 22, weight: FontWeight.Regular),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class TeamDisplay : DrawableTournamentTeam
|
||||||
|
{
|
||||||
|
public TeamDisplay(TournamentTeam team)
|
||||||
|
: base(team)
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
|
Flag.RelativeSizeAxes = Axes.None;
|
||||||
|
Flag.Size = new Vector2(300, 200);
|
||||||
|
Flag.Scale = new Vector2(0.3f);
|
||||||
|
|
||||||
|
InternalChild = new FillFlowContainer
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
Spacing = new Vector2(0, 5),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
Flag,
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Text = team?.FullName.Value ?? "???",
|
||||||
|
Font = OsuFont.Torus.With(size: 32, weight: FontWeight.SemiBold),
|
||||||
|
Colour = Color4.Black,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -201,7 +201,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro
|
|||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = team?.FullName.Value.ToUpper() ?? "???",
|
Text = team?.FullName.Value.ToUpper() ?? "???",
|
||||||
Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 40, FontWeight.Light),
|
Font = OsuFont.Torus.With(size: 40, weight: FontWeight.Light),
|
||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
@ -209,7 +209,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro
|
|||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = teamName.ToUpper(),
|
Text = teamName.ToUpper(),
|
||||||
Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 20, FontWeight.Regular),
|
Font = OsuFont.Torus.With(size: 20, weight: FontWeight.Regular),
|
||||||
Colour = colour,
|
Colour = colour,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
|
@ -126,7 +126,7 @@ namespace osu.Game.Tournament.Screens.TeamWin
|
|||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Colour = col,
|
Colour = col,
|
||||||
Text = "WINNER",
|
Text = "WINNER",
|
||||||
Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 15, FontWeight.Regular),
|
Font = OsuFont.Torus.With(size: 15, weight: FontWeight.Regular),
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
@ -134,7 +134,7 @@ namespace osu.Game.Tournament.Screens.TeamWin
|
|||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Colour = col,
|
Colour = col,
|
||||||
Text = match.Round.Value?.Name.Value ?? "Unknown Round",
|
Text = match.Round.Value?.Name.Value ?? "Unknown Round",
|
||||||
Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 50, FontWeight.Light),
|
Font = OsuFont.Torus.With(size: 50, weight: FontWeight.Light),
|
||||||
Spacing = new Vector2(10, 0),
|
Spacing = new Vector2(10, 0),
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
@ -143,7 +143,7 @@ namespace osu.Game.Tournament.Screens.TeamWin
|
|||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Colour = col,
|
Colour = col,
|
||||||
Text = match.Date.Value.ToUniversalTime().ToString("dd MMMM HH:mm UTC"),
|
Text = match.Date.Value.ToUniversalTime().ToString("dd MMMM HH:mm UTC"),
|
||||||
Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 20, FontWeight.Light),
|
Font = OsuFont.Torus.With(size: 20, weight: FontWeight.Light),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -203,7 +203,7 @@ namespace osu.Game.Tournament.Screens.TeamWin
|
|||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = team?.FullName.Value.ToUpper() ?? "???",
|
Text = team?.FullName.Value.ToUpper() ?? "???",
|
||||||
Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 40, FontWeight.Light),
|
Font = OsuFont.Torus.With(size: 40, weight: FontWeight.Light),
|
||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
|
@ -1,75 +0,0 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
|
||||||
|
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Tournament
|
|
||||||
{
|
|
||||||
public static class TournamentFont
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The default font size.
|
|
||||||
/// </summary>
|
|
||||||
public const float DEFAULT_FONT_SIZE = 16;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieves a <see cref="FontUsage"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="typeface">The font typeface.</param>
|
|
||||||
/// <param name="size">The size of the text in local space. For a value of 16, a single line will have a height of 16px.</param>
|
|
||||||
/// <param name="weight">The font weight.</param>
|
|
||||||
/// <param name="italics">Whether the font is italic.</param>
|
|
||||||
/// <param name="fixedWidth">Whether all characters should be spaced the same distance apart.</param>
|
|
||||||
/// <returns>The <see cref="FontUsage"/>.</returns>
|
|
||||||
public static FontUsage GetFont(TournamentTypeface typeface = TournamentTypeface.Aquatico, float size = DEFAULT_FONT_SIZE, FontWeight weight = FontWeight.Medium, bool italics = false, bool fixedWidth = false)
|
|
||||||
=> new FontUsage(GetFamilyString(typeface), size, GetWeightString(typeface, weight), italics, fixedWidth);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieves the string representation of a <see cref="TournamentTypeface"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="typeface">The <see cref="TournamentTypeface"/>.</param>
|
|
||||||
/// <returns>The string representation.</returns>
|
|
||||||
public static string GetFamilyString(TournamentTypeface typeface)
|
|
||||||
{
|
|
||||||
switch (typeface)
|
|
||||||
{
|
|
||||||
case TournamentTypeface.Aquatico:
|
|
||||||
return "Aquatico";
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieves the string representation of a <see cref="FontWeight"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="typeface">The <see cref="TournamentTypeface"/>.</param>
|
|
||||||
/// <param name="weight">The <see cref="FontWeight"/>.</param>
|
|
||||||
/// <returns>The string representation of <paramref name="weight"/> in the specified <paramref name="typeface"/>.</returns>
|
|
||||||
public static string GetWeightString(TournamentTypeface typeface, FontWeight weight)
|
|
||||||
=> GetWeightString(GetFamilyString(typeface), weight);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieves the string representation of a <see cref="FontWeight"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="family">The family string.</param>
|
|
||||||
/// <param name="weight">The <see cref="FontWeight"/>.</param>
|
|
||||||
/// <returns>The string representation of <paramref name="weight"/> in the specified <paramref name="family"/>.</returns>
|
|
||||||
public static string GetWeightString(string family, FontWeight weight)
|
|
||||||
{
|
|
||||||
string weightString = weight.ToString();
|
|
||||||
|
|
||||||
// Only exo has an explicit "regular" weight, other fonts do not
|
|
||||||
if (weight == FontWeight.Regular && family != GetFamilyString(TournamentTypeface.Aquatico))
|
|
||||||
weightString = string.Empty;
|
|
||||||
|
|
||||||
return weightString;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum TournamentTypeface
|
|
||||||
{
|
|
||||||
Aquatico
|
|
||||||
}
|
|
||||||
}
|
|
@ -54,9 +54,6 @@ namespace osu.Game.Tournament
|
|||||||
{
|
{
|
||||||
Resources.AddStore(new DllResourceStore(typeof(TournamentGameBase).Assembly));
|
Resources.AddStore(new DllResourceStore(typeof(TournamentGameBase).Assembly));
|
||||||
|
|
||||||
AddFont(Resources, @"Resources/Fonts/Aquatico-Regular");
|
|
||||||
AddFont(Resources, @"Resources/Fonts/Aquatico-Light");
|
|
||||||
|
|
||||||
Textures.AddStore(new TextureLoaderStore(new ResourceStore<byte[]>(new StorageBackedResourceStore(storage))));
|
Textures.AddStore(new TextureLoaderStore(new ResourceStore<byte[]>(new StorageBackedResourceStore(storage))));
|
||||||
|
|
||||||
this.storage = storage;
|
this.storage = storage;
|
||||||
@ -124,10 +121,9 @@ namespace osu.Game.Tournament
|
|||||||
using (var sr = new StreamReader(stream))
|
using (var sr = new StreamReader(stream))
|
||||||
ladder = JsonConvert.DeserializeObject<LadderInfo>(sr.ReadToEnd());
|
ladder = JsonConvert.DeserializeObject<LadderInfo>(sr.ReadToEnd());
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
if (ladder == null)
|
||||||
ladder = new LadderInfo();
|
ladder = new LadderInfo();
|
||||||
}
|
|
||||||
|
|
||||||
if (ladder.Ruleset.Value == null)
|
if (ladder.Ruleset.Value == null)
|
||||||
ladder.Ruleset.Value = RulesetStore.AvailableRulesets.First();
|
ladder.Ruleset.Value = RulesetStore.AvailableRulesets.First();
|
||||||
@ -205,9 +201,11 @@ namespace osu.Game.Tournament
|
|||||||
{
|
{
|
||||||
foreach (var p in t.Players)
|
foreach (var p in t.Players)
|
||||||
{
|
{
|
||||||
if (p.Username == null || p.Statistics == null)
|
if (string.IsNullOrEmpty(p.Username) || p.Statistics == null)
|
||||||
|
{
|
||||||
PopulateUser(p);
|
PopulateUser(p);
|
||||||
addedInfo = true;
|
addedInfo = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,6 +241,24 @@ namespace osu.Game.Tournament
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var t in ladder.Teams)
|
||||||
|
{
|
||||||
|
foreach (var s in t.SeedingResults)
|
||||||
|
{
|
||||||
|
foreach (var b in s.Beatmaps)
|
||||||
|
{
|
||||||
|
if (b.BeatmapInfo == null && b.ID > 0)
|
||||||
|
{
|
||||||
|
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID });
|
||||||
|
req.Perform(API);
|
||||||
|
b.BeatmapInfo = req.Result?.ToBeatmap(RulesetStore);
|
||||||
|
|
||||||
|
addedInfo = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return addedInfo;
|
return addedInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,6 +80,7 @@ namespace osu.Game.Tournament
|
|||||||
new ShowcaseScreen(),
|
new ShowcaseScreen(),
|
||||||
new MapPoolScreen(),
|
new MapPoolScreen(),
|
||||||
new TeamIntroScreen(),
|
new TeamIntroScreen(),
|
||||||
|
new SeedingScreen(),
|
||||||
new DrawingsScreen(),
|
new DrawingsScreen(),
|
||||||
new GameplayScreen(),
|
new GameplayScreen(),
|
||||||
new TeamWinScreen()
|
new TeamWinScreen()
|
||||||
@ -121,6 +122,7 @@ namespace osu.Game.Tournament
|
|||||||
new ScreenButton(typeof(LadderScreen)) { Text = "Bracket", RequestSelection = SetScreen },
|
new ScreenButton(typeof(LadderScreen)) { Text = "Bracket", RequestSelection = SetScreen },
|
||||||
new Separator(),
|
new Separator(),
|
||||||
new ScreenButton(typeof(TeamIntroScreen)) { Text = "TeamIntro", RequestSelection = SetScreen },
|
new ScreenButton(typeof(TeamIntroScreen)) { Text = "TeamIntro", RequestSelection = SetScreen },
|
||||||
|
new ScreenButton(typeof(SeedingScreen)) { Text = "Seeding", RequestSelection = SetScreen },
|
||||||
new Separator(),
|
new Separator(),
|
||||||
new ScreenButton(typeof(MapPoolScreen)) { Text = "MapPool", RequestSelection = SetScreen },
|
new ScreenButton(typeof(MapPoolScreen)) { Text = "MapPool", RequestSelection = SetScreen },
|
||||||
new ScreenButton(typeof(GameplayScreen)) { Text = "Gameplay", RequestSelection = SetScreen },
|
new ScreenButton(typeof(GameplayScreen)) { Text = "Gameplay", RequestSelection = SetScreen },
|
||||||
@ -146,8 +148,20 @@ namespace osu.Game.Tournament
|
|||||||
private Drawable currentScreen;
|
private Drawable currentScreen;
|
||||||
private ScheduledDelegate scheduledHide;
|
private ScheduledDelegate scheduledHide;
|
||||||
|
|
||||||
|
private Drawable temporaryScreen;
|
||||||
|
|
||||||
|
public void SetScreen(Drawable screen)
|
||||||
|
{
|
||||||
|
currentScreen?.Hide();
|
||||||
|
currentScreen = null;
|
||||||
|
|
||||||
|
screens.Add(temporaryScreen = screen);
|
||||||
|
}
|
||||||
|
|
||||||
public void SetScreen(Type screenType)
|
public void SetScreen(Type screenType)
|
||||||
{
|
{
|
||||||
|
temporaryScreen?.Expire();
|
||||||
|
|
||||||
var target = screens.FirstOrDefault(s => s.GetType() == screenType);
|
var target = screens.FirstOrDefault(s => s.GetType() == screenType);
|
||||||
|
|
||||||
if (target == null || currentScreen == target) return;
|
if (target == null || currentScreen == target) return;
|
||||||
|
16
osu.Game.Tournament/TournamentSpriteText.cs
Normal file
16
osu.Game.Tournament/TournamentSpriteText.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// 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.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
|
||||||
|
namespace osu.Game.Tournament
|
||||||
|
{
|
||||||
|
public class TournamentSpriteText : OsuSpriteText
|
||||||
|
{
|
||||||
|
public TournamentSpriteText()
|
||||||
|
{
|
||||||
|
Font = OsuFont.Torus;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -17,7 +17,9 @@ namespace osu.Game.Graphics
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static FontUsage Default => GetFont();
|
public static FontUsage Default => GetFont();
|
||||||
|
|
||||||
public static FontUsage Numeric => GetFont(Typeface.Venera, weight: FontWeight.Regular);
|
public static FontUsage Numeric => GetFont(Typeface.Venera, weight: FontWeight.Bold);
|
||||||
|
|
||||||
|
public static FontUsage Torus => GetFont(Typeface.Torus, weight: FontWeight.Regular);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves a <see cref="FontUsage"/>.
|
/// Retrieves a <see cref="FontUsage"/>.
|
||||||
@ -45,6 +47,9 @@ namespace osu.Game.Graphics
|
|||||||
|
|
||||||
case Typeface.Venera:
|
case Typeface.Venera:
|
||||||
return "Venera";
|
return "Venera";
|
||||||
|
|
||||||
|
case Typeface.Torus:
|
||||||
|
return "Torus";
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -65,16 +70,7 @@ namespace osu.Game.Graphics
|
|||||||
/// <param name="family">The family string.</param>
|
/// <param name="family">The family string.</param>
|
||||||
/// <param name="weight">The <see cref="FontWeight"/>.</param>
|
/// <param name="weight">The <see cref="FontWeight"/>.</param>
|
||||||
/// <returns>The string representation of <paramref name="weight"/> in the specified <paramref name="family"/>.</returns>
|
/// <returns>The string representation of <paramref name="weight"/> in the specified <paramref name="family"/>.</returns>
|
||||||
public static string GetWeightString(string family, FontWeight weight)
|
public static string GetWeightString(string family, FontWeight weight) => weight.ToString();
|
||||||
{
|
|
||||||
string weightString = weight.ToString();
|
|
||||||
|
|
||||||
// Only exo has an explicit "regular" weight, other fonts do not
|
|
||||||
if (family != GetFamilyString(Typeface.Exo) && weight == FontWeight.Regular)
|
|
||||||
weightString = string.Empty;
|
|
||||||
|
|
||||||
return weightString;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class OsuFontExtensions
|
public static class OsuFontExtensions
|
||||||
@ -102,15 +98,39 @@ namespace osu.Game.Graphics
|
|||||||
{
|
{
|
||||||
Exo,
|
Exo,
|
||||||
Venera,
|
Venera,
|
||||||
|
Torus
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum FontWeight
|
public enum FontWeight
|
||||||
{
|
{
|
||||||
Light,
|
/// <summary>
|
||||||
Regular,
|
/// Equivalent to weight 300.
|
||||||
Medium,
|
/// </summary>
|
||||||
SemiBold,
|
Light = 300,
|
||||||
Bold,
|
|
||||||
Black
|
/// <summary>
|
||||||
|
/// Equivalent to weight 400.
|
||||||
|
/// </summary>
|
||||||
|
Regular = 400,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Equivalent to weight 500.
|
||||||
|
/// </summary>
|
||||||
|
Medium = 500,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Equivalent to weight 600.
|
||||||
|
/// </summary>
|
||||||
|
SemiBold = 600,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Equivalent to weight 700.
|
||||||
|
/// </summary>
|
||||||
|
Bold = 700,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Equivalent to weight 900.
|
||||||
|
/// </summary>
|
||||||
|
Black = 900
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
Spacing = new Vector2(-3, 0),
|
Spacing = new Vector2(-3, 0),
|
||||||
Padding = new MarginPadding { Top = 5 },
|
Padding = new MarginPadding { Top = 5 },
|
||||||
Colour = getRankNameColour(),
|
Colour = getRankNameColour(),
|
||||||
Font = OsuFont.GetFont(Typeface.Venera, 25),
|
Font = OsuFont.Numeric.With(size: 25),
|
||||||
Text = getRankName(),
|
Text = getRankName(),
|
||||||
ShadowColour = Color4.Black.Opacity(0.3f),
|
ShadowColour = Color4.Black.Opacity(0.3f),
|
||||||
ShadowOffset = new Vector2(0, 0.08f),
|
ShadowOffset = new Vector2(0, 0.08f),
|
||||||
|
@ -157,9 +157,14 @@ namespace osu.Game
|
|||||||
AddFont(Resources, @"Fonts/Exo2.0-Black");
|
AddFont(Resources, @"Fonts/Exo2.0-Black");
|
||||||
AddFont(Resources, @"Fonts/Exo2.0-BlackItalic");
|
AddFont(Resources, @"Fonts/Exo2.0-BlackItalic");
|
||||||
|
|
||||||
AddFont(Resources, @"Fonts/Venera");
|
AddFont(Resources, @"Fonts/Torus-SemiBold");
|
||||||
|
AddFont(Resources, @"Fonts/Torus-Bold");
|
||||||
|
AddFont(Resources, @"Fonts/Torus-Regular");
|
||||||
|
AddFont(Resources, @"Fonts/Torus-Light");
|
||||||
|
|
||||||
AddFont(Resources, @"Fonts/Venera-Light");
|
AddFont(Resources, @"Fonts/Venera-Light");
|
||||||
AddFont(Resources, @"Fonts/Venera-Medium");
|
AddFont(Resources, @"Fonts/Venera-Bold");
|
||||||
|
AddFont(Resources, @"Fonts/Venera-Black");
|
||||||
|
|
||||||
runMigrations();
|
runMigrations();
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.221.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.304.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.302.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.302.0" />
|
||||||
<PackageReference Include="Sentry" Version="2.1.0" />
|
<PackageReference Include="Sentry" Version="2.1.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.221.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.304.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.302.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.302.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
||||||
|
Reference in New Issue
Block a user