mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-29 09:23:32 +00:00
Export AniDir field for FrameTags in JSON meta attribute
This commit is contained in:
parent
4dbee12789
commit
2d2434daea
@ -697,9 +697,11 @@ void DocumentExporter::createDataFile(const Samples& samples, std::ostream& os,
|
||||
firstTag = false;
|
||||
else
|
||||
os << ",";
|
||||
|
||||
os << "\n { \"name\": \"" << escape_for_json(tag->name()) << "\","
|
||||
<< " \"from\": " << tag->fromFrame() << ","
|
||||
<< " \"to\": " << tag->toFrame() << " }";
|
||||
<< " \"to\": " << tag->toFrame() << ","
|
||||
<< " \"direction\": \"" << escape_for_json(convert_to_string(tag->aniDir())) << "\" }";
|
||||
}
|
||||
}
|
||||
os << "\n ]";
|
||||
|
@ -11,6 +11,7 @@ add_library(doc-lib
|
||||
algorithm/rotsprite.cpp
|
||||
algorithm/shift_image.cpp
|
||||
algorithm/shrink_bounds.cpp
|
||||
anidir.cpp
|
||||
blend_funcs.cpp
|
||||
brush.cpp
|
||||
cel.cpp
|
||||
|
25
src/doc/anidir.cpp
Normal file
25
src/doc/anidir.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
// Aseprite Document Library
|
||||
// Copyright (c) 2001-2015 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "doc/anidir.h"
|
||||
|
||||
namespace doc {
|
||||
|
||||
std::string convert_to_string(AniDir anidir)
|
||||
{
|
||||
switch (anidir) {
|
||||
case AniDir::FORWARD: return "forward";
|
||||
case AniDir::REVERSE: return "reverse";
|
||||
case AniDir::PING_PONG: return "pingpong";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
} // namespace doc
|
@ -8,6 +8,8 @@
|
||||
#define DOC_ANIDIR_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace doc {
|
||||
|
||||
enum class AniDir {
|
||||
@ -16,6 +18,8 @@ namespace doc {
|
||||
PING_PONG = 2,
|
||||
};
|
||||
|
||||
std::string convert_to_string(AniDir anidir);
|
||||
|
||||
} // namespace doc
|
||||
|
||||
#endif // DOC_ANIDIR_H_INCLUDED
|
||||
|
Loading…
Reference in New Issue
Block a user