mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Implement an intermediary EditRulesetContainer
This commit is contained in:
@ -291,17 +291,7 @@ namespace osu.Game.Rulesets.UI
|
||||
private void loadObjects()
|
||||
{
|
||||
foreach (TObject h in Beatmap.HitObjects)
|
||||
{
|
||||
var drawableObject = GetVisualRepresentation(h);
|
||||
|
||||
if (drawableObject == null)
|
||||
continue;
|
||||
|
||||
drawableObject.OnNewResult += (_, r) => OnNewResult?.Invoke(r);
|
||||
drawableObject.OnRevertResult += (_, r) => OnRevertResult?.Invoke(r);
|
||||
|
||||
Playfield.Add(drawableObject);
|
||||
}
|
||||
AddRepresentation(h);
|
||||
|
||||
Playfield.PostProcess();
|
||||
|
||||
@ -309,6 +299,23 @@ namespace osu.Game.Rulesets.UI
|
||||
mod.ApplyToDrawableHitObjects(Playfield.HitObjectContainer.Objects);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates and adds the visual representation of a <see cref="TObject"/> to this <see cref="RulesetContainer{TObject}"/>.
|
||||
/// </summary>
|
||||
/// <param name="hitObject">The <see cref="TObject"/> to add the visual representation for.</param>
|
||||
internal void AddRepresentation(TObject hitObject)
|
||||
{
|
||||
var drawableObject = GetVisualRepresentation(hitObject);
|
||||
|
||||
if (drawableObject == null)
|
||||
return;
|
||||
|
||||
drawableObject.OnNewResult += (_, r) => OnNewResult?.Invoke(r);
|
||||
drawableObject.OnRevertResult += (_, r) => OnRevertResult?.Invoke(r);
|
||||
|
||||
Playfield.Add(drawableObject);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
@ -334,7 +341,7 @@ namespace osu.Game.Rulesets.UI
|
||||
/// </summary>
|
||||
/// <param name="h">The HitObject to make drawable.</param>
|
||||
/// <returns>The DrawableHitObject.</returns>
|
||||
protected abstract DrawableHitObject<TObject> GetVisualRepresentation(TObject h);
|
||||
public abstract DrawableHitObject<TObject> GetVisualRepresentation(TObject h);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Reference in New Issue
Block a user