diff --git a/data/strings/en.ini b/data/strings/en.ini index f53d04017..1c7863b7a 100644 --- a/data/strings/en.ini +++ b/data/strings/en.ini @@ -1033,6 +1033,7 @@ double_high = Double-high Pixels (1:2) title = Notice description = Do you want to load the following files as an animation? repeat = Do the same for other files +duration = Duration agree = &Agree skip = &Skip diff --git a/data/widgets/open_sequence.xml b/data/widgets/open_sequence.xml index be47668f0..3bb5d985c 100644 --- a/data/widgets/open_sequence.xml +++ b/data/widgets/open_sequence.xml @@ -8,6 +8,10 @@ + + diff --git a/src/app/file/file.cpp b/src/app/file/file.cpp index 64245ac53..78596848f 100644 --- a/src/app/file/file.cpp +++ b/src/app/file/file.cpp @@ -385,6 +385,10 @@ FileOp* FileOp::createLoadDocumentOperation(Context* context, window.files()->getSelectedChild() != nullptr); }); + window.duration()->setTextf("%d", fop->m_seq.duration); + window.duration()->Change.connect( + [&]() { fop->m_seq.duration = window.duration()->textInt(); }); + window.openWindowInForeground(); // Don't show this alert again. @@ -832,6 +836,8 @@ void FileOp::operate(IFileOpProgress* progress) #endif } + m_document->sprite()->setFrameDuration(frame, m_seq.duration); + ++frame; m_seq.progress_offset += m_seq.progress_fraction; } @@ -1395,6 +1401,7 @@ FileOp::FileOp(FileOpType type, m_seq.frame = frame_t(0); m_seq.layer = nullptr; m_seq.last_cel = nullptr; + m_seq.duration = 100; m_seq.flags = 0; } diff --git a/src/app/file/file.h b/src/app/file/file.h index 93a0ca4b2..35c8d1aee 100644 --- a/src/app/file/file.h +++ b/src/app/file/file.h @@ -311,6 +311,7 @@ namespace app { bool has_alpha; LayerImage* layer; Cel* last_cel; + int duration; // Flags after the user choose what to do with the sequence. int flags; } m_seq;