mirror of
https://github.com/godotengine/godot.git
synced 2025-10-31 21:51:22 +00:00
Remove duplicate shortcut definitions
This commit is contained in:
parent
aaa4560729
commit
e065d7132a
12 changed files with 68 additions and 49 deletions
|
|
@ -2183,13 +2183,6 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
->get_viewport_control()
|
||||
->connect(SceneStringName(mouse_exited), callable_mp(this, &TileMapLayerEditorTilesPlugin::_mouse_exited_viewport));
|
||||
|
||||
// --- Shortcuts ---
|
||||
ED_SHORTCUT("tiles_editor/cut", TTR("Cut"), KeyModifierMask::CMD_OR_CTRL | Key::X);
|
||||
ED_SHORTCUT("tiles_editor/copy", TTR("Copy"), KeyModifierMask::CMD_OR_CTRL | Key::C);
|
||||
ED_SHORTCUT("tiles_editor/paste", TTR("Paste"), KeyModifierMask::CMD_OR_CTRL | Key::V);
|
||||
ED_SHORTCUT("tiles_editor/cancel", TTR("Cancel"), Key::ESCAPE);
|
||||
ED_SHORTCUT("tiles_editor/delete", TTR("Delete"), Key::KEY_DELETE);
|
||||
|
||||
// --- Initialize references ---
|
||||
tile_map_clipboard.instantiate();
|
||||
selection_pattern.instantiate();
|
||||
|
|
@ -2217,7 +2210,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
paint_tool_button->set_theme_type_variation("FlatButton");
|
||||
paint_tool_button->set_toggle_mode(true);
|
||||
paint_tool_button->set_button_group(tool_buttons_group);
|
||||
paint_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/paint_tool", TTR("Paint"), Key::D));
|
||||
paint_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/paint_tool"));
|
||||
paint_tool_button->set_tooltip_text(TTR("Shift: Draw line.") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Shift: Draw rectangle."));
|
||||
paint_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
|
||||
tilemap_tiles_tools_buttons->add_child(paint_tool_button);
|
||||
|
|
@ -2228,7 +2221,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
line_tool_button->set_toggle_mode(true);
|
||||
line_tool_button->set_button_group(tool_buttons_group);
|
||||
// TRANSLATORS: This refers to the line tool in the tilemap editor.
|
||||
line_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/line_tool", TTR("Line", "Tool"), Key::L));
|
||||
line_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/line_tool"));
|
||||
line_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
|
||||
tilemap_tiles_tools_buttons->add_child(line_tool_button);
|
||||
viewport_shortcut_buttons.push_back(line_tool_button);
|
||||
|
|
@ -2237,7 +2230,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
rect_tool_button->set_theme_type_variation("FlatButton");
|
||||
rect_tool_button->set_toggle_mode(true);
|
||||
rect_tool_button->set_button_group(tool_buttons_group);
|
||||
rect_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/rect_tool", TTR("Rect"), Key::R));
|
||||
rect_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/rect_tool"));
|
||||
rect_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
|
||||
tilemap_tiles_tools_buttons->add_child(rect_tool_button);
|
||||
viewport_shortcut_buttons.push_back(rect_tool_button);
|
||||
|
|
@ -2246,7 +2239,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
bucket_tool_button->set_theme_type_variation("FlatButton");
|
||||
bucket_tool_button->set_toggle_mode(true);
|
||||
bucket_tool_button->set_button_group(tool_buttons_group);
|
||||
bucket_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/bucket_tool", TTR("Bucket"), Key::B));
|
||||
bucket_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/bucket_tool"));
|
||||
bucket_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
|
||||
tilemap_tiles_tools_buttons->add_child(bucket_tool_button);
|
||||
toolbar->add_child(tilemap_tiles_tools_buttons);
|
||||
|
|
@ -2263,7 +2256,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
picker_button = memnew(Button);
|
||||
picker_button->set_theme_type_variation("FlatButton");
|
||||
picker_button->set_toggle_mode(true);
|
||||
picker_button->set_shortcut(ED_SHORTCUT("tiles_editor/picker", TTR("Picker"), Key::P));
|
||||
picker_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/picker"));
|
||||
Key key = (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) ? Key::META : Key::CTRL;
|
||||
picker_button->set_tooltip_text(vformat(TTR("Alternatively hold %s with other tools to pick tile."), find_keycode_name(key)));
|
||||
picker_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
|
||||
|
|
@ -2274,7 +2267,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
erase_button = memnew(Button);
|
||||
erase_button->set_theme_type_variation("FlatButton");
|
||||
erase_button->set_toggle_mode(true);
|
||||
erase_button->set_shortcut(ED_SHORTCUT("tiles_editor/eraser", TTR("Eraser"), Key::E));
|
||||
erase_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/eraser"));
|
||||
erase_button->set_tooltip_text(TTR("Alternatively use RMB to erase tiles."));
|
||||
erase_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
|
||||
tools_settings->add_child(erase_button);
|
||||
|
|
@ -3552,7 +3545,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
|
|||
paint_tool_button->set_toggle_mode(true);
|
||||
paint_tool_button->set_button_group(tool_buttons_group);
|
||||
paint_tool_button->set_pressed(true);
|
||||
paint_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/paint_tool", TTR("Paint"), Key::D));
|
||||
paint_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/paint_tool"));
|
||||
paint_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
|
||||
tilemap_tiles_tools_buttons->add_child(paint_tool_button);
|
||||
viewport_shortcut_buttons.push_back(paint_tool_button);
|
||||
|
|
@ -3561,7 +3554,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
|
|||
line_tool_button->set_theme_type_variation("FlatButton");
|
||||
line_tool_button->set_toggle_mode(true);
|
||||
line_tool_button->set_button_group(tool_buttons_group);
|
||||
line_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/line_tool", TTR("Line"), Key::L));
|
||||
line_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/line_tool"));
|
||||
line_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
|
||||
tilemap_tiles_tools_buttons->add_child(line_tool_button);
|
||||
viewport_shortcut_buttons.push_back(line_tool_button);
|
||||
|
|
@ -3570,7 +3563,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
|
|||
rect_tool_button->set_theme_type_variation("FlatButton");
|
||||
rect_tool_button->set_toggle_mode(true);
|
||||
rect_tool_button->set_button_group(tool_buttons_group);
|
||||
rect_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/rect_tool", TTR("Rect"), Key::R));
|
||||
rect_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/rect_tool"));
|
||||
rect_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
|
||||
tilemap_tiles_tools_buttons->add_child(rect_tool_button);
|
||||
viewport_shortcut_buttons.push_back(rect_tool_button);
|
||||
|
|
@ -3579,7 +3572,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
|
|||
bucket_tool_button->set_theme_type_variation("FlatButton");
|
||||
bucket_tool_button->set_toggle_mode(true);
|
||||
bucket_tool_button->set_button_group(tool_buttons_group);
|
||||
bucket_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/bucket_tool", TTR("Bucket"), Key::B));
|
||||
bucket_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/bucket_tool"));
|
||||
bucket_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
|
||||
tilemap_tiles_tools_buttons->add_child(bucket_tool_button);
|
||||
viewport_shortcut_buttons.push_back(bucket_tool_button);
|
||||
|
|
@ -3597,7 +3590,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
|
|||
picker_button = memnew(Button);
|
||||
picker_button->set_theme_type_variation("FlatButton");
|
||||
picker_button->set_toggle_mode(true);
|
||||
picker_button->set_shortcut(ED_SHORTCUT("tiles_editor/picker", TTR("Picker"), Key::P));
|
||||
picker_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/picker"));
|
||||
picker_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
|
||||
tools_settings->add_child(picker_button);
|
||||
viewport_shortcut_buttons.push_back(picker_button);
|
||||
|
|
@ -3606,7 +3599,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
|
|||
erase_button = memnew(Button);
|
||||
erase_button->set_theme_type_variation("FlatButton");
|
||||
erase_button->set_toggle_mode(true);
|
||||
erase_button->set_shortcut(ED_SHORTCUT("tiles_editor/eraser", TTR("Eraser"), Key::E));
|
||||
erase_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/eraser"));
|
||||
erase_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
|
||||
tools_settings->add_child(erase_button);
|
||||
viewport_shortcut_buttons.push_back(erase_button);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue