Conflicts:
	main/main.cpp
This commit is contained in:
Juan Linietsky 2015-11-24 10:52:41 -03:00
commit 082e3fbb29
78 changed files with 615 additions and 224 deletions

1
.gitignore vendored
View File

@ -296,3 +296,4 @@ cscope.po.out
godot.creator.* godot.creator.*
projects/ projects/
platform/windows/godot_res.res

View File

@ -332,6 +332,7 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) {
String candidate = d->get_current_dir(); String candidate = d->get_current_dir();
String current_dir = d->get_current_dir(); String current_dir = d->get_current_dir();
String exec_name = OS::get_singleton()->get_executable_path().get_file().basename();
bool found = false; bool found = false;
bool first_time=true; bool first_time=true;
@ -339,7 +340,16 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) {
//try to load settings in ascending through dirs shape! //try to load settings in ascending through dirs shape!
//tries to open pack, but only first time //tries to open pack, but only first time
if (first_time && (_load_resource_pack(current_dir+"/data.pck") || _load_resource_pack(current_dir+"/data.pcz") )) { if (first_time && (_load_resource_pack(current_dir+"/"+exec_name+".pck") || _load_resource_pack(current_dir+"/"+exec_name+".pcz") )) {
if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) {
_load_settings("res://override.cfg");
found=true;
}
break;
} else if (first_time && (_load_resource_pack(current_dir+"/data.pck") || _load_resource_pack(current_dir+"/data.pcz") )) {
if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) { if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) {
_load_settings("res://override.cfg"); _load_settings("res://override.cfg");

View File

@ -1955,7 +1955,6 @@ void ResourceFormatLoaderXML::get_recognized_extensions_for_type(const String& p
if (ext=="res") if (ext=="res")
continue; continue;
p_extensions->push_back("x"+ext); p_extensions->push_back("x"+ext);
p_extensions->push_back(ext);
} }
p_extensions->push_back("xml"); p_extensions->push_back("xml");

View File

@ -1291,8 +1291,8 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
ADDFUNC1(STRING,STRING,String,pad_decimals,INT,"digits",varray()); ADDFUNC1(STRING,STRING,String,pad_decimals,INT,"digits",varray());
ADDFUNC1(STRING,STRING,String,pad_zeros,INT,"digits",varray()); ADDFUNC1(STRING,STRING,String,pad_zeros,INT,"digits",varray());
ADDFUNC0(STRING,STRING,String,to_ascii,varray()); ADDFUNC0(STRING,RAW_ARRAY,String,to_ascii,varray());
ADDFUNC0(STRING,STRING,String,to_utf8,varray()); ADDFUNC0(STRING,RAW_ARRAY,String,to_utf8,varray());
ADDFUNC0(VECTOR2,VECTOR2,Vector2,normalized,varray()); ADDFUNC0(VECTOR2,VECTOR2,Vector2,normalized,varray());

View File

@ -2818,9 +2818,9 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
} break; } break;
case MATRIX32: { case MATRIX32: {
p_list->push_back( PropertyInfo(Variant::REAL,"x")); p_list->push_back( PropertyInfo(Variant::VECTOR2,"x"));
p_list->push_back( PropertyInfo(Variant::REAL,"y")); p_list->push_back( PropertyInfo(Variant::VECTOR2,"y"));
p_list->push_back( PropertyInfo(Variant::REAL,"o")); p_list->push_back( PropertyInfo(Variant::VECTOR2,"o"));
} break; } break;
case PLANE: { case PLANE: {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 844 B

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1 +0,0 @@
gen_mipmaps=true

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -2,3 +2,4 @@
name="Look At Pointer" name="Look At Pointer"
main_scene="res://lookat.scn" main_scene="res://lookat.scn"
icon="res://icon.png"

BIN
demos/2d/lookat/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -2,6 +2,7 @@
name="Motion Test" name="Motion Test"
main_scene="res://motion.scn" main_scene="res://motion.scn"
icon="res://icon.png"
[display] [display]

BIN
demos/2d/motion/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,5 @@
[application]
name="Polygon Pathfinder"
main_scene="res://poly_with_holes.scn"
icon="res://icon.png"

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

View File

@ -1,5 +0,0 @@
[application]
name="polygon_path_finder_demo"
main_scene="res://new_scene_poly_with_holes.scn"
icon="res://icon.png"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -1 +0,0 @@
gen_mipmaps=true

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -2,6 +2,7 @@
name="Glass Bubbles (Texscreen)" name="Glass Bubbles (Texscreen)"
main_scene="res://bubbles.scn" main_scene="res://bubbles.scn"
icon="res://icon.png"
[display] [display]

BIN
demos/2d/texscreen/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -2,6 +2,7 @@
name="Truck Town" name="Truck Town"
main_scene="res://car_select.scn" main_scene="res://car_select.scn"
icon="res://icon.png"
[display] [display]

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -2,3 +2,4 @@
name="Drag &amp; Drop (GUI)" name="Drag &amp; Drop (GUI)"
main_scene="res://drag_and_drop.scn" main_scene="res://drag_and_drop.scn"
icon="res://icon.png"

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

View File

@ -2,6 +2,7 @@
name="Input Mapping GUI" name="Input Mapping GUI"
main_scene="res://controls.scn" main_scene="res://controls.scn"
icon="res://icon.png"
[display] [display]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -2,6 +2,7 @@
name="Translation Demo" name="Translation Demo"
main_scene="res://main.scn" main_scene="res://main.scn"
icon="res://icon.png"
[locale] [locale]

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -2,3 +2,4 @@
name="RegEx" name="RegEx"
main_scene="res://regex.scn" main_scene="res://regex.scn"
icon="res://icon.png"

BIN
demos/misc/regex/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -1 +0,0 @@
gen_mipmaps=false

View File

@ -2,3 +2,4 @@
name="3D in 2D" name="3D in 2D"
main_scene="res://main.scn" main_scene="res://main.scn"
icon="res://icon.png"

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -2,3 +2,4 @@
name="GUI in 3D" name="GUI in 3D"
main_scene="res://gui_3d.scn" main_scene="res://gui_3d.scn"
icon="res://icon.png"

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -2,6 +2,7 @@
name="Screen Capturing" name="Screen Capturing"
main_scene="res://screen_capture.scn" main_scene="res://screen_capture.scn"
icon="res://icon.png"
[display] [display]

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -3197,6 +3197,24 @@
<description> <description>
</description> </description>
</method> </method>
<method name="set_animation_process_mode">
<argument index="0" name="mode" type="int">
</argument>
<description>
</description>
</method>
<method name="get_animation_process_mode" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
<method name="advance">
<argument index="0" name="delta" type="float">
</argument>
<description>
</description>
</method>
<method name="reset"> <method name="reset">
<description> <description>
</description> </description>
@ -4353,7 +4371,7 @@
Stop a given voice. Stop a given voice.
</description> </description>
</method> </method>
<method name="free"> <method name="free_rid">
<argument index="0" name="rid" type="RID"> <argument index="0" name="rid" type="RID">
</argument> </argument>
<description> <description>
@ -5477,7 +5495,7 @@
</constant> </constant>
</constants> </constants>
</class> </class>
<class name="ButtonGroup" inherits="Control" category="Core"> <class name="ButtonGroup" inherits="BoxContainer" category="Core">
<brief_description> <brief_description>
Group of Buttons. Group of Buttons.
</brief_description> </brief_description>
@ -5523,6 +5541,10 @@
</methods> </methods>
<constants> <constants>
</constants> </constants>
<theme_items>
<theme_item name="panel" type="StyleBox">
</theme_item>
</theme_items>
</class> </class>
<class name="Camera" inherits="Spatial" category="Core"> <class name="Camera" inherits="Spatial" category="Core">
<brief_description> <brief_description>
@ -6628,7 +6650,7 @@
<argument index="0" name="radius" type="float"> <argument index="0" name="radius" type="float">
</argument> </argument>
<description> <description>
Radius of the [CapsuleShape2D]. Set the radius of the [CapsuleShape2D].
</description> </description>
</method> </method>
<method name="get_radius" qualifiers="const"> <method name="get_radius" qualifiers="const">
@ -6642,7 +6664,7 @@
<argument index="0" name="height" type="float"> <argument index="0" name="height" type="float">
</argument> </argument>
<description> <description>
Height of the [CapsuleShape2D]. Set the height of the [CapsuleShape2D].
</description> </description>
</method> </method>
<method name="get_height" qualifiers="const"> <method name="get_height" qualifiers="const">
@ -6947,7 +6969,7 @@
Base node for 2D collisionables. Base node for 2D collisionables.
</brief_description> </brief_description>
<description> <description>
CollisionObject2D is the base class for 2D physics collisionables. They can hold any number of 2D collision shapes. Usually, they are edited by placing CollisionBody2D and CollisionPolygon2D nodes as children. Such nodes are for reference ant not present outside the editor, so code should use the regular shape API. CollisionObject2D is the base class for 2D physics collisionables. They can hold any number of 2D collision shapes. Usually, they are edited by placing [CollisionBody2D] and [CollisionPolygon2D] nodes as children. Such nodes are for reference and not present outside the editor, so code should use the regular shape API.
</description> </description>
<methods> <methods>
<method name="_input_event" qualifiers="virtual"> <method name="_input_event" qualifiers="virtual">
@ -7143,58 +7165,69 @@
</class> </class>
<class name="CollisionPolygon2D" inherits="Node2D" category="Core"> <class name="CollisionPolygon2D" inherits="Node2D" category="Core">
<brief_description> <brief_description>
Editor-Only class. Editor-only class for easy editing of collision polygons.
</brief_description> </brief_description>
<description> <description>
Editor-Only class. This is not present when running the game. It's used in the editor to properly edit and position collision shapes in [CollisionObject2D]. This is not accessible from regular code. This class is for editing custom shape polygons. Editor-only class. This is not present when running the game. It's used in the editor to properly edit and position collision shapes in [CollisionObject2D]. This is not accessible from regular code. This class is for editing custom shape polygons.
</description> </description>
<methods> <methods>
<method name="set_polygon"> <method name="set_polygon">
<argument index="0" name="polygon" type="Vector2Array"> <argument index="0" name="polygon" type="Vector2Array">
</argument> </argument>
<description> <description>
Set the array of points forming the polygon.
When editing the point list via the editor, depending on [method get_build_mode], it has to be a list of points (for [code]build_mode[/code]=0), or a list of lines (for [code]build_mode[/code]=1). In the second case, the even elements of the array define the start point of the line, and the odd elements the end point.
</description> </description>
</method> </method>
<method name="get_polygon" qualifiers="const"> <method name="get_polygon" qualifiers="const">
<return type="Vector2Array"> <return type="Vector2Array">
</return> </return>
<description> <description>
Return the list of points that define the polygon.
</description> </description>
</method> </method>
<method name="set_build_mode"> <method name="set_build_mode">
<argument index="0" name="arg0" type="int"> <argument index="0" name="arg0" type="int">
</argument> </argument>
<description> <description>
Set whether the polygon is to be a [ConvexPolygon2D] ([code]build_mode[/code]=0), or a [ConcavePolygon2D] ([code]build_mode[/code]=1).
</description> </description>
</method> </method>
<method name="get_build_mode" qualifiers="const"> <method name="get_build_mode" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return whether the polygon is a [ConvexPolygon2D] ([code]build_mode[/code]=0), or a [ConcavePolygon2D] ([code]build_mode[/code]=1).
</description> </description>
</method> </method>
<method name="set_trigger"> <method name="set_trigger">
<argument index="0" name="arg0" type="bool"> <argument index="0" name="arg0" type="bool">
</argument> </argument>
<description> <description>
Set whether this polygon is a trigger. A trigger polygon detects collisions, but is otherwise unaffected by physics (i.e. colliding objects will not get blocked).
</description> </description>
</method> </method>
<method name="is_trigger" qualifiers="const"> <method name="is_trigger" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return whether this polygon is a trigger.
</description> </description>
</method> </method>
<method name="get_collision_object_first_shape" qualifiers="const"> <method name="get_collision_object_first_shape" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the index of the first shape generated by the editor.
When [code]build_mode[/code] is set to generate convex polygons, the shape shown in the editor may be decomopsed into many convex polygons. In that case, a range of indexes is needed to directly access the [Shape2D]s.
When [code]build_mode[/code] is set to generate concave polygons, there is only one [Shape2D] generated, so the start index and the end index are the same.
</description> </description>
</method> </method>
<method name="get_collision_object_last_shape" qualifiers="const"> <method name="get_collision_object_last_shape" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the index of the last shape generated by the editor.
</description> </description>
</method> </method>
</methods> </methods>
@ -7253,40 +7286,45 @@
</class> </class>
<class name="CollisionShape2D" inherits="Node2D" category="Core"> <class name="CollisionShape2D" inherits="Node2D" category="Core">
<brief_description> <brief_description>
Editor-Only class. Editor-only class for easy editing of shapes.
</brief_description> </brief_description>
<description> <description>
Editor-Only class. This is not present when running the game. It's used in the editor to properly edit and position collision shapes in [CollisionObject2D]. This is not accessible from regular code. Editor-only class. This is not present when running the game. It's used in the editor to properly edit and position collision shapes in [CollisionObject2D]. This is not accessible from regular code.
</description> </description>
<methods> <methods>
<method name="set_shape"> <method name="set_shape">
<argument index="0" name="shape" type="Object"> <argument index="0" name="shape" type="Object">
</argument> </argument>
<description> <description>
Set this shape's [Shape2D]. This will not appear as a node, but can be directly edited as a property.
</description> </description>
</method> </method>
<method name="get_shape" qualifiers="const"> <method name="get_shape" qualifiers="const">
<return type="Object"> <return type="Object">
</return> </return>
<description> <description>
Return this shape's [Shape2D].
</description> </description>
</method> </method>
<method name="set_trigger"> <method name="set_trigger">
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
Set whether this shape is a trigger. A trigger shape detects collisions, but is otherwise unaffected by physics (i.e. will not block movement of colliding objects).
</description> </description>
</method> </method>
<method name="is_trigger" qualifiers="const"> <method name="is_trigger" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return whether this shape is a trigger.
</description> </description>
</method> </method>
<method name="get_collision_object_shape_index" qualifiers="const"> <method name="get_collision_object_shape_index" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the index of this shape inside its container [CollisionObject2D]. This can be used to directly access the underlying [Shape2D].
</description> </description>
</method> </method>
</methods> </methods>
@ -7298,7 +7336,7 @@
Color in RGBA format. Color in RGBA format.
</brief_description> </brief_description>
<description> <description>
A color is represented as red, green and blue (r,g,b) components. Additionally, "a" represents the alpha component, often used for transparency. Values are in floating point and usually range from 0 to 1. Some methods (such as set_modulate() ) may accept values > 1. A color is represented as red, green and blue (r,g,b) components. Additionally, "a" represents the alpha component, often used for transparency. Values are in floating point and usually range from 0 to 1. Some methods (such as set_modulate() ) may accept values &gt; 1.
</description> </description>
<methods> <methods>
<method name="blend"> <method name="blend">
@ -7666,7 +7704,7 @@
Concave polygon shape. Concave polygon shape.
</brief_description> </brief_description>
<description> <description>
Concave polygon shape resource, which can be set into a [PhysicsBody] or area. This shape is created by feeding a list of triangles. Concave polygon shape resource, which can be set into a [PhysicsBody] or area. This shape is created by feeding a list of triangles.
</description> </description>
<methods> <methods>
<method name="set_faces"> <method name="set_faces">
@ -7693,6 +7731,7 @@
</brief_description> </brief_description>
<description> <description>
Concave polygon 2D shape resource for physics. It is made out of segments and is very optimal for complex polygonal concave collisions. It is really not advised to use for RigidBody nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions. Concave polygon 2D shape resource for physics. It is made out of segments and is very optimal for complex polygonal concave collisions. It is really not advised to use for RigidBody nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions.
The main difference between a [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection.
</description> </description>
<methods> <methods>
<method name="set_segments"> <method name="set_segments">
@ -8583,14 +8622,15 @@
Convex Polygon Shape for 2D physics. Convex Polygon Shape for 2D physics.
</brief_description> </brief_description>
<description> <description>
Convex Polygon Shape for 2D physics. Convex Polygon Shape for 2D physics. A convex polygon, whatever its shape, is internally decomposed into as many convex polygons as needed to ensure all collision checks against it are always done on convex polygons (which are faster to check).
The main difference between a [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection.
</description> </description>
<methods> <methods>
<method name="set_point_cloud"> <method name="set_point_cloud">
<argument index="0" name="point_cloud" type="Vector2Array"> <argument index="0" name="point_cloud" type="Vector2Array">
</argument> </argument>
<description> <description>
Create the point set from a point cloud. The resulting convex hull will be set as the shape. Currently, this method does nothing.
</description> </description>
</method> </method>
<method name="set_points"> <method name="set_points">
@ -8871,12 +8911,12 @@ Cubic interpolation tends to follow the curves better, but linear is faster (and
</description> </description>
</method> </method>
<method name="tesselate" qualifiers="const"> <method name="tesselate" qualifiers="const">
<return type="Vector2Array">
</return>
<argument index="0" name="max_stages" type="int" default="5"> <argument index="0" name="max_stages" type="int" default="5">
</argument> </argument>
<argument index="1" name="tolerance_degrees" type="float" default="4"> <argument index="1" name="tolerance_degrees" type="float" default="4">
</argument> </argument>
<return type="Vector2Array">
</return>
<description> <description>
Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts. Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts.
This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough. This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough.
@ -8884,16 +8924,6 @@ This approximation makes straight segments between each point, then subdivides t
"tolerance_degrees" controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. "tolerance_degrees" controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided.
</description> </description>
</method> </method>
<method name="tesselate" qualifiers="const">
<return type="Vector2Array">
</return>
<argument index="0" name="max_stages" type="int" default="5">
</argument>
<argument index="1" name="tolerance_degrees" type="float" default="4">
</argument>
<description>
</description>
</method>
</methods> </methods>
<constants> <constants>
</constants> </constants>
@ -9078,12 +9108,12 @@ Cubic interpolation tends to follow the curves better, but linear is faster (and
</description> </description>
</method> </method>
<method name="tesselate" qualifiers="const"> <method name="tesselate" qualifiers="const">
<return type="Vector3Array">
</return>
<argument index="0" name="max_stages" type="int" default="5"> <argument index="0" name="max_stages" type="int" default="5">
</argument> </argument>
<argument index="1" name="tolerance_degrees" type="float" default="4"> <argument index="1" name="tolerance_degrees" type="float" default="4">
</argument> </argument>
<return type="Vector3Array">
</return>
<description> <description>
Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts. Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts.
This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough. This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough.
@ -9091,16 +9121,6 @@ This approximation makes straight segments between each point, then subdivides t
"tolerance_degrees" controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. "tolerance_degrees" controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided.
</description> </description>
</method> </method>
<method name="tesselate" qualifiers="const">
<return type="Vector3Array">
</return>
<argument index="0" name="max_stages" type="int" default="5">
</argument>
<argument index="1" name="tolerance_degrees" type="float" default="4">
</argument>
<description>
</description>
</method>
</methods> </methods>
<constants> <constants>
</constants> </constants>
@ -10761,6 +10781,14 @@ This approximation makes straight segments between each point, then subdivides t
</constant> </constant>
<constant name="FLAG_DISCARD_ALPHA" value="3"> <constant name="FLAG_DISCARD_ALPHA" value="3">
</constant> </constant>
<constant name="LIGHT_SHADER_LAMBERT" value="0">
</constant>
<constant name="LIGHT_SHADER_WRAP" value="1">
</constant>
<constant name="LIGHT_SHADER_VELVET" value="2">
</constant>
<constant name="LIGHT_SHADER_TOON" value="3">
</constant>
</constants> </constants>
</class> </class>
<class name="Font" inherits="Resource" category="Core"> <class name="Font" inherits="Resource" category="Core">
@ -12521,9 +12549,9 @@ This approximation makes straight segments between each point, then subdivides t
<argument index="3" name="verify_host" type="bool" default="true"> <argument index="3" name="verify_host" type="bool" default="true">
</argument> </argument>
<description> <description>
Connect to a host. This needs to be done before any requests are sent. Connect to a host. This needs to be done before any requests are sent.
The host should not have http:// prepended but will strip the protocol identifier if provided. The host should not have http:// prepended but will strip the protocol identifier if provided.
verify_host will check the SSL identity of the host if set to true. verify_host will check the SSL identity of the host if set to true.
</description> </description>
</method> </method>
@ -12545,13 +12573,12 @@ verify_host will check the SSL identity of the host if set to true.
<argument index="3" name="body" type="String" default="&quot;&quot;"> <argument index="3" name="body" type="String" default="&quot;&quot;">
</argument> </argument>
<description> <description>
Sends a request to the connected host. The url is the what is normally behind the hostname, Sends a request to the connected host. The url is the what is normally behind the hostname, i.e:
i.e;
http://somehost.com/index.php http://somehost.com/index.php
url would be &quot;index.php&quot; url would be "index.php"
Headers are HTTP request headers Headers are HTTP request headers
To create a POST request with query strings to push to the server, do: To create a POST request with query strings to push to the server, do:
var fields = {"username" : "user", var fields = {"username" : "user",
"password" : "pass"} "password" : "pass"}
@ -12566,8 +12593,8 @@ var result = httpClient.request(httpClient.METHOD_POST, "index.php", headers, qu
</return> </return>
<argument index="0" name="body" type="String"> <argument index="0" name="body" type="String">
</argument> </argument>
<description> <description>
Stub function Stub function
</description> </description>
</method> </method>
<method name="send_body_data"> <method name="send_body_data">
@ -12576,7 +12603,7 @@ var result = httpClient.request(httpClient.METHOD_POST, "index.php", headers, qu
<argument index="0" name="body" type="RawArray"> <argument index="0" name="body" type="RawArray">
</argument> </argument>
<description> <description>
Stub function Stub function
</description> </description>
</method> </method>
<method name="close"> <method name="close">
@ -12629,14 +12656,14 @@ var result = httpClient.request(httpClient.METHOD_POST, "index.php", headers, qu
<argument index="0" name="bytes" type="int"> <argument index="0" name="bytes" type="int">
</argument> </argument>
<description> <description>
Sets the size of the buffer used and maximum bytes to read per iteration Sets the size of the buffer used and maximum bytes to read per iteration
</description> </description>
</method> </method>
<method name="set_blocking_mode"> <method name="set_blocking_mode">
<argument index="0" name="enabled" type="bool"> <argument index="0" name="enabled" type="bool">
</argument> </argument>
<description> <description>
If set to true, execute will wait until all data is read from the response. If set to true, execute will wait until all data is read from the response.
</description> </description>
</method> </method>
<method name="is_blocking_mode_enabled" qualifiers="const"> <method name="is_blocking_mode_enabled" qualifiers="const">
@ -12649,30 +12676,30 @@ var result = httpClient.request(httpClient.METHOD_POST, "index.php", headers, qu
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns a status string like STATUS_REQUESTING. Need to call [method poll] in order to get status updates. Returns a status string like STATUS_REQUESTING. Need to call [method poll] in order to get status updates.
</description> </description>
</method> </method>
<method name="poll"> <method name="poll">
<return type="Error"> <return type="Error">
</return> </return>
<description> <description>
This needs to be called in order to have any request processed. Check results with [method get_status] This needs to be called in order to have any request processed. Check results with [method get_status]
</description> </description>
</method> </method>
<method name="query_string_from_dict"> <method name="query_string_from_dict">
<return type="String"> <return type="String">
</return> </return>
<argument index="0" name="fields" type="Dictionary"> <argument index="0" name="fields" type="Dictionary">
</argument> </argument>
<description> <description>
Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary. Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary.
var fields = {"username": "user", "password": "pass"} var fields = {"username": "user", "password": "pass"}
String queryString = httpClient.query_string_from_dict(fields) String queryString = httpClient.query_string_from_dict(fields)
returns:= "username=user&amp;password=pass" returns:= "username=user&amp;password=pass"
</description> </description>
</method> </method>
</methods> </methods>
<constants> <constants>
<constant name="METHOD_GET" value="0"> <constant name="METHOD_GET" value="0">
@ -14453,6 +14480,12 @@ returns:= "username=user&amp;password=pass"
<description> <description>
</description> </description>
</method> </method>
<method name="get_instance_path" qualifiers="const">
<return type="String">
</return>
<description>
</description>
</method>
</methods> </methods>
<constants> <constants>
</constants> </constants>
@ -15902,6 +15935,18 @@ returns:= "username=user&amp;password=pass"
LineEdit provides a single line string editor, used for text fields. LineEdit provides a single line string editor, used for text fields.
</description> </description>
<methods> <methods>
<method name="set_align">
<argument index="0" name="align" type="int">
</argument>
<description>
</description>
</method>
<method name="get_align" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
<method name="clear"> <method name="clear">
<description> <description>
Clear the [LineEdit] text. Clear the [LineEdit] text.
@ -16015,6 +16060,14 @@ returns:= "username=user&amp;password=pass"
</signal> </signal>
</signals> </signals>
<constants> <constants>
<constant name="ALIGN_LEFT" value="0">
</constant>
<constant name="ALIGN_CENTER" value="1">
</constant>
<constant name="ALIGN_RIGHT" value="2">
</constant>
<constant name="ALIGN_FILL" value="3">
</constant>
</constants> </constants>
<theme_items> <theme_items>
<theme_item name="minimum_spaces" type="int"> <theme_item name="minimum_spaces" type="int">
@ -16733,6 +16786,8 @@ returns:= "username=user&amp;password=pass"
</theme_item> </theme_item>
<theme_item name="pressed" type="StyleBox"> <theme_item name="pressed" type="StyleBox">
</theme_item> </theme_item>
<theme_item name="focus" type="StyleBox">
</theme_item>
<theme_item name="disabled" type="StyleBox"> <theme_item name="disabled" type="StyleBox">
</theme_item> </theme_item>
<theme_item name="normal" type="StyleBox"> <theme_item name="normal" type="StyleBox">
@ -18584,6 +18639,18 @@ returns:= "username=user&amp;password=pass"
Replace a node in a scene by a given one. Subscriptions that pass through this node will be lost. Replace a node in a scene by a given one. Subscriptions that pass through this node will be lost.
</description> </description>
</method> </method>
<method name="set_scene_instance_load_placeholder">
<argument index="0" name="load_placeholder" type="bool">
</argument>
<description>
</description>
</method>
<method name="get_scene_instance_load_placeholder" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
<method name="get_viewport" qualifiers="const"> <method name="get_viewport" qualifiers="const">
<return type="Object"> <return type="Object">
</return> </return>
@ -21573,16 +21640,16 @@ This method controls whether the position between two cached points is interpola
</methods> </methods>
<constants> <constants>
<constant name="ROTATION_NONE" value="0"> <constant name="ROTATION_NONE" value="0">
Forbids the PathFollow to rotate. Forbids the PathFollow to rotate.
</constant> </constant>
<constant name="ROTATION_Y" value="1"> <constant name="ROTATION_Y" value="1">
Allows the PathFollow to rotate in the Y axis only. Allows the PathFollow to rotate in the Y axis only.
</constant> </constant>
<constant name="ROTATION_XY" value="2"> <constant name="ROTATION_XY" value="2">
Allows the PathFollow to rotate in both the X, and Y axes. Allows the PathFollow to rotate in both the X, and Y axes.
</constant> </constant>
<constant name="ROTATION_XYZ" value="3"> <constant name="ROTATION_XYZ" value="3">
Allows the PathFollow to rotate in any axis. Allows the PathFollow to rotate in any axis.
</constant> </constant>
</constants> </constants>
</class> </class>
@ -21697,10 +21764,6 @@ This method controls whether the position between two cached points is interpola
</description> </description>
</method> </method>
</methods> </methods>
<members>
<member name="lookahead" type="float">
</member>
</members>
<constants> <constants>
</constants> </constants>
</class> </class>
@ -26057,6 +26120,14 @@ This method controls whether the position between two cached points is interpola
<description> <description>
</description> </description>
</method> </method>
<method name="xform">
<return type="Vector3">
</return>
<argument index="0" name="v" type="Vector3">
</argument>
<description>
</description>
</method>
<method name="Quat"> <method name="Quat">
<return type="Quat"> <return type="Quat">
</return> </return>
@ -26301,12 +26372,14 @@ This method controls whether the position between two cached points is interpola
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Returns a copy of the array's contents formatted as String. Fast alternative to get_string_from_utf8(), assuming the content is ASCII-only (unlike the UTF-8 function, this function maps every byte to a character in the string, so any multibyte sequence will be torn apart).
</description> </description>
</method> </method>
<method name="get_string_from_utf8"> <method name="get_string_from_utf8">
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Returns a copy of the array's contents formatted as String, assuming the array is formatted as UTF-8. Slower than get_string_from_ascii(), but works for UTF-8. Usually you should prefer this function over get_string_from_ascii() to support international input.
</description> </description>
</method> </method>
<method name="push_back"> <method name="push_back">
@ -26584,19 +26657,21 @@ This method controls whether the position between two cached points is interpola
Ray 2D shape resource for physics. Ray 2D shape resource for physics.
</brief_description> </brief_description>
<description> <description>
Ray 2D shape resource for physics. A ray is not really a collision body, isntead it tries to separate itself from whatever is touching its far endpoint. It's often useful for ccharacters. Ray 2D shape resource for physics. A ray is not really a collision body, isntead it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters.
</description> </description>
<methods> <methods>
<method name="set_length"> <method name="set_length">
<argument index="0" name="length" type="float"> <argument index="0" name="length" type="float">
</argument> </argument>
<description> <description>
Set the length of the ray.
</description> </description>
</method> </method>
<method name="get_length" qualifiers="const"> <method name="get_length" qualifiers="const">
<return type="float"> <return type="float">
</return> </return>
<description> <description>
Return the length of the ray.
</description> </description>
</method> </method>
</methods> </methods>
@ -26866,27 +26941,22 @@ This method controls whether the position between two cached points is interpola
<methods> <methods>
<method name="compile"> <method name="compile">
<return type="int"> <return type="int">
[OK] if the regular expression was valid. [FAIL] otherwise.
</return> </return>
<argument index="0" name="pattern" type="String"> <argument index="0" name="pattern" type="String">
The string to be converted into a regular expression. </argument>
<argument index="1" name="expanded" type="bool" default="true">
</argument> </argument>
<description> <description>
Once created, a RegEx object needs a regular expression to be assigned to it. This method tries to convert the string given to an usable regular expression.
</description> </description>
</method> </method>
<method name="find" qualifiers="const"> <method name="find" qualifiers="const">
<return type="int"> <return type="int">
The position within the string (starting with 0) where the pattern was found. It will return -1 if the pattern was not found, it was invalid, or the start or end positions were beyond the string's end.
</return> </return>
<argument index="0" name="text" type="String"> <argument index="0" name="text" type="String">
The text to search the pattern in.
</argument> </argument>
<argument index="1" name="start" type="int" default="0"> <argument index="1" name="start" type="int" default="0">
The position in the string (starting with 0) to start searching from.
</argument> </argument>
<argument index="2" name="end" type="int" default="-1"> <argument index="2" name="end" type="int" default="-1">
The position in the string (starting with 0) to stop searching. A value less than the start position means "end of the string".
</argument> </argument>
<description> <description>
This method tries to find the pattern within the string, and returns the position where it was found. It also stores any capturing group (see [method get_capture]) for further retrieval. This method tries to find the pattern within the string, and returns the position where it was found. It also stores any capturing group (see [method get_capture]) for further retrieval.
@ -26915,7 +26985,6 @@ This method controls whether the position between two cached points is interpola
<return type="String"> <return type="String">
</return> </return>
<argument index="0" name="capture" type="int"> <argument index="0" name="capture" type="int">
The number of the captured group, starting with 0. Like other regular expression engines, Godot's engine takes 0 as the full expression, and 1 as the first pair of capturing parentheses.
</argument> </argument>
<description> <description>
Returns a captured group. A captured group is the part of a string that matches a part of the pattern delimited by parentheses (unless they are non-capturing parentheses [i](?:)[/i]). Returns a captured group. A captured group is the part of a string that matches a part of the pattern delimited by parentheses (unless they are non-capturing parentheses [i](?:)[/i]).
@ -26923,7 +26992,6 @@ This method controls whether the position between two cached points is interpola
</method> </method>
<method name="get_captures" qualifiers="const"> <method name="get_captures" qualifiers="const">
<return type="StringArray"> <return type="StringArray">
A list contining all the strings captured by the regular expression.
</return> </return>
<description> <description>
Return a list of all the captures made by the regular expression. Return a list of all the captures made by the regular expression.
@ -29543,24 +29611,28 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="a" type="Vector2"> <argument index="0" name="a" type="Vector2">
</argument> </argument>
<description> <description>
Set the first point's position.
</description> </description>
</method> </method>
<method name="get_a" qualifiers="const"> <method name="get_a" qualifiers="const">
<return type="Vector2"> <return type="Vector2">
</return> </return>
<description> <description>
Return the first point's position.
</description> </description>
</method> </method>
<method name="set_b"> <method name="set_b">
<argument index="0" name="b" type="Vector2"> <argument index="0" name="b" type="Vector2">
</argument> </argument>
<description> <description>
Set the second point's position.
</description> </description>
</method> </method>
<method name="get_b" qualifiers="const"> <method name="get_b" qualifiers="const">
<return type="Vector2"> <return type="Vector2">
</return> </return>
<description> <description>
Return the second point's position.
</description> </description>
</method> </method>
</methods> </methods>
@ -30608,13 +30680,14 @@ This method controls whether the position between two cached points is interpola
</argument> </argument>
<description> <description>
Use a custom solver bias. No need to change this unless you really know what you are doing. Use a custom solver bias. No need to change this unless you really know what you are doing.
The solver bias is a factor controlling how much two objects "rebound" off each other, when colliding, to avoid them getting into each other because of numerical imprecision.
</description> </description>
</method> </method>
<method name="get_custom_solver_bias" qualifiers="const"> <method name="get_custom_solver_bias" qualifiers="const">
<return type="float"> <return type="float">
</return> </return>
<description> <description>
Return the custom solver bias. No need to change this unless you really know what you are doing. Return the custom solver bias.
</description> </description>
</method> </method>
<method name="collide"> <method name="collide">
@ -30627,6 +30700,8 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="shape_xform" type="Matrix32"> <argument index="2" name="shape_xform" type="Matrix32">
</argument> </argument>
<description> <description>
Return whether this shape is colliding with another.
This method needs the transformation matrix for this shape ([code]local_xform[/code]), the shape to check collisions with ([code]with_shape[/code]), and the transformation matrix of that shape ([code]shape_xform[/code]).
</description> </description>
</method> </method>
<method name="collide_with_motion"> <method name="collide_with_motion">
@ -30643,6 +30718,8 @@ This method controls whether the position between two cached points is interpola
<argument index="4" name="shape_motion" type="Vector2"> <argument index="4" name="shape_motion" type="Vector2">
</argument> </argument>
<description> <description>
Return whether this shape would collide with another, if a given movemen was applied.
This method needs the transformation matrix for this shape ([code]local_xform[/code]), the movement to test on this shape ([code]local_motion[/code]), the shape to check collisions with ([code]with_shape[/code]), the transformation matrix of that shape ([code]shape_xform[/code]), and the movement to test ont the other object ([code]shape_motion[/code]).
</description> </description>
</method> </method>
<method name="collide_and_get_contacts"> <method name="collide_and_get_contacts">
@ -30653,6 +30730,8 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="shape_xform" type="Matrix32"> <argument index="2" name="shape_xform" type="Matrix32">
</argument> </argument>
<description> <description>
Return a list of the points where this shape touches another. If there are no collisions, the list is empty.
This method needs the transformation matrix for this shape ([code]local_xform[/code]), the shape to check collisions with ([code]with_shape[/code]), and the transformation matrix of that shape ([code]shape_xform[/code]).
</description> </description>
</method> </method>
<method name="collide_with_motion_and_get_contacts"> <method name="collide_with_motion_and_get_contacts">
@ -30667,6 +30746,8 @@ This method controls whether the position between two cached points is interpola
<argument index="4" name="shape_motion" type="Vector2"> <argument index="4" name="shape_motion" type="Vector2">
</argument> </argument>
<description> <description>
Return a list of the points where this shape would touch another, if a given movement was applied. If there are no collisions, the list is empty.
This method needs the transformation matrix for this shape ([code]local_xform[/code]), the movement to test on this shape ([code]local_motion[/code]), the shape to check collisions with ([code]with_shape[/code]), the transformation matrix of that shape ([code]shape_xform[/code]), and the movement to test ont the other object ([code]shape_motion[/code]).
</description> </description>
</method> </method>
</methods> </methods>
@ -33055,9 +33136,10 @@ This method controls whether the position between two cached points is interpola
</description> </description>
</method> </method>
<method name="to_ascii"> <method name="to_ascii">
<return type="String"> <return type="RawArray">
</return> </return>
<description> <description>
Convert the String (which is a character array) to RawArray (which is an array of bytes). The conversion is speeded up in comparison to to_utf8() with the assumption that all the characters the String contains are only ASCII characters.
</description> </description>
</method> </method>
<method name="to_float"> <method name="to_float">
@ -33089,9 +33171,10 @@ This method controls whether the position between two cached points is interpola
</description> </description>
</method> </method>
<method name="to_utf8"> <method name="to_utf8">
<return type="String"> <return type="RawArray">
</return> </return>
<description> <description>
Convert the String (which is an array of characters) to RawArray (which is an array of bytes). The conversion is a bit slower than to_ascii(), but supports all UTF-8 characters. Therefore, you should prefer this function over to_ascii().
</description> </description>
</method> </method>
<method name="xml_escape"> <method name="xml_escape">
@ -33988,15 +34071,17 @@ This method controls whether the position between two cached points is interpola
<method name="cursor_set_column"> <method name="cursor_set_column">
<argument index="0" name="column" type="int"> <argument index="0" name="column" type="int">
</argument> </argument>
<argument index="1" name="arg1" type="bool">
</argument>
<description> <description>
Set the current column of the text editor.
</description> </description>
</method> </method>
<method name="cursor_set_line"> <method name="cursor_set_line">
<argument index="0" name="line" type="int"> <argument index="0" name="line" type="int">
</argument> </argument>
<argument index="1" name="arg1" type="bool">
</argument>
<description> <description>
Set the current line of the text editor.
</description> </description>
</method> </method>
<method name="cursor_get_column" qualifiers="const"> <method name="cursor_get_column" qualifiers="const">
@ -36252,6 +36337,18 @@ This method controls whether the position between two cached points is interpola
<description> <description>
</description> </description>
</method> </method>
<method name="set_hide_folding">
<argument index="0" name="hide" type="bool">
</argument>
<description>
</description>
</method>
<method name="is_folding_hidden" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
</methods> </methods>
<signals> <signals>
<signal name="item_activated"> <signal name="item_activated">
@ -37404,6 +37501,14 @@ This method controls whether the position between two cached points is interpola
<description> <description>
</description> </description>
<methods> <methods>
<method name="angle">
<return type="float">
</return>
<description>
Returns the result of atan2 when called with the Vector's x and y as parameters (Math::atan2(x,y)).
Be aware that it therefore returns an angle oriented clockwise with regard to the (0, 1) unit vector, and not an angle oriented counter-clockwise with regard to the (1, 0) unit vector (which would be the typical trigonometric representation of the angle when calling Math::atan2(y,x)).
</description>
</method>
<method name="angle_to"> <method name="angle_to">
<return type="float"> <return type="float">
</return> </return>
@ -37422,13 +37527,6 @@ This method controls whether the position between two cached points is interpola
Returns the angle in radians between the line connecting the two points and the x coordinate. Returns the angle in radians between the line connecting the two points and the x coordinate.
</description> </description>
</method> </method>
<method name="atan2">
<return type="float">
</return>
<description>
Returns the result of atan2 when called with the Vector's x and y as parameters.
</description>
</method>
<method name="cubic_interpolate"> <method name="cubic_interpolate">
<return type="Vector2"> <return type="Vector2">
</return> </return>
@ -37529,7 +37627,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="vec" type="Vector2"> <argument index="0" name="vec" type="Vector2">
</argument> </argument>
<description> <description>
Reflects/mirrors the vector around another vector. Like "slide", but reflects the Vector instead of continuing along the wall.
</description> </description>
</method> </method>
<method name="rotated"> <method name="rotated">
@ -37593,10 +37691,10 @@ This method controls whether the position between two cached points is interpola
</class> </class>
<class name="Vector2Array" category="Built-In Types"> <class name="Vector2Array" category="Built-In Types">
<brief_description> <brief_description>
An Array of Vector2's. An Array of Vector2.
</brief_description> </brief_description>
<description> <description>
An Array specifically designed to hold Vector2's. An Array specifically designed to hold Vector2.
</description> </description>
<methods> <methods>
<method name="get"> <method name="get">
@ -37605,21 +37703,21 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Get the Vector2 at the given index. Returns the Vector2 at the given index.
</description> </description>
</method> </method>
<method name="push_back"> <method name="push_back">
<argument index="0" name="vector2" type="Vector2"> <argument index="0" name="vector2" type="Vector2">
</argument> </argument>
<description> <description>
Insert a new Vector2. Inserts a Vector2 at the end.
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Set the size of the Vector2Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array. Sets the size of the Vector2Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
</description> </description>
</method> </method>
<method name="set"> <method name="set">
@ -37628,7 +37726,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="vector2" type="Vector2"> <argument index="1" name="vector2" type="Vector2">
</argument> </argument>
<description> <description>
Set the Vector2 at the given index. Changes the Vector2 at the given index.
</description> </description>
</method> </method>
<method name="size"> <method name="size">
@ -37663,12 +37761,14 @@ This method controls whether the position between two cached points is interpola
<return type="Vector3"> <return type="Vector3">
</return> </return>
<description> <description>
Returns a new vector with all components in absolute values (e.g. positive).
</description> </description>
</method> </method>
<method name="ceil"> <method name="ceil">
<return type="Vector3"> <return type="Vector3">
</return> </return>
<description> <description>
Returns a new vector with all components rounded up.
</description> </description>
</method> </method>
<method name="cross"> <method name="cross">
@ -37692,7 +37792,7 @@ This method controls whether the position between two cached points is interpola
<argument index="3" name="t" type="float"> <argument index="3" name="t" type="float">
</argument> </argument>
<description> <description>
Perform a cubic interpolation between vectors a,b,c,d (b is current), by the given amount (i). Perform a cubic interpolation between vectors pre_a, a, b, post_b (a is current), by the given amount (t).
</description> </description>
</method> </method>
<method name="distance_squared_to"> <method name="distance_squared_to">
@ -37701,7 +37801,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="b" type="Vector3"> <argument index="0" name="b" type="Vector3">
</argument> </argument>
<description> <description>
Return the squared distance (distance minus the last square root) to b. Return the squared distance (distance minus the last square root) to b. Prefer this function over distance_to if you need to sort vectors or need the squared distance for some formula.
</description> </description>
</method> </method>
<method name="distance_to"> <method name="distance_to">
@ -37726,13 +37826,14 @@ This method controls whether the position between two cached points is interpola
<return type="Vector3"> <return type="Vector3">
</return> </return>
<description> <description>
Returns a new vector with all components rounded down.
</description> </description>
</method> </method>
<method name="inverse"> <method name="inverse">
<return type="Vector3"> <return type="Vector3">
</return> </return>
<description> <description>
Returns the inverse of the vector. this is the same as Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z ) Returns the inverse of the vector. This is the same as Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )
</description> </description>
</method> </method>
<method name="length"> <method name="length">
@ -37746,7 +37847,7 @@ This method controls whether the position between two cached points is interpola
<return type="float"> <return type="float">
</return> </return>
<description> <description>
Return the length of the vector, squared. Return the length of the vector, squared. Prefer this function over "length" if you need to sort vectors or need the squared length for some formula.
</description> </description>
</method> </method>
<method name="linear_interpolate"> <method name="linear_interpolate">
@ -37757,26 +37858,28 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="t" type="float"> <argument index="1" name="t" type="float">
</argument> </argument>
<description> <description>
Linearly interpolates the vector to a given one (b), by the given amount (i). Linearly interpolates the vector to a given one (b), by the given amount (t).
</description> </description>
</method> </method>
<method name="max_axis"> <method name="max_axis">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns AXIS_X, AXIS_Y or AXIS_Z depending on which axis is the largest.
</description> </description>
</method> </method>
<method name="min_axis"> <method name="min_axis">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns AXIS_X, AXIS_Y or AXIS_Z depending on which axis is the smallest.
</description> </description>
</method> </method>
<method name="normalized"> <method name="normalized">
<return type="Vector3"> <return type="Vector3">
</return> </return>
<description> <description>
Return a copy of the normalized vector to unit length. This is the same as v / v.length() Return a copy of the normalized vector to unit length. This is the same as v / v.length().
</description> </description>
</method> </method>
<method name="reflect"> <method name="reflect">
@ -37785,6 +37888,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="by" type="Vector3"> <argument index="0" name="by" type="Vector3">
</argument> </argument>
<description> <description>
Like "slide", but reflects the Vector instead of continuing along the wall.
</description> </description>
</method> </method>
<method name="rotated"> <method name="rotated">
@ -37795,6 +37899,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="phi" type="float"> <argument index="1" name="phi" type="float">
</argument> </argument>
<description> <description>
Rotates the vector around some axis by phi radians.
</description> </description>
</method> </method>
<method name="slide"> <method name="slide">
@ -37803,6 +37908,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="by" type="Vector3"> <argument index="0" name="by" type="Vector3">
</argument> </argument>
<description> <description>
Slides the vector along a wall.
</description> </description>
</method> </method>
<method name="snapped"> <method name="snapped">
@ -37824,6 +37930,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="z" type="float"> <argument index="2" name="z" type="float">
</argument> </argument>
<description> <description>
Returns a Vector3 with the given components.
</description> </description>
</method> </method>
</methods> </methods>
@ -37837,17 +37944,22 @@ This method controls whether the position between two cached points is interpola
</members> </members>
<constants> <constants>
<constant name="AXIS_X" value="0"> <constant name="AXIS_X" value="0">
Enumerated value for the X axis. Returned by functions like max_axis or min_axis.
</constant> </constant>
<constant name="AXIS_Y" value="1"> <constant name="AXIS_Y" value="1">
Enumerated value for the Y axis.
</constant> </constant>
<constant name="AXIS_Z" value="2"> <constant name="AXIS_Z" value="2">
Enumerated value for the Z axis.
</constant> </constant>
</constants> </constants>
</class> </class>
<class name="Vector3Array" category="Built-In Types"> <class name="Vector3Array" category="Built-In Types">
<brief_description> <brief_description>
An Array of Vector3.
</brief_description> </brief_description>
<description> <description>
An Array specifically designed to hold Vector3.
</description> </description>
<methods> <methods>
<method name="get"> <method name="get">
@ -37856,18 +37968,21 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Returns the Vector3 at the given index.
</description> </description>
</method> </method>
<method name="push_back"> <method name="push_back">
<argument index="0" name="vector3" type="Vector3"> <argument index="0" name="vector3" type="Vector3">
</argument> </argument>
<description> <description>
Inserts a Vector3 at the end.
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Sets the size of the Vector3Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
</description> </description>
</method> </method>
<method name="set"> <method name="set">
@ -37876,12 +37991,14 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="vector3" type="Vector3"> <argument index="1" name="vector3" type="Vector3">
</argument> </argument>
<description> <description>
Changes the Vector3 at the given index.
</description> </description>
</method> </method>
<method name="size"> <method name="size">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns the size of the array.
</description> </description>
</method> </method>
<method name="Vector3Array"> <method name="Vector3Array">
@ -37890,6 +38007,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="from" type="Array"> <argument index="0" name="from" type="Array">
</argument> </argument>
<description> <description>
Constructs a new Vector3Array. Optionally, you can pass in an Array that will be converted.
</description> </description>
</method> </method>
</methods> </methods>

View File

@ -575,8 +575,8 @@
3x3 Matrix. 3x3 Matrix.
</brief_description> </brief_description>
<description> <description>
</description>
Matrix represent a 3x3 (3 rows by 3 columns) transformation matrix. it is used mainly to represent and accumulate transformations such as rotation or scale when used as an OCS (oriented coordinate system). Matrix represent a 3x3 (3 rows by 3 columns) transformation matrix. it is used mainly to represent and accumulate transformations such as rotation or scale when used as an OCS (oriented coordinate system).
</description>
<methods> <methods>
<method name="invert"> <method name="invert">
<description> <description>
@ -937,8 +937,8 @@
Vector used for 2D Math. Vector used for 2D Math.
</brief_description> </brief_description>
<description> <description>
</description>
Vector class, which performs basic 2D vector math operations. Vector class, which performs basic 2D vector math operations.
</description>
<methods> <methods>
<method name="operator+"> <method name="operator+">
<argument index="0" name="b" type="Vector2"> <argument index="0" name="b" type="Vector2">

View File

@ -1502,7 +1502,7 @@
<description> <description>
</description> </description>
</method> </method>
<method name="free"> <method name="free_rid">
<argument index="0" name="rid" type="RID"> <argument index="0" name="rid" type="RID">
</argument> </argument>
<description> <description>

View File

@ -4641,6 +4641,9 @@ void RasterizerGLES2::_update_shader( Shader* p_shader) const {
if (light_flags.uses_light) { if (light_flags.uses_light) {
enablers.push_back("#define USE_LIGHT_SHADER_CODE\n"); enablers.push_back("#define USE_LIGHT_SHADER_CODE\n");
} }
if (light_flags.uses_shadow_color) {
enablers.push_back("#define USE_LIGHT_SHADOW_COLOR\n");
}
if (light_flags.uses_time || fragment_flags.uses_time || vertex_flags.uses_time) { if (light_flags.uses_time || fragment_flags.uses_time || vertex_flags.uses_time) {
enablers.push_back("#define USE_TIME\n"); enablers.push_back("#define USE_TIME\n");
uses_time=true; uses_time=true;

View File

@ -221,6 +221,10 @@ String ShaderCompilerGLES2::dump_node_code(SL::Node *p_node,int p_level,bool p_a
uses_light=true; uses_light=true;
} }
if (vnode->name==vname_shadow) {
uses_shadow_color=true;
}
} }
if (type==ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX) { if (type==ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX) {
@ -783,13 +787,14 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() {
replace_table["texscreen"]= "texscreen"; replace_table["texscreen"]= "texscreen";
replace_table["texpos"]= "texpos"; replace_table["texpos"]= "texpos";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["POSITION"] = "gl_Position";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_VERTEX"] = "vertex_in.xyz"; mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_VERTEX"] = "vertex_in.xyz";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_NORMAL"] = "normal_in"; mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_NORMAL"] = "normal_in";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_TANGENT"]="tangent_in"; mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_TANGENT"]="tangent_in";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_BINORMALF"]="binormalf"; mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_BINORMALF"]="binormalf";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["POSITION"] = "gl_Position";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["VERTEX"]="vertex_interp"; mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["VERTEX"]="vertex_interp";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["NORMAL"]="normal_interp"; mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["NORMAL"]="normal_interp";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["TANGENT"]="tangent_interp"; mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["TANGENT"]="tangent_interp";
@ -858,6 +863,7 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() {
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["LIGHT"]="light"; mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["LIGHT"]="light";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["POINT_COORD"]="gl_PointCoord"; mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["POINT_COORD"]="gl_PointCoord";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["TIME"]="time"; mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["TIME"]="time";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["SHADOW"]="shadow_color";
mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["SRC_VERTEX"]="src_vtx"; mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["SRC_VERTEX"]="src_vtx";
mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["VERTEX"]="outvec.xy"; mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["VERTEX"]="outvec.xy";

View File

@ -1175,6 +1175,10 @@ FRAGMENT_SHADER_CODE
vec3 mdiffuse = diffuse.rgb; vec3 mdiffuse = diffuse.rgb;
vec3 light; vec3 light;
#if defined(USE_LIGHT_SHADOW_COLOR)
vec3 shadow_color=vec3(0.0,0.0,0.0);
#endif
#if defined(USE_LIGHT_SHADER_CODE) #if defined(USE_LIGHT_SHADER_CODE)
//light is written by the light shader //light is written by the light shader
{ {
@ -1195,6 +1199,10 @@ LIGHT_SHADER_CODE
#endif #endif
diffuse.rgb = const_light_mult * ambient_light *diffuse.rgb + light * attenuation * shadow_attenuation; diffuse.rgb = const_light_mult * ambient_light *diffuse.rgb + light * attenuation * shadow_attenuation;
#if defined(USE_LIGHT_SHADOW_COLOR)
diffuse.rgb += light * shadow_color * attenuation * (1.0 - shadow_attenuation);
#endif
#ifdef USE_FOG #ifdef USE_FOG
diffuse.rgb = mix(diffuse.rgb,fog_interp.rgb,fog_interp.a); diffuse.rgb = mix(diffuse.rgb,fog_interp.rgb,fog_interp.a);

View File

@ -432,7 +432,6 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas
} else if (I->get()=="-e" || I->get()=="-editor") { // fonud editor } else if (I->get()=="-e" || I->get()=="-editor") { // fonud editor
editor=true; editor=true;
init_maximized=true;
} else if (I->get()=="-nowindow") { // fullscreen } else if (I->get()=="-nowindow") { // fullscreen
OS::get_singleton()->set_no_window_mode(true); OS::get_singleton()->set_no_window_mode(true);
@ -649,6 +648,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas
if (editor) { if (editor) {
main_args.push_back("-editor"); main_args.push_back("-editor");
init_maximized=true;
use_custom_res=false; use_custom_res=false;
} }
@ -876,6 +876,7 @@ Error Main::setup2() {
boot_logo_path = boot_logo_path.strip_edges(); boot_logo_path = boot_logo_path.strip_edges();
if (boot_logo_path!=String() /*&& FileAccess::exists(boot_logo_path)*/) { if (boot_logo_path!=String() /*&& FileAccess::exists(boot_logo_path)*/) {
print_line("Boot splash path: "+boot_logo_path);
Error err = boot_logo.load(boot_logo_path); Error err = boot_logo.load(boot_logo_path);
} }
@ -893,7 +894,7 @@ Error Main::setup2() {
} else { } else {
#ifndef NO_DEFAULT_BOOT_LOGO #ifndef NO_DEFAULT_BOOT_LOGO
MAIN_PRINT("Main: Create botsplash"); MAIN_PRINT("Main: Create bootsplash");
Image splash(boot_splash_png); Image splash(boot_splash_png);
MAIN_PRINT("Main: ClearColor"); MAIN_PRINT("Main: ClearColor");
@ -1085,7 +1086,7 @@ bool Main::start() {
#endif #endif
if(script=="" && game_path=="" && !editor && String(GLOBAL_DEF("application/main_scene",""))!="") { if(script=="" && game_path=="" && String(GLOBAL_DEF("application/main_scene",""))!="") {
game_path=GLOBAL_DEF("application/main_scene",""); game_path=GLOBAL_DEF("application/main_scene","");
} }

View File

@ -371,8 +371,8 @@ public class GodotView extends GLSurfaceView {
if (use_32) { if (use_32) {
setEGLConfigChooser( translucent ? setEGLConfigChooser( translucent ?
new ConfigChooser(8, 8, 8, 8, 24, stencil) : new FallbackConfigChooser(8, 8, 8, 8, 24, stencil, new ConfigChooser(8, 8, 8, 8, 16, stencil)) :
new ConfigChooser(8, 8, 8, 8, 24, stencil) ); new FallbackConfigChooser(8, 8, 8, 8, 24, stencil, new ConfigChooser(5, 6, 5, 0, 16, stencil)) );
} else { } else {
setEGLConfigChooser( translucent ? setEGLConfigChooser( translucent ?
@ -410,6 +410,25 @@ public class GodotView extends GLSurfaceView {
Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error)); Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error));
} }
} }
/* Fallback if 32bit View is not supported*/
private static class FallbackConfigChooser extends ConfigChooser {
private ConfigChooser fallback;
public FallbackConfigChooser(int r, int g, int b, int a, int depth, int stencil, ConfigChooser fallback) {
super(r, g, b, a, depth, stencil);
this.fallback = fallback;
}
@Override
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display, EGLConfig[] configs) {
EGLConfig ec = super.chooseConfig(egl, display, configs);
if (ec == null) {
Log.w(TAG, "Trying ConfigChooser fallback");
ec = fallback.chooseConfig(egl, display, configs);
}
return ec;
}
}
private static class ConfigChooser implements GLSurfaceView.EGLConfigChooser { private static class ConfigChooser implements GLSurfaceView.EGLConfigChooser {

View File

@ -308,7 +308,9 @@ void AcceptDialog::_bind_methods() {
ADD_SIGNAL( MethodInfo("confirmed") ); ADD_SIGNAL( MethodInfo("confirmed") );
ADD_SIGNAL( MethodInfo("custom_action",PropertyInfo(Variant::STRING,"action")) ); ADD_SIGNAL( MethodInfo("custom_action",PropertyInfo(Variant::STRING,"action")) );
ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"dialog/text",PROPERTY_HINT_MULTILINE_TEXT,"",PROPERTY_USAGE_DEFAULT_INTL),_SCS("set_text"),_SCS("get_text"));
ADD_PROPERTY( PropertyInfo(Variant::BOOL, "dialog/hide_on_ok"),_SCS("set_hide_on_ok"),_SCS("get_hide_on_ok") );
} }

View File

@ -170,7 +170,14 @@ void PopupMenu::_activate_submenu(int over) {
Point2 p = get_global_pos(); Point2 p = get_global_pos();
Rect2 pr(p,get_size()); Rect2 pr(p,get_size());
Ref<StyleBox> style = get_stylebox("panel"); Ref<StyleBox> style = get_stylebox("panel");
pm->set_pos(p+Point2(get_size().width,items[over]._ofs_cache-style->get_offset().y));
Point2 pos = p+Point2(get_size().width,items[over]._ofs_cache-style->get_offset().y);
Size2 size = pm->get_size();
// fix pos
if (pos.x+size.width > get_viewport_rect().size.width)
pos.x=p.x-size.width;
pm->set_pos(pos);
pm->popup(); pm->popup();
PopupMenu *pum = pm->cast_to<PopupMenu>(); PopupMenu *pum = pm->cast_to<PopupMenu>();

View File

@ -1435,6 +1435,7 @@ const ShaderGraph::InOutParamInfo ShaderGraph::inout_param_info[]={
{MODE_MATERIAL,SHADER_TYPE_LIGHT,"ShadeParam","SHADE_PARAM","",SLOT_TYPE_SCALAR,SLOT_IN}, {MODE_MATERIAL,SHADER_TYPE_LIGHT,"ShadeParam","SHADE_PARAM","",SLOT_TYPE_SCALAR,SLOT_IN},
//light out //light out
{MODE_MATERIAL,SHADER_TYPE_LIGHT,"Light","LIGHT","",SLOT_TYPE_VEC,SLOT_OUT}, {MODE_MATERIAL,SHADER_TYPE_LIGHT,"Light","LIGHT","",SLOT_TYPE_VEC,SLOT_OUT},
{MODE_MATERIAL,SHADER_TYPE_LIGHT,"Shadow", "SHADOW", "",SLOT_TYPE_VEC, SLOT_OUT },
//canvas item vertex in //canvas item vertex in
{MODE_CANVAS_ITEM,SHADER_TYPE_VERTEX,"Vertex","vec3(SRC_VERTEX,0)","",SLOT_TYPE_VEC,SLOT_IN}, {MODE_CANVAS_ITEM,SHADER_TYPE_VERTEX,"Vertex","vec3(SRC_VERTEX,0)","",SLOT_TYPE_VEC,SLOT_IN},
{MODE_CANVAS_ITEM,SHADER_TYPE_VERTEX,"UV","SRC_UV","",SLOT_TYPE_VEC,SLOT_IN}, {MODE_CANVAS_ITEM,SHADER_TYPE_VERTEX,"UV","SRC_UV","",SLOT_TYPE_VEC,SLOT_IN},

View File

@ -132,7 +132,7 @@ void AudioServer::_bind_methods() {
ObjectTypeDB::bind_method(_MD("voice_stop","voice"), &AudioServer::voice_stop ); ObjectTypeDB::bind_method(_MD("voice_stop","voice"), &AudioServer::voice_stop );
ObjectTypeDB::bind_method(_MD("free","rid"), &AudioServer::free ); ObjectTypeDB::bind_method(_MD("free_rid","rid"), &AudioServer::free );
ObjectTypeDB::bind_method(_MD("set_stream_global_volume_scale","scale"), &AudioServer::set_stream_global_volume_scale ); ObjectTypeDB::bind_method(_MD("set_stream_global_volume_scale","scale"), &AudioServer::set_stream_global_volume_scale );
ObjectTypeDB::bind_method(_MD("get_stream_global_volume_scale"), &AudioServer::get_stream_global_volume_scale ); ObjectTypeDB::bind_method(_MD("get_stream_global_volume_scale"), &AudioServer::get_stream_global_volume_scale );

View File

@ -1113,7 +1113,8 @@ const ShaderLanguage::BuiltinsDef ShaderLanguage::light_builtins_defs[]={
{ "SPECULAR_EXP", TYPE_FLOAT}, { "SPECULAR_EXP", TYPE_FLOAT},
{ "SHADE_PARAM", TYPE_FLOAT}, { "SHADE_PARAM", TYPE_FLOAT},
{ "LIGHT", TYPE_VEC3}, { "LIGHT", TYPE_VEC3},
{ "POINT_COORD", TYPE_VEC2}, { "SHADOW", TYPE_VEC3 },
{ "POINT_COORD", TYPE_VEC2 },
// { "SCREEN_POS", TYPE_VEC2}, // { "SCREEN_POS", TYPE_VEC2},
// { "SCREEN_TEXEL_SIZE", TYPE_VEC2}, // { "SCREEN_TEXEL_SIZE", TYPE_VEC2},
{ "TIME", TYPE_FLOAT}, { "TIME", TYPE_FLOAT},

View File

@ -2011,6 +2011,11 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
} break;
case SCENE_TAB_CLOSE: {
_remove_scene(tab_closing);
_update_scene_tabs();
current_option = -1;
} break; } break;
case FILE_SAVE_SCENE: { case FILE_SAVE_SCENE: {
@ -2023,7 +2028,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
return; return;
}; };
// fallthrough to save_as // fallthrough to save_as
}; } break;
case FILE_SAVE_AS_SCENE: { case FILE_SAVE_AS_SCENE: {
Node *scene = editor_data.get_edited_scene_root(); Node *scene = editor_data.get_edited_scene_root();
@ -2957,23 +2962,23 @@ void EditorNode::_remove_edited_scene() {
_update_title(); _update_title();
_update_scene_tabs(); _update_scene_tabs();
if (editor_data.get_edited_scene_count()==1) { // if (editor_data.get_edited_scene_count()==1) {
//make new scene appear saved // //make new scene appear saved
set_current_version(editor_data.get_undo_redo().get_version()); // set_current_version(editor_data.get_undo_redo().get_version());
unsaved_cache=false; // unsaved_cache=false;
} // }
} }
void EditorNode::_remove_scene(int index) { void EditorNode::_remove_scene(int index) {
// printf("Attempting to remove scene %d (current is %d)\n", index, editor_data.get_edited_scene()); // printf("Attempting to remove scene %d (current is %d)\n", index, editor_data.get_edited_scene());
if (editor_data.get_edited_scene() == index) { if (editor_data.get_edited_scene() == index) {
//Scene to remove is current scene //Scene to remove is current scene
_remove_edited_scene(); _remove_edited_scene();
} }
else { else {
// Scene to remove is not active scene."); // Scene to remove is not active scene
editor_data.remove_scene(index); editor_data.remove_scene(index);
editor_data.get_undo_redo().clear_history();
} }
} }
@ -4019,6 +4024,8 @@ void EditorNode::_bind_methods() {
ObjectTypeDB::bind_method("_prepare_history",&EditorNode::_prepare_history); ObjectTypeDB::bind_method("_prepare_history",&EditorNode::_prepare_history);
ObjectTypeDB::bind_method("_select_history",&EditorNode::_select_history); ObjectTypeDB::bind_method("_select_history",&EditorNode::_select_history);
ObjectTypeDB::bind_method("_toggle_search_bar",&EditorNode::_toggle_search_bar);
ObjectTypeDB::bind_method("_clear_search_box",&EditorNode::_clear_search_box);
ObjectTypeDB::bind_method(_MD("add_editor_import_plugin", "plugin"), &EditorNode::add_editor_import_plugin); ObjectTypeDB::bind_method(_MD("add_editor_import_plugin", "plugin"), &EditorNode::add_editor_import_plugin);
ObjectTypeDB::bind_method(_MD("remove_editor_import_plugin", "plugin"), &EditorNode::remove_editor_import_plugin); ObjectTypeDB::bind_method(_MD("remove_editor_import_plugin", "plugin"), &EditorNode::remove_editor_import_plugin);
@ -4467,8 +4474,19 @@ void EditorNode::_scene_tab_script_edited(int p_tab) {
} }
void EditorNode::_scene_tab_closed(int p_tab) { void EditorNode::_scene_tab_closed(int p_tab) {
_remove_scene(p_tab); current_option = SCENE_TAB_CLOSE;
_update_scene_tabs(); tab_closing = p_tab;
if (unsaved_cache) {
confirmation->get_ok()->set_text("Yes");
//confirmation->get_cancel()->show();
confirmation->set_text("Close scene? (Unsaved changes will be lost)");
confirmation->popup_centered_minsize();
}
else {
_remove_scene(p_tab);
//_update_scene_tabs();
}
} }
@ -4501,6 +4519,30 @@ void EditorNode::_scene_tab_changed(int p_tab) {
} }
void EditorNode::_toggle_search_bar(bool p_pressed) {
property_editor->set_use_filter(p_pressed);
if (p_pressed) {
search_bar->show();
search_box->grab_focus();
search_box->select_all();
} else {
search_bar->hide();
}
}
void EditorNode::_clear_search_box() {
if (search_box->get_text()=="")
return;
search_box->clear();
property_editor->update_tree();
}
EditorNode::EditorNode() { EditorNode::EditorNode() {
EditorHelp::generate_doc(); //before any editor classes are crated EditorHelp::generate_doc(); //before any editor classes are crated
@ -5306,6 +5348,12 @@ EditorNode::EditorNode() {
editor_path->set_h_size_flags(Control::SIZE_EXPAND_FILL); editor_path->set_h_size_flags(Control::SIZE_EXPAND_FILL);
prop_editor_hb->add_child(editor_path); prop_editor_hb->add_child(editor_path);
search_button = memnew( ToolButton );
search_button->set_toggle_mode(true);
search_button->set_pressed(false);
search_button->set_icon(gui_base->get_icon("Zoom","EditorIcons"));
prop_editor_hb->add_child(search_button);
search_button->connect("toggled",this,"_toggle_search_bar");
object_menu = memnew( MenuButton ); object_menu = memnew( MenuButton );
object_menu->set_icon(gui_base->get_icon("Tools","EditorIcons")); object_menu->set_icon(gui_base->get_icon("Tools","EditorIcons"));
@ -5317,6 +5365,22 @@ EditorNode::EditorNode() {
create_dialog->set_base_type("Resource"); create_dialog->set_base_type("Resource");
create_dialog->connect("create",this,"_resource_created"); create_dialog->connect("create",this,"_resource_created");
search_bar = memnew( HBoxContainer );
search_bar->set_h_size_flags(Control::SIZE_EXPAND_FILL);
prop_editor_base->add_child(search_bar);
search_bar->hide();
l = memnew( Label("Search: ") );
search_bar->add_child(l);
search_box = memnew( LineEdit );
search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
search_bar->add_child(search_box);
ToolButton *clear_button = memnew( ToolButton );
clear_button->set_icon(gui_base->get_icon("Close","EditorIcons"));
search_bar->add_child(clear_button);
clear_button->connect("pressed",this,"_clear_search_box");
property_editor = memnew( PropertyEditor ); property_editor = memnew( PropertyEditor );
property_editor->set_autoclear(true); property_editor->set_autoclear(true);
@ -5325,6 +5389,7 @@ EditorNode::EditorNode() {
property_editor->set_use_doc_hints(true); property_editor->set_use_doc_hints(true);
property_editor->hide_top_label(); property_editor->hide_top_label();
property_editor->register_text_enter(search_box);
prop_editor_base->add_child( property_editor ); prop_editor_base->add_child( property_editor );
property_editor->set_undo_redo(&editor_data.get_undo_redo()); property_editor->set_undo_redo(&editor_data.get_undo_redo());

View File

@ -173,6 +173,7 @@ class EditorNode : public Node {
SOURCES_REIMPORT, SOURCES_REIMPORT,
DEPENDENCY_LOAD_CHANGED_IMAGES, DEPENDENCY_LOAD_CHANGED_IMAGES,
DEPENDENCY_UPDATE_IMPORTED, DEPENDENCY_UPDATE_IMPORTED,
SCENE_TAB_CLOSE,
IMPORT_PLUGIN_BASE=100, IMPORT_PLUGIN_BASE=100,
@ -217,6 +218,7 @@ class EditorNode : public Node {
//main tabs //main tabs
Tabs *scene_tabs; Tabs *scene_tabs;
int tab_closing;
int old_split_ofs; int old_split_ofs;
@ -248,6 +250,7 @@ class EditorNode : public Node {
ToolButton *play_scene_button; ToolButton *play_scene_button;
ToolButton *play_custom_scene_button; ToolButton *play_custom_scene_button;
MenuButton *debug_button; MenuButton *debug_button;
ToolButton *search_button;
TextureProgress *audio_vu; TextureProgress *audio_vu;
//MenuButton *fileserver_menu; //MenuButton *fileserver_menu;
@ -266,6 +269,9 @@ class EditorNode : public Node {
ScenesDock *scenes_dock; ScenesDock *scenes_dock;
EditorRunNative *run_native; EditorRunNative *run_native;
HBoxContainer *search_bar;
LineEdit *search_box;
CreateDialog *create_dialog; CreateDialog *create_dialog;
CallDialog *call_dialog; CallDialog *call_dialog;
@ -515,6 +521,9 @@ class EditorNode : public Node {
void _save_docks(); void _save_docks();
void _load_docks(); void _load_docks();
void _toggle_search_bar(bool p_pressed);
void _clear_search_box();
protected: protected:
void _notification(int p_what); void _notification(int p_what);
static void _bind_methods(); static void _bind_methods();

View File

@ -624,11 +624,6 @@ void ProjectManager::_open_project_confirm() {
args.push_back("-editor"); args.push_back("-editor");
const String &selected_main = E->get();
if (selected_main!="") {
args.push_back(selected_main);
}
String exec = OS::get_singleton()->get_executable_path(); String exec = OS::get_singleton()->get_executable_path();
OS::ProcessID pid=0; OS::ProcessID pid=0;

View File

@ -59,6 +59,9 @@ void ProjectSettings::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) { if (p_what==NOTIFICATION_ENTER_TREE) {
search_button->set_icon(get_icon("Zoom","EditorIcons"));
clear_button->set_icon(get_icon("Close","EditorIcons"));
translation_list->connect("button_pressed",this,"_translation_delete"); translation_list->connect("button_pressed",this,"_translation_delete");
_update_actions(); _update_actions();
popup_add->add_icon_item(get_icon("Keyboard","EditorIcons"),"Key",InputEvent::KEY); popup_add->add_icon_item(get_icon("Keyboard","EditorIcons"),"Key",InputEvent::KEY);
@ -1171,6 +1174,31 @@ void ProjectSettings::_update_autoload() {
} }
void ProjectSettings::_toggle_search_bar(bool p_pressed) {
globals_editor->set_use_filter(p_pressed);
if (p_pressed) {
search_bar->show();
add_prop_bar->hide();
search_box->grab_focus();
search_box->select_all();
} else {
search_bar->hide();
add_prop_bar->show();
}
}
void ProjectSettings::_clear_search_box() {
if (search_box->get_text()=="")
return;
search_box->clear();
globals_editor->update_tree();
}
void ProjectSettings::_bind_methods() { void ProjectSettings::_bind_methods() {
@ -1212,6 +1240,9 @@ void ProjectSettings::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_update_autoload"),&ProjectSettings::_update_autoload); ObjectTypeDB::bind_method(_MD("_update_autoload"),&ProjectSettings::_update_autoload);
ObjectTypeDB::bind_method(_MD("_autoload_delete"),&ProjectSettings::_autoload_delete); ObjectTypeDB::bind_method(_MD("_autoload_delete"),&ProjectSettings::_autoload_delete);
ObjectTypeDB::bind_method(_MD("_clear_search_box"),&ProjectSettings::_clear_search_box);
ObjectTypeDB::bind_method(_MD("_toggle_search_bar"),&ProjectSettings::_toggle_search_bar);
} }
ProjectSettings::ProjectSettings(EditorData *p_data) { ProjectSettings::ProjectSettings(EditorData *p_data) {
@ -1232,87 +1263,93 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
//tab_container->set_anchor_and_margin(MARGIN_TOP,ANCHOR_BEGIN, 15 ); //tab_container->set_anchor_and_margin(MARGIN_TOP,ANCHOR_BEGIN, 15 );
//tab_container->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_END, 35 ); //tab_container->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_END, 35 );
Control *props_base = memnew( Control ); VBoxContainer *props_base = memnew( VBoxContainer );
props_base->set_alignment(BoxContainer::ALIGN_BEGIN);
props_base->set_v_size_flags(Control::SIZE_EXPAND_FILL);
tab_container->add_child(props_base); tab_container->add_child(props_base);
props_base->set_name("General"); props_base->set_name("General");
globals_editor = memnew( PropertyEditor );
props_base->add_child(globals_editor);
globals_editor->set_area_as_parent_rect();
globals_editor->hide_top_label();
globals_editor->set_anchor_and_margin(MARGIN_TOP,ANCHOR_BEGIN, 55 );
globals_editor->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_END, 35 );
globals_editor->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_BEGIN, 5 );
globals_editor->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END, 5 );
globals_editor->set_capitalize_paths(false);
globals_editor->get_scene_tree()->connect("cell_selected",this,"_item_selected");
globals_editor->connect("property_toggled",this,"_item_checked");
globals_editor->connect("property_edited",this,"_settings_prop_edited");
HBoxContainer *hbc = memnew( HBoxContainer );
hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
props_base->add_child(hbc);
search_button = memnew( ToolButton );
search_button->set_toggle_mode(true);
search_button->set_pressed(false);
search_button->set_text("Search");
hbc->add_child(search_button);
search_button->connect("toggled",this,"_toggle_search_bar");
hbc->add_child( memnew( VSeparator ) );
add_prop_bar = memnew( HBoxContainer );
add_prop_bar->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hbc->add_child(add_prop_bar);
Label *l = memnew( Label ); Label *l = memnew( Label );
props_base->add_child(l); add_prop_bar->add_child(l);
l->set_pos(Point2(6,5));
l->set_text("Category:"); l->set_text("Category:");
l = memnew( Label );
l->set_anchor(MARGIN_LEFT,ANCHOR_RATIO);
props_base->add_child(l);
l->set_begin(Point2(0.21,5));
l->set_text("Property:");
l = memnew( Label );
l->set_anchor(MARGIN_LEFT,ANCHOR_RATIO);
props_base->add_child(l);
l->set_begin(Point2(0.51,5));
l->set_text("Type:");
category = memnew( LineEdit ); category = memnew( LineEdit );
props_base->add_child(category); category->set_h_size_flags(Control::SIZE_EXPAND_FILL);
category->set_anchor(MARGIN_RIGHT,ANCHOR_RATIO); add_prop_bar->add_child(category);
category->set_begin( Point2(5,25) );
category->set_end( Point2(0.20,26) );
category->connect("text_entered",this,"_item_adds"); category->connect("text_entered",this,"_item_adds");
l = memnew( Label );
add_prop_bar->add_child(l);
l->set_text("Property:");
property = memnew( LineEdit ); property = memnew( LineEdit );
props_base->add_child(property); property->set_h_size_flags(Control::SIZE_EXPAND_FILL);
property->set_anchor(MARGIN_LEFT,ANCHOR_RATIO); add_prop_bar->add_child(property);
property->set_anchor(MARGIN_RIGHT,ANCHOR_RATIO);
property->set_begin( Point2(0.21,25) );
property->set_end( Point2(0.50,26) );
property->connect("text_entered",this,"_item_adds"); property->connect("text_entered",this,"_item_adds");
l = memnew( Label );
add_prop_bar->add_child(l);
l->set_text("Type:");
type = memnew( OptionButton ); type = memnew( OptionButton );
props_base->add_child(type); type->set_h_size_flags(Control::SIZE_EXPAND_FILL);
type->set_anchor(MARGIN_LEFT,ANCHOR_RATIO); add_prop_bar->add_child(type);
type->set_anchor(MARGIN_RIGHT,ANCHOR_RATIO);
type->set_begin( Point2(0.51,25) );
type->set_end( Point2(0.70,26) );
type->add_item("bool"); type->add_item("bool");
type->add_item("int"); type->add_item("int");
type->add_item("float"); type->add_item("float");
type->add_item("string"); type->add_item("string");
Button *add = memnew( Button ); Button *add = memnew( Button );
props_base->add_child(add); add_prop_bar->add_child(add);
add->set_anchor(MARGIN_LEFT,ANCHOR_RATIO);
add->set_anchor(MARGIN_RIGHT,ANCHOR_RATIO);
add->set_begin( Point2(0.71,25) );
add->set_end( Point2(0.85,26) );
add->set_text("Add"); add->set_text("Add");
add->connect("pressed",this,"_item_add"); add->connect("pressed",this,"_item_add");
Button *del = memnew( Button ); Button *del = memnew( Button );
props_base->add_child(del); add_prop_bar->add_child(del);
del->set_anchor(MARGIN_LEFT,ANCHOR_RATIO);
del->set_anchor(MARGIN_RIGHT,ANCHOR_END);
del->set_begin( Point2(0.86,25) );
del->set_end( Point2(5,26) );
del->set_text("Del"); del->set_text("Del");
del->connect("pressed",this,"_item_del"); del->connect("pressed",this,"_item_del");
/* search_bar = memnew( HBoxContainer );
search_bar->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hbc->add_child(search_bar);
search_bar->hide();
search_box = memnew( LineEdit );
search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
search_bar->add_child(search_box);
clear_button = memnew( ToolButton );
search_bar->add_child(clear_button);
clear_button->connect("pressed",this,"_clear_search_box");
globals_editor = memnew( PropertyEditor );
props_base->add_child(globals_editor);
globals_editor->hide_top_label();
globals_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
globals_editor->register_text_enter(search_box);
globals_editor->set_capitalize_paths(false);
globals_editor->get_scene_tree()->connect("cell_selected",this,"_item_selected");
globals_editor->connect("property_toggled",this,"_item_checked");
globals_editor->connect("property_edited",this,"_settings_prop_edited");
/*
Button *save = memnew( Button ); Button *save = memnew( Button );
props_base->add_child(save); props_base->add_child(save);
@ -1325,17 +1362,16 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
save->set_text("Save"); save->set_text("Save");
save->connect("pressed",this,"_save"); save->connect("pressed",this,"_save");
*/ */
hbc = memnew( HBoxContainer );
props_base->add_child(hbc);
popup_platform = memnew( MenuButton ); popup_platform = memnew( MenuButton );
popup_platform->set_text("Copy To Platform.."); popup_platform->set_text("Copy To Platform..");
popup_platform->set_disabled(true); popup_platform->set_disabled(true);
props_base->add_child(popup_platform); hbc->add_child(popup_platform);
popup_platform->set_anchor(MARGIN_LEFT,ANCHOR_BEGIN); hbc->add_spacer();
popup_platform->set_anchor(MARGIN_RIGHT,ANCHOR_BEGIN);
popup_platform->set_anchor(MARGIN_TOP,ANCHOR_END);
popup_platform->set_anchor(MARGIN_BOTTOM,ANCHOR_END);
popup_platform->set_begin( Point2(10,28) );
popup_platform->set_end( Point2(150,20) );
List<StringName> ep; List<StringName> ep;
EditorImportExport::get_singleton()->get_export_platforms(&ep); EditorImportExport::get_singleton()->get_export_platforms(&ep);

View File

@ -47,6 +47,12 @@ class ProjectSettings : public AcceptDialog {
UndoRedo *undo_redo; UndoRedo *undo_redo;
PropertyEditor *globals_editor; PropertyEditor *globals_editor;
HBoxContainer *search_bar;
ToolButton *search_button;
LineEdit *search_box;
ToolButton *clear_button;
HBoxContainer *add_prop_bar;
ConfirmationDialog *message; ConfirmationDialog *message;
LineEdit *category; LineEdit *category;
LineEdit *property; LineEdit *property;
@ -130,6 +136,9 @@ class ProjectSettings : public AcceptDialog {
void _translation_res_option_changed(); void _translation_res_option_changed();
void _translation_res_option_delete(Object *p_item,int p_column, int p_button); void _translation_res_option_delete(Object *p_item,int p_column, int p_button);
void _toggle_search_bar(bool p_pressed);
void _clear_search_box();
ProjectSettings(); ProjectSettings();

View File

@ -2363,6 +2363,8 @@ void PropertyEditor::update_tree() {
TreeItem * current_category=NULL; TreeItem * current_category=NULL;
String filter = search_box ? search_box->get_text() : "";
for (List<PropertyInfo>::Element *I=plist.front() ; I ; I=I->next()) { for (List<PropertyInfo>::Element *I=plist.front() ; I ; I=I->next()) {
PropertyInfo& p = I->get(); PropertyInfo& p = I->get();
@ -2426,7 +2428,24 @@ void PropertyEditor::update_tree() {
} else if ( ! (p.usage&PROPERTY_USAGE_EDITOR ) ) } else if ( ! (p.usage&PROPERTY_USAGE_EDITOR ) )
continue; continue;
String name = (p.name.find("/")!=-1)?p.name.right( p.name.find_last("/")+1 ):p.name;
if (capitalize_paths)
name = name.camelcase_to_underscore().capitalize();
String path=p.name.left( p.name.find_last("/") ) ; String path=p.name.left( p.name.find_last("/") ) ;
if (use_filter && filter!="") {
String cat = path;
if (capitalize_paths)
cat = cat.capitalize();
if (cat.findn(filter)==-1 && name.findn(filter)==-1)
continue;
}
//printf("property %s\n",p.name.ascii().get_data()); //printf("property %s\n",p.name.ascii().get_data());
TreeItem * parent = get_parent_node(path,item_path,current_category?current_category:root ); TreeItem * parent = get_parent_node(path,item_path,current_category?current_category:root );
//if (parent->get_parent()==root) //if (parent->get_parent()==root)
@ -2448,8 +2467,6 @@ void PropertyEditor::update_tree() {
TreeItem * item = tree->create_item( parent ); TreeItem * item = tree->create_item( parent );
String name = (p.name.find("/")!=-1)?p.name.right( p.name.find_last("/")+1 ):p.name;
if (level>0) { if (level>0) {
item->set_custom_bg_color(0,col); item->set_custom_bg_color(0,col);
//item->set_custom_bg_color(1,col); //item->set_custom_bg_color(1,col);
@ -2465,11 +2482,7 @@ void PropertyEditor::update_tree() {
item->set_checked(0,p.usage&PROPERTY_USAGE_CHECKED); item->set_checked(0,p.usage&PROPERTY_USAGE_CHECKED);
} }
if (capitalize_paths) item->set_text(0, name);
item->set_text( 0, name.camelcase_to_underscore().capitalize() );
else
item->set_text( 0, name );
item->set_tooltip(0, p.name); item->set_tooltip(0, p.name);
if (use_doc_hints) { if (use_doc_hints) {
@ -3403,6 +3416,11 @@ void PropertyEditor::_draw_flags(Object *t,const Rect2& p_rect) {
} }
void PropertyEditor::_filter_changed(const String& p_text) {
update_tree();
}
void PropertyEditor::_bind_methods() { void PropertyEditor::_bind_methods() {
ObjectTypeDB::bind_method( "_item_edited",&PropertyEditor::_item_edited); ObjectTypeDB::bind_method( "_item_edited",&PropertyEditor::_item_edited);
@ -3415,6 +3433,7 @@ void PropertyEditor::_bind_methods() {
ObjectTypeDB::bind_method( "_changed_callback",&PropertyEditor::_changed_callbacks); ObjectTypeDB::bind_method( "_changed_callback",&PropertyEditor::_changed_callbacks);
ObjectTypeDB::bind_method( "_draw_flags",&PropertyEditor::_draw_flags); ObjectTypeDB::bind_method( "_draw_flags",&PropertyEditor::_draw_flags);
ObjectTypeDB::bind_method( "_set_range_def",&PropertyEditor::_set_range_def); ObjectTypeDB::bind_method( "_set_range_def",&PropertyEditor::_set_range_def);
ObjectTypeDB::bind_method( "_filter_changed",&PropertyEditor::_filter_changed);
ADD_SIGNAL( MethodInfo("property_toggled",PropertyInfo( Variant::STRING, "property"),PropertyInfo( Variant::BOOL, "value"))); ADD_SIGNAL( MethodInfo("property_toggled",PropertyInfo( Variant::STRING, "property"),PropertyInfo( Variant::BOOL, "value")));
ADD_SIGNAL( MethodInfo("resource_selected", PropertyInfo( Variant::OBJECT, "res"),PropertyInfo( Variant::STRING, "prop") ) ); ADD_SIGNAL( MethodInfo("resource_selected", PropertyInfo( Variant::OBJECT, "res"),PropertyInfo( Variant::STRING, "prop") ) );
@ -3469,12 +3488,32 @@ void PropertyEditor::set_show_categories(bool p_show) {
update_tree(); update_tree();
} }
void PropertyEditor::set_use_filter(bool p_use) {
if (p_use==use_filter)
return;
use_filter=p_use;
update_tree();
}
void PropertyEditor::register_text_enter(Node* p_line_edit) {
ERR_FAIL_NULL(p_line_edit);
search_box=p_line_edit->cast_to<LineEdit>();
if (search_box)
search_box->connect("text_changed",this,"_filter_changed");
}
PropertyEditor::PropertyEditor() { PropertyEditor::PropertyEditor() {
_prop_edited="property_edited"; _prop_edited="property_edited";
_prop_edited_name.push_back(String()); _prop_edited_name.push_back(String());
undo_redo=NULL; undo_redo=NULL;
obj=NULL; obj=NULL;
search_box=NULL;
changing=false; changing=false;
update_tree_pending=false; update_tree_pending=false;
@ -3527,7 +3566,9 @@ PropertyEditor::PropertyEditor() {
show_categories=false; show_categories=false;
refresh_countdown=0; refresh_countdown=0;
use_doc_hints=false; use_doc_hints=false;
use_filter=false;
} }

View File

@ -147,6 +147,7 @@ class PropertyEditor : public Control {
Tree *tree; Tree *tree;
Label *top_label; Label *top_label;
//Object *object; //Object *object;
LineEdit *search_box;
Object* obj; Object* obj;
@ -163,6 +164,8 @@ class PropertyEditor : public Control {
float refresh_countdown; float refresh_countdown;
bool use_doc_hints; bool use_doc_hints;
bool use_filter;
HashMap<String,String> pending; HashMap<String,String> pending;
String selected_property; String selected_property;
@ -201,6 +204,8 @@ class PropertyEditor : public Control {
void _refresh_item(TreeItem *p_item); void _refresh_item(TreeItem *p_item);
void _set_range_def(Object *p_item, String prop, float p_frame); void _set_range_def(Object *p_item, String prop, float p_frame);
void _filter_changed(const String& p_text);
UndoRedo *undo_redo; UndoRedo *undo_redo;
protected: protected:
@ -230,7 +235,10 @@ public:
void set_show_categories(bool p_show); void set_show_categories(bool p_show);
void set_use_doc_hints(bool p_enable) { use_doc_hints=p_enable; } void set_use_doc_hints(bool p_enable) { use_doc_hints=p_enable; }
void set_use_filter(bool p_use);
void register_text_enter(Node *p_line_edit);
PropertyEditor(); PropertyEditor();
~PropertyEditor(); ~PropertyEditor();

View File

@ -1264,7 +1264,10 @@ void SceneTreeDock::import_subscene() {
void SceneTreeDock::_import_subscene() { void SceneTreeDock::_import_subscene() {
Node* parent = scene_tree->get_selected(); Node* parent = scene_tree->get_selected();
ERR_FAIL_COND(!parent); if (!parent) {
parent = editor_data->get_edited_scene_root();
ERR_FAIL_COND(!parent);
}
import_subscene_dialog->move(parent,edited_scene); import_subscene_dialog->move(parent,edited_scene);
editor_data->get_undo_redo().clear_history(); //no undo for now.. editor_data->get_undo_redo().clear_history(); //no undo for now..

View File

@ -72,6 +72,10 @@ void EditorSettingsDialog::popup_edit_settings() {
property_editor->edit(EditorSettings::get_singleton()); property_editor->edit(EditorSettings::get_singleton());
property_editor->update_tree(); property_editor->update_tree();
search_box->select_all();
search_box->grab_focus();
popup_centered_ratio(0.7); popup_centered_ratio(0.7);
} }
@ -244,11 +248,21 @@ void EditorSettingsDialog::_update_plugins() {
} }
void EditorSettingsDialog::_clear_search_box() {
if (search_box->get_text()=="")
return;
search_box->clear();
property_editor->update_tree();
}
void EditorSettingsDialog::_notification(int p_what) { void EditorSettingsDialog::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) { if (p_what==NOTIFICATION_ENTER_TREE) {
rescan_plugins->set_icon(get_icon("Reload","EditorIcons")); rescan_plugins->set_icon(get_icon("Reload","EditorIcons"));
clear_button->set_icon(get_icon("Close","EditorIcons"));
_update_plugins(); _update_plugins();
} }
} }
@ -261,6 +275,7 @@ void EditorSettingsDialog::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_plugin_settings"),&EditorSettingsDialog::_plugin_settings); ObjectTypeDB::bind_method(_MD("_plugin_settings"),&EditorSettingsDialog::_plugin_settings);
ObjectTypeDB::bind_method(_MD("_plugin_edited"),&EditorSettingsDialog::_plugin_edited); ObjectTypeDB::bind_method(_MD("_plugin_edited"),&EditorSettingsDialog::_plugin_edited);
ObjectTypeDB::bind_method(_MD("_plugin_install"),&EditorSettingsDialog::_plugin_install); ObjectTypeDB::bind_method(_MD("_plugin_install"),&EditorSettingsDialog::_plugin_install);
ObjectTypeDB::bind_method(_MD("_clear_search_box"),&EditorSettingsDialog::_clear_search_box);
} }
EditorSettingsDialog::EditorSettingsDialog() { EditorSettingsDialog::EditorSettingsDialog() {
@ -271,16 +286,38 @@ EditorSettingsDialog::EditorSettingsDialog() {
add_child(tabs); add_child(tabs);
set_child_rect(tabs); set_child_rect(tabs);
VBoxContainer *vbc = memnew( VBoxContainer );
tabs->add_child(vbc);
vbc->set_name("General");
HBoxContainer *hbc = memnew( HBoxContainer );
hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
vbc->add_child(hbc);
Label *l = memnew( Label );
l->set_text("Search: ");
hbc->add_child(l);
search_box = memnew( LineEdit );
search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hbc->add_child(search_box);
clear_button = memnew( ToolButton );
hbc->add_child(clear_button);
clear_button->connect("pressed",this,"_clear_search_box");
property_editor = memnew( PropertyEditor ); property_editor = memnew( PropertyEditor );
property_editor->hide_top_label(); property_editor->hide_top_label();
tabs->add_child(property_editor); property_editor->set_use_filter(true);
property_editor->set_name("General"); property_editor->register_text_enter(search_box);
property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
vbc->add_child(property_editor);
VBoxContainer *vbc = memnew( VBoxContainer ); vbc = memnew( VBoxContainer );
tabs->add_child(vbc); tabs->add_child(vbc);
vbc->set_name("Plugins"); vbc->set_name("Plugins");
HBoxContainer *hbc = memnew( HBoxContainer ); hbc = memnew( HBoxContainer );
vbc->add_child(hbc); vbc->add_child(hbc);
hbc->add_child( memnew( Label("Plugin List: "))); hbc->add_child( memnew( Label("Plugin List: ")));
hbc->add_spacer(); hbc->add_spacer();

View File

@ -51,6 +51,8 @@ class EditorSettingsDialog : public AcceptDialog {
Button *rescan_plugins; Button *rescan_plugins;
Tree *plugins; Tree *plugins;
LineEdit *search_box;
ToolButton *clear_button;
PropertyEditor *property_editor; PropertyEditor *property_editor;
Timer *timer; Timer *timer;
@ -71,6 +73,8 @@ class EditorSettingsDialog : public AcceptDialog {
void _rescan_plugins(); void _rescan_plugins();
void _update_plugins(); void _update_plugins();
void _clear_search_box();
protected: protected:
static void _bind_methods(); static void _bind_methods();