summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/path_editor_plugin.cpp8
-rw-r--r--editor/plugins/script_text_editor.cpp4
-rw-r--r--editor/plugins/script_text_editor.h6
3 files changed, 13 insertions, 5 deletions
diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp
index 88dc258c5f..1ae5acc5ff 100644
--- a/editor/plugins/path_editor_plugin.cpp
+++ b/editor/plugins/path_editor_plugin.cpp
@@ -95,6 +95,7 @@ void PathSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_p
Vector3 ray_from = p_camera->project_ray_origin(p_point);
Vector3 ray_dir = p_camera->project_ray_normal(p_point);
+ // Setting curve point positions
if (p_idx < c->get_point_count()) {
Plane p(gt.xform(original), p_camera->get_transform().basis.get_axis(2));
@@ -126,6 +127,7 @@ void PathSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_p
Vector3 inters;
+ // Setting curve in/out positions
if (p.intersects_ray(ray_from, ray_dir, &inters)) {
if (!PathEditorPlugin::singleton->is_handle_clicked()) {
@@ -135,9 +137,13 @@ void PathSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_p
}
Vector3 local = gi.xform(inters) - base;
+ if (SpatialEditor::get_singleton()->is_snap_enabled()) {
+ float snap = SpatialEditor::get_singleton()->get_translate_snap();
+ local.snap(Vector3(snap, snap, snap));
+ }
+
if (t == 0) {
c->set_point_in(idx, local);
-
if (PathEditorPlugin::singleton->mirror_angle_enabled())
c->set_point_out(idx, PathEditorPlugin::singleton->mirror_length_enabled() ? -local : (-local.normalized() * orig_out_length));
} else {
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 2cfa759e3b..438621115b 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -773,13 +773,13 @@ void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_fo
}
}
-void ScriptTextEditor::_code_complete_scripts(void *p_ud, const String &p_code, List<String> *r_options, bool &r_force) {
+void ScriptTextEditor::_code_complete_scripts(void *p_ud, const String &p_code, List<ScriptCodeCompletionOption> *r_options, bool &r_force) {
ScriptTextEditor *ste = (ScriptTextEditor *)p_ud;
ste->_code_complete_script(p_code, r_options, r_force);
}
-void ScriptTextEditor::_code_complete_script(const String &p_code, List<String> *r_options, bool &r_force) {
+void ScriptTextEditor::_code_complete_script(const String &p_code, List<ScriptCodeCompletionOption> *r_options, bool &r_force) {
if (color_panel->is_visible_in_tree()) return;
Node *base = get_tree()->get_edited_scene_root();
diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h
index b53383b117..9a2a514a6e 100644
--- a/editor/plugins/script_text_editor.h
+++ b/editor/plugins/script_text_editor.h
@@ -143,7 +143,6 @@ class ScriptTextEditor : public ScriptEditorBase {
};
protected:
- static void _code_complete_scripts(void *p_ud, const String &p_code, List<String> *r_options, bool &r_force);
void _update_breakpoint_list();
void _breakpoint_item_pressed(int p_idx);
void _breakpoint_toggled(int p_row);
@@ -151,7 +150,10 @@ protected:
void _validate_script(); // No longer virtual.
void _update_bookmark_list();
void _bookmark_item_pressed(int p_idx);
- void _code_complete_script(const String &p_code, List<String> *r_options, bool &r_force);
+
+ static void _code_complete_scripts(void *p_ud, const String &p_code, List<ScriptCodeCompletionOption> *r_options, bool &r_force);
+ void _code_complete_script(const String &p_code, List<ScriptCodeCompletionOption> *r_options, bool &r_force);
+
void _load_theme_settings();
void _set_theme_for_script();
void _show_warnings_panel(bool p_show);