You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Initial editor accessibility.
This commit is contained in:
@@ -2219,6 +2219,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
||||
select_tool_button->set_button_group(tool_buttons_group);
|
||||
select_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/selection_tool", TTRC("Selection Tool"), Key::S));
|
||||
select_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
|
||||
select_tool_button->set_accessibility_name(TTRC("Selection Tool"));
|
||||
tilemap_tiles_tools_buttons->add_child(select_tool_button);
|
||||
viewport_shortcut_buttons.push_back(select_tool_button);
|
||||
|
||||
@@ -2229,6 +2230,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
||||
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));
|
||||
paint_tool_button->set_accessibility_name(TTRC("Paint Tool"));
|
||||
tilemap_tiles_tools_buttons->add_child(paint_tool_button);
|
||||
viewport_shortcut_buttons.push_back(paint_tool_button);
|
||||
|
||||
@@ -2239,6 +2241,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
||||
// TRANSLATORS: This refers to the line tool in the tilemap editor.
|
||||
line_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/line_tool"));
|
||||
line_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
|
||||
line_tool_button->set_accessibility_name(TTRC("Line Tool"));
|
||||
tilemap_tiles_tools_buttons->add_child(line_tool_button);
|
||||
viewport_shortcut_buttons.push_back(line_tool_button);
|
||||
|
||||
@@ -2248,6 +2251,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
||||
rect_tool_button->set_button_group(tool_buttons_group);
|
||||
rect_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/rect_tool"));
|
||||
rect_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
|
||||
rect_tool_button->set_accessibility_name(TTRC("Rect Tool"));
|
||||
tilemap_tiles_tools_buttons->add_child(rect_tool_button);
|
||||
viewport_shortcut_buttons.push_back(rect_tool_button);
|
||||
|
||||
@@ -2257,6 +2261,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
||||
bucket_tool_button->set_button_group(tool_buttons_group);
|
||||
bucket_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/bucket_tool"));
|
||||
bucket_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
|
||||
bucket_tool_button->set_accessibility_name(TTRC("Bucket Tool"));
|
||||
tilemap_tiles_tools_buttons->add_child(bucket_tool_button);
|
||||
toolbar->add_child(tilemap_tiles_tools_buttons);
|
||||
viewport_shortcut_buttons.push_back(bucket_tool_button);
|
||||
@@ -2276,6 +2281,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
||||
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));
|
||||
picker_button->set_accessibility_name(TTRC("Pick"));
|
||||
tools_settings->add_child(picker_button);
|
||||
viewport_shortcut_buttons.push_back(picker_button);
|
||||
|
||||
@@ -2286,6 +2292,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
||||
erase_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/eraser"));
|
||||
erase_button->set_tooltip_text(TTRC("Alternatively use RMB to erase tiles."));
|
||||
erase_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
|
||||
erase_button->set_accessibility_name(TTRC("Erase"));
|
||||
tools_settings->add_child(erase_button);
|
||||
viewport_shortcut_buttons.push_back(erase_button);
|
||||
|
||||
@@ -2299,6 +2306,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
||||
transform_button_rotate_left->set_shortcut(ED_SHORTCUT("tiles_editor/rotate_tile_left", TTRC("Rotate Tile Left"), Key::Z));
|
||||
transform_toolbar->add_child(transform_button_rotate_left);
|
||||
transform_button_rotate_left->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_ROTATE_LEFT));
|
||||
transform_button_rotate_left->set_accessibility_name(TTRC("Rotate Tile Left"));
|
||||
viewport_shortcut_buttons.push_back(transform_button_rotate_left);
|
||||
|
||||
transform_button_rotate_right = memnew(Button);
|
||||
@@ -2306,6 +2314,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
||||
transform_button_rotate_right->set_shortcut(ED_SHORTCUT("tiles_editor/rotate_tile_right", TTRC("Rotate Tile Right"), Key::X));
|
||||
transform_toolbar->add_child(transform_button_rotate_right);
|
||||
transform_button_rotate_right->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_ROTATE_RIGHT));
|
||||
transform_button_rotate_right->set_accessibility_name(TTRC("Rotate Tile Right"));
|
||||
viewport_shortcut_buttons.push_back(transform_button_rotate_right);
|
||||
|
||||
transform_button_flip_h = memnew(Button);
|
||||
@@ -2313,6 +2322,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
||||
transform_button_flip_h->set_shortcut(ED_SHORTCUT("tiles_editor/flip_tile_horizontal", TTRC("Flip Tile Horizontally"), Key::C));
|
||||
transform_toolbar->add_child(transform_button_flip_h);
|
||||
transform_button_flip_h->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_FLIP_H));
|
||||
transform_button_flip_h->set_accessibility_name(TTRC("Flip Tile Horizontally"));
|
||||
viewport_shortcut_buttons.push_back(transform_button_flip_h);
|
||||
|
||||
transform_button_flip_v = memnew(Button);
|
||||
@@ -2320,6 +2330,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
||||
transform_button_flip_v->set_shortcut(ED_SHORTCUT("tiles_editor/flip_tile_vertical", TTRC("Flip Tile Vertically"), Key::V));
|
||||
transform_toolbar->add_child(transform_button_flip_v);
|
||||
transform_button_flip_v->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_FLIP_V));
|
||||
transform_button_flip_v->set_accessibility_name(TTRC("Flip Tile Vertically"));
|
||||
viewport_shortcut_buttons.push_back(transform_button_flip_v);
|
||||
|
||||
// Separator 2.
|
||||
@@ -2339,6 +2350,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
||||
random_tile_toggle->set_toggle_mode(true);
|
||||
random_tile_toggle->set_tooltip_text(TTR("Place Random Tile"));
|
||||
random_tile_toggle->connect(SceneStringName(toggled), callable_mp(this, &TileMapLayerEditorTilesPlugin::_on_random_tile_checkbox_toggled));
|
||||
random_tile_toggle->set_accessibility_name(TTRC("Place Random Tile"));
|
||||
tools_settings->add_child(random_tile_toggle);
|
||||
|
||||
// Random tile scattering.
|
||||
@@ -2356,6 +2368,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
||||
scatter_spinbox->set_tooltip_text(TTR("Modifies the chance of painting nothing instead of a randomly selected tile."));
|
||||
scatter_spinbox->get_line_edit()->add_theme_constant_override("minimum_character_width", 4);
|
||||
scatter_spinbox->connect(SceneStringName(value_changed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_on_scattering_spinbox_changed));
|
||||
scatter_spinbox->set_accessibility_name(TTRC("Scattering"));
|
||||
scatter_controls_container->add_child(scatter_spinbox);
|
||||
tools_settings->add_child(scatter_controls_container);
|
||||
|
||||
@@ -2404,6 +2417,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
||||
source_sort_button->set_flat(false);
|
||||
source_sort_button->set_theme_type_variation("FlatMenuButton");
|
||||
source_sort_button->set_tooltip_text(TTR("Sort sources"));
|
||||
source_sort_button->set_accessibility_name(TTRC("Sort sources"));
|
||||
|
||||
PopupMenu *p = source_sort_button->get_popup();
|
||||
p->connect(SceneStringName(id_pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_set_source_sort));
|
||||
@@ -3571,6 +3585,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
|
||||
paint_tool_button->set_pressed(true);
|
||||
paint_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/paint_tool"));
|
||||
paint_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
|
||||
paint_tool_button->set_accessibility_name(TTRC("Paint Tool"));
|
||||
tilemap_tiles_tools_buttons->add_child(paint_tool_button);
|
||||
viewport_shortcut_buttons.push_back(paint_tool_button);
|
||||
|
||||
@@ -3580,6 +3595,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
|
||||
line_tool_button->set_button_group(tool_buttons_group);
|
||||
line_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/line_tool"));
|
||||
line_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
|
||||
line_tool_button->set_accessibility_name(TTRC("Line Tool"));
|
||||
tilemap_tiles_tools_buttons->add_child(line_tool_button);
|
||||
viewport_shortcut_buttons.push_back(line_tool_button);
|
||||
|
||||
@@ -3589,6 +3605,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
|
||||
rect_tool_button->set_button_group(tool_buttons_group);
|
||||
rect_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/rect_tool"));
|
||||
rect_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
|
||||
rect_tool_button->set_accessibility_name(TTRC("Rect Tool"));
|
||||
tilemap_tiles_tools_buttons->add_child(rect_tool_button);
|
||||
viewport_shortcut_buttons.push_back(rect_tool_button);
|
||||
|
||||
@@ -3598,6 +3615,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
|
||||
bucket_tool_button->set_button_group(tool_buttons_group);
|
||||
bucket_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/bucket_tool"));
|
||||
bucket_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
|
||||
bucket_tool_button->set_accessibility_name(TTRC("Bucket Tool"));
|
||||
tilemap_tiles_tools_buttons->add_child(bucket_tool_button);
|
||||
viewport_shortcut_buttons.push_back(bucket_tool_button);
|
||||
|
||||
@@ -3616,6 +3634,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
|
||||
picker_button->set_toggle_mode(true);
|
||||
picker_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/picker"));
|
||||
picker_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
|
||||
picker_button->set_accessibility_name(TTRC("Pick"));
|
||||
tools_settings->add_child(picker_button);
|
||||
viewport_shortcut_buttons.push_back(picker_button);
|
||||
|
||||
@@ -3625,6 +3644,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
|
||||
erase_button->set_toggle_mode(true);
|
||||
erase_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/eraser"));
|
||||
erase_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
|
||||
erase_button->set_accessibility_name(TTRC("Erase"));
|
||||
tools_settings->add_child(erase_button);
|
||||
viewport_shortcut_buttons.push_back(erase_button);
|
||||
|
||||
@@ -4476,18 +4496,21 @@ TileMapLayerEditor::TileMapLayerEditor() {
|
||||
layers_selection_button->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS);
|
||||
layers_selection_button->set_tooltip_text(TTR("TileMap Layers"));
|
||||
layers_selection_button->connect(SceneStringName(item_selected), callable_mp(this, &TileMapLayerEditor::_layers_selection_item_selected));
|
||||
layers_selection_button->set_accessibility_name(TTRC("TileMap Layers"));
|
||||
layer_selection_hbox->add_child(layers_selection_button);
|
||||
|
||||
select_previous_layer = memnew(Button);
|
||||
select_previous_layer->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
select_previous_layer->set_tooltip_text(TTR("Select previous layer"));
|
||||
select_previous_layer->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditor::_select_previous_layer_pressed));
|
||||
select_previous_layer->set_accessibility_name(TTRC("Previous"));
|
||||
layer_selection_hbox->add_child(select_previous_layer);
|
||||
|
||||
select_next_layer = memnew(Button);
|
||||
select_next_layer->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
select_next_layer->set_tooltip_text(TTR("Select next layer"));
|
||||
select_next_layer->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditor::_select_next_layer_pressed));
|
||||
select_next_layer->set_accessibility_name(TTRC("Next"));
|
||||
layer_selection_hbox->add_child(select_next_layer);
|
||||
|
||||
select_all_layers = memnew(Button);
|
||||
@@ -4503,6 +4526,7 @@ TileMapLayerEditor::TileMapLayerEditor() {
|
||||
toggle_highlight_selected_layer_button->set_toggle_mode(true);
|
||||
toggle_highlight_selected_layer_button->connect(SceneStringName(toggled), callable_mp(this, &TileMapLayerEditor::_highlight_selected_layer_button_toggled));
|
||||
toggle_highlight_selected_layer_button->set_tooltip_text(TTR("Highlight Selected TileMap Layer"));
|
||||
toggle_highlight_selected_layer_button->set_accessibility_name(TTRC("Highlight Selected TileMap Layer"));
|
||||
tile_map_toolbar->add_child(toggle_highlight_selected_layer_button);
|
||||
|
||||
tile_map_toolbar->add_child(memnew(VSeparator));
|
||||
@@ -4513,11 +4537,13 @@ TileMapLayerEditor::TileMapLayerEditor() {
|
||||
toggle_grid_button->set_toggle_mode(true);
|
||||
toggle_grid_button->set_tooltip_text(TTR("Toggle grid visibility."));
|
||||
toggle_grid_button->connect(SceneStringName(toggled), callable_mp(this, &TileMapLayerEditor::_on_grid_toggled));
|
||||
toggle_grid_button->set_accessibility_name(TTRC("Grid"));
|
||||
tile_map_toolbar->add_child(toggle_grid_button);
|
||||
|
||||
// Advanced settings menu button.
|
||||
advanced_menu_button = memnew(MenuButton);
|
||||
advanced_menu_button->set_flat(false);
|
||||
advanced_menu_button->set_accessibility_name(TTRC("Advanced"));
|
||||
advanced_menu_button->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
advanced_menu_button->get_popup()->add_item(TTR("Automatically Replace Tiles with Proxies"), ADVANCED_MENU_REPLACE_WITH_PROXIES);
|
||||
advanced_menu_button->get_popup()->add_item(TTR("Extract TileMap layers as individual TileMapLayer nodes"), ADVANCED_MENU_EXTRACT_TILE_MAP_LAYERS);
|
||||
|
||||
Reference in New Issue
Block a user