-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat.more-keybinds' of https://github.com/zacharied/Ong…
…ekiFumenEditor into batch_mode # Conflicts: # OngekiFumenEditor/Properties/Resources.Designer.cs
- Loading branch information
Showing
24 changed files
with
226 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
OngekiFumenEditor/Modules/FumenVisualEditor/Behaviors/BatchMode/BatchModeCommandHandlers.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System; | ||
using System.ComponentModel.Composition; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms.VisualStyles; | ||
using System.Windows.Input; | ||
using Caliburn.Micro; | ||
using Gemini.Framework.Commands; | ||
using OngekiFumenEditor.Kernel.KeyBinding; | ||
using OngekiFumenEditor.Modules.FumenVisualEditor.Kernel; | ||
using OngekiFumenEditor.Utils; | ||
|
||
namespace OngekiFumenEditor.Modules.FumenVisualEditor.Behaviors.BatchMode; | ||
|
||
public abstract class BatchModeSubmodeCommandHandler<TCommandDefinition> : CommandHandlerBase<TCommandDefinition> | ||
where TCommandDefinition : BatchModeSubmode | ||
{ | ||
private IEditorDocumentManager Editor; | ||
private BatchModeSubmode Submode; | ||
|
||
public BatchModeSubmodeCommandHandler() | ||
{ | ||
Editor = IoC.Get<IEditorDocumentManager>(); | ||
Submode = BatchModeBehavior.Submodes.OfType<TCommandDefinition>().Single(); | ||
} | ||
|
||
public override void Update(Command command) | ||
{ | ||
base.Update(command); | ||
|
||
if (Editor.CurrentActivatedEditor is not null && Editor.CurrentActivatedEditor.IsBatchMode) { | ||
command.Enabled = true; | ||
command.Checked = Editor.CurrentActivatedEditor.BatchModeBehavior.CurrentSubmode == Submode; | ||
} | ||
else { | ||
command.Enabled = false; | ||
command.Checked = false; | ||
} | ||
} | ||
|
||
public override Task Run(Command command) | ||
{ | ||
Editor.CurrentActivatedEditor.BatchModeBehavior.CurrentSubmode = Submode; | ||
return Task.CompletedTask; | ||
} | ||
} | ||
|
||
[CommandHandler] public class BatchModeLaneLeftCommandHandler : BatchModeSubmodeCommandHandler<BatchModeInputLaneLeft>; | ||
[CommandHandler] public class BatchModeLaneCenterCommandHandler : BatchModeSubmodeCommandHandler<BatchModeInputLaneCenter>; | ||
[CommandHandler] public class BatchModeLaneRightCommandHandler : BatchModeSubmodeCommandHandler<BatchModeInputLaneRight>; | ||
[CommandHandler] public class BatchModeWallLeftCommandHandler : BatchModeSubmodeCommandHandler<BatchModeInputWallLeft>; | ||
[CommandHandler] public class BatchModeWallRightCommandHandler : BatchModeSubmodeCommandHandler<BatchModeInputWallRight>; | ||
[CommandHandler] public class BatchModeLaneColorfulCommandHandler : BatchModeSubmodeCommandHandler<BatchModeInputLaneColorful>; | ||
[CommandHandler] public class BatchModeTapCommandHandler : BatchModeSubmodeCommandHandler<BatchModeInputTap>; | ||
[CommandHandler] public class BatchModeHoldCommandHandler : BatchModeSubmodeCommandHandler<BatchModeInputHold>; | ||
[CommandHandler] public class BatchModeFlickCommandHandler : BatchModeSubmodeCommandHandler<BatchModeInputFlick>; | ||
[CommandHandler] public class BatchModeBellCommandHandler : BatchModeSubmodeCommandHandler<BatchModeInputNormalBell>; | ||
[CommandHandler] public class BatchModeLaneBlockCommandHandler : BatchModeSubmodeCommandHandler<BatchModeInputLaneBlock>; | ||
[CommandHandler] public class BatchModeClipboardCommandHandler : BatchModeSubmodeCommandHandler<BatchModeInputClipboard>; | ||
[CommandHandler] public class BatchModeFilterLanesCommandHandler : BatchModeSubmodeCommandHandler<BatchModeFilterLanes>; | ||
[CommandHandler] public class BatchModeFilterDockableObjectsCommandHandler : BatchModeSubmodeCommandHandler<BatchModeFilterDockableObjects>; | ||
[CommandHandler] public class BatchModeFilterFloatingObjectsCommandHandler : BatchModeSubmodeCommandHandler<BatchModeFilterFloatingObjects>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.