Improve auto-translation of tile editors
This commit is contained in:
parent
897172fa25
commit
0d01c01c7b
8 changed files with 157 additions and 113 deletions
|
|
@ -5814,7 +5814,7 @@ void EditorInspector::add_custom_property_description(const String &p_class, con
|
|||
String EditorInspector::get_custom_property_description(const String &p_property) const {
|
||||
HashMap<String, String>::ConstIterator E = custom_property_descriptions.find(p_property);
|
||||
if (E) {
|
||||
return E->value;
|
||||
return TTR(E->value);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -648,7 +648,7 @@ TileAtlasView::TileAtlasView() {
|
|||
button_center_view->connect(SceneStringName(pressed), callable_mp(this, &TileAtlasView::_center_view));
|
||||
button_center_view->set_flat(true);
|
||||
button_center_view->set_disabled(true);
|
||||
button_center_view->set_tooltip_text(TTR("Center View"));
|
||||
button_center_view->set_tooltip_text(TTRC("Center View"));
|
||||
add_child(button_center_view);
|
||||
|
||||
panner.instantiate();
|
||||
|
|
@ -665,7 +665,7 @@ TileAtlasView::TileAtlasView() {
|
|||
|
||||
missing_source_label = memnew(Label);
|
||||
missing_source_label->set_focus_mode(FOCUS_ACCESSIBILITY);
|
||||
missing_source_label->set_text(TTR("The selected atlas source has no valid texture. Assign a texture in the TileSet bottom tab."));
|
||||
missing_source_label->set_text(TTRC("The selected atlas source has no valid texture. Assign a texture in the TileSet bottom tab."));
|
||||
center_container->add_child(missing_source_label);
|
||||
|
||||
margin_container = memnew(MarginContainer);
|
||||
|
|
@ -689,7 +689,7 @@ TileAtlasView::TileAtlasView() {
|
|||
// Base tiles.
|
||||
Label *base_tile_label = memnew(Label);
|
||||
base_tile_label->set_mouse_filter(Control::MOUSE_FILTER_PASS);
|
||||
base_tile_label->set_text(TTR("Base Tiles"));
|
||||
base_tile_label->set_text(TTRC("Base Tiles"));
|
||||
base_tile_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
||||
left_vbox->add_child(base_tile_label);
|
||||
|
||||
|
|
@ -732,7 +732,7 @@ TileAtlasView::TileAtlasView() {
|
|||
// Alternative tiles.
|
||||
Label *alternative_tiles_label = memnew(Label);
|
||||
alternative_tiles_label->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
||||
alternative_tiles_label->set_text(TTR("Alternative Tiles"));
|
||||
alternative_tiles_label->set_text(TTRC("Alternative Tiles"));
|
||||
alternative_tiles_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
||||
right_vbox->add_child(alternative_tiles_label);
|
||||
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ void TileMapLayerEditorTilesPlugin::_update_transform_buttons() {
|
|||
|
||||
if (tile_set->get_tile_shape() != TileSet::TILE_SHAPE_SQUARE && selection_pattern->get_size() != Vector2i(1, 1)) {
|
||||
_set_transform_buttons_state({ transform_button_flip_h, transform_button_flip_v }, { transform_button_rotate_left, transform_button_rotate_right },
|
||||
TTR("Can't rotate patterns when using non-square tile grid."));
|
||||
TTRC("Can't rotate patterns when using non-square tile grid."));
|
||||
} else {
|
||||
_set_transform_buttons_state({ transform_button_rotate_left, transform_button_rotate_right, transform_button_flip_h, transform_button_flip_v }, {}, "");
|
||||
}
|
||||
|
|
@ -151,6 +151,16 @@ void TileMapLayerEditorTilesPlugin::_set_transform_buttons_state(const Vector<Bu
|
|||
}
|
||||
}
|
||||
|
||||
void TileMapLayerEditorTilesPlugin::_update_translation() {
|
||||
paint_tool_button->set_tooltip_text(TTR("Shift: Draw line.") + "\n" + vformat(TTR("%s+Shift: Draw rectangle."), keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL)));
|
||||
|
||||
if (scene_tiles_list->is_visible_in_tree()) {
|
||||
_update_scenes_collection_view();
|
||||
_update_tile_set_sources_list();
|
||||
}
|
||||
_update_patterns_list();
|
||||
}
|
||||
|
||||
Vector<TileMapLayerSubEditorPlugin::TabData> TileMapLayerEditorTilesPlugin::get_tabs() const {
|
||||
Vector<TileMapLayerSubEditorPlugin::TabData> tabs;
|
||||
Vector<Control *> toolbar_controls;
|
||||
|
|
@ -2202,7 +2212,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
paint_tool_button->set_toggle_mode(true);
|
||||
paint_tool_button->set_button_group(tool_buttons_group);
|
||||
paint_tool_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/paint_tool"));
|
||||
paint_tool_button->set_tooltip_text(TTR("Shift: Draw line.") + "\n" + vformat(TTR("%s+Shift: Draw rectangle."), keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL)));
|
||||
paint_tool_button->set_tooltip_auto_translate_mode(Node::AUTO_TRANSLATE_MODE_DISABLED);
|
||||
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);
|
||||
|
|
@ -2250,7 +2260,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
picker_button->set_toggle_mode(true);
|
||||
picker_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/picker"));
|
||||
Key key = OS::prefer_meta_over_ctrl() ? 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->set_tooltip_text(vformat(TTRC("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);
|
||||
|
|
@ -2309,7 +2319,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
// Continuous checkbox.
|
||||
bucket_contiguous_checkbox = memnew(CheckBox);
|
||||
bucket_contiguous_checkbox->set_flat(true);
|
||||
bucket_contiguous_checkbox->set_text(TTR("Contiguous"));
|
||||
bucket_contiguous_checkbox->set_text(TTRC("Contiguous"));
|
||||
bucket_contiguous_checkbox->set_pressed(true);
|
||||
bucket_contiguous_checkbox->hide();
|
||||
tools_settings->add_child(bucket_contiguous_checkbox);
|
||||
|
|
@ -2318,7 +2328,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
random_tile_toggle = memnew(Button);
|
||||
random_tile_toggle->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
random_tile_toggle->set_toggle_mode(true);
|
||||
random_tile_toggle->set_tooltip_text(TTR("Place Random Tile"));
|
||||
random_tile_toggle->set_tooltip_text(TTRC("Place Random Tile"));
|
||||
random_tile_toggle->connect(SceneStringName(toggled), callable_mp(this, &TileMapLayerEditorTilesPlugin::_on_random_tile_checkbox_toggled));
|
||||
tools_settings->add_child(random_tile_toggle);
|
||||
|
||||
|
|
@ -2327,15 +2337,15 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
scatter_controls_container->set_vertical(false);
|
||||
|
||||
scatter_label = memnew(Label);
|
||||
scatter_label->set_tooltip_text(TTR("Modifies the chance of painting nothing instead of a randomly selected tile."));
|
||||
scatter_label->set_text(TTR("Scattering:"));
|
||||
scatter_label->set_tooltip_text(TTRC("Modifies the chance of painting nothing instead of a randomly selected tile."));
|
||||
scatter_label->set_text(TTRC("Scattering:"));
|
||||
scatter_controls_container->add_child(scatter_label);
|
||||
|
||||
scatter_spinbox = memnew(SpinBox);
|
||||
scatter_spinbox->set_min(0.0);
|
||||
scatter_spinbox->set_max(1000);
|
||||
scatter_spinbox->set_step(0.001);
|
||||
scatter_spinbox->set_tooltip_text(TTR("Modifies the chance of painting nothing instead of a randomly selected tile."));
|
||||
scatter_spinbox->set_tooltip_text(TTRC("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:"));
|
||||
|
|
@ -2356,11 +2366,11 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
tiles_bottom_panel->connect(SceneStringName(theme_changed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_theme));
|
||||
tiles_bottom_panel->connect(SceneStringName(visibility_changed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_stop_dragging));
|
||||
tiles_bottom_panel->connect(SceneStringName(visibility_changed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_tab_changed));
|
||||
tiles_bottom_panel->set_name(TTR("Tiles"));
|
||||
tiles_bottom_panel->set_name(TTRC("Tiles"));
|
||||
|
||||
missing_source_label = memnew(Label);
|
||||
missing_source_label->set_focus_mode(Control::FOCUS_ACCESSIBILITY);
|
||||
missing_source_label->set_text(TTR("This TileMap's TileSet has no Tile Source configured. Go to the TileSet bottom panel to add one."));
|
||||
missing_source_label->set_text(TTRC("This TileMap's TileSet has no Tile Source configured. Go to the TileSet bottom panel to add one."));
|
||||
missing_source_label->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||
missing_source_label->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
missing_source_label->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
|
|
@ -2386,16 +2396,16 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
source_sort_button = memnew(MenuButton);
|
||||
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_tooltip_text(TTRC("Sort sources"));
|
||||
source_sort_button->set_h_size_flags(Control::SIZE_SHRINK_END);
|
||||
source_sort_button->set_v_size_flags(Control::SIZE_SHRINK_END);
|
||||
|
||||
PopupMenu *p = source_sort_button->get_popup();
|
||||
p->connect(SceneStringName(id_pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_set_source_sort));
|
||||
p->add_radio_check_item(TTR("Sort by ID (Ascending)"), TilesEditorUtils::SOURCE_SORT_ID);
|
||||
p->add_radio_check_item(TTR("Sort by ID (Descending)"), TilesEditorUtils::SOURCE_SORT_ID_REVERSE);
|
||||
p->add_radio_check_item(TTR("Sort by Name (Ascending)"), TilesEditorUtils::SOURCE_SORT_NAME);
|
||||
p->add_radio_check_item(TTR("Sort by Name (Descending)"), TilesEditorUtils::SOURCE_SORT_NAME_REVERSE);
|
||||
p->add_radio_check_item(TTRC("Sort by ID (Ascending)"), TilesEditorUtils::SOURCE_SORT_ID);
|
||||
p->add_radio_check_item(TTRC("Sort by ID (Descending)"), TilesEditorUtils::SOURCE_SORT_ID_REVERSE);
|
||||
p->add_radio_check_item(TTRC("Sort by Name (Ascending)"), TilesEditorUtils::SOURCE_SORT_NAME);
|
||||
p->add_radio_check_item(TTRC("Sort by Name (Descending)"), TilesEditorUtils::SOURCE_SORT_NAME_REVERSE);
|
||||
p->set_item_checked(TilesEditorUtils::SOURCE_SORT_ID, true);
|
||||
|
||||
sources_list = memnew(TileSetSourceItemList);
|
||||
|
|
@ -2442,7 +2452,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
// Invalid source label.
|
||||
invalid_source_label = memnew(Label);
|
||||
invalid_source_label->set_focus_mode(Control::FOCUS_ACCESSIBILITY);
|
||||
invalid_source_label->set_text(TTR("Invalid source selected."));
|
||||
invalid_source_label->set_text(TTRC("Invalid source selected."));
|
||||
invalid_source_label->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
invalid_source_label->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
invalid_source_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
||||
|
|
@ -2452,7 +2462,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
|
||||
// --- Bottom panel patterns ---
|
||||
patterns_mc = memnew(MarginContainer);
|
||||
patterns_mc->set_name(TTR("Patterns"));
|
||||
patterns_mc->set_name(TTRC("Patterns"));
|
||||
patterns_mc->connect(SceneStringName(visibility_changed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_tab_changed));
|
||||
|
||||
int thumbnail_size = 64;
|
||||
|
|
@ -2472,7 +2482,8 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
|
||||
patterns_help_label = memnew(Label);
|
||||
patterns_help_label->set_focus_mode(Control::FOCUS_ACCESSIBILITY);
|
||||
patterns_help_label->set_text(TTR("Drag and drop or paste a TileMap selection here to store a pattern."));
|
||||
patterns_help_label->set_text(TTRC("Drag and drop or paste a TileMap selection here to store a pattern."));
|
||||
patterns_help_label->set_auto_translate_mode(Node::AUTO_TRANSLATE_MODE_ALWAYS);
|
||||
patterns_help_label->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||
patterns_help_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
||||
patterns_help_label->set_anchors_and_offsets_preset(Control::PRESET_HCENTER_WIDE);
|
||||
|
|
@ -2480,6 +2491,9 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
|
|||
|
||||
// Update.
|
||||
_update_source_display();
|
||||
|
||||
_update_translation();
|
||||
EditorSettings::get_singleton()->connect("_translation_changed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_translation));
|
||||
}
|
||||
|
||||
void TileMapLayerEditorTerrainsPlugin::tile_set_changed() {
|
||||
|
|
@ -3376,13 +3390,13 @@ void TileMapLayerEditorTerrainsPlugin::_update_tiles_list() {
|
|||
|
||||
// Add the two first generic modes
|
||||
int item_index = terrains_tile_list->add_icon_item(main_box_container->get_editor_theme_icon(SNAME("TerrainConnect")));
|
||||
terrains_tile_list->set_item_tooltip(item_index, TTR("Connect mode: paints a terrain, then connects it with the surrounding tiles with the same terrain."));
|
||||
terrains_tile_list->set_item_tooltip(item_index, TTRC("Connect mode: paints a terrain, then connects it with the surrounding tiles with the same terrain."));
|
||||
Dictionary list_metadata_dict;
|
||||
list_metadata_dict["type"] = SELECTED_TYPE_CONNECT;
|
||||
terrains_tile_list->set_item_metadata(item_index, list_metadata_dict);
|
||||
|
||||
item_index = terrains_tile_list->add_icon_item(main_box_container->get_editor_theme_icon(SNAME("TerrainPath")));
|
||||
terrains_tile_list->set_item_tooltip(item_index, TTR("Path mode: paints a terrain, then connects it to the previous tile painted within the same stroke."));
|
||||
terrains_tile_list->set_item_tooltip(item_index, TTRC("Path mode: paints a terrain, then connects it to the previous tile painted within the same stroke."));
|
||||
list_metadata_dict = Dictionary();
|
||||
list_metadata_dict["type"] = SELECTED_TYPE_PATH;
|
||||
terrains_tile_list->set_item_metadata(item_index, list_metadata_dict);
|
||||
|
|
@ -3463,6 +3477,10 @@ void TileMapLayerEditorTerrainsPlugin::_update_theme() {
|
|||
_update_tiles_list();
|
||||
}
|
||||
|
||||
void TileMapLayerEditorTerrainsPlugin::_update_translation() {
|
||||
_update_terrains_tree();
|
||||
}
|
||||
|
||||
void TileMapLayerEditorTerrainsPlugin::edit(ObjectID p_edited_tile_map_layer_id) {
|
||||
_stop_dragging(); // Avoids staying in a wrong drag state.
|
||||
|
||||
|
|
@ -3605,10 +3623,13 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
|
|||
// Continuous checkbox.
|
||||
bucket_contiguous_checkbox = memnew(CheckBox);
|
||||
bucket_contiguous_checkbox->set_flat(true);
|
||||
bucket_contiguous_checkbox->set_text(TTR("Contiguous"));
|
||||
bucket_contiguous_checkbox->set_text(TTRC("Contiguous"));
|
||||
bucket_contiguous_checkbox->set_pressed(true);
|
||||
bucket_contiguous_checkbox->hide();
|
||||
tools_settings->add_child(bucket_contiguous_checkbox);
|
||||
|
||||
_update_translation();
|
||||
EditorSettings::get_singleton()->connect("_translation_changed", callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_translation));
|
||||
}
|
||||
|
||||
TileMapLayer *TileMapLayerEditor::_get_edited_layer() const {
|
||||
|
|
@ -3794,7 +3815,7 @@ void TileMapLayerEditor::_update_layers_selector() {
|
|||
layers_selection_button->set_disabled(false);
|
||||
if (layers_selection_button->get_item_count() == 0) {
|
||||
layers_selection_button->set_disabled(true);
|
||||
layers_selection_button->set_text(TTR("No Layers"));
|
||||
layers_selection_button->set_text(TTRC("No Layers"));
|
||||
}
|
||||
|
||||
// Disable next/previous if there's one or less layers.
|
||||
|
|
@ -3921,7 +3942,7 @@ void TileMapLayerEditor::_advanced_menu_button_id_pressed(int p_id) {
|
|||
|
||||
if (p_id == ADVANCED_MENU_REPLACE_WITH_PROXIES) { // Replace Tile Proxies
|
||||
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
|
||||
undo_redo->create_action(TTR("Replace Tiles with Proxies"));
|
||||
undo_redo->create_action(TTRC("Replace Tiles with Proxies"));
|
||||
TypedArray<Vector2i> used_cells = edited_layer->get_used_cells();
|
||||
for (int i = 0; i < used_cells.size(); i++) {
|
||||
Vector2i cell_coords = used_cells[i];
|
||||
|
|
@ -3946,7 +3967,7 @@ void TileMapLayerEditor::_advanced_menu_button_id_pressed(int p_id) {
|
|||
ERR_FAIL_NULL(edited_scene_root);
|
||||
|
||||
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
|
||||
undo_redo->create_action(TTR("Extract TileMap layers as individual TileMapLayer nodes"));
|
||||
undo_redo->create_action(TTRC("Extract TileMap layers as individual TileMapLayer nodes"));
|
||||
|
||||
TileMap *tile_map = Object::cast_to<TileMap>(edited_layer->get_parent());
|
||||
for (int i = 0; i < tile_map->get_layers_count(); i++) {
|
||||
|
|
@ -3980,16 +4001,16 @@ void TileMapLayerEditor::_update_bottom_panel() {
|
|||
|
||||
// Update state labels.
|
||||
if (is_multi_node_edit) {
|
||||
cant_edit_label->set_text(TTR("Can't edit multiple layers at once."));
|
||||
cant_edit_label->set_text(TTRC("Can't edit multiple layers at once."));
|
||||
cant_edit_label->show();
|
||||
} else if (!edited_layer) {
|
||||
cant_edit_label->set_text(TTR("The selected TileMap has no layer to edit."));
|
||||
cant_edit_label->set_text(TTRC("The selected TileMap has no layer to edit."));
|
||||
cant_edit_label->show();
|
||||
} else if (!edited_layer->is_enabled() || !edited_layer->is_visible_in_tree()) {
|
||||
cant_edit_label->set_text(TTR("The edited layer is disabled or invisible"));
|
||||
cant_edit_label->set_text(TTRC("The edited layer is disabled or invisible"));
|
||||
cant_edit_label->show();
|
||||
} else if (tile_set.is_null()) {
|
||||
cant_edit_label->set_text(TTR("The edited TileMap or TileMapLayer node has no TileSet resource.\nCreate or load a TileSet resource in the Tile Set property in the inspector."));
|
||||
cant_edit_label->set_text(TTRC("The edited TileMap or TileMapLayer node has no TileSet resource.\nCreate or load a TileSet resource in the Tile Set property in the inspector."));
|
||||
cant_edit_label->show();
|
||||
} else {
|
||||
cant_edit_label->hide();
|
||||
|
|
@ -4553,26 +4574,26 @@ TileMapLayerEditor::TileMapLayerEditor() {
|
|||
layers_selection_button = memnew(OptionButton);
|
||||
layers_selection_button->set_custom_minimum_size(Size2(200, 0));
|
||||
layers_selection_button->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS);
|
||||
layers_selection_button->set_tooltip_text(TTR("TileMap Layers"));
|
||||
layers_selection_button->set_tooltip_text(TTRC("TileMap Layers"));
|
||||
layers_selection_button->connect(SceneStringName(item_selected), callable_mp(this, &TileMapLayerEditor::_layers_selection_item_selected));
|
||||
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->set_tooltip_text(TTRC("Select previous layer"));
|
||||
select_previous_layer->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditor::_select_previous_layer_pressed));
|
||||
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->set_tooltip_text(TTRC("Select next layer"));
|
||||
select_next_layer->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditor::_select_next_layer_pressed));
|
||||
layer_selection_hbox->add_child(select_next_layer);
|
||||
|
||||
select_all_layers = memnew(Button);
|
||||
select_all_layers->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
select_all_layers->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditor::_select_all_layers_pressed));
|
||||
select_all_layers->set_tooltip_text(TTR("Select all TileMapLayers in scene"));
|
||||
select_all_layers->set_tooltip_text(TTRC("Select all TileMapLayers in scene"));
|
||||
layer_selection_hbox->add_child(select_all_layers);
|
||||
|
||||
// Highlighting selected layer.
|
||||
|
|
@ -4580,7 +4601,7 @@ TileMapLayerEditor::TileMapLayerEditor() {
|
|||
toggle_highlight_selected_layer_button->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
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_tooltip_text(TTRC("Highlight Selected TileMap Layer"));
|
||||
tile_map_toolbar->add_child(toggle_highlight_selected_layer_button);
|
||||
|
||||
layer_selector_separator = memnew(SwitchSeparator);
|
||||
|
|
@ -4591,7 +4612,7 @@ TileMapLayerEditor::TileMapLayerEditor() {
|
|||
toggle_grid_button = memnew(Button);
|
||||
toggle_grid_button->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
toggle_grid_button->set_toggle_mode(true);
|
||||
toggle_grid_button->set_tooltip_text(TTR("Toggle grid visibility."));
|
||||
toggle_grid_button->set_tooltip_text(TTRC("Toggle grid visibility."));
|
||||
toggle_grid_button->connect(SceneStringName(toggled), callable_mp(this, &TileMapLayerEditor::_on_grid_toggled));
|
||||
tile_map_toolbar->add_child(toggle_grid_button);
|
||||
|
||||
|
|
@ -4600,8 +4621,8 @@ TileMapLayerEditor::TileMapLayerEditor() {
|
|||
advanced_menu_button->set_flat(false);
|
||||
advanced_menu_button->set_tooltip_text(TTRC("Advanced settings."));
|
||||
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);
|
||||
advanced_menu_button->get_popup()->add_item(TTRC("Automatically Replace Tiles with Proxies"), ADVANCED_MENU_REPLACE_WITH_PROXIES);
|
||||
advanced_menu_button->get_popup()->add_item(TTRC("Extract TileMap layers as individual TileMapLayer nodes"), ADVANCED_MENU_EXTRACT_TILE_MAP_LAYERS);
|
||||
advanced_menu_button->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &TileMapLayerEditor::_advanced_menu_button_id_pressed));
|
||||
tile_map_toolbar->add_child(advanced_menu_button);
|
||||
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ private:
|
|||
void _update_toolbar();
|
||||
void _update_transform_buttons();
|
||||
void _set_transform_buttons_state(const Vector<Button *> &p_enabled_buttons, const Vector<Button *> &p_disabled_buttons, const String &p_why_disabled);
|
||||
void _update_translation();
|
||||
|
||||
///// Tilemap editing. /////
|
||||
bool has_mouse = false;
|
||||
|
|
@ -345,6 +346,7 @@ private:
|
|||
void _update_terrains_tree();
|
||||
void _update_tiles_list();
|
||||
void _update_theme();
|
||||
void _update_translation();
|
||||
|
||||
// Update callback
|
||||
virtual void tile_set_changed() override;
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ bool TileSetAtlasSourceEditor::TileSetAtlasSourceProxyObject::_get(const StringN
|
|||
}
|
||||
|
||||
void TileSetAtlasSourceEditor::TileSetAtlasSourceProxyObject::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||
p_list->push_back(PropertyInfo(Variant::NIL, TTR("Atlas"), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_CATEGORY));
|
||||
p_list->push_back(PropertyInfo(Variant::NIL, TTRC("Atlas"), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_CATEGORY));
|
||||
p_list->push_back(PropertyInfo(Variant::INT, PNAME("id"), PROPERTY_HINT_RANGE, "0," + itos(INT_MAX) + ",1"));
|
||||
p_list->push_back(PropertyInfo(Variant::STRING, PNAME("name")));
|
||||
p_list->push_back(PropertyInfo(Variant::OBJECT, PNAME("texture"), PROPERTY_HINT_RESOURCE_TYPE, Texture2D::get_class_static()));
|
||||
|
|
@ -400,15 +400,15 @@ void TileSetAtlasSourceEditor::AtlasTileProxyObject::_get_property_list(List<Pro
|
|||
// ID and size related properties.
|
||||
if (tiles.size() == 1) {
|
||||
if (tiles.front()->get().alternative == 0) {
|
||||
p_list->push_back(PropertyInfo(Variant::NIL, TTR("Base Tile"), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_CATEGORY));
|
||||
p_list->push_back(PropertyInfo(Variant::NIL, TTRC("Base Tile"), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_CATEGORY));
|
||||
p_list->push_back(PropertyInfo(Variant::VECTOR2I, PNAME("atlas_coords")));
|
||||
p_list->push_back(PropertyInfo(Variant::VECTOR2I, PNAME("size_in_atlas")));
|
||||
} else {
|
||||
p_list->push_back(PropertyInfo(Variant::NIL, TTR("Alternative Tile"), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_CATEGORY));
|
||||
p_list->push_back(PropertyInfo(Variant::NIL, TTRC("Alternative Tile"), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_CATEGORY));
|
||||
p_list->push_back(PropertyInfo(Variant::INT, PNAME("alternative_id")));
|
||||
}
|
||||
} else {
|
||||
p_list->push_back(PropertyInfo(Variant::NIL, TTR("Tiles"), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_CATEGORY));
|
||||
p_list->push_back(PropertyInfo(Variant::NIL, TTRC("Tiles"), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_CATEGORY));
|
||||
}
|
||||
|
||||
// Animation.
|
||||
|
|
@ -976,7 +976,7 @@ void TileSetAtlasSourceEditor::_update_atlas_view() {
|
|||
help_label->set_text(TTR("Hold Ctrl to create multiple tiles.") + "\n" + TTR("Hold Shift to create big tiles."));
|
||||
} else if (tools_button_group->get_pressed_button() == tool_select_button) {
|
||||
help_label->set_visible(true);
|
||||
help_label->set_text(TTRC("Hold Shift to select multiple regions."));
|
||||
help_label->set_text(TTR("Hold Shift to select multiple regions."));
|
||||
} else {
|
||||
help_label->set_visible(false);
|
||||
}
|
||||
|
|
@ -1061,7 +1061,7 @@ void TileSetAtlasSourceEditor::_update_toolbar() {
|
|||
|
||||
void TileSetAtlasSourceEditor::_update_buttons() {
|
||||
tool_paint_button->set_disabled(read_only);
|
||||
tool_paint_button->set_tooltip_text(read_only ? TTR("TileSet is in read-only mode. Make the resource unique to edit TileSet properties.") : TTR("Paint properties."));
|
||||
tool_paint_button->set_tooltip_text(read_only ? TTRC("TileSet is in read-only mode. Make the resource unique to edit TileSet properties.") : TTRC("Paint properties."));
|
||||
tools_settings_erase_button->set_disabled(read_only);
|
||||
tool_advanced_menu_button->set_disabled(read_only);
|
||||
}
|
||||
|
|
@ -2430,32 +2430,40 @@ void TileSetAtlasSourceEditor::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_READY: {
|
||||
atlas_source_inspector->edit(atlas_source_proxy_object);
|
||||
atlas_source_inspector->add_custom_property_description("TileSetAtlasSourceProxyObject", "id", TTR("The tile's unique identifier within this TileSet. Each tile stores its source ID, so changing one may make tiles invalid."));
|
||||
atlas_source_inspector->add_custom_property_description("TileSetAtlasSourceProxyObject", "name", TTR("The human-readable name for the atlas. Use a descriptive name here for organizational purposes (such as \"terrain\", \"decoration\", etc.)."));
|
||||
atlas_source_inspector->add_custom_property_description("TileSetAtlasSourceProxyObject", "texture", TTR("The image from which the tiles will be created."));
|
||||
atlas_source_inspector->add_custom_property_description("TileSetAtlasSourceProxyObject", "margins", TTR("The margins on the image's edges that should not be selectable as tiles (in pixels). Increasing this can be useful if you download a tilesheet image that has margins on the edges (e.g. for attribution)."));
|
||||
atlas_source_inspector->add_custom_property_description("TileSetAtlasSourceProxyObject", "separation", TTR("The separation between each tile on the atlas in pixels. Increasing this can be useful if the tilesheet image you're using contains guides (such as outlines between every tile)."));
|
||||
atlas_source_inspector->add_custom_property_description("TileSetAtlasSourceProxyObject", "texture_region_size", TTR("The size of each tile on the atlas in pixels. In most cases, this should match the tile size defined in the TileMap property (although this is not strictly necessary)."));
|
||||
atlas_source_inspector->add_custom_property_description("TileSetAtlasSourceProxyObject", "use_texture_padding", TTR("If checked, adds a 1-pixel transparent edge around each tile to prevent texture bleeding when filtering is enabled. It's recommended to leave this enabled unless you're running into rendering issues due to texture padding."));
|
||||
atlas_source_inspector->add_custom_property_description("TileSetAtlasSourceProxyObject", "id", TTRC("The tile's unique identifier within this TileSet. Each tile stores its source ID, so changing one may make tiles invalid."));
|
||||
atlas_source_inspector->add_custom_property_description("TileSetAtlasSourceProxyObject", "name", TTRC("The human-readable name for the atlas. Use a descriptive name here for organizational purposes (such as \"terrain\", \"decoration\", etc.)."));
|
||||
atlas_source_inspector->add_custom_property_description("TileSetAtlasSourceProxyObject", "texture", TTRC("The image from which the tiles will be created."));
|
||||
atlas_source_inspector->add_custom_property_description("TileSetAtlasSourceProxyObject", "margins", TTRC("The margins on the image's edges that should not be selectable as tiles (in pixels). Increasing this can be useful if you download a tilesheet image that has margins on the edges (e.g. for attribution)."));
|
||||
atlas_source_inspector->add_custom_property_description("TileSetAtlasSourceProxyObject", "separation", TTRC("The separation between each tile on the atlas in pixels. Increasing this can be useful if the tilesheet image you're using contains guides (such as outlines between every tile)."));
|
||||
atlas_source_inspector->add_custom_property_description("TileSetAtlasSourceProxyObject", "texture_region_size", TTRC("The size of each tile on the atlas in pixels. In most cases, this should match the tile size defined in the TileMap property (although this is not strictly necessary)."));
|
||||
atlas_source_inspector->add_custom_property_description("TileSetAtlasSourceProxyObject", "use_texture_padding", TTRC("If checked, adds a 1-pixel transparent edge around each tile to prevent texture bleeding when filtering is enabled. It's recommended to leave this enabled unless you're running into rendering issues due to texture padding."));
|
||||
|
||||
tile_inspector->edit(tile_proxy_object);
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "atlas_coords", TTR("The position of the tile's top-left corner in the atlas. The position and size must be within the atlas and can't overlap another tile.\nEach painted tile has associated atlas coords, so changing this property may cause your TileMaps to not display properly."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "size_in_atlas", TTR("The unit size of the tile."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "animation_columns", TTR("Number of columns for the animation grid. If number of columns is lower than number of frames, the animation will automatically adjust row count."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "animation_separation", TTR("The space (in tiles) between each frame of the animation."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "animation_speed", TTR("Animation speed in frames per second."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "animation_mode", TTR("Determines how animation will start. In \"Default\" mode all tiles start animating at the same frame. In \"Random Start Times\" mode, each tile starts animation with a random offset."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "flip_h", TTR("If [code]true[/code], the tile is horizontally flipped."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "flip_v", TTR("If [code]true[/code], the tile is vertically flipped."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "transpose", TTR("If [code]true[/code], the tile is rotated 90 degrees [i]counter-clockwise[/i] and then flipped vertically. In practice, this means that to rotate a tile by 90 degrees clockwise without flipping it, you should enable [b]Flip H[/b] and [b]Transpose[/b]. To rotate a tile by 180 degrees clockwise, enable [b]Flip H[/b] and [b]Flip V[/b]. To rotate a tile by 270 degrees clockwise, enable [b]Flip V[/b] and [b]Transpose[/b]."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "texture_origin", TTR("The origin to use for drawing the tile. This can be used to visually offset the tile compared to the base tile."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "modulate", TTR("The color multiplier to use when rendering the tile."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "material", TTR("The material to use for this tile. This can be used to apply a different blend mode or custom shaders to a single tile."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "z_index", TTR("The sorting order for this tile. Higher values will make the tile render in front of others on the same layer. The index is relative to the TileMap's own Z index."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "y_sort_origin", TTR("The vertical offset to use for tile sorting based on its Y coordinate (in pixels). This allows using layers as if they were on different height for top-down games. Adjusting this can help alleviate issues with sorting certain tiles. Only effective if Y Sort Enabled is true on the TileMap layer the tile is placed on."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "terrain_set", TTR("The index of the terrain set this tile belongs to. [code]-1[/code] means it will not be used in terrains."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "terrain", TTR("The index of the terrain inside the terrain set this tile belongs to. [code]-1[/code] means it will not be used in terrains."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "probability", TTR("The relative probability of this tile appearing when painting with \"Place Random Tile\" enabled."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "atlas_coords", TTRC("The position of the tile's top-left corner in the atlas. The position and size must be within the atlas and can't overlap another tile.\nEach painted tile has associated atlas coords, so changing this property may cause your TileMaps to not display properly."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "size_in_atlas", TTRC("The unit size of the tile."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "animation_columns", TTRC("Number of columns for the animation grid. If number of columns is lower than number of frames, the animation will automatically adjust row count."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "animation_separation", TTRC("The space (in tiles) between each frame of the animation."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "animation_speed", TTRC("Animation speed in frames per second."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "animation_mode", TTRC("Determines how animation will start. In \"Default\" mode all tiles start animating at the same frame. In \"Random Start Times\" mode, each tile starts animation with a random offset."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "flip_h", TTRC("If [code]true[/code], the tile is horizontally flipped."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "flip_v", TTRC("If [code]true[/code], the tile is vertically flipped."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "transpose", TTRC("If [code]true[/code], the tile is rotated 90 degrees [i]counter-clockwise[/i] and then flipped vertically. In practice, this means that to rotate a tile by 90 degrees clockwise without flipping it, you should enable [b]Flip H[/b] and [b]Transpose[/b]. To rotate a tile by 180 degrees clockwise, enable [b]Flip H[/b] and [b]Flip V[/b]. To rotate a tile by 270 degrees clockwise, enable [b]Flip V[/b] and [b]Transpose[/b]."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "texture_origin", TTRC("The origin to use for drawing the tile. This can be used to visually offset the tile compared to the base tile."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "modulate", TTRC("The color multiplier to use when rendering the tile."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "material", TTRC("The material to use for this tile. This can be used to apply a different blend mode or custom shaders to a single tile."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "z_index", TTRC("The sorting order for this tile. Higher values will make the tile render in front of others on the same layer. The index is relative to the TileMap's own Z index."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "y_sort_origin", TTRC("The vertical offset to use for tile sorting based on its Y coordinate (in pixels). This allows using layers as if they were on different height for top-down games. Adjusting this can help alleviate issues with sorting certain tiles. Only effective if Y Sort Enabled is true on the TileMap layer the tile is placed on."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "terrain_set", TTRC("The index of the terrain set this tile belongs to. [code]-1[/code] means it will not be used in terrains."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "terrain", TTRC("The index of the terrain inside the terrain set this tile belongs to. [code]-1[/code] means it will not be used in terrains."));
|
||||
tile_inspector->add_custom_property_description("AtlasTileProxyObject", "probability", TTRC("The relative probability of this tile appearing when painting with \"Place Random Tile\" enabled."));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||
outside_tiles_warning->set_tooltip_text(vformat(TTR("The current atlas source has tiles outside the texture.\nYou can clear it using \"%s\" option in the 3 dots menu."), TTR("Remove Tiles Outside the Texture")));
|
||||
if (tile_set.is_valid()) {
|
||||
_update_tile_data_editors();
|
||||
_update_atlas_view();
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
|
|
@ -2544,25 +2552,25 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
|
|||
middle_vbox_container->add_child(toolbox);
|
||||
|
||||
tool_setup_atlas_source_button = memnew(Button);
|
||||
tool_setup_atlas_source_button->set_text(TTR("Setup"));
|
||||
tool_setup_atlas_source_button->set_text(TTRC("Setup"));
|
||||
tool_setup_atlas_source_button->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
tool_setup_atlas_source_button->set_toggle_mode(true);
|
||||
tool_setup_atlas_source_button->set_pressed(true);
|
||||
tool_setup_atlas_source_button->set_button_group(tools_button_group);
|
||||
tool_setup_atlas_source_button->set_tooltip_text(TTR("Atlas setup. Add/Remove tiles tool (use the shift key to create big tiles, control for rectangle editing)."));
|
||||
tool_setup_atlas_source_button->set_tooltip_text(TTRC("Atlas setup. Add/Remove tiles tool (use the shift key to create big tiles, control for rectangle editing)."));
|
||||
toolbox->add_child(tool_setup_atlas_source_button);
|
||||
|
||||
tool_select_button = memnew(Button);
|
||||
tool_select_button->set_text(TTR("Select"));
|
||||
tool_select_button->set_text(TTRC("Select"));
|
||||
tool_select_button->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
tool_select_button->set_toggle_mode(true);
|
||||
tool_select_button->set_pressed(false);
|
||||
tool_select_button->set_button_group(tools_button_group);
|
||||
tool_select_button->set_tooltip_text(TTR("Select tiles."));
|
||||
tool_select_button->set_tooltip_text(TTRC("Select tiles."));
|
||||
toolbox->add_child(tool_select_button);
|
||||
|
||||
tool_paint_button = memnew(Button);
|
||||
tool_paint_button->set_text(TTR("Paint"));
|
||||
tool_paint_button->set_text(TTRC("Paint"));
|
||||
tool_paint_button->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
tool_paint_button->set_toggle_mode(true);
|
||||
tool_paint_button->set_button_group(tools_button_group);
|
||||
|
|
@ -2586,7 +2594,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
|
|||
tile_inspector_no_tile_selected_label->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER);
|
||||
tile_inspector_no_tile_selected_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
||||
tile_inspector_no_tile_selected_label->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||
tile_inspector_no_tile_selected_label->set_text(TTR("No tiles selected.\nSelect one or more tiles from the palette to edit its properties."));
|
||||
tile_inspector_no_tile_selected_label->set_text(TTRC("No tiles selected.\nSelect one or more tiles from the palette to edit its properties."));
|
||||
middle_vbox_container->add_child(tile_inspector_no_tile_selected_label);
|
||||
|
||||
// Property values palette.
|
||||
|
|
@ -2603,7 +2611,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
|
|||
tile_data_editors_popup = memnew(Popup);
|
||||
|
||||
tile_data_editors_label = memnew(Label);
|
||||
tile_data_editors_label->set_text(TTR("Paint Properties:"));
|
||||
tile_data_editors_label->set_text(TTRC("Paint Properties:"));
|
||||
tile_data_editors_label->set_theme_type_variation("HeaderSmall");
|
||||
tile_data_editors_vbox->add_child(tile_data_editors_label);
|
||||
|
||||
|
|
@ -2657,15 +2665,15 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
|
|||
tool_advanced_menu_button = memnew(MenuButton);
|
||||
tool_advanced_menu_button->set_flat(false);
|
||||
tool_advanced_menu_button->set_theme_type_variation("FlatMenuButton");
|
||||
tool_advanced_menu_button->get_popup()->add_item(TTR("Create Tiles in Non-Transparent Texture Regions"), ADVANCED_AUTO_CREATE_TILES);
|
||||
tool_advanced_menu_button->get_popup()->add_item(TTR("Remove Tiles in Fully Transparent Texture Regions"), ADVANCED_AUTO_REMOVE_TILES);
|
||||
tool_advanced_menu_button->get_popup()->add_item(TTR("Remove Tiles Outside the Texture"), ADVANCED_CLEANUP_TILES);
|
||||
tool_advanced_menu_button->get_popup()->add_item(TTRC("Create Tiles in Non-Transparent Texture Regions"), ADVANCED_AUTO_CREATE_TILES);
|
||||
tool_advanced_menu_button->get_popup()->add_item(TTRC("Remove Tiles in Fully Transparent Texture Regions"), ADVANCED_AUTO_REMOVE_TILES);
|
||||
tool_advanced_menu_button->get_popup()->add_item(TTRC("Remove Tiles Outside the Texture"), ADVANCED_CLEANUP_TILES);
|
||||
tool_advanced_menu_button->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &TileSetAtlasSourceEditor::_menu_option));
|
||||
tool_settings->add_child(tool_advanced_menu_button);
|
||||
|
||||
outside_tiles_warning = memnew(TextureRect);
|
||||
outside_tiles_warning->set_stretch_mode(TextureRect::STRETCH_KEEP_ASPECT_CENTERED);
|
||||
outside_tiles_warning->set_tooltip_text(vformat(TTR("The current atlas source has tiles outside the texture.\nYou can clear it using \"%s\" option in the 3 dots menu."), TTR("Remove Tiles Outside the Texture")));
|
||||
outside_tiles_warning->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
|
||||
outside_tiles_warning->hide();
|
||||
tool_settings->add_child(outside_tiles_warning);
|
||||
|
||||
|
|
@ -2704,16 +2712,17 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
|
|||
help_label->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
|
||||
help_label->set_vertical_alignment(VERTICAL_ALIGNMENT_BOTTOM);
|
||||
help_label->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||
help_label->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
|
||||
tile_atlas_view->add_child(help_label);
|
||||
|
||||
base_tile_popup_menu = memnew(PopupMenu);
|
||||
base_tile_popup_menu->add_shortcut(ED_GET_SHORTCUT("tiles_editor/delete"), TILE_DELETE);
|
||||
base_tile_popup_menu->add_item(TTR("Create an Alternative Tile"), TILE_CREATE_ALTERNATIVE);
|
||||
base_tile_popup_menu->add_item(TTRC("Create an Alternative Tile"), TILE_CREATE_ALTERNATIVE);
|
||||
base_tile_popup_menu->connect(SceneStringName(id_pressed), callable_mp(this, &TileSetAtlasSourceEditor::_menu_option));
|
||||
tile_atlas_view->add_child(base_tile_popup_menu);
|
||||
|
||||
empty_base_tile_popup_menu = memnew(PopupMenu);
|
||||
empty_base_tile_popup_menu->add_item(TTR("Create a Tile"), TILE_CREATE);
|
||||
empty_base_tile_popup_menu->add_item(TTRC("Create a Tile"), TILE_CREATE);
|
||||
empty_base_tile_popup_menu->connect(SceneStringName(id_pressed), callable_mp(this, &TileSetAtlasSourceEditor::_menu_option));
|
||||
tile_atlas_view->add_child(empty_base_tile_popup_menu);
|
||||
|
||||
|
|
@ -2748,10 +2757,10 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
|
|||
|
||||
// -- Dialogs --
|
||||
confirm_auto_create_tiles = memnew(AcceptDialog);
|
||||
confirm_auto_create_tiles->set_title(TTR("Auto Create Tiles in Non-Transparent Texture Regions?"));
|
||||
confirm_auto_create_tiles->set_text(TTR("The atlas's texture was modified.\nWould you like to automatically create tiles in the atlas?"));
|
||||
confirm_auto_create_tiles->set_ok_button_text(TTR("Yes"));
|
||||
confirm_auto_create_tiles->add_cancel_button()->set_text(TTR("No"));
|
||||
confirm_auto_create_tiles->set_title(TTRC("Auto Create Tiles in Non-Transparent Texture Regions?"));
|
||||
confirm_auto_create_tiles->set_text(TTRC("The atlas's texture was modified.\nWould you like to automatically create tiles in the atlas?"));
|
||||
confirm_auto_create_tiles->set_ok_button_text(TTRC("Yes"));
|
||||
confirm_auto_create_tiles->add_cancel_button()->set_text(TTRC("No"));
|
||||
confirm_auto_create_tiles->connect(SceneStringName(confirmed), callable_mp(this, &TileSetAtlasSourceEditor::_auto_create_tiles));
|
||||
confirm_auto_create_tiles->connect("canceled", callable_mp(this, &TileSetAtlasSourceEditor::_cancel_auto_create_tiles));
|
||||
add_child(confirm_auto_create_tiles);
|
||||
|
|
|
|||
|
|
@ -365,6 +365,11 @@ void TileSetEditor::_set_source_sort(int p_sort) {
|
|||
|
||||
void TileSetEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||
_update_sources_list();
|
||||
_update_patterns_list();
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
sources_delete_button->set_button_icon(get_editor_theme_icon(SNAME("Remove")));
|
||||
sources_add_button->set_button_icon(get_editor_theme_icon(SNAME("Add")));
|
||||
|
|
@ -827,8 +832,8 @@ TileSetEditor::TileSetEditor() {
|
|||
tabs_bar->set_theme_type_variation("TabBarInner");
|
||||
tabs_bar->set_tab_alignment(TabBar::ALIGNMENT_CENTER);
|
||||
tabs_bar->set_clip_tabs(false);
|
||||
tabs_bar->add_tab(TTR("Tile Sources"));
|
||||
tabs_bar->add_tab(TTR("Patterns"));
|
||||
tabs_bar->add_tab(TTRC("Tile Sources"));
|
||||
tabs_bar->add_tab(TTRC("Patterns"));
|
||||
tabs_bar->connect("tab_changed", callable_mp(this, &TileSetEditor::_tab_changed));
|
||||
|
||||
tile_set_toolbar = memnew(HBoxContainer);
|
||||
|
|
@ -843,7 +848,7 @@ TileSetEditor::TileSetEditor() {
|
|||
//// Tiles ////
|
||||
// Split container.
|
||||
split_container = memnew(HSplitContainer);
|
||||
split_container->set_name(TTR("Tiles"));
|
||||
split_container->set_name(TTRC("Tiles"));
|
||||
split_container->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
split_container->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
main_vb->add_child(split_container);
|
||||
|
|
@ -859,14 +864,14 @@ TileSetEditor::TileSetEditor() {
|
|||
source_sort_button = memnew(MenuButton);
|
||||
source_sort_button->set_flat(false);
|
||||
source_sort_button->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
source_sort_button->set_tooltip_text(TTR("Sort Sources"));
|
||||
source_sort_button->set_tooltip_text(TTRC("Sort Sources"));
|
||||
|
||||
PopupMenu *p = source_sort_button->get_popup();
|
||||
p->connect(SceneStringName(id_pressed), callable_mp(this, &TileSetEditor::_set_source_sort));
|
||||
p->add_radio_check_item(TTR("Sort by ID (Ascending)"), TilesEditorUtils::SOURCE_SORT_ID);
|
||||
p->add_radio_check_item(TTR("Sort by ID (Descending)"), TilesEditorUtils::SOURCE_SORT_ID_REVERSE);
|
||||
p->add_radio_check_item(TTR("Sort by Name (Ascending)"), TilesEditorUtils::SOURCE_SORT_NAME);
|
||||
p->add_radio_check_item(TTR("Sort by Name (Descending)"), TilesEditorUtils::SOURCE_SORT_NAME_REVERSE);
|
||||
p->add_radio_check_item(TTRC("Sort by ID (Ascending)"), TilesEditorUtils::SOURCE_SORT_ID);
|
||||
p->add_radio_check_item(TTRC("Sort by ID (Descending)"), TilesEditorUtils::SOURCE_SORT_ID_REVERSE);
|
||||
p->add_radio_check_item(TTRC("Sort by Name (Ascending)"), TilesEditorUtils::SOURCE_SORT_NAME);
|
||||
p->add_radio_check_item(TTRC("Sort by Name (Descending)"), TilesEditorUtils::SOURCE_SORT_NAME_REVERSE);
|
||||
p->set_item_checked(TilesEditorUtils::SOURCE_SORT_ID, true);
|
||||
|
||||
sources_list = memnew(TileSetSourceItemList);
|
||||
|
|
@ -890,18 +895,18 @@ TileSetEditor::TileSetEditor() {
|
|||
sources_add_button = memnew(MenuButton);
|
||||
sources_add_button->set_flat(false);
|
||||
sources_add_button->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
sources_add_button->get_popup()->add_item(TTR("Atlas"));
|
||||
sources_add_button->get_popup()->set_item_tooltip(-1, TTR("A palette of tiles made from a texture."));
|
||||
sources_add_button->get_popup()->add_item(TTR("Scenes Collection"));
|
||||
sources_add_button->get_popup()->set_item_tooltip(-1, TTR("A collection of scenes that can be instantiated and placed as tiles."));
|
||||
sources_add_button->get_popup()->add_item(TTRC("Atlas"));
|
||||
sources_add_button->get_popup()->set_item_tooltip(-1, TTRC("A palette of tiles made from a texture."));
|
||||
sources_add_button->get_popup()->add_item(TTRC("Scenes Collection"));
|
||||
sources_add_button->get_popup()->set_item_tooltip(-1, TTRC("A collection of scenes that can be instantiated and placed as tiles."));
|
||||
sources_add_button->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &TileSetEditor::_source_add_id_pressed));
|
||||
sources_bottom_actions->add_child(sources_add_button);
|
||||
|
||||
sources_advanced_menu_button = memnew(MenuButton);
|
||||
sources_advanced_menu_button->set_flat(false);
|
||||
sources_advanced_menu_button->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
sources_advanced_menu_button->get_popup()->add_item(TTR("Open Atlas Merging Tool"));
|
||||
sources_advanced_menu_button->get_popup()->add_item(TTR("Manage Tile Proxies"));
|
||||
sources_advanced_menu_button->get_popup()->add_item(TTRC("Open Atlas Merging Tool"));
|
||||
sources_advanced_menu_button->get_popup()->add_item(TTRC("Manage Tile Proxies"));
|
||||
sources_advanced_menu_button->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &TileSetEditor::_sources_advanced_menu_id_pressed));
|
||||
sources_advanced_menu_button->set_accessibility_name(TTRC("Advanced"));
|
||||
sources_bottom_actions->add_child(sources_advanced_menu_button);
|
||||
|
|
@ -922,7 +927,7 @@ TileSetEditor::TileSetEditor() {
|
|||
// No source selected.
|
||||
no_source_selected_label = memnew(Label);
|
||||
no_source_selected_label->set_focus_mode(FOCUS_ACCESSIBILITY);
|
||||
no_source_selected_label->set_text(TTR("No TileSet source selected. Select or create a TileSet source.\nYou can create a new source by using the Add button on the left or by dropping a tileset texture onto the source list."));
|
||||
no_source_selected_label->set_text(TTRC("No TileSet source selected. Select or create a TileSet source.\nYou can create a new source by using the Add button on the left or by dropping a tileset texture onto the source list."));
|
||||
no_source_selected_label->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||
no_source_selected_label->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS);
|
||||
no_source_selected_label->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
|
|
@ -969,7 +974,7 @@ TileSetEditor::TileSetEditor() {
|
|||
|
||||
patterns_help_label = memnew(Label);
|
||||
patterns_help_label->set_focus_mode(FOCUS_ACCESSIBILITY);
|
||||
patterns_help_label->set_text(TTR("Add new patterns in the TileMap editing mode."));
|
||||
patterns_help_label->set_text(TTRC("Add new patterns in the TileMap editing mode."));
|
||||
patterns_help_label->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
|
||||
patterns_help_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
||||
patterns_help_label->set_anchors_and_offsets_preset(Control::PRESET_HCENTER_WIDE);
|
||||
|
|
@ -994,7 +999,7 @@ void TileSourceInspectorPlugin::_show_id_edit_dialog(Object *p_for_source) {
|
|||
VBoxContainer *vbox = memnew(VBoxContainer);
|
||||
id_edit_dialog->add_child(vbox);
|
||||
|
||||
Label *label = memnew(Label(TTR("Warning: Modifying a source ID will result in all TileMaps using that source to reference an invalid source instead. This may result in unexpected data loss. Change this ID carefully.")));
|
||||
Label *label = memnew(Label(TTRC("Warning: Modifying a source ID will result in all TileMaps using that source to reference an invalid source instead. This may result in unexpected data loss. Change this ID carefully.")));
|
||||
label->set_autowrap_mode(TextServer::AUTOWRAP_WORD);
|
||||
// Workaround too tall popup window due to text autowrapping. See GH-83546.
|
||||
label->set_custom_minimum_size(Vector2i(400, 0));
|
||||
|
|
@ -1037,7 +1042,7 @@ bool TileSourceInspectorPlugin::parse_property(Object *p_object, const Variant::
|
|||
id_label->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
hbox->add_child(id_label);
|
||||
|
||||
Button *button = memnew(Button(TTR("Edit")));
|
||||
Button *button = memnew(Button(TTRC("Edit")));
|
||||
button->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
hbox->add_child(button);
|
||||
button->connect(SceneStringName(pressed), callable_mp(this, &TileSourceInspectorPlugin::_show_id_edit_dialog).bind(p_object));
|
||||
|
|
|
|||
|
|
@ -358,13 +358,17 @@ void TileSetScenesCollectionSourceEditor::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case NOTIFICATION_READY: {
|
||||
scenes_collection_source_inspector->edit(scenes_collection_source_proxy_object);
|
||||
scenes_collection_source_inspector->add_custom_property_description("TileSetScenesCollectionProxyObject", "id", TTR("The tile's unique identifier within this TileSet. Each tile stores its source ID, so changing one may make tiles invalid."));
|
||||
scenes_collection_source_inspector->add_custom_property_description("TileSetScenesCollectionProxyObject", "name", TTR("The human-readable name for the scene collection. Use a descriptive name here for organizational purposes (such as \"obstacles\", \"decoration\", etc.)."));
|
||||
scenes_collection_source_inspector->add_custom_property_description("TileSetScenesCollectionProxyObject", "id", TTRC("The tile's unique identifier within this TileSet. Each tile stores its source ID, so changing one may make tiles invalid."));
|
||||
scenes_collection_source_inspector->add_custom_property_description("TileSetScenesCollectionProxyObject", "name", TTRC("The human-readable name for the scene collection. Use a descriptive name here for organizational purposes (such as \"obstacles\", \"decoration\", etc.)."));
|
||||
|
||||
tile_inspector->edit(tile_proxy_object);
|
||||
tile_inspector->add_custom_property_description("SceneTileProxyObject", "id", TTR("ID of the scene tile in the collection. Each painted tile has associated ID, so changing this property may cause your TileMaps to not display properly."));
|
||||
tile_inspector->add_custom_property_description("SceneTileProxyObject", "scene", TTR("Absolute path to the scene associated with this tile."));
|
||||
tile_inspector->add_custom_property_description("SceneTileProxyObject", "display_placeholder", TTR("If [code]true[/code], a placeholder marker will be displayed on top of the scene's preview. The marker is displayed anyway if the scene has no valid preview."));
|
||||
tile_inspector->add_custom_property_description("SceneTileProxyObject", "id", TTRC("ID of the scene tile in the collection. Each painted tile has associated ID, so changing this property may cause your TileMaps to not display properly."));
|
||||
tile_inspector->add_custom_property_description("SceneTileProxyObject", "scene", TTRC("Absolute path to the scene associated with this tile."));
|
||||
tile_inspector->add_custom_property_description("SceneTileProxyObject", "display_placeholder", TTRC("If [code]true[/code], a placeholder marker will be displayed on top of the scene's preview. The marker is displayed anyway if the scene has no valid preview."));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||
_update_scenes_list();
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
|
|
@ -525,7 +529,7 @@ TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() {
|
|||
// Scenes collection source inspector.
|
||||
scenes_collection_source_inspector_label = memnew(Label);
|
||||
scenes_collection_source_inspector_label->set_focus_mode(FOCUS_ACCESSIBILITY);
|
||||
scenes_collection_source_inspector_label->set_text(TTR("Scenes collection properties:"));
|
||||
scenes_collection_source_inspector_label->set_text(TTRC("Scenes collection properties:"));
|
||||
middle_vbox_container->add_child(scenes_collection_source_inspector_label);
|
||||
|
||||
scenes_collection_source_proxy_object = memnew(TileSetScenesCollectionProxyObject());
|
||||
|
|
@ -538,7 +542,7 @@ TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() {
|
|||
|
||||
// Tile inspector.
|
||||
tile_inspector_label = memnew(Label);
|
||||
tile_inspector_label->set_text(TTR("Tile properties:"));
|
||||
tile_inspector_label->set_text(TTRC("Tile properties:"));
|
||||
tile_inspector_label->hide();
|
||||
middle_vbox_container->add_child(tile_inspector_label);
|
||||
|
||||
|
|
|
|||
|
|
@ -1361,6 +1361,7 @@ void EditorSettings::setup_language(bool p_initial_setup) {
|
|||
|
||||
if (lang == "en") {
|
||||
TranslationServer::get_singleton()->set_locale(lang);
|
||||
emit_signal("_translation_changed");
|
||||
return; // Default, nothing to do.
|
||||
}
|
||||
|
||||
|
|
@ -1368,6 +1369,7 @@ void EditorSettings::setup_language(bool p_initial_setup) {
|
|||
load_doc_translations(lang);
|
||||
|
||||
TranslationServer::get_singleton()->set_locale(lang);
|
||||
emit_signal("_translation_changed");
|
||||
}
|
||||
|
||||
void EditorSettings::setup_network() {
|
||||
|
|
@ -2308,6 +2310,7 @@ void EditorSettings::_bind_methods() {
|
|||
|
||||
ADD_SIGNAL(MethodInfo("settings_changed"));
|
||||
ADD_SIGNAL(MethodInfo("_favorites_changed"));
|
||||
ADD_SIGNAL(MethodInfo("_translation_changed"));
|
||||
|
||||
BIND_CONSTANT(NOTIFICATION_EDITOR_SETTINGS_CHANGED);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue