Commit Graph

33659 Commits

Author SHA1 Message Date
Rémi Verschelde 9bc9948cbf
Merge pull request #46739 from KoBeWi/hungry_spinbox_eats_cursor
Release mouse when SpinBox leaves scene tree
2021-03-07 00:06:08 +01:00
Rémi Verschelde 27aacabf81
Merge pull request #46742 from bruvzg/thread_id_fix
Improve thread IDs to avoid collisions with threads not created by the Godot API.
2021-03-07 00:01:52 +01:00
bruvzg 9887c2b4f0
Improve thread IDs to avoid collisions with threads not created by the Godot API. 2021-03-07 00:17:20 +02:00
kobewi 83f6c6b360 Release mouse when SpinBox leaves scene tree 2021-03-06 22:22:24 +01:00
Ignacio Etcheverry e2afe700f6 Add C# source generator for a new ScriptPath attribute
This source generator adds a newly introduced attribute,
`ScriptPath` to all classes that:

- Are top-level classes (not inner/nested).
- Have the `partial` modifier.
- Inherit `Godot.Object`.
- The class name matches the file name.

A build error is thrown if the generator finds a class that meets these
conditions but is not declared `partial`, unless the class is annotated
with the `DisableGodotGenerators` attribute.

We also generate an `AssemblyHasScripts` assembly attribute which Godot
uses to get all the script classes in the assembly, eliminating the need
for Godot to search them. We can also avoid searching in assemblies that
don't have this attribute. This will be good for performance in the
future once we support multiple assemblies with Godot script classes.

This is an example of what the generated code looks like:

```
using Godot;
namespace Foo {
	[ScriptPathAttribute("res://Player.cs")]
	// Multiple partial declarations are allowed
	[ScriptPathAttribute("res://Foo/Player.cs")]
	partial class Player {}
}

[assembly:AssemblyHasScripts(new System.Type[] { typeof(Foo.Player) })]
```

The new attributes replace script metadata which we were generating by
determining the namespace of script classes with a very simple parser.
This fixes several issues with the old approach related to parser
errors and conditional compilation.
It also makes the task part of the MSBuild project build, rather than
a separate step executed by the Godot editor.
2021-03-06 21:50:32 +01:00
Rémi Verschelde 05248535f7
Merge pull request #46641 from KoBeWi/unsaved_forever
Don't save unchanged script upon closing
2021-03-06 21:06:06 +01:00
kobewi 12f5a5a701 Don't save unchanged script upon closing 2021-03-06 20:17:19 +01:00
Rémi Verschelde a4b5edf468
Merge pull request #46728 from Faless/js/4.x_fetch_world
[HTML5] Replace XMLHttpRequest(s) with Fetch.
2021-03-06 16:15:09 +01:00
Rémi Verschelde ac249032bf
Merge pull request #46727 from RandomShaper/fix_nfs_crash
Fix crash on cleanup of EditorFileServer
2021-03-06 16:11:23 +01:00
Shatur95 c26b451afe Fix enabling of created plugin 2021-03-06 15:33:52 +02:00
Pedro J. Estébanez 565796518d Fix crash on cleanup of EditorFileServer 2021-03-06 13:29:40 +01:00
Duddino c47070e165 Added some checks to prevent accessing a null collider
Previously godot would try to access
`CollisionObjectBullet::bt_collision_object` even if it was null.
Fixes #46651
2021-03-06 12:07:27 +01:00
Fabio Alessandrelli fd76977183 [HTML5] Replace XMLHttpRequest with Fetch.
This has some advantages:
- Streaming/chunked response support.
- Broader headers support.
2021-03-06 11:44:07 +01:00
Rémi Verschelde 17e66382b8
Merge pull request #46686 from akien-mga/doc-irc-rocketchat
Link to Godot Contributors Chat instead of IRC
2021-03-06 00:05:44 +01:00
Rémi Verschelde edbc8488a5
Merge pull request #46709 from Ev1lbl0w/bugfix-negative_vram
Fix negative VRAM values
2021-03-05 23:53:25 +01:00
Ev1lbl0w 1f0b60c47d
Fix negative VRAM values 2021-03-05 21:48:20 +00:00
Rémi Verschelde 3ff56719fc
Merge pull request #46706 from fabriceci/improvement-raycast2d-debug-shape2
Raycast2D debug Shape: fix a regression + improvement on tiny ray (fix #46680)
2021-03-05 22:38:49 +01:00
Rémi Verschelde aaeb07d50f
Merge pull request #43929 from HaSa1002/docs-lang-6
Docs: Port Code Examples to C# (R, S, T, U)
2021-03-05 22:36:05 +01:00
Rémi Verschelde 848f3bba7c Link to Godot Contributors Chat instead of IRC 2021-03-05 22:32:48 +01:00
Rémi Verschelde f9dad47478
Merge pull request #46701 from HaSa1002/fix-lossy-cursor
Move cursor shape loading after module loading
2021-03-05 22:29:06 +01:00
fabriceci af041adb06 add responsive arrows when the size is very small + fix a regression: missing a translation on the line 2021-03-05 22:14:06 +01:00
Fabio Alessandrelli 44a662a149 [HTML5] Rename heapCopy to heapSlice.
New heapCopy function copies a TypedArray to the heap.
2021-03-05 20:17:58 +01:00
Fabio Alessandrelli cb1b89dac5 [HTML5] Export process writes sizes in template.
This allow the loading bar to be much more reliable, even in cases where
realible stream loading status is not detectable (server-side
compression, chunked encoding).
2021-03-05 20:15:38 +01:00
Fabio Alessandrelli 272e491f52 [HTML5] Preloader fetch, streaming instantiation. 2021-03-05 20:11:18 +01:00
HaSa1002 bae843a1c9
Docs: Port Code Examples to C# (R, S, T, U)
* RenderingServer
 * RichTextEffect
 * SceneTree
 * SceneTreeTimer
 * ScriptCreateDialog
 * SpinBox
 * Sprite2D
 * StreamPeer
 * String
 * SurfaceTool
 * TextEdit
 * TileMap
 * Tree
 * Tween
 * UDPServer
 * UndoRedo

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2021-03-05 18:57:28 +01:00
sps1112 05f5a43cad Fix Control._edit_set_state crash 2021-03-05 21:52:34 +05:30
Johannes 2ac9f37b17
Move cursor shape loading after module loading
fixes #46685
2021-03-05 17:22:06 +01:00
Rémi Verschelde 4de0768cdb
Merge pull request #46663 from Calinou/doc-margincontainer-theme-constant
Use safer `add_theme_constant_override()` in MarginContainer code sample
2021-03-05 15:11:56 +01:00
Rémi Verschelde bc6713ef50
Merge pull request #46516 from HaSa1002/scrollcontainer-embed
Fix Window returning `INVALID_WINDOW_ID` when being embedded
2021-03-05 13:46:44 +01:00
Rémi Verschelde bd9799e9f0
Merge pull request #46675 from fabriceci/improvement-raycast2d-debug-shape
Improving the Raycast2D debug Shape
2021-03-05 00:59:21 +01:00
fabriceci 90ca587281 Highlight collision, correct the size and make the arrow a bit less thick for low-res game 2021-03-05 00:32:49 +01:00
Rémi Verschelde 1eabeec680
Merge pull request #46677 from W4RH4WK/fix-canvas-renderer-line-width
Fix canvas renderer line width
2021-03-05 00:14:42 +01:00
Alex Hirsch 426ef4b1ee Fix canvas renderer line width
fix #46644
2021-03-04 21:37:06 +01:00
Rémi Verschelde e556ec0c5a
Merge pull request #46529 from jmb462/improvement-raycast3d-debug-shape
Adding Raycast3D custom debug shape thickness and color
2021-03-04 20:38:32 +01:00
Rémi Verschelde 86fba08427
Merge pull request #46669 from W4RH4WK/add-fail-check-variant-construct
Add missing ERR_FAIL_INDEX check to Variant::construct
2021-03-04 20:35:39 +01:00
Rémi Verschelde a3dece960f
Merge pull request #46668 from nekomatata/fix-errors-polygon-2d
Fix errors with invalid CollisionPolygon2D
2021-03-04 20:33:22 +01:00
Rémi Verschelde 6b2577599f
Merge pull request #46665 from nekomatata/fix-crash-convex-shape-2d
Fix errors and crash with empty ConvexPolygonShape2D
2021-03-04 20:19:16 +01:00
Crystal Melting Dot 89baf02fb6 Fix TabContainer _get_tab_width
Now it translates node name before calculating tab width
2021-03-04 22:10:28 +03:00
Alex Hirsch 6985967c3b Add missing ERR_FAIL_INDEX check to Variant::construct
Other functions in the same file validate parameters using the ERR_FAIL
macros. This validation was missing for Variant::construct resulting in
a crash when called with invalid data (p_type < 0).

fix #46067
2021-03-04 18:50:37 +01:00
PouleyKetchoupp 2217e477b9 Fix errors with invalid CollisionPolygon2D
Fixed internal errors when the shape is invalid and made warnings more
descriptive.
2021-03-04 10:44:37 -07:00
PouleyKetchoupp 6fb6090748 Fix errors and crash with empty ConvexPolygonShape2D 2021-03-04 09:46:32 -07:00
Hugo Locurcio af513344ce
Use safer `add_theme_constant_override()` in MarginContainer code sample
Control has magic setters to set custom theme items, but using the
dedicated Control methods is less prone to typos so it should be favored.
2021-03-04 17:17:40 +01:00
Rémi Verschelde 4c10d31bc4
Merge pull request #46652 from akien-mga/remote-debugger-fix-div-by-zero
RemoteDebugger: Fix possible division by zero
2021-03-04 14:14:00 +01:00
Rémi Verschelde 614566ddb5 RemoteDebugger: Fix possible division by zero 2021-03-04 12:55:53 +01:00
Rémi Verschelde 372b1b8f68 Revert "Add size check in Control._edit_set_state to prevent crash"
This reverts commit ef1d58f034.
2021-03-04 12:06:58 +01:00
jmb462 068300c7c9 Adding Raycast3D custom debug shape thickness and color 2021-03-04 11:17:26 +01:00
Rémi Verschelde dd1881ae19
Merge pull request #46524 from kuruk-mm/lineedit_triple_click
LineEdit: Now double click to select a word, and triple click to sele…
2021-03-04 10:18:20 +01:00
Rémi Verschelde b7c9c730d6
Merge pull request #46635 from Calinou/doc-itemlist-remove-examples
Remove trivial examples in the ItemList class documentation
2021-03-04 08:53:23 +01:00
Rémi Verschelde 484ad8d362
Merge pull request #46640 from pdfrod/fix-crash-in-image-texture
Fix crash trying to destroy an ImageTexture object containing a null texture
2021-03-04 08:15:23 +01:00
Rémi Verschelde 8ff25ffb78
Merge pull request #46620 from sps1112/fix-control.edit_set_state-crash
Add size check in Control::_edit_set_state()  to fix crash
2021-03-04 07:46:16 +01:00