diff --git a/src/Module_Nodes/Module_Nodes.cpp b/src/Module_Nodes/Module_Nodes.cpp index 401c93fb..6733d16d 100644 --- a/src/Module_Nodes/Module_Nodes.cpp +++ b/src/Module_Nodes/Module_Nodes.cpp @@ -335,7 +335,3 @@ void Module_Nodes::debug_show_nodes_and_links_registries_windows(Ui_Ref ui) cons } } // namespace Lab - -#include -#include -CEREAL_REGISTER_TYPE(Lab::Module_Nodes); // NOLINT \ No newline at end of file diff --git a/src/Module_Nodes/NodesCategoryConfig.cpp b/src/Module_Nodes/NodesCategoryConfig.cpp index 9285480d..a1378bc6 100644 --- a/src/Module_Nodes/NodesCategoryConfig.cpp +++ b/src/Module_Nodes/NodesCategoryConfig.cpp @@ -1,23 +1,22 @@ #include "NodesCategoryConfig.h" #include -#include #include #include #include "Cool/Path/Path.h" -#include "Cool/Serialization/Serialization.h" #include "Cool/Variables/internal/color_utils.h" +#include "Serialization/SNodesCategoryConfig.h" #include "imgui.h" namespace Lab { void NodesCategoryConfig::save_to_json() const { - Cool::Serialization::save(*this, _path_to_json); + serialize_nodes_cat_cfg(*this, _path_to_json); } void NodesCategoryConfig::load_from_json() { - Cool::Serialization::load(*this, _path_to_json) + deserialize(*this, _path_to_json) .send_error_if_any([&](std::string const& message) { return Cool::Message{ .category = "Nodes Category", diff --git a/src/Serialization/SNodesCategoryConfig.h b/src/Serialization/SNodesCategoryConfig.h new file mode 100644 index 00000000..b9e0bca4 --- /dev/null +++ b/src/Serialization/SNodesCategoryConfig.h @@ -0,0 +1,11 @@ +#pragma once +#include +#include "Cool/Log/OptionalErrorMessage.h" +#include "Module_Nodes/NodesCategoryConfig.h" + +namespace Lab { + +auto serialize_nodes_cat_cfg(NodesCategoryConfig const& config, std::filesystem::path const& path) -> bool; +auto deserialize(NodesCategoryConfig& config, std::filesystem::path const& path) -> Cool::OptionalErrorMessage; + +} // namespace Lab \ No newline at end of file diff --git a/src/Serialization/impl.cpp b/src/Serialization/impl.cpp index 6bf5a3fb..f95805db 100644 --- a/src/Serialization/impl.cpp +++ b/src/Serialization/impl.cpp @@ -5,7 +5,10 @@ /// this file as much as possible. /// +#include #include "Cool/Serialization/Serialization.h" +#include "Module_Nodes/Module_Nodes.h" +#include "SNodesCategoryConfig.h" #include "SProject.h" // @@ -17,10 +20,20 @@ auto serialize(Project const& project, std::filesystem::path const& path) -> boo { return Cool::Serialization::save(project, path, "Project"); } - auto deserialize(Project& project, std::filesystem::path const& path) -> Cool::OptionalErrorMessage { return Cool::Serialization::load(project, path); } -} // namespace Lab \ No newline at end of file +auto serialize_nodes_cat_cfg(NodesCategoryConfig const& config, std::filesystem::path const& path) -> bool +{ + return Cool::Serialization::save(config, path); +} +auto deserialize(NodesCategoryConfig& config, std::filesystem::path const& path) -> Cool::OptionalErrorMessage +{ + return Cool::Serialization::load(config, path); +} + +} // namespace Lab + +CEREAL_REGISTER_TYPE(Lab::Module_Nodes); // NOLINT \ No newline at end of file