mirror of https://github.com/ppy/osu
Add ruleset selection to tournament client
This commit is contained in:
parent
fced262c41
commit
702a1c496b
|
@ -5,6 +5,7 @@
|
|||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Rulesets;
|
||||
|
||||
namespace osu.Game.Tournament.Models
|
||||
{
|
||||
|
@ -14,6 +15,8 @@ namespace osu.Game.Tournament.Models
|
|||
[Serializable]
|
||||
public class LadderInfo
|
||||
{
|
||||
public Bindable<RulesetInfo> Ruleset = new Bindable<RulesetInfo>();
|
||||
|
||||
public BindableList<TournamentMatch> Matches = new BindableList<TournamentMatch>();
|
||||
public BindableList<TournamentRound> Rounds = new BindableList<TournamentRound>();
|
||||
public BindableList<TournamentTeam> Teams = new BindableList<TournamentTeam>();
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
using osu.Game.Graphics.UserInterfaceV2;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Tournament.IPC;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
@ -28,6 +29,9 @@ public class SetupScreen : TournamentScreen, IProvideVideo
|
|||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private RulesetStore rulesets { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
|
@ -85,7 +89,14 @@ private void reload()
|
|||
Value = api?.LocalUser.Value.Username,
|
||||
Failing = api?.IsLoggedIn != true,
|
||||
Description = "In order to access the API and display metadata, a login is required."
|
||||
}
|
||||
},
|
||||
new LabelledDropdown<RulesetInfo>
|
||||
{
|
||||
Label = "Ruleset",
|
||||
Description = "Decides what stats are displayed and which ranks are retrieved for players",
|
||||
Items = rulesets.AvailableRulesets,
|
||||
Current = LadderInfo.Ruleset,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -126,6 +126,8 @@ private void readBracket()
|
|||
ladder = new LadderInfo();
|
||||
}
|
||||
|
||||
Ruleset.BindTo(ladder.Ruleset);
|
||||
|
||||
dependencies.Cache(ladder);
|
||||
|
||||
bool addedInfo = false;
|
||||
|
|
Loading…
Reference in New Issue