mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge branch 'master' into new-interfaces
This commit is contained in:
@ -21,22 +21,22 @@ namespace osu.Game.Tournament.Components
|
||||
{
|
||||
public class SongBar : CompositeDrawable
|
||||
{
|
||||
private BeatmapInfo beatmap;
|
||||
private BeatmapInfo beatmapInfo;
|
||||
|
||||
public const float HEIGHT = 145 / 2f;
|
||||
|
||||
[Resolved]
|
||||
private IBindable<RulesetInfo> ruleset { get; set; }
|
||||
|
||||
public BeatmapInfo Beatmap
|
||||
public BeatmapInfo BeatmapInfo
|
||||
{
|
||||
get => beatmap;
|
||||
get => beatmapInfo;
|
||||
set
|
||||
{
|
||||
if (beatmap == value)
|
||||
if (beatmapInfo == value)
|
||||
return;
|
||||
|
||||
beatmap = value;
|
||||
beatmapInfo = value;
|
||||
update();
|
||||
}
|
||||
}
|
||||
@ -95,18 +95,18 @@ namespace osu.Game.Tournament.Components
|
||||
|
||||
private void update()
|
||||
{
|
||||
if (beatmap == null)
|
||||
if (beatmapInfo == null)
|
||||
{
|
||||
flow.Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
var bpm = beatmap.BeatmapSet.OnlineInfo.BPM;
|
||||
var length = beatmap.Length;
|
||||
var bpm = beatmapInfo.BeatmapSet.OnlineInfo.BPM;
|
||||
var length = beatmapInfo.Length;
|
||||
string hardRockExtra = "";
|
||||
string srExtra = "";
|
||||
|
||||
var ar = beatmap.BaseDifficulty.ApproachRate;
|
||||
var ar = beatmapInfo.BaseDifficulty.ApproachRate;
|
||||
|
||||
if ((mods & LegacyMods.HardRock) > 0)
|
||||
{
|
||||
@ -132,9 +132,9 @@ namespace osu.Game.Tournament.Components
|
||||
default:
|
||||
stats = new (string heading, string content)[]
|
||||
{
|
||||
("CS", $"{beatmap.BaseDifficulty.CircleSize:0.#}{hardRockExtra}"),
|
||||
("CS", $"{beatmapInfo.BaseDifficulty.CircleSize:0.#}{hardRockExtra}"),
|
||||
("AR", $"{ar:0.#}{hardRockExtra}"),
|
||||
("OD", $"{beatmap.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}"),
|
||||
("OD", $"{beatmapInfo.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}"),
|
||||
};
|
||||
break;
|
||||
|
||||
@ -142,15 +142,15 @@ namespace osu.Game.Tournament.Components
|
||||
case 3:
|
||||
stats = new (string heading, string content)[]
|
||||
{
|
||||
("OD", $"{beatmap.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}"),
|
||||
("HP", $"{beatmap.BaseDifficulty.DrainRate:0.#}{hardRockExtra}")
|
||||
("OD", $"{beatmapInfo.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}"),
|
||||
("HP", $"{beatmapInfo.BaseDifficulty.DrainRate:0.#}{hardRockExtra}")
|
||||
};
|
||||
break;
|
||||
|
||||
case 2:
|
||||
stats = new (string heading, string content)[]
|
||||
{
|
||||
("CS", $"{beatmap.BaseDifficulty.CircleSize:0.#}{hardRockExtra}"),
|
||||
("CS", $"{beatmapInfo.BaseDifficulty.CircleSize:0.#}{hardRockExtra}"),
|
||||
("AR", $"{ar:0.#}"),
|
||||
};
|
||||
break;
|
||||
@ -186,7 +186,7 @@ namespace osu.Game.Tournament.Components
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new DiffPiece(stats),
|
||||
new DiffPiece(("Star Rating", $"{beatmap.StarDifficulty:0.#}{srExtra}"))
|
||||
new DiffPiece(("Star Rating", $"{beatmapInfo.StarDifficulty:0.#}{srExtra}"))
|
||||
}
|
||||
},
|
||||
new FillFlowContainer
|
||||
@ -229,7 +229,7 @@ namespace osu.Game.Tournament.Components
|
||||
}
|
||||
}
|
||||
},
|
||||
new TournamentBeatmapPanel(beatmap)
|
||||
new TournamentBeatmapPanel(beatmapInfo)
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Width = 0.5f,
|
||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Tournament.Components
|
||||
{
|
||||
public class TournamentBeatmapPanel : CompositeDrawable
|
||||
{
|
||||
public readonly BeatmapInfo Beatmap;
|
||||
public readonly BeatmapInfo BeatmapInfo;
|
||||
private readonly string mod;
|
||||
|
||||
private const float horizontal_padding = 10;
|
||||
@ -32,11 +32,11 @@ namespace osu.Game.Tournament.Components
|
||||
private readonly Bindable<TournamentMatch> currentMatch = new Bindable<TournamentMatch>();
|
||||
private Box flash;
|
||||
|
||||
public TournamentBeatmapPanel(BeatmapInfo beatmap, string mod = null)
|
||||
public TournamentBeatmapPanel(BeatmapInfo beatmapInfo, string mod = null)
|
||||
{
|
||||
if (beatmap == null) throw new ArgumentNullException(nameof(beatmap));
|
||||
if (beatmapInfo == null) throw new ArgumentNullException(nameof(beatmapInfo));
|
||||
|
||||
Beatmap = beatmap;
|
||||
BeatmapInfo = beatmapInfo;
|
||||
this.mod = mod;
|
||||
Width = 400;
|
||||
Height = HEIGHT;
|
||||
@ -61,7 +61,7 @@ namespace osu.Game.Tournament.Components
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = OsuColour.Gray(0.5f),
|
||||
BeatmapSet = Beatmap.BeatmapSet,
|
||||
BeatmapSet = BeatmapInfo.BeatmapSet,
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
@ -75,8 +75,8 @@ namespace osu.Game.Tournament.Components
|
||||
new TournamentSpriteText
|
||||
{
|
||||
Text = new RomanisableString(
|
||||
$"{Beatmap.Metadata.ArtistUnicode ?? Beatmap.Metadata.Artist} - {Beatmap.Metadata.TitleUnicode ?? Beatmap.Metadata.Title}",
|
||||
$"{Beatmap.Metadata.Artist} - {Beatmap.Metadata.Title}"),
|
||||
$"{BeatmapInfo.Metadata.ArtistUnicode ?? BeatmapInfo.Metadata.Artist} - {BeatmapInfo.Metadata.TitleUnicode ?? BeatmapInfo.Metadata.Title}",
|
||||
$"{BeatmapInfo.Metadata.Artist} - {BeatmapInfo.Metadata.Title}"),
|
||||
Font = OsuFont.Torus.With(weight: FontWeight.Bold),
|
||||
},
|
||||
new FillFlowContainer
|
||||
@ -93,7 +93,7 @@ namespace osu.Game.Tournament.Components
|
||||
},
|
||||
new TournamentSpriteText
|
||||
{
|
||||
Text = Beatmap.Metadata.AuthorString,
|
||||
Text = BeatmapInfo.Metadata.AuthorString,
|
||||
Padding = new MarginPadding { Right = 20 },
|
||||
Font = OsuFont.Torus.With(weight: FontWeight.Bold, size: 14)
|
||||
},
|
||||
@ -105,7 +105,7 @@ namespace osu.Game.Tournament.Components
|
||||
},
|
||||
new TournamentSpriteText
|
||||
{
|
||||
Text = Beatmap.Version,
|
||||
Text = BeatmapInfo.Version,
|
||||
Font = OsuFont.Torus.With(weight: FontWeight.Bold, size: 14)
|
||||
},
|
||||
}
|
||||
@ -149,7 +149,7 @@ namespace osu.Game.Tournament.Components
|
||||
|
||||
private void updateState()
|
||||
{
|
||||
var found = currentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == Beatmap.OnlineBeatmapID);
|
||||
var found = currentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == BeatmapInfo.OnlineBeatmapID);
|
||||
|
||||
bool doFlash = found != choice;
|
||||
choice = found;
|
||||
|
@ -94,7 +94,7 @@ namespace osu.Game.Tournament.IPC
|
||||
else
|
||||
{
|
||||
beatmapLookupRequest = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId });
|
||||
beatmapLookupRequest.Success += b => Beatmap.Value = b.ToBeatmap(Rulesets);
|
||||
beatmapLookupRequest.Success += b => Beatmap.Value = b.ToBeatmapInfo(Rulesets);
|
||||
API.Queue(beatmapLookupRequest);
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Tournament.Screens
|
||||
private void beatmapChanged(ValueChangedEvent<BeatmapInfo> beatmap)
|
||||
{
|
||||
SongBar.FadeInFromZero(300, Easing.OutQuint);
|
||||
SongBar.Beatmap = beatmap.NewValue;
|
||||
SongBar.BeatmapInfo = beatmap.NewValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
|
||||
req.Success += res =>
|
||||
{
|
||||
Model.BeatmapInfo = res.ToBeatmap(rulesets);
|
||||
Model.BeatmapInfo = res.ToBeatmapInfo(rulesets);
|
||||
updatePanel();
|
||||
};
|
||||
|
||||
|
@ -246,7 +246,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
|
||||
req.Success += res =>
|
||||
{
|
||||
Model.BeatmapInfo = res.ToBeatmap(rulesets);
|
||||
Model.BeatmapInfo = res.ToBeatmapInfo(rulesets);
|
||||
updatePanel();
|
||||
};
|
||||
|
||||
|
@ -147,11 +147,11 @@ namespace osu.Game.Tournament.Screens.MapPool
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
if (e.Button == MouseButton.Left && map.Beatmap.OnlineBeatmapID != null)
|
||||
addForBeatmap(map.Beatmap.OnlineBeatmapID.Value);
|
||||
if (e.Button == MouseButton.Left && map.BeatmapInfo.OnlineBeatmapID != null)
|
||||
addForBeatmap(map.BeatmapInfo.OnlineBeatmapID.Value);
|
||||
else
|
||||
{
|
||||
var existing = CurrentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == map.Beatmap.OnlineBeatmapID);
|
||||
var existing = CurrentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == map.BeatmapInfo.OnlineBeatmapID);
|
||||
|
||||
if (existing != null)
|
||||
{
|
||||
|
@ -182,7 +182,7 @@ namespace osu.Game.Tournament
|
||||
{
|
||||
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID });
|
||||
API.Perform(req);
|
||||
b.BeatmapInfo = req.Result?.ToBeatmap(RulesetStore);
|
||||
b.BeatmapInfo = req.Result?.ToBeatmapInfo(RulesetStore);
|
||||
|
||||
addedInfo = true;
|
||||
}
|
||||
@ -203,7 +203,7 @@ namespace osu.Game.Tournament
|
||||
{
|
||||
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID });
|
||||
req.Perform(API);
|
||||
b.BeatmapInfo = req.Result?.ToBeatmap(RulesetStore);
|
||||
b.BeatmapInfo = req.Result?.ToBeatmapInfo(RulesetStore);
|
||||
|
||||
addedInfo = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user