Skip to content

Commit 91260f0

Browse files
committed
Add keybind to swap flick direction
1 parent 771fa0f commit 91260f0

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

OngekiFumenEditor/Modules/FumenVisualEditor/ViewModels/FumenVisualEditorViewModel.UserInteractionActions.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,28 @@ public void KeyboardAction_FastSetObjectIsCritical(ActionExecutionContext e)
605605
}));
606606
}
607607

608+
public void KeyboardAction_FastSwitchFlickDirection(ActionExecutionContext e)
609+
{
610+
var selectedFlicks = SelectObjects.OfType<Flick>().ToList();
611+
612+
if (selectedFlicks.Count == 0)
613+
{
614+
ToastNotify(Resources.NoFlickCouldBeSwitched);
615+
return;
616+
}
617+
618+
UndoRedoManager.ExecuteAction(LambdaUndoAction.Create(Resources.BatchSwitchFlickDirection, ChangeFlicks, ChangeFlicks));
619+
return;
620+
621+
void ChangeFlicks()
622+
{
623+
foreach (var flick in selectedFlicks)
624+
flick.Direction = flick.Direction == Flick.FlickDirection.Left
625+
? Flick.FlickDirection.Right
626+
: Flick.FlickDirection.Left;
627+
}
628+
}
629+
608630
public bool CheckAndNotifyIfPlaceBeyondDuration(Point placePoint)
609631
{
610632
if (placePoint.Y > TotalDurationHeight || placePoint.Y < 0)

OngekiFumenEditor/Modules/FumenVisualEditor/Views/FumenVisualEditorView.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
xmlns:sys="clr-namespace:System;assembly=mscorlib"
1717
xmlns:valueconverters="clr-namespace:OngekiFumenEditor.UI.ValueConverters"
1818
xmlns:viewmodels="clr-namespace:OngekiFumenEditor.Modules.FumenVisualEditor.ViewModels"
19-
cal:Message.Attach="[Key OemTilde] = [Action KeyboardAction_FastPlaceDockableObjectToWallLeft]; [Key D4] = [Action KeyboardAction_FastPlaceDockableObjectToWallRight]; [Key D3] = [Action KeyboardAction_FastPlaceDockableObjectToRight]; [Key D2] = [Action KeyboardAction_FastPlaceDockableObjectToCenter]; [Key D1] = [Action KeyboardAction_FastPlaceDockableObjectToLeft]; [Event DragEnter] = [Action Grid_DragEnter($executionContext)]; [Event Drop] = [Action Grid_Drop($executionContext)]; [Event FocusableChanged] = [Action OnFocusableChanged($executionContext)]; [Key Delete] = [Action KeyboardAction_DeleteSelectingObjects]; [Gesture Ctrl+A] = [Action KeyboardAction_SelectAllObjects]; [Key Escape] = [Action KeyboardAction_CancelSelectingObjects]; [Key C] = [Action KeyboardAction_FastSetObjectIsCritical($executionContext)]; [Key Q] = [Action KeyboardAction_HideOrShow];[Key A] = [Action KeyboardAction_FastAddConnectableChild($executionContext)]; [Gesture Ctrl+C]=[Action MenuItemAction_CopySelectedObjects]; [Gesture Ctrl+V]=[Action MenuItemAction_PasteCopiesObjects]; "
19+
cal:Message.Attach="[Key OemTilde] = [Action KeyboardAction_FastPlaceDockableObjectToWallLeft]; [Key D4] = [Action KeyboardAction_FastPlaceDockableObjectToWallRight]; [Key D3] = [Action KeyboardAction_FastPlaceDockableObjectToRight]; [Key D2] = [Action KeyboardAction_FastPlaceDockableObjectToCenter]; [Key D1] = [Action KeyboardAction_FastPlaceDockableObjectToLeft]; [Event DragEnter] = [Action Grid_DragEnter($executionContext)]; [Event Drop] = [Action Grid_Drop($executionContext)]; [Event FocusableChanged] = [Action OnFocusableChanged($executionContext)]; [Key Delete] = [Action KeyboardAction_DeleteSelectingObjects]; [Gesture Ctrl+A] = [Action KeyboardAction_SelectAllObjects]; [Key Escape] = [Action KeyboardAction_CancelSelectingObjects]; [Key C] = [Action KeyboardAction_FastSetObjectIsCritical($executionContext)]; [Key Q] = [Action KeyboardAction_HideOrShow];[Key A] = [Action KeyboardAction_FastAddConnectableChild($executionContext)]; [Key F] = [Action KeyboardAction_FastSwitchFlickDirection($executionContext)]; [Gesture Ctrl+C]=[Action MenuItemAction_CopySelectedObjects]; [Gesture Ctrl+V]=[Action MenuItemAction_PasteCopiesObjects]; "
2020
d:DataContext="{d:DesignInstance Type=viewmodels:FumenVisualEditorViewModel}"
2121
d:DesignHeight="450"
2222
d:DesignWidth="800"

OngekiFumenEditor/Properties/Resources.Designer.cs

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

OngekiFumenEditor/Properties/Resources.resx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@
216216
<data name="BatchSetIsCritical" xml:space="preserve">
217217
<value>Batch set property IsCritical</value>
218218
</data>
219+
<data name="BatchSwitchFlickDirection" xml:space="preserve">
220+
<value>Batch switch flick direction</value>
221+
</data>
219222
<data name="BeatSplit" xml:space="preserve">
220223
<value>Subdivision multiplier for the meter:</value>
221224
</data>
@@ -1005,6 +1008,9 @@
10051008
<data name="NoObjectCouldBeSetIsCritical" xml:space="preserve">
10061009
<value>No suitable objects to setting property IsCritical</value>
10071010
</data>
1011+
<data name="NoFlickCouldBeSwitched" xml:space="preserve">
1012+
<value>No flicks to switch in selection</value>
1013+
</data>
10081014
<data name="NotInterpolatedCurve" xml:space="preserve">
10091015
<value>The curve lane has not been interpolated yet</value>
10101016
</data>

0 commit comments

Comments
 (0)