mirror of
https://github.com/osukey/osukey.git
synced 2025-05-24 15:07:20 +09:00
Merge branch 'master' into editor-fix-slider-drag-after-snaking
This commit is contained in:
commit
1b6ef60f36
@ -8,6 +8,7 @@ using osu.Game.Beatmaps;
|
|||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.UI;
|
using osu.Game.Rulesets.Osu.UI;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -20,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
/// Hit objects are intentionally made to fade out at a constant slower rate than in gameplay.
|
/// Hit objects are intentionally made to fade out at a constant slower rate than in gameplay.
|
||||||
/// This allows a mapper to gain better historical context and use recent hitobjects as reference / snap points.
|
/// This allows a mapper to gain better historical context and use recent hitobjects as reference / snap points.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const double editor_hit_object_fade_out_extension = 500;
|
private const double editor_hit_object_fade_out_extension = 700;
|
||||||
|
|
||||||
public DrawableOsuEditRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods)
|
public DrawableOsuEditRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods)
|
||||||
: base(ruleset, beatmap, mods)
|
: base(ruleset, beatmap, mods)
|
||||||
@ -32,11 +33,30 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
|
|
||||||
private void updateState(DrawableHitObject hitObject, ArmedState state)
|
private void updateState(DrawableHitObject hitObject, ArmedState state)
|
||||||
{
|
{
|
||||||
switch (state)
|
if (state == ArmedState.Idle)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// adjust the visuals of certain object types to make them stay on screen for longer than usual.
|
||||||
|
switch (hitObject)
|
||||||
{
|
{
|
||||||
case ArmedState.Miss:
|
default:
|
||||||
|
// there are quite a few drawable hit types we don't want to extent (spinners, ticks etc.)
|
||||||
|
return;
|
||||||
|
|
||||||
|
case DrawableSlider _:
|
||||||
|
// no specifics to sliders but let them fade slower below.
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DrawableHitCircle circle: // also handles slider heads
|
||||||
|
circle.ApproachCircle
|
||||||
|
.FadeOutFromOne(editor_hit_object_fade_out_extension)
|
||||||
|
.Expire();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Get the existing fade out transform
|
// Get the existing fade out transform
|
||||||
var existing = hitObject.Transforms.LastOrDefault(t => t.TargetMember == nameof(Alpha));
|
var existing = hitObject.Transforms.LastOrDefault(t => t.TargetMember == nameof(Alpha));
|
||||||
|
|
||||||
if (existing == null)
|
if (existing == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -44,8 +64,6 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
|
|
||||||
using (hitObject.BeginAbsoluteSequence(existing.StartTime))
|
using (hitObject.BeginAbsoluteSequence(existing.StartTime))
|
||||||
hitObject.FadeOut(editor_hit_object_fade_out_extension).Expire();
|
hitObject.FadeOut(editor_hit_object_fade_out_extension).Expire();
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Playfield CreatePlayfield() => new OsuPlayfieldNoCursor();
|
protected override Playfield CreatePlayfield() => new OsuPlayfieldNoCursor();
|
||||||
|
@ -45,15 +45,21 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
beatmap.HitObjectAdded += addHitObject;
|
beatmap.HitObjectAdded += addHitObject;
|
||||||
|
beatmap.HitObjectUpdated += updateReplay;
|
||||||
beatmap.HitObjectRemoved += removeHitObject;
|
beatmap.HitObjectRemoved += removeHitObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateReplay(HitObject obj = null) =>
|
||||||
|
drawableRuleset.RegenerateAutoplay();
|
||||||
|
|
||||||
private void addHitObject(HitObject hitObject)
|
private void addHitObject(HitObject hitObject)
|
||||||
{
|
{
|
||||||
var drawableObject = drawableRuleset.CreateDrawableRepresentation((TObject)hitObject);
|
var drawableObject = drawableRuleset.CreateDrawableRepresentation((TObject)hitObject);
|
||||||
|
|
||||||
drawableRuleset.Playfield.Add(drawableObject);
|
drawableRuleset.Playfield.Add(drawableObject);
|
||||||
drawableRuleset.Playfield.PostProcess();
|
drawableRuleset.Playfield.PostProcess();
|
||||||
|
|
||||||
|
updateReplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeHitObject(HitObject hitObject)
|
private void removeHitObject(HitObject hitObject)
|
||||||
@ -62,6 +68,8 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
|
|
||||||
drawableRuleset.Playfield.Remove(drawableObject);
|
drawableRuleset.Playfield.Remove(drawableObject);
|
||||||
drawableRuleset.Playfield.PostProcess();
|
drawableRuleset.Playfield.PostProcess();
|
||||||
|
|
||||||
|
drawableRuleset.RegenerateAutoplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool PropagatePositionalInputSubTree => false;
|
public override bool PropagatePositionalInputSubTree => false;
|
||||||
|
@ -76,7 +76,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
drawableRulesetWrapper = new DrawableEditRulesetWrapper<TObject>(CreateDrawableRuleset(Ruleset, EditorBeatmap.PlayableBeatmap))
|
drawableRulesetWrapper = new DrawableEditRulesetWrapper<TObject>(CreateDrawableRuleset(Ruleset, EditorBeatmap.PlayableBeatmap, new[] { Ruleset.GetAutoplayMod() }))
|
||||||
{
|
{
|
||||||
Clock = EditorClock,
|
Clock = EditorClock,
|
||||||
ProcessCustomClock = false
|
ProcessCustomClock = false
|
||||||
|
@ -151,8 +151,11 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
public virtual PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new PlayfieldAdjustmentContainer();
|
public virtual PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new PlayfieldAdjustmentContainer();
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuConfigManager config { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager config, CancellationToken? cancellationToken)
|
private void load(CancellationToken? cancellationToken)
|
||||||
{
|
{
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -178,11 +181,18 @@ namespace osu.Game.Rulesets.UI
|
|||||||
.WithChild(ResumeOverlay)));
|
.WithChild(ResumeOverlay)));
|
||||||
}
|
}
|
||||||
|
|
||||||
applyRulesetMods(Mods, config);
|
RegenerateAutoplay();
|
||||||
|
|
||||||
loadObjects(cancellationToken);
|
loadObjects(cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RegenerateAutoplay()
|
||||||
|
{
|
||||||
|
// for now this is applying mods which aren't just autoplay.
|
||||||
|
// we'll need to reconsider this flow in the future.
|
||||||
|
applyRulesetMods(Mods, config);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates and adds drawable representations of hit objects to the play field.
|
/// Creates and adds drawable representations of hit objects to the play field.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -212,6 +212,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
if (blueprint != null)
|
if (blueprint != null)
|
||||||
{
|
{
|
||||||
|
// doing this post-creations as adding the default hit sample should be the case regardless of the ruleset.
|
||||||
|
blueprint.HitObject.Samples.Add(new HitSampleInfo { Name = HitSampleInfo.HIT_NORMAL });
|
||||||
|
|
||||||
placementBlueprintContainer.Child = currentPlacement = blueprint;
|
placementBlueprintContainer.Child = currentPlacement = blueprint;
|
||||||
|
|
||||||
// Fixes a 1-frame position discrepancy due to the first mouse move event happening in the next frame
|
// Fixes a 1-frame position discrepancy due to the first mouse move event happening in the next frame
|
||||||
|
Loading…
x
Reference in New Issue
Block a user