diff --git a/core/story-manager/interfaces/i_story_manager.h b/core/story-manager/interfaces/i_story_manager.h index a25bf2e..7caae03 100644 --- a/core/story-manager/interfaces/i_story_manager.h +++ b/core/story-manager/interfaces/i_story_manager.h @@ -32,7 +32,7 @@ class IStoryManager public: virtual ~IStoryManager() {} - virtual void OpenProject(const std::string &uuid, IStoryManager::ProjectType type) = 0; + virtual void OpenProject(const std::string &uuid) = 0; virtual void ImportProject(const std::string &fileName, int format) = 0; virtual void Log(const std::string &txt, bool critical = false) = 0; virtual void PlaySoundFile(const std::string &fileName) = 0; diff --git a/core/story-manager/interfaces/i_story_project.h b/core/story-manager/interfaces/i_story_project.h index 4a91c84..2e584dd 100644 --- a/core/story-manager/interfaces/i_story_project.h +++ b/core/story-manager/interfaces/i_story_project.h @@ -17,6 +17,8 @@ public: virtual ~IStoryProject() {}; + virtual std::string GetName() const = 0; + virtual std::list> GetNodeConnections(const std::string &nodeId) = 0; virtual int OutputsCount(const std::string &nodeId) = 0; virtual StoryOptions GetOptions() = 0; diff --git a/core/story-manager/lib/nodes_factory.h b/core/story-manager/lib/nodes_factory.h index 37f1d7c..e55233e 100644 --- a/core/story-manager/lib/nodes_factory.h +++ b/core/story-manager/lib/nodes_factory.h @@ -7,7 +7,8 @@ #include "json.hpp" // #include "media_node.h" -#include "function_node.h" +#include "call_function_node.h" +#include "module_node.h" #include "variable_node.h" #include "operator_node.h" #include "print_node.h" @@ -15,10 +16,12 @@ #include "story_project.h" static const std::string OperatorNodeUuid = "0226fdac-8f7a-47d7-8584-b23aceb712ec"; -static const std::string FunctionNodeUuid = "02745f38-9b11-49fe-94b1-b2a6b78249fb"; +static const std::string CallFunctionNodeUuid = "02745f38-9b11-49fe-94b1-b2a6b78249fb"; static const std::string VariableNodeUuid = "020cca4e-9cdc-47e7-a6a5-53e4c9152ed0"; static const std::string PrintNodeUuid = "02ee27bc-ff1d-4f94-b700-eab55052ad1c"; static const std::string SyscallNodeUuid = "02225cff-4975-400e-8130-41524d8af773"; +static const std::string ModuleNodeUuid = "02e4c728-ef72-4003-b7c8-2bee8834a47e"; + typedef std::shared_ptr (*GenericCreator)(const std::string &type); @@ -26,7 +29,6 @@ class NodesFactory { public: - NodesFactory(ILogger &log) : m_log(log) , m_rootPath("") @@ -34,7 +36,7 @@ public: // Register node types // registerNode("media-node"); registerNode(OperatorNodeUuid, nullptr); - registerNode(FunctionNodeUuid, nullptr); + registerNode(CallFunctionNodeUuid, nullptr); registerNode(VariableNodeUuid, nullptr); registerNode(PrintNodeUuid, nullptr); registerNode(SyscallNodeUuid, nullptr); @@ -62,6 +64,29 @@ public: } } + std::shared_ptr GetModule(const std::string &name) + { + std::shared_ptr module; + + // Scan all function nodes and find the one with that name + for (auto n : m_registry) + { + if (n.first == ModuleNodeUuid) + { + if (n.second.first) + { + // We have a module here, get the name + if (n.second.first->GetName() == name) + { + module = n.second.first; + } + } + } + } + + return module; + } + void SetModulesRootDirectory(const std::string &rootPath) { m_rootPath = rootPath; } @@ -92,7 +117,7 @@ public: if (p->IsModule()) { - registerNode(FunctionNodeUuid, p); + registerNode(ModuleNodeUuid, p); // For now, function node use only primitives nodes // FIXME: in the future, allow function node to use other function nodes // Need a list of required nodes to be registered @@ -118,12 +143,11 @@ private: }; // UUID is the key, and the value is a function that creates the node - typedef std::map, GenericCreator>> Registry; + typedef std::map, GenericCreator>> Registry; Registry m_registry; template - void registerNode(const std::string& uuid, std::shared_ptr moduleInfo = nullptr) { - info.creator = ; - m_registry.insert(typename Registry::value_type(uuid, std::make_pair::create_func>)); + void registerNode(const std::string& uuid, std::shared_ptr moduleInfo) { + m_registry.insert(std::make_pair(uuid, std::make_pair(moduleInfo, Factory::create_func))); } }; diff --git a/core/story-manager/src/nodes/function_node.cpp b/core/story-manager/src/nodes/call_function_node.cpp similarity index 62% rename from core/story-manager/src/nodes/function_node.cpp rename to core/story-manager/src/nodes/call_function_node.cpp index 1c6c971..7601686 100644 --- a/core/story-manager/src/nodes/function_node.cpp +++ b/core/story-manager/src/nodes/call_function_node.cpp @@ -1,17 +1,17 @@ -#include "function_node.h" +#include "call_function_node.h" #include "story_project.h" #include "connection.h" #include "sys_lib.h" -FunctionNode::FunctionNode(const std::string &type) - : BaseNode(type, "Function Node") +CallFunctionNode::CallFunctionNode(const std::string &type) + : BaseNode(type, "Call Function Node") { nlohmann::json j{ {"function", ""} }; SetInternalData(j); } -void FunctionNode::Initialize() +void CallFunctionNode::Initialize() { nlohmann::json j = GetInternalData(); // m_image = j["image"].get(); diff --git a/core/story-manager/src/nodes/call_function_node.h b/core/story-manager/src/nodes/call_function_node.h new file mode 100644 index 0000000..9a5c6fd --- /dev/null +++ b/core/story-manager/src/nodes/call_function_node.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include "i_story_manager.h" +#include "base_node.h" +#include "i_script_node.h" +#include "i_story_project.h" + +class CallFunctionNode : public BaseNode +{ +public: + CallFunctionNode(const std::string &type); + + virtual void Initialize() override; + +private: + nlohmann::json m_content; +}; + diff --git a/core/story-manager/src/nodes/module_node.cpp b/core/story-manager/src/nodes/module_node.cpp new file mode 100644 index 0000000..32d4f0d --- /dev/null +++ b/core/story-manager/src/nodes/module_node.cpp @@ -0,0 +1,20 @@ +#include "module_node.h" +#include "story_project.h" +#include "connection.h" +#include "sys_lib.h" + + +ModuleNode::ModuleNode(const std::string &type) + : BaseNode(type, "Module Node") +{ + nlohmann::json j{ {"module", ""} }; + SetInternalData(j); +} + +void ModuleNode::Initialize() +{ + nlohmann::json j = GetInternalData(); + // m_image = j["image"].get(); + // m_sound = j["sound"].get(); +} + diff --git a/core/story-manager/src/nodes/function_node.h b/core/story-manager/src/nodes/module_node.h similarity index 79% rename from core/story-manager/src/nodes/function_node.h rename to core/story-manager/src/nodes/module_node.h index 4a16de1..d6801ca 100644 --- a/core/story-manager/src/nodes/function_node.h +++ b/core/story-manager/src/nodes/module_node.h @@ -6,10 +6,10 @@ #include "i_script_node.h" #include "i_story_project.h" -class FunctionNode : public BaseNode +class ModuleNode : public BaseNode { public: - FunctionNode(const std::string &type); + ModuleNode(const std::string &type); virtual void Initialize() override; diff --git a/core/story-manager/src/story_project.cpp b/core/story-manager/src/story_project.cpp index f484486..a15a446 100644 --- a/core/story-manager/src/story_project.cpp +++ b/core/story-manager/src/story_project.cpp @@ -8,13 +8,13 @@ #include "story_project.h" #include "json.hpp" // #include "media_node.h" -#include "function_node.h" #include "variable_node.h" #include "operator_node.h" #include "print_node.h" #include "syscall_node.h" #include "sys_lib.h" #include "assembly_generator_chip32.h" +#include "nodes_factory.h" StoryProject::StoryProject(ILogger &log) : m_log(log) diff --git a/core/story-manager/src/story_project.h b/core/story-manager/src/story_project.h index c3392c1..7fed896 100644 --- a/core/story-manager/src/story_project.h +++ b/core/story-manager/src/story_project.h @@ -16,7 +16,8 @@ #include "story_page.h" #include "story_options.h" #include "variable.h" -#include "nodes_factory.h" + +class NodesFactory; struct StoryProject : public IStoryProject { @@ -65,7 +66,7 @@ public: std::string GetProjectFilePath() const; std::string GetWorkingDir() const; - std::string GetName() const { return m_name; } + virtual std::string GetName() const override { return m_name; } std::string GetUuid() const { return m_uuid; } std::string GetDescription() const { return m_description; } uint32_t GetVersion() const { return m_version; } diff --git a/story-editor/CMakeLists.txt b/story-editor/CMakeLists.txt index 0133a6e..efbe108 100644 --- a/story-editor/CMakeLists.txt +++ b/story-editor/CMakeLists.txt @@ -133,7 +133,8 @@ set(SRCS # src/node_editor/media_node_widget.cpp src/node_editor/base_node_widget.cpp src/node_editor/node_editor_window.cpp - src/node_editor/function_node_widget.cpp + src/node_editor/call_function_node_widget.cpp + src/node_editor/module_node_widget.cpp src/node_editor/variable_node_widget.cpp src/node_editor/operator_node_widget.cpp src/node_editor/print_node_widget.cpp @@ -179,7 +180,8 @@ set(SRCS ../core/story-manager/src/nodes/compare_node.cpp ../core/story-manager/src/nodes/branch_node.cpp ../core/story-manager/src/nodes/variable_node.cpp - ../core/story-manager/src/nodes/function_node.cpp + ../core/story-manager/src/nodes/call_function_node.cpp + ../core/story-manager/src/nodes/module_node.cpp ../core/story-manager/src/nodes/print_node.cpp ../core/story-manager/src/nodes/syscall_node.cpp ../core/story-manager/src/nodes/connection.cpp diff --git a/story-editor/imgui.ini b/story-editor/imgui.ini index 38a4417..d11dc92 100644 --- a/story-editor/imgui.ini +++ b/story-editor/imgui.ini @@ -9,8 +9,8 @@ Size=400,400 Collapsed=0 [Window][Library Manager] -Pos=628,26 -Size=652,268 +Pos=796,26 +Size=484,268 Collapsed=0 DockId=0x00000003,0 @@ -21,32 +21,32 @@ Collapsed=0 DockId=0x00000004,0 [Window][Emulator] -Pos=628,26 -Size=652,268 +Pos=796,26 +Size=484,268 Collapsed=0 DockId=0x00000003,5 [Window][Code viewer] -Pos=628,26 -Size=652,268 +Pos=796,26 +Size=484,268 Collapsed=0 DockId=0x00000003,4 [Window][Resources] -Pos=628,26 -Size=652,268 +Pos=796,26 +Size=484,268 Collapsed=0 DockId=0x00000003,1 [Window][Node editor] Pos=60,26 -Size=566,439 +Size=734,439 Collapsed=0 -DockId=0x00000001,0 +DockId=0x00000001,1 [Window][TOOLBAR] Pos=76,71 -Size=79,42 +Size=150,42 Collapsed=0 [Window][Variables] @@ -56,20 +56,20 @@ Collapsed=0 DockId=0x00000005,0 [Window][CPU] -Pos=628,26 -Size=652,268 +Pos=796,26 +Size=484,268 Collapsed=0 DockId=0x00000003,2 [Window][RAM view] -Pos=628,26 -Size=652,268 +Pos=796,26 +Size=484,268 Collapsed=0 DockId=0x00000003,3 [Window][Properties] -Pos=628,296 -Size=652,169 +Pos=796,296 +Size=484,169 Collapsed=0 DockId=0x00000006,0 @@ -88,6 +88,18 @@ Pos=381,236 Size=518,248 Collapsed=0 +[Window][Module editor] +Pos=60,26 +Size=734,439 +Collapsed=0 +DockId=0x00000001,1 + +[Window][Story editor] +Pos=60,26 +Size=734,439 +Collapsed=0 +DockId=0x00000001,0 + [Table][0x7728942D,5] RefScale=20 Column 0 Width=44 Sort=0v @@ -110,9 +122,9 @@ Column 2 Width=124 [Docking][Data] DockSpace ID=0x08BD597D Window=0x1BBC0F80 Pos=60,26 Size=1220,694 Split=Y DockNode ID=0x00000007 Parent=0x08BD597D SizeRef=1220,439 Split=X - DockNode ID=0x00000001 Parent=0x00000007 SizeRef=820,694 CentralNode=1 Selected=0xBB79A587 - DockNode ID=0x00000002 Parent=0x00000007 SizeRef=652,694 Split=Y Selected=0x52EB28B5 - DockNode ID=0x00000003 Parent=0x00000002 SizeRef=718,268 Selected=0x30401527 + DockNode ID=0x00000001 Parent=0x00000007 SizeRef=734,694 CentralNode=1 Selected=0x93ADCAAB + DockNode ID=0x00000002 Parent=0x00000007 SizeRef=484,694 Split=Y Selected=0x52EB28B5 + DockNode ID=0x00000003 Parent=0x00000002 SizeRef=718,268 Selected=0x4B07C626 DockNode ID=0x00000006 Parent=0x00000002 SizeRef=718,169 Selected=0x8C72BEA8 DockNode ID=0x00000008 Parent=0x08BD597D SizeRef=1220,253 Split=X Selected=0xEA83D666 DockNode ID=0x00000004 Parent=0x00000008 SizeRef=610,192 Selected=0xEA83D666 diff --git a/story-editor/src/node_editor/function_node_widget.cpp b/story-editor/src/node_editor/call_function_node_widget.cpp similarity index 73% rename from story-editor/src/node_editor/function_node_widget.cpp rename to story-editor/src/node_editor/call_function_node_widget.cpp index 75f7c82..d1ad553 100644 --- a/story-editor/src/node_editor/function_node_widget.cpp +++ b/story-editor/src/node_editor/call_function_node_widget.cpp @@ -1,13 +1,13 @@ #include -#include "function_node_widget.h" +#include "call_function_node_widget.h" namespace ed = ax::NodeEditor; #include "IconsMaterialDesignIcons.h" #include "story_project.h" #include "uuid.h" -FunctionNodeWidget::FunctionNodeWidget(IStoryManager &manager, std::shared_ptr node) +CallFunctionNodeWidget::CallFunctionNodeWidget(IStoryManager &manager, std::shared_ptr node) : BaseNodeWidget(manager, node) , m_manager(manager) { @@ -19,7 +19,7 @@ FunctionNodeWidget::FunctionNodeWidget(IStoryManager &manager, std::shared_ptr +#include +#include +#include + +#include "base_node_widget.h" +#include "i_story_manager.h" +#include "i_story_project.h" +#include "call_function_node.h" +#include "gui.h" +#include + + +class CallFunctionNodeWidget : public BaseNodeWidget +{ +public: + CallFunctionNodeWidget(IStoryManager &manager, std::shared_ptr node); + + void Draw() override; + + virtual void DrawProperties() override; + virtual void Initialize() override; + +private: + IStoryManager &m_manager; + + std::shared_ptr m_callFunctionNode; + + std::string m_functionName; + std::string m_functionUuid; +}; diff --git a/story-editor/src/node_editor/module_node_widget.cpp b/story-editor/src/node_editor/module_node_widget.cpp new file mode 100644 index 0000000..5fff5ed --- /dev/null +++ b/story-editor/src/node_editor/module_node_widget.cpp @@ -0,0 +1,47 @@ + +#include +#include "module_node_widget.h" + +namespace ed = ax::NodeEditor; +#include "IconsMaterialDesignIcons.h" +#include "story_project.h" +#include "uuid.h" + +ModuleNodeWidget::ModuleNodeWidget(IStoryManager &manager, std::shared_ptr node) + : BaseNodeWidget(manager, node) + , m_manager(manager) +{ + // Create defaut one input and one output + AddInputs(1); + AddOutputs(2); + SetOutPinName(0, "Success"); + SetOutPinName(1, "Failure"); +} + +void ModuleNodeWidget::Draw() +{ + BaseNodeWidget::FrameStart(); + + ImGui::TextUnformatted(m_functionName.c_str()); + + + DrawPins(); + + BaseNodeWidget::FrameEnd(); + +} + +void ModuleNodeWidget::Initialize() +{ + BaseNodeWidget::Initialize(); + m_functionName = "Function"; +} + +void ModuleNodeWidget::DrawProperties() +{ + + + +} + + diff --git a/story-editor/src/node_editor/function_node_widget.h b/story-editor/src/node_editor/module_node_widget.h similarity index 71% rename from story-editor/src/node_editor/function_node_widget.h rename to story-editor/src/node_editor/module_node_widget.h index fd15456..b808b5c 100644 --- a/story-editor/src/node_editor/function_node_widget.h +++ b/story-editor/src/node_editor/module_node_widget.h @@ -12,10 +12,10 @@ #include -class FunctionNodeWidget : public BaseNodeWidget +class ModuleNodeWidget : public BaseNodeWidget { public: - FunctionNodeWidget(IStoryManager &manager, std::shared_ptr node); + ModuleNodeWidget(IStoryManager &manager, std::shared_ptr node); void Draw() override; @@ -25,5 +25,5 @@ public: private: IStoryManager &m_manager; std::string m_functionName; - std::string m_functionUuid; + }; diff --git a/story-editor/src/node_editor/node_editor_window.cpp b/story-editor/src/node_editor/node_editor_window.cpp index 071414b..33cc78c 100644 --- a/story-editor/src/node_editor/node_editor_window.cpp +++ b/story-editor/src/node_editor/node_editor_window.cpp @@ -10,7 +10,8 @@ #include "IconsFontAwesome5_c.h" #include "media_node_widget.h" -#include "function_node_widget.h" +#include "call_function_node_widget.h" +#include "module_node_widget.h" #include "variable_node_widget.h" #include "operator_node_widget.h" #include "print_node_widget.h" @@ -26,8 +27,8 @@ if (!(x)) { \ #include "json.hpp" -NodeEditorWindow::NodeEditorWindow(IStoryManager &manager, NodesFactory &factory, IStoryManager::ProjectType type) - : WindowBase(type == IStoryManager::ProjectType::PROJECT_TYPE_STORY ? "Story editor" : "Module editor") +NodeEditorWindow::NodeEditorWindow(IStoryManager &manager, NodesFactory &factory, IStoryProject::Type type) + : WindowBase(type == IStoryProject::Type::PROJECT_TYPE_STORY ? "Story editor" : "Module editor") , m_manager(manager) , m_nodesFactory(factory) , m_editorType(type) @@ -35,7 +36,8 @@ NodeEditorWindow::NodeEditorWindow(IStoryManager &manager, NodesFactory &factory // registerNode("media-node"); registerNode("operator-node"); - registerNode("function-node"); + registerNode("call-function-node"); + registerNode("module-node"); registerNode("variable-node"); registerNode("print-node"); registerNode("syscall-node"); diff --git a/story-editor/src/node_editor/node_editor_window.h b/story-editor/src/node_editor/node_editor_window.h index ee168e2..beb9732 100644 --- a/story-editor/src/node_editor/node_editor_window.h +++ b/story-editor/src/node_editor/node_editor_window.h @@ -8,6 +8,7 @@ #include "base_node_widget.h" #include "window_base.h" #include "i_story_manager.h" +#include "i_story_project.h" #include "json.hpp" #include "story_project.h" #include "node_editor_page.h" @@ -27,7 +28,7 @@ class NodeEditorWindow : public WindowBase { public: - NodeEditorWindow(IStoryManager &manager, NodesFactory &factory, IStoryManager::ProjectType type = IStoryManager::ProjectType::PROJECT_TYPE_STORY); + NodeEditorWindow(IStoryManager &manager, NodesFactory &factory, IStoryProject::Type type = IStoryProject::Type::PROJECT_TYPE_STORY); ~NodeEditorWindow(); virtual void Draw() override; @@ -41,7 +42,7 @@ public: private: IStoryManager &m_manager; NodesFactory &m_nodesFactory; - IStoryManager::ProjectType m_editorType{IStoryManager::ProjectType::PROJECT_TYPE_STORY}; + IStoryProject::Type m_editorType{IStoryProject::Type::PROJECT_TYPE_STORY}; bool m_loaded{false}; diff --git a/story-editor/src/windows/main_window.cpp b/story-editor/src/windows/main_window.cpp index 766bd67..6d8d273 100644 --- a/story-editor/src/windows/main_window.cpp +++ b/story-editor/src/windows/main_window.cpp @@ -24,13 +24,14 @@ MainWindow::MainWindow() : m_resources(*this) + , m_nodesFactory(*this) , m_libraryManager(*this, m_nodesFactory) , m_emulatorWindow(*this) , m_debuggerWindow(*this) , m_cpuWindow(*this) , m_resourcesWindow(*this) , m_nodeEditorWindow(*this, m_nodesFactory) - , m_moduleEditorWindow(*this, m_nodesFactory, NodeEditorWindow::EditorType::NODE_EDITOR_MODULE) + , m_moduleEditorWindow(*this, m_nodesFactory, IStoryProject::Type::PROJECT_TYPE_MODULE) , m_libraryWindow(*this, m_libraryManager) , m_variablesWindow(*this) , m_player(*this) @@ -604,7 +605,7 @@ bool MainWindow::ShowQuitConfirm() // ImGui::SetNextWindowSize(ImVec2(200, 150)); if (ImGui::BeginPopupModal("QuitConfirm", NULL, ImGuiWindowFlags_AlwaysAutoResize)) { - ImGui::Text("Voulez-vous vraiment quitter le logiciel ?"); + ImGui::Text("Really qui without saving?"); ImGui::Separator(); if (ImGui::Button("OK", ImVec2(120, 0))) @@ -837,7 +838,7 @@ void MainWindow::ProjectPropertiesPopup() } } -void MainWindow::SaveProject(IStoryManager::ProjectType type) +void MainWindow::SaveProject() { nlohmann::json model; m_story->Save(m_resources); @@ -846,7 +847,7 @@ void MainWindow::SaveProject(IStoryManager::ProjectType type) void MainWindow::OpenProject(const std::string &uuid) { - CloseProject(IStoryManager::ProjectType::PROJECT_TYPE_STORY); + CloseProject(); m_story = m_libraryManager.GetStory(uuid); @@ -897,15 +898,15 @@ void MainWindow::OpenProject(const std::string &uuid) void MainWindow::OpenModule(const std::string &uuid) { - m_story = m_libraryManager.GetModule(uuid); - if (!m_story) + m_module = m_nodesFactory.GetModule(uuid); + if (!m_module) { Log("Cannot find module: " + uuid); } - else if (m_story->Load(m_resources, m_nodesFactory)) + else if (m_module->Load(m_resources, m_nodesFactory)) { Log("Open module success"); - m_moduleEditorWindow.Load(m_story); + m_moduleEditorWindow.Load(m_module); } else { @@ -918,7 +919,7 @@ void MainWindow::OpenModule(const std::string &uuid) -void MainWindow::CloseProject(IStoryManager::ProjectType type) +void MainWindow::CloseProject() { // FIXME: not sure but if present, we lost some information in the library manager @@ -929,21 +930,9 @@ void MainWindow::CloseProject(IStoryManager::ProjectType type) // } m_resources.Clear(); + m_nodeEditorWindow.Initialize(); + m_nodeEditorWindow.Disable(); - if (type == IStoryManager::ProjectType::PROJECT_TYPE_STORY) - { - m_nodeEditorWindow.Initialize(); - m_nodeEditorWindow.Disable(); - } - else if (type == IStoryManager::ProjectType::PROJECT_TYPE_MODULE) - { - m_moduleEditorWindow.Initialize(); - m_moduleEditorWindow.Disable(); - } - - // FIXME: si un des deux types de projets est encore ouvert, on ne va pas fermer - // le sautres fenĂȘtres de preview - m_emulatorWindow.ClearImage(); m_consoleWindow.ClearLog(); m_debuggerWindow.ClearErrors(); @@ -960,6 +949,14 @@ void MainWindow::CloseProject(IStoryManager::ProjectType type) } +void MainWindow::CloseModule() +{ + m_moduleEditorWindow.Initialize(); + m_moduleEditorWindow.Disable(); + +} + + void MainWindow::ImportProject(const std::string &filePathName, int format) { (void) format; diff --git a/story-editor/src/windows/main_window.h b/story-editor/src/windows/main_window.h index 2cfb42a..ad022b7 100644 --- a/story-editor/src/windows/main_window.h +++ b/story-editor/src/windows/main_window.h @@ -84,7 +84,8 @@ public: private: enum VmEventType { EvNoEvent, EvStep, EvRun, EvOkButton, EvPreviousButton, EvNextButton, EvAudioFinished, EvStop, EvHomeButton}; - std::shared_ptr m_story; + std::shared_ptr m_story; // Current story + std::shared_ptr m_module; // Current module // VM uint8_t m_rom_data[16*1024]; @@ -136,10 +137,12 @@ private: WebServer m_webServer; // From IStoryManager (proxy to StoryProject class) - virtual void OpenProject(const std::string &uuid, IStoryManager::ProjectType type) override; - - void SaveProject(IStoryManager::ProjectType type); - void CloseProject(IStoryManager::ProjectType type); + virtual void OpenProject(const std::string &uuid) override; + void SaveProject(); + void CloseProject(); + + void OpenModule(const std::string &uuid); + void CloseModule(); // From IStoryManager (proxy to StoryProject class) virtual void ImportProject(const std::string &filePathName, int format);