summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/area.cpp2
-rw-r--r--scene/animation/animation_node_state_machine.cpp3
-rw-r--r--scene/gui/dialogs.cpp14
-rw-r--r--scene/gui/dialogs.h3
-rw-r--r--scene/resources/animation.cpp8
5 files changed, 27 insertions, 3 deletions
diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp
index 3557f0425c..4247266e3d 100644
--- a/scene/3d/area.cpp
+++ b/scene/3d/area.cpp
@@ -752,7 +752,7 @@ Area::Area() :
gravity_is_point = false;
gravity_distance_scale = 0;
linear_damp = 0.1;
- angular_damp = 1;
+ angular_damp = 0.1;
priority = 0;
monitoring = false;
monitorable = false;
diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp
index 60f8806b25..a2411743d4 100644
--- a/scene/animation/animation_node_state_machine.cpp
+++ b/scene/animation/animation_node_state_machine.cpp
@@ -599,6 +599,9 @@ void AnimationNodeStateMachine::remove_node(const StringName &p_name) {
{
Ref<AnimationNode> node = states[p_name].node;
+
+ ERR_FAIL_COND(node.is_null());
+
node->disconnect("tree_changed", this, "_tree_changed");
}
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index 89f3d509d0..4da11b671e 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -406,12 +406,20 @@ void AcceptDialog::set_hide_on_ok(bool p_hide) {
hide_on_ok = p_hide;
}
-
bool AcceptDialog::get_hide_on_ok() const {
return hide_on_ok;
}
+void AcceptDialog::set_autowrap(bool p_autowrap) {
+
+ label->set_autowrap(p_autowrap);
+}
+bool AcceptDialog::has_autowrap() {
+
+ return label->has_autowrap();
+}
+
void AcceptDialog::register_text_enter(Node *p_line_edit) {
ERR_FAIL_NULL(p_line_edit);
@@ -530,6 +538,8 @@ void AcceptDialog::_bind_methods() {
ClassDB::bind_method(D_METHOD("_custom_action"), &AcceptDialog::_custom_action);
ClassDB::bind_method(D_METHOD("set_text", "text"), &AcceptDialog::set_text);
ClassDB::bind_method(D_METHOD("get_text"), &AcceptDialog::get_text);
+ ClassDB::bind_method(D_METHOD("set_autowrap", "autowrap"), &AcceptDialog::set_autowrap);
+ ClassDB::bind_method(D_METHOD("has_autowrap"), &AcceptDialog::has_autowrap);
ADD_SIGNAL(MethodInfo("confirmed"));
ADD_SIGNAL(MethodInfo("custom_action", PropertyInfo(Variant::STRING, "action")));
@@ -537,6 +547,7 @@ void AcceptDialog::_bind_methods() {
ADD_GROUP("Dialog", "dialog");
ADD_PROPERTY(PropertyInfo(Variant::STRING, "dialog_text", PROPERTY_HINT_MULTILINE_TEXT, "", PROPERTY_USAGE_DEFAULT_INTL), "set_text", "get_text");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dialog_hide_on_ok"), "set_hide_on_ok", "get_hide_on_ok");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dialog_autowrap"), "set_autowrap", "has_autowrap");
}
bool AcceptDialog::swap_ok_cancel = false;
@@ -555,7 +566,6 @@ AcceptDialog::AcceptDialog() {
label->set_anchor(MARGIN_BOTTOM, ANCHOR_END);
label->set_begin(Point2(margin, margin));
label->set_end(Point2(-margin, -button_margin - 10));
- //label->set_autowrap(true);
add_child(label);
hbc = memnew(HBoxContainer);
diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h
index 4b89ac54c5..c1a7f26a85 100644
--- a/scene/gui/dialogs.h
+++ b/scene/gui/dialogs.h
@@ -145,6 +145,9 @@ public:
void set_text(String p_text);
String get_text() const;
+ void set_autowrap(bool p_autowrap);
+ bool has_autowrap();
+
AcceptDialog();
~AcceptDialog();
};
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index e4da659b0d..1ca643cd7a 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -1425,7 +1425,9 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p
TransformTrack *tt = static_cast<TransformTrack *>(t);
ERR_FAIL_INDEX(p_key_idx, tt->transforms.size());
+
Dictionary d = p_value;
+
if (d.has("location"))
tt->transforms.write[p_key_idx].value.loc = d["location"];
if (d.has("rotation"))
@@ -1438,6 +1440,7 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p
ValueTrack *vt = static_cast<ValueTrack *>(t);
ERR_FAIL_INDEX(p_key_idx, vt->values.size());
+
vt->values.write[p_key_idx].value = p_value;
} break;
@@ -1445,11 +1448,14 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p
MethodTrack *mt = static_cast<MethodTrack *>(t);
ERR_FAIL_INDEX(p_key_idx, mt->methods.size());
+
Dictionary d = p_value;
+
if (d.has("method"))
mt->methods.write[p_key_idx].method = d["method"];
if (d.has("args"))
mt->methods.write[p_key_idx].params = d["args"];
+
} break;
case TYPE_BEZIER: {
@@ -1469,6 +1475,7 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p
case TYPE_AUDIO: {
AudioTrack *at = static_cast<AudioTrack *>(t);
+ ERR_FAIL_INDEX(p_key_idx, at->values.size());
Dictionary k = p_value;
ERR_FAIL_COND(!k.has("start_offset"));
@@ -1483,6 +1490,7 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p
case TYPE_ANIMATION: {
AnimationTrack *at = static_cast<AnimationTrack *>(t);
+ ERR_FAIL_INDEX(p_key_idx, at->values.size());
at->values.write[p_key_idx].value = p_value;