Commit Graph

2282 Commits

Author SHA1 Message Date
Rémi Verschelde
a7a2a12bfd
Merge pull request #100671 from bruvzg/get_menu
[MenuBar] Use PopupMenu title property as a menu name.
2024-12-20 23:57:47 +01:00
Rémi Verschelde
a11364d1e6
Merge pull request #99010 from Hilderin/embedding-game-process
Embed game process in editor
2024-12-20 23:56:43 +01:00
Rémi Verschelde
7d5b23c5b0
Merge pull request #96626 from hakro/steady_as_she_goes
Allow Timer nodes to ignore engine time scale
2024-12-20 23:56:33 +01:00
Pāvels Nadtočajevs
9604e98a52 [MenuBar] Use PopupMenu title property as a menu name. 2024-12-20 23:35:07 +02:00
Thaddeus Crews
a6e89ba2ba
Merge pull request #80121 from Sauermann/fix-embedded-window-stretch
Fix display of embedded `Window`
2024-12-19 20:00:17 -06:00
Thaddeus Crews
cbfc34d279
Merge pull request #100444 from Sauermann/fix-view-panner-mouse-warp
Fix `ViewPanner` panning-mouse-warp
2024-12-19 20:00:01 -06:00
Thaddeus Crews
d3e5b62ea2
Merge pull request #99230 from paddy-exe/instance_uniforms_compatability_renderer
Implement 2D instance uniforms
2024-12-19 19:59:37 -06:00
Markus Sauermann
4887172a59 Fix ViewPanner panning mouse warp
Currently the mouse cursor jumps in unexpected ways, when a `ViewPanner`
is used in SubViewports or embedded Windows.

This is caused by providing wrong coordinate systems to
Input::warp_mouse_motion.

This PR replaces the use of `Input::warp_mouse_motion` with
`Viewport::wrap_mouse_in_rect` and makes sure, that the correct
coordinate systems are used.

This change makes it necessary, that all classes, that currently
use ViewPanner, need to provide the correct Viewport to ViewPanner.
2024-12-20 00:28:49 +01:00
Hakim
483c1348d0 Allow Timer nodes to ignore engine time scale 2024-12-19 18:40:24 +01:00
Hilderin
9d2a4c03be Embedding game process in editor 2024-12-18 17:52:42 -05:00
kobewi
ceefc0d38a Implement 2D instance shader parameters
Co-authored-by: kobewi <kobewi4e@gmail.com>
Co-authored-by: yesfish <huwpascoe@users.noreply.github.com>
Co-authored-by: Álex Román Núñez <eirexe123@gmail.com>
2024-12-17 23:59:16 +01:00
Rémi Verschelde
98ca63ae47
Merge pull request #99849 from Sauermann/fix-menu-button-hover
Fix `switch_on_hover` for `MenuButton`
2024-12-17 16:19:03 +01:00
Rémi Verschelde
d60c0e21a6
Merge pull request #88313 from wagnerfs/run-time-anisotropic-filtering
Allow changing the anisotropic filter level at run-time per Viewport
2024-12-17 16:18:38 +01:00
Markus Sauermann
0eff41d045 Fix displaying of embedded Window
Fix Rect of texture to take window and stretch transform into account.

There is no need for `viewport_attach_to_screen` for embedded windows,
since their display is handled via `Viewport::_sub_window_update`.
2024-12-17 08:38:14 +01:00
Markus Sauermann
9c5886f95a Fix switch_on_hover for MenuButton
Previously, embedded Windows (the opened menu) were not accounted for
when checking for `switch_on_hover`.

`gui_get_hovered_control()` is more appropriate to check for the hover
status of other `MenuButton` nodes at the mouse position.

Explain the usage of the incorrectly used function in a comment.
2024-12-16 22:11:42 +01:00
Rémi Verschelde
08508d2e01
Merge pull request #99700 from hpvb/scene_tree_editor_performance
Improve Scene Tree editor performance
2024-12-16 17:16:00 +01:00
Hilderin
4e19ab8afe
Fix connecting a signal with a double click is too difficult
Co-authored-by: Danil Alexeev <dalexeev12@yandex.ru>
2024-12-14 16:18:34 +03:00
Thaddeus Crews
bfc66f0608
Merge pull request #100282 from devloglogan/motion-vectors-openxr
Add renderer motion vectors API for use with OpenXR
2024-12-12 16:13:36 -06:00
HP van Braam
6f7525c396 Improve Scene Tree editor performance
We now cache the Node*<>TreeItem* mapping in the SceneTreeEditor. This
allows us to make targeted updates to the Tree used to display the scene
tree in the editor.

Previously on almost all changes to the scene tree the editor would
rebuild the entire widget, causing a large number of deallocations an
allocations. We now carefully manipulate the Tree widget in-situ saving
a large number of these allocations.

In order to know what Nodes need to be updated we add a
editor_state_changed signal to Node, this is a TOOLS_ENABLED,
editor-only signal fired when changes to Node happen that are relevant
to editor state.

We also now make sure that when nodes are moved/renamed we don't check
expensive properties that cannot contain NodePaths. This saves a lot of
time when SceneTreeDock renames a node in a scene with a lot of
MeshInstances. This makes renaming nodes go from ~27 seconds to ~2
seconds on large scenes.

SceneTreeEditor instances will now also not do all of the potentially
expensive update work if they are invisible. This behavior is turned off
by default so it won't affect existing users. This change allows the
editor to only update SceneTreeEditors that actually in view. In
practice this means that for most changes instead of updating 6
SceneTreeEditors we only update 1 instantly, and the others only when
they become visible.

There is definitely more that could be done, but this is already a
massive improvement. In complex scenes we see an improvement of 10x,
things that used to take ~30 seconds now only take 2.

This fixes #83460

I want to thank KoBeWi, TokisanGames, a-johnston, aniel080400 for
their tireless testing. And AeioMuch for their testing and providing a
fix for the hover issue.
2024-12-12 22:47:05 +01:00
Rémi Verschelde
26fec37389
Merge pull request #99942 from kitbdev/fix-invisible-subviewport-editor
Fix selecting and editing invisble items in SubViewports
2024-12-12 14:10:09 +01:00
Thaddeus Crews
b773fff5a4
Merge pull request #99622 from Chaosus/shader_fix_global_empty_type
Add `samplerExternalOES` type to shader globals
2024-12-11 17:35:40 -06:00
Markus Sauermann
4d6a6b21e2 Allow canceling drag-and-drop with right mouse button
This is a small usability enhancement, that allows users to cancel
drag-and-drop without the need to press the escape key on the keyboard.
2024-12-11 00:13:54 +01:00
devloglogan
3deb5884d7 Renderer agnostic motion vector rendering/OpenXR changes 2024-12-10 15:59:17 -06:00
bruvzg
9fece033ab [macOS, Windows] Add support for excluding windows from a screenshot. 2024-12-10 11:00:13 +02:00
Thaddeus Crews
09dd5e6b20
Merge pull request #98032 from zaevi/fix_drag_preview_position
Fix incorrect drag preview position under transformed `CanvasLayer`.
2024-12-09 14:33:36 -06:00
Thaddeus Crews
610f4a2687
Merge pull request #97328 from AThousandShips/fix_recursive_draw
Prevent infinite recursion in first `_draw`
2024-12-04 11:02:06 -06:00
kit
93e06ff16c Fix select and edit invisble items in SubViewports 2024-12-02 17:12:51 -05:00
Rémi Verschelde
302da3d9a4
Merge pull request #99669 from syntaxerror247/root_window_issues
Fix root window size bug on `Android`
2024-12-02 15:51:16 +01:00
Anish Mishra
c699d5bada Fix root window size bug on Android 2024-12-02 19:00:28 +05:30
rune-scape
d58b2e879f Get rid of easily removable uses of const_cast 2024-12-01 17:50:13 -08:00
Wagner
6995b6a03e Allow changing the anisotropic filter level at run-time per Viewport 2024-11-30 00:50:45 -03:00
Rémi Verschelde
16ee94a953
Merge pull request #99843 from KoBeWi/easy_windows
Add helper method to get Window from ID
2024-11-29 22:51:45 +01:00
Rémi Verschelde
cf165a1d29
Merge pull request #99739 from ydeltastar/fix-default-environment
Fix default `Environment` project setting and loading
2024-11-29 22:51:14 +01:00
Rémi Verschelde
05e93a6010
Merge pull request #99691 from Sauermann/fix-consume-mouse-over
Rename `SubViewportContainer` option `consume_drag_and_drop` to `mouse_target`
2024-11-29 22:51:10 +01:00
kobewi
e0304a7d00 Add helper method to get Window from ID 2024-11-29 21:15:23 +01:00
Markus Sauermann
f53a220a72 Fix physics picking when hovering an embedded window
When the mouse is hovering an embedded window, it is still considered
within the main viewport.
Previously in this case physics picking was executed, as if no embedded
window was there.

This PR introduces an additional check to exclude these cases.
2024-11-27 22:29:42 +01:00
ydeltastar
8793764ba6
Fix default environment project setting and loading 2024-11-27 14:15:27 -03:00
Thaddeus Crews
9c300a6c05
Merge pull request #80965 from Calinou/viewport-add-get-stretch-scale-factor
Add a Viewport method to get automatically computed 2D stretch transform
2024-11-27 10:47:12 -06:00
Markus Sauermann
003647972f Rename consume_drag_and_drop to mouse_target
The functionality of the parameter is not limited to drag-and-drop
operations, but it has also other uses.
So its name should not be tied to drag-and-drop.

The API was created in the not yet released Godot 4.4-dev6, so this
change should not be considered compatibility breaking.
2024-11-25 21:36:29 +01:00
Chaosus
7ecdfc8b52 Add samplerExternalOES type to shader globals 2024-11-24 14:33:52 +03:00
AThousandShips
ff6eea5042
Prevent infinite recursion in first _draw 2024-11-22 17:42:58 +01:00
Thaddeus Crews
0eca686191
Merge pull request #99270 from Sauermann/fix-svc-drop-config
Introduce a `SubViewportContainer` config for drag-and-drop target locations
2024-11-21 17:56:48 -06:00
Rémi Verschelde
285954659d
Merge pull request #96721 from aXu-AP/tooltip-distance
Fix tooltip appearing in old place, on movement
2024-11-20 17:03:08 +01:00
Hugo Locurcio
0cf99cf95d
Add a Viewport method to get automatically computed 2D stretch transform
`Viewport.get_stretch_transform()` returns the automatically computed
2D stretch transform. Combined with `Transform2D.get_scale()`, this is
useful when using the `canvas_items` stretch mode in a project.

There are many situations where knowing this factor is useful:

- Divide Camera2D zoom to keep the size of the 2D game world identical
  regardless of the 2D scale factor (so that UI elements can still be scaled).
- Make certain controls always drawn at 1:1 scale
  (e.g. for the crosshair in a FPS). This is done by dividing the Control
  node's scale by the scale factor.
2024-11-19 23:11:13 +01:00
Markus Sauermann
117158d271 Introduce a SubViewportContainer config for drag-and-drop targets
With the drag-and-drop rewrite, `SubViewportContainer` nodes were no
longer available as drop-locations.

This PR introduces a configuration option, that allows
`SubViewportContainer` to be considered as drop-location, but disables the
`Control` nodes inside its `SubViewport` children as drop-location.
2024-11-19 23:06:41 +01:00
A Thousand Ships
68f638cf02
Use (r)find_char instead of (r)find for single characters 2024-11-17 10:02:18 +01:00
Pāvels Nadtočajevs
932b2269f8 Fix missing native file dialog title translation. 2024-11-14 14:48:52 +02:00
Thaddeus Crews
cc6ee3e956
Merge pull request #98713 from dalexeev/core-fix-callable-get-bound-arguments
Core: Fix `Callable.get_bound_arguments{,_count}()` return incorrect data
2024-11-12 12:13:04 -06:00
Thaddeus Crews
0ad3181d14
Merge pull request #98951 from AThousandShips/fix_more_super_call
Fix a few more super calls in `get_configuration_warnings` methods
2024-11-12 09:27:33 -06:00
Thaddeus Crews
925b690c98
Core: Integrate Ref::instantiate where possible 2024-11-10 12:41:26 -06:00