summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/node_2d.cpp22
-rw-r--r--scene/animation/tween.cpp1
-rw-r--r--scene/gui/control.cpp12
-rwxr-xr-xscene/main/node.cpp1
-rw-r--r--scene/main/scene_main_loop.cpp5
-rw-r--r--scene/main/scene_main_loop.h1
-rw-r--r--scene/main/viewport.cpp4
7 files changed, 29 insertions, 17 deletions
diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp
index 1ba6ec46cf..16b6342299 100644
--- a/scene/2d/node_2d.cpp
+++ b/scene/2d/node_2d.cpp
@@ -63,9 +63,10 @@ void Node2D::edit_set_state(const Variant &p_state) {
angle = state[1];
_scale = state[2];
_update_transform();
- _change_notify("transform/rot");
- _change_notify("transform/scale");
- _change_notify("transform/pos");
+ _change_notify("rotation");
+ _change_notify("rotation_deg");
+ _change_notify("scale");
+ _change_notify("position");
}
void Node2D::edit_set_rect(const Rect2 &p_edit_rect) {
@@ -95,15 +96,16 @@ void Node2D::edit_set_rect(const Rect2 &p_edit_rect) {
_scale *= new_scale;
_update_transform();
- _change_notify("transform/scale");
- _change_notify("transform/pos");
+ _change_notify("scale");
+ _change_notify("position");
}
void Node2D::edit_rotate(float p_rot) {
angle += p_rot;
_update_transform();
- _change_notify("transform/rot");
+ _change_notify("rotation");
+ _change_notify("rotation_deg");
}
void Node2D::_update_xform_values() {
@@ -134,7 +136,7 @@ void Node2D::set_position(const Point2 &p_pos) {
((Node2D *)this)->_update_xform_values();
pos = p_pos;
_update_transform();
- _change_notify("transform/pos");
+ _change_notify("position");
}
void Node2D::set_rotation(float p_radians) {
@@ -143,7 +145,8 @@ void Node2D::set_rotation(float p_radians) {
((Node2D *)this)->_update_xform_values();
angle = p_radians;
_update_transform();
- _change_notify("transform/rot");
+ _change_notify("rotation");
+ _change_notify("rotation_deg");
}
void Node2D::set_rotation_in_degrees(float p_degrees) {
@@ -169,7 +172,7 @@ void Node2D::set_scale(const Size2 &p_scale) {
if (_scale.y == 0)
_scale.y = CMP_EPSILON;
_update_transform();
- _change_notify("transform/scale");
+ _change_notify("scale");
}
Point2 Node2D::get_position() const {
@@ -349,6 +352,7 @@ void Node2D::set_z(int p_z) {
ERR_FAIL_COND(p_z > VS::CANVAS_ITEM_Z_MAX);
z = p_z;
VS::get_singleton()->canvas_item_set_z(get_canvas_item(), z);
+ _change_notify("z");
}
void Node2D::set_z_as_relative(bool p_enabled) {
diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp
index c455d20b14..bb7ea47178 100644
--- a/scene/animation/tween.cpp
+++ b/scene/animation/tween.cpp
@@ -610,6 +610,7 @@ void Tween::_tween_process(float p_delta) {
_apply_tween_value(data, result);
if (data.finish) {
+ _apply_tween_value(data, data.final_val);
emit_signal("tween_completed", object, data.key);
// not repeat mode, remove completed action
if (!repeat)
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index d2f3eea721..7f9944833a 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -1347,12 +1347,12 @@ Control::AnchorType Control::get_anchor(Margin p_margin) const {
void Control::_change_notify_margins() {
// this avoids sending the whole object data again on a change
- _change_notify("margin/left");
- _change_notify("margin/top");
- _change_notify("margin/right");
- _change_notify("margin/bottom");
- _change_notify("rect/pos");
- _change_notify("rect/size");
+ _change_notify("margin_left");
+ _change_notify("margin_top");
+ _change_notify("margin_right");
+ _change_notify("margin_bottom");
+ _change_notify("rect_pos");
+ _change_notify("rect_size");
}
void Control::set_margin(Margin p_margin, float p_value) {
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index c13ed232a7..42e9cec217 100755
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -2914,6 +2914,7 @@ void Node::_bind_methods() {
BIND_CONSTANT(DUPLICATE_SIGNALS);
BIND_CONSTANT(DUPLICATE_GROUPS);
BIND_CONSTANT(DUPLICATE_SCRIPTS);
+ BIND_CONSTANT(DUPLICATE_USE_INSTANCING);
ADD_SIGNAL(MethodInfo("renamed"));
ADD_SIGNAL(MethodInfo("tree_entered"));
diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp
index 79ee4a6f75..8eb09908ad 100644
--- a/scene/main/scene_main_loop.cpp
+++ b/scene/main/scene_main_loop.cpp
@@ -374,6 +374,10 @@ void SceneTree::input_text(const String &p_text) {
root_lock--;
}
+bool SceneTree::is_input_handled() {
+ return input_handled;
+}
+
void SceneTree::input_event(const InputEvent &p_event) {
if (is_editor_hint() && (p_event.type == InputEvent::JOYPAD_MOTION || p_event.type == InputEvent::JOYPAD_BUTTON))
@@ -2153,6 +2157,7 @@ void SceneTree::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_pause", "enable"), &SceneTree::set_pause);
ClassDB::bind_method(D_METHOD("is_paused"), &SceneTree::is_paused);
ClassDB::bind_method(D_METHOD("set_input_as_handled"), &SceneTree::set_input_as_handled);
+ ClassDB::bind_method(D_METHOD("is_input_handled"), &SceneTree::is_input_handled);
ClassDB::bind_method(D_METHOD("create_timer:SceneTreeTimer", "time_sec", "pause_mode_process"), &SceneTree::create_timer, DEFVAL(true));
diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_main_loop.h
index fadf77e30f..47220b9b63 100644
--- a/scene/main/scene_main_loop.h
+++ b/scene/main/scene_main_loop.h
@@ -350,6 +350,7 @@ public:
void quit();
void set_input_as_handled();
+ bool is_input_handled();
_FORCE_INLINE_ float get_fixed_process_time() const { return fixed_process_time; }
_FORCE_INLINE_ float get_idle_process_time() const { return idle_process_time; }
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 23f8189167..3b8fd1ae3e 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1401,7 +1401,7 @@ void Viewport::_vp_input(const InputEvent &p_ev) {
return;
#ifdef TOOLS_ENABLED
- if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) {
+ if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) {
return;
}
#endif
@@ -1422,7 +1422,7 @@ void Viewport::_vp_unhandled_input(const InputEvent &p_ev) {
if (disable_input)
return;
#ifdef TOOLS_ENABLED
- if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) {
+ if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) {
return;
}
#endif