summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/tests/test_gdscript.cpp1
-rw-r--r--bin/tests/test_misc.cpp2
-rw-r--r--bin/tests/test_physics.cpp2
-rw-r--r--bin/tests/test_physics_2d.cpp2
-rw-r--r--core/dvector.h28
-rw-r--r--core/image.cpp1
-rw-r--r--core/math/triangulate.cpp5
-rw-r--r--core/object.cpp1
-rw-r--r--core/object_type_db.cpp7
-rw-r--r--core/variant_call.cpp2
-rw-r--r--doc/base/classes.xml535
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp17
-rw-r--r--drivers/png/image_loader_png.cpp2
-rw-r--r--drivers/pulseaudio/audio_driver_pulseaudio.cpp4
-rw-r--r--drivers/unix/os_unix.cpp2
-rw-r--r--modules/gdscript/gd_editor.cpp15
-rw-r--r--modules/gdscript/gd_tokenizer.cpp4
-rw-r--r--modules/visual_script/visual_script_editor.cpp1
-rw-r--r--platform/android/detect.py13
-rw-r--r--platform/android/export/export.cpp34
-rw-r--r--platform/osx/export/export.cpp2
-rw-r--r--platform/winrt/export/export.cpp20
-rw-r--r--scene/3d/remote_transform.cpp132
-rw-r--r--scene/3d/remote_transform.h30
-rw-r--r--scene/gui/color_picker.cpp17
-rw-r--r--scene/gui/color_rect.cpp36
-rw-r--r--scene/gui/color_rect.h22
-rw-r--r--scene/gui/control.cpp47
-rw-r--r--scene/gui/control.h2
-rw-r--r--scene/gui/dialogs.cpp1
-rw-r--r--scene/gui/panel.h2
-rw-r--r--scene/gui/scroll_container.cpp4
-rw-r--r--scene/gui/text_edit.cpp3
-rw-r--r--scene/main/viewport.cpp31
-rw-r--r--scene/main/viewport.h2
-rw-r--r--scene/register_scene_types.cpp4
-rw-r--r--servers/visual/rasterizer.cpp3
-rw-r--r--tools/editor/code_editor.cpp34
-rw-r--r--tools/editor/code_editor.h5
-rw-r--r--tools/editor/editor_data.cpp16
-rw-r--r--tools/editor/editor_data.h2
-rw-r--r--tools/editor/editor_file_system.cpp18
-rw-r--r--tools/editor/editor_import_export.cpp2
-rw-r--r--tools/editor/editor_node.cpp60
-rw-r--r--tools/editor/editor_node.h3
-rw-r--r--tools/editor/editor_plugin.cpp39
-rw-r--r--tools/editor/editor_plugin.h14
-rw-r--r--tools/editor/editor_resource_preview.cpp42
-rw-r--r--tools/editor/editor_resource_preview.h8
-rw-r--r--tools/editor/editor_themes.cpp13
-rw-r--r--tools/editor/editor_themes.h4
-rw-r--r--tools/editor/icons/2x/icon_remote_transform.pngbin0 -> 1435 bytes
-rw-r--r--tools/editor/icons/icon_color_frame.pngbin0 -> 360 bytes
-rw-r--r--tools/editor/icons/icon_remote_transform.pngbin0 -> 680 bytes
-rw-r--r--tools/editor/icons/source/icon_remote_transform.svg124
-rw-r--r--tools/editor/io_plugins/editor_bitmask_import_plugin.cpp2
-rw-r--r--tools/editor/io_plugins/editor_sample_import_plugin.cpp2
-rw-r--r--tools/editor/io_plugins/editor_scene_import_plugin.cpp7
-rw-r--r--tools/editor/plugins/baked_light_baker.cpp4
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.cpp14
-rw-r--r--tools/editor/plugins/collision_polygon_2d_editor_plugin.h2
-rw-r--r--tools/editor/plugins/collision_shape_2d_editor_plugin.h2
-rw-r--r--tools/editor/plugins/light_occluder_2d_editor_plugin.h2
-rw-r--r--tools/editor/plugins/navigation_polygon_editor_plugin.h2
-rw-r--r--tools/editor/plugins/path_2d_editor_plugin.h2
-rw-r--r--tools/editor/plugins/polygon_2d_editor_plugin.h2
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp43
-rw-r--r--tools/editor/plugins/script_editor_plugin.h4
-rw-r--r--tools/editor/plugins/script_text_editor.cpp150
-rw-r--r--tools/editor/plugins/script_text_editor.h5
-rw-r--r--tools/editor/plugins/shader_graph_editor_plugin.cpp9
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.cpp3
-rw-r--r--tools/editor/plugins/tile_map_editor_plugin.h2
-rw-r--r--tools/editor/project_manager.cpp4
-rw-r--r--tools/editor/spatial_editor_gizmos.cpp2
75 files changed, 1373 insertions, 310 deletions
diff --git a/bin/tests/test_gdscript.cpp b/bin/tests/test_gdscript.cpp
index 4457d70b38..43d65f782b 100644
--- a/bin/tests/test_gdscript.cpp
+++ b/bin/tests/test_gdscript.cpp
@@ -222,6 +222,7 @@ static String _parser_expr(const GDParser::Node *p_expr) {
case GDParser::OperatorNode::OP_BIT_AND: { txt=_parser_expr(c_node->arguments[0])+"&"+_parser_expr(c_node->arguments[1]); } break;;
case GDParser::OperatorNode::OP_BIT_OR: { txt=_parser_expr(c_node->arguments[0])+"|"+_parser_expr(c_node->arguments[1]); } break;
case GDParser::OperatorNode::OP_BIT_XOR: { txt=_parser_expr(c_node->arguments[0])+"^"+_parser_expr(c_node->arguments[1]); } break;
+ default: {}
}
diff --git a/bin/tests/test_misc.cpp b/bin/tests/test_misc.cpp
index 68564c62b0..9d7adc3573 100644
--- a/bin/tests/test_misc.cpp
+++ b/bin/tests/test_misc.cpp
@@ -431,7 +431,7 @@ public:
RID lightaux = vs->light_create( VisualServer::LIGHT_DIRECTIONAL );
//vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,0.0) );
//vs->light_set_shadow( lightaux, true );
- RID light = vs->instance_create2( lightaux,scenario );
+ vs->instance_create2( lightaux,scenario );
//rot_a=Transform(Matrix3(Vector3(1,0,0),Math_PI/2.0),Vector3());
rot_b=Transform(Matrix3(),Vector3(2,0,0));
diff --git a/bin/tests/test_physics.cpp b/bin/tests/test_physics.cpp
index ecd90a13d4..f202d0dda1 100644
--- a/bin/tests/test_physics.cpp
+++ b/bin/tests/test_physics.cpp
@@ -609,7 +609,7 @@ public:
//t.basis.rotate(Vector3(-1,0,0),Math_PI/4*i);
- RID b = create_body(type,PhysicsServer::BODY_MODE_RIGID,t);
+ create_body(type,PhysicsServer::BODY_MODE_RIGID,t);
//RID b = create_body(type,i==0?PhysicsServer::BODY_MODE_STATIC:PhysicsServer::BODY_MODE_RIGID,t);
}
diff --git a/bin/tests/test_physics_2d.cpp b/bin/tests/test_physics_2d.cpp
index c5fb734999..845e20b6c3 100644
--- a/bin/tests/test_physics_2d.cpp
+++ b/bin/tests/test_physics_2d.cpp
@@ -410,7 +410,7 @@ public:
Physics2DServer::ShapeType type = types[i%4];
// type=Physics2DServer::SHAPE_SEGMENT;
- RID b = _add_body(type,Matrix32(i*0.8,Point2(152+i*40,100-40*i)));
+ _add_body(type,Matrix32(i*0.8,Point2(152+i*40,100-40*i)));
//if (i==0)
// ps->body_set_mode(b,Physics2DServer::BODY_MODE_STATIC);
}
diff --git a/core/dvector.h b/core/dvector.h
index a5519ed604..9a54641617 100644
--- a/core/dvector.h
+++ b/core/dvector.h
@@ -262,6 +262,34 @@ public:
w[bs+i]=r[i];
}
+ DVector<T> subarray(int p_from, int p_to) {
+
+ if (p_from<0) {
+ p_from=size()+p_from;
+ }
+ if (p_to<0) {
+ p_to=size()+p_to;
+ }
+ if (p_from<0 || p_from>=size()) {
+ DVector<T>& aux=*((DVector<T>*)0); // nullreturn
+ ERR_FAIL_COND_V(p_from<0 || p_from>=size(),aux)
+ }
+ if (p_to<0 || p_to>=size()) {
+ DVector<T>& aux=*((DVector<T>*)0); // nullreturn
+ ERR_FAIL_COND_V(p_to<0 || p_to>=size(),aux)
+ }
+
+ DVector<T> slice;
+ int span=1 + p_to - p_from;
+ slice.resize(span);
+ Read r = read();
+ Write w = slice.write();
+ for (int i=0; i<span; ++i) {
+ w[i] = r[p_from+i];
+ }
+
+ return slice;
+ }
Error insert(int p_pos,const T& p_val) {
diff --git a/core/image.cpp b/core/image.cpp
index d6ac3f28ea..90051d7d0d 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -2052,6 +2052,7 @@ Error Image::_decompress_bc() {
ht/=2;
} break;
+ default: {}
}
}
diff --git a/core/math/triangulate.cpp b/core/math/triangulate.cpp
index 27b7c86675..1f5d5ed6b3 100644
--- a/core/math/triangulate.cpp
+++ b/core/math/triangulate.cpp
@@ -157,7 +157,10 @@ bool Triangulate::triangulate(const Vector<Vector2> &contour,Vector<int> &result
m++;
/* remove v from remaining polygon */
- for(s=v,t=v+1;t<nv;s++,t++) V[s] = V[t]; nv--;
+ for(s=v,t=v+1;t<nv;s++,t++)
+ V[s] = V[t];
+
+ nv--;
/* resest error detection counter */
count = 2*nv;
diff --git a/core/object.cpp b/core/object.cpp
index 81fdc2a90c..8cd4e07097 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -1644,6 +1644,7 @@ void Object::_clear_internal_resource_paths(const Variant &p_var) {
_clear_internal_resource_paths(d[E->get()]);
}
} break;
+ default: {}
}
}
diff --git a/core/object_type_db.cpp b/core/object_type_db.cpp
index b6a69e3bd4..aa641923e6 100644
--- a/core/object_type_db.cpp
+++ b/core/object_type_db.cpp
@@ -866,21 +866,14 @@ MethodBind* ObjectTypeDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind , c
Vector<Variant> defvals;
-#define PARSE_DEFVAL(m_defval)\
-if (d##m_defval.used) defvals.insert(0,d##m_defval.val);\
-else goto set_defvals;
-
defvals.resize(p_defcount);
for(int i=0;i<p_defcount;i++) {
defvals[i]=*p_defs[p_defcount-i-1];
}
- set_defvals:
-
p_bind->set_default_arguments(defvals);
p_bind->set_hint_flags(p_flags);
-#undef PARSE_DEFVAL
return p_bind;
}
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index e7e71e8251..8473fdcd19 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -518,6 +518,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var
VCALL_LOCALMEM1(ByteArray,append);
VCALL_LOCALMEM1(ByteArray,append_array);
VCALL_LOCALMEM0(ByteArray,invert);
+ VCALL_LOCALMEM2R(ByteArray,subarray);
VCALL_LOCALMEM0R(IntArray,size);
VCALL_LOCALMEM2(IntArray,set);
@@ -1592,6 +1593,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
ADDFUNC2(RAW_ARRAY,INT,ByteArray,insert,INT,"idx",INT,"byte",varray());
ADDFUNC1(RAW_ARRAY,NIL,ByteArray,resize,INT,"idx",varray());
ADDFUNC0(RAW_ARRAY,NIL,ByteArray,invert,varray());
+ ADDFUNC2(RAW_ARRAY,RAW_ARRAY,ByteArray,subarray,INT,"from",INT,"to",varray());
ADDFUNC0(RAW_ARRAY,STRING,ByteArray,get_string_from_ascii,varray());
ADDFUNC0(RAW_ARRAY,STRING,ByteArray,get_string_from_utf8,varray());
diff --git a/doc/base/classes.xml b/doc/base/classes.xml
index e202369eda..916ca09c92 100644
--- a/doc/base/classes.xml
+++ b/doc/base/classes.xml
@@ -2221,6 +2221,12 @@
Register a [LineEdit] in the dialog. When the enter key is pressed, the dialog will be accepted.
</description>
</method>
+ <method name="set_child_rect">
+ <argument index="0" name="child" type="Control">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_hide_on_ok">
<argument index="0" name="enabled" type="bool">
</argument>
@@ -11261,6 +11267,184 @@
</constant>
</constants>
</class>
+<class name="EditorFileSystem" inherits="Node" category="Core">
+ <brief_description>
+ Resource filesystem, as the editor sees it.
+ </brief_description>
+ <description>
+ This object holds information of all resources in the filesystem, their types, etc.
+ </description>
+ <methods>
+ <method name="get_file_type" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="path" type="String">
+ </argument>
+ <description>
+ Get the type of the file, given the full path.
+ </description>
+ </method>
+ <method name="get_filesystem">
+ <return type="EditorFileSystemDirectory">
+ </return>
+ <description>
+ Get the root directory object.
+ </description>
+ </method>
+ <method name="get_path">
+ <return type="EditorFileSystemDirectory">
+ </return>
+ <argument index="0" name="path" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_scanning_progress" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Return the scan progress for 0 to 1 if the FS is being scanned.
+ </description>
+ </method>
+ <method name="is_scanning" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ Return true of the filesystem is being scanned.
+ </description>
+ </method>
+ <method name="scan">
+ <description>
+ Scan the filesystem for changes.
+ </description>
+ </method>
+ <method name="scan_sources">
+ <description>
+ Check if the source of any imported resource changed.
+ </description>
+ </method>
+ <method name="update_file">
+ <argument index="0" name="path" type="String">
+ </argument>
+ <description>
+ Update a file information. Call this if an external program (not Godot) modified the file.
+ </description>
+ </method>
+ </methods>
+ <signals>
+ <signal name="filesystem_changed">
+ <description>
+ Emitted if the filesystem changed.
+ </description>
+ </signal>
+ <signal name="sources_changed">
+ <argument index="0" name="exist" type="bool">
+ </argument>
+ <description>
+ Emitted if the source of any imported file changed.
+ </description>
+ </signal>
+ </signals>
+ <constants>
+ </constants>
+</class>
+<class name="EditorFileSystemDirectory" inherits="Object" category="Core">
+ <brief_description>
+ A diretory for the resource filesystem.
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="find_dir_index" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="find_file_index" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_file" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_file_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_file_path" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_file_type" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_name">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_parent">
+ <return type="EditorFileSystemDirectory">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_path" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_subdir">
+ <return type="Object">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_subdir_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_missing_sources" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
<class name="EditorImportPlugin" inherits="Reference" category="Core">
<brief_description>
Import plugin for editor
@@ -11459,14 +11643,24 @@
This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object.
</description>
</method>
- <method name="forward_input_event" qualifiers="virtual">
+ <method name="forward_canvas_input_event" qualifiers="virtual">
<return type="bool">
</return>
- <argument index="0" name="event" type="InputEvent">
+ <argument index="0" name="canvas_xform" type="Matrix32">
+ </argument>
+ <argument index="1" name="event" type="InputEvent">
</argument>
<description>
- This is a low level function for plugins that edit a given object type derived from CanvasItem to capture the input in the 2D editor viewport. The function is only being called if your object is being edited.
- Return true if you want to capture the input, otherwise false.
+ If your plugin is active (because handles() returned true to the object), any input interaction with the 2D canvas editor will be first forwarded here. The canvas transform (containing zoom and offset to transform to edited world coordinates) is provided, but the input supplied is in untransformed coordinates to the canvas editor. Return true if you want to eat this event and not pass it to the canvas editor.
+ </description>
+ </method>
+ <method name="forward_draw_over_canvas" qualifiers="virtual">
+ <argument index="0" name="canvas_xform" type="Matrix32">
+ </argument>
+ <argument index="1" name="canvas" type="Control">
+ </argument>
+ <description>
+ This function is called every time the 2D canvas editor draws (which overlays over the edited scene). Drawing over the supplied control will draw over the edited scene. To convert from control coordinates to edited scene coordinates (including zoom and offset), a transform is also provided. If you require this control to be redraw, call [method update_canvas]().
</description>
</method>
<method name="forward_spatial_input_event" qualifiers="virtual">
@@ -11510,6 +11704,20 @@
Get the name of the editor plugin. For main scren plugins this is what will appear in the selector (which by default is 2D, 3D, Script).
</description>
</method>
+ <method name="get_resource_filesystem">
+ <return type="EditorFileSystem">
+ </return>
+ <description>
+ Get the filesystem cache for all resources in the project.
+ </description>
+ </method>
+ <method name="get_resource_previewer">
+ <return type="EditorResourcePreview">
+ </return>
+ <description>
+ Get tool for generating resource previews.
+ </description>
+ </method>
<method name="get_selection">
<return type="EditorSelection">
</return>
@@ -11554,6 +11762,15 @@
Return true if this is a main screen editor plugin (it goes in the main screen selector together with 2D, 3D, Script).
</description>
</method>
+ <method name="inspect_object">
+ <argument index="0" name="object" type="Object">
+ </argument>
+ <argument index="1" name="for_property" type="String" default="&quot;&quot;">
+ </argument>
+ <description>
+ Inspect an object in the inspector.
+ </description>
+ </method>
<method name="make_visible" qualifiers="virtual">
<argument index="0" name="visible" type="bool">
</argument>
@@ -11621,6 +11838,11 @@
Restore the plugin GUI layout saved by [method EditorPlugin.get_window_layout].
</description>
</method>
+ <method name="update_canvas">
+ <description>
+ Updates the control used to draw the edited scene over the 2D canvas. This is used together with [method forward_canvas_input_event]().
+ </description>
+ </method>
</methods>
<constants>
<constant name="CONTAINER_TOOLBAR" value="0">
@@ -11657,6 +11879,117 @@
</constant>
</constants>
</class>
+<class name="EditorResourcePreview" inherits="Node" category="Core">
+ <brief_description>
+ Helper to generate previews of reources or files.
+ </brief_description>
+ <description>
+ This object is used to generate previews for resources of files.
+ </description>
+ <methods>
+ <method name="add_preview_generator">
+ <argument index="0" name="generator" type="EditorResourcePreviewGenerator">
+ </argument>
+ <description>
+ Create an own, custom preview generator.
+ </description>
+ </method>
+ <method name="check_for_invalidation">
+ <argument index="0" name="path" type="String">
+ </argument>
+ <description>
+ Check if the resource changed, if so it will be invalidated and the corresponding signal emitted.
+ </description>
+ </method>
+ <method name="queue_edited_resource_preview">
+ <argument index="0" name="resource" type="Resource">
+ </argument>
+ <argument index="1" name="receiver" type="Object">
+ </argument>
+ <argument index="2" name="receiver_func" type="String">
+ </argument>
+ <argument index="3" name="userdata" type="Variant">
+ </argument>
+ <description>
+ Queue a resource being edited for preview (using an instance). Once the preview is ready, your receiver.receiver_func will be called either containing the preview texture or an empty texure (if no preview was possible). Callback must have the format: (path,texture,userdata). Userdata can be anything.
+ </description>
+ </method>
+ <method name="queue_resource_preview">
+ <argument index="0" name="path" type="String">
+ </argument>
+ <argument index="1" name="receiver" type="Object">
+ </argument>
+ <argument index="2" name="receiver_func" type="String">
+ </argument>
+ <argument index="3" name="userdata" type="Variant">
+ </argument>
+ <description>
+ Queue a resource file for preview (using a path). Once the preview is ready, your receiver.receiver_func will be called either containing the preview texture or an empty texure (if no preview was possible). Callback must have the format: (path,texture,userdata). Userdata can be anything.
+ </description>
+ </method>
+ <method name="remove_preview_generator">
+ <argument index="0" name="generator" type="EditorResourcePreviewGenerator">
+ </argument>
+ <description>
+ Remove a custom preview generator.
+ </description>
+ </method>
+ </methods>
+ <signals>
+ <signal name="preview_invalidated">
+ <argument index="0" name="path" type="String">
+ </argument>
+ <description>
+ If a preview was invalidated (changed) this signal will emit (using the path of the preview)
+ </description>
+ </signal>
+ </signals>
+ <constants>
+ </constants>
+</class>
+<class name="EditorResourcePreviewGenerator" inherits="Reference" category="Core">
+ <brief_description>
+ Custom generator of previews.
+ </brief_description>
+ <description>
+ Custom code to generate previews. Please check "file_dialog/thumbnail_size" in EditorSettings to find out the right size to do previews at.
+ </description>
+ <methods>
+ <method name="generate" qualifiers="virtual">
+ <return type="Texture">
+ </return>
+ <argument index="0" name="from" type="Resource">
+ </argument>
+ <description>
+ Generate a preview from a given resource. This must be always implemented.
+ Returning an empty texture is an OK way to fail and let another generator take care.
+ Care must be taken because this function is always called from a thread (not the main thread).
+ </description>
+ </method>
+ <method name="generate_from_path" qualifiers="virtual">
+ <return type="Texture">
+ </return>
+ <argument index="0" name="path" type="String">
+ </argument>
+ <description>
+ Generate a preview directly from a path, implementing this is optional, as default code will load and call generate()
+ Returning an empty texture is an OK way to fail and let another generator take care.
+ Care must be taken because this function is always called from a thread (not the main thread).
+ </description>
+ </method>
+ <method name="handles" qualifiers="virtual">
+ <return type="bool">
+ </return>
+ <argument index="0" name="type" type="String">
+ </argument>
+ <description>
+ Return if your generator supports this resource type.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
<class name="EditorScenePostImport" inherits="Reference" category="Core">
<brief_description>
Base script for post-processing scenes being imported.
@@ -11732,6 +12065,13 @@
Get the list of selectes nodes.
</description>
</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">
<argument index="0" name="node" type="Node">
</argument>
@@ -13189,31 +13529,10 @@
However, by creating a [FuncRef] using the [method @GDScript.funcref] function, a reference to a function in a given object can be created, passed around and called.
</description>
<methods>
- <method name="call_func">
+ <method name="call_func" qualifiers="vararg">
<return type="Variant">
</return>
- <argument index="0" name="arg0" type="Variant" default="NULL">
- </argument>
- <argument index="1" name="arg1" type="Variant" default="NULL">
- </argument>
- <argument index="2" name="arg2" type="Variant" default="NULL">
- </argument>
- <argument index="3" name="arg3" type="Variant" default="NULL">
- </argument>
- <argument index="4" name="arg4" type="Variant" default="NULL">
- </argument>
- <argument index="5" name="arg5" type="Variant" default="NULL">
- </argument>
- <argument index="6" name="arg6" type="Variant" default="NULL">
- </argument>
- <argument index="7" name="arg7" type="Variant" default="NULL">
- </argument>
- <argument index="8" name="arg8" type="Variant" default="NULL">
- </argument>
- <argument index="9" name="arg9" type="Variant" default="NULL">
- </argument>
<description>
- Call the referenced function with the given arguments. The argument count must correspond to the required number of arguments in the function. Returns the return value of the function call.
</description>
</method>
<method name="set_function">
@@ -13290,7 +13609,7 @@
<description>
</description>
</method>
- <method name="new">
+ <method name="new" qualifiers="vararg">
<return type="Object">
</return>
<description>
@@ -15392,10 +15711,11 @@
</argument>
<argument index="2" name="ssl_validate_domain" type="bool" default="true">
</argument>
+ <argument index="3" name="method" type="int" default="0">
+ </argument>
+ <argument index="4" name="request_data" type="String" default="&quot;&quot;">
+ </argument>
<description>
- Make a HTTP GET request. The url is the complete url including "http://" or "https://" which will be parsed for a host and a port.
- The custom_headers are HTTP request headers which will be used. If User-Agent is not specified a Godot specific will be used.
- The ssl_validate_domain specifies if in case of HTTPS the server certificate should be verified.
</description>
</method>
<method name="set_body_size_limit">
@@ -17940,15 +18260,6 @@
Return tooltip hint for specified item index.
</description>
</method>
- <method name="is_item_tooltip_enabled" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Returns whether the tooptip is enabled for specified item index.
- </description>
- </method>
<method name="get_max_columns" qualifiers="const">
<return type="int">
</return>
@@ -17977,7 +18288,7 @@
</description>
</method>
<method name="get_v_scroll">
- <return type="VScrollBar">
+ <return type="Object">
</return>
<description>
Returns the current vertical scroll bar for the List.
@@ -18001,6 +18312,15 @@
Returns whether or not the item at the specified index is selectable.
</description>
</method>
+ <method name="is_item_tooltip_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ Returns whether the tooptip is enabled for specified item index.
+ </description>
+ </method>
<method name="is_same_column_width" qualifiers="const">
<return type="int">
</return>
@@ -22540,7 +22860,7 @@
Replace a node in a scene by a given one. Subscriptions that pass through this node will be lost.
</description>
</method>
- <method name="rpc">
+ <method name="rpc" qualifiers="vararg">
<argument index="0" name="method" type="String">
</argument>
<description>
@@ -22554,22 +22874,22 @@
<description>
</description>
</method>
- <method name="rpc_id">
- <argument index="0" name="peer_" type="int">
+ <method name="rpc_id" qualifiers="vararg">
+ <argument index="0" name="peer_id" type="int">
</argument>
<argument index="1" name="method" type="String">
</argument>
<description>
</description>
</method>
- <method name="rpc_unreliable">
+ <method name="rpc_unreliable" qualifiers="vararg">
<argument index="0" name="method" type="String">
</argument>
<description>
</description>
</method>
- <method name="rpc_unreliable_id">
- <argument index="0" name="peer_" type="int">
+ <method name="rpc_unreliable_id" qualifiers="vararg">
+ <argument index="0" name="peer_id" type="int">
</argument>
<argument index="1" name="method" type="String">
</argument>
@@ -24021,50 +24341,18 @@
Add a user signal (can be added anytime). Arguments are optional, but can be added as an array of dictionaries, each containing "name" and "type" (from [@Global Scope] TYPE_*).
</description>
</method>
- <method name="call">
+ <method name="call" qualifiers="vararg">
<return type="Variant">
</return>
<argument index="0" name="method" type="String">
</argument>
- <argument index="1" name="arg0" type="Variant" default="NULL">
- </argument>
- <argument index="2" name="arg1" type="Variant" default="NULL">
- </argument>
- <argument index="3" name="arg2" type="Variant" default="NULL">
- </argument>
- <argument index="4" name="arg3" type="Variant" default="NULL">
- </argument>
- <argument index="5" name="arg4" type="Variant" default="NULL">
- </argument>
- <argument index="6" name="arg5" type="Variant" default="NULL">
- </argument>
- <argument index="7" name="arg6" type="Variant" default="NULL">
- </argument>
- <argument index="8" name="arg7" type="Variant" default="NULL">
- </argument>
- <argument index="9" name="arg8" type="Variant" default="NULL">
- </argument>
- <argument index="10" name="arg9" type="Variant" default="NULL">
- </argument>
<description>
- Call a function in the object, result is returned.
</description>
</method>
- <method name="call_deferred">
+ <method name="call_deferred" qualifiers="vararg">
<argument index="0" name="method" type="String">
</argument>
- <argument index="1" name="arg0" type="Variant" default="NULL">
- </argument>
- <argument index="2" name="arg1" type="Variant" default="NULL">
- </argument>
- <argument index="3" name="arg2" type="Variant" default="NULL">
- </argument>
- <argument index="4" name="arg3" type="Variant" default="NULL">
- </argument>
- <argument index="5" name="arg4" type="Variant" default="NULL">
- </argument>
<description>
- Create and store a function in the object. The call will take place on idle time.
</description>
</method>
<method name="callv">
@@ -24112,21 +24400,10 @@
Disconnect a signal from a method.
</description>
</method>
- <method name="emit_signal">
+ <method name="emit_signal" qualifiers="vararg">
<argument index="0" name="signal" type="String">
</argument>
- <argument index="1" name="arg0" type="Variant" default="NULL">
- </argument>
- <argument index="2" name="arg1" type="Variant" default="NULL">
- </argument>
- <argument index="3" name="arg2" type="Variant" default="NULL">
- </argument>
- <argument index="4" name="arg3" type="Variant" default="NULL">
- </argument>
- <argument index="5" name="arg4" type="Variant" default="NULL">
- </argument>
<description>
- Emit a signal. Arguments are passed in an array.
</description>
</method>
<method name="free">
@@ -31364,6 +31641,17 @@
Return the size of the array.
</description>
</method>
+ <method name="subarray">
+ <return type="RawArray">
+ </return>
+ <argument index="0" name="from" type="int">
+ </argument>
+ <argument index="1" name="to" type="int">
+ </argument>
+ <description>
+ Returns the slice of the [RawArray] between indices (inclusive) as a new [RawArray]. Any negative index is considered to be from the end of the array.
+ </description>
+ </method>
</methods>
<constants>
</constants>
@@ -32064,6 +32352,28 @@
<constants>
</constants>
</class>
+<class name="RemoteTransform" inherits="Spatial" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_remote_node" qualifiers="const">
+ <return type="NodePath">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_remote_node">
+ <argument index="0" name="path" type="NodePath">
+ </argument>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
<class name="RemoteTransform2D" inherits="Node2D" category="Core">
<brief_description>
</brief_description>
@@ -34623,23 +34933,13 @@
<description>
</description>
<methods>
- <method name="call_group">
+ <method name="call_group" qualifiers="vararg">
<argument index="0" name="flags" type="int">
</argument>
<argument index="1" name="group" type="String">
</argument>
<argument index="2" name="method" type="String">
</argument>
- <argument index="3" name="arg0" type="Variant" default="NULL">
- </argument>
- <argument index="4" name="arg1" type="Variant" default="NULL">
- </argument>
- <argument index="5" name="arg2" type="Variant" default="NULL">
- </argument>
- <argument index="6" name="arg3" type="Variant" default="NULL">
- </argument>
- <argument index="7" name="arg4" type="Variant" default="NULL">
- </argument>
<description>
</description>
</method>
@@ -35063,7 +35363,7 @@
A helper node for displaying scrollable elements (e.g. lists).
</brief_description>
<description>
- A ScrollContainer node with a [Control] child and scrollbar child ([HScrollbar], [VScrollBar], or both) will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the minimum_size of the Control relative to the ScrollContainer. Works great with a [Panel] control.
+ A ScrollContainer node with a [Control] child and scrollbar child ([HScrollbar], [VScrollBar], or both) will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the minimum_size of the Control relative to the ScrollContainer. Works great with a [Panel] control. You can set EXPAND on children size flags, so they will upscale to ScrollContainer size if ScrollContainer size is bigger (scroll is invisible for chosen dimension).
</description>
<methods>
<method name="get_h_scroll" qualifiers="const">
@@ -43875,24 +44175,12 @@
Common behavior is to create an action, then add do/undo calls to functions or property changes, then commiting the action.
</description>
<methods>
- <method name="add_do_method">
+ <method name="add_do_method" qualifiers="vararg">
<argument index="0" name="object" type="Object">
</argument>
<argument index="1" name="method" type="String">
</argument>
- <argument index="2" name="arg0" type="Variant" default="NULL">
- </argument>
- <argument index="3" name="arg1" type="Variant" default="NULL">
- </argument>
- <argument index="4" name="arg2" type="Variant" default="NULL">
- </argument>
- <argument index="5" name="arg3" type="Variant" default="NULL">
- </argument>
- <argument index="6" name="arg4" type="Variant" default="NULL">
- </argument>
<description>
- Add a call to a method in a given object with custom
- arguments.
</description>
</method>
<method name="add_do_property">
@@ -43913,23 +44201,12 @@
Add a 'do' reference that will be erased if the 'do' history is lost. This is useful mostly for new nodes created for the 'do' call. Do not use for resources.
</description>
</method>
- <method name="add_undo_method">
+ <method name="add_undo_method" qualifiers="vararg">
<argument index="0" name="object" type="Object">
</argument>
<argument index="1" name="method" type="String">
</argument>
- <argument index="2" name="arg0" type="Variant" default="NULL">
- </argument>
- <argument index="3" name="arg1" type="Variant" default="NULL">
- </argument>
- <argument index="4" name="arg2" type="Variant" default="NULL">
- </argument>
- <argument index="5" name="arg3" type="Variant" default="NULL">
- </argument>
- <argument index="6" name="arg4" type="Variant" default="NULL">
- </argument>
<description>
- Add a call to an undo method in a given object with custom arguments. Undo calls are used to revert 'do' calls.
</description>
</method>
<method name="add_undo_property">
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index 1986ddced2..8350fb0674 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -6777,7 +6777,7 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans
}
}
- if (e->instance->billboard || e->instance->depth_scale) {
+ if (e->instance->billboard || e->instance->billboard_y || e->instance->depth_scale) {
Transform xf=e->instance->transform;
if (e->instance->depth_scale) {
@@ -6808,6 +6808,21 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans
xf.basis.scale(scale);
}
+
+ if (e->instance->billboard_y) {
+
+ Vector3 scale = xf.basis.get_scale();
+ Vector3 look_at = p_view_transform.get_origin();
+ look_at.y = 0.0;
+ Vector3 look_at_norm = look_at.normalized();
+
+ if (current_rt && current_rt_vflip) {
+ xf.set_look_at(xf.origin,xf.origin + look_at_norm, Vector3(0.0, -1.0, 0.0));
+ } else {
+ xf.set_look_at(xf.origin,xf.origin + look_at_norm, Vector3(0.0, 1.0, 0.0));
+ }
+ xf.basis.scale(scale);
+ }
material_shader.set_uniform(MaterialShaderGLES2::WORLD_TRANSFORM, xf);
} else {
diff --git a/drivers/png/image_loader_png.cpp b/drivers/png/image_loader_png.cpp
index e10ac7493f..4967b0f9df 100644
--- a/drivers/png/image_loader_png.cpp
+++ b/drivers/png/image_loader_png.cpp
@@ -270,7 +270,7 @@ static void user_read_data(png_structp png_ptr,png_bytep data, png_size_t p_leng
PNGReadStatus *rstatus;
rstatus=(PNGReadStatus*)png_get_io_ptr(png_ptr);
- int to_read=p_length;
+ png_size_t to_read=p_length;
if (rstatus->size>=0) {
to_read = MIN( p_length, rstatus->size - rstatus->offset);
}
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
index 4804bc5630..954d2c20f2 100644
--- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp
+++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
@@ -175,8 +175,8 @@ void AudioDriverPulseAudio::finish() {
exit_thread = true;
Thread::wait_to_finish(thread);
- if (pulse)
- pa_simple_free(pulse);
+ if (pulse)
+ pa_simple_free(pulse);
if (samples_in) {
memdelete_arr(samples_in);
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index fd515d6dd3..271cf302ef 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -390,7 +390,7 @@ Error OS_Unix::execute(const String& p_path, const List<String>& p_arguments,boo
if (p_blocking) {
int status;
- pid_t rpid = waitpid(pid,&status,0);
+ waitpid(pid,&status,0);
if (r_exitcode)
*r_exitcode=WEXITSTATUS(status);
} else {
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp
index 2a80531ec5..29dbe82a47 100644
--- a/modules/gdscript/gd_editor.cpp
+++ b/modules/gdscript/gd_editor.cpp
@@ -2094,7 +2094,7 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base
GDParser p;
- Error err = p.parse(p_code,p_base_path,false,"",true);
+ p.parse(p_code,p_base_path,false,"",true);
bool isfunction=false;
Set<String> options;
@@ -2141,7 +2141,18 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base
GDCompletionIdentifier t;
if (_guess_expression_type(context,static_cast<const GDParser::OperatorNode *>(node)->arguments[0],p.get_completion_line(),t)) {
- if (t.type==Variant::OBJECT && t.obj_type!=StringName()) {
+ if (t.type==Variant::OBJECT && t.obj_type=="GDNativeClass") {
+ //native enum
+ Ref<GDNativeClass> gdn = t.value;
+ if (gdn.is_valid()) {
+ StringName cn = gdn->get_name();
+ List<String> cnames;
+ ObjectTypeDB::get_integer_constant_list(cn,&cnames);
+ for (List<String>::Element *E=cnames.front();E;E=E->next()) {
+ options.insert(E->get());
+ }
+ }
+ } else if (t.type==Variant::OBJECT && t.obj_type!=StringName()) {
Ref<GDScript> on_script;
diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp
index 072a7e26a0..2041ec12ad 100644
--- a/modules/gdscript/gd_tokenizer.cpp
+++ b/modules/gdscript/gd_tokenizer.cpp
@@ -1332,7 +1332,7 @@ StringName GDTokenizerBuffer::get_token_identifier(int p_offset) const{
ERR_FAIL_INDEX_V(offset,tokens.size(),StringName());
uint32_t identifier = tokens[offset]>>TOKEN_BITS;
- ERR_FAIL_INDEX_V(identifier,identifiers.size(),StringName());
+ ERR_FAIL_INDEX_V(identifier,(uint32_t)identifiers.size(),StringName());
return identifiers[identifier];
}
@@ -1391,7 +1391,7 @@ const Variant& GDTokenizerBuffer::get_token_constant(int p_offset) const{
int offset = token+p_offset;
ERR_FAIL_INDEX_V(offset,tokens.size(),nil);
uint32_t constant = tokens[offset]>>TOKEN_BITS;
- ERR_FAIL_INDEX_V(constant,constants.size(),nil);
+ ERR_FAIL_INDEX_V(constant,(uint32_t)constants.size(),nil);
return constants[constant];
}
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp
index 76f6f47ad8..02d3c453c4 100644
--- a/modules/visual_script/visual_script_editor.cpp
+++ b/modules/visual_script/visual_script_editor.cpp
@@ -2140,6 +2140,7 @@ Vector<String> VisualScriptEditor::get_functions(){
void VisualScriptEditor::set_edited_script(const Ref<Script>& p_script){
+
script=p_script;
signal_editor->script=p_script;
signal_editor->undo_redo=undo_redo;
diff --git a/platform/android/detect.py b/platform/android/detect.py
index 6fb71a195f..49ffc86658 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -166,16 +166,13 @@ def configure(env):
env.Append(CPPPATH=[gcc_include])
# env['CCFLAGS'] = string.split('-DNO_THREADS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -mthumb -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED ')
- libm='m'
env['neon_enabled']=False
if env['android_arch']=='x86':
env['CCFLAGS'] = string.split('-DNO_STATVFS -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__GLIBC__ -Wno-psabi -ftree-vectorize -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED')
elif env["android_arch"]=="armv6":
- env['CCFLAGS'] = string.split('-DNO_STATVFS -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__ARM_ARCH_6__ -D__GLIBC__ -Wno-psabi -march=armv6 -mfpu=vfp -mfloat-abi=hard -D_NDK_MATH_NO_SOFTFP=1 -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED')
- libm='m_hard'
+ env['CCFLAGS'] = string.split('-DNO_STATVFS -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__ARM_ARCH_6__ -D__GLIBC__ -Wno-psabi -march=armv6 -mfpu=vfp -mfloat-abi=softfp -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED')
elif env["android_arch"]=="armv7":
- env['CCFLAGS'] = string.split('-DNO_STATVFS -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -Wl,--fix-cortex-a8 -D__GLIBC__ -Wno-psabi -march=armv7-a -mfloat-abi=hard -D_NDK_MATH_NO_SOFTFP=1 -ftree-vectorize -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED')
- libm='m_hard'
+ env['CCFLAGS'] = string.split('-DNO_STATVFS -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -D__GLIBC__ -Wno-psabi -march=armv7-a -mfloat-abi=softfp -ftree-vectorize -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED')
if env['android_neon']=='yes':
env['neon_enabled']=True
env.Append(CCFLAGS=['-mfpu=neon','-D__ARM_NEON__'])
@@ -184,11 +181,11 @@ def configure(env):
env.Append(LDPATH=[ld_path])
env.Append(LIBS=['OpenSLES'])
-# env.Append(LIBS=['c',libm,'stdc++','log','EGL','GLESv1_CM','GLESv2','OpenSLES','supc++','android'])
+# env.Append(LIBS=['c','m','stdc++','log','EGL','GLESv1_CM','GLESv2','OpenSLES','supc++','android'])
env.Append(LIBS=['EGL','OpenSLES','android'])
- env.Append(LIBS=['c',libm,'stdc++','log','GLESv1_CM','GLESv2', 'z'])
+ env.Append(LIBS=['c','m','stdc++','log','GLESv1_CM','GLESv2', 'z'])
- env["LINKFLAGS"]= string.split(" -g --sysroot="+ld_sysroot+" -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--no-warn-mismatch")
+ env["LINKFLAGS"]= string.split(" -g --sysroot="+ld_sysroot+" -Wl,--no-undefined -Wl,-z,noexecstack ")
env.Append(LINKFLAGS=["-Wl,-soname,libgodot_android.so"])
if (env["target"]=="release"):
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 10d77aba6c..8f3edfcaa7 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -495,7 +495,7 @@ static String _parse_string(const uint8_t *p_bytes,bool p_utf8) {
Vector<uint8_t> str8;
str8.resize(len+1);
- for(int i=0;i<len;i++) {
+ for(uint32_t i=0;i<len;i++) {
str8[i]=p_bytes[offset+i];
}
str8[len]=0;
@@ -505,7 +505,7 @@ static String _parse_string(const uint8_t *p_bytes,bool p_utf8) {
} else {
String str;
- for(int i=0;i<len;i++) {
+ for(uint32_t i=0;i<len;i++) {
CharType c = decode_uint16(&p_bytes[offset+i*2]);
if (c==0)
break;
@@ -535,7 +535,7 @@ void EditorExportPlatformAndroid::_fix_resources(Vector<uint8_t>& p_manifest) {
printf("stirng count: %i\n",string_count);
printf("flags: %x\n",string_flags);
- for(int i=0;i<string_count;i++) {
+ for(uint32_t i=0;i<string_count;i++) {
uint32_t offset = decode_uint32(&p_manifest[string_table_begins+i*4]);
offset+=string_table_begins+string_count*4;
@@ -569,7 +569,7 @@ void EditorExportPlatformAndroid::_fix_resources(Vector<uint8_t>& p_manifest) {
Vector<uint8_t> ret;
ret.resize(string_table_begins+string_table.size()*4);
- for(int i=0;i<string_table_begins;i++) {
+ for(uint32_t i=0;i<string_table_begins;i++) {
ret[i]=p_manifest[i];
}
@@ -660,7 +660,7 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
uint32_t filesize = decode_uint32(&p_manifest[ofs+4]);
ofs+=8;
-// print_line("FILESIZE: "+itos(filesize)+" ACTUAL: "+itos(p_manifest.size()));
+ //print_line("FILESIZE: "+itos(filesize)+" ACTUAL: "+itos(p_manifest.size()));
uint32_t string_count;
uint32_t styles_count;
@@ -672,7 +672,7 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
uint32_t string_table_ends;
Vector<uint8_t> stable_extra;
- while(ofs < p_manifest.size()) {
+ while(ofs < (uint32_t)p_manifest.size()) {
uint32_t chunk = decode_uint32(&p_manifest[ofs]);
uint32_t size = decode_uint32(&p_manifest[ofs+4]);
@@ -687,7 +687,7 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
string_count=decode_uint32(&p_manifest[iofs]);
styles_count=decode_uint32(&p_manifest[iofs+4]);
- uint32_t string_flags=decode_uint32(&p_manifest[iofs+8]);
+ string_flags=decode_uint32(&p_manifest[iofs+8]);
string_data_offset=decode_uint32(&p_manifest[iofs+12]);
styles_offset=decode_uint32(&p_manifest[iofs+16]);
/*
@@ -703,7 +703,7 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
string_table_begins=st_offset;
- for(int i=0;i<string_count;i++) {
+ for(uint32_t i=0;i<string_count;i++) {
uint32_t string_at = decode_uint32(&p_manifest[st_offset+i*4]);
string_at+=st_offset+string_count*4;
@@ -719,7 +719,7 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
uint32_t len = decode_uint16(&p_manifest[string_at]);
Vector<CharType> ucstring;
ucstring.resize(len+1);
- for(int j=0;j<len;j++) {
+ for(uint32_t j=0;j<len;j++) {
uint16_t c=decode_uint16(&p_manifest[string_at+2+2*j]);
ucstring[j]=c;
}
@@ -732,7 +732,7 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
// print_line("String "+itos(i)+": "+string_table[i]);
}
- for(int i=string_end;i<(ofs+size);i++) {
+ for(uint32_t i=string_end;i<(ofs+size);i++) {
stable_extra.push_back(p_manifest[i]);
}
@@ -758,7 +758,7 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
uint32_t attrcount=decode_uint32(&p_manifest[iofs+20]);
iofs+=28;
//printf("ATTRCOUNT: %x\n",attrcount);
- for(int i=0;i<attrcount;i++) {
+ for(uint32_t i=0;i<attrcount;i++) {
uint32_t attr_nspace=decode_uint32(&p_manifest[iofs]);
uint32_t attr_name=decode_uint32(&p_manifest[iofs+4]);
uint32_t attr_value=decode_uint32(&p_manifest[iofs+8]);
@@ -883,7 +883,7 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
Vector<uint8_t> ret;
ret.resize(string_table_begins+string_table.size()*4);
- for(int i=0;i<string_table_begins;i++) {
+ for(uint32_t i=0;i<string_table_begins;i++) {
ret[i]=p_manifest[i];
}
@@ -927,7 +927,7 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool
uint32_t extra = (p_manifest.size()-string_table_ends);
ret.resize(new_stable_end + extra);
- for(int i=0;i<extra;i++)
+ for(uint32_t i=0;i<extra;i++)
ret[new_stable_end+i]=p_manifest[string_table_ends+i];
while(ret.size()%4)
@@ -1355,7 +1355,7 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
args.push_back(unaligned_path);
args.push_back(user);
int retval;
- int err = OS::get_singleton()->execute(jarsigner,args,true,NULL,NULL,&retval);
+ OS::get_singleton()->execute(jarsigner,args,true,NULL,NULL,&retval);
if (retval) {
EditorNode::add_io_error("'jarsigner' returned with error #"+itos(retval));
return ERR_CANT_CREATE;
@@ -1368,7 +1368,7 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
args.push_back(unaligned_path);
args.push_back("-verbose");
- err = OS::get_singleton()->execute(jarsigner,args,true,NULL,NULL,&retval);
+ OS::get_singleton()->execute(jarsigner,args,true,NULL,NULL,&retval);
if (retval) {
EditorNode::add_io_error("'jarsigner' verification of APK failed. Make sure to use jarsigner from Java 6.");
return ERR_CANT_CREATE;
@@ -1515,7 +1515,7 @@ void EditorExportPlatformAndroid::_device_poll_thread(void *ud) {
List<String> args;
args.push_back("devices");
int ec;
- Error err = OS::get_singleton()->execute(adb,args,true,NULL,&devices,&ec);
+ OS::get_singleton()->execute(adb,args,true,NULL,&devices,&ec);
Vector<String> ds = devices.split("\n");
Vector<String> ldevices;
for(int i=1;i<ds.size();i++) {
@@ -1574,7 +1574,7 @@ void EditorExportPlatformAndroid::_device_poll_thread(void *ud) {
int ec;
String dp;
- Error err = OS::get_singleton()->execute(adb,args,true,NULL,&dp,&ec);
+ OS::get_singleton()->execute(adb,args,true,NULL,&dp,&ec);
Vector<String> props = dp.split("\n");
String vendor;
diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp
index 47b0392b25..30f4c58150 100644
--- a/platform/osx/export/export.cpp
+++ b/platform/osx/export/export.cpp
@@ -445,7 +445,7 @@ Error EditorExportPlatformOSX::export_project(const String& p_path, bool p_debug
{
//write datapack
- int err = zipOpenNewFileInZip(dpkg,
+ zipOpenNewFileInZip(dpkg,
(pkg_name+".app/Contents/Resources/data.pck").utf8().get_data(),
NULL,
NULL,
diff --git a/platform/winrt/export/export.cpp b/platform/winrt/export/export.cpp
index ed294b438f..eca9f09de6 100644
--- a/platform/winrt/export/export.cpp
+++ b/platform/winrt/export/export.cpp
@@ -84,16 +84,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <zlib.h>
-#ifdef OPENSSL_ENABLED
-#include <openssl/bio.h>
-#include <openssl/asn1.h>
-#include <openssl/pkcs7.h>
-#include <openssl/pkcs12.h>
-#include <openssl/err.h>
-#include <openssl/asn1t.h>
-#include <openssl/x509.h>
-#include <openssl/ossl_typ.h>
-
// Capabilities
static const char* uwp_capabilities[] = {
"allJoyn",
@@ -129,6 +119,16 @@ static const char* uwp_device_capabilites[] = {
NULL
};
+#ifdef OPENSSL_ENABLED
+#include <openssl/bio.h>
+#include <openssl/asn1.h>
+#include <openssl/pkcs7.h>
+#include <openssl/pkcs12.h>
+#include <openssl/err.h>
+#include <openssl/asn1t.h>
+#include <openssl/x509.h>
+#include <openssl/ossl_typ.h>
+
namespace asn1 {
// https://msdn.microsoft.com/en-us/gg463180.aspx
diff --git a/scene/3d/remote_transform.cpp b/scene/3d/remote_transform.cpp
new file mode 100644
index 0000000000..d43870417a
--- /dev/null
+++ b/scene/3d/remote_transform.cpp
@@ -0,0 +1,132 @@
+
+/*************************************************************************/
+/* remote_transform.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* 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 */
+/* "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 "remote_transform.h"
+
+void RemoteTransform::_update_cache() {
+ cache=0;
+ if (has_node(remote_node)) {
+ Node *node = get_node(remote_node);
+ if (!node || this==node || node->is_a_parent_of(this) || this->is_a_parent_of(node)) {
+ return;
+ }
+
+ cache=node->get_instance_ID();
+ }
+}
+
+void RemoteTransform::_update_remote() {
+
+
+ if (!is_inside_tree())
+ return;
+
+ if (!cache)
+ return;
+
+ Object *obj = ObjectDB::get_instance(cache);
+ if (!obj)
+ return;
+
+ Spatial *n = obj->cast_to<Spatial>();
+ if (!n)
+ return;
+
+ if (!n->is_inside_tree())
+ return;
+
+ //todo make faster
+ n->set_global_transform(get_global_transform());
+
+}
+
+void RemoteTransform::_notification(int p_what) {
+
+ switch(p_what) {
+
+ case NOTIFICATION_READY: {
+
+ _update_cache();
+
+ } break;
+ case NOTIFICATION_TRANSFORM_CHANGED: {
+ if (!is_inside_tree())
+ break;
+
+ if (cache) {
+
+ _update_remote();
+
+ }
+
+ } break;
+
+ }
+}
+
+
+void RemoteTransform::set_remote_node(const NodePath& p_remote_node) {
+
+ remote_node=p_remote_node;
+ if (is_inside_tree())
+ _update_cache();
+
+ update_configuration_warning();
+}
+
+NodePath RemoteTransform::get_remote_node() const{
+
+ return remote_node;
+}
+
+
+String RemoteTransform::get_configuration_warning() const {
+
+ if (!has_node(remote_node) || !get_node(remote_node) || !get_node(remote_node)->cast_to<Spatial>()) {
+ return TTR("Path property must point to a valid Spatial node to work.");
+ }
+
+ return String();
+}
+
+void RemoteTransform::_bind_methods() {
+
+ ObjectTypeDB::bind_method(_MD("set_remote_node","path"),&RemoteTransform::set_remote_node);
+ ObjectTypeDB::bind_method(_MD("get_remote_node"),&RemoteTransform::get_remote_node);
+
+ ADD_PROPERTY( PropertyInfo(Variant::NODE_PATH,"remote_path"),_SCS("set_remote_node"),_SCS("get_remote_node"));
+}
+
+RemoteTransform::RemoteTransform() {
+
+ cache=0;
+
+}
+
diff --git a/scene/3d/remote_transform.h b/scene/3d/remote_transform.h
new file mode 100644
index 0000000000..78f0fec1e9
--- /dev/null
+++ b/scene/3d/remote_transform.h
@@ -0,0 +1,30 @@
+#ifndef REMOTETRANSFORM_H
+#define REMOTETRANSFORM_H
+
+#include "scene/3d/spatial.h"
+
+class RemoteTransform : public Spatial
+{
+ OBJ_TYPE(RemoteTransform,Spatial);
+
+ NodePath remote_node;
+
+ ObjectID cache;
+
+ void _update_remote();
+ void _update_cache();
+
+protected:
+ static void _bind_methods();
+ void _notification(int p_what);
+public:
+ void set_remote_node(const NodePath& p_remote_node);
+ NodePath get_remote_node() const;
+
+ virtual String get_configuration_warning() const;
+
+ RemoteTransform();
+
+};
+
+#endif // REMOTETRANSFORM_H
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index b69646432e..5e66544153 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -41,13 +41,13 @@ void update_material(Ref<CanvasItemMaterial>mat,const Color& p_color,float h,flo
if (!sdr.is_valid())
return;
- mat->set_shader_param("R",p_color.r);
- mat->set_shader_param("G",p_color.g);
- mat->set_shader_param("B",p_color.b);
- mat->set_shader_param("H",h);
- mat->set_shader_param("S",s);
- mat->set_shader_param("V",v);
- mat->set_shader_param("A",p_color.a);
+ mat->set_shader_param("R",p_color.r);
+ mat->set_shader_param("G",p_color.g);
+ mat->set_shader_param("B",p_color.b);
+ mat->set_shader_param("H",h);
+ mat->set_shader_param("S",s);
+ mat->set_shader_param("V",v);
+ mat->set_shader_param("A",p_color.a);
}
void ColorPicker::_notification(int p_what) {
@@ -397,9 +397,10 @@ void ColorPicker::_screen_input(const InputEvent &ev)
if (!r->get_rect().has_point(Point2(mev.global_x,mev.global_y)))
return;
Image img =r->get_screen_capture();
- if (!img.empty())
+ if (!img.empty()) {
last_capture=img;
r->queue_screen_capture();
+ }
if (!last_capture.empty())
set_color(last_capture.get_pixel(mev.global_x,mev.global_y));
}
diff --git a/scene/gui/color_rect.cpp b/scene/gui/color_rect.cpp
new file mode 100644
index 0000000000..a0e4df66b5
--- /dev/null
+++ b/scene/gui/color_rect.cpp
@@ -0,0 +1,36 @@
+#include "color_rect.h"
+
+
+
+
+void ColorFrame::set_frame_color(const Color& p_color) {
+
+ color=p_color;
+ update();
+}
+
+Color ColorFrame::get_frame_color() const{
+
+ return color;
+}
+
+void ColorFrame::_notification(int p_what) {
+
+ if (p_what==NOTIFICATION_DRAW) {
+ draw_rect(Rect2(Point2(),get_size()),color);
+ }
+}
+
+void ColorFrame::_bind_methods() {
+
+ ObjectTypeDB::bind_method(_MD("set_frame_color","color"),&ColorFrame::set_frame_color);
+ ObjectTypeDB::bind_method(_MD("get_frame_color"),&ColorFrame::get_frame_color);
+
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR,"color"),_SCS("set_frame_color"),_SCS("get_frame_color") );
+}
+
+ColorFrame::ColorFrame() {
+
+ color=Color(1,1,1);
+}
+
diff --git a/scene/gui/color_rect.h b/scene/gui/color_rect.h
new file mode 100644
index 0000000000..3816d44052
--- /dev/null
+++ b/scene/gui/color_rect.h
@@ -0,0 +1,22 @@
+#ifndef COLORRECT_H
+#define COLORRECT_H
+
+#include "scene/gui/control.h"
+
+class ColorFrame : public Control {
+ OBJ_TYPE(ColorFrame,Control)
+
+ Color color;
+protected:
+
+ void _notification(int p_what);
+ static void _bind_methods();
+public:
+
+ void set_frame_color(const Color& p_color);
+ Color get_frame_color() const;
+
+ ColorFrame();
+};
+
+#endif // COLORRECT_H
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index bf35fd25bd..a5bee32a69 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -431,8 +431,7 @@ void Control::add_child_notify(Node *p_child) {
return;
if (child_c->data.theme.is_null() && data.theme_owner) {
- child_c->data.theme_owner=data.theme_owner;
- child_c->notification(NOTIFICATION_THEME_CHANGED);
+ _propagate_theme_changed(child_c,data.theme_owner); //need to propagate here, since many controls may require setting up stuff
}
}
@@ -443,8 +442,7 @@ void Control::remove_child_notify(Node *p_child) {
return;
if (child_c->data.theme_owner && child_c->data.theme.is_null()) {
- child_c->data.theme_owner=NULL;
- //notification(NOTIFICATION_THEME_CHANGED);
+ _propagate_theme_changed(child_c,NULL);
}
}
@@ -482,10 +480,10 @@ void Control::_notification(int p_notification) {
if (is_set_as_toplevel()) {
data.SI=get_viewport()->_gui_add_subwindow_control(this);
- if (data.theme.is_null() && data.parent && data.parent->data.theme_owner) {
+ /*if (data.theme.is_null() && data.parent && data.parent->data.theme_owner) {
data.theme_owner=data.parent->data.theme_owner;
notification(NOTIFICATION_THEME_CHANGED);
- }
+ }*/
} else {
@@ -521,10 +519,10 @@ void Control::_notification(int p_notification) {
if (parent_control) {
//do nothing, has a parent control
- if (data.theme.is_null() && parent_control->data.theme_owner) {
+ /*if (data.theme.is_null() && parent_control->data.theme_owner) {
data.theme_owner=parent_control->data.theme_owner;
notification(NOTIFICATION_THEME_CHANGED);
- }
+ }*/
} else if (subwindow) {
//is a subwindow (process input before other controls for that canvas)
data.SI=get_viewport()->_gui_add_subwindow_control(this);
@@ -1915,7 +1913,7 @@ void Control::_propagate_theme_changed(CanvasItem *p_at,Control *p_owner,bool p_
CanvasItem *child = p_at->get_child(i)->cast_to<CanvasItem>();
if (child) {
- _propagate_theme_changed(child,p_owner);
+ _propagate_theme_changed(child,p_owner,p_assign);
}
}
@@ -1926,7 +1924,7 @@ void Control::_propagate_theme_changed(CanvasItem *p_at,Control *p_owner,bool p_
if (p_assign) {
c->data.theme_owner=p_owner;
}
- c->_notification(NOTIFICATION_THEME_CHANGED);
+ c->notification(NOTIFICATION_THEME_CHANGED);
c->update();
}
}
@@ -2408,6 +2406,35 @@ bool Control::is_visibility_clip_disabled() const {
return data.disable_visibility_clip;
}
+void Control::get_argument_options(const StringName& p_function,int p_idx,List<String>*r_options) const {
+
+ Node::get_argument_options(p_function,p_idx,r_options);
+
+ if (p_idx==0) {
+ List<StringName> sn;
+ String pf = p_function;
+ if (pf=="add_color_override" || pf=="has_color" || pf=="has_color_override" || pf=="get_color") {
+ Theme::get_default()->get_color_list(get_type(),&sn);
+ } else if (pf=="add_style_override" || pf=="has_style" || pf=="has_style_override" || pf=="get_style") {
+ Theme::get_default()->get_stylebox_list(get_type(),&sn);
+ } else if (pf=="add_font_override" || pf=="has_font" || pf=="has_font_override" || pf=="get_font") {
+ Theme::get_default()->get_font_list(get_type(),&sn);
+ } else if (pf=="add_constant_override" || pf=="has_constant" || pf=="has_constant_override" || pf=="get_constant") {
+ Theme::get_default()->get_constant_list(get_type(),&sn);
+ } else if (pf=="add_color_override" || pf=="has_color" || pf=="has_color_override" || pf=="get_color") {
+ Theme::get_default()->get_color_list(get_type(),&sn);
+ }
+
+ sn.sort_custom<StringName::AlphCompare>();
+ for (List<StringName>::Element *E=sn.front();E;E=E->next()) {
+ r_options->push_back("\""+E->get()+"\"");
+ }
+ }
+
+
+}
+
+
void Control::_bind_methods() {
diff --git a/scene/gui/control.h b/scene/gui/control.h
index 558439efbf..37efd80970 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -407,6 +407,8 @@ public:
void set_disable_visibility_clip(bool p_ignore);
bool is_visibility_clip_disabled() const;
+ virtual void get_argument_options(const StringName& p_function,int p_idx,List<String>*r_options) const;
+
Control();
~Control();
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index 93e46da82b..15ff334c92 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -368,6 +368,7 @@ void AcceptDialog::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_custom_action"),&AcceptDialog::_custom_action);
ObjectTypeDB::bind_method(_MD("set_text","text"),&AcceptDialog::set_text);
ObjectTypeDB::bind_method(_MD("get_text"),&AcceptDialog::get_text);
+ ObjectTypeDB::bind_method(_MD("set_child_rect","child:Control"),&AcceptDialog::set_child_rect);
ADD_SIGNAL( MethodInfo("confirmed") );
ADD_SIGNAL( MethodInfo("custom_action",PropertyInfo(Variant::STRING,"action")) );
diff --git a/scene/gui/panel.h b/scene/gui/panel.h
index efa9ebcaa0..9e2e7df7f0 100644
--- a/scene/gui/panel.h
+++ b/scene/gui/panel.h
@@ -45,4 +45,6 @@ public:
};
+
+
#endif
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp
index 190e8e141f..0fa2856ca4 100644
--- a/scene/gui/scroll_container.cpp
+++ b/scene/gui/scroll_container.cpp
@@ -228,14 +228,14 @@ void ScrollContainer::_notification(int p_what) {
child_max_size.y = MAX(child_max_size.y, minsize.y);
Rect2 r = Rect2(-scroll,minsize);
- if (!scroll_h) {
+ if (!h_scroll->is_visible()) {
r.pos.x=0;
if (c->get_h_size_flags()&SIZE_EXPAND)
r.size.width=MAX(size.width,minsize.width);
else
r.size.width=minsize.width;
}
- if (!scroll_v) {
+ if (!v_scroll->is_visible()) {
r.pos.y=0;
r.size.height=size.height;
if (c->get_v_size_flags()&SIZE_EXPAND)
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 4756fdee26..87df8c076e 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -34,6 +34,7 @@
#include "globals.h"
#include "message_queue.h"
+#include "scene/main/viewport.h"
#define TAB_PIXELS
@@ -1651,7 +1652,7 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
const InputEventMouseMotion &mm=p_input_event.mouse_motion;
- if (mm.button_mask&BUTTON_MASK_LEFT) {
+ if (mm.button_mask&BUTTON_MASK_LEFT && get_viewport()->gui_get_drag_data()==Variant()) { //ignore if dragging
if (selection.selecting_mode!=Selection::MODE_NONE) {
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 7970229c06..347d72aecd 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1344,6 +1344,15 @@ Matrix32 Viewport::_get_input_pre_xform() const {
return pre_xf;
}
+Vector2 Viewport::_get_window_offset() const {
+
+ if (parent_control) {
+ return (parent_control->get_viewport()->get_final_transform() * parent_control->get_global_transform_with_canvas()).get_origin();
+ }
+
+ return Vector2();
+}
+
void Viewport::_make_input_local(InputEvent& ev) {
@@ -1351,10 +1360,7 @@ void Viewport::_make_input_local(InputEvent& ev) {
case InputEvent::MOUSE_BUTTON: {
- Vector2 vp_ofs;
- if (parent_control) {
- vp_ofs = (parent_control->get_viewport()->get_final_transform() * parent_control->get_global_transform_with_canvas()).get_origin();
- }
+ Vector2 vp_ofs = _get_window_offset();
Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
Vector2 g = ai.xform(Vector2(ev.mouse_button.global_x,ev.mouse_button.global_y));
@@ -1369,10 +1375,7 @@ void Viewport::_make_input_local(InputEvent& ev) {
} break;
case InputEvent::MOUSE_MOTION: {
- Vector2 vp_ofs;
- if (parent_control) {
- vp_ofs = (parent_control->get_viewport()->get_final_transform() * parent_control->get_global_transform_with_canvas()).get_origin();
- }
+ Vector2 vp_ofs = _get_window_offset();
Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
Vector2 g = ai.xform(Vector2(ev.mouse_motion.global_x,ev.mouse_motion.global_y));
@@ -1393,10 +1396,7 @@ void Viewport::_make_input_local(InputEvent& ev) {
} break;
case InputEvent::SCREEN_TOUCH: {
- Vector2 vp_ofs;
- if (parent_control) {
- vp_ofs = (parent_control->get_viewport()->get_final_transform() * parent_control->get_global_transform_with_canvas()).get_origin();
- }
+ Vector2 vp_ofs = _get_window_offset();
Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
Vector2 t = ai.xform(Vector2(ev.screen_touch.x,ev.screen_touch.y)-vp_ofs);
@@ -1408,10 +1408,7 @@ void Viewport::_make_input_local(InputEvent& ev) {
} break;
case InputEvent::SCREEN_DRAG: {
- Vector2 vp_ofs;
- if (parent_control) {
- vp_ofs = (parent_control->get_viewport()->get_final_transform() * parent_control->get_global_transform_with_canvas()).get_origin();
- }
+ Vector2 vp_ofs = _get_window_offset();
Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
Vector2 t = ai.xform(Vector2(ev.screen_drag.x,ev.screen_drag.y)-vp_ofs);
@@ -1490,7 +1487,7 @@ void Viewport::_vp_unhandled_input(const InputEvent& p_ev) {
Vector2 Viewport::get_mouse_pos() const {
- return (get_final_transform().affine_inverse() * _get_input_pre_xform()).xform(Input::get_singleton()->get_mouse_pos());
+ return (get_final_transform().affine_inverse() * _get_input_pre_xform()).xform(Input::get_singleton()->get_mouse_pos() - _get_window_offset());
}
void Viewport::warp_mouse(const Vector2& p_pos) {
diff --git a/scene/main/viewport.h b/scene/main/viewport.h
index 22a97a9888..145f642fd3 100644
--- a/scene/main/viewport.h
+++ b/scene/main/viewport.h
@@ -268,6 +268,8 @@ friend class Control;
Control *_gui_get_focus_owner();
+ Vector2 _get_window_offset() const;
+
friend class Listener;
void _listener_transform_changed_notify();
void _listener_set(Listener* p_listener);
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index be2c12d63a..104aeb2b5e 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -55,6 +55,7 @@
#include "scene/gui/option_button.h"
#include "scene/gui/color_picker.h"
#include "scene/gui/texture_frame.h"
+#include "scene/gui/color_rect.h"
#include "scene/gui/patch_9_frame.h"
#include "scene/gui/menu_button.h"
#include "scene/gui/check_box.h"
@@ -182,6 +183,7 @@
#include "scene/3d/spatial.h"
+#include "scene/3d/remote_transform.h"
#include "scene/3d/skeleton.h"
#include "scene/3d/bone_attachment.h"
#include "scene/3d/room_instance.h"
@@ -338,6 +340,7 @@ void register_scene_types() {
OS::get_singleton()->yield(); //may take time to init
ObjectTypeDB::register_type<TextureFrame>();
+ ObjectTypeDB::register_type<ColorFrame>();
ObjectTypeDB::register_type<Patch9Frame>();
ObjectTypeDB::register_type<TabContainer>();
ObjectTypeDB::register_type<Tabs>();
@@ -453,6 +456,7 @@ void register_scene_types() {
ObjectTypeDB::register_type<BakedLightInstance>();
ObjectTypeDB::register_type<BakedLightSampler>();
ObjectTypeDB::register_type<WorldEnvironment>();
+ ObjectTypeDB::register_type<RemoteTransform>();
ObjectTypeDB::register_virtual_type<Joint>();
ObjectTypeDB::register_type<PinJoint>();
diff --git a/servers/visual/rasterizer.cpp b/servers/visual/rasterizer.cpp
index 32f5b80e55..a4b91e17fe 100644
--- a/servers/visual/rasterizer.cpp
+++ b/servers/visual/rasterizer.cpp
@@ -290,9 +290,6 @@ RID Rasterizer::_create_shader(const FixedMaterialShaderKey& p_key) {
//print_line("**VERTEX SHADER GENERATED code: \n"+vcode);
- double tf = (OS::get_singleton()->get_ticks_usec()-t)/1000.0;
-// print_line("generate: "+rtos(tf));
-
shader_set_code(fms.shader,vcode,code,lcode,0,0);
fixed_material_shaders[p_key]=fms;
diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp
index 2779275ea8..9240e3527c 100644
--- a/tools/editor/code_editor.cpp
+++ b/tools/editor/code_editor.cpp
@@ -356,7 +356,7 @@ void FindReplaceBar::_show_search() {
show();
search_text->grab_focus();
- if (text_edit->is_selection_active()) {
+ if (text_edit->is_selection_active() && !selection_only->is_pressed()) {
search_text->set_text(text_edit->get_selection_text());
}
@@ -376,12 +376,16 @@ void FindReplaceBar::popup_search() {
void FindReplaceBar::popup_replace() {
+
if (!replace_hbc->is_visible() || !replace_options_hbc->is_visible()) {
replace_text->clear();
replace_hbc->show();
replace_options_hbc->show();
+
}
+ selection_only->set_pressed( (text_edit->is_selection_active() && text_edit->get_selection_from_line() < text_edit->get_selection_to_line()) );
+
_show_search();
}
@@ -409,6 +413,14 @@ void FindReplaceBar::_search_text_entered(const String& p_text) {
search_next();
}
+void FindReplaceBar::_replace_text_entered(const String& p_text) {
+
+ if (selection_only->is_pressed() && text_edit->is_selection_active()) {
+ _replace_all();
+ _hide_bar();
+ }
+}
+
String FindReplaceBar::get_search_text() const {
return search_text->get_text();
@@ -452,6 +464,7 @@ void FindReplaceBar::_bind_methods() {
ObjectTypeDB::bind_method("_editor_text_changed",&FindReplaceBar::_editor_text_changed);
ObjectTypeDB::bind_method("_search_text_changed",&FindReplaceBar::_search_text_changed);
ObjectTypeDB::bind_method("_search_text_entered",&FindReplaceBar::_search_text_entered);
+ ObjectTypeDB::bind_method("_replace_text_entered",&FindReplaceBar::_replace_text_entered);
ObjectTypeDB::bind_method("_search_current",&FindReplaceBar::search_current);
ObjectTypeDB::bind_method("_search_next",&FindReplaceBar::search_next);
ObjectTypeDB::bind_method("_search_prev",&FindReplaceBar::search_prev);
@@ -497,18 +510,19 @@ FindReplaceBar::FindReplaceBar() {
replace_text = memnew(LineEdit);
replace_hbc->add_child(replace_text);
replace_text->set_custom_minimum_size(Size2(200, 0));
- replace_text->connect("text_entered",this,"_search_text_entered");
+ replace_text->connect("text_entered",this,"_replace_text_entered");
+
- replace = memnew(ToolButton);
+ replace = memnew(Button);
replace_hbc->add_child(replace);
replace->set_text(TTR("Replace"));
- replace->set_focus_mode(FOCUS_NONE);
+ //replace->set_focus_mode(FOCUS_NONE);
replace->connect("pressed",this,"_replace_pressed");
- replace_all = memnew(ToolButton);
+ replace_all = memnew(Button);
replace_hbc->add_child(replace_all);
replace_all->set_text(TTR("Replace All"));
- replace_all->set_focus_mode(FOCUS_NONE);
+ //replace_all->set_focus_mode(FOCUS_NONE);
replace_all->connect("pressed",this,"_replace_all_pressed");
Control *spacer_split = memnew( Control );
@@ -581,8 +595,10 @@ void FindReplaceDialog::popup_search() {
void FindReplaceDialog::popup_replace() {
+
set_title(TTR("Replace"));
bool do_selection=(text_edit->is_selection_active() && text_edit->get_selection_from_line() < text_edit->get_selection_to_line());
+
set_replace_selection_only(do_selection);
if (!do_selection && text_edit->is_selection_active()) {
@@ -1112,8 +1128,10 @@ void CodeTextEditor::_update_font() {
font_overridden = true;
}
}
- if(!font_overridden)
+ if(!font_overridden) {
+
text_editor->add_font_override("font",get_font("source","EditorFonts"));
+ }
}
void CodeTextEditor::_on_settings_change() {
@@ -1152,7 +1170,7 @@ void CodeTextEditor::_notification(int p_what) {
_load_theme_settings();
emit_signal("load_theme_settings");
}
- if (p_what==NOTIFICATION_ENTER_TREE) {
+ if (p_what==NOTIFICATION_THEME_CHANGED) {
_update_font();
}
}
diff --git a/tools/editor/code_editor.h b/tools/editor/code_editor.h
index 2affa31482..6f59dda1ee 100644
--- a/tools/editor/code_editor.h
+++ b/tools/editor/code_editor.h
@@ -73,8 +73,8 @@ class FindReplaceBar : public HBoxContainer {
TextureButton *hide_button;
LineEdit *replace_text;
- ToolButton *replace;
- ToolButton *replace_all;
+ Button *replace;
+ Button *replace_all;
CheckBox *selection_only;
VBoxContainer *text_vbc;
@@ -98,6 +98,7 @@ class FindReplaceBar : public HBoxContainer {
void _search_options_changed(bool p_pressed);
void _search_text_changed(const String& p_text);
void _search_text_entered(const String& p_text);
+ void _replace_text_entered(const String& p_text);
protected:
void _notification(int p_what);
diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp
index 35ec1ebfcc..8fc18b5b39 100644
--- a/tools/editor/editor_data.cpp
+++ b/tools/editor/editor_data.cpp
@@ -877,8 +877,7 @@ bool EditorSelection::is_selected(Node * p_node) const {
return selection.has(p_node);
}
-
-Array EditorSelection::_get_selected_nodes() {
+Array EditorSelection::_get_transformable_selected_nodes() {
Array ret;
@@ -890,6 +889,18 @@ Array EditorSelection::_get_selected_nodes() {
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() {
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("remove_node","node:Node"),&EditorSelection::remove_node);
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") );
}
diff --git a/tools/editor/editor_data.h b/tools/editor/editor_data.h
index a0b716f560..59f9d4e4f3 100644
--- a/tools/editor/editor_data.h
+++ b/tools/editor/editor_data.h
@@ -233,6 +233,8 @@ public:
void _update_nl();
Array _get_selected_nodes();
+ Array _get_transformable_selected_nodes();
+
protected:
static void _bind_methods();
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_import_export.cpp b/tools/editor/editor_import_export.cpp
index 357d139c04..d90a175811 100644
--- a/tools/editor/editor_import_export.cpp
+++ b/tools/editor/editor_import_export.cpp
@@ -1441,7 +1441,7 @@ bool EditorExportPlatformPC::can_export(String *r_error) const {
String err;
bool valid=true;
- if (use64 && (!exists_export_template(debug_binary64)) || !exists_export_template(release_binary64)) {
+ if (use64 && (!exists_export_template(debug_binary64) || !exists_export_template(release_binary64))) {
valid=false;
err="No 64 bits export templates found.\nDownload and install export templates.\n";
}
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 11c51991e1..e88a155d95 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -785,7 +785,7 @@ bool EditorNode::_find_and_save_resource(RES res,Map<RES,bool>& processed,int32_
if (changed || subchanged) {
//save
print_line("Also saving modified external resource: "+res->get_path());
- Error err = ResourceSaver::save(res->get_path(),res,flags);
+ ResourceSaver::save(res->get_path(),res,flags);
}
processed[res]=false; //because it's a file
@@ -4139,6 +4139,11 @@ void EditorNode::register_editor_types() {
//ObjectTypeDB::register_type<EditorImportExport>();
ObjectTypeDB::register_type<EditorSettings>();
ObjectTypeDB::register_type<EditorSpatialGizmo>();
+ ObjectTypeDB::register_type<EditorResourcePreview>();
+ ObjectTypeDB::register_type<EditorResourcePreviewGenerator>();
+ ObjectTypeDB::register_type<EditorFileSystem>();
+ ObjectTypeDB::register_type<EditorFileSystemDirectory>();
+
//ObjectTypeDB::register_type<EditorImporter>();
@@ -5414,9 +5419,9 @@ EditorNode::EditorNode() {
theme_base->add_child(gui_base);
gui_base->set_area_as_parent_rect();
- theme_base->set_theme( create_default_theme() );
- theme = create_editor_theme();
- gui_base->set_theme(theme);
+ Ref<Theme> theme = create_editor_theme();
+ theme_base->set_theme( theme );
+ gui_base->set_theme(create_custom_theme());
resource_preview = memnew( EditorResourcePreview );
add_child(resource_preview);
@@ -6679,45 +6684,54 @@ EditorNode::~EditorNode() {
void EditorPluginList::make_visible(bool p_visible) {
- if (!plugins_list.empty()) {
- for (int i = 0; i < plugins_list.size(); i++) {
- plugins_list[i]->make_visible(p_visible);
- }
+
+ for (int i = 0; i < plugins_list.size(); i++) {
+ plugins_list[i]->make_visible(p_visible);
}
+
}
void EditorPluginList::edit(Object* p_object) {
- if (!plugins_list.empty()) {
- for (int i = 0; i < plugins_list.size(); i++) {
- plugins_list[i]->edit(p_object);
- }
+
+ for (int i = 0; i < plugins_list.size(); i++) {
+ plugins_list[i]->edit(p_object);
}
+
}
-bool EditorPluginList::forward_input_event(const InputEvent& p_event) {
+bool EditorPluginList::forward_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) {
+
bool discard = false;
- if (!plugins_list.empty()) {
- for (int i = 0; i < plugins_list.size(); i++) {
- if (plugins_list[i]->forward_input_event(p_event)) {
- discard = true;
- }
+
+ for (int i = 0; i < plugins_list.size(); i++) {
+ if (plugins_list[i]->forward_canvas_input_event(p_canvas_xform,p_event)) {
+ discard = true;
}
}
+
return discard;
}
bool EditorPluginList::forward_spatial_input_event(Camera* p_camera, const InputEvent& p_event) {
bool discard = false;
- if (!plugins_list.empty()) {
- for (int i = 0; i < plugins_list.size(); i++) {
- if (plugins_list[i]->forward_spatial_input_event(p_camera, p_event)) {
- discard = true;
- }
+
+ for (int i = 0; i < plugins_list.size(); i++) {
+ if (plugins_list[i]->forward_spatial_input_event(p_camera, p_event)) {
+ discard = true;
}
}
+
return discard;
}
+void EditorPluginList::forward_draw_over_canvas(const Matrix32& p_canvas_xform,Control* p_canvas) {
+
+ for (int i = 0; i < plugins_list.size(); i++) {
+ plugins_list[i]->forward_draw_over_canvas(p_canvas_xform,p_canvas);
+ }
+
+}
+
bool EditorPluginList::empty() {
return plugins_list.empty();
}
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index e6119cf577..147a0fd6ed 100644
--- a/tools/editor/editor_node.h
+++ b/tools/editor/editor_node.h
@@ -780,8 +780,9 @@ public:
void make_visible(bool p_visible);
void edit(Object *p_object);
- bool forward_input_event(const InputEvent& p_event);
+ bool forward_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event);
bool forward_spatial_input_event(Camera* p_camera, const InputEvent& p_event);
+ void forward_draw_over_canvas(const Matrix32& p_canvas_xform,Control* p_canvas);
void clear();
bool empty();
diff --git a/tools/editor/editor_plugin.cpp b/tools/editor/editor_plugin.cpp
index 5e671549ef..55f0e52c88 100644
--- a/tools/editor/editor_plugin.cpp
+++ b/tools/editor/editor_plugin.cpp
@@ -32,6 +32,7 @@
#include "plugins/spatial_editor_plugin.h"
#include "tools/editor/editor_node.h"
#include "tools/editor/editor_settings.h"
+#include "editor_resource_preview.h"
void EditorPlugin::add_custom_type(const String& p_type, const String& p_base,const Ref<Script>& p_script, const Ref<Texture>& p_icon) {
@@ -130,13 +131,25 @@ Ref<SpatialEditorGizmo> EditorPlugin::create_spatial_gizmo(Spatial* p_spatial) {
return Ref<SpatialEditorGizmo>();
}
-bool EditorPlugin::forward_input_event(const InputEvent& p_event) {
+bool EditorPlugin::forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) {
- if (get_script_instance() && get_script_instance()->has_method("forward_input_event")) {
- return get_script_instance()->call("forward_input_event",p_event);
+ if (get_script_instance() && get_script_instance()->has_method("forward_canvas_input_event")) {
+ return get_script_instance()->call("forward_canvas_input_event",p_canvas_xform,p_event);
}
return false;
}
+
+void EditorPlugin::forward_draw_over_canvas(const Matrix32& p_canvas_xform,Control *p_canvas) {
+
+ if (get_script_instance() && get_script_instance()->has_method("forward_draw_over_canvas")) {
+ get_script_instance()->call("forward_draw_over_canvas",p_canvas_xform,p_canvas);
+ }
+}
+
+void EditorPlugin::update_canvas() {
+ CanvasItemEditor::get_singleton()->get_viewport_control()->update();
+}
+
bool EditorPlugin::forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event) {
if (get_script_instance() && get_script_instance()->has_method("forward_spatial_input_event")) {
@@ -272,6 +285,10 @@ EditorSettings *EditorPlugin::get_editor_settings() {
return EditorSettings::get_singleton();
}
+EditorResourcePreview *EditorPlugin::get_resource_previewer() {
+ return EditorResourcePreview::get_singleton();
+}
+
void EditorPlugin::add_import_plugin(const Ref<EditorImportPlugin>& p_editor_import) {
EditorNode::get_singleton()->add_editor_import_plugin(p_editor_import);
@@ -298,6 +315,14 @@ Control *EditorPlugin::get_base_control() {
return EditorNode::get_singleton()->get_gui_base();
}
+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() {
@@ -315,6 +340,11 @@ void EditorPlugin::_bind_methods() {
ObjectTypeDB::bind_method(_MD("add_export_plugin","plugin:EditorExportPlugin"),&EditorPlugin::add_export_plugin);
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);
ObjectTypeDB::bind_method(_MD("get_base_control:Control"),&EditorPlugin::get_base_control);
ObjectTypeDB::bind_method(_MD("get_undo_redo:UndoRedo"),&EditorPlugin::_get_undo_redo);
@@ -322,7 +352,8 @@ void EditorPlugin::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_editor_settings:EditorSettings"),&EditorPlugin::get_editor_settings);
ObjectTypeDB::bind_method(_MD("queue_save_layout"),&EditorPlugin::queue_save_layout);
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"forward_input_event",PropertyInfo(Variant::INPUT_EVENT,"event")));
+ ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"forward_canvas_input_event",PropertyInfo(Variant::MATRIX32,"canvas_xform"),PropertyInfo(Variant::INPUT_EVENT,"event")));
+ ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("forward_draw_over_canvas",PropertyInfo(Variant::MATRIX32,"canvas_xform"),PropertyInfo(Variant::OBJECT,"canvas:Control")));
ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"forward_spatial_input_event",PropertyInfo(Variant::OBJECT,"camera",PROPERTY_HINT_RESOURCE_TYPE,"Camera"),PropertyInfo(Variant::INPUT_EVENT,"event")));
MethodInfo gizmo = MethodInfo(Variant::OBJECT,"create_spatial_gizmo",PropertyInfo(Variant::OBJECT,"for_spatial:Spatial"));
gizmo.return_val.hint=PROPERTY_HINT_RESOURCE_TYPE;
diff --git a/tools/editor/editor_plugin.h b/tools/editor/editor_plugin.h
index 9a9c32357d..5b944cc27a 100644
--- a/tools/editor/editor_plugin.h
+++ b/tools/editor/editor_plugin.h
@@ -34,6 +34,7 @@
#include "scene/resources/texture.h"
#include "undo_redo.h"
#include "io/config_file.h"
+
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
@@ -47,6 +48,8 @@ class EditorSettings;
class SpatialEditorGizmo;
class EditorImportPlugin;
class EditorExportPlugin;
+class EditorResourcePreview;
+class EditorFileSystem;
class EditorPlugin : public Node {
@@ -99,7 +102,8 @@ public:
void remove_control_from_bottom_panel(Control *p_control);
virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial* p_spatial);
- virtual bool forward_input_event(const InputEvent& p_event);
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform, const InputEvent& p_event);
+ virtual void forward_draw_over_canvas(const Matrix32& p_canvas_xform,Control *p_canvas);
virtual bool forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event);
virtual String get_name() const;
virtual bool has_main_screen() const;
@@ -116,7 +120,11 @@ public:
virtual bool get_remove_list(List<Node*> *p_list);
virtual void set_window_layout(Ref<ConfigFile> p_layout);
virtual void get_window_layout(Ref<ConfigFile> p_layout);
- virtual void edited_scene_changed(){}; // if changes are pending in editor, apply them
+ virtual void edited_scene_changed(){} // if changes are pending in editor, apply them
+
+ void update_canvas();
+
+ virtual void inspect_object(Object *p_obj,const String& p_for_property=String());
void queue_save_layout() const;
@@ -131,6 +139,8 @@ public:
EditorSelection* get_selection();
//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/editor_resource_preview.cpp b/tools/editor/editor_resource_preview.cpp
index a02fe2a531..6afc3e2a34 100644
--- a/tools/editor/editor_resource_preview.cpp
+++ b/tools/editor/editor_resource_preview.cpp
@@ -35,14 +35,46 @@
#include "editor_scale.h"
#include "message_queue.h"
+bool EditorResourcePreviewGenerator::handles(const String& p_type) const {
+
+ if (get_script_instance() && get_script_instance()->has_method("handles")) {
+ return get_script_instance()->call("handles",p_type);
+ }
+ ERR_EXPLAIN("EditorResourcePreviewGenerator::handles needs to be overriden");
+ ERR_FAIL_V(false);
+}
+Ref<Texture> EditorResourcePreviewGenerator::generate(const RES& p_from){
+
+ if (get_script_instance() && get_script_instance()->has_method("generate")) {
+ return get_script_instance()->call("generate",p_from);
+ }
+ ERR_EXPLAIN("EditorResourcePreviewGenerator::generate needs to be overriden");
+ ERR_FAIL_V(Ref<Texture>());
+
+}
+
+
Ref<Texture> EditorResourcePreviewGenerator::generate_from_path(const String& p_path) {
+ if (get_script_instance() && get_script_instance()->has_method("generate_from_path")) {
+ return get_script_instance()->call("generate_from_path",p_path);
+ }
+
RES res = ResourceLoader::load(p_path);
if (!res.is_valid())
return res;
return generate(res);
}
+
+void EditorResourcePreviewGenerator::_bind_methods() {
+
+ ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"handles",PropertyInfo(Variant::STRING,"type")));
+ ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::OBJECT,"generate:Texture",PropertyInfo(Variant::OBJECT,"from",PROPERTY_HINT_RESOURCE_TYPE,"Resource")));
+ ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::OBJECT,"generate_from_path:Texture",PropertyInfo(Variant::STRING,"path",PROPERTY_HINT_FILE)));
+
+}
+
EditorResourcePreviewGenerator::EditorResourcePreviewGenerator() {
@@ -330,6 +362,11 @@ void EditorResourcePreview::add_preview_generator(const Ref<EditorResourcePrevie
preview_generators.push_back(p_generator);
}
+void EditorResourcePreview::remove_preview_generator(const Ref<EditorResourcePreviewGenerator>& p_generator) {
+
+ preview_generators.erase(p_generator);
+}
+
EditorResourcePreview* EditorResourcePreview::get_singleton() {
return singleton;
@@ -338,6 +375,11 @@ EditorResourcePreview* EditorResourcePreview::get_singleton() {
void EditorResourcePreview::_bind_methods() {
ObjectTypeDB::bind_method("_preview_ready",&EditorResourcePreview::_preview_ready);
+
+ ObjectTypeDB::bind_method(_MD("queue_resource_preview","path","receiver","receiver_func","userdata:Variant"),&EditorResourcePreview::queue_resource_preview);
+ ObjectTypeDB::bind_method(_MD("queue_edited_resource_preview","resource:Resource","receiver","receiver_func","userdata:Variant"),&EditorResourcePreview::queue_edited_resource_preview);
+ ObjectTypeDB::bind_method(_MD("add_preview_generator","generator:EditorResourcePreviewGenerator"),&EditorResourcePreview::add_preview_generator);
+ ObjectTypeDB::bind_method(_MD("remove_preview_generator","generator:EditorResourcePreviewGenerator"),&EditorResourcePreview::remove_preview_generator);
ObjectTypeDB::bind_method(_MD("check_for_invalidation","path"),&EditorResourcePreview::check_for_invalidation);
diff --git a/tools/editor/editor_resource_preview.h b/tools/editor/editor_resource_preview.h
index 51a00965eb..2756360130 100644
--- a/tools/editor/editor_resource_preview.h
+++ b/tools/editor/editor_resource_preview.h
@@ -57,10 +57,13 @@ class EditorResourcePreviewGenerator : public Reference {
OBJ_TYPE(EditorResourcePreviewGenerator,Reference );
+protected:
+
+ static void _bind_methods();
public:
- virtual bool handles(const String& p_type) const=0;
- virtual Ref<Texture> generate(const RES& p_from)=0;
+ virtual bool handles(const String& p_type) const;
+ virtual Ref<Texture> generate(const RES& p_from);
virtual Ref<Texture> generate_from_path(const String& p_path);
EditorResourcePreviewGenerator();
@@ -121,6 +124,7 @@ public:
void queue_edited_resource_preview(const Ref<Resource>& p_path, Object* p_receiver, const StringName& p_receiver_func, const Variant& p_userdata);
void add_preview_generator(const Ref<EditorResourcePreviewGenerator>& p_generator);
+ void remove_preview_generator(const Ref<EditorResourcePreviewGenerator>& p_generator);
void check_for_invalidation(const String& p_path);
EditorResourcePreview();
diff --git a/tools/editor/editor_themes.cpp b/tools/editor/editor_themes.cpp
index 7130044490..80ba4c46e0 100644
--- a/tools/editor/editor_themes.cpp
+++ b/tools/editor/editor_themes.cpp
@@ -33,7 +33,7 @@
#include "editor_settings.h"
#include "core/io/resource_loader.h"
-Ref<Theme> create_default_theme()
+Ref<Theme> create_editor_theme()
{
Ref<Theme> theme = Ref<Theme>( memnew( Theme ) );
@@ -57,23 +57,22 @@ Ref<Theme> create_default_theme()
return theme;
}
-Ref<Theme> create_editor_theme()
+Ref<Theme> create_custom_theme()
{
- Ref<Theme> theme = NULL;
+ Ref<Theme> theme;
String custom_theme = EditorSettings::get_singleton()->get("global/custom_theme");
if (custom_theme!="") {
theme = ResourceLoader::load(custom_theme);
}
- if (theme.is_null() || !theme.is_valid()) {
- theme = create_default_theme();
- }
-
String global_font = EditorSettings::get_singleton()->get("global/custom_font");
if (global_font!="") {
Ref<Font> fnt = ResourceLoader::load(global_font);
if (fnt.is_valid()) {
+ if (!theme.is_valid()) {
+ theme.instance();
+ }
theme->set_default_theme_font(fnt);
}
}
diff --git a/tools/editor/editor_themes.h b/tools/editor/editor_themes.h
index dbff8b3079..db49801600 100644
--- a/tools/editor/editor_themes.h
+++ b/tools/editor/editor_themes.h
@@ -31,8 +31,8 @@
#include "scene/resources/theme.h"
-Ref<Theme> create_default_theme();
-
Ref<Theme> create_editor_theme();
+Ref<Theme> create_custom_theme();
+
#endif
diff --git a/tools/editor/icons/2x/icon_remote_transform.png b/tools/editor/icons/2x/icon_remote_transform.png
new file mode 100644
index 0000000000..9ee66bc70c
--- /dev/null
+++ b/tools/editor/icons/2x/icon_remote_transform.png
Binary files differ
diff --git a/tools/editor/icons/icon_color_frame.png b/tools/editor/icons/icon_color_frame.png
new file mode 100644
index 0000000000..a82eefc10a
--- /dev/null
+++ b/tools/editor/icons/icon_color_frame.png
Binary files differ
diff --git a/tools/editor/icons/icon_remote_transform.png b/tools/editor/icons/icon_remote_transform.png
new file mode 100644
index 0000000000..deff925b53
--- /dev/null
+++ b/tools/editor/icons/icon_remote_transform.png
Binary files differ
diff --git a/tools/editor/icons/source/icon_remote_transform.svg b/tools/editor/icons/source/icon_remote_transform.svg
new file mode 100644
index 0000000000..fbbfacf629
--- /dev/null
+++ b/tools/editor/icons/source/icon_remote_transform.svg
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="16"
+ viewBox="0 0 16 16"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_remote_transform.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="16"
+ inkscape:cx="7.0691739"
+ inkscape:cy="9.3738931"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:snap-bbox-midpoints="true"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1680"
+ inkscape:window-height="1050"
+ inkscape:window-x="1366"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="true"
+ inkscape:snap-intersection-paths="true"
+ inkscape:object-nodes="true"
+ inkscape:snap-smooth-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ empspacing="4" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4155"
+ sodipodi:type="arc"
+ sodipodi:cx="744.13245"
+ sodipodi:cy="734.23291"
+ sodipodi:rx="4"
+ sodipodi:ry="4"
+ sodipodi:start="0"
+ sodipodi:end="3.1415927"
+ d="m 748.13245,734.23291 a 4,4 0 0 1 -2,3.4641 4,4 0 0 1 -4,0 4,4 0 0 1 -2,-3.4641 l 4,0 z"
+ inkscape:transform-center-y="0.58575321"
+ transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,0,0)"
+ inkscape:transform-center-x="0.58575732" />
+ <circle
+ style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4159"
+ cx="7"
+ cy="1045.3622"
+ r="1" />
+ <path
+ style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 13.242641,1039.1196 a 6.0000172,6.0000172 0 0 0 -8.4852817,0 l 0.7071068,0.7071 a 5.0000172,5.0000172 0 0 1 7.0710679,0 5.0000172,5.0000172 0 0 1 0,7.071 l 0.707107,0.7071 a 6.0000172,6.0000172 0 0 0 0,-8.4852 z"
+ id="circle4163"
+ inkscape:connector-curvature="0"
+ inkscape:transform-center-y="-0.87867618"
+ inkscape:transform-center-x="-0.8786559" />
+ <path
+ style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 11.828427,1040.5338 a 4.0000172,4.0000172 0 0 0 -5.6568541,0 l 0.7071068,0.7071 a 3.0000174,3.0000174 0 0 1 4.2426403,0 3.0000174,3.0000174 0 0 1 0,4.2426 l 0.707107,0.7071 a 4.0000172,4.0000172 0 0 0 0,-5.6568 z"
+ id="circle4168"
+ inkscape:connector-curvature="0"
+ inkscape:transform-center-y="-0.58578284"
+ inkscape:transform-center-x="-0.58576926" />
+ <path
+ style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 10.414214,1041.948 a 2,2 0 0 0 -2.8284276,0 l 0.7071068,0.7071 a 1.0000174,1.0000174 0 0 1 1.4142136,0 1.0000174,1.0000174 0 0 1 0,1.4142 l 0.7071072,0.7071 a 2,2 0 0 0 0,-2.8284 z"
+ id="circle4172"
+ inkscape:connector-curvature="0"
+ inkscape:transform-center-y="-0.29289334"
+ inkscape:transform-center-x="-0.29288664" />
+ <path
+ style="fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 1,1051.3622 4,-5 1,0 0,5 z"
+ id="path4181"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ </g>
+</svg>
diff --git a/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp b/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp
index dca7d011ff..757d2ed5d4 100644
--- a/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp
@@ -147,7 +147,7 @@ public:
dst = dst.plus_file(bitmasks[i].get_file().basename() + ".pbm");
- Error err = plugin->import(dst, imd);
+ plugin->import(dst, imd);
}
hide();
diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.cpp b/tools/editor/io_plugins/editor_sample_import_plugin.cpp
index ac0795f522..7dc74e58dd 100644
--- a/tools/editor/io_plugins/editor_sample_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_sample_import_plugin.cpp
@@ -298,7 +298,7 @@ public:
dst = dst.plus_file(samples[i].get_file().basename()+".smp");
- Error err = plugin->import(dst,imd);
+ plugin->import(dst,imd);
}
hide();
diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
index fa62283e37..190b56faba 100644
--- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
@@ -1447,6 +1447,7 @@ void EditorSceneImportPlugin::_find_resources(const Variant& p_var, Map<Ref<Imag
}
} break;
+ default: {}
}
@@ -2325,7 +2326,7 @@ void EditorSceneImportPlugin::_filter_tracks(Node *scene, const String& p_text)
if (!scene->has_node(String("AnimationPlayer")))
return;
- Node* n = scene->get_node(String("AnimationPlayer"));
+ Node* n = scene->get_node(String("AnimationPlayer"));
ERR_FAIL_COND(!n);
AnimationPlayer *anim = n->cast_to<AnimationPlayer>();
ERR_FAIL_COND(!anim);
@@ -2443,7 +2444,7 @@ void EditorSceneImportPlugin::_optimize_animations(Node *scene, float p_max_lin_
if (!scene->has_node(String("AnimationPlayer")))
return;
- Node* n = scene->get_node(String("AnimationPlayer"));
+ Node* n = scene->get_node(String("AnimationPlayer"));
ERR_FAIL_COND(!n);
AnimationPlayer *anim = n->cast_to<AnimationPlayer>();
ERR_FAIL_COND(!anim);
@@ -2842,7 +2843,7 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c
}
}
- Error err = EditorTextureImportPlugin::get_singleton()->import(target_path,imd);
+ EditorTextureImportPlugin::get_singleton()->import(target_path,imd);
}
}
diff --git a/tools/editor/plugins/baked_light_baker.cpp b/tools/editor/plugins/baked_light_baker.cpp
index a2e94e8855..f43bec1cd3 100644
--- a/tools/editor/plugins/baked_light_baker.cpp
+++ b/tools/editor/plugins/baked_light_baker.cpp
@@ -1177,8 +1177,6 @@ float BakedLightBaker::_throw_ray(ThreadStack& thread_stack,bool p_bake_direct,c
diffuse_at_point.g=res_light.g*diffuse_at_point.g;
diffuse_at_point.b=res_light.b*diffuse_at_point.b;
- float ret=1e6;
-
if (p_bounces>0) {
@@ -1220,7 +1218,7 @@ float BakedLightBaker::_throw_ray(ThreadStack& thread_stack,bool p_bake_direct,c
#endif
- ret=_throw_ray(thread_stack,p_bake_direct,r_point,r_point+rn*p_rest,p_rest,diffuse_at_point,p_att_curve,p_att_pos,p_att_curve_len,p_bounces-1);
+ _throw_ray(thread_stack,p_bake_direct,r_point,r_point+rn*p_rest,p_rest,diffuse_at_point,p_att_curve,p_att_pos,p_att_curve_len,p_bounces-1);
}
if (use_specular && (specular_at_point.r>CMP_EPSILON || specular_at_point.g>CMP_EPSILON || specular_at_point.b>CMP_EPSILON)) {
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp
index 3468f42a6c..b0e002ba44 100644
--- a/tools/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp
@@ -1058,7 +1058,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
EditorPluginList *over_plugin_list = en->get_editor_plugins_over();
if (!over_plugin_list->empty()) {
- bool discard = over_plugin_list->forward_input_event(p_event);
+ bool discard = over_plugin_list->forward_input_event(transform,p_event);
if (discard) {
accept_event();
return;
@@ -2090,6 +2090,18 @@ void CanvasItemEditor::_viewport_draw() {
}
+ {
+
+ EditorNode *en = editor;
+ EditorPluginList *over_plugin_list = en->get_editor_plugins_over();
+
+ if (!over_plugin_list->empty()) {
+
+ over_plugin_list->forward_draw_over_canvas(transform,viewport);
+
+ }
+ }
+
if (skeleton_show_bones) {
int bone_width = EditorSettings::get_singleton()->get("2d_editor/bone_width");
Color bone_color1 = EditorSettings::get_singleton()->get("2d_editor/bone_color1");
diff --git a/tools/editor/plugins/collision_polygon_2d_editor_plugin.h b/tools/editor/plugins/collision_polygon_2d_editor_plugin.h
index 982ba35fe8..431d3651c1 100644
--- a/tools/editor/plugins/collision_polygon_2d_editor_plugin.h
+++ b/tools/editor/plugins/collision_polygon_2d_editor_plugin.h
@@ -95,7 +95,7 @@ class CollisionPolygon2DEditorPlugin : public EditorPlugin {
public:
- virtual bool forward_input_event(const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
virtual String get_name() const { return "CollisionPolygon2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/collision_shape_2d_editor_plugin.h b/tools/editor/plugins/collision_shape_2d_editor_plugin.h
index 1ee81eda43..a8930dc0f2 100644
--- a/tools/editor/plugins/collision_shape_2d_editor_plugin.h
+++ b/tools/editor/plugins/collision_shape_2d_editor_plugin.h
@@ -86,7 +86,7 @@ class CollisionShape2DEditorPlugin : public EditorPlugin {
EditorNode* editor;
public:
- virtual bool forward_input_event(const InputEvent& p_event) { return collision_shape_2d_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_shape_2d_editor->forward_input_event(p_event); }
virtual String get_name() const { return "CollisionShape2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.h b/tools/editor/plugins/light_occluder_2d_editor_plugin.h
index b570fff506..0176eb87dd 100644
--- a/tools/editor/plugins/light_occluder_2d_editor_plugin.h
+++ b/tools/editor/plugins/light_occluder_2d_editor_plugin.h
@@ -99,7 +99,7 @@ class LightOccluder2DEditorPlugin : public EditorPlugin {
public:
- virtual bool forward_input_event(const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
virtual String get_name() const { return "LightOccluder2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/navigation_polygon_editor_plugin.h b/tools/editor/plugins/navigation_polygon_editor_plugin.h
index 503b4c2662..defdebbec2 100644
--- a/tools/editor/plugins/navigation_polygon_editor_plugin.h
+++ b/tools/editor/plugins/navigation_polygon_editor_plugin.h
@@ -101,7 +101,7 @@ class NavigationPolygonEditorPlugin : public EditorPlugin {
public:
- virtual bool forward_input_event(const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
virtual String get_name() const { return "NavigationPolygonInstance"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/path_2d_editor_plugin.h b/tools/editor/plugins/path_2d_editor_plugin.h
index 973c17464e..acbc481e09 100644
--- a/tools/editor/plugins/path_2d_editor_plugin.h
+++ b/tools/editor/plugins/path_2d_editor_plugin.h
@@ -108,7 +108,7 @@ class Path2DEditorPlugin : public EditorPlugin {
public:
- virtual bool forward_input_event(const InputEvent& p_event) { return path2d_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return path2d_editor->forward_input_event(p_event); }
virtual String get_name() const { return "Path2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.h b/tools/editor/plugins/polygon_2d_editor_plugin.h
index d8b951ec44..33bae94340 100644
--- a/tools/editor/plugins/polygon_2d_editor_plugin.h
+++ b/tools/editor/plugins/polygon_2d_editor_plugin.h
@@ -151,7 +151,7 @@ class Polygon2DEditorPlugin : public EditorPlugin {
public:
- virtual bool forward_input_event(const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
virtual String get_name() const { return "Polygon2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 1f931fb492..77b4106473 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -480,6 +480,33 @@ void ScriptEditor::_close_docs_tab() {
}
+void ScriptEditor::_close_all_tabs() {
+
+ int child_count = tab_container->get_child_count();
+ for (int i = child_count-1; i>=0; i--) {
+
+ tab_container->set_current_tab(i);
+ ScriptEditorBase *se = tab_container->get_child(i)->cast_to<ScriptEditorBase>();
+
+ if (se) {
+
+ // Maybe there are unsaved changes
+ if (se->is_unsaved()) {
+ _ask_close_current_unsaved_tab(se);
+ continue;
+ }
+
+ }
+
+ _close_current_tab();
+ }
+
+}
+
+void ScriptEditor::_ask_close_current_unsaved_tab(ScriptEditorBase *current) {
+ erase_tab_confirm->set_text("Close and save changes?\n\""+current->get_name()+"\"");
+ erase_tab_confirm->popup_centered_minsize();
+}
void ScriptEditor::_resave_scripts(const String& p_str) {
@@ -831,8 +858,7 @@ void ScriptEditor::_menu_option(int p_option) {
case FILE_CLOSE: {
if (current->is_unsaved()) {
- erase_tab_confirm->set_text("Close and save changes?\n\""+current->get_name()+"\"");
- erase_tab_confirm->popup_centered_minsize();
+ _ask_close_current_unsaved_tab(current);
} else {
_close_current_tab();
}
@@ -840,6 +866,9 @@ void ScriptEditor::_menu_option(int p_option) {
case CLOSE_DOCS: {
_close_docs_tab();
} break;
+ case CLOSE_ALL: {
+ _close_all_tabs();
+ } break;
case DEBUG_NEXT: {
if (debugger)
@@ -913,6 +942,9 @@ void ScriptEditor::_menu_option(int p_option) {
case CLOSE_DOCS: {
_close_docs_tab();
} break;
+ case CLOSE_ALL: {
+ _close_all_tabs();
+ } break;
}
@@ -1481,6 +1513,7 @@ void ScriptEditor::edit(const Ref<Script>& p_script, bool p_grab_focus) {
}
ERR_FAIL_COND(!se);
tab_container->add_child(se);
+
se->set_edited_script(p_script);
se->set_tooltip_request_func("_get_debug_tooltip",this);
if (se->get_edit_menu()) {
@@ -1977,6 +2010,7 @@ void ScriptEditor::_bind_methods() {
ObjectTypeDB::bind_method("_menu_option",&ScriptEditor::_menu_option);
ObjectTypeDB::bind_method("_close_current_tab",&ScriptEditor::_close_current_tab);
ObjectTypeDB::bind_method("_close_docs_tab", &ScriptEditor::_close_docs_tab);
+ ObjectTypeDB::bind_method("_close_all_tabs", &ScriptEditor::_close_all_tabs);
ObjectTypeDB::bind_method("_editor_play",&ScriptEditor::_editor_play);
ObjectTypeDB::bind_method("_editor_pause",&ScriptEditor::_editor_pause);
ObjectTypeDB::bind_method("_editor_stop",&ScriptEditor::_editor_stop);
@@ -2057,8 +2091,8 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/reload_script_soft", TTR("Soft Reload Script"), KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_R), FILE_TOOL_RELOAD_SOFT);
file_menu->get_popup()->add_separator();
- file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/history_previous", TTR("History Prev"), KEY_MASK_CTRL|KEY_MASK_ALT|KEY_LEFT), WINDOW_PREV);
- file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/history_next", TTR("History Next"), KEY_MASK_CTRL|KEY_MASK_ALT|KEY_RIGHT), WINDOW_NEXT);
+ file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/history_previous", TTR("History Prev"), KEY_MASK_ALT|KEY_LEFT), WINDOW_PREV);
+ file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/history_next", TTR("History Next"), KEY_MASK_ALT|KEY_RIGHT), WINDOW_NEXT);
file_menu->get_popup()->add_separator();
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/import_theme", TTR("Import Theme")), FILE_IMPORT_THEME);
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/reload_theme", TTR("Reload Theme")), FILE_RELOAD_THEME);
@@ -2067,6 +2101,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
file_menu->get_popup()->add_separator();
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_docs", TTR("Close Docs")), CLOSE_DOCS);
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_file", TTR("Close"), KEY_MASK_CMD | KEY_W), FILE_CLOSE);
+ file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_all", TTR("Close All")), CLOSE_ALL);
file_menu->get_popup()->connect("item_pressed", this,"_menu_option");
diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h
index 1a23ffed72..907240a352 100644
--- a/tools/editor/plugins/script_editor_plugin.h
+++ b/tools/editor/plugins/script_editor_plugin.h
@@ -133,6 +133,7 @@ class ScriptEditor : public VBoxContainer {
FILE_SAVE_THEME_AS,
FILE_CLOSE,
CLOSE_DOCS,
+ CLOSE_ALL,
FILE_TOOL_RELOAD,
FILE_TOOL_RELOAD_SOFT,
DEBUG_NEXT,
@@ -221,6 +222,9 @@ class ScriptEditor : public VBoxContainer {
void _close_current_tab();
void _close_docs_tab();
+ void _close_all_tabs();
+
+ void _ask_close_current_unsaved_tab(ScriptEditorBase *current);
bool grab_focus_block;
diff --git a/tools/editor/plugins/script_text_editor.cpp b/tools/editor/plugins/script_text_editor.cpp
index 57cf8cbea3..68b1042565 100644
--- a/tools/editor/plugins/script_text_editor.cpp
+++ b/tools/editor/plugins/script_text_editor.cpp
@@ -30,6 +30,7 @@
#include "tools/editor/editor_settings.h"
#include "os/keyboard.h"
#include "tools/editor/script_editor_debugger.h"
+#include "tools/editor/editor_node.h"
Vector<String> ScriptTextEditor::get_functions() {
@@ -920,6 +921,10 @@ void ScriptTextEditor::_bind_methods() {
ObjectTypeDB::bind_method("_edit_option",&ScriptTextEditor::_edit_option);
ObjectTypeDB::bind_method("_goto_line",&ScriptTextEditor::_goto_line);
+ ObjectTypeDB::bind_method("get_drag_data_fw",&ScriptTextEditor::get_drag_data_fw);
+ ObjectTypeDB::bind_method("can_drop_data_fw",&ScriptTextEditor::can_drop_data_fw);
+ ObjectTypeDB::bind_method("drop_data_fw",&ScriptTextEditor::drop_data_fw);
+
ADD_SIGNAL(MethodInfo("name_changed"));
ADD_SIGNAL(MethodInfo("request_help_search",PropertyInfo(Variant::STRING,"topic")));
}
@@ -957,6 +962,144 @@ void ScriptTextEditor::set_debugger_active(bool p_active) {
}
+
+Variant ScriptTextEditor::get_drag_data_fw(const Point2& p_point,Control* p_from) {
+
+ return Variant();
+}
+
+bool ScriptTextEditor::can_drop_data_fw(const Point2& p_point,const Variant& p_data,Control* p_from) const{
+
+ Dictionary d = p_data;
+ if (d.has("type") &&
+ (
+
+ String(d["type"])=="resource" ||
+ String(d["type"])=="files" ||
+ String(d["type"])=="nodes"
+ ) ) {
+
+
+ return true;
+ }
+
+
+ return false;
+
+}
+
+#ifdef TOOLS_ENABLED
+
+static Node* _find_script_node(Node* p_edited_scene,Node* p_current_node,const Ref<Script> &script) {
+
+ if (p_edited_scene!=p_current_node && p_current_node->get_owner()!=p_edited_scene)
+ return NULL;
+
+ Ref<Script> scr = p_current_node->get_script();
+
+ if (scr.is_valid() && scr==script)
+ return p_current_node;
+
+ for(int i=0;i<p_current_node->get_child_count();i++) {
+ Node *n = _find_script_node(p_edited_scene,p_current_node->get_child(i),script);
+ if (n)
+ return n;
+ }
+
+ return NULL;
+}
+
+#else
+
+static Node* _find_script_node(Node* p_edited_scene,Node* p_current_node,const Ref<Script> &script) {
+
+ return NULL;
+}
+#endif
+
+
+
+
+void ScriptTextEditor::drop_data_fw(const Point2& p_point,const Variant& p_data,Control* p_from){
+
+ Dictionary d = p_data;
+
+ if (d.has("type") && String(d["type"])=="resource") {
+
+ Ref<Resource> res = d["resource"];
+ if (!res.is_valid()) {
+ return;
+ }
+
+ if (res->get_path().is_resource_file()) {
+ EditorNode::get_singleton()->show_warning("Only resources from filesystem can be dropped.");
+ return;
+ }
+
+ code_editor->get_text_edit()->insert_text_at_cursor(res->get_path());
+
+ }
+
+ if (d.has("type") && String(d["type"])=="files") {
+
+
+ Array files = d["files"];
+
+ String text_to_drop;
+ for(int i=0;i<files.size();i++) {
+
+ if (i>0)
+ text_to_drop+=",";
+ text_to_drop+="\""+String(files[i]).c_escape()+"\"";
+
+ }
+
+ code_editor->get_text_edit()->insert_text_at_cursor(text_to_drop);
+
+ }
+
+ if (d.has("type") && String(d["type"])=="nodes") {
+
+ Node* sn = _find_script_node(get_tree()->get_edited_scene_root(),get_tree()->get_edited_scene_root(),script);
+
+
+ if (!sn) {
+ EditorNode::get_singleton()->show_warning("Can't drop nodes because script '"+get_name()+"' is not used in this scene.");
+ return;
+ }
+
+
+ Array nodes = d["nodes"];
+ String text_to_drop;
+ for(int i=0;i<nodes.size();i++) {
+
+ if (i>0)
+ text_to_drop+=",";
+
+ NodePath np = nodes[i];
+ Node *node = get_node(np);
+ if (!node) {
+ continue;
+ }
+
+
+
+ String path = sn->get_path_to(node);
+ text_to_drop+="\""+path.c_escape()+"\"";
+
+
+ }
+
+ code_editor->get_text_edit()->insert_text_at_cursor(text_to_drop);
+
+
+ }
+
+
+
+}
+
+
ScriptTextEditor::ScriptTextEditor() {
code_editor = memnew( CodeTextEditor );
@@ -1039,6 +1182,9 @@ ScriptTextEditor::ScriptTextEditor() {
goto_line_dialog = memnew(GotoLineDialog);
add_child(goto_line_dialog);
+
+
+ code_editor->get_text_edit()->set_drag_forwarding(this);
}
static ScriptEditorBase * create_editor(const Ref<Script>& p_script) {
@@ -1060,8 +1206,8 @@ void ScriptTextEditor::register_editor() {
ED_SHORTCUT("script_text_editor/select_all", TTR("Select All"), KEY_MASK_CMD|KEY_A);
ED_SHORTCUT("script_text_editor/move_up", TTR("Move Up"), KEY_MASK_ALT|KEY_UP);
ED_SHORTCUT("script_text_editor/move_down", TTR("Move Down"), KEY_MASK_ALT|KEY_DOWN);
- ED_SHORTCUT("script_text_editor/indent_left", TTR("Indent Left"), KEY_MASK_ALT|KEY_LEFT);
- ED_SHORTCUT("script_text_editor/indent_right", TTR("Indent Right"), KEY_MASK_ALT|KEY_RIGHT);
+ ED_SHORTCUT("script_text_editor/indent_left", TTR("Indent Left"), 0);
+ ED_SHORTCUT("script_text_editor/indent_right", TTR("Indent Right"), 0);
ED_SHORTCUT("script_text_editor/toggle_comment", TTR("Toggle Comment"), KEY_MASK_CMD|KEY_K);
ED_SHORTCUT("script_text_editor/clone_down", TTR("Clone Down"), KEY_MASK_CMD|KEY_B);
#ifdef OSX_ENABLED
diff --git a/tools/editor/plugins/script_text_editor.h b/tools/editor/plugins/script_text_editor.h
index 247fd97e81..c311a21131 100644
--- a/tools/editor/plugins/script_text_editor.h
+++ b/tools/editor/plugins/script_text_editor.h
@@ -98,6 +98,11 @@ protected:
void _edit_option(int p_op);
void _goto_line(int p_line) { goto_line(p_line); }
+
+ Variant get_drag_data_fw(const Point2& p_point,Control* p_from);
+ bool can_drop_data_fw(const Point2& p_point,const Variant& p_data,Control* p_from) const;
+ void drop_data_fw(const Point2& p_point,const Variant& p_data,Control* p_from);
+
public:
virtual void apply_code();
diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp
index 815da48e96..aa66a2e0d9 100644
--- a/tools/editor/plugins/shader_graph_editor_plugin.cpp
+++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp
@@ -901,6 +901,7 @@ void ShaderGraphView::_variant_edited() {
case Variant::COLOR:
v2=Color();
break;
+ default: {}
}
UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Default Value"));
@@ -1321,6 +1322,7 @@ void ShaderGraphView::_default_changed(int p_id, Node *p_button, int p_param, in
h=PROPERTY_HINT_COLOR_NO_ALPHA;
v=Color();
break;
+ default: {}
}
ped_popup->edit(NULL,"",vt,v,h,p_hint);
@@ -1347,6 +1349,8 @@ ToolButton *ShaderGraphView::make_label(String text, Variant::Type v_type) {
break;
case Variant::COLOR:
l->set_icon(ped_popup->get_icon("Color", "EditorIcons"));
+ break;
+ default: {}
}
return l;
}
@@ -1372,7 +1376,7 @@ ToolButton *ShaderGraphView::make_editor(String text,GraphNode* gn,int p_id,int
case Variant::TRANSFORM:
edit->set_icon(ped_popup->get_icon("Matrix", "EditorIcons"));
break;
- case Variant::COLOR:
+ case Variant::COLOR: {
Image icon_color = Image(15,15,false,Image::FORMAT_RGB);
Color c = graph->default_get_value(type,p_id,param);
for (int x=1;x<14;x++)
@@ -1382,7 +1386,8 @@ ToolButton *ShaderGraphView::make_editor(String text,GraphNode* gn,int p_id,int
t.instance();
t->create_from_image(icon_color);
edit->set_icon(t);
- break;
+ } break;
+ default: {}
}
return edit;
}
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp
index 41956747e1..9701b8030d 100644
--- a/tools/editor/plugins/spatial_editor_plugin.cpp
+++ b/tools/editor/plugins/spatial_editor_plugin.cpp
@@ -3469,6 +3469,8 @@ void SpatialEditor::_unhandled_key_input(InputEvent p_event) {
if (!is_visible() || get_viewport()->gui_has_modal_stack())
return;
+#if 0
+//i don't remember this being used, why was it here?
{
EditorNode *en = editor;
@@ -3480,6 +3482,7 @@ void SpatialEditor::_unhandled_key_input(InputEvent p_event) {
}
}
+#endif
switch(p_event.type) {
diff --git a/tools/editor/plugins/tile_map_editor_plugin.h b/tools/editor/plugins/tile_map_editor_plugin.h
index 4b47dccd15..2f24002770 100644
--- a/tools/editor/plugins/tile_map_editor_plugin.h
+++ b/tools/editor/plugins/tile_map_editor_plugin.h
@@ -181,7 +181,7 @@ class TileMapEditorPlugin : public EditorPlugin {
public:
- virtual bool forward_input_event(const InputEvent& p_event) { return tile_map_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return tile_map_editor->forward_input_event(p_event); }
virtual String get_name() const { return "TileMap"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp
index 0c734436cd..b884e0d111 100644
--- a/tools/editor/project_manager.cpp
+++ b/tools/editor/project_manager.cpp
@@ -1196,7 +1196,7 @@ ProjectManager::ProjectManager() {
FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("file_dialog/show_hidden_files"));
set_area_as_parent_rect();
- set_theme(create_default_theme());
+ set_theme(create_editor_theme());
gui_base = memnew( Control );
add_child(gui_base);
@@ -1389,7 +1389,7 @@ ProjectManager::ProjectManager() {
SceneTree::get_singleton()->connect("files_dropped", this, "_files_dropped");
- gui_base->set_theme(create_editor_theme());
+ gui_base->set_theme(create_custom_theme());
}
diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp
index 480d33fd0a..84803eb6db 100644
--- a/tools/editor/spatial_editor_gizmos.cpp
+++ b/tools/editor/spatial_editor_gizmos.cpp
@@ -422,8 +422,6 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera,const Point2& p_po
if (billboard_handle) {
t.set_look_at(t.origin,t.origin+p_camera->get_transform().basis.get_axis(2),p_camera->get_transform().basis.get_axis(1));
}
- Transform ti=t.affine_inverse();
-
float min_d=1e20;
int idx=-1;