diff options
-rw-r--r-- | SConstruct | 4 | ||||
-rw-r--r-- | core/SCsub | 3 | ||||
-rw-r--r-- | drivers/SCsub | 3 | ||||
-rw-r--r-- | editor/SCsub | 3 | ||||
-rw-r--r-- | editor/editor_help.cpp | 3 | ||||
-rw-r--r-- | editor/editor_node.cpp | 5 | ||||
-rw-r--r-- | editor/filesystem_dock.cpp | 19 | ||||
-rw-r--r-- | editor/property_editor.cpp | 5 | ||||
-rw-r--r-- | editor/property_editor.h | 1 | ||||
-rw-r--r-- | main/SCsub | 3 | ||||
-rw-r--r-- | main/tests/SCsub | 3 | ||||
-rw-r--r-- | methods.py | 27 | ||||
-rw-r--r-- | modules/SCsub | 3 | ||||
-rw-r--r-- | modules/freetype/SCsub | 3 | ||||
-rw-r--r-- | modules/gdnative/SCsub | 3 | ||||
-rw-r--r-- | modules/recast/SCsub | 3 | ||||
-rw-r--r-- | modules/svg/SCsub | 3 | ||||
-rw-r--r-- | platform/SCsub | 3 | ||||
-rw-r--r-- | platform/android/SCsub | 3 | ||||
-rw-r--r-- | platform/haiku/SCsub | 2 | ||||
-rw-r--r-- | platform/iphone/SCsub | 3 | ||||
-rw-r--r-- | platform/javascript/SCsub | 2 | ||||
-rw-r--r-- | platform/javascript/os_javascript.cpp | 4 | ||||
-rw-r--r-- | platform/osx/SCsub | 3 | ||||
-rw-r--r-- | platform/server/SCsub | 3 | ||||
-rw-r--r-- | platform/uwp/SCsub | 3 | ||||
-rw-r--r-- | platform/windows/SCsub | 3 | ||||
-rw-r--r-- | platform/x11/SCsub | 3 | ||||
-rw-r--r-- | scene/SCsub | 3 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 6 | ||||
-rw-r--r-- | servers/SCsub | 3 |
31 files changed, 72 insertions, 66 deletions
diff --git a/SConstruct b/SConstruct index 7c171c8015..17c809c179 100644 --- a/SConstruct +++ b/SConstruct @@ -121,6 +121,10 @@ env_base.__class__.add_source_files = methods.add_source_files env_base.__class__.use_windows_spawn_fix = methods.use_windows_spawn_fix env_base.__class__.split_lib = methods.split_lib +env_base.__class__.add_shared_library = methods.add_shared_library +env_base.__class__.add_library = methods.add_library +env_base.__class__.add_program = methods.add_program + env_base["x86_libtheora_opt_gcc"] = False env_base["x86_libtheora_opt_vc"] = False diff --git a/core/SCsub b/core/SCsub index be2034409e..1545bc8aeb 100644 --- a/core/SCsub +++ b/core/SCsub @@ -105,7 +105,6 @@ SConscript('helper/SCsub') # Build it all as a library -lib = env.Library("core", env.core_sources) -env.NoCache(lib) +lib = env.add_library("core", env.core_sources) env.Prepend(LIBS=[lib]) Export('env') diff --git a/drivers/SCsub b/drivers/SCsub index d96d0ed7a9..daa5ff623b 100644 --- a/drivers/SCsub +++ b/drivers/SCsub @@ -45,6 +45,5 @@ if env.split_drivers: env.split_lib("drivers") else: env.add_source_files(env.drivers_sources, "*.cpp") - lib = env.Library("drivers", env.drivers_sources) - env.NoCache(lib) + lib = env.add_library("drivers", env.drivers_sources) env.Prepend(LIBS=[lib]) diff --git a/editor/SCsub b/editor/SCsub index 8a0e36b4a3..8f87e12cb9 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -474,8 +474,7 @@ if env['tools']: SConscript('import/SCsub') SConscript('plugins/SCsub') - lib = env.Library("editor", env.editor_sources) - env.NoCache(lib) + lib = env.add_library("editor", env.editor_sources) env.Prepend(LIBS=[lib]) Export('env') diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 4b372e7afd..5fc27c2e3c 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -433,12 +433,11 @@ void EditorHelpIndex::_update_class_list() { while (type != "") { if (filter.is_subsequence_ofi(type)) { - if (to_select.empty()) { + if (to_select.empty() || type.length() < to_select.length()) { to_select = type; } found = true; - break; } type = EditorHelp::get_doc_data()->class_list[type].inherits; diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index b5c7187b81..fbf6c86c35 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1475,7 +1475,6 @@ void EditorNode::_edit_current() { object_menu->set_disabled(true); bool capitalize = bool(EDITOR_DEF("interface/editor/capitalize_properties", true)); - bool expandall = bool(EDITOR_DEF("interface/editor/expand_all_properties", true)); bool is_resource = current_obj->is_class("Resource"); bool is_node = current_obj->is_class("Node"); resource_save_button->set_disabled(!is_resource); @@ -1547,10 +1546,6 @@ void EditorNode::_edit_current() { property_editor->set_enable_capitalize_paths(capitalize); } - if (property_editor->is_expand_all_properties_enabled() != expandall) { - property_editor->set_use_folding(expandall == false); - } - /* Take care of PLUGIN EDITOR */ EditorPlugin *main_plugin = editor_data.get_editor(current_obj); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index a5445ca153..9fe3e2ad25 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -781,6 +781,20 @@ void FileSystemDock::_try_move_item(const FileOrFolder &p_item, const String &p_ } } + // update scene if it is open + for (int i = 0; i < changed_paths.size(); ++i) { + String new_item_path = p_item.is_file ? new_path : changed_paths[i].replace_first(old_path, new_path); + if (ResourceLoader::get_resource_type(new_item_path) == "PackedScene" && editor->is_scene_open(changed_paths[i])) { + EditorData *ed = &editor->get_editor_data(); + for (int j = 0; j < ed->get_edited_scene_count(); j++) { + if (ed->get_scene_path(j) == changed_paths[i]) { + ed->get_edited_scene_root(j)->set_filename(new_item_path); + break; + } + } + } + } + //Only treat as a changed dependency if it was successfully moved for (int i = 0; i < changed_paths.size(); ++i) { p_renames[changed_paths[i]] = changed_paths[i].replace_first(old_path, new_path); @@ -803,7 +817,10 @@ void FileSystemDock::_update_dependencies_after_move(const Map<String, String> & String file = p_renames.has(remaps[i]) ? p_renames[remaps[i]] : remaps[i]; print_line("Remapping dependencies for: " + file); Error err = ResourceLoader::rename_dependencies(file, p_renames); - if (err != OK) { + if (err == OK) { + if (ResourceLoader::get_resource_type(file) == "PackedScene") + editor->reload_scene(file); + } else { EditorNode::get_singleton()->add_io_error(TTR("Unable to update dependencies:\n") + remaps[i] + "\n"); } } diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index d383e54f05..d573a44cdd 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -2665,12 +2665,12 @@ TreeItem *PropertyEditor::get_parent_node(String p_path, HashMap<String, TreeIte item->set_editable(1, false); item->set_selectable(1, subsection_selectable); - if (use_folding) { + if (use_folding || folding_behaviour != FB_UNDEFINED) { // Even if you disabled folding (expand all by default), you still can collapse all manually. if (!obj->editor_is_section_unfolded(p_path)) { updating_folding = true; if (folding_behaviour == FB_COLLAPSEALL) item->set_collapsed(true); - else if (folding_behaviour == FB_EXPANDALL) + else if (folding_behaviour == FB_EXPANDALL || is_expandall_enabled) item->set_collapsed(false); else item->set_collapsed(true); @@ -4310,6 +4310,7 @@ PropertyEditor::PropertyEditor() { property_selectable = false; show_type_icons = false; // maybe one day will return. folding_behaviour = FB_UNDEFINED; + is_expandall_enabled = bool(EDITOR_DEF("interface/editor/expand_all_properties", true)); } PropertyEditor::~PropertyEditor() { diff --git a/editor/property_editor.h b/editor/property_editor.h index 299e8d3cd7..a337a05e46 100644 --- a/editor/property_editor.h +++ b/editor/property_editor.h @@ -203,6 +203,7 @@ class PropertyEditor : public Control { bool hide_script; bool use_folding; bool property_selectable; + bool is_expandall_enabled; bool updating_folding; diff --git a/main/SCsub b/main/SCsub index 74a350ea01..2cc617fc2c 100644 --- a/main/SCsub +++ b/main/SCsub @@ -56,6 +56,5 @@ env.Command("#main/app_icon.gen.h", "#main/app_icon.png", make_app_icon) SConscript('tests/SCsub') -lib = env.Library("main", env.main_sources) -env.NoCache(lib) +lib = env.add_library("main", env.main_sources) env.Prepend(LIBS=[lib]) diff --git a/main/tests/SCsub b/main/tests/SCsub index bb44e9e5da..26a0819ee8 100644 --- a/main/tests/SCsub +++ b/main/tests/SCsub @@ -9,6 +9,5 @@ Export('env') # SConscript('math/SCsub'); -lib = env.Library("tests", env.tests_sources) -env.NoCache(lib) +lib = env.add_library("tests", env.tests_sources) env.Prepend(LIBS=[lib]) diff --git a/methods.py b/methods.py index 0bf5c01462..e861303e63 100644 --- a/methods.py +++ b/methods.py @@ -1495,30 +1495,26 @@ def split_lib(self, libname): base = string.join(fname.split("/")[:2], "/") if base != cur_base and len(list) > max_src: if num > 0: - lib = env.Library(libname + str(num), list) - env.NoCache(lib) + lib = env.add_library(libname + str(num), list) lib_list.append(lib) list = [] num = num + 1 cur_base = base list.append(f) - lib = env.Library(libname + str(num), list) - env.NoCache(lib) + lib = env.add_library(libname + str(num), list) lib_list.append(lib) if len(lib_list) > 0: import os, sys if os.name == 'posix' and sys.platform == 'msys': env.Replace(ARFLAGS=['rcsT']) - lib = env.Library(libname + "_collated", lib_list) - env.NoCache(lib) + lib = env.add_library(libname + "_collated", lib_list) lib_list = [lib] lib_base = [] env.add_source_files(lib_base, "*.cpp") - lib = env.Library(libname, lib_base) - env.NoCache(lib) + lib = env.add_library(libname, lib_base) lib_list.insert(0, lib) env.Prepend(LIBS=lib_list) @@ -1757,3 +1753,18 @@ def precious_program(env, program, sources, **args): program = env.ProgramOriginal(program, sources, **args) env.Precious(program) return program + +def add_shared_library(env, name, sources, **args): + library = env.SharedLibrary(name, sources, **args) + env.NoCache(library) + return library + +def add_library(env, name, sources, **args): + library = env.Library(name, sources, **args) + env.NoCache(library) + return library + +def add_program(env, name, sources, **args): + program = env.Program(name, sources, **args) + env.NoCache(program) + return program diff --git a/modules/SCsub b/modules/SCsub index ea8b58b8c5..e3c535e981 100644 --- a/modules/SCsub +++ b/modules/SCsub @@ -17,7 +17,6 @@ for x in env.module_list: env_modules.Append(CPPFLAGS=["-DMODULE_" + x.upper() + "_ENABLED"]) SConscript(x + "/SCsub") -lib = env_modules.Library("modules", env.modules_sources) -env_modules.NoCache(lib) +lib = env_modules.add_library("modules", env.modules_sources) env.Prepend(LIBS=[lib]) diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub index 9169c7d674..f69b632e76 100644 --- a/modules/freetype/SCsub +++ b/modules/freetype/SCsub @@ -68,8 +68,7 @@ if env['builtin_freetype']: if env['builtin_libpng']: env.Append(CPPPATH=["#thirdparty/libpng"]) - lib = env.Library("freetype_builtin", thirdparty_sources) - env.NoCache(lib) + lib = env.add_library("freetype_builtin", thirdparty_sources) # Needs to be appended to arrive after libscene in the linker call, # but we don't want it to arrive *after* system libs, so manual hack # LIBS contains first SCons Library objects ("SCons.Node.FS.File object") diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index 1641d26cbf..fd11c8d094 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -248,5 +248,4 @@ if ARGUMENTS.get('gdnative_wrapper', False): if not env.msvc: gd_wrapper_env.Append(CCFLAGS=['-fPIC']) - lib = gd_wrapper_env.Library("#bin/gdnative_wrapper_code", [gensource]) - gd_wrapper_env.NoCache(lib) + lib = gd_wrapper_env.add_library("#bin/gdnative_wrapper_code", [gensource]) diff --git a/modules/recast/SCsub b/modules/recast/SCsub index 335ab6c16e..530df9a37c 100644 --- a/modules/recast/SCsub +++ b/modules/recast/SCsub @@ -24,8 +24,7 @@ if env['builtin_recast']: env.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/Include"]) - lib = env.Library("recast_builtin", thirdparty_sources) - env.NoCache(lib) + lib = env.add_library("recast_builtin", thirdparty_sources) env.Append(LIBS=[lib]) # Godot source files diff --git a/modules/svg/SCsub b/modules/svg/SCsub index 1b71fbeca4..e12abac8c1 100644 --- a/modules/svg/SCsub +++ b/modules/svg/SCsub @@ -12,8 +12,7 @@ thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] # env.add_source_files(env.modules_sources, thirdparty_sources) -lib = env.Library("svg_builtin", thirdparty_sources) -env.NoCache(lib) +lib = env.add_library("svg_builtin", thirdparty_sources) # Needs to be appended to arrive after libscene in the linker call, # but we don't want it to arrive *after* system libs, so manual hack diff --git a/platform/SCsub b/platform/SCsub index a362371f93..e624f8e90f 100644 --- a/platform/SCsub +++ b/platform/SCsub @@ -25,8 +25,7 @@ f.write(unreg_apis) f.close() platform_sources.append('register_platform_apis.gen.cpp') -lib = env.Library('platform', platform_sources) -env.NoCache(lib) +lib = env.add_library('platform', platform_sources) env.Prepend(LIBS=lib) Export('env') diff --git a/platform/android/SCsub b/platform/android/SCsub index 74349cb0ad..0cd91276ef 100644 --- a/platform/android/SCsub +++ b/platform/android/SCsub @@ -144,8 +144,7 @@ manifest = manifest.replace("$$ADD_APPATTRIBUTE_CHUNKS$$", env.android_appattrib pp_baseout.write(manifest) -lib = env_android.SharedLibrary("#bin/libgodot", [android_objects], SHLIBSUFFIX=env["SHLIBSUFFIX"]) -env_android.NoCache(lib) +lib = env_android.add_shared_library("#bin/libgodot", [android_objects], SHLIBSUFFIX=env["SHLIBSUFFIX"]) lib_arch_dir = '' if env['android_arch'] == 'armv6': diff --git a/platform/haiku/SCsub b/platform/haiku/SCsub index d0c244a194..592f56bbbf 100644 --- a/platform/haiku/SCsub +++ b/platform/haiku/SCsub @@ -12,7 +12,7 @@ common_haiku = [ 'audio_driver_media_kit.cpp' ] -target = env.Program( +target = env.add_program( '#bin/godot', ['godot_haiku.cpp'] + common_haiku ) diff --git a/platform/iphone/SCsub b/platform/iphone/SCsub index 5903934d7d..6b5f30dc41 100644 --- a/platform/iphone/SCsub +++ b/platform/iphone/SCsub @@ -17,8 +17,7 @@ iphone_lib = [ ] env_ios = env.Clone() -ios_lib = env_ios.Library('iphone', iphone_lib) -env_ios.NoCache(ios_lib) +ios_lib = env_ios.add_library('iphone', iphone_lib) def combine_libs(target=None, source=None, env=None): lib_path = target[0].srcnode().abspath diff --git a/platform/javascript/SCsub b/platform/javascript/SCsub index 8d505a5829..05992ebac8 100644 --- a/platform/javascript/SCsub +++ b/platform/javascript/SCsub @@ -22,7 +22,7 @@ for x in javascript_files: env.Append(LINKFLAGS=["-s", "EXPORTED_FUNCTIONS=\"['_main','_main_after_fs_sync','_send_notification']\""]) target_dir = env.Dir("#bin") -build = env.Program(['#bin/godot', target_dir.File('godot' + env['PROGSUFFIX'] + '.wasm')], javascript_objects, PROGSUFFIX=env['PROGSUFFIX'] + '.js'); +build = env.add_program(['#bin/godot', target_dir.File('godot' + env['PROGSUFFIX'] + '.wasm')], javascript_objects, PROGSUFFIX=env['PROGSUFFIX'] + '.js'); js_libraries = [] js_libraries.append(env.File('http_request.js')) diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index d5c675d9e0..3b02bfd862 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -201,7 +201,7 @@ static EM_BOOL _mousemove_callback(int event_type, const EmscriptenMouseEvent *m ev->set_position(pos); ev->set_global_position(ev->get_position()); - ev->set_relative(_input->get_mouse_position() - ev->get_position()); + ev->set_relative(ev->get_position() - _input->get_mouse_position()); _input->set_mouse_position(ev->get_position()); ev->set_speed(_input->get_last_mouse_speed()); @@ -336,7 +336,7 @@ static EM_BOOL _touchmove_callback(int event_type, const EmscriptenTouchEvent *t ev_mouse->set_position(Point2(first_touch.canvasX, first_touch.canvasY)); ev_mouse->set_global_position(ev_mouse->get_position()); - ev_mouse->set_relative(_input->get_mouse_position() - ev_mouse->get_position()); + ev_mouse->set_relative(ev_mouse->get_position() - _input->get_mouse_position()); _input->set_mouse_position(ev_mouse->get_position()); ev_mouse->set_speed(_input->get_last_mouse_speed()); diff --git a/platform/osx/SCsub b/platform/osx/SCsub index 16223654cc..cb88bc470a 100644 --- a/platform/osx/SCsub +++ b/platform/osx/SCsub @@ -16,8 +16,7 @@ files = [ 'power_osx.cpp', ] -prog = env.Program('#bin/godot', files) -env.NoCache(prog) +prog = env.add_program('#bin/godot', files) if env["debug_symbols"] == "full" or env["debug_symbols"] == "yes": env.AddPostAction(prog, make_debug) diff --git a/platform/server/SCsub b/platform/server/SCsub index 9e7bfda123..30d8cc8064 100644 --- a/platform/server/SCsub +++ b/platform/server/SCsub @@ -7,5 +7,4 @@ common_server = [\ "os_server.cpp",\ ] -prog = env.Program('#bin/godot_server', ['godot_server.cpp'] + common_server) -env.NoCache(prog) +prog = env.add_program('#bin/godot_server', ['godot_server.cpp'] + common_server) diff --git a/platform/uwp/SCsub b/platform/uwp/SCsub index ba375428a5..f0d69fef33 100644 --- a/platform/uwp/SCsub +++ b/platform/uwp/SCsub @@ -19,8 +19,7 @@ files = [ if "build_angle" in env and env["build_angle"]: cmd = env.AlwaysBuild(env.ANGLE('libANGLE.lib', None)) -prog = env.Program('#bin/godot', files) -env.NoCache(prog) +prog = env.add_program('#bin/godot', files) if "build_angle" in env and env["build_angle"]: env.Depends(prog, [cmd]) diff --git a/platform/windows/SCsub b/platform/windows/SCsub index 2fdb801c2e..5a253d5db5 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -28,8 +28,7 @@ obj = env.RES(restarget, 'godot_res.rc') common_win.append(obj) -prog = env.Program('#bin/godot', ['godot_win.cpp'] + common_win, PROGSUFFIX=env["PROGSUFFIX"]) -env.NoCache(prog) +prog = env.add_program('#bin/godot', ['godot_win.cpp'] + common_win, PROGSUFFIX=env["PROGSUFFIX"]) # Microsoft Visual Studio Project Generation if env['vsproj']: diff --git a/platform/x11/SCsub b/platform/x11/SCsub index 1eeee8380f..6378553638 100644 --- a/platform/x11/SCsub +++ b/platform/x11/SCsub @@ -17,8 +17,7 @@ common_x11 = [ "power_x11.cpp", ] -prog = env.Program('#bin/godot', ['godot_x11.cpp'] + common_x11) -env.NoCache(prog) +prog = env.add_program('#bin/godot', ['godot_x11.cpp'] + common_x11) if env["debug_symbols"] == "full" or env["debug_symbols"] == "yes": env.AddPostAction(prog, make_debug) diff --git a/scene/SCsub b/scene/SCsub index bec1b40ed6..5d81e818ba 100644 --- a/scene/SCsub +++ b/scene/SCsub @@ -30,8 +30,7 @@ SConscript('resources/SCsub') # Build it all as a library -lib = env.Library("scene", env.scene_sources) -env.NoCache(lib) +lib = env.add_library("scene", env.scene_sources) env.Prepend(LIBS=[lib]) Export('env') diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 166b55d6f3..6fa73e4b58 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -303,8 +303,6 @@ void TextEdit::_update_scrollbars() { int total_rows = (is_hiding_enabled() ? get_total_unhidden_rows() : text.size()); if (scroll_past_end_of_file_enabled) { total_rows += visible_rows - 1; - } else { - total_rows -= 1; } int vscroll_pixels = v_scroll->get_combined_minimum_size().width; @@ -3081,7 +3079,7 @@ void TextEdit::_scroll_down(real_t p_delta) { if (smooth_scroll_enabled) { int max_v_scroll = get_total_unhidden_rows(); if (!scroll_past_end_of_file_enabled) { - max_v_scroll -= get_visible_rows() + 1; + max_v_scroll -= get_visible_rows(); max_v_scroll = CLAMP(max_v_scroll, 0, get_total_unhidden_rows()); } @@ -3139,7 +3137,7 @@ void TextEdit::_scroll_lines_down() { // calculate the maximum vertical scroll position int max_v_scroll = get_total_unhidden_rows(); if (!scroll_past_end_of_file_enabled) { - max_v_scroll -= get_visible_rows() + 1; + max_v_scroll -= get_visible_rows(); max_v_scroll = CLAMP(max_v_scroll, 0, get_total_unhidden_rows()); } diff --git a/servers/SCsub b/servers/SCsub index ad43faf72e..252a18ffd3 100644 --- a/servers/SCsub +++ b/servers/SCsub @@ -13,7 +13,6 @@ SConscript('physics_2d/SCsub') SConscript('visual/SCsub') SConscript('audio/SCsub') -lib = env.Library("servers", env.servers_sources) -env.NoCache(lib) +lib = env.add_library("servers", env.servers_sources) env.Prepend(LIBS=[lib]) |