Skip to content

Commit

Permalink
Reindex when saving behaviour/character files
Browse files Browse the repository at this point in the history
  • Loading branch information
Pentalimbed committed Jun 11, 2022
1 parent ebb4048 commit cb12f59
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/hkx/hkxfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
9 changes: 5 additions & 4 deletions src/hkx/hkxfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit cb12f59

Please sign in to comment.