summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-09-10 17:34:27 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-09-10 17:34:27 -0300
commit65b93d177e334aaa11db9c6cf9350d5280a76afe (patch)
tree69af708253e8d5d6803ad11486bf9880e1577d23 /tools
parent2da3aaefc2509408284d77b01349231e6965ef20 (diff)
-Added bindings to the resource filesystem for editor
-Added set_child_rect, which was unavailable for script
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/editor_file_system.cpp18
-rw-r--r--tools/editor/editor_node.cpp3
-rw-r--r--tools/editor/editor_plugin.cpp5
-rw-r--r--tools/editor/editor_plugin.h2
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.cpp2
5 files changed, 27 insertions, 3 deletions
diff --git a/tools/editor/editor_file_system.cpp b/tools/editor/editor_file_system.cpp
index 582b9e2490..be1af16576 100644
--- a/tools/editor/editor_file_system.cpp
+++ b/tools/editor/editor_file_system.cpp
@@ -208,10 +208,14 @@ void EditorFileSystemDirectory::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_file_count"),&EditorFileSystemDirectory::get_file_count);
ObjectTypeDB::bind_method(_MD("get_file","idx"),&EditorFileSystemDirectory::get_file);
ObjectTypeDB::bind_method(_MD("get_file_path","idx"),&EditorFileSystemDirectory::get_file_path);
- ObjectTypeDB::bind_method(_MD("get_file_types","idx"),&EditorFileSystemDirectory::get_file_type);
+ ObjectTypeDB::bind_method(_MD("get_file_type","idx"),&EditorFileSystemDirectory::get_file_type);
ObjectTypeDB::bind_method(_MD("is_missing_sources","idx"),&EditorFileSystemDirectory::is_missing_sources);
ObjectTypeDB::bind_method(_MD("get_name"),&EditorFileSystemDirectory::get_name);
- ObjectTypeDB::bind_method(_MD("get_parent"),&EditorFileSystemDirectory::get_parent);
+ ObjectTypeDB::bind_method(_MD("get_path"),&EditorFileSystemDirectory::get_path);
+ ObjectTypeDB::bind_method(_MD("get_parent:EditorFileSystemDirectory"),&EditorFileSystemDirectory::get_parent);
+ ObjectTypeDB::bind_method(_MD("find_file_index","name"),&EditorFileSystemDirectory::find_file_index);
+ ObjectTypeDB::bind_method(_MD("find_dir_index","name"),&EditorFileSystemDirectory::find_dir_index);
+
}
@@ -1341,6 +1345,16 @@ void EditorFileSystem::update_file(const String& p_file) {
void EditorFileSystem::_bind_methods() {
+
+ ObjectTypeDB::bind_method(_MD("get_filesystem:EditorFileSystemDirectory"),&EditorFileSystem::get_filesystem);
+ ObjectTypeDB::bind_method(_MD("is_scanning"),&EditorFileSystem::is_scanning);
+ ObjectTypeDB::bind_method(_MD("get_scanning_progress"),&EditorFileSystem::get_scanning_progress);
+ ObjectTypeDB::bind_method(_MD("scan"),&EditorFileSystem::scan);
+ ObjectTypeDB::bind_method(_MD("scan_sources"),&EditorFileSystem::scan_sources);
+ ObjectTypeDB::bind_method(_MD("update_file","path"),&EditorFileSystem::update_file);
+ ObjectTypeDB::bind_method(_MD("get_path:EditorFileSystemDirectory","path"),&EditorFileSystem::get_path);
+ ObjectTypeDB::bind_method(_MD("get_file_type","path"),&EditorFileSystem::get_file_type);
+
ADD_SIGNAL( MethodInfo("filesystem_changed") );
ADD_SIGNAL( MethodInfo("sources_changed",PropertyInfo(Variant::BOOL,"exist")) );
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 9a81d287b2..86b814c610 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -4141,6 +4141,9 @@ void EditorNode::register_editor_types() {
ObjectTypeDB::register_type<EditorSpatialGizmo>();
ObjectTypeDB::register_type<EditorResourcePreview>();
ObjectTypeDB::register_type<EditorResourcePreviewGenerator>();
+ ObjectTypeDB::register_type<EditorFileSystem>();
+ ObjectTypeDB::register_type<EditorFileSystemDirectory>();
+
//ObjectTypeDB::register_type<EditorImporter>();
diff --git a/tools/editor/editor_plugin.cpp b/tools/editor/editor_plugin.cpp
index 0cfb9c083c..55f0e52c88 100644
--- a/tools/editor/editor_plugin.cpp
+++ b/tools/editor/editor_plugin.cpp
@@ -320,6 +320,10 @@ void EditorPlugin::inspect_object(Object *p_obj,const String& p_for_property) {
EditorNode::get_singleton()->push_item(p_obj,p_for_property);
}
+EditorFileSystem *EditorPlugin::get_resource_file_system() {
+ return EditorFileSystem::get_singleton();
+}
+
void EditorPlugin::_bind_methods() {
ObjectTypeDB::bind_method(_MD("add_control_to_container","container","control:Control"),&EditorPlugin::add_control_to_container);
@@ -337,6 +341,7 @@ void EditorPlugin::_bind_methods() {
ObjectTypeDB::bind_method(_MD("remove_export_plugin","plugin:EditorExportPlugin"),&EditorPlugin::remove_export_plugin);
ObjectTypeDB::bind_method(_MD("get_resource_previewer:EditorResourcePreview"),&EditorPlugin::get_resource_previewer);
+ ObjectTypeDB::bind_method(_MD("get_resource_filesystem:EditorFileSystem"),&EditorPlugin::get_resource_file_system);
ObjectTypeDB::bind_method(_MD("inspect_object","object","for_property"),&EditorPlugin::inspect_object,DEFVAL(String()));
ObjectTypeDB::bind_method(_MD("update_canvas"),&EditorPlugin::update_canvas);
diff --git a/tools/editor/editor_plugin.h b/tools/editor/editor_plugin.h
index f73fb47cc8..5b944cc27a 100644
--- a/tools/editor/editor_plugin.h
+++ b/tools/editor/editor_plugin.h
@@ -49,6 +49,7 @@ class SpatialEditorGizmo;
class EditorImportPlugin;
class EditorExportPlugin;
class EditorResourcePreview;
+class EditorFileSystem;
class EditorPlugin : public Node {
@@ -139,6 +140,7 @@ public:
//EditorImportExport *get_import_export();
EditorSettings *get_editor_settings();
EditorResourcePreview *get_resource_previewer();
+ EditorFileSystem *get_resource_file_system();
virtual void restore_global_state();
virtual void save_global_state();
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp
index 8076a91a32..9701b8030d 100644
--- a/tools/editor/plugins/spatial_editor_plugin.cpp
+++ b/tools/editor/plugins/spatial_editor_plugin.cpp
@@ -3470,7 +3470,7 @@ void SpatialEditor::_unhandled_key_input(InputEvent p_event) {
return;
#if 0
-//i don't remember this being used
+//i don't remember this being used, why was it here?
{
EditorNode *en = editor;