mirror of
https://github.com/ppy/osu.git
synced 2024-11-15 17:57:29 +08:00
Remove 'Centre on selected object' button
This commit is contained in:
parent
f8397cccc7
commit
4959045851
@ -16,7 +16,6 @@ using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Graphics.UserInterfaceV2;
|
||||
using osu.Game.Input.Bindings;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Osu.UI;
|
||||
using osu.Game.Screens.Edit;
|
||||
using osu.Game.Screens.Edit.Components.RadioButtons;
|
||||
@ -88,7 +87,6 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
private ExpandableSlider<float> spacingSlider = null!;
|
||||
private ExpandableSlider<float> gridLinesRotationSlider = null!;
|
||||
private RoundedButton gridFromPointsButton = null!;
|
||||
private ExpandableButton useSelectedObjectPositionButton = null!;
|
||||
private EditorRadioButtonCollection gridTypeButtons = null!;
|
||||
|
||||
public event Action? GridFromPointsClicked;
|
||||
@ -135,19 +133,6 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
Current = StartPositionY,
|
||||
KeyboardStep = 1,
|
||||
},
|
||||
useSelectedObjectPositionButton = new ExpandableButton
|
||||
{
|
||||
ExpandedLabelText = "Centre on selected object",
|
||||
Action = () =>
|
||||
{
|
||||
if (editorBeatmap.SelectedHitObjects.Count != 1)
|
||||
return;
|
||||
|
||||
StartPosition.Value = ((IHasPosition)editorBeatmap.SelectedHitObjects.Single()).Position;
|
||||
updateEnabledStates();
|
||||
},
|
||||
RelativeSizeAxes = Axes.X,
|
||||
},
|
||||
spacingSlider = new ExpandableSlider<float>
|
||||
{
|
||||
Current = Spacing,
|
||||
@ -260,25 +245,15 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
}
|
||||
}, true);
|
||||
|
||||
editorBeatmap.BeatmapReprocessed += updateEnabledStates;
|
||||
editorBeatmap.SelectedHitObjects.BindCollectionChanged((_, _) => updateEnabledStates());
|
||||
expandingContainer?.Expanded.BindValueChanged(v =>
|
||||
{
|
||||
gridFromPointsButton.FadeTo(v.NewValue ? 1f : 0f, 500, Easing.OutQuint);
|
||||
gridFromPointsButton.BypassAutoSizeAxes = !v.NewValue ? Axes.Y : Axes.None;
|
||||
gridTypeButtons.FadeTo(v.NewValue ? 1f : 0f, 500, Easing.OutQuint);
|
||||
gridTypeButtons.BypassAutoSizeAxes = !v.NewValue ? Axes.Y : Axes.None;
|
||||
updateEnabledStates();
|
||||
}, true);
|
||||
}
|
||||
|
||||
private void updateEnabledStates()
|
||||
{
|
||||
useSelectedObjectPositionButton.Enabled.Value = expandingContainer?.Expanded.Value == true
|
||||
&& editorBeatmap.SelectedHitObjects.Count == 1
|
||||
&& StartPosition.Value != ((IHasPosition)editorBeatmap.SelectedHitObjects.Single()).Position;
|
||||
}
|
||||
|
||||
private float normalizeRotation(float rotation, float period)
|
||||
{
|
||||
return ((rotation + 360 + period * 0.5f) % period) - period * 0.5f;
|
||||
|
Loading…
Reference in New Issue
Block a user