Commit graph

279 commits

Author SHA1 Message Date
Guilherme Felipe ea6a5bb8fb Fix crash when multiple mouse buttons is pressed. 2018-12-01 11:25:43 -02:00
Juan Linietsky 167eb269ec Fixes crash, closes #24038 2018-11-28 13:10:23 -03:00
Juan Linietsky 39028cc161 Improved the mouse focus system (mouse keeps focus on a control while buttons are pressed). Fixes #19154 and likely many others.
WARNING: Test well in every OS, if mouse wheel events are not properly sent as pressed+unpressed pair, it will fail and break (and the OS needs to be fixed). Only tested on X11 so far.
2018-11-28 09:33:13 -03:00
Michael Alexsander Silva Dias da7d3c5a58 Make opening menus with the same parent on mouse focus explicit 2018-11-20 20:37:45 -02:00
Juan Linietsky 55ded6b2de Properly handle multiple parent drag, fixes #19460 2018-11-19 18:38:07 -03:00
Juan Linietsky 3331ececc4 Do not allow controls in ignore mouse to get focus via their children, fixes #17955 2018-11-16 13:47:21 -03:00
Juan Linietsky 80a90ca824 -Send mouse motion events again to CollisionObjects (Area/Body) if they move, even if mouse does not. Fixes #16536 (likely many others should check)
-Add ability for viewports to set input events as handled locally
2018-11-15 13:56:57 -03:00
Juan Linietsky daa1686772
Merge pull request #21386 from RandomShaper/fix-picking-in-canvas-layers
Fix picking in CanvasLayer
2018-11-07 17:51:27 -03:00
Juan Linietsky 65e3ef705b
Merge pull request #21962 from YeldhamDev/switch_hover_submenu
Fix MenuButton hover switching not happening with submenus open
2018-11-01 17:01:51 -03:00
Rémi Verschelde 9de724f327
Merge pull request #23091 from aaronfranke/mingw-warnings
Fix some compile warnings for Windows from Linux
2018-10-25 15:09:11 +02:00
Superwaitsum e5041ad0f5 Add some limits on the Editor Settings 2018-10-24 19:46:33 -05:00
Aaron Franke dc2e73499a Fix compile warnings for Windows from Linux
At least the ones I got when I compiled it using Mingw64 POSIX on Xubuntu 18.04. Plus use the Size2 of get_window_size() directly, rather than reconstructing it.
2018-10-19 09:11:14 -04:00
Rémi Verschelde d95bbb8922 Fix warnings about set but unused variables [-Wunused-but-set-variable]
Fixes the following GCC 5 warnings:
```
drivers/gles2/rasterizer_canvas_gles2.cpp:814:8: warning: variable 'rt_size' set but not used [-Wunused-but-set-variable]
drivers/gles2/rasterizer_scene_gles2.cpp:2270:11: warning: variable 'vp_height' set but not used [-Wunused-but-set-variable]
drivers/gles2/rasterizer_scene_gles2.cpp:2673:22: warning: variable 'e' set but not used [-Wunused-but-set-variable]
drivers/gles2/rasterizer_scene_gles2.cpp:715:7: warning: variable 'no_cull' set but not used [-Wunused-but-set-variable]
drivers/gles2/shader_gles2.cpp:693:14: warning: variable 'cc' set but not used [-Wunused-but-set-variable]
drivers/gles3/rasterizer_canvas_gles3.cpp:1226:8: warning: variable 'rt_size' set but not used [-Wunused-but-set-variable]
drivers/gles3/rasterizer_scene_gles3.cpp:3039:10: warning: variable 'contrib' set but not used [-Wunused-but-set-variable]
drivers/gles3/rasterizer_scene_gles3.cpp:4504:32: warning: variable 'vp_height' set but not used [-Wunused-but-set-variable]
editor/editor_inspector.cpp:272:9: warning: variable 'guide_color' set but not used [-Wunused-but-set-variable]
editor/editor_themes.cpp:1067:14: warning: variable 'alpha3' set but not used [-Wunused-but-set-variable]
editor/editor_themes.cpp:263:8: warning: variable 'script_bg_color' set but not used [-Wunused-but-set-variable]
editor/plugins/collision_shape_2d_editor_plugin.cpp:326:11: warning: variable 'cpoint' set but not used [-Wunused-but-set-variable]
editor/plugins/mesh_editor_plugin.cpp:72:9: warning: variable 'size' set but not used [-Wunused-but-set-variable]
editor/plugins/shader_editor_plugin.cpp:471:12: warning: variable 'mpos' set but not used [-Wunused-but-set-variable]
editor/plugins/shader_editor_plugin.cpp:89:8: warning: variable 'basetype_color' set but not used [-Wunused-but-set-variable]
editor/plugins/shader_editor_plugin.cpp:90:8: warning: variable 'type_color' set but not used [-Wunused-but-set-variable]
editor/plugins/shader_editor_plugin.cpp:92:8: warning: variable 'string_color' set but not used [-Wunused-but-set-variable]
modules/visual_script/visual_script_editor.cpp:2521:7: warning: variable 'seq_connect' set but not used [-Wunused-but-set-variable]
platform/android/export/export.cpp:580:12: warning: variable 'styles_count' set but not used [-Wunused-but-set-variable]
platform/android/export/export.cpp:584:12: warning: variable 'styles_offset' set but not used [-Wunused-but-set-variable]
platform/osx/export/export.cpp:464:9: warning: variable 'zerr' set but not used [-Wunused-but-set-variable]
scene/2d/tile_map.cpp:260:10: warning: variable 'tcenter' set but not used [-Wunused-but-set-variable]
scene/3d/light.cpp:166:7: warning: variable 'editor_ok' set but not used [-Wunused-but-set-variable]
scene/3d/navigation.cpp:566:11: warning: variable 'closest_navmesh' set but not used [-Wunused-but-set-variable]
scene/gui/rich_text_label.cpp:869:8: warning: variable 'size' set but not used [-Wunused-but-set-variable]
scene/main/viewport.cpp:705:14: warning: variable 'xform' set but not used [-Wunused-but-set-variable]
scene/main/viewport.cpp:706:8: warning: variable 'ss' set but not used [-Wunused-but-set-variable]
scene/main/viewport.cpp:726:14: warning: variable 'xform' set but not used [-Wunused-but-set-variable]
scene/main/viewport.cpp:727:8: warning: variable 'ss' set but not used [-Wunused-but-set-variable]
scene/resources/material.cpp:430:7: warning: variable 'using_world' set but not used [-Wunused-but-set-variable]
servers/visual/shader_language.cpp:2026:7: warning: variable 'all_const' set but not used [-Wunused-but-set-variable]
servers/visual/visual_server_scene.cpp:1383:28: warning: variable 'z_max_cam' set but not used [-Wunused-but-set-variable]
```

Also fixes two [-Wunused-value] warnings:
```
scene/gui/text_edit.cpp:4405:20: warning: statement has no effect [-Wunused-value]
servers/visual/visual_server_scene.cpp:905:48: warning: value computed is not used [-Wunused-value]
```

Some of those are bugs and need further work, they are identified with
`// FIXME` comments.
2018-09-27 16:25:24 +02:00
Michael Alexsander Silva Dias 585ad5c8ea Expose "get_modal_stack_top()" to GDScript 2018-09-14 16:35:52 -03:00
Rémi Verschelde 277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +02:00
Michael Alexsander Silva Dias 592eda7ad9 Fix MenuButton hover switching not happening with submenus open 2018-09-11 01:44:19 -03:00
Pedro J. Estébanez 6d0f4a4ad7 Fix picking in CanvasLayer
New APIs in 2D physics allow intersection queries filtered by CanvasLayer object instance id. Viewport keep an inventory of its descendant CanvasLayers and takes advantage of all that to test picking with the mouse/touch position correctly transformed for each CanvasLayer.
2018-08-25 00:03:26 +02:00
Juan Linietsky 683c3f2fcf Avoid misuse of set_drag_preview() function where it shouldn't be. Closes #20100 2018-08-24 10:30:11 -03:00
Rémi Verschelde 52466d57e9 Make some debug prints verbose-only, remove others 2018-08-24 14:59:01 +02:00
Juan Linietsky ee07fb5ebe Changes to ClippedCamera, RayCast,Raycast2D and 2D physics API to add ability to choose between bodies and areas when colliding. 2018-08-21 15:31:23 -03:00
Ibrahn Sahir 1626ae6421 fixed uninitialised variable that was causing menu crash. 2018-07-28 18:09:47 +01:00
Guilherme Felipe d1f5deabd8 Opens the menu with the same parent on mouse focus 2018-07-24 19:59:40 -03:00
Juan Linietsky 336db8bcd1 -Fix tooltips in inspector, now they show as rich text. 2018-07-20 18:16:19 -03:00
Max Hilbrunner a8a318161b
Merge pull request #19015 from toger5/fixed_scrolling_with_trackpad_in_new_inspector
fixed scrolling in new ispector when using trackpad pan gesture
2018-07-05 00:22:06 +02:00
Juan Linietsky 085483e885 -Fix fullscreen on Windows with a HiDPI monitor but a non-HiDPI project
-Replaced some viewport size calls to screen size, since viewport size should be deprecated at this point..
2018-07-03 18:53:27 -03:00
Juan Linietsky eeab3502d5 Changes to how node paths are selected from property, allowing setting a hint. 2018-06-27 20:50:25 -03:00
Guilherme Felipe aa53c032ed Fix regression with cursor shape 2018-06-07 15:12:59 -03:00
Juan Linietsky b659fd6d74 Entirely new (and much improved) animation editor. 2018-06-07 12:52:00 -03:00
Webster Sheets 1198662b2b Revert #14753, as it is buggy and no longer necessary. 2018-05-24 16:10:25 -04:00
toger5 0e015f6023 fixed scrolling in new ispector when using trackpad pan gesture 2018-05-18 18:47:39 +02:00
Rémi Verschelde 93c4274941
Merge pull request #18928 from BastiaanOlij/fix_viewport_flags
Store flags so it isn't lost when viewport isn't setup yet
2018-05-16 15:11:20 +02:00
Bastiaan Olij 0fc4f22522 Store flags so it isn't lost when viewport isn't setup yet 2018-05-16 22:19:45 +10:00
Juan Linietsky 005b69cf6e -New inspector.
-Changed UI resizing code, gained huge amount of speed.
-Reorganized timer sync to clean up behavior (sorry forgot commit this before)

-
2018-05-15 17:14:31 -03:00
Juan Linietsky d5c3fc1522
Merge pull request #15119 from poke1024/visible-subwindows
More efficient subwindow handling
2018-05-08 09:49:34 -03:00
Juan Linietsky c54ac6a15d
Merge pull request #15074 from PJB3005/17-12-26-remove_gui_focus_on_visibility_loss
Hiding a Control now fires NOTIFICATION_FOCUS_EXIT.
2018-05-08 09:40:44 -03:00
Geequlim 56c2463f8c Fix double free for drag preview control in viewport 2018-05-08 13:52:38 +08:00
Bastiaan Olij 6f7fefa489 Added option to viewport to keep linear color 2018-05-06 19:28:09 +10:00
Guilherme Felipe 4f05190fb0 Implement Input.set_default_cursor_shape to change the default shape
Closes #18043
2018-04-10 11:38:34 -03:00
Pedro J. Estébanez 259ed1d400 Improve popup menus usability
It seems that popups were intended to "grab" the mouse click that triggered them, but their intent was being lost. This commit does the necessary changes to let it happen and updates items that were trying to get advantage of it, because the semantics of `Control::grab_click_focus()` have changed a bit. Namely, it must be called **before** showing the modal.

This allows to popup a menu and activate an item in it in a single click-point-release cycle, instead of having to click once to open the menu and once more to pick an item.

This ability is extended even to context menus activated with the RMB (or any other mouse button, for that matter). The editor benefits from this in the context menu of the tree dock, which has been patched to opt-in for this feature.

This improves UX a bit by saving unnecessary clicks.

From now on, `PopupMenu` always grabs the click and also invalidates the first button release unless the mouse has moved (that's what `set_invalidate_click_until_motion()` was doing and now it's removed), so there is no longer the need of doing both things at every point a pop-up menu is shown.
2018-04-07 01:06:02 +02:00
Fabio Alessandrelli c531262190
Merge pull request #16947 from Faless/ui_actions
GUI elements ui_action usage, improvements
2018-03-16 20:55:11 +01:00
Bernhard Liebl 166c2bdea7 Fix gesture events being blocked 2018-03-04 22:19:10 +01:00
Rémi Verschelde ce7da2c7d6 Viewport: Fix missing tooltips w/ disabled physics object picking
Previously this option seemed to be the sole responsible for enabling
physics processing in Viewport, while several other features like
tooltips and debugging collision hints rely on it.

All this logic is moved to internal processing (it's incorrect to let
it be affected by users disabling physics/idle processing), and disabling
physics object picking no longer affects the internal physics processing.

Fixes #17001.
2018-03-01 16:01:10 +01:00
Hein-Pieter van Braam d702d7b335 Fix various valgrind reported uninitialized variable uses 2018-02-28 21:55:13 +01:00
Fabio Alessandrelli 90b9449844 Properly set input as handled when closing modal 2018-02-23 13:01:28 +01:00
Rémi Verschelde 598724c043 Remove obsolete Viewport _update_rect() code 2018-01-18 22:37:45 +01:00
Bojidar Marinov 9b8e8b2220
Bind many more properties to scripts
Notable potentially breaking changes:
- PROPERTY_USAGE_NOEDITOR is now PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NETWORK, without PROPERTY_USAGE_INTERNAL
- Some properties were renamed, and sometimes even shadowed by new ones
- New getter methods (some virtual) were added
2018-01-12 00:58:14 +02:00
Juan Linietsky 90d47ae23d Force button release when window focuses out, fixes #15318 and likely many other issues. 2018-01-05 15:40:08 -03:00
Rémi Verschelde e4213e66b2 Add missing copyright headers and fix formatting
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
2018-01-05 01:22:23 +01:00
Rémi Verschelde b50a9114b1 Update copyright statements to 2018
Happy new year to the wonderful Godot community!
2018-01-01 14:40:47 +01:00
Noshyaar 7d0212f4eb
Merge pull request #14953 from poke1024/fix-toolbar-gesture
Hide tooltip on gesture input
2018-01-01 18:53:11 +07:00
Bernhard Liebl 098bcf55d0 More efficient subwindow handling 2017-12-28 11:27:43 +01:00
PJB3005 7f0a1c1780 Hiding a control now fires NOTIFICATION_FOCUS_EXIT.
It always removed the focus from the control, but this happened without firing the relevant notification.
2017-12-26 20:58:53 +01:00
Juan Linietsky 4a2eef4ad8 Removed the InputEvent ID field, which was unused and can cause bugs. 2017-12-26 09:49:31 -03:00
Noshyaar a483edbddd
Merge pull request #14899 from volzhs/render-quality-option
Respect HDR option
2017-12-25 08:36:46 +07:00
Noshyaar 1348b087e6
Merge pull request #14753 from NathanWarden/mouse_button_fix
Fixed a bug where mouse button focus breaks when using multiple buttons at once.
2017-12-25 08:33:42 +07:00
Bernhard Liebl 27afa8813d Hide tooltip on gesture input 2017-12-22 19:39:23 +01:00
Juan Linietsky 1fa9aac3e4 -Make capture dependent on a cell size, not subdivision.
-Fixed a bug recently introduced when releasing mouse events and calling popups
2017-12-21 11:05:55 -03:00
volzhs 0856259d19 Respect HDR option 2017-12-21 22:49:55 +09:00
Juan Linietsky feef500b39 properly send mouse released event when grabbing modal focus, fixes #14854 2017-12-20 18:03:48 -03:00
Juan Linietsky 1eb1837d0c Should no longer crash after rebaking, may be a solution to #14795
Not sure if this is the same problem, as reported, please test.
2017-12-19 09:58:02 -03:00
Nathan Warden fcba654bb8 Fixed a bug where mouse button focus breaks when using multiple buttons at once. 2017-12-16 19:30:49 -05:00
Juan Linietsky 1b944cb663
Revert "Fix mouse button release not sent to gui_input if it's different from the button that gave focus" 2017-12-16 19:50:32 -03:00
Rémi Verschelde 9079be9e83
Merge pull request #14484 from Zylann/fix_mouse_focus_button_release
Fix mouse button release not sent to gui_input if it's different from the button that gave focus
2017-12-16 13:29:44 +01:00
Bernhard Liebl 0d826717e7 Fixes oversized tooltip labels (issue 14570) 2017-12-15 19:33:00 +01:00
Rémi Verschelde 7d735da6aa
Merge pull request #13351 from poke1024/fix12451_2
Make click on arrow properly open and close property editor modals
2017-12-10 11:58:36 +01:00
Bernhard Liebl efc3ffb816 fix certain popup close clicks with popup buttons 2017-12-10 10:55:48 +01:00
Marc Gilleron f52da158d9 Fix mouse button release not sent to gui_input if it's different from the button that gave focus 2017-12-10 02:25:39 +01:00
volzhs 0e9d31a2e6 Fix mouse position in viewport 2017-12-10 06:15:57 +09:00
Juan Linietsky dd892a327d Added some clean up in camera/viewport management. Fixes #12279, Fixes #12774 2017-12-07 12:13:20 -03:00
Juan Linietsky d438ac0aed -Implemented Proxy Textures (needed to solve the problem with ViewportTexture)
-Properly use hierarchy to initialize resources local to scene (solves problem of GUI in 3D)
2017-12-04 15:56:17 -03:00
AndreaCatania d6e413bb9c Removed type_mask and fixed some variable name 2017-11-21 22:56:40 +01:00
Bernhard Liebl 80ad8afc85 Native pan and zoom for macOS 2017-11-21 09:11:39 +01:00
Rémi Verschelde f2f75d1f11 Merge pull request #12149 from endragor/check-input-handled
Check if input is handled before handling it
2017-10-20 22:47:31 +02:00
Poommetee Ketson f9f3829bd2 Fix Viewport clear mode is bool instead of int, fixes #12202 2017-10-19 18:17:11 +07:00
Ruslan Mustakov 5da02a0d9c Check if input is handled before handling it 2017-10-16 19:13:33 +07:00
AndreaCatania 4537977d6d Renamed fixed_process to physics_process 2017-09-30 16:19:07 +02:00
letheed 5ad9be4c24 Rename pos to position in user facing methods and variables
Rename user facing methods and variables as well as the corresponding
C++ methods according to the folloming changes:

* pos -> position
* rot -> rotation
* loc -> location

C++ variables are left as is.
2017-09-20 13:11:10 +02:00
Maxim Sheronov 0fffa45158 Fix enums bindings
Add missed bindings for enums
Move some enums to class to have correct output of api.json
2017-09-13 20:57:07 +03:00
Hein-Pieter van Braam 5e18967d77 Fix serveral recent new clang-format errors 2017-09-08 00:20:16 +02:00
Juan Linietsky 1eeda0f32f Restored auto snapping of controls to pixels, fixes #10847 and probably several more issues. Made it optional in the project settings but defaults to true. 2017-09-07 11:22:07 -03:00
Hein-Pieter van Braam 9c63ab99f0 Fix use of unitialized variables
The second in my quest to make Godot 3.x compile with -Werror on GCC7
2017-09-02 01:59:26 +02:00
Juan Linietsky 5653477a30 Exposed new ClearMode function to Viewport clases, closes #9995 2017-08-31 11:15:10 -03:00
Rémi Verschelde 7ad14e7a3e Dead code tells no tales 2017-08-27 22:13:45 +02:00
Rémi Verschelde bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Poommetee Ketson 87917e769f Viewport: fix 'size' binding from Rect2 to Vector2 2017-08-27 12:03:19 +07:00
Juan Linietsky 1894157c9f -Massive clean up to gizmos
-Make sure handles are always visible (on top)
-Fixed instanced scene selection (should work properly now)
-Added interpolated camera
-Customizable gizmo colors in editor settings
2017-08-26 00:47:28 -03:00
Hein-Pieter van Braam cacced7e50 Convert Object::cast_to() to the static version
Currently we rely on some undefined behavior when Object->cast_to() gets
called with a Null pointer. This used to work fine with GCC < 6 but
newer versions of GCC remove all codepaths in which the this pointer is
Null. However, the non-static cast_to() was supposed to be null safe.

This patch makes cast_to() Null safe and removes the now redundant Null
checks where they existed.

It is explained in this article: https://www.viva64.com/en/b/0226/
2017-08-24 23:08:24 +02:00
Juan Linietsky 2cc8309249 Merge pull request #10351 from neikeq/enums-are-for-the-weak
ClassDB: Provide the enum name of integer constants
2017-08-21 19:56:08 -03:00
Wilson E. Alvarez 0017e21521 Fixed segfault when hovering over scene tree elements and showing tooltips. 2017-08-20 22:28:07 -04:00
Ignacio Etcheverry 32dd9a9f66 ClassDB: Provide the enum name of integer constants 2017-08-20 22:07:43 +02:00
Juan Linietsky 541fdffc0a Merge pull request #10319 from neikeq/pr-engine-editor-hint
Adds Engine::is_editor_hint() method
2017-08-20 12:55:46 -03:00
Ignacio Etcheverry 90b8a5b71e Removes editor_hint from SceneTree 2017-08-19 01:29:45 +02:00
kubecz3k 129ebca41d Merge pull request #9889 from groud/control_enhancements
Control node enhancements
2017-08-15 22:55:49 +02:00
Juan Linietsky fdc2cdef0b Ensure nothing is found outside modal stack, but keep logic going. Fixes #7622 2017-08-15 07:32:15 -03:00
Gilles Roudiere 0d35d4d53b Replace GUI anchor type by a float between 0 and 1 2017-08-13 21:20:13 +02:00
Ignacio Etcheverry 78619a5866 Fixes method definitions with extra number of arguments 2017-08-10 07:17:51 +02:00
Ignacio Etcheverry 2f290038d6 Removes type information from method binds 2017-08-10 07:17:50 +02:00
Thomas Herzog 5ada918d9f Merge pull request #10136 from MednauN/master
Add handling of touch events in _gui_input_event
2017-08-07 22:23:30 +02:00
Indah Sylvia 5ae78fdf6a Makes all Godot API's methods Lower Case 2017-08-07 18:24:35 +07:00
Evgeny Zuev 60230675d9 Add handling of touch events in _gui_input_event
Fixes #10039
2017-08-07 15:14:50 +07:00