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

@ -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) {