Commit graph

1904 commits

Author SHA1 Message Date
Markus Sauermann
5312d83f3b Fix Viewport::get_mouse_position for SubViewports
SubViewports don't have a cached mouse position available.
This PR calculates the mouse position from the screen position of
the mouse cursor.
2023-02-07 13:54:47 +01:00
Rémi Verschelde
cd0f1e9b10
Merge pull request #72740 from Sauermann/fix-event-device-id
Fix mouse/drag/touch InputEvents having no device id
2023-02-06 23:51:26 +01:00
Markus Sauermann
8748f4dcaa Fix mouse/drag/touch InputEvents having no device id
Some internally created emulated/instantiated events didn't have a
device id. This PR sets for these cases a device id.

Also rename `DEVICE_ID_TOUCH_MOUSE` to the more generic
`DEVICE_ID_EMULATION`.
2023-02-06 22:49:42 +01:00
Markus Sauermann
262d84fa90 Fix MOUSE_FILTER_STOP not affecting emulated mouse events
Touch and Drag events are now stopped by MOUSE_FILTER_STOP
2023-02-06 22:31:03 +01:00
Rémi Verschelde
82ff7b4bce
Merge pull request #68492 from Sauermann/fix-picking-sort
Fix propagation order for 2D physics picking events
2023-02-06 15:38:38 +01:00
Markus Sauermann
6e855e3820 Fix propagation order for 2D physics picking events
This patch adds a viewport-configuration-option for sorting
physics-picking events by the Z-Index and the scene tree position
of the collision objects.
2023-02-04 22:44:36 +01:00
kobewi
7331750618 Fix Camera2D crash due to ParallaxBackground node 2023-02-03 15:36:08 +01:00
Markus Sauermann
e3e9da78e8 Remove Viewport::_get_input_pre_xform
This function is only relevant for `Window`. So this PR moves
the functionality to the `Window`-class.
2023-02-02 22:03:52 +01:00
Rémi Verschelde
a16b0fec40
Merge pull request #72618 from Sauermann/fix-simplify-set-size
Simplify Viewport::_set_size
2023-02-02 21:05:51 +01:00
Markus Sauermann
6743ac34d3 Simplify Viewport::_set_size
`Viewport.to_screen_rect` is used only in a single location to compare it
to `Rect2i()`.

When called from `SubViewport`, `to_screen_rect` is always equal to `Rect2i()`.
When called from `Window`, `to_screen_rect` is always different from `Rect2i()`.

So the comparison `to_screen_rect != Rect2i()` can be replaced by
`Object::cast_to<Window>(this)`.

This allows the removal of `Viewport.to_screen_rect` and the simplification of
`Viewport::_set_size`.
2023-02-02 19:09:14 +01:00
Markus Sauermann
3bc426c9d8 Fix toplevel nomenclature
toplevel was 3.x
top_level is 4.x
2023-02-02 17:37:41 +01:00
kobewi
724d6581d6 Fix Camera2D crashes 2023-02-01 23:49:02 +01:00
Rémi Verschelde
e52213e2fa
More codespell fixes, do more changes from previous ignore list 2023-02-01 12:11:36 +01:00
Rémi Verschelde
2852d5e613
Merge pull request #67331 from Sauermann/fix-subviewport-no-stretch-update
Fix stretch transform when resizing SubViewports
2023-02-01 11:10:01 +01:00
Rémi Verschelde
f7397a5ac6
Merge pull request #58610 from Sauermann/fix-physics-mouse
Fix execution of physics picking events at unexpected times
2023-02-01 09:41:43 +01:00
Rémi Verschelde
394bb0ee2b
Fix various typos with codespell
Finally do the childs -> children rename too.
2023-02-01 08:45:41 +01:00
Markus Sauermann
8182f29d40 Fix stretch transform when resizing SubViewports
Move calculation of stretch transform from outside to inside
of `Viewport::_set_size` function.
2023-02-01 08:34:40 +01:00
Rémi Verschelde
d9ade633b3
Merge pull request #71936 from akien-mga/remove-some-unused-signals
Remove some unused signals
2023-02-01 07:53:52 +01:00
Rémi Verschelde
e8240031e7
Merge pull request #71479 from raulsntos/virtual-return-type
Use enum instead of int in virtual methods return type
2023-02-01 07:45:28 +01:00
Rémi Verschelde
51414fc987
Merge pull request #66906 from Sauermann/fix-prohibit-inconsistent-size-state
Prohibit inconsistent size state for SubViewport
2023-02-01 07:26:00 +01:00
Markus Sauermann
decbda68d7 Prohibit inconsistent size state for SubViewport
Prohibit size changes of SubViewports with parent SubViewportContainers that have stretch mode enabled.
2023-01-31 22:53:43 +01:00
Raul Santos
9e9eac4676
Use enum instead of int in virtual methods return type 2023-01-31 19:06:49 +01:00
Rémi Verschelde
14a4408e02
Merge pull request #65698 from KoBeWi/cameraman
Rework how current Camera2D is determined
2023-01-31 18:56:20 +01:00
Rémi Verschelde
b342dcdf04
Remove some unused signals
Part of #37604.
2023-01-31 18:54:04 +01:00
Rémi Verschelde
2b710bc336
Fix MSVC shadow local warning 2023-01-31 18:06:21 +01:00
Rémi Verschelde
1c42e141d0
Merge pull request #59310 from Sauermann/proposal-event-transform
Calculate window input event transform only on window change
2023-01-31 15:57:07 +01:00
Rémi Verschelde
4cfdd25384
Merge pull request #67507 from Sauermann/fix-toplevel-root-control-node
Fix event propagation to child after set_as_toplevel
2023-01-31 15:55:46 +01:00
Rémi Verschelde
bde3310f02
Merge pull request #71995 from Faless/net/4.x_tls_verify
[NET] Refactor TLS configuration.
2023-01-30 13:28:31 +01:00
Rémi Verschelde
2e0d9efb72
Merge pull request #72115 from AThousandShips/clip_children_fix
Hide `clip_children` for some non-drawn CanvasItems
2023-01-30 10:02:54 +01:00
Ninni Pipping
bbf203bc32 Hide clip_children for non-drawn CanvasItems 2023-01-30 08:22:06 +01:00
Hugo Locurcio
9f026d5274
Fix Editor Description tooltip not changing until scene is reopened
You still need to select another node to see the tooltip updated first,
but you no longer need to save and reopen the scene to view the updated
tooltip.
2023-01-30 00:18:13 +01:00
Fabio Alessandrelli
adba870534 [NET] Refactor TLS configuration.
Use a TLSOptions configuration object which is created via static
functions.

- "TLSOptions.client": uses the standard CA and common name verification.
- "TLSOptions.client_unsafe": uses optional CA verification (i.e. if specified)
- "TLSOptions.server": is the standard server configuration (chain + key)

This will allow us to expand the TLS configuration options to include
e.g. mutual authentication without bloating the classes that uses
StreamPeerTLS and PacketPeerDTLS as underlying peers.
2023-01-28 11:08:02 +01:00
Rémi Verschelde
aae96945fa
Merge pull request #71470 from YeldhamDev/window_fixes
Fix some small bugs in the `Window` node
2023-01-27 19:26:31 +01:00
Markus Sauermann
b15a3ea3a4 Added assertion check 2023-01-26 16:10:32 +01:00
Rémi Verschelde
058c61b5b3
Merge pull request #68007 from Sauermann/fix-3d-capture
Fix event-content and mouse-signals with 3D-capture-on-drag
2023-01-26 16:00:26 +01:00
Rémi Verschelde
13e20fed99
Merge pull request #68627 from Sauermann/fix-tooltip-position
Fix position of Tooltips
2023-01-26 16:00:14 +01:00
Markus Sauermann
83fa14a5a9 Include the Window-transform into Viewport::get_final_transform 2023-01-26 15:30:44 +01:00
Markus Sauermann
c4ed247f5f Fix position of Tooltips
CanvasItem::get_screen_transform returns a transform from the CanvasItem
to the coordinate system, where a Popup - created as a child of the
CanvasItem - should be opened.
get_screen_transform makes some simplifications, that work well, when used
in the editor, but not in general cases.

Since Popups like Tooltips are now used more commonly in projects,
it becomes necessary to correct these simplifications.

This solution introduces Viewport::get_popup_base_transform, which makes
the necessary calculations.
2023-01-26 15:15:14 +01:00
Aaron Franke
2bc0bcbd26
PropertyUsage: Rename "DO_NOT_SHARE_ON_DUPLICATE" to "ALWAYS_DUPLICATE" 2023-01-24 16:05:07 -06:00
Yuri Sizov
fab9926a95
Merge pull request #65137 from dalexeev/editor-naming
Rearrange `editor/naming/*` project settings
2023-01-24 22:26:03 +03:00
Rémi Verschelde
11e2278844
Merge pull request #57606 from SaracenOne/update_on_reimport
Update instances of scenes which have been reimported.
2023-01-23 15:35:44 +01:00
Rémi Verschelde
5b1df48c6c
Convert en_GB spelling to en_US with codespell 2023-01-23 11:02:20 +01:00
Rémi Verschelde
cd031fd31a
Merge pull request #71663 from bruvzg/init_pos_x
Reorganize main and sub-window initial position properties.
2023-01-22 11:25:58 +01:00
Rémi Verschelde
229c82690d
Merge pull request #70294 from KoBeWi/treedulate
Add a method to get global modulate
2023-01-21 20:51:42 +01:00
Rémi Verschelde
7b622ce6e8
Merge pull request #71021 from reduz/prevent-physics-callback-removal
Error when removing a physics node during a physics callback
2023-01-21 11:28:02 +01:00
Rémi Verschelde
a83093fa80
Merge pull request #71692 from HalcyonGarside/viewport-debug-draw-fix
Fix incorrect Viewport Debug Draw effects
2023-01-20 08:49:21 +01:00
Rémi Verschelde
9fc40123ab
Merge pull request #71679 from kleonc/draw_polyline_line_strip
`CanvasItem::draw_polyline` Support thin polylines drawn using line strip
2023-01-20 08:48:56 +01:00
Rémi Verschelde
360b61084a
Merge pull request #41239 from dalexeev/fix_draw_rect
Fix `CanvasItem.draw_rect` function with `filled = false`
2023-01-19 22:49:23 +01:00
HalcyonGarside
ef35c4002c Add 'Lighting' to list of Debug Draw viewport options 2023-01-19 15:23:59 -05:00
kleonc
728c51e362 CanvasItem::draw_polyline Support thin polylines drawn using line strip 2023-01-19 21:08:25 +01:00
bruvzg
aade5abd4f
Reorganize main and sub-window initial position properties. 2023-01-19 13:44:06 +02:00
Michael Alexsander
52b077ca28 Fix some small bugs in the Window node 2023-01-18 21:20:49 -03:00
Rémi Verschelde
2050f59e3a
Merge pull request #71623 from kleonc/draw_arc_clamp_to_single_circle
`CanvasItem::draw_arc` Clamp angle difference so arc won't overlap itself
2023-01-18 22:28:24 +01:00
kleonc
43fc483e6c CanvasItem::draw_arc Clamp angle difference so arc won't overlap itself 2023-01-18 15:16:22 +01:00
Mai Lavelle
a058cedb53 Fix crash on touch release 2023-01-17 19:12:55 -05:00
Danil Alexeev
c046bb8389
Fix CanvasItem.draw_rect function with filled = false 2023-01-17 09:15:47 +03:00
SaracenOne
4628736894 Update instances of scenes which have been reimported. 2023-01-16 13:46:33 -08:00
Rémi Verschelde
ae3ca04aba
Merge pull request #69598 from Sauermann/fix-focus-inverse
Calculate the mouse focus inverse transform only when needed
2023-01-16 22:11:23 +01:00
Rémi Verschelde
47689c7d51
Merge pull request #71502 from bruvzg/tooltip_clickthrough
Add `WINDOW_FLAG_MOUSE_PASSTHROUGH` flag and enabled it for tooltips.
2023-01-16 12:48:45 +01:00
Danil Alexeev
a8cbb6245b
Fix scaling issue in draw_line and similar methods 2023-01-16 12:49:58 +03:00
bruvzg
34b34b104c
Add WINDOW_FLAG_MOUSE_PASSTHROUGH flag and enabled it for tooltips. Expose window_set_mouse_passthrough to Window. 2023-01-16 11:42:49 +02:00
Rémi Verschelde
55bf948fe7
Fix change_scene memory leak due to duplicate instantiation
Regression from #71105.
Fixes #71363.
2023-01-15 14:05:15 +01:00
bruvzg
9b2843f14f
Improve dashed line alignment and make it optional. 2023-01-13 10:30:12 +02:00
Rémi Verschelde
f79c58aac5
Merge pull request #71209 from bruvzg/ed_progress_reparent
Automatically reparent editor progress dialog to avoid error spam.
2023-01-13 00:29:48 +01:00
Danil Alexeev
8f706be6fa
Rearrange editor/naming/* project settings 2023-01-12 11:41:13 +03:00
Rémi Verschelde
baae87e307
Merge pull request #71105 from reduz/unload-current-scene
Add SceneTree.unload_current_scene()
2023-01-11 09:46:33 +01:00
bruvzg
19293d1813
Automatically reparent editor progress dialog to avoid error spam. 2023-01-11 10:13:21 +02:00
Juan Linietsky
e5f2c442c7 Add SceneTree.unload_current_scene()
Provides an obvious way to unload the currently loaded scene (which is nowhere to be found in the docs).
The SceneTree.change_scene_to() method must now always provide a valid PackedScene.

Fixes #63565.
2023-01-10 14:02:06 +01:00
bruvzg
ca8b762797
Add Node::get_window() method. 2023-01-10 11:10:46 +02:00
Rémi Verschelde
dce8cdbca8
Merge pull request #70863 from bruvzg/win_init_min
Set main window min. size via Window object instead of DisplayServer to preserve it during window updates.
2023-01-09 23:08:52 +01:00
Markus Sauermann
0d6d5e6421 Calculate the mouse focus inverse transform only when needed
Revival of #49158

Co-authored-by: Marcel Admiraal <madmiraal@users.noreply.github.com>
2023-01-09 21:35:38 +01:00
Yuri Sizov
0ca5a72e90 Clarify some parent item checks in CanvasItem 2023-01-09 19:59:55 +03:00
Juan Linietsky
2b815df3c1 Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
2023-01-08 22:17:40 +01:00
Rémi Verschelde
d642274f75
Merge pull request #70939 from bruvzg/win_screen_2
Add support for the custom initial screen for the main window, fix primary screen detection.
2023-01-07 13:21:36 +01:00
Rémi Verschelde
3579d7a9f7
Merge pull request #36301 from KoBeWi/daddy_node
Add reparent methods to Node
2023-01-07 13:20:56 +01:00
Juan Linietsky
398e73c689 Error when removing a phycics node during a physics callback
* This behavior is not allowed, the error text suggests using call_deferred().
* Added a check in Node::remove_child to prevent future crashes of this type.
* Fixed a performance regression introduced by #36244.

Fixes #63718, probably other crashes too.
2023-01-07 12:57:24 +01:00
bruvzg
2718a7b7d3
Add support for the custom initial screen for the main window, fix primary screen detection. 2023-01-07 11:14:35 +02:00
Rémi Verschelde
163f6f5fe8
Merge pull request #68429 from KoBeWi/PropertySettings
Add PropertyInfo overload for GLOBAL_DEF
2023-01-06 22:59:29 +01:00
Rémi Verschelde
d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
Rémi Verschelde
8791e333da
Merge pull request #70624 from bruvzg/cur_sc
Improve `window_set_current_screen` and fix secondary window initial mode and positions.
2023-01-03 15:56:05 +01:00
bruvzg
06551dfa3a
Set main window min. size via Window object instead of DisplayServer to preserve it during window updates. 2023-01-03 09:25:45 +02:00
Adam Scott
ea33001b95 Add safety-checks before some servers free() 2022-12-29 16:23:38 -05:00
bruvzg
f7955633de
Improve window_set_current_screen and fix secondary window initial mode and positions. 2022-12-29 09:43:39 +02:00
Aaron Franke
3161647dab
Fix CanvasItem Z-index referring to Node2D 2022-12-19 20:59:14 -06:00
Rémi Verschelde
adc1096b19
Merge pull request #70219 from bruvzg/msdf_outline_scaling
Scale MSDF font outline with the font size and MSDF source size to match dynamic font behavior.
2022-12-19 16:26:56 +01:00
Rémi Verschelde
f29f3db419
Merge pull request #59682 from Sauermann/fix-following-viewport-transform
Include the follow-viewport-transform into CanvasLayer transform calculations
2022-12-19 16:26:19 +01:00
kobewi
32b0770a73 Add a method to get global modulate 2022-12-19 11:51:37 +01:00
Markus Sauermann
2da2220da7 Include the following-viewport-transform into CanvasLayer transforms
The following-viewport-transform was missing from several calculations
2022-12-18 22:44:34 +01:00
bruvzg
20d9457f9d
Scale MSDF font outline with the font size and MSDF source size to match dynamic font behavior. 2022-12-17 22:47:54 +02:00
Rémi Verschelde
a1f481a7d6
Merge pull request #70202 from Calinou/viewport-transparent-background-rename-project-setting
Move transparent background project setting to a subsection
2022-12-17 20:56:19 +01:00
Hugo Locurcio
a3eac5fc7c
Move transparent background project setting to a subsection
This prevents the project setting from being located directly within
a root category, which is confusing from an UX perspective in the
project settings editor.
2022-12-17 18:45:21 +01:00
Rémi Verschelde
8be126272f
Merge pull request #70075 from Sauermann/fix-missing-shortcut-handled-check
Fix missing check if shortcut event is handled for Control-nodes
2022-12-16 13:47:39 +01:00
Haoyu Qiu
e173710963 Fix possible Tween leak on exit 2022-12-15 19:09:09 +08:00
Markus Sauermann
57ff04278b Fix missing check if shortcut event is handled for Control-nodes
Control-nodes without a shortcut-context were missing a check if
the event was handled, so that a single shortcut-event was passed to
multiple Control-nodes.
2022-12-14 22:22:24 +01:00
Rémi Verschelde
f1edd03d4c
Merge pull request #69718 from groud/finally_rename_gdnative_to_gdextension
Rename all gdnative occurences to gdextension
2022-12-12 11:43:59 +01:00
Gilles Roudière
be1c9d677d Rename all gdnative occurences to gdextension
Non-exhaustive list of case-sensitive renames:

GDExtension -> GDNative
GDNATIVE -> GDEXTENSION
gdextension -> gdnative
ExtensionExtension ->Extension (for where there was GDNativeExtension)
EXTENSION_EXTENSION ->EXTENSION (for where there was GDNATIVE_EXTENSION)
gdnlib -> gdextension
gdn_interface -> gde_interface
gdni -> gde_interface
2022-12-12 11:04:57 +01:00
kobewi
7c6b659bd7 Add PropertyInfo overload for GLOBAL_DEF 2022-12-11 21:36:48 +01:00
Yuri Sizov
29cc86fa6c Copy local theme overrides from Control to Window 2022-12-07 20:50:51 +03:00
bruvzg
edf13eb5a6
Rename window_get_real_size to window_get_size_with_decorations, add window_get_position_with_decorations. 2022-12-07 11:07:30 +02:00
kobewi
7e2a8afb57 Rework how current Camera2D is determined 2022-12-02 00:05:02 +01:00
Fredia Huya-Kouadio
3ff7dd2aa4 Fix routing of InputEventScreenDrag events to Control nodes 2022-11-30 14:06:41 -08:00
Hendrik Brucker
e84f45fc93 Move z_index, z_as_relative and y_sort_enabled from Node2D to CanvasItem 2022-11-29 17:11:22 +01:00
Rémi Verschelde
ef090ee6ea
Merge pull request #68874 from TokageItLab/fix-unique-path-keying
Added option to `get_path_to()` to get the shortest path considering unique name
2022-11-28 14:49:34 +01:00
Rémi Verschelde
f4faa507d4
Merge pull request #68836 from Calinou/projectsettings-vrs-texture-allow-more-formats
Allow all lossless image formats to be used for VRS texture project setting
2022-11-28 08:38:08 +01:00
Rémi Verschelde
438b2e2d02
Merge pull request #59801 from Sauermann/fix-node2d-viewport-root-order
Fix Viewport root order after Node2D raise
2022-11-28 08:21:10 +01:00
Rémi Verschelde
88e6e1e51c
Revert "SceneTree Fix storing removed nodes to be skipped by the group calls" 2022-11-27 13:42:24 +01:00
Rémi Verschelde
986a4279fa
Merge pull request #68447 from Grimmr/clean-tooltips-on-WM-focus-off
Viewport cancels existing tooltip when window looses focus
2022-11-25 14:04:40 +01:00
grimmr
aa9b5b917f Viewport cancels existing tooltip when window looses focus
fixes #68197

when NOTIFICATION_WM_WINDOW_FOCUS_OUT is recieved by a viewport it will now call
_gui_cancel_tooltip() to avoid it hanging around after the mouse events stop
coming in
2022-11-25 09:44:04 +00:00
Rémi Verschelde
d7e3fce995
Merge pull request #68566 from Mickeon/node-print-orphans-static
Make `Node.print_orphan_nodes()` static
2022-11-24 18:55:30 +01:00
Rémi Verschelde
885fc1f3e7
Merge pull request #68568 from Mickeon/node-parent-busy-error
Update "Parent node is busy" errors to use `Callable.call_deferred()`
2022-11-23 23:11:06 +01:00
Micky
c6a355b9e8 Update "Parent node is busy" errors to use Callable.call_deferred()
Also fixes outdated method names in the messages.
2022-11-23 17:39:34 +01:00
Markus Sauermann
f8df18ef47 Fix CanvasTransform on RenderingServer when Viewport enters Tree
Previously the Viewport didn't initialize its canvas transform in the
RenderingServer.
2022-11-22 23:04:23 +01:00
Fabio Alessandrelli
145f07c037 [Net] Fix HTTPRequest gzip with high compression ratio.
Decompress each body chunk over multiple iterations, this causes more
reallocations, but it ensures decompression will not fail no matter the
compression ratio.
2022-11-20 22:41:14 +01:00
Silc Renew
b9d1550590 Add option to get_path_to() to get the shortest path with unique name 2022-11-19 15:06:25 +09:00
Hugo Locurcio
4b13093251
Allow all lossless image formats to be used for VRS texture project setting
WebP can also be lossy, but the class reference now warns about the
requirement to use a lossless format for the VRS texture to work correctly.
2022-11-18 22:21:28 +01:00
Uxeron
721e51ac28 Fixed _get_drag_data getting incorrect position on scaled controls 2022-11-18 19:10:57 +02:00
Rémi Verschelde
6d2a7cb46d
Merge pull request #68709 from MewPurPur/instance-begone-part3
Remove more instances of 'instance' being used as a verb
2022-11-16 14:41:42 +01:00
VolTer
3b4f5f8a04 Remove more instances of 'instance' being used as a verb 2022-11-16 14:01:53 +01:00
Haoyu Qiu
3b08d0e852 Fix crash of queue_free() when main loop is not SceneTree 2022-11-15 08:25:25 +08:00
Rémi Verschelde
03f30855d1
Merge pull request #67831 from kleonc/scene-tree-fix-storing-removed-nodes
`SceneTree` Fix storing removed nodes to be skipped by the group calls
2022-11-14 23:27:41 +01:00
Rémi Verschelde
0dbb632116
Merge pull request #68564 from Mickeon/node-no-remove-group-error
Strip ERR_FAIL from `Node.remove_from_group()`
2022-11-14 23:24:14 +01:00
Markus Sauermann
3b14f0334c Remove redundant Variant-types initializations 2022-11-14 19:35:19 +01:00
Rémi Verschelde
d639bb87a7
Merge pull request #68272 from Sauermann/fix-windowfocus-on-resize
Fix Windowfocus on resizing
2022-11-14 16:38:00 +01:00
Markus Sauermann
5cf6ebce63 Drop physics mouseover as soon as the mouse moves over a Control 2022-11-14 12:07:26 +01:00
Micky
a1c10dbbd8 Strip ERR_FAIL from Node.remove_from_group()
Also simplifies group check removing unnecessary `!data.grouped.has`
2022-11-13 00:01:18 +01:00
Micky
9b42268467 Make Node.print_orphan_nodes() static 2022-11-12 17:55:42 +01:00
Rémi Verschelde
5c7af7f391
Merge pull request #68418 from Sauermann/fix-escape-dnd
Allow canceling Drag and Drop with the Escape-Key
2022-11-11 16:49:09 +01:00
Markus Sauermann
226044b944 Allow canceling Drag and Drop with the Escape-Key
This patch implements the functionality to cancel Drag and Drop
by using the escape key or more general, the ui_cancel action.

Since this would be the third location, where the finalization of
Drag and Drop would have to be implemented, that functionality was
put into the private function _perform_drop.

Simplified gui.drag_data.get_type() != Variant::NIL to gui.dragging
because they are equivalent.
2022-11-08 19:10:16 +01:00
ktxyz
7601808455 Update sub_windows order with respect to FLAG_ALWAYS_ON_TOP 2022-11-08 13:20:45 +01:00
Markus Sauermann
7445ab95fc Fix SubViewport with default size being pink
A SubViewport with default-size doesn't display its content, but shows
pink color, until it is resized.
This patch makes sure, that the size gets set during initialization.
2022-11-07 09:23:32 +01:00
Markus Sauermann
65647e9c7d Fix Windowfocus on resizing
When resizing a non-focused window, the previously focused
Window got resized.
This patch grabs focus for the actually resized window, before
starting with the resizing.
2022-11-04 22:24:00 +01:00
Rémi Verschelde
d4bf7f4458
Fixup Clang -Wtype-limits warnings introduced by #52350 2022-11-02 22:36:01 +01:00
Markus Sauermann
022d24a9ae Fix Viewport root order after Node2D raise 2022-11-02 21:45:00 +01:00
Rémi Verschelde
30e4e7c083
Merge pull request #67917 from Faless/mp/4.x_auth
[MP] Add peer authentication support to the default MultiplayerAPI.
2022-11-02 18:53:38 +01:00
Rémi Verschelde
604abb434f
Merge pull request #52350 from BimDav/viewport_canvas_cull
Added Viewport canvas cull mask feature
2022-11-02 17:14:24 +01:00
Fabio Alessandrelli
33dda2e68a [MP] Remove connection state signals from MultiplayerPeer.
Now handled directly by the MultiplayerAPI implementation.
2022-11-02 15:17:23 +01:00
Rémi Verschelde
ad0349c0e3
Merge pull request #59479 from Sauermann/fix-rootorder-on-layerchange
Update root order on layer change
2022-11-02 14:20:24 +01:00
Fabio Alessandrelli
0a0e99cadc
Merge pull request #67982 from Faless/mp/4.x_disconnect_close
[MP] Add MultiplayerPeer disconnect_peer, close.
2022-11-01 20:35:04 +01:00
BimDav
fcb9be66a2 Viewport canvas cull mask feature
Co-authored-by: Valentin Zagura <puthre@gmail.com>
2022-10-31 14:09:49 +01:00
Rémi Verschelde
5947f22be9
Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +01:00
Rémi Verschelde
71a6aba3d7
Merge pull request #67710 from KoBeWi/a_bit_local_global_transform
Remove error condition from get_global_transform()
2022-10-31 11:59:08 +01:00
Rémi Verschelde
be126d42d4
Merge pull request #67588 from KoBeWi/if(!GDVIRTUAL_CALL)don't
Simplify GDVIRTUAL_CALL calls
2022-10-31 11:55:56 +01:00
Rémi Verschelde
dcd86f9848
Merge pull request #67046 from Cykyrios/fix-invalid-tooltip-position
Fix invalid tooltip position
2022-10-31 11:05:19 +01:00
Rémi Verschelde
420eb1aa34
Merge pull request #67445 from Zylann/rename_queue_delete
Rename queue_delete => queue_free
2022-10-31 10:51:18 +01:00
Rémi Verschelde
32548f9608
Merge pull request #67467 from timothyqiu/who-ami-i
Fix get_path() error when calling get_node()
2022-10-31 10:33:51 +01:00
Markus Sauermann
35956d9128 Fix event-content and mouse-signals with 3D-capture-on-drag
Fix for 3D-physics processing:
- with enabled input_capture_on_drag now report correct position and
normals in _input_event
- mouse_enter and mouse_exit signals are emitted when the mouse cursor
leaves the visible area of the 3D-object, independently of pressed mouse
button or input_capture_on_drag
- make sure that collision input events are sent in the right order with
respect to mouse_enter and mouse_exit signals
2022-10-29 12:59:46 +02:00
Fabio Alessandrelli
39f3d9d59e [MP] Add MultiplayerPeer disconnect_peer, close.
Update ENet, WebRTC, and WebSocket to support peer disconnection and
unify the close function.
2022-10-28 21:18:01 +02:00
Micky
0e0a233859 Fix spacing of few PROPERTY_HINT_ENUM hint_strings 2022-10-28 14:51:26 +02:00
Clay John
8fd92ed867
Merge pull request #64710 from MinusKube/window-size-crash
Prevent windows from having a size greater than device limit
2022-10-27 10:02:44 -07:00
Clay John
e1caa8797b
Merge pull request #67043 from clayjohn/clip_children
Improve behaviour of clip_children by clipping to parent alpha value but still retaining parent color
2022-10-27 09:59:27 -07:00
Clay John
2f2c138b44
Merge pull request #67926 from Rindbee/fix_call_shortcut_input
Fix calling `_call_shortcut_input` on a node that has been removed
2022-10-27 09:56:55 -07:00
Clay John
d1cc93af89
Merge pull request #67832 from Sauermann/fix-remove-unnecessary-casts
Remove unnecessary casts
2022-10-27 09:47:34 -07:00
Fabio Alessandrelli
7536d15fe3 [MP] Let MultiplayerAPI handle packet relaying and peer signaling.
MultiplayerPeer changes:

- Adds is_server_relay_supported virtual method

Informs the upper MultiplayerAPI layer if it can signal peers connected
to the server to other clients, and perform packet relaying among them.

- Adds get_packet_channel and get_packet_mode virtual methods

Allows the MultiplayerAPI to retrieve the channel and transfer modes to
use when relaying the last received packet.

SceneMultiplayerPeer changes:

- Implement peer signaling and packet relaying when the MultiplayerPeer
  advertise they are supported.

ENet, WebRTC, WebSocket changes:

- Removed custom code for relaying from WebSocket and ENet, and let it
  be handled by the upper layer.
- Update WebRTC to split create_client, create_server, and create_mesh,
  with the latter behaving like the old initialize with
  "server_compatibility = false", and the first two supporting the upper
  layer relaying protocol.
2022-10-27 18:08:58 +02:00
Rindbee
c77349ecb7 Fix calling _call_shortcut_input on a node that has been removed
Nodes may have been deleted by shortcuts. For example, when switching
scenes with `Ctrl` + `Tab` / `Ctrl` + `Shift` + `Tab`, some controls
will be deleted and recreated.
2022-10-27 14:05:51 +08:00
Marc Gilleron
7543a5e014 Rename queue_delete => queue_free
# Conflicts:
#	editor/plugins/tiles/tiles_editor_plugin.cpp
2022-10-24 22:07:02 +01:00
kleonc
471f2da9b6 SceneTree Fix storing removed nodes to be skipped by the group calls 2022-10-24 21:38:19 +02:00
Markus Sauermann
5ee449efec Remove unnecessary casts
button_add_item and button_add are both Button

p_parent is a Node3D

CanvasItem can never be cast to Viewport
2022-10-24 15:59:18 +02:00
kobewi
2ff676a696 Remove error condition from get_global_transform() 2022-10-21 14:52:43 +02:00
kobewi
4efa851d7f Add methods to get target filter and repeat 2022-10-19 14:41:42 +02:00
kobewi
d06a8320e5 Simplify GDVIRTUAL_CALL calls 2022-10-19 00:05:48 +02:00
kobewi
e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
Markus Sauermann
13b87c13c7 Fix set_as_toplevel event propagation to child
In certain conditions events did not get propagated to Control childs of
Node2D nodes when setting a parent of the Node2D to toplevel.

This patch makes sure that such Control nodes become root control in the
viewport.
2022-10-16 21:42:16 +02:00
Haoyu Qiu
64c20a51c1 Fix get_path() error when calling get_node() 2022-10-16 10:48:59 +08:00
Markus Sauermann
39e49a8bdd Expose Viewport::get_screen_transform to GDScript 2022-10-15 23:37:59 +02:00
Miguel Gonzalez Sanchez
a97a00bf02
Rename pos -> index on Node 2022-10-14 19:56:34 +01:00
clayjohn
b6f44859d7 Implement multiple clip_children modes for CanvasItems 2022-10-14 08:02:28 -07:00
Markus Sauermann
b1d6b34662 Always update Viewport's last_mosue_position
When the mouse cursor is over a embedded Window, the Viewport's
last_mouse_position did not get updated.
This patch makes sure that the update happens on every InputEventMouse.

Document canvas layer of embedded Windows.
2022-10-14 12:51:45 +02:00
Rémi Verschelde
f32f5b70d8 Merge pull request #67348 from Mickeon/salvage-a-dear-comment
Comment not to remove `data` structs in some Nodes
2022-10-13 18:40:58 +02:00
Micky
de9e08da76 Comment not to remove data structs in some Nodes 2022-10-13 15:52:35 +02:00
Eric M
a3ed9e6f2c Move Shortcut Context to Control and ensure that shortcut_input adheres to contexts. Also ensure that controls with no context are only triggered AFTER nodes which do have a context. 2022-10-13 21:07:19 +10:00
Rémi Verschelde
15b68f7601 Merge pull request #67232 from bruvzg/popup_edit
Improve Popup / Window behavior in the edited scene tree.
2022-10-12 14:45:14 +02:00
Nikola Bunjevac
d7e9b8af9a Set window size after setting new limits
Otherwise this can fail as the size may not fit
into current limits. This is problematic at least
on X11.
2022-10-11 17:16:20 +02:00
Rémi Verschelde
e413d1c9c3 Merge pull request #67104 from Calinou/add-viewport-transparent-project-setting
Add a project setting to make the root viewport transparent
2022-10-11 09:28:43 +02:00
bruvzg
2e1fcbe14b
Prevent Popups it the edited scene tree from closing on focus loss. Hide irrelevant Popup flags from the editor inspector. 2022-10-11 08:55:00 +03:00
kobewi
b754df2b99 Fix node name casing issues
Co-authored-by: ryburnj <jordanryburn@gmail.com>
2022-10-10 22:31:26 +02:00
Hugo Locurcio
bab8497fa2
Add a project setting to make the root viewport transparent
This allows recording videos with a transparent background without
having to create a script.
2022-10-09 00:16:07 +02:00
Cykyrios
f0d7934055 Fix invalid tooltip position 2022-10-07 22:43:49 +02:00
bruvzg
0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
Markus Sauermann
90b01d79af Fix execution of physics picking events
Fix that physics picking can happen after the mouse has left the viewport
2022-10-06 13:58:54 +02:00
Rémi Verschelde
2b9a145158 Merge pull request #66869 from Sauermann/fix-transform-det-0-spam
Fix Transform2D det == 0 spam for SubViewports
2022-10-04 12:05:37 +02:00
Markus Sauermann
650cc16b05 Fix Transform2D det == 0 spam for SubViewports 2022-10-04 11:48:39 +02:00
Rémi Verschelde
1c6e8f7e62 Merge pull request #66712 from Cykyrios/fix-invalid-popup-position
Fix invalid popup position for embedded popups
2022-10-04 11:19:50 +02:00
Rémi Verschelde
38dd753715 Merge pull request #66859 from Rindbee/reset-gui_parent
Make sure to reset the tooltip of its gui_parent when the viewport is removed
2022-10-04 10:32:51 +02:00
Rindbee
9a05ea231a Make sure to reset the tooltip of its gui_parent when the viewport is removed 2022-10-04 11:58:02 +08:00
Cykyrios
2237df6273 Fix invalid popup position for embedded popups 2022-10-03 21:23:32 +02:00
Rémi Verschelde
f501e4f665 Unix: Remove now unnecessary I/O defines, cleanup
- `LIBC_FILEIO_ENABLED` wasn't defined anywhere, even in _other platforms_.
- `NO_NETWORK` is also never defined. It probably isn't enough anyway to
  disable network APIs in the current codebase.
- `UNIX_SOCKET_UNAVAILABLE` is never defined in this code but used by some
  other platforms, clarify that.
- `NO_STATVFS` can be removed as Android supports it since API level 19,
  which is our current min SDK level. It's also only used for
  `DirAccessUnix::get_space_left()` which is anyway overridden by
  `DirAccessJAndroid::get_space_left()` so it shouldn't make a difference.
  * Fixed documentation for `DirAccess.get_space_left()`.
- `NO_FCNTL` is likely also a remnant of early Android days, in current NDK
  r23 it seems to be available. Also cleaned up unused `fcntl.h` includes.
- `NO_ALLOCA` is never defined, and we use alloca in many places now.
2022-10-03 12:33:41 +02:00
EricEzaM
2a7e61457a Allow shortcut input to be JoypadButton. 2022-10-02 17:11:18 +10:00
Markus Sauermann
2bf2217b1a Calculate window input event transform only on window change 2022-10-01 09:54:38 +02:00
Rémi Verschelde
e3464c8fc8 Merge pull request #58995 from Sauermann/fix-mouse-cursor-change-2
Update mouse cursor shape after changes
2022-09-28 20:50:05 +02:00
Rémi Verschelde
7562932eb2 Merge pull request #66160 from dpalais/double_time
Use double instead of real_t type for time-related parameters and variables
2022-09-27 10:04:10 +02:00
Dave Palais
0c46068af0 Change time parameters and variables to double type
Addresses #65313
2022-09-26 13:52:54 -05:00
kobewi
a4c3551dc6 Force window position if spawned outside screen 2022-09-26 13:44:25 +02:00
bruvzg
0dab11afa4
[macOS extend-to-title] Add scene/project name to the editor title, fix incorrect window button position/order when system primary language is RTL. 2022-09-22 23:09:56 +03:00
Rémi Verschelde
ae2d9be0fe
Merge pull request #63740 from Faless/net/4.x_http_request_decompress
[HTTP] Implement streaming decompression.
2022-09-20 22:29:16 +02:00
Fabio Alessandrelli
172a9e0b24 [HTTPRequest] Cleanup, refactor deferred call. 2022-09-20 18:39:10 +02:00
Fabio Alessandrelli
98047e791a [HTTPRequest] Body streaming decompresison.
Using a StreamPeerGZIP (which acts as a ringbuffer).
2022-09-20 18:39:10 +02:00
Marc Gilleron
aed3822a93 Change return type of get_configuration_warnings to PackedStringArray 2022-09-19 16:43:15 +01:00
Markus Sauermann
52da6f1a44 Update mouse cursor shape after changes
This fixes some cases where the mouse cursor shape did not change automatically, but instead required a MouseMove to update.
2022-09-18 17:15:38 +02:00
Rémi Verschelde
d79040e7eb Merge pull request #65496 from MinusKube/popup-capture-mouse-bug
Fix MOUSE_MODE_CAPTURED not working correctly with popups
2022-09-16 09:23:40 +02:00
Rémi Verschelde
d347d2f585 Merge pull request #65550 from MinusKube/small-popup-bug
Use embedding viewport instead of parent viewport to determine popup rect
2022-09-16 09:22:57 +02:00
David Snopek
e82cd46a74 Fix XR rendering in 'opengl3' driver and expose true size via the Viewport node 2022-09-14 20:55:56 -05:00
SaracenOne
cc4bda8500 Add ability to flag classes as experimental or deprecated. 2022-09-11 00:11:33 +01:00
Rémi Verschelde
8899f1eec2
Merge pull request #65595 from KoBeWi/minus_children
Allow negative indices in `move_child()`
2022-09-10 09:59:15 +02:00
kobewi
31e62ca827 Allow negative indices in move_child() 2022-09-10 03:54:04 +02:00
VolTer
e19f7b2407 Remove Remove and Skip 2022-09-09 23:44:31 +02:00
MinusKube
00e153f85a Use embedding viewport instead of parent viewport to determine popup rect 2022-09-09 01:22:46 +02:00
Rémi Verschelde
7936b3cc4c Merge pull request #60108 from KoBeWi/arise_to_top
Rename raise() to move_to_front()
2022-09-08 09:23:31 +02:00
Rémi Verschelde
de739530c2 Merge pull request #63596 from Jayman2000/issue-27640
Rename `change_scene()` and `change_scene_to()`
2022-09-08 09:22:03 +02:00
Rémi Verschelde
a51dc70dfb Merge pull request #65460 from Faless/net/4.x_ssl_to_tls_more
[Net] Rename "ssl" references to "tls" in methods and members.
2022-09-08 09:20:19 +02:00
Fabio Alessandrelli
a95d792420 [Net] Rename "ssl" references to "tls" in methods and members. 2022-09-08 03:24:23 +02:00
Jason Yundt
69963ffaa3 Rename change_scene() and change_scene_to()
Before this change, the SceneTree had methods named “change_scene” and
“change_scene_to”. One of them accepted a String as a parameter and the
other accepted a PackedScene, but you couldn’t tell which one was which
just by looking at their names.

This change renames those two methods to “change_scene_to_file” and
“change_scene_to_packed”. These new names came from this suggestion [1].
These new names make the difference between the two methods more clear
and hint at the fact that there’s more than one change_scene method.

[1]: <https://github.com/godotengine/godot/issues/27640#issuecomment-1081870955>

Fixes #27640.
2022-09-07 17:06:33 -04:00
MinusKube
06b86fad0d Fix MOUSE_MODE_CAPTURED not working correctly with popups 2022-09-07 19:31:57 +02:00
smix8
d7f75fab60 Remove / Replace old Navigation Debug Visualization
- removes / replaces leftovers from old navigation debug code
- cleanes SceneTree and ProjectSettings from old navigation debug
2022-09-07 18:30:35 +02:00
Micky
f577bae76f Rename legible_unique_name param to force_readable_name
With the introduction of Scene Unique Nodes, `is_unique_in_owner`, "Unique Name in Scene" and other descriptions related to the feature, the second parameter of add_child() and add_simbling() could be misunderstood to be related, at first glance.
2022-09-07 11:58:30 +02:00
kobewi
b218727599 Rename raise() to move_to_front() 2022-09-06 22:13:06 +02:00
MinusKube
f5a808192b Prevent windows from having a size greater than device limit 2022-09-04 22:48:54 +02:00
Rémi Verschelde
a653801b17
Merge pull request #65285 from YuriSizov/window-theme-change-is-imminent
Un-defer the initial theme changed notification in `Window`
2022-09-03 18:23:45 +02:00
Yuri Sizov
41eabca0fb Un-defer the initial theme changed notification in Window 2022-09-03 14:55:13 +03:00
Xwdit
f350356183 Some improvements to the SceneTreeTimer 2022-09-03 11:44:11 +02:00
Rémi Verschelde
597bc949a4 Merge pull request #65250 from YuriSizov/theme-owner-rises 2022-09-02 23:20:49 +02:00
Yuri Sizov
8b128081e8 Un-defer the initial theme changed notification
Co-authored-by: Rindbee <idleman@yeah.net>
2022-09-02 23:44:23 +03:00
Yuri Sizov
ddc55ef746 Add ThemeOwner type for managing theme propagation and lookup 2022-09-02 23:44:23 +03:00
Hugo Locurcio
f7292dbeb3
Rename or_lesser range property hint to or_less
"less" should be used for quantity, rather than "lesser".

Existing scripts that use `or_lesser` in `_get_property_list()`
will need to be updated to account for this change.
2022-09-02 19:08:20 +02:00
Rémi Verschelde
6ccbc27093
Merge pull request #64735 from KoBeWi/viewportshifter 2022-09-02 15:42:42 +02:00
Rémi Verschelde
c82bbc38a5 Merge pull request #64952 from Chaosus/vs_rename_uniform_to_param 2022-09-02 13:49:53 +02:00
Rindbee
621b9a1bfe Fix getting an error message when repeatedly entering and exiting the tree 2022-09-02 10:48:20 +08:00
Fabio Alessandrelli
fbbd3950c8 Simplify network GDExtension bindings using EXBIND macros.
Simplify StreamPeer, PacketPeer, MultiplayerPeer extension.

Simplify and update WebRTC*Extension with newly supported types.
2022-09-01 19:10:22 +02:00
Yuri Sizov
15fd025f90 Add dumb and manual theme caching systems to Window 2022-09-01 16:05:02 +03:00
Yuri Rubinsky
8191b3c110 Rename uniform to parameter across the engine 2022-09-01 11:42:57 +03:00
Rémi Verschelde
e74809094f
Merge pull request #65108 from MinusKube/subwindow-focused-bug
Prevent subwindow_focused from pointing to a window that is not a subwindow
2022-09-01 08:45:37 +02:00
clayjohn
385ee5c70b Implement Physical Light Units as an optional setting.
This allows light sources to be specified in physical light units in addition to the regular energy multiplier. In order to avoid loss of precision at high values, brightness values are premultiplied by an exposure normalization value.

In support of Physical Light Units this PR also renames CameraEffects to CameraAttributes.
2022-08-31 12:14:46 -07:00
MinusKube
64cf943e07 Prevent subwindow_focused from pointing to a window that is not a subwindow 2022-08-30 21:57:03 +02:00
Rémi Verschelde
6e6287f748
Merge pull request #47744 from KoBeWi/press_F_to_play_exit 2022-08-30 19:29:04 +02:00
kobewi
cd01f695d5 Change _redraw_callback to callable_mp 2022-08-30 15:21:48 +02:00
Rémi Verschelde
02d510bd07
Merge pull request #63003 from Geometror/msaa-2d 2022-08-30 14:54:20 +02:00
Rémi Verschelde
ae349d8227
Merge pull request #64377 from Mickeon/rename-canvas-redraw
Rename `CanvasItem.update()` to `queue_redraw()`
2022-08-30 14:47:41 +02:00
kobewi
409613ba7b Allow to change the Stop shortcut used at runtime 2022-08-30 14:14:15 +02:00
Rémi Verschelde
0bf3f79157
Merge pull request #63902 from dalexeev/string-cases 2022-08-30 14:06:28 +02:00
Rémi Verschelde
889c522a19
Merge pull request #64410 from MewPurPur/rename-notification-instanced 2022-08-30 12:01:58 +02:00
Danil Alexeev
d4555ef5fb
Add String.to_{camel,pascal,snake}_case methods 2022-08-30 12:36:24 +03:00
Aaron Franke
10a56981dc
Rename String plus_file to path_join 2022-08-29 19:38:13 -05:00
Micky
e31bb5ffeb Rename CanvasItem.update() to queue_redraw()
Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on.

Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency.

Just a few comments have also been changed to say "redraw".

In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
2022-08-29 14:59:47 +02:00
Rémi Verschelde
e60086f98b
Merge pull request #64119 from YuriSizov/theme-init-database 2022-08-29 14:02:21 +02:00
Rémi Verschelde
fd6453c45e Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED"
This reverts commit 4b817a565c.

Fixes #64988.
Fixes #64997.

This caused several regressions (#64988, #64997,
https://github.com/godotengine/godot/issues/64997#issuecomment-1229970605)
which point at a flaw in the current logic:

- `Control::NOTIFICATION_ENTER_TREE` triggers a *deferred* notification with
  `NOTIFCATION_THEME_CHANGED` as introduced in #62845.
- Some classes use their `THEME_CHANGED` to cache theme items in
  member variables (e.g. `style_normal`, etc.), and use those member
  variables in `ENTER_TREE`, `READY`, `DRAW`, etc. Since the `THEME_CHANGE`
  notification is now deferred, they end up accessing invalid state and this
  can lead to not applying theme properly (e.g. for EditorHelp) or crashing
  (e.g. for EditorLog or CodeEdit).

So we need to go back to the drawing board and see if `THEME_CHANGED` can be
called earlier so that the previous logic still works?

Or can we refactor all engine code to make sure that:
- `ENTER_TREE` and similar do not depend on theme properties cached in member
  variables.
- Or `THEME_CHANGE` does trigger a general UI update to make sure that any
  bad theme handling in `ENTER_TREE` and co. gets fixed when `THEME_CHANGE`
  does arrive for the first time. But that means having a temporary invalid
  (and possibly still crashing) state, and doing some computations twice
  which might be heavy (e.g. `EditorHelp::_update_doc()`).
2022-08-29 11:11:29 +02:00
Aaron Record
4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 -06:00
Rémi Verschelde
bd219de7fe
Merge pull request #64928 from YuriSizov/editor-tooltip-or-not-tooltip
Remove Inspector tooltip hack that never actually worked
2022-08-26 23:04:50 +02:00
Rémi Verschelde
4f60fd0480
Merge pull request #64777 from bruvzg/extend_to_title
[macOS] Extend editor contents to the window title bar for better space usage.
2022-08-26 23:03:31 +02:00
Yuri Sizov
6320a0fc18 Add ThemeDB, expose previously static Theme methods 2022-08-26 19:23:05 +03:00
Yuri Sizov
207bdc2b9f Remove Inspector tooltip hack that never actually worked 2022-08-26 17:22:13 +03:00
bruvzg
bc4ba6cb78
[macOS] Extend editor contents to the window titlebar for better space usage. 2022-08-26 15:12:43 +03:00
Rémi Verschelde
ff612b6916
Merge pull request #64574 from Begah/fix_transient_window_wrap_mouse 2022-08-26 13:54:23 +02:00
Rémi Verschelde
7013c68619
Merge pull request #64422 from bruvzg/make_fonts_unbearably_ugly_2.0 2022-08-26 11:59:07 +02:00
Rémi Verschelde
7bb92bc040
Merge pull request #62845 from AaronRecord/dont_update_theme_outside_of_tree
Refactor and remove excessive calls of `NOTIFICATION_THEME_CHANGED`
2022-08-26 10:37:44 +02:00
Rémi Verschelde
d93d646723
Merge pull request #64570 from KoBeWi/node🧳ing
Unify node casing adjustment
2022-08-26 09:49:58 +02:00
Aaron Record
74eb2a70bd Refactor and remove excessive calls of NOTIFICATION_THEME_CHANGED 2022-08-25 14:50:49 -06:00
Rémi Verschelde
060d0ce882
Merge pull request #53299 from Calinou/viewport-tweak-configuration-warning 2022-08-25 21:44:31 +02:00
Rémi Verschelde
5eed1b299b
Merge pull request #64355 from Mickeon/rename-follow-viewport 2022-08-25 18:34:19 +02:00
MathieuRoux
5ac5c8bc06 Fix warp_mouse for transient windows, smoother mouse positioning when releasing mouse for spinbox 2022-08-25 11:30:49 +02:00
Rémi Verschelde
bb6d771397
Merge pull request #64843 from Faless/mp/4.x_encode_fix
[MP] Fix variant serialization after variant size change.
2022-08-25 00:02:07 +02:00
Fabio Alessandrelli
75de626781 [MP] Fix variant serialization after variant size change.
The bit mask used for the type when compressing variants in the
Multiplayer API became too small to represent all variant types.

This commit expand the mask, which means we no longer have an extra bit
in the "meta" byte we use to store encoding information.

The extra bit was only used in case of booleans to store the value and
since booleans do not require extra encoding information we use those 2
bits to store the value instead.
2022-08-24 19:46:55 +02:00
Rémi Verschelde
629949d0a5
Merge pull request #64759 from skyace65/Anisotropic
Spell out "anisotropic" fully in filter options
2022-08-24 09:53:28 +02:00
Rémi Verschelde
91e5f48ea7
Merge pull request #64009 from KoBeWi/arrayy_lmao
Replace Array return types with TypedArray (part 2)
2022-08-24 08:18:56 +02:00
skyace65
64061678c6 Spell out "anisotropic" fully in filter options 2022-08-23 19:19:56 -04:00
kobewi
1abdffe7a0 Replace Array return types with TypedArray 2 2022-08-23 23:21:32 +02:00
Pedro J. Estébanez
910efbff03 Avoid warnings about cursor shape change not supported 2022-08-23 11:14:07 +02:00
bruvzg
bcc3643989
Add font LCD sub-pixel anti-aliasing support. 2022-08-23 08:47:21 +03:00
Yuri Sizov
1a24c9e14b Make _validate_property a multilevel method 2022-08-22 18:35:11 +03:00
kobewi
3a4a4aeade Fix Viewport size change not updating textures 2022-08-22 16:34:47 +02:00
kobewi
fdab23163f Unify node casing adjustment 2022-08-18 14:08:40 +02:00
Tomasz Chabora
2bdd7e9ea0 Add methods for node reparenting 2022-08-16 19:44:41 +02:00
VolTer
2599710793 Rename NOTIFICATION_INSTANCED to NOTIFICATION_SCENE_INSTANTIATED 2022-08-16 12:41:10 +02:00
Micky
fe86c5cba5 Rename CanvasItem.follow_viewport_enable to end with "d"
For consistency with the rest of the exposed booleans in Godot
2022-08-13 13:00:45 +02:00
Hendrik Brucker
e96b1a2c0c Implement MSAA for 2D [Vulkan only] 2022-08-13 01:09:48 +02:00
Yuri Sizov
1362bc22bd Add tests for empty/unnamed arguments to ClassDB, Variant, GDScript 2022-08-08 16:36:01 +03:00
Michael Alexsander
2b86c458bf Fix some bugs with Windows 2022-08-05 02:25:15 -03:00
Nathan Franke
c3c5985189
move rpc and rpc_id implementations back to header
StackOverflow on why this is needed: https://stackoverflow.com/questions/495021/why-can-templates-only-be-implemented-in-the-header-file
Minor mistake in commit ca7d572908
2022-08-02 18:35:29 -05:00
Juan Linietsky
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
Rémi Verschelde
14d021287b
Merge pull request #63049 from Faless/mp/4.x_as_module 2022-07-28 20:46:31 +02:00
Rémi Verschelde
8e0f328a80
Merge pull request #59840 from Calinou/renderingserver-global-uniform-rename 2022-07-28 20:34:17 +02:00
Hugo Locurcio
4b42379c8f
Rename RenderingServer global shader uniform methods to be more explicit
The `global_shader_uniform` name is longer, but it makes it much
easier to find the methods when searching in the class reference.
2022-07-28 18:46:59 +02:00
Hugo Locurcio
e24029edc3
Allow changing mipmap LOD bias when FSR 1.0 scaling is not used
Mipmap LOD bias can be useful to improve the appearance of distant
textures without increasing anisotropic filtering (or in situations
where anisotropic filtering is not effective).

`fsr_mipmap_bias` was renamed to `texture_mipmap_bias` accordingly.
The property hint now allows for greater precision as well.
2022-07-28 17:51:13 +02:00
Rémi Verschelde
199ea349f5
Merge pull request #57698 from bluenote10/feature/rename_translated_to_translated_local 2022-07-28 10:03:07 +02:00
Rindbee
fc17d3563d Remove first_draw and reset visibility when entering tree 2022-07-28 12:35:47 +08:00
Rémi Verschelde
950750fb98
Merge pull request #63355 from YeldhamDev/directional_tooltip 2022-07-27 12:37:03 +02:00
Fabio Alessandrelli
ca7d572908 [Net] Modularize multiplayer, expose MultiplayerAPI to extensions.
- RPC configurations are now dictionaries.
- Script.get_rpc_methods renamed to Script.get_rpc_config.
- Node.rpc[_id] and Callable.rpc now return an Error.
- Refactor MultiplayerAPI to allow extension.
- New MultiplayerAPI.rpc method with Array argument (for scripts).
- Move the default MultiplayerAPI implementation to a module.
2022-07-26 09:31:12 +02:00
Rémi Verschelde
90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
Michael Alexsander
46346cfaa5 Make tooltips be shown at different directions if there's not enough space 2022-07-23 14:51:06 -03:00
reduz
455c06ecd4 Implement Vector4, Vector4i, Projection
Implement built-in classes Vector4, Vector4i and Projection.

* Two versions of Vector4 (float and integer).
* A Projection class, which is a 4x4 matrix specialized in projection types.

These types have been requested for a long time, but given they were very corner case they were not added before.
Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity.

**Q**: Why Projection and not Matrix4?
**A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
2022-07-23 14:00:01 +02:00
kleonc
57ff4032d0 Fix CanvasItem not exiting its canvas group on canvas exit 2022-07-20 21:35:31 +02:00
FireForge
97dfbea6ad Rename Control PRESET_WIDE to PRESET_FULL_RECT 2022-07-18 20:08:11 -05:00
Rémi Verschelde
168ee3e6c4
Merge pull request #63083 from madmiraal/fix-56336 2022-07-18 09:31:35 +02:00
Marcel Admiraal
96c75f1d10 Set initial SceneTree processes times to 0.0 2022-07-17 08:51:25 +01:00
Bastiaan Olij
d139131aab Adding Variable Rate Shading support to Godot
Improve GI renderer and add VRS support
Implement render device has_feature and move subgroup settings to limit_get
2022-07-17 15:42:24 +10:00
Fabian Keller
2bf9e6090c rename translate(d) to translate(d)_local in Transform 2D/3D 2022-07-16 11:47:54 +02:00
bruvzg
cbe3a2dcb7
Use BitField hint for the TextServer enums. Add missing parts for BitField support to the GDextension API. 2022-07-15 08:49:50 +03:00
Hugo Locurcio
21ea1c3835
Rename soft shadow quality project settings for easier searching
`rendering/quality/shadows` is now `rendering/quality/positional_shadow`
to explicitly denote that the settings only affect positional light shadows,
not directional light shadows.

Shadow atlas settings now contain the word "atlas" for easier searching.

Soft shadow quality settings were renamed to contain the word "filter".
This makes the settings appear when searching for "filter" in the
project settings dialog, like in Godot 3.x.
2022-07-13 19:56:02 +02:00
bruvzg
344ba0ffaf
Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
Hugo Locurcio
462432f89f
Add an underscore to internal group names as per engine policy
This also adds `SNAME()` macros where relevant to improve performance.
2022-07-01 20:16:25 +02:00
Rémi Verschelde
a7e589df38
Merge pull request #62084 from smix8/path_debug_options_4.x
Add Path2D/3D debug options
2022-06-29 20:36:43 +02:00
Rémi Verschelde
82a56e5c42
Merge pull request #61587 from YuriSizov/control-fix-theme-owner-toplevel
Fix theme propagation for children of top level controls and windows
2022-06-27 12:03:36 +02:00