From ea2f3f3a7be7d0b5b33c7188e0650a1645749c2a Mon Sep 17 00:00:00 2001 From: Lightning_A Date: Tue, 27 Jul 2021 07:17:22 -0600 Subject: [PATCH] Remove CoreStringNames and SceneStringNames as they're no longer useful --- core/config/project_settings.cpp | 5 +- core/core_string_names.cpp | 81 ------- core/core_string_names.h | 102 -------- core/io/packed_data_container.cpp | 1 - core/io/resource.cpp | 3 +- core/math/a_star.cpp | 17 +- core/object/message_queue.cpp | 3 +- core/object/object.cpp | 17 +- core/object/script_language.cpp | 1 - core/register_core_types.cpp | 4 - core/variant/variant.cpp | 3 +- core/variant/variant_call.cpp | 1 - core/variant/variant_construct.h | 1 - core/variant/variant_op.h | 1 - core/variant/variant_setget.cpp | 6 +- core/variant/variant_setget.h | 1 - core/variant/variant_utility.cpp | 1 - .../plugins/animation_tree_editor_plugin.cpp | 3 +- editor/plugins/curve_editor_plugin.cpp | 5 +- editor/plugins/script_editor_plugin.cpp | 3 +- .../plugins/texture_region_editor_plugin.cpp | 3 +- .../tiles/tile_set_atlas_source_editor.cpp | 15 +- ...le_set_scenes_collection_source_editor.cpp | 8 +- editor/property_editor.cpp | 1 - main/main.cpp | 1 - .../gdnative/nativescript/nativescript.cpp | 7 +- modules/gdscript/gdscript.cpp | 7 +- modules/gdscript/gdscript_vm.cpp | 9 +- .../gdscript/tests/gdscript_test_runner.cpp | 1 - modules/gridmap/grid_map.cpp | 1 - modules/opensimplex/noise_texture.cpp | 6 +- modules/opensimplex/open_simplex_noise.cpp | 2 - modules/visual_script/visual_script.cpp | 7 +- scene/2d/animated_sprite_2d.cpp | 9 +- scene/2d/area_2d.cpp | 69 +++--- scene/2d/camera_2d.cpp | 1 - scene/2d/collision_object_2d.cpp | 22 +- scene/2d/cpu_particles_2d.cpp | 5 +- scene/2d/gpu_particles_2d.cpp | 1 - scene/2d/joints_2d.cpp | 9 +- scene/2d/line_2d.cpp | 9 +- scene/2d/mesh_instance_2d.cpp | 3 +- scene/2d/multimesh_instance_2d.cpp | 3 +- scene/2d/navigation_region_2d.cpp | 7 +- scene/2d/path_2d.cpp | 1 - scene/2d/physics_body_2d.cpp | 44 ++-- scene/2d/remote_transform_2d.cpp | 1 - scene/2d/sprite_2d.cpp | 10 +- scene/2d/visible_on_screen_notifier_2d.cpp | 5 +- scene/3d/area_3d.cpp | 69 +++--- scene/3d/collision_object_3d.cpp | 13 +- scene/3d/mesh_instance_3d.cpp | 5 +- scene/3d/node_3d.cpp | 11 +- scene/3d/occluder_instance_3d.cpp | 5 +- scene/3d/path_3d.cpp | 1 - scene/3d/physics_body_3d.cpp | 44 ++-- scene/3d/physics_joint_3d.cpp | 10 +- scene/3d/skeleton_3d.cpp | 3 +- scene/3d/sprite_3d.cpp | 17 +- scene/3d/visible_on_screen_notifier_3d.cpp | 5 +- scene/3d/visual_instance_3d.cpp | 5 +- scene/animation/animation_blend_tree.cpp | 18 +- scene/animation/animation_player.cpp | 21 +- scene/animation/animation_tree.cpp | 7 +- scene/gui/base_button.cpp | 5 +- scene/gui/container.cpp | 3 +- scene/gui/control.cpp | 37 ++- scene/gui/nine_patch_rect.cpp | 3 +- scene/gui/rich_text_label.cpp | 1 - scene/gui/texture_rect.cpp | 5 +- scene/gui/video_player.cpp | 3 +- scene/main/canvas_item.cpp | 15 +- scene/main/node.cpp | 40 ++-- scene/main/scene_tree.cpp | 1 - scene/main/shader_globals_override.cpp | 14 +- scene/main/viewport.cpp | 26 +- scene/main/window.cpp | 7 +- scene/register_scene_types.cpp | 4 - scene/resources/animation.cpp | 17 +- scene/resources/curve.cpp | 36 ++- scene/resources/environment.cpp | 5 +- scene/resources/gradient.cpp | 16 +- scene/resources/material.cpp | 1 - scene/resources/packed_scene.cpp | 3 +- scene/resources/shader.cpp | 1 - scene/resources/sprite_frames.cpp | 6 +- scene/resources/texture.cpp | 21 +- scene/resources/tile_set.cpp | 5 +- scene/resources/world_3d.cpp | 1 - scene/scene_string_names.cpp | 215 ----------------- scene/scene_string_names.h | 226 ------------------ tests/test_object.h | 5 +- 92 files changed, 373 insertions(+), 1109 deletions(-) delete mode 100644 core/core_string_names.cpp delete mode 100644 core/core_string_names.h delete mode 100644 scene/scene_string_names.cpp delete mode 100644 scene/scene_string_names.h diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index c5e6c6d68563..09516793550c 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -31,7 +31,6 @@ #include "project_settings.h" #include "core/core_bind.h" // For Compression enum. -#include "core/core_string_names.h" #include "core/input/input_map.h" #include "core/io/dir_access.h" #include "core/io/file_access.h" @@ -173,7 +172,7 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) { } } } else { - if (p_name == CoreStringNames::get_singleton()->_custom_features) { + if (p_name == SNAME("_custom_features")) { Vector custom_feature_array = String(p_value).split(","); for (int i = 0; i < custom_feature_array.size(); i++) { custom_features.insert(custom_feature_array[i]); @@ -706,7 +705,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Mapstore_32(count + 1); //store how many properties are saved, add one for custom featuers, which must always go first - String key = CoreStringNames::get_singleton()->_custom_features; + String key = SNAME("_custom_features"); file->store_pascal_string(key); int len; diff --git a/core/core_string_names.cpp b/core/core_string_names.cpp deleted file mode 100644 index ff8569e45dc7..000000000000 --- a/core/core_string_names.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/*************************************************************************/ -/* core_string_names.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#include "core_string_names.h" - -CoreStringNames *CoreStringNames::singleton = nullptr; - -CoreStringNames::CoreStringNames() : - _free(StaticCString::create("free")), - changed(StaticCString::create("changed")), - _meta(StaticCString::create("__meta__")), - _script(StaticCString::create("script")), - script_changed(StaticCString::create("script_changed")), - ___pdcdata(StaticCString::create("___pdcdata")), - __getvar(StaticCString::create("__getvar")), - _iter_init(StaticCString::create("_iter_init")), - _iter_next(StaticCString::create("_iter_next")), - _iter_get(StaticCString::create("_iter_get")), - get_rid(StaticCString::create("get_rid")), - _to_string(StaticCString::create("_to_string")), -#ifdef TOOLS_ENABLED - _sections_unfolded(StaticCString::create("_sections_unfolded")), -#endif - _custom_features(StaticCString::create("_custom_features")), - x(StaticCString::create("x")), - y(StaticCString::create("y")), - z(StaticCString::create("z")), - w(StaticCString::create("w")), - r(StaticCString::create("r")), - g(StaticCString::create("g")), - b(StaticCString::create("b")), - a(StaticCString::create("a")), - position(StaticCString::create("position")), - size(StaticCString::create("size")), - end(StaticCString::create("end")), - basis(StaticCString::create("basis")), - origin(StaticCString::create("origin")), - normal(StaticCString::create("normal")), - d(StaticCString::create("d")), - h(StaticCString::create("h")), - s(StaticCString::create("s")), - v(StaticCString::create("v")), - r8(StaticCString::create("r8")), - g8(StaticCString::create("g8")), - b8(StaticCString::create("b8")), - a8(StaticCString::create("a8")), - call(StaticCString::create("call")), - call_deferred(StaticCString::create("call_deferred")), - bind(StaticCString::create("bind")), - unbind(StaticCString::create("unbind")), - emit(StaticCString::create("emit")), - notification(StaticCString::create("notification")), - property_list_changed(StaticCString::create("property_list_changed")) { -} diff --git a/core/core_string_names.h b/core/core_string_names.h deleted file mode 100644 index abe751372e81..000000000000 --- a/core/core_string_names.h +++ /dev/null @@ -1,102 +0,0 @@ -/*************************************************************************/ -/* core_string_names.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#ifndef CORE_STRING_NAMES_H -#define CORE_STRING_NAMES_H - -#include "core/string/string_name.h" - -class CoreStringNames { - friend void register_core_types(); - friend void unregister_core_types(); - - static void create() { singleton = memnew(CoreStringNames); } - static void free() { - memdelete(singleton); - singleton = nullptr; - } - - CoreStringNames(); - -public: - _FORCE_INLINE_ static CoreStringNames *get_singleton() { return singleton; } - - static CoreStringNames *singleton; - - StringName _free; - StringName changed; - StringName _meta; - StringName _script; - StringName script_changed; - StringName ___pdcdata; - StringName __getvar; - StringName _iter_init; - StringName _iter_next; - StringName _iter_get; - StringName get_rid; - StringName _to_string; -#ifdef TOOLS_ENABLED - StringName _sections_unfolded; -#endif - StringName _custom_features; - - StringName x; - StringName y; - StringName z; - StringName w; - StringName r; - StringName g; - StringName b; - StringName a; - StringName position; - StringName size; - StringName end; - StringName basis; - StringName origin; - StringName normal; - StringName d; - StringName h; - StringName s; - StringName v; - StringName r8; - StringName g8; - StringName b8; - StringName a8; - - StringName call; - StringName call_deferred; - StringName bind; - StringName unbind; - StringName emit; - StringName notification; - StringName property_list_changed; -}; - -#endif // CORE_STRING_NAMES_H diff --git a/core/io/packed_data_container.cpp b/core/io/packed_data_container.cpp index 4a76f0191d8e..28c44be09805 100644 --- a/core/io/packed_data_container.cpp +++ b/core/io/packed_data_container.cpp @@ -30,7 +30,6 @@ #include "packed_data_container.h" -#include "core/core_string_names.h" #include "core/io/marshalls.h" Variant PackedDataContainer::getvar(const Variant &p_key, bool *r_valid) const { diff --git a/core/io/resource.cpp b/core/io/resource.cpp index 727611a5735e..697e041d993c 100644 --- a/core/io/resource.cpp +++ b/core/io/resource.cpp @@ -30,7 +30,6 @@ #include "resource.h" -#include "core/core_string_names.h" #include "core/io/file_access.h" #include "core/io/resource_loader.h" #include "core/math/math_funcs.h" @@ -41,7 +40,7 @@ #include void Resource::emit_changed() { - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } void Resource::_resource_path_changed() { diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index 88e11a630cd9..0406c400eb0e 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -32,7 +32,6 @@ #include "core/math/geometry_3d.h" #include "core/object/script_language.h" -#include "scene/scene_string_names.h" int AStar::get_available_point_id() const { if (points.is_empty()) { @@ -388,8 +387,8 @@ bool AStar::_solve(Point *begin_point, Point *end_point) { } real_t AStar::_estimate_cost(int p_from_id, int p_to_id) { - if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_estimate_cost)) { - return get_script_instance()->call(SceneStringNames::get_singleton()->_estimate_cost, p_from_id, p_to_id); + if (get_script_instance() && get_script_instance()->has_method(SNAME("_estimate_cost"))) { + return get_script_instance()->call(SNAME("_estimate_cost"), p_from_id, p_to_id); } Point *from_point; @@ -404,8 +403,8 @@ real_t AStar::_estimate_cost(int p_from_id, int p_to_id) { } real_t AStar::_compute_cost(int p_from_id, int p_to_id) { - if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_compute_cost)) { - return get_script_instance()->call(SceneStringNames::get_singleton()->_compute_cost, p_from_id, p_to_id); + if (get_script_instance() && get_script_instance()->has_method(SNAME("_compute_cost"))) { + return get_script_instance()->call(SNAME("_compute_cost"), p_from_id, p_to_id); } Point *from_point; @@ -660,8 +659,8 @@ Vector2 AStar2D::get_closest_position_in_segment(const Vector2 &p_point) const { } real_t AStar2D::_estimate_cost(int p_from_id, int p_to_id) { - if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_estimate_cost)) { - return get_script_instance()->call(SceneStringNames::get_singleton()->_estimate_cost, p_from_id, p_to_id); + if (get_script_instance() && get_script_instance()->has_method(SNAME("_estimate_cost"))) { + return get_script_instance()->call(SNAME("_estimate_cost"), p_from_id, p_to_id); } AStar::Point *from_point; @@ -676,8 +675,8 @@ real_t AStar2D::_estimate_cost(int p_from_id, int p_to_id) { } real_t AStar2D::_compute_cost(int p_from_id, int p_to_id) { - if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_compute_cost)) { - return get_script_instance()->call(SceneStringNames::get_singleton()->_compute_cost, p_from_id, p_to_id); + if (get_script_instance() && get_script_instance()->has_method(SNAME("_compute_cost"))) { + return get_script_instance()->call(SNAME("_compute_cost"), p_from_id, p_to_id); } AStar::Point *from_point; diff --git a/core/object/message_queue.cpp b/core/object/message_queue.cpp index 4751c69f1eae..bf9db6838ac1 100644 --- a/core/object/message_queue.cpp +++ b/core/object/message_queue.cpp @@ -31,7 +31,6 @@ #include "message_queue.h" #include "core/config/project_settings.h" -#include "core/core_string_names.h" #include "core/object/script_language.h" MessageQueue *MessageQueue::singleton = nullptr; @@ -104,7 +103,7 @@ Error MessageQueue::push_notification(ObjectID p_id, int p_notification) { Message *msg = memnew_placement(&buffer[buffer_end], Message); msg->type = TYPE_NOTIFICATION; - msg->callable = Callable(p_id, CoreStringNames::get_singleton()->notification); //name is meaningless but callable needs it + msg->callable = Callable(p_id, SNAME("notification")); //name is meaningless but callable needs it //msg->target; msg->notification = p_notification; diff --git a/core/object/object.cpp b/core/object/object.cpp index d552d5e5e0c0..b78b76c85bcd 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -30,7 +30,6 @@ #include "object.h" -#include "core/core_string_names.h" #include "core/io/resource.h" #include "core/object/class_db.h" #include "core/object/message_queue.h" @@ -413,14 +412,14 @@ void Object::set(const StringName &p_name, const Variant &p_value, bool *r_valid } } - if (p_name == CoreStringNames::get_singleton()->_script) { + if (p_name == SNAME("script")) { set_script(p_value); if (r_valid) { *r_valid = true; } return; - } else if (p_name == CoreStringNames::get_singleton()->_meta) { + } else if (p_name == SNAME("__meta__")) { //set_meta(p_name,p_value); metadata = p_value.duplicate(); if (r_valid) { @@ -495,14 +494,14 @@ Variant Object::get(const StringName &p_name, bool *r_valid) const { } } - if (p_name == CoreStringNames::get_singleton()->_script) { + if (p_name == SNAME("script")) { ret = get_script(); if (r_valid) { *r_valid = true; } return ret; - } else if (p_name == CoreStringNames::get_singleton()->_meta) { + } else if (p_name == SNAME("__meta__")) { ret = metadata; if (r_valid) { *r_valid = true; @@ -706,7 +705,7 @@ Variant Object::_call_deferred_bind(const Variant **p_args, int p_argcount, Call } bool Object::has_method(const StringName &p_method) const { - if (p_method == CoreStringNames::get_singleton()->_free) { + if (p_method == SNAME("free")) { return true; } @@ -777,7 +776,7 @@ Variant Object::call(const StringName &p_name, VARIANT_ARG_DECLARE) { Variant Object::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { r_error.error = Callable::CallError::CALL_OK; - if (p_method == CoreStringNames::get_singleton()->_free) { + if (p_method == SNAME("free")) { //free must be here, before anything, always ready #ifdef DEBUG_ENABLED if (p_argcount != 0) { @@ -897,7 +896,7 @@ void Object::set_script(const Variant &p_script) { } notify_property_list_changed(); //scripts may add variables, so refresh is desired - emit_signal(CoreStringNames::get_singleton()->script_changed); + emit_signal(SNAME("script_changed")); } void Object::set_script_instance(ScriptInstance *p_instance) { @@ -1536,7 +1535,7 @@ void Object::clear_internal_resource_paths() { } void Object::notify_property_list_changed() { - emit_signal(CoreStringNames::get_singleton()->property_list_changed); + emit_signal(SNAME("property_list_changed")); } void Object::_bind_methods() { diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp index 0fb8c7350cb3..4626196f3d88 100644 --- a/core/object/script_language.cpp +++ b/core/object/script_language.cpp @@ -31,7 +31,6 @@ #include "script_language.h" #include "core/config/project_settings.h" -#include "core/core_string_names.h" #include "core/debugger/engine_debugger.h" #include "core/debugger/script_debugger.h" diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index 3d1cb4a8e181..2b0e121ac33f 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -33,7 +33,6 @@ #include "core/config/engine.h" #include "core/config/project_settings.h" #include "core/core_bind.h" -#include "core/core_string_names.h" #include "core/crypto/aes_context.h" #include "core/crypto/crypto.h" #include "core/crypto/hashing_context.h" @@ -118,8 +117,6 @@ void register_core_types() { Variant::register_types(); - CoreStringNames::create(); - resource_format_po.instantiate(); ResourceLoader::add_resource_format_loader(resource_format_po); @@ -360,6 +357,5 @@ void unregister_core_types() { ClassDB::cleanup(); ResourceCache::clear(); - CoreStringNames::free(); StringName::cleanup(); } diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp index 97a1b4c02a8e..bb72163d7f57 100644 --- a/core/variant/variant.cpp +++ b/core/variant/variant.cpp @@ -30,7 +30,6 @@ #include "variant.h" -#include "core/core_string_names.h" #include "core/debugger/engine_debugger.h" #include "core/io/json.h" #include "core/io/marshalls.h" @@ -2036,7 +2035,7 @@ Variant::operator ::RID() const { } #endif Callable::CallError ce; - Variant ret = _get_obj().obj->call(CoreStringNames::get_singleton()->get_rid, nullptr, 0, ce); + Variant ret = _get_obj().obj->call(SNAME("get_rid"), nullptr, 0, ce); if (ce.error == Callable::CallError::CALL_OK && ret.get_type() == Variant::RID) { return ret; } diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index f8538f71d374..dace9930567f 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -30,7 +30,6 @@ #include "variant.h" -#include "core/core_string_names.h" #include "core/crypto/crypto_core.h" #include "core/debugger/engine_debugger.h" #include "core/io/compression.h" diff --git a/core/variant/variant_construct.h b/core/variant/variant_construct.h index b03f4a8d3bd0..adff393a5b03 100644 --- a/core/variant/variant_construct.h +++ b/core/variant/variant_construct.h @@ -33,7 +33,6 @@ #include "variant.h" -#include "core/core_string_names.h" #include "core/crypto/crypto_core.h" #include "core/debugger/engine_debugger.h" #include "core/io/compression.h" diff --git a/core/variant/variant_op.h b/core/variant/variant_op.h index cbdd60f4043f..8bcc7be86c44 100644 --- a/core/variant/variant_op.h +++ b/core/variant/variant_op.h @@ -33,7 +33,6 @@ #include "variant.h" -#include "core/core_string_names.h" #include "core/debugger/engine_debugger.h" #include "core/object/class_db.h" diff --git a/core/variant/variant_setget.cpp b/core/variant/variant_setget.cpp index ae3c7685fd72..69f2cd12ea22 100644 --- a/core/variant/variant_setget.cpp +++ b/core/variant/variant_setget.cpp @@ -1190,7 +1190,7 @@ bool Variant::iter_init(Variant &r_iter, bool &valid) const { ref.push_back(r_iter); Variant vref = ref; const Variant *refp[] = { &vref }; - Variant ret = _get_obj().obj->call(CoreStringNames::get_singleton()->_iter_init, refp, 1, ce); + Variant ret = _get_obj().obj->call(SNAME("_iter_init"), refp, 1, ce); if (ref.size() != 1 || ce.error != Callable::CallError::CALL_OK) { valid = false; @@ -1417,7 +1417,7 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const { ref.push_back(r_iter); Variant vref = ref; const Variant *refp[] = { &vref }; - Variant ret = _get_obj().obj->call(CoreStringNames::get_singleton()->_iter_next, refp, 1, ce); + Variant ret = _get_obj().obj->call(SNAME("_iter_next"), refp, 1, ce); if (ref.size() != 1 || ce.error != Callable::CallError::CALL_OK) { valid = false; @@ -1599,7 +1599,7 @@ Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const { Callable::CallError ce; ce.error = Callable::CallError::CALL_OK; const Variant *refp[] = { &r_iter }; - Variant ret = _get_obj().obj->call(CoreStringNames::get_singleton()->_iter_get, refp, 1, ce); + Variant ret = _get_obj().obj->call(SNAME("_iter_get"), refp, 1, ce); if (ce.error != Callable::CallError::CALL_OK) { r_valid = false; diff --git a/core/variant/variant_setget.h b/core/variant/variant_setget.h index dbf24ab3e373..8a506b3c3ba3 100644 --- a/core/variant/variant_setget.h +++ b/core/variant/variant_setget.h @@ -33,7 +33,6 @@ #include "variant.h" -#include "core/core_string_names.h" #include "core/debugger/engine_debugger.h" #include "core/object/class_db.h" #include "core/templates/local_vector.h" diff --git a/core/variant/variant_utility.cpp b/core/variant/variant_utility.cpp index 64f07e075e54..8b4952c50583 100644 --- a/core/variant/variant_utility.cpp +++ b/core/variant/variant_utility.cpp @@ -30,7 +30,6 @@ #include "variant.h" -#include "core/core_string_names.h" #include "core/io/marshalls.h" #include "core/object/ref_counted.h" #include "core/os/os.h" diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index cd84be0c25c7..8baa827e2b0d 100644 --- a/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -45,7 +45,6 @@ #include "scene/gui/menu_button.h" #include "scene/gui/panel.h" #include "scene/main/window.h" -#include "scene/scene_string_names.h" void AnimationTreeEditor::edit(AnimationTree *p_tree) { if (tree == p_tree) { @@ -180,7 +179,7 @@ void AnimationTreeEditor::remove_plugin(AnimationTreeNodeEditorPlugin *p_editor) } String AnimationTreeEditor::get_base_path() { - String path = SceneStringNames::get_singleton()->parameters_base_path; + String path = "parameters/"; for (int i = 0; i < edited_path.size(); i++) { path += edited_path[i] + "/"; } diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 07ff0eb346b9..e18bda7f4dac 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -31,7 +31,6 @@ #include "curve_editor_plugin.h" #include "canvas_item_editor_plugin.h" -#include "core/core_string_names.h" #include "core/input/input.h" #include "core/os/keyboard.h" #include "editor/editor_scale.h" @@ -70,14 +69,14 @@ void CurveEditor::set_curve(Ref curve) { } if (_curve_ref.is_valid()) { - _curve_ref->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CurveEditor::_curve_changed)); + _curve_ref->disconnect(SNAME("changed"), callable_mp(this, &CurveEditor::_curve_changed)); _curve_ref->disconnect(Curve::SIGNAL_RANGE_CHANGED, callable_mp(this, &CurveEditor::_curve_changed)); } _curve_ref = curve; if (_curve_ref.is_valid()) { - _curve_ref->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CurveEditor::_curve_changed)); + _curve_ref->connect(SNAME("changed"), callable_mp(this, &CurveEditor::_curve_changed)); _curve_ref->connect(Curve::SIGNAL_RANGE_CHANGED, callable_mp(this, &CurveEditor::_curve_changed)); } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 668a15da3726..ea35940fbf61 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -46,7 +46,6 @@ #include "editor/node_dock.h" #include "editor/plugins/shader_editor_plugin.h" #include "scene/main/window.h" -#include "scene/scene_string_names.h" #include "script_text_editor.h" #include "servers/display_server.h" #include "text_editor.h" @@ -3579,7 +3578,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { autosave_timer = memnew(Timer); autosave_timer->set_one_shot(false); - autosave_timer->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &ScriptEditor::_update_autosave_timer)); + autosave_timer->connect(SNAME("tree_entered"), callable_mp(this, &ScriptEditor::_update_autosave_timer)); autosave_timer->connect("timeout", callable_mp(this, &ScriptEditor::_autosave_scripts)); add_child(autosave_timer); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index b277f2ab42e1..33dab1b10ae9 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -30,7 +30,6 @@ #include "texture_region_editor_plugin.h" -#include "core/core_string_names.h" #include "core/input/input.h" #include "core/os/keyboard.h" #include "editor/editor_scale.h" @@ -414,7 +413,7 @@ void TextureRegionEditor::_region_input(const Ref &p_input) { } else if (obj_styleBox.is_valid()) { undo_redo->add_do_method(obj_styleBox.ptr(), "set_margin_size", side[edited_margin], obj_styleBox->get_margin_size(side[edited_margin])); undo_redo->add_undo_method(obj_styleBox.ptr(), "set_margin_size", side[edited_margin], prev_margin); - obj_styleBox->emit_signal(CoreStringNames::get_singleton()->changed); + obj_styleBox->emit_signal(SNAME("changed")); } edited_margin = -1; } else { diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 432f48fa8544..60617181ea51 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -44,7 +44,6 @@ #include "scene/gui/split_container.h" #include "scene/gui/tab_container.h" -#include "core/core_string_names.h" #include "core/math/geometry_2d.h" #include "core/os/keyboard.h" @@ -108,7 +107,7 @@ void TileSetAtlasSourceEditor::TileSetAtlasSourceProxyObject::edit(Ref // Disconnect to changes. if (tile_set_atlas_source) { - tile_set_atlas_source->disconnect(CoreStringNames::get_singleton()->property_list_changed, callable_mp((Object *)this, &Object::notify_property_list_changed)); + tile_set_atlas_source->disconnect(SNAME("property_list_changed"), callable_mp((Object *)this, &Object::notify_property_list_changed)); } tile_set = p_tile_set; @@ -117,8 +116,8 @@ void TileSetAtlasSourceEditor::TileSetAtlasSourceProxyObject::edit(Ref // Connect to changes. if (tile_set_atlas_source) { - if (!tile_set_atlas_source->is_connected(CoreStringNames::get_singleton()->property_list_changed, callable_mp((Object *)this, &Object::notify_property_list_changed))) { - tile_set_atlas_source->connect(CoreStringNames::get_singleton()->property_list_changed, callable_mp((Object *)this, &Object::notify_property_list_changed)); + if (!tile_set_atlas_source->is_connected(SNAME("property_list_changed"), callable_mp((Object *)this, &Object::notify_property_list_changed))) { + tile_set_atlas_source->connect(SNAME("property_list_changed"), callable_mp((Object *)this, &Object::notify_property_list_changed)); } } @@ -325,8 +324,8 @@ void TileSetAtlasSourceEditor::AtlasTileProxyObject::edit(TileSetAtlasSource *p_ if (tile_set_atlas_source && tile_set_atlas_source->has_tile(coords) && tile_set_atlas_source->has_alternative_tile(coords, alternative)) { TileData *tile_data = Object::cast_to(tile_set_atlas_source->get_tile_data(coords, alternative)); - if (tile_data->is_connected(CoreStringNames::get_singleton()->property_list_changed, callable_mp((Object *)this, &Object::notify_property_list_changed))) { - tile_data->disconnect(CoreStringNames::get_singleton()->property_list_changed, callable_mp((Object *)this, &Object::notify_property_list_changed)); + if (tile_data->is_connected(SNAME("property_list_changed"), callable_mp((Object *)this, &Object::notify_property_list_changed))) { + tile_data->disconnect(SNAME("property_list_changed"), callable_mp((Object *)this, &Object::notify_property_list_changed)); } } } @@ -341,8 +340,8 @@ void TileSetAtlasSourceEditor::AtlasTileProxyObject::edit(TileSetAtlasSource *p_ if (tile_set_atlas_source->has_tile(coords) && tile_set_atlas_source->has_alternative_tile(coords, alternative)) { TileData *tile_data = Object::cast_to(tile_set_atlas_source->get_tile_data(coords, alternative)); - if (!tile_data->is_connected(CoreStringNames::get_singleton()->property_list_changed, callable_mp((Object *)this, &Object::notify_property_list_changed))) { - tile_data->connect(CoreStringNames::get_singleton()->property_list_changed, callable_mp((Object *)this, &Object::notify_property_list_changed)); + if (!tile_data->is_connected(SNAME("property_list_changed"), callable_mp((Object *)this, &Object::notify_property_list_changed))) { + tile_data->connect(SNAME("property_list_changed"), callable_mp((Object *)this, &Object::notify_property_list_changed)); } } } diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp index f74b3bf9c258..7a40a8e4a3cb 100644 --- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp @@ -36,8 +36,6 @@ #include "scene/gui/item_list.h" -#include "core/core_string_names.h" - void TileSetScenesCollectionSourceEditor::TileSetScenesCollectionProxyObject::set_id(int p_id) { ERR_FAIL_COND(p_id < 0); if (source_id == p_id) { @@ -91,7 +89,7 @@ void TileSetScenesCollectionSourceEditor::TileSetScenesCollectionProxyObject::ed // Disconnect to changes. if (tile_set_scenes_collection_source) { - tile_set_scenes_collection_source->disconnect(CoreStringNames::get_singleton()->property_list_changed, callable_mp((Object *)this, &Object::notify_property_list_changed)); + tile_set_scenes_collection_source->disconnect(SNAME("property_list_changed"), callable_mp((Object *)this, &Object::notify_property_list_changed)); } tile_set = p_tile_set; @@ -100,8 +98,8 @@ void TileSetScenesCollectionSourceEditor::TileSetScenesCollectionProxyObject::ed // Connect to changes. if (tile_set_scenes_collection_source) { - if (!tile_set_scenes_collection_source->is_connected(CoreStringNames::get_singleton()->property_list_changed, callable_mp((Object *)this, &Object::notify_property_list_changed))) { - tile_set_scenes_collection_source->connect(CoreStringNames::get_singleton()->property_list_changed, callable_mp((Object *)this, &Object::notify_property_list_changed)); + if (!tile_set_scenes_collection_source->is_connected(SNAME("property_list_changed"), callable_mp((Object *)this, &Object::notify_property_list_changed))) { + tile_set_scenes_collection_source->connect(SNAME("property_list_changed"), callable_mp((Object *)this, &Object::notify_property_list_changed)); } } diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 7338588d56c6..b6133a5869e6 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -56,7 +56,6 @@ #include "scene/main/window.h" #include "scene/resources/font.h" #include "scene/resources/packed_scene.h" -#include "scene/scene_string_names.h" void EditorResourceConversionPlugin::_bind_methods() { MethodInfo mi; diff --git a/main/main.cpp b/main/main.cpp index 02c3dffd11a8..e2a57ff9e767 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -31,7 +31,6 @@ #include "main.h" #include "core/config/project_settings.h" -#include "core/core_string_names.h" #include "core/crypto/crypto.h" #include "core/debugger/engine_debugger.h" #include "core/extension/extension_api_dump.h" diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index f3a0e9603fa6..15acd221e341 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -36,7 +36,6 @@ #include "core/config/project_settings.h" #include "core/core_constants.h" -#include "core/core_string_names.h" #include "core/io/file_access.h" #include "core/io/file_access_encrypted.h" #include "core/os/os.h" @@ -764,15 +763,15 @@ void NativeScriptInstance::notification(int p_notification) { } String NativeScriptInstance::to_string(bool *r_valid) { - if (has_method(CoreStringNames::get_singleton()->_to_string)) { + if (has_method(SNAME("_to_string"))) { Callable::CallError ce; - Variant ret = call(CoreStringNames::get_singleton()->_to_string, nullptr, 0, ce); + Variant ret = call(SNAME("_to_string"), nullptr, 0, ce); if (ce.error == Callable::CallError::CALL_OK) { if (ret.get_type() != Variant::STRING) { if (r_valid) { *r_valid = false; } - ERR_FAIL_V_MSG(String(), "Wrong type for " + CoreStringNames::get_singleton()->_to_string + ", must be a String."); + ERR_FAIL_V_MSG(String(), "Wrong type for " + SNAME("_to_string") + ", must be a String."); } if (r_valid) { *r_valid = true; diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index bcb53508eae4..b3d15e48f737 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -35,7 +35,6 @@ #include "core/config/engine.h" #include "core/config/project_settings.h" #include "core/core_constants.h" -#include "core/core_string_names.h" #include "core/io/file_access.h" #include "core/io/file_access_encrypted.h" #include "core/os/os.h" @@ -1511,15 +1510,15 @@ void GDScriptInstance::notification(int p_notification) { } String GDScriptInstance::to_string(bool *r_valid) { - if (has_method(CoreStringNames::get_singleton()->_to_string)) { + if (has_method(SNAME("_to_string"))) { Callable::CallError ce; - Variant ret = call(CoreStringNames::get_singleton()->_to_string, nullptr, 0, ce); + Variant ret = call(SNAME("_to_string"), nullptr, 0, ce); if (ce.error == Callable::CallError::CALL_OK) { if (ret.get_type() != Variant::STRING) { if (r_valid) { *r_valid = false; } - ERR_FAIL_V_MSG(String(), "Wrong type for " + CoreStringNames::get_singleton()->_to_string + ", must be a String."); + ERR_FAIL_V_MSG(String(), "Wrong type for " + SNAME("_to_string") + ", must be a String."); } if (r_valid) { *r_valid = true; diff --git a/modules/gdscript/gdscript_vm.cpp b/modules/gdscript/gdscript_vm.cpp index 8a261a88e3ae..25e9ff7e7045 100644 --- a/modules/gdscript/gdscript_vm.cpp +++ b/modules/gdscript/gdscript_vm.cpp @@ -30,7 +30,6 @@ #include "gdscript_function.h" -#include "core/core_string_names.h" #include "core/os/os.h" #include "gdscript.h" #include "gdscript_lambda_callable.h" @@ -2758,7 +2757,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a args[0] = &vref; Callable::CallError ce; - Variant has_next = obj->call(CoreStringNames::get_singleton()->_iter_init, (const Variant **)args, 1, ce); + Variant has_next = obj->call(SNAME("_iter_init"), (const Variant **)args, 1, ce); #ifdef DEBUG_ENABLED if (ce.error != Callable::CallError::CALL_OK) { @@ -2772,7 +2771,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a ip = jumpto; } else { GET_INSTRUCTION_ARG(iterator, 2); - *iterator = obj->call(CoreStringNames::get_singleton()->_iter_get, (const Variant **)args, 1, ce); + *iterator = obj->call(SNAME("_iter_get"), (const Variant **)args, 1, ce); #ifdef DEBUG_ENABLED if (ce.error != Callable::CallError::CALL_OK) { err_text = vformat(R"(There was an error calling "_iter_get" on iterator object of type %s.)", *container); @@ -3089,7 +3088,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a args[0] = &vref; Callable::CallError ce; - Variant has_next = obj->call(CoreStringNames::get_singleton()->_iter_next, (const Variant **)args, 1, ce); + Variant has_next = obj->call(SNAME("_iter_next"), (const Variant **)args, 1, ce); #ifdef DEBUG_ENABLED if (ce.error != Callable::CallError::CALL_OK) { @@ -3103,7 +3102,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a ip = jumpto; } else { GET_INSTRUCTION_ARG(iterator, 2); - *iterator = obj->call(CoreStringNames::get_singleton()->_iter_get, (const Variant **)args, 1, ce); + *iterator = obj->call(SNAME("_iter_get"), (const Variant **)args, 1, ce); #ifdef DEBUG_ENABLED if (ce.error != Callable::CallError::CALL_OK) { err_text = vformat(R"(There was an error calling "_iter_get" on iterator object of type %s.)", *container); diff --git a/modules/gdscript/tests/gdscript_test_runner.cpp b/modules/gdscript/tests/gdscript_test_runner.cpp index 03a48bf071d9..675b01a88abd 100644 --- a/modules/gdscript/tests/gdscript_test_runner.cpp +++ b/modules/gdscript/tests/gdscript_test_runner.cpp @@ -36,7 +36,6 @@ #include "../gdscript_parser.h" #include "core/config/project_settings.h" -#include "core/core_string_names.h" #include "core/io/dir_access.h" #include "core/io/file_access_pack.h" #include "core/os/os.h" diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index fea513c82036..1c2547437fe1 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -35,7 +35,6 @@ #include "scene/3d/light_3d.h" #include "scene/resources/mesh_library.h" #include "scene/resources/surface_tool.h" -#include "scene/scene_string_names.h" #include "servers/navigation_server_3d.h" #include "servers/rendering_server.h" diff --git a/modules/opensimplex/noise_texture.cpp b/modules/opensimplex/noise_texture.cpp index 9db3f3d5fd73..94986cf91a59 100644 --- a/modules/opensimplex/noise_texture.cpp +++ b/modules/opensimplex/noise_texture.cpp @@ -30,8 +30,6 @@ #include "noise_texture.h" -#include "core/core_string_names.h" - NoiseTexture::NoiseTexture() { noise = Ref(); @@ -173,11 +171,11 @@ void NoiseTexture::set_noise(Ref p_noise) { return; } if (noise.is_valid()) { - noise->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NoiseTexture::_queue_update)); + noise->disconnect(SNAME("changed"), callable_mp(this, &NoiseTexture::_queue_update)); } noise = p_noise; if (noise.is_valid()) { - noise->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NoiseTexture::_queue_update)); + noise->connect(SNAME("changed"), callable_mp(this, &NoiseTexture::_queue_update)); } _queue_update(); } diff --git a/modules/opensimplex/open_simplex_noise.cpp b/modules/opensimplex/open_simplex_noise.cpp index f0a886728443..12a320bf4f15 100644 --- a/modules/opensimplex/open_simplex_noise.cpp +++ b/modules/opensimplex/open_simplex_noise.cpp @@ -30,8 +30,6 @@ #include "open_simplex_noise.h" -#include "core/core_string_names.h" - OpenSimplexNoise::OpenSimplexNoise() { _init_seeds(); } diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 7a2404fd809a..6687168c0323 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -31,7 +31,6 @@ #include "visual_script.h" #include "core/config/project_settings.h" -#include "core/core_string_names.h" #include "core/os/os.h" #include "scene/main/node.h" #include "visual_script_nodes.h" @@ -1806,15 +1805,15 @@ void VisualScriptInstance::notification(int p_notification) { } String VisualScriptInstance::to_string(bool *r_valid) { - if (has_method(CoreStringNames::get_singleton()->_to_string)) { + if (has_method(SNAME("_to_string"))) { Callable::CallError ce; - Variant ret = call(CoreStringNames::get_singleton()->_to_string, nullptr, 0, ce); + Variant ret = call(SNAME("_to_string"), nullptr, 0, ce); if (ce.error == Callable::CallError::CALL_OK) { if (ret.get_type() != Variant::STRING) { if (r_valid) { *r_valid = false; } - ERR_FAIL_V_MSG(String(), "Wrong type for " + CoreStringNames::get_singleton()->_to_string + ", must be a String."); + ERR_FAIL_V_MSG(String(), "Wrong type for " + SNAME("_to_string") + ", must be a String."); } if (r_valid) { *r_valid = true; diff --git a/scene/2d/animated_sprite_2d.cpp b/scene/2d/animated_sprite_2d.cpp index da2ab6ada830..7c112d4277c2 100644 --- a/scene/2d/animated_sprite_2d.cpp +++ b/scene/2d/animated_sprite_2d.cpp @@ -32,7 +32,6 @@ #include "core/os/os.h" #include "scene/main/viewport.h" -#include "scene/scene_string_names.h" #ifdef TOOLS_ENABLED Dictionary AnimatedSprite2D::_edit_get_state() const { @@ -179,7 +178,7 @@ void AnimatedSprite2D::_notification(int p_what) { frame = 0; } - emit_signal(SceneStringNames::get_singleton()->animation_finished); + emit_signal(SNAME("animation_finished")); } else { if (backwards) { frame = 0; @@ -189,7 +188,7 @@ void AnimatedSprite2D::_notification(int p_what) { if (!is_over) { is_over = true; - emit_signal(SceneStringNames::get_singleton()->animation_finished); + emit_signal(SNAME("animation_finished")); } } } else { @@ -202,7 +201,7 @@ void AnimatedSprite2D::_notification(int p_what) { update(); - emit_signal(SceneStringNames::get_singleton()->frame_changed); + emit_signal(SNAME("frame_changed")); } float to_process = MIN(timeout, remaining); @@ -303,7 +302,7 @@ void AnimatedSprite2D::set_frame(int p_frame) { _reset_timeout(); update(); - emit_signal(SceneStringNames::get_singleton()->frame_changed); + emit_signal(SNAME("frame_changed")); } int AnimatedSprite2D::get_frame() const { diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index cf84767151b5..acd2dab101b5 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -30,7 +30,6 @@ #include "area_2d.h" -#include "scene/scene_string_names.h" #include "servers/audio_server.h" #include "servers/physics_server_2d.h" @@ -116,9 +115,9 @@ void Area2D::_body_enter_tree(ObjectID p_id) { ERR_FAIL_COND(E->get().in_tree); E->get().in_tree = true; - emit_signal(SceneStringNames::get_singleton()->body_entered, node); + emit_signal(SNAME("body_entered"), node); for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->body_shape_entered, E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape); + emit_signal(SNAME("body_shape_entered"), E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape); } } @@ -130,9 +129,9 @@ void Area2D::_body_exit_tree(ObjectID p_id) { ERR_FAIL_COND(!E); ERR_FAIL_COND(!E->get().in_tree); E->get().in_tree = false; - emit_signal(SceneStringNames::get_singleton()->body_exited, node); + emit_signal(SNAME("body_exited"), node); for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape); + emit_signal(SNAME("body_shape_exited"), E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape); } } @@ -158,10 +157,10 @@ void Area2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i E->get().rc = 0; E->get().in_tree = node && node->is_inside_tree(); if (node) { - node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area2D::_body_enter_tree), make_binds(objid)); - node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area2D::_body_exit_tree), make_binds(objid)); + node->connect(SNAME("tree_entered"), callable_mp(this, &Area2D::_body_enter_tree), make_binds(objid)); + node->connect(SNAME("tree_exiting"), callable_mp(this, &Area2D::_body_exit_tree), make_binds(objid)); if (E->get().in_tree) { - emit_signal(SceneStringNames::get_singleton()->body_entered, node); + emit_signal(SNAME("body_entered"), node); } } } @@ -171,7 +170,7 @@ void Area2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i } if (!node || E->get().in_tree) { - emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_body, node, p_body_shape, p_area_shape); + emit_signal(SNAME("body_shape_entered"), p_body, node, p_body_shape, p_area_shape); } } else { @@ -185,15 +184,15 @@ void Area2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i if (E->get().rc == 0) { body_map.erase(E); if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area2D::_body_enter_tree)); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area2D::_body_exit_tree)); + node->disconnect(SNAME("tree_entered"), callable_mp(this, &Area2D::_body_enter_tree)); + node->disconnect(SNAME("tree_exiting"), callable_mp(this, &Area2D::_body_exit_tree)); if (in_tree) { - emit_signal(SceneStringNames::get_singleton()->body_exited, obj); + emit_signal(SNAME("body_exited"), obj); } } } if (!node || in_tree) { - emit_signal(SceneStringNames::get_singleton()->body_shape_exited, p_body, obj, p_body_shape, p_area_shape); + emit_signal(SNAME("body_shape_exited"), p_body, obj, p_body_shape, p_area_shape); } } @@ -210,9 +209,9 @@ void Area2D::_area_enter_tree(ObjectID p_id) { ERR_FAIL_COND(E->get().in_tree); E->get().in_tree = true; - emit_signal(SceneStringNames::get_singleton()->area_entered, node); + emit_signal(SNAME("area_entered"), node); for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->area_shape_entered, E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape); + emit_signal(SNAME("area_shape_entered"), E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape); } } @@ -224,9 +223,9 @@ void Area2D::_area_exit_tree(ObjectID p_id) { ERR_FAIL_COND(!E); ERR_FAIL_COND(!E->get().in_tree); E->get().in_tree = false; - emit_signal(SceneStringNames::get_singleton()->area_exited, node); + emit_signal(SNAME("area_exited"), node); for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->area_shape_exited, E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape); + emit_signal(SNAME("area_shape_exited"), E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape); } } @@ -251,10 +250,10 @@ void Area2D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i E->get().rc = 0; E->get().in_tree = node && node->is_inside_tree(); if (node) { - node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area2D::_area_enter_tree), make_binds(objid)); - node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area2D::_area_exit_tree), make_binds(objid)); + node->connect(SNAME("tree_entered"), callable_mp(this, &Area2D::_area_enter_tree), make_binds(objid)); + node->connect(SNAME("tree_exiting"), callable_mp(this, &Area2D::_area_exit_tree), make_binds(objid)); if (E->get().in_tree) { - emit_signal(SceneStringNames::get_singleton()->area_entered, node); + emit_signal(SNAME("area_entered"), node); } } } @@ -264,7 +263,7 @@ void Area2D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i } if (!node || E->get().in_tree) { - emit_signal(SceneStringNames::get_singleton()->area_shape_entered, p_area, node, p_area_shape, p_self_shape); + emit_signal(SNAME("area_shape_entered"), p_area, node, p_area_shape, p_self_shape); } } else { @@ -278,15 +277,15 @@ void Area2D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i if (E->get().rc == 0) { area_map.erase(E); if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area2D::_area_enter_tree)); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area2D::_area_exit_tree)); + node->disconnect(SNAME("tree_entered"), callable_mp(this, &Area2D::_area_enter_tree)); + node->disconnect(SNAME("tree_exiting"), callable_mp(this, &Area2D::_area_exit_tree)); if (in_tree) { - emit_signal(SceneStringNames::get_singleton()->area_exited, obj); + emit_signal(SNAME("area_exited"), obj); } } } if (!node || in_tree) { - emit_signal(SceneStringNames::get_singleton()->area_shape_exited, p_area, obj, p_area_shape, p_self_shape); + emit_signal(SNAME("area_shape_exited"), p_area, obj, p_area_shape, p_self_shape); } } @@ -309,18 +308,18 @@ void Area2D::_clear_monitoring() { continue; } - node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area2D::_body_enter_tree)); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area2D::_body_exit_tree)); + node->disconnect(SNAME("tree_entered"), callable_mp(this, &Area2D::_body_enter_tree)); + node->disconnect(SNAME("tree_exiting"), callable_mp(this, &Area2D::_body_exit_tree)); if (!E->get().in_tree) { continue; } for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape); + emit_signal(SNAME("body_shape_exited"), E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape); } - emit_signal(SceneStringNames::get_singleton()->body_exited, obj); + emit_signal(SNAME("body_exited"), obj); } } @@ -337,18 +336,18 @@ void Area2D::_clear_monitoring() { continue; } - node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area2D::_area_enter_tree)); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area2D::_area_exit_tree)); + node->disconnect(SNAME("tree_entered"), callable_mp(this, &Area2D::_area_enter_tree)); + node->disconnect(SNAME("tree_exiting"), callable_mp(this, &Area2D::_area_exit_tree)); if (!E->get().in_tree) { continue; } for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->area_shape_exited, E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape); + emit_signal(SNAME("area_shape_exited"), E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape); } - emit_signal(SceneStringNames::get_singleton()->area_exited, obj); + emit_signal(SNAME("area_exited"), obj); } } } @@ -370,8 +369,8 @@ void Area2D::set_monitoring(bool p_enable) { monitoring = p_enable; if (monitoring) { - PhysicsServer2D::get_singleton()->area_set_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_body_inout); - PhysicsServer2D::get_singleton()->area_set_area_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_area_inout); + PhysicsServer2D::get_singleton()->area_set_monitor_callback(get_rid(), this, SNAME("_body_inout")); + PhysicsServer2D::get_singleton()->area_set_area_monitor_callback(get_rid(), this, SNAME("_area_inout")); } else { PhysicsServer2D::get_singleton()->area_set_monitor_callback(get_rid(), nullptr, StringName()); diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 0e5591595758..3580bfd2867a 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -32,7 +32,6 @@ #include "core/config/engine.h" #include "core/math/math_funcs.h" -#include "scene/scene_string_names.h" #include "servers/rendering_server.h" void Camera2D::_update_scroll() { diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index 3ba3a4eec5d2..4c4bea13d94b 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -30,8 +30,6 @@ #include "collision_object_2d.h" -#include "scene/scene_string_names.h" - void CollisionObject2D::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { @@ -479,37 +477,37 @@ bool CollisionObject2D::is_pickable() const { void CollisionObject2D::_input_event(Node *p_viewport, const Ref &p_input_event, int p_shape) { if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_input_event, p_viewport, p_input_event, p_shape); + get_script_instance()->call(SNAME("_input_event"), p_viewport, p_input_event, p_shape); } - emit_signal(SceneStringNames::get_singleton()->input_event, p_viewport, p_input_event, p_shape); + emit_signal(SNAME("input_event"), p_viewport, p_input_event, p_shape); } void CollisionObject2D::_mouse_enter() { if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_enter); + get_script_instance()->call(SNAME("_mouse_enter")); } - emit_signal(SceneStringNames::get_singleton()->mouse_entered); + emit_signal(SNAME("mouse_entered")); } void CollisionObject2D::_mouse_exit() { if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_exit); + get_script_instance()->call(SNAME("_mouse_exit")); } - emit_signal(SceneStringNames::get_singleton()->mouse_exited); + emit_signal(SNAME("mouse_exited")); } void CollisionObject2D::_mouse_shape_enter(int p_shape) { if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_shape_enter, p_shape); + get_script_instance()->call(SNAME("_mouse_shape_enter"), p_shape); } - emit_signal(SceneStringNames::get_singleton()->mouse_shape_entered, p_shape); + emit_signal(SNAME("mouse_shape_entered"), p_shape); } void CollisionObject2D::_mouse_shape_exit(int p_shape) { if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_shape_exit, p_shape); + get_script_instance()->call(SNAME("_mouse_shape_exit"), p_shape); } - emit_signal(SceneStringNames::get_singleton()->mouse_shape_exited, p_shape); + emit_signal(SNAME("mouse_shape_exited"), p_shape); } void CollisionObject2D::set_only_update_transform_changes(bool p_enable) { diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index a341ba69ac32..544e29bfcd97 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -30,7 +30,6 @@ #include "cpu_particles_2d.h" -#include "core/core_string_names.h" #include "scene/2d/gpu_particles_2d.h" #include "scene/main/canvas_item.h" #include "scene/resources/particles_material.h" @@ -204,13 +203,13 @@ void CPUParticles2D::set_texture(const Ref &p_texture) { } if (texture.is_valid()) { - texture->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CPUParticles2D::_texture_changed)); + texture->disconnect(SNAME("changed"), callable_mp(this, &CPUParticles2D::_texture_changed)); } texture = p_texture; if (texture.is_valid()) { - texture->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CPUParticles2D::_texture_changed)); + texture->connect(SNAME("changed"), callable_mp(this, &CPUParticles2D::_texture_changed)); } update(); diff --git a/scene/2d/gpu_particles_2d.cpp b/scene/2d/gpu_particles_2d.cpp index adfb94d57421..c4e8018a3190 100644 --- a/scene/2d/gpu_particles_2d.cpp +++ b/scene/2d/gpu_particles_2d.cpp @@ -32,7 +32,6 @@ #include "core/os/os.h" #include "scene/resources/particles_material.h" -#include "scene/scene_string_names.h" #ifdef TOOLS_ENABLED #include "core/config/engine.h" diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp index dbba6917b5bd..18a2f7eb8abf 100644 --- a/scene/2d/joints_2d.cpp +++ b/scene/2d/joints_2d.cpp @@ -32,20 +32,19 @@ #include "core/config/engine.h" #include "physics_body_2d.h" -#include "scene/scene_string_names.h" #include "servers/physics_server_2d.h" void Joint2D::_disconnect_signals() { Node *node_a = get_node_or_null(a); PhysicsBody2D *body_a = Object::cast_to(node_a); if (body_a) { - body_a->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Joint2D::_body_exit_tree)); + body_a->disconnect(SNAME("tree_exiting"), callable_mp(this, &Joint2D::_body_exit_tree)); } Node *node_b = get_node_or_null(b); PhysicsBody2D *body_b = Object::cast_to(node_b); if (body_b) { - body_b->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Joint2D::_body_exit_tree)); + body_b->disconnect(SNAME("tree_exiting"), callable_mp(this, &Joint2D::_body_exit_tree)); } } @@ -116,8 +115,8 @@ void Joint2D::_update_joint(bool p_only_free) { ba = body_a->get_rid(); bb = body_b->get_rid(); - body_a->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Joint2D::_body_exit_tree)); - body_b->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Joint2D::_body_exit_tree)); + body_a->connect(SNAME("tree_exiting"), callable_mp(this, &Joint2D::_body_exit_tree)); + body_b->connect(SNAME("tree_exiting"), callable_mp(this, &Joint2D::_body_exit_tree)); PhysicsServer2D::get_singleton()->joint_disable_collisions_between_bodies(joint, exclude_from_collision); } diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp index 37eb45c21db8..d8b33433a422 100644 --- a/scene/2d/line_2d.cpp +++ b/scene/2d/line_2d.cpp @@ -30,7 +30,6 @@ #include "line_2d.h" -#include "core/core_string_names.h" #include "core/math/geometry_2d.h" #include "line_builder.h" @@ -94,14 +93,14 @@ float Line2D::get_width() const { void Line2D::set_curve(const Ref &p_curve) { // Cleanup previous connection if any if (_curve.is_valid()) { - _curve->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Line2D::_curve_changed)); + _curve->disconnect(SNAME("changed"), callable_mp(this, &Line2D::_curve_changed)); } _curve = p_curve; // Connect to the curve so the line will update when it is changed if (_curve.is_valid()) { - _curve->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Line2D::_curve_changed)); + _curve->connect(SNAME("changed"), callable_mp(this, &Line2D::_curve_changed)); } update(); @@ -164,14 +163,14 @@ Color Line2D::get_default_color() const { void Line2D::set_gradient(const Ref &p_gradient) { // Cleanup previous connection if any if (_gradient.is_valid()) { - _gradient->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Line2D::_gradient_changed)); + _gradient->disconnect(SNAME("changed"), callable_mp(this, &Line2D::_gradient_changed)); } _gradient = p_gradient; // Connect to the gradient so the line will update when the Gradient is changed if (_gradient.is_valid()) { - _gradient->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Line2D::_gradient_changed)); + _gradient->connect(SNAME("changed"), callable_mp(this, &Line2D::_gradient_changed)); } update(); diff --git a/scene/2d/mesh_instance_2d.cpp b/scene/2d/mesh_instance_2d.cpp index 15008390b763..d5badf6111e8 100644 --- a/scene/2d/mesh_instance_2d.cpp +++ b/scene/2d/mesh_instance_2d.cpp @@ -29,7 +29,6 @@ /*************************************************************************/ #include "mesh_instance_2d.h" -#include "scene/scene_string_names.h" void MeshInstance2D::_notification(int p_what) { if (p_what == NOTIFICATION_DRAW) { @@ -71,7 +70,7 @@ void MeshInstance2D::set_texture(const Ref &p_texture) { } texture = p_texture; update(); - emit_signal(SceneStringNames::get_singleton()->texture_changed); + emit_signal(SNAME("texture_changed")); } void MeshInstance2D::set_normal_map(const Ref &p_texture) { diff --git a/scene/2d/multimesh_instance_2d.cpp b/scene/2d/multimesh_instance_2d.cpp index 1bff2f337de9..94a859ad93a8 100644 --- a/scene/2d/multimesh_instance_2d.cpp +++ b/scene/2d/multimesh_instance_2d.cpp @@ -29,7 +29,6 @@ /*************************************************************************/ #include "multimesh_instance_2d.h" -#include "scene/scene_string_names.h" void MultiMeshInstance2D::_notification(int p_what) { if (p_what == NOTIFICATION_DRAW) { @@ -71,7 +70,7 @@ void MultiMeshInstance2D::set_texture(const Ref &p_texture) { } texture = p_texture; update(); - emit_signal(SceneStringNames::get_singleton()->texture_changed); + emit_signal(SNAME("texture_changed")); } Ref MultiMeshInstance2D::get_texture() const { diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp index ea639ae3a3ed..bd5e7843c4ca 100644 --- a/scene/2d/navigation_region_2d.cpp +++ b/scene/2d/navigation_region_2d.cpp @@ -31,7 +31,6 @@ #include "navigation_region_2d.h" #include "core/config/engine.h" -#include "core/core_string_names.h" #include "core/math/geometry_2d.h" #include "core/os/mutex.h" #include "servers/navigation_server_2d.h" @@ -320,7 +319,7 @@ void NavigationPolygon::make_polygons_from_outlines() { polygons.push_back(p); } - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } void NavigationPolygon::_bind_methods() { @@ -480,14 +479,14 @@ void NavigationRegion2D::set_navigation_polygon(const Ref &p_ } if (navpoly.is_valid()) { - navpoly->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NavigationRegion2D::_navpoly_changed)); + navpoly->disconnect(SNAME("changed"), callable_mp(this, &NavigationRegion2D::_navpoly_changed)); } navpoly = p_navpoly; NavigationServer2D::get_singleton()->region_set_navpoly(region, p_navpoly); if (navpoly.is_valid()) { - navpoly->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NavigationRegion2D::_navpoly_changed)); + navpoly->connect(SNAME("changed"), callable_mp(this, &NavigationRegion2D::_navpoly_changed)); } _navpoly_changed(); diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 9912612c4fee..3a3bb7c441e2 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -32,7 +32,6 @@ #include "core/config/engine.h" #include "core/math/geometry_2d.h" -#include "scene/scene_string_names.h" #ifdef TOOLS_ENABLED #include "editor/editor_scale.h" diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 561207c24cc3..da4c26201d19 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -31,12 +31,10 @@ #include "physics_body_2d.h" #include "core/config/engine.h" -#include "core/core_string_names.h" #include "core/math/math_funcs.h" #include "core/object/class_db.h" #include "core/templates/list.h" #include "core/templates/rid.h" -#include "scene/scene_string_names.h" void PhysicsBody2D::_bind_methods() { ClassDB::bind_method(D_METHOD("move_and_collide", "rel_vec", "infinite_inertia", "exclude_raycast_shapes", "test_only", "safe_margin"), &PhysicsBody2D::_move, DEFVAL(true), DEFVAL(true), DEFVAL(false), DEFVAL(0.08)); @@ -198,15 +196,15 @@ real_t StaticBody2D::get_constant_angular_velocity() const { void StaticBody2D::set_physics_material_override(const Ref &p_physics_material_override) { if (physics_material_override.is_valid()) { - if (physics_material_override->is_connected(CoreStringNames::get_singleton()->changed, callable_mp(this, &StaticBody2D::_reload_physics_characteristics))) { - physics_material_override->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &StaticBody2D::_reload_physics_characteristics)); + if (physics_material_override->is_connected(SNAME("changed"), callable_mp(this, &StaticBody2D::_reload_physics_characteristics))) { + physics_material_override->disconnect(SNAME("changed"), callable_mp(this, &StaticBody2D::_reload_physics_characteristics)); } } physics_material_override = p_physics_material_override; if (physics_material_override.is_valid()) { - physics_material_override->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &StaticBody2D::_reload_physics_characteristics)); + physics_material_override->connect(SNAME("changed"), callable_mp(this, &StaticBody2D::_reload_physics_characteristics)); } _reload_physics_characteristics(); } @@ -417,10 +415,10 @@ void RigidBody2D::_body_enter_tree(ObjectID p_id) { contact_monitor->locked = true; E->get().in_scene = true; - emit_signal(SceneStringNames::get_singleton()->body_entered, node); + emit_signal(SNAME("body_entered"), node); for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->body_shape_entered, E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].local_shape); + emit_signal(SNAME("body_shape_entered"), E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].local_shape); } contact_monitor->locked = false; @@ -438,10 +436,10 @@ void RigidBody2D::_body_exit_tree(ObjectID p_id) { contact_monitor->locked = true; - emit_signal(SceneStringNames::get_singleton()->body_exited, node); + emit_signal(SNAME("body_exited"), node); for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].local_shape); + emit_signal(SNAME("body_shape_exited"), E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].local_shape); } contact_monitor->locked = false; @@ -466,10 +464,10 @@ void RigidBody2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instan //E->get().rc=0; E->get().in_scene = node && node->is_inside_tree(); if (node) { - node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &RigidBody2D::_body_enter_tree), make_binds(objid)); - node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &RigidBody2D::_body_exit_tree), make_binds(objid)); + node->connect(SNAME("tree_entered"), callable_mp(this, &RigidBody2D::_body_enter_tree), make_binds(objid)); + node->connect(SNAME("tree_exiting"), callable_mp(this, &RigidBody2D::_body_exit_tree), make_binds(objid)); if (E->get().in_scene) { - emit_signal(SceneStringNames::get_singleton()->body_entered, node); + emit_signal(SNAME("body_entered"), node); } } @@ -481,7 +479,7 @@ void RigidBody2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instan } if (E->get().in_scene) { - emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_body, node, p_body_shape, p_local_shape); + emit_signal(SNAME("body_shape_entered"), p_body, node, p_body_shape, p_local_shape); } } else { @@ -495,17 +493,17 @@ void RigidBody2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instan if (E->get().shapes.is_empty()) { if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &RigidBody2D::_body_enter_tree)); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &RigidBody2D::_body_exit_tree)); + node->disconnect(SNAME("tree_entered"), callable_mp(this, &RigidBody2D::_body_enter_tree)); + node->disconnect(SNAME("tree_exiting"), callable_mp(this, &RigidBody2D::_body_exit_tree)); if (in_scene) { - emit_signal(SceneStringNames::get_singleton()->body_exited, node); + emit_signal(SNAME("body_exited"), node); } } contact_monitor->body_map.erase(E); } if (node && in_scene) { - emit_signal(SceneStringNames::get_singleton()->body_shape_exited, p_body, node, p_body_shape, p_local_shape); + emit_signal(SNAME("body_shape_exited"), p_body, node, p_body_shape, p_local_shape); } } } @@ -533,7 +531,7 @@ void RigidBody2D::_direct_state_changed(Object *p_state) { angular_velocity = state->get_angular_velocity(); if (sleeping != state->is_sleeping()) { sleeping = state->is_sleeping(); - emit_signal(SceneStringNames::get_singleton()->sleeping_state_changed); + emit_signal(SNAME("sleeping_state_changed")); } if (get_script_instance()) { get_script_instance()->call("_integrate_forces", state); @@ -668,15 +666,15 @@ real_t RigidBody2D::get_inertia() const { void RigidBody2D::set_physics_material_override(const Ref &p_physics_material_override) { if (physics_material_override.is_valid()) { - if (physics_material_override->is_connected(CoreStringNames::get_singleton()->changed, callable_mp(this, &RigidBody2D::_reload_physics_characteristics))) { - physics_material_override->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &RigidBody2D::_reload_physics_characteristics)); + if (physics_material_override->is_connected(SNAME("changed"), callable_mp(this, &RigidBody2D::_reload_physics_characteristics))) { + physics_material_override->disconnect(SNAME("changed"), callable_mp(this, &RigidBody2D::_reload_physics_characteristics)); } } physics_material_override = p_physics_material_override; if (physics_material_override.is_valid()) { - physics_material_override->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &RigidBody2D::_reload_physics_characteristics)); + physics_material_override->connect(SNAME("changed"), callable_mp(this, &RigidBody2D::_reload_physics_characteristics)); } _reload_physics_characteristics(); } @@ -874,8 +872,8 @@ void RigidBody2D::set_contact_monitor(bool p_enabled) { Node *node = Object::cast_to(obj); if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &RigidBody2D::_body_enter_tree)); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &RigidBody2D::_body_exit_tree)); + node->disconnect(SNAME("tree_entered"), callable_mp(this, &RigidBody2D::_body_enter_tree)); + node->disconnect(SNAME("tree_exiting"), callable_mp(this, &RigidBody2D::_body_exit_tree)); } } diff --git a/scene/2d/remote_transform_2d.cpp b/scene/2d/remote_transform_2d.cpp index e7cef965fe5c..fe3e86742421 100644 --- a/scene/2d/remote_transform_2d.cpp +++ b/scene/2d/remote_transform_2d.cpp @@ -29,7 +29,6 @@ /*************************************************************************/ #include "remote_transform_2d.h" -#include "scene/scene_string_names.h" void RemoteTransform2D::_update_cache() { cache = ObjectID(); diff --git a/scene/2d/sprite_2d.cpp b/scene/2d/sprite_2d.cpp index 40e0f4523f09..41a5cf412b8f 100644 --- a/scene/2d/sprite_2d.cpp +++ b/scene/2d/sprite_2d.cpp @@ -30,10 +30,8 @@ #include "sprite_2d.h" -#include "core/core_string_names.h" #include "core/os/os.h" #include "scene/main/window.h" -#include "scene/scene_string_names.h" #ifdef TOOLS_ENABLED Dictionary Sprite2D::_edit_get_state() const { @@ -143,17 +141,17 @@ void Sprite2D::set_texture(const Ref &p_texture) { } if (texture.is_valid()) { - texture->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Sprite2D::_texture_changed)); + texture->disconnect(SNAME("changed"), callable_mp(this, &Sprite2D::_texture_changed)); } texture = p_texture; if (texture.is_valid()) { - texture->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Sprite2D::_texture_changed)); + texture->connect(SNAME("changed"), callable_mp(this, &Sprite2D::_texture_changed)); } update(); - emit_signal(SceneStringNames::get_singleton()->texture_changed); + emit_signal(SNAME("texture_changed")); item_rect_changed(); } @@ -247,7 +245,7 @@ void Sprite2D::set_frame(int p_frame) { frame = p_frame; - emit_signal(SceneStringNames::get_singleton()->frame_changed); + emit_signal(SNAME("frame_changed")); } int Sprite2D::get_frame() const { diff --git a/scene/2d/visible_on_screen_notifier_2d.cpp b/scene/2d/visible_on_screen_notifier_2d.cpp index 25237edacf34..e7327d4009ec 100644 --- a/scene/2d/visible_on_screen_notifier_2d.cpp +++ b/scene/2d/visible_on_screen_notifier_2d.cpp @@ -36,7 +36,6 @@ #include "scene/2d/physics_body_2d.h" #include "scene/animation/animation_player.h" #include "scene/main/window.h" -#include "scene/scene_string_names.h" #ifdef TOOLS_ENABLED Rect2 VisibleOnScreenNotifier2D::_edit_get_rect() const { @@ -54,7 +53,7 @@ void VisibleOnScreenNotifier2D::_visibility_enter() { } on_screen = true; - emit_signal(SceneStringNames::get_singleton()->screen_entered); + emit_signal(SNAME("screen_entered")); _screen_enter(); } void VisibleOnScreenNotifier2D::_visibility_exit() { @@ -63,7 +62,7 @@ void VisibleOnScreenNotifier2D::_visibility_exit() { } on_screen = false; - emit_signal(SceneStringNames::get_singleton()->screen_exited); + emit_signal(SNAME("screen_exited")); _screen_exit(); } diff --git a/scene/3d/area_3d.cpp b/scene/3d/area_3d.cpp index cd64a813dd92..40289ef32738 100644 --- a/scene/3d/area_3d.cpp +++ b/scene/3d/area_3d.cpp @@ -30,7 +30,6 @@ #include "area_3d.h" -#include "scene/scene_string_names.h" #include "servers/audio_server.h" #include "servers/physics_server_3d.h" @@ -116,9 +115,9 @@ void Area3D::_body_enter_tree(ObjectID p_id) { ERR_FAIL_COND(E->get().in_tree); E->get().in_tree = true; - emit_signal(SceneStringNames::get_singleton()->body_entered, node); + emit_signal(SNAME("body_entered"), node); for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->body_shape_entered, E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape); + emit_signal(SNAME("body_shape_entered"), E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape); } } @@ -130,9 +129,9 @@ void Area3D::_body_exit_tree(ObjectID p_id) { ERR_FAIL_COND(!E); ERR_FAIL_COND(!E->get().in_tree); E->get().in_tree = false; - emit_signal(SceneStringNames::get_singleton()->body_exited, node); + emit_signal(SNAME("body_exited"), node); for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape); + emit_signal(SNAME("body_shape_exited"), E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape); } } @@ -158,10 +157,10 @@ void Area3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i E->get().rc = 0; E->get().in_tree = node && node->is_inside_tree(); if (node) { - node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area3D::_body_enter_tree), make_binds(objid)); - node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area3D::_body_exit_tree), make_binds(objid)); + node->connect(SNAME("tree_entered"), callable_mp(this, &Area3D::_body_enter_tree), make_binds(objid)); + node->connect(SNAME("tree_exiting"), callable_mp(this, &Area3D::_body_exit_tree), make_binds(objid)); if (E->get().in_tree) { - emit_signal(SceneStringNames::get_singleton()->body_entered, node); + emit_signal(SNAME("body_entered"), node); } } } @@ -171,7 +170,7 @@ void Area3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i } if (E->get().in_tree) { - emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_body, node, p_body_shape, p_area_shape); + emit_signal(SNAME("body_shape_entered"), p_body, node, p_body_shape, p_area_shape); } } else { @@ -185,15 +184,15 @@ void Area3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i if (E->get().rc == 0) { body_map.erase(E); if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area3D::_body_enter_tree)); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area3D::_body_exit_tree)); + node->disconnect(SNAME("tree_entered"), callable_mp(this, &Area3D::_body_enter_tree)); + node->disconnect(SNAME("tree_exiting"), callable_mp(this, &Area3D::_body_exit_tree)); if (in_tree) { - emit_signal(SceneStringNames::get_singleton()->body_exited, obj); + emit_signal(SNAME("body_exited"), obj); } } } if (node && in_tree) { - emit_signal(SceneStringNames::get_singleton()->body_shape_exited, p_body, obj, p_body_shape, p_area_shape); + emit_signal(SNAME("body_shape_exited"), p_body, obj, p_body_shape, p_area_shape); } } @@ -217,18 +216,18 @@ void Area3D::_clear_monitoring() { } //ERR_CONTINUE(!node); - node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area3D::_body_enter_tree)); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area3D::_body_exit_tree)); + node->disconnect(SNAME("tree_entered"), callable_mp(this, &Area3D::_body_enter_tree)); + node->disconnect(SNAME("tree_exiting"), callable_mp(this, &Area3D::_body_exit_tree)); if (!E->get().in_tree) { continue; } for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape); + emit_signal(SNAME("body_shape_exited"), E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].area_shape); } - emit_signal(SceneStringNames::get_singleton()->body_exited, node); + emit_signal(SNAME("body_exited"), node); } } @@ -246,18 +245,18 @@ void Area3D::_clear_monitoring() { } //ERR_CONTINUE(!node); - node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area3D::_area_enter_tree)); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area3D::_area_exit_tree)); + node->disconnect(SNAME("tree_entered"), callable_mp(this, &Area3D::_area_enter_tree)); + node->disconnect(SNAME("tree_exiting"), callable_mp(this, &Area3D::_area_exit_tree)); if (!E->get().in_tree) { continue; } for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->area_shape_exited, E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape); + emit_signal(SNAME("area_shape_exited"), E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape); } - emit_signal(SceneStringNames::get_singleton()->area_exited, obj); + emit_signal(SNAME("area_exited"), obj); } } } @@ -278,8 +277,8 @@ void Area3D::set_monitoring(bool p_enable) { monitoring = p_enable; if (monitoring) { - PhysicsServer3D::get_singleton()->area_set_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_body_inout); - PhysicsServer3D::get_singleton()->area_set_area_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_area_inout); + PhysicsServer3D::get_singleton()->area_set_monitor_callback(get_rid(), this, SNAME("_body_inout")); + PhysicsServer3D::get_singleton()->area_set_area_monitor_callback(get_rid(), this, SNAME("_area_inout")); } else { PhysicsServer3D::get_singleton()->area_set_monitor_callback(get_rid(), nullptr, StringName()); PhysicsServer3D::get_singleton()->area_set_area_monitor_callback(get_rid(), nullptr, StringName()); @@ -297,9 +296,9 @@ void Area3D::_area_enter_tree(ObjectID p_id) { ERR_FAIL_COND(E->get().in_tree); E->get().in_tree = true; - emit_signal(SceneStringNames::get_singleton()->area_entered, node); + emit_signal(SNAME("area_entered"), node); for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->area_shape_entered, E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape); + emit_signal(SNAME("area_shape_entered"), E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape); } } @@ -311,9 +310,9 @@ void Area3D::_area_exit_tree(ObjectID p_id) { ERR_FAIL_COND(!E); ERR_FAIL_COND(!E->get().in_tree); E->get().in_tree = false; - emit_signal(SceneStringNames::get_singleton()->area_exited, node); + emit_signal(SNAME("area_exited"), node); for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->area_shape_exited, E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape); + emit_signal(SNAME("area_shape_exited"), E->get().rid, node, E->get().shapes[i].area_shape, E->get().shapes[i].self_shape); } } @@ -339,10 +338,10 @@ void Area3D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i E->get().rc = 0; E->get().in_tree = node && node->is_inside_tree(); if (node) { - node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area3D::_area_enter_tree), make_binds(objid)); - node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area3D::_area_exit_tree), make_binds(objid)); + node->connect(SNAME("tree_entered"), callable_mp(this, &Area3D::_area_enter_tree), make_binds(objid)); + node->connect(SNAME("tree_exiting"), callable_mp(this, &Area3D::_area_exit_tree), make_binds(objid)); if (E->get().in_tree) { - emit_signal(SceneStringNames::get_singleton()->area_entered, node); + emit_signal(SNAME("area_entered"), node); } } } @@ -352,7 +351,7 @@ void Area3D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i } if (!node || E->get().in_tree) { - emit_signal(SceneStringNames::get_singleton()->area_shape_entered, p_area, node, p_area_shape, p_self_shape); + emit_signal(SNAME("area_shape_entered"), p_area, node, p_area_shape, p_self_shape); } } else { @@ -366,15 +365,15 @@ void Area3D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i if (E->get().rc == 0) { area_map.erase(E); if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area3D::_area_enter_tree)); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area3D::_area_exit_tree)); + node->disconnect(SNAME("tree_entered"), callable_mp(this, &Area3D::_area_enter_tree)); + node->disconnect(SNAME("tree_exiting"), callable_mp(this, &Area3D::_area_exit_tree)); if (in_tree) { - emit_signal(SceneStringNames::get_singleton()->area_exited, obj); + emit_signal(SNAME("area_exited"), obj); } } } if (!node || in_tree) { - emit_signal(SceneStringNames::get_singleton()->area_shape_exited, p_area, obj, p_area_shape, p_self_shape); + emit_signal(SNAME("area_shape_exited"), p_area, obj, p_area_shape, p_self_shape); } } diff --git a/scene/3d/collision_object_3d.cpp b/scene/3d/collision_object_3d.cpp index dd1f25da6881..7e1048d5983b 100644 --- a/scene/3d/collision_object_3d.cpp +++ b/scene/3d/collision_object_3d.cpp @@ -31,7 +31,6 @@ #include "collision_object_3d.h" #include "core/config/engine.h" -#include "scene/scene_string_names.h" void CollisionObject3D::_notification(int p_what) { switch (p_what) { @@ -253,23 +252,23 @@ void CollisionObject3D::_apply_enabled() { void CollisionObject3D::_input_event(Node *p_camera, const Ref &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape) { if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_input_event, p_camera, p_input_event, p_pos, p_normal, p_shape); + get_script_instance()->call(SNAME("_input_event"), p_camera, p_input_event, p_pos, p_normal, p_shape); } - emit_signal(SceneStringNames::get_singleton()->input_event, p_camera, p_input_event, p_pos, p_normal, p_shape); + emit_signal(SNAME("input_event"), p_camera, p_input_event, p_pos, p_normal, p_shape); } void CollisionObject3D::_mouse_enter() { if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_enter); + get_script_instance()->call(SNAME("_mouse_enter")); } - emit_signal(SceneStringNames::get_singleton()->mouse_entered); + emit_signal(SNAME("mouse_entered")); } void CollisionObject3D::_mouse_exit() { if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_exit); + get_script_instance()->call(SNAME("_mouse_exit")); } - emit_signal(SceneStringNames::get_singleton()->mouse_exited); + emit_signal(SNAME("mouse_exited")); } void CollisionObject3D::set_body_mode(PhysicsServer3D::BodyMode p_mode) { diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp index 9ca1d55d0b31..350f07c6dc52 100644 --- a/scene/3d/mesh_instance_3d.cpp +++ b/scene/3d/mesh_instance_3d.cpp @@ -31,7 +31,6 @@ #include "mesh_instance_3d.h" #include "collision_shape_3d.h" -#include "core/core_string_names.h" #include "physics_body_3d.h" #include "scene/resources/material.h" #include "skeleton_3d.h" @@ -111,7 +110,7 @@ void MeshInstance3D::set_mesh(const Ref &p_mesh) { } if (mesh.is_valid()) { - mesh->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &MeshInstance3D::_mesh_changed)); + mesh->disconnect(SNAME("changed"), callable_mp(this, &MeshInstance3D::_mesh_changed)); } mesh = p_mesh; @@ -125,7 +124,7 @@ void MeshInstance3D::set_mesh(const Ref &p_mesh) { blend_shape_tracks["blend_shapes/" + String(mesh->get_blend_shape_name(i))] = mt; } - mesh->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &MeshInstance3D::_mesh_changed)); + mesh->connect(SNAME("changed"), callable_mp(this, &MeshInstance3D::_mesh_changed)); surface_override_materials.resize(mesh->get_surface_count()); set_base(mesh->get_rid()); diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp index 0daee69ee5b6..b7a4bceb1fa3 100644 --- a/scene/3d/node_3d.cpp +++ b/scene/3d/node_3d.cpp @@ -35,7 +35,6 @@ #include "scene/3d/visual_instance_3d.h" #include "scene/main/scene_tree.h" #include "scene/main/window.h" -#include "scene/scene_string_names.h" /* @@ -177,11 +176,11 @@ void Node3D::_notification(int p_what) { ERR_FAIL_COND(!data.viewport); if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_enter_world); + get_script_instance()->call(SNAME("_enter_world")); } #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint() && get_tree()->is_node_being_edited(this)) { - get_tree()->call_group_flags(0, SceneStringNames::get_singleton()->_spatial_editor_group, SceneStringNames::get_singleton()->_request_gizmo, this); + get_tree()->call_group_flags(0, SNAME("_spatial_editor_group"), SNAME("_request_gizmo"), this); if (!data.gizmos_disabled) { for (int i = 0; i < data.gizmos.size(); i++) { data.gizmos.write[i]->create(); @@ -201,7 +200,7 @@ void Node3D::_notification(int p_what) { #endif if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_exit_world); + get_script_instance()->call(SNAME("_exit_world")); } data.viewport = nullptr; @@ -389,7 +388,7 @@ void Node3D::clear_subgizmo_selection() { } if (Engine::get_singleton()->is_editor_hint() && get_tree()->is_node_being_edited(this)) { - get_tree()->call_group_flags(0, SceneStringNames::get_singleton()->_spatial_editor_group, SceneStringNames::get_singleton()->_clear_subgizmo_selection, this); + get_tree()->call_group_flags(0, SNAME("_spatial_editor_group"), SNAME("_clear_subgizmo_selection"), this); } #endif } @@ -519,7 +518,7 @@ Ref Node3D::get_world_3d() const { void Node3D::_propagate_visibility_changed() { notification(NOTIFICATION_VISIBILITY_CHANGED); - emit_signal(SceneStringNames::get_singleton()->visibility_changed); + emit_signal(SNAME("visibility_changed")); #ifdef TOOLS_ENABLED if (!data.gizmos.is_empty()) { data.gizmos_dirty = true; diff --git a/scene/3d/occluder_instance_3d.cpp b/scene/3d/occluder_instance_3d.cpp index 3d1a27911bce..4efc8133825d 100644 --- a/scene/3d/occluder_instance_3d.cpp +++ b/scene/3d/occluder_instance_3d.cpp @@ -29,7 +29,6 @@ /*************************************************************************/ #include "occluder_instance_3d.h" -#include "core/core_string_names.h" #include "scene/3d/mesh_instance_3d.h" RID Occluder3D::get_rid() const { @@ -161,14 +160,14 @@ void OccluderInstance3D::set_occluder(const Ref &p_occluder) { } if (occluder.is_valid()) { - occluder->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &OccluderInstance3D::_occluder_changed)); + occluder->disconnect(SNAME("changed"), callable_mp(this, &OccluderInstance3D::_occluder_changed)); } occluder = p_occluder; if (occluder.is_valid()) { set_base(occluder->get_rid()); - occluder->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &OccluderInstance3D::_occluder_changed)); + occluder->connect(SNAME("changed"), callable_mp(this, &OccluderInstance3D::_occluder_changed)); } else { set_base(RID()); } diff --git a/scene/3d/path_3d.cpp b/scene/3d/path_3d.cpp index 6af2e7f8792e..8d09fe416fea 100644 --- a/scene/3d/path_3d.cpp +++ b/scene/3d/path_3d.cpp @@ -31,7 +31,6 @@ #include "path_3d.h" #include "core/config/engine.h" -#include "scene/scene_string_names.h" void Path3D::_notification(int p_what) { } diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index 93ecb2cd3a8c..5c1c8c512a52 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -31,12 +31,10 @@ #include "physics_body_3d.h" #include "core/config/engine.h" -#include "core/core_string_names.h" #include "core/object/class_db.h" #include "core/templates/list.h" #include "core/templates/rid.h" #include "scene/3d/collision_shape_3d.h" -#include "scene/scene_string_names.h" #include "servers/navigation_server_3d.h" #ifdef TOOLS_ENABLED @@ -212,15 +210,15 @@ real_t PhysicsBody3D::get_inverse_mass() const { void StaticBody3D::set_physics_material_override(const Ref &p_physics_material_override) { if (physics_material_override.is_valid()) { - if (physics_material_override->is_connected(CoreStringNames::get_singleton()->changed, callable_mp(this, &StaticBody3D::_reload_physics_characteristics))) { - physics_material_override->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &StaticBody3D::_reload_physics_characteristics)); + if (physics_material_override->is_connected(SNAME("changed"), callable_mp(this, &StaticBody3D::_reload_physics_characteristics))) { + physics_material_override->disconnect(SNAME("changed"), callable_mp(this, &StaticBody3D::_reload_physics_characteristics)); } } physics_material_override = p_physics_material_override; if (physics_material_override.is_valid()) { - physics_material_override->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &StaticBody3D::_reload_physics_characteristics)); + physics_material_override->connect(SNAME("changed"), callable_mp(this, &StaticBody3D::_reload_physics_characteristics)); } _reload_physics_characteristics(); } @@ -490,10 +488,10 @@ void RigidBody3D::_body_enter_tree(ObjectID p_id) { contact_monitor->locked = true; - emit_signal(SceneStringNames::get_singleton()->body_entered, node); + emit_signal(SNAME("body_entered"), node); for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->body_shape_entered, E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].local_shape); + emit_signal(SNAME("body_shape_entered"), E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].local_shape); } contact_monitor->locked = false; @@ -511,10 +509,10 @@ void RigidBody3D::_body_exit_tree(ObjectID p_id) { contact_monitor->locked = true; - emit_signal(SceneStringNames::get_singleton()->body_exited, node); + emit_signal(SNAME("body_exited"), node); for (int i = 0; i < E->get().shapes.size(); i++) { - emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].local_shape); + emit_signal(SNAME("body_shape_exited"), E->get().rid, node, E->get().shapes[i].body_shape, E->get().shapes[i].local_shape); } contact_monitor->locked = false; @@ -539,10 +537,10 @@ void RigidBody3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instan //E->get().rc=0; E->get().in_tree = node && node->is_inside_tree(); if (node) { - node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &RigidBody3D::_body_enter_tree), make_binds(objid)); - node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &RigidBody3D::_body_exit_tree), make_binds(objid)); + node->connect(SNAME("tree_entered"), callable_mp(this, &RigidBody3D::_body_enter_tree), make_binds(objid)); + node->connect(SNAME("tree_exiting"), callable_mp(this, &RigidBody3D::_body_exit_tree), make_binds(objid)); if (E->get().in_tree) { - emit_signal(SceneStringNames::get_singleton()->body_entered, node); + emit_signal(SNAME("body_entered"), node); } } } @@ -552,7 +550,7 @@ void RigidBody3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instan } if (E->get().in_tree) { - emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_body, node, p_body_shape, p_local_shape); + emit_signal(SNAME("body_shape_entered"), p_body, node, p_body_shape, p_local_shape); } } else { @@ -566,17 +564,17 @@ void RigidBody3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instan if (E->get().shapes.is_empty()) { if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &RigidBody3D::_body_enter_tree)); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &RigidBody3D::_body_exit_tree)); + node->disconnect(SNAME("tree_entered"), callable_mp(this, &RigidBody3D::_body_enter_tree)); + node->disconnect(SNAME("tree_exiting"), callable_mp(this, &RigidBody3D::_body_exit_tree)); if (in_tree) { - emit_signal(SceneStringNames::get_singleton()->body_exited, node); + emit_signal(SNAME("body_exited"), node); } } contact_monitor->body_map.erase(E); } if (node && in_tree) { - emit_signal(SceneStringNames::get_singleton()->body_shape_exited, p_body, obj, p_body_shape, p_local_shape); + emit_signal(SNAME("body_shape_exited"), p_body, obj, p_body_shape, p_local_shape); } } } @@ -603,7 +601,7 @@ void RigidBody3D::_direct_state_changed(Object *p_state) { inverse_inertia_tensor = state->get_inverse_inertia_tensor(); if (sleeping != state->is_sleeping()) { sleeping = state->is_sleeping(); - emit_signal(SceneStringNames::get_singleton()->sleeping_state_changed); + emit_signal(SNAME("sleeping_state_changed")); } if (get_script_instance()) { get_script_instance()->call("_integrate_forces", state); @@ -746,15 +744,15 @@ real_t RigidBody3D::get_mass() const { void RigidBody3D::set_physics_material_override(const Ref &p_physics_material_override) { if (physics_material_override.is_valid()) { - if (physics_material_override->is_connected(CoreStringNames::get_singleton()->changed, callable_mp(this, &RigidBody3D::_reload_physics_characteristics))) { - physics_material_override->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &RigidBody3D::_reload_physics_characteristics)); + if (physics_material_override->is_connected(SNAME("changed"), callable_mp(this, &RigidBody3D::_reload_physics_characteristics))) { + physics_material_override->disconnect(SNAME("changed"), callable_mp(this, &RigidBody3D::_reload_physics_characteristics)); } } physics_material_override = p_physics_material_override; if (physics_material_override.is_valid()) { - physics_material_override->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &RigidBody3D::_reload_physics_characteristics)); + physics_material_override->connect(SNAME("changed"), callable_mp(this, &RigidBody3D::_reload_physics_characteristics)); } _reload_physics_characteristics(); } @@ -924,8 +922,8 @@ void RigidBody3D::set_contact_monitor(bool p_enabled) { Node *node = Object::cast_to(obj); if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &RigidBody3D::_body_enter_tree)); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &RigidBody3D::_body_exit_tree)); + node->disconnect(SNAME("tree_entered"), callable_mp(this, &RigidBody3D::_body_enter_tree)); + node->disconnect(SNAME("tree_exiting"), callable_mp(this, &RigidBody3D::_body_exit_tree)); } } diff --git a/scene/3d/physics_joint_3d.cpp b/scene/3d/physics_joint_3d.cpp index 59440bd1a8c3..6da05a2f5a2c 100644 --- a/scene/3d/physics_joint_3d.cpp +++ b/scene/3d/physics_joint_3d.cpp @@ -30,19 +30,17 @@ #include "physics_joint_3d.h" -#include "scene/scene_string_names.h" - void Joint3D::_disconnect_signals() { Node *node_a = get_node_or_null(a); PhysicsBody3D *body_a = Object::cast_to(node_a); if (body_a) { - body_a->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Joint3D::_body_exit_tree)); + body_a->disconnect(SNAME("tree_exiting"), callable_mp(this, &Joint3D::_body_exit_tree)); } Node *node_b = get_node_or_null(b); PhysicsBody3D *body_b = Object::cast_to(node_b); if (body_b) { - body_b->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Joint3D::_body_exit_tree)); + body_b->disconnect(SNAME("tree_exiting"), callable_mp(this, &Joint3D::_body_exit_tree)); } } @@ -108,12 +106,12 @@ void Joint3D::_update_joint(bool p_only_free) { if (body_a) { ba = body_a->get_rid(); - body_a->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Joint3D::_body_exit_tree)); + body_a->connect(SNAME("tree_exiting"), callable_mp(this, &Joint3D::_body_exit_tree)); } if (body_b) { bb = body_b->get_rid(); - body_b->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Joint3D::_body_exit_tree)); + body_b->connect(SNAME("tree_exiting"), callable_mp(this, &Joint3D::_body_exit_tree)); } PhysicsServer3D::get_singleton()->joint_disable_collisions_between_bodies(joint, exclude_from_collision); diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp index 9ce4c3745723..b3b6d1dafe00 100644 --- a/scene/3d/skeleton_3d.cpp +++ b/scene/3d/skeleton_3d.cpp @@ -36,7 +36,6 @@ #include "core/variant/type_info.h" #include "scene/3d/physics_body_3d.h" #include "scene/resources/surface_tool.h" -#include "scene/scene_string_names.h" void SkinReference::_skin_changed() { if (skeleton_node) { @@ -332,7 +331,7 @@ void Skeleton3D::_notification(int p_what) { dirty = false; #ifdef TOOLS_ENABLED - emit_signal(SceneStringNames::get_singleton()->pose_updated); + emit_signal(SNAME("pose_updated")); #endif // TOOLS_ENABLED } break; diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index a901920dbe78..751efca1f000 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -30,9 +30,6 @@ #include "sprite_3d.h" -#include "core/core_string_names.h" -#include "scene/scene_string_names.h" - Color SpriteBase3D::_get_color_accum() { if (!color_dirty) { return color_accum; @@ -177,7 +174,7 @@ void SpriteBase3D::_queue_update() { update_gizmos(); pending_update = true; - call_deferred(SceneStringNames::get_singleton()->_im_update); + call_deferred(SNAME("_im_update")); } AABB SpriteBase3D::get_aabb() const { @@ -618,11 +615,11 @@ void Sprite3D::set_texture(const Ref &p_texture) { return; } if (texture.is_valid()) { - texture->disconnect(CoreStringNames::get_singleton()->changed, Callable(this, "_queue_update")); + texture->disconnect(SNAME("changed"), Callable(this, "_queue_update")); } texture = p_texture; if (texture.is_valid()) { - texture->connect(CoreStringNames::get_singleton()->changed, Callable(this, "_queue_update")); + texture->connect(SNAME("changed"), Callable(this, "_queue_update")); } _queue_update(); } @@ -663,7 +660,7 @@ void Sprite3D::set_frame(int p_frame) { _queue_update(); - emit_signal(SceneStringNames::get_singleton()->frame_changed); + emit_signal(SNAME("frame_changed")); } int Sprite3D::get_frame() const { @@ -1050,13 +1047,13 @@ void AnimatedSprite3D::_notification(int p_what) { } else { frame = fc - 1; } - emit_signal(SceneStringNames::get_singleton()->animation_finished); + emit_signal(SNAME("animation_finished")); } else { frame++; } _queue_update(); - emit_signal(SceneStringNames::get_singleton()->frame_changed); + emit_signal(SNAME("frame_changed")); } float to_process = MIN(timeout, remaining); @@ -1114,7 +1111,7 @@ void AnimatedSprite3D::set_frame(int p_frame) { frame = p_frame; _reset_timeout(); _queue_update(); - emit_signal(SceneStringNames::get_singleton()->frame_changed); + emit_signal(SNAME("frame_changed")); } int AnimatedSprite3D::get_frame() const { diff --git a/scene/3d/visible_on_screen_notifier_3d.cpp b/scene/3d/visible_on_screen_notifier_3d.cpp index 6a80aa3f45ad..0db8272b2729 100644 --- a/scene/3d/visible_on_screen_notifier_3d.cpp +++ b/scene/3d/visible_on_screen_notifier_3d.cpp @@ -34,7 +34,6 @@ #include "scene/3d/camera_3d.h" #include "scene/3d/physics_body_3d.h" #include "scene/animation/animation_player.h" -#include "scene/scene_string_names.h" void VisibleOnScreenNotifier3D::_visibility_enter() { if (!is_inside_tree() || Engine::get_singleton()->is_editor_hint()) { @@ -42,7 +41,7 @@ void VisibleOnScreenNotifier3D::_visibility_enter() { } on_screen = true; - emit_signal(SceneStringNames::get_singleton()->screen_entered); + emit_signal(SNAME("screen_entered")); _screen_enter(); } void VisibleOnScreenNotifier3D::_visibility_exit() { @@ -51,7 +50,7 @@ void VisibleOnScreenNotifier3D::_visibility_exit() { } on_screen = false; - emit_signal(SceneStringNames::get_singleton()->screen_exited); + emit_signal(SNAME("screen_exited")); _screen_exit(); } diff --git a/scene/3d/visual_instance_3d.cpp b/scene/3d/visual_instance_3d.cpp index 70a7021f2281..d20a2c55fbbb 100644 --- a/scene/3d/visual_instance_3d.cpp +++ b/scene/3d/visual_instance_3d.cpp @@ -30,7 +30,6 @@ #include "visual_instance_3d.h" -#include "scene/scene_string_names.h" #include "servers/rendering_server.h" #include "skeleton_3d.h" @@ -212,12 +211,12 @@ bool GeometryInstance3D::_set(const StringName &p_name, const Variant &p_value) return true; } #ifndef DISABLE_DEPRECATED - if (p_name == SceneStringNames::get_singleton()->use_in_baked_light && bool(p_value)) { + if (p_name == SNAME("use_in_baked_light") && bool(p_value)) { set_gi_mode(GI_MODE_BAKED); return true; } - if (p_name == SceneStringNames::get_singleton()->use_dynamic_gi && bool(p_value)) { + if (p_name == SNAME("use_dynamic_gi") && bool(p_value)) { set_gi_mode(GI_MODE_DYNAMIC); return true; } diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp index 4bddae3b149f..a2bf6f86c943 100644 --- a/scene/animation/animation_blend_tree.cpp +++ b/scene/animation/animation_blend_tree.cpp @@ -30,8 +30,6 @@ #include "animation_blend_tree.h" -#include "scene/scene_string_names.h" - void AnimationNodeAnimation::set_animation(const StringName &p_name) { animation = p_name; } @@ -806,7 +804,7 @@ AnimationNodeOutput::AnimationNodeOutput() { void AnimationNodeBlendTree::add_node(const StringName &p_name, Ref p_node, const Vector2 &p_position) { ERR_FAIL_COND(nodes.has(p_name)); ERR_FAIL_COND(p_node.is_null()); - ERR_FAIL_COND(p_name == SceneStringNames::get_singleton()->output); + ERR_FAIL_COND(p_name == SNAME("output")); ERR_FAIL_COND(String(p_name).find("/") != -1); Node n; @@ -876,7 +874,7 @@ Vector AnimationNodeBlendTree::get_node_connection_array(const Strin void AnimationNodeBlendTree::remove_node(const StringName &p_name) { ERR_FAIL_COND(!nodes.has(p_name)); - ERR_FAIL_COND(p_name == SceneStringNames::get_singleton()->output); //can't delete output + ERR_FAIL_COND(p_name == SNAME("output")); //can't delete output { Ref node = nodes[p_name].node; @@ -902,8 +900,8 @@ void AnimationNodeBlendTree::remove_node(const StringName &p_name) { void AnimationNodeBlendTree::rename_node(const StringName &p_name, const StringName &p_new_name) { ERR_FAIL_COND(!nodes.has(p_name)); ERR_FAIL_COND(nodes.has(p_new_name)); - ERR_FAIL_COND(p_name == SceneStringNames::get_singleton()->output); - ERR_FAIL_COND(p_new_name == SceneStringNames::get_singleton()->output); + ERR_FAIL_COND(p_name == SNAME("output")); + ERR_FAIL_COND(p_new_name == SNAME("output")); nodes[p_name].node->disconnect("changed", callable_mp(this, &AnimationNodeBlendTree::_node_changed)); @@ -927,7 +925,7 @@ void AnimationNodeBlendTree::rename_node(const StringName &p_name, const StringN void AnimationNodeBlendTree::connect_node(const StringName &p_input_node, int p_input_index, const StringName &p_output_node) { ERR_FAIL_COND(!nodes.has(p_output_node)); ERR_FAIL_COND(!nodes.has(p_input_node)); - ERR_FAIL_COND(p_output_node == SceneStringNames::get_singleton()->output); + ERR_FAIL_COND(p_output_node == SNAME("output")); ERR_FAIL_COND(p_input_node == p_output_node); Ref input = nodes[p_input_node].node; @@ -955,7 +953,7 @@ void AnimationNodeBlendTree::disconnect_node(const StringName &p_node, int p_inp } AnimationNodeBlendTree::ConnectionError AnimationNodeBlendTree::can_connect_node(const StringName &p_input_node, int p_input_index, const StringName &p_output_node) const { - if (!nodes.has(p_output_node) || p_output_node == SceneStringNames::get_singleton()->output) { + if (!nodes.has(p_output_node) || p_output_node == SNAME("output")) { return CONNECTION_ERROR_NO_OUTPUT; } @@ -1008,8 +1006,8 @@ String AnimationNodeBlendTree::get_caption() const { } float AnimationNodeBlendTree::process(float p_time, bool p_seek) { - Ref output = nodes[SceneStringNames::get_singleton()->output].node; - return _blend_node("output", nodes[SceneStringNames::get_singleton()->output].connections, this, output, p_time, p_seek, 1.0); + Ref output = nodes[SNAME("output")].node; + return _blend_node("output", nodes[SNAME("output")].connections, this, output, p_time, p_seek, 1.0); } void AnimationNodeBlendTree::get_node_list(List *r_list) { diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 67b6205a6519..d1b90d5da992 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -32,7 +32,6 @@ #include "core/config/engine.h" #include "core/object/message_queue.h" -#include "scene/scene_string_names.h" #include "servers/audio/audio_stream.h" #ifdef TOOLS_ENABLED @@ -86,7 +85,7 @@ bool AnimationPlayer::_set(const StringName &p_name, const Variant &p_value) { String which = name.get_slicec('/', 1); animation_set_next(which, p_value); - } else if (p_name == SceneStringNames::get_singleton()->blend_times) { + } else if (p_name == SNAME("blend_times")) { Array array = p_value; int len = array.size(); ERR_FAIL_COND_V(len % 3, false); @@ -316,11 +315,11 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim, Node *p_root_ov pa.special = SP_NONE; pa.owner = p_anim->node_cache[i]; if (false && p_anim->node_cache[i]->node_2d) { - if (leftover_path.size() == 1 && leftover_path[0] == SceneStringNames::get_singleton()->transform_pos) { + if (leftover_path.size() == 1 && leftover_path[0] == SNAME("position")) { pa.special = SP_NODE2D_POS; - } else if (leftover_path.size() == 1 && leftover_path[0] == SceneStringNames::get_singleton()->transform_rot) { + } else if (leftover_path.size() == 1 && leftover_path[0] == SNAME("rotation")) { pa.special = SP_NODE2D_ROT; - } else if (leftover_path.size() == 1 && leftover_path[0] == SceneStringNames::get_singleton()->transform_scale) { + } else if (leftover_path.size() == 1 && leftover_path[0] == SNAME("scale")) { pa.special = SP_NODE2D_SCALE; } } @@ -945,14 +944,14 @@ void AnimationPlayer::_animation_process(float p_delta) { String new_name = playback.assigned; queued.pop_front(); if (end_notify) { - emit_signal(SceneStringNames::get_singleton()->animation_changed, old, new_name); + emit_signal(SNAME("animation_changed"), old, new_name); } } else { //stop(); playing = false; _set_process(false); if (end_notify) { - emit_signal(SceneStringNames::get_singleton()->animation_finished, playback.assigned); + emit_signal(SNAME("animation_finished"), playback.assigned); } } end_reached = false; @@ -998,11 +997,11 @@ void AnimationPlayer::remove_animation(const StringName &p_name) { } void AnimationPlayer::_ref_anim(const Ref &p_anim) { - Ref(p_anim)->connect(SceneStringNames::get_singleton()->tracks_changed, callable_mp(this, &AnimationPlayer::_animation_changed), varray(), CONNECT_REFERENCE_COUNTED); + Ref(p_anim)->connect(SNAME("tracks_changed"), callable_mp(this, &AnimationPlayer::_animation_changed), varray(), CONNECT_REFERENCE_COUNTED); } void AnimationPlayer::_unref_anim(const Ref &p_anim) { - Ref(p_anim)->disconnect(SceneStringNames::get_singleton()->tracks_changed, callable_mp(this, &AnimationPlayer::_animation_changed)); + Ref(p_anim)->disconnect(SNAME("tracks_changed"), callable_mp(this, &AnimationPlayer::_animation_changed)); } void AnimationPlayer::rename_animation(const StringName &p_name, const StringName &p_new_name) { @@ -1209,7 +1208,7 @@ void AnimationPlayer::play(const StringName &p_name, float p_custom_blend, float _set_process(true); // always process when starting an animation playing = true; - emit_signal(SceneStringNames::get_singleton()->animation_started, c.assigned); + emit_signal(SNAME("animation_started"), c.assigned); if (is_inside_tree() && Engine::get_singleton()->is_editor_hint()) { return; // no next in this case @@ -1691,7 +1690,7 @@ void AnimationPlayer::_bind_methods() { } AnimationPlayer::AnimationPlayer() { - root = SceneStringNames::get_singleton()->path_pp; + root = NodePath(".."); } AnimationPlayer::~AnimationPlayer() { diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index 00b847168d13..c1ff521b7536 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -32,7 +32,6 @@ #include "animation_blend_tree.h" #include "core/config/engine.h" -#include "scene/scene_string_names.h" #include "servers/audio/audio_stream.h" void AnimationNode::get_parameter_list(List *r_list) const { @@ -801,11 +800,11 @@ void AnimationTree::_process_graph(float p_delta) { { if (started) { //if started, seek - root->_pre_process(SceneStringNames::get_singleton()->parameters_base_path, nullptr, &state, 0, true, Vector()); + root->_pre_process("parameters/", nullptr, &state, 0, true, Vector()); started = false; } - root->_pre_process(SceneStringNames::get_singleton()->parameters_base_path, nullptr, &state, p_delta, false, Vector()); + root->_pre_process("parameters/", nullptr, &state, p_delta, false, Vector()); } if (!state.valid) { @@ -1385,7 +1384,7 @@ void AnimationTree::_update_properties() { input_activity_map_get.clear(); if (root.is_valid()) { - _update_properties_for_node(SceneStringNames::get_singleton()->parameters_base_path, root); + _update_properties_for_node("parameters/", root); } properties_dirty = false; diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 75a4464a4085..869dcb9c6282 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -32,7 +32,6 @@ #include "core/os/keyboard.h" #include "scene/main/window.h" -#include "scene/scene_string_names.h" void BaseButton::_unpress_group() { if (!button_group.is_valid()) { @@ -122,7 +121,7 @@ void BaseButton::_notification(int p_what) { void BaseButton::_pressed() { if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_pressed); + get_script_instance()->call(SNAME("_pressed")); } pressed(); emit_signal(SNAME("pressed")); @@ -130,7 +129,7 @@ void BaseButton::_pressed() { void BaseButton::_toggled(bool p_pressed) { if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_toggled, p_pressed); + get_script_instance()->call(SNAME("_toggled"), p_pressed); } toggled(p_pressed); emit_signal(SNAME("toggled"), p_pressed); diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index c97434f69b04..ae7af015ee17 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -30,7 +30,6 @@ #include "container.h" #include "core/object/message_queue.h" -#include "scene/scene_string_names.h" void Container::_child_minsize_changed() { //Size2 ms = get_combined_minimum_size(); @@ -88,7 +87,7 @@ void Container::_sort_children() { } notification(NOTIFICATION_SORT_CHILDREN); - emit_signal(SceneStringNames::get_singleton()->sort_children); + emit_signal(SNAME("sort_children")); pending_sort = false; } diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index c19ee849d365..0d7696ca948c 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -42,7 +42,6 @@ #include "scene/gui/panel.h" #include "scene/main/canvas_layer.h" #include "scene/main/window.h" -#include "scene/scene_string_names.h" #include "servers/rendering_server.h" #include "servers/text_server.h" @@ -301,7 +300,7 @@ void Control::_update_minimum_size() { if (minsize != data.last_minimum_size) { data.last_minimum_size = minsize; _size_changed(); - emit_signal(SceneStringNames::get_singleton()->minimum_size_changed); + emit_signal(SNAME("minimum_size_changed")); } } @@ -640,27 +639,27 @@ void Control::_notification(int p_notification) { } break; case NOTIFICATION_RESIZED: { - emit_signal(SceneStringNames::get_singleton()->resized); + emit_signal(SNAME("resized")); } break; case NOTIFICATION_DRAW: { _update_canvas_item_transform(); RenderingServer::get_singleton()->canvas_item_set_custom_rect(get_canvas_item(), !data.disable_visibility_clip, Rect2(Point2(), get_size())); RenderingServer::get_singleton()->canvas_item_set_clip(get_canvas_item(), data.clip_contents); - //emit_signal(SceneStringNames::get_singleton()->draw); + //emit_signal(SNAME("draw")); } break; case NOTIFICATION_MOUSE_ENTER: { - emit_signal(SceneStringNames::get_singleton()->mouse_entered); + emit_signal(SNAME("mouse_entered")); } break; case NOTIFICATION_MOUSE_EXIT: { - emit_signal(SceneStringNames::get_singleton()->mouse_exited); + emit_signal(SNAME("mouse_exited")); } break; case NOTIFICATION_FOCUS_ENTER: { - emit_signal(SceneStringNames::get_singleton()->focus_entered); + emit_signal(SNAME("focus_entered")); update(); } break; case NOTIFICATION_FOCUS_EXIT: { - emit_signal(SceneStringNames::get_singleton()->focus_exited); + emit_signal(SNAME("focus_exited")); update(); } break; case NOTIFICATION_THEME_CHANGED: { @@ -718,7 +717,7 @@ Variant Control::get_drag_data(const Point2 &p_point) { Variant v = p_point; const Variant *p = &v; Callable::CallError ce; - Variant ret = get_script_instance()->call(SceneStringNames::get_singleton()->_get_drag_data, &p, 1, ce); + Variant ret = get_script_instance()->call(SNAME("_get_drag_data"), &p, 1, ce); if (ce.error == Callable::CallError::CALL_OK) { return ret; } @@ -740,7 +739,7 @@ bool Control::can_drop_data(const Point2 &p_point, const Variant &p_data) const Variant v = p_point; const Variant *p[2] = { &v, &p_data }; Callable::CallError ce; - Variant ret = get_script_instance()->call(SceneStringNames::get_singleton()->_can_drop_data, p, 2, ce); + Variant ret = get_script_instance()->call(SNAME("_can_drop_data"), p, 2, ce); if (ce.error == Callable::CallError::CALL_OK) { return ret; } @@ -763,7 +762,7 @@ void Control::drop_data(const Point2 &p_point, const Variant &p_data) { Variant v = p_point; const Variant *p[2] = { &v, &p_data }; Callable::CallError ce; - Variant ret = get_script_instance()->call(SceneStringNames::get_singleton()->_drop_data, p, 2, ce); + Variant ret = get_script_instance()->call(SNAME("_drop_data"), p, 2, ce); if (ce.error == Callable::CallError::CALL_OK) { return; } @@ -787,7 +786,7 @@ Size2 Control::get_minimum_size() const { ScriptInstance *si = const_cast(this)->get_script_instance(); if (si) { Callable::CallError ce; - Variant s = si->call(SceneStringNames::get_singleton()->_get_minimum_size, nullptr, 0, ce); + Variant s = si->call(SNAME("_get_minimum_size"), nullptr, 0, ce); if (ce.error == Callable::CallError::CALL_OK) { return s; } @@ -2016,7 +2015,7 @@ void Control::_propagate_theme_changed(Node *p_at, Control *p_owner, Window *p_o c->data.theme_owner_window = p_owner_window; } c->notification(Control::NOTIFICATION_THEME_CHANGED); - c->emit_signal(SceneStringNames::get_singleton()->theme_changed); + c->emit_signal(SNAME("theme_changed")); } if (w) { @@ -2025,7 +2024,7 @@ void Control::_propagate_theme_changed(Node *p_at, Control *p_owner, Window *p_o w->theme_owner_window = p_owner_window; } w->notification(Window::NOTIFICATION_THEME_CHANGED); - w->emit_signal(SceneStringNames::get_singleton()->theme_changed); + w->emit_signal(SNAME("theme_changed")); } } @@ -2291,7 +2290,7 @@ void Control::set_h_size_flags(int p_flags) { return; } data.h_size_flags = p_flags; - emit_signal(SceneStringNames::get_singleton()->size_flags_changed); + emit_signal(SNAME("size_flags_changed")); } int Control::get_h_size_flags() const { @@ -2303,7 +2302,7 @@ void Control::set_v_size_flags(int p_flags) { return; } data.v_size_flags = p_flags; - emit_signal(SceneStringNames::get_singleton()->size_flags_changed); + emit_signal(SNAME("size_flags_changed")); } void Control::set_stretch_ratio(real_t p_ratio) { @@ -2312,7 +2311,7 @@ void Control::set_stretch_ratio(real_t p_ratio) { } data.expand = p_ratio; - emit_signal(SceneStringNames::get_singleton()->size_flags_changed); + emit_signal(SNAME("size_flags_changed")); } real_t Control::get_stretch_ratio() const { @@ -2467,7 +2466,7 @@ Vector Control::structured_text_parser(StructuredTextParser p_theme_ty } break; case STRUCTURED_TEXT_CUSTOM: { if (get_script_instance()) { - Variant data = get_script_instance()->call(SceneStringNames::get_singleton()->_structured_text_parser, p_args, p_text); + Variant data = get_script_instance()->call(SNAME("_structured_text_parser"), p_args, p_text); if (data.get_type() == Variant::ARRAY) { Array _data = data; for (int i = 0; i < _data.size(); i++) { @@ -2499,7 +2498,7 @@ real_t Control::get_rotation() const { void Control::_override_changed() { notification(NOTIFICATION_THEME_CHANGED); - emit_signal(SceneStringNames::get_singleton()->theme_changed); + emit_signal(SNAME("theme_changed")); minimum_size_changed(); // overrides are likely to affect minimum size } diff --git a/scene/gui/nine_patch_rect.cpp b/scene/gui/nine_patch_rect.cpp index 8bf25ac9154f..c3b131949859 100644 --- a/scene/gui/nine_patch_rect.cpp +++ b/scene/gui/nine_patch_rect.cpp @@ -30,7 +30,6 @@ #include "nine_patch_rect.h" -#include "scene/scene_string_names.h" #include "servers/rendering_server.h" void NinePatchRect::_notification(int p_what) { @@ -98,7 +97,7 @@ void NinePatchRect::set_texture(const Ref &p_tex) { texture->set_flags(texture->get_flags()&(~Texture::FLAG_REPEAT)); //remove repeat from texture, it looks bad in sprites */ minimum_size_changed(); - emit_signal(SceneStringNames::get_singleton()->texture_changed); + emit_signal(SNAME("texture_changed")); } Ref NinePatchRect::get_texture() const { diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 3925e0c38e47..f29f51cf0934 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -33,7 +33,6 @@ #include "core/math/math_defs.h" #include "core/os/keyboard.h" #include "core/os/os.h" -#include "scene/scene_string_names.h" #include "servers/display_server.h" #include "modules/modules_enabled.gen.h" diff --git a/scene/gui/texture_rect.cpp b/scene/gui/texture_rect.cpp index 1cba88e06f82..d5618cdb3963 100644 --- a/scene/gui/texture_rect.cpp +++ b/scene/gui/texture_rect.cpp @@ -29,7 +29,6 @@ /*************************************************************************/ #include "texture_rect.h" -#include "core/core_string_names.h" #include "servers/rendering_server.h" void TextureRect::_notification(int p_what) { @@ -162,13 +161,13 @@ void TextureRect::set_texture(const Ref &p_tex) { } if (texture.is_valid()) { - texture->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &TextureRect::_texture_changed)); + texture->disconnect(SNAME("changed"), callable_mp(this, &TextureRect::_texture_changed)); } texture = p_tex; if (texture.is_valid()) { - texture->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &TextureRect::_texture_changed)); + texture->connect(SNAME("changed"), callable_mp(this, &TextureRect::_texture_changed)); } update(); diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index 229b5384eae1..8bb2fc39900a 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -29,7 +29,6 @@ /*************************************************************************/ #include "video_player.h" -#include "scene/scene_string_names.h" #include "core/os/os.h" #include "servers/audio_server.h" @@ -161,7 +160,7 @@ void VideoPlayer::_notification(int p_notification) { playback->update(delta); // playback->is_playing() returns false in the last video frame if (!playback->is_playing()) { - emit_signal(SceneStringNames::get_singleton()->finished); + emit_signal(SNAME("finished")); } } break; diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 0a7635188545..7b8a5f91b4dd 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -39,7 +39,6 @@ #include "scene/resources/font.h" #include "scene/resources/style_box.h" #include "scene/resources/texture.h" -#include "scene/scene_string_names.h" #include "servers/rendering_server.h" Mutex CanvasItemMaterial::material_mutex; @@ -356,7 +355,7 @@ void CanvasItem::_propagate_visibility_changed(bool p_visible) { if (p_visible) { update(); //todo optimize } else { - emit_signal(SceneStringNames::get_singleton()->hidden); + emit_signal(SNAME("hidden")); } _block(); @@ -422,9 +421,9 @@ void CanvasItem::_update_callback() { drawing = true; current_item_drawn = this; notification(NOTIFICATION_DRAW); - emit_signal(SceneStringNames::get_singleton()->draw); + emit_signal(SNAME("draw")); if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_draw); + get_script_instance()->call(SNAME("_draw")); } current_item_drawn = nullptr; drawing = false; @@ -574,7 +573,7 @@ void CanvasItem::_notification(int p_what) { window = Object::cast_to(viewport); if (window) { - window->connect(SceneStringNames::get_singleton()->visibility_changed, callable_mp(this, &CanvasItem::_window_visibility_changed)); + window->connect(SNAME("visibility_changed"), callable_mp(this, &CanvasItem::_window_visibility_changed)); } } } @@ -607,7 +606,7 @@ void CanvasItem::_notification(int p_what) { C = nullptr; } if (window) { - window->disconnect(SceneStringNames::get_singleton()->visibility_changed, callable_mp(this, &CanvasItem::_window_visibility_changed)); + window->disconnect(SNAME("visibility_changed"), callable_mp(this, &CanvasItem::_window_visibility_changed)); } global_invalid = true; } break; @@ -615,7 +614,7 @@ void CanvasItem::_notification(int p_what) { case NOTIFICATION_TRANSFORM_CHANGED: { } break; case NOTIFICATION_VISIBILITY_CHANGED: { - emit_signal(SceneStringNames::get_singleton()->visibility_changed); + emit_signal(SNAME("visibility_changed")); } break; } } @@ -723,7 +722,7 @@ void CanvasItem::item_rect_changed(bool p_size_changed) { if (p_size_changed) { update(); } - emit_signal(SceneStringNames::get_singleton()->item_rect_changed); + emit_signal(SNAME("item_rect_changed")); } void CanvasItem::draw_line(const Point2 &p_from, const Point2 &p_to, const Color &p_color, real_t p_width) { diff --git a/scene/main/node.cpp b/scene/main/node.cpp index f1e55743519a..010865be6237 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -30,7 +30,6 @@ #include "node.h" -#include "core/core_string_names.h" #include "core/io/resource_loader.h" #include "core/object/message_queue.h" #include "core/string/print_string.h" @@ -38,7 +37,6 @@ #include "scene/animation/tween.h" #include "scene/debugger/scene_debugger.h" #include "scene/resources/packed_scene.h" -#include "scene/scene_string_names.h" #include "viewport.h" #ifdef TOOLS_ENABLED @@ -56,13 +54,13 @@ void Node::_notification(int p_notification) { case NOTIFICATION_PROCESS: { if (get_script_instance()) { Variant time = get_process_delta_time(); - get_script_instance()->call(SceneStringNames::get_singleton()->_process, time); + get_script_instance()->call(SNAME("_process"), time); } } break; case NOTIFICATION_PHYSICS_PROCESS: { if (get_script_instance()) { Variant time = get_physics_process_delta_time(); - get_script_instance()->call(SceneStringNames::get_singleton()->_physics_process, time); + get_script_instance()->call(SNAME("_physics_process"), time); } } break; @@ -125,27 +123,27 @@ void Node::_notification(int p_notification) { } break; case NOTIFICATION_READY: { if (get_script_instance()) { - if (get_script_instance()->has_method(SceneStringNames::get_singleton()->_input)) { + if (get_script_instance()->has_method(SNAME("_input"))) { set_process_input(true); } - if (get_script_instance()->has_method(SceneStringNames::get_singleton()->_unhandled_input)) { + if (get_script_instance()->has_method(SNAME("_unhandled_input"))) { set_process_unhandled_input(true); } - if (get_script_instance()->has_method(SceneStringNames::get_singleton()->_unhandled_key_input)) { + if (get_script_instance()->has_method(SNAME("_unhandled_key_input"))) { set_process_unhandled_key_input(true); } - if (get_script_instance()->has_method(SceneStringNames::get_singleton()->_process)) { + if (get_script_instance()->has_method(SNAME("_process"))) { set_process(true); } - if (get_script_instance()->has_method(SceneStringNames::get_singleton()->_physics_process)) { + if (get_script_instance()->has_method(SNAME("_physics_process"))) { set_physics_process(true); } - get_script_instance()->call(SceneStringNames::get_singleton()->_ready); + get_script_instance()->call(SNAME("_ready")); } } break; @@ -187,7 +185,7 @@ void Node::_propagate_ready() { if (data.ready_first) { data.ready_first = false; notification(NOTIFICATION_READY); - emit_signal(SceneStringNames::get_singleton()->ready); + emit_signal(SNAME("ready")); } } @@ -215,10 +213,10 @@ void Node::_propagate_enter_tree() { notification(NOTIFICATION_ENTER_TREE); if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_enter_tree); + get_script_instance()->call(SNAME("_enter_tree")); } - emit_signal(SceneStringNames::get_singleton()->tree_entered); + emit_signal(SNAME("tree_entered")); data.tree->node_added(this); @@ -245,7 +243,7 @@ void Node::_propagate_after_exit_tree() { data.children[i]->_propagate_after_exit_tree(); } data.blocked--; - emit_signal(SceneStringNames::get_singleton()->tree_exited); + emit_signal(SNAME("tree_exited")); } void Node::_propagate_exit_tree() { @@ -263,9 +261,9 @@ void Node::_propagate_exit_tree() { data.blocked--; if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_exit_tree); + get_script_instance()->call(SNAME("_exit_tree")); } - emit_signal(SceneStringNames::get_singleton()->tree_exiting); + emit_signal(SNAME("tree_exiting")); notification(NOTIFICATION_EXIT_TREE, true); if (data.tree) { @@ -1226,12 +1224,10 @@ Node *Node::get_node_or_null(const NodePath &p_path) const { StringName name = p_path.get_name(i); Node *next = nullptr; - if (name == SceneStringNames::get_singleton()->dot) { // . - + if (name == SNAME(".")) { // . next = current; - } else if (name == SceneStringNames::get_singleton()->doubledot) { // .. - + } else if (name == SNAME("..")) { // .. if (current == nullptr || !current->data.parent) { return nullptr; } @@ -1898,7 +1894,7 @@ Node *Node::_duplicate(int p_flags, Map *r_duplimap) const node->data.editable_instance = data.editable_instance; } - StringName script_property_name = CoreStringNames::get_singleton()->_script; + StringName script_property_name = SNAME("script"); List hidden_roots; List node_tree; @@ -2516,7 +2512,7 @@ void Node::update_configuration_warnings() { return; } if (get_tree()->get_edited_scene_root() && (get_tree()->get_edited_scene_root() == this || get_tree()->get_edited_scene_root()->is_ancestor_of(this))) { - get_tree()->emit_signal(SceneStringNames::get_singleton()->node_configuration_warning_changed, this); + get_tree()->emit_signal(SNAME("node_configuration_warning_changed"), this); } #endif } diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index adba7f1a31a6..6b8c5b691f5a 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -47,7 +47,6 @@ #include "scene/resources/material.h" #include "scene/resources/mesh.h" #include "scene/resources/packed_scene.h" -#include "scene/scene_string_names.h" #include "servers/display_server.h" #include "servers/navigation_server_3d.h" #include "servers/physics_server_2d.h" diff --git a/scene/main/shader_globals_override.cpp b/scene/main/shader_globals_override.cpp index d22a6b28751b..ac94adfc7d91 100644 --- a/scene/main/shader_globals_override.cpp +++ b/scene/main/shader_globals_override.cpp @@ -30,9 +30,7 @@ #include "shader_globals_override.h" -#include "core/core_string_names.h" #include "scene/main/window.h" -#include "scene/scene_string_names.h" StringName *ShaderGlobalsOverride::_remap(const StringName &p_name) const { StringName *r = param_remaps.getptr(p_name); @@ -223,11 +221,11 @@ void ShaderGlobalsOverride::_get_property_list(List *p_list) const void ShaderGlobalsOverride::_activate() { List nodes; - get_tree()->get_nodes_in_group(SceneStringNames::get_singleton()->shader_overrides_group_active, &nodes); + get_tree()->get_nodes_in_group(SNAME("_shader_overrides_group_active_"), &nodes); if (nodes.size() == 0) { //good we are the only override, enable all active = true; - add_to_group(SceneStringNames::get_singleton()->shader_overrides_group_active); + add_to_group(SNAME("_shader_overrides_group_active_")); const StringName *K = nullptr; while ((K = overrides.next(K))) { @@ -248,7 +246,7 @@ void ShaderGlobalsOverride::_activate() { void ShaderGlobalsOverride::_notification(int p_what) { if (p_what == Node3D::NOTIFICATION_ENTER_TREE) { - add_to_group(SceneStringNames::get_singleton()->shader_overrides_group); + add_to_group(SNAME("_shader_overrides_group_")); _activate(); } else if (p_what == Node3D::NOTIFICATION_EXIT_TREE) { @@ -263,9 +261,9 @@ void ShaderGlobalsOverride::_notification(int p_what) { } } - remove_from_group(SceneStringNames::get_singleton()->shader_overrides_group_active); - remove_from_group(SceneStringNames::get_singleton()->shader_overrides_group); - get_tree()->call_group(SceneStringNames::get_singleton()->shader_overrides_group, "_activate"); //another may want to activate when this is removed + remove_from_group(SNAME("_shader_overrides_group_active_")); + remove_from_group(SNAME("_shader_overrides_group_")); + get_tree()->call_group(SNAME("_shader_overrides_group_"), "_activate"); //another may want to activate when this is removed active = false; } } diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 4231072ed937..e558083eba1d 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -31,7 +31,6 @@ #include "viewport.h" #include "core/config/project_settings.h" -#include "core/core_string_names.h" #include "core/debugger/engine_debugger.h" #include "core/input/input.h" #include "core/os/os.h" @@ -54,7 +53,6 @@ #include "scene/main/timer.h" #include "scene/main/window.h" #include "scene/resources/mesh.h" -#include "scene/scene_string_names.h" #include "servers/display_server.h" #include "servers/physics_server_2d.h" @@ -1230,7 +1228,7 @@ void Viewport::set_world_3d(const Ref &p_world_3d) { } if (own_world_3d.is_valid() && world_3d.is_valid()) { - world_3d->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Viewport::_own_world_3d_changed)); + world_3d->disconnect(SNAME("changed"), callable_mp(this, &Viewport::_own_world_3d_changed)); } world_3d = p_world_3d; @@ -1238,7 +1236,7 @@ void Viewport::set_world_3d(const Ref &p_world_3d) { if (own_world_3d.is_valid()) { if (world_3d.is_valid()) { own_world_3d = world_3d->duplicate(); - world_3d->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Viewport::_own_world_3d_changed)); + world_3d->connect(SNAME("changed"), callable_mp(this, &Viewport::_own_world_3d_changed)); } else { own_world_3d = Ref(memnew(World3D)); } @@ -1624,7 +1622,7 @@ void Viewport::_gui_call_input(Control *p_control, const Ref &p_inpu Control *control = Object::cast_to(ci); if (control) { if (control->data.mouse_filter != Control::MOUSE_FILTER_IGNORE) { - control->emit_signal(SceneStringNames::get_singleton()->gui_input, ev); //signal should be first, so it's possible to override an event (and then accept it) + control->emit_signal(SNAME("gui_input"), ev); //signal should be first, so it's possible to override an event (and then accept it) } if (gui.key_event_accepted) { break; @@ -1639,9 +1637,9 @@ void Viewport::_gui_call_input(Control *p_control, const Ref &p_inpu Variant event = ev; const Variant *args[1] = { &event }; if (control->get_script_instance()) { - control->get_script_instance()->call(SceneStringNames::get_singleton()->_gui_input, args, 1, error); + control->get_script_instance()->call(SNAME("_gui_input"), args, 1, error); } - MethodBind *method = ClassDB::get_method(control->get_class_name(), SceneStringNames::get_singleton()->_gui_input); + MethodBind *method = ClassDB::get_method(control->get_class_name(), SNAME("_gui_input")); if (method) { method->call(control, args, 1, error); } @@ -2372,9 +2370,9 @@ void Viewport::_gui_input_event(Ref p_event) { if (gui.key_focus) { gui.key_event_accepted = false; if (gui.key_focus->can_process()) { - gui.key_focus->call(SceneStringNames::get_singleton()->_gui_input, p_event); + gui.key_focus->call(SNAME("_gui_input"), p_event); if (gui.key_focus) { //maybe lost it - gui.key_focus->emit_signal(SceneStringNames::get_singleton()->gui_input, p_event); + gui.key_focus->emit_signal(SNAME("gui_input"), p_event); } } @@ -2595,7 +2593,7 @@ void Viewport::_drop_mouse_focus() { mb->set_global_position(c->get_local_mouse_position()); mb->set_button_index(MouseButton(i + 1)); mb->set_pressed(false); - c->call(SceneStringNames::get_singleton()->_gui_input, mb); + c->call(SNAME("_gui_input"), mb); } } } @@ -2707,7 +2705,7 @@ void Viewport::_post_gui_grab_click_focus() { mb->set_position(click); mb->set_button_index(MouseButton(i + 1)); mb->set_pressed(false); - gui.mouse_focus->call(SceneStringNames::get_singleton()->_gui_input, mb); + gui.mouse_focus->call(SNAME("_gui_input"), mb); } } @@ -2725,7 +2723,7 @@ void Viewport::_post_gui_grab_click_focus() { mb->set_position(click); mb->set_button_index(MouseButton(i + 1)); mb->set_pressed(true); - gui.mouse_focus->call_deferred(SceneStringNames::get_singleton()->_gui_input, mb); + gui.mouse_focus->call_deferred(SNAME("_gui_input"), mb); } } } @@ -3149,12 +3147,12 @@ void Viewport::set_use_own_world_3d(bool p_world_3d) { if (!p_world_3d) { own_world_3d = Ref(); if (world_3d.is_valid()) { - world_3d->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Viewport::_own_world_3d_changed)); + world_3d->disconnect(SNAME("changed"), callable_mp(this, &Viewport::_own_world_3d_changed)); } } else { if (world_3d.is_valid()) { own_world_3d = world_3d->duplicate(); - world_3d->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Viewport::_own_world_3d_changed)); + world_3d->connect(SNAME("changed"), callable_mp(this, &Viewport::_own_world_3d_changed)); } else { own_world_3d = Ref(memnew(World3D)); } diff --git a/scene/main/window.cpp b/scene/main/window.cpp index ab1846660bbb..3cf5326429a5 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -35,7 +35,6 @@ #include "core/string/translation.h" #include "scene/gui/control.h" #include "scene/resources/font.h" -#include "scene/scene_string_names.h" void Window::set_title(const String &p_title) { title = p_title; @@ -401,7 +400,7 @@ void Window::set_visible(bool p_visible) { focused = false; } notification(NOTIFICATION_VISIBILITY_CHANGED); - emit_signal(SceneStringNames::get_singleton()->visibility_changed); + emit_signal(SNAME("visibility_changed")); RS::get_singleton()->viewport_set_active(get_viewport_rid(), visible); @@ -750,7 +749,7 @@ void Window::_notification(int p_what) { } if (visible) { notification(NOTIFICATION_VISIBILITY_CHANGED); - emit_signal(SceneStringNames::get_singleton()->visibility_changed); + emit_signal(SNAME("visibility_changed")); RS::get_singleton()->viewport_set_active(get_viewport_rid(), true); } } @@ -912,7 +911,7 @@ void Window::_window_input(const Ref &p_ev) { } } - emit_signal(SceneStringNames::get_singleton()->window_input, p_ev); + emit_signal(SNAME("window_input"), p_ev); input(p_ev); if (!is_input_handled()) { diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 439fe649a195..a7fec66b1c8e 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -190,7 +190,6 @@ #include "scene/resources/world_2d.h" #include "scene/resources/world_3d.h" #include "scene/resources/world_margin_shape_3d.h" -#include "scene/scene_string_names.h" #include "scene/main/shader_globals_override.h" @@ -255,8 +254,6 @@ static Ref resource_saver_shader; static Ref resource_loader_shader; void register_scene_types() { - SceneStringNames::create(); - OS::get_singleton()->yield(); //may take time to init Node::init_node_hrcr(); @@ -1092,5 +1089,4 @@ void unregister_scene_types() { ParticlesMaterial::finish_shaders(); CanvasItemMaterial::finish_shaders(); ColorPicker::finish_shaders(); - SceneStringNames::free(); } diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 640ec50eb948..ba5724815520 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -29,7 +29,6 @@ /*************************************************************************/ #include "animation.h" -#include "scene/scene_string_names.h" #include "core/math/geometry_3d.h" @@ -619,7 +618,7 @@ int Animation::add_track(TrackType p_type, int p_at_pos) { } } emit_changed(); - emit_signal(SceneStringNames::get_singleton()->tracks_changed); + emit_signal(SNAME("tracks_changed")); return p_at_pos; } @@ -663,7 +662,7 @@ void Animation::remove_track(int p_track) { memdelete(t); tracks.remove(p_track); emit_changed(); - emit_signal(SceneStringNames::get_singleton()->tracks_changed); + emit_signal(SNAME("tracks_changed")); } int Animation::get_track_count() const { @@ -679,7 +678,7 @@ void Animation::track_set_path(int p_track, const NodePath &p_path) { ERR_FAIL_INDEX(p_track, tracks.size()); tracks[p_track]->path = p_path; emit_changed(); - emit_signal(SceneStringNames::get_singleton()->tracks_changed); + emit_signal(SNAME("tracks_changed")); } NodePath Animation::track_get_path(int p_track) const { @@ -2518,7 +2517,7 @@ void Animation::track_move_up(int p_track) { } emit_changed(); - emit_signal(SceneStringNames::get_singleton()->tracks_changed); + emit_signal(SNAME("tracks_changed")); } void Animation::track_move_down(int p_track) { @@ -2527,7 +2526,7 @@ void Animation::track_move_down(int p_track) { } emit_changed(); - emit_signal(SceneStringNames::get_singleton()->tracks_changed); + emit_signal(SNAME("tracks_changed")); } void Animation::track_move_to(int p_track, int p_to_index) { @@ -2543,7 +2542,7 @@ void Animation::track_move_to(int p_track, int p_to_index) { tracks.insert(p_to_index > p_track ? p_to_index - 1 : p_to_index, track); emit_changed(); - emit_signal(SceneStringNames::get_singleton()->tracks_changed); + emit_signal(SNAME("tracks_changed")); } void Animation::track_swap(int p_track, int p_with_track) { @@ -2555,7 +2554,7 @@ void Animation::track_swap(int p_track, int p_with_track) { SWAP(tracks.write[p_track], tracks.write[p_with_track]); emit_changed(); - emit_signal(SceneStringNames::get_singleton()->tracks_changed); + emit_signal(SNAME("tracks_changed")); } void Animation::set_step(float p_step) { @@ -2705,7 +2704,7 @@ void Animation::clear() { loop = false; length = 1; emit_changed(); - emit_signal(SceneStringNames::get_singleton()->tracks_changed); + emit_signal(SNAME("tracks_changed")); } bool Animation::_transform_track_optimize_key(const TKey &t0, const TKey &t1, const TKey &t2, float p_alowed_linear_err, float p_alowed_angular_err, float p_max_optimizable_angle, const Vector3 &p_norm) { diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index c13db83d6d30..dd9c369ea640 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -30,8 +30,6 @@ #include "curve.h" -#include "core/core_string_names.h" - template static _FORCE_INLINE_ T _bezier_interp(real_t t, T start, T control_1, T control_2, T end) { /* Formula from Wikipedia article on Bezier curves. */ @@ -357,7 +355,7 @@ real_t Curve::interpolate_local_nocheck(int index, real_t local_offset) const { void Curve::mark_dirty() { _baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } Array Curve::get_data() const { @@ -547,7 +545,7 @@ void Curve2D::add_point(const Vector2 &p_pos, const Vector2 &p_in, const Vector2 } baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } void Curve2D::set_point_position(int p_index, const Vector2 &p_pos) { @@ -555,7 +553,7 @@ void Curve2D::set_point_position(int p_index, const Vector2 &p_pos) { points.write[p_index].pos = p_pos; baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } Vector2 Curve2D::get_point_position(int p_index) const { @@ -568,7 +566,7 @@ void Curve2D::set_point_in(int p_index, const Vector2 &p_in) { points.write[p_index].in = p_in; baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } Vector2 Curve2D::get_point_in(int p_index) const { @@ -581,7 +579,7 @@ void Curve2D::set_point_out(int p_index, const Vector2 &p_out) { points.write[p_index].out = p_out; baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } Vector2 Curve2D::get_point_out(int p_index) const { @@ -593,14 +591,14 @@ void Curve2D::remove_point(int p_index) { ERR_FAIL_INDEX(p_index, points.size()); points.remove(p_index); baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } void Curve2D::clear_points() { if (!points.is_empty()) { points.clear(); baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } } @@ -799,7 +797,7 @@ PackedVector2Array Curve2D::get_baked_points() const { void Curve2D::set_bake_interval(float p_tolerance) { bake_interval = p_tolerance; baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } float Curve2D::get_bake_interval() const { @@ -1016,7 +1014,7 @@ void Curve3D::add_point(const Vector3 &p_pos, const Vector3 &p_in, const Vector3 } baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } void Curve3D::set_point_position(int p_index, const Vector3 &p_pos) { @@ -1024,7 +1022,7 @@ void Curve3D::set_point_position(int p_index, const Vector3 &p_pos) { points.write[p_index].pos = p_pos; baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } Vector3 Curve3D::get_point_position(int p_index) const { @@ -1037,7 +1035,7 @@ void Curve3D::set_point_tilt(int p_index, float p_tilt) { points.write[p_index].tilt = p_tilt; baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } float Curve3D::get_point_tilt(int p_index) const { @@ -1050,7 +1048,7 @@ void Curve3D::set_point_in(int p_index, const Vector3 &p_in) { points.write[p_index].in = p_in; baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } Vector3 Curve3D::get_point_in(int p_index) const { @@ -1063,7 +1061,7 @@ void Curve3D::set_point_out(int p_index, const Vector3 &p_out) { points.write[p_index].out = p_out; baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } Vector3 Curve3D::get_point_out(int p_index) const { @@ -1075,14 +1073,14 @@ void Curve3D::remove_point(int p_index) { ERR_FAIL_INDEX(p_index, points.size()); points.remove(p_index); baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } void Curve3D::clear_points() { if (!points.is_empty()) { points.clear(); baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } } @@ -1522,7 +1520,7 @@ float Curve3D::get_closest_offset(const Vector3 &p_to_point) const { void Curve3D::set_bake_interval(float p_tolerance) { bake_interval = p_tolerance; baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } float Curve3D::get_bake_interval() const { @@ -1532,7 +1530,7 @@ float Curve3D::get_bake_interval() const { void Curve3D::set_up_vector_enabled(bool p_enable) { up_vector_enabled = p_enable; baked_cache_dirty = true; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } bool Curve3D::is_up_vector_enabled() const { diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 8550af8bcbd3..260add083791 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -31,7 +31,6 @@ #include "environment.h" #include "core/config/project_settings.h" -#include "core/core_string_names.h" #include "servers/rendering_server.h" #include "texture.h" @@ -907,8 +906,8 @@ void Environment::set_adjustment_color_correction(Ref p_color_correctio adjustment_color_correction = p_color_correction; Ref grad_tex = p_color_correction; if (grad_tex.is_valid()) { - if (!grad_tex->is_connected(CoreStringNames::get_singleton()->changed, callable_mp(this, &Environment::_update_adjustment))) { - grad_tex->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Environment::_update_adjustment)); + if (!grad_tex->is_connected(SNAME("changed"), callable_mp(this, &Environment::_update_adjustment))) { + grad_tex->connect(SNAME("changed"), callable_mp(this, &Environment::_update_adjustment)); } } Ref adjustment_texture_2d = adjustment_color_correction; diff --git a/scene/resources/gradient.cpp b/scene/resources/gradient.cpp index 7b9b9421423e..d00872226e6c 100644 --- a/scene/resources/gradient.cpp +++ b/scene/resources/gradient.cpp @@ -30,8 +30,6 @@ #include "gradient.h" -#include "core/core_string_names.h" - Gradient::Gradient() { //Set initial gradient transition from black to white points.resize(2); @@ -92,7 +90,7 @@ void Gradient::set_offsets(const Vector &p_offsets) { points.write[i].offset = p_offsets[i]; } is_sorted = false; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } void Gradient::set_colors(const Vector &p_colors) { @@ -103,7 +101,7 @@ void Gradient::set_colors(const Vector &p_colors) { for (int i = 0; i < points.size(); i++) { points.write[i].color = p_colors[i]; } - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } Vector &Gradient::get_points() { @@ -117,20 +115,20 @@ void Gradient::add_point(float p_offset, const Color &p_color) { is_sorted = false; points.push_back(p); - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } void Gradient::remove_point(int p_index) { ERR_FAIL_INDEX(p_index, points.size()); ERR_FAIL_COND(points.size() <= 1); points.remove(p_index); - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } void Gradient::set_points(Vector &p_points) { points = p_points; is_sorted = false; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } void Gradient::set_offset(int pos, const float offset) { @@ -138,7 +136,7 @@ void Gradient::set_offset(int pos, const float offset) { _update_sorting(); points.write[pos].offset = offset; is_sorted = false; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } float Gradient::get_offset(int pos) { @@ -151,7 +149,7 @@ void Gradient::set_color(int pos, const Color &color) { ERR_FAIL_INDEX(pos, points.size()); _update_sorting(); points.write[pos].color = color; - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(SNAME("changed")); } Color Gradient::get_color(int pos) { diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 08f7274ff630..0754c0c01cbe 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -37,7 +37,6 @@ #endif #include "scene/main/scene_tree.h" -#include "scene/scene_string_names.h" void Material::set_next_pass(const Ref &p_pass) { for (Ref pass_child = p_pass; pass_child != nullptr; pass_child = pass_child->get_next_pass()) { diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index eddbb9a842df..343acf893fca 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -32,7 +32,6 @@ #include "core/config/engine.h" #include "core/config/project_settings.h" -#include "core/core_string_names.h" #include "core/io/resource_loader.h" #include "scene/2d/node_2d.h" #include "scene/3d/node_3d.h" @@ -193,7 +192,7 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const { ERR_FAIL_INDEX_V(nprops[j].name, sname_count, nullptr); ERR_FAIL_INDEX_V(nprops[j].value, prop_count, nullptr); - if (snames[nprops[j].name] == CoreStringNames::get_singleton()->_script) { + if (snames[nprops[j].name] == SNAME("script")) { //work around to avoid old script variables from disappearing, should be the proper fix to: //https://github.com/godotengine/godot/issues/2958 diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp index 424a54f34427..94f7d83a3722 100644 --- a/scene/resources/shader.cpp +++ b/scene/resources/shader.cpp @@ -31,7 +31,6 @@ #include "shader.h" #include "core/io/file_access.h" -#include "scene/scene_string_names.h" #include "servers/rendering/shader_language.h" #include "servers/rendering_server.h" #include "texture.h" diff --git a/scene/resources/sprite_frames.cpp b/scene/resources/sprite_frames.cpp index e9adf6755983..137c2ea96c31 100644 --- a/scene/resources/sprite_frames.cpp +++ b/scene/resources/sprite_frames.cpp @@ -30,8 +30,6 @@ #include "sprite_frames.h" -#include "scene/scene_string_names.h" - void SpriteFrames::add_frame(const StringName &p_anim, const Ref &p_frame, int p_at_pos) { Map::Element *E = animations.find(p_anim); ERR_FAIL_COND_MSG(!E, "Animation '" + String(p_anim) + "' doesn't exist."); @@ -149,7 +147,7 @@ bool SpriteFrames::get_animation_loop(const StringName &p_anim) const { void SpriteFrames::_set_frames(const Array &p_frames) { clear_all(); - Map::Element *E = animations.find(SceneStringNames::get_singleton()->_default); + Map::Element *E = animations.find(SNAME("default")); ERR_FAIL_COND(!E); E->get().frames.resize(p_frames.size()); @@ -237,5 +235,5 @@ void SpriteFrames::_bind_methods() { } SpriteFrames::SpriteFrames() { - add_animation(SceneStringNames::get_singleton()->_default); + add_animation(SNAME("default")); } diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 38042d84fd1a..28d4f10cec73 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -30,7 +30,6 @@ #include "texture.h" -#include "core/core_string_names.h" #include "core/io/image_loader.h" #include "core/os/os.h" #include "mesh.h" @@ -1450,11 +1449,11 @@ void CurveTexture::ensure_default_setup(float p_min, float p_max) { void CurveTexture::set_curve(Ref p_curve) { if (_curve != p_curve) { if (_curve.is_valid()) { - _curve->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CurveTexture::_update)); + _curve->disconnect(SNAME("changed"), callable_mp(this, &CurveTexture::_update)); } _curve = p_curve; if (_curve.is_valid()) { - _curve->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CurveTexture::_update)); + _curve->connect(SNAME("changed"), callable_mp(this, &CurveTexture::_update)); } _update(); } @@ -1612,11 +1611,11 @@ void CurveXYZTexture::ensure_default_setup(float p_min, float p_max) { void CurveXYZTexture::set_curve_x(Ref p_curve) { if (_curve_x != p_curve) { if (_curve_x.is_valid()) { - _curve_x->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CurveXYZTexture::_update)); + _curve_x->disconnect(SNAME("changed"), callable_mp(this, &CurveXYZTexture::_update)); } _curve_x = p_curve; if (_curve_x.is_valid()) { - _curve_x->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CurveXYZTexture::_update), varray(), CONNECT_REFERENCE_COUNTED); + _curve_x->connect(SNAME("changed"), callable_mp(this, &CurveXYZTexture::_update), varray(), CONNECT_REFERENCE_COUNTED); } _update(); } @@ -1625,11 +1624,11 @@ void CurveXYZTexture::set_curve_x(Ref p_curve) { void CurveXYZTexture::set_curve_y(Ref p_curve) { if (_curve_y != p_curve) { if (_curve_y.is_valid()) { - _curve_y->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CurveXYZTexture::_update)); + _curve_y->disconnect(SNAME("changed"), callable_mp(this, &CurveXYZTexture::_update)); } _curve_y = p_curve; if (_curve_y.is_valid()) { - _curve_y->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CurveXYZTexture::_update), varray(), CONNECT_REFERENCE_COUNTED); + _curve_y->connect(SNAME("changed"), callable_mp(this, &CurveXYZTexture::_update), varray(), CONNECT_REFERENCE_COUNTED); } _update(); } @@ -1638,11 +1637,11 @@ void CurveXYZTexture::set_curve_y(Ref p_curve) { void CurveXYZTexture::set_curve_z(Ref p_curve) { if (_curve_z != p_curve) { if (_curve_z.is_valid()) { - _curve_z->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CurveXYZTexture::_update)); + _curve_z->disconnect(SNAME("changed"), callable_mp(this, &CurveXYZTexture::_update)); } _curve_z = p_curve; if (_curve_z.is_valid()) { - _curve_z->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CurveXYZTexture::_update), varray(), CONNECT_REFERENCE_COUNTED); + _curve_z->connect(SNAME("changed"), callable_mp(this, &CurveXYZTexture::_update), varray(), CONNECT_REFERENCE_COUNTED); } _update(); } @@ -1770,11 +1769,11 @@ void GradientTexture::set_gradient(Ref p_gradient) { return; } if (gradient.is_valid()) { - gradient->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &GradientTexture::_update)); + gradient->disconnect(SNAME("changed"), callable_mp(this, &GradientTexture::_update)); } gradient = p_gradient; if (gradient.is_valid()) { - gradient->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &GradientTexture::_update)); + gradient->connect(SNAME("changed"), callable_mp(this, &GradientTexture::_update)); } _update(); emit_changed(); diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 737b47ed9549..b25aaa6526c7 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -30,7 +30,6 @@ #include "tile_set.h" -#include "core/core_string_names.h" #include "core/math/geometry_2d.h" #include "core/templates/local_vector.h" @@ -139,7 +138,7 @@ int TileSet::add_source(Ref p_tile_set_source, int p_atlas_source p_tile_set_source->set_tile_set(this); _compute_next_source_id(); - sources[new_source_id]->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &TileSet::_source_changed)); + sources[new_source_id]->connect(SNAME("changed"), callable_mp(this, &TileSet::_source_changed)); emit_changed(); @@ -149,7 +148,7 @@ int TileSet::add_source(Ref p_tile_set_source, int p_atlas_source void TileSet::remove_source(int p_source_id) { ERR_FAIL_COND_MSG(!sources.has(p_source_id), vformat("Cannot remove TileSet atlas source. No tileset atlas source with id %d.", p_source_id)); - sources[p_source_id]->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &TileSet::_source_changed)); + sources[p_source_id]->disconnect(SNAME("changed"), callable_mp(this, &TileSet::_source_changed)); sources[p_source_id]->set_tile_set(nullptr); sources.erase(p_source_id); diff --git a/scene/resources/world_3d.cpp b/scene/resources/world_3d.cpp index 42047f104f95..9b973095c1d1 100644 --- a/scene/resources/world_3d.cpp +++ b/scene/resources/world_3d.cpp @@ -34,7 +34,6 @@ #include "core/math/octree.h" #include "scene/3d/camera_3d.h" #include "scene/3d/visible_on_screen_notifier_3d.h" -#include "scene/scene_string_names.h" #include "servers/navigation_server_3d.h" void World3D::_register_camera(Camera3D *p_camera) { diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp deleted file mode 100644 index b8173c962345..000000000000 --- a/scene/scene_string_names.cpp +++ /dev/null @@ -1,215 +0,0 @@ -/*************************************************************************/ -/* scene_string_names.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#include "scene_string_names.h" - -SceneStringNames *SceneStringNames::singleton = nullptr; - -SceneStringNames::SceneStringNames() { - _estimate_cost = StaticCString::create("_estimate_cost"); - _compute_cost = StaticCString::create("_compute_cost"); - - resized = StaticCString::create("resized"); - dot = StaticCString::create("."); - doubledot = StaticCString::create(".."); - draw = StaticCString::create("draw"); - _draw = StaticCString::create("_draw"); - hidden = StaticCString::create("hidden"); - visibility_changed = StaticCString::create("visibility_changed"); - input_event = StaticCString::create("input_event"); - shader = StaticCString::create("shader"); - shader_unshaded = StaticCString::create("shader/unshaded"); - shading_mode = StaticCString::create("shader/shading_mode"); - tree_entered = StaticCString::create("tree_entered"); - tree_exiting = StaticCString::create("tree_exiting"); - tree_exited = StaticCString::create("tree_exited"); - ready = StaticCString::create("ready"); - item_rect_changed = StaticCString::create("item_rect_changed"); - size_flags_changed = StaticCString::create("size_flags_changed"); - minimum_size_changed = StaticCString::create("minimum_size_changed"); - sleeping_state_changed = StaticCString::create("sleeping_state_changed"); - - finished = StaticCString::create("finished"); - emission_finished = StaticCString::create("emission_finished"); - animation_finished = StaticCString::create("animation_finished"); - animation_changed = StaticCString::create("animation_changed"); - animation_started = StaticCString::create("animation_started"); - - pose_updated = StaticCString::create("pose_updated"); - - mouse_entered = StaticCString::create("mouse_entered"); - mouse_exited = StaticCString::create("mouse_exited"); - mouse_shape_entered = StaticCString::create("mouse_shape_entered"); - mouse_shape_exited = StaticCString::create("mouse_shape_exited"); - - focus_entered = StaticCString::create("focus_entered"); - focus_exited = StaticCString::create("focus_exited"); - - sort_children = StaticCString::create("sort_children"); - - body_shape_entered = StaticCString::create("body_shape_entered"); - body_entered = StaticCString::create("body_entered"); - body_shape_exited = StaticCString::create("body_shape_exited"); - body_exited = StaticCString::create("body_exited"); - - area_shape_entered = StaticCString::create("area_shape_entered"); - area_shape_exited = StaticCString::create("area_shape_exited"); - - _body_inout = StaticCString::create("_body_inout"); - _area_inout = StaticCString::create("_area_inout"); - - idle = StaticCString::create("idle"); - iteration = StaticCString::create("iteration"); - update = StaticCString::create("update"); - updated = StaticCString::create("updated"); - - _get_gizmo_geometry = StaticCString::create("_get_gizmo_geometry"); - _can_gizmo_scale = StaticCString::create("_can_gizmo_scale"); - - _physics_process = StaticCString::create("_physics_process"); - _process = StaticCString::create("_process"); - - _enter_tree = StaticCString::create("_enter_tree"); - _exit_tree = StaticCString::create("_exit_tree"); - _enter_world = StaticCString::create("_enter_world"); - _exit_world = StaticCString::create("_exit_world"); - _ready = StaticCString::create("_ready"); - - _update_scroll = StaticCString::create("_update_scroll"); - _update_xform = StaticCString::create("_update_xform"); - - _structured_text_parser = StaticCString::create("_structured_text_parser"); - - _proxgroup_add = StaticCString::create("_proxgroup_add"); - _proxgroup_remove = StaticCString::create("_proxgroup_remove"); - - grouped = StaticCString::create("grouped"); - ungrouped = StaticCString::create("ungrouped"); - - screen_entered = StaticCString::create("screen_entered"); - screen_exited = StaticCString::create("screen_exited"); - - viewport_entered = StaticCString::create("viewport_entered"); - viewport_exited = StaticCString::create("viewport_exited"); - - camera_entered = StaticCString::create("camera_entered"); - camera_exited = StaticCString::create("camera_exited"); - - _input = StaticCString::create("_input"); - _input_event = StaticCString::create("_input_event"); - - gui_input = StaticCString::create("gui_input"); - _gui_input = StaticCString::create("_gui_input"); - - _unhandled_input = StaticCString::create("_unhandled_input"); - _unhandled_key_input = StaticCString::create("_unhandled_key_input"); - - changed = StaticCString::create("changed"); - _shader_changed = StaticCString::create("_shader_changed"); - - _spatial_editor_group = StaticCString::create("_spatial_editor_group"); - _request_gizmo = StaticCString::create("_request_gizmo"); - _clear_subgizmo_selection = StaticCString::create("_clear_subgizmo_selection"); - - offset = StaticCString::create("offset"); - unit_offset = StaticCString::create("unit_offset"); - rotation_mode = StaticCString::create("rotation_mode"); - rotate = StaticCString::create("rotate"); - h_offset = StaticCString::create("h_offset"); - v_offset = StaticCString::create("v_offset"); - - transform_pos = StaticCString::create("position"); - transform_rot = StaticCString::create("rotation"); - transform_scale = StaticCString::create("scale"); - - _update_remote = StaticCString::create("_update_remote"); - _update_pairs = StaticCString::create("_update_pairs"); - - _get_minimum_size = StaticCString::create("_get_minimum_size"); - - area_entered = StaticCString::create("area_entered"); - area_exited = StaticCString::create("area_exited"); - - _has_point = StaticCString::create("_has_point"); - - line_separation = StaticCString::create("line_separation"); - - _get_drag_data = StaticCString::create("_get_drag_data"); - _drop_data = StaticCString::create("_drop_data"); - _can_drop_data = StaticCString::create("_can_drop_data"); - - _im_update = StaticCString::create("_im_update"); // Sprite3D - - baked_light_changed = StaticCString::create("baked_light_changed"); - _baked_light_changed = StaticCString::create("_baked_light_changed"); - - _mouse_enter = StaticCString::create("_mouse_enter"); - _mouse_exit = StaticCString::create("_mouse_exit"); - _mouse_shape_enter = StaticCString::create("_mouse_shape_enter"); - _mouse_shape_exit = StaticCString::create("_mouse_shape_exit"); - - _pressed = StaticCString::create("_pressed"); - _toggled = StaticCString::create("_toggled"); - - frame_changed = StaticCString::create("frame_changed"); - texture_changed = StaticCString::create("texture_changed"); - - playback_speed = StaticCString::create("playback/speed"); - playback_active = StaticCString::create("playback/active"); - autoplay = StaticCString::create("autoplay"); - blend_times = StaticCString::create("blend_times"); - speed = StaticCString::create("speed"); - - node_configuration_warning_changed = StaticCString::create("node_configuration_warning_changed"); - - output = StaticCString::create("output"); - - path_pp = NodePath(".."); - - _default = StaticCString::create("default"); - - _window_group = StaticCString::create("_window_group"); - _window_input = StaticCString::create("_window_input"); - window_input = StaticCString::create("window_input"); - _window_unhandled_input = StaticCString::create("_window_unhandled_input"); - - theme_changed = StaticCString::create("theme_changed"); - parameters_base_path = "parameters/"; - - tracks_changed = "tracks_changed"; - - shader_overrides_group = StaticCString::create("_shader_overrides_group_"); - shader_overrides_group_active = StaticCString::create("_shader_overrides_group_active_"); - -#ifndef DISABLE_DEPRECATED - use_in_baked_light = StaticCString::create("use_in_baked_light"); - use_dynamic_gi = StaticCString::create("use_dynamic_gi"); -#endif -} diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h deleted file mode 100644 index eddb0c33eb49..000000000000 --- a/scene/scene_string_names.h +++ /dev/null @@ -1,226 +0,0 @@ -/*************************************************************************/ -/* scene_string_names.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#ifndef SCENE_STRING_NAMES_H -#define SCENE_STRING_NAMES_H - -#include "core/string/node_path.h" -#include "core/string/string_name.h" - -class SceneStringNames { - friend void register_scene_types(); - friend void unregister_scene_types(); - - static SceneStringNames *singleton; - - static void create() { singleton = memnew(SceneStringNames); } - static void free() { - memdelete(singleton); - singleton = nullptr; - } - - SceneStringNames(); - -public: - _FORCE_INLINE_ static SceneStringNames *get_singleton() { return singleton; } - - StringName _estimate_cost; - StringName _compute_cost; - - StringName resized; - StringName dot; - StringName doubledot; - StringName draw; - StringName hidden; - StringName visibility_changed; - StringName input_event; - StringName _input_event; - StringName gui_input; - StringName _gui_input; - StringName item_rect_changed; - StringName shader; - StringName shader_unshaded; - StringName shading_mode; - StringName tree_entered; - StringName tree_exiting; - StringName tree_exited; - StringName ready; - StringName size_flags_changed; - StringName minimum_size_changed; - StringName sleeping_state_changed; - StringName idle; - StringName iteration; - StringName update; - StringName updated; - - StringName line_separation; - - StringName mouse_entered; - StringName mouse_exited; - StringName mouse_shape_entered; - StringName mouse_shape_exited; - StringName focus_entered; - StringName focus_exited; - - StringName sort_children; - - StringName finished; - StringName emission_finished; - StringName animation_finished; - StringName animation_changed; - StringName animation_started; - - StringName pose_updated; - - StringName body_shape_entered; - StringName body_entered; - StringName body_shape_exited; - StringName body_exited; - - StringName area_shape_entered; - StringName area_shape_exited; - - StringName _body_inout; - StringName _area_inout; - - StringName _get_gizmo_geometry; - StringName _can_gizmo_scale; - - StringName _physics_process; - StringName _process; - StringName _enter_world; - StringName _exit_world; - StringName _enter_tree; - StringName _exit_tree; - StringName _draw; - StringName _input; - StringName _ready; - StringName _unhandled_input; - StringName _unhandled_key_input; - - StringName _pressed; - StringName _toggled; - - StringName _update_scroll; - StringName _update_xform; - - StringName _structured_text_parser; - - StringName _proxgroup_add; - StringName _proxgroup_remove; - - StringName grouped; - StringName ungrouped; - - StringName _has_point; - StringName _get_drag_data; - StringName _can_drop_data; - StringName _drop_data; - - StringName screen_entered; - StringName screen_exited; - StringName viewport_entered; - StringName viewport_exited; - StringName camera_entered; - StringName camera_exited; - - StringName changed; - StringName _shader_changed; - - StringName _spatial_editor_group; - StringName _request_gizmo; - StringName _clear_subgizmo_selection; - - StringName offset; - StringName unit_offset; - StringName rotation_mode; - StringName rotate; - StringName v_offset; - StringName h_offset; - - StringName transform_pos; - StringName transform_rot; - StringName transform_scale; - - StringName _update_remote; - StringName _update_pairs; - - StringName area_entered; - StringName area_exited; - - StringName _get_minimum_size; - - StringName _im_update; - - StringName baked_light_changed; - StringName _baked_light_changed; - - StringName _mouse_enter; - StringName _mouse_exit; - StringName _mouse_shape_enter; - StringName _mouse_shape_exit; - - StringName frame_changed; - StringName texture_changed; - - StringName playback_speed; - StringName playback_active; - StringName autoplay; - StringName blend_times; - StringName speed; - - NodePath path_pp; - - StringName _default; - - StringName node_configuration_warning_changed; - - StringName output; - - StringName parameters_base_path; - - StringName tracks_changed; - - StringName _window_group; - StringName _window_input; - StringName _window_unhandled_input; - StringName window_input; - - StringName theme_changed; - StringName shader_overrides_group; - StringName shader_overrides_group_active; - -#ifndef DISABLE_DEPRECATED - StringName use_in_baked_light; - StringName use_dynamic_gi; -#endif -}; - -#endif // SCENE_STRING_NAMES_H diff --git a/tests/test_object.h b/tests/test_object.h index a18adf31b620..a8ba889bfc3e 100644 --- a/tests/test_object.h +++ b/tests/test_object.h @@ -31,7 +31,6 @@ #ifndef TEST_OBJECT_H #define TEST_OBJECT_H -#include "core/core_string_names.h" #include "core/object/object.h" #include "thirdparty/doctest/doctest.h" @@ -235,7 +234,7 @@ TEST_CASE("[Object] Script property setter") { Variant script; bool valid = false; - object.set(CoreStringNames::get_singleton()->_script, script, &valid); + object.set(SNAME("script"), script, &valid); CHECK(valid); CHECK_MESSAGE( object.get_script() == script, @@ -248,7 +247,7 @@ TEST_CASE("[Object] Script property getter") { object.set_script(script); bool valid = false; - const Variant &actual_value = object.get(CoreStringNames::get_singleton()->_script, &valid); + const Variant &actual_value = object.get(SNAME("script"), &valid); CHECK(valid); CHECK_MESSAGE( actual_value == script,