mirror of
https://github.com/ppy/osu
synced 2025-03-22 19:06:58 +00:00
Marker* -> Handle
This commit is contained in:
parent
3999940538
commit
09c51df2bd
@ -15,32 +15,32 @@ using OpenTK.Graphics;
|
|||||||
namespace osu.Game.Rulesets.Edit.Layers.Selection
|
namespace osu.Game.Rulesets.Edit.Layers.Selection
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a marker visible on the border of a <see cref="MarkerContainer"/> which exposes
|
/// Represents a marker visible on the border of a <see cref="HandleContainer"/> which exposes
|
||||||
/// properties that are used to resize a <see cref="HitObjectSelectionBox"/>.
|
/// properties that are used to resize a <see cref="HitObjectSelectionBox"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Marker : CompositeDrawable
|
public class Handle : CompositeDrawable
|
||||||
{
|
{
|
||||||
private const float marker_size = 10;
|
private const float marker_size = 10;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked when this <see cref="Marker"/> requires the current drag rectangle.
|
/// Invoked when this <see cref="Handle"/> requires the current drag rectangle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Func<RectangleF> GetDragRectangle;
|
public Func<RectangleF> GetDragRectangle;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked when this <see cref="Marker"/> wants to update the drag rectangle.
|
/// Invoked when this <see cref="Handle"/> wants to update the drag rectangle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Action<RectangleF> UpdateDragRectangle;
|
public Action<RectangleF> UpdateDragRectangle;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked when this <see cref="Marker"/> has finished updates to the drag rectangle.
|
/// Invoked when this <see cref="Handle"/> has finished updates to the drag rectangle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Action FinishCapture;
|
public Action FinishCapture;
|
||||||
|
|
||||||
private Color4 normalColour;
|
private Color4 normalColour;
|
||||||
private Color4 hoverColour;
|
private Color4 hoverColour;
|
||||||
|
|
||||||
public Marker()
|
public Handle()
|
||||||
{
|
{
|
||||||
Size = new Vector2(marker_size);
|
Size = new Vector2(marker_size);
|
||||||
|
|
@ -11,77 +11,77 @@ using osu.Framework.Graphics.Primitives;
|
|||||||
namespace osu.Game.Rulesets.Edit.Layers.Selection
|
namespace osu.Game.Rulesets.Edit.Layers.Selection
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A <see cref="CompositeDrawable"/> that has <see cref="Marker"/>s around its border.
|
/// A <see cref="CompositeDrawable"/> that has <see cref="Handle"/>s around its border.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MarkerContainer : CompositeDrawable
|
public class HandleContainer : CompositeDrawable
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked when a <see cref="Marker"/> requires the current drag rectangle.
|
/// Invoked when a <see cref="Handle"/> requires the current drag rectangle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Func<RectangleF> GetDragRectangle;
|
public Func<RectangleF> GetDragRectangle;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked when a <see cref="Marker"/> wants to update the drag rectangle.
|
/// Invoked when a <see cref="Handle"/> wants to update the drag rectangle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Action<RectangleF> UpdateDragRectangle;
|
public Action<RectangleF> UpdateDragRectangle;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked when a <see cref="Marker"/> has finished updates to the drag rectangle.
|
/// Invoked when a <see cref="Handle"/> has finished updates to the drag rectangle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Action FinishCapture;
|
public Action FinishCapture;
|
||||||
|
|
||||||
public MarkerContainer()
|
public HandleContainer()
|
||||||
{
|
{
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new Marker
|
new Handle
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopLeft,
|
Anchor = Anchor.TopLeft,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
},
|
},
|
||||||
new Marker
|
new Handle
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
},
|
},
|
||||||
new Marker
|
new Handle
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
},
|
},
|
||||||
new Marker
|
new Handle
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
},
|
},
|
||||||
new Marker
|
new Handle
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
},
|
},
|
||||||
new Marker
|
new Handle
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreRight,
|
Anchor = Anchor.CentreRight,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
},
|
},
|
||||||
new Marker
|
new Handle
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
},
|
},
|
||||||
new Marker
|
new Handle
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomCentre,
|
Anchor = Anchor.BottomCentre,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
},
|
},
|
||||||
new CentreMarker
|
new OriginHandle
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
InternalChildren.OfType<Marker>().ForEach(m =>
|
InternalChildren.OfType<Handle>().ForEach(m =>
|
||||||
{
|
{
|
||||||
m.GetDragRectangle = () => GetDragRectangle();
|
m.GetDragRectangle = () => GetDragRectangle();
|
||||||
m.UpdateDragRectangle = r => UpdateDragRectangle(r);
|
m.UpdateDragRectangle = r => UpdateDragRectangle(r);
|
@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
|
|||||||
|
|
||||||
private readonly Container borderMask;
|
private readonly Container borderMask;
|
||||||
private readonly Drawable background;
|
private readonly Drawable background;
|
||||||
private readonly MarkerContainer markers;
|
private readonly HandleContainer handles;
|
||||||
|
|
||||||
private Color4 captureFinishedColour;
|
private Color4 captureFinishedColour;
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
markers = new MarkerContainer
|
handles = new HandleContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
@ -159,7 +159,7 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
|
|||||||
|
|
||||||
// Transform into markers to let the user modify the drag selection further.
|
// Transform into markers to let the user modify the drag selection further.
|
||||||
background.Delay(50).FadeOut(200);
|
background.Delay(50).FadeOut(200);
|
||||||
markers.FadeIn(200);
|
handles.FadeIn(200);
|
||||||
|
|
||||||
Selection.Value = new SelectionInfo
|
Selection.Value = new SelectionInfo
|
||||||
{
|
{
|
||||||
|
@ -11,14 +11,14 @@ using OpenTK;
|
|||||||
namespace osu.Game.Rulesets.Edit.Layers.Selection
|
namespace osu.Game.Rulesets.Edit.Layers.Selection
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the centre of a <see cref="MarkerContainer"/>.
|
/// Represents the origin of a <see cref="HandleContainer"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CentreMarker : CompositeDrawable
|
public class OriginHandle : CompositeDrawable
|
||||||
{
|
{
|
||||||
private const float marker_size = 10;
|
private const float marker_size = 10;
|
||||||
private const float line_width = 2;
|
private const float line_width = 2;
|
||||||
|
|
||||||
public CentreMarker()
|
public OriginHandle()
|
||||||
{
|
{
|
||||||
Size = new Vector2(marker_size);
|
Size = new Vector2(marker_size);
|
||||||
|
|
@ -307,10 +307,10 @@
|
|||||||
<Compile Include="Overlays\Profile\Sections\Ranks\DrawableTotalScore.cs" />
|
<Compile Include="Overlays\Profile\Sections\Ranks\DrawableTotalScore.cs" />
|
||||||
<Compile Include="Overlays\Profile\Sections\Ranks\ScoreModsContainer.cs" />
|
<Compile Include="Overlays\Profile\Sections\Ranks\ScoreModsContainer.cs" />
|
||||||
<Compile Include="Overlays\Settings\SettingsButton.cs" />
|
<Compile Include="Overlays\Settings\SettingsButton.cs" />
|
||||||
<Compile Include="Rulesets\Edit\Layers\Selection\CentreMarker.cs" />
|
<Compile Include="Rulesets\Edit\Layers\Selection\OriginHandle.cs" />
|
||||||
<Compile Include="Rulesets\Edit\Layers\Selection\HitObjectSelectionBox.cs" />
|
<Compile Include="Rulesets\Edit\Layers\Selection\HitObjectSelectionBox.cs" />
|
||||||
<Compile Include="Rulesets\Edit\Layers\Selection\Marker.cs" />
|
<Compile Include="Rulesets\Edit\Layers\Selection\Handle.cs" />
|
||||||
<Compile Include="Rulesets\Edit\Layers\Selection\MarkerContainer.cs" />
|
<Compile Include="Rulesets\Edit\Layers\Selection\HandleContainer.cs" />
|
||||||
<Compile Include="Rulesets\Edit\Layers\Selection\SelectionInfo.cs" />
|
<Compile Include="Rulesets\Edit\Layers\Selection\SelectionInfo.cs" />
|
||||||
<Compile Include="Rulesets\Edit\Layers\Selection\SelectionLayer.cs" />
|
<Compile Include="Rulesets\Edit\Layers\Selection\SelectionLayer.cs" />
|
||||||
<Compile Include="Screens\Edit\Components\BottomBarContainer.cs" />
|
<Compile Include="Screens\Edit\Components\BottomBarContainer.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user