Commit graph

1471 commits

Author SHA1 Message Date
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
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
Rémi Verschelde
11f5d2141a
Merge pull request #61577 from YuriSizov/core-fix-events-for-moved-nodes 2022-06-27 12:02:19 +02:00
reduz
d69e3791bf Fix editor-only visibility for lights
* Update visibility again for editor-only lights if owner changes.

Fixes #26399, supersedes #52327
2022-06-23 08:19:18 +02:00
Rémi Verschelde
91e9e3c681
Merge pull request #62247 from Rindbee/fix-editor-hang-when-window-as-root 2022-06-20 17:43:54 +02:00
smix8
e12e239ab4 Add Path2D/3D debug options
Add Path2D/3D debug options.
2022-06-20 17:32:05 +02:00
Rindbee
5ac259fad8 Quickfix editor hangs when rooting a window with exclusive and transient flags enabled 2022-06-20 21:45:08 +08:00
Rémi Verschelde
3e6de687b8 Node: Rename child_exited_tree to child_exiting_tree
The name was confusing as this signal is emitted around the same time as
`tree_exiting` and `NOTIFICATION_EXIT_TREE`, i.e. while the child node is
still in tree.

Fixes #59210.
2022-06-20 11:55:19 +02:00
markdibarry
459228cdb3 Add explicit deferred flags 2022-06-19 10:04:53 -04:00
Rindbee
53bd72fa70 Fix previous min size affects _get_contents_minimum_size in AcceptDialog 2022-06-17 16:21:23 +08:00
FireForge
92817aa72f Add Vector2/3 linking to more properties
- Camera2D.zoom
- CanvasLayer.scale
- ParallaxBackground.scroll_base_scale
- ParallaxLayer.motion_scale
- Polygon2D.texture_scale
- BaseMaterial3D.uv1_scale
- BaseMaterial3D.uv2_scale
2022-06-14 09:33:44 -05:00
Rémi Verschelde
41986532c1
Merge pull request #61974 from Calinou/project-settings-mark-as-basic 2022-06-13 17:16:03 +02:00
bruvzg
f7269fe878
Single-window mode popups and edited scene windows fixes.
Fix single-window mode popup not closing when OptionBox is clicked.
Fix single-window mode submenus closing when parent menu item, that was used to open it is clicked (using same safe-area logic as platform specific code).
Disallow windows that are part of an edited scene from being set as exclusive or popup to prevent it from locking up the editor.
2022-06-13 09:56:08 +03:00
Hugo Locurcio
c178cfef8e
Mark some common project settings as basic 2022-06-12 19:50:14 +02:00
FireForge
4678736a39 Add suffixes to all nodes and resources 2022-06-11 09:41:05 -05:00
kobewi
9036fcbe5e Remove TooltipPanel and TooltipLabel 2022-06-09 22:23:11 +02:00
jfons
ba832d83b2 Initial TAA implementation
Initial TAA support based on the implementation in Spartan Engine.

Motion vectors are correctly generated for camera and mesh movement, but there is no support for other things like particles or skeleton deformations.
2022-06-07 13:14:44 +02:00
Haoyu Qiu
83d931ad3c Fix Viewport.own_world_3d documentation
Also fixed the naming of the setter's parameter and made an `if` block
straightforward.
2022-06-06 21:34:40 +08:00
Rémi Verschelde
659f4b64d6
Merge pull request #60830 from Ansraer/fix-2d-scale
[4.x] Add viewport content scale
2022-06-04 00:15:38 +02:00
Yuri Sizov
ba273c6c5f Fix theme propagation for children of top level controls and windows 2022-06-01 04:20:00 +03:00
Yuri Sizov
8e5ad7be46 Mark node groups as dirty for every children if parent is moved 2022-05-31 21:28:04 +03:00
reduz
45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
Rémi Verschelde
a5109d49ce
Merge pull request #61026 from timothyqiu/quit-prop
Make `auto_accept_quit` and `quit_on_go_back` properties
2022-05-20 08:13:00 +02:00
Aaron Franke
5dc3bfb80e
Use suffixes for units in nodes and resources 2022-05-19 14:34:27 -05:00
Aaron Record
900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +02:00
Rémi Verschelde
2f3a8a3d61
Merge pull request #61095 from BimDav/get_node_and_resource
Fix a bug in get_node_and_resource when the property is set to null
2022-05-18 15:19:17 +02:00
Rémi Verschelde
5c79782c7e
Merge pull request #61088 from groud/keep_unhandled_events_on_pass 2022-05-17 23:50:55 +02:00
Gilles Roudière
6db8b7616d Keep input event as unhandled if they go through a control set to MOUSE_FILTER_PASS 2022-05-17 15:41:58 +02:00
BimDav
3e96abce07 fix a bug in get_node_and_resource 2022-05-16 19:40:59 +02:00
reduz
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
Haoyu Qiu
82fdad148f Make auto_accept_quit and quit_on_go_back properties 2022-05-14 18:18:26 +08:00
reduz
8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +02:00
Rémi Verschelde
b6983eeccf
Merge pull request #51591 from Calinou/call-group-default-immediate
Make `{call,set,notify}_group()` immediate by default
2022-05-10 14:52:23 +02:00
Ansraer
045f511bd9 Add viewport content scale 2022-05-06 19:50:53 +02:00