mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +00:00
Added Duration to filename formatter
This commit is contained in:
parent
4981f05f0b
commit
59e01493cb
@ -892,7 +892,8 @@ void DocExporter::captureSamples(Samples& samples,
|
||||
.outerTagName(outerTag ? outerTag->name(): "")
|
||||
.frame(outputFrame)
|
||||
.tagFrame(innerTag ? frame - innerTag->fromFrame():
|
||||
outputFrame);
|
||||
outputFrame)
|
||||
.duration(sprite->frameDuration(frame));
|
||||
++outputFrame;
|
||||
|
||||
std::string filename = filename_formatter(format, fnInfo);
|
||||
|
@ -112,6 +112,7 @@ std::string filename_formatter(
|
||||
base::replace_string(output, "{layer}", info.layerName());
|
||||
base::replace_string(output, "{group}", info.groupName());
|
||||
base::replace_string(output, "{slice}", info.sliceName());
|
||||
base::replace_string(output, "{duration}", std::to_string(info.duration()));
|
||||
|
||||
if (replaceFrame) {
|
||||
base::replace_string(output, "{tag}", info.innerTagName());
|
||||
|
@ -24,6 +24,7 @@ namespace app {
|
||||
const std::string& sliceName() const { return m_sliceName; }
|
||||
int frame() const { return m_frame; }
|
||||
int tagFrame() const { return m_tagFrame; }
|
||||
int duration() const { return m_duration; }
|
||||
|
||||
FilenameInfo& filename(const std::string& value) {
|
||||
m_filename = value;
|
||||
@ -65,6 +66,11 @@ namespace app {
|
||||
return *this;
|
||||
}
|
||||
|
||||
FilenameInfo& duration(int value) {
|
||||
m_duration = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_filename;
|
||||
std::string m_layerName;
|
||||
@ -74,6 +80,7 @@ namespace app {
|
||||
std::string m_sliceName;
|
||||
int m_frame;
|
||||
int m_tagFrame;
|
||||
int m_duration;
|
||||
};
|
||||
|
||||
// Returns the information inside {frame} tag.
|
||||
|
Loading…
Reference in New Issue
Block a user