Add shorthand for using singleton string names

This commit is contained in:
kobewi 2023-09-04 17:01:33 +02:00
parent 916ea002c1
commit a262d2d881
77 changed files with 382 additions and 380 deletions

View file

@ -291,7 +291,7 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) {
}
}
} else {
if (p_name == CoreStringNames::get_singleton()->_custom_features) {
if (p_name == CoreStringName(_custom_features)) {
Vector<String> custom_feature_array = String(p_value).split(",");
for (int i = 0; i < custom_feature_array.size(); i++) {
custom_features.insert(custom_feature_array[i]);
@ -875,7 +875,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const RBMap<S
if (!p_custom_features.is_empty()) {
// Store how many properties are saved, add one for custom features, which must always go first.
file->store_32(count + 1);
String key = CoreStringNames::get_singleton()->_custom_features;
String key = CoreStringName(_custom_features);
file->store_pascal_string(key);
int len;

View file

@ -33,12 +33,10 @@
CoreStringNames *CoreStringNames::singleton = nullptr;
CoreStringNames::CoreStringNames() :
_free(StaticCString::create("free")),
free_(StaticCString::create("free")),
changed(StaticCString::create("changed")),
_script(StaticCString::create("script")),
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")),

View file

@ -50,12 +50,10 @@ public:
static CoreStringNames *singleton;
StringName _free;
StringName free_; // "free", conflict with C++ keyword.
StringName changed;
StringName _script;
StringName script;
StringName script_changed;
StringName ___pdcdata;
StringName __getvar;
StringName _iter_init;
StringName _iter_next;
StringName _iter_get;
@ -98,4 +96,6 @@ public:
StringName property_list_changed;
};
#define CoreStringName(m_name) CoreStringNames::get_singleton()->m_name
#endif // CORE_STRING_NAMES_H

View file

@ -1696,7 +1696,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
Variant value;
if (E.name == CoreStringNames::get_singleton()->_script) {
if (E.name == CoreStringName(script)) {
Ref<Script> script = obj->get_script();
if (script.is_valid()) {
String path = script->get_path();

View file

@ -43,9 +43,9 @@
void Resource::emit_changed() {
if (ResourceLoader::is_within_load() && !Thread::is_main_thread()) {
// Let the connection happen on the main thread, later, since signals are not thread-safe.
call_deferred("emit_signal", CoreStringNames::get_singleton()->changed);
call_deferred("emit_signal", CoreStringName(changed));
} else {
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
}
@ -172,8 +172,8 @@ void Resource::connect_changed(const Callable &p_callable, uint32_t p_flags) {
callable_mp(this, &Resource::connect_changed).call_deferred(p_callable, p_flags);
return;
}
if (!is_connected(CoreStringNames::get_singleton()->changed, p_callable) || p_flags & CONNECT_REFERENCE_COUNTED) {
connect(CoreStringNames::get_singleton()->changed, p_callable, p_flags);
if (!is_connected(CoreStringName(changed), p_callable) || p_flags & CONNECT_REFERENCE_COUNTED) {
connect(CoreStringName(changed), p_callable, p_flags);
}
}
@ -183,8 +183,8 @@ void Resource::disconnect_changed(const Callable &p_callable) {
callable_mp(this, &Resource::disconnect_changed).call_deferred(p_callable);
return;
}
if (is_connected(CoreStringNames::get_singleton()->changed, p_callable)) {
disconnect(CoreStringNames::get_singleton()->changed, p_callable);
if (is_connected(CoreStringName(changed), p_callable)) {
disconnect(CoreStringName(changed), p_callable);
}
}

View file

@ -1554,7 +1554,7 @@ bool ClassDB::get_property(Object *p_object, const StringName &p_property, Varia
}
// The "free()" method is special, so we assume it exists and return a Callable.
if (p_property == CoreStringNames::get_singleton()->_free) {
if (p_property == CoreStringName(free_)) {
r_value = Callable(p_object, p_property);
return true;
}

View file

@ -197,7 +197,7 @@ Error CallQueue::push_notification(ObjectID p_id, int p_notification) {
Message *msg = memnew_placement(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, CoreStringName(notification)); //name is meaningless but callable needs it
//msg->target;
msg->notification = p_notification;

View file

@ -260,7 +260,7 @@ void Object::set(const StringName &p_name, const Variant &p_value, bool *r_valid
}
}
if (p_name == CoreStringNames::get_singleton()->_script) {
if (p_name == CoreStringName(script)) {
set_script(p_value);
if (r_valid) {
*r_valid = true;
@ -351,7 +351,7 @@ Variant Object::get(const StringName &p_name, bool *r_valid) const {
}
}
if (p_name == CoreStringNames::get_singleton()->_script) {
if (p_name == CoreStringName(script)) {
ret = get_script();
if (r_valid) {
*r_valid = true;
@ -672,7 +672,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 == CoreStringName(free_)) {
return true;
}
@ -698,7 +698,7 @@ int Object::_get_method_argument_count_bind(const StringName &p_method) const {
}
int Object::get_method_argument_count(const StringName &p_method, bool *r_is_valid) const {
if (p_method == CoreStringNames::get_singleton()->_free) {
if (p_method == CoreStringName(free_)) {
if (r_is_valid) {
*r_is_valid = true;
}
@ -787,7 +787,7 @@ Variant Object::callv(const StringName &p_method, const Array &p_args) {
Variant Object::callp(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 == CoreStringName(free_)) {
//free must be here, before anything, always ready
#ifdef DEBUG_ENABLED
if (p_argcount != 0) {
@ -850,7 +850,7 @@ Variant Object::callp(const StringName &p_method, const Variant **p_args, int p_
Variant Object::call_const(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 == CoreStringName(free_)) {
// Free is not const, so fail.
r_error.error = Callable::CallError::CALL_ERROR_METHOD_NOT_CONST;
return Variant();
@ -979,7 +979,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(CoreStringName(script_changed));
}
void Object::set_script_instance(ScriptInstance *p_instance) {
@ -1654,7 +1654,7 @@ void Object::clear_internal_resource_paths() {
}
void Object::notify_property_list_changed() {
emit_signal(CoreStringNames::get_singleton()->property_list_changed);
emit_signal(CoreStringName(property_list_changed));
}
void Object::_bind_methods() {

View file

@ -2121,7 +2121,7 @@ Variant::operator ::RID() const {
}
#endif
Callable::CallError ce;
Variant ret = _get_obj().obj->callp(CoreStringNames::get_singleton()->get_rid, nullptr, 0, ce);
Variant ret = _get_obj().obj->callp(CoreStringName(get_rid), nullptr, 0, ce);
if (ce.error == Callable::CallError::CALL_OK && ret.get_type() == Variant::RID) {
return ret;
}

View file

@ -1384,7 +1384,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->callp(CoreStringNames::get_singleton()->_iter_init, refp, 1, ce);
Variant ret = _get_obj().obj->callp(CoreStringName(_iter_init), refp, 1, ce);
if (ref.size() != 1 || ce.error != Callable::CallError::CALL_OK) {
valid = false;
@ -1619,7 +1619,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->callp(CoreStringNames::get_singleton()->_iter_next, refp, 1, ce);
Variant ret = _get_obj().obj->callp(CoreStringName(_iter_next), refp, 1, ce);
if (ref.size() != 1 || ce.error != Callable::CallError::CALL_OK) {
valid = false;
@ -1811,7 +1811,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->callp(CoreStringNames::get_singleton()->_iter_get, refp, 1, ce);
Variant ret = _get_obj().obj->callp(CoreStringName(_iter_get), refp, 1, ce);
if (ce.error != Callable::CallError::CALL_OK) {
r_valid = false;

View file

@ -547,8 +547,8 @@ ActionMapEditor::ActionMapEditor() {
action_list_search_by_event->set_h_size_flags(Control::SIZE_EXPAND_FILL);
action_list_search_by_event->set_stretch_ratio(0.75);
action_list_search_by_event->connect("event_changed", callable_mp(this, &ActionMapEditor::_search_by_event));
action_list_search_by_event->connect(SceneStringNames::get_singleton()->focus_entered, callable_mp(this, &ActionMapEditor::_on_filter_focused));
action_list_search_by_event->connect(SceneStringNames::get_singleton()->focus_exited, callable_mp(this, &ActionMapEditor::_on_filter_unfocused));
action_list_search_by_event->connect(SceneStringName(focus_entered), callable_mp(this, &ActionMapEditor::_on_filter_focused));
action_list_search_by_event->connect(SceneStringName(focus_exited), callable_mp(this, &ActionMapEditor::_on_filter_unfocused));
top_hbox->add_child(action_list_search_by_event);
Button *clear_all_search = memnew(Button);

View file

@ -2932,7 +2932,7 @@ void AnimationTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
}
if (selected || editor->is_selection_active()) {
AnimationPlayer *player = AnimationPlayerEditor::get_singleton()->get_player();
if (!player->has_animation(SceneStringNames::get_singleton()->RESET) || animation != player->get_animation(SceneStringNames::get_singleton()->RESET)) {
if (!player->has_animation(SceneStringName(RESET)) || animation != player->get_animation(SceneStringName(RESET))) {
menu->add_icon_item(get_editor_theme_icon(SNAME("Reload")), TTR("Add RESET Value(s)"), MENU_KEY_ADD_RESET);
}
@ -3691,8 +3691,8 @@ void AnimationTrackEditor::_animation_track_remove_request(int p_track, Ref<Anim
// Remove corresponding reset tracks if they are no longer needed.
AnimationPlayer *player = AnimationPlayerEditor::get_singleton()->get_player();
if (player->has_animation(SceneStringNames::get_singleton()->RESET)) {
Ref<Animation> reset = player->get_animation(SceneStringNames::get_singleton()->RESET);
if (player->has_animation(SceneStringName(RESET))) {
Ref<Animation> reset = player->get_animation(SceneStringName(RESET));
if (reset != p_from_animation) {
for (int i = 0; i < reset->get_track_count(); i++) {
if (reset->track_get_path(i) == p_from_animation->track_get_path(p_track)) {
@ -3798,7 +3798,7 @@ void AnimationTrackEditor::make_insert_queue() {
void AnimationTrackEditor::commit_insert_queue() {
bool reset_allowed = true;
AnimationPlayer *player = AnimationPlayerEditor::get_singleton()->get_player();
if (player->has_animation(SceneStringNames::get_singleton()->RESET) && player->get_animation(SceneStringNames::get_singleton()->RESET) == animation) {
if (player->has_animation(SceneStringName(RESET)) && player->get_animation(SceneStringName(RESET)) == animation) {
// Avoid messing with the reset animation itself.
reset_allowed = false;
} else {
@ -4207,8 +4207,8 @@ void AnimationTrackEditor::insert_value_key(const String &p_property, const Vari
Ref<Animation> AnimationTrackEditor::_create_and_get_reset_animation() {
AnimationPlayer *player = AnimationPlayerEditor::get_singleton()->get_player();
if (player->has_animation(SceneStringNames::get_singleton()->RESET)) {
return player->get_animation(SceneStringNames::get_singleton()->RESET);
if (player->has_animation(SceneStringName(RESET))) {
return player->get_animation(SceneStringName(RESET));
} else {
Ref<AnimationLibrary> al;
AnimationMixer *mixer = AnimationPlayerEditor::get_singleton()->fetch_mixer_for_library();
@ -4224,9 +4224,9 @@ Ref<Animation> AnimationTrackEditor::_create_and_get_reset_animation() {
reset_anim.instantiate();
reset_anim->set_length(ANIM_MIN_LENGTH);
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->add_do_method(al.ptr(), "add_animation", SceneStringNames::get_singleton()->RESET, reset_anim);
undo_redo->add_do_method(al.ptr(), "add_animation", SceneStringName(RESET), reset_anim);
undo_redo->add_do_method(AnimationPlayerEditor::get_singleton(), "_animation_player_changed", player);
undo_redo->add_undo_method(al.ptr(), "remove_animation", SceneStringNames::get_singleton()->RESET);
undo_redo->add_undo_method(al.ptr(), "remove_animation", SceneStringName(RESET));
undo_redo->add_undo_method(AnimationPlayerEditor::get_singleton(), "_animation_player_changed", player);
return reset_anim;
}
@ -5024,8 +5024,8 @@ void AnimationTrackEditor::_add_track(int p_type) {
void AnimationTrackEditor::_fetch_value_track_options(const NodePath &p_path, Animation::UpdateMode *r_update_mode, Animation::InterpolationType *r_interpolation_type, bool *r_loop_wrap) {
AnimationPlayer *player = AnimationPlayerEditor::get_singleton()->get_player();
if (player->has_animation(SceneStringNames::get_singleton()->RESET)) {
Ref<Animation> reset_anim = player->get_animation(SceneStringNames::get_singleton()->RESET);
if (player->has_animation(SceneStringName(RESET))) {
Ref<Animation> reset_anim = player->get_animation(SceneStringName(RESET));
int rt = reset_anim->find_track(p_path, Animation::TrackType::TYPE_VALUE);
if (rt >= 0) {
*r_update_mode = reset_anim->value_track_get_update_mode(rt);

View file

@ -3141,7 +3141,7 @@ void EditorPropertyResource::_resource_changed(const Ref<Resource> &p_resource)
// Changing the value of Script-type exported variables of the main script should not trigger saving/reloading properties.
bool is_script = false;
Ref<Script> s = p_resource;
if (get_edited_object() && s.is_valid() && get_edited_property() == CoreStringNames::get_singleton()->_script) {
if (get_edited_object() && s.is_valid() && get_edited_property() == CoreStringName(script)) {
is_script = true;
InspectorDock::get_singleton()->store_script_properties(get_edited_object());
s->call("set_instance_base_type", get_edited_object()->get_class());

View file

@ -984,12 +984,12 @@ void AnimationPlayerEditor::_update_animation_list_icons() {
Ref<Texture2D> icon;
if (anim_name == player->get_autoplay()) {
if (anim_name == SceneStringNames::get_singleton()->RESET) {
if (anim_name == SceneStringName(RESET)) {
icon = autoplay_reset_icon;
} else {
icon = autoplay_icon;
}
} else if (anim_name == SceneStringNames::get_singleton()->RESET) {
} else if (anim_name == SceneStringName(RESET)) {
icon = reset_icon;
}
@ -1459,7 +1459,7 @@ void AnimationPlayerEditor::_onion_skinning_menu(int p_option) {
onion.enabled = !onion.enabled;
if (onion.enabled) {
if (get_player() && !get_player()->has_animation(SceneStringNames::get_singleton()->RESET)) {
if (get_player() && !get_player()->has_animation(SceneStringName(RESET))) {
EditorNode::get_singleton()->show_warning(TTR("Onion skinning requires a RESET animation."));
}
_start_onion_skinning(); // It will check for RESET animation anyway.
@ -1592,7 +1592,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_1() {
return;
}
if (!onion.enabled || !is_visible() || !get_player() || !get_player()->has_animation(SceneStringNames::get_singleton()->RESET)) {
if (!onion.enabled || !is_visible() || !get_player() || !get_player()->has_animation(SceneStringName(RESET))) {
_stop_onion_skinning();
return;
}
@ -1783,7 +1783,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_2_epilog() {
}
void AnimationPlayerEditor::_start_onion_skinning() {
if (get_player() && !get_player()->has_animation(SceneStringNames::get_singleton()->RESET)) {
if (get_player() && !get_player()->has_animation(SceneStringName(RESET))) {
onion.enabled = false;
onion_toggle->set_pressed_no_signal(false);
return;

View file

@ -119,7 +119,7 @@ String AnimationNodeStateMachineEditor::_get_root_playback_path(String &r_node_d
if (node_directory_path.size()) {
r_node_directory += "/";
}
base_path = !edited_path.size() ? String(SceneStringNames::get_singleton()->parameters_base_path) + "playback" : String(SceneStringNames::get_singleton()->parameters_base_path) + base_path + "/playback";
base_path = !edited_path.size() ? String(SceneStringName(parameters_base_path)) + "playback" : String(SceneStringName(parameters_base_path)) + base_path + "/playback";
} else {
// Hmmm, we have to return Grouped state machine playback...
// It will give the user the error that Root/Nested state machine should be retrieved, that would be kind :-)

View file

@ -221,7 +221,7 @@ void AnimationTreeEditor::remove_plugin(AnimationTreeNodeEditorPlugin *p_editor)
}
String AnimationTreeEditor::get_base_path() {
String path = SceneStringNames::get_singleton()->parameters_base_path;
String path = SceneStringName(parameters_base_path);
for (int i = 0; i < edited_path.size(); i++) {
path += edited_path[i] + "/";
}

View file

@ -387,7 +387,7 @@ void CollisionShape2DEditor::_shape_changed() {
canvas_item_editor->update_viewport();
if (current_shape.is_valid()) {
current_shape->disconnect(SceneStringNames::get_singleton()->changed, callable_mp(canvas_item_editor, &CanvasItemEditor::update_viewport));
current_shape->disconnect_changed(callable_mp(canvas_item_editor, &CanvasItemEditor::update_viewport));
current_shape = Ref<Shape2D>();
shape_type = -1;
}
@ -399,7 +399,7 @@ void CollisionShape2DEditor::_shape_changed() {
current_shape = node->get_shape();
if (current_shape.is_valid()) {
current_shape->connect(SceneStringNames::get_singleton()->changed, callable_mp(canvas_item_editor, &CanvasItemEditor::update_viewport));
current_shape->connect_changed(callable_mp(canvas_item_editor, &CanvasItemEditor::update_viewport));
} else {
return;
}

View file

@ -172,14 +172,14 @@ void MeshInstance3DEditor::_create_collision_shape() {
ur->add_do_method(instance, "add_child", body, true);
ur->add_do_method(body, "set_owner", owner);
ur->add_do_method(Node3DEditor::get_singleton(), SceneStringNames::get_singleton()->_request_gizmo, body);
ur->add_do_method(Node3DEditor::get_singleton(), SceneStringName(_request_gizmo), body);
for (Ref<Shape3D> shape : shapes) {
CollisionShape3D *cshape = memnew(CollisionShape3D);
cshape->set_shape(shape);
body->add_child(cshape, true);
ur->add_do_method(cshape, "set_owner", owner);
ur->add_do_method(Node3DEditor::get_singleton(), SceneStringNames::get_singleton()->_request_gizmo, cshape);
ur->add_do_method(Node3DEditor::get_singleton(), SceneStringName(_request_gizmo), cshape);
}
ur->add_do_reference(body);
ur->add_undo_method(instance, "remove_child", body);
@ -191,7 +191,7 @@ void MeshInstance3DEditor::_create_collision_shape() {
cshape->set_transform(node->get_transform());
ur->add_do_method(E, "add_sibling", cshape, true);
ur->add_do_method(cshape, "set_owner", owner);
ur->add_do_method(Node3DEditor::get_singleton(), SceneStringNames::get_singleton()->_request_gizmo, cshape);
ur->add_do_method(Node3DEditor::get_singleton(), SceneStringName(_request_gizmo), cshape);
ur->add_do_reference(cshape);
ur->add_undo_method(node->get_parent(), "remove_child", cshape);
}
@ -232,7 +232,7 @@ void MeshInstance3DEditor::_menu_option(int p_option) {
ur->add_do_method(node, "add_child", nmi, true);
ur->add_do_method(nmi, "set_owner", owner);
ur->add_do_method(Node3DEditor::get_singleton(), SceneStringNames::get_singleton()->_request_gizmo, nmi);
ur->add_do_method(Node3DEditor::get_singleton(), SceneStringName(_request_gizmo), nmi);
ur->add_do_reference(nmi);
ur->add_undo_method(node, "remove_child", nmi);
@ -509,7 +509,7 @@ void MeshInstance3DEditor::_create_outline_mesh() {
ur->add_do_method(node, "add_child", mi, true);
ur->add_do_method(mi, "set_owner", owner);
ur->add_do_method(Node3DEditor::get_singleton(), SceneStringNames::get_singleton()->_request_gizmo, mi);
ur->add_do_method(Node3DEditor::get_singleton(), SceneStringName(_request_gizmo), mi);
ur->add_do_reference(mi);
ur->add_undo_method(node, "remove_child", mi);

View file

@ -973,7 +973,7 @@ void ScriptEditor::_queue_close_tabs() {
// Maybe there are unsaved changes.
if (se->is_unsaved()) {
_ask_close_current_unsaved_tab(se);
erase_tab_confirm->connect(SceneStringNames::get_singleton()->visibility_changed, callable_mp(this, &ScriptEditor::_queue_close_tabs), CONNECT_ONE_SHOT);
erase_tab_confirm->connect(SceneStringName(visibility_changed), callable_mp(this, &ScriptEditor::_queue_close_tabs), CONNECT_ONE_SHOT);
break;
}
}
@ -4238,7 +4238,7 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
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(SceneStringName(tree_entered), callable_mp(this, &ScriptEditor::_update_autosave_timer));
autosave_timer->connect("timeout", callable_mp(this, &ScriptEditor::_autosave_scripts));
add_child(autosave_timer);

View file

@ -410,8 +410,8 @@ void Skeleton3DEditor::create_physical_skeleton() {
ur->add_do_method(physical_bone, "set_joint_type", PhysicalBone3D::JOINT_TYPE_PIN);
}
ur->add_do_method(Node3DEditor::get_singleton(), SceneStringNames::get_singleton()->_request_gizmo, physical_bone);
ur->add_do_method(Node3DEditor::get_singleton(), SceneStringNames::get_singleton()->_request_gizmo, collision_shape);
ur->add_do_method(Node3DEditor::get_singleton(), SceneStringName(_request_gizmo), physical_bone);
ur->add_do_method(Node3DEditor::get_singleton(), SceneStringName(_request_gizmo), collision_shape);
ur->add_do_reference(physical_bone);
ur->add_undo_method(simulator, "remove_child", physical_bone);
@ -842,10 +842,10 @@ void Skeleton3DEditor::_notification(int p_what) {
joint_tree->connect("item_selected", callable_mp(this, &Skeleton3DEditor::_joint_tree_selection_changed));
joint_tree->connect("item_mouse_selected", callable_mp(this, &Skeleton3DEditor::_joint_tree_rmb_select));
#ifdef TOOLS_ENABLED
skeleton->connect(SceneStringNames::get_singleton()->pose_updated, callable_mp(this, &Skeleton3DEditor::_draw_gizmo));
skeleton->connect(SceneStringNames::get_singleton()->pose_updated, callable_mp(this, &Skeleton3DEditor::_update_properties));
skeleton->connect(SceneStringNames::get_singleton()->bone_enabled_changed, callable_mp(this, &Skeleton3DEditor::_bone_enabled_changed));
skeleton->connect(SceneStringNames::get_singleton()->show_rest_only_changed, callable_mp(this, &Skeleton3DEditor::_update_gizmo_visible));
skeleton->connect(SceneStringName(pose_updated), callable_mp(this, &Skeleton3DEditor::_draw_gizmo));
skeleton->connect(SceneStringName(pose_updated), callable_mp(this, &Skeleton3DEditor::_update_properties));
skeleton->connect(SceneStringName(bone_enabled_changed), callable_mp(this, &Skeleton3DEditor::_bone_enabled_changed));
skeleton->connect(SceneStringName(show_rest_only_changed), callable_mp(this, &Skeleton3DEditor::_update_gizmo_visible));
#endif
get_tree()->connect("node_removed", callable_mp(this, &Skeleton3DEditor::_node_removed), Object::CONNECT_ONE_SHOT);
@ -870,10 +870,10 @@ void Skeleton3DEditor::_notification(int p_what) {
if (skeleton) {
select_bone(-1); // Requires that the joint_tree has not been deleted.
#ifdef TOOLS_ENABLED
skeleton->disconnect(SceneStringNames::get_singleton()->show_rest_only_changed, callable_mp(this, &Skeleton3DEditor::_update_gizmo_visible));
skeleton->disconnect(SceneStringNames::get_singleton()->bone_enabled_changed, callable_mp(this, &Skeleton3DEditor::_bone_enabled_changed));
skeleton->disconnect(SceneStringNames::get_singleton()->pose_updated, callable_mp(this, &Skeleton3DEditor::_draw_gizmo));
skeleton->disconnect(SceneStringNames::get_singleton()->pose_updated, callable_mp(this, &Skeleton3DEditor::_update_properties));
skeleton->disconnect(SceneStringName(show_rest_only_changed), callable_mp(this, &Skeleton3DEditor::_update_gizmo_visible));
skeleton->disconnect(SceneStringName(bone_enabled_changed), callable_mp(this, &Skeleton3DEditor::_bone_enabled_changed));
skeleton->disconnect(SceneStringName(pose_updated), callable_mp(this, &Skeleton3DEditor::_draw_gizmo));
skeleton->disconnect(SceneStringName(pose_updated), callable_mp(this, &Skeleton3DEditor::_update_properties));
skeleton->set_transform_gizmo_visible(true);
#endif
if (handles_mesh_instance->get_parent()) {

View file

@ -135,7 +135,7 @@ void TileSetAtlasSourceEditor::TileSetAtlasSourceProxyObject::edit(Ref<TileSet>
// Disconnect to changes.
if (tile_set_atlas_source.is_valid()) {
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(CoreStringName(property_list_changed), callable_mp((Object *)this, &Object::notify_property_list_changed));
}
tile_set = p_tile_set;
@ -144,8 +144,8 @@ void TileSetAtlasSourceEditor::TileSetAtlasSourceProxyObject::edit(Ref<TileSet>
// Connect to changes.
if (tile_set_atlas_source.is_valid()) {
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(CoreStringName(property_list_changed), callable_mp((Object *)this, &Object::notify_property_list_changed))) {
tile_set_atlas_source->connect(CoreStringName(property_list_changed), callable_mp((Object *)this, &Object::notify_property_list_changed));
}
}
@ -522,8 +522,8 @@ void TileSetAtlasSourceEditor::AtlasTileProxyObject::edit(Ref<TileSetAtlasSource
if (tile_set_atlas_source.is_valid() && tile_set_atlas_source->has_tile(coords) && tile_set_atlas_source->has_alternative_tile(coords, alternative)) {
TileData *tile_data = 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(CoreStringName(property_list_changed), callable_mp((Object *)this, &Object::notify_property_list_changed))) {
tile_data->disconnect(CoreStringName(property_list_changed), callable_mp((Object *)this, &Object::notify_property_list_changed));
}
}
}
@ -538,8 +538,8 @@ void TileSetAtlasSourceEditor::AtlasTileProxyObject::edit(Ref<TileSetAtlasSource
if (tile_set_atlas_source->has_tile(coords) && tile_set_atlas_source->has_alternative_tile(coords, alternative)) {
TileData *tile_data = 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(CoreStringName(property_list_changed), callable_mp((Object *)this, &Object::notify_property_list_changed))) {
tile_data->connect(CoreStringName(property_list_changed), callable_mp((Object *)this, &Object::notify_property_list_changed));
}
}
}

View file

@ -117,7 +117,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(CoreStringName(property_list_changed), callable_mp((Object *)this, &Object::notify_property_list_changed));
}
tile_set = p_tile_set;
@ -126,8 +126,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(CoreStringName(property_list_changed), callable_mp((Object *)this, &Object::notify_property_list_changed))) {
tile_set_scenes_collection_source->connect(CoreStringName(property_list_changed), callable_mp((Object *)this, &Object::notify_property_list_changed));
}
}

View file

@ -2038,15 +2038,15 @@ void GDScriptInstance::notification(int p_notification, bool p_reversed) {
}
String GDScriptInstance::to_string(bool *r_valid) {
if (has_method(CoreStringNames::get_singleton()->_to_string)) {
if (has_method(CoreStringName(_to_string))) {
Callable::CallError ce;
Variant ret = callp(CoreStringNames::get_singleton()->_to_string, nullptr, 0, ce);
Variant ret = callp(CoreStringName(_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 " + CoreStringName(_to_string) + ", must be a String.");
}
if (r_valid) {
*r_valid = true;

View file

@ -231,7 +231,7 @@ bool GDScriptAnalyzer::has_member_name_conflict_in_native_type(const StringName
if (ClassDB::has_integer_constant(p_native_type_string, p_member_name)) {
return true;
}
if (p_member_name == CoreStringNames::get_singleton()->_script) {
if (p_member_name == CoreStringName(script)) {
return true;
}
@ -2172,7 +2172,7 @@ void GDScriptAnalyzer::resolve_for(GDScriptParser::ForNode *p_for) {
List<GDScriptParser::DataType> par_types;
int default_arg_count = 0;
BitField<MethodFlags> method_flags;
if (get_function_signature(p_for->list, false, list_type, CoreStringNames::get_singleton()->_iter_get, return_type, par_types, default_arg_count, method_flags)) {
if (get_function_signature(p_for->list, false, list_type, CoreStringName(_iter_get), return_type, par_types, default_arg_count, method_flags)) {
variable_type = return_type;
variable_type.type_source = list_type.type_source;
} else if (!list_type.is_hard_type()) {

View file

@ -346,7 +346,7 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code
scr = scr->_base;
}
if (nc && (identifier == CoreStringNames::get_singleton()->_free || ClassDB::has_signal(nc->get_name(), identifier) || ClassDB::has_method(nc->get_name(), identifier))) {
if (nc && (identifier == CoreStringName(free_) || ClassDB::has_signal(nc->get_name(), identifier) || ClassDB::has_method(nc->get_name(), identifier))) {
// Get like it was a property.
GDScriptCodeGenerator::Address temp = codegen.add_temporary(); // TODO: Get type here.
GDScriptCodeGenerator::Address self(GDScriptCodeGenerator::Address::SELF);

View file

@ -1741,7 +1741,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
if (base_type == Variant::OBJECT) {
if (base_obj) {
MethodBind *method = ClassDB::get_method(base_class, *methodname);
if (*methodname == CoreStringNames::get_singleton()->_free || (method && !method->has_return())) {
if (*methodname == CoreStringName(free_) || (method && !method->has_return())) {
err_text = R"(Trying to get a return value of a method that returns "void")";
OPCODE_BREAK;
}
@ -3097,7 +3097,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
const Variant *args[] = { &vref };
Callable::CallError ce;
Variant has_next = obj->callp(CoreStringNames::get_singleton()->_iter_init, args, 1, ce);
Variant has_next = obj->callp(CoreStringName(_iter_init), args, 1, ce);
#ifdef DEBUG_ENABLED
if (ref.size() != 1 || ce.error != Callable::CallError::CALL_OK) {
@ -3113,7 +3113,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
*counter = ref[0];
GET_VARIANT_PTR(iterator, 2);
*iterator = obj->callp(CoreStringNames::get_singleton()->_iter_get, (const Variant **)&counter, 1, ce);
*iterator = obj->callp(CoreStringName(_iter_get), (const Variant **)&counter, 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);
@ -3431,7 +3431,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
const Variant *args[] = { &vref };
Callable::CallError ce;
Variant has_next = obj->callp(CoreStringNames::get_singleton()->_iter_next, args, 1, ce);
Variant has_next = obj->callp(CoreStringName(_iter_next), args, 1, ce);
#ifdef DEBUG_ENABLED
if (ref.size() != 1 || ce.error != Callable::CallError::CALL_OK) {
@ -3447,7 +3447,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
*counter = ref[0];
GET_VARIANT_PTR(iterator, 2);
*iterator = obj->callp(CoreStringNames::get_singleton()->_iter_get, (const Variant **)&counter, 1, ce);
*iterator = obj->callp(CoreStringName(_iter_get), (const Variant **)&counter, 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);

View file

@ -949,7 +949,7 @@ void GridMapEditor::_update_mesh_library() {
void GridMapEditor::edit(GridMap *p_gridmap) {
if (node) {
node->disconnect(SNAME("cell_size_changed"), callable_mp(this, &GridMapEditor::_draw_grids));
node->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &GridMapEditor::_update_mesh_library));
node->disconnect(CoreStringName(changed), callable_mp(this, &GridMapEditor::_update_mesh_library));
if (mesh_library.is_valid()) {
mesh_library->disconnect_changed(callable_mp(this, &GridMapEditor::update_palette));
mesh_library = Ref<MeshLibrary>();
@ -987,7 +987,7 @@ void GridMapEditor::edit(GridMap *p_gridmap) {
update_grid();
node->connect(SNAME("cell_size_changed"), callable_mp(this, &GridMapEditor::_draw_grids));
node->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &GridMapEditor::_update_mesh_library));
node->connect(CoreStringName(changed), callable_mp(this, &GridMapEditor::_update_mesh_library));
_update_mesh_library();
}

View file

@ -266,7 +266,7 @@ void GridMap::set_mesh_library(const Ref<MeshLibrary> &p_mesh_library) {
}
_recreate_octant_data();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
Ref<MeshLibrary> GridMap::get_mesh_library() const {
@ -1136,7 +1136,7 @@ void GridMap::_bind_methods() {
BIND_CONSTANT(INVALID_CELL_ITEM);
ADD_SIGNAL(MethodInfo("cell_size_changed", PropertyInfo(Variant::VECTOR3, "cell_size")));
ADD_SIGNAL(MethodInfo(CoreStringNames::get_singleton()->changed));
ADD_SIGNAL(MethodInfo(CoreStringName(changed)));
}
void GridMap::set_cell_scale(float p_scale) {

View file

@ -216,7 +216,7 @@ void MultiplayerSpawner::_notification(int p_what) {
for (const KeyValue<ObjectID, SpawnInfo> &E : tracked_nodes) {
Node *node = Object::cast_to<Node>(ObjectDB::get_instance(E.key));
ERR_CONTINUE(!node);
node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &MultiplayerSpawner::_node_exit));
node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &MultiplayerSpawner::_node_exit));
get_multiplayer()->object_configuration_remove(node, this);
}
tracked_nodes.clear();
@ -258,7 +258,7 @@ void MultiplayerSpawner::_track(Node *p_node, const Variant &p_argument, int p_s
ObjectID oid = p_node->get_instance_id();
if (!tracked_nodes.has(oid)) {
tracked_nodes[oid] = SpawnInfo(p_argument.duplicate(true), p_scene_id);
p_node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &MultiplayerSpawner::_node_exit).bind(p_node->get_instance_id()), CONNECT_ONE_SHOT);
p_node->connect(SceneStringName(tree_exiting), callable_mp(this, &MultiplayerSpawner::_node_exit).bind(p_node->get_instance_id()), CONNECT_ONE_SHOT);
_spawn_notify(p_node->get_instance_id());
}
}

View file

@ -42,7 +42,7 @@ SceneCacheInterface::NodeCache &SceneCacheInterface::_track(Node *p_node) {
NodeCache *nc = nodes_cache.getptr(oid);
if (!nc) {
nodes_cache[oid] = NodeCache();
p_node->connect(SceneStringNames::get_singleton()->tree_exited, callable_mp(this, &SceneCacheInterface::_remove_node_cache).bind(oid), Object::CONNECT_ONE_SHOT);
p_node->connect(SceneStringName(tree_exited), callable_mp(this, &SceneCacheInterface::_remove_node_cache).bind(oid), Object::CONNECT_ONE_SHOT);
}
return nodes_cache[oid];
}
@ -286,7 +286,7 @@ void SceneCacheInterface::clear() {
for (KeyValue<ObjectID, NodeCache> &E : nodes_cache) {
Object *obj = ObjectDB::get_instance(E.key);
ERR_CONTINUE(!obj);
obj->disconnect(SceneStringNames::get_singleton()->tree_exited, callable_mp(this, &SceneCacheInterface::_remove_node_cache));
obj->disconnect(SceneStringName(tree_exited), callable_mp(this, &SceneCacheInterface::_remove_node_cache));
}
peers_info.clear();
nodes_cache.clear();

View file

@ -57,7 +57,7 @@ SceneReplicationInterface::TrackedNode &SceneReplicationInterface::_track(const
if (!tracked_nodes.has(p_id)) {
tracked_nodes[p_id] = TrackedNode(p_id);
Node *node = get_id_as<Node>(p_id);
node->connect(SceneStringNames::get_singleton()->tree_exited, callable_mp(this, &SceneReplicationInterface::_untrack).bind(p_id), Node::CONNECT_ONE_SHOT);
node->connect(SceneStringName(tree_exited), callable_mp(this, &SceneReplicationInterface::_untrack).bind(p_id), Node::CONNECT_ONE_SHOT);
}
return tracked_nodes[p_id];
}
@ -135,8 +135,8 @@ void SceneReplicationInterface::on_network_process() {
for (const ObjectID &oid : spawn_queue) {
Node *node = get_id_as<Node>(oid);
ERR_CONTINUE(!node);
if (node->is_connected(SceneStringNames::get_singleton()->ready, callable_mp(this, &SceneReplicationInterface::_node_ready))) {
node->disconnect(SceneStringNames::get_singleton()->ready, callable_mp(this, &SceneReplicationInterface::_node_ready));
if (node->is_connected(SceneStringName(ready), callable_mp(this, &SceneReplicationInterface::_node_ready))) {
node->disconnect(SceneStringName(ready), callable_mp(this, &SceneReplicationInterface::_node_ready));
}
}
spawn_queue.clear();
@ -168,7 +168,7 @@ Error SceneReplicationInterface::on_spawn(Object *p_obj, Variant p_config) {
ERR_FAIL_COND_V(tobj.spawner != ObjectID(), ERR_ALREADY_IN_USE);
tobj.spawner = spawner->get_instance_id();
spawn_queue.insert(oid);
node->connect(SceneStringNames::get_singleton()->ready, callable_mp(this, &SceneReplicationInterface::_node_ready).bind(oid), Node::CONNECT_ONE_SHOT);
node->connect(SceneStringName(ready), callable_mp(this, &SceneReplicationInterface::_node_ready).bind(oid), Node::CONNECT_ONE_SHOT);
return OK;
}

View file

@ -202,7 +202,7 @@ void AnimatedSprite2D::_notification(int p_what) {
} else {
frame = last_frame;
pause();
emit_signal(SceneStringNames::get_singleton()->animation_finished);
emit_signal(SceneStringName(animation_finished));
return;
}
} else {
@ -211,7 +211,7 @@ void AnimatedSprite2D::_notification(int p_what) {
_calc_frame_speed_scale();
frame_progress = 0.0;
queue_redraw();
emit_signal(SceneStringNames::get_singleton()->frame_changed);
emit_signal(SceneStringName(frame_changed));
}
double to_process = MIN((1.0 - frame_progress) / abs_speed, remaining);
frame_progress += to_process * abs_speed;
@ -226,7 +226,7 @@ void AnimatedSprite2D::_notification(int p_what) {
} else {
frame = 0;
pause();
emit_signal(SceneStringNames::get_singleton()->animation_finished);
emit_signal(SceneStringName(animation_finished));
return;
}
} else {
@ -235,7 +235,7 @@ void AnimatedSprite2D::_notification(int p_what) {
_calc_frame_speed_scale();
frame_progress = 1.0;
queue_redraw();
emit_signal(SceneStringNames::get_singleton()->frame_changed);
emit_signal(SceneStringName(frame_changed));
}
double to_process = MIN(frame_progress / abs_speed, remaining);
frame_progress -= to_process * abs_speed;
@ -291,12 +291,12 @@ void AnimatedSprite2D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
}
if (frames.is_valid()) {
frames->disconnect(SceneStringNames::get_singleton()->changed, callable_mp(this, &AnimatedSprite2D::_res_changed));
frames->disconnect(SceneStringName(changed), callable_mp(this, &AnimatedSprite2D::_res_changed));
}
stop();
frames = p_frames;
if (frames.is_valid()) {
frames->connect(SceneStringNames::get_singleton()->changed, callable_mp(this, &AnimatedSprite2D::_res_changed));
frames->connect(SceneStringName(changed), callable_mp(this, &AnimatedSprite2D::_res_changed));
List<StringName> al;
frames->get_animation_list(&al);
@ -363,7 +363,7 @@ void AnimatedSprite2D::set_frame_and_progress(int p_frame, real_t p_progress) {
return; // No change, don't redraw.
}
queue_redraw();
emit_signal(SceneStringNames::get_singleton()->frame_changed);
emit_signal(SceneStringName(frame_changed));
}
void AnimatedSprite2D::set_speed_scale(float p_speed_scale) {

View file

@ -81,10 +81,10 @@ StringName AudioStreamPlayer2D::_get_actual_bus() {
//check if any area is diverting sound into a bus
Ref<World2D> world_2d = get_world_2d();
ERR_FAIL_COND_V(world_2d.is_null(), SceneStringNames::get_singleton()->Master);
ERR_FAIL_COND_V(world_2d.is_null(), SceneStringName(Master));
PhysicsDirectSpaceState2D *space_state = PhysicsServer2D::get_singleton()->space_get_direct_state(world_2d->get_space());
ERR_FAIL_NULL_V(space_state, SceneStringNames::get_singleton()->Master);
ERR_FAIL_COND_V(space_state, SceneStringName(Master));
PhysicsDirectSpaceState2D::ShapeResult sr[MAX_INTERSECT_AREAS];
PhysicsDirectSpaceState2D::PointParameters point_params;

View file

@ -997,7 +997,7 @@ void CPUParticles2D::_particles_process(double p_delta) {
}
if (!Math::is_equal_approx(time, 0.0) && active && !should_be_active) {
active = false;
emit_signal(SceneStringNames::get_singleton()->finished);
emit_signal(SceneStringName(finished));
}
}

View file

@ -731,7 +731,7 @@ void GPUParticles2D::_notification(int p_what) {
}
if (time > active_time) {
if (active && !signal_canceled) {
emit_signal(SceneStringNames::get_singleton()->finished);
emit_signal(SceneStringName(finished));
}
active = false;
if (!emitting) {

View file

@ -70,7 +70,7 @@ void MeshInstance2D::set_texture(const Ref<Texture2D> &p_texture) {
}
texture = p_texture;
queue_redraw();
emit_signal(SceneStringNames::get_singleton()->texture_changed);
emit_signal(SceneStringName(texture_changed));
}
Ref<Texture2D> MeshInstance2D::get_texture() const {

View file

@ -79,7 +79,7 @@ void MultiMeshInstance2D::set_texture(const Ref<Texture2D> &p_texture) {
}
texture = p_texture;
queue_redraw();
emit_signal(SceneStringNames::get_singleton()->texture_changed);
emit_signal(SceneStringName(texture_changed));
}
Ref<Texture2D> MultiMeshInstance2D::get_texture() const {

View file

@ -142,9 +142,9 @@ void Area2D::_body_enter_tree(ObjectID p_id) {
ERR_FAIL_COND(E->value.in_tree);
E->value.in_tree = true;
emit_signal(SceneStringNames::get_singleton()->body_entered, node);
emit_signal(SceneStringName(body_entered), node);
for (int i = 0; i < E->value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->body_shape_entered, E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].area_shape);
emit_signal(SceneStringName(body_shape_entered), E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].area_shape);
}
}
@ -156,9 +156,9 @@ void Area2D::_body_exit_tree(ObjectID p_id) {
ERR_FAIL_COND(!E);
ERR_FAIL_COND(!E->value.in_tree);
E->value.in_tree = false;
emit_signal(SceneStringNames::get_singleton()->body_exited, node);
emit_signal(SceneStringName(body_exited), node);
for (int i = 0; i < E->value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].area_shape);
emit_signal(SceneStringName(body_shape_exited), E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].area_shape);
}
}
@ -172,9 +172,9 @@ void Area2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i
lock_callback();
locked = true;
if (body_in) {
emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_body, (Node *)nullptr, p_body_shape, p_area_shape);
emit_signal(SceneStringName(body_shape_entered), p_body, (Node *)nullptr, p_body_shape, p_area_shape);
} else {
emit_signal(SceneStringNames::get_singleton()->body_shape_exited, p_body, (Node *)nullptr, p_body_shape, p_area_shape);
emit_signal(SceneStringName(body_shape_exited), p_body, (Node *)nullptr, p_body_shape, p_area_shape);
}
locked = false;
unlock_callback();
@ -200,10 +200,10 @@ void Area2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i
E->value.rc = 0;
E->value.in_tree = node && node->is_inside_tree();
if (node) {
node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area2D::_body_enter_tree).bind(objid));
node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area2D::_body_exit_tree).bind(objid));
node->connect(SceneStringName(tree_entered), callable_mp(this, &Area2D::_body_enter_tree).bind(objid));
node->connect(SceneStringName(tree_exiting), callable_mp(this, &Area2D::_body_exit_tree).bind(objid));
if (E->value.in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_entered, node);
emit_signal(SceneStringName(body_entered), node);
}
}
}
@ -213,7 +213,7 @@ void Area2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i
}
if (!node || E->value.in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_body, node, p_body_shape, p_area_shape);
emit_signal(SceneStringName(body_shape_entered), p_body, node, p_body_shape, p_area_shape);
}
} else {
@ -227,15 +227,15 @@ void Area2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i
if (E->value.rc == 0) {
body_map.remove(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(SceneStringName(tree_entered), callable_mp(this, &Area2D::_body_enter_tree));
node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &Area2D::_body_exit_tree));
if (in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_exited, obj);
emit_signal(SceneStringName(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(SceneStringName(body_shape_exited), p_body, obj, p_body_shape, p_area_shape);
}
}
@ -253,9 +253,9 @@ void Area2D::_area_enter_tree(ObjectID p_id) {
ERR_FAIL_COND(E->value.in_tree);
E->value.in_tree = true;
emit_signal(SceneStringNames::get_singleton()->area_entered, node);
emit_signal(SceneStringName(area_entered), node);
for (int i = 0; i < E->value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->area_shape_entered, E->value.rid, node, E->value.shapes[i].area_shape, E->value.shapes[i].self_shape);
emit_signal(SceneStringName(area_shape_entered), E->value.rid, node, E->value.shapes[i].area_shape, E->value.shapes[i].self_shape);
}
}
@ -267,9 +267,9 @@ void Area2D::_area_exit_tree(ObjectID p_id) {
ERR_FAIL_COND(!E);
ERR_FAIL_COND(!E->value.in_tree);
E->value.in_tree = false;
emit_signal(SceneStringNames::get_singleton()->area_exited, node);
emit_signal(SceneStringName(area_exited), node);
for (int i = 0; i < E->value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->area_shape_exited, E->value.rid, node, E->value.shapes[i].area_shape, E->value.shapes[i].self_shape);
emit_signal(SceneStringName(area_shape_exited), E->value.rid, node, E->value.shapes[i].area_shape, E->value.shapes[i].self_shape);
}
}
@ -283,9 +283,9 @@ void Area2D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i
lock_callback();
locked = true;
if (area_in) {
emit_signal(SceneStringNames::get_singleton()->area_shape_entered, p_area, (Node *)nullptr, p_area_shape, p_self_shape);
emit_signal(SceneStringName(area_shape_entered), p_area, (Node *)nullptr, p_area_shape, p_self_shape);
} else {
emit_signal(SceneStringNames::get_singleton()->area_shape_exited, p_area, (Node *)nullptr, p_area_shape, p_self_shape);
emit_signal(SceneStringName(area_shape_exited), p_area, (Node *)nullptr, p_area_shape, p_self_shape);
}
locked = false;
unlock_callback();
@ -311,10 +311,10 @@ void Area2D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i
E->value.rc = 0;
E->value.in_tree = node && node->is_inside_tree();
if (node) {
node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area2D::_area_enter_tree).bind(objid));
node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area2D::_area_exit_tree).bind(objid));
node->connect(SceneStringName(tree_entered), callable_mp(this, &Area2D::_area_enter_tree).bind(objid));
node->connect(SceneStringName(tree_exiting), callable_mp(this, &Area2D::_area_exit_tree).bind(objid));
if (E->value.in_tree) {
emit_signal(SceneStringNames::get_singleton()->area_entered, node);
emit_signal(SceneStringName(area_entered), node);
}
}
}
@ -324,7 +324,7 @@ void Area2D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i
}
if (!node || E->value.in_tree) {
emit_signal(SceneStringNames::get_singleton()->area_shape_entered, p_area, node, p_area_shape, p_self_shape);
emit_signal(SceneStringName(area_shape_entered), p_area, node, p_area_shape, p_self_shape);
}
} else {
@ -338,15 +338,15 @@ void Area2D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i
if (E->value.rc == 0) {
area_map.remove(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(SceneStringName(tree_entered), callable_mp(this, &Area2D::_area_enter_tree));
node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &Area2D::_area_exit_tree));
if (in_tree) {
emit_signal(SceneStringNames::get_singleton()->area_exited, obj);
emit_signal(SceneStringName(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(SceneStringName(area_shape_exited), p_area, obj, p_area_shape, p_self_shape);
}
}
@ -370,18 +370,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(SceneStringName(tree_entered), callable_mp(this, &Area2D::_body_enter_tree));
node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &Area2D::_body_exit_tree));
if (!E.value.in_tree) {
continue;
}
for (int i = 0; i < E.value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E.value.rid, node, E.value.shapes[i].body_shape, E.value.shapes[i].area_shape);
emit_signal(SceneStringName(body_shape_exited), E.value.rid, node, E.value.shapes[i].body_shape, E.value.shapes[i].area_shape);
}
emit_signal(SceneStringNames::get_singleton()->body_exited, obj);
emit_signal(SceneStringName(body_exited), obj);
}
}
@ -398,18 +398,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(SceneStringName(tree_entered), callable_mp(this, &Area2D::_area_enter_tree));
node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &Area2D::_area_exit_tree));
if (!E.value.in_tree) {
continue;
}
for (int i = 0; i < E.value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->area_shape_exited, E.value.rid, node, E.value.shapes[i].area_shape, E.value.shapes[i].self_shape);
emit_signal(SceneStringName(area_shape_exited), E.value.rid, node, E.value.shapes[i].area_shape, E.value.shapes[i].self_shape);
}
emit_signal(SceneStringNames::get_singleton()->area_exited, obj);
emit_signal(SceneStringName(area_exited), obj);
}
}
}
@ -538,7 +538,7 @@ StringName Area2D::get_audio_bus_name() const {
return audio_bus;
}
}
return SceneStringNames::get_singleton()->Master;
return SceneStringName(Master);
}
void Area2D::_validate_property(PropertyInfo &p_property) const {

View file

@ -519,27 +519,27 @@ bool CollisionObject2D::is_pickable() const {
void CollisionObject2D::_input_event_call(Viewport *p_viewport, const Ref<InputEvent> &p_input_event, int p_shape) {
GDVIRTUAL_CALL(_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(SceneStringName(input_event), p_viewport, p_input_event, p_shape);
}
void CollisionObject2D::_mouse_enter() {
GDVIRTUAL_CALL(_mouse_enter);
emit_signal(SceneStringNames::get_singleton()->mouse_entered);
emit_signal(SceneStringName(mouse_entered));
}
void CollisionObject2D::_mouse_exit() {
GDVIRTUAL_CALL(_mouse_exit);
emit_signal(SceneStringNames::get_singleton()->mouse_exited);
emit_signal(SceneStringName(mouse_exited));
}
void CollisionObject2D::_mouse_shape_enter(int p_shape) {
GDVIRTUAL_CALL(_mouse_shape_enter, p_shape);
emit_signal(SceneStringNames::get_singleton()->mouse_shape_entered, p_shape);
emit_signal(SceneStringName(mouse_shape_entered), p_shape);
}
void CollisionObject2D::_mouse_shape_exit(int p_shape) {
GDVIRTUAL_CALL(_mouse_shape_exit, p_shape);
emit_signal(SceneStringNames::get_singleton()->mouse_shape_exited, p_shape);
emit_signal(SceneStringName(mouse_shape_exited), p_shape);
}
void CollisionObject2D::set_only_update_transform_changes(bool p_enable) {

View file

@ -37,13 +37,13 @@ void Joint2D::_disconnect_signals() {
Node *node_a = get_node_or_null(a);
PhysicsBody2D *body_a = Object::cast_to<PhysicsBody2D>(node_a);
if (body_a) {
body_a->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Joint2D::_body_exit_tree));
body_a->disconnect(SceneStringName(tree_exiting), callable_mp(this, &Joint2D::_body_exit_tree));
}
Node *node_b = get_node_or_null(b);
PhysicsBody2D *body_b = Object::cast_to<PhysicsBody2D>(node_b);
if (body_b) {
body_b->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Joint2D::_body_exit_tree));
body_b->disconnect(SceneStringName(tree_exiting), callable_mp(this, &Joint2D::_body_exit_tree));
}
}
@ -117,8 +117,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(SceneStringName(tree_exiting), callable_mp(this, &Joint2D::_body_exit_tree));
body_b->connect(SceneStringName(tree_exiting), callable_mp(this, &Joint2D::_body_exit_tree));
PhysicsServer2D::get_singleton()->joint_disable_collisions_between_bodies(joint, exclude_from_collision);
}

View file

@ -44,10 +44,10 @@ void RigidBody2D::_body_enter_tree(ObjectID p_id) {
contact_monitor->locked = true;
E->value.in_scene = true;
emit_signal(SceneStringNames::get_singleton()->body_entered, node);
emit_signal(SceneStringName(body_entered), node);
for (int i = 0; i < E->value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->body_shape_entered, E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].local_shape);
emit_signal(SceneStringName(body_shape_entered), E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].local_shape);
}
contact_monitor->locked = false;
@ -65,10 +65,10 @@ void RigidBody2D::_body_exit_tree(ObjectID p_id) {
contact_monitor->locked = true;
emit_signal(SceneStringNames::get_singleton()->body_exited, node);
emit_signal(SceneStringName(body_exited), node);
for (int i = 0; i < E->value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].local_shape);
emit_signal(SceneStringName(body_shape_exited), E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].local_shape);
}
contact_monitor->locked = false;
@ -93,10 +93,10 @@ void RigidBody2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instan
//E->value.rc=0;
E->value.in_scene = node && node->is_inside_tree();
if (node) {
node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &RigidBody2D::_body_enter_tree).bind(objid));
node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &RigidBody2D::_body_exit_tree).bind(objid));
node->connect(SceneStringName(tree_entered), callable_mp(this, &RigidBody2D::_body_enter_tree).bind(objid));
node->connect(SceneStringName(tree_exiting), callable_mp(this, &RigidBody2D::_body_exit_tree).bind(objid));
if (E->value.in_scene) {
emit_signal(SceneStringNames::get_singleton()->body_entered, node);
emit_signal(SceneStringName(body_entered), node);
}
}
@ -108,7 +108,7 @@ void RigidBody2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instan
}
if (E->value.in_scene) {
emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_body, node, p_body_shape, p_local_shape);
emit_signal(SceneStringName(body_shape_entered), p_body, node, p_body_shape, p_local_shape);
}
} else {
@ -122,17 +122,17 @@ void RigidBody2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instan
if (E->value.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(SceneStringName(tree_entered), callable_mp(this, &RigidBody2D::_body_enter_tree));
node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &RigidBody2D::_body_exit_tree));
if (in_scene) {
emit_signal(SceneStringNames::get_singleton()->body_exited, node);
emit_signal(SceneStringName(body_exited), node);
}
}
contact_monitor->body_map.remove(E);
}
if (node && in_scene) {
emit_signal(SceneStringNames::get_singleton()->body_shape_exited, p_body, node, p_body_shape, p_local_shape);
emit_signal(SceneStringName(body_shape_exited), p_body, node, p_body_shape, p_local_shape);
}
}
}
@ -158,7 +158,7 @@ void RigidBody2D::_sync_body_state(PhysicsDirectBodyState2D *p_state) {
if (sleeping != p_state->is_sleeping()) {
sleeping = p_state->is_sleeping();
emit_signal(SceneStringNames::get_singleton()->sleeping_state_changed);
emit_signal(SceneStringName(sleeping_state_changed));
}
}
@ -605,8 +605,8 @@ void RigidBody2D::set_contact_monitor(bool p_enabled) {
Node *node = Object::cast_to<Node>(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(SceneStringName(tree_entered), callable_mp(this, &RigidBody2D::_body_enter_tree));
node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &RigidBody2D::_body_exit_tree));
}
}

View file

@ -146,7 +146,7 @@ void Sprite2D::set_texture(const Ref<Texture2D> &p_texture) {
}
queue_redraw();
emit_signal(SceneStringNames::get_singleton()->texture_changed);
emit_signal(SceneStringName(texture_changed));
item_rect_changed();
}
@ -260,7 +260,7 @@ void Sprite2D::set_frame(int p_frame) {
frame = p_frame;
item_rect_changed();
emit_signal(SceneStringNames::get_singleton()->frame_changed);
emit_signal(SceneStringName(frame_changed));
}
int Sprite2D::get_frame() const {

View file

@ -54,7 +54,7 @@ void TileMap::_tile_set_changed() {
}
void TileMap::_emit_changed() {
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
void TileMap::_set_tile_map_data_using_compatibility_format(int p_layer, TileMapDataFormat p_format, const Vector<int> &p_data) {
@ -360,7 +360,7 @@ void TileMap::add_layer(int p_to_pos) {
for (uint32_t i = 0; i < layers.size(); i++) {
layers[i]->set_as_tile_map_internal_node(i);
}
new_layer->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &TileMap::_emit_changed));
new_layer->connect(CoreStringName(changed), callable_mp(this, &TileMap::_emit_changed));
notify_property_list_changed();
@ -768,7 +768,7 @@ bool TileMap::_set(const StringName &p_name, const Variant &p_value) {
new_layer->set_as_tile_map_internal_node(index);
new_layer->set_name(vformat("Layer%d", index));
new_layer->set_tile_set(tile_set);
new_layer->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &TileMap::_emit_changed));
new_layer->connect(CoreStringName(changed), callable_mp(this, &TileMap::_emit_changed));
layers.push_back(new_layer);
}
@ -1051,7 +1051,7 @@ void TileMap::_bind_methods() {
ADD_PROPERTY_DEFAULT("format", TileMapDataFormat::TILE_MAP_DATA_FORMAT_1);
ADD_SIGNAL(MethodInfo(CoreStringNames::get_singleton()->changed));
ADD_SIGNAL(MethodInfo(CoreStringName(changed)));
BIND_ENUM_CONSTANT(VISIBILITY_MODE_DEFAULT);
BIND_ENUM_CONSTANT(VISIBILITY_MODE_FORCE_HIDE);
@ -1064,7 +1064,7 @@ TileMap::TileMap() {
new_layer->set_as_tile_map_internal_node(0);
new_layer->set_name("Layer0");
new_layer->set_tile_set(tile_set);
new_layer->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &TileMap::_emit_changed));
new_layer->connect(CoreStringName(changed), callable_mp(this, &TileMap::_emit_changed));
layers.push_back(new_layer);
if (!base_property_helper.is_initialized()) {

View file

@ -1598,11 +1598,11 @@ RBSet<TerrainConstraint> TileMapLayer::_get_terrain_constraints_from_painted_cel
void TileMapLayer::_tile_set_changed() {
dirty.flags[DIRTY_FLAGS_TILE_SET] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
void TileMapLayer::_renamed() {
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
void TileMapLayer::_update_notify_local_transform() {
@ -1805,7 +1805,7 @@ void TileMapLayer::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "navigation_enabled"), "set_navigation_enabled", "is_navigation_enabled");
ADD_PROPERTY(PropertyInfo(Variant::INT, "navigation_visibility_mode", PROPERTY_HINT_ENUM, "Default,Force Show,Force Hide"), "set_navigation_visibility_mode", "get_navigation_visibility_mode");
ADD_SIGNAL(MethodInfo(CoreStringNames::get_singleton()->changed));
ADD_SIGNAL(MethodInfo(CoreStringName(changed)));
ADD_PROPERTY_DEFAULT("tile_map_data_format", TileMapDataFormat::TILE_MAP_DATA_FORMAT_1);
@ -1819,7 +1819,7 @@ void TileMapLayer::_update_self_texture_filter(RS::CanvasItemTextureFilter p_tex
CanvasItem::_update_self_texture_filter(p_texture_filter);
dirty.flags[DIRTY_FLAGS_LAYER_TEXTURE_FILTER] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
void TileMapLayer::_update_self_texture_repeat(RS::CanvasItemTextureRepeat p_texture_repeat) {
@ -1827,7 +1827,7 @@ void TileMapLayer::_update_self_texture_repeat(RS::CanvasItemTextureRepeat p_tex
CanvasItem::_update_self_texture_repeat(p_texture_repeat);
dirty.flags[DIRTY_FLAGS_LAYER_TEXTURE_REPEAT] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
void TileMapLayer::set_as_tile_map_internal_node(int p_index) {
@ -2502,7 +2502,7 @@ void TileMapLayer::update_internals() {
void TileMapLayer::notify_runtime_tile_data_update() {
dirty.flags[TileMapLayer::DIRTY_FLAGS_LAYER_RUNTIME_UPDATE] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
Vector2i TileMapLayer::map_pattern(const Vector2i &p_position_in_tilemap, const Vector2i &p_coords_in_pattern, Ref<TileMapPattern> p_pattern) {
@ -2537,7 +2537,7 @@ void TileMapLayer::set_enabled(bool p_enabled) {
enabled = p_enabled;
dirty.flags[DIRTY_FLAGS_LAYER_ENABLED] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
bool TileMapLayer::is_enabled() const {
@ -2563,7 +2563,7 @@ void TileMapLayer::set_tile_set(const Ref<TileSet> &p_tile_set) {
tile_set->connect_changed(callable_mp(this, &TileMapLayer::_tile_set_changed));
}
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
// Trigger updates for TileSet's read-only status.
notify_property_list_changed();
@ -2675,7 +2675,7 @@ void TileMapLayer::set_self_modulate(const Color &p_self_modulate) {
CanvasItem::set_self_modulate(p_self_modulate);
dirty.flags[DIRTY_FLAGS_LAYER_SELF_MODULATE] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
void TileMapLayer::set_y_sort_enabled(bool p_y_sort_enabled) {
@ -2685,7 +2685,7 @@ void TileMapLayer::set_y_sort_enabled(bool p_y_sort_enabled) {
CanvasItem::set_y_sort_enabled(p_y_sort_enabled);
dirty.flags[DIRTY_FLAGS_LAYER_Y_SORT_ENABLED] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
_update_notify_local_transform();
}
@ -2697,7 +2697,7 @@ void TileMapLayer::set_y_sort_origin(int p_y_sort_origin) {
y_sort_origin = p_y_sort_origin;
dirty.flags[DIRTY_FLAGS_LAYER_Y_SORT_ORIGIN] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
int TileMapLayer::get_y_sort_origin() const {
@ -2711,7 +2711,7 @@ void TileMapLayer::set_z_index(int p_z_index) {
CanvasItem::set_z_index(p_z_index);
dirty.flags[DIRTY_FLAGS_LAYER_Z_INDEX] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
void TileMapLayer::set_light_mask(int p_light_mask) {
@ -2721,7 +2721,7 @@ void TileMapLayer::set_light_mask(int p_light_mask) {
CanvasItem::set_light_mask(p_light_mask);
dirty.flags[DIRTY_FLAGS_LAYER_LIGHT_MASK] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
void TileMapLayer::set_rendering_quadrant_size(int p_size) {
@ -2733,7 +2733,7 @@ void TileMapLayer::set_rendering_quadrant_size(int p_size) {
rendering_quadrant_size = p_size;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
int TileMapLayer::get_rendering_quadrant_size() const {
@ -2747,7 +2747,7 @@ void TileMapLayer::set_collision_enabled(bool p_enabled) {
collision_enabled = p_enabled;
dirty.flags[DIRTY_FLAGS_LAYER_COLLISION_ENABLED] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
bool TileMapLayer::is_collision_enabled() const {
@ -2758,7 +2758,7 @@ void TileMapLayer::set_use_kinematic_bodies(bool p_use_kinematic_bodies) {
use_kinematic_bodies = p_use_kinematic_bodies;
dirty.flags[DIRTY_FLAGS_LAYER_USE_KINEMATIC_BODIES] = p_use_kinematic_bodies;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
bool TileMapLayer::is_using_kinematic_bodies() const {
@ -2772,7 +2772,7 @@ void TileMapLayer::set_collision_visibility_mode(TileMapLayer::DebugVisibilityMo
collision_visibility_mode = p_show_collision;
dirty.flags[DIRTY_FLAGS_LAYER_COLLISION_VISIBILITY_MODE] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
TileMapLayer::DebugVisibilityMode TileMapLayer::get_collision_visibility_mode() const {
@ -2786,7 +2786,7 @@ void TileMapLayer::set_navigation_enabled(bool p_enabled) {
navigation_enabled = p_enabled;
dirty.flags[DIRTY_FLAGS_LAYER_NAVIGATION_ENABLED] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
bool TileMapLayer::is_navigation_enabled() const {
@ -2800,7 +2800,7 @@ void TileMapLayer::set_navigation_map(RID p_map) {
navigation_map_override = p_map;
dirty.flags[DIRTY_FLAGS_LAYER_NAVIGATION_MAP] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
RID TileMapLayer::get_navigation_map() const {
@ -2819,7 +2819,7 @@ void TileMapLayer::set_navigation_visibility_mode(TileMapLayer::DebugVisibilityM
navigation_visibility_mode = p_show_navigation;
dirty.flags[DIRTY_FLAGS_LAYER_NAVIGATION_VISIBILITY_MODE] = true;
_queue_internal_update();
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(CoreStringName(changed));
}
TileMapLayer::DebugVisibilityMode TileMapLayer::get_navigation_visibility_mode() const {

View file

@ -38,11 +38,11 @@ void TouchScreenButton::set_texture_normal(const Ref<Texture2D> &p_texture) {
return;
}
if (texture_normal.is_valid()) {
texture_normal->disconnect(SceneStringNames::get_singleton()->changed, callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw));
texture_normal->disconnect(SceneStringName(changed), callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw));
}
texture_normal = p_texture;
if (texture_normal.is_valid()) {
texture_normal->connect(SceneStringNames::get_singleton()->changed, callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw), CONNECT_REFERENCE_COUNTED);
texture_normal->connect(SceneStringName(changed), callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw), CONNECT_REFERENCE_COUNTED);
}
queue_redraw();
}
@ -56,11 +56,11 @@ void TouchScreenButton::set_texture_pressed(const Ref<Texture2D> &p_texture_pres
return;
}
if (texture_pressed.is_valid()) {
texture_pressed->disconnect(SceneStringNames::get_singleton()->changed, callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw));
texture_pressed->disconnect(SceneStringName(changed), callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw));
}
texture_pressed = p_texture_pressed;
if (texture_pressed.is_valid()) {
texture_pressed->connect(SceneStringNames::get_singleton()->changed, callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw), CONNECT_REFERENCE_COUNTED);
texture_pressed->connect(SceneStringName(changed), callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw), CONNECT_REFERENCE_COUNTED);
}
queue_redraw();
}

View file

@ -48,7 +48,7 @@ void VisibleOnScreenNotifier2D::_visibility_enter() {
}
on_screen = true;
emit_signal(SceneStringNames::get_singleton()->screen_entered);
emit_signal(SceneStringName(screen_entered));
_screen_enter();
}
void VisibleOnScreenNotifier2D::_visibility_exit() {
@ -57,7 +57,7 @@ void VisibleOnScreenNotifier2D::_visibility_exit() {
}
on_screen = false;
emit_signal(SceneStringNames::get_singleton()->screen_exited);
emit_signal(SceneStringName(screen_exited));
_screen_exit();
}

View file

@ -1156,7 +1156,7 @@ void CPUParticles3D::_particles_process(double p_delta) {
}
if (!Math::is_equal_approx(time, 0.0) && active && !should_be_active) {
active = false;
emit_signal(SceneStringNames::get_singleton()->finished);
emit_signal(SceneStringName(finished));
}
}

View file

@ -478,7 +478,7 @@ void GPUParticles3D::_notification(int p_what) {
}
if (time > active_time) {
if (active && !signal_canceled) {
emit_signal(SceneStringNames::get_singleton()->finished);
emit_signal(SceneStringName(finished));
}
active = false;
if (!emitting) {

View file

@ -193,12 +193,12 @@ void Node3D::_notification(int p_what) {
ERR_FAIL_NULL(data.viewport);
if (get_script_instance()) {
get_script_instance()->call(SceneStringNames::get_singleton()->_enter_world);
get_script_instance()->call(SceneStringName(_enter_world));
}
#ifdef TOOLS_ENABLED
if (is_part_of_edited_scene()) {
get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringNames::get_singleton()->_spatial_editor_group, SNAME("_request_gizmo_for_id"), get_instance_id());
get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringName(_spatial_editor_group), SNAME("_request_gizmo_for_id"), get_instance_id());
}
#endif
} break;
@ -211,7 +211,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(SceneStringName(_exit_world));
}
data.viewport = nullptr;
@ -564,7 +564,7 @@ void Node3D::update_gizmos() {
}
if (data.gizmos.is_empty()) {
get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringNames::get_singleton()->_spatial_editor_group, SNAME("_request_gizmo_for_id"), get_instance_id());
get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringName(_spatial_editor_group), SNAME("_request_gizmo_for_id"), get_instance_id());
return;
}
if (data.gizmos_dirty) {
@ -583,7 +583,7 @@ void Node3D::set_subgizmo_selection(Ref<Node3DGizmo> p_gizmo, int p_id, Transfor
}
if (is_part_of_edited_scene()) {
get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringNames::get_singleton()->_spatial_editor_group, SceneStringNames::get_singleton()->_set_subgizmo_selection, this, p_gizmo, p_id, p_transform);
get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringName(_spatial_editor_group), SceneStringName(_set_subgizmo_selection), this, p_gizmo, p_id, p_transform);
}
#endif
}
@ -600,7 +600,7 @@ void Node3D::clear_subgizmo_selection() {
}
if (is_part_of_edited_scene()) {
get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringNames::get_singleton()->_spatial_editor_group, SceneStringNames::get_singleton()->_clear_subgizmo_selection, this);
get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringName(_spatial_editor_group), SceneStringName(_clear_subgizmo_selection), this);
}
#endif
}
@ -777,7 +777,7 @@ Ref<World3D> Node3D::get_world_3d() const {
void Node3D::_propagate_visibility_changed() {
notification(NOTIFICATION_VISIBILITY_CHANGED);
emit_signal(SceneStringNames::get_singleton()->visibility_changed);
emit_signal(SceneStringName(visibility_changed));
#ifdef TOOLS_ENABLED
if (!data.gizmos.is_empty()) {

View file

@ -199,9 +199,9 @@ void Area3D::_body_enter_tree(ObjectID p_id) {
ERR_FAIL_COND(E->value.in_tree);
E->value.in_tree = true;
emit_signal(SceneStringNames::get_singleton()->body_entered, node);
emit_signal(SceneStringName(body_entered), node);
for (int i = 0; i < E->value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->body_shape_entered, E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].area_shape);
emit_signal(SceneStringName(body_shape_entered), E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].area_shape);
}
}
@ -213,9 +213,9 @@ void Area3D::_body_exit_tree(ObjectID p_id) {
ERR_FAIL_COND(!E);
ERR_FAIL_COND(!E->value.in_tree);
E->value.in_tree = false;
emit_signal(SceneStringNames::get_singleton()->body_exited, node);
emit_signal(SceneStringName(body_exited), node);
for (int i = 0; i < E->value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].area_shape);
emit_signal(SceneStringName(body_shape_exited), E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].area_shape);
}
}
@ -229,9 +229,9 @@ void Area3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i
locked = true;
// Emit the appropriate signals.
if (body_in) {
emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_body, (Node *)nullptr, p_body_shape, p_area_shape);
emit_signal(SceneStringName(body_shape_entered), p_body, (Node *)nullptr, p_body_shape, p_area_shape);
} else {
emit_signal(SceneStringNames::get_singleton()->body_shape_exited, p_body, (Node *)nullptr, p_body_shape, p_area_shape);
emit_signal(SceneStringName(body_shape_exited), p_body, (Node *)nullptr, p_body_shape, p_area_shape);
}
locked = false;
unlock_callback();
@ -257,10 +257,10 @@ void Area3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i
E->value.rc = 0;
E->value.in_tree = node && node->is_inside_tree();
if (node) {
node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area3D::_body_enter_tree).bind(objid));
node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area3D::_body_exit_tree).bind(objid));
node->connect(SceneStringName(tree_entered), callable_mp(this, &Area3D::_body_enter_tree).bind(objid));
node->connect(SceneStringName(tree_exiting), callable_mp(this, &Area3D::_body_exit_tree).bind(objid));
if (E->value.in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_entered, node);
emit_signal(SceneStringName(body_entered), node);
}
}
}
@ -270,7 +270,7 @@ void Area3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i
}
if (!node || E->value.in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_body, node, p_body_shape, p_area_shape);
emit_signal(SceneStringName(body_shape_entered), p_body, node, p_body_shape, p_area_shape);
}
} else {
@ -284,15 +284,15 @@ void Area3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i
if (E->value.rc == 0) {
body_map.remove(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(SceneStringName(tree_entered), callable_mp(this, &Area3D::_body_enter_tree));
node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &Area3D::_body_exit_tree));
if (in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_exited, obj);
emit_signal(SceneStringName(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(SceneStringName(body_shape_exited), p_body, obj, p_body_shape, p_area_shape);
}
}
@ -317,18 +317,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(SceneStringName(tree_entered), callable_mp(this, &Area3D::_body_enter_tree));
node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &Area3D::_body_exit_tree));
if (!E.value.in_tree) {
continue;
}
for (int i = 0; i < E.value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E.value.rid, node, E.value.shapes[i].body_shape, E.value.shapes[i].area_shape);
emit_signal(SceneStringName(body_shape_exited), E.value.rid, node, E.value.shapes[i].body_shape, E.value.shapes[i].area_shape);
}
emit_signal(SceneStringNames::get_singleton()->body_exited, node);
emit_signal(SceneStringName(body_exited), node);
}
}
@ -346,18 +346,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(SceneStringName(tree_entered), callable_mp(this, &Area3D::_area_enter_tree));
node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &Area3D::_area_exit_tree));
if (!E.value.in_tree) {
continue;
}
for (int i = 0; i < E.value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->area_shape_exited, E.value.rid, node, E.value.shapes[i].area_shape, E.value.shapes[i].self_shape);
emit_signal(SceneStringName(area_shape_exited), E.value.rid, node, E.value.shapes[i].area_shape, E.value.shapes[i].self_shape);
}
emit_signal(SceneStringNames::get_singleton()->area_exited, obj);
emit_signal(SceneStringName(area_exited), obj);
}
}
}
@ -405,9 +405,9 @@ void Area3D::_area_enter_tree(ObjectID p_id) {
ERR_FAIL_COND(E->value.in_tree);
E->value.in_tree = true;
emit_signal(SceneStringNames::get_singleton()->area_entered, node);
emit_signal(SceneStringName(area_entered), node);
for (int i = 0; i < E->value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->area_shape_entered, E->value.rid, node, E->value.shapes[i].area_shape, E->value.shapes[i].self_shape);
emit_signal(SceneStringName(area_shape_entered), E->value.rid, node, E->value.shapes[i].area_shape, E->value.shapes[i].self_shape);
}
}
@ -419,9 +419,9 @@ void Area3D::_area_exit_tree(ObjectID p_id) {
ERR_FAIL_COND(!E);
ERR_FAIL_COND(!E->value.in_tree);
E->value.in_tree = false;
emit_signal(SceneStringNames::get_singleton()->area_exited, node);
emit_signal(SceneStringName(area_exited), node);
for (int i = 0; i < E->value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->area_shape_exited, E->value.rid, node, E->value.shapes[i].area_shape, E->value.shapes[i].self_shape);
emit_signal(SceneStringName(area_shape_exited), E->value.rid, node, E->value.shapes[i].area_shape, E->value.shapes[i].self_shape);
}
}
@ -435,9 +435,9 @@ void Area3D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i
locked = true;
// Emit the appropriate signals.
if (area_in) {
emit_signal(SceneStringNames::get_singleton()->area_shape_entered, p_area, (Node *)nullptr, p_area_shape, p_self_shape);
emit_signal(SceneStringName(area_shape_entered), p_area, (Node *)nullptr, p_area_shape, p_self_shape);
} else {
emit_signal(SceneStringNames::get_singleton()->area_shape_exited, p_area, (Node *)nullptr, p_area_shape, p_self_shape);
emit_signal(SceneStringName(area_shape_exited), p_area, (Node *)nullptr, p_area_shape, p_self_shape);
}
locked = false;
unlock_callback();
@ -463,10 +463,10 @@ void Area3D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i
E->value.rc = 0;
E->value.in_tree = node && node->is_inside_tree();
if (node) {
node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area3D::_area_enter_tree).bind(objid));
node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area3D::_area_exit_tree).bind(objid));
node->connect(SceneStringName(tree_entered), callable_mp(this, &Area3D::_area_enter_tree).bind(objid));
node->connect(SceneStringName(tree_exiting), callable_mp(this, &Area3D::_area_exit_tree).bind(objid));
if (E->value.in_tree) {
emit_signal(SceneStringNames::get_singleton()->area_entered, node);
emit_signal(SceneStringName(area_entered), node);
}
}
}
@ -476,7 +476,7 @@ void Area3D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i
}
if (!node || E->value.in_tree) {
emit_signal(SceneStringNames::get_singleton()->area_shape_entered, p_area, node, p_area_shape, p_self_shape);
emit_signal(SceneStringName(area_shape_entered), p_area, node, p_area_shape, p_self_shape);
}
} else {
@ -490,15 +490,15 @@ void Area3D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i
if (E->value.rc == 0) {
area_map.remove(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(SceneStringName(tree_entered), callable_mp(this, &Area3D::_area_enter_tree));
node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &Area3D::_area_exit_tree));
if (in_tree) {
emit_signal(SceneStringNames::get_singleton()->area_exited, obj);
emit_signal(SceneStringName(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(SceneStringName(area_shape_exited), p_area, obj, p_area_shape, p_self_shape);
}
}
@ -605,7 +605,7 @@ StringName Area3D::get_audio_bus_name() const {
return audio_bus;
}
}
return SceneStringNames::get_singleton()->Master;
return SceneStringName(Master);
}
void Area3D::set_use_reverb_bus(bool p_enable) {
@ -626,7 +626,7 @@ StringName Area3D::get_reverb_bus_name() const {
return reverb_bus;
}
}
return SceneStringNames::get_singleton()->Master;
return SceneStringName(Master);
}
void Area3D::set_reverb_amount(float p_amount) {
@ -812,6 +812,8 @@ void Area3D::_bind_methods() {
Area3D::Area3D() :
CollisionObject3D(PhysicsServer3D::get_singleton()->area_create(), true) {
audio_bus = SceneStringName(Master);
reverb_bus = SceneStringName(Master);
set_gravity(9.8);
set_gravity_direction(Vector3(0, -1, 0));
set_monitoring(true);

View file

@ -135,10 +135,10 @@ private:
void _clear_monitoring();
bool audio_bus_override = false;
StringName audio_bus = SceneStringNames::get_singleton()->Master;
StringName audio_bus;
bool use_reverb_bus = false;
StringName reverb_bus = SceneStringNames::get_singleton()->Master;
StringName reverb_bus;
float reverb_amount = 0.0;
float reverb_uniformity = 0.0;

View file

@ -291,17 +291,17 @@ void CollisionObject3D::_apply_enabled() {
void CollisionObject3D::_input_event_call(Camera3D *p_camera, const Ref<InputEvent> &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape) {
GDVIRTUAL_CALL(_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(SceneStringName(input_event), p_camera, p_input_event, p_pos, p_normal, p_shape);
}
void CollisionObject3D::_mouse_enter() {
GDVIRTUAL_CALL(_mouse_enter);
emit_signal(SceneStringNames::get_singleton()->mouse_entered);
emit_signal(SceneStringName(mouse_entered));
}
void CollisionObject3D::_mouse_exit() {
GDVIRTUAL_CALL(_mouse_exit);
emit_signal(SceneStringNames::get_singleton()->mouse_exited);
emit_signal(SceneStringName(mouse_exited));
}
void CollisionObject3D::set_body_mode(PhysicsServer3D::BodyMode p_mode) {

View file

@ -36,13 +36,13 @@ void Joint3D::_disconnect_signals() {
Node *node_a = get_node_or_null(a);
PhysicsBody3D *body_a = Object::cast_to<PhysicsBody3D>(node_a);
if (body_a) {
body_a->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Joint3D::_body_exit_tree));
body_a->disconnect(SceneStringName(tree_exiting), callable_mp(this, &Joint3D::_body_exit_tree));
}
Node *node_b = get_node_or_null(b);
PhysicsBody3D *body_b = Object::cast_to<PhysicsBody3D>(node_b);
if (body_b) {
body_b->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Joint3D::_body_exit_tree));
body_b->disconnect(SceneStringName(tree_exiting), callable_mp(this, &Joint3D::_body_exit_tree));
}
}
@ -108,12 +108,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(SceneStringName(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(SceneStringName(tree_exiting), callable_mp(this, &Joint3D::_body_exit_tree));
}
PhysicsServer3D::get_singleton()->joint_disable_collisions_between_bodies(joint, exclude_from_collision);

View file

@ -45,10 +45,10 @@ void RigidBody3D::_body_enter_tree(ObjectID p_id) {
contact_monitor->locked = true;
emit_signal(SceneStringNames::get_singleton()->body_entered, node);
emit_signal(SceneStringName(body_entered), node);
for (int i = 0; i < E->value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->body_shape_entered, E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].local_shape);
emit_signal(SceneStringName(body_shape_entered), E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].local_shape);
}
contact_monitor->locked = false;
@ -66,10 +66,10 @@ void RigidBody3D::_body_exit_tree(ObjectID p_id) {
contact_monitor->locked = true;
emit_signal(SceneStringNames::get_singleton()->body_exited, node);
emit_signal(SceneStringName(body_exited), node);
for (int i = 0; i < E->value.shapes.size(); i++) {
emit_signal(SceneStringNames::get_singleton()->body_shape_exited, E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].local_shape);
emit_signal(SceneStringName(body_shape_exited), E->value.rid, node, E->value.shapes[i].body_shape, E->value.shapes[i].local_shape);
}
contact_monitor->locked = false;
@ -94,10 +94,10 @@ void RigidBody3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instan
//E->value.rc=0;
E->value.in_tree = node && node->is_inside_tree();
if (node) {
node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &RigidBody3D::_body_enter_tree).bind(objid));
node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &RigidBody3D::_body_exit_tree).bind(objid));
node->connect(SceneStringName(tree_entered), callable_mp(this, &RigidBody3D::_body_enter_tree).bind(objid));
node->connect(SceneStringName(tree_exiting), callable_mp(this, &RigidBody3D::_body_exit_tree).bind(objid));
if (E->value.in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_entered, node);
emit_signal(SceneStringName(body_entered), node);
}
}
}
@ -107,7 +107,7 @@ void RigidBody3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instan
}
if (E->value.in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_body, node, p_body_shape, p_local_shape);
emit_signal(SceneStringName(body_shape_entered), p_body, node, p_body_shape, p_local_shape);
}
} else {
@ -121,17 +121,17 @@ void RigidBody3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instan
if (E->value.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(SceneStringName(tree_entered), callable_mp(this, &RigidBody3D::_body_enter_tree));
node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &RigidBody3D::_body_exit_tree));
if (in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_exited, node);
emit_signal(SceneStringName(body_exited), node);
}
}
contact_monitor->body_map.remove(E);
}
if (node && in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_shape_exited, p_body, obj, p_body_shape, p_local_shape);
emit_signal(SceneStringName(body_shape_exited), p_body, obj, p_body_shape, p_local_shape);
}
}
}
@ -157,7 +157,7 @@ void RigidBody3D::_sync_body_state(PhysicsDirectBodyState3D *p_state) {
if (sleeping != p_state->is_sleeping()) {
sleeping = p_state->is_sleeping();
emit_signal(SceneStringNames::get_singleton()->sleeping_state_changed);
emit_signal(SceneStringName(sleeping_state_changed));
}
}
@ -613,8 +613,8 @@ void RigidBody3D::set_contact_monitor(bool p_enabled) {
Node *node = Object::cast_to<Node>(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(SceneStringName(tree_entered), callable_mp(this, &RigidBody3D::_body_enter_tree));
node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &RigidBody3D::_body_exit_tree));
}
}

View file

@ -314,7 +314,7 @@ void Skeleton3D::_notification(int p_what) {
_process_modifiers();
}
emit_signal(SceneStringNames::get_singleton()->skeleton_updated);
emit_signal(SceneStringName(skeleton_updated));
// Update skins.
RenderingServer *rs = RenderingServer::get_singleton();
@ -605,7 +605,7 @@ void Skeleton3D::set_bone_enabled(int p_bone, bool p_enabled) {
ERR_FAIL_INDEX(p_bone, bone_size);
bones.write[p_bone].enabled = p_enabled;
emit_signal(SceneStringNames::get_singleton()->bone_enabled_changed, p_bone);
emit_signal(SceneStringName(bone_enabled_changed), p_bone);
_make_dirty();
}
@ -617,7 +617,7 @@ bool Skeleton3D::is_bone_enabled(int p_bone) const {
void Skeleton3D::set_show_rest_only(bool p_enabled) {
show_rest_only = p_enabled;
emit_signal(SceneStringNames::get_singleton()->show_rest_only_changed);
emit_signal(SceneStringName(show_rest_only_changed));
_make_dirty();
}
@ -840,7 +840,7 @@ void Skeleton3D::force_update_all_bone_transforms() {
if (updating) {
return;
}
emit_signal(SceneStringNames::get_singleton()->pose_updated);
emit_signal(SceneStringName(pose_updated));
}
void Skeleton3D::force_update_bone_children_transforms(int p_bone_idx) {

View file

@ -796,15 +796,15 @@ void Sprite3D::set_texture(const Ref<Texture2D> &p_texture) {
return;
}
if (texture.is_valid()) {
texture->disconnect(SceneStringNames::get_singleton()->changed, callable_mp((SpriteBase3D *)this, &Sprite3D::_queue_redraw));
texture->disconnect(SceneStringName(changed), callable_mp((SpriteBase3D *)this, &Sprite3D::_queue_redraw));
}
texture = p_texture;
if (texture.is_valid()) {
texture->connect(SceneStringNames::get_singleton()->changed, callable_mp((SpriteBase3D *)this, &Sprite3D::_queue_redraw));
texture->connect(SceneStringName(changed), callable_mp((SpriteBase3D *)this, &Sprite3D::_queue_redraw));
}
_queue_redraw();
emit_signal(SceneStringNames::get_singleton()->texture_changed);
emit_signal(SceneStringName(texture_changed));
}
Ref<Texture2D> Sprite3D::get_texture() const {
@ -849,7 +849,7 @@ void Sprite3D::set_frame(int p_frame) {
frame = p_frame;
_queue_redraw();
emit_signal(SceneStringNames::get_singleton()->frame_changed);
emit_signal(SceneStringName(frame_changed));
}
int Sprite3D::get_frame() const {
@ -1122,7 +1122,7 @@ void AnimatedSprite3D::_notification(int p_what) {
} else {
frame = last_frame;
pause();
emit_signal(SceneStringNames::get_singleton()->animation_finished);
emit_signal(SceneStringName(animation_finished));
return;
}
} else {
@ -1131,7 +1131,7 @@ void AnimatedSprite3D::_notification(int p_what) {
_calc_frame_speed_scale();
frame_progress = 0.0;
_queue_redraw();
emit_signal(SceneStringNames::get_singleton()->frame_changed);
emit_signal(SceneStringName(frame_changed));
}
double to_process = MIN((1.0 - frame_progress) / abs_speed, remaining);
frame_progress += to_process * abs_speed;
@ -1146,7 +1146,7 @@ void AnimatedSprite3D::_notification(int p_what) {
} else {
frame = 0;
pause();
emit_signal(SceneStringNames::get_singleton()->animation_finished);
emit_signal(SceneStringName(animation_finished));
return;
}
} else {
@ -1155,7 +1155,7 @@ void AnimatedSprite3D::_notification(int p_what) {
_calc_frame_speed_scale();
frame_progress = 1.0;
_queue_redraw();
emit_signal(SceneStringNames::get_singleton()->frame_changed);
emit_signal(SceneStringName(frame_changed));
}
double to_process = MIN(frame_progress / abs_speed, remaining);
frame_progress -= to_process * abs_speed;
@ -1177,12 +1177,12 @@ void AnimatedSprite3D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
}
if (frames.is_valid()) {
frames->disconnect(SceneStringNames::get_singleton()->changed, callable_mp(this, &AnimatedSprite3D::_res_changed));
frames->disconnect(SceneStringName(changed), callable_mp(this, &AnimatedSprite3D::_res_changed));
}
stop();
frames = p_frames;
if (frames.is_valid()) {
frames->connect(SceneStringNames::get_singleton()->changed, callable_mp(this, &AnimatedSprite3D::_res_changed));
frames->connect(SceneStringName(changed), callable_mp(this, &AnimatedSprite3D::_res_changed));
List<StringName> al;
frames->get_animation_list(&al);
@ -1249,7 +1249,7 @@ void AnimatedSprite3D::set_frame_and_progress(int p_frame, real_t p_progress) {
return; // No change, don't redraw.
}
_queue_redraw();
emit_signal(SceneStringNames::get_singleton()->frame_changed);
emit_signal(SceneStringName(frame_changed));
}
void AnimatedSprite3D::set_speed_scale(float p_speed_scale) {

View file

@ -38,7 +38,7 @@ void VisibleOnScreenNotifier3D::_visibility_enter() {
}
on_screen = true;
emit_signal(SceneStringNames::get_singleton()->screen_entered);
emit_signal(SceneStringName(screen_entered));
_screen_enter();
}
void VisibleOnScreenNotifier3D::_visibility_exit() {
@ -47,7 +47,7 @@ void VisibleOnScreenNotifier3D::_visibility_exit() {
}
on_screen = false;
emit_signal(SceneStringNames::get_singleton()->screen_exited);
emit_signal(SceneStringName(screen_exited));
_screen_exit();
}

View file

@ -169,11 +169,11 @@ VisualInstance3D::~VisualInstance3D() {
void GeometryInstance3D::set_material_override(const Ref<Material> &p_material) {
if (material_override.is_valid()) {
material_override->disconnect(CoreStringNames::get_singleton()->property_list_changed, callable_mp((Object *)this, &Object::notify_property_list_changed));
material_override->disconnect(CoreStringName(property_list_changed), callable_mp((Object *)this, &Object::notify_property_list_changed));
}
material_override = p_material;
if (material_override.is_valid()) {
material_override->connect(CoreStringNames::get_singleton()->property_list_changed, callable_mp((Object *)this, &Object::notify_property_list_changed));
material_override->connect(CoreStringName(property_list_changed), callable_mp((Object *)this, &Object::notify_property_list_changed));
}
RS::get_singleton()->instance_geometry_set_material_override(get_instance(), p_material.is_valid() ? p_material->get_rid() : RID());
}
@ -279,12 +279,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 == SceneStringName(use_in_baked_light) && bool(p_value)) {
set_gi_mode(GI_MODE_STATIC);
return true;
}
if (p_name == SceneStringNames::get_singleton()->use_dynamic_gi && bool(p_value)) {
if (p_name == SceneStringName(use_dynamic_gi) && bool(p_value)) {
set_gi_mode(GI_MODE_DYNAMIC);
return true;
}

View file

@ -1421,7 +1421,7 @@ AnimationNodeOutput::AnimationNodeOutput() {
void AnimationNodeBlendTree::add_node(const StringName &p_name, Ref<AnimationNode> 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 == SceneStringName(output));
ERR_FAIL_COND(String(p_name).contains("/"));
Node n;
@ -1491,7 +1491,7 @@ Vector<StringName> 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 == SceneStringName(output)); //can't delete output
{
Ref<AnimationNode> node = nodes[p_name].node;
@ -1520,8 +1520,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 == SceneStringName(output));
ERR_FAIL_COND(p_new_name == SceneStringName(output));
nodes[p_name].node->disconnect_changed(callable_mp(this, &AnimationNodeBlendTree::_node_changed));
@ -1546,7 +1546,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 == SceneStringName(output));
ERR_FAIL_COND(p_input_node == p_output_node);
Ref<AnimationNode> input = nodes[p_input_node].node;
@ -1574,7 +1574,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 == SceneStringName(output)) {
return CONNECTION_ERROR_NO_OUTPUT;
}
@ -1627,8 +1627,8 @@ String AnimationNodeBlendTree::get_caption() const {
}
AnimationNode::NodeTimeInfo AnimationNodeBlendTree::_process(const AnimationMixer::PlaybackInfo p_playback_info, bool p_test_only) {
Ref<AnimationNodeOutput> output = nodes[SceneStringNames::get_singleton()->output].node;
node_state.connections = nodes[SceneStringNames::get_singleton()->output].connections;
Ref<AnimationNodeOutput> output = nodes[SceneStringName(output)].node;
node_state.connections = nodes[SceneStringName(output)].connections;
ERR_FAIL_COND_V(output.is_null(), NodeTimeInfo());
AnimationMixer::PlaybackInfo pi = p_playback_info;

View file

@ -628,9 +628,9 @@ bool AnimationMixer::_update_caches() {
#endif
Ref<Animation> reset_anim;
bool has_reset_anim = has_animation(SceneStringNames::get_singleton()->RESET);
bool has_reset_anim = has_animation(SceneStringName(RESET));
if (has_reset_anim) {
reset_anim = get_animation(SceneStringNames::get_singleton()->RESET);
reset_anim = get_animation(SceneStringName(RESET));
}
for (const StringName &E : sname) {
Ref<Animation> anim = get_animation(E);
@ -1926,7 +1926,7 @@ bool AnimationMixer::is_reset_on_save_enabled() const {
}
bool AnimationMixer::can_apply_reset() const {
return has_animation(SceneStringNames::get_singleton()->RESET);
return has_animation(SceneStringName(RESET));
}
void AnimationMixer::_build_backup_track_cache() {
@ -2013,7 +2013,7 @@ Ref<AnimatedValuesBackup> AnimationMixer::make_backup() {
Ref<AnimatedValuesBackup> backup;
backup.instantiate();
Ref<Animation> reset_anim = animation_set[SceneStringNames::get_singleton()->RESET].animation;
Ref<Animation> reset_anim = animation_set[SceneStringName(RESET)].animation;
ERR_FAIL_COND_V(reset_anim.is_null(), Ref<AnimatedValuesBackup>());
_blend_init();
@ -2022,7 +2022,7 @@ Ref<AnimatedValuesBackup> AnimationMixer::make_backup() {
pi.delta = 0;
pi.seeked = true;
pi.weight = 1.0;
make_animation_instance(SceneStringNames::get_singleton()->RESET, pi);
make_animation_instance(SceneStringName(RESET), pi);
_build_backup_track_cache();
backup->set_data(track_cache);
@ -2034,7 +2034,7 @@ Ref<AnimatedValuesBackup> AnimationMixer::make_backup() {
void AnimationMixer::reset() {
ERR_FAIL_COND(!can_apply_reset());
Ref<Animation> reset_anim = animation_set[SceneStringNames::get_singleton()->RESET].animation;
Ref<Animation> reset_anim = animation_set[SceneStringName(RESET)].animation;
ERR_FAIL_COND(reset_anim.is_null());
Node *root_node_object = get_node_or_null(root_node);
@ -2044,11 +2044,11 @@ void AnimationMixer::reset() {
root_node_object->add_child(aux_player);
Ref<AnimationLibrary> al;
al.instantiate();
al->add_animation(SceneStringNames::get_singleton()->RESET, reset_anim);
al->add_animation(SceneStringName(RESET), reset_anim);
aux_player->set_reset_on_save_enabled(false);
aux_player->set_root_node(aux_player->get_path_to(root_node_object));
aux_player->add_animation_library("", al);
aux_player->set_assigned_animation(SceneStringNames::get_singleton()->RESET);
aux_player->set_assigned_animation(SceneStringName(RESET));
aux_player->seek(0.0f, true);
aux_player->queue_free();
}
@ -2068,7 +2068,7 @@ Ref<AnimatedValuesBackup> AnimationMixer::apply_reset(bool p_user_initiated) {
}
ERR_FAIL_COND_V(!can_apply_reset(), Ref<AnimatedValuesBackup>());
Ref<Animation> reset_anim = animation_set[SceneStringNames::get_singleton()->RESET].animation;
Ref<Animation> reset_anim = animation_set[SceneStringName(RESET)].animation;
ERR_FAIL_COND_V(reset_anim.is_null(), Ref<AnimatedValuesBackup>());
Ref<AnimatedValuesBackup> backup_current = make_backup();
@ -2286,7 +2286,7 @@ void AnimationMixer::_bind_methods() {
}
AnimationMixer::AnimationMixer() {
root_node = SceneStringNames::get_singleton()->path_pp;
root_node = SceneStringName(path_pp);
}
AnimationMixer::~AnimationMixer() {

View file

@ -41,7 +41,7 @@ bool AnimationPlayer::_set(const StringName &p_name, const Variant &p_value) {
} else if (name.begins_with("next/")) {
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 == SceneStringName(blend_times)) {
Array array = p_value;
int len = array.size();
ERR_FAIL_COND_V(len % 3, false);
@ -326,14 +326,14 @@ void AnimationPlayer::_blend_post_process() {
String new_name = playback.assigned;
playback_queue.pop_front();
if (end_notify) {
emit_signal(SceneStringNames::get_singleton()->animation_changed, old, new_name);
emit_signal(SceneStringName(animation_changed), old, new_name);
}
} else {
_clear_caches();
playing = false;
_set_process(false);
if (end_notify) {
emit_signal(SceneStringNames::get_singleton()->animation_finished, playback.assigned);
emit_signal(SceneStringName(animation_finished), playback.assigned);
if (movie_quit_on_finish && OS::get_singleton()->has_feature("movie")) {
print_line(vformat("Movie Maker mode is enabled. Quitting on animation finish as requested by: %s", get_path()));
get_tree()->quit();
@ -463,7 +463,7 @@ void AnimationPlayer::_play(const StringName &p_name, double p_custom_blend, flo
_set_process(true); // Always process when starting an animation.
playing = true;
emit_signal(SceneStringNames::get_singleton()->animation_started, c.assigned);
emit_signal(SceneStringName(animation_started), c.assigned);
if (is_inside_tree() && Engine::get_singleton()->is_editor_hint()) {
return; // No next in this case.

View file

@ -627,7 +627,7 @@ bool AnimationTree::_blend_pre_process(double p_delta, int p_track_count, const
for (int i = 0; i < p_track_count; i++) {
src_blendsw[i] = 1.0; // By default all go to 1 for the root input.
}
root_animation_node->node_state.base_path = SceneStringNames::get_singleton()->parameters_base_path;
root_animation_node->node_state.base_path = SceneStringName(parameters_base_path);
root_animation_node->node_state.parent = nullptr;
}
@ -788,7 +788,7 @@ void AnimationTree::_update_properties() {
input_activity_map_get.clear();
if (root_animation_node.is_valid()) {
_update_properties_for_node(SceneStringNames::get_singleton()->parameters_base_path, root_animation_node);
_update_properties_for_node(SceneStringName(parameters_base_path), root_animation_node);
}
properties_dirty = false;
@ -810,7 +810,7 @@ void AnimationTree::_notification(int p_what) {
void AnimationTree::set_animation_player(const NodePath &p_path) {
animation_player = p_path;
if (p_path.is_empty()) {
set_root_node(SceneStringNames::get_singleton()->path_pp);
set_root_node(SceneStringName(path_pp));
while (animation_libraries.size()) {
remove_animation_library(animation_libraries[0].name);
}

View file

@ -307,14 +307,14 @@ StringName AudioStreamPlayerInternal::get_bus() const {
return bus;
}
}
return SceneStringNames::get_singleton()->Master;
return SceneStringName(Master);
}
AudioStreamPlayerInternal::AudioStreamPlayerInternal(Node *p_node, const Callable &p_play_callable, bool p_physical) {
node = p_node;
play_callable = p_play_callable;
physical = p_physical;
bus = SceneStringNames::get_singleton()->Master;
bus = SceneStringName(Master);
AudioServer::get_singleton()->connect("bus_layout_changed", callable_mp((Object *)node, &Object::notify_property_list_changed));
AudioServer::get_singleton()->connect("bus_renamed", callable_mp((Object *)node, &Object::notify_property_list_changed).unbind(3));

View file

@ -86,10 +86,10 @@ void Container::_sort_children() {
}
notification(NOTIFICATION_PRE_SORT_CHILDREN);
emit_signal(SceneStringNames::get_singleton()->pre_sort_children);
emit_signal(SceneStringName(pre_sort_children));
notification(NOTIFICATION_SORT_CHILDREN);
emit_signal(SceneStringNames::get_singleton()->sort_children);
emit_signal(SceneStringName(sort_children));
pending_sort = false;
}

View file

@ -1606,7 +1606,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(SceneStringName(minimum_size_changed));
}
}
@ -1770,7 +1770,7 @@ void Control::set_h_size_flags(BitField<SizeFlags> p_flags) {
return;
}
data.h_size_flags = p_flags;
emit_signal(SceneStringNames::get_singleton()->size_flags_changed);
emit_signal(SceneStringName(size_flags_changed));
}
BitField<Control::SizeFlags> Control::get_h_size_flags() const {
@ -1784,7 +1784,7 @@ void Control::set_v_size_flags(BitField<SizeFlags> p_flags) {
return;
}
data.v_size_flags = p_flags;
emit_signal(SceneStringNames::get_singleton()->size_flags_changed);
emit_signal(SceneStringName(size_flags_changed));
}
BitField<Control::SizeFlags> Control::get_v_size_flags() const {
@ -1799,7 +1799,7 @@ void Control::set_stretch_ratio(real_t p_ratio) {
}
data.expand = p_ratio;
emit_signal(SceneStringNames::get_singleton()->size_flags_changed);
emit_signal(SceneStringName(size_flags_changed));
}
real_t Control::get_stretch_ratio() const {
@ -1811,7 +1811,7 @@ real_t Control::get_stretch_ratio() const {
void Control::_call_gui_input(const Ref<InputEvent> &p_event) {
if (p_event->get_device() != InputEvent::DEVICE_ID_INTERNAL) {
emit_signal(SceneStringNames::get_singleton()->gui_input, p_event); // Signal should be first, so it's possible to override an event (and then accept it).
emit_signal(SceneStringName(gui_input), p_event); // Signal should be first, so it's possible to override an event (and then accept it).
}
if (!is_inside_tree() || get_viewport()->is_input_handled()) {
return; // Input was handled, abort.
@ -3299,7 +3299,7 @@ void Control::_notification(int p_notification) {
} break;
case NOTIFICATION_RESIZED: {
emit_signal(SceneStringNames::get_singleton()->resized);
emit_signal(SceneStringName(resized));
} break;
case NOTIFICATION_DRAW: {
@ -3309,25 +3309,25 @@ void Control::_notification(int p_notification) {
} break;
case NOTIFICATION_MOUSE_ENTER: {
emit_signal(SceneStringNames::get_singleton()->mouse_entered);
emit_signal(SceneStringName(mouse_entered));
} break;
case NOTIFICATION_MOUSE_EXIT: {
emit_signal(SceneStringNames::get_singleton()->mouse_exited);
emit_signal(SceneStringName(mouse_exited));
} break;
case NOTIFICATION_FOCUS_ENTER: {
emit_signal(SceneStringNames::get_singleton()->focus_entered);
emit_signal(SceneStringName(focus_entered));
queue_redraw();
} break;
case NOTIFICATION_FOCUS_EXIT: {
emit_signal(SceneStringNames::get_singleton()->focus_exited);
emit_signal(SceneStringName(focus_exited));
queue_redraw();
} break;
case NOTIFICATION_THEME_CHANGED: {
emit_signal(SceneStringNames::get_singleton()->theme_changed);
emit_signal(SceneStringName(theme_changed));
_invalidate_theme_cache();
_update_theme_item_cache();

View file

@ -111,7 +111,7 @@ void NinePatchRect::set_texture(const Ref<Texture2D> &p_tex) {
queue_redraw();
update_minimum_size();
emit_signal(SceneStringNames::get_singleton()->texture_changed);
emit_signal(SceneStringName(texture_changed));
}
Ref<Texture2D> NinePatchRect::get_texture() const {

View file

@ -163,7 +163,7 @@ void VideoStreamPlayer::_notification(int p_notification) {
play();
return;
}
emit_signal(SceneStringNames::get_singleton()->finished);
emit_signal(SceneStringName(finished));
}
} break;
@ -460,7 +460,7 @@ StringName VideoStreamPlayer::get_bus() const {
return bus;
}
}
return SceneStringNames::get_singleton()->Master;
return SceneStringName(Master);
}
void VideoStreamPlayer::_validate_property(PropertyInfo &p_property) const {

View file

@ -95,7 +95,7 @@ void CanvasItem::_handle_visibility_change(bool p_visible) {
if (p_visible) {
queue_redraw();
} else {
emit_signal(SceneStringNames::get_singleton()->hidden);
emit_signal(SceneStringName(hidden));
}
_block();
@ -141,7 +141,7 @@ void CanvasItem::_redraw_callback() {
drawing = true;
current_item_drawn = this;
notification(NOTIFICATION_DRAW);
emit_signal(SceneStringNames::get_singleton()->draw);
emit_signal(SceneStringName(draw));
GDVIRTUAL_CALL(_draw);
current_item_drawn = nullptr;
drawing = false;
@ -309,7 +309,7 @@ void CanvasItem::_notification(int p_what) {
window = Object::cast_to<Window>(viewport);
if (window) {
window->connect(SceneStringNames::get_singleton()->visibility_changed, callable_mp(this, &CanvasItem::_window_visibility_changed));
window->connect(SceneStringName(visibility_changed), callable_mp(this, &CanvasItem::_window_visibility_changed));
parent_visible_in_tree = window->is_visible();
} else {
parent_visible_in_tree = true;
@ -363,7 +363,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(SceneStringName(visibility_changed), callable_mp(this, &CanvasItem::_window_visibility_changed));
window = nullptr;
}
_set_global_invalid(true);
@ -383,7 +383,7 @@ void CanvasItem::_notification(int p_what) {
case NOTIFICATION_VISIBILITY_CHANGED: {
ERR_MAIN_THREAD_GUARD;
emit_signal(SceneStringNames::get_singleton()->visibility_changed);
emit_signal(SceneStringName(visibility_changed));
} break;
case NOTIFICATION_WORLD_2D_CHANGED: {
ERR_MAIN_THREAD_GUARD;
@ -555,7 +555,7 @@ void CanvasItem::item_rect_changed(bool p_size_changed) {
if (p_size_changed) {
queue_redraw();
}
emit_signal(SceneStringNames::get_singleton()->item_rect_changed);
emit_signal(SceneStringName(item_rect_changed));
}
void CanvasItem::set_z_index(int p_z) {

View file

@ -266,7 +266,7 @@ void Node::_propagate_ready() {
if (data.ready_first) {
data.ready_first = false;
notification(NOTIFICATION_READY);
emit_signal(SceneStringNames::get_singleton()->ready);
emit_signal(SceneStringName(ready));
}
}
@ -295,7 +295,7 @@ void Node::_propagate_enter_tree() {
GDVIRTUAL_CALL(_enter_tree);
emit_signal(SceneStringNames::get_singleton()->tree_entered);
emit_signal(SceneStringName(tree_entered));
data.tree->node_added(this);
@ -350,7 +350,7 @@ void Node::_propagate_after_exit_tree() {
data.blocked--;
emit_signal(SceneStringNames::get_singleton()->tree_exited);
emit_signal(SceneStringName(tree_exited));
}
void Node::_propagate_exit_tree() {
@ -372,7 +372,7 @@ void Node::_propagate_exit_tree() {
GDVIRTUAL_CALL(_exit_tree);
emit_signal(SceneStringNames::get_singleton()->tree_exiting);
emit_signal(SceneStringName(tree_exiting));
notification(NOTIFICATION_EXIT_TREE, true);
if (data.tree) {
@ -1738,11 +1738,11 @@ 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 == SceneStringName(dot)) { // .
next = current;
} else if (name == SceneStringNames::get_singleton()->doubledot) { // ..
} else if (name == SceneStringName(doubledot)) { // ..
if (current == nullptr || !current->data.parent) {
return nullptr;
@ -2667,7 +2667,7 @@ Node *Node::_duplicate(int p_flags, HashMap<const Node *, Node *> *r_duplimap) c
node->data.editable_instance = data.editable_instance;
}
StringName script_property_name = CoreStringNames::get_singleton()->_script;
StringName script_property_name = CoreStringName(script);
List<const Node *> hidden_roots;
List<const Node *> node_tree;
@ -3323,7 +3323,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(SceneStringName(node_configuration_warning_changed), this);
}
#endif
}

View file

@ -223,11 +223,11 @@ void ShaderGlobalsOverride::_get_property_list(List<PropertyInfo> *p_list) const
void ShaderGlobalsOverride::_activate() {
ERR_FAIL_NULL(get_tree());
List<Node *> nodes;
get_tree()->get_nodes_in_group(SceneStringNames::get_singleton()->shader_overrides_group_active, &nodes);
get_tree()->get_nodes_in_group(SceneStringName(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(SceneStringName(shader_overrides_group_active));
for (const KeyValue<StringName, Override> &E : overrides) {
const Override *o = &E.value;
@ -248,7 +248,7 @@ void ShaderGlobalsOverride::_activate() {
void ShaderGlobalsOverride::_notification(int p_what) {
switch (p_what) {
case Node::NOTIFICATION_ENTER_TREE: {
add_to_group(SceneStringNames::get_singleton()->shader_overrides_group);
add_to_group(SceneStringName(shader_overrides_group));
_activate();
} break;
@ -263,9 +263,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_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringNames::get_singleton()->shader_overrides_group, "_activate"); //another may want to activate when this is removed
remove_from_group(SceneStringName(shader_overrides_group_active));
remove_from_group(SceneStringName(shader_overrides_group));
get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringName(shader_overrides_group), "_activate"); //another may want to activate when this is removed
active = false;
} break;
}

View file

@ -846,7 +846,7 @@ void Window::set_visible(bool p_visible) {
focused = false;
}
notification(NOTIFICATION_VISIBILITY_CHANGED);
emit_signal(SceneStringNames::get_singleton()->visibility_changed);
emit_signal(SceneStringName(visibility_changed));
RS::get_singleton()->viewport_set_active(get_viewport_rid(), visible);
@ -1321,7 +1321,7 @@ void Window::_notification(int p_what) {
}
if (visible) {
notification(NOTIFICATION_VISIBILITY_CHANGED);
emit_signal(SceneStringNames::get_singleton()->visibility_changed);
emit_signal(SceneStringName(visibility_changed));
RS::get_singleton()->viewport_set_active(get_viewport_rid(), true);
}
@ -1337,7 +1337,7 @@ void Window::_notification(int p_what) {
} break;
case NOTIFICATION_THEME_CHANGED: {
emit_signal(SceneStringNames::get_singleton()->theme_changed);
emit_signal(SceneStringName(theme_changed));
_invalidate_theme_cache();
_update_theme_item_cache();
} break;
@ -1404,11 +1404,11 @@ void Window::_notification(int p_what) {
} break;
case NOTIFICATION_VP_MOUSE_ENTER: {
emit_signal(SceneStringNames::get_singleton()->mouse_entered);
emit_signal(SceneStringName(mouse_entered));
} break;
case NOTIFICATION_VP_MOUSE_EXIT: {
emit_signal(SceneStringNames::get_singleton()->mouse_exited);
emit_signal(SceneStringName(mouse_exited));
} break;
}
}
@ -1622,7 +1622,7 @@ void Window::_window_input(const Ref<InputEvent> &p_ev) {
_input_from_window(p_ev);
if (p_ev->get_device() != InputEvent::DEVICE_ID_INTERNAL && is_inside_tree()) {
emit_signal(SceneStringNames::get_singleton()->window_input, p_ev);
emit_signal(SceneStringName(window_input), p_ev);
}
if (is_inside_tree()) {

View file

@ -328,7 +328,7 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const {
ERR_FAIL_INDEX_V(nprops[j].name, sname_count, nullptr);
if (snames[nprops[j].name] == CoreStringNames::get_singleton()->_script) {
if (snames[nprops[j].name] == CoreStringName(script)) {
//work around to avoid old script variables from disappearing, should be the proper fix to:
//https://github.com/godotengine/godot/issues/2958

View file

@ -277,5 +277,5 @@ void SpriteFrames::_bind_methods() {
}
SpriteFrames::SpriteFrames() {
add_animation(SceneStringNames::get_singleton()->_default);
add_animation(SceneStringName(default_));
}

View file

@ -196,7 +196,7 @@ SceneStringNames::SceneStringNames() {
// Audio bus name.
Master = StaticCString::create("Master");
_default = StaticCString::create("default");
default_ = StaticCString::create("default");
_window_group = StaticCString::create("_window_group");
_window_input = StaticCString::create("_window_input");

View file

@ -198,7 +198,7 @@ public:
NodePath path_pp;
StringName _default;
StringName default_; // "default", conflict with C++ keyword.
StringName node_configuration_warning_changed;
@ -224,4 +224,6 @@ public:
#endif
};
#define SceneStringName(m_name) SceneStringNames::get_singleton()->m_name
#endif // SCENE_STRING_NAMES_H

View file

@ -762,7 +762,7 @@ void AudioServer::set_bus_count(int p_count) {
buses[i]->bypass = false;
buses[i]->volume_db = 0;
if (i > 0) {
buses[i]->send = SceneStringNames::get_singleton()->Master;
buses[i]->send = SceneStringName(Master);
}
bus_map[attempt] = buses[i];
@ -1600,7 +1600,7 @@ void AudioServer::set_bus_layout(const Ref<AudioBusLayout> &p_bus_layout) {
for (int i = 0; i < p_bus_layout->buses.size(); i++) {
Bus *bus = memnew(Bus);
if (i == 0) {
bus->name = SceneStringNames::get_singleton()->Master;
bus->name = SceneStringName(Master);
} else {
bus->name = p_bus_layout->buses[i].name;
bus->send = p_bus_layout->buses[i].send;
@ -1923,5 +1923,5 @@ void AudioBusLayout::_get_property_list(List<PropertyInfo> *p_list) const {
AudioBusLayout::AudioBusLayout() {
buses.resize(1);
buses.write[0].name = SceneStringNames::get_singleton()->Master;
buses.write[0].name = SceneStringName(Master);
}

View file

@ -251,7 +251,7 @@ TEST_CASE("[Object] Script property setter") {
Variant script;
bool valid = false;
object.set(CoreStringNames::get_singleton()->_script, script, &valid);
object.set(CoreStringName(script), script, &valid);
CHECK(valid);
CHECK_MESSAGE(
object.get_script() == script,
@ -264,7 +264,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(CoreStringName(script), &valid);
CHECK(valid);
CHECK_MESSAGE(
actual_value == script,