1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-16 14:00:40 +00:00

fix get_selected_nodes()

This commit is contained in:
Juan Linietsky
2016-09-10 17:50:20 -03:00
parent 65b93d177e
commit 2a003d7b4e
3 changed files with 36 additions and 15 deletions

View File

@@ -11269,10 +11269,10 @@
</class> </class>
<class name="EditorFileSystem" inherits="Node" category="Core"> <class name="EditorFileSystem" inherits="Node" category="Core">
<brief_description> <brief_description>
Resource filesystem, as the editor sees it. Resource filesystem, as the editor sees it.
</brief_description> </brief_description>
<description> <description>
This object holds information of all resources in the filesystem, their types, etc. This object holds information of all resources in the filesystem, their types, etc.
</description> </description>
<methods> <methods>
<method name="get_file_type" qualifiers="const"> <method name="get_file_type" qualifiers="const">
@@ -11281,14 +11281,14 @@
<argument index="0" name="path" type="String"> <argument index="0" name="path" type="String">
</argument> </argument>
<description> <description>
Get the type of the file, given the full path. Get the type of the file, given the full path.
</description> </description>
</method> </method>
<method name="get_filesystem"> <method name="get_filesystem">
<return type="EditorFileSystemDirectory"> <return type="EditorFileSystemDirectory">
</return> </return>
<description> <description>
Get the root directory object. Get the root directory object.
</description> </description>
</method> </method>
<method name="get_path"> <method name="get_path">
@@ -11303,45 +11303,45 @@
<return type="float"> <return type="float">
</return> </return>
<description> <description>
Return the scan progress for 0 to 1 if the FS is being scanned. Return the scan progress for 0 to 1 if the FS is being scanned.
</description> </description>
</method> </method>
<method name="is_scanning" qualifiers="const"> <method name="is_scanning" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return true of the filesystem is being scanned. Return true of the filesystem is being scanned.
</description> </description>
</method> </method>
<method name="scan"> <method name="scan">
<description> <description>
Scan the filesystem for changes. Scan the filesystem for changes.
</description> </description>
</method> </method>
<method name="scan_sources"> <method name="scan_sources">
<description> <description>
Check if the source of any imported resource changed. Check if the source of any imported resource changed.
</description> </description>
</method> </method>
<method name="update_file"> <method name="update_file">
<argument index="0" name="path" type="String"> <argument index="0" name="path" type="String">
</argument> </argument>
<description> <description>
Update a file information. Call this if an external program (not Godot) modified the file. Update a file information. Call this if an external program (not Godot) modified the file.
</description> </description>
</method> </method>
</methods> </methods>
<signals> <signals>
<signal name="filesystem_changed"> <signal name="filesystem_changed">
<description> <description>
Emitted if the filesystem changed. Emitted if the filesystem changed.
</description> </description>
</signal> </signal>
<signal name="sources_changed"> <signal name="sources_changed">
<argument index="0" name="exist" type="bool"> <argument index="0" name="exist" type="bool">
</argument> </argument>
<description> <description>
Emitted if the source of any imported file changed. Emitted if the source of any imported file changed.
</description> </description>
</signal> </signal>
</signals> </signals>
@@ -11350,7 +11350,7 @@
</class> </class>
<class name="EditorFileSystemDirectory" inherits="Object" category="Core"> <class name="EditorFileSystemDirectory" inherits="Object" category="Core">
<brief_description> <brief_description>
A diretory for the resource filesystem. A diretory for the resource filesystem.
</brief_description> </brief_description>
<description> <description>
</description> </description>
@@ -11708,7 +11708,7 @@
<return type="EditorFileSystem"> <return type="EditorFileSystem">
</return> </return>
<description> <description>
Get the filesystem cache for all resources in the project. Get the filesystem cache for all resources in the project.
</description> </description>
</method> </method>
<method name="get_resource_previewer"> <method name="get_resource_previewer">
@@ -12065,6 +12065,13 @@
Get the list of selectes nodes. Get the list of selectes nodes.
</description> </description>
</method> </method>
<method name="get_transformable_selected_nodes">
<return type="Array">
</return>
<description>
Get the list of selected nodes, optimized for transform operations (ie, moving them, rotating, etc). This list avoids situations where a node is selected and also chid/grandchild.
</description>
</method>
<method name="remove_node"> <method name="remove_node">
<argument index="0" name="node" type="Node"> <argument index="0" name="node" type="Node">
</argument> </argument>

View File

@@ -877,8 +877,7 @@ bool EditorSelection::is_selected(Node * p_node) const {
return selection.has(p_node); return selection.has(p_node);
} }
Array EditorSelection::_get_transformable_selected_nodes() {
Array EditorSelection::_get_selected_nodes() {
Array ret; Array ret;
@@ -890,6 +889,18 @@ Array EditorSelection::_get_selected_nodes() {
return ret; return ret;
} }
Array EditorSelection::_get_selected_nodes() {
Array ret;
for (Map<Node*,Object*>::Element *E=selection.front();E;E=E->next()) {
ret.push_back(E->key());
}
return ret;
}
void EditorSelection::_bind_methods() { void EditorSelection::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_node_removed"),&EditorSelection::_node_removed); ObjectTypeDB::bind_method(_MD("_node_removed"),&EditorSelection::_node_removed);
@@ -897,6 +908,7 @@ void EditorSelection::_bind_methods() {
ObjectTypeDB::bind_method(_MD("add_node","node:Node"),&EditorSelection::add_node); ObjectTypeDB::bind_method(_MD("add_node","node:Node"),&EditorSelection::add_node);
ObjectTypeDB::bind_method(_MD("remove_node","node:Node"),&EditorSelection::remove_node); ObjectTypeDB::bind_method(_MD("remove_node","node:Node"),&EditorSelection::remove_node);
ObjectTypeDB::bind_method(_MD("get_selected_nodes"),&EditorSelection::_get_selected_nodes); ObjectTypeDB::bind_method(_MD("get_selected_nodes"),&EditorSelection::_get_selected_nodes);
ObjectTypeDB::bind_method(_MD("get_transformable_selected_nodes"),&EditorSelection::_get_transformable_selected_nodes);
ADD_SIGNAL( MethodInfo("selection_changed") ); ADD_SIGNAL( MethodInfo("selection_changed") );
} }

View File

@@ -233,6 +233,8 @@ public:
void _update_nl(); void _update_nl();
Array _get_selected_nodes(); Array _get_selected_nodes();
Array _get_transformable_selected_nodes();
protected: protected:
static void _bind_methods(); static void _bind_methods();