From df69073589c452f9f601ac69d039797f986c47b3 Mon Sep 17 00:00:00 2001 From: kobewi Date: Tue, 25 Jul 2023 22:55:29 +0200 Subject: [PATCH] Add help label about creating multiple/big tiles --- .../plugins/tiles/tile_set_atlas_source_editor.cpp | 14 ++++++++++++++ .../plugins/tiles/tile_set_atlas_source_editor.h | 1 + 2 files changed, 15 insertions(+) diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index f4290ba508..ab68232b83 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -966,6 +966,8 @@ void TileSetAtlasSourceEditor::_update_atlas_view() { if (tile_set.is_null()) { return; + } else { + tile_create_help->set_visible(tools_button_group->get_pressed_button() == tool_setup_atlas_source_button); } Vector2i pos; @@ -2572,6 +2574,18 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { tile_atlas_view->connect("transform_changed", callable_mp(this, &TileSetAtlasSourceEditor::_tile_atlas_view_transform_changed).unbind(2)); right_panel->add_child(tile_atlas_view); + tile_create_help = memnew(HBoxContainer); + tile_atlas_view->add_child(tile_create_help); + tile_create_help->set_mouse_filter(MOUSE_FILTER_IGNORE); + tile_create_help->set_anchors_and_offsets_preset(Control::PRESET_BOTTOM_LEFT, Control::PRESET_MODE_MINSIZE, 30 * EDSCALE); + tile_create_help->add_theme_constant_override("separation", 30 * EDSCALE); + + Label *help_label = memnew(Label(TTR("Hold Ctrl to create multiple tiles."))); + tile_create_help->add_child(help_label); + + help_label = memnew(Label(TTR("Hold Shift to create big tiles."))); + tile_create_help->add_child(help_label); + base_tile_popup_menu = memnew(PopupMenu); base_tile_popup_menu->add_shortcut(ED_SHORTCUT("tiles_editor/delete", TTR("Delete"), Key::KEY_DELETE), TILE_DELETE); base_tile_popup_menu->add_item(TTR("Create an Alternative Tile"), TILE_CREATE_ALTERNATIVE); diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.h b/editor/plugins/tiles/tile_set_atlas_source_editor.h index 6bbede520f..fa0d166942 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.h +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.h @@ -159,6 +159,7 @@ private: // -- Atlas view -- TileAtlasView *tile_atlas_view = nullptr; + HBoxContainer *tile_create_help = nullptr; // Dragging enum DragType {