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

@ -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();
}