summaryrefslogtreecommitdiffstats
path: root/methods.py
diff options
context:
space:
mode:
authorSpartan322 <Megacake1234@gmail.com>2024-10-30 05:22:24 -0400
committerSpartan322 <Megacake1234@gmail.com>2024-10-30 05:22:24 -0400
commit82de309d58c5f0e221b85463cca2983cd7ed0289 (patch)
tree5c87dc486c61310a1eafc2e7cb2fd52be0d52e22 /methods.py
parent77eaec766e2e40f2a5d399989d827f9582a3be15 (diff)
parent8004c7524fb9f43425c4d6f614410a76678e0f7c (diff)
downloadredot-engine-82de309d58c5f0e221b85463cca2983cd7ed0289.tar.gz
Merge commit godotengine/godot@8004c7524fb9f43425c4d6f614410a76678e0f7c
Diffstat (limited to 'methods.py')
-rw-r--r--methods.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/methods.py b/methods.py
index 08ab7d6923..6bd93cb3f5 100644
--- a/methods.py
+++ b/methods.py
@@ -416,10 +416,6 @@ def convert_custom_modules_path(path):
return path
-def disable_module(self):
- self.disabled_modules.append(self.current_module)
-
-
def module_add_dependencies(self, module, dependencies, optional=False):
"""
Adds dependencies for a given module.
@@ -440,19 +436,21 @@ def module_check_dependencies(self, module):
Meant to be used in module `can_build` methods.
Returns a boolean (True if dependencies are satisfied).
"""
- missing_deps = []
+ missing_deps = set()
required_deps = self.module_dependencies[module][0] if module in self.module_dependencies else []
for dep in required_deps:
opt = "module_{}_enabled".format(dep)
- if opt not in self or not self[opt]:
- missing_deps.append(dep)
-
- if missing_deps != []:
- print_warning(
- "Disabling '{}' module as the following dependencies are not satisfied: {}".format(
- module, ", ".join(missing_deps)
+ if opt not in self or not self[opt] or not module_check_dependencies(self, dep):
+ missing_deps.add(dep)
+
+ if missing_deps:
+ if module not in self.disabled_modules:
+ print_warning(
+ "Disabling '{}' module as the following dependencies are not satisfied: {}".format(
+ module, ", ".join(missing_deps)
+ )
)
- )
+ self.disabled_modules.add(module)
return False
else:
return True