From 8ab6673e11cc9998b9b880db549c1868e9bde694 Mon Sep 17 00:00:00 2001 From: Renato Machado Date: Sun, 14 May 2023 00:14:46 -0300 Subject: [PATCH] commit --- .../game_attachedeffects/attachedeffects.otmod | 2 +- src/framework/core/module.cpp | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/game_attachedeffects/attachedeffects.otmod b/modules/game_attachedeffects/attachedeffects.otmod index 778ff66ec7..3513ae4f5f 100644 --- a/modules/game_attachedeffects/attachedeffects.otmod +++ b/modules/game_attachedeffects/attachedeffects.otmod @@ -3,7 +3,7 @@ Module description: Attached Effects System, to create aura, wings... author: Mehah website: - scripts: [lib, attachedeffects, effects, configs/outfit_618] + scripts: [lib, attachedeffects, effects, configs/*] sandboxed: true @onLoad: controller:init() @onUnload: controller:terminate() \ No newline at end of file diff --git a/src/framework/core/module.cpp b/src/framework/core/module.cpp index 45a2508049..feeb239821 100644 --- a/src/framework/core/module.cpp +++ b/src/framework/core/module.cpp @@ -235,8 +235,19 @@ void Module::discover(const OTMLNodePtr& moduleNode) } if (const auto& node = moduleNode->get("scripts")) { - for (const auto& tmp : node->children()) - m_scripts.emplace_back(stdext::resolve_path(tmp->value(), node->source())); + for (const auto& tmp : node->children()) { + auto path = stdext::resolve_path(tmp->value(), node->source()); + + if (path.ends_with('*')) { + path.pop_back(); + for (const auto& filePath : g_resources.listDirectoryFiles(path, true, false, true)) { + if (g_resources.isFileType(filePath, "lua")) { + m_scripts.emplace_back(filePath); + } + } + } else + m_scripts.emplace_back(path); + } } if (const auto& node = moduleNode->get("load-later")) {