summaryrefslogtreecommitdiff
path: root/modules/mono
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mono')
-rw-r--r--modules/mono/build_scripts/mono_configure.py2
-rw-r--r--modules/mono/config.py6
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/Sdk.props2
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedFields.cs12
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedProperties.cs12
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs26
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/MarshalUtils.cs2
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs3
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs7
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSerializationGenerator.cs3
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs4
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs10
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Peer.cs2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.IdeMessaging/ResponseAwaiter.cs2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Utils/NotifyAwaiter.cs6
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/Program.cs2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs4
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Build/BuildManager.cs6
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Build/BuildOutputView.cs8
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs4
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Build/NuGetUtils.cs2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs27
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs8
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Export/XcodeHelper.cs2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs4
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs8
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs4
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs4
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs22
-rw-r--r--modules/mono/editor/code_completion.cpp11
-rw-r--r--modules/mono/glue/GodotSharp/GodotPlugins/Main.cs2
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/AABB.cs3
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs2
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs11
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs2
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Dictionary.cs8
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/DisposablesTracker.cs4
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/NodeExtensions.cs8
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/PackedSceneExtensions.cs2
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/ResourceLoaderExtensions.cs2
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/NativeFuncs.cs4
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/VariantConversionCallbacks.cs224
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Object.exceptions.cs31
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Projection.cs14
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs15
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs3
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Transform3D.cs3
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs6
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs4
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs8
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3i.cs4
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4.cs8
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4i.cs8
-rw-r--r--modules/mono/godotsharp_dirs.cpp2
55 files changed, 338 insertions, 257 deletions
diff --git a/modules/mono/build_scripts/mono_configure.py b/modules/mono/build_scripts/mono_configure.py
index ef7dbabf66..c2d5452837 100644
--- a/modules/mono/build_scripts/mono_configure.py
+++ b/modules/mono/build_scripts/mono_configure.py
@@ -16,7 +16,7 @@ def module_supports_tools_on(platform):
def configure(env, env_mono):
# is_android = env["platform"] == "android"
- # is_javascript = env["platform"] == "javascript"
+ # is_web = env["platform"] == "web"
# is_ios = env["platform"] == "ios"
# is_ios_sim = is_ios and env["arch"] in ["x86_32", "x86_64"]
diff --git a/modules/mono/config.py b/modules/mono/config.py
index b599414a2c..ad78c8c898 100644
--- a/modules/mono/config.py
+++ b/modules/mono/config.py
@@ -1,4 +1,4 @@
-# Prior to .NET Core, we supported these: ["windows", "macos", "linuxbsd", "android", "haiku", "javascript", "ios"]
+# Prior to .NET Core, we supported these: ["windows", "macos", "linuxbsd", "android", "haiku", "web", "ios"]
# Eventually support for each them should be added back (except Haiku if not supported by .NET Core)
supported_platforms = ["windows", "macos", "linuxbsd"]
@@ -10,8 +10,8 @@ def can_build(env, platform):
def get_opts(platform):
from SCons.Variables import BoolVariable, PathVariable
- default_mono_static = platform in ["ios", "javascript"]
- default_mono_bundles_zlib = platform in ["javascript"]
+ default_mono_static = platform in ["ios", "web"]
+ default_mono_bundles_zlib = platform in ["web"]
return [
PathVariable(
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/Sdk.props b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/Sdk.props
index ad41ab04d5..59ce1da17b 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/Sdk.props
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/Sdk.props
@@ -81,7 +81,7 @@
<GodotPlatformConstants Condition=" '$(GodotTargetPlatform)' == 'haiku' ">GODOT_HAIKU;GODOT_PC</GodotPlatformConstants>
<GodotPlatformConstants Condition=" '$(GodotTargetPlatform)' == 'android' ">GODOT_ANDROID;GODOT_MOBILE</GodotPlatformConstants>
<GodotPlatformConstants Condition=" '$(GodotTargetPlatform)' == 'ios' ">GODOT_IPHONE;GODOT_IOS;GODOT_MOBILE</GodotPlatformConstants>
- <GodotPlatformConstants Condition=" '$(GodotTargetPlatform)' == 'javascript' ">GODOT_JAVASCRIPT;GODOT_HTML5;GODOT_WASM;GODOT_WEB</GodotPlatformConstants>
+ <GodotPlatformConstants Condition=" '$(GodotTargetPlatform)' == 'web' ">GODOT_JAVASCRIPT;GODOT_HTML5;GODOT_WASM;GODOT_WEB</GodotPlatformConstants>
<GodotDefineConstants>$(GodotDefineConstants);$(GodotPlatformConstants)</GodotDefineConstants>
</PropertyGroup>
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedFields.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedFields.cs
index ac9f59aa99..ac8d6473a6 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedFields.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedFields.cs
@@ -94,16 +94,20 @@ namespace Godot.SourceGenerators.Sample
[Export] private NodePath field_NodePath = new NodePath("foo");
[Export] private RID field_RID;
- [Export] private Godot.Collections.Dictionary field_GodotDictionary =
+ [Export]
+ private Godot.Collections.Dictionary field_GodotDictionary =
new() { { "foo", 10 }, { Vector2.Up, Colors.Chocolate } };
- [Export] private Godot.Collections.Array field_GodotArray =
+ [Export]
+ private Godot.Collections.Array field_GodotArray =
new() { "foo", 10, Vector2.Up, Colors.Chocolate };
- [Export] private Godot.Collections.Dictionary<string, bool> field_GodotGenericDictionary =
+ [Export]
+ private Godot.Collections.Dictionary<string, bool> field_GodotGenericDictionary =
new() { { "foo", true }, { "bar", false } };
- [Export] private Godot.Collections.Array<int> field_GodotGenericArray =
+ [Export]
+ private Godot.Collections.Array<int> field_GodotGenericArray =
new() { 0, 1, 2, 3, 4, 5, 6 };
}
}
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedProperties.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedProperties.cs
index 4a0e8075f0..3020cfbc50 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedProperties.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedProperties.cs
@@ -94,16 +94,20 @@ namespace Godot.SourceGenerators.Sample
[Export] private NodePath property_NodePath { get; set; } = new NodePath("foo");
[Export] private RID property_RID { get; set; }
- [Export] private Godot.Collections.Dictionary property_GodotDictionary { get; set; } =
+ [Export]
+ private Godot.Collections.Dictionary property_GodotDictionary { get; set; } =
new() { { "foo", 10 }, { Vector2.Up, Colors.Chocolate } };
- [Export] private Godot.Collections.Array property_GodotArray { get; set; } =
+ [Export]
+ private Godot.Collections.Array property_GodotArray { get; set; } =
new() { "foo", 10, Vector2.Up, Colors.Chocolate };
- [Export] private Godot.Collections.Dictionary<string, bool> property_GodotGenericDictionary { get; set; } =
+ [Export]
+ private Godot.Collections.Dictionary<string, bool> property_GodotGenericDictionary { get; set; } =
new() { { "foo", true }, { "bar", false } };
- [Export] private Godot.Collections.Array<int> property_GodotGenericArray { get; set; } =
+ [Export]
+ private Godot.Collections.Array<int> property_GodotGenericArray { get; set; } =
new() { 0, 1, 2, 3, 4, 5, 6 };
}
}
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
index 3dfa8000ba..e28788ec0b 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Common.cs
@@ -168,6 +168,32 @@ namespace Godot.SourceGenerators
location?.SourceTree?.FilePath));
}
+ public static void ReportExportedMemberIsIndexer(
+ GeneratorExecutionContext context,
+ ISymbol exportedMemberSymbol
+ )
+ {
+ var locations = exportedMemberSymbol.Locations;
+ var location = locations.FirstOrDefault(l => l.SourceTree != null) ?? locations.FirstOrDefault();
+
+ string message = $"Attempted to export indexer property: " +
+ $"'{exportedMemberSymbol.ToDisplayString()}'";
+
+ string description = $"{message}. Indexer properties can't be exported." +
+ " Remove the '[Export]' attribute.";
+
+ context.ReportDiagnostic(Diagnostic.Create(
+ new DiagnosticDescriptor(id: "GD0105",
+ title: message,
+ messageFormat: message,
+ category: "Usage",
+ DiagnosticSeverity.Error,
+ isEnabledByDefault: true,
+ description),
+ location,
+ location?.SourceTree?.FilePath));
+ }
+
public static void ReportSignalDelegateMissingSuffix(
GeneratorExecutionContext context,
INamedTypeSymbol delegateSymbol)
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/MarshalUtils.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/MarshalUtils.cs
index 831ac3bdeb..efdd50098e 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/MarshalUtils.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/MarshalUtils.cs
@@ -16,7 +16,7 @@ namespace Godot.SourceGenerators
INamedTypeSymbol GetTypeByMetadataNameOrThrow(string fullyQualifiedMetadataName)
{
return compilation.GetTypeByMetadataName(fullyQualifiedMetadataName) ??
- throw new InvalidOperationException("Type not found: " + fullyQualifiedMetadataName);
+ throw new InvalidOperationException($"Type not found: '{fullyQualifiedMetadataName}'.");
}
GodotObjectType = GetTypeByMetadataNameOrThrow("Godot.Object");
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs
index 7629595b3a..fc46d82dff 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs
@@ -112,7 +112,8 @@ namespace Godot.SourceGenerators
var propertySymbols = members
.Where(s => !s.IsStatic && s.Kind == SymbolKind.Property)
- .Cast<IPropertySymbol>();
+ .Cast<IPropertySymbol>()
+ .Where(s => !s.IsIndexer);
var fieldSymbols = members
.Where(s => !s.IsStatic && s.Kind == SymbolKind.Field && !s.IsImplicitlyDeclared)
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs
index 85fadaa52e..c7745391d0 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs
@@ -134,6 +134,12 @@ namespace Godot.SourceGenerators
continue;
}
+ if (property.IsIndexer)
+ {
+ Common.ReportExportedMemberIsIndexer(context, property);
+ continue;
+ }
+
// TODO: We should still restore read-only properties after reloading assembly. Two possible ways: reflection or turn RestoreGodotObjectData into a constructor overload.
// Ignore properties without a getter or without a setter. Godot properties must be both readable and writable.
if (property.IsWriteOnly)
@@ -148,7 +154,6 @@ namespace Godot.SourceGenerators
continue;
}
-
var propertyType = property.Type;
var marshalType = MarshalUtils.ConvertManagedTypeToMarshalType(propertyType, typeCache);
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSerializationGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSerializationGenerator.cs
index 5a84122c4c..39a99ff8ba 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSerializationGenerator.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSerializationGenerator.cs
@@ -112,7 +112,8 @@ namespace Godot.SourceGenerators
var propertySymbols = members
.Where(s => !s.IsStatic && s.Kind == SymbolKind.Property)
- .Cast<IPropertySymbol>();
+ .Cast<IPropertySymbol>()
+ .Where(s => !s.IsIndexer);
var fieldSymbols = members
.Where(s => !s.IsStatic && s.Kind == SymbolKind.Field && !s.IsImplicitlyDeclared)
diff --git a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs
index 60a4f297c9..7c5502814f 100644
--- a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs
@@ -34,7 +34,7 @@ namespace GodotTools.Core
path = path.Replace('\\', '/');
path = path[path.Length - 1] == '/' ? path.Substring(0, path.Length - 1) : path;
- string[] parts = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
+ string[] parts = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
path = string.Join(Path.DirectorySeparatorChar.ToString(), parts).Trim();
@@ -60,7 +60,7 @@ namespace GodotTools.Core
public static string ToSafeDirName(this string dirName, bool allowDirSeparator = false)
{
- var invalidChars = new List<string> {":", "*", "?", "\"", "<", ">", "|"};
+ var invalidChars = new List<string> { ":", "*", "?", "\"", "<", ">", "|" };
if (allowDirSeparator)
{
diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs
index bc09e1ebf9..72e2a1fc0d 100644
--- a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs
@@ -123,12 +123,16 @@ namespace GodotTools.IdeMessaging
string projectMetadataDir = Path.Combine(godotProjectDir, ".godot", "mono", "metadata");
// FileSystemWatcher requires an existing directory
- if (!Directory.Exists(projectMetadataDir)) {
+ if (!Directory.Exists(projectMetadataDir))
+ {
// Check if the non hidden version exists
string nonHiddenProjectMetadataDir = Path.Combine(godotProjectDir, "godot", "mono", "metadata");
- if (Directory.Exists(nonHiddenProjectMetadataDir)) {
+ if (Directory.Exists(nonHiddenProjectMetadataDir))
+ {
projectMetadataDir = nonHiddenProjectMetadataDir;
- } else {
+ }
+ else
+ {
Directory.CreateDirectory(projectMetadataDir);
}
}
diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Peer.cs b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Peer.cs
index 10d7e1898e..dd3913b4f3 100644
--- a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Peer.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Peer.cs
@@ -78,7 +78,7 @@ namespace GodotTools.IdeMessaging
clientStream.WriteTimeout = ClientWriteTimeout;
clientReader = new StreamReader(clientStream, Encoding.UTF8);
- clientWriter = new StreamWriter(clientStream, Encoding.UTF8) {NewLine = "\n"};
+ clientWriter = new StreamWriter(clientStream, Encoding.UTF8) { NewLine = "\n" };
}
public async Task Process()
diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/ResponseAwaiter.cs b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/ResponseAwaiter.cs
index 548e7f06ee..a57c82b608 100644
--- a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/ResponseAwaiter.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/ResponseAwaiter.cs
@@ -17,7 +17,7 @@ namespace GodotTools.IdeMessaging
if (content.Status == MessageStatus.Ok)
SetResult(JsonConvert.DeserializeObject<T>(content.Body));
else
- SetResult(new T {Status = content.Status});
+ SetResult(new T { Status = content.Status });
}
}
}
diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Utils/NotifyAwaiter.cs b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Utils/NotifyAwaiter.cs
index d84a63c83c..a285d5fa97 100644
--- a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Utils/NotifyAwaiter.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Utils/NotifyAwaiter.cs
@@ -21,14 +21,14 @@ namespace GodotTools.IdeMessaging.Utils
public void OnCompleted(Action continuation)
{
if (this.continuation != null)
- throw new InvalidOperationException("This awaiter has already been listened");
+ throw new InvalidOperationException("This awaiter already has a continuation.");
this.continuation = continuation;
}
public void SetResult(T result)
{
if (IsCompleted)
- throw new InvalidOperationException("This awaiter is already completed");
+ throw new InvalidOperationException("This awaiter is already completed.");
IsCompleted = true;
this.result = result;
@@ -39,7 +39,7 @@ namespace GodotTools.IdeMessaging.Utils
public void SetException(Exception exception)
{
if (IsCompleted)
- throw new InvalidOperationException("This awaiter is already completed");
+ throw new InvalidOperationException("This awaiter is already completed.");
IsCompleted = true;
this.exception = exception;
diff --git a/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/Program.cs b/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/Program.cs
index 7a4641dbbc..cc0deb6cc0 100644
--- a/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/Program.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/Program.cs
@@ -249,8 +249,8 @@ namespace GodotTools.OpenVisualStudio
// Thread call was rejected, so try again.
int IOleMessageFilter.RetryRejectedCall(IntPtr hTaskCallee, int dwTickCount, int dwRejectType)
{
+ // flag = SERVERCALL_RETRYLATER
if (dwRejectType == 2)
- // flag = SERVERCALL_RETRYLATER
{
// Retry the thread call immediately if return >= 0 & < 100
return 99;
diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs
index fb6d2a707b..f3c8e89dff 100644
--- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs
@@ -15,7 +15,7 @@ namespace GodotTools.ProjectEditor
public static ProjectRootElement GenGameProject(string name)
{
if (name.Length == 0)
- throw new ArgumentException("Project name is empty", nameof(name));
+ throw new ArgumentException("Project name is empty.", nameof(name));
var root = ProjectRootElement.Create(NewProjectFileOptions.None);
@@ -37,7 +37,7 @@ namespace GodotTools.ProjectEditor
public static string GenAndSaveGameProject(string dir, string name)
{
if (name.Length == 0)
- throw new ArgumentException("Project name is empty", nameof(name));
+ throw new ArgumentException("Project name is empty.", nameof(name));
string path = Path.Combine(dir, name + ".csproj");
diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildManager.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildManager.cs
index 43256953f5..993c6d9217 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildManager.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildManager.cs
@@ -62,7 +62,7 @@ namespace GodotTools.Build
private static bool Build(BuildInfo buildInfo)
{
if (_buildInProgress != null)
- throw new InvalidOperationException("A build is already in progress");
+ throw new InvalidOperationException("A build is already in progress.");
_buildInProgress = buildInfo;
@@ -111,7 +111,7 @@ namespace GodotTools.Build
public static async Task<bool> BuildAsync(BuildInfo buildInfo)
{
if (_buildInProgress != null)
- throw new InvalidOperationException("A build is already in progress");
+ throw new InvalidOperationException("A build is already in progress.");
_buildInProgress = buildInfo;
@@ -157,7 +157,7 @@ namespace GodotTools.Build
private static bool Publish(BuildInfo buildInfo)
{
if (_buildInProgress != null)
- throw new InvalidOperationException("A build is already in progress");
+ throw new InvalidOperationException("A build is already in progress.");
_buildInProgress = buildInfo;
diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildOutputView.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildOutputView.cs
index 96d1fc28bf..180cc3cf14 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildOutputView.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildOutputView.cs
@@ -120,13 +120,13 @@ namespace GodotTools.Build
private void IssueActivated(int idx)
{
if (idx < 0 || idx >= _issuesList.ItemCount)
- throw new IndexOutOfRangeException("Item list index out of range");
+ throw new ArgumentOutOfRangeException(nameof(idx), "Item list index out of range.");
// Get correct issue idx from issue list
int issueIndex = (int)_issuesList.GetItemMetadata(idx);
if (issueIndex < 0 || issueIndex >= _issues.Count)
- throw new IndexOutOfRangeException("Issue index out of range");
+ throw new InvalidOperationException("Issue index out of range.");
BuildIssue issue = _issues[issueIndex];
@@ -293,7 +293,7 @@ namespace GodotTools.Build
public void RestartBuild()
{
if (!HasBuildExited)
- throw new InvalidOperationException("Build already started");
+ throw new InvalidOperationException("Build already started.");
BuildManager.RestartBuild(this);
}
@@ -301,7 +301,7 @@ namespace GodotTools.Build
public void StopBuild()
{
if (!HasBuildExited)
- throw new InvalidOperationException("Build is not in progress");
+ throw new InvalidOperationException("Build is not in progress.");
BuildManager.StopBuild(this);
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs b/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs
index 6dae0a3a0e..d05995c495 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs
@@ -139,7 +139,7 @@ namespace GodotTools.Build
_errorsBtn = new Button
{
- HintTooltip = "Show Errors".TTR(),
+ TooltipText = "Show Errors".TTR(),
Icon = GetThemeIcon("StatusError", "EditorIcons"),
ExpandIcon = false,
ToggleMode = true,
@@ -151,7 +151,7 @@ namespace GodotTools.Build
_warningsBtn = new Button
{
- HintTooltip = "Show Warnings".TTR(),
+ TooltipText = "Show Warnings".TTR(),
Icon = GetThemeIcon("NodeWarning", "EditorIcons"),
ExpandIcon = false,
ToggleMode = true,
diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/NuGetUtils.cs b/modules/mono/editor/GodotTools/GodotTools/Build/NuGetUtils.cs
index fdb86c8f34..d2e0e128b5 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Build/NuGetUtils.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Build/NuGetUtils.cs
@@ -49,7 +49,7 @@ namespace GodotTools.Build
{
// Check that the root node is the expected one
if (rootNode.Name != nuGetConfigRootName)
- throw new Exception("Invalid root Xml node for NuGet.Config. " +
+ throw new FormatException("Invalid root Xml node for NuGet.Config. " +
$"Expected '{nuGetConfigRootName}' got '{rootNode.Name}'.");
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs b/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs
index fc325fc25b..2184cae6d6 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs
@@ -76,13 +76,20 @@ namespace GodotTools.Export
else
{
string arch = "";
- if (features.Contains("x86_64")) {
+ if (features.Contains("x86_64"))
+ {
arch = "x86_64";
- } else if (features.Contains("x86_32")) {
+ }
+ else if (features.Contains("x86_32"))
+ {
arch = "x86_32";
- } else if (features.Contains("arm64")) {
+ }
+ else if (features.Contains("arm64"))
+ {
arch = "arm64";
- } else if (features.Contains("arm32")) {
+ }
+ else if (features.Contains("arm32"))
+ {
arch = "arm32";
}
CompileAssembliesForDesktop(exporter, platform, isDebug, arch, aotOpts, aotTempDir, outputDataDir, assembliesPrepared, bclDir);
@@ -212,7 +219,7 @@ namespace GodotTools.Export
int clangExitCode = OS.ExecuteCommand(XcodeHelper.FindXcodeTool("clang"), clangArgs);
if (clangExitCode != 0)
- throw new Exception($"Command 'clang' exited with code: {clangExitCode}");
+ throw new InvalidOperationException($"Command 'clang' exited with code: {clangExitCode}.");
objFilePathsForiOSArch[arch].Add(objFilePath);
}
@@ -318,7 +325,7 @@ MONO_AOT_MODE_LAST = 1000,
int arExitCode = OS.ExecuteCommand(XcodeHelper.FindXcodeTool("ar"), arArgs);
if (arExitCode != 0)
- throw new Exception($"Command 'ar' exited with code: {arExitCode}");
+ throw new InvalidOperationException($"Command 'ar' exited with code: {arExitCode}.");
arFilePathsForAllArchs.Add(arOutputFilePath);
}
@@ -336,7 +343,7 @@ MONO_AOT_MODE_LAST = 1000,
int lipoExitCode = OS.ExecuteCommand(XcodeHelper.FindXcodeTool("lipo"), lipoArgs);
if (lipoExitCode != 0)
- throw new Exception($"Command 'lipo' exited with code: {lipoExitCode}");
+ throw new InvalidOperationException($"Command 'lipo' exited with code: {lipoExitCode}.");
// TODO: Add the AOT lib and interpreter libs as device only to suppress warnings when targeting the simulator
@@ -436,7 +443,7 @@ MONO_AOT_MODE_LAST = 1000,
}
else if (!Directory.Exists(androidToolchain))
{
- throw new FileNotFoundException("Android toolchain not found: " + androidToolchain);
+ throw new FileNotFoundException($"Android toolchain not found: '{androidToolchain}'.");
}
var androidToolPrefixes = new Dictionary<string, string>
@@ -533,12 +540,12 @@ MONO_AOT_MODE_LAST = 1000,
Console.WriteLine($"Running: \"{process.StartInfo.FileName}\" {process.StartInfo.Arguments}");
if (!process.Start())
- throw new Exception("Failed to start process for Mono AOT compiler");
+ throw new InvalidOperationException("Failed to start process for Mono AOT compiler.");
process.WaitForExit();
if (process.ExitCode != 0)
- throw new Exception($"Mono AOT compiler exited with code: {process.ExitCode}");
+ throw new InvalidOperationException($"Mono AOT compiler exited with code: {process.ExitCode}.");
}
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
index e1b5530b93..951bff7e7a 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
@@ -98,16 +98,16 @@ namespace GodotTools.Export
return;
if (!DeterminePlatformFromFeatures(features, out string platform))
- throw new NotSupportedException("Target platform not supported");
+ throw new NotSupportedException("Target platform not supported.");
if (!new[] { OS.Platforms.Windows, OS.Platforms.LinuxBSD, OS.Platforms.MacOS }
.Contains(platform))
{
- throw new NotImplementedException("Target platform not yet implemented");
+ throw new NotImplementedException("Target platform not yet implemented.");
}
string outputDir = new FileInfo(path).Directory?.FullName ??
- throw new FileNotFoundException("Output base directory not found");
+ throw new FileNotFoundException("Output base directory not found.");
string buildConfig = isDebug ? "ExportDebug" : "ExportRelease";
@@ -131,7 +131,7 @@ namespace GodotTools.Export
if (!BuildManager.PublishProjectBlocking(buildConfig, platform,
runtimeIdentifier, publishOutputTempDir))
{
- throw new Exception("Failed to build project");
+ throw new InvalidOperationException("Failed to build project.");
}
string soExt = ridOS switch
diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/XcodeHelper.cs b/modules/mono/editor/GodotTools/GodotTools/Export/XcodeHelper.cs
index 93ef837a83..4f5bebfb42 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Export/XcodeHelper.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Export/XcodeHelper.cs
@@ -16,7 +16,7 @@ namespace GodotTools.Export
_XcodePath = FindXcode();
if (_XcodePath == null)
- throw new Exception("Could not find Xcode");
+ throw new FileNotFoundException("Could not find Xcode.");
}
return _XcodePath;
diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
index 0aca60dad4..994c11fa72 100644
--- a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
@@ -342,7 +342,7 @@ namespace GodotTools
DotNetSolution.MigrateFromOldConfigNames(GodotSharpDirs.ProjectSlnPath);
var msbuildProject = ProjectUtils.Open(GodotSharpDirs.ProjectCsProjPath)
- ?? throw new Exception("Cannot open C# project");
+ ?? throw new InvalidOperationException("Cannot open C# project.");
// NOTE: The order in which changes are made to the project is important
@@ -433,7 +433,7 @@ namespace GodotTools
_toolBarBuildButton = new Button
{
Text = "Build",
- HintTooltip = "Build Solution".TTR(),
+ TooltipText = "Build Solution".TTR(),
FocusMode = Control.FocusModeEnum.None,
Shortcut = buildSolutionShortcut,
ShortcutInTooltip = true
diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs
index 95b60aded1..9df90ac608 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs
@@ -153,7 +153,7 @@ namespace GodotTools.Ides
}
default:
- throw new ArgumentOutOfRangeException();
+ throw new ArgumentOutOfRangeException(nameof(editorId));
}
}
@@ -180,17 +180,17 @@ namespace GodotTools.Ides
public void SendOpenFile(string file)
{
- SendRequest<OpenFileResponse>(new OpenFileRequest {File = file});
+ SendRequest<OpenFileResponse>(new OpenFileRequest { File = file });
}
public void SendOpenFile(string file, int line)
{
- SendRequest<OpenFileResponse>(new OpenFileRequest {File = file, Line = line});
+ SendRequest<OpenFileResponse>(new OpenFileRequest { File = file, Line = line });
}
public void SendOpenFile(string file, int line, int column)
{
- SendRequest<OpenFileResponse>(new OpenFileRequest {File = file, Line = line, Column = column});
+ SendRequest<OpenFileResponse>(new OpenFileRequest { File = file, Line = line, Column = column });
}
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs
index 6f11831b80..62db6e3af5 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs
@@ -385,7 +385,7 @@ namespace GodotTools.Ides
// However, it doesn't fix resource loading if the rest of the path is also case insensitive.
string scriptFileLocalized = FsPathUtils.LocalizePathWithCaseChecked(request.ScriptFile);
- var response = new CodeCompletionResponse {Kind = request.Kind, ScriptFile = request.ScriptFile};
+ var response = new CodeCompletionResponse { Kind = request.Kind, ScriptFile = request.ScriptFile };
response.Suggestions = await Task.Run(() =>
Internal.CodeCompletionRequest(response.Kind, scriptFileLocalized ?? request.ScriptFile));
return response;
diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs
index 4caab035de..dad6e35344 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs
@@ -42,7 +42,7 @@ namespace GodotTools.Ides.Rider
{
return CollectAllRiderPathsLinux();
}
- throw new Exception("Unexpected OS.");
+ throw new InvalidOperationException("Unexpected OS.");
}
catch (Exception e)
{
@@ -216,7 +216,7 @@ namespace GodotTools.Ides.Rider
return "../../build.txt";
if (OS.IsMacOS)
return "Contents/Resources/build.txt";
- throw new Exception("Unknown OS.");
+ throw new InvalidOperationException("Unknown OS.");
}
[SupportedOSPlatform("windows")]
diff --git a/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs b/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs
index e3fe1622d0..fd810996f7 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs
@@ -74,11 +74,11 @@ namespace GodotTools.Internals
internal static unsafe void Initialize(IntPtr unmanagedCallbacks, int unmanagedCallbacksSize)
{
if (initialized)
- throw new InvalidOperationException("Already initialized");
+ throw new InvalidOperationException("Already initialized.");
initialized = true;
if (unmanagedCallbacksSize != sizeof(InternalUnmanagedCallbacks))
- throw new ArgumentException("Unmanaged callbacks size mismatch");
+ throw new ArgumentException("Unmanaged callbacks size mismatch.", nameof(unmanagedCallbacksSize));
_unmanagedCallbacks = Unsafe.AsRef<InternalUnmanagedCallbacks>((void*)unmanagedCallbacks);
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs b/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs
index 651922d019..6290b2c56f 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs
@@ -30,7 +30,7 @@ namespace GodotTools.Utils
public const string Haiku = "Haiku";
public const string Android = "Android";
public const string iOS = "iOS";
- public const string HTML5 = "HTML5";
+ public const string Web = "Web";
}
/// <summary>
@@ -45,7 +45,7 @@ namespace GodotTools.Utils
public const string Haiku = "haiku";
public const string Android = "android";
public const string iOS = "ios";
- public const string HTML5 = "javascript";
+ public const string Web = "web";
}
/// <summary>
@@ -77,7 +77,7 @@ namespace GodotTools.Utils
["Haiku"] = Platforms.Haiku,
["Android"] = Platforms.Android,
["iOS"] = Platforms.iOS,
- ["HTML5"] = Platforms.HTML5
+ ["Web"] = Platforms.Web
};
public static readonly Dictionary<string, string> PlatformNameMap = new Dictionary<string, string>
@@ -92,7 +92,7 @@ namespace GodotTools.Utils
[Names.Haiku] = Platforms.Haiku,
[Names.Android] = Platforms.Android,
[Names.iOS] = Platforms.iOS,
- [Names.HTML5] = Platforms.HTML5
+ [Names.Web] = Platforms.Web
};
public static readonly Dictionary<string, string> DotNetOSPlatformMap = new Dictionary<string, string>
@@ -107,7 +107,7 @@ namespace GodotTools.Utils
[Platforms.UWP] = DotNetOS.Win10,
[Platforms.Android] = DotNetOS.Android,
[Platforms.iOS] = DotNetOS.iOS,
- [Platforms.HTML5] = DotNetOS.Browser
+ [Platforms.Web] = DotNetOS.Browser
};
private static bool IsOS(string name)
@@ -144,7 +144,7 @@ namespace GodotTools.Utils
private static readonly Lazy<bool> _isHaiku = new(() => IsOS(Names.Haiku));
private static readonly Lazy<bool> _isAndroid = new(() => IsOS(Names.Android));
private static readonly Lazy<bool> _isiOS = new(() => IsOS(Names.iOS));
- private static readonly Lazy<bool> _isHTML5 = new(() => IsOS(Names.HTML5));
+ private static readonly Lazy<bool> _isWeb = new(() => IsOS(Names.Web));
private static readonly Lazy<bool> _isUnixLike = new(() => IsAnyOS(UnixLikePlatforms));
[SupportedOSPlatformGuard("windows")] public static bool IsWindows => _isWindows.Value || IsUWP;
@@ -161,7 +161,7 @@ namespace GodotTools.Utils
[SupportedOSPlatformGuard("ios")] public static bool IsiOS => _isiOS.Value;
- [SupportedOSPlatformGuard("browser")] public static bool IsHTML5 => _isHTML5.Value;
+ [SupportedOSPlatformGuard("browser")] public static bool IsWeb => _isWeb.Value;
public static bool IsUnixLike => _isUnixLike.Value;
public static char PathSep => IsWindows ? ';' : ':';
@@ -206,10 +206,10 @@ namespace GodotTools.Utils
return searchDirs.Select(dir => Path.Combine(dir, name)).FirstOrDefault(File.Exists);
return (from dir in searchDirs
- select Path.Combine(dir, name)
+ select Path.Combine(dir, name)
into path
- from ext in windowsExts
- select path + ext).FirstOrDefault(File.Exists);
+ from ext in windowsExts
+ select path + ext).FirstOrDefault(File.Exists);
}
[return: MaybeNull]
@@ -257,7 +257,7 @@ namespace GodotTools.Utils
using Process process = Process.Start(startInfo);
if (process == null)
- throw new Exception("No process was started");
+ throw new InvalidOperationException("No process was started.");
process.BeginOutputReadLine();
process.BeginErrorReadLine();
diff --git a/modules/mono/editor/code_completion.cpp b/modules/mono/editor/code_completion.cpp
index 7bce6f2c21..36c46627e2 100644
--- a/modules/mono/editor/code_completion.cpp
+++ b/modules/mono/editor/code_completion.cpp
@@ -35,6 +35,7 @@
#include "editor/editor_settings.h"
#include "scene/gui/control.h"
#include "scene/main/node.h"
+#include "scene/theme/theme_db.h"
namespace gdmono {
@@ -195,7 +196,7 @@ PackedStringArray get_code_completion(CompletionKind p_kind, const String &p_scr
Node *base = _try_find_owner_node_in_tree(script);
if (base && Object::cast_to<Control>(base)) {
List<StringName> sn;
- Theme::get_default()->get_color_list(base->get_class(), &sn);
+ ThemeDB::get_singleton()->get_default_theme()->get_color_list(base->get_class(), &sn);
for (const StringName &E : sn) {
suggestions.push_back(quoted(E));
@@ -207,7 +208,7 @@ PackedStringArray get_code_completion(CompletionKind p_kind, const String &p_scr
Node *base = _try_find_owner_node_in_tree(script);
if (base && Object::cast_to<Control>(base)) {
List<StringName> sn;
- Theme::get_default()->get_constant_list(base->get_class(), &sn);
+ ThemeDB::get_singleton()->get_default_theme()->get_constant_list(base->get_class(), &sn);
for (const StringName &E : sn) {
suggestions.push_back(quoted(E));
@@ -219,7 +220,7 @@ PackedStringArray get_code_completion(CompletionKind p_kind, const String &p_scr
Node *base = _try_find_owner_node_in_tree(script);
if (base && Object::cast_to<Control>(base)) {
List<StringName> sn;
- Theme::get_default()->get_font_list(base->get_class(), &sn);
+ ThemeDB::get_singleton()->get_default_theme()->get_font_list(base->get_class(), &sn);
for (const StringName &E : sn) {
suggestions.push_back(quoted(E));
@@ -231,7 +232,7 @@ PackedStringArray get_code_completion(CompletionKind p_kind, const String &p_scr
Node *base = _try_find_owner_node_in_tree(script);
if (base && Object::cast_to<Control>(base)) {
List<StringName> sn;
- Theme::get_default()->get_font_size_list(base->get_class(), &sn);
+ ThemeDB::get_singleton()->get_default_theme()->get_font_size_list(base->get_class(), &sn);
for (const StringName &E : sn) {
suggestions.push_back(quoted(E));
@@ -243,7 +244,7 @@ PackedStringArray get_code_completion(CompletionKind p_kind, const String &p_scr
Node *base = _try_find_owner_node_in_tree(script);
if (base && Object::cast_to<Control>(base)) {
List<StringName> sn;
- Theme::get_default()->get_stylebox_list(base->get_class(), &sn);
+ ThemeDB::get_singleton()->get_default_theme()->get_stylebox_list(base->get_class(), &sn);
for (const StringName &E : sn) {
suggestions.push_back(quoted(E));
diff --git a/modules/mono/glue/GodotSharp/GodotPlugins/Main.cs b/modules/mono/glue/GodotSharp/GodotPlugins/Main.cs
index dad7464410..8308bada24 100644
--- a/modules/mono/glue/GodotSharp/GodotPlugins/Main.cs
+++ b/modules/mono/glue/GodotSharp/GodotPlugins/Main.cs
@@ -153,7 +153,7 @@ namespace GodotPlugins
string assemblyPath = new(nAssemblyPath);
if (_editorApiAssembly == null)
- throw new InvalidOperationException("The Godot editor API assembly is not loaded");
+ throw new InvalidOperationException("The Godot editor API assembly is not loaded.");
var (assembly, _) = LoadPlugin(assemblyPath);
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/AABB.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/AABB.cs
index b3a36e8ac8..17f680361d 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/AABB.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/AABB.cs
@@ -145,6 +145,9 @@ namespace Godot
/// Gets the position of one of the 8 endpoints of the <see cref="AABB"/>.
/// </summary>
/// <param name="idx">Which endpoint to get.</param>
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="idx"/> is less than 0 or greater than 7.
+ /// </exception>
/// <returns>An endpoint of the <see cref="AABB"/>.</returns>
public Vector3 GetEndpoint(int idx)
{
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs
index f2984bd1fb..1c98dfcdf6 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs
@@ -510,7 +510,7 @@ namespace Godot.Collections
if (_convertToVariantCallback == null || _convertToManagedCallback == null)
{
throw new InvalidOperationException(
- $"The array element type is not supported for conversion to Variant: '{typeof(T).FullName}'");
+ $"The array element type is not supported for conversion to Variant: '{typeof(T).FullName}'.");
}
}
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs
index ed20067a92..fbd59d649f 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs
@@ -148,6 +148,9 @@ namespace Godot
/// Access whole columns in the form of <see cref="Vector3"/>.
/// </summary>
/// <param name="column">Which column vector.</param>
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="column"/> is not 0, 1, 2 or 3.
+ /// </exception>
/// <value>The basis column.</value>
public Vector3 this[int column]
{
@@ -366,8 +369,8 @@ namespace Godot
/// but are more efficient for some internal calculations.
/// </summary>
/// <param name="index">Which row.</param>
- /// <exception cref="IndexOutOfRangeException">
- /// Thrown when the <paramref name="index"/> is not 0, 1 or 2.
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="index"/> is not 0, 1 or 2.
/// </exception>
/// <returns>One of <c>Row0</c>, <c>Row1</c>, or <c>Row2</c>.</returns>
public Vector3 GetRow(int index)
@@ -391,8 +394,8 @@ namespace Godot
/// </summary>
/// <param name="index">Which row.</param>
/// <param name="value">The vector to set the row to.</param>
- /// <exception cref="IndexOutOfRangeException">
- /// Thrown when the <paramref name="index"/> is not 0, 1 or 2.
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="index"/> is not 0, 1 or 2.
/// </exception>
public void SetRow(int index, Vector3 value)
{
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs
index 0cbaef3dad..33d8aef1a9 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs
@@ -595,7 +595,7 @@ namespace Godot
/// </summary>
/// <param name="rgba">A string for the HTML hexadecimal representation of this color.</param>
/// <exception name="ArgumentOutOfRangeException">
- /// Thrown when the given <paramref name="rgba"/> color code is invalid.
+ /// <paramref name="rgba"/> color code is invalid.
/// </exception>
private static Color FromHTML(string rgba)
{
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Dictionary.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Dictionary.cs
index 95ad097192..93103d0f6b 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Dictionary.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Dictionary.cs
@@ -171,7 +171,7 @@ namespace Godot.Collections
var self = (godot_dictionary)NativeValue;
if (NativeFuncs.godotsharp_dictionary_contains_key(ref self, variantKey).ToBool())
- throw new ArgumentException("An element with the same key already exists", nameof(key));
+ throw new ArgumentException("An element with the same key already exists.", nameof(key));
godot_variant variantValue = (godot_variant)value.NativeVar;
NativeFuncs.godotsharp_dictionary_add(ref self, variantKey, variantValue);
@@ -381,13 +381,13 @@ namespace Godot.Collections
if (_convertKeyToVariantCallback == null || _convertKeyToManagedCallback == null)
{
throw new InvalidOperationException(
- $"The dictionary key type is not supported for conversion to Variant: '{typeof(TKey).FullName}'");
+ $"The dictionary key type is not supported for conversion to Variant: '{typeof(TKey).FullName}'.");
}
if (_convertValueToVariantCallback == null || _convertValueToManagedCallback == null)
{
throw new InvalidOperationException(
- $"The dictionary value type is not supported for conversion to Variant: '{typeof(TValue).FullName}'");
+ $"The dictionary value type is not supported for conversion to Variant: '{typeof(TValue).FullName}'.");
}
}
@@ -556,7 +556,7 @@ namespace Godot.Collections
var self = (godot_dictionary)_underlyingDict.NativeValue;
if (NativeFuncs.godotsharp_dictionary_contains_key(ref self, variantKey).ToBool())
- throw new ArgumentException("An element with the same key already exists", nameof(key));
+ throw new ArgumentException("An element with the same key already exists.", nameof(key));
using var variantValue = _convertValueToVariantCallback(value);
NativeFuncs.godotsharp_dictionary_add(ref self, variantKey, variantValue);
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/DisposablesTracker.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/DisposablesTracker.cs
index 75793ea446..421b588560 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/DisposablesTracker.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/DisposablesTracker.cs
@@ -83,13 +83,13 @@ namespace Godot
public static void UnregisterGodotObject(Object godotObject, WeakReference<Object> weakReferenceToSelf)
{
if (!GodotObjectInstances.TryRemove(weakReferenceToSelf, out _))
- throw new ArgumentException("Godot Object not registered", nameof(weakReferenceToSelf));
+ throw new ArgumentException("Godot Object not registered.", nameof(weakReferenceToSelf));
}
public static void UnregisterDisposable(WeakReference<IDisposable> weakReference)
{
if (!OtherInstances.TryRemove(weakReference, out _))
- throw new ArgumentException("Disposable not registered", nameof(weakReference));
+ throw new ArgumentException("Disposable not registered.", nameof(weakReference));
}
}
}
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/NodeExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/NodeExtensions.cs
index df0e839866..03996bafdd 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/NodeExtensions.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/NodeExtensions.cs
@@ -36,7 +36,7 @@ namespace Godot
/// <seealso cref="GetNodeOrNull{T}(NodePath)"/>
/// <param name="path">The path to the node to fetch.</param>
/// <exception cref="InvalidCastException">
- /// Thrown when the given the fetched node can't be casted to the given type <typeparamref name="T"/>.
+ /// The fetched node can't be casted to the given type <typeparamref name="T"/>.
/// </exception>
/// <typeparam name="T">The type to cast to. Should be a descendant of <see cref="Node"/>.</typeparam>
/// <returns>
@@ -100,7 +100,7 @@ namespace Godot
/// parameter in <see cref="AddChild(Node, bool, InternalMode)"/>).
/// </param>
/// <exception cref="InvalidCastException">
- /// Thrown when the given the fetched node can't be casted to the given type <typeparamref name="T"/>.
+ /// The fetched node can't be casted to the given type <typeparamref name="T"/>.
/// </exception>
/// <typeparam name="T">The type to cast to. Should be a descendant of <see cref="Node"/>.</typeparam>
/// <returns>
@@ -142,7 +142,7 @@ namespace Godot
/// </summary>
/// <seealso cref="GetOwnerOrNull{T}"/>
/// <exception cref="InvalidCastException">
- /// Thrown when the given the fetched node can't be casted to the given type <typeparamref name="T"/>.
+ /// The fetched node can't be casted to the given type <typeparamref name="T"/>.
/// </exception>
/// <typeparam name="T">The type to cast to. Should be a descendant of <see cref="Node"/>.</typeparam>
/// <returns>
@@ -176,7 +176,7 @@ namespace Godot
/// </summary>
/// <seealso cref="GetParentOrNull{T}"/>
/// <exception cref="InvalidCastException">
- /// Thrown when the given the fetched node can't be casted to the given type <typeparamref name="T"/>.
+ /// The fetched node can't be casted to the given type <typeparamref name="T"/>.
/// </exception>
/// <typeparam name="T">The type to cast to. Should be a descendant of <see cref="Node"/>.</typeparam>
/// <returns>
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/PackedSceneExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/PackedSceneExtensions.cs
index 435b59d5f3..8463403096 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/PackedSceneExtensions.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/PackedSceneExtensions.cs
@@ -11,7 +11,7 @@ namespace Godot
/// </summary>
/// <seealso cref="InstantiateOrNull{T}(GenEditState)"/>
/// <exception cref="InvalidCastException">
- /// Thrown when the given the instantiated node can't be casted to the given type <typeparamref name="T"/>.
+ /// The instantiated node can't be casted to the given type <typeparamref name="T"/>.
/// </exception>
/// <typeparam name="T">The type to cast to. Should be a descendant of <see cref="Node"/>.</typeparam>
/// <returns>The instantiated scene.</returns>
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/ResourceLoaderExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/ResourceLoaderExtensions.cs
index 25c11d5cf6..b246e56fa9 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/ResourceLoaderExtensions.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/ResourceLoaderExtensions.cs
@@ -19,7 +19,7 @@ namespace Godot
/// Returns an empty resource if no <see cref="ResourceFormatLoader"/> could handle the file.
/// </summary>
/// <exception cref="InvalidCastException">
- /// Thrown when the given the loaded resource can't be casted to the given type <typeparamref name="T"/>.
+ /// The loaded resource can't be casted to the given type <typeparamref name="T"/>.
/// </exception>
/// <typeparam name="T">The type to cast to. Should be a descendant of <see cref="Resource"/>.</typeparam>
public static T Load<T>(string path, string typeHint = null, CacheMode cacheMode = CacheMode.Reuse) where T : class
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/NativeFuncs.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/NativeFuncs.cs
index 48c1b48c59..94dda5a74b 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/NativeFuncs.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/NativeFuncs.cs
@@ -22,11 +22,11 @@ namespace Godot.NativeInterop
public static void Initialize(IntPtr unmanagedCallbacks, int unmanagedCallbacksSize)
{
if (initialized)
- throw new InvalidOperationException("Already initialized");
+ throw new InvalidOperationException("Already initialized.");
initialized = true;
if (unmanagedCallbacksSize != sizeof(UnmanagedCallbacks))
- throw new ArgumentException("Unmanaged callbacks size mismatch");
+ throw new ArgumentException("Unmanaged callbacks size mismatch.", nameof(unmanagedCallbacksSize));
_unmanagedCallbacks = Unsafe.AsRef<UnmanagedCallbacks>((void*)unmanagedCallbacks);
}
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/VariantConversionCallbacks.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/VariantConversionCallbacks.cs
index 2b5bf2e142..a13fb936e8 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/VariantConversionCallbacks.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/VariantConversionCallbacks.cs
@@ -6,7 +6,7 @@ namespace Godot.NativeInterop;
internal static unsafe class VariantConversionCallbacks
{
[SuppressMessage("ReSharper", "RedundantNameQualifier")]
- internal static delegate* <in T, godot_variant> GetToVariantCallback<T>()
+ internal static delegate*<in T, godot_variant> GetToVariantCallback<T>()
{
static godot_variant FromBool(in bool @bool) =>
VariantUtils.CreateFromBool(@bool);
@@ -153,163 +153,163 @@ internal static unsafe class VariantConversionCallbacks
if (typeOfT == typeof(bool))
{
- return (delegate* <in T, godot_variant>)(delegate* <in bool, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in bool, godot_variant>)
&FromBool;
}
if (typeOfT == typeof(char))
{
- return (delegate* <in T, godot_variant>)(delegate* <in char, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in char, godot_variant>)
&FromChar;
}
if (typeOfT == typeof(sbyte))
{
- return (delegate* <in T, godot_variant>)(delegate* <in sbyte, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in sbyte, godot_variant>)
&FromInt8;
}
if (typeOfT == typeof(short))
{
- return (delegate* <in T, godot_variant>)(delegate* <in short, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in short, godot_variant>)
&FromInt16;
}
if (typeOfT == typeof(int))
{
- return (delegate* <in T, godot_variant>)(delegate* <in int, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in int, godot_variant>)
&FromInt32;
}
if (typeOfT == typeof(long))
{
- return (delegate* <in T, godot_variant>)(delegate* <in long, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in long, godot_variant>)
&FromInt64;
}
if (typeOfT == typeof(byte))
{
- return (delegate* <in T, godot_variant>)(delegate* <in byte, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in byte, godot_variant>)
&FromUInt8;
}
if (typeOfT == typeof(ushort))
{
- return (delegate* <in T, godot_variant>)(delegate* <in ushort, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in ushort, godot_variant>)
&FromUInt16;
}
if (typeOfT == typeof(uint))
{
- return (delegate* <in T, godot_variant>)(delegate* <in uint, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in uint, godot_variant>)
&FromUInt32;
}
if (typeOfT == typeof(ulong))
{
- return (delegate* <in T, godot_variant>)(delegate* <in ulong, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in ulong, godot_variant>)
&FromUInt64;
}
if (typeOfT == typeof(float))
{
- return (delegate* <in T, godot_variant>)(delegate* <in float, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in float, godot_variant>)
&FromFloat;
}
if (typeOfT == typeof(double))
{
- return (delegate* <in T, godot_variant>)(delegate* <in double, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in double, godot_variant>)
&FromDouble;
}
if (typeOfT == typeof(Vector2))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Vector2, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Vector2, godot_variant>)
&FromVector2;
}
if (typeOfT == typeof(Vector2i))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Vector2i, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Vector2i, godot_variant>)
&FromVector2I;
}
if (typeOfT == typeof(Rect2))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Rect2, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Rect2, godot_variant>)
&FromRect2;
}
if (typeOfT == typeof(Rect2i))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Rect2i, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Rect2i, godot_variant>)
&FromRect2I;
}
if (typeOfT == typeof(Transform2D))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Transform2D, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Transform2D, godot_variant>)
&FromTransform2D;
}
if (typeOfT == typeof(Vector3))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Vector3, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Vector3, godot_variant>)
&FromVector3;
}
if (typeOfT == typeof(Vector3i))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Vector3i, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Vector3i, godot_variant>)
&FromVector3I;
}
if (typeOfT == typeof(Basis))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Basis, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Basis, godot_variant>)
&FromBasis;
}
if (typeOfT == typeof(Quaternion))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Quaternion, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Quaternion, godot_variant>)
&FromQuaternion;
}
if (typeOfT == typeof(Transform3D))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Transform3D, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Transform3D, godot_variant>)
&FromTransform3D;
}
if (typeOfT == typeof(AABB))
{
- return (delegate* <in T, godot_variant>)(delegate* <in AABB, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in AABB, godot_variant>)
&FromAabb;
}
if (typeOfT == typeof(Color))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Color, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Color, godot_variant>)
&FromColor;
}
if (typeOfT == typeof(Plane))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Plane, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Plane, godot_variant>)
&FromPlane;
}
if (typeOfT == typeof(Callable))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Callable, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Callable, godot_variant>)
&FromCallable;
}
if (typeOfT == typeof(SignalInfo))
{
- return (delegate* <in T, godot_variant>)(delegate* <in SignalInfo, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in SignalInfo, godot_variant>)
&FromSignalInfo;
}
@@ -321,42 +321,42 @@ internal static unsafe class VariantConversionCallbacks
{
case TypeCode.SByte:
{
- return (delegate* <in T, godot_variant>)(delegate* <in sbyte, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in sbyte, godot_variant>)
&FromInt8;
}
case TypeCode.Int16:
{
- return (delegate* <in T, godot_variant>)(delegate* <in short, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in short, godot_variant>)
&FromInt16;
}
case TypeCode.Int32:
{
- return (delegate* <in T, godot_variant>)(delegate* <in int, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in int, godot_variant>)
&FromInt32;
}
case TypeCode.Int64:
{
- return (delegate* <in T, godot_variant>)(delegate* <in long, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in long, godot_variant>)
&FromInt64;
}
case TypeCode.Byte:
{
- return (delegate* <in T, godot_variant>)(delegate* <in byte, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in byte, godot_variant>)
&FromUInt8;
}
case TypeCode.UInt16:
{
- return (delegate* <in T, godot_variant>)(delegate* <in ushort, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in ushort, godot_variant>)
&FromUInt16;
}
case TypeCode.UInt32:
{
- return (delegate* <in T, godot_variant>)(delegate* <in uint, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in uint, godot_variant>)
&FromUInt32;
}
case TypeCode.UInt64:
{
- return (delegate* <in T, godot_variant>)(delegate* <in ulong, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in ulong, godot_variant>)
&FromUInt64;
}
default:
@@ -366,121 +366,121 @@ internal static unsafe class VariantConversionCallbacks
if (typeOfT == typeof(string))
{
- return (delegate* <in T, godot_variant>)(delegate* <in string, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in string, godot_variant>)
&FromString;
}
if (typeOfT == typeof(byte[]))
{
- return (delegate* <in T, godot_variant>)(delegate* <in byte[], godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in byte[], godot_variant>)
&FromByteArray;
}
if (typeOfT == typeof(int[]))
{
- return (delegate* <in T, godot_variant>)(delegate* <in int[], godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in int[], godot_variant>)
&FromInt32Array;
}
if (typeOfT == typeof(long[]))
{
- return (delegate* <in T, godot_variant>)(delegate* <in long[], godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in long[], godot_variant>)
&FromInt64Array;
}
if (typeOfT == typeof(float[]))
{
- return (delegate* <in T, godot_variant>)(delegate* <in float[], godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in float[], godot_variant>)
&FromFloatArray;
}
if (typeOfT == typeof(double[]))
{
- return (delegate* <in T, godot_variant>)(delegate* <in double[], godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in double[], godot_variant>)
&FromDoubleArray;
}
if (typeOfT == typeof(string[]))
{
- return (delegate* <in T, godot_variant>)(delegate* <in string[], godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in string[], godot_variant>)
&FromStringArray;
}
if (typeOfT == typeof(Vector2[]))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Vector2[], godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Vector2[], godot_variant>)
&FromVector2Array;
}
if (typeOfT == typeof(Vector3[]))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Vector3[], godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Vector3[], godot_variant>)
&FromVector3Array;
}
if (typeOfT == typeof(Color[]))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Color[], godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Color[], godot_variant>)
&FromColorArray;
}
if (typeOfT == typeof(StringName[]))
{
- return (delegate* <in T, godot_variant>)(delegate* <in StringName[], godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in StringName[], godot_variant>)
&FromStringNameArray;
}
if (typeOfT == typeof(NodePath[]))
{
- return (delegate* <in T, godot_variant>)(delegate* <in NodePath[], godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in NodePath[], godot_variant>)
&FromNodePathArray;
}
if (typeOfT == typeof(RID[]))
{
- return (delegate* <in T, godot_variant>)(delegate* <in RID[], godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in RID[], godot_variant>)
&FromRidArray;
}
if (typeof(Godot.Object).IsAssignableFrom(typeOfT))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Godot.Object, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Godot.Object, godot_variant>)
&FromGodotObject;
}
if (typeOfT == typeof(StringName))
{
- return (delegate* <in T, godot_variant>)(delegate* <in StringName, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in StringName, godot_variant>)
&FromStringName;
}
if (typeOfT == typeof(NodePath))
{
- return (delegate* <in T, godot_variant>)(delegate* <in NodePath, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in NodePath, godot_variant>)
&FromNodePath;
}
if (typeOfT == typeof(RID))
{
- return (delegate* <in T, godot_variant>)(delegate* <in RID, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in RID, godot_variant>)
&FromRid;
}
if (typeOfT == typeof(Godot.Collections.Dictionary))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Godot.Collections.Dictionary, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Godot.Collections.Dictionary, godot_variant>)
&FromGodotDictionary;
}
if (typeOfT == typeof(Godot.Collections.Array))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Godot.Collections.Array, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Godot.Collections.Array, godot_variant>)
&FromGodotArray;
}
if (typeOfT == typeof(Variant))
{
- return (delegate* <in T, godot_variant>)(delegate* <in Variant, godot_variant>)
+ return (delegate*<in T, godot_variant>)(delegate*<in Variant, godot_variant>)
&FromVariant;
}
@@ -488,7 +488,7 @@ internal static unsafe class VariantConversionCallbacks
}
[SuppressMessage("ReSharper", "RedundantNameQualifier")]
- internal static delegate* <in godot_variant, T> GetToManagedCallback<T>()
+ internal static delegate*<in godot_variant, T> GetToManagedCallback<T>()
{
static bool ToBool(in godot_variant variant) =>
VariantUtils.ConvertToBool(variant);
@@ -638,163 +638,163 @@ internal static unsafe class VariantConversionCallbacks
if (typeOfT == typeof(bool))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, bool>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, bool>)
&ToBool;
}
if (typeOfT == typeof(char))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, char>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, char>)
&ToChar;
}
if (typeOfT == typeof(sbyte))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, sbyte>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, sbyte>)
&ToInt8;
}
if (typeOfT == typeof(short))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, short>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, short>)
&ToInt16;
}
if (typeOfT == typeof(int))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, int>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, int>)
&ToInt32;
}
if (typeOfT == typeof(long))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, long>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, long>)
&ToInt64;
}
if (typeOfT == typeof(byte))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, byte>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, byte>)
&ToUInt8;
}
if (typeOfT == typeof(ushort))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, ushort>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, ushort>)
&ToUInt16;
}
if (typeOfT == typeof(uint))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, uint>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, uint>)
&ToUInt32;
}
if (typeOfT == typeof(ulong))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, ulong>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, ulong>)
&ToUInt64;
}
if (typeOfT == typeof(float))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, float>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, float>)
&ToFloat;
}
if (typeOfT == typeof(double))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, double>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, double>)
&ToDouble;
}
if (typeOfT == typeof(Vector2))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Vector2>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Vector2>)
&ToVector2;
}
if (typeOfT == typeof(Vector2i))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Vector2i>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Vector2i>)
&ToVector2I;
}
if (typeOfT == typeof(Rect2))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Rect2>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Rect2>)
&ToRect2;
}
if (typeOfT == typeof(Rect2i))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Rect2i>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Rect2i>)
&ToRect2I;
}
if (typeOfT == typeof(Transform2D))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Transform2D>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Transform2D>)
&ToTransform2D;
}
if (typeOfT == typeof(Vector3))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Vector3>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Vector3>)
&ToVector3;
}
if (typeOfT == typeof(Vector3i))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Vector3i>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Vector3i>)
&ToVector3I;
}
if (typeOfT == typeof(Basis))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Basis>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Basis>)
&ToBasis;
}
if (typeOfT == typeof(Quaternion))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Quaternion>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Quaternion>)
&ToQuaternion;
}
if (typeOfT == typeof(Transform3D))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Transform3D>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Transform3D>)
&ToTransform3D;
}
if (typeOfT == typeof(AABB))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, AABB>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, AABB>)
&ToAabb;
}
if (typeOfT == typeof(Color))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Color>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Color>)
&ToColor;
}
if (typeOfT == typeof(Plane))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Plane>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Plane>)
&ToPlane;
}
if (typeOfT == typeof(Callable))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Callable>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Callable>)
&ToCallable;
}
if (typeOfT == typeof(SignalInfo))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, SignalInfo>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, SignalInfo>)
&ToSignalInfo;
}
@@ -806,42 +806,42 @@ internal static unsafe class VariantConversionCallbacks
{
case TypeCode.SByte:
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, sbyte>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, sbyte>)
&ToInt8;
}
case TypeCode.Int16:
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, short>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, short>)
&ToInt16;
}
case TypeCode.Int32:
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, int>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, int>)
&ToInt32;
}
case TypeCode.Int64:
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, long>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, long>)
&ToInt64;
}
case TypeCode.Byte:
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, byte>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, byte>)
&ToUInt8;
}
case TypeCode.UInt16:
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, ushort>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, ushort>)
&ToUInt16;
}
case TypeCode.UInt32:
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, uint>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, uint>)
&ToUInt32;
}
case TypeCode.UInt64:
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, ulong>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, ulong>)
&ToUInt64;
}
default:
@@ -851,121 +851,121 @@ internal static unsafe class VariantConversionCallbacks
if (typeOfT == typeof(string))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, string>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, string>)
&ToString;
}
if (typeOfT == typeof(byte[]))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, byte[]>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, byte[]>)
&ToByteArray;
}
if (typeOfT == typeof(int[]))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, int[]>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, int[]>)
&ToInt32Array;
}
if (typeOfT == typeof(long[]))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, long[]>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, long[]>)
&ToInt64Array;
}
if (typeOfT == typeof(float[]))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, float[]>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, float[]>)
&ToFloatArray;
}
if (typeOfT == typeof(double[]))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, double[]>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, double[]>)
&ToDoubleArray;
}
if (typeOfT == typeof(string[]))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, string[]>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, string[]>)
&ToStringArray;
}
if (typeOfT == typeof(Vector2[]))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Vector2[]>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Vector2[]>)
&ToVector2Array;
}
if (typeOfT == typeof(Vector3[]))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Vector3[]>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Vector3[]>)
&ToVector3Array;
}
if (typeOfT == typeof(Color[]))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Color[]>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Color[]>)
&ToColorArray;
}
if (typeOfT == typeof(StringName[]))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, StringName[]>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, StringName[]>)
&ToStringNameArray;
}
if (typeOfT == typeof(NodePath[]))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, NodePath[]>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, NodePath[]>)
&ToNodePathArray;
}
if (typeOfT == typeof(RID[]))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, RID[]>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, RID[]>)
&ToRidArray;
}
if (typeof(Godot.Object).IsAssignableFrom(typeOfT))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Godot.Object>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Godot.Object>)
&ToGodotObject;
}
if (typeOfT == typeof(StringName))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, StringName>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, StringName>)
&ToStringName;
}
if (typeOfT == typeof(NodePath))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, NodePath>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, NodePath>)
&ToNodePath;
}
if (typeOfT == typeof(RID))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, RID>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, RID>)
&ToRid;
}
if (typeOfT == typeof(Godot.Collections.Dictionary))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Godot.Collections.Dictionary>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Godot.Collections.Dictionary>)
&ToGodotDictionary;
}
if (typeOfT == typeof(Godot.Collections.Array))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Godot.Collections.Array>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Godot.Collections.Array>)
&ToGodotArray;
}
if (typeOfT == typeof(Variant))
{
- return (delegate* <in godot_variant, T>)(delegate* <in godot_variant, Variant>)
+ return (delegate*<in godot_variant, T>)(delegate*<in godot_variant, Variant>)
&ToVariant;
}
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Object.exceptions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Object.exceptions.cs
index eb2811c73d..0fcc4ee01b 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Object.exceptions.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Object.exceptions.cs
@@ -1,4 +1,5 @@
using System;
+using System.Text;
#nullable enable
@@ -60,19 +61,22 @@ namespace Godot
{
get
{
- string s = base.Message;
-
- if (string.IsNullOrEmpty(s))
+ StringBuilder sb;
+ if (string.IsNullOrEmpty(base.Message))
+ {
+ sb = new(Arg_NativeConstructorNotFoundException);
+ }
+ else
{
- s = Arg_NativeConstructorNotFoundException;
+ sb = new(base.Message);
}
if (!string.IsNullOrEmpty(_nativeClassName))
{
- s += " " + string.Format("(Class '{0}')", _nativeClassName);
+ sb.Append($" (Method '{_nativeClassName}')");
}
- return s;
+ return sb.ToString();
}
}
}
@@ -115,19 +119,22 @@ namespace Godot
{
get
{
- string s = base.Message;
-
- if (string.IsNullOrEmpty(s))
+ StringBuilder sb;
+ if (string.IsNullOrEmpty(base.Message))
+ {
+ sb = new(Arg_NativeMethodBindNotFoundException);
+ }
+ else
{
- s = Arg_NativeMethodBindNotFoundException;
+ sb = new(base.Message);
}
if (!string.IsNullOrEmpty(_nativeMethodName))
{
- s += " " + string.Format("(Method '{0}')", _nativeMethodName);
+ sb.Append($" (Method '{_nativeMethodName}')");
}
- return s;
+ return sb.ToString();
}
}
}
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Projection.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Projection.cs
index 9d08e7120a..da895fd121 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Projection.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Projection.cs
@@ -649,6 +649,9 @@ namespace Godot
/// Access whole columns in the form of <see cref="Vector4"/>.
/// </summary>
/// <param name="column">Which column vector.</param>
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="column"/> is not 0, 1, 2 or 3.
+ /// </exception>
public Vector4 this[int column]
{
get
@@ -664,7 +667,7 @@ namespace Godot
case 3:
return w;
default:
- throw new IndexOutOfRangeException();
+ throw new ArgumentOutOfRangeException(nameof(column));
}
}
set
@@ -684,7 +687,7 @@ namespace Godot
w = value;
return;
default:
- throw new IndexOutOfRangeException();
+ throw new ArgumentOutOfRangeException(nameof(column));
}
}
}
@@ -694,6 +697,9 @@ namespace Godot
/// </summary>
/// <param name="column">Which column vector.</param>
/// <param name="row">Which row of the column.</param>
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="column"/> or <paramref name="row"/> are not 0, 1, 2 or 3.
+ /// </exception>
public real_t this[int column, int row]
{
get
@@ -709,7 +715,7 @@ namespace Godot
case 3:
return w[row];
default:
- throw new IndexOutOfRangeException();
+ throw new ArgumentOutOfRangeException(nameof(column));
}
}
set
@@ -729,7 +735,7 @@ namespace Godot
w[row] = value;
return;
default:
- throw new IndexOutOfRangeException();
+ throw new ArgumentOutOfRangeException(nameof(column));
}
}
}
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs
index 5cc478ca71..d459fe8c96 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs
@@ -47,6 +47,9 @@ namespace Godot
/// <summary>
/// Access quaternion components using their index.
/// </summary>
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="index"/> is not 0, 1, 2 or 3.
+ /// </exception>
/// <value>
/// <c>[0]</c> is equivalent to <see cref="x"/>,
/// <c>[1]</c> is equivalent to <see cref="y"/>,
@@ -314,7 +317,7 @@ namespace Godot
#if DEBUG
if (!IsNormalized())
{
- throw new InvalidOperationException("Quaternion is not normalized");
+ throw new InvalidOperationException("Quaternion is not normalized.");
}
#endif
var basis = new Basis(this);
@@ -330,7 +333,7 @@ namespace Godot
#if DEBUG
if (!IsNormalized())
{
- throw new InvalidOperationException("Quaternion is not normalized");
+ throw new InvalidOperationException("Quaternion is not normalized.");
}
#endif
return new Quaternion(-x, -y, -z, w);
@@ -374,11 +377,11 @@ namespace Godot
#if DEBUG
if (!IsNormalized())
{
- throw new InvalidOperationException("Quaternion is not normalized");
+ throw new InvalidOperationException("Quaternion is not normalized.");
}
if (!to.IsNormalized())
{
- throw new ArgumentException("Argument is not normalized", nameof(to));
+ throw new ArgumentException("Argument is not normalized.", nameof(to));
}
#endif
@@ -543,7 +546,7 @@ namespace Godot
#if DEBUG
if (!axis.IsNormalized())
{
- throw new ArgumentException("Argument is not normalized", nameof(axis));
+ throw new ArgumentException("Argument is not normalized.", nameof(axis));
}
#endif
@@ -599,7 +602,7 @@ namespace Godot
#if DEBUG
if (!quaternion.IsNormalized())
{
- throw new InvalidOperationException("Quaternion is not normalized");
+ throw new InvalidOperationException("Quaternion is not normalized.");
}
#endif
var u = new Vector3(quaternion.x, quaternion.y, quaternion.z);
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs
index 33b4f11f62..894667db76 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs
@@ -75,6 +75,9 @@ namespace Godot
/// The third column is the <see cref="origin"/> vector.
/// </summary>
/// <param name="column">Which column vector.</param>
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="column"/> is not 0, 1 or 2.
+ /// </exception>
public Vector2 this[int column]
{
get
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform3D.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform3D.cs
index 3c017ecc9f..2f7891e7ef 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform3D.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform3D.cs
@@ -32,6 +32,9 @@ namespace Godot
/// The fourth column is the <see cref="origin"/> vector.
/// </summary>
/// <param name="column">Which column vector.</param>
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="column"/> is not 0, 1, 2 or 3.
+ /// </exception>
public Vector3 this[int column]
{
get
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs
index b2964db8cd..87f397891e 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs
@@ -39,8 +39,8 @@ namespace Godot
/// <summary>
/// Access vector components using their index.
/// </summary>
- /// <exception cref="IndexOutOfRangeException">
- /// Thrown when the given the <paramref name="index"/> is not 0 or 1.
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="index"/> is not 0 or 1.
/// </exception>
/// <value>
/// <c>[0]</c> is equivalent to <see cref="x"/>,
@@ -502,7 +502,7 @@ namespace Godot
#if DEBUG
if (!normal.IsNormalized())
{
- throw new ArgumentException("Argument is not normalized", nameof(normal));
+ throw new ArgumentException("Argument is not normalized.", nameof(normal));
}
#endif
return (2 * Dot(normal) * normal) - this;
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs
index 666616edec..bdadf696e3 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs
@@ -39,8 +39,8 @@ namespace Godot
/// <summary>
/// Access vector components using their index.
/// </summary>
- /// <exception cref="IndexOutOfRangeException">
- /// Thrown when the given the <paramref name="index"/> is not 0 or 1.
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="index"/> is not 0 or 1.
/// </exception>
/// <value>
/// <c>[0]</c> is equivalent to <see cref="x"/>,
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs
index b53ca5e45a..6649f3b784 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs
@@ -48,8 +48,8 @@ namespace Godot
/// <summary>
/// Access vector components using their index.
/// </summary>
- /// <exception cref="IndexOutOfRangeException">
- /// Thrown when the given the <paramref name="index"/> is not 0, 1 or 2.
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="index"/> is not 0, 1 or 2.
/// </exception>
/// <value>
/// <c>[0]</c> is equivalent to <see cref="x"/>,
@@ -521,7 +521,7 @@ namespace Godot
#if DEBUG
if (!normal.IsNormalized())
{
- throw new ArgumentException("Argument is not normalized", nameof(normal));
+ throw new ArgumentException("Argument is not normalized.", nameof(normal));
}
#endif
return (2.0f * Dot(normal) * normal) - this;
@@ -539,7 +539,7 @@ namespace Godot
#if DEBUG
if (!axis.IsNormalized())
{
- throw new ArgumentException("Argument is not normalized", nameof(axis));
+ throw new ArgumentException("Argument is not normalized.", nameof(axis));
}
#endif
return new Basis(axis, angle) * this;
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3i.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3i.cs
index 2947ef94a7..e88a043cb3 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3i.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3i.cs
@@ -48,8 +48,8 @@ namespace Godot
/// <summary>
/// Access vector components using their <paramref name="index"/>.
/// </summary>
- /// <exception cref="IndexOutOfRangeException">
- /// Thrown when the given the <paramref name="index"/> is not 0, 1 or 2.
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="index"/> is not 0, 1 or 2.
/// </exception>
/// <value>
/// <c>[0]</c> is equivalent to <see cref="x"/>,
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4.cs
index b6f243dfb4..d1962c68cf 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4.cs
@@ -57,8 +57,8 @@ namespace Godot
/// <summary>
/// Access vector components using their index.
/// </summary>
- /// <exception cref="IndexOutOfRangeException">
- /// Thrown when the given the <paramref name="index"/> is not 0, 1, 2 or 3.
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="index"/> is not 0, 1, 2 or 3.
/// </exception>
/// <value>
/// <c>[0]</c> is equivalent to <see cref="x"/>,
@@ -81,7 +81,7 @@ namespace Godot
case 3:
return w;
default:
- throw new IndexOutOfRangeException();
+ throw new ArgumentOutOfRangeException(nameof(index));
}
}
set
@@ -101,7 +101,7 @@ namespace Godot
w = value;
return;
default:
- throw new IndexOutOfRangeException();
+ throw new ArgumentOutOfRangeException(nameof(index));
}
}
}
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4i.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4i.cs
index 73134b0baf..4b1bb3ba19 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4i.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4i.cs
@@ -57,8 +57,8 @@ namespace Godot
/// <summary>
/// Access vector components using their <paramref name="index"/>.
/// </summary>
- /// <exception cref="IndexOutOfRangeException">
- /// Thrown when the given the <paramref name="index"/> is not 0, 1, 2 or 3.
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// <paramref name="index"/> is not 0, 1, 2 or 3.
/// </exception>
/// <value>
/// <c>[0]</c> is equivalent to <see cref="x"/>,
@@ -81,7 +81,7 @@ namespace Godot
case 3:
return w;
default:
- throw new IndexOutOfRangeException();
+ throw new ArgumentOutOfRangeException(nameof(index));
}
}
set
@@ -101,7 +101,7 @@ namespace Godot
w = value;
return;
default:
- throw new IndexOutOfRangeException();
+ throw new ArgumentOutOfRangeException(nameof(index));
}
}
}
diff --git a/modules/mono/godotsharp_dirs.cpp b/modules/mono/godotsharp_dirs.cpp
index 71576c2f80..12960fb938 100644
--- a/modules/mono/godotsharp_dirs.cpp
+++ b/modules/mono/godotsharp_dirs.cpp
@@ -137,7 +137,7 @@ private:
api_assemblies_base_dir = res_data_dir.plus_file("assemblies");
-#ifdef JAVASCRIPT_ENABLED
+#ifdef WEB_ENABLED
mono_user_dir = "user://";
#else
mono_user_dir = _get_mono_user_dir();