New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement an interface for moving hitobjects in the editor #2195

Merged
merged 13 commits into from Mar 14, 2018

Conversation

2 participants
@smoogipoo
Contributor

smoogipoo commented Mar 9, 2018

Prereqs:

Very basic initial implementation. More work to be done (snapping, etc). I've moved SelectionOverlay (previous: CaptureBox) out into the HitObjectOverlayLayer to allow it to be overridden and provide different anchor points/movement implementations in the future/possibly handle snapping itself.

@smoogipoo smoogipoo added the editor label Mar 9, 2018

@smoogipoo smoogipoo added this to the March 2018 milestone Mar 9, 2018

smoogipoo and others added some commits Mar 9, 2018

namespace osu.Game.Rulesets.Edit.Types
{
public interface IHasEditablePosition

This comment has been minimized.

@peppy

peppy Mar 10, 2018

Member

this should probably derive from IHasPosition and maybe expose Postiion's Set

This comment has been minimized.

@smoogipoo

smoogipoo Mar 12, 2018

Contributor

I didn't want to expose Position's setter because it's super hard to control the logic for slider circles - consider that Position is set when loading the beatmap...

@@ -15,15 +18,13 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
/// <summary>
/// A box which encloses <see cref="DrawableHitObject"/>s.
/// </summary>
public class CaptureBox : VisibilityContainer
public class SelectionOverlay : VisibilityContainer

This comment has been minimized.

@peppy

peppy Mar 10, 2018

Member

does this change name in the future PR? what does it become, if so (if it does, i'd prefer not renaming it here).

This comment has been minimized.

@smoogipoo

smoogipoo Mar 12, 2018

Contributor

It remains as SelectionOverlay

This comment has been minimized.

@smoogipoo

smoogipoo Mar 12, 2018

Contributor

Seeing as the "future PR" is not PR'd yet, consider this as it is within the context of this PR, plz.

This comment has been minimized.

@peppy

peppy Mar 12, 2018

Member

you said in the description to ignore naming :| which one?

This comment has been minimized.

@smoogipoo

smoogipoo Mar 12, 2018

Contributor

removed from pr description

@@ -60,6 +68,27 @@ private void load(OsuColour colours)
Position = topLeft;
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;

This comment has been minimized.

@peppy

peppy Mar 10, 2018

Member

I'd probably add

public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => overlays.Any(o => o.IsHovered);

to this class

This comment has been minimized.

@smoogipoo

smoogipoo Mar 12, 2018

Contributor

Nah, because you should be able to select a group of objects and click-drag anywhere in the selection box to move them. It feels super bad otherwise - might as well not have the box in the first place.

This comment has been minimized.

@peppy

peppy Mar 12, 2018

Member

hmm, this makes it very awkward to make new selections. we may want to reconsider the visuals of the box to make this not the case, because i believe we want the behaviour i mention instead (give it a try, it definitely feels better when editing, and is how the stable editor works).

@peppy

peppy approved these changes Mar 14, 2018

@peppy

This comment has been minimized.

Member

peppy commented Mar 14, 2018

Last commit was pair coding with @smoogipoo, mutually agreed namespace/organisational changes.

@peppy peppy merged commit edd053f into ppy:master Mar 14, 2018

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@smoogipoo smoogipoo deleted the smoogipoo:editor-hitobject-movement branch Jun 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment