From cb12f59643c1aaccee338c208ad54fb0f101c43e Mon Sep 17 00:00:00 2001 From: Pentalimbed Date: Sat, 11 Jun 2022 19:16:27 +0800 Subject: [PATCH] Reindex when saving behaviour/character files --- TODO | 3 +++ src/hkx/hkxfile.cpp | 7 +++++++ src/hkx/hkxfile.h | 9 +++++---- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 5449594..e385599 100644 --- a/TODO +++ b/TODO @@ -76,6 +76,9 @@ ### Bugfix - No opened file close file crash fix - Character file character property uneditable bug fix +## 0.7.4a +### Bugfix +- Reindex when saving behaviour/character files Column view optimization Delete all children diff --git a/src/hkx/hkxfile.cpp b/src/hkx/hkxfile.cpp index 69029e6..e4db6e5 100644 --- a/src/hkx/hkxfile.cpp +++ b/src/hkx/hkxfile.cpp @@ -688,6 +688,13 @@ void CharacterFile::loadFile(std::string_view path) m_loaded = true; } +void CharacterFile::saveFile(std::string_view path) +{ + m_prop_manager.reindex(); + + HkxFile::saveFile(path); +} + ////////////////////// FILE MANAGER HkxFileManager* HkxFileManager::getSingleton() { diff --git a/src/hkx/hkxfile.h b/src/hkx/hkxfile.h index f268233..2b0a793 100644 --- a/src/hkx/hkxfile.h +++ b/src/hkx/hkxfile.h @@ -33,7 +33,7 @@ class HkxFile virtual constexpr HkxFileType getType() { return kUnknown; } void loadFile(std::string_view path); - void saveFile(std::string_view path = {}); + virtual void saveFile(std::string_view path = {}); inline bool isFileLoaded() { return m_loaded; } inline std::string_view getPath() { return m_path; } @@ -110,8 +110,8 @@ class BehaviourFile : public HkxFile public: virtual constexpr HkxFileType getType() override { return kBehaviour; } - void loadFile(std::string_view path); - void saveFile(std::string_view path = {}); + void loadFile(std::string_view path); + virtual void saveFile(std::string_view path = {}) override; inline std::string_view getRootStateMachine() { @@ -172,7 +172,8 @@ class CharacterFile : public HkxFile public: virtual constexpr HkxFileType getType() override { return kCharacter; } - void loadFile(std::string_view path); + void loadFile(std::string_view path); + virtual void saveFile(std::string_view path = {}) override; inline virtual bool isObjEssential(std::string_view id) override {