diff --git a/SConstruct b/SConstruct index a619ea0797..c2524a4a4d 100644 --- a/SConstruct +++ b/SConstruct @@ -399,6 +399,7 @@ if selected_platform in platform_list: sys.modules.pop('detect') env.module_list = [] + env.module_icons_paths = [] env.doc_class_path = {} for x in module_list: @@ -421,13 +422,22 @@ if selected_platform in platform_list: if (can_build): config.configure(env) env.module_list.append(x) + + # Get doc classes paths (if present) try: - doc_classes = config.get_doc_classes() - doc_path = config.get_doc_path() - for c in doc_classes: - env.doc_class_path[c] = "modules/" + x + "/" + doc_path + doc_classes = config.get_doc_classes() + doc_path = config.get_doc_path() + for c in doc_classes: + env.doc_class_path[c] = "modules/" + x + "/" + doc_path except: pass + # Get icon paths (if present) + try: + icons_path = config.get_icons_path() + env.module_icons_paths.append("modules/" + x + "/" + icons_path) + except: + # Default path for module icons + env.module_icons_paths.append("modules/" + x + "/" + "icons") sys.path.remove(tmppath) sys.modules.pop('config') diff --git a/editor/icons/SCsub b/editor/icons/SCsub index 109e1aa83b..b39c74c66a 100644 --- a/editor/icons/SCsub +++ b/editor/icons/SCsub @@ -10,4 +10,12 @@ make_editor_icons_builder = Builder(action=run_in_subprocess(editor_icons_builde src_suffix='.svg') env['BUILDERS']['MakeEditorIconsBuilder'] = make_editor_icons_builder -env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#editor/editor_icons.gen.h', Glob("*.svg"))]) + +# Editor's own icons +icon_sources = Glob("*.svg") + +# Module icons +for module_icons in env.module_icons_paths: + icon_sources += Glob('#' + module_icons + "/*.svg") + +env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#editor/editor_icons.gen.h', icon_sources)]) diff --git a/editor/icons/icon_c_s_g_box.svg b/modules/csg/icons/icon_c_s_g_box.svg similarity index 100% rename from editor/icons/icon_c_s_g_box.svg rename to modules/csg/icons/icon_c_s_g_box.svg diff --git a/editor/icons/icon_c_s_g_capsule.svg b/modules/csg/icons/icon_c_s_g_capsule.svg similarity index 100% rename from editor/icons/icon_c_s_g_capsule.svg rename to modules/csg/icons/icon_c_s_g_capsule.svg diff --git a/editor/icons/icon_c_s_g_combiner.svg b/modules/csg/icons/icon_c_s_g_combiner.svg similarity index 100% rename from editor/icons/icon_c_s_g_combiner.svg rename to modules/csg/icons/icon_c_s_g_combiner.svg diff --git a/editor/icons/icon_c_s_g_cylinder.svg b/modules/csg/icons/icon_c_s_g_cylinder.svg similarity index 100% rename from editor/icons/icon_c_s_g_cylinder.svg rename to modules/csg/icons/icon_c_s_g_cylinder.svg diff --git a/editor/icons/icon_c_s_g_mesh.svg b/modules/csg/icons/icon_c_s_g_mesh.svg similarity index 100% rename from editor/icons/icon_c_s_g_mesh.svg rename to modules/csg/icons/icon_c_s_g_mesh.svg diff --git a/editor/icons/icon_c_s_g_polygon.svg b/modules/csg/icons/icon_c_s_g_polygon.svg similarity index 100% rename from editor/icons/icon_c_s_g_polygon.svg rename to modules/csg/icons/icon_c_s_g_polygon.svg diff --git a/editor/icons/icon_c_s_g_sphere.svg b/modules/csg/icons/icon_c_s_g_sphere.svg similarity index 100% rename from editor/icons/icon_c_s_g_sphere.svg rename to modules/csg/icons/icon_c_s_g_sphere.svg diff --git a/editor/icons/icon_c_s_g_torus.svg b/modules/csg/icons/icon_c_s_g_torus.svg similarity index 100% rename from editor/icons/icon_c_s_g_torus.svg rename to modules/csg/icons/icon_c_s_g_torus.svg diff --git a/editor/icons/icon_g_d_native_library.svg b/modules/gdnative/icons/icon_g_d_native_library.svg similarity index 100% rename from editor/icons/icon_g_d_native_library.svg rename to modules/gdnative/icons/icon_g_d_native_library.svg diff --git a/editor/icons/icon_native_script.svg b/modules/gdnative/icons/icon_native_script.svg similarity index 100% rename from editor/icons/icon_native_script.svg rename to modules/gdnative/icons/icon_native_script.svg diff --git a/editor/icons/icon_g_d_script.svg b/modules/gdscript/icons/icon_g_d_script.svg similarity index 100% rename from editor/icons/icon_g_d_script.svg rename to modules/gdscript/icons/icon_g_d_script.svg diff --git a/editor/icons/icon_grid_map.svg b/modules/gridmap/icons/icon_grid_map.svg similarity index 100% rename from editor/icons/icon_grid_map.svg rename to modules/gridmap/icons/icon_grid_map.svg diff --git a/editor/icons/icon_noise_texture.svg b/modules/opensimplex/icons/icon_noise_texture.svg similarity index 100% rename from editor/icons/icon_noise_texture.svg rename to modules/opensimplex/icons/icon_noise_texture.svg diff --git a/editor/icons/icon_visual_script.svg b/modules/visual_script/icons/icon_visual_script.svg similarity index 100% rename from editor/icons/icon_visual_script.svg rename to modules/visual_script/icons/icon_visual_script.svg