mirror of
https://github.com/osukey/osukey.git
synced 2025-04-29 10:47:22 +09:00
Update tournament components to use APIBeatmap
directly
This commit is contained in:
parent
db6343c44c
commit
3130616300
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
@ -23,14 +22,13 @@ namespace osu.Game.Tournament.Tests.Components
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = 1091460 });
|
var req = new GetBeatmapRequest(new APIBeatmap { OnlineID = 1091460 });
|
||||||
req.Success += success;
|
req.Success += success;
|
||||||
api.Queue(req);
|
api.Queue(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void success(APIBeatmap apiBeatmap)
|
private void success(APIBeatmap beatmap)
|
||||||
{
|
{
|
||||||
var beatmap = apiBeatmap.ToBeatmapInfo(rulesets);
|
|
||||||
Add(new TournamentBeatmapPanel(beatmap)
|
Add(new TournamentBeatmapPanel(beatmap)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Tournament.Components;
|
using osu.Game.Tournament.Components;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Tournament.Tests.Components
|
namespace osu.Game.Tournament.Tests.Components
|
||||||
{
|
{
|
||||||
@ -23,12 +23,10 @@ namespace osu.Game.Tournament.Tests.Components
|
|||||||
|
|
||||||
private FillFlowContainer<TournamentBeatmapPanel> fillFlow;
|
private FillFlowContainer<TournamentBeatmapPanel> fillFlow;
|
||||||
|
|
||||||
private BeatmapInfo beatmapInfo;
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = 490154 });
|
var req = new GetBeatmapRequest(new APIBeatmap { OnlineID = 490154 });
|
||||||
req.Success += success;
|
req.Success += success;
|
||||||
api.Queue(req);
|
api.Queue(req);
|
||||||
|
|
||||||
@ -38,18 +36,17 @@ namespace osu.Game.Tournament.Tests.Components
|
|||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Direction = FillDirection.Full,
|
Direction = FillDirection.Full,
|
||||||
Spacing = new osuTK.Vector2(10)
|
Spacing = new Vector2(10)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void success(APIBeatmap apiBeatmap)
|
private void success(APIBeatmap beatmap)
|
||||||
{
|
{
|
||||||
beatmapInfo = apiBeatmap.ToBeatmapInfo(rulesets);
|
|
||||||
var mods = rulesets.GetRuleset(Ladder.Ruleset.Value.ID ?? 0).CreateInstance().AllMods;
|
var mods = rulesets.GetRuleset(Ladder.Ruleset.Value.ID ?? 0).CreateInstance().AllMods;
|
||||||
|
|
||||||
foreach (var mod in mods)
|
foreach (var mod in mods)
|
||||||
{
|
{
|
||||||
fillFlow.Add(new TournamentBeatmapPanel(beatmapInfo, mod.Acronym)
|
fillFlow.Add(new TournamentBeatmapPanel(beatmap, mod.Acronym)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
|
@ -44,8 +44,8 @@ namespace osu.Game.Tournament.Tests.NonVisual
|
|||||||
{
|
{
|
||||||
Beatmaps =
|
Beatmaps =
|
||||||
{
|
{
|
||||||
new RoundBeatmap { BeatmapInfo = TournamentTestScene.CreateSampleBeatmapInfo() },
|
new RoundBeatmap { BeatmapInfo = TournamentTestScene.CreateSampleBeatmap() },
|
||||||
new RoundBeatmap { BeatmapInfo = TournamentTestScene.CreateSampleBeatmapInfo() },
|
new RoundBeatmap { BeatmapInfo = TournamentTestScene.CreateSampleBeatmap() },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -132,7 +132,7 @@ namespace osu.Game.Tournament.Tests.Screens
|
|||||||
{
|
{
|
||||||
Ladder.CurrentMatch.Value.Round.Value.Beatmaps.Add(new RoundBeatmap
|
Ladder.CurrentMatch.Value.Round.Value.Beatmaps.Add(new RoundBeatmap
|
||||||
{
|
{
|
||||||
BeatmapInfo = CreateSampleBeatmapInfo(),
|
BeatmapInfo = CreateSampleBeatmap(),
|
||||||
Mods = mods
|
Mods = mods
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Tests.Visual;
|
using osu.Game.Tests.Visual;
|
||||||
@ -74,19 +73,19 @@ namespace osu.Game.Tournament.Tests
|
|||||||
{
|
{
|
||||||
new SeedingBeatmap
|
new SeedingBeatmap
|
||||||
{
|
{
|
||||||
BeatmapInfo = CreateSampleBeatmapInfo(),
|
BeatmapInfo = CreateSampleBeatmap(),
|
||||||
Score = 12345672,
|
Score = 12345672,
|
||||||
Seed = { Value = 24 },
|
Seed = { Value = 24 },
|
||||||
},
|
},
|
||||||
new SeedingBeatmap
|
new SeedingBeatmap
|
||||||
{
|
{
|
||||||
BeatmapInfo = CreateSampleBeatmapInfo(),
|
BeatmapInfo = CreateSampleBeatmap(),
|
||||||
Score = 1234567,
|
Score = 1234567,
|
||||||
Seed = { Value = 12 },
|
Seed = { Value = 12 },
|
||||||
},
|
},
|
||||||
new SeedingBeatmap
|
new SeedingBeatmap
|
||||||
{
|
{
|
||||||
BeatmapInfo = CreateSampleBeatmapInfo(),
|
BeatmapInfo = CreateSampleBeatmap(),
|
||||||
Score = 1234567,
|
Score = 1234567,
|
||||||
Seed = { Value = 16 },
|
Seed = { Value = 16 },
|
||||||
}
|
}
|
||||||
@ -100,19 +99,19 @@ namespace osu.Game.Tournament.Tests
|
|||||||
{
|
{
|
||||||
new SeedingBeatmap
|
new SeedingBeatmap
|
||||||
{
|
{
|
||||||
BeatmapInfo = CreateSampleBeatmapInfo(),
|
BeatmapInfo = CreateSampleBeatmap(),
|
||||||
Score = 234567,
|
Score = 234567,
|
||||||
Seed = { Value = 3 },
|
Seed = { Value = 3 },
|
||||||
},
|
},
|
||||||
new SeedingBeatmap
|
new SeedingBeatmap
|
||||||
{
|
{
|
||||||
BeatmapInfo = CreateSampleBeatmapInfo(),
|
BeatmapInfo = CreateSampleBeatmap(),
|
||||||
Score = 234567,
|
Score = 234567,
|
||||||
Seed = { Value = 6 },
|
Seed = { Value = 6 },
|
||||||
},
|
},
|
||||||
new SeedingBeatmap
|
new SeedingBeatmap
|
||||||
{
|
{
|
||||||
BeatmapInfo = CreateSampleBeatmapInfo(),
|
BeatmapInfo = CreateSampleBeatmap(),
|
||||||
Score = 234567,
|
Score = 234567,
|
||||||
Seed = { Value = 12 },
|
Seed = { Value = 12 },
|
||||||
}
|
}
|
||||||
@ -152,16 +151,15 @@ namespace osu.Game.Tournament.Tests
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static BeatmapInfo CreateSampleBeatmapInfo() =>
|
public static APIBeatmap CreateSampleBeatmap() =>
|
||||||
new BeatmapInfo
|
new APIBeatmap
|
||||||
{
|
{
|
||||||
Metadata = new BeatmapMetadata
|
BeatmapSet = new APIBeatmapSet
|
||||||
{
|
{
|
||||||
Title = "Test Title",
|
Title = "Test Title",
|
||||||
Artist = "Test Artist",
|
Artist = "Test Artist",
|
||||||
ID = RNG.Next(0, 1000000)
|
|
||||||
},
|
},
|
||||||
OnlineInfo = new APIBeatmap(),
|
OnlineID = RNG.Next(0, 1000000),
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override ITestSceneTestRunner CreateRunner() => new TournamentTestSceneTestRunner();
|
protected override ITestSceneTestRunner CreateRunner() => new TournamentTestSceneTestRunner();
|
||||||
|
@ -12,6 +12,7 @@ using osu.Game.Beatmaps;
|
|||||||
using osu.Game.Beatmaps.Legacy;
|
using osu.Game.Beatmaps.Legacy;
|
||||||
using osu.Game.Extensions;
|
using osu.Game.Extensions;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Screens.Menu;
|
using osu.Game.Screens.Menu;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -21,16 +22,15 @@ namespace osu.Game.Tournament.Components
|
|||||||
{
|
{
|
||||||
public class SongBar : CompositeDrawable
|
public class SongBar : CompositeDrawable
|
||||||
{
|
{
|
||||||
private BeatmapInfo beatmapInfo;
|
private APIBeatmap beatmapInfo;
|
||||||
|
|
||||||
public const float HEIGHT = 145 / 2f;
|
public const float HEIGHT = 145 / 2f;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private IBindable<RulesetInfo> ruleset { get; set; }
|
private IBindable<RulesetInfo> ruleset { get; set; }
|
||||||
|
|
||||||
public BeatmapInfo BeatmapInfo
|
public APIBeatmap BeatmapInfo
|
||||||
{
|
{
|
||||||
get => beatmapInfo;
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (beatmapInfo == value)
|
if (beatmapInfo == value)
|
||||||
@ -101,12 +101,12 @@ namespace osu.Game.Tournament.Components
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
double bpm = beatmapInfo.BeatmapSet.OnlineInfo.BPM;
|
double bpm = beatmapInfo.BPM; // TODO: check this works.
|
||||||
double length = beatmapInfo.Length;
|
double length = beatmapInfo.Length;
|
||||||
string hardRockExtra = "";
|
string hardRockExtra = "";
|
||||||
string srExtra = "";
|
string srExtra = "";
|
||||||
|
|
||||||
float ar = beatmapInfo.BaseDifficulty.ApproachRate;
|
float ar = beatmapInfo.Difficulty.ApproachRate;
|
||||||
|
|
||||||
if ((mods & LegacyMods.HardRock) > 0)
|
if ((mods & LegacyMods.HardRock) > 0)
|
||||||
{
|
{
|
||||||
@ -132,9 +132,9 @@ namespace osu.Game.Tournament.Components
|
|||||||
default:
|
default:
|
||||||
stats = new (string heading, string content)[]
|
stats = new (string heading, string content)[]
|
||||||
{
|
{
|
||||||
("CS", $"{beatmapInfo.BaseDifficulty.CircleSize:0.#}{hardRockExtra}"),
|
("CS", $"{beatmapInfo.Difficulty.CircleSize:0.#}{hardRockExtra}"),
|
||||||
("AR", $"{ar:0.#}{hardRockExtra}"),
|
("AR", $"{ar:0.#}{hardRockExtra}"),
|
||||||
("OD", $"{beatmapInfo.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}"),
|
("OD", $"{beatmapInfo.Difficulty.OverallDifficulty:0.#}{hardRockExtra}"),
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -142,15 +142,15 @@ namespace osu.Game.Tournament.Components
|
|||||||
case 3:
|
case 3:
|
||||||
stats = new (string heading, string content)[]
|
stats = new (string heading, string content)[]
|
||||||
{
|
{
|
||||||
("OD", $"{beatmapInfo.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}"),
|
("OD", $"{beatmapInfo.Difficulty.OverallDifficulty:0.#}{hardRockExtra}"),
|
||||||
("HP", $"{beatmapInfo.BaseDifficulty.DrainRate:0.#}{hardRockExtra}")
|
("HP", $"{beatmapInfo.Difficulty.DrainRate:0.#}{hardRockExtra}")
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
stats = new (string heading, string content)[]
|
stats = new (string heading, string content)[]
|
||||||
{
|
{
|
||||||
("CS", $"{beatmapInfo.BaseDifficulty.CircleSize:0.#}{hardRockExtra}"),
|
("CS", $"{beatmapInfo.Difficulty.CircleSize:0.#}{hardRockExtra}"),
|
||||||
("AR", $"{ar:0.#}"),
|
("AR", $"{ar:0.#}"),
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
@ -186,7 +186,7 @@ namespace osu.Game.Tournament.Components
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new DiffPiece(stats),
|
new DiffPiece(stats),
|
||||||
new DiffPiece(("Star Rating", $"{beatmapInfo.StarDifficulty:0.#}{srExtra}"))
|
new DiffPiece(("Star Rating", $"{beatmapInfo.StarRating:0.#}{srExtra}"))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
|
@ -13,6 +13,7 @@ using osu.Framework.Graphics.Textures;
|
|||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Tournament.Models;
|
using osu.Game.Tournament.Models;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -20,7 +21,7 @@ namespace osu.Game.Tournament.Components
|
|||||||
{
|
{
|
||||||
public class TournamentBeatmapPanel : CompositeDrawable
|
public class TournamentBeatmapPanel : CompositeDrawable
|
||||||
{
|
{
|
||||||
public readonly IBeatmapInfo BeatmapInfo;
|
public readonly APIBeatmap BeatmapInfo;
|
||||||
|
|
||||||
private readonly string mod;
|
private readonly string mod;
|
||||||
|
|
||||||
@ -32,7 +33,7 @@ namespace osu.Game.Tournament.Components
|
|||||||
private readonly Bindable<TournamentMatch> currentMatch = new Bindable<TournamentMatch>();
|
private readonly Bindable<TournamentMatch> currentMatch = new Bindable<TournamentMatch>();
|
||||||
private Box flash;
|
private Box flash;
|
||||||
|
|
||||||
public TournamentBeatmapPanel(IBeatmapInfo beatmapInfo, string mod = null)
|
public TournamentBeatmapPanel(APIBeatmap beatmapInfo, string mod = null)
|
||||||
{
|
{
|
||||||
if (beatmapInfo == null) throw new ArgumentNullException(nameof(beatmapInfo));
|
if (beatmapInfo == null) throw new ArgumentNullException(nameof(beatmapInfo));
|
||||||
|
|
||||||
@ -62,7 +63,7 @@ namespace osu.Game.Tournament.Components
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = OsuColour.Gray(0.5f),
|
Colour = OsuColour.Gray(0.5f),
|
||||||
BeatmapSet = BeatmapInfo.BeatmapSet as IBeatmapSetOnlineInfo,
|
BeatmapSet = BeatmapInfo.BeatmapSet,
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
|
@ -11,10 +11,10 @@ using osu.Framework.Extensions.ObjectExtensions;
|
|||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Beatmaps.Legacy;
|
using osu.Game.Beatmaps.Legacy;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Tournament.Models;
|
using osu.Game.Tournament.Models;
|
||||||
|
|
||||||
@ -93,8 +93,8 @@ namespace osu.Game.Tournament.IPC
|
|||||||
Beatmap.Value = existing.BeatmapInfo;
|
Beatmap.Value = existing.BeatmapInfo;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
beatmapLookupRequest = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId });
|
beatmapLookupRequest = new GetBeatmapRequest(new APIBeatmap { OnlineID = beatmapId });
|
||||||
beatmapLookupRequest.Success += b => Beatmap.Value = b.ToBeatmapInfo(Rulesets);
|
beatmapLookupRequest.Success += b => Beatmap.Value = b;
|
||||||
API.Queue(beatmapLookupRequest);
|
API.Queue(beatmapLookupRequest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
|
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Beatmaps.Legacy;
|
using osu.Game.Beatmaps.Legacy;
|
||||||
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
|
|
||||||
namespace osu.Game.Tournament.IPC
|
namespace osu.Game.Tournament.IPC
|
||||||
{
|
{
|
||||||
public class MatchIPCInfo : Component
|
public class MatchIPCInfo : Component
|
||||||
{
|
{
|
||||||
public Bindable<BeatmapInfo> Beatmap { get; } = new Bindable<BeatmapInfo>();
|
public Bindable<APIBeatmap> Beatmap { get; } = new Bindable<APIBeatmap>();
|
||||||
public Bindable<LegacyMods> Mods { get; } = new Bindable<LegacyMods>();
|
public Bindable<LegacyMods> Mods { get; } = new Bindable<LegacyMods>();
|
||||||
public Bindable<TourneyState> State { get; } = new Bindable<TourneyState>();
|
public Bindable<TourneyState> State { get; } = new Bindable<TourneyState>();
|
||||||
public Bindable<string> ChatChannel { get; } = new Bindable<string>();
|
public Bindable<string> ChatChannel { get; } = new Bindable<string>();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
|
|
||||||
namespace osu.Game.Tournament.Models
|
namespace osu.Game.Tournament.Models
|
||||||
{
|
{
|
||||||
@ -10,6 +10,6 @@ namespace osu.Game.Tournament.Models
|
|||||||
public int ID;
|
public int ID;
|
||||||
public string Mods;
|
public string Mods;
|
||||||
|
|
||||||
public BeatmapInfo BeatmapInfo;
|
public APIBeatmap BeatmapInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +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 osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
|
|
||||||
namespace osu.Game.Tournament.Models
|
namespace osu.Game.Tournament.Models
|
||||||
{
|
{
|
||||||
@ -10,7 +10,7 @@ namespace osu.Game.Tournament.Models
|
|||||||
{
|
{
|
||||||
public int ID;
|
public int ID;
|
||||||
|
|
||||||
public BeatmapInfo BeatmapInfo;
|
public APIBeatmap BeatmapInfo;
|
||||||
|
|
||||||
public long Score;
|
public long Score;
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Beatmaps.Legacy;
|
using osu.Game.Beatmaps.Legacy;
|
||||||
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Tournament.Components;
|
using osu.Game.Tournament.Components;
|
||||||
using osu.Game.Tournament.IPC;
|
using osu.Game.Tournament.IPC;
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ namespace osu.Game.Tournament.Screens
|
|||||||
SongBar.Mods = mods.NewValue;
|
SongBar.Mods = mods.NewValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void beatmapChanged(ValueChangedEvent<BeatmapInfo> beatmap)
|
private void beatmapChanged(ValueChangedEvent<APIBeatmap> beatmap)
|
||||||
{
|
{
|
||||||
SongBar.FadeInFromZero(300, Easing.OutQuint);
|
SongBar.FadeInFromZero(300, Easing.OutQuint);
|
||||||
SongBar.BeatmapInfo = beatmap.NewValue;
|
SongBar.BeatmapInfo = beatmap.NewValue;
|
||||||
|
@ -7,10 +7,10 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Overlays.Settings;
|
using osu.Game.Overlays.Settings;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Tournament.Components;
|
using osu.Game.Tournament.Components;
|
||||||
@ -234,11 +234,11 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = Model.ID });
|
var req = new GetBeatmapRequest(new APIBeatmap { OnlineID = Model.ID });
|
||||||
|
|
||||||
req.Success += res =>
|
req.Success += res =>
|
||||||
{
|
{
|
||||||
Model.BeatmapInfo = res.ToBeatmapInfo(rulesets);
|
Model.BeatmapInfo = res;
|
||||||
updatePanel();
|
updatePanel();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -7,10 +7,10 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Overlays.Settings;
|
using osu.Game.Overlays.Settings;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Tournament.Components;
|
using osu.Game.Tournament.Components;
|
||||||
@ -242,11 +242,11 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = Model.ID });
|
var req = new GetBeatmapRequest(new APIBeatmap { OnlineID = Model.ID });
|
||||||
|
|
||||||
req.Success += res =>
|
req.Success += res =>
|
||||||
{
|
{
|
||||||
Model.BeatmapInfo = res.ToBeatmapInfo(rulesets);
|
Model.BeatmapInfo = res;
|
||||||
updatePanel();
|
updatePanel();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Tournament.Components;
|
using osu.Game.Tournament.Components;
|
||||||
using osu.Game.Tournament.IPC;
|
using osu.Game.Tournament.IPC;
|
||||||
using osu.Game.Tournament.Models;
|
using osu.Game.Tournament.Models;
|
||||||
@ -105,14 +105,14 @@ namespace osu.Game.Tournament.Screens.MapPool
|
|||||||
ipc.Beatmap.BindValueChanged(beatmapChanged);
|
ipc.Beatmap.BindValueChanged(beatmapChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void beatmapChanged(ValueChangedEvent<BeatmapInfo> beatmap)
|
private void beatmapChanged(ValueChangedEvent<APIBeatmap> beatmap)
|
||||||
{
|
{
|
||||||
if (CurrentMatch.Value == null || CurrentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Ban) < 2)
|
if (CurrentMatch.Value == null || CurrentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Ban) < 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// if bans have already been placed, beatmap changes result in a selection being made autoamtically
|
// if bans have already been placed, beatmap changes result in a selection being made autoamtically
|
||||||
if (beatmap.NewValue.OnlineBeatmapID != null)
|
if (beatmap.NewValue.OnlineID > 0)
|
||||||
addForBeatmap(beatmap.NewValue.OnlineBeatmapID.Value);
|
addForBeatmap(beatmap.NewValue.OnlineID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setMode(TeamColour colour, ChoiceType choiceType)
|
private void setMode(TeamColour colour, ChoiceType choiceType)
|
||||||
@ -179,7 +179,7 @@ namespace osu.Game.Tournament.Screens.MapPool
|
|||||||
if (CurrentMatch.Value == null)
|
if (CurrentMatch.Value == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (CurrentMatch.Value.Round.Value.Beatmaps.All(b => b.BeatmapInfo.OnlineBeatmapID != beatmapId))
|
if (CurrentMatch.Value.Round.Value.Beatmaps.All(b => b.BeatmapInfo.OnlineID != beatmapId))
|
||||||
// don't attempt to add if the beatmap isn't in our pool
|
// don't attempt to add if the beatmap isn't in our pool
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ namespace osu.Game.Tournament
|
|||||||
{
|
{
|
||||||
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID });
|
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID });
|
||||||
API.Perform(req);
|
API.Perform(req);
|
||||||
b.BeatmapInfo = req.Response?.ToBeatmapInfo(RulesetStore);
|
b.BeatmapInfo = req.Response;
|
||||||
|
|
||||||
addedInfo = true;
|
addedInfo = true;
|
||||||
}
|
}
|
||||||
@ -211,7 +211,7 @@ namespace osu.Game.Tournament
|
|||||||
{
|
{
|
||||||
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID });
|
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID });
|
||||||
req.Perform(API);
|
req.Perform(API);
|
||||||
b.BeatmapInfo = req.Response?.ToBeatmapInfo(RulesetStore);
|
b.BeatmapInfo = req.Response;
|
||||||
|
|
||||||
addedInfo = true;
|
addedInfo = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user