The Update(TM), Part 1

This commit is contained in:
2025-07-27 22:08:57 -04:00
parent 0439221e78
commit fe8bdae9a8
45 changed files with 4450 additions and 3564 deletions

44
src/clipboard.h Normal file
View File

@@ -0,0 +1,44 @@
#pragma once
#include "anm2.h"
enum ClipboardItemType
{
CLIPBOARD_NONE,
CLIPBOARD_FRAME,
CLIPBOARD_ANIMATION,
CLIPBOARD_EVENT
};
struct ClipboardItem
{
std::variant<std::monostate, Anm2FrameWithReference, Anm2AnimationWithID, Anm2EventWithID> data = std::monostate();
ClipboardItemType type = CLIPBOARD_NONE;
ClipboardItem() = default;
ClipboardItem(const Anm2FrameWithReference& frame)
: data(frame), type(CLIPBOARD_FRAME) {}
ClipboardItem(const Anm2AnimationWithID& anim)
: data(anim), type(CLIPBOARD_ANIMATION) {}
ClipboardItem(const Anm2EventWithID& event)
: data(event), type(CLIPBOARD_EVENT) {}
};
using ClipboardLocation = std::variant<std::monostate, Anm2Reference, s32>;
struct Clipboard
{
Anm2* anm2 = nullptr;
ClipboardItem item;
ClipboardItem hoveredItem;
ClipboardLocation location;
};
void clipboard_copy(Clipboard* self);
void clipboard_cut(Clipboard* self);
void clipboard_paste(Clipboard* self);
void clipboard_init(Clipboard* self, Anm2* anm2);