| 692 | #endif // DEBUG_ENABLED |
| 693 | |
| 694 | bool TileMap::_set(const StringName &p_name, const Variant &p_value) { |
| 695 | int index; |
| 696 | const String sname = p_name; |
| 697 | |
| 698 | Vector<String> components = String(p_name).split("/", true, 2); |
| 699 | if (sname == "format") { |
| 700 | if (p_value.get_type() == Variant::INT) { |
| 701 | format = (TileMapDataFormat)(p_value.operator int64_t()); // Set format used for loading. |
| 702 | return true; |
| 703 | } |
| 704 | } |
| 705 | #ifndef DISABLE_DEPRECATED |
| 706 | else if (sname == "cell_quadrant_size") { |
| 707 | set_rendering_quadrant_size(p_value); |
| 708 | return true; |
| 709 | } |
| 710 | #endif // DISABLE_DEPRECATED |
| 711 | else if (property_helper.is_property_valid(sname, &index)) { |
| 712 | if (index >= (int)layers.size()) { |
| 713 | while (index >= (int)layers.size()) { |
| 714 | TileMapLayer *new_layer = memnew(TileMapLayer); |
| 715 | add_child(new_layer, false, INTERNAL_MODE_FRONT); |
| 716 | new_layer->set_as_tile_map_internal_node(index); |
| 717 | new_layer->set_name(vformat("Layer%d", index)); |
| 718 | new_layer->set_tile_set(tile_set); |
| 719 | new_layer->connect(CoreStringName(changed), callable_mp(this, &TileMap::_emit_changed)); |
| 720 | layers.push_back(new_layer); |
| 721 | } |
| 722 | |
| 723 | notify_property_list_changed(); |
| 724 | _emit_changed(); |
| 725 | update_configuration_warnings(); |
| 726 | } |
| 727 | |
| 728 | if (property_helper.property_set_value(sname, p_value)) { |
| 729 | if (components[1] == "tile_data") { |
| 730 | _emit_changed(); |
| 731 | } |
| 732 | return true; |
| 733 | } |
| 734 | } |
| 735 | return false; |
| 736 | } |
| 737 | |
| 738 | bool TileMap::_get(const StringName &p_name, Variant &r_ret) const { |
| 739 | const String sname = p_name; |
nothing calls this directly
no test coverage detected