Merge pull request #52021 from Calinou/rename-polygon-editor-settings

Rename polygon editor settings for better display in the Editor Settings
This commit is contained in:
Hugo Locurcio 2021-08-23 19:25:24 +02:00 committed by GitHub
commit 679b9be9d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 14 deletions

View file

@ -704,8 +704,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("editors/tiles_editor/grid_color", Color(1.0, 0.5, 0.2, 0.5));
// Polygon editor
_initial_set("editors/poly_editor/point_grab_radius", 8);
_initial_set("editors/poly_editor/show_previous_outline", true);
_initial_set("editors/polygon_editor/point_grab_radius", 8);
_initial_set("editors/polygon_editor/show_previous_outline", true);
// Animation
_initial_set("editors/animation/autorename_animation_tracks", true);

View file

@ -367,7 +367,7 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
edge_point = PosVertex();
return true;
} else {
const real_t grab_threshold = EDITOR_GET("editors/poly_editor/point_grab_radius");
const real_t grab_threshold = EDITOR_GET("editors/polygon_editor/point_grab_radius");
if (!_is_line() && wip.size() > 1 && xform.xform(wip[0]).distance_to(xform.xform(cpoint)) < grab_threshold) {
//wip closed
@ -502,7 +502,7 @@ void AbstractPolygon2DEditor::forward_canvas_draw_over_viewport(Control *p_overl
offset = _get_offset(j);
}
if (!wip_active && j == edited_point.polygon && EDITOR_GET("editors/poly_editor/show_previous_outline")) {
if (!wip_active && j == edited_point.polygon && EDITOR_GET("editors/polygon_editor/show_previous_outline")) {
const Color col = Color(0.5, 0.5, 0.5); // FIXME polygon->get_outline_color();
const int n = pre_move_edit.size();
for (int i = 0; i < n - (is_closed ? 0 : 1); i++) {
@ -625,7 +625,7 @@ AbstractPolygon2DEditor::Vertex AbstractPolygon2DEditor::get_active_point() cons
}
AbstractPolygon2DEditor::PosVertex AbstractPolygon2DEditor::closest_point(const Vector2 &p_pos) const {
const real_t grab_threshold = EDITOR_GET("editors/poly_editor/point_grab_radius");
const real_t grab_threshold = EDITOR_GET("editors/polygon_editor/point_grab_radius");
const int n_polygons = _get_polygon_count();
const Transform2D xform = canvas_item_editor->get_canvas_transform() * _get_node()->get_global_transform();
@ -653,7 +653,7 @@ AbstractPolygon2DEditor::PosVertex AbstractPolygon2DEditor::closest_point(const
}
AbstractPolygon2DEditor::PosVertex AbstractPolygon2DEditor::closest_edge_point(const Vector2 &p_pos) const {
const real_t grab_threshold = EDITOR_GET("editors/poly_editor/point_grab_radius");
const real_t grab_threshold = EDITOR_GET("editors/polygon_editor/point_grab_radius");
const real_t eps = grab_threshold * 2;
const real_t eps2 = eps * eps;

View file

@ -590,7 +590,7 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_no
return;
}
const real_t grab_distance = EDITOR_GET("editors/poly_editor/point_grab_radius");
const real_t grab_distance = EDITOR_GET("editors/polygon_editor/point_grab_radius");
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(p_node);
for (int i = p_node->get_child_count() - 1; i >= 0; i--) {

View file

@ -138,7 +138,7 @@ bool CollisionPolygon3DEditor::forward_spatial_gui_input(Camera3D *p_camera, con
Vector<Vector2> poly = node->call("get_polygon");
//first check if a point is to be added (segment split)
real_t grab_threshold = EDITOR_GET("editors/poly_editor/point_grab_radius");
real_t grab_threshold = EDITOR_GET("editors/polygon_editor/point_grab_radius");
switch (mode) {
case MODE_CREATE: {

View file

@ -70,7 +70,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
return false;
}
real_t grab_threshold = EDITOR_GET("editors/poly_editor/point_grab_radius");
real_t grab_threshold = EDITOR_GET("editors/polygon_editor/point_grab_radius");
Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid()) {

View file

@ -1041,7 +1041,7 @@ void Polygon2DEditor::_uv_draw() {
for (int i = 0; i < uvs.size(); i++) {
int next = uv_draw_max > 0 ? (i + 1) % uv_draw_max : 0;
if (i < uv_draw_max && uv_drag && uv_move_current == UV_MODE_EDIT_POINT && EDITOR_DEF("editors/poly_editor/show_previous_outline", true)) {
if (i < uv_draw_max && uv_drag && uv_move_current == UV_MODE_EDIT_POINT && EDITOR_DEF("editors/polygon_editor/show_previous_outline", true)) {
uv_edit_draw->draw_line(mtx.xform(points_prev[i]), mtx.xform(points_prev[next]), prev_color, Math::round(EDSCALE));
}

View file

@ -110,7 +110,7 @@ void DummyObject::clear_dummy_properties() {
void GenericTilePolygonEditor::_base_control_draw() {
ERR_FAIL_COND(!tile_set.is_valid());
real_t grab_threshold = EDITOR_GET("editors/poly_editor/point_grab_radius");
real_t grab_threshold = EDITOR_GET("editors/polygon_editor/point_grab_radius");
Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color");
const Ref<Texture2D> handle = get_theme_icon(SNAME("EditorPathSharpHandle"), SNAME("EditorIcons"));
@ -262,7 +262,7 @@ void GenericTilePolygonEditor::_advanced_menu_item_pressed(int p_item_pressed) {
}
void GenericTilePolygonEditor::_grab_polygon_point(Vector2 p_pos, const Transform2D &p_polygon_xform, int &r_polygon_index, int &r_point_index) {
const real_t grab_threshold = EDITOR_GET("editors/poly_editor/point_grab_radius");
const real_t grab_threshold = EDITOR_GET("editors/polygon_editor/point_grab_radius");
r_polygon_index = -1;
r_point_index = -1;
float closest_distance = grab_threshold + 1.0;
@ -280,7 +280,7 @@ void GenericTilePolygonEditor::_grab_polygon_point(Vector2 p_pos, const Transfor
}
void GenericTilePolygonEditor::_grab_polygon_segment_point(Vector2 p_pos, const Transform2D &p_polygon_xform, int &r_polygon_index, int &r_segment_index, Vector2 &r_point) {
const real_t grab_threshold = EDITOR_GET("editors/poly_editor/point_grab_radius");
const real_t grab_threshold = EDITOR_GET("editors/polygon_editor/point_grab_radius");
Point2 point = p_polygon_xform.affine_inverse().xform(p_pos);
r_polygon_index = -1;
@ -340,7 +340,7 @@ void GenericTilePolygonEditor::_snap_to_half_pixel(Point2 &r_point) {
}
void GenericTilePolygonEditor::_base_control_gui_input(Ref<InputEvent> p_event) {
real_t grab_threshold = EDITOR_GET("editors/poly_editor/point_grab_radius");
real_t grab_threshold = EDITOR_GET("editors/polygon_editor/point_grab_radius");
hovered_polygon_index = -1;
hovered_point_index = -1;