summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/area_2d.cpp8
-rw-r--r--scene/2d/canvas_item.cpp5
-rw-r--r--scene/2d/collision_polygon_2d.cpp2
-rw-r--r--scene/2d/navigation2d.cpp12
-rw-r--r--scene/2d/path_2d.cpp2
-rw-r--r--scene/2d/physics_body_2d.cpp25
-rw-r--r--scene/2d/physics_body_2d.h2
-rw-r--r--scene/2d/screen_button.cpp8
-rw-r--r--scene/3d/camera.cpp111
-rw-r--r--scene/3d/camera.h5
-rw-r--r--scene/3d/physics_body.cpp24
-rw-r--r--scene/3d/physics_body.h2
-rw-r--r--scene/3d/spatial_stream_player.cpp2
-rw-r--r--scene/audio/stream_player.cpp5
-rw-r--r--scene/gui/button.cpp4
-rw-r--r--scene/gui/control.cpp11
-rw-r--r--scene/gui/control.h2
-rw-r--r--scene/gui/file_dialog.cpp41
-rw-r--r--scene/gui/file_dialog.h2
-rw-r--r--scene/gui/line_edit.cpp63
-rw-r--r--scene/gui/range.cpp22
-rw-r--r--scene/gui/range.h4
-rw-r--r--scene/gui/tabs.cpp321
-rw-r--r--scene/gui/tabs.h22
-rw-r--r--scene/gui/text_edit.cpp84
-rw-r--r--scene/main/node.cpp2
-rw-r--r--scene/main/scene_main_loop.cpp13
-rw-r--r--scene/main/scene_main_loop.h4
-rw-r--r--scene/main/viewport.cpp4
-rw-r--r--scene/register_scene_types.cpp5
-rw-r--r--scene/resources/bit_mask.cpp54
-rw-r--r--scene/resources/bit_mask.h11
-rw-r--r--scene/resources/default_theme/default_theme.cpp1
-rw-r--r--scene/resources/default_theme/tab_close.pngbin0 -> 398 bytes
-rw-r--r--scene/resources/default_theme/theme_data.h5
-rw-r--r--scene/resources/packed_scene.cpp10
-rw-r--r--scene/resources/packed_scene.h6
-rw-r--r--scene/resources/sample.cpp6
-rw-r--r--scene/resources/scene_format_text.cpp31
-rw-r--r--scene/resources/shader_graph.cpp5
40 files changed, 521 insertions, 425 deletions
diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp
index 464553b982..50a115174d 100644
--- a/scene/2d/area_2d.cpp
+++ b/scene/2d/area_2d.cpp
@@ -420,13 +420,13 @@ void Area2D::_notification(int p_what) {
void Area2D::set_enable_monitoring(bool p_enable) {
- if (locked) {
- ERR_EXPLAIN("This function can't be used during the in/out signal.");
- }
- ERR_FAIL_COND(locked);
if (p_enable==monitoring)
return;
+ if (locked) {
+ ERR_EXPLAIN("Function blocked during in/out signal. Use call_deferred(\"set_enable_monitoring\",true/false)");
+ }
+ ERR_FAIL_COND(locked);
monitoring=p_enable;
diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp
index 8f6df43c76..35b453d71d 100644
--- a/scene/2d/canvas_item.cpp
+++ b/scene/2d/canvas_item.cpp
@@ -389,8 +389,8 @@ Matrix32 CanvasItem::get_global_transform_with_canvas() const {
if (last_valid->canvas_layer)
return last_valid->canvas_layer->get_transform() * xform;
- else
- return xform;
+ else if (is_inside_tree())
+ return get_viewport()->get_canvas_transform() * xform;
}
Matrix32 CanvasItem::get_global_transform() const {
@@ -548,6 +548,7 @@ void CanvasItem::_notification(int p_what) {
get_parent()->cast_to<CanvasItem>()->children_items.erase(C);
C=NULL;
}
+ global_invalid=true;
} break;
case NOTIFICATION_DRAW: {
diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp
index 386c7b9dd0..2a40a6207d 100644
--- a/scene/2d/collision_polygon_2d.cpp
+++ b/scene/2d/collision_polygon_2d.cpp
@@ -197,7 +197,7 @@ void CollisionPolygon2D::_notification(int p_what) {
Vector2 n = polygon[(i+1)%polygon.size()];
draw_line(p,n,Color(0.9,0.2,0.0,0.8),3);
}
-//#define DEBUG_DECOMPOSE
+#define DEBUG_DECOMPOSE
#if defined(TOOLS_ENABLED) && defined (DEBUG_DECOMPOSE)
Vector< Vector<Vector2> > decomp = _decompose_in_convex();
diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp
index e2a4de5fac..c7542407cb 100644
--- a/scene/2d/navigation2d.cpp
+++ b/scene/2d/navigation2d.cpp
@@ -508,7 +508,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
points+=", ";
points+=_get_vertex(p->edges[i].point);
}
- print_line("poly "+itos(idx++)+" - "+points);
+ //print_line("poly "+itos(idx++)+" - "+points);
p = p->edges[prev].C;
if (p==begin_poly)
break;
@@ -557,6 +557,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
bool skip=false;
+ /*
print_line("-----\nAPEX: "+(apex_point-end_point));
print_line("LEFT:");
print_line("\tPortal: "+(portal_left-end_point));
@@ -570,6 +571,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
print_line("\tRight Tangent: "+rtos(CLOCK_TANGENT(apex_point,portal_right,right)));
print_line("\tRight Distance: "+rtos(portal_right.distance_squared_to(apex_point)));
print_line("\tRight Test: "+rtos(CLOCK_TANGENT(apex_point,right,portal_left)));
+ */
if (CLOCK_TANGENT(apex_point,portal_left,left) >= 0){
@@ -577,7 +579,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
if (portal_left.distance_squared_to(apex_point)<CMP_EPSILON || CLOCK_TANGENT(apex_point,left,portal_right) > 0) {
left_poly=p;
portal_left=left;
- print_line("***ADVANCE LEFT");
+ //print_line("***ADVANCE LEFT");
} else {
//_clip_path(path,apex_poly,portal_right,right_poly);
@@ -592,7 +594,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
path.push_back(apex_point);
skip=true;
//print_line("addpoint left");
- print_line("***CLIP LEFT");
+ //print_line("***CLIP LEFT");
}
}
@@ -601,7 +603,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
if (portal_right.distance_squared_to(apex_point)<CMP_EPSILON || CLOCK_TANGENT(apex_point,right,portal_left) < 0) {
right_poly=p;
portal_right=right;
- print_line("***ADVANCE RIGHT");
+ //print_line("***ADVANCE RIGHT");
} else {
//_clip_path(path,apex_poly,portal_left,left_poly);
@@ -615,7 +617,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
if (path[path.size()-1].distance_to(apex_point)>CMP_EPSILON)
path.push_back(apex_point);
//print_line("addpoint right");
- print_line("***CLIP RIGHT");
+ //print_line("***CLIP RIGHT");
}
}
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp
index f135864098..bd7415aa04 100644
--- a/scene/2d/path_2d.cpp
+++ b/scene/2d/path_2d.cpp
@@ -74,6 +74,8 @@ void Path2D::set_curve(const Ref<Curve2D>& p_curve) {
curve->connect("changed",this,"_curve_changed");
}
+ _curve_changed();
+
}
Ref<Curve2D> Path2D::get_curve() const{
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index dd8aa9e8b1..cc2e5c0d72 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -310,14 +310,20 @@ void RigidBody2D::_body_enter_tree(ObjectID p_id) {
ERR_FAIL_COND(!E);
ERR_FAIL_COND(E->get().in_scene);
+ contact_monitor->locked=true;
+
E->get().in_scene=true;
emit_signal(SceneStringNames::get_singleton()->body_enter,node);
+
for(int i=0;i<E->get().shapes.size();i++) {
emit_signal(SceneStringNames::get_singleton()->body_enter_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape);
}
+ contact_monitor->locked=false;
+
+
}
void RigidBody2D::_body_exit_tree(ObjectID p_id) {
@@ -329,11 +335,18 @@ void RigidBody2D::_body_exit_tree(ObjectID p_id) {
ERR_FAIL_COND(!E);
ERR_FAIL_COND(!E->get().in_scene);
E->get().in_scene=false;
+
+ contact_monitor->locked=true;
+
emit_signal(SceneStringNames::get_singleton()->body_exit,node);
+
for(int i=0;i<E->get().shapes.size();i++) {
emit_signal(SceneStringNames::get_singleton()->body_exit_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape);
}
+
+ contact_monitor->locked=false;
+
}
void RigidBody2D::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,int p_local_shape) {
@@ -439,6 +452,8 @@ void RigidBody2D::_direct_state_changed(Object *p_state) {
if (contact_monitor) {
+ contact_monitor->locked=true;
+
//untag all
int rc=0;
for( Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) {
@@ -520,6 +535,8 @@ void RigidBody2D::_direct_state_changed(Object *p_state) {
_body_inout(1,toadd[i].id,toadd[i].shape,toadd[i].local_shape);
}
+ contact_monitor->locked=false;
+
}
set_block_transform_notify(true); // don't want notify (would feedback loop)
@@ -803,6 +820,11 @@ void RigidBody2D::set_contact_monitor(bool p_enabled) {
if (!p_enabled) {
+ if (contact_monitor->locked) {
+ ERR_EXPLAIN("Can't disable contact monitoring during in/out callback. Use call_deferred(\"set_contact_monitor\",false) instead");
+ }
+ ERR_FAIL_COND(contact_monitor->locked);
+
for(Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) {
//clean up mess
@@ -813,6 +835,7 @@ void RigidBody2D::set_contact_monitor(bool p_enabled) {
} else {
contact_monitor = memnew( ContactMonitor );
+ contact_monitor->locked=false;
}
}
@@ -1250,7 +1273,7 @@ void KinematicBody2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_collider_velocity"),&KinematicBody2D::get_collider_velocity);
ObjectTypeDB::bind_method(_MD("get_collider:Object"),&KinematicBody2D::_get_collider);
ObjectTypeDB::bind_method(_MD("get_collider_shape"),&KinematicBody2D::get_collider_shape);
- ObjectTypeDB::bind_method(_MD("get_collider_metadata"),&KinematicBody2D::get_collider_metadata);
+ ObjectTypeDB::bind_method(_MD("get_collider_metadata:Variant"),&KinematicBody2D::get_collider_metadata);
ObjectTypeDB::bind_method(_MD("set_collision_margin","pixels"),&KinematicBody2D::set_collision_margin);
ObjectTypeDB::bind_method(_MD("get_collision_margin","pixels"),&KinematicBody2D::get_collision_margin);
diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h
index fc337915c5..999e63dd5d 100644
--- a/scene/2d/physics_body_2d.h
+++ b/scene/2d/physics_body_2d.h
@@ -190,7 +190,7 @@ private:
struct ContactMonitor {
-
+ bool locked;
Map<ObjectID,BodyState> body_map;
};
diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp
index 0254eb2836..fac94f19dc 100644
--- a/scene/2d/screen_button.cpp
+++ b/scene/2d/screen_button.cpp
@@ -102,6 +102,10 @@ void TouchScreenButton::_notification(int p_what) {
action_id=-1;
}
} break;
+ case NOTIFICATION_EXIT_TREE: {
+ if (is_pressed())
+ Input::get_singleton()->action_release(action);
+ } break;
}
}
@@ -161,7 +165,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) {
if (finger_pressed==-1 || p_event.screen_touch.index==finger_pressed) {
- Point2 coord = (get_global_transform()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y));
+ Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y));
bool touched=false;
if (bitmask.is_valid()) {
@@ -238,7 +242,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) {
if (finger_pressed!=-1)
return; //already fingering
- Point2 coord = (get_global_transform()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y));
+ Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y));
bool touched=false;
if (bitmask.is_valid()) {
diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp
index 644129db89..3e78fef147 100644
--- a/scene/3d/camera.cpp
+++ b/scene/3d/camera.cpp
@@ -125,7 +125,7 @@ bool Camera::_get(const StringName& p_name,Variant &r_ret) const {
r_ret= int(keep_aspect);
else if (p_name=="current") {
- if (is_inside_tree() && get_tree()->is_editor_hint()) {
+ if (is_inside_tree() && get_tree()->is_node_being_edited(this)) {
r_ret=current;
} else {
r_ret=is_current();
@@ -192,12 +192,11 @@ void Camera::_update_camera() {
// here goes listener stuff
// if (viewport_ptr && is_inside_scene() && is_current())
-// viewport_ptr->_camera_transform_changed_notify();
+// get_viewport()->_camera_transform_changed_notify();
if (is_inside_tree() && is_current()) {
- if (viewport_ptr) {
- viewport_ptr->_camera_transform_changed_notify();
- }
+ get_viewport()->_camera_transform_changed_notify();
+
}
if (is_current() && get_world().is_valid()) {
@@ -213,29 +212,10 @@ void Camera::_notification(int p_what) {
case NOTIFICATION_ENTER_WORLD: {
- viewport_ptr=NULL;
-
- { //find viewport stuff
- Node *parent=get_parent();
- while(parent) {
-
- Viewport* viewport = parent->cast_to<Viewport>();
-
- if (viewport) {
- viewport_ptr=viewport;
- break;
- }
- parent=parent->get_parent();
- }
-
- }
-
- camera_group = "_vp_cameras"+itos(get_viewport()->get_instance_ID());
- add_to_group(camera_group);
- if (viewport_ptr)
- viewport_ptr->cameras.insert(this);
- if (current)
+ bool first_camera = get_viewport()->cameras.size()==0;
+ get_viewport()->cameras.insert(this);
+ if (!get_tree()->is_node_being_edited(this) && (current || first_camera))
make_current();
@@ -246,17 +226,17 @@ void Camera::_notification(int p_what) {
} break;
case NOTIFICATION_EXIT_WORLD: {
- if (is_current()) {
- clear_current();
- current=true; //keep it true
+ if (!get_tree()->is_node_being_edited(this)) {
+ if (is_current()) {
+ clear_current();
+ current=true; //keep it true
- } else {
- current=false;
+ } else {
+ current=false;
+ }
}
- if (viewport_ptr)
- viewport_ptr->cameras.erase(this);
- viewport_ptr=NULL;
- remove_from_group(camera_group);
+
+ get_viewport()->cameras.erase(this);
} break;
@@ -324,25 +304,12 @@ void Camera::make_current() {
if (!is_inside_tree())
return;
- if (viewport_ptr) {
- viewport_ptr->_set_camera(this);
- }
+ get_viewport()->_set_camera(this);
//get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,camera_group,"_camera_make_current",this);
}
-void Camera::_camera_make_next_current(Node *p_exclude) {
-
- if (this==p_exclude)
- return;
- if (!is_inside_tree())
- return;
- if (get_viewport()->get_camera()!=NULL)
- return;
-
- make_current();
-}
void Camera::clear_current() {
@@ -351,12 +318,20 @@ void Camera::clear_current() {
if (!is_inside_tree())
return;
- if (viewport_ptr) {
- if (viewport_ptr->get_camera()==this) {
- viewport_ptr->_set_camera(NULL);
- //a group is used beause this needs to be in order to be deterministic
- get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,camera_group,"_camera_make_next_current",this);
+ if (get_viewport()->get_camera()==this) {
+ get_viewport()->_set_camera(NULL);
+ //a group is used beause this needs to be in order to be deterministic
+
+ for (Set<Camera*>::Element *E=get_viewport()->cameras.front();E;E=E->next()) {
+ if (this==E->get())
+ continue;
+ if (!E->get()->is_inside_tree())
+ continue;
+ if (get_viewport()->get_camera()!=NULL)
+ return;
+
+ E->get()->make_current();
}
}
@@ -364,9 +339,9 @@ void Camera::clear_current() {
bool Camera::is_current() const {
- if (is_inside_tree()) {
- if (viewport_ptr)
- return viewport_ptr->get_camera()==this;
+ if (is_inside_tree() && !get_tree()->is_node_being_edited(this)) {
+
+ return get_viewport()->get_camera()==this;
} else
return current;
@@ -481,12 +456,12 @@ Vector3 Camera::project_local_ray_normal(const Point2& p_pos) const {
#if 0
- Size2 viewport_size = viewport_ptr->get_visible_rect().size;
+ Size2 viewport_size = get_viewport()->get_visible_rect().size;
Vector2 cpos = p_pos;
#else
- Size2 viewport_size = viewport_ptr->get_camera_rect_size();
- Vector2 cpos = viewport_ptr->get_camera_coords(p_pos);
+ Size2 viewport_size = get_viewport()->get_camera_rect_size();
+ Vector2 cpos = get_viewport()->get_camera_coords(p_pos);
#endif
Vector3 ray;
@@ -514,12 +489,12 @@ Vector3 Camera::project_ray_origin(const Point2& p_pos) const {
}
#if 0
- Size2 viewport_size = viewport_ptr->get_visible_rect().size;
+ Size2 viewport_size = get_viewport()->get_visible_rect().size;
Vector2 cpos = p_pos;
#else
- Size2 viewport_size = viewport_ptr->get_camera_rect_size();
- Vector2 cpos = viewport_ptr->get_camera_coords(p_pos);
+ Size2 viewport_size = get_viewport()->get_camera_rect_size();
+ Vector2 cpos = get_viewport()->get_camera_coords(p_pos);
#endif
ERR_FAIL_COND_V( viewport_size.y == 0, Vector3() );
@@ -566,7 +541,7 @@ Point2 Camera::unproject_position(const Vector3& p_pos) const {
ERR_FAIL_COND_V(!is_inside_tree(),Vector2());
}
- Size2 viewport_size = viewport_ptr->get_visible_rect().size;
+ Size2 viewport_size = get_viewport()->get_visible_rect().size;
CameraMatrix cm;
@@ -597,7 +572,7 @@ Vector3 Camera::project_position(const Point2& p_point) const {
ERR_FAIL_COND_V(!is_inside_tree(),Vector3());
}
- Size2 viewport_size = viewport_ptr->get_visible_rect().size;
+ Size2 viewport_size = get_viewport()->get_visible_rect().size;
CameraMatrix cm;
@@ -692,7 +667,6 @@ void Camera::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_environment:Environment"),&Camera::get_environment);
ObjectTypeDB::bind_method(_MD("set_keep_aspect_mode","mode"),&Camera::set_keep_aspect_mode);
ObjectTypeDB::bind_method(_MD("get_keep_aspect_mode"),&Camera::get_keep_aspect_mode);
- ObjectTypeDB::bind_method(_MD("_camera_make_next_current"),&Camera::_camera_make_next_current);
//ObjectTypeDB::bind_method( _MD("_camera_make_current"),&Camera::_camera_make_current );
BIND_CONSTANT( PROJECTION_PERSPECTIVE );
@@ -745,7 +719,7 @@ Vector<Plane> Camera::get_frustum() const {
ERR_FAIL_COND_V(!is_inside_world(),Vector<Plane>());
- Size2 viewport_size = viewport_ptr->get_visible_rect().size;
+ Size2 viewport_size = get_viewport()->get_visible_rect().size;
CameraMatrix cm;
if (mode==PROJECTION_PERSPECTIVE)
cm.set_perspective(fov,viewport_size.get_aspect(),near,far,keep_aspect==KEEP_WIDTH);
@@ -789,7 +763,6 @@ Camera::Camera() {
near=0;
far=0;
current=false;
- viewport_ptr=NULL;
force_change=false;
mode=PROJECTION_PERSPECTIVE;
set_perspective(60.0,0.1,100.0);
diff --git a/scene/3d/camera.h b/scene/3d/camera.h
index dcb7a21961..02ca6ffb9a 100644
--- a/scene/3d/camera.h
+++ b/scene/3d/camera.h
@@ -68,18 +68,15 @@ private:
RID camera;
RID scenario_id;
- String camera_group;
+ //String camera_group;
uint32_t layers;
- Viewport *viewport_ptr;
Ref<Environment> environment;
virtual bool _can_gizmo_scale() const;
virtual RES _get_gizmo_geometry() const;
- void _camera_make_next_current(Node *p_exclude);
-
//void _camera_make_current(Node *p_camera);
friend class Viewport;
diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp
index de777604b0..1a2665b6ad 100644
--- a/scene/3d/physics_body.cpp
+++ b/scene/3d/physics_body.cpp
@@ -207,6 +207,9 @@ void RigidBody::_body_enter_tree(ObjectID p_id) {
ERR_FAIL_COND(E->get().in_tree);
E->get().in_tree=true;
+
+ contact_monitor->locked=true;
+
emit_signal(SceneStringNames::get_singleton()->body_enter,node);
for(int i=0;i<E->get().shapes.size();i++) {
@@ -214,6 +217,9 @@ void RigidBody::_body_enter_tree(ObjectID p_id) {
emit_signal(SceneStringNames::get_singleton()->body_enter_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape);
}
+ contact_monitor->locked=false;
+
+
}
void RigidBody::_body_exit_tree(ObjectID p_id) {
@@ -225,11 +231,18 @@ void RigidBody::_body_exit_tree(ObjectID p_id) {
ERR_FAIL_COND(!E);
ERR_FAIL_COND(!E->get().in_tree);
E->get().in_tree=false;
+
+ contact_monitor->locked=true;
+
emit_signal(SceneStringNames::get_singleton()->body_exit,node);
+
for(int i=0;i<E->get().shapes.size();i++) {
emit_signal(SceneStringNames::get_singleton()->body_exit_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape);
}
+
+ contact_monitor->locked=false;
+
}
void RigidBody::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,int p_local_shape) {
@@ -317,6 +330,8 @@ void RigidBody::_direct_state_changed(Object *p_state) {
if (contact_monitor) {
+ contact_monitor->locked=true;
+
//untag all
int rc=0;
for( Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) {
@@ -396,6 +411,8 @@ void RigidBody::_direct_state_changed(Object *p_state) {
_body_inout(1,toadd[i].id,toadd[i].shape,toadd[i].local_shape);
}
+ contact_monitor->locked=false;
+
}
set_ignore_transform_notification(true);
@@ -648,6 +665,11 @@ void RigidBody::set_contact_monitor(bool p_enabled) {
if (!p_enabled) {
+ if (contact_monitor->locked) {
+ ERR_EXPLAIN("Can't disable contact monitoring during in/out callback. Use call_deferred(\"set_contact_monitor\",false) instead");
+ }
+ ERR_FAIL_COND(contact_monitor->locked);
+
for(Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) {
//clean up mess
@@ -658,6 +680,8 @@ void RigidBody::set_contact_monitor(bool p_enabled) {
} else {
contact_monitor = memnew( ContactMonitor );
+ contact_monitor->locked=false;
+
}
}
diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h
index 0d6c358e28..da79d63f00 100644
--- a/scene/3d/physics_body.h
+++ b/scene/3d/physics_body.h
@@ -175,7 +175,7 @@ private:
struct ContactMonitor {
-
+ bool locked;
Map<ObjectID,BodyState> body_map;
};
diff --git a/scene/3d/spatial_stream_player.cpp b/scene/3d/spatial_stream_player.cpp
index 048c9e78ac..dfef0faf4b 100644
--- a/scene/3d/spatial_stream_player.cpp
+++ b/scene/3d/spatial_stream_player.cpp
@@ -60,7 +60,7 @@ void SpatialStreamPlayer::sp_set_mix_rate(int p_rate){
bool SpatialStreamPlayer::sp_mix(int32_t *p_buffer,int p_frames) {
- if (resampler.is_ready()) {
+ if (resampler.is_ready() && !paused) {
return resampler.mix(p_buffer,p_frames);
}
diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp
index 74d84b8b08..f7cfc31b03 100644
--- a/scene/audio/stream_player.cpp
+++ b/scene/audio/stream_player.cpp
@@ -58,7 +58,7 @@ void StreamPlayer::sp_set_mix_rate(int p_rate){
bool StreamPlayer::sp_mix(int32_t *p_buffer,int p_frames) {
- if (resampler.is_ready()) {
+ if (resampler.is_ready() && !paused) {
return resampler.mix(p_buffer,p_frames);
}
@@ -170,6 +170,7 @@ void StreamPlayer::stop() {
stop_request=false;
playback->stop();
resampler.flush();
+ emit_signal("finished");
//set_idle_process(false);
}
@@ -378,6 +379,8 @@ void StreamPlayer::_bind_methods() {
ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/paused"), _SCS("set_paused"), _SCS("is_paused") );
ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") );
ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/buffering_ms"), _SCS("set_buffering_msec"), _SCS("get_buffering_msec") );
+
+ ADD_SIGNAL(MethodInfo("finished"));
}
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index 59f2f34b82..b9ce46d738 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -137,8 +137,10 @@ void Button::_notification(int p_what) {
text_ofs.y+=font->get_ascent();
font->draw( ci, text_ofs.floor(), text, color,clip_text?text_clip:-1);
if (!_icon.is_null()) {
+
+ int valign = size.height-style->get_minimum_size().y;
- _icon->draw(ci,Point2(style->get_offset().x, Math::floor( (size.height-_icon->get_height())/2.0 ) ),is_disabled()?Color(1,1,1,0.4):Color(1,1,1) );
+ _icon->draw(ci,style->get_offset()+Point2(0, Math::floor( (valign-_icon->get_height())/2.0 ) ),is_disabled()?Color(1,1,1,0.4):Color(1,1,1) );
}
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 23a7ae00da..5a8ecfeffe 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -862,6 +862,13 @@ bool Control::window_has_modal_stack() const {
return data.window->window->modal_stack.size();
}
+bool Control::is_window_modal_on_top() const {
+
+ if (window_has_modal_stack())
+ return data.window->window->modal_stack.back()->get()==this;
+ return false;
+}
+
void Control::_window_cancel_tooltip() {
window->tooltip=NULL;
@@ -916,7 +923,7 @@ void Control::_window_show_tooltip() {
void Control::_window_call_input(Control *p_control,const InputEvent& p_input) {
- _block();
+// _block();
while(p_control) {
@@ -934,7 +941,7 @@ void Control::_window_call_input(Control *p_control,const InputEvent& p_input) {
p_control=p_control->data.parent;
}
- _unblock();
+ //_unblock();
}
diff --git a/scene/gui/control.h b/scene/gui/control.h
index 280e88e85d..0ead632aab 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -270,6 +270,8 @@ public:
void set_custom_minimum_size(const Size2& p_custom);
Size2 get_custom_minimum_size() const;
+ bool is_window_modal_on_top() const;
+
bool is_window() const;
Control *get_window() const;
Control *get_parent_control() const;
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index 955a02d0f9..5b57395e58 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -56,7 +56,42 @@ void FileDialog::_notification(int p_what) {
//RID ci = get_canvas_item();
//get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
- }
+ }
+
+ if (p_what==NOTIFICATION_POPUP_HIDE) {
+
+ set_process_unhandled_input(false);
+ }
+}
+
+void FileDialog::_unhandled_input(const InputEvent& p_event) {
+
+ if (p_event.type==InputEvent::KEY && is_window_modal_on_top()) {
+
+ const InputEventKey &k=p_event.key;
+
+ if (k.pressed) {
+
+ bool handled=true;
+
+ switch (k.scancode) {
+
+ case KEY_H: {
+
+ if (k.mod.command) {
+ set_show_hidden_files(!show_hidden_files);
+ } else {
+ handled=false;
+ }
+
+ } break;
+ default: { handled=false; }
+ }
+
+ if (handled)
+ accept_event();
+ }
+ }
}
void FileDialog::set_enable_multiple_selection(bool p_enable) {
@@ -114,6 +149,8 @@ void FileDialog::_post_popup() {
else
tree->grab_focus();
+ set_process_unhandled_input(true);
+
}
void FileDialog::_action_pressed() {
@@ -628,6 +665,8 @@ bool FileDialog::default_show_hidden_files=false;
void FileDialog::_bind_methods() {
+ ObjectTypeDB::bind_method(_MD("_unhandled_input"),&FileDialog::_unhandled_input);
+
ObjectTypeDB::bind_method(_MD("_tree_selected"),&FileDialog::_tree_selected);
ObjectTypeDB::bind_method(_MD("_tree_db_selected"),&FileDialog::_tree_dc_selected);
ObjectTypeDB::bind_method(_MD("_dir_entered"),&FileDialog::_dir_entered);
diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h
index 491655e4ce..b71a157fa7 100644
--- a/scene/gui/file_dialog.h
+++ b/scene/gui/file_dialog.h
@@ -117,6 +117,8 @@ private:
void _update_drives();
+ void _unhandled_input(const InputEvent& p_event);
+
virtual void _post_popup();
protected:
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index db463c133b..fdced3f62f 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -245,12 +245,26 @@ void LineEdit::_input_event(InputEvent p_event) {
delete_char();
}
} break;
+ case KEY_KP_4: {
+ if (k.unicode != 0) {
+ handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_left
+ }
case KEY_LEFT: {
shift_selection_check_pre(k.mod.shift);
set_cursor_pos(get_cursor_pos()-1);
shift_selection_check_post(k.mod.shift);
} break;
+ case KEY_KP_6: {
+ if (k.unicode != 0) {
+ handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_right
+ }
case KEY_RIGHT: {
shift_selection_check_pre(k.mod.shift);
@@ -271,12 +285,26 @@ void LineEdit::_input_event(InputEvent p_event) {
}
} break;
+ case KEY_KP_7: {
+ if (k.unicode != 0) {
+ handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_home
+ }
case KEY_HOME: {
shift_selection_check_pre(k.mod.shift);
set_cursor_pos(0);
shift_selection_check_post(k.mod.shift);
} break;
+ case KEY_KP_1: {
+ if (k.unicode != 0) {
+ handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_end
+ }
case KEY_END: {
shift_selection_check_pre(k.mod.shift);
@@ -287,26 +315,29 @@ void LineEdit::_input_event(InputEvent p_event) {
default: {
- if (k.unicode>=32 && k.scancode!=KEY_DELETE) {
-
- if (editable) {
- selection_delete();
- CharType ucodestr[2]={(CharType)k.unicode,0};
- append_at_cursor(ucodestr);
- emit_signal("text_changed",text);
- _change_notify("text");
- }
-
- } else {
- handled=false;
- }
+ handled=false;
} break;
}
- if (handled)
+ if (handled) {
accept_event();
- else
- return;
+ } else {
+ if (k.unicode>=32 && k.scancode!=KEY_DELETE) {
+
+ if (editable) {
+ selection_delete();
+ CharType ucodestr[2]={(CharType)k.unicode,0};
+ append_at_cursor(ucodestr);
+ emit_signal("text_changed",text);
+ _change_notify("text");
+
+ accept_event();
+ }
+
+ } else {
+ return;
+ }
+ }
selection.old_shift=k.mod.shift;
diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp
index 25b7952da1..ffcdf98519 100644
--- a/scene/gui/range.cpp
+++ b/scene/gui/range.cpp
@@ -48,20 +48,20 @@ void Range::Shared::emit_value_changed() {
}
}
-void Range::_changed_notify() {
+void Range::_changed_notify(const char *p_what) {
emit_signal("changed",shared->val);
update();
- _change_notify();
+ _change_notify(p_what);
}
-void Range::Shared::emit_changed() {
+void Range::Shared::emit_changed(const char *p_what) {
for (Set<Range*>::Element *E=owners.front();E;E=E->next()) {
Range *r=E->get();
if (!r->is_inside_tree())
continue;
- r->_changed_notify();
+ r->_changed_notify(p_what);
}
}
@@ -77,7 +77,11 @@ void Range::set_val(double p_val) {
if (p_val<shared->min)
p_val=shared->min;
-
+
+ //avoid to set -0
+ if (p_val == 0)
+ p_val = 0;
+
if (shared->val==p_val)
return;
@@ -90,20 +94,20 @@ void Range::set_min(double p_min) {
shared->min=p_min;
set_val(shared->val);
- shared->emit_changed();
+ shared->emit_changed("range/min");
}
void Range::set_max(double p_max) {
shared->max=p_max;
set_val(shared->val);
- shared->emit_changed();
+ shared->emit_changed("range/max");
}
void Range::set_step(double p_step) {
shared->step=p_step;
- shared->emit_changed();
+ shared->emit_changed("range/step");
}
void Range::set_page(double p_page) {
@@ -111,7 +115,7 @@ void Range::set_page(double p_page) {
shared->page=p_page;
set_val(shared->val);
- shared->emit_changed();
+ shared->emit_changed("range/page");
}
double Range::get_val() const {
diff --git a/scene/gui/range.h b/scene/gui/range.h
index 2967c2790c..d96ecdfb0b 100644
--- a/scene/gui/range.h
+++ b/scene/gui/range.h
@@ -44,7 +44,7 @@ class Range : public Control {
bool exp_unit_value;
Set<Range*> owners;
void emit_value_changed();
- void emit_changed();
+ void emit_changed(const char *p_what="");
};
Shared *shared;
@@ -55,7 +55,7 @@ class Range : public Control {
void _share(Node *p_range);
void _value_changed_notify();
- void _changed_notify();
+ void _changed_notify(const char *p_what="");
protected:
diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp
index 6a677e7de0..a26acc9c05 100644
--- a/scene/gui/tabs.cpp
+++ b/scene/gui/tabs.cpp
@@ -65,8 +65,8 @@ Size2 Tabs::get_minimum_size() const {
ms.height=MAX(bms.height+tab_bg->get_minimum_size().height,ms.height);
}
- if (tabs[i].close_button.is_valid()) {
- Ref<Texture> cb=tabs[i].close_button;
+ if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i==current)) {
+ Ref<Texture> cb=get_icon("close");
Size2 bms = cb->get_size();//+get_stylebox("button")->get_minimum_size();
bms.width+=get_constant("hseparation");
ms.width+=bms.width;
@@ -108,14 +108,6 @@ void Tabs::_input_event(const InputEvent& p_event) {
for(int i=0;i<tabs.size();i++) {
// test hovering tab to display close button if policy says so
- if (cb_displaypolicy == SHOW_HOVER) {
- int ofs=tabs[i].ofs_cache;
- int size = tabs[i].ofs_cache;
- if (pos.x >=tabs[i].ofs_cache && pos.x<tabs[i].ofs_cache+tabs[i].size_cache) {
- hover=i;
- }
- }
-
// test hovering right button and close button
if (tabs[i].rb_rect.has_point(pos)) {
@@ -260,12 +252,14 @@ void Tabs::_notification(int p_what) {
Ref<Font> font = get_font("font");
Color color_fg = get_color("font_color_fg");
Color color_bg = get_color("font_color_bg");
+ Ref<Texture> close=get_icon("close");
int h = get_size().height;
int label_valign_fg = get_constant("label_valign_fg");
int label_valign_bg = get_constant("label_valign_bg");
+
int w=0;
int mw = 0;
@@ -277,32 +271,12 @@ void Tabs::_notification(int p_what) {
for(int i=0;i<tabs.size();i++) {
- Ref<Texture> tex = tabs[i].icon;
- if (tex.is_valid()) {
- if (tabs[i].text!="")
- mw+=get_constant("hseparation");
+ int sz = get_tab_width(i);
+
+ tabs[i].ofs_cache=mw;
+ mw+=sz;
- }
- mw+=font->get_string_size(tabs[i].text).width;
- if (current==i)
- mw+=tab_fg->get_minimum_size().width;
- else
- mw+=tab_bg->get_minimum_size().width;
-
- if (tabs[i].right_button.is_valid()) {
- Ref<Texture> rb=tabs[i].right_button;
- Size2 bms = rb->get_size();//+get_stylebox("button")->get_minimum_size();
- bms.width+=get_constant("hseparation");
-
- mw+=bms.width;
- }
- if (tabs[i].close_button.is_valid()) {
- Ref<Texture> cb=tabs[i].close_button;
- Size2 bms = cb->get_size();//+get_stylebox("button")->get_minimum_size();
- bms.width+=get_constant("hseparation");
- mw+=bms.width;
- }
}
}
@@ -364,56 +338,15 @@ void Tabs::_notification(int p_what) {
}
- // Close button
- switch (cb_displaypolicy) {
- case SHOW_ALWAYS: {
- if (tabs[i].close_button.is_valid()) {
- Ref<StyleBox> style = get_stylebox("button");
- Ref<Texture> rb=tabs[i].close_button;
-
- lsize+=get_constant("hseparation");
- //lsize+=style->get_margin(MARGIN_LEFT);
- lsize+=rb->get_width();
- //lsize+=style->get_margin(MARGIN_RIGHT);
- }
- } break;
- case SHOW_ACTIVE_ONLY: {
- if (i==current) {
- if (tabs[i].close_button.is_valid()) {
- Ref<StyleBox> style = get_stylebox("button");
- Ref<Texture> rb=tabs[i].close_button;
-
- lsize+=get_constant("hseparation");
- //lsize+=style->get_margin(MARGIN_LEFT);
- lsize+=rb->get_width();
- //lsize+=style->get_margin(MARGIN_RIGHT);
-
- }
- }
- } break;
- case SHOW_HOVER: {
- if (i==current || i==hover) {
- if (tabs[i].close_button.is_valid()) {
- Ref<StyleBox> style = get_stylebox("button");
- Ref<Texture> rb=tabs[i].close_button;
-
- lsize+=get_constant("hseparation");
- //lsize+=style->get_margin(MARGIN_LEFT);
- lsize+=rb->get_width();
- //lsize+=style->get_margin(MARGIN_RIGHT);
-
- }
- }
- } break;
- case SHOW_NEVER: // by default, never show close button
- default: {
- // do nothing
- } break;
+ if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i==current)) {
+ lsize+=get_constant("hseparation");
+ //lsize+=style->get_margin(MARGIN_LEFT);
+ lsize+=close->get_width();
+ //lsize+=style->get_margin(MARGIN_RIGHT);
}
-
if (w+lsize > limit) {
max_drawn_tab=i-1;
missing_right=true;
@@ -487,100 +420,31 @@ void Tabs::_notification(int p_what) {
}
+ if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i==current)) {
+ Ref<StyleBox> style = get_stylebox("button");
+ Ref<Texture> cb=close;
- // Close button
- switch (cb_displaypolicy) {
- case SHOW_ALWAYS: {
- if (tabs[i].close_button.is_valid()) {
- Ref<StyleBox> style = get_stylebox("button");
- Ref<Texture> cb=tabs[i].close_button;
-
- w+=get_constant("hseparation");
-
- Rect2 cb_rect;
- cb_rect.size=style->get_minimum_size()+cb->get_size();
- cb_rect.pos.x=w;
- cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2;
-
- if (cb_hover==i) {
- if (cb_pressing)
- get_stylebox("button_pressed")->draw(ci,cb_rect);
- else
- style->draw(ci,cb_rect);
- }
+ w+=get_constant("hseparation");
- //w+=style->get_margin(MARGIN_LEFT);
+ Rect2 cb_rect;
+ cb_rect.size=style->get_minimum_size()+cb->get_size();
+ cb_rect.pos.x=w;
+ cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2;
- cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) ));
- w+=cb->get_width();
- //w+=style->get_margin(MARGIN_RIGHT);
- tabs[i].cb_rect=cb_rect;
- }
- } break;
- case SHOW_ACTIVE_ONLY: {
- if (current==i) {
- if (tabs[i].close_button.is_valid()) {
- Ref<StyleBox> style = get_stylebox("button");
- Ref<Texture> cb=tabs[i].close_button;
-
- w+=get_constant("hseparation");
-
- Rect2 cb_rect;
- cb_rect.size=style->get_minimum_size()+cb->get_size();
- cb_rect.pos.x=w;
- cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2;
-
- if (cb_hover==i) {
- if (cb_pressing)
- get_stylebox("button_pressed")->draw(ci,cb_rect);
- else
- style->draw(ci,cb_rect);
- }
-
- //w+=style->get_margin(MARGIN_LEFT);
-
- cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) ));
- w+=cb->get_width();
- //w+=style->get_margin(MARGIN_RIGHT);
- tabs[i].cb_rect=cb_rect;
- }
- }
- } break;
- case SHOW_HOVER: {
- if (current==i || hover==i) {
- if (tabs[i].close_button.is_valid()) {
- Ref<StyleBox> style = get_stylebox("button");
- Ref<Texture> cb=tabs[i].close_button;
-
- w+=get_constant("hseparation");
-
- Rect2 cb_rect;
- cb_rect.size=style->get_minimum_size()+cb->get_size();
- cb_rect.pos.x=w;
- cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2;
-
- if (cb_hover==i) {
- if (cb_pressing)
- get_stylebox("button_pressed")->draw(ci,cb_rect);
- else
- style->draw(ci,cb_rect);
- }
-
- //w+=style->get_margin(MARGIN_LEFT);
-
- cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) ));
- w+=cb->get_width();
- //w+=style->get_margin(MARGIN_RIGHT);
- tabs[i].cb_rect=cb_rect;
- }
+ if (cb_hover==i) {
+ if (cb_pressing)
+ get_stylebox("button_pressed")->draw(ci,cb_rect);
+ else
+ style->draw(ci,cb_rect);
}
- } break;
- case SHOW_NEVER:
- default: {
- // show nothing
- } break;
+ //w+=style->get_margin(MARGIN_LEFT);
+
+ cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) ));
+ w+=cb->get_width();
+ //w+=style->get_margin(MARGIN_RIGHT);
+ tabs[i].cb_rect=cb_rect;
}
w+=sb->get_margin(MARGIN_RIGHT);
@@ -687,20 +551,6 @@ Ref<Texture> Tabs::get_tab_right_button(int p_tab) const{
}
-void Tabs::set_tab_close_button(int p_tab, const Ref<Texture>& p_close_button) {
- ERR_FAIL_INDEX(p_tab, tabs.size());
- tabs[p_tab].close_button=p_close_button;
- update();
- minimum_size_changed();
-}
-
-
-Ref<Texture> Tabs::get_tab_close_button(int p_tab) const{
-
- ERR_FAIL_INDEX_V(p_tab,tabs.size(),Ref<Texture>());
- return tabs[p_tab].close_button;
-
-}
void Tabs::add_tab(const String& p_str,const Ref<Texture>& p_icon) {
@@ -708,8 +558,6 @@ void Tabs::add_tab(const String& p_str,const Ref<Texture>& p_icon) {
t.text=p_str;
t.icon=p_icon;
- t.close_button = get_icon("Close","EditorIcons");
-
tabs.push_back(t);
update();
@@ -741,10 +589,6 @@ void Tabs::remove_tab(int p_idx) {
}
-void Tabs::set_tab_close_display_policy(CloseButtonDisplayPolicy p_cb_displaypolicy) {
- cb_displaypolicy = p_cb_displaypolicy;
-}
-
void Tabs::set_tab_align(TabAlign p_align) {
@@ -757,6 +601,94 @@ Tabs::TabAlign Tabs::get_tab_align() const {
return tab_align;
}
+int Tabs::get_tab_width(int p_idx) const {
+
+ ERR_FAIL_INDEX_V(p_idx,tabs.size(),0);
+
+ Ref<StyleBox> tab_bg = get_stylebox("tab_bg");
+ Ref<StyleBox> tab_fg = get_stylebox("tab_fg");
+ Ref<Font> font = get_font("font");
+ Ref<Texture> close=get_icon("close");
+
+ int x=0;
+
+ Ref<Texture> tex = tabs[p_idx].icon;
+ if (tex.is_valid()) {
+ if (tabs[p_idx].text!="")
+ x+=get_constant("hseparation");
+
+ }
+
+
+ x+=font->get_string_size(tabs[p_idx].text).width;
+ if (current==p_idx)
+ x+=tab_fg->get_minimum_size().width;
+ else
+ x+=tab_bg->get_minimum_size().width;
+
+ if (tabs[p_idx].right_button.is_valid()) {
+ print_line("has right");
+ Ref<Texture> rb=tabs[p_idx].right_button;
+ Size2 bms = rb->get_size();//+get_stylebox("button")->get_minimum_size();
+ bms.width+=get_constant("hseparation");
+
+ x+=bms.width;
+ }
+
+ if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && p_idx==current)) {
+
+ Size2 bms = close->get_size();//+get_stylebox("button")->get_minimum_size();
+ bms.width+=get_constant("hseparation");
+ x+=bms.width;
+ }
+
+ return x;
+}
+
+void Tabs::ensure_tab_visible(int p_idx) {
+
+ if (!is_inside_tree())
+ return;
+
+ ERR_FAIL_INDEX(p_idx,tabs.size());
+
+ if (p_idx<=offset) {
+ offset=p_idx;
+ update();
+ return;
+ }
+
+ Ref<Texture> incr = get_icon("increment");
+ Ref<Texture> decr = get_icon("decrement");
+
+ int limit=get_size().width-incr->get_width()-decr->get_width();
+
+
+
+ int x=0;
+ for(int i=0;i<tabs.size();i++) {
+
+ if (i<offset)
+ continue;
+
+ int sz = get_tab_width(i);
+ tabs[i].x_cache=x;
+ tabs[i].x_size_cache=sz;
+ x+=sz;
+
+ }
+
+ while(offset<tabs.size() && ( (tabs[p_idx].x_cache + tabs[p_idx].x_size_cache) - tabs[offset].x_cache) > limit) {
+ offset++;
+ }
+
+ update();
+}
+
+void Tabs::set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy) {
+ cb_displaypolicy=p_policy;
+ update();
+}
void Tabs::_bind_methods() {
@@ -772,6 +704,7 @@ void Tabs::_bind_methods() {
ObjectTypeDB::bind_method(_MD("add_tab","title","icon:Texture"),&Tabs::add_tab);
ObjectTypeDB::bind_method(_MD("set_tab_align","align"),&Tabs::set_tab_align);
ObjectTypeDB::bind_method(_MD("get_tab_align"),&Tabs::get_tab_align);
+ ObjectTypeDB::bind_method(_MD("ensure_tab_visible","idx"),&Tabs::ensure_tab_visible);
ADD_SIGNAL(MethodInfo("tab_changed",PropertyInfo(Variant::INT,"tab")));
ADD_SIGNAL(MethodInfo("right_button_pressed",PropertyInfo(Variant::INT,"tab")));
@@ -784,10 +717,10 @@ void Tabs::_bind_methods() {
BIND_CONSTANT( ALIGN_CENTER );
BIND_CONSTANT( ALIGN_RIGHT );
- BIND_CONSTANT( SHOW_ACTIVE_ONLY );
- BIND_CONSTANT( SHOW_ALWAYS );
- BIND_CONSTANT( SHOW_HOVER );
- BIND_CONSTANT( SHOW_NEVER );
+ BIND_CONSTANT( CLOSE_BUTTON_SHOW_ACTIVE_ONLY );
+ BIND_CONSTANT( CLOSE_BUTTON_SHOW_ALWAYS );
+ BIND_CONSTANT( CLOSE_BUTTON_SHOW_NEVER );
+
}
@@ -801,7 +734,9 @@ Tabs::Tabs() {
cb_hover=-1;
cb_pressing=false;
- cb_displaypolicy = SHOW_NEVER; // Default : no close button
+ cb_displaypolicy = CLOSE_BUTTON_SHOW_NEVER; // Default : no close button
offset=0;
max_drawn_tab=0;
+
+
}
diff --git a/scene/gui/tabs.h b/scene/gui/tabs.h
index efcb291a52..7f85280853 100644
--- a/scene/gui/tabs.h
+++ b/scene/gui/tabs.h
@@ -45,10 +45,9 @@ public:
enum CloseButtonDisplayPolicy {
- SHOW_ALWAYS,
- SHOW_ACTIVE_ONLY,
- SHOW_HOVER,
- SHOW_NEVER
+ CLOSE_BUTTON_SHOW_NEVER,
+ CLOSE_BUTTON_SHOW_ACTIVE_ONLY,
+ CLOSE_BUTTON_SHOW_ALWAYS,
};
private:
@@ -59,10 +58,13 @@ private:
Ref<Texture> icon;
int ofs_cache;
int size_cache;
+ int x_cache;
+ int x_size_cache;
+
Ref<Texture> right_button;
Rect2 rb_rect;
- Ref<Texture> close_button;
Rect2 cb_rect;
+
};
@@ -85,6 +87,8 @@ private:
int hover; // hovered tab
+ int get_tab_width(int p_idx) const;
+
protected:
void _input_event(const InputEvent& p_event);
@@ -104,13 +108,11 @@ public:
void set_tab_right_button(int p_tab,const Ref<Texture>& p_right_button);
Ref<Texture> get_tab_right_button(int p_tab) const;
- void set_tab_close_button(int p_tab, const Ref<Texture>& p_close_button);
- Ref<Texture> get_tab_close_button(int p_tab) const;
- void set_tab_close_display_policy(CloseButtonDisplayPolicy p_cb_displaypolicy);
-
void set_tab_align(TabAlign p_align);
TabAlign get_tab_align() const;
+ void set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy);
+
int get_tab_count() const;
void set_current_tab(int p_current);
int get_current_tab() const;
@@ -119,6 +121,8 @@ public:
void clear_tabs();
+ void ensure_tab_visible(int p_idx);
+
Size2 get_minimum_size() const;
Tabs();
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 70da7e39a4..7f7c8c023c 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -839,7 +839,7 @@ void TextEdit::_notification(int p_what) {
}
- if (cursor.column==str.length() && cursor.line==line) {
+ if (cursor.column==str.length() && cursor.line==line && (char_ofs+char_margin)>=xmargin_beg) {
cursor_pos=Point2i( char_ofs+char_margin, ofs_y );
VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(1,get_row_height())),cache.font_color);
@@ -1740,6 +1740,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
}
} break;
+ case KEY_KP_4: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_left
+ }
case KEY_LEFT: {
if (k.mod.shift)
@@ -1786,6 +1793,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
_post_shift_selection();
} break;
+ case KEY_KP_6: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_right
+ }
case KEY_RIGHT: {
if (k.mod.shift)
@@ -1829,6 +1843,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
_post_shift_selection();
} break;
+ case KEY_KP_8: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_up
+ }
case KEY_UP: {
if (k.mod.shift)
@@ -1849,6 +1870,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
_cancel_code_hint();
} break;
+ case KEY_KP_2: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_down
+ }
case KEY_DOWN: {
if (k.mod.shift)
@@ -1937,6 +1965,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
update();
} break;
+ case KEY_KP_7: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_home
+ }
#ifdef APPLE_STYLE_KEYS
case KEY_HOME: {
@@ -1950,18 +1985,6 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
_post_shift_selection();
} break;
- case KEY_END: {
-
- if (k.mod.shift)
- _pre_shift_selection();
-
- cursor_set_line(text.size()-1);
-
- if (k.mod.shift)
- _post_shift_selection();
-
- } break;
-
#else
case KEY_HOME: {
@@ -1992,6 +2015,27 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
completion_hint="";
} break;
+#endif
+ case KEY_KP_1: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_end
+ }
+#ifdef APPLE_STYLE_KEYS
+ case KEY_END: {
+
+ if (k.mod.shift)
+ _pre_shift_selection();
+
+ cursor_set_line(text.size()-1);
+
+ if (k.mod.shift)
+ _post_shift_selection();
+
+ } break;
+#else
case KEY_END: {
if (k.mod.shift)
@@ -2009,6 +2053,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
} break;
#endif
+ case KEY_KP_9: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_pageup
+ }
case KEY_PAGEUP: {
if (k.mod.shift)
@@ -2024,6 +2075,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
} break;
+ case KEY_KP_3: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_pageup
+ }
case KEY_PAGEDOWN: {
if (k.mod.shift)
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 95b79cc940..0780a4bdaf 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -2067,6 +2067,8 @@ void Node::_bind_methods() {
BIND_CONSTANT( NOTIFICATION_UNPARENTED );
BIND_CONSTANT( NOTIFICATION_PAUSED );
BIND_CONSTANT( NOTIFICATION_UNPAUSED );
+ BIND_CONSTANT( NOTIFICATION_INSTANCED );
+
BIND_CONSTANT( PAUSE_MODE_INHERIT );
diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp
index da1d6b3204..a18eb1249f 100644
--- a/scene/main/scene_main_loop.cpp
+++ b/scene/main/scene_main_loop.cpp
@@ -620,6 +620,14 @@ void SceneTree::set_editor_hint(bool p_enabled) {
editor_hint=p_enabled;
}
+bool SceneTree::is_node_being_edited(const Node* p_node) const {
+#ifdef TOOLS_ENABLED
+ return editor_hint && edited_scene_root && edited_scene_root->is_a_parent_of(p_node);
+#else
+ return false;
+#endif
+}
+
bool SceneTree::is_editor_hint() const {
return editor_hint;
@@ -965,6 +973,10 @@ Array SceneTree::_get_nodes_in_group(const StringName& p_group) {
return ret;
}
+bool SceneTree::has_group(const StringName& p_identifier) const {
+
+ return group_map.has(p_identifier);
+}
void SceneTree::get_nodes_in_group(const StringName& p_group,List<Node*> *p_list) {
@@ -1589,6 +1601,7 @@ void SceneTree::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_nodes_in_group","group"),&SceneTree::_get_nodes_in_group);
ObjectTypeDB::bind_method(_MD("get_root:Viewport"),&SceneTree::get_root);
+ ObjectTypeDB::bind_method(_MD("has_group","name"),&SceneTree::has_group);
ObjectTypeDB::bind_method(_MD("set_auto_accept_quit","enabled"),&SceneTree::set_auto_accept_quit);
diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_main_loop.h
index 9ff9bb5747..c6fc124345 100644
--- a/scene/main/scene_main_loop.h
+++ b/scene/main/scene_main_loop.h
@@ -279,6 +279,8 @@ public:
void set_editor_hint(bool p_enabled);
bool is_editor_hint() const;
+ bool is_node_being_edited(const Node* p_node) const;
+
void set_pause(bool p_enabled);
bool is_paused() const;
@@ -318,6 +320,8 @@ public:
void queue_delete(Object *p_object);
void get_nodes_in_group(const StringName& p_group,List<Node*> *p_list);
+ bool has_group(const StringName& p_identifier) const;
+
void set_screen_stretch(StretchMode p_mode,StretchAspect p_aspect,const Size2 p_minsize);
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 6d18a53c9f..330f855006 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -577,7 +577,7 @@ void Viewport::_notification(int p_what) {
PhysicsDirectSpaceState *space = PhysicsServer::get_singleton()->space_get_direct_state(find_world()->get_space());
if (space) {
- bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF);
+ bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF,true);
ObjectID new_collider=0;
if (col) {
@@ -617,7 +617,7 @@ void Viewport::_notification(int p_what) {
PhysicsDirectSpaceState *space = PhysicsServer::get_singleton()->space_get_direct_state(find_world()->get_space());
if (space) {
- bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF);
+ bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF,true);
ObjectID new_collider=0;
if (col) {
if (result.collider) {
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 84b65fc4d6..6c4fe1be79 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -221,7 +221,7 @@
static ResourceFormatLoaderImage *resource_loader_image=NULL;
static ResourceFormatLoaderWAV *resource_loader_wav=NULL;
-static ResourceFormatLoaderBitMap *resource_loader_bitmap=NULL;
+
#ifdef TOOLS_ENABLED
@@ -249,8 +249,6 @@ void register_scene_types() {
resource_loader_wav = memnew( ResourceFormatLoaderWAV );
ResourceLoader::add_resource_format_loader( resource_loader_wav );
- resource_loader_bitmap = memnew( ResourceFormatLoaderBitMap );
- ResourceLoader::add_resource_format_loader( resource_loader_bitmap );
#ifdef TOOLS_ENABLED
@@ -631,7 +629,6 @@ void unregister_scene_types() {
memdelete( resource_loader_image );
memdelete( resource_loader_wav );
- memdelete( resource_loader_bitmap );
#ifdef TOOLS_ENABLED
diff --git a/scene/resources/bit_mask.cpp b/scene/resources/bit_mask.cpp
index 7cbc145084..f5bfce3ef8 100644
--- a/scene/resources/bit_mask.cpp
+++ b/scene/resources/bit_mask.cpp
@@ -204,57 +204,3 @@ BitMap::BitMap() {
//////////////////////////////////////
-
-RES ResourceFormatLoaderBitMap::load(const String &p_path, const String& p_original_path, Error *r_error) {
-
- if (r_error)
- *r_error=ERR_FILE_CANT_OPEN;
-
- BitMap* ptr = memnew(BitMap);
- Ref<BitMap> bitmap( ptr );
-
-
- Image image;
-
- Error err = ImageLoader::load_image(p_path,&image);
-
- ERR_EXPLAIN("Failed loading image for BitMap: "+p_path);
- ERR_FAIL_COND_V(err, RES());
-
- bitmap->create_from_image_alpha(image);
- if (r_error)
- *r_error=OK;
-
- return bitmap;
-
-}
-
-bool ResourceFormatLoaderBitMap::handles_type(const String& p_type) const {
-
- return (p_type=="BitMap");
-}
-
-void ResourceFormatLoaderBitMap::get_recognized_extensions(List<String> *p_extensions) const {
-
- ImageLoader::get_recognized_extensions(p_extensions);
-}
-
-String ResourceFormatLoaderBitMap::get_resource_type(const String &p_path) const {
-
- List<String> extensions;
- ImageLoader::get_recognized_extensions(&extensions);
- String ext=p_path.extension().to_lower();
- for(List<String>::Element *E=extensions.front();E;E=E->next()) {
- if (E->get()==ext)
- return "BitMap";
- }
- return "";
-}
-
-
-ResourceFormatLoaderBitMap::ResourceFormatLoaderBitMap() {
-
-
-}
-
-
diff --git a/scene/resources/bit_mask.h b/scene/resources/bit_mask.h
index 66623f55c8..b245ea1542 100644
--- a/scene/resources/bit_mask.h
+++ b/scene/resources/bit_mask.h
@@ -62,16 +62,5 @@ public:
BitMap();
};
-class ResourceFormatLoaderBitMap : public ResourceFormatLoader {
-
-public:
-
- virtual RES load(const String &p_path,const String& p_original_path="",Error *r_error=NULL);
- virtual void get_recognized_extensions(List<String> *p_extensions) const;
- virtual bool handles_type(const String& p_type) const;
- virtual String get_resource_type(const String &p_path) const;
-
- ResourceFormatLoaderBitMap();
-};
#endif // BIT_MASK_H
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index 6076292bfb..f0b3519b4a 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -717,6 +717,7 @@ void make_default_theme() {
t->set_icon("increment_hilite","Tabs",make_icon( scroll_button_right_hl_png));
t->set_icon("decrement","Tabs",make_icon( scroll_button_left_png));
t->set_icon("decrement_hilite","Tabs",make_icon( scroll_button_left_hl_png));
+ t->set_icon("close","Tabs",make_icon( tab_close_png));
t->set_font("font","Tabs", default_font );
diff --git a/scene/resources/default_theme/tab_close.png b/scene/resources/default_theme/tab_close.png
new file mode 100644
index 0000000000..10e56d5bb8
--- /dev/null
+++ b/scene/resources/default_theme/tab_close.png
Binary files differ
diff --git a/scene/resources/default_theme/theme_data.h b/scene/resources/default_theme/theme_data.h
index c1fac47724..e0b5736d99 100644
--- a/scene/resources/default_theme/theme_data.h
+++ b/scene/resources/default_theme/theme_data.h
@@ -399,6 +399,11 @@ static const unsigned char tab_behind_png[]={
};
+static const unsigned char tab_close_png[]={
+0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,0x0,0xb,0x12,0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x1,0x1b,0x49,0x44,0x41,0x54,0x38,0x8d,0xcd,0x52,0xbb,0x4e,0xc4,0x40,0xc,0x9c,0x73,0xd2,0x50,0x38,0xd1,0x8a,0x82,0x36,0x3d,0x8,0xc4,0x43,0x88,0x13,0x12,0x20,0xf8,0x67,0x8a,0xfb,0x1,0xe,0x89,0x13,0x3d,0x47,0xb1,0x7f,0xb0,0x85,0x53,0x41,0xce,0xa6,0xd9,0x45,0xbe,0x24,0x1f,0x70,0x96,0x56,0x96,0xed,0x9d,0x91,0x3d,0x36,0x70,0x50,0x96,0x52,0xaa,0xbd,0x1f,0xd5,0xaa,0xb9,0x1a,0x79,0xb0,0x99,0x9d,0xc4,0x18,0x4d,0x55,0x2f,0xfd,0xc7,0x94,0x12,0xa9,0xea,0x53,0x8c,0xd1,0xcc,0xac,0xf1,0xb5,0x85,0x67,0x8b,0x31,0x1a,0x0,0x5,0x40,0xcc,0x7c,0x4b,0x44,0x9f,0x0,0x54,0x55,0x5f,0x44,0x64,0x5,0x60,0x7,0xa0,0xea,0xba,0x6e,0x31,0x21,0x48,0x29,0xd5,0xaa,0x7a,0x25,0x22,0xef,0x25,0xc7,0xcc,0x4b,0x33,0xb,0x7d,0xdf,0xbf,0xba,0xdc,0x29,0x11,0x7d,0x85,0x10,0x86,0x49,0x7,0x99,0xe4,0x5a,0x44,0xd6,0x73,0x1a,0x65,0xf0,0x77,0x8,0xe1,0x67,0xa2,0x1,0x0,0x84,0x10,0x6,0x22,0xda,0x30,0xf3,0x7d,0x4e,0x59,0x7e,0x60,0xe6,0xb,0x22,0xda,0x7a,0xf0,0x84,0x20,0x9b,0x9a,0x59,0xeb,0xe2,0xd2,0x65,0x53,0xc8,0x30,0x53,0x2c,0x23,0x54,0xaa,0xfa,0x9c,0x5,0x9b,0x1b,0xe1,0x8e,0x88,0x36,0x65,0xfe,0xbd,0xe,0x32,0xf8,0xd1,0x83,0x99,0xf9,0x9c,0x99,0x1f,0x4a,0x2c,0x22,0xeb,0xf1,0x8a,0xe7,0xd6,0xb8,0x3,0x50,0x65,0xc1,0xb6,0x0,0x4c,0x55,0x6f,0x44,0xe4,0xd,0xc0,0x0,0xa0,0xf6,0x6b,0xdc,0x3b,0xa4,0xa6,0x69,0x8e,0x33,0xf8,0x2c,0xab,0xfd,0x9b,0x85,0xfd,0x60,0xe6,0x25,0x80,0xaa,0x6d,0xdb,0xa3,0xb9,0x4b,0xfd,0x27,0xf1,0x7e,0xac,0x8f,0xf7,0x87,0x63,0x7f,0xc3,0xca,0xa9,0x49,0x35,0x25,0x97,0x14,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+};
+
+
static const unsigned char tab_container_bg_png[]={
0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0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27,0x7f,0xe6,0xd3,0x0,0x80,0x9d,0xf8,0x99,0x7b,0x1,0x0,0x5b,0x94,0x21,0x15,0x1,0xa0,0x91,0x0,0x20,0x13,0x65,0x88,0x44,0x0,0x68,0x3b,0x0,0xac,0xcf,0x56,0x8a,0x45,0x0,0x58,0x30,0x0,0x14,0x66,0x4b,0xc4,0x39,0x0,0xd8,0x2d,0x0,0x30,0x49,0x57,0x66,0x48,0x0,0xb0,0xb7,0x0,0xc0,0xce,0x10,0xb,0xb2,0x0,0x8,0xc,0x0,0x30,0x51,0x88,0x85,0x29,0x0,0x4,0x7b,0x0,0x60,0xc8,0x23,0x23,0x78,0x0,0x84,0x99,0x0,0x14,0x46,0xf2,0x57,0x3c,0xf1,0x2b,0xae,0x10,0xe7,0x2a,0x0,0x0,0x78,0x99,0xb2,0x3c,0xb9,0x24,0x39,0x45,0x81,0x5b,0x8,0x2d,0x71,0x7,0x57,0x57,0x2e,0x1e,0x28,0xce,0x49,0x17,0x2b,0x14,0x36,0x61,0x2,0x61,0x9a,0x40,0x2e,0xc2,0x79,0x99,0x19,0x32,0x81,0x34,0xf,0xe0,0xf3,0xcc,0x0,0x0,0xa0,0x91,0x15,0x11,0xe0,0x83,0xf3,0xfd,0x78,0xce,0xe,0xae,0xce,0xce,0x36,0x8e,0xb6,0xe,0x5f,0x2d,0xea,0xbf,0x6,0xff,0x22,0x62,0x62,0xe3,0xfe,0xe5,0xcf,0xab,0x70,0x40,0x0,0x0,0xe1,0x74,0x7e,0xd1,0xfe,0x2c,0x2f,0xb3,0x1a,0x80,0x3b,0x6,0x80,0x6d,0xfe,0xa2,0x25,0xee,0x4,0x68,0x5e,0xb,0xa0,0x75,0xf7,0x8b,0x66,0xb2,0xf,0x40,0xb5,0x0,0xa0,0xe9,0xda,0x57,0xf3,0x70,0xf8,0x7e,0x3c,0x3c,0x45,0xa1,0x90,0xb9,0xd9,0xd9,0xe5,0xe4,0xe4,0xd8,0x4a,0xc4,0x42,0x5b,0x61,0xca,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41,0xc8,0x8,0x13,0x61,0x21,0xda,0x88,0x1,0x62,0x8a,0x58,0x23,0x8e,0x8,0x17,0x99,0x85,0xf8,0x21,0xc1,0x48,0x4,0x12,0x8b,0x24,0x20,0xc9,0x88,0x14,0x51,0x22,0x4b,0x91,0x35,0x48,0x31,0x52,0x8a,0x54,0x20,0x55,0x48,0x1d,0xf2,0x3d,0x72,0x2,0x39,0x87,0x5c,0x46,0xba,0x91,0x3b,0xc8,0x0,0x32,0x82,0xfc,0x86,0xbc,0x47,0x31,0x94,0x81,0xb2,0x51,0x3d,0xd4,0xc,0xb5,0x43,0xb9,0xa8,0x37,0x1a,0x84,0x46,0xa2,0xb,0xd0,0x64,0x74,0x31,0x9a,0x8f,0x16,0xa0,0x9b,0xd0,0x72,0xb4,0x1a,0x3d,0x8c,0x36,0xa1,0xe7,0xd0,0xab,0x68,0xf,0xda,0x8f,0x3e,0x43,0xc7,0x30,0xc0,0xe8,0x18,0x7,0x33,0xc4,0x6c,0x30,0x2e,0xc6,0xc3,0x42,0xb1,0x38,0x2c,0x9,0x93,0x63,0xcb,0xb1,0x22,0xac,0xc,0xab,0xc6,0x1a,0xb0,0x56,0xac,0x3,0xbb,0x89,0xf5,0x63,0xcf,0xb1,0x77,0x4,0x12,0x81,0x45,0xc0,0x9,0x36,0x4,0x77,0x42,0x20,0x61,0x1e,0x41,0x48,0x58,0x4c,0x58,0x4e,0xd8,0x48,0xa8,0x20,0x1c,0x24,0x34,0x11,0xda,0x9,0x37,0x9,0x3,0x84,0x51,0xc2,0x27,0x22,0x93,0xa8,0x4b,0xb4,0x26,0xba,0x11,0xf9,0xc4,0x18,0x62,0x32,0x31,0x87,0x58,0x48,0x2c,0x23,0xd6,0x12,0x8f,0x13,0x2f,0x10,0x7b,0x88,0x43,0xc4,0x37,0x24,0x12,0x89,0x43,0x32,0x27,0xb9,0x90,0x2,0x49,0xb1,0xa4,0x54,0xd2,0x12,0xd2,0x46,0xd2,0x6e,0x52,0x23,0xe9,0x2c,0xa9,0x9b,0x34,0x48,0x1a,0x23,0x93,0xc9,0xda,0x64,0x6b,0xb2,0x7,0x39,0x94,0x2c,0x20,0x2b,0xc8,0x85,0xe4,0x9d,0xe4,0xc3,0xe4,0x33,0xe4,0x1b,0xe4,0x21,0xf2,0x5b,0xa,0x9d,0x62,0x40,0x71,0xa4,0xf8,0x53,0xe2,0x28,0x52,0xca,0x6a,0x4a,0x19,0xe5,0x10,0xe5,0x34,0xe5,0x6,0x65,0x98,0x32,0x41,0x55,0xa3,0x9a,0x52,0xdd,0xa8,0xa1,0x54,0x11,0x35,0x8f,0x5a,0x42,0xad,0xa1,0xb6,0x52,0xaf,0x51,0x87,0xa8,0x13,0x34,0x75,0x9a,0x39,0xcd,0x83,0x16,0x49,0x4b,0xa5,0xad,0xa2,0x95,0xd3,0x1a,0x68,0x17,0x68,0xf7,0x69,0xaf,0xe8,0x74,0xba,0x11,0xdd,0x95,0x1e,0x4e,0x97,0xd0,0x57,0xd2,0xcb,0xe9,0x47,0xe8,0x97,0xe8,0x3,0xf4,0x77,0xc,0xd,0x86,0x15,0x83,0xc7,0x88,0x67,0x28,0x19,0x9b,0x18,0x7,0x18,0x67,0x19,0x77,0x18,0xaf,0x98,0x4c,0xa6,0x19,0xd3,0x8b,0x19,0xc7,0x54,0x30,0x37,0x31,0xeb,0x98,0xe7,0x99,0xf,0x99,0x6f,0x55,0x58,0x2a,0xb6,0x2a,0x7c,0x15,0x91,0xca,0xa,0x95,0x4a,0x95,0x26,0x95,0x1b,0x2a,0x2f,0x54,0xa9,0xaa,0xa6,0xaa,0xde,0xaa,0xb,0x55,0xf3,0x55,0xcb,0x54,0x8f,0xa9,0x5e,0x53,0x7d,0xae,0x46,0x55,0x33,0x53,0xe3,0xa9,0x9,0xd4,0x96,0xab,0x55,0xaa,0x9d,0x50,0xeb,0x53,0x1b,0x53,0x67,0xa9,0x3b,0xa8,0x87,0xaa,0x67,0xa8,0x6f,0x54,0x3f,0xa4,0x7e,0x59,0xfd,0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0xe1,0x7a,0xd2,0xf5,0x9d,0x9b,0xb3,0x9b,0xc2,0xed,0xa8,0xdb,0xaf,0xee,0x36,0xee,0x69,0xee,0x87,0xdc,0x9f,0xcc,0x34,0x9f,0x29,0x9e,0x59,0x33,0x73,0xd0,0xc3,0xc8,0x43,0xe0,0x51,0xe5,0xd1,0x3f,0xb,0x9f,0x95,0x30,0x6b,0xdf,0xac,0x7e,0x4f,0x43,0x4f,0x81,0x67,0xb5,0xe7,0x23,0x2f,0x63,0x2f,0x91,0x57,0xad,0xd7,0xb0,0xb7,0xa5,0x77,0xaa,0xf7,0x61,0xef,0x17,0x3e,0xf6,0x3e,0x72,0x9f,0xe3,0x3e,0xe3,0x3c,0x37,0xde,0x32,0xde,0x59,0x5f,0xcc,0x37,0xc0,0xb7,0xc8,0xb7,0xcb,0x4f,0xc3,0x6f,0x9e,0x5f,0x85,0xdf,0x43,0x7f,0x23,0xff,0x64,0xff,0x7a,0xff,0xd1,0x0,0xa7,0x80,0x25,0x1,0x67,0x3,0x89,0x81,0x41,0x81,0x5b,0x2,0xfb,0xf8,0x7a,0x7c,0x21,0xbf,0x8e,0x3f,0x3a,0xdb,0x65,0xf6,0xb2,0xd9,0xed,0x41,0x8c,0xa0,0xb9,0x41,0x15,0x41,0x8f,0x82,0xad,0x82,0xe5,0xc1,0xad,0x21,0x68,0xc8,0xec,0x90,0xad,0x21,0xf7,0xe7,0x98,0xce,0x91,0xce,0x69,0xe,0x85,0x50,0x7e,0xe8,0xd6,0xd0,0x7,0x61,0xe6,0x61,0x8b,0xc3,0x7e,0xc,0x27,0x85,0x87,0x85,0x57,0x86,0x3f,0x8e,0x70,0x88,0x58,0x1a,0xd1,0x31,0x97,0x35,0x77,0xd1,0xdc,0x43,0x73,0xdf,0x44,0xfa,0x44,0x96,0x44,0xde,0x9b,0x67,0x31,0x4f,0x39,0xaf,0x2d,0x4a,0x35,0x2a,0x3e,0xaa,0x2e,0x6a,0x3c,0xda,0x37,0xba,0x34,0xba,0x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d,0x74,0x40,0xc1,0x5a,0xea,0x45,0xc4,0xa5,0x27,0xf0,0x34,0x73,0x84,0xe2,0x61,0x3c,0x81,0xee,0xc4,0x8b,0x8,0x76,0xd3,0xea,0x14,0x5a,0xe8,0x74,0xde,0x4b,0x5c,0x4c,0x46,0x2a,0xd4,0x3a,0xc5,0x40,0x20,0x8b,0xe4,0x4f,0xfe,0xf0,0xff,0xe,0x8,0xc0,0x0,0xc8,0x81,0x13,0xab,0x3d,0x90,0xf1,0x33,0x4,0x48,0xc0,0x16,0xd8,0x0,0x35,0xb0,0xed,0x86,0xcf,0x80,0x2,0x18,0x5a,0x9d,0x3,0xce,0x12,0x40,0x2d,0x6b,0x60,0xd,0x2c,0x81,0xa,0xdb,0x9e,0x3,0xc5,0xed,0xcd,0xdd,0xfd,0xf8,0xea,0xba,0x8c,0x29,0x16,0xaa,0xec,0xd,0xe7,0x20,0xf8,0x50,0xbd,0xcf,0xde,0xa6,0x2f,0xaf,0x4f,0x8f,0x40,0xc,0x76,0xf6,0x70,0x3c,0x9a,0x94,0xd5,0xe7,0xa2,0x88,0x31,0xa2,0xec,0x47,0x70,0x38,0x42,0x8,0xc5,0x78,0x34,0x29,0x81,0x67,0x60,0xf5,0x4d,0xa1,0x89,0x4d,0xd1,0xc4,0xe6,0xd7,0xe1,0x96,0x87,0xd2,0xc4,0x86,0x26,0x36,0x85,0x51,0x1d,0x4,0x7b,0x58,0x2e,0x22,0x88,0xa,0x7f,0x85,0xa2,0x88,0x8,0x46,0xdd,0x7,0xfb,0xb6,0x53,0x51,0x54,0x94,0x3e,0x61,0x7d,0xe,0xc8,0x42,0x47,0x2f,0x69,0xea,0x75,0x1,0x40,0xd2,0xd4,0x1,0x10,0x76,0x51,0x55,0x8f,0xba,0x80,0x5d,0x0,0x55,0x3d,0x2,0xa0,0xed,0xd3,0xe,0x40,0x5a,0xd0,0x84,0xf6,0xa4,0x20,0x2d,0x5,0x5,0x24,0x98,0x3c,0x6b,0x84,0xde,0x4f,0xa4,0xdd,0x53,0x3,0x29,0x33,0x6d,0xaf,0x71,0x59,0x95,0x79,0x8f,0xa8,0x1e,0xcc,0xcc,0x7b,0x70,0x59,0x65,0x92,0xde,0x6,0x33,0xc6,0x72,0xbe,0x98,0x4d,0x2f,0xce,0x2f,0xcb,0x24,0xa9,0xe0,0x80,0x96,0x7d,0x16,0x3e,0xe6,0x8b,0xd9,0x83,0xf9,0x61,0xe3,0x80,0xd3,0x7f,0x98,0x69,0x1d,0x8c,0x2,0x40,0x4,0x56,0xc7,0xda,0xf9,0xb,0x57,0x2d,0xbb,0xf5,0x2d,0xe4,0x89,0x1b,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
};
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index d2795bddb8..03127620f7 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -1597,6 +1597,16 @@ Node *PackedScene::instance(bool p_gen_edit_state) const {
return s;
}
+void PackedScene::replace_state(Ref<SceneState> p_by) {
+
+ state=p_by;
+ state->set_path(get_path());
+#ifdef TOOLS_ENABLED
+ state->set_last_modified_time(get_last_modified_time());
+#endif
+
+}
+
void PackedScene::recreate_state() {
state = Ref<SceneState>( memnew( SceneState ));
diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h
index 911ffd2542..00a812f16a 100644
--- a/scene/resources/packed_scene.h
+++ b/scene/resources/packed_scene.h
@@ -50,7 +50,6 @@ class SceneState : public Reference {
FLAG_INSTANCE_IS_PLACEHOLDER=(1<<30),
FLAG_MASK=(1<<24)-1,
NO_PARENT_SAVED=0x7FFFFFFF,
- TYPE_INSTANCED=0x7FFFFFFF,
};
@@ -106,6 +105,10 @@ class SceneState : public Reference {
static bool disable_placeholders;
public:
+ enum {
+ TYPE_INSTANCED=0x7FFFFFFF
+ };
+
static void set_disable_placeholders(bool p_disable);
int find_node_by_path(const NodePath& p_node) const;
@@ -195,6 +198,7 @@ public:
Node *instance(bool p_gen_edit_state=false) const;
void recreate_state();
+ void replace_state(Ref<SceneState> p_by);
virtual void set_path(const String& p_path,bool p_take_over=false);
#ifdef TOOLS_ENABLED
diff --git a/scene/resources/sample.cpp b/scene/resources/sample.cpp
index 0354cbc3b2..4b25a2c490 100644
--- a/scene/resources/sample.cpp
+++ b/scene/resources/sample.cpp
@@ -210,11 +210,11 @@ void Sample::_bind_methods(){
ADD_PROPERTY( PropertyInfo( Variant::DICTIONARY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), _SCS("_set_data"), _SCS("_get_data") );
ADD_PROPERTY( PropertyInfo( Variant::BOOL, "stereo"), _SCS(""), _SCS("is_stereo") );
- ADD_PROPERTY( PropertyInfo( Variant::INT, "length"), _SCS(""), _SCS("get_length") );
+ ADD_PROPERTY( PropertyInfo( Variant::INT, "length",PROPERTY_HINT_RANGE,"0,999999999"), _SCS(""), _SCS("get_length") );
ADD_PROPERTY( PropertyInfo( Variant::INT, "mix_rate", PROPERTY_HINT_RANGE,"1,192000,1" ), _SCS("set_mix_rate"), _SCS("get_mix_rate") );
ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_format", PROPERTY_HINT_ENUM,"None,Forward,PingPong" ), _SCS("set_loop_format"), _SCS("get_loop_format") );
- ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_begin", PROPERTY_HINT_RANGE,"0,"+itos(99999999)+",1"), _SCS("set_loop_begin"), _SCS("get_loop_begin") );
- ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_end", PROPERTY_HINT_RANGE,"0,"+itos(99999999)+",1"), _SCS("set_loop_end"), _SCS("get_loop_end") );
+ ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_begin", PROPERTY_HINT_RANGE,"0,"+itos(999999999)+",1"), _SCS("set_loop_begin"), _SCS("get_loop_begin") );
+ ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_end", PROPERTY_HINT_RANGE,"0,"+itos(999999999)+",1"), _SCS("set_loop_end"), _SCS("get_loop_end") );
BIND_CONSTANT( FORMAT_PCM8 );
BIND_CONSTANT( FORMAT_PCM16 );
diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp
index aef11433dc..5450b9e2ac 100644
--- a/scene/resources/scene_format_text.cpp
+++ b/scene/resources/scene_format_text.cpp
@@ -302,6 +302,10 @@ Error ResourceInteractiveLoaderText::poll() {
if (error) {
if (error!=ERR_FILE_EOF) {
_printerr();
+ } else {
+ if (!ResourceCache::has(res_path)) {
+ resource->set_path(res_path);
+ }
}
return error;
}
@@ -362,18 +366,15 @@ Error ResourceInteractiveLoaderText::poll() {
parent=packed_scene->get_state()->add_node_path(next_tag.fields["parent"]);
}
- if (next_tag.fields.has("owner")) {
- owner=packed_scene->get_state()->add_node_path(next_tag.fields["owner"]);
- } else {
- if (parent!=-1)
- owner=0; //if no owner, owner is root
- }
if (next_tag.fields.has("type")) {
type=packed_scene->get_state()->add_name(next_tag.fields["type"]);
+ } else {
+ type=SceneState::TYPE_INSTANCED; //no type? assume this was instanced
}
+
if (next_tag.fields.has("instance")) {
instance=packed_scene->get_state()->add_value(next_tag.fields["instance"]);
@@ -384,6 +385,13 @@ Error ResourceInteractiveLoaderText::poll() {
}
}
+ if (next_tag.fields.has("owner")) {
+ owner=packed_scene->get_state()->add_node_path(next_tag.fields["owner"]);
+ } else {
+ if (parent!=-1 && !(type==SceneState::TYPE_INSTANCED && instance==-1))
+ owner=0; //if no owner, owner is root
+ }
+
int node_id = packed_scene->get_state()->add_node(parent,owner,type,name,instance);
@@ -399,6 +407,9 @@ Error ResourceInteractiveLoaderText::poll() {
_printerr();
} else {
resource=packed_scene;
+ if (!ResourceCache::has(res_path)) {
+ packed_scene->set_path(res_path);
+ }
}
return error;
}
@@ -473,8 +484,8 @@ Error ResourceInteractiveLoaderText::poll() {
}
Vector<int> bind_ints;
- for(int i=9;i<binds.size();i++) {
- bind_ints.push_back( packed_scene->get_state()->add_value( bind_ints[i] ) );
+ for(int i=0;i<binds.size();i++) {
+ bind_ints.push_back( packed_scene->get_state()->add_value( binds[i] ) );
}
packed_scene->get_state()->add_connection(
@@ -1366,10 +1377,10 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re
Array binds=state->get_connection_binds(i);
f->store_string(connstr);
- if (binds.size()) {
+ if (binds.size()) {
String vars;
VariantWriter::write_to_string(binds,vars,_write_resources,this);
- f->store_string("binds= "+vars);
+ f->store_string(" binds= "+vars);
}
diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp
index e485379182..eabc84c41e 100644
--- a/scene/resources/shader_graph.cpp
+++ b/scene/resources/shader_graph.cpp
@@ -1533,7 +1533,7 @@ const ShaderGraph::NodeSlotInfo ShaderGraph::node_slot_info[]= {
{NODE_CURVE_MAP,{SLOT_TYPE_SCALAR,SLOT_MAX},{SLOT_TYPE_SCALAR,SLOT_MAX}}, // vec3 interpolation (with optional curve)
{NODE_SCALAR_INPUT,{SLOT_MAX},{SLOT_TYPE_SCALAR,SLOT_MAX}}, // scalar uniform (assignable in material)
{NODE_VEC_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_MAX}}, // vec3 uniform (assignable in material)
- {NODE_RGB_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_MAX}}, // color uniform (assignable in material)
+ {NODE_RGB_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // color uniform (assignable in material)
{NODE_XFORM_INPUT,{SLOT_MAX},{SLOT_TYPE_XFORM,SLOT_MAX}}, // mat4 uniform (assignable in material)
{NODE_TEXTURE_INPUT,{SLOT_TYPE_VEC,SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // texture input (assignable in material)
{NODE_CUBEMAP_INPUT,{SLOT_TYPE_VEC,SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // cubemap input (assignable in material)
@@ -2576,8 +2576,9 @@ void ShaderGraph::_add_node_code(ShaderType p_type,Node *p_node,const Vector<Str
String name = p_node->param1;
Color dv= p_node->param2;
- code +="uniform color "+name+"=vec4("+rtos(dv.r)+","+rtos(dv.g)+","+rtos(dv.g)+","+rtos(dv.a)+");\n";
+ code +="uniform color "+name+"=vec4("+rtos(dv.r)+","+rtos(dv.g)+","+rtos(dv.b)+","+rtos(dv.a)+");\n";
code += OUTNAME(p_node->id,0)+"="+name+".rgb;\n";
+ code += OUTNAME(p_node->id,1)+"="+name+".a;\n";
}break;
case NODE_XFORM_INPUT: {