Commit graph

375 commits

Author SHA1 Message Date
Rémi Verschelde a6b869988f
Merge pull request #44276 from YeldhamDev/tooltip_position_embedded_fix
Fix tooltip position in main embedded window
2021-01-01 16:28:59 +01:00
Marcel Admiraal 5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
Marcel Admiraal 4b8b803931 Rename Control margin to offset 2020-12-23 06:25:56 +00:00
reduz d2302f53d6 Implement automatic LOD (Level of Detail)
-Happens on import by default for all models
-Just works (tm)
-Biasing can be later adjusted per node or per viewport (as well as globally)
-Disabled AABB.get_support test because its broken
2020-12-18 15:48:03 +01:00
Daniel Ting aea7fde241 Rename neighbour in Control to neighbor
This keeps things consistent with the rest of Godot, which uses the
American English spelling of Color.
2020-12-15 16:42:21 -06:00
Michael Alexsander 48027448bf Fix tooltip position in embedded window 2020-12-10 16:11:57 -03:00
Marcel Admiraal 284642be01 Rename Viewport::ClearMode::CLEAR_MODE_ONLY_NEXT_FRAME to CLEAR_MODE_ONCE 2020-12-10 12:24:49 +00:00
Rémi Verschelde a09846e015
Merge pull request #42109 from EricEzaM/PR/input-and-shortcuts-rework
Shortcuts rework - fixed issues with input propagation and triggering of unwanted shortcuts.
2020-11-28 09:04:25 +01:00
Rémi Verschelde a6751e6c58
Merge pull request #41100 from bruvzg/ctl_text_server_interface
[Complex Text Layouts] Implement TextServer interface.
2020-11-28 09:03:15 +01:00
reduz 1bcf3c305b Implement signed distance fields for 2D shaders 2020-11-26 10:49:50 -03:00
bruvzg 99666de00f
[Complex Text Layouts] Refactor Font class, default themes and controls to use Text Server interface.
Implement interface mirroring.
Add TextLine and TextParagraph classes.
Handle UTF-16 input on macOS and Windows.
2020-11-26 14:25:48 +02:00
Eric M efe5c250d5 Implement new shortcuts system.
unhandled_key_input changed to unhandled_button_input. Controls can set a 'shortcut_context' which they can then use to determine if their shortcuts should be triggered or not, based on if the viewport's focused GUI control is a child of their 'shortcut context'.
2020-11-23 21:14:26 +10:00
Aaron Franke 02161aad5a
Remove empty lines around braces with the formatting script 2020-11-16 23:38:11 -05:00
reduz 127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
Rémi Verschelde afef8e30ea
Merge pull request #39635 from Meriipu/master_nodrop
do not drop mouseover on WM_MOUSE_EXIT
2020-11-03 20:28:11 +01:00
Rémi Verschelde c5d8dafec4
Tooltips: Improve code clarity and docs
The return type for `_make_custom_tooltip` is clarified as Control, and users
should make sure to return a visible node for proper size calculations.

Moreover in the current master branch, a PopupPanel will be added as parent
to the provided tooltip to make it a sub-window.

Clarifies documentation for `Control._make_custom_tooltip`, and shows how to
use the (until now undocumented) "TooltipPanel" and "TooltipLabel" theme types
to style tooltips.

Fixes #39677.
2020-11-03 09:19:03 +01:00
reduz 0e6664539d Refactor pixel snapping.
-Rename pixel_snap to snap_2d_to_vertices
-Added snap_2d_to_transforms which is more useful

Fixes #41814
Solves proposal https://github.com/godotengine/godot-proposals/issues/1666
Supersedes #35606, supersedes #41535, supersedes #41534
2020-10-30 08:57:32 -03:00
reduz 84d734da0e Refactored 2D shader and lighting system
-Removed normal/specular properties from nodes
-Create CanvasTexture, which can contain normal/specular channels
-Refactored, optimized and simplified 2D shaders
-Use atlas for light textures.
-Use a shadow atlas for shadow textures.
-Use both items aboves to make light rendering stateless (faster).
-Reorganized uniform sets for more efficiency.
2020-10-24 15:57:25 -03:00
Juan Linietsky 85ebf40b6c
Merge pull request #38097 from Calinou/add-viewport-debanding
Add a debanding property to Viewport
2020-10-19 14:15:44 -03:00
Rémi Verschelde 19f72beebb
Merge pull request #42451 from Duroxxigar/rename-toplevel
Renamed toplevel to be top_level
2020-10-02 10:57:23 +02:00
Rémi Verschelde 12091b39d2
Merge pull request #38743 from arrowinaknee/node-config-warnings
Update all get_configuration_warning() to retrieve warnings from the parent
2020-10-01 14:03:29 +02:00
Duroxxigar b687ace7f9 Renamed toplevel to be top_level 2020-10-01 03:17:33 -04:00
Rémi Verschelde c217498aa6
Merge pull request #41895 from 11thPenguin/master
Fix minor typo, gui_hid -> gui_hide
2020-09-29 10:35:12 +02:00
Meriipu e8804b9978 Make the currently hovered control get updated on mouse-release
Previously, when the mouse was released after dragging a scrollbar,
its highlight was not dropped (if the mouse cursor was still inside
the viewport). This seems to be because the currently hovered control
only gets updated when the mouse is moved.

This commit fixes the dropping of the cosmetic highlight by running
the check for whether the currently hovered control has changed on
mouse-clicks, in addition to to the existing mouse-movements.
2020-09-28 16:04:01 +02:00
Eric M 07cb95bbda Tooltip flickering and targeting fixes. 2020-09-15 17:34:29 +10:00
Jonah Stich f6b14238c7 Fixed minor typo, gui_hid -> gui_hide. 2020-09-08 18:08:21 -07:00
Meriipu 44657db3e2 If the mouse is held on notification_wm_mouse_exit, do not drop focus
This fixes a bug where users of the scrollbar had to be very careful
not to move the mouse outside the viewport, otherwise the scrollbar
would drop its drag-action and stop scrolling until clicked again.

The existing behaviour had the side-effect of also dropping the
cosmetic highlighting of the scrollbar (in addition to the dragging),
for the specific case where the mouse was move outside the window.
The previous behaviour did nothing to remove the highlight if the
mouse was released (but not moved) inside the viewport.

This separate issue with the lingering highlight of the scrollbar
(until a mouse-movement action is performed inside the viewport) is
fixed in an immediate followup to this commit.

Closes bug #39634
2020-09-07 04:11:27 +02:00
Hugo Locurcio 8891579068
Add a debanding property to Viewport
It can be enabled in the Project Settings
(`rendering/quality/screen_filters/use_debanding`). It's disabled
by default as it has a small performance impact and can make
PNG screenshots much larger (due to how dithering works).
It will also slightly brighten the scene's dark areas.

As a result, it should be enabled only when banding is noticeable enough.

This closes #17006.
2020-08-14 23:12:33 +02:00
George Marques 5cbd032309
Fix input after removing multilevel calls 2020-07-27 15:23:57 -03:00
George Marques 2b9d9bc364
Remove multilevel calls
In general they are more confusing to users because they expect
inheritance to fully override parent methods. This behavior can be
enabled by script writers using a simple super() call.
2020-07-24 14:13:58 -03:00
Juan Linietsky d3adc53ad9 Ensure cursor shape changes when exiting window, fixes #37724 2020-07-02 14:17:46 -03:00
Rémi Verschelde 0636e2a877
Merge pull request #40020 from reduz/fix-tree-edit-focus
Fix doubleclick on tree item, restore input focus on previous windows.
2020-07-02 07:26:13 +02:00
Juan Linietsky 39a77735bd Add ability to clamp embedded subwindows to parent, fixes #37792 2020-07-01 12:49:35 -03:00
Juan Linietsky 058166fb6c Fix doubleclick on tree item, restore input focus on previous windows.
Closes #37335
2020-07-01 12:46:39 -03:00
Juan Linietsky 239942cfef Ensure embedded mode works again
Also implemented application in/out notifications in X11.
2020-07-01 09:27:43 -03:00
Juan Linietsky 438c380458 Add a separate application focus/in notification out from Window focus notification. 2020-06-30 10:40:06 -03:00
Juan Linietsky 201d606b3d Addition of SDFGI for open world global illumination
Move GI to a deferred pass
2020-06-26 11:06:48 -03:00
ArrowInAKnee 9fc2b0fddc Update all get_configuration_warning to retrieve warnings from the parent 2020-05-16 16:07:42 +03:00
Rémi Verschelde 0ee0fa42e6 Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14 21:57:34 +02:00
Rémi Verschelde 07bc4e2f96 Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
  -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
  -o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```

This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.

This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde 0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde 1f6f364a56 Port member initialization from constructor to declaration (C++11)
Using `clang-tidy`'s `modernize-use-default-member-init` check and
manual review of the changes, and some extra manual changes that
`clang-tidy` failed to do.

Also went manually through all of `core` to find occurrences that
`clang-tidy` couldn't handle, especially all initializations done
in a constructor without using initializer lists.
2020-05-14 10:01:56 +02:00
Rémi Verschelde f7ca1c805b doc: Sync classref with current source 2020-05-04 16:55:01 +02:00
Rémi Verschelde 878adb22b7
Merge pull request #37717 from qarmin/world_fix
Change non-existent World to World3D
2020-05-04 16:37:40 +02:00
Rémi Verschelde fdf58a5858 Rename InputFilter back to Input
It changed name as part of the DisplayServer and input refactoring
in #37317, with the rationale that input no longer goes through the
main loop, so the previous Input singleton now only does filtering.

But the gains in consistency are quite limited in the renaming, and
it breaks compatibility for all scripts and tutorials that access
the Input singleton via the scripting language. A temporary option
was suggested to keep the scripting singleton named `Input` even if
its type is `InputFilter`, but that adds inconsistency and breaks C#.

Fixes godotengine/godot-proposals#639.
Fixes #37319.
Fixes #37690.
2020-04-28 15:19:49 +02:00
Rémi Verschelde b7b46093d8 doc: Sync classref with current source
Add missing enum bindings.
2020-04-20 11:48:00 +02:00
qarmin 559bc3ca87 Change non-existent World to World3D 2020-04-18 11:00:51 +02:00
clayjohn b50d954cb0 Update many docs with recent rendering changes 2020-04-17 09:47:59 -07:00
Juan Linietsky 5944eb6e7f Implement decals
Also implemented decal atlas, so projectors and other stuff can be added.
Sidenote: Had to make RID hashable, so some unrelated includes changed
in order to include it in hashfuncs.h
2020-04-14 11:13:34 -03:00
Juan Linietsky 16ae2cc1bf Add screen space AA option, with FXAA implementation. 2020-04-12 10:57:18 -03:00