diff options
-rw-r--r-- | LICENSE.txt | 2 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | drivers/gles3/shaders/scene.glsl | 1 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 18 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 8 | ||||
-rw-r--r-- | modules/mono/editor/godotsharp_editor.cpp | 7 | ||||
-rw-r--r-- | modules/mono/editor/godotsharp_editor.h | 1 | ||||
-rw-r--r-- | scene/gui/item_list.cpp | 3 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.cpp | 3 |
9 files changed, 33 insertions, 12 deletions
diff --git a/LICENSE.txt b/LICENSE.txt index 0b5b0c341f..bcce1a3a33 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -18,5 +18,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --- Godot Engine <https://godotengine.org> @@ -26,6 +26,8 @@ Before being open sourced in February 2014, Godot had been developed by Juan Linietsky and Ariel Manzur (both still maintaining the project) for several years as an in-house engine, used to publish several work-for-hire titles. +![Screenshot of a 3D scene in Godot Engine](http://download.tuxfamily.org/godotengine/media/screenshots/editor_3d_fracteed.jpg) + ### Getting the engine #### Binary downloads diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 41966fd565..9880663143 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -665,6 +665,7 @@ layout(std140) uniform SceneData { highp float shadow_dual_paraboloid_render_zfar; highp float shadow_dual_paraboloid_render_side; + highp vec2 viewport_size; highp vec2 screen_pixel_size; highp vec2 shadow_atlas_pixel_size; highp vec2 directional_shadow_pixel_size; diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index f96cbabde7..01aa967a6d 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -847,6 +847,7 @@ void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) { selection_menu->set_invalidate_click_until_motion(); } } + void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { if (previewing) @@ -1576,7 +1577,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { } } - } else if (m->get_button_mask() & BUTTON_MASK_RIGHT) { + } else if ((m->get_button_mask() & BUTTON_MASK_RIGHT) || freelook_active) { if (nav_scheme == NAVIGATION_MAYA && m->get_alt()) { nav_mode = NAVIGATION_ZOOM; @@ -1791,6 +1792,13 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { set_message(TTR("Animation Key Inserted.")); } + if (ED_IS_SHORTCUT("spatial_editor/freelook_toggle", p_event)) { + set_freelook_active(!is_freelook_active()); + + } else if (k->get_scancode() == KEY_ESCAPE) { + set_freelook_active(false); + } + if (k->get_scancode() == KEY_SPACE) { if (!k->is_pressed()) emit_signal("toggle_maximize_view", this); } @@ -1815,9 +1823,15 @@ void SpatialEditorViewport::set_freelook_active(bool active_now) { freelook_speed = base_speed * cursor.distance; } + // Hide mouse like in an FPS (warping doesn't work) + OS::get_singleton()->set_mouse_mode(OS::MOUSE_MODE_CAPTURED); + } else if (freelook_active && !active_now) { // Sync camera cursor to cursor to "cut" interpolation jumps due to changing referential cursor = camera_cursor; + + // Restore mouse + OS::get_singleton()->set_mouse_mode(OS::MOUSE_MODE_VISIBLE); } freelook_active = active_now; @@ -4595,6 +4609,8 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { ED_SHORTCUT("spatial_editor/display_wireframe", TTR("Display Wireframe"), KEY_Z); + ED_SHORTCUT("spatial_editor/freelook_toggle", TTR("Toggle Freelook"), KEY_MASK_SHIFT + KEY_F); + PopupMenu *p; transform_menu = memnew(MenuButton); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index f3e59932c4..7438c7671e 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -319,6 +319,14 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { editor->push_item(existing.ptr()); else { String path = selected->get_filename(); + if (path == "") { + String root_path = editor_data->get_edited_scene_root()->get_filename(); + if (root_path == "") { + path = "res://" + selected->get_name(); + } else { + path = root_path.get_base_dir() + "/" + selected->get_name(); + } + } script_create_dialog->config(selected->get_class(), path); script_create_dialog->popup_centered(); } diff --git a/modules/mono/editor/godotsharp_editor.cpp b/modules/mono/editor/godotsharp_editor.cpp index 39c57ee0be..837dbfde66 100644 --- a/modules/mono/editor/godotsharp_editor.cpp +++ b/modules/mono/editor/godotsharp_editor.cpp @@ -171,11 +171,6 @@ Error GodotSharpEditor::open_in_external_editor(const Ref<Script> &p_script, int String script_path = ProjectSettings::get_singleton()->globalize_path(p_script->get_path()); monodevel_instance->execute(script_path); } break; - case EDITOR_VISUAL_STUDIO: - // TODO - // devenv <PathToSolutionFolder> - // devenv /edit <PathToCsFile> /command "edit.goto <Line>" - // HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7 default: return ERR_UNAVAILABLE; } @@ -229,7 +224,7 @@ GodotSharpEditor::GodotSharpEditor(EditorNode *p_editor) { if (!ed_settings->has_setting("mono/editor/external_editor")) { ed_settings->set_setting("mono/editor/external_editor", EDITOR_NONE); } - ed_settings->add_property_hint(PropertyInfo(Variant::INT, "mono/editor/external_editor", PROPERTY_HINT_ENUM, "None,MonoDevelop,Visual Studio,Visual Studio Code")); + ed_settings->add_property_hint(PropertyInfo(Variant::INT, "mono/editor/external_editor", PROPERTY_HINT_ENUM, "None,MonoDevelop,Visual Studio Code")); } GodotSharpEditor::~GodotSharpEditor() { diff --git a/modules/mono/editor/godotsharp_editor.h b/modules/mono/editor/godotsharp_editor.h index 7b4b50b172..0f2c163582 100644 --- a/modules/mono/editor/godotsharp_editor.h +++ b/modules/mono/editor/godotsharp_editor.h @@ -69,7 +69,6 @@ public: enum ExternalEditor { EDITOR_NONE, EDITOR_MONODEVELOP, - EDITOR_VISUAL_STUDIO, EDITOR_CODE, }; diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 3203b38d40..623a110263 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -781,7 +781,9 @@ void ItemList::_notification(int p_what) { } if (has_focus()) { + VisualServer::get_singleton()->canvas_item_add_clip_ignore(get_canvas_item(), true); draw_style_box(get_stylebox("bg_focus"), Rect2(Point2(), size)); + VisualServer::get_singleton()->canvas_item_add_clip_ignore(get_canvas_item(), false); } if (shape_changed) { @@ -1427,6 +1429,7 @@ ItemList::ItemList() { allow_rmb_select = false; icon_scale = 1.0f; + set_clip_contents(true); } ItemList::~ItemList() { diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index c644fd2d55..69e2d1c162 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -102,6 +102,7 @@ void VisualServerRaster::draw() { VSG::viewport->draw_viewports(); VSG::scene->render_probes(); + _draw_margins(); VSG::rasterizer->end_frame(); while (frame_drawn_callbacks.front()) { @@ -119,8 +120,6 @@ void VisualServerRaster::draw() { frame_drawn_callbacks.pop_front(); } - - _draw_margins(); } void VisualServerRaster::sync() { } |