Split anm2 and timeline into modules; merge groups by name
Baseline before de-bloat refactor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9e9dd8bd8a
commit
41ed347925
20 files changed
+7849
-7415
No files matched your search
@@ -0,0 +1,120 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "clipboard.hpp"
|
||||
#include "manager.hpp"
|
||||
#include "popup/item_properties.hpp"
|
||||
#include "resources.hpp"
|
||||
#include "settings.hpp"
|
||||
#include "strings.hpp"
|
||||
#include "util/imgui/popup.hpp"
|
||||
|
||||
namespace anm2ed::imgui
|
||||
{
|
||||
struct TimelineContext;
|
||||
|
||||
struct TimelineRowReference
|
||||
{
|
||||
int documentIndex{-1};
|
||||
int animationIndex{-1};
|
||||
int type{NONE};
|
||||
int id{-1};
|
||||
int index{-1};
|
||||
int groupType{NONE};
|
||||
int groupId{-1};
|
||||
bool isGroup{};
|
||||
|
||||
auto operator<=>(const TimelineRowReference&) const = default;
|
||||
};
|
||||
|
||||
struct FrameMoveDrag
|
||||
{
|
||||
int type{NONE};
|
||||
int itemID{-1};
|
||||
int animationIndex{-1};
|
||||
int groupType{NONE};
|
||||
int groupId{-1};
|
||||
int frameIndex{-1};
|
||||
int duration{1};
|
||||
std::vector<int> indices{};
|
||||
std::vector<Reference> references{};
|
||||
bool isActive{};
|
||||
};
|
||||
|
||||
struct FrameDurationDrag
|
||||
{
|
||||
Reference reference{};
|
||||
int duration{1};
|
||||
};
|
||||
|
||||
enum class BakeIntoOtherFramesTarget
|
||||
{
|
||||
CURRENT_SELECTION,
|
||||
ALL
|
||||
};
|
||||
|
||||
class Timeline
|
||||
{
|
||||
friend struct TimelineContext;
|
||||
|
||||
bool isDragging{};
|
||||
bool isWindowHovered{};
|
||||
bool isHorizontalScroll{};
|
||||
popup::ItemProperties itemProperties{};
|
||||
PopupHelper bakePopup{PopupHelper(LABEL_TIMELINE_BAKE_POPUP, POPUP_SMALL_NO_HEIGHT)};
|
||||
PopupHelper bakeIntoOtherFramesPopup{PopupHelper(LABEL_BAKE_INTO_OTHER_FRAMES, POPUP_SMALL_NO_HEIGHT)};
|
||||
PopupHelper makeManyRegionsPopup{PopupHelper(LABEL_MAKE_MANY_REGIONS, POPUP_SMALL_NO_HEIGHT)};
|
||||
BakeIntoOtherFramesTarget bakeIntoOtherFramesTarget{BakeIntoOtherFramesTarget::CURRENT_SELECTION};
|
||||
bool isBakeIntoOtherFramesLayers{true};
|
||||
bool isBakeIntoOtherFramesNulls{true};
|
||||
bool isMakeManyRegionsMapFrames{true};
|
||||
std::set<Reference> makeManyRegionReferences{};
|
||||
int hoveredTime{};
|
||||
bool isFrameBoxPending{};
|
||||
bool isFrameBoxSelecting{};
|
||||
bool isFrameBoxAdditive{};
|
||||
ImVec2 frameBoxStart{};
|
||||
ImVec2 frameBoxEnd{};
|
||||
std::set<Reference> frameBoxSelection{};
|
||||
TimelineRowReference rowSelectionAnchor{};
|
||||
bool isRowSelectionAnchorSet{};
|
||||
PopupHelper groupPropertiesPopup{PopupHelper(LABEL_GROUP_PROPERTIES, POPUP_SMALL_NO_HEIGHT)};
|
||||
std::string groupName{};
|
||||
int groupAnimationIndex{-1};
|
||||
int groupType{NONE};
|
||||
int groupId{-1};
|
||||
Reference draggedFrameReference{};
|
||||
bool isDraggedFrameActive{};
|
||||
int draggedFrameType{};
|
||||
int draggedFrameIndex{-1};
|
||||
int draggedFrameStart{-1};
|
||||
int draggedFrameStartDuration{-1};
|
||||
std::vector<FrameDurationDrag> draggedFrameStartDurations{};
|
||||
float draggedFrameStartMouseX{};
|
||||
float draggedFrameWidth{};
|
||||
bool isDraggedFrameSnapshot{};
|
||||
bool frameFocusRequested{};
|
||||
int frameFocusIndex{-1};
|
||||
FrameMoveDrag frameMoveDrag{};
|
||||
std::vector<int> frameSelectionSnapshot{};
|
||||
std::vector<int> frameSelectionLocked{};
|
||||
bool isFrameSelectionLocked{};
|
||||
Reference frameSelectionSnapshotReference{};
|
||||
Reference frameSelectionAnchor{};
|
||||
bool isFrameSelectionAnchorSet{};
|
||||
int animationLengthEditIndex{-1};
|
||||
std::vector<TimelineRowReference> rowDragReferences{};
|
||||
glm::vec2 scroll{};
|
||||
ImGuiStyle style{};
|
||||
std::unique_ptr<TimelineContext> context{};
|
||||
|
||||
public:
|
||||
Timeline();
|
||||
~Timeline();
|
||||
void update(Manager&, Settings&, Resources&, Clipboard&);
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user