Refactoring; structs for popups/multi-selects, additional popups in places

This commit is contained in:
2025-10-22 21:27:11 -04:00
parent 5b0f9a39c4
commit 87c2db2a77
31 changed files with 849 additions and 355 deletions

View File

@@ -1,9 +1,11 @@
#pragma once
#include "anm2.h"
#include <filesystem>
#include <set>
#include "anm2.h"
#include "types.h"
#include <glm/glm.hpp>
namespace anm2ed::document
@@ -22,6 +24,7 @@ namespace anm2ed::document
int overlayIndex{};
int referenceSpritesheet{-1};
int referenceLayer{-1};
std::set<int> selectedEvents{};
std::set<int> selectedLayers{};
@@ -29,9 +32,12 @@ namespace anm2ed::document
std::set<int> selectedAnimations{};
std::set<int> selectedSpritesheets{};
std::vector<std::string> spritesheetNames{};
std::vector<const char*> spritesheetNamesCstr{};
uint64_t hash{};
uint64_t saveHash{};
double lastHashTime{};
bool isJustChanged[types::change::COUNT]{};
bool isOpen{true};
Document();
@@ -39,12 +45,17 @@ namespace anm2ed::document
Document(const std::string& path, bool isNew = false, std::string* errorString = nullptr);
bool save(const std::string& path = {}, std::string* errorString = nullptr);
void hash_set();
void hash_time(double time, double interval = 1.0);
void clean();
void on_change();
void change(types::change::Type type);
bool is_just_changed(types::change::Type type);
bool is_dirty();
void update();
std::string directory_get();
std::string filename_get();
anm2::Animation* animation_get();
anm2::Frame* frame_get();
anm2::Item* item_get();
anm2::Spritesheet* spritesheet_get();
bool is_valid();
};