mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Merge commit godotengine/godot@8004c7524f
This commit is contained in:
22
methods.py
22
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 opt not in self or not self[opt] or not module_check_dependencies(self, dep):
|
||||
missing_deps.add(dep)
|
||||
|
||||
if missing_deps != []:
|
||||
print_warning(
|
||||
"Disabling '{}' module as the following dependencies are not satisfied: {}".format(
|
||||
module, ", ".join(missing_deps)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user