Fix open exiting module
Some checks failed
Build-StoryEditor / build_linux (push) Has been cancelled
Build-StoryEditor / build_win32 (push) Has been cancelled
Deploy-Documentation / deploy (push) Has been cancelled

This commit is contained in:
anthony@rabine.fr 2025-07-28 20:39:04 +02:00
parent 03fc21dd17
commit d2fac4d79e
2 changed files with 6 additions and 5 deletions

View file

@ -158,16 +158,20 @@ public:
if (entry.is_directory())
{
std::cout << "Scanning directory: " << entry.path() << std::endl;
auto uuid = entry.path().filename().string();
for (const auto& subEntry : std::filesystem::directory_iterator(entry.path()))
{
if (subEntry.is_regular_file() && subEntry.path().extension() == ".json")
{
std::cout << "Found module file: " << subEntry.path() << std::endl;
auto p = std::make_shared<StoryProject>(m_log);
p->SetPaths(uuid, m_rootPath);
// Load the JSON file and register a node based on its content
std::ifstream file(subEntry.path());
nlohmann::json j;
file >> j;
auto p = std::make_shared<StoryProject>(m_log);
p->ParseStoryInformation(j);
if (p->IsModule())
{

View file

@ -909,18 +909,15 @@ void MainWindow::OpenModule(const std::string &uuid)
{
Log("Open module success");
m_moduleEditorWindow.Load(m_module);
m_moduleEditorWindow.Enable();
}
else
{
Log("Open module error");
}
m_moduleEditorWindow.Enable();
}
void MainWindow::CloseProject()
{
// FIXME: not sure but if present, we lost some information in the library manager