summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/Godot.app/Contents/Info.plist4
-rw-r--r--tools/addheader/addheader.py2
-rw-r--r--tools/addheader/header.txt2
-rw-r--r--tools/collada/collada.cpp2
-rw-r--r--tools/collada/collada.h2
-rw-r--r--tools/doc/doc_data.cpp10
-rw-r--r--tools/doc/doc_data.h2
-rw-r--r--tools/docdump/doc_dump.cpp2
-rw-r--r--tools/docdump/doc_dump.h2
-rw-r--r--tools/editor/animation_editor.cpp2
-rw-r--r--tools/editor/animation_editor.h2
-rw-r--r--tools/editor/array_property_edit.cpp10
-rw-r--r--tools/editor/call_dialog.cpp2
-rw-r--r--tools/editor/call_dialog.h2
-rw-r--r--tools/editor/code_editor.cpp3
-rw-r--r--tools/editor/code_editor.h2
-rw-r--r--tools/editor/connections_dialog.cpp2
-rw-r--r--tools/editor/connections_dialog.h2
-rw-r--r--tools/editor/console.cpp386
-rw-r--r--tools/editor/console.h116
-rw-r--r--tools/editor/create_dialog.cpp2
-rw-r--r--tools/editor/create_dialog.h2
-rw-r--r--tools/editor/default_saver.cpp2
-rw-r--r--tools/editor/default_saver.h2
-rw-r--r--tools/editor/doc_code_font.h2
-rw-r--r--tools/editor/doc_font.h2
-rw-r--r--tools/editor/doc_title_font.h2
-rw-r--r--tools/editor/editor_data.cpp2
-rw-r--r--tools/editor/editor_data.h2
-rw-r--r--tools/editor/editor_dir_dialog.cpp2
-rw-r--r--tools/editor/editor_dir_dialog.h2
-rw-r--r--tools/editor/editor_file_dialog.cpp2
-rw-r--r--tools/editor/editor_file_dialog.h2
-rw-r--r--tools/editor/editor_file_system.cpp950
-rw-r--r--tools/editor/editor_file_system.h89
-rw-r--r--tools/editor/editor_fonts.cpp2
-rw-r--r--tools/editor/editor_fonts.h2
-rw-r--r--tools/editor/editor_help.cpp2
-rw-r--r--tools/editor/editor_help.h2
-rw-r--r--tools/editor/editor_icons.h2
-rw-r--r--tools/editor/editor_import_export.cpp2
-rw-r--r--tools/editor/editor_import_export.h2
-rw-r--r--tools/editor/editor_log.cpp2
-rw-r--r--tools/editor/editor_log.h2
-rw-r--r--tools/editor/editor_name_dialog.cpp2
-rw-r--r--tools/editor/editor_name_dialog.h2
-rw-r--r--tools/editor/editor_node.cpp104
-rw-r--r--tools/editor/editor_node.h6
-rw-r--r--tools/editor/editor_path.cpp2
-rw-r--r--tools/editor/editor_path.h2
-rw-r--r--tools/editor/editor_plugin.cpp2
-rw-r--r--tools/editor/editor_plugin.h2
-rw-r--r--tools/editor/editor_reimport_dialog.cpp2
-rw-r--r--tools/editor/editor_reimport_dialog.h2
-rw-r--r--tools/editor/editor_run.cpp2
-rw-r--r--tools/editor/editor_run.h2
-rw-r--r--tools/editor/editor_run_native.cpp2
-rw-r--r--tools/editor/editor_run_native.h2
-rw-r--r--tools/editor/editor_selection.cpp2
-rw-r--r--tools/editor/editor_selection.h2
-rw-r--r--tools/editor/editor_settings.cpp2
-rw-r--r--tools/editor/editor_settings.h2
-rw-r--r--tools/editor/editor_sub_scene.cpp2
-rw-r--r--tools/editor/editor_sub_scene.h2
-rw-r--r--tools/editor/editor_vu.cpp2
-rw-r--r--tools/editor/editor_vu.h2
-rw-r--r--tools/editor/file_type_cache.cpp2
-rw-r--r--tools/editor/file_type_cache.h2
-rw-r--r--tools/editor/groups_editor.cpp2
-rw-r--r--tools/editor/groups_editor.h2
-rw-r--r--tools/editor/icons/icon_edit_pivot.pngbin0 -> 407 bytes
-rw-r--r--tools/editor/import_settings.cpp2
-rw-r--r--tools/editor/import_settings.h2
-rw-r--r--tools/editor/io_plugins/editor_atlas.cpp2
-rw-r--r--tools/editor/io_plugins/editor_atlas.h2
-rw-r--r--tools/editor/io_plugins/editor_font_import_plugin.cpp24
-rw-r--r--tools/editor/io_plugins/editor_font_import_plugin.h2
-rw-r--r--tools/editor/io_plugins/editor_import_collada.cpp2
-rw-r--r--tools/editor/io_plugins/editor_import_collada.h2
-rw-r--r--tools/editor/io_plugins/editor_sample_import_plugin.cpp2
-rw-r--r--tools/editor/io_plugins/editor_sample_import_plugin.h2
-rw-r--r--tools/editor/io_plugins/editor_scene_import_plugin.cpp2
-rw-r--r--tools/editor/io_plugins/editor_scene_import_plugin.h2
-rw-r--r--tools/editor/io_plugins/editor_texture_import_plugin.cpp2
-rw-r--r--tools/editor/io_plugins/editor_texture_import_plugin.h2
-rw-r--r--tools/editor/io_plugins/editor_translation_import_plugin.cpp2
-rw-r--r--tools/editor/io_plugins/editor_translation_import_plugin.h2
-rw-r--r--tools/editor/optimized_save_dialog.cpp2
-rw-r--r--tools/editor/optimized_save_dialog.h2
-rw-r--r--tools/editor/output_strings.cpp2
-rw-r--r--tools/editor/output_strings.h2
-rw-r--r--tools/editor/pane_drag.cpp2
-rw-r--r--tools/editor/pane_drag.h2
-rw-r--r--tools/editor/plugins/animation_data_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/animation_data_editor_plugin.h2
-rw-r--r--tools/editor/plugins/animation_player_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/animation_player_editor_plugin.h2
-rw-r--r--tools/editor/plugins/animation_tree_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/animation_tree_editor_plugin.h2
-rw-r--r--tools/editor/plugins/camera_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/camera_editor_plugin.h2
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.cpp104
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.h6
-rw-r--r--tools/editor/plugins/collision_polygon_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/collision_polygon_editor_plugin.h2
-rw-r--r--tools/editor/plugins/control_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/control_editor_plugin.h2
-rw-r--r--tools/editor/plugins/cube_grid_theme_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/cube_grid_theme_editor_plugin.h2
-rw-r--r--tools/editor/plugins/editor_preview_plugins.cpp76
-rw-r--r--tools/editor/plugins/editor_preview_plugins.h11
-rw-r--r--tools/editor/plugins/item_list_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/item_list_editor_plugin.h2
-rw-r--r--tools/editor/plugins/multimesh_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/multimesh_editor_plugin.h2
-rw-r--r--tools/editor/plugins/particles_2d_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/particles_2d_editor_plugin.h2
-rw-r--r--tools/editor/plugins/particles_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/particles_editor_plugin.h2
-rw-r--r--tools/editor/plugins/path_2d_editor_plugin.cpp4
-rw-r--r--tools/editor/plugins/path_2d_editor_plugin.h2
-rw-r--r--tools/editor/plugins/path_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/path_editor_plugin.h2
-rw-r--r--tools/editor/plugins/polygon_2d_editor_plugin.cpp3
-rw-r--r--tools/editor/plugins/resource_preloader_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/resource_preloader_editor_plugin.h2
-rw-r--r--tools/editor/plugins/rich_text_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/rich_text_editor_plugin.h2
-rw-r--r--tools/editor/plugins/sample_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/sample_editor_plugin.h2
-rw-r--r--tools/editor/plugins/sample_library_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/sample_library_editor_plugin.h2
-rw-r--r--tools/editor/plugins/sample_player_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/sample_player_editor_plugin.h2
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp11
-rw-r--r--tools/editor/plugins/script_editor_plugin.h2
-rw-r--r--tools/editor/plugins/shader_editor_plugin.cpp9
-rw-r--r--tools/editor/plugins/shader_editor_plugin.h2
-rw-r--r--tools/editor/plugins/shader_graph_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/shader_graph_editor_plugin.h2
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.cpp7
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.h2
-rw-r--r--tools/editor/plugins/sprite_frames_editor_plugin.cpp5
-rw-r--r--tools/editor/plugins/sprite_frames_editor_plugin.h2
-rw-r--r--tools/editor/plugins/sprite_region_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/sprite_region_editor_plugin.h2
-rw-r--r--tools/editor/plugins/stream_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/stream_editor_plugin.h2
-rw-r--r--tools/editor/plugins/style_box_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/style_box_editor_plugin.h2
-rw-r--r--tools/editor/plugins/theme_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/theme_editor_plugin.h2
-rw-r--r--tools/editor/plugins/tile_map_editor_plugin.cpp5
-rw-r--r--tools/editor/plugins/tile_map_editor_plugin.h2
-rw-r--r--tools/editor/plugins/tile_set_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/tile_set_editor_plugin.h2
-rw-r--r--tools/editor/progress_dialog.cpp2
-rw-r--r--tools/editor/progress_dialog.h2
-rw-r--r--tools/editor/project_export.cpp2
-rw-r--r--tools/editor/project_export.h2
-rw-r--r--tools/editor/project_manager.cpp2
-rw-r--r--tools/editor/project_manager.h2
-rw-r--r--tools/editor/project_settings.cpp166
-rw-r--r--tools/editor/project_settings.h4
-rw-r--r--tools/editor/property_editor.cpp173
-rw-r--r--tools/editor/property_editor.h4
-rw-r--r--tools/editor/pvrtc_compress.cpp2
-rw-r--r--tools/editor/pvrtc_compress.h2
-rw-r--r--tools/editor/quick_open.cpp2
-rw-r--r--tools/editor/quick_open.h2
-rw-r--r--tools/editor/register_exporters.h2
-rw-r--r--tools/editor/reparent_dialog.cpp15
-rw-r--r--tools/editor/reparent_dialog.h9
-rw-r--r--tools/editor/resources_dock.cpp2
-rw-r--r--tools/editor/resources_dock.h2
-rw-r--r--tools/editor/run_settings_dialog.cpp2
-rw-r--r--tools/editor/run_settings_dialog.h2
-rw-r--r--tools/editor/scene_tree_dock.cpp41
-rw-r--r--tools/editor/scene_tree_dock.h4
-rw-r--r--tools/editor/scene_tree_editor.cpp2
-rw-r--r--tools/editor/scene_tree_editor.h2
-rw-r--r--tools/editor/scenes.cpp2
-rw-r--r--tools/editor/scenes.h2
-rw-r--r--tools/editor/scenes_dock.cpp2
-rw-r--r--tools/editor/scenes_dock.h2
-rw-r--r--tools/editor/script_create_dialog.cpp2
-rw-r--r--tools/editor/script_create_dialog.h2
-rw-r--r--tools/editor/script_editor_debugger.cpp2
-rw-r--r--tools/editor/script_editor_debugger.h2
-rw-r--r--tools/editor/settings_config_dialog.cpp2
-rw-r--r--tools/editor/settings_config_dialog.h2
-rw-r--r--tools/editor/spatial_editor_gizmos.cpp2
-rw-r--r--tools/editor/spatial_editor_gizmos.h2
-rw-r--r--tools/export/blender25/io_scene_dae/export_dae.py2
-rw-r--r--tools/ios_xcode_template/godot_ios/main.m2
-rw-r--r--tools/ios_xcode_template/godot_iosTests/godot_iosTests.m2
-rw-r--r--tools/pck/pck_packer.cpp2
197 files changed, 1396 insertions, 1295 deletions
diff --git a/tools/Godot.app/Contents/Info.plist b/tools/Godot.app/Contents/Info.plist
index 8a89993fb9..cb2db17807 100755
--- a/tools/Godot.app/Contents/Info.plist
+++ b/tools/Godot.app/Contents/Info.plist
@@ -9,7 +9,7 @@
<key>CFBundleName</key>
<string>Godot</string>
<key>CFBundleGetInfoString</key>
- <string>(c) 2007-2014 Juan Linietsky, Ariel Manzur</string>
+ <string>(c) 2007-2016 Juan Linietsky, Ariel Manzur</string>
<key>CFBundleIconFile</key>
<string>Godot.icns</string>
<key>CFBundleIdentifier</key>
@@ -25,7 +25,7 @@
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>NSHumanReadableCopyright</key>
- <string>© 2007-2014 Juan Linietsky, Ariel Manzur</string>
+ <string>© 2007-2016 Juan Linietsky, Ariel Manzur</string>
<key>LSMinimumSystemVersion</key>
<string>10.6.0</string>
<key>LSMinimumSystemVersionByArchitecture</key>
diff --git a/tools/addheader/addheader.py b/tools/addheader/addheader.py
index 038cec96d0..0252eb396d 100644
--- a/tools/addheader/addheader.py
+++ b/tools/addheader/addheader.py
@@ -6,7 +6,7 @@ header="""\
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/addheader/header.txt b/tools/addheader/header.txt
index 359949cc3b..e4efb2dcfc 100644
--- a/tools/addheader/header.txt
+++ b/tools/addheader/header.txt
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/*************************************************/
/* Source code within this file is: */
-/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */
+/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */
/* All Rights Reserved. */
/*************************************************/
diff --git a/tools/collada/collada.cpp b/tools/collada/collada.cpp
index 107ffac626..07da72718e 100644
--- a/tools/collada/collada.cpp
+++ b/tools/collada/collada.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/collada/collada.h b/tools/collada/collada.h
index 81f51a1f3d..8983b8faf0 100644
--- a/tools/collada/collada.h
+++ b/tools/collada/collada.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp
index 3161e380b9..a039c58ff4 100644
--- a/tools/doc/doc_data.cpp
+++ b/tools/doc/doc_data.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -584,7 +584,10 @@ void DocData::generate(bool p_basic_types) {
md.name=mi.name;
if (mi.return_val.name!="")
md.return_type=mi.return_val.name;
- else
+ else if (mi.name.find(":")!=-1) {
+ md.return_type=mi.name.get_slice(":",1);
+ md.name=mi.name.get_slice(":",0);
+ } else
md.return_type=Variant::get_type_name(mi.return_val.type);
for(int i=0;i<mi.arguments.size();i++) {
@@ -594,8 +597,9 @@ void DocData::generate(bool p_basic_types) {
ArgumentDoc ad;
ad.name=pi.name;
+
if (pi.type==Variant::NIL)
- ad.type="var";
+ ad.type="Variant";
else
ad.type=Variant::get_type_name( pi.type );
diff --git a/tools/doc/doc_data.h b/tools/doc/doc_data.h
index b62eb21b4a..877f30defb 100644
--- a/tools/doc/doc_data.h
+++ b/tools/doc/doc_data.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/docdump/doc_dump.cpp b/tools/docdump/doc_dump.cpp
index 5f108ee9c8..f8e035e3fa 100644
--- a/tools/docdump/doc_dump.cpp
+++ b/tools/docdump/doc_dump.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/docdump/doc_dump.h b/tools/docdump/doc_dump.h
index cb18289e31..372f5e0969 100644
--- a/tools/docdump/doc_dump.h
+++ b/tools/docdump/doc_dump.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp
index b8aa5874d1..2d274dc91b 100644
--- a/tools/editor/animation_editor.cpp
+++ b/tools/editor/animation_editor.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/animation_editor.h b/tools/editor/animation_editor.h
index 743242fe94..65d0fb70f8 100644
--- a/tools/editor/animation_editor.h
+++ b/tools/editor/animation_editor.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/array_property_edit.cpp b/tools/editor/array_property_edit.cpp
index 64a2762095..66c2782da5 100644
--- a/tools/editor/array_property_edit.cpp
+++ b/tools/editor/array_property_edit.cpp
@@ -72,6 +72,15 @@ bool ArrayPropertyEdit::_set(const StringName& p_name, const Variant& p_value){
ur->add_undo_method(this,"_set_value",i,arr.get(i));
}
+ } else if (newsize>size && size) {
+
+ Variant init;
+ Variant::CallError ce;
+ init = Variant::construct(arr.get(size-1).get_type(),NULL,0,ce);
+ for(int i=size;i<newsize;i++) {
+ ur->add_do_method(this,"_set_value",i,init);
+ }
+
}
ur->add_do_method(this,"_notif_change");
ur->add_undo_method(this,"_notif_change");
@@ -83,6 +92,7 @@ bool ArrayPropertyEdit::_set(const StringName& p_name, const Variant& p_value){
_change_notify();
return true;
}
+
} else if (pn.begins_with("indices")) {
if (pn.find("_")!=-1) {
diff --git a/tools/editor/call_dialog.cpp b/tools/editor/call_dialog.cpp
index 0e3abcf4ef..edcd7371f2 100644
--- a/tools/editor/call_dialog.cpp
+++ b/tools/editor/call_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/call_dialog.h b/tools/editor/call_dialog.h
index fe69847796..2d04e7b6cd 100644
--- a/tools/editor/call_dialog.h
+++ b/tools/editor/call_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp
index 0728b3b7c1..fe863bfebc 100644
--- a/tools/editor/code_editor.cpp
+++ b/tools/editor/code_editor.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -612,6 +612,7 @@ CodeTextEditor::CodeTextEditor() {
if (!font_overrode)
text_editor->add_font_override("font",get_font("source","Fonts"));
+
text_editor->set_show_line_numbers(true);
text_editor->set_brace_matching(true);
text_editor->set_auto_indent(true);
diff --git a/tools/editor/code_editor.h b/tools/editor/code_editor.h
index 0c32aeb68f..5ed7ce9052 100644
--- a/tools/editor/code_editor.h
+++ b/tools/editor/code_editor.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/connections_dialog.cpp b/tools/editor/connections_dialog.cpp
index d4937d7114..e94bc78f5d 100644
--- a/tools/editor/connections_dialog.cpp
+++ b/tools/editor/connections_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/connections_dialog.h b/tools/editor/connections_dialog.h
index 4a1c3f189c..d5e228e799 100644
--- a/tools/editor/connections_dialog.h
+++ b/tools/editor/connections_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/console.cpp b/tools/editor/console.cpp
deleted file mode 100644
index 0c98f05706..0000000000
--- a/tools/editor/console.cpp
+++ /dev/null
@@ -1,386 +0,0 @@
-/*************************************************************************/
-/* console.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* http://www.godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-#include "console.h"
-#include "os/os.h"
-#include "os/keyboard.h"
-
-#include "editor_icons.h"
-#include "scene/gui/label.h"
-#include "globals.h"
-
-
-void Console::_stats_update_timer_callback() {
-
- if (!status->is_visible())
- return;
-
- VisualServer *vs = VisualServer::get_singleton();
-
- stats.render_objects_in_frame->set_text(1,String::num(vs->get_render_info( VisualServer::INFO_OBJECTS_IN_FRAME ) ) );
- stats.material_changes_in_frame->set_text(1,String::num(vs->get_render_info( VisualServer::INFO_MATERIAL_CHANGES_IN_FRAME ) ) );
-
- int64_t total_vmem = vs->get_render_info( VisualServer::INFO_USAGE_VIDEO_MEM_TOTAL );
- if (total_vmem<0)
- stats.usage_video_mem_total->set_text(1, "Unknown");
- else
- stats.usage_video_mem_total->set_text(1,String::humanize_size( total_vmem ) );
-
- stats.usage_video_mem_used->set_text(1,String::humanize_size( vs->get_render_info( VisualServer::INFO_VIDEO_MEM_USED ) ) );
- stats.usage_texture_mem_used->set_text(1,String::humanize_size( vs->get_render_info( VisualServer::INFO_TEXTURE_MEM_USED ) ) );
- stats.usage_vertex_mem_used->set_text(1,String::humanize_size( vs->get_render_info( VisualServer::INFO_VERTEX_MEM_USED ) ) );
-
-
- stats.usage_static_memory_total->set_text(1,String::humanize_size( Memory::get_static_mem_available() ) );
- stats.usage_static_memory->set_text(1,String::humanize_size( Memory::get_static_mem_usage() ) );
- stats.usage_dynamic_memory_total->set_text(1,String::humanize_size( Memory::get_dynamic_mem_available() ) );
- stats.usage_dynamic_memory->set_text(1,String::humanize_size( Memory::get_dynamic_mem_usage() ) );
- stats.usage_objects_instanced->set_text(1,String::num( ObjectDB::get_object_count()) );
-
-
-}
-
-void Console::_print_handle(void *p_this,const String& p_string) {
-
-
- return;
- Console *self = (Console*)p_this;
-
- OutputQueue oq;
- oq.text=p_string;
- oq.type=OutputStrings::LINE_NORMAL;
-
-
- if (self->output_queue_mutex)
- self->output_queue_mutex->lock();
-
- self->output_queue.push_back(oq);
-
- if (self->output_queue_mutex)
- self->output_queue_mutex->unlock();
-
-}
-void Console::_error_handle(void *p_this,const char*p_function,const char* p_file,int p_line,const char *p_error, const char *p_explanation,ErrorHandlerType p_type) {
-
-
- Console *self = (Console*)p_this;
-
- OutputQueue oq;
- oq.text="ERROR: "+String(p_file)+":"+itos(p_line)+", in function: "+String(p_function);
- oq.text+="\n "+String(p_error)+".";
- if (p_explanation && p_explanation[0])
- oq.text+="\n Reason: "+String(p_explanation);
- oq.text+="\n";
- oq.type=OutputStrings::LINE_ERROR;
-
-
- if (self->output_queue_mutex)
- self->output_queue_mutex->lock();
-
- self->output_queue.push_back(oq);
-
- if (self->output_queue_mutex)
- self->output_queue_mutex->unlock();
-
-
-}
-
-void Console::_window_input_event(InputEvent p_event) {
-
- Control::_window_input_event(p_event);
-
- if (p_event.type==InputEvent::KEY && p_event.key.pressed) {
-
- if (p_event.key.scancode==KEY_QUOTELEFT && p_event.key.mod.control) {
-
- if (is_visible())
- hide();
- else {
- globals_property_editor->edit( NULL );
- globals_property_editor->edit( Globals::get_singleton() );
- show();
- };
- }
-
- if (p_event.key.scancode==KEY_ESCAPE && !window_has_modal_stack() && is_visible()) {
- hide();
- get_tree()->call_group(0,"windows","_cancel_input_ID",p_event.ID);
- }
-
-
- }
-}
-
-void Console::_window_resize_event() {
-
-// Control::_window_resize_event();
- _resized();
-}
-
-
-void Console::_resized() {
-
- set_pos( Point2( 0, OS::get_singleton()->get_video_mode().height-height) );
- set_size( Size2( OS::get_singleton()->get_video_mode().width, height) );
-}
-
-void Console::_notification(int p_what) {
-
- switch(p_what) {
-
- case NOTIFICATION_ENTER_TREE: {
-
- _resized();
- show();
- globals_property_editor->edit( Globals::get_singleton() );
-
- } break;
-
- case NOTIFICATION_PROCESS: {
- //pop messies
-
- if (output_queue_mutex)
- output_queue_mutex->lock();
-
- while(output_queue.size()) {
-
- OutputQueue q = output_queue.front()->get();
- if (q.type==OutputStrings::LINE_ERROR || q.type==OutputStrings::LINE_WARNING)
- errors->add_line(q.text,q.meta,q.type);
- output->add_line(q.text,q.meta,q.type);
- output_queue.pop_front();
- }
-
- if (output_queue_mutex)
- output_queue_mutex->unlock();
-
- } break;
- case NOTIFICATION_DRAW: {
-
- RID ci = get_canvas_item();
- get_stylebox("panel","Panel")->draw(ci,Rect2(Point2(),get_size()));
-
- } break;
- }
-}
-
-
-void Console::_close_pressed() {
-
- hide();
-}
-
-void Console::_inspector_node_selected() {
-
-
- Node *node = inspect_tree_editor->get_selected();
-
- if (!node)
- inspect_property_editor->edit(NULL);
- else {
-
- inspect_history.add_object(node->get_instance_ID());
-
- inspect_property_editor->edit(node);
- }
-
-}
-
-void Console::_bind_methods() {
-
- ObjectTypeDB::bind_method("_stats_update_timer_callback",&Console::_stats_update_timer_callback);
- ObjectTypeDB::bind_method("_close_pressed",&Console::_close_pressed);
- ObjectTypeDB::bind_method("_inspector_node_selected",&Console::_inspector_node_selected);
-}
-
-
-Console::Console() {
-
- Ref<Theme> theme( memnew( Theme ) );
- set_theme( theme );
- editor_register_icons(theme);
-
- height=300;
- tabs = memnew( TabContainer );
- tabs->set_tab_align(TabContainer::ALIGN_LEFT);
- add_child(tabs);
- tabs->set_area_as_parent_rect();
-
- output = memnew( OutputStrings );
- output->set_name("Output");
- tabs->add_child(output);
- errors = memnew( OutputStrings );
- errors->set_name("Errors");
- tabs->add_child(errors);
- status = memnew( Control );
- status->set_name("Stats");
- tabs->add_child(status);
- inspect = memnew( Control );
- inspect->set_name("Inspect");
- tabs->add_child(inspect);
- globals = memnew( Control );
- globals->set_name("Globals");
- tabs->add_child(globals);
-
- // stats
-
- stats_tree = memnew( Tree );
- stats_tree->set_hide_root(true);
- stats_tree->set_columns(2);
- status->add_child(stats_tree);
- stats_tree->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
- stats_tree->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO );
- stats_tree->set_margin( MARGIN_RIGHT, 0.5 );
- stats_tree->set_begin( Point2( 20,25 ) );
- stats_tree->set_end( Point2( 0.5,5 ) );
-
- Label *stats_label = memnew( Label );
- stats_label->set_text("Engine Statistics:");
- stats_label->set_pos( Point2( 5,5 ) );
- status->add_child(stats_label);
-
- TreeItem *stats_tree_root = stats_tree->create_item(NULL);
-
- {
- //system items
- TreeItem *system_item = stats_tree->create_item(stats_tree_root);
- system_item->set_text(0,"System");
-
- stats.usage_static_memory_total = stats_tree->create_item(system_item);
- stats.usage_static_memory_total->set_text(0,"Total Static Mem");;
- stats.usage_static_memory = stats_tree->create_item(system_item);
- stats.usage_static_memory->set_text(0,"Static Mem Usage");;
- stats.usage_dynamic_memory_total = stats_tree->create_item(system_item);
- stats.usage_dynamic_memory_total->set_text(0,"Total Dynamic Mem");;
- stats.usage_dynamic_memory = stats_tree->create_item(system_item);
- stats.usage_dynamic_memory->set_text(0,"Dynamic Mem Usage");
- stats.usage_objects_instanced = stats_tree->create_item(system_item);
- stats.usage_objects_instanced->set_text(0,"Instanced Objects");
-
- //render items
- TreeItem *render_item = stats_tree->create_item(stats_tree_root);
- render_item->set_text(0,"Render");
- stats.render_objects_in_frame = stats_tree->create_item(render_item);
- stats.render_objects_in_frame->set_text(0,"Visible Objects");
- stats.material_changes_in_frame = stats_tree->create_item(render_item);
- stats.material_changes_in_frame->set_text(0,"Material Changes");
- stats.usage_video_mem_total = stats_tree->create_item(render_item);
- stats.usage_video_mem_total->set_text(0,"Total Video Mem");
- stats.usage_texture_mem_used = stats_tree->create_item(render_item);
- stats.usage_texture_mem_used->set_text(0,"Texture Mem Usage");
- stats.usage_vertex_mem_used = stats_tree->create_item(render_item);
- stats.usage_vertex_mem_used->set_text(0,"Vertex Mem Usage");
- stats.usage_video_mem_used = stats_tree->create_item(render_item);
- stats.usage_video_mem_used->set_text(0,"Combined Mem Usage");
- }
-
- {
-
- inspect_tree_editor = memnew( SceneTreeEditor );
- inspect_tree_editor->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO );
- inspect_tree_editor->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
- inspect_tree_editor->set_begin( Point2( 20, 5 ) );
- inspect_tree_editor->set_end( Point2( 0.49, 5 ) );
- inspect->add_child(inspect_tree_editor);
-
- inspect_property_editor = memnew( PropertyEditor );
- inspect_property_editor->set_anchor( MARGIN_LEFT, ANCHOR_RATIO );
- inspect_property_editor->set_anchor( MARGIN_RIGHT, ANCHOR_END );
- inspect_property_editor->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
- inspect_property_editor->set_begin( Point2( 0.51, 5 ) );
- inspect_property_editor->set_end( Point2( 5, 5 ) );
- inspect->add_child(inspect_property_editor);
- }
-
-
- { //globals
-
- globals_property_editor = memnew( PropertyEditor );
- globals_property_editor->set_anchor( MARGIN_RIGHT, ANCHOR_END );
- globals_property_editor->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
- globals_property_editor->set_begin( Point2( 15, 5 ) );
- globals_property_editor->set_end( Point2( 5, 5 ) );
- globals_property_editor->get_top_label()->set_text("Globals Editor:");
- globals->add_child(globals_property_editor);
-
- }
-
-
-#ifndef NO_THREADS
- output_queue_mutex = Mutex::create();
-#else
- output_queue_mutex = NULL;
-#endif
-
-
- hide();
- set_process(true);
-
- close = memnew( Button );
- add_child(close);
- close->set_anchor( MARGIN_LEFT, ANCHOR_END);
- close->set_anchor( MARGIN_RIGHT, ANCHOR_END);
- close->set_begin( Point2( 25, 3 ) );
- close->set_end( Point2( 5, 3 ) );
- close->set_flat(true);
- close->connect("pressed", this,"_close_pressed");
-
-
- close->set_icon( get_icon("close","Icons") );
-// force_top_viewport(true);
-
-
- err_handler.userdata=this;
- err_handler.errfunc=_error_handle;
- add_error_handler(&err_handler);
-
- print_handler.userdata=this;
- print_handler.printfunc=_print_handle;
- add_print_handler(&print_handler);
-
- Timer *timer = memnew( Timer );
- add_child(timer);
- timer->set_wait_time(1);
- timer->start();
- timer->connect("timeout", this,"_stats_update_timer_callback");
- inspect_tree_editor->connect("node_selected", this,"_inspector_node_selected");
-
-
-
-}
-
-
-Console::~Console() {
-
- if (output_queue_mutex)
- memdelete(output_queue_mutex);
-
- remove_error_handler(&err_handler);
- remove_print_handler(&print_handler);
-
-}
diff --git a/tools/editor/console.h b/tools/editor/console.h
deleted file mode 100644
index aff425fcde..0000000000
--- a/tools/editor/console.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*************************************************************************/
-/* console.h */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* http://www.godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-#ifndef CONSOLE_H
-#define CONSOLE_H
-
-#include "scene/gui/popup.h"
-#include "scene/gui/button.h"
-#include "scene/gui/tab_container.h"
-#include "scene/gui/tree.h"
-#include "scene/main/timer.h"
-#include "output_strings.h"
-#include "property_editor.h"
-#include "scene_tree_editor.h"
-#include "editor_data.h"
-
-class Console : public Popup {
-
- OBJ_TYPE( Console, Popup );
-
- TabContainer *tabs;
- OutputStrings *output;
- OutputStrings *errors;
- Control *status;
- Control *inspect;
- Control *globals;
- Button *close;
- int height;
-
- EditorHistory inspect_history;
- SceneTreeEditor *inspect_tree_editor;
- PropertyEditor *inspect_property_editor;
- PropertyEditor *globals_property_editor;
-
- Tree *stats_tree;
-
- struct StatsItems {
-
- TreeItem *render_objects_in_frame;
- TreeItem *material_changes_in_frame;
-
- TreeItem *usage_video_mem_total;
- TreeItem *usage_video_mem_used;
- TreeItem *usage_texture_mem_used;
- TreeItem *usage_vertex_mem_used;
-
- TreeItem *usage_static_memory_total;
- TreeItem *usage_static_memory;
- TreeItem *usage_dynamic_memory_total;
- TreeItem *usage_dynamic_memory;
- TreeItem *usage_objects_instanced;
-
- } stats;
-
- struct OutputQueue {
-
- OutputStrings::LineType type;
- Variant meta;
- String text;
- };
-
- Mutex *output_queue_mutex;
- List<OutputQueue> output_queue;
-
-
- ErrorHandlerList err_handler;
- PrintHandlerList print_handler;
-
- void _inspector_node_selected();
-
- static void _error_handle(void *p_this,const char*p_function,const char* p_file,int p_line,const char *p_error, const char *p_explanation,ErrorHandlerType p_type);
- static void _print_handle(void *p_this,const String& p_string);
-
-protected:
-
- virtual void _window_input_event(InputEvent p_event);
- virtual void _window_resize_event();
-
- void _stats_update_timer_callback();
- void _resized();
- void _close_pressed();
-
- void _notification(int p_what);
-
- static void _bind_methods();
-public:
- Console();
- ~Console();
-};
-
-#endif // CONSOLE_H
diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp
index a9119349c8..0f39d72308 100644
--- a/tools/editor/create_dialog.cpp
+++ b/tools/editor/create_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/create_dialog.h b/tools/editor/create_dialog.h
index f200e1caf5..6f959fd467 100644
--- a/tools/editor/create_dialog.h
+++ b/tools/editor/create_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/default_saver.cpp b/tools/editor/default_saver.cpp
index c865adb1eb..611232e04b 100644
--- a/tools/editor/default_saver.cpp
+++ b/tools/editor/default_saver.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/default_saver.h b/tools/editor/default_saver.h
index 4e11ff5592..2b1a1edb23 100644
--- a/tools/editor/default_saver.h
+++ b/tools/editor/default_saver.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/doc_code_font.h b/tools/editor/doc_code_font.h
index 91f67c4a41..879c873ea1 100644
--- a/tools/editor/doc_code_font.h
+++ b/tools/editor/doc_code_font.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/doc_font.h b/tools/editor/doc_font.h
index f2e5e7950b..a3c3b58b21 100644
--- a/tools/editor/doc_font.h
+++ b/tools/editor/doc_font.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/doc_title_font.h b/tools/editor/doc_title_font.h
index fb6b4eaf5b..75a3f049f0 100644
--- a/tools/editor/doc_title_font.h
+++ b/tools/editor/doc_title_font.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp
index e9f9e09acd..d79c1ff466 100644
--- a/tools/editor/editor_data.cpp
+++ b/tools/editor/editor_data.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_data.h b/tools/editor/editor_data.h
index 51af7d41bd..7dafeeea04 100644
--- a/tools/editor/editor_data.h
+++ b/tools/editor/editor_data.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_dir_dialog.cpp b/tools/editor/editor_dir_dialog.cpp
index 1f3b5eed65..8512154485 100644
--- a/tools/editor/editor_dir_dialog.cpp
+++ b/tools/editor/editor_dir_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_dir_dialog.h b/tools/editor/editor_dir_dialog.h
index 8ac83b86e8..1c2593219c 100644
--- a/tools/editor/editor_dir_dialog.h
+++ b/tools/editor/editor_dir_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp
index 0fa120bfa9..22cd3845e1 100644
--- a/tools/editor/editor_file_dialog.cpp
+++ b/tools/editor/editor_file_dialog.cpp
@@ -1114,7 +1114,7 @@ void EditorFileDialog::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_vbox:VBoxContainer"),&EditorFileDialog::get_vbox);
ObjectTypeDB::bind_method(_MD("set_access","access"),&EditorFileDialog::set_access);
ObjectTypeDB::bind_method(_MD("get_access"),&EditorFileDialog::get_access);
- ObjectTypeDB::bind_method(_MD("set_show_hidden_files"),&EditorFileDialog::set_show_hidden_files);
+ ObjectTypeDB::bind_method(_MD("set_show_hidden_files","show"),&EditorFileDialog::set_show_hidden_files);
ObjectTypeDB::bind_method(_MD("is_showing_hidden_files"),&EditorFileDialog::is_showing_hidden_files);
ObjectTypeDB::bind_method(_MD("_select_drive"),&EditorFileDialog::_select_drive);
ObjectTypeDB::bind_method(_MD("_make_dir"),&EditorFileDialog::_make_dir);
diff --git a/tools/editor/editor_file_dialog.h b/tools/editor/editor_file_dialog.h
index 5137d1f364..3590964a51 100644
--- a/tools/editor/editor_file_dialog.h
+++ b/tools/editor/editor_file_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_file_system.cpp b/tools/editor/editor_file_system.cpp
index 33e4a15c85..c7c1a48e34 100644
--- a/tools/editor/editor_file_system.cpp
+++ b/tools/editor/editor_file_system.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -37,6 +37,31 @@
EditorFileSystem *EditorFileSystem::singleton=NULL;
+void EditorFileSystemDirectory::sort_files() {
+
+ files.sort_custom<FileInfoSort>();
+}
+
+int EditorFileSystemDirectory::find_file_index(const String& p_file) const {
+
+ for(int i=0;i<files.size();i++) {
+ if (files[i]->file==p_file)
+ return i;
+ }
+ return -1;
+
+}
+int EditorFileSystemDirectory::find_dir_index(const String& p_dir) const{
+
+
+ for(int i=0;i<subdirs.size();i++) {
+ if (subdirs[i]->name==p_dir)
+ return i;
+ }
+
+ return -1;
+}
+
int EditorFileSystemDirectory::get_subdir_count() const {
@@ -59,7 +84,7 @@ String EditorFileSystemDirectory::get_file(int p_idx) const{
ERR_FAIL_INDEX_V(p_idx,files.size(),"");
- return files[p_idx].file;
+ return files[p_idx]->file;
}
String EditorFileSystemDirectory::get_path() const {
@@ -91,22 +116,22 @@ String EditorFileSystemDirectory::get_file_path(int p_idx) const {
bool EditorFileSystemDirectory::get_file_meta(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx,files.size(),"");
- return files[p_idx].meta.enabled;
+ return files[p_idx]->meta.enabled;
}
Vector<String> EditorFileSystemDirectory::get_file_deps(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx,files.size(),Vector<String>());
- return files[p_idx].meta.deps;
+ return files[p_idx]->meta.deps;
}
Vector<String> EditorFileSystemDirectory::get_missing_sources(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx,files.size(),Vector<String>());
Vector<String> missing;
- for(int i=0;i<files[p_idx].meta.sources.size();i++) {
- if (files[p_idx].meta.sources[i].missing)
- missing.push_back(files[p_idx].meta.sources[i].path);
+ for(int i=0;i<files[p_idx]->meta.sources.size();i++) {
+ if (files[p_idx]->meta.sources[i].missing)
+ missing.push_back(files[p_idx]->meta.sources[i].path);
}
return missing;
@@ -116,8 +141,8 @@ Vector<String> EditorFileSystemDirectory::get_missing_sources(int p_idx) const {
bool EditorFileSystemDirectory::is_missing_sources(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx,files.size(),false);
- for(int i=0;i<files[p_idx].meta.sources.size();i++) {
- if (files[p_idx].meta.sources[i].missing)
+ for(int i=0;i<files[p_idx]->meta.sources.size();i++) {
+ if (files[p_idx]->meta.sources[i].missing)
return true;
}
@@ -127,7 +152,7 @@ bool EditorFileSystemDirectory::is_missing_sources(int p_idx) const {
StringName EditorFileSystemDirectory::get_file_type(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx,files.size(),"");
- return files[p_idx].type;
+ return files[p_idx]->type;
}
String EditorFileSystemDirectory::get_name() {
@@ -157,11 +182,17 @@ void EditorFileSystemDirectory::_bind_methods() {
EditorFileSystemDirectory::EditorFileSystemDirectory() {
+ modified_time=0;
parent=NULL;
}
EditorFileSystemDirectory::~EditorFileSystemDirectory() {
+ for(int i=0;i<files.size();i++) {
+
+ memdelete(files[i]);
+ }
+
for(int i=0;i<subdirs.size();i++) {
memdelete(subdirs[i]);
@@ -173,19 +204,6 @@ EditorFileSystemDirectory::~EditorFileSystemDirectory() {
-
-
-EditorFileSystem::DirItem::~DirItem() {
-
- for(int i=0;i<dirs.size();i++) {
- memdelete(dirs[i]);
- }
-
- for(int i=0;i<files.size();i++) {
- memdelete(files[i]);
- }
-}
-
EditorFileSystemDirectory::ImportMeta EditorFileSystem::_get_meta(const String& p_path) {
Ref<ResourceImportMetadata> imd = ResourceLoader::load_import_metadata(p_path);
@@ -214,160 +232,16 @@ EditorFileSystemDirectory::ImportMeta EditorFileSystem::_get_meta(const String&
return m;
}
-EditorFileSystem::DirItem* EditorFileSystem::_scan_dir(DirAccess *da,Set<String> &extensions,String p_name,float p_from,float p_range,const String& p_path,HashMap<String,FileCache> &file_cache,HashMap<String,DirCache> &dir_cache,EditorProgressBG& p_prog) {
- if (abort_scan)
- return NULL;
-
- if (p_path!=String()) {
- if (FileAccess::exists(("res://"+p_path).plus_file("engine.cfg"))) {
- return NULL;
- }
- }
-
- List<String> dirs;
- List<String> files;
- Set<String> pngs;
-
- String path=p_path;
- if (path.ends_with("/"))
- path=path.substr(0,path.length()-1);
- String global_path = Globals::get_singleton()->get_resource_path().plus_file(path);
-
- path="res://"+path;
- uint64_t mtime = FileAccess::get_modified_time(global_path);
-
- DirCache *dc = dir_cache.getptr(path);
-
-
- if (false && dc && dc->modification_time==mtime) {
- //use the cached files, since directory did not change
- for (Set<String>::Element *E=dc->subdirs.front();E;E=E->next()) {
- dirs.push_back(E->get());
- }
- for (Set<String>::Element *E=dc->files.front();E;E=E->next()) {
- files.push_back(E->get());
- }
-
- } else {
- //use the filesystem, some files may have changed
- Error err = da->change_dir(global_path);
- if (err!=OK) {
- print_line("Can't change to: "+path);
- ERR_FAIL_COND_V(err!=OK,NULL);
- }
+void EditorFileSystem::_scan_filesystem() {
-
- da->list_dir_begin();
- while (true) {
-
- bool isdir;
- String f = da->get_next(&isdir);
- if (f=="")
- break;
- if (isdir) {
- dirs.push_back(f);
- } else {
- String ext = f.extension().to_lower();
- if (extensions.has(ext))
- files.push_back(f);
-
- }
-
- }
-
- da->list_dir_end();
- files.sort();
- dirs.sort();
-
- }
-
-
-
- //print_line(da->get_current_dir()+": dirs: "+itos(dirs.size())+" files:"+itos(files.size()) );
-
- //find subdirs
- Vector<DirItem*> subdirs;
-
- //String current = da->get_current_dir();
- float idx=0;
- for (List<String>::Element *E=dirs.front();E;E=E->next(),idx+=1.0) {
-
- String d = E->get();
- if (d.begins_with(".")) //ignore hidden and . / ..
- continue;
-
- //ERR_CONTINUE( da->change_dir(d)!= OK );
- DirItem *sdi = _scan_dir(da,extensions,d,p_from+(idx/dirs.size())*p_range,p_range/dirs.size(),p_path+d+"/",file_cache,dir_cache,p_prog);
- if (sdi) {
- subdirs.push_back(sdi);
- }
- //da->change_dir(current);
- }
-
-
- if (subdirs.empty() && files.empty()) {
- total=p_from+p_range;
- p_prog.step(total*100);
- return NULL; //give up, nothing to do here
- }
-
- DirItem *di = memnew( DirItem );
- di->path=path;
- di->name=p_name;
- di->dirs=subdirs;
- di->modified_time=mtime;
-
- //add files
- for (List<String>::Element *E=files.front();E;E=E->next()) {
-
- SceneItem * si = memnew( SceneItem );
- si->file=E->get();
- si->path="res://"+p_path+si->file;
- FileCache *fc = file_cache.getptr(si->path);
- uint64_t mt = FileAccess::get_modified_time(si->path);
-
- if (fc && fc->modification_time == mt) {
-
- si->meta=fc->meta;
- si->type=fc->type;
- si->modified_time=fc->modification_time;
- } else {
- si->meta=_get_meta(si->path);
- si->type=ResourceLoader::get_resource_type(si->path);
- si->modified_time=mt;
-
- }
-
- if (si->meta.enabled) {
- md_count++;
- if (_check_meta_sources(si->meta)) {
- sources_changed.push_back(si->path);
- }
- }
- di->files.push_back(si);
- }
-
- total=p_from+p_range;
- p_prog.step(total*100);
-
- return di;
-}
-
-
-void EditorFileSystem::_scan_scenes() {
-
- ERR_FAIL_COND(!scanning || scandir);
+ ERR_FAIL_COND(!scanning || new_filesystem);
//read .fscache
- HashMap<String,FileCache> file_cache;
- HashMap<String,DirCache> dir_cache;
- DirCache *dc=NULL;
String cpath;
sources_changed.clear();
-
-
+ file_cache.clear();
String project=Globals::get_singleton()->get_resource_path();
@@ -387,26 +261,7 @@ void EditorFileSystem::_scan_scenes() {
ERR_CONTINUE( split.size() != 3);
String name = split[1];
- dir_cache[name]=DirCache();
- dc=&dir_cache[name];
- dc->modification_time=split[2].to_int64();
-
- if (name!="res://") {
-
- cpath=name+"/";
-
- int sp=name.find_last("/");
- if (sp==5)
- sp=6;
- String pd = name.substr(0,sp);
- DirCache *dcp = dir_cache.getptr(pd);
- ERR_CONTINUE(!dcp);
- dcp->subdirs.insert(name.get_file());
- } else {
-
- cpath=name;
- }
-
+ cpath=name;
} else {
Vector<String> split = l.split("::");
@@ -414,12 +269,8 @@ void EditorFileSystem::_scan_scenes() {
String name = split[0];
String file;
- if (!name.begins_with("res://")) {
- file=name;
- name=cpath+name;
- } else {
- file=name.get_file();
- }
+ file=name;
+ name=cpath.plus_file(name);
FileCache fc;
fc.type=split[1];
@@ -453,8 +304,6 @@ void EditorFileSystem::_scan_scenes() {
file_cache[name]=fc;
- ERR_CONTINUE(!dc);
- dc->files.insert(file);
}
}
@@ -465,39 +314,31 @@ void EditorFileSystem::_scan_scenes() {
+ EditorProgressBG scan_progress("efs","ScanFS",1000);
+ ScanProgress sp;
+ sp.low=0;
+ sp.hi=1;
+ sp.progress=&scan_progress;
- total=0;
- DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
- //da->change_dir( Globals::get_singleton()->get_resource_path() );
+ new_filesystem = memnew( EditorFileSystemDirectory );
+ new_filesystem->parent=NULL;
+ DirAccess *d = DirAccess::create(DirAccess::ACCESS_RESOURCES);
+ d->change_dir("res://");
+ _scan_new_dir(new_filesystem,d,sp);
- List<String> extensionsl;
- ResourceLoader::get_recognized_extensions_for_type("",&extensionsl);
- Set<String> extensions;
- for(List<String>::Element *E = extensionsl.front();E;E=E->next()) {
+ file_cache.clear(); //clear caches, no longer needed
- extensions.insert(E->get());
- }
-
- EditorProgressBG scan_progress("efs","ScanFS",100);
-
- md_count=0;
- scandir=_scan_dir(da,extensions,"",0,1,"",file_cache,dir_cache,scan_progress);
- memdelete(da);
- if (abort_scan && scandir) {
- memdelete(scandir);
- scandir=NULL;
-
- }
+ memdelete(d);
//save back the findings
// String fscache = EditorSettings::get_singleton()->get_project_settings_path().plus_file("file_cache");
f=FileAccess::open(fscache,FileAccess::WRITE);
- _save_type_cache_fs(scandir,f);
+ _save_filesystem_cache(new_filesystem,f);
f->close();
memdelete(f);
@@ -510,7 +351,95 @@ void EditorFileSystem::_scan_scenes() {
void EditorFileSystem::_thread_func(void *_userdata) {
EditorFileSystem *sd = (EditorFileSystem*)_userdata;
- sd->_scan_scenes();
+ sd->_scan_filesystem();
+
+}
+
+bool EditorFileSystem::_update_scan_actions() {
+
+ sources_changed.clear();
+
+ bool fs_changed=false;
+
+ for (List<ItemAction>::Element *E=scan_actions.front();E;E=E->next()) {
+
+ ItemAction&ia = E->get();
+
+ switch(ia.action) {
+ case ItemAction::ACTION_NONE: {
+
+ } break;
+ case ItemAction::ACTION_DIR_ADD: {
+
+ //print_line("*ACTION ADD DIR: "+ia.new_dir->get_name());
+ int idx=0;
+ for(int i=0;i<ia.dir->subdirs.size();i++) {
+
+ if (ia.new_dir->name<ia.dir->subdirs[i]->name)
+ break;
+ idx++;
+ }
+ if (idx==ia.dir->subdirs.size()) {
+ ia.dir->subdirs.push_back(ia.new_dir);
+ } else {
+ ia.dir->subdirs.insert(idx,ia.new_dir);
+ }
+
+ fs_changed=true;
+ } break;
+ case ItemAction::ACTION_DIR_REMOVE: {
+
+ ERR_CONTINUE(!ia.dir->parent);
+ //print_line("*ACTION REMOVE DIR: "+ia.dir->get_name());
+ ia.dir->parent->subdirs.erase(ia.dir);
+ memdelete( ia.dir );
+ fs_changed=true;
+ } break;
+ case ItemAction::ACTION_FILE_ADD: {
+
+ int idx=0;
+ for(int i=0;i<ia.dir->files.size();i++) {
+
+ if (ia.new_file->file<ia.dir->files[i]->file)
+ break;
+ idx++;
+ }
+ if (idx==ia.dir->files.size()) {
+ ia.dir->files.push_back(ia.new_file);
+ } else {
+ ia.dir->files.insert(idx,ia.new_file);
+ }
+
+ fs_changed=true;
+ //print_line("*ACTION ADD FILE: "+ia.new_file->file);
+
+ } break;
+ case ItemAction::ACTION_FILE_REMOVE: {
+
+ int idx = ia.dir->find_file_index(ia.file);
+ ERR_CONTINUE(idx==-1);
+ memdelete( ia.dir->files[idx] );
+ ia.dir->files.remove(idx);
+
+ fs_changed=true;
+ //print_line("*ACTION REMOVE FILE: "+ia.file);
+
+ } break;
+ case ItemAction::ACTION_FILE_SOURCES_CHANGED: {
+
+ int idx = ia.dir->find_file_index(ia.file);
+ ERR_CONTINUE(idx==-1);
+ String full_path = ia.dir->get_file_path(idx);
+ sources_changed.push_back(full_path);
+
+ } break;
+
+ }
+ }
+
+ scan_actions.clear();
+
+ return fs_changed;
}
@@ -526,19 +455,15 @@ void EditorFileSystem::scan() {
abort_scan=false;
if (!use_threads) {
scanning=true;
- _scan_scenes();
- if (rootdir)
- memdelete(rootdir);
- rootdir=scandir;
+ scan_total=0;
+ _scan_filesystem();
if (filesystem)
memdelete(filesystem);
// file_type_cache.clear();
- filesystem=_update_tree(rootdir);
-
- if (rootdir)
- memdelete(rootdir);
- rootdir=NULL;
- scanning=false;
+ filesystem=new_filesystem;
+ new_filesystem=NULL;
+ _update_scan_actions();
+ scanning=false;
emit_signal("filesystem_changed");
emit_signal("sources_changed",sources_changed.size()>0);
@@ -548,6 +473,7 @@ void EditorFileSystem::scan() {
set_process(true);
Thread::Settings s;
scanning=true;
+ scan_total=0;
s.priority=Thread::PRIORITY_LOW;
thread = Thread::create(_thread_func,this,s);
//tree->hide();
@@ -559,14 +485,10 @@ void EditorFileSystem::scan() {
}
-bool EditorFileSystem::_check_meta_sources(EditorFileSystemDirectory::ImportMeta & p_meta,EditorProgressBG *ep) {
+bool EditorFileSystem::_check_meta_sources(EditorFileSystemDirectory::ImportMeta & p_meta) {
if (p_meta.enabled) {
- if (ep) {
- ep->step(ss_amount++);
- }
-
for(int j=0;j<p_meta.sources.size();j++) {
@@ -584,9 +506,9 @@ bool EditorFileSystem::_check_meta_sources(EditorFileSystemDirectory::ImportMeta
if (mt!=p_meta.sources[j].modified_time) {
//scan
String md5 = FileAccess::get_md5(src);
- print_line("checking: "+src);
- print_line("md5: "+md5);
- print_line("vs: "+p_meta.sources[j].md5);
+ //print_line("checking: "+src);
+ //print_line("md5: "+md5);
+ //print_line("vs: "+p_meta.sources[j].md5);
if (md5!=p_meta.sources[j].md5) {
//really changed
return true;
@@ -599,18 +521,300 @@ bool EditorFileSystem::_check_meta_sources(EditorFileSystemDirectory::ImportMeta
return false;
}
-void EditorFileSystem::_scan_sources(EditorFileSystemDirectory *p_dir,EditorProgressBG *ep) {
+void EditorFileSystem::ScanProgress::update(int p_current,int p_total) const {
+
+ float ratio = low + ((hi-low)/p_total)*p_current;
+ progress->step(ratio*1000);
+ EditorFileSystem::singleton->scan_total=ratio;
+}
+
+EditorFileSystem::ScanProgress EditorFileSystem::ScanProgress::get_sub(int p_current,int p_total) const{
+
+ ScanProgress sp=*this;
+ float slice = (sp.hi-sp.low)/p_total;
+ sp.low+=slice*p_current;
+ sp.hi=slice;
+ return sp;
+
+
+}
+
+
+void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir,DirAccess *da,const ScanProgress& p_progress) {
+
+ List<String> dirs;
+ List<String> files;
+
+ String cd = da->get_current_dir();
+
+ p_dir->modified_time = FileAccess::get_modified_time(cd);
+
+
+ da->list_dir_begin();
+ while (true) {
+
+ bool isdir;
+ String f = da->get_next(&isdir);
+ if (f=="")
+ break;
+
+ if (isdir) {
+
+ if (f.begins_with(".")) //ignore hidden and . / ..
+ continue;
+
+ if (FileAccess::exists(cd.plus_file(f).plus_file("engine.cfg"))) // skip if another project inside this
+ continue;
+
+ dirs.push_back(f);
+
+ } else {
+
+ files.push_back(f);
+ }
+
+ }
+
+ da->list_dir_end();
+
+ dirs.sort();
+ files.sort();
+
+ int total = dirs.size()+files.size();
+ int idx=0;
+
+ for (List<String>::Element *E=dirs.front();E;E=E->next(),idx++) {
+
+ if (da->change_dir(E->get())==OK) {
+
+ EditorFileSystemDirectory *efd = memnew( EditorFileSystemDirectory );
+
+ efd->parent=p_dir;
+ efd->name=E->get();
+
+ _scan_new_dir(efd,da,p_progress.get_sub(idx,total));
+
+ int idx=0;
+ for(int i=0;i<p_dir->subdirs.size();i++) {
+
+ if (efd->name<p_dir->subdirs[i]->name)
+ break;
+ idx++;
+ }
+ if (idx==p_dir->subdirs.size()) {
+ p_dir->subdirs.push_back(efd);
+ } else {
+ p_dir->subdirs.insert(idx,efd);
+ }
+
+ da->change_dir("..");
+ } else {
+ ERR_PRINTS("Can't go into subdir: "+E->get());
+ }
+
+ p_progress.update(idx,total);
+
+ }
+
+ for (List<String>::Element*E=files.front();E;E=E->next(),idx++) {
+
+ String ext = E->get().extension().to_lower();
+ if (!valid_extensions.has(ext))
+ continue; //invalid
+
+ EditorFileSystemDirectory::FileInfo *fi = memnew( EditorFileSystemDirectory::FileInfo );
+ fi->file=E->get();
+
+ String path = cd.plus_file(fi->file);
+
+ FileCache *fc = file_cache.getptr(path);
+ uint64_t mt = FileAccess::get_modified_time(path);
+
+ if (fc && fc->modification_time == mt) {
+
+ fi->meta=fc->meta;
+ fi->type=fc->type;
+ fi->modified_time=fc->modification_time;
+ } else {
+ fi->meta=_get_meta(path);
+ fi->type=ResourceLoader::get_resource_type(path);
+ fi->modified_time=mt;
+
+ }
+
+ if (fi->meta.enabled) {
+ if (_check_meta_sources(fi->meta)) {
+ ItemAction ia;
+ ia.action=ItemAction::ACTION_FILE_SOURCES_CHANGED;
+ ia.dir=p_dir;
+ ia.file=E->get();
+ scan_actions.push_back(ia);
+ }
+ }
+
+ p_dir->files.push_back(fi);
+ p_progress.update(idx,total);
+ }
+
+}
+
+
+void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir,const ScanProgress& p_progress) {
+
+ uint64_t current_mtime = FileAccess::get_modified_time(p_dir->get_path());
+
+ bool updated_dir=false;
+
+ //print_line("dir: "+p_dir->get_path()+" MODTIME: "+itos(p_dir->modified_time)+" CTIME: "+itos(current_mtime));
+
+ if (current_mtime!=p_dir->modified_time) {
+
+ updated_dir=true;
+ p_dir->modified_time=current_mtime;
+ //ooooops, dir changed, see what's going on
+
+ //first mark everything as veryfied
+
+ for(int i=0;i<p_dir->files.size();i++) {
+
+ p_dir->files[i]->verified=false;
+ }
+
+ for(int i=0;i<p_dir->subdirs.size();i++) {
+
+ p_dir->get_subdir(i)->verified=false;
+ }
+
+ //then scan files and directories and check what's different
+
+ DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
+ String cd = p_dir->get_path();
+ da->change_dir(cd);
+ da->list_dir_begin();
+ while (true) {
+
+ bool isdir;
+ String f = da->get_next(&isdir);
+ if (f=="")
+ break;
+
+ if (isdir) {
+
+ if (f.begins_with(".")) //ignore hidden and . / ..
+ continue;
+
+ int idx = p_dir->find_dir_index(f);
+ if (idx==-1) {
+
+ if (FileAccess::exists(cd.plus_file(f).plus_file("engine.cfg"))) // skip if another project inside this
+ continue;
+
+ EditorFileSystemDirectory *efd = memnew( EditorFileSystemDirectory );
+
+ efd->parent=p_dir;
+ efd->name=f;
+ DirAccess *d = DirAccess::create(DirAccess::ACCESS_RESOURCES);
+ d->change_dir(cd.plus_file(f));
+ _scan_new_dir(efd,d,p_progress.get_sub(1,1));
+ memdelete(d);
+
+
+ ItemAction ia;
+ ia.action=ItemAction::ACTION_DIR_ADD;
+ ia.dir=p_dir;
+ ia.file=f;
+ ia.new_dir=efd;
+ scan_actions.push_back(ia);
+ } else {
+ p_dir->subdirs[idx]->verified=true;
+ }
+
+
+ } else {
+ String ext = f.extension().to_lower();
+ if (!valid_extensions.has(ext))
+ continue; //invalid
+
+ int idx = p_dir->find_file_index(f);
+
+ if (idx==-1) {
+ //never seen this file, add actition to add it
+ EditorFileSystemDirectory::FileInfo *fi = memnew( EditorFileSystemDirectory::FileInfo );
+ fi->file=f;
+
+ String path = cd.plus_file(fi->file);
+ fi->modified_time=FileAccess::get_modified_time(path);
+ fi->meta=_get_meta(path);
+ fi->type=ResourceLoader::get_resource_type(path);
+
+ {
+ ItemAction ia;
+ ia.action=ItemAction::ACTION_FILE_ADD;
+ ia.dir=p_dir;
+ ia.file=f;
+ ia.new_file=fi;
+ scan_actions.push_back(ia);
+ }
+
+ //take the chance and scan sources
+ if (_check_meta_sources(fi->meta)) {
+
+ ItemAction ia;
+ ia.action=ItemAction::ACTION_FILE_SOURCES_CHANGED;
+ ia.dir=p_dir;
+ ia.file=f;
+ scan_actions.push_back(ia);
+ }
+
+ } else {
+ p_dir->files[idx]->verified=true;
+ }
+
+
+ }
+
+ }
+ da->list_dir_end();
+ memdelete(da);
+
+
+
+
+ }
for(int i=0;i<p_dir->files.size();i++) {
- if (_check_meta_sources(p_dir->files[i].meta,ep)) {
- sources_changed.push_back(p_dir->get_file_path(i));
+ if (updated_dir && !p_dir->files[i]->verified) {
+ //this file was removed, add action to remove it
+ ItemAction ia;
+ ia.action=ItemAction::ACTION_FILE_REMOVE;
+ ia.dir=p_dir;
+ ia.file=p_dir->files[i]->file;
+ scan_actions.push_back(ia);
+ continue;
+
+ }
+ if (_check_meta_sources(p_dir->files[i]->meta)) {
+ ItemAction ia;
+ ia.action=ItemAction::ACTION_FILE_SOURCES_CHANGED;
+ ia.dir=p_dir;
+ ia.file=p_dir->files[i]->file;
+ scan_actions.push_back(ia);
}
}
for(int i=0;i<p_dir->subdirs.size();i++) {
- _scan_sources(p_dir->get_subdir(i),ep);
+ if (updated_dir && !p_dir->subdirs[i]->verified) {
+ //this directory was removed, add action to remove it
+ ItemAction ia;
+ ia.action=ItemAction::ACTION_DIR_REMOVE;
+ ia.dir=p_dir->subdirs[i];
+ scan_actions.push_back(ia);
+ continue;
+
+ }
+ _scan_fs_changes(p_dir->get_subdir(i),p_progress);
}
}
@@ -619,9 +823,12 @@ void EditorFileSystem::_thread_func_sources(void *_userdata) {
EditorFileSystem *efs = (EditorFileSystem*)_userdata;
if (efs->filesystem) {
- EditorProgressBG pr("sources","ScanSources",efs->md_count);
- efs->ss_amount=0;
- efs->_scan_sources(efs->filesystem,&pr);
+ EditorProgressBG pr("sources","ScanSources",1000);
+ ScanProgress sp;
+ sp.progress=&pr;
+ sp.hi=1;
+ sp.low=0;
+ efs->_scan_fs_changes(efs->filesystem,sp);
}
efs->scanning_sources_done=true;
}
@@ -643,8 +850,17 @@ void EditorFileSystem::scan_sources() {
abort_scan=false;
if (!use_threads) {
- if (filesystem)
- _scan_sources(filesystem,NULL);
+ if (filesystem) {
+ EditorProgressBG pr("sources","ScanSources",1000);
+ ScanProgress sp;
+ sp.progress=&pr;
+ sp.hi=1;
+ sp.low=0;
+ scan_total=0;
+ _scan_fs_changes(filesystem,sp);
+ if (_update_scan_actions())
+ emit_signal("filesystem_changed");
+ }
scanning_sources=false;
scanning_sources_done=true;
emit_signal("sources_changed",sources_changed.size()>0);
@@ -652,8 +868,8 @@ void EditorFileSystem::scan_sources() {
ERR_FAIL_COND(thread_sources);
set_process(true);
+ scan_total=0;
Thread::Settings s;
- ss_amount=0;
s.priority=Thread::PRIORITY_LOW;
thread_sources = Thread::create(_thread_func_sources,this,s);
//tree->hide();
@@ -665,53 +881,14 @@ void EditorFileSystem::scan_sources() {
}
-EditorFileSystemDirectory* EditorFileSystem::_update_tree(DirItem *p_item) {
-
- EditorFileSystemDirectory *efd = memnew( EditorFileSystemDirectory );
-
- if (!p_item)
- return efd; //empty likely
- efd->name=p_item->name;
-
- for(int i=0;i<p_item->files.size();i++) {
-
- String s = p_item->files[i]->type;
- //if (p_item->files[i]->meta)
- // s="*"+s;
-
-// file_type_cache[p_item->files[i]->path]=s;
- if (p_item->files[i]->type=="")
- continue; //ignore because it's invalid
- EditorFileSystemDirectory::FileInfo fi;
- fi.file=p_item->files[i]->file;
- fi.type=p_item->files[i]->type;
- fi.meta=p_item->files[i]->meta;
- fi.modified_time=p_item->files[i]->modified_time;
-
- efd->files.push_back(fi);
-
- }
-
- for(int i=0;i<p_item->dirs.size();i++) {
-
- EditorFileSystemDirectory *efsd =_update_tree(p_item->dirs[i]);
- efsd->parent=efd;
- efd->subdirs.push_back( efsd );
-
- }
-
-
- return efd;
-}
-
void EditorFileSystem::_notification(int p_what) {
switch(p_what) {
case NOTIFICATION_ENTER_TREE: {
- _load_type_cache();
- scan();
+
+ scan();
} break;
case NOTIFICATION_EXIT_TREE: {
if (use_threads && thread) {
@@ -727,13 +904,13 @@ void EditorFileSystem::_notification(int p_what) {
set_process(false);
}
- if (rootdir)
- memdelete(rootdir);
- rootdir=NULL;
if (filesystem)
memdelete(filesystem);
+ if (new_filesystem)
+ memdelete(new_filesystem);
filesystem=NULL;
+ new_filesystem=NULL;
} break;
case NOTIFICATION_PROCESS: {
@@ -751,6 +928,8 @@ void EditorFileSystem::_notification(int p_what) {
Thread::wait_to_finish(thread_sources);
memdelete(thread_sources);
thread_sources=NULL;
+ if (_update_scan_actions())
+ emit_signal("filesystem_changed");
//print_line("sources changed: "+itos(sources_changed.size()));
emit_signal("sources_changed",sources_changed.size()>0);
}
@@ -758,21 +937,14 @@ void EditorFileSystem::_notification(int p_what) {
set_process(false);
- if (rootdir)
- memdelete(rootdir);
if (filesystem)
memdelete(filesystem);
- rootdir=scandir;
- scandir=NULL;
-// file_type_cache.clear();
- filesystem=_update_tree(rootdir);
-
- if (rootdir)
- memdelete(rootdir);
- rootdir=NULL;
+ filesystem=new_filesystem;
+ new_filesystem=NULL;
Thread::wait_to_finish(thread);
memdelete(thread);
thread=NULL;
+ _update_scan_actions();
emit_signal("filesystem_changed");
emit_signal("sources_changed",sources_changed.size()>0);
//print_line("initial sources changed: "+itos(sources_changed.size()));
@@ -794,7 +966,7 @@ bool EditorFileSystem::is_scanning() const {
}
float EditorFileSystem::get_scanning_progress() const {
- return total;
+ return scan_total;
}
EditorFileSystemDirectory *EditorFileSystem::get_filesystem() {
@@ -802,12 +974,12 @@ EditorFileSystemDirectory *EditorFileSystem::get_filesystem() {
return filesystem;
}
-void EditorFileSystem::_save_type_cache_fs(DirItem *p_dir,FileAccess *p_file) {
+void EditorFileSystem::_save_filesystem_cache(EditorFileSystemDirectory*p_dir,FileAccess *p_file) {
if (!p_dir)
return; //none
- p_file->store_line("::"+p_dir->path+"::"+String::num(p_dir->modified_time));
+ p_file->store_line("::"+p_dir->get_path()+"::"+String::num(p_dir->modified_time));
for(int i=0;i<p_dir->files.size();i++) {
@@ -832,126 +1004,96 @@ void EditorFileSystem::_save_type_cache_fs(DirItem *p_dir,FileAccess *p_file) {
p_file->store_line(s);
}
- for(int i=0;i<p_dir->dirs.size();i++) {
+ for(int i=0;i<p_dir->subdirs.size();i++) {
- _save_type_cache_fs(p_dir->dirs[i],p_file);
+ _save_filesystem_cache(p_dir->subdirs[i],p_file);
}
}
-void EditorFileSystem::_load_type_cache(){
-
- GLOBAL_LOCK_FUNCTION
-
-
-#if 0
- //this is not good, removed for now as it interferes with metadata stored in files
-
- String project=Globals::get_singleton()->get_resource_path();
- FileAccess *f =FileAccess::open(project+"/types.cache",FileAccess::READ);
-
- if (!f) {
-
- WARN_PRINT("Can't open types.cache.");
- return;
- }
-
- file_type_cache.clear();
- while(!f->eof_reached()) {
-
- String path=f->get_line();
- if (f->eof_reached())
- break;
- String type=f->get_line();
- file_type_cache[path]=type;
- }
-
- memdelete(f);
-#endif
-}
bool EditorFileSystem::_find_file(const String& p_file,EditorFileSystemDirectory ** r_d, int &r_file_pos) const {
//todo make faster
- if (!filesystem || scanning)
- return false;
+ if (!filesystem || scanning)
+ return false;
- String f = Globals::get_singleton()->localize_path(p_file);
+ String f = Globals::get_singleton()->localize_path(p_file);
- if (!f.begins_with("res://"))
- return false;
- f=f.substr(6,f.length());
- f=f.replace("\\","/");
+ if (!f.begins_with("res://"))
+ return false;
+ f=f.substr(6,f.length());
+ f=f.replace("\\","/");
- Vector<String> path = f.split("/");
+ Vector<String> path = f.split("/");
- if (path.size()==0)
- return false;
- String file=path[path.size()-1];
- path.resize(path.size()-1);
+ if (path.size()==0)
+ return false;
+ String file=path[path.size()-1];
+ path.resize(path.size()-1);
- EditorFileSystemDirectory *fs=filesystem;
+ EditorFileSystemDirectory *fs=filesystem;
- for(int i=0;i<path.size();i++) {
+ for(int i=0;i<path.size();i++) {
- int idx=-1;
- for(int j=0;j<fs->get_subdir_count();j++) {
+ int idx=-1;
+ for(int j=0;j<fs->get_subdir_count();j++) {
- if (fs->get_subdir(j)->get_name()==path[i]) {
- idx=j;
- break;
- }
- }
+ if (fs->get_subdir(j)->get_name()==path[i]) {
+ idx=j;
+ break;
+ }
+ }
- if (idx==-1) {
- //does not exist, create i guess?
- EditorFileSystemDirectory *efsd = memnew( EditorFileSystemDirectory );
- efsd->name=path[i];
- int idx2=0;
- for(int j=0;j<fs->get_subdir_count();j++) {
+ if (idx==-1) {
+ //does not exist, create i guess?
+ EditorFileSystemDirectory *efsd = memnew( EditorFileSystemDirectory );
+ efsd->name=path[i];
+ int idx2=0;
+ for(int j=0;j<fs->get_subdir_count();j++) {
- if (efsd->name<fs->get_subdir(j)->get_name())
- break;
- idx2++;
- }
+ if (efsd->name<fs->get_subdir(j)->get_name())
+ break;
+ idx2++;
+ }
- if (idx2==fs->get_subdir_count())
- fs->subdirs.push_back(efsd);
- else
- fs->subdirs.insert(idx2,efsd);
- fs=efsd;
- } else {
+ if (idx2==fs->get_subdir_count())
+ fs->subdirs.push_back(efsd);
+ else
+ fs->subdirs.insert(idx2,efsd);
+ fs=efsd;
+ } else {
- fs=fs->get_subdir(idx);
+ fs=fs->get_subdir(idx);
+ }
}
- }
- int cpos=-1;
- for(int i=0;i<fs->files.size();i++) {
+ int cpos=-1;
+ for(int i=0;i<fs->files.size();i++) {
- if (fs->files[i].file==file) {
- cpos=i;
- break;
+ if (fs->files[i]->file==file) {
+ cpos=i;
+ break;
+ }
}
- }
r_file_pos=cpos;
*r_d=fs;
- if (cpos!=-1) {
+ if (cpos!=-1) {
- return true;
- } else {
+ return true;
+ } else {
- return false;
- }
+ return false;
+ }
}
@@ -967,7 +1109,7 @@ String EditorFileSystem::get_file_type(const String& p_file) const {
}
- return fs->files[cpos].type;
+ return fs->files[cpos]->type;
}
@@ -1024,16 +1166,16 @@ EditorFileSystemDirectory *EditorFileSystem::get_path(const String& p_path) {
void EditorFileSystem::_resource_saved(const String& p_path){
- print_line("resource saved: "+p_path);
+ //print_line("resource saved: "+p_path);
EditorFileSystem::get_singleton()->update_file(p_path);
}
String EditorFileSystem::_find_first_from_source(EditorFileSystemDirectory* p_dir,const String &p_src) const {
for(int i=0;i<p_dir->files.size();i++) {
- for(int j=0;j<p_dir->files[i].meta.sources.size();j++) {
+ for(int j=0;j<p_dir->files[i]->meta.sources.size();j++) {
- if (p_dir->files[i].meta.sources[j].path==p_src)
+ if (p_dir->files[i]->meta.sources[j].path==p_src)
return p_dir->get_file_path(i);
}
}
@@ -1070,6 +1212,7 @@ void EditorFileSystem::update_file(const String& p_file) {
if (!FileAccess::exists(p_file)) {
//was removed
+ memdelete( fs->files[cpos] );
fs->files.remove(cpos);
call_deferred("emit_signal","filesystem_changed"); //update later
return;
@@ -1083,13 +1226,13 @@ void EditorFileSystem::update_file(const String& p_file) {
int idx=0;
for(int i=0;i<fs->files.size();i++) {
- if (p_file<fs->files[i].file)
+ if (p_file<fs->files[i]->file)
break;
idx++;
}
- EditorFileSystemDirectory::FileInfo fi;
- fi.file=p_file.get_file();
+ EditorFileSystemDirectory::FileInfo *fi = memnew( EditorFileSystemDirectory::FileInfo );
+ fi->file=p_file.get_file();
if (idx==fs->files.size()) {
fs->files.push_back(fi);
@@ -1102,10 +1245,10 @@ void EditorFileSystem::update_file(const String& p_file) {
}
- print_line("UPDATING: "+p_file);
- fs->files[cpos].type=type;
- fs->files[cpos].modified_time=FileAccess::get_modified_time(p_file);
- fs->files[cpos].meta=_get_meta(p_file);
+ //print_line("UPDATING: "+p_file);
+ fs->files[cpos]->type=type;
+ fs->files[cpos]->modified_time=FileAccess::get_modified_time(p_file);
+ fs->files[cpos]->meta=_get_meta(p_file);
call_deferred("emit_signal","filesystem_changed"); //update later
@@ -1128,15 +1271,22 @@ EditorFileSystem::EditorFileSystem() {
thread = NULL;
scanning=false;
- scandir=NULL;
- rootdir=NULL;
use_threads=true;
thread_sources=NULL;
+ new_filesystem=NULL;
scanning_sources=false;
ResourceSaver::set_save_callback(_resource_saved);
+ List<String> extensionsl;
+ ResourceLoader::get_recognized_extensions_for_type("",&extensionsl);
+ for(List<String>::Element *E = extensionsl.front();E;E=E->next()) {
+
+ valid_extensions.insert(E->get());
+ }
+
+ scan_total=0;
}
EditorFileSystem::~EditorFileSystem() {
diff --git a/tools/editor/editor_file_system.h b/tools/editor/editor_file_system.h
index f79dd209ef..d11fa0cfb1 100644
--- a/tools/editor/editor_file_system.h
+++ b/tools/editor/editor_file_system.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -42,6 +42,8 @@ class EditorFileSystemDirectory : public Object {
OBJ_TYPE( EditorFileSystemDirectory,Object );
String name;
+ uint64_t modified_time;
+ bool verified; //used for checking changes
EditorFileSystemDirectory *parent;
Vector<EditorFileSystemDirectory*> subdirs;
@@ -68,11 +70,20 @@ class EditorFileSystemDirectory : public Object {
String file;
StringName type;
uint64_t modified_time;
-
ImportMeta meta;
+ bool verified; //used for checking changes
+
+ };
+
+ struct FileInfoSort {
+ bool operator()(const FileInfo *p_a,const FileInfo *p_b) const {
+ return p_a->file<p_b->file;
+ }
};
- Vector<FileInfo> files;
+ void sort_files();
+
+ Vector<FileInfo*> files;
static void _bind_methods();
@@ -96,6 +107,9 @@ public:
EditorFileSystemDirectory *get_parent();
+ int find_file_index(const String& p_file) const;
+ int find_dir_index(const String& p_dir) const;
+
EditorFileSystemDirectory();
~EditorFileSystemDirectory();
@@ -107,45 +121,47 @@ class EditorFileSystem : public Node {
_THREAD_SAFE_CLASS_
- struct SceneItem {
+
+ struct ItemAction {
+
+ enum Action {
+ ACTION_NONE,
+ ACTION_DIR_ADD,
+ ACTION_DIR_REMOVE,
+ ACTION_FILE_ADD,
+ ACTION_FILE_REMOVE,
+ ACTION_FILE_SOURCES_CHANGED
+ };
+
+ Action action;
+ EditorFileSystemDirectory *dir;
String file;
- String path;
- String type;
- uint64_t modified_time;
- EditorFileSystemDirectory::ImportMeta meta;
- };
+ EditorFileSystemDirectory *new_dir;
+ EditorFileSystemDirectory::FileInfo *new_file;
- struct DirItem {
+ ItemAction() { action=ACTION_NONE; dir=NULL; new_dir=NULL; new_file=NULL; }
- uint64_t modified_time;
- String path;
- String name;
- Vector<DirItem*> dirs;
- Vector<SceneItem*> files;
- ~DirItem();
};
- float total;
bool use_threads;
Thread *thread;
static void _thread_func(void *_userdata);
- DirItem *scandir;
- DirItem *rootdir;
+ EditorFileSystemDirectory *new_filesystem;
bool abort_scan;
bool scanning;
+ float scan_total;
- EditorFileSystemDirectory* _update_tree(DirItem *p_item);
- void _scan_scenes();
- void _load_type_cache();
+ void _scan_filesystem();
EditorFileSystemDirectory *filesystem;
static EditorFileSystem *singleton;
+ /* Used for reading the filesystem cache file */
struct FileCache {
String type;
@@ -154,34 +170,43 @@ class EditorFileSystem : public Node {
Vector<String> deps;
};
- struct DirCache {
+ HashMap<String,FileCache> file_cache;
- uint64_t modification_time;
- Set<String> files;
- Set<String> subdirs;
- };
+ struct ScanProgress {
+ float low;
+ float hi;
+ mutable EditorProgressBG *progress;
+ void update(int p_current,int p_total) const;
+ ScanProgress get_sub(int p_current,int p_total) const;
+ };
static EditorFileSystemDirectory::ImportMeta _get_meta(const String& p_path);
- bool _check_meta_sources(EditorFileSystemDirectory::ImportMeta & p_meta,EditorProgressBG *ep=NULL);
+ bool _check_meta_sources(EditorFileSystemDirectory::ImportMeta & p_meta);
- DirItem* _scan_dir(DirAccess *da,Set<String> &extensions,String p_name,float p_from,float p_range,const String& p_path,HashMap<String,FileCache> &file_cache,HashMap<String,DirCache> &dir_cache,EditorProgressBG& p_prog);
- void _save_type_cache_fs(DirItem *p_dir,FileAccess *p_file);
+ void _save_filesystem_cache(EditorFileSystemDirectory *p_dir,FileAccess *p_file);
bool _find_file(const String& p_file,EditorFileSystemDirectory ** r_d, int &r_file_pos) const;
- void _scan_sources(EditorFileSystemDirectory *p_dir,EditorProgressBG *ep);
+ void _scan_fs_changes(EditorFileSystemDirectory *p_dir, const ScanProgress &p_progress);
int md_count;
+ Set<String> valid_extensions;
+
+ void _scan_new_dir(EditorFileSystemDirectory *p_dir,DirAccess *da,const ScanProgress& p_progress);
Thread *thread_sources;
bool scanning_sources;
bool scanning_sources_done;
- int ss_amount;
+
static void _thread_func_sources(void *_userdata);
+
List<String> sources_changed;
+ List<ItemAction> scan_actions;
+
+ bool _update_scan_actions();
static void _resource_saved(const String& p_path);
String _find_first_from_source(EditorFileSystemDirectory* p_dir,const String &p_src) const;
diff --git a/tools/editor/editor_fonts.cpp b/tools/editor/editor_fonts.cpp
index f145f1ddef..b12b041f16 100644
--- a/tools/editor/editor_fonts.cpp
+++ b/tools/editor/editor_fonts.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_fonts.h b/tools/editor/editor_fonts.h
index cc990a560c..3b2422c3e3 100644
--- a/tools/editor/editor_fonts.h
+++ b/tools/editor/editor_fonts.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp
index 1905ab731f..2ece518f8d 100644
--- a/tools/editor/editor_help.cpp
+++ b/tools/editor/editor_help.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_help.h b/tools/editor/editor_help.h
index 04ac4d35ff..059a7ae11d 100644
--- a/tools/editor/editor_help.h
+++ b/tools/editor/editor_help.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_icons.h b/tools/editor/editor_icons.h
index 910febc895..191b908682 100644
--- a/tools/editor/editor_icons.h
+++ b/tools/editor/editor_icons.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp
index c50a95a93d..bcac82fc1b 100644
--- a/tools/editor/editor_import_export.cpp
+++ b/tools/editor/editor_import_export.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_import_export.h b/tools/editor/editor_import_export.h
index 940a41bafd..3dc78c88aa 100644
--- a/tools/editor/editor_import_export.h
+++ b/tools/editor/editor_import_export.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_log.cpp b/tools/editor/editor_log.cpp
index 264117eecd..48f7c90066 100644
--- a/tools/editor/editor_log.cpp
+++ b/tools/editor/editor_log.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_log.h b/tools/editor/editor_log.h
index 93044f9a2d..d7d46b70d3 100644
--- a/tools/editor/editor_log.h
+++ b/tools/editor/editor_log.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_name_dialog.cpp b/tools/editor/editor_name_dialog.cpp
index 82050e0a56..c221b908e0 100644
--- a/tools/editor/editor_name_dialog.cpp
+++ b/tools/editor/editor_name_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_name_dialog.h b/tools/editor/editor_name_dialog.h
index 85f4f772e6..9e66908899 100644
--- a/tools/editor/editor_name_dialog.h
+++ b/tools/editor/editor_name_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index b30c875866..9fe0409c0e 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -415,7 +415,7 @@ void EditorNode::_rebuild_import_menu()
{
PopupMenu* p = import_menu->get_popup();
p->clear();
- p->add_item("Sub-Scene", FILE_IMPORT_SUBSCENE);
+ p->add_item("Node from scene", FILE_IMPORT_SUBSCENE);
p->add_separator();
for (int i = 0; i < editor_import_export->get_import_plugin_count(); i++) {
p->add_item(editor_import_export->get_import_plugin(i)->get_visible_name(), IMPORT_PLUGIN_BASE + i);
@@ -511,13 +511,21 @@ void EditorNode::save_resource_as(const Ref<Resource>& p_resource) {
file->set_mode(EditorFileDialog::MODE_SAVE_FILE);
bool relpaths = (p_resource->has_meta("__editor_relpaths__") && p_resource->get_meta("__editor_relpaths__").operator bool());
+ current_option=RESOURCE_SAVE_AS;
List<String> extensions;
Ref<PackedScene> sd = memnew( PackedScene );
ResourceSaver::get_recognized_extensions(p_resource,&extensions);
file->clear_filters();
+
+ List<String> preferred;
for(int i=0;i<extensions.size();i++) {
+ if (p_resource->is_type("Script") && extensions[i]=="tres" || extensions[i]=="res" || extensions[i]=="xml") {
+ //this serves no purpose and confused people
+ continue;
+ }
file->add_filter("*."+extensions[i]+" ; "+extensions[i].to_upper());
+ preferred.push_back(extensions[i]);
}
//file->set_current_path(current_path);
@@ -529,11 +537,11 @@ void EditorNode::save_resource_as(const Ref<Resource>& p_resource) {
file->set_current_path(p_resource->get_path().replacen("."+ext,"."+extensions.front()->get()));
}
}
- } else {
+ } else if (preferred.size()) {
String existing;
if (extensions.size()) {
- existing="new_"+p_resource->get_type().to_lower()+"."+extensions.front()->get().to_lower();
+ existing="new_"+p_resource->get_type().to_lower()+"."+preferred.front()->get().to_lower();
}
file->set_current_path(existing);
@@ -584,59 +592,66 @@ void EditorNode::_dialog_display_file_error(String p_file,Error p_error) {
}
-void EditorNode::_get_scene_metadata() {
+void EditorNode::_get_scene_metadata(const String& p_file) {
Node *scene = editor_data.get_edited_scene_root();
if (!scene)
return;
+ String path = EditorSettings::get_singleton()->get_project_settings_path().plus_file(p_file.get_file()+"-editstate-"+p_file.md5_text()+".cfg");
- if (scene->has_meta("__editor_plugin_states__")) {
+ Ref<ConfigFile> cf;
+ cf.instance();
- Dictionary md = scene->get_meta("__editor_plugin_states__");
- editor_data.set_editor_states(md);
+ Error err = cf->load(path);
+ if (err!=OK)
+ return; //must not exist
- }
+ List<String> esl;
+ cf->get_section_keys("editor_states",&esl);
- if (scene->has_meta("__editor_run_settings__")) {
+ Dictionary md;
+ for (List<String>::Element *E=esl.front();E;E=E->next()) {
- Dictionary md = scene->get_meta("__editor_run_settings__");
- if (md.has("run_mode"))
- run_settings_dialog->set_run_mode(md["run_mode"]);
- if (md.has("custom_args"))
- run_settings_dialog->set_custom_arguments(md["custom_args"]);
+ Variant st=cf->get_value("editor_states",E->get());
+ if (st.get_type()) {
+ md[E->get()]=st;
+ }
}
+
+ editor_data.set_editor_states(md);
+
}
-void EditorNode::_set_scene_metadata() {
+void EditorNode::_set_scene_metadata(const String& p_file) {
Node *scene = editor_data.get_edited_scene_root();
if (!scene)
return;
- { /* Editor States */
- Dictionary md = editor_data.get_editor_states();
-
- if (!md.empty()) {
- scene->set_meta("__editor_plugin_states__",md);
- }
- }
+ scene->set_meta("__editor_run_settings__",Variant()); //clear it (no point in keeping it)
+ scene->set_meta("__editor_plugin_states__",Variant());
- { /* Run Settings */
+ String path = EditorSettings::get_singleton()->get_project_settings_path().plus_file(p_file.get_file()+"-editstate-"+p_file.md5_text()+".cfg");
+ Ref<ConfigFile> cf;
+ cf.instance();
- Dictionary md;
- md["run_mode"]=run_settings_dialog->get_run_mode();
- md["custom_args"]=run_settings_dialog->get_custom_arguments();
- scene->set_meta("__editor_run_settings__",md);
- }
+ Dictionary md = editor_data.get_editor_states();
+ List<Variant> keys;
+ md.get_key_list(&keys);
+ for(List<Variant>::Element *E=keys.front();E;E=E->next()) {
+ cf->set_value("editor_states",E->get(),md[E->get()]);
+ }
+ Error err = cf->save(path);
+ ERR_FAIL_COND(err!=OK);
}
@@ -954,7 +969,7 @@ void EditorNode::_save_scene(String p_file) {
}
- _set_scene_metadata();
+ _set_scene_metadata(p_file);
Ref<PackedScene> sdata;
@@ -1439,8 +1454,13 @@ void EditorNode::_dialog_action(String p_file) {
Ref<ConfigFile> config;
config.instance();
Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg"));
- if (err!=OK && err!=ERR_FILE_NOT_FOUND) {
- return; //no config
+
+ if (err==ERR_CANT_OPEN) {
+ config.instance(); // new config
+ } else if (err!=OK) {
+ confirm_error->set_text("Error trying to save layout!");
+ confirm_error->popup_centered_minsize();
+ return;
}
_save_docks_to_config(config, p_file);
@@ -1465,11 +1485,8 @@ void EditorNode::_dialog_action(String p_file) {
Ref<ConfigFile> config;
config.instance();
Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg"));
- if (err!=OK) {
- return; //no config
- }
- if (!config->has_section(p_file)) {
+ if (err!=OK || !config->has_section(p_file)) {
confirm_error->set_text("Layout name not found!");
confirm_error->popup_centered_minsize();
return;
@@ -3518,11 +3535,13 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo
}
- for(int i=0;i<editor_data.get_edited_scene_count();i++) {
+ if(!p_set_inherited) {
+ for(int i=0;i<editor_data.get_edited_scene_count();i++) {
- if (editor_data.get_scene_path(i)==p_scene) {
- _scene_tab_changed(i);
- return OK;
+ if (editor_data.get_scene_path(i)==p_scene) {
+ _scene_tab_changed(i);
+ return OK;
+ }
}
}
@@ -3652,7 +3671,7 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo
new_scene->set_scene_instance_state(Ref<SceneState>());
set_edited_scene(new_scene);
- _get_scene_metadata();
+ _get_scene_metadata(p_scene);
/*
editor_data.set_edited_scene_root(new_scene);
@@ -5172,7 +5191,7 @@ EditorNode::EditorNode() {
p->add_separator();
p->add_item("Revert Scene",EDIT_REVERT);
p->add_separator();
- p->add_item("Quit to Project List",RUN_PROJECT_MANAGER,KEY_MASK_SHIFT+KEY_MASK_CMD+KEY_Q);
+ p->add_item("Quit to Project List",RUN_PROJECT_MANAGER,KEY_MASK_SHIFT+KEY_MASK_ALT+KEY_Q);
p->add_item("Quit",FILE_QUIT,KEY_MASK_CMD+KEY_Q);
recent_scenes = memnew( PopupMenu );
@@ -5938,6 +5957,7 @@ EditorNode::EditorNode() {
resource_preview->add_preview_generator( Ref<EditorScriptPreviewPlugin>( memnew(EditorScriptPreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorSamplePreviewPlugin>( memnew(EditorSamplePreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorMeshPreviewPlugin>( memnew(EditorMeshPreviewPlugin )));
+ resource_preview->add_preview_generator( Ref<EditorBitmapPreviewPlugin>( memnew(EditorBitmapPreviewPlugin )));
circle_step_msec=OS::get_singleton()->get_ticks_msec();
circle_step_frame=OS::get_singleton()->get_frames_drawn();
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index 0a087eb1ed..2228e0948b 100644
--- a/tools/editor/editor_node.h
+++ b/tools/editor/editor_node.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -420,8 +420,8 @@ class EditorNode : public Node {
void _node_renamed();
void _editor_select(int p_which);
- void _set_scene_metadata();
- void _get_scene_metadata();
+ void _set_scene_metadata(const String &p_file);
+ void _get_scene_metadata(const String& p_file);
void _update_title();
void _update_scene_tabs();
void _close_messages();
diff --git a/tools/editor/editor_path.cpp b/tools/editor/editor_path.cpp
index 94e2efe346..4cf98e832c 100644
--- a/tools/editor/editor_path.cpp
+++ b/tools/editor/editor_path.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_path.h b/tools/editor/editor_path.h
index 2edaeb92a3..11e1005ba3 100644
--- a/tools/editor/editor_path.h
+++ b/tools/editor/editor_path.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_plugin.cpp b/tools/editor/editor_plugin.cpp
index 7417d707bb..b7ccb452e9 100644
--- a/tools/editor/editor_plugin.cpp
+++ b/tools/editor/editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_plugin.h b/tools/editor/editor_plugin.h
index 6850be2eaa..bf1e185a37 100644
--- a/tools/editor/editor_plugin.h
+++ b/tools/editor/editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_reimport_dialog.cpp b/tools/editor/editor_reimport_dialog.cpp
index 8842a485b3..eab5a5e32d 100644
--- a/tools/editor/editor_reimport_dialog.cpp
+++ b/tools/editor/editor_reimport_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_reimport_dialog.h b/tools/editor/editor_reimport_dialog.h
index 9726bac805..0c2d0eb52c 100644
--- a/tools/editor/editor_reimport_dialog.h
+++ b/tools/editor/editor_reimport_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_run.cpp b/tools/editor/editor_run.cpp
index b635cea84b..fb0f24c084 100644
--- a/tools/editor/editor_run.cpp
+++ b/tools/editor/editor_run.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_run.h b/tools/editor/editor_run.h
index e1b0b081c7..0b96a2c91c 100644
--- a/tools/editor/editor_run.h
+++ b/tools/editor/editor_run.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_run_native.cpp b/tools/editor/editor_run_native.cpp
index 2eedba93dc..234dd03087 100644
--- a/tools/editor/editor_run_native.cpp
+++ b/tools/editor/editor_run_native.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_run_native.h b/tools/editor/editor_run_native.h
index 77d6dc198e..04dad6b6aa 100644
--- a/tools/editor/editor_run_native.h
+++ b/tools/editor/editor_run_native.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_selection.cpp b/tools/editor/editor_selection.cpp
index d8fd8735fc..f3fbdba907 100644
--- a/tools/editor/editor_selection.cpp
+++ b/tools/editor/editor_selection.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_selection.h b/tools/editor/editor_selection.h
index f10f313a4e..d238d86567 100644
--- a/tools/editor/editor_selection.h
+++ b/tools/editor/editor_selection.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp
index 5c36b842c7..4195ba97e6 100644
--- a/tools/editor/editor_settings.cpp
+++ b/tools/editor/editor_settings.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_settings.h b/tools/editor/editor_settings.h
index bdfa5160d6..d1a11360af 100644
--- a/tools/editor/editor_settings.h
+++ b/tools/editor/editor_settings.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_sub_scene.cpp b/tools/editor/editor_sub_scene.cpp
index d7d79e5cc7..e58e2c1351 100644
--- a/tools/editor/editor_sub_scene.cpp
+++ b/tools/editor/editor_sub_scene.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_sub_scene.h b/tools/editor/editor_sub_scene.h
index dfd6c531e2..3dd86eefda 100644
--- a/tools/editor/editor_sub_scene.h
+++ b/tools/editor/editor_sub_scene.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_vu.cpp b/tools/editor/editor_vu.cpp
index ac11aceb21..7a133c9736 100644
--- a/tools/editor/editor_vu.cpp
+++ b/tools/editor/editor_vu.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/editor_vu.h b/tools/editor/editor_vu.h
index 4c51ac31c0..78fe3eda86 100644
--- a/tools/editor/editor_vu.h
+++ b/tools/editor/editor_vu.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/file_type_cache.cpp b/tools/editor/file_type_cache.cpp
index a86400a560..7044a9900c 100644
--- a/tools/editor/file_type_cache.cpp
+++ b/tools/editor/file_type_cache.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/file_type_cache.h b/tools/editor/file_type_cache.h
index efc6d22b25..18451cbe19 100644
--- a/tools/editor/file_type_cache.h
+++ b/tools/editor/file_type_cache.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/groups_editor.cpp b/tools/editor/groups_editor.cpp
index bb5e93da34..6840a8b205 100644
--- a/tools/editor/groups_editor.cpp
+++ b/tools/editor/groups_editor.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/groups_editor.h b/tools/editor/groups_editor.h
index 3a9cc77727..b5bccb2766 100644
--- a/tools/editor/groups_editor.h
+++ b/tools/editor/groups_editor.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/icons/icon_edit_pivot.png b/tools/editor/icons/icon_edit_pivot.png
new file mode 100644
index 0000000000..d68f7bbf25
--- /dev/null
+++ b/tools/editor/icons/icon_edit_pivot.png
Binary files differ
diff --git a/tools/editor/import_settings.cpp b/tools/editor/import_settings.cpp
index 36d7828be0..2bbd1e3805 100644
--- a/tools/editor/import_settings.cpp
+++ b/tools/editor/import_settings.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/import_settings.h b/tools/editor/import_settings.h
index 31237dd8cf..5a383a1a1a 100644
--- a/tools/editor/import_settings.h
+++ b/tools/editor/import_settings.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/io_plugins/editor_atlas.cpp b/tools/editor/io_plugins/editor_atlas.cpp
index 7e9acd193d..f894e7e8b2 100644
--- a/tools/editor/io_plugins/editor_atlas.cpp
+++ b/tools/editor/io_plugins/editor_atlas.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/io_plugins/editor_atlas.h b/tools/editor/io_plugins/editor_atlas.h
index 716faff0c6..0135e76622 100644
--- a/tools/editor/io_plugins/editor_atlas.h
+++ b/tools/editor/io_plugins/editor_atlas.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp
index 5ba0669f1d..9b4ca246e7 100644
--- a/tools/editor/io_plugins/editor_font_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -621,6 +621,7 @@ public:
source->get_file_dialog()->set_mode(EditorFileDialog::MODE_OPEN_FILE);
source->get_file_dialog()->add_filter("*.ttf;TrueType");
source->get_file_dialog()->add_filter("*.otf;OpenType");
+ source->get_file_dialog()->add_filter("*.fnt;BMFont");
source->get_line_edit()->connect("text_entered",this,"_src_changed");
vbl->add_margin_child("Source Font:",source);
@@ -876,10 +877,31 @@ static unsigned char get_SDF_radial(
Ref<Font> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMetadata>& p_from, const String &p_existing) {
+
+
Ref<ResourceImportMetadata> from = p_from;
ERR_FAIL_COND_V(from->get_source_count()!=1,Ref<Font>());
String src_path = EditorImportPlugin::expand_source_path(from->get_source_path(0));
+
+ if (src_path.extension().to_lower()=="fnt") {
+
+ if (ResourceLoader::load(src_path).is_valid()) {
+ EditorNode::get_singleton()->show_warning("Path: "+src_path+"\nIs a Godot font file, please supply a BMFont type file instead.");
+ return Ref<Font>();
+ }
+
+ Ref<Font> font;
+ font.instance();
+ Error err = font->create_from_fnt(src_path);
+ if (err) {
+ EditorNode::get_singleton()->show_warning("Path: "+src_path+"\nFailed opening as BMFont file.");
+ return Ref<Font>();
+ }
+
+ return font;
+ }
+
int size = from->get_option("font/size");
#ifdef FREETYPE_ENABLED
diff --git a/tools/editor/io_plugins/editor_font_import_plugin.h b/tools/editor/io_plugins/editor_font_import_plugin.h
index 451f01080e..814897c5f0 100644
--- a/tools/editor/io_plugins/editor_font_import_plugin.h
+++ b/tools/editor/io_plugins/editor_font_import_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/io_plugins/editor_import_collada.cpp
index ffc2d057e3..7de9d978f2 100644
--- a/tools/editor/io_plugins/editor_import_collada.cpp
+++ b/tools/editor/io_plugins/editor_import_collada.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/io_plugins/editor_import_collada.h b/tools/editor/io_plugins/editor_import_collada.h
index 243cd043a0..de45dc38f4 100644
--- a/tools/editor/io_plugins/editor_import_collada.h
+++ b/tools/editor/io_plugins/editor_import_collada.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.cpp b/tools/editor/io_plugins/editor_sample_import_plugin.cpp
index 28eeb56b4b..b81c88c817 100644
--- a/tools/editor/io_plugins/editor_sample_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_sample_import_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.h b/tools/editor/io_plugins/editor_sample_import_plugin.h
index 89319affa0..b31562af76 100644
--- a/tools/editor/io_plugins/editor_sample_import_plugin.h
+++ b/tools/editor/io_plugins/editor_sample_import_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
index ca44df269b..a3b6827cd4 100644
--- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.h b/tools/editor/io_plugins/editor_scene_import_plugin.h
index 71efab9503..1f3b73fe7f 100644
--- a/tools/editor/io_plugins/editor_scene_import_plugin.h
+++ b/tools/editor/io_plugins/editor_scene_import_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp
index 92ef57a69e..29273ebd06 100644
--- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.h b/tools/editor/io_plugins/editor_texture_import_plugin.h
index 38fd671e9d..cb63ba98c8 100644
--- a/tools/editor/io_plugins/editor_texture_import_plugin.h
+++ b/tools/editor/io_plugins/editor_texture_import_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.cpp b/tools/editor/io_plugins/editor_translation_import_plugin.cpp
index d152d71af4..1edfe697b6 100644
--- a/tools/editor/io_plugins/editor_translation_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_translation_import_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.h b/tools/editor/io_plugins/editor_translation_import_plugin.h
index f3c2884534..cadcdc03b3 100644
--- a/tools/editor/io_plugins/editor_translation_import_plugin.h
+++ b/tools/editor/io_plugins/editor_translation_import_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/optimized_save_dialog.cpp b/tools/editor/optimized_save_dialog.cpp
index 687d3675fc..4814b3b021 100644
--- a/tools/editor/optimized_save_dialog.cpp
+++ b/tools/editor/optimized_save_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/optimized_save_dialog.h b/tools/editor/optimized_save_dialog.h
index 739d0e1506..bdc36eddc1 100644
--- a/tools/editor/optimized_save_dialog.h
+++ b/tools/editor/optimized_save_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/output_strings.cpp b/tools/editor/output_strings.cpp
index 30569d11b0..a19352f4ec 100644
--- a/tools/editor/output_strings.cpp
+++ b/tools/editor/output_strings.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/output_strings.h b/tools/editor/output_strings.h
index ad893534fa..3d5deb1646 100644
--- a/tools/editor/output_strings.h
+++ b/tools/editor/output_strings.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/pane_drag.cpp b/tools/editor/pane_drag.cpp
index fb137de5ce..8e8c2941ec 100644
--- a/tools/editor/pane_drag.cpp
+++ b/tools/editor/pane_drag.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/pane_drag.h b/tools/editor/pane_drag.h
index a6cd9b6662..24f2ef7ed8 100644
--- a/tools/editor/pane_drag.h
+++ b/tools/editor/pane_drag.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/animation_data_editor_plugin.cpp b/tools/editor/plugins/animation_data_editor_plugin.cpp
index d8d65b875a..a73c75056b 100644
--- a/tools/editor/plugins/animation_data_editor_plugin.cpp
+++ b/tools/editor/plugins/animation_data_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/animation_data_editor_plugin.h b/tools/editor/plugins/animation_data_editor_plugin.h
index 0daa67d0a5..0a12638474 100644
--- a/tools/editor/plugins/animation_data_editor_plugin.h
+++ b/tools/editor/plugins/animation_data_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp
index dc2c241d2f..12a707b2ca 100644
--- a/tools/editor/plugins/animation_player_editor_plugin.cpp
+++ b/tools/editor/plugins/animation_player_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/animation_player_editor_plugin.h b/tools/editor/plugins/animation_player_editor_plugin.h
index 839df3ddcc..9fbd92e4f0 100644
--- a/tools/editor/plugins/animation_player_editor_plugin.h
+++ b/tools/editor/plugins/animation_player_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/animation_tree_editor_plugin.cpp b/tools/editor/plugins/animation_tree_editor_plugin.cpp
index 382bc44726..609b1ccb63 100644
--- a/tools/editor/plugins/animation_tree_editor_plugin.cpp
+++ b/tools/editor/plugins/animation_tree_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/animation_tree_editor_plugin.h b/tools/editor/plugins/animation_tree_editor_plugin.h
index bd29530c7a..fb7eb58f8d 100644
--- a/tools/editor/plugins/animation_tree_editor_plugin.h
+++ b/tools/editor/plugins/animation_tree_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/camera_editor_plugin.cpp b/tools/editor/plugins/camera_editor_plugin.cpp
index 08ed2c745d..7433264b16 100644
--- a/tools/editor/plugins/camera_editor_plugin.cpp
+++ b/tools/editor/plugins/camera_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/camera_editor_plugin.h b/tools/editor/plugins/camera_editor_plugin.h
index afb8f9415d..ea016ecb4d 100644
--- a/tools/editor/plugins/camera_editor_plugin.h
+++ b/tools/editor/plugins/camera_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp
index 0946383c8d..f3cf53cbdf 100644
--- a/tools/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -152,6 +152,46 @@ public:
}
};
+void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) {
+ List<Node*> &selection = editor_selection->get_selected_node_list();
+
+ undo_redo->create_action("Move Pivot");
+
+ for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
+
+ Node2D *n2d = E->get()->cast_to<Node2D>();
+
+ if (n2d && n2d->edit_has_pivot()) {
+
+ Vector2 offset = n2d->edit_get_pivot();
+ Vector2 gpos = n2d->get_global_pos();
+
+ Vector2 local_mouse_pos = n2d->get_canvas_transform().affine_inverse().xform(mouse_pos);
+
+ Vector2 motion_ofs = gpos-local_mouse_pos;
+
+ undo_redo->add_do_method(n2d,"set_global_pos",local_mouse_pos);
+ undo_redo->add_do_method(n2d,"edit_set_pivot",offset+n2d->get_global_transform().affine_inverse().basis_xform(motion_ofs));
+ undo_redo->add_undo_method(n2d,"set_global_pos",gpos);
+ undo_redo->add_undo_method(n2d,"edit_set_pivot",offset);
+ for(int i=0;i<n2d->get_child_count();i++) {
+ Node2D *n2dc = n2d->get_child(i)->cast_to<Node2D>();
+ if (!n2dc)
+ continue;
+
+ undo_redo->add_do_method(n2dc,"set_global_pos",n2dc->get_global_pos());
+ undo_redo->add_undo_method(n2dc,"set_global_pos",n2dc->get_global_pos());
+
+ }
+
+ }
+
+ }
+
+ undo_redo->commit_action();
+
+}
+
void CanvasItemEditor::_unhandled_key_input(const InputEvent& p_ev) {
if (!is_visible())
@@ -179,38 +219,7 @@ void CanvasItemEditor::_unhandled_key_input(const InputEvent& p_ev) {
mouse_pos=transform.affine_inverse().xform(mouse_pos);
mouse_pos=snap_point(mouse_pos);
- undo_redo->create_action("Move Pivot");
-
- for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
-
- Node2D *n2d = E->get()->cast_to<Node2D>();
-
- if (n2d && n2d->edit_has_pivot()) {
-
- Vector2 offset = n2d->edit_get_pivot();
- Vector2 gpos = n2d->get_global_pos();
-
- Vector2 motion_ofs = gpos-mouse_pos;
-
- undo_redo->add_do_method(n2d,"set_global_pos",mouse_pos);
- undo_redo->add_do_method(n2d,"edit_set_pivot",offset+n2d->get_global_transform().affine_inverse().basis_xform(motion_ofs));
- undo_redo->add_undo_method(n2d,"set_global_pos",gpos);
- undo_redo->add_undo_method(n2d,"edit_set_pivot",offset);
- for(int i=0;i<n2d->get_child_count();i++) {
- Node2D *n2dc = n2d->get_child(i)->cast_to<Node2D>();
- if (!n2dc)
- continue;
-
- undo_redo->add_do_method(n2dc,"set_global_pos",n2dc->get_global_pos());
- undo_redo->add_undo_method(n2dc,"set_global_pos",n2dc->get_global_pos());
-
- }
-
- }
-
- }
-
- undo_redo->commit_action();
+ _edit_set_pivot(mouse_pos);
}
}
@@ -221,7 +230,7 @@ void CanvasItemEditor::_unhandled_key_input(const InputEvent& p_ev) {
void CanvasItemEditor::_tool_select(int p_index) {
- ToolButton *tb[TOOL_MAX]={select_button,list_select_button,move_button,rotate_button,pan_button};
+ ToolButton *tb[TOOL_MAX]={select_button,list_select_button,move_button,rotate_button,pivot_button,pan_button};
for(int i=0;i<TOOL_MAX;i++) {
tb[i]->set_pressed(i==p_index);
@@ -1130,6 +1139,20 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
return;
}
+
+ if (b.button_index==BUTTON_LEFT && tool==TOOL_EDIT_PIVOT) {
+ if (b.pressed) {
+
+ Point2 mouse_pos(b.x,b.y);
+ mouse_pos=transform.affine_inverse().xform(mouse_pos);
+ mouse_pos=snap_point(mouse_pos);
+ _edit_set_pivot(mouse_pos);
+ }
+ return;
+ }
+
+
+
if (tool==TOOL_PAN || b.button_index!=BUTTON_LEFT || Input::get_singleton()->is_key_pressed(KEY_SPACE))
return;
@@ -1858,6 +1881,8 @@ void CanvasItemEditor::_viewport_draw() {
CanvasItem *single_item=NULL;
+ bool pivot_found=false;
+
for(Map<Node*,Object*>::Element *E=selection.front();E;E=E->next()) {
@@ -1899,7 +1924,7 @@ void CanvasItemEditor::_viewport_draw() {
viewport->draw_line(endpoints[i],endpoints[(i+1)%4],c,2);
}
- if (single && (tool==TOOL_SELECT || tool == TOOL_MOVE || tool == TOOL_ROTATE)) { //kind of sucks
+ if (single && (tool==TOOL_SELECT || tool == TOOL_MOVE || tool == TOOL_ROTATE || tool==TOOL_EDIT_PIVOT)) { //kind of sucks
if (canvas_item->cast_to<Node2D>()) {
@@ -1907,6 +1932,7 @@ void CanvasItemEditor::_viewport_draw() {
if (canvas_item->cast_to<Node2D>()->edit_has_pivot()) {
viewport->draw_texture(pivot,xform.get_origin()+(-pivot->get_size()/2).floor());
can_move_pivot=true;
+ pivot_found=true;
}
}
@@ -1941,6 +1967,7 @@ void CanvasItemEditor::_viewport_draw() {
//E->get().last_rect = rect;
}
+ pivot_button->set_disabled(!pivot_found);
VisualServer::get_singleton()->canvas_item_add_set_transform(ci,Matrix32());
@@ -2149,6 +2176,7 @@ void CanvasItemEditor::_notification(int p_what) {
move_button->set_icon( get_icon("ToolMove","EditorIcons"));
rotate_button->set_icon( get_icon("ToolRotate","EditorIcons"));
pan_button->set_icon( get_icon("ToolPan", "EditorIcons"));
+ pivot_button->set_icon( get_icon("EditPivot", "EditorIcons"));
select_handle=get_icon("EditorHandle","EditorIcons");
lock_button->set_icon(get_icon("Lock","EditorIcons"));
unlock_button->set_icon(get_icon("Unlock","EditorIcons"));
@@ -3206,6 +3234,12 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
list_select_button->connect("pressed",this,"_tool_select",make_binds(TOOL_LIST_SELECT));
list_select_button->set_tooltip("Show a list of all objects at the position clicked\n(same as Alt+RMB in selet mode).");
+ pivot_button = memnew( ToolButton );
+ pivot_button->set_toggle_mode(true);
+ hb->add_child(pivot_button);
+ pivot_button->connect("pressed",this,"_tool_select",make_binds(TOOL_EDIT_PIVOT));
+ pivot_button->set_tooltip("Click to change object's rotation pivot");
+
pan_button = memnew( ToolButton );
pan_button->set_toggle_mode(true);
hb->add_child(pan_button);
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.h b/tools/editor/plugins/canvas_item_editor_plugin.h
index 2376e9f842..91cfab9863 100644
--- a/tools/editor/plugins/canvas_item_editor_plugin.h
+++ b/tools/editor/plugins/canvas_item_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -70,6 +70,7 @@ class CanvasItemEditor : public VBoxContainer {
TOOL_LIST_SELECT,
TOOL_MOVE,
TOOL_ROTATE,
+ TOOL_EDIT_PIVOT,
TOOL_PAN,
TOOL_MAX
};
@@ -245,6 +246,7 @@ class CanvasItemEditor : public VBoxContainer {
ToolButton *move_button;
ToolButton *rotate_button;
+ ToolButton *pivot_button;
ToolButton *pan_button;
ToolButton *lock_button;
@@ -266,6 +268,7 @@ class CanvasItemEditor : public VBoxContainer {
PopupMenu *selection_menu;
+
//PopupMenu *popup;
DragType drag;
Point2 drag_from;
@@ -306,6 +309,7 @@ class CanvasItemEditor : public VBoxContainer {
CanvasItem *ref_item;
+ void _edit_set_pivot(const Vector2& mouse_pos);
void _add_canvas_item(CanvasItem *p_canvas_item);
void _remove_canvas_item(CanvasItem *p_canvas_item);
void _clear_canvas_items();
diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_editor_plugin.cpp
index 60683f4eda..d4198f3166 100644
--- a/tools/editor/plugins/collision_polygon_editor_plugin.cpp
+++ b/tools/editor/plugins/collision_polygon_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.h b/tools/editor/plugins/collision_polygon_editor_plugin.h
index 20a0b3c3f6..45e287ef00 100644
--- a/tools/editor/plugins/collision_polygon_editor_plugin.h
+++ b/tools/editor/plugins/collision_polygon_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/control_editor_plugin.cpp b/tools/editor/plugins/control_editor_plugin.cpp
index 7348a69665..375622a89c 100644
--- a/tools/editor/plugins/control_editor_plugin.cpp
+++ b/tools/editor/plugins/control_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/control_editor_plugin.h b/tools/editor/plugins/control_editor_plugin.h
index 074298d0df..94cffc8d8d 100644
--- a/tools/editor/plugins/control_editor_plugin.h
+++ b/tools/editor/plugins/control_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp b/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp
index c118485083..c861a5841a 100644
--- a/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp
+++ b/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/cube_grid_theme_editor_plugin.h b/tools/editor/plugins/cube_grid_theme_editor_plugin.h
index 583ddf6e14..72ee171e19 100644
--- a/tools/editor/plugins/cube_grid_theme_editor_plugin.h
+++ b/tools/editor/plugins/cube_grid_theme_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/editor_preview_plugins.cpp b/tools/editor/plugins/editor_preview_plugins.cpp
index 5f52d4c3e7..a0ce294219 100644
--- a/tools/editor/plugins/editor_preview_plugins.cpp
+++ b/tools/editor/plugins/editor_preview_plugins.cpp
@@ -6,6 +6,7 @@
#include "scene/resources/material.h"
#include "scene/resources/sample.h"
#include "scene/resources/mesh.h"
+#include "scene/resources/bit_mask.h"
bool EditorTexturePreviewPlugin::handles(const String& p_type) const {
@@ -58,6 +59,81 @@ EditorTexturePreviewPlugin::EditorTexturePreviewPlugin() {
}
+////////////////////////////////////////////////////////////////////////////
+
+bool EditorBitmapPreviewPlugin::handles(const String& p_type) const {
+
+ return ObjectTypeDB::is_type(p_type,"BitMap");
+}
+
+Ref<Texture> EditorBitmapPreviewPlugin::generate(const RES& p_from) {
+
+ Ref<BitMap> bm =p_from;
+
+ if (bm->get_size()==Size2()) {
+ return Ref<Texture>();
+ }
+
+ DVector<uint8_t> data;
+
+ data.resize(bm->get_size().width*bm->get_size().height);
+
+ {
+ DVector<uint8_t>::Write w=data.write();
+
+ for(int i=0;i<bm->get_size().width;i++) {
+ for(int j=0;j<bm->get_size().height;j++) {
+ if (bm->get_bit(Point2i(i,j))) {
+ w[j*bm->get_size().width+i]=255;
+ } else {
+ w[j*bm->get_size().width+i]=0;
+
+ }
+ }
+
+ }
+ }
+
+
+ Image img(bm->get_size().width,bm->get_size().height,0,Image::FORMAT_GRAYSCALE,data);
+
+ int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ if (img.is_compressed()) {
+ if (img.decompress()!=OK)
+ return Ref<Texture>();
+ } else if (img.get_format()!=Image::FORMAT_RGB && img.get_format()!=Image::FORMAT_RGBA) {
+ img.convert(Image::FORMAT_RGBA);
+ }
+
+ int width,height;
+ if (img.get_width() > thumbnail_size && img.get_width() >= img.get_height()) {
+
+ width=thumbnail_size;
+ height = img.get_height() * thumbnail_size / img.get_width();
+ } else if (img.get_height() > thumbnail_size && img.get_height() >= img.get_width()) {
+
+ height=thumbnail_size;
+ width = img.get_width() * thumbnail_size / img.get_height();
+ } else {
+
+ width=img.get_width();
+ height=img.get_height();
+ }
+
+ img.resize(width,height);
+
+ Ref<ImageTexture> ptex = Ref<ImageTexture>( memnew( ImageTexture ));
+
+ ptex->create_from_image(img,0);
+ return ptex;
+
+}
+
+EditorBitmapPreviewPlugin::EditorBitmapPreviewPlugin() {
+
+
+}
+
///////////////////////////////////////////////////////////////////////////
diff --git a/tools/editor/plugins/editor_preview_plugins.h b/tools/editor/plugins/editor_preview_plugins.h
index 98071e2a0e..b3bfda8045 100644
--- a/tools/editor/plugins/editor_preview_plugins.h
+++ b/tools/editor/plugins/editor_preview_plugins.h
@@ -13,6 +13,17 @@ public:
};
+class EditorBitmapPreviewPlugin : public EditorResourcePreviewGenerator {
+public:
+
+ virtual bool handles(const String& p_type) const;
+ virtual Ref<Texture> generate(const RES& p_from);
+
+ EditorBitmapPreviewPlugin();
+};
+
+
+
class EditorPackedScenePreviewPlugin : public EditorResourcePreviewGenerator {
Ref<Texture> _gen_from_imd(Ref<ResourceImportMetadata> p_imd);
diff --git a/tools/editor/plugins/item_list_editor_plugin.cpp b/tools/editor/plugins/item_list_editor_plugin.cpp
index 9c53c73afd..6f0db959ba 100644
--- a/tools/editor/plugins/item_list_editor_plugin.cpp
+++ b/tools/editor/plugins/item_list_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/item_list_editor_plugin.h b/tools/editor/plugins/item_list_editor_plugin.h
index b40a2c22f8..95d316b199 100644
--- a/tools/editor/plugins/item_list_editor_plugin.h
+++ b/tools/editor/plugins/item_list_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/multimesh_editor_plugin.cpp b/tools/editor/plugins/multimesh_editor_plugin.cpp
index a5c823f8bd..3f63ef706b 100644
--- a/tools/editor/plugins/multimesh_editor_plugin.cpp
+++ b/tools/editor/plugins/multimesh_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/multimesh_editor_plugin.h b/tools/editor/plugins/multimesh_editor_plugin.h
index edc3dfd55f..245da1eeb7 100644
--- a/tools/editor/plugins/multimesh_editor_plugin.h
+++ b/tools/editor/plugins/multimesh_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/particles_2d_editor_plugin.cpp b/tools/editor/plugins/particles_2d_editor_plugin.cpp
index dadfa8bfdc..2488c4cdd9 100644
--- a/tools/editor/plugins/particles_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/particles_2d_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/particles_2d_editor_plugin.h b/tools/editor/plugins/particles_2d_editor_plugin.h
index dba0bb4dae..f70a0e7b76 100644
--- a/tools/editor/plugins/particles_2d_editor_plugin.h
+++ b/tools/editor/plugins/particles_2d_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/particles_editor_plugin.cpp b/tools/editor/plugins/particles_editor_plugin.cpp
index 5c84d9a86a..2df6d3ea90 100644
--- a/tools/editor/plugins/particles_editor_plugin.cpp
+++ b/tools/editor/plugins/particles_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/particles_editor_plugin.h b/tools/editor/plugins/particles_editor_plugin.h
index 92756af1f6..ff80bffc29 100644
--- a/tools/editor/plugins/particles_editor_plugin.h
+++ b/tools/editor/plugins/particles_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/path_2d_editor_plugin.cpp b/tools/editor/plugins/path_2d_editor_plugin.cpp
index d037adc555..509edbe5f8 100644
--- a/tools/editor/plugins/path_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/path_2d_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -534,6 +534,7 @@ void Path2DEditor::edit(Node *p_path2d) {
if (!node->is_connected("visibility_changed", this, "_node_visibility_changed"))
node->connect("visibility_changed", this, "_node_visibility_changed");
+
} else {
if (canvas_item_editor->get_viewport_control()->is_connected("draw",this,"_canvas_draw"))
@@ -614,6 +615,7 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) {
editor=p_editor;
undo_redo = editor->get_undo_redo();
+ mode=MODE_EDIT;
action=ACTION_NONE;
#if 0
diff --git a/tools/editor/plugins/path_2d_editor_plugin.h b/tools/editor/plugins/path_2d_editor_plugin.h
index 9f15c0669f..973c17464e 100644
--- a/tools/editor/plugins/path_2d_editor_plugin.h
+++ b/tools/editor/plugins/path_2d_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/path_editor_plugin.cpp b/tools/editor/plugins/path_editor_plugin.cpp
index f4bdf50fe9..b99e632604 100644
--- a/tools/editor/plugins/path_editor_plugin.cpp
+++ b/tools/editor/plugins/path_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/path_editor_plugin.h b/tools/editor/plugins/path_editor_plugin.h
index fcd4241e59..18bad23bd1 100644
--- a/tools/editor/plugins/path_editor_plugin.h
+++ b/tools/editor/plugins/path_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.cpp b/tools/editor/plugins/polygon_2d_editor_plugin.cpp
index cd82297365..3e9c58d604 100644
--- a/tools/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -755,7 +755,6 @@ void Polygon2DEditor::edit(Node *p_collision_polygon) {
canvas_item_editor=CanvasItemEditor::get_singleton();
}
-
if (p_collision_polygon) {
node=p_collision_polygon->cast_to<Polygon2D>();
diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.cpp b/tools/editor/plugins/resource_preloader_editor_plugin.cpp
index 9cd20ac53a..403a919f5d 100644
--- a/tools/editor/plugins/resource_preloader_editor_plugin.cpp
+++ b/tools/editor/plugins/resource_preloader_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.h b/tools/editor/plugins/resource_preloader_editor_plugin.h
index 88272bc603..49ef86b4c2 100644
--- a/tools/editor/plugins/resource_preloader_editor_plugin.h
+++ b/tools/editor/plugins/resource_preloader_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/rich_text_editor_plugin.cpp b/tools/editor/plugins/rich_text_editor_plugin.cpp
index a0daad854f..08374d6624 100644
--- a/tools/editor/plugins/rich_text_editor_plugin.cpp
+++ b/tools/editor/plugins/rich_text_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/rich_text_editor_plugin.h b/tools/editor/plugins/rich_text_editor_plugin.h
index 478dc0d308..ae1d04be01 100644
--- a/tools/editor/plugins/rich_text_editor_plugin.h
+++ b/tools/editor/plugins/rich_text_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/sample_editor_plugin.cpp b/tools/editor/plugins/sample_editor_plugin.cpp
index d88f2adc73..ffa39bd010 100644
--- a/tools/editor/plugins/sample_editor_plugin.cpp
+++ b/tools/editor/plugins/sample_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/sample_editor_plugin.h b/tools/editor/plugins/sample_editor_plugin.h
index e615667914..22dc75b53b 100644
--- a/tools/editor/plugins/sample_editor_plugin.h
+++ b/tools/editor/plugins/sample_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/sample_library_editor_plugin.cpp b/tools/editor/plugins/sample_library_editor_plugin.cpp
index b497458a2a..493ae405ba 100644
--- a/tools/editor/plugins/sample_library_editor_plugin.cpp
+++ b/tools/editor/plugins/sample_library_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/sample_library_editor_plugin.h b/tools/editor/plugins/sample_library_editor_plugin.h
index 2770ca2d9a..6627d8d6de 100644
--- a/tools/editor/plugins/sample_library_editor_plugin.h
+++ b/tools/editor/plugins/sample_library_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/sample_player_editor_plugin.cpp b/tools/editor/plugins/sample_player_editor_plugin.cpp
index f1c7ca8c98..3085ad87d8 100644
--- a/tools/editor/plugins/sample_player_editor_plugin.cpp
+++ b/tools/editor/plugins/sample_player_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/sample_player_editor_plugin.h b/tools/editor/plugins/sample_player_editor_plugin.h
index cdd1a99c17..013b042487 100644
--- a/tools/editor/plugins/sample_player_editor_plugin.h
+++ b/tools/editor/plugins/sample_player_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 59f5d89073..ded27d1fef 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -2043,6 +2043,15 @@ void ScriptEditor::_editor_settings_changed() {
autosave_timer->stop();
}
+ for(int i=0;i<tab_container->get_child_count();i++) {
+
+ ScriptTextEditor *ste = tab_container->get_child(i)->cast_to<ScriptTextEditor>();
+ if (!ste)
+ continue;
+
+ ste->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
+ }
+
}
void ScriptEditor::_autosave_scripts() {
diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h
index 32c1e7e1c8..b829d4e0e5 100644
--- a/tools/editor/plugins/script_editor_plugin.h
+++ b/tools/editor/plugins/script_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp
index 848073af3e..65b5365b50 100644
--- a/tools/editor/plugins/shader_editor_plugin.cpp
+++ b/tools/editor/plugins/shader_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -172,11 +172,8 @@ ShaderTextEditor::ShaderTextEditor() {
void ShaderEditor::_menu_option(int p_option) {
- int selected = tab_container->get_current_tab();
- if (selected<0 || selected>=tab_container->get_child_count())
- return;
- ShaderTextEditor *current = tab_container->get_child(selected)->cast_to<ShaderTextEditor>();
+ ShaderTextEditor *current = tab_container->get_current_tab_control()->cast_to<ShaderTextEditor>();
if (!current)
return;
@@ -235,7 +232,7 @@ void ShaderEditor::_menu_option(int p_option) {
void ShaderEditor::_tab_changed(int p_which) {
- ShaderTextEditor *shader_editor = tab_container->get_child(p_which)->cast_to<ShaderTextEditor>();
+ ShaderTextEditor *shader_editor = tab_container->get_tab_control(p_which)->cast_to<ShaderTextEditor>();
if (shader_editor)
shader_editor->get_text_edit()->grab_focus();
diff --git a/tools/editor/plugins/shader_editor_plugin.h b/tools/editor/plugins/shader_editor_plugin.h
index 4ead2ba94e..26d20b80b4 100644
--- a/tools/editor/plugins/shader_editor_plugin.h
+++ b/tools/editor/plugins/shader_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp
index 3a7dc26466..c6677b6883 100644
--- a/tools/editor/plugins/shader_graph_editor_plugin.cpp
+++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/shader_graph_editor_plugin.h b/tools/editor/plugins/shader_graph_editor_plugin.h
index 39e9b29d45..5ac9db3650 100644
--- a/tools/editor/plugins/shader_graph_editor_plugin.h
+++ b/tools/editor/plugins/shader_graph_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp
index 92ad991d96..8903e12319 100644
--- a/tools/editor/plugins/spatial_editor_plugin.cpp
+++ b/tools/editor/plugins/spatial_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -1617,6 +1617,8 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
case InputEvent::KEY: {
const InputEventKey &k = p_event.key;
+ if (!k.pressed)
+ break;
switch(k.scancode) {
case KEY_S: {
@@ -1677,7 +1679,8 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
} break;
case KEY_KP_5: {
- orthogonal = !orthogonal;
+
+ //orthogonal = !orthogonal;
_menu_option(orthogonal?VIEW_PERSPECTIVE:VIEW_ORTHOGONAL);
_update_name();
diff --git a/tools/editor/plugins/spatial_editor_plugin.h b/tools/editor/plugins/spatial_editor_plugin.h
index e7ea14ba6a..e8856d5a8f 100644
--- a/tools/editor/plugins/spatial_editor_plugin.h
+++ b/tools/editor/plugins/spatial_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
index e90087efda..048df2d682 100644
--- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -338,7 +338,6 @@ void SpriteFramesEditor::_update_library() {
TreeItem *ti = tree->create_item(root);
ti->set_cell_mode(0,TreeItem::CELL_MODE_STRING);
- ti->set_editable(0,true);
ti->set_selectable(0,true);
if (frames->get_frame(i).is_null()) {
@@ -346,7 +345,7 @@ void SpriteFramesEditor::_update_library() {
ti->set_text(0,"Frame "+itos(i)+" (empty)");
} else {
- ti->set_text(0,"Frame "+itos(i));
+ ti->set_text(0,"Frame "+itos(i)+" ("+frames->get_frame(i)->get_name()+")");
ti->set_icon(0,frames->get_frame(i));
}
if (frames->get_frame(i).is_valid())
diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.h b/tools/editor/plugins/sprite_frames_editor_plugin.h
index 969d7b1ce3..e4088da297 100644
--- a/tools/editor/plugins/sprite_frames_editor_plugin.h
+++ b/tools/editor/plugins/sprite_frames_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/sprite_region_editor_plugin.cpp b/tools/editor/plugins/sprite_region_editor_plugin.cpp
index 35c53cf562..2653973226 100644
--- a/tools/editor/plugins/sprite_region_editor_plugin.cpp
+++ b/tools/editor/plugins/sprite_region_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Author: Mariano Suligoy */
/* */
diff --git a/tools/editor/plugins/sprite_region_editor_plugin.h b/tools/editor/plugins/sprite_region_editor_plugin.h
index cf69395f40..fafa2e119b 100644
--- a/tools/editor/plugins/sprite_region_editor_plugin.h
+++ b/tools/editor/plugins/sprite_region_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Author: Mariano Suligoy */
/* */
diff --git a/tools/editor/plugins/stream_editor_plugin.cpp b/tools/editor/plugins/stream_editor_plugin.cpp
index 81db7f2846..d896784074 100644
--- a/tools/editor/plugins/stream_editor_plugin.cpp
+++ b/tools/editor/plugins/stream_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/stream_editor_plugin.h b/tools/editor/plugins/stream_editor_plugin.h
index 7378bfad0c..5730612d61 100644
--- a/tools/editor/plugins/stream_editor_plugin.h
+++ b/tools/editor/plugins/stream_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/style_box_editor_plugin.cpp b/tools/editor/plugins/style_box_editor_plugin.cpp
index 898c69e1e0..58e9038840 100644
--- a/tools/editor/plugins/style_box_editor_plugin.cpp
+++ b/tools/editor/plugins/style_box_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/style_box_editor_plugin.h b/tools/editor/plugins/style_box_editor_plugin.h
index 00b0871572..3b3f8d8d0f 100644
--- a/tools/editor/plugins/style_box_editor_plugin.h
+++ b/tools/editor/plugins/style_box_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/theme_editor_plugin.cpp b/tools/editor/plugins/theme_editor_plugin.cpp
index 63ba57bfc0..f67f049b36 100644
--- a/tools/editor/plugins/theme_editor_plugin.cpp
+++ b/tools/editor/plugins/theme_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/theme_editor_plugin.h b/tools/editor/plugins/theme_editor_plugin.h
index 40c7ad8186..f5e7192a73 100644
--- a/tools/editor/plugins/theme_editor_plugin.h
+++ b/tools/editor/plugins/theme_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp
index 66c7a39096..b2562eafe1 100644
--- a/tools/editor/plugins/tile_map_editor_plugin.cpp
+++ b/tools/editor/plugins/tile_map_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -218,7 +218,8 @@ struct _TileMapEditorCopyData {
bool TileMapEditor::forward_input_event(const InputEvent& p_event) {
- if (!node || !node->get_tileset().is_valid())
+
+ if (!node || !node->get_tileset().is_valid() || !node->is_visible())
return false;
Matrix32 xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * node->get_global_transform();
diff --git a/tools/editor/plugins/tile_map_editor_plugin.h b/tools/editor/plugins/tile_map_editor_plugin.h
index 74d1573d0f..3cbf5ff68d 100644
--- a/tools/editor/plugins/tile_map_editor_plugin.h
+++ b/tools/editor/plugins/tile_map_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/tile_set_editor_plugin.cpp b/tools/editor/plugins/tile_set_editor_plugin.cpp
index b61fe6806b..06046b226a 100644
--- a/tools/editor/plugins/tile_set_editor_plugin.cpp
+++ b/tools/editor/plugins/tile_set_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/plugins/tile_set_editor_plugin.h b/tools/editor/plugins/tile_set_editor_plugin.h
index 0a646001ab..3f47520e2a 100644
--- a/tools/editor/plugins/tile_set_editor_plugin.h
+++ b/tools/editor/plugins/tile_set_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/progress_dialog.cpp b/tools/editor/progress_dialog.cpp
index 90398767ea..d072ce7f83 100644
--- a/tools/editor/progress_dialog.cpp
+++ b/tools/editor/progress_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/progress_dialog.h b/tools/editor/progress_dialog.h
index 8c75948fda..539eaa8737 100644
--- a/tools/editor/progress_dialog.h
+++ b/tools/editor/progress_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp
index 29f9918e26..d034edc80d 100644
--- a/tools/editor/project_export.cpp
+++ b/tools/editor/project_export.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/project_export.h b/tools/editor/project_export.h
index 09c8f10206..5a42a58e58 100644
--- a/tools/editor/project_export.h
+++ b/tools/editor/project_export.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp
index 880df85c19..5fd9118a32 100644
--- a/tools/editor/project_manager.cpp
+++ b/tools/editor/project_manager.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/project_manager.h b/tools/editor/project_manager.h
index f8edb6dc10..80c34690f8 100644
--- a/tools/editor/project_manager.h
+++ b/tools/editor/project_manager.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp
index dd3c7552de..b61fcfa780 100644
--- a/tools/editor/project_settings.cpp
+++ b/tools/editor/project_settings.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,6 +33,7 @@
#include "editor_node.h"
#include "scene/gui/margin_container.h"
#include "translation.h"
+#include "global_constants.h"
ProjectSettings *ProjectSettings::singleton=NULL;
@@ -106,6 +107,8 @@ void ProjectSettings::_action_persist_toggle() {
String name="input/"+ti->get_text(0);
bool prev = Globals::get_singleton()->is_persisting(name);
+ print_line("prev persist: "+itos(prev));
+ print_line("new persist: "+itos(ti->is_checked(0)));
if (prev==ti->is_checked(0))
return;
@@ -155,12 +158,14 @@ void ProjectSettings::_device_input_add() {
} break;
case InputEvent::JOYSTICK_MOTION: {
- ie.joy_motion.axis = device_index->get_selected();
+ ie.joy_motion.axis = device_index->get_selected()>>1;
+ ie.joy_motion.axis_value = device_index->get_selected()&1?1:-1;
+
for(int i=0;i<arr.size();i++) {
InputEvent aie=arr[i];
- if (aie.device == ie.device && aie.type==InputEvent::JOYSTICK_MOTION && aie.joy_motion.axis==ie.joy_motion.axis) {
+ if (aie.device == ie.device && aie.type==InputEvent::JOYSTICK_MOTION && aie.joy_motion.axis==ie.joy_motion.axis && aie.joy_motion.axis_value==ie.joy_motion.axis_value) {
return;
}
}
@@ -294,9 +299,10 @@ void ProjectSettings::_add_item(int p_item){
device_id->set_val(0);
device_index_label->set_text("Joy Button Axis:");
device_index->clear();
- for(int i=0;i<8;i++) {
+ for(int i=0;i<24;i++) {
+
- device_index->add_item("Axis "+itos(i));
+ device_index->add_item("Axis "+itos(i/2)+" "+(i&1?"+":"-"));
}
device_input->popup_centered(Size2(350,95));
@@ -424,7 +430,7 @@ void ProjectSettings::_update_actions() {
continue;
TreeItem *item=input_editor->create_item(root);
- item->set_cell_mode(0,TreeItem::CELL_MODE_CHECK);
+ //item->set_cell_mode(0,TreeItem::CELL_MODE_CHECK);
item->set_text(0,name);
item->add_button(0,get_icon("Add","EditorIcons"),1);
if (!Globals::get_singleton()->get_input_presets().find(pi.name)) {
@@ -433,7 +439,7 @@ void ProjectSettings::_update_actions() {
}
item->set_custom_bg_color(0,get_color("prop_subsection","Editor"));
item->set_editable(0,true);
- item->set_checked(0,pi.usage&PROPERTY_USAGE_CHECKED);
+ //item->set_checked(0,pi.usage&PROPERTY_USAGE_CHECKED);
@@ -493,7 +499,7 @@ void ProjectSettings::_update_actions() {
} break;
case InputEvent::JOYSTICK_MOTION: {
- String str = "Device "+itos(ie.device)+", Axis "+itos(ie.joy_motion.axis)+".";
+ String str = "Device "+itos(ie.device)+", Axis "+itos(ie.joy_motion.axis)+" "+(ie.joy_motion.axis_value<0?"-.":"+.");
action->set_text(0,str);
action->set_icon(0,get_icon("JoyAxis","EditorIcons"));
} break;
@@ -695,9 +701,20 @@ void ProjectSettings::_save() {
void ProjectSettings::_settings_prop_edited(const String& p_name) {
- if (!Globals::get_singleton()->is_persisting(p_name)) {
- String full_item = globals_editor->get_full_item_path(p_name);
+ String full_item = globals_editor->get_full_item_path(p_name);
+
+ if (!Globals::get_singleton()->is_persisting(full_item)) {
Globals::get_singleton()->set_persisting(full_item,true);
+
+ {
+ //small usability workaround, if anything related to resolution scaling or size is modified, change all of them together
+ if (full_item=="display/width" || full_item=="display/height" || full_item=="display/stretch_mode") {
+ Globals::get_singleton()->set_persisting("display/height",true);
+ Globals::get_singleton()->set_persisting("display/width",true);
+ }
+ }
+
+
// globals_editor->update_property(p_name);
globals_editor->get_property_editor()->update_tree();
}
@@ -777,10 +794,11 @@ void ProjectSettings::_translation_file_open() {
void ProjectSettings::_autoload_file_callback(const String& p_path) {
autoload_add_path->set_text(p_path);
- if (autoload_add_name->get_text().strip_edges()==String()) {
+ //if (autoload_add_name->get_text().strip_edges()==String()) {
autoload_add_name->set_text( p_path.get_file().basename() );
- }
+ //}
+
//_translation_add(p_translation);
}
@@ -789,6 +807,40 @@ void ProjectSettings::_autoload_file_open() {
autoload_file_open->popup_centered_ratio();
}
+void ProjectSettings::_autoload_edited() {
+
+ if (updating_autoload)
+ return;
+
+ TreeItem *ti = autoload_list->get_edited();
+ if (!ti || autoload_list->get_edited_column()!=2)
+ return;
+
+ updating_autoload=true;
+ bool checked=ti->is_checked(2);
+
+ String base="autoload/"+ti->get_text(0);
+
+ String path = Globals::get_singleton()->get(base);
+
+ if (path.begins_with("*"))
+ path=path.substr(1,path.length());
+
+ if (checked)
+ path="*"+path;
+
+ undo_redo->create_action("Toggle Autoload GlobalVar");
+ undo_redo->add_do_property(Globals::get_singleton(),base,path);
+ undo_redo->add_undo_property(Globals::get_singleton(),base,Globals::get_singleton()->get(base));
+ undo_redo->add_do_method(this,"_update_autoload");
+ undo_redo->add_undo_method(this,"_update_autoload");
+ undo_redo->add_do_method(this,"_settings_changed");
+ undo_redo->add_undo_method(this,"_settings_changed");
+ undo_redo->commit_action();
+ updating_autoload=false;
+
+}
+
void ProjectSettings::_autoload_add() {
String name = autoload_add_name->get_text();
@@ -799,6 +851,35 @@ void ProjectSettings::_autoload_add() {
}
+ if (ObjectTypeDB::type_exists(name)) {
+
+ message->set_text("Invalid Name.Must not collide with an existing engine class name.");
+ message->popup_centered(Size2(300,100));
+ return;
+
+ }
+
+ for(int i=0;i<Variant::VARIANT_MAX;i++) {
+ if (Variant::get_type_name(Variant::Type(i))==name) {
+
+ message->set_text("Invalid Name.Must not collide with an existing buit-in type name.");
+ message->popup_centered(Size2(300,100));
+ return;
+
+ }
+ }
+
+ for(int i=0;i<GlobalConstants::get_global_constant_count();i++) {
+
+ if (GlobalConstants::get_global_constant_name(i)==name) {
+
+ message->set_text("Invalid Name.Must not collide with an existing global constant name.");
+ message->popup_centered(Size2(300,100));
+ return;
+ }
+
+ }
+
String path = autoload_add_path->get_text();
if (!FileAccess::exists(path)) {
message->set_text("Invalid Path.\nFile does not exist.");
@@ -815,7 +896,7 @@ void ProjectSettings::_autoload_add() {
undo_redo->create_action("Add Autoload");
name = "autoload/"+name;
- undo_redo->add_do_property(Globals::get_singleton(),name,path);
+ undo_redo->add_do_property(Globals::get_singleton(),name,"*"+path);
if (Globals::get_singleton()->has(name))
undo_redo->add_undo_property(Globals::get_singleton(),name,Globals::get_singleton()->get(name));
else
@@ -865,11 +946,14 @@ void ProjectSettings::_autoload_delete(Object *p_item,int p_column, int p_button
String swap_name= "autoload/"+swap->get_text(0);
+ int order = Globals::get_singleton()->get_order(name);
+ int swap_order = Globals::get_singleton()->get_order(swap_name);
+
undo_redo->create_action("Move Autoload");
- undo_redo->add_do_method(Globals::get_singleton(),"set_order",swap_name,Globals::get_singleton()->get_order(name));
- undo_redo->add_do_method(Globals::get_singleton(),"set_order",name,Globals::get_singleton()->get_order(swap_name));
- undo_redo->add_undo_method(Globals::get_singleton(),"set_order",swap_name,Globals::get_singleton()->get_order(swap_name));
- undo_redo->add_undo_method(Globals::get_singleton(),"set_order",name,Globals::get_singleton()->get_order(name));
+ undo_redo->add_do_method(Globals::get_singleton(),"set_order",swap_name,order);
+ undo_redo->add_do_method(Globals::get_singleton(),"set_order",name,swap_order);
+ undo_redo->add_undo_method(Globals::get_singleton(),"set_order",swap_name,swap_order);
+ undo_redo->add_undo_method(Globals::get_singleton(),"set_order",name,order);
undo_redo->add_do_method(this,"_update_autoload");
undo_redo->add_undo_method(this,"_update_autoload");
undo_redo->add_do_method(this,"_settings_changed");
@@ -1208,6 +1292,11 @@ void ProjectSettings::_update_translations() {
void ProjectSettings::_update_autoload() {
+ if (updating_autoload)
+ return;
+
+ updating_autoload=true;
+
autoload_list->clear();
TreeItem *root = autoload_list->create_item();
autoload_list->set_hide_root(true);
@@ -1222,18 +1311,31 @@ void ProjectSettings::_update_autoload() {
continue;
String name = pi.name.get_slice("/",1);
+ String path = Globals::get_singleton()->get(pi.name);
+
if (name=="")
continue;
-
+ bool global=false;
+ if (path.begins_with("*")) {
+ path=path.substr(1,path.length());
+ global=true;
+ }
TreeItem *t = autoload_list->create_item(root);
t->set_text(0,name);
- t->set_text(1,Globals::get_singleton()->get(pi.name));
- t->add_button(1,get_icon("MoveUp","EditorIcons"),1);
- t->add_button(1,get_icon("MoveDown","EditorIcons"),2);
- t->add_button(1,get_icon("Del","EditorIcons"),0);
+ t->set_text(1,path);
+ t->set_cell_mode(2,TreeItem::CELL_MODE_CHECK);
+ t->set_editable(2,true);
+ t->set_text(2,"Enable");
+ t->set_checked(2,global);
+ t->add_button(3,get_icon("MoveUp","EditorIcons"),1);
+ t->add_button(3,get_icon("MoveDown","EditorIcons"),2);
+ t->add_button(3,get_icon("Del","EditorIcons"),0);
+
}
+ updating_autoload=false;
+
}
void ProjectSettings::_toggle_search_bar(bool p_pressed) {
@@ -1302,6 +1404,7 @@ void ProjectSettings::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_autoload_file_callback"),&ProjectSettings::_autoload_file_callback);
ObjectTypeDB::bind_method(_MD("_update_autoload"),&ProjectSettings::_update_autoload);
ObjectTypeDB::bind_method(_MD("_autoload_delete"),&ProjectSettings::_autoload_delete);
+ ObjectTypeDB::bind_method(_MD("_autoload_edited"),&ProjectSettings::_autoload_edited);
ObjectTypeDB::bind_method(_MD("_clear_search_box"),&ProjectSettings::_clear_search_box);
ObjectTypeDB::bind_method(_MD("_toggle_search_bar"),&ProjectSettings::_toggle_search_bar);
@@ -1694,11 +1797,24 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
autoload_file_open->set_mode(EditorFileDialog::MODE_OPEN_FILE);
autoload_file_open->connect("file_selected",this,"_autoload_file_callback");
- autoload_list->set_columns(2);
+ autoload_list->set_columns(4);
autoload_list->set_column_titles_visible(true);
- autoload_list->set_column_title(0,"name");
- autoload_list->set_column_title(1,"path");
+ autoload_list->set_column_title(0,"Name");
+ autoload_list->set_column_expand(0,true);
+ autoload_list->set_column_min_width(0,100);
+ autoload_list->set_column_title(1,"Path");
+ autoload_list->set_column_expand(1,true);
+ autoload_list->set_column_min_width(1,100);
+ autoload_list->set_column_title(2,"Singleton");
+ autoload_list->set_column_expand(2,false);
+ autoload_list->set_column_min_width(2,80);
+ autoload_list->set_column_expand(3,false);
+ autoload_list->set_column_min_width(3,80);
+
autoload_list->connect("button_pressed",this,"_autoload_delete");
+ autoload_list->connect("item_edited",this,"_autoload_edited");
+
+ updating_autoload=false;
}
diff --git a/tools/editor/project_settings.h b/tools/editor/project_settings.h
index f201f5c48f..b689340fdf 100644
--- a/tools/editor/project_settings.h
+++ b/tools/editor/project_settings.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -95,8 +95,10 @@ class ProjectSettings : public AcceptDialog {
void _update_autoload();
void _autoload_file_callback(const String& p_path);
void _autoload_add();
+ void _autoload_edited();
void _autoload_file_open();
void _autoload_delete(Object *p_item,int p_column, int p_button);
+ bool updating_autoload;
void _item_selected();
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index 141f0c2943..fc5fce1d47 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -927,6 +927,7 @@ void CustomPropertyEditor::_node_path_selected(NodePath p_path) {
if (!node) {
v=p_path;
emit_signal("variant_changed");
+ call_deferred("hide"); //to not mess with dialogs
return;
}
@@ -938,6 +939,7 @@ void CustomPropertyEditor::_node_path_selected(NodePath p_path) {
v=p_path;
emit_signal("variant_changed");
+ call_deferred("hide"); //to not mess with dialogs
}
@@ -1040,6 +1042,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) {
v=NodePath();
emit_signal("variant_changed");
+ hide();
}
} break;
case Variant::OBJECT: {
@@ -2110,6 +2113,65 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p
}
+void PropertyEditor::_check_reload_status(const String&p_name, TreeItem* item) {
+
+ bool has_reload=false;
+ int found=-1;
+
+ for(int i=0;i<item->get_button_count(1);i++) {
+
+ if (item->get_button_id(1,i)==3) {
+ found=i;
+ break;
+ }
+ }
+
+ if (_might_be_in_instance()) {
+
+
+ Variant vorig;
+ Dictionary d=item->get_metadata(0);
+ int usage = d.has("usage")?int(int(d["usage"])&(PROPERTY_USAGE_STORE_IF_NONONE|PROPERTY_USAGE_STORE_IF_NONZERO)):0;
+
+
+ if (_get_instanced_node_original_property(p_name,vorig) || usage) {
+ Variant v = obj->get(p_name);
+
+ bool changed = _is_property_different(v,vorig,usage);
+
+ if ((found!=-1)!=changed) {
+
+ if (changed) {
+
+ has_reload=true;
+ } else {
+
+ }
+
+ }
+
+ }
+
+
+
+ }
+
+ if (!has_reload && !obj->get_script().is_null()) {
+ Ref<Script> scr = obj->get_script();
+ Variant orig_value;
+ if (scr->get_property_default_value(p_name,orig_value)) {
+ if (orig_value!=obj->get(p_name)) {
+ has_reload=true;
+ }
+ }
+ }
+
+ if (found!=-1 && !has_reload) {
+ item->erase_button(1,found);
+ } else if (found==-1 && has_reload) {
+ item->add_button(1,get_icon("Reload","EditorIcons"),3);
+ }
+}
void PropertyEditor::_notification(int p_what) {
@@ -2151,43 +2213,8 @@ void PropertyEditor::_notification(int p_what) {
if (!item)
continue;
- if (_might_be_in_instance()) {
-
-
- Variant vorig;
- Dictionary d=item->get_metadata(0);
- int usage = d.has("usage")?int(int(d["usage"])&(PROPERTY_USAGE_STORE_IF_NONONE|PROPERTY_USAGE_STORE_IF_NONZERO)):0;
-
-
- if (_get_instanced_node_original_property(*k,vorig) || usage) {
- Variant v = obj->get(*k);
-
- int found=-1;
- for(int i=0;i<item->get_button_count(1);i++) {
-
- if (item->get_button_id(1,i)==3) {
- found=i;
- break;
- }
- }
-
- bool changed = _is_property_different(v,vorig,usage);
-
- if ((found!=-1)!=changed) {
-
- if (changed) {
-
- item->add_button(1,get_icon("Reload","EditorIcons"),3);
- } else {
-
- item->erase_button(1,found);
- }
-
- }
-
- }
+ _check_reload_status(*k,item);
- }
Dictionary d=item->get_metadata(0);
set_item_text(item,d["type"],d["name"],d["hint"],d["hint_text"]);
}
@@ -2254,23 +2281,30 @@ void PropertyEditor::_refresh_item(TreeItem *p_item) {
if (name!=String()) {
+
+ _check_reload_status(name,p_item);
+#if 0
+ bool has_reload=false;
+
+ int found=-1;
+ for(int i=0;i<p_item->get_button_count(1);i++) {
+
+ if (p_item->get_button_id(1,i)==3) {
+ found=i;
+ break;
+ }
+ }
+
if (_might_be_in_instance()) {
Variant vorig;
Dictionary d=p_item->get_metadata(0);
int usage = d.has("usage")?int(int(d["usage"])&(PROPERTY_USAGE_STORE_IF_NONONE|PROPERTY_USAGE_STORE_IF_NONZERO)):0;
+
if (_get_instanced_node_original_property(name,vorig) || usage) {
Variant v = obj->get(name);
- int found=-1;
- for(int i=0;i<p_item->get_button_count(1);i++) {
-
- if (p_item->get_button_id(1,i)==3) {
- found=i;
- break;
- }
- }
bool changed = _is_property_different(v,vorig,usage);
@@ -2278,10 +2312,11 @@ void PropertyEditor::_refresh_item(TreeItem *p_item) {
if (changed) {
- p_item->add_button(1,get_icon("Reload","EditorIcons"),3);
+ has_reload=true;
+
} else {
- p_item->erase_button(1,found);
+ //p_item->erase_button(1,found);
}
}
@@ -2290,6 +2325,22 @@ void PropertyEditor::_refresh_item(TreeItem *p_item) {
}
+ if (!has_reload && !obj->get_script().is_null()) {
+ Ref<Script> scr = obj->get_script();
+ Variant orig_value;
+ if (scr->get_property_default_value(name,orig_value)) {
+ if (orig_value!=obj->get(name)) {
+ has_reload=true;
+ }
+ }
+ }
+
+ if (!has_reload && found!=-1) {
+ p_item->erase_button(1,found);
+ } else if (has_reload && found==-1) {
+ p_item->add_button(1,get_icon("Reload","EditorIcons"),3);
+ }
+#endif
Dictionary d=p_item->get_metadata(0);
set_item_text(p_item,d["type"],d["name"],d["hint"],d["hint_text"]);
}
@@ -3030,6 +3081,7 @@ void PropertyEditor::update_tree() {
}
}
+ bool has_reload=false;
if (_might_be_in_instance()) {
Variant vorig;
@@ -3042,11 +3094,24 @@ void PropertyEditor::update_tree() {
if (_is_property_different(v,vorig,usage)) {
//print_line("FOR "+String(p.name)+" RELOAD WITH: "+String(v)+"("+Variant::get_type_name(v.get_type())+")=="+String(vorig)+"("+Variant::get_type_name(vorig.get_type())+")");
item->add_button(1,get_icon("Reload","EditorIcons"),3);
+ has_reload=true;
}
}
}
+ if (!has_reload && !obj->get_script().is_null()) {
+ Ref<Script> scr = obj->get_script();
+ Variant orig_value;
+ if (scr->get_property_default_value(p.name,orig_value)) {
+ if (orig_value!=obj->get(p.name)) {
+ item->add_button(1,get_icon("Reload","EditorIcons"),3);
+ }
+ }
+ }
+
+
+
}
}
@@ -3337,8 +3402,6 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) {
call_deferred("_set_range_def",ti,prop,ti->get_range(p_column)+1.0);
} else if (p_button==3) {
- if (!_might_be_in_instance())
- return;
if (!d.has("name"))
return;
@@ -3346,11 +3409,21 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) {
Variant vorig;
- if (_get_instanced_node_original_property(prop,vorig)) {
+ if (_might_be_in_instance() && _get_instanced_node_original_property(prop,vorig)) {
_edit_set(prop,vorig);
+ return;
}
+ if (!obj->get_script().is_null()) {
+ Ref<Script> scr = obj->get_script();
+ Variant orig_value;
+ if (scr->get_property_default_value(prop,orig_value)) {
+ _edit_set(prop,orig_value);
+ }
+ }
+
+
} else {
Dictionary d = ti->get_metadata(0);
diff --git a/tools/editor/property_editor.h b/tools/editor/property_editor.h
index 81fb078a11..4f03c0381f 100644
--- a/tools/editor/property_editor.h
+++ b/tools/editor/property_editor.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -114,6 +114,7 @@ class CustomPropertyEditor : public Popup {
void _action_pressed(int p_which);
void _type_create_selected(int p_idx);
+
void _color_changed(const Color& p_color);
void _draw_easing();
void _menu_option(int p_which);
@@ -192,6 +193,7 @@ class PropertyEditor : public Control {
virtual void _changed_callback(Object *p_changed,const char * p_what);
virtual void _changed_callbacks(Object *p_changed,const String& p_callback);
+ void _check_reload_status(const String&p_name,TreeItem* item);
void _edit_button(Object *p_item, int p_column, int p_button);
diff --git a/tools/editor/pvrtc_compress.cpp b/tools/editor/pvrtc_compress.cpp
index a2f98adbe0..c30aedc1dc 100644
--- a/tools/editor/pvrtc_compress.cpp
+++ b/tools/editor/pvrtc_compress.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/pvrtc_compress.h b/tools/editor/pvrtc_compress.h
index c4fb0bacb5..129faee080 100644
--- a/tools/editor/pvrtc_compress.h
+++ b/tools/editor/pvrtc_compress.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/quick_open.cpp b/tools/editor/quick_open.cpp
index 6135a4ab64..bfbcb739ac 100644
--- a/tools/editor/quick_open.cpp
+++ b/tools/editor/quick_open.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/quick_open.h b/tools/editor/quick_open.h
index 8b38256d39..7f2091e5d1 100644
--- a/tools/editor/quick_open.h
+++ b/tools/editor/quick_open.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/register_exporters.h b/tools/editor/register_exporters.h
index 0e1ad2ca46..364ad5efc9 100644
--- a/tools/editor/register_exporters.h
+++ b/tools/editor/register_exporters.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/reparent_dialog.cpp b/tools/editor/reparent_dialog.cpp
index f024844731..97b27603b2 100644
--- a/tools/editor/reparent_dialog.cpp
+++ b/tools/editor/reparent_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -62,7 +62,7 @@ void ReparentDialog::_reparent() {
if (tree->get_selected()) {
- emit_signal("reparent",tree->get_selected()->get_path(),node_only->is_pressed());
+ emit_signal("reparent",tree->get_selected()->get_path(),keep_transform->is_pressed());
hide();
}
}
@@ -78,7 +78,7 @@ void ReparentDialog::_bind_methods() {
ObjectTypeDB::bind_method("_reparent",&ReparentDialog::_reparent);
ObjectTypeDB::bind_method("_cancel",&ReparentDialog::_cancel);
- ADD_SIGNAL( MethodInfo("reparent",PropertyInfo(Variant::NODE_PATH,"path"),PropertyInfo(Variant::BOOL,"only_node")));
+ ADD_SIGNAL( MethodInfo("reparent",PropertyInfo(Variant::NODE_PATH,"path"),PropertyInfo(Variant::BOOL,"keep_global_xform")));
}
@@ -101,15 +101,18 @@ ReparentDialog::ReparentDialog() {
//label->set_pos( Point2( 15,8) );
//label->set_text("Reparent Location (Select new Parent):");
- node_only = memnew( CheckButton );
- add_child(node_only);
- node_only->hide();
+ keep_transform = memnew( CheckBox );
+ keep_transform->set_text("Keep Global Transform");
+ keep_transform->set_pressed(true);
+ vbc->add_child(keep_transform);
+
//vbc->add_margin_child("Options:",node_only);;
//cancel->connect("pressed", this,"_cancel");
get_ok()->set_text("Reparent");
+
}
diff --git a/tools/editor/reparent_dialog.h b/tools/editor/reparent_dialog.h
index 78c0df9285..296102e4b9 100644
--- a/tools/editor/reparent_dialog.h
+++ b/tools/editor/reparent_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,6 +32,7 @@
#include "scene/gui/dialogs.h"
#include "scene/gui/button.h"
#include "scene/gui/check_button.h"
+#include "scene/gui/check_box.h"
#include "tools/editor/scene_tree_editor.h"
#include "scene/gui/line_edit.h"
/**
@@ -42,12 +43,14 @@ class ReparentDialog : public ConfirmationDialog {
OBJ_TYPE( ReparentDialog, ConfirmationDialog );
SceneTreeEditor *tree;
- CheckButton *node_only;
+ CheckBox *keep_transform;
+
void update_tree();
void _reparent();
void _cancel();
-
+
+
protected:
void _notification(int p_what);
diff --git a/tools/editor/resources_dock.cpp b/tools/editor/resources_dock.cpp
index b69eec4a51..5e44162c93 100644
--- a/tools/editor/resources_dock.cpp
+++ b/tools/editor/resources_dock.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/resources_dock.h b/tools/editor/resources_dock.h
index 933b457b29..978291fc3f 100644
--- a/tools/editor/resources_dock.h
+++ b/tools/editor/resources_dock.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/run_settings_dialog.cpp b/tools/editor/run_settings_dialog.cpp
index e883c69939..e8c509d79d 100644
--- a/tools/editor/run_settings_dialog.cpp
+++ b/tools/editor/run_settings_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/run_settings_dialog.h b/tools/editor/run_settings_dialog.h
index fdb8857f6b..09319702f3 100644
--- a/tools/editor/run_settings_dialog.h
+++ b/tools/editor/run_settings_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp
index 8b5bf8c1e1..75f1597b20 100644
--- a/tools/editor/scene_tree_dock.cpp
+++ b/tools/editor/scene_tree_dock.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -889,7 +889,7 @@ bool SceneTreeDock::_validate_no_foreign() {
return true;
}
-void SceneTreeDock::_node_reparent(NodePath p_path,bool p_node_only) {
+void SceneTreeDock::_node_reparent(NodePath p_path,bool p_keep_global_xform) {
Node *node = scene_tree->get_selected();
@@ -948,6 +948,23 @@ void SceneTreeDock::_node_reparent(NodePath p_path,bool p_node_only) {
editor_data->get_undo_redo().add_do_method(sed,"live_debug_reparent_node",edited_scene->get_path_to(node),edited_scene->get_path_to(new_parent),new_name,-1);
editor_data->get_undo_redo().add_undo_method(sed,"live_debug_reparent_node",NodePath(String(edited_scene->get_path_to(new_parent))+"/"+new_name),edited_scene->get_path_to(node->get_parent()),node->get_name(),node->get_index());
+ if (p_keep_global_xform) {
+ if (node->cast_to<Node2D>())
+ editor_data->get_undo_redo().add_do_method(node,"set_global_transform",node->cast_to<Node2D>()->get_global_transform());
+ if (node->cast_to<Spatial>())
+ editor_data->get_undo_redo().add_do_method(node,"set_global_transform",node->cast_to<Spatial>()->get_global_transform());
+ if (node->cast_to<Control>()) {
+ bool can_do_it=false;
+ Control *c=node->cast_to<Control>();
+ if (c->get_parent()->cast_to<Container>())
+ can_do_it=false;
+ for(int i=0;i<4;i++) {
+ if (c->get_anchor(Margin(i))!=ANCHOR_BEGIN)
+ can_do_it=false;
+ }
+ editor_data->get_undo_redo().add_do_method(node,"set_global_pos",node->cast_to<Control>()->get_global_pos());
+ }
+ }
editor_data->get_undo_redo().add_do_method(this,"_set_owners",edited_scene,owners);
@@ -982,6 +999,26 @@ void SceneTreeDock::_node_reparent(NodePath p_path,bool p_node_only) {
if (editor->get_animation_editor()->get_root()==node)
editor_data->get_undo_redo().add_undo_method(editor->get_animation_editor(),"set_root",node);
+ if (p_keep_global_xform) {
+ if (node->cast_to<Node2D>())
+ editor_data->get_undo_redo().add_undo_method(node,"set_transform",node->cast_to<Node2D>()->get_transform());
+ if (node->cast_to<Spatial>())
+ editor_data->get_undo_redo().add_undo_method(node,"set_transform",node->cast_to<Spatial>()->get_transform());
+ if (node->cast_to<Control>()) {
+ bool can_do_it=false;
+ Control *c=node->cast_to<Control>();
+ if (c->get_parent()->cast_to<Container>())
+ can_do_it=false;
+ for(int i=0;i<4;i++) {
+ if (c->get_anchor(Margin(i))!=ANCHOR_BEGIN)
+ can_do_it=false;
+ }
+ editor_data->get_undo_redo().add_undo_method(node,"set_pos",node->cast_to<Control>()->get_pos());
+ }
+ }
+
+
+
}
perform_node_renames(NULL,&path_renames);
diff --git a/tools/editor/scene_tree_dock.h b/tools/editor/scene_tree_dock.h
index b1c53d2ff9..aad12a2340 100644
--- a/tools/editor/scene_tree_dock.h
+++ b/tools/editor/scene_tree_dock.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -99,7 +99,7 @@ class SceneTreeDock : public VBoxContainer {
EditorNode *editor;
Node *_duplicate(Node *p_node, Map<Node*,Node*> &duplimap);
- void _node_reparent(NodePath p_path,bool p_node_only);
+ void _node_reparent(NodePath p_path, bool p_keep_global_xform);
void _set_owners(Node *p_owner, const Array& p_nodes);
void _load_request(const String& p_path);
void _script_open_request(const Ref<Script>& p_script);
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index a164703e31..531fe83bc3 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/scene_tree_editor.h b/tools/editor/scene_tree_editor.h
index 50cca4e24b..334debc148 100644
--- a/tools/editor/scene_tree_editor.h
+++ b/tools/editor/scene_tree_editor.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/scenes.cpp b/tools/editor/scenes.cpp
index ada5751b5a..e6569c98a9 100644
--- a/tools/editor/scenes.cpp
+++ b/tools/editor/scenes.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/scenes.h b/tools/editor/scenes.h
index 463c3b5e18..bae9ef65f0 100644
--- a/tools/editor/scenes.h
+++ b/tools/editor/scenes.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp
index 5880a6eef6..cdc0bf0d25 100644
--- a/tools/editor/scenes_dock.cpp
+++ b/tools/editor/scenes_dock.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/scenes_dock.h b/tools/editor/scenes_dock.h
index e5e0eafc24..a1978a3ca4 100644
--- a/tools/editor/scenes_dock.h
+++ b/tools/editor/scenes_dock.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/script_create_dialog.cpp b/tools/editor/script_create_dialog.cpp
index 622150ab68..409e8be870 100644
--- a/tools/editor/script_create_dialog.cpp
+++ b/tools/editor/script_create_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/script_create_dialog.h b/tools/editor/script_create_dialog.h
index 59fde8fbd5..181989402e 100644
--- a/tools/editor/script_create_dialog.h
+++ b/tools/editor/script_create_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp
index d0bf4faf02..fb821573f9 100644
--- a/tools/editor/script_editor_debugger.cpp
+++ b/tools/editor/script_editor_debugger.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/script_editor_debugger.h b/tools/editor/script_editor_debugger.h
index 43666b37d5..55c79ca3b3 100644
--- a/tools/editor/script_editor_debugger.h
+++ b/tools/editor/script_editor_debugger.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/settings_config_dialog.cpp b/tools/editor/settings_config_dialog.cpp
index d3c9e39cbb..ebbc488ff2 100644
--- a/tools/editor/settings_config_dialog.cpp
+++ b/tools/editor/settings_config_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/settings_config_dialog.h b/tools/editor/settings_config_dialog.h
index 4934c8c97b..e1c3238a64 100644
--- a/tools/editor/settings_config_dialog.h
+++ b/tools/editor/settings_config_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp
index 04a6b1b437..320b0c3a70 100644
--- a/tools/editor/spatial_editor_gizmos.cpp
+++ b/tools/editor/spatial_editor_gizmos.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/editor/spatial_editor_gizmos.h b/tools/editor/spatial_editor_gizmos.h
index bc7e8ad21d..669d3e2380 100644
--- a/tools/editor/spatial_editor_gizmos.h
+++ b/tools/editor/spatial_editor_gizmos.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/export/blender25/io_scene_dae/export_dae.py b/tools/export/blender25/io_scene_dae/export_dae.py
index b846f0e2d8..7ee0e179b8 100644
--- a/tools/export/blender25/io_scene_dae/export_dae.py
+++ b/tools/export/blender25/io_scene_dae/export_dae.py
@@ -921,7 +921,7 @@ class DaeExporter:
if (node.parent.type=="ARMATURE"):
armature=node.parent
if (armcount>1):
- self.operator.report({'WARNING'},'Object "'+node.name+'" refers to more than one armature! This is unsopported.')
+ self.operator.report({'WARNING'},'Object "'+node.name+'" refers to more than one armature! This is unsupported.')
if (armcount==0):
self.operator.report({'WARNING'},'Object "'+node.name+'" is child of an armature, but has no armature modifier.')
diff --git a/tools/ios_xcode_template/godot_ios/main.m b/tools/ios_xcode_template/godot_ios/main.m
index 6bb6bc2188..3e4ea5e129 100644
--- a/tools/ios_xcode_template/godot_ios/main.m
+++ b/tools/ios_xcode_template/godot_ios/main.m
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m b/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m
index 75e44659e0..d9fac0a250 100644
--- a/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m
+++ b/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/tools/pck/pck_packer.cpp b/tools/pck/pck_packer.cpp
index d398fefb5f..228d37df7c 100644
--- a/tools/pck/pck_packer.cpp
+++ b/tools/pck/pck_packer.cpp
@@ -26,7 +26,7 @@ void PCKPacker::_bind_methods() {
ObjectTypeDB::bind_method(_MD("pck_start","pck_name","alignment"),&PCKPacker::pck_start);
ObjectTypeDB::bind_method(_MD("add_file","pck_path","source_path"),&PCKPacker::add_file);
- ObjectTypeDB::bind_method(_MD("flush"),&PCKPacker::flush);
+ ObjectTypeDB::bind_method(_MD("flush","verbose"),&PCKPacker::flush);
};