mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-01 18:00:26 +00:00
Add GotoFirst/LastFrameInTag commands
This commit is contained in:
parent
88acf951cc
commit
967c819a18
@ -780,6 +780,9 @@
|
||||
<item command="GotoNextFrame" text="@.frame_jump_to_next_frame" />
|
||||
<item command="GotoLastFrame" text="@.frame_jump_to_last_frame" />
|
||||
<separator />
|
||||
<item command="GotoFirstFrameInTag" text="@.frame_jump_to_first_frame_in_tag" />
|
||||
<item command="GotoLastFrameInTag" text="@.frame_jump_to_last_frame_in_tag" />
|
||||
<separator />
|
||||
<item command="GotoFrame" text="@.frame_go_to_frame" />
|
||||
</menu>
|
||||
<item command="PlayAnimation" text="@.frame_play_animation" />
|
||||
|
@ -263,8 +263,10 @@ FrameProperties = Frame Properties
|
||||
FrameTagProperties = Frame Tag Properties
|
||||
FullscreenPreview = Fullscreen Preview
|
||||
GotoFirstFrame = Go to First Frame
|
||||
GotoFirstFrameInTag = Go to First Frame In Tag
|
||||
GotoFrame = Go to Frame
|
||||
GotoLastFrame = Go to Last Frame
|
||||
GotoLastFrameInTag = Go to Last Frame In Tag
|
||||
GotoNextFrame = Go to Next Frame
|
||||
GotoNextFrameWithSameTag = Go to Next Frame with same tag
|
||||
GotoNextLayer = Go to Next Layer
|
||||
@ -756,6 +758,8 @@ frame_jump_to_first_frame = &First Frame
|
||||
frame_jump_to_previous_frame = &Previous Frame
|
||||
frame_jump_to_next_frame = &Next Frame
|
||||
frame_jump_to_last_frame = &Last Frame
|
||||
frame_jump_to_first_frame_in_tag = First Frame In Tag
|
||||
frame_jump_to_last_frame_in_tag = Last Frame In Tag
|
||||
frame_go_to_frame = &Go to Frame
|
||||
frame_play_animation = &Play Animation
|
||||
frame_constant_frame_rate = Constant Frame Rate
|
||||
|
@ -59,6 +59,23 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
class GotoFirstFrameInTagCommand : public GotoCommand {
|
||||
public:
|
||||
GotoFirstFrameInTagCommand()
|
||||
: GotoCommand(CommandId::GotoFirstFrameInTag()) { }
|
||||
Command* clone() const override { return new GotoFirstFrameInTagCommand(*this); }
|
||||
|
||||
protected:
|
||||
frame_t onGetFrame(Editor* editor) override {
|
||||
frame_t frame = editor->frame();
|
||||
FrameTag* tag = editor
|
||||
->getCustomizationDelegate()
|
||||
->getFrameTagProvider()
|
||||
->getFrameTagByFrame(frame, false);
|
||||
return (tag ? tag->fromFrame(): 0);
|
||||
}
|
||||
};
|
||||
|
||||
class GotoPreviousFrameCommand : public GotoCommand {
|
||||
public:
|
||||
GotoPreviousFrameCommand()
|
||||
@ -137,6 +154,23 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
class GotoLastFrameInTagCommand : public GotoCommand {
|
||||
public:
|
||||
GotoLastFrameInTagCommand()
|
||||
: GotoCommand(CommandId::GotoLastFrameInTag()) { }
|
||||
Command* clone() const override { return new GotoLastFrameInTagCommand(*this); }
|
||||
|
||||
protected:
|
||||
frame_t onGetFrame(Editor* editor) override {
|
||||
frame_t frame = editor->frame();
|
||||
FrameTag* tag = editor
|
||||
->getCustomizationDelegate()
|
||||
->getFrameTagProvider()
|
||||
->getFrameTagByFrame(frame, false);
|
||||
return (tag ? tag->toFrame(): editor->sprite()->lastFrame());
|
||||
}
|
||||
};
|
||||
|
||||
class GotoFrameCommand : public GotoCommand {
|
||||
public:
|
||||
GotoFrameCommand() : GotoCommand(CommandId::GotoFrame())
|
||||
@ -243,6 +277,11 @@ Command* CommandFactory::createGotoFirstFrameCommand()
|
||||
return new GotoFirstFrameCommand;
|
||||
}
|
||||
|
||||
Command* CommandFactory::createGotoFirstFrameInTagCommand()
|
||||
{
|
||||
return new GotoFirstFrameInTagCommand;
|
||||
}
|
||||
|
||||
Command* CommandFactory::createGotoPreviousFrameCommand()
|
||||
{
|
||||
return new GotoPreviousFrameCommand;
|
||||
@ -258,6 +297,11 @@ Command* CommandFactory::createGotoLastFrameCommand()
|
||||
return new GotoLastFrameCommand;
|
||||
}
|
||||
|
||||
Command* CommandFactory::createGotoLastFrameInTagCommand()
|
||||
{
|
||||
return new GotoLastFrameInTagCommand;
|
||||
}
|
||||
|
||||
Command* CommandFactory::createGotoNextFrameWithSameTagCommand()
|
||||
{
|
||||
return new GotoNextFrameWithSameTagCommand;
|
||||
|
@ -60,8 +60,10 @@ FOR_EACH_COMMAND(FrameProperties)
|
||||
FOR_EACH_COMMAND(FrameTagProperties)
|
||||
FOR_EACH_COMMAND(FullscreenPreview)
|
||||
FOR_EACH_COMMAND(GotoFirstFrame)
|
||||
FOR_EACH_COMMAND(GotoFirstFrameInTag)
|
||||
FOR_EACH_COMMAND(GotoFrame)
|
||||
FOR_EACH_COMMAND(GotoLastFrame)
|
||||
FOR_EACH_COMMAND(GotoLastFrameInTag)
|
||||
FOR_EACH_COMMAND(GotoNextFrame)
|
||||
FOR_EACH_COMMAND(GotoNextFrameWithSameTag)
|
||||
FOR_EACH_COMMAND(GotoNextLayer)
|
||||
|
Loading…
Reference in New Issue
Block a user