summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/sprite_3d.cpp11
-rw-r--r--scene/3d/sprite_3d.h2
-rw-r--r--scene/gui/dialogs.cpp18
-rw-r--r--scene/gui/dialogs.h11
-rw-r--r--scene/scene_string_names.cpp1
-rw-r--r--scene/scene_string_names.h1
6 files changed, 26 insertions, 18 deletions
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index c4c80fa37d..fd22076091 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -333,9 +333,6 @@ void SpriteBase3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_item_rect"), &SpriteBase3D::get_item_rect);
ClassDB::bind_method(D_METHOD("generate_triangle_mesh"), &SpriteBase3D::generate_triangle_mesh);
- ClassDB::bind_method(D_METHOD("_queue_update"), &SpriteBase3D::_queue_update);
- ClassDB::bind_method(D_METHOD("_im_update"), &SpriteBase3D::_im_update);
-
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "centered"), "set_centered", "is_centered");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flip_h"), "set_flip_h", "is_flipped_h");
@@ -525,16 +522,20 @@ void Sprite3D::_draw() {
VS::get_singleton()->immediate_end(immediate);
}
+void Sprite3D::_texture_changed() {
+ _queue_update();
+}
+
void Sprite3D::set_texture(const Ref<Texture2D> &p_texture) {
if (p_texture == texture)
return;
if (texture.is_valid()) {
- texture->disconnect_compat(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_queue_update);
+ texture->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Sprite3D::_texture_changed));
}
texture = p_texture;
if (texture.is_valid()) {
- texture->connect_compat(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_queue_update);
+ texture->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Sprite3D::_texture_changed));
}
_queue_update();
}
diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h
index 3b3f0265ce..082884c83b 100644
--- a/scene/3d/sprite_3d.h
+++ b/scene/3d/sprite_3d.h
@@ -157,6 +157,8 @@ class Sprite3D : public SpriteBase3D {
int vframes;
int hframes;
+ void _texture_changed();
+
protected:
virtual void _draw();
static void _bind_methods();
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index 0237be8ad6..6cadd0a63e 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -338,8 +338,6 @@ void WindowDialog::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_resizable"), &WindowDialog::get_resizable);
ClassDB::bind_method(D_METHOD("get_close_button"), &WindowDialog::get_close_button);
- ClassDB::bind_method(D_METHOD("_closed"), &WindowDialog::_closed); // Still used by some connect_compat.
-
ADD_PROPERTY(PropertyInfo(Variant::STRING, "window_title", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT_INTL), "set_title", "get_title");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "resizable", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT_INTL), "set_resizable", "get_resizable");
}
@@ -398,7 +396,7 @@ void AcceptDialog::_notification(int p_what) {
}
}
-void AcceptDialog::_builtin_text_entered(const String &p_text) {
+void AcceptDialog::_text_entered(const String &p_text) {
_ok_pressed();
}
@@ -410,11 +408,18 @@ void AcceptDialog::_ok_pressed() {
ok_pressed();
emit_signal("confirmed");
}
+
void AcceptDialog::_close_pressed() {
cancel_pressed();
}
+// FIXME: This is redundant with _closed_pressed, but there's a slight behavior
+// change (WindowDialog's _closed() also calls hide()) which should be assessed.
+void AcceptDialog::_on_close_pressed() {
+ _closed(); // From WindowDialog.
+}
+
String AcceptDialog::get_text() const {
return label->get_text();
@@ -449,7 +454,7 @@ void AcceptDialog::register_text_enter(Node *p_line_edit) {
ERR_FAIL_NULL(p_line_edit);
LineEdit *line_edit = Object::cast_to<LineEdit>(p_line_edit);
if (line_edit)
- line_edit->connect("text_entered", callable_mp(this, &AcceptDialog::_builtin_text_entered));
+ line_edit->connect("text_entered", callable_mp(this, &AcceptDialog::_text_entered));
}
void AcceptDialog::_update_child_rects() {
@@ -546,7 +551,7 @@ Button *AcceptDialog::add_cancel(const String &p_cancel) {
if (p_cancel == "")
c = RTR("Cancel");
Button *b = swap_ok_cancel ? add_button(c, true) : add_button(c);
- b->connect_compat("pressed", this, "_closed");
+ b->connect("pressed", callable_mp(this, &AcceptDialog::_on_close_pressed));
return b;
}
@@ -564,9 +569,6 @@ void AcceptDialog::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_autowrap", "autowrap"), &AcceptDialog::set_autowrap);
ClassDB::bind_method(D_METHOD("has_autowrap"), &AcceptDialog::has_autowrap);
- ClassDB::bind_method(D_METHOD("_ok"), &AcceptDialog::_ok_pressed); // Still used by some connect_compat.
- ClassDB::bind_method(D_METHOD("_builtin_text_entered"), &AcceptDialog::_builtin_text_entered); // Still used by some connect_compat.
-
ADD_SIGNAL(MethodInfo("confirmed"));
ADD_SIGNAL(MethodInfo("custom_action", PropertyInfo(Variant::STRING_NAME, "action")));
diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h
index b6381e98b4..c474f7849d 100644
--- a/scene/gui/dialogs.h
+++ b/scene/gui/dialogs.h
@@ -64,7 +64,6 @@ class WindowDialog : public Popup {
#endif
void _gui_input(const Ref<InputEvent> &p_event);
- void _closed();
int _drag_hit_test(const Point2 &pos) const;
protected:
@@ -75,6 +74,9 @@ protected:
void _notification(int p_what);
static void _bind_methods();
+ // Not private since used by derived classes signal.
+ void _closed();
+
public:
TextureButton *get_close_button();
@@ -113,9 +115,7 @@ class AcceptDialog : public WindowDialog {
bool hide_on_ok;
void _custom_action(const String &p_action);
- void _ok_pressed();
void _close_pressed();
- void _builtin_text_entered(const String &p_text);
void _update_child_rects();
static bool swap_ok_cancel;
@@ -128,6 +128,11 @@ protected:
virtual void cancel_pressed() {}
virtual void custom_action(const String &) {}
+ // Not private since used by derived classes signal.
+ void _text_entered(const String &p_text);
+ void _ok_pressed();
+ void _on_close_pressed();
+
public:
Size2 get_minimum_size() const;
diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp
index 59f9bc17f8..d3c5a87cae 100644
--- a/scene/scene_string_names.cpp
+++ b/scene/scene_string_names.cpp
@@ -162,7 +162,6 @@ SceneStringNames::SceneStringNames() {
can_drop_data = StaticCString::create("can_drop_data");
_im_update = StaticCString::create("_im_update"); // Sprite3D
- _queue_update = StaticCString::create("_queue_update"); // Sprite3D
baked_light_changed = StaticCString::create("baked_light_changed");
_baked_light_changed = StaticCString::create("_baked_light_changed");
diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h
index 0d76105f9b..7976a2072c 100644
--- a/scene/scene_string_names.h
+++ b/scene/scene_string_names.h
@@ -174,7 +174,6 @@ public:
StringName _get_minimum_size;
StringName _im_update;
- StringName _queue_update;
StringName baked_light_changed;
StringName _baked_light_changed;