From af518b2d3be99d2f269a38c2572cec46d232c01d Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 8 Feb 2024 18:11:25 +0100 Subject: [PATCH] Ported parts of: [3.x] Add Selected Collision Group in TileSet Editor Also moves the TileSet Script property down to its own category. - Mickeon https://github.com/godotengine/godot/commit/211c707e67725f27ae995a923dd206cca9976315 --- modules/tile_map/tile_set_editor_plugin.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/tile_map/tile_set_editor_plugin.cpp b/modules/tile_map/tile_set_editor_plugin.cpp index e58de9ff6..f747cabd7 100644 --- a/modules/tile_map/tile_set_editor_plugin.cpp +++ b/modules/tile_map/tile_set_editor_plugin.cpp @@ -3627,6 +3627,7 @@ void TilesetEditorContext::_get_property_list(List *p_list) const p_list->push_back(PropertyInfo(Variant::VECTOR2, "options_step")); p_list->push_back(PropertyInfo(Variant::VECTOR2, "options_separation")); } + if (tileset_editor->get_current_tile() >= 0 && !tileset.is_null()) { int id = tileset_editor->get_current_tile(); p_list->push_back(PropertyInfo(Variant::NIL, "Selected Tile", PROPERTY_HINT_NONE, "tile_", PROPERTY_USAGE_GROUP)); @@ -3652,20 +3653,27 @@ void TilesetEditorContext::_get_property_list(List *p_list) const p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_shape_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); p_list->push_back(PropertyInfo(Variant::INT, "tile_z_index", PROPERTY_HINT_RANGE, itos(RS::CANVAS_ITEM_Z_MIN) + "," + itos(RS::CANVAS_ITEM_Z_MAX) + ",1")); } + if (tileset_editor->edit_mode == TileSetEditor::EDITMODE_COLLISION && tileset_editor->edited_collision_shape.is_valid()) { p_list->push_back(PropertyInfo(Variant::OBJECT, "selected_collision", PROPERTY_HINT_RESOURCE_TYPE, tileset_editor->edited_collision_shape->get_class())); + if (tileset_editor->edited_collision_shape.is_valid()) { + p_list->push_back(PropertyInfo(Variant::NIL, "Collision Options", PROPERTY_HINT_NONE, "selected_collision_", PROPERTY_USAGE_GROUP)); p_list->push_back(PropertyInfo(Variant::BOOL, "selected_collision_one_way", PROPERTY_HINT_NONE)); p_list->push_back(PropertyInfo(Variant::REAL, "selected_collision_one_way_margin", PROPERTY_HINT_NONE)); } } + if (tileset_editor->edit_mode == TileSetEditor::EDITMODE_NAVIGATION && tileset_editor->edited_navigation_shape.is_valid()) { p_list->push_back(PropertyInfo(Variant::OBJECT, "selected_navigation", PROPERTY_HINT_RESOURCE_TYPE, tileset_editor->edited_navigation_shape->get_class())); } + if (tileset_editor->edit_mode == TileSetEditor::EDITMODE_OCCLUSION && tileset_editor->edited_occlusion_shape.is_valid()) { p_list->push_back(PropertyInfo(Variant::OBJECT, "selected_occlusion", PROPERTY_HINT_RESOURCE_TYPE, tileset_editor->edited_occlusion_shape->get_class())); } + if (!tileset.is_null()) { + p_list->push_back(PropertyInfo(Variant::NIL, "TileSet", PROPERTY_HINT_NONE, "tileset", PROPERTY_USAGE_CATEGORY)); p_list->push_back(PropertyInfo(Variant::OBJECT, "tileset_script", PROPERTY_HINT_RESOURCE_TYPE, "Script")); } }