Repository: godotengine/godot
File: editor/plugins/abstract_polygon_2d_editor.cpp (C++)

Code before:
	wip_active = false;

	edited_point = PosVertex();
	hover_point = Vertex();
	selected_point = Vertex();
	center_drag = false;
}

void AbstractPolygon2DEditor::disable_polygon_editing(bool p_disable, const String &p_reason) {
	_polygon_editing_enabled = !p_disable;

	button_create->set_disabled(p_disable);
	button_edit->set_disabled(p_disable);
	button_delete->set_disabled(p_disable);
	button_center->set_disabled(p_disable);

	if (p_disable) {
		button_create->set_tooltip_text(p_reason);
		button_edit->set_tooltip_text(p_reason);
		button_delete->set_tooltip_text(p_reason);
		button_center->set_tooltip_text(p_reason);
	} else {
		button_create->set_tooltip_text(TTR("Create points."));
		button_edit->set_tooltip_text(TTR("Edit points.\nLMB: Move Point\nRMB: Erase Point"));
		button_delete->set_tooltip_text(TTR("Erase points."));
		button_center->set_tooltip_text(TTR("Move center of gravity to origin."));
	}
}

bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
	if (!_get_node() || !_polygon_editing_enabled) {
		return false;
	}

	if (!_get_node()->is_visible_in_tree()) {
		return false;
	}

	Viewport *vp = _get_node()->get_viewport();
	if (vp && !vp->is_visible_subviewport()) {
		return false;
	}

	EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
	Ref<InputEventMouseButton> mb = p_event;

	if (!_has_resource()) {
		if (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT && mb->is_pressed()) {
			create_resource->set_text(String("No polygon resource on this node.\nCreate and assign one?"));
			create_resource->popup_centered();
		}

Review comment (suggestion):
```suggestion
		button_center->set_tooltip_text(TTRC("Move center of gravity to origin."));
```
All of the buttons should use TTRC, but you don't need to update them.

Code after:
	wip_active = false;

	edited_point = PosVertex();
	hover_point = Vertex();
	selected_point = Vertex();
	center_drag = false;
}

void AbstractPolygon2DEditor::disable_polygon_editing(bool p_disable, const String &p_reason) {
	_polygon_editing_enabled = !p_disable;

	button_create->set_disabled(p_disable);
	button_edit->set_disabled(p_disable);
	button_delete->set_disabled(p_disable);
	button_center->set_disabled(p_disable);

	if (p_disable) {
		button_create->set_tooltip_text(p_reason);
		button_edit->set_tooltip_text(p_reason);
		button_delete->set_tooltip_text(p_reason);
		button_center->set_tooltip_text(p_reason);
	} else {
		button_create->set_tooltip_text(TTRC("Create points."));
		button_edit->set_tooltip_text(TTRC("Edit points.\nLMB: Move Point\nRMB: Erase Point"));
		button_delete->set_tooltip_text(TTRC("Erase points."));
		button_center->set_tooltip_text(TTRC("Move center of gravity to geometric center."));
	}
}

bool AbstractPolygon2DEditor::_commit_drag() {
	EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();

	center_drag = false;
	int n_polygons = _get_polygon_count();
	ERR_FAIL_COND_V(pre_center_move_edit.size() != n_polygons, false);
	undo_redo->create_action(TTR("Move Geometric Center"));
	for (int i = 0; i < n_polygons; i++) {
		_action_set_polygon(i, pre_center_move_edit[i], _get_polygon(i));
	}
	pre_center_move_edit.clear();
	_commit_action();
	return true;
}

bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
	if (!_get_node() || !_polygon_editing_enabled) {
		return false;
	}

	if (!_get_node()->is_visible_in_tree()) {
		return false;