summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/canvas_layer.cpp6
-rw-r--r--scene/main/http_request.cpp4
-rw-r--r--scene/main/node.cpp23
-rw-r--r--scene/main/scene_tree.cpp31
-rwxr-xr-xscene/main/timer.cpp4
-rw-r--r--scene/main/viewport.cpp18
6 files changed, 39 insertions, 47 deletions
diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp
index 04cf5c6338..2085fa3a60 100644
--- a/scene/main/canvas_layer.cpp
+++ b/scene/main/canvas_layer.cpp
@@ -307,15 +307,15 @@ void CanvasLayer::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "layer", PROPERTY_HINT_RANGE, "-128,128,1"), "set_layer", "get_layer");
ADD_GROUP("Transform", "");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "rotation_degrees", PROPERTY_HINT_RANGE, "-1080,1080,0.1,or_lesser,or_greater", PROPERTY_USAGE_EDITOR), "set_rotation_degrees", "get_rotation_degrees");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "rotation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_rotation", "get_rotation");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rotation_degrees", PROPERTY_HINT_RANGE, "-1080,1080,0.1,or_lesser,or_greater", PROPERTY_USAGE_EDITOR), "set_rotation_degrees", "get_rotation_degrees");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rotation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_rotation", "get_rotation");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "scale"), "set_scale", "get_scale");
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "transform"), "set_transform", "get_transform");
ADD_GROUP("", "");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_viewport", PROPERTY_HINT_RESOURCE_TYPE, "Viewport", 0), "set_custom_viewport", "get_custom_viewport");
ADD_GROUP("Follow Viewport", "follow_viewport");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "follow_viewport_enable"), "set_follow_viewport", "is_following_viewport");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "follow_viewport_scale", PROPERTY_HINT_RANGE, "0.001,1000,0.001,or_greater,or_lesser"), "set_follow_viewport_scale", "get_follow_viewport_scale");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "follow_viewport_scale", PROPERTY_HINT_RANGE, "0.001,1000,0.001,or_greater,or_lesser"), "set_follow_viewport_scale", "get_follow_viewport_scale");
}
CanvasLayer::CanvasLayer() {
diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp
index 85bde92851..fee2ada76d 100644
--- a/scene/main/http_request.cpp
+++ b/scene/main/http_request.cpp
@@ -539,8 +539,6 @@ void HTTPRequest::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_download_chunk_size"), &HTTPRequest::set_download_chunk_size);
ClassDB::bind_method(D_METHOD("get_download_chunk_size"), &HTTPRequest::get_download_chunk_size);
- ClassDB::bind_method(D_METHOD("_timeout"), &HTTPRequest::_timeout);
-
ADD_PROPERTY(PropertyInfo(Variant::STRING, "download_file", PROPERTY_HINT_FILE), "set_download_file", "get_download_file");
ADD_PROPERTY(PropertyInfo(Variant::INT, "download_chunk_size", PROPERTY_HINT_RANGE, "256,16777216"), "set_download_chunk_size", "get_download_chunk_size");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_threads"), "set_use_threads", "is_using_threads");
@@ -589,7 +587,7 @@ HTTPRequest::HTTPRequest() {
timer = memnew(Timer);
timer->set_one_shot(true);
- timer->connect_compat("timeout", this, "_timeout");
+ timer->connect("timeout", callable_mp(this, &HTTPRequest::_timeout));
add_child(timer);
timeout = 0;
}
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 7b10a4dc2f..973dff07d2 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -30,8 +30,6 @@
#include "node.h"
-#include <stdint.h>
-
#include "core/core_string_names.h"
#include "core/io/resource_loader.h"
#include "core/message_queue.h"
@@ -46,6 +44,8 @@
#include "editor/editor_settings.h"
#endif
+#include <stdint.h>
+
VARIANT_ENUM_CAST(Node::PauseMode);
int Node::orphan_node_count = 0;
@@ -2346,15 +2346,18 @@ void Node::_duplicate_signals(const Node *p_original, Node *p_copy) const {
Node *copytarget = target;
- // Atempt to find a path to the duplicate target, if it seems it's not part
+ // Attempt to find a path to the duplicate target, if it seems it's not part
// of the duplicated and not yet parented hierarchy then at least try to connect
// to the same target as the original
if (p_copy->has_node(ptarget))
copytarget = p_copy->get_node(ptarget);
- if (copy && copytarget && !copy->is_connected_compat(E->get().signal.get_name(), copytarget, E->get().callable.get_method())) {
- copy->connect_compat(E->get().signal.get_name(), copytarget, E->get().callable.get_method(), E->get().binds, E->get().flags);
+ if (copy && copytarget) {
+ const Callable copy_callable = Callable(copytarget, E->get().callable.get_method());
+ if (!copy->is_connected(E->get().signal.get_name(), copy_callable)) {
+ copy->connect(E->get().signal.get_name(), copy_callable, E->get().binds, E->get().flags);
+ }
}
}
}
@@ -2509,10 +2512,10 @@ void Node::_replace_connections_target(Node *p_new_target) {
Connection &c = E->get();
if (c.flags & CONNECT_PERSIST) {
- c.signal.get_object()->disconnect_compat(c.signal.get_name(), this, c.callable.get_method());
+ c.signal.get_object()->disconnect(c.signal.get_name(), Callable(this, c.callable.get_method()));
bool valid = p_new_target->has_method(c.callable.get_method()) || Ref<Script>(p_new_target->get_script()).is_null() || Ref<Script>(p_new_target->get_script())->has_method(c.callable.get_method());
ERR_CONTINUE_MSG(!valid, "Attempt to connect signal '" + c.signal.get_object()->get_class() + "." + c.signal.get_name() + "' to nonexistent method '" + c.callable.get_object()->get_class() + "." + c.callable.get_method() + "'.");
- c.signal.get_object()->connect_compat(c.signal.get_name(), p_new_target, c.callable.get_method(), c.binds, c.flags);
+ c.signal.get_object()->connect(c.signal.get_name(), Callable(p_new_target, c.callable.get_method()), c.binds, c.flags);
}
}
}
@@ -2800,7 +2803,7 @@ void Node::_bind_methods() {
GLOBAL_DEF("node/name_casing", NAME_CASING_PASCAL_CASE);
ProjectSettings::get_singleton()->set_custom_property_info("node/name_casing", PropertyInfo(Variant::INT, "node/name_casing", PROPERTY_HINT_ENUM, "PascalCase,camelCase,snake_case"));
- ClassDB::bind_method(D_METHOD("add_child_below_node", "node", "child_node", "legible_unique_name"), &Node::add_child_below_node, DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("add_child_below_node", "preceding_node", "node", "legible_unique_name"), &Node::add_child_below_node, DEFVAL(false));
ClassDB::bind_method(D_METHOD("set_name", "name"), &Node::set_name);
ClassDB::bind_method(D_METHOD("get_name"), &Node::get_name);
@@ -2983,8 +2986,8 @@ void Node::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "set_custom_multiplayer", "get_custom_multiplayer");
ADD_PROPERTY(PropertyInfo(Variant::INT, "process_priority"), "set_process_priority", "get_process_priority");
- BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::REAL, "delta")));
- BIND_VMETHOD(MethodInfo("_physics_process", PropertyInfo(Variant::REAL, "delta")));
+ BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::FLOAT, "delta")));
+ BIND_VMETHOD(MethodInfo("_physics_process", PropertyInfo(Variant::FLOAT, "delta")));
BIND_VMETHOD(MethodInfo("_enter_tree"));
BIND_VMETHOD(MethodInfo("_exit_tree"));
BIND_VMETHOD(MethodInfo("_ready"));
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index f27415ee6f..370cf6a2a4 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -59,7 +59,7 @@ void SceneTreeTimer::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_time_left", "time"), &SceneTreeTimer::set_time_left);
ClassDB::bind_method(D_METHOD("get_time_left"), &SceneTreeTimer::get_time_left);
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_left"), "set_time_left", "get_time_left");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_left"), "set_time_left", "get_time_left");
ADD_SIGNAL(MethodInfo("timeout"));
}
@@ -88,7 +88,7 @@ void SceneTreeTimer::release_connections() {
for (List<Connection>::Element *E = connections.front(); E; E = E->next()) {
Connection const &connection = E->get();
- disconnect_compat(connection.signal.get_name(), connection.callable.get_object(), connection.callable.get_method());
+ disconnect(connection.signal.get_name(), connection.callable);
}
}
@@ -435,7 +435,7 @@ void SceneTree::input_event(const Ref<InputEvent> &p_event) {
if (ScriptDebugger::get_singleton() && ScriptDebugger::get_singleton()->is_remote()) {
//quit from game window using F8
Ref<InputEventKey> k = ev;
- if (k.is_valid() && k->is_pressed() && !k->is_echo() && k->get_scancode() == KEY_F8) {
+ if (k.is_valid() && k->is_pressed() && !k->is_echo() && k->get_keycode() == KEY_F8) {
ScriptDebugger::get_singleton()->request_quit();
}
}
@@ -1393,21 +1393,21 @@ void SceneTree::set_multiplayer(Ref<MultiplayerAPI> p_multiplayer) {
ERR_FAIL_COND(!p_multiplayer.is_valid());
if (multiplayer.is_valid()) {
- multiplayer->disconnect_compat("network_peer_connected", this, "_network_peer_connected");
- multiplayer->disconnect_compat("network_peer_disconnected", this, "_network_peer_disconnected");
- multiplayer->disconnect_compat("connected_to_server", this, "_connected_to_server");
- multiplayer->disconnect_compat("connection_failed", this, "_connection_failed");
- multiplayer->disconnect_compat("server_disconnected", this, "_server_disconnected");
+ multiplayer->disconnect("network_peer_connected", callable_mp(this, &SceneTree::_network_peer_connected));
+ multiplayer->disconnect("network_peer_disconnected", callable_mp(this, &SceneTree::_network_peer_disconnected));
+ multiplayer->disconnect("connected_to_server", callable_mp(this, &SceneTree::_connected_to_server));
+ multiplayer->disconnect("connection_failed", callable_mp(this, &SceneTree::_connection_failed));
+ multiplayer->disconnect("server_disconnected", callable_mp(this, &SceneTree::_server_disconnected));
}
multiplayer = p_multiplayer;
multiplayer->set_root_node(root);
- multiplayer->connect_compat("network_peer_connected", this, "_network_peer_connected");
- multiplayer->connect_compat("network_peer_disconnected", this, "_network_peer_disconnected");
- multiplayer->connect_compat("connected_to_server", this, "_connected_to_server");
- multiplayer->connect_compat("connection_failed", this, "_connection_failed");
- multiplayer->connect_compat("server_disconnected", this, "_server_disconnected");
+ multiplayer->connect("network_peer_connected", callable_mp(this, &SceneTree::_network_peer_connected));
+ multiplayer->connect("network_peer_disconnected", callable_mp(this, &SceneTree::_network_peer_disconnected));
+ multiplayer->connect("connected_to_server", callable_mp(this, &SceneTree::_connected_to_server));
+ multiplayer->connect("connection_failed", callable_mp(this, &SceneTree::_connection_failed));
+ multiplayer->connect("server_disconnected", callable_mp(this, &SceneTree::_server_disconnected));
}
void SceneTree::set_network_peer(const Ref<NetworkedMultiplayerPeer> &p_network_peer) {
@@ -1528,11 +1528,6 @@ void SceneTree::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_rpc_sender_id"), &SceneTree::get_rpc_sender_id);
ClassDB::bind_method(D_METHOD("set_refuse_new_network_connections", "refuse"), &SceneTree::set_refuse_new_network_connections);
ClassDB::bind_method(D_METHOD("is_refusing_new_network_connections"), &SceneTree::is_refusing_new_network_connections);
- ClassDB::bind_method(D_METHOD("_network_peer_connected"), &SceneTree::_network_peer_connected);
- ClassDB::bind_method(D_METHOD("_network_peer_disconnected"), &SceneTree::_network_peer_disconnected);
- ClassDB::bind_method(D_METHOD("_connected_to_server"), &SceneTree::_connected_to_server);
- ClassDB::bind_method(D_METHOD("_connection_failed"), &SceneTree::_connection_failed);
- ClassDB::bind_method(D_METHOD("_server_disconnected"), &SceneTree::_server_disconnected);
ClassDB::bind_method(D_METHOD("set_use_font_oversampling", "enable"), &SceneTree::set_use_font_oversampling);
ClassDB::bind_method(D_METHOD("is_using_font_oversampling"), &SceneTree::is_using_font_oversampling);
diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp
index cb213be731..7c847095e1 100755
--- a/scene/main/timer.cpp
+++ b/scene/main/timer.cpp
@@ -206,11 +206,11 @@ void Timer::_bind_methods() {
ADD_SIGNAL(MethodInfo("timeout"));
ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_timer_process_mode", "get_timer_process_mode");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "wait_time", PROPERTY_HINT_EXP_RANGE, "0.001,4096,0.001,or_greater"), "set_wait_time", "get_wait_time");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wait_time", PROPERTY_HINT_EXP_RANGE, "0.001,4096,0.001,or_greater"), "set_wait_time", "get_wait_time");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "is_one_shot");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autostart"), "set_autostart", "has_autostart");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "paused", PROPERTY_HINT_NONE, "", 0), "set_paused", "is_paused");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_left", PROPERTY_HINT_NONE, "", 0), "", "get_time_left");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_left", PROPERTY_HINT_NONE, "", 0), "", "get_time_left");
BIND_ENUM_CONSTANT(TIMER_PROCESS_PHYSICS);
BIND_ENUM_CONSTANT(TIMER_PROCESS_IDLE);
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index d39bbed55b..e027ec9b4b 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1124,7 +1124,7 @@ void Viewport::set_world(const Ref<World> &p_world) {
_propagate_exit_world(this);
if (own_world.is_valid() && world.is_valid()) {
- world->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_own_world_changed");
+ world->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Viewport::_own_world_changed));
}
world = p_world;
@@ -1132,7 +1132,7 @@ void Viewport::set_world(const Ref<World> &p_world) {
if (own_world.is_valid()) {
if (world.is_valid()) {
own_world = world->duplicate();
- world->connect_compat(CoreStringNames::get_singleton()->changed, this, "_own_world_changed");
+ world->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Viewport::_own_world_changed));
} else {
own_world = Ref<World>(memnew(World));
}
@@ -2473,7 +2473,7 @@ List<Control *>::Element *Viewport::_gui_add_root_control(Control *p_control) {
List<Control *>::Element *Viewport::_gui_add_subwindow_control(Control *p_control) {
- p_control->connect_compat("visibility_changed", this, "_subwindow_visibility_changed");
+ p_control->connect("visibility_changed", callable_mp(this, &Viewport::_subwindow_visibility_changed));
if (p_control->is_visible_in_tree()) {
gui.subwindow_order_dirty = true;
@@ -2568,7 +2568,7 @@ void Viewport::_gui_remove_subwindow_control(List<Control *>::Element *SI) {
Control *control = SI->get();
- control->disconnect_compat("visibility_changed", this, "_subwindow_visibility_changed");
+ control->disconnect("visibility_changed", callable_mp(this, &Viewport::_subwindow_visibility_changed));
List<Control *>::Element *E = gui.subwindows.find(control);
if (E)
@@ -2850,12 +2850,12 @@ void Viewport::set_use_own_world(bool p_world) {
if (!p_world) {
own_world = Ref<World>();
if (world.is_valid()) {
- world->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_own_world_changed");
+ world->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Viewport::_own_world_changed));
}
} else {
if (world.is_valid()) {
own_world = world->duplicate();
- world->connect_compat(CoreStringNames::get_singleton()->changed, this, "_own_world_changed");
+ world->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Viewport::_own_world_changed));
} else {
own_world = Ref<World>(memnew(World));
}
@@ -3194,10 +3194,6 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_default_canvas_item_texture_repeat", "mode"), &Viewport::set_default_canvas_item_texture_repeat);
ClassDB::bind_method(D_METHOD("get_default_canvas_item_texture_repeat"), &Viewport::get_default_canvas_item_texture_repeat);
- ClassDB::bind_method(D_METHOD("_subwindow_visibility_changed"), &Viewport::_subwindow_visibility_changed);
-
- ClassDB::bind_method(D_METHOD("_own_world_changed"), &Viewport::_own_world_changed);
-
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "arvr"), "set_use_arvr", "use_arvr");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "size"), "set_size", "get_size");
@@ -3360,7 +3356,7 @@ Viewport::Viewport() {
//gui.tooltip_timer->force_parent_owned();
gui.tooltip_delay = GLOBAL_DEF("gui/timers/tooltip_delay_sec", 0.5);
- ProjectSettings::get_singleton()->set_custom_property_info("gui/timers/tooltip_delay_sec", PropertyInfo(Variant::REAL, "gui/timers/tooltip_delay_sec", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater")); // No negative numbers
+ ProjectSettings::get_singleton()->set_custom_property_info("gui/timers/tooltip_delay_sec", PropertyInfo(Variant::FLOAT, "gui/timers/tooltip_delay_sec", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater")); // No negative numbers
gui.tooltip = NULL;
gui.tooltip_label = NULL;