2015-02-12 23:16:25 +08:00
|
|
|
// Aseprite
|
|
|
|
// Copyright (C) 2001-2015 David Capello
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License version 2 as
|
|
|
|
// published by the Free Software Foundation.
|
2014-05-08 19:47:45 +08:00
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "app/app.h"
|
|
|
|
#include "app/commands/command.h"
|
|
|
|
#include "app/context.h"
|
2014-09-09 10:08:06 +08:00
|
|
|
#include "app/document.h"
|
2014-05-08 19:47:45 +08:00
|
|
|
#include "app/settings/document_settings.h"
|
|
|
|
#include "app/settings/settings.h"
|
|
|
|
|
|
|
|
namespace app {
|
|
|
|
|
|
|
|
using namespace gfx;
|
|
|
|
|
|
|
|
class ShowOnionSkinCommand : public Command {
|
|
|
|
public:
|
|
|
|
ShowOnionSkinCommand()
|
|
|
|
: Command("ShowOnionSkin",
|
|
|
|
"Show Onion Skin",
|
|
|
|
CmdUIOnlyFlag)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-08-15 10:07:47 +08:00
|
|
|
Command* clone() const override { return new ShowOnionSkinCommand(*this); }
|
2014-05-08 19:47:45 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool onChecked(Context* context)
|
|
|
|
{
|
2014-07-29 11:53:24 +08:00
|
|
|
IDocumentSettings* docSettings = context->settings()->getDocumentSettings(context->activeDocument());
|
2014-05-08 19:47:45 +08:00
|
|
|
|
|
|
|
return docSettings->getUseOnionskin();
|
|
|
|
}
|
|
|
|
|
|
|
|
void onExecute(Context* context)
|
|
|
|
{
|
2014-07-29 11:53:24 +08:00
|
|
|
IDocumentSettings* docSettings = context->settings()->getDocumentSettings(context->activeDocument());
|
2014-05-08 19:47:45 +08:00
|
|
|
|
|
|
|
docSettings->setUseOnionskin(docSettings->getUseOnionskin() ? false: true);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
Command* CommandFactory::createShowOnionSkinCommand()
|
|
|
|
{
|
|
|
|
return new ShowOnionSkinCommand;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace app
|