mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-05 06:20:10 +00:00
Add NewFrameCommand::onGetFriendlyName() to differentiate "New Empty Frame" from "New Frame"
This commit is contained in:
parent
3ba3b48fd7
commit
bee4e64e38
@ -49,9 +49,10 @@ public:
|
||||
Command* clone() const override { return new NewFrameCommand(*this); }
|
||||
|
||||
protected:
|
||||
void onLoadParams(Params* params);
|
||||
bool onEnabled(Context* context);
|
||||
void onExecute(Context* context);
|
||||
void onLoadParams(Params* params) override;
|
||||
bool onEnabled(Context* context) override;
|
||||
void onExecute(Context* context) override;
|
||||
std::string onGetFriendlyName() const override;
|
||||
|
||||
private:
|
||||
Content m_content;
|
||||
@ -106,6 +107,22 @@ void NewFrameCommand::onExecute(Context* context)
|
||||
App::instance()->getMainWindow()->popTimeline();
|
||||
}
|
||||
|
||||
std::string NewFrameCommand::onGetFriendlyName() const
|
||||
{
|
||||
std::string text = "New Frame";
|
||||
|
||||
switch (m_content) {
|
||||
case Content::CurrentFrame:
|
||||
text = "New Frame (duplicated)";
|
||||
break;
|
||||
case Content::EmptyFrame:
|
||||
text = "New Frame (empty)";
|
||||
break;
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
Command* CommandFactory::createNewFrameCommand()
|
||||
{
|
||||
return new NewFrameCommand;
|
||||
|
Loading…
Reference in New Issue
Block a user