From bd65ae633d527c7362ae8c7211d6bde627a2a841 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Thu, 8 Jun 2023 21:18:49 +0200 Subject: [PATCH] C#: Add compat overloads --- .../mono/glue/GodotSharp/GodotSharp/Compat.cs | 129 ++++++++++++++++++ .../GodotSharp/GodotSharp/GodotSharp.csproj | 4 + .../GodotSharp/GodotSharpEditor/Compat.cs | 18 +++ .../GodotSharpEditor/GodotSharpEditor.csproj | 4 + 4 files changed, 155 insertions(+) create mode 100644 modules/mono/glue/GodotSharp/GodotSharp/Compat.cs create mode 100644 modules/mono/glue/GodotSharp/GodotSharpEditor/Compat.cs diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Compat.cs b/modules/mono/glue/GodotSharp/GodotSharp/Compat.cs new file mode 100644 index 0000000000..41cea031ab --- /dev/null +++ b/modules/mono/glue/GodotSharp/GodotSharp/Compat.cs @@ -0,0 +1,129 @@ +// This file contains methods that existed in a previous version of Godot in ClassDB but were removed +// or their method signature has changed so they are no longer generated by bindings_generator. +// These methods are provided to avoid breaking binary compatibility. + +using System; +using System.ComponentModel; + +namespace Godot; + +partial class AnimationNode +{ + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public double BlendInput(int inputIndex, double time, bool seek, bool isExternalSeeking, float blend, FilterAction filter, bool sync) + { + return BlendInput(inputIndex, time, seek, isExternalSeeking, blend, filter, sync, testOnly: false); + } + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public double BlendNode(StringName name, AnimationNode node, double time, bool seek, bool isExternalSeeking, float blend, FilterAction filter, bool sync) + { + return BlendNode(name, node, time, seek, isExternalSeeking, blend, filter, sync, testOnly: false); + } +} + +partial class CodeEdit +{ + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void AddCodeCompletionOption(CodeCompletionKind type, string displayText, string insertText, Nullable textColor, Resource icon, Nullable value) + { + AddCodeCompletionOption(type, displayText, insertText, textColor, icon, value, location: 1024); + } +} + +partial class Geometry3D +{ + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static Vector3[] SegmentIntersectsConvex(Vector3 from, Vector3 to, Godot.Collections.Array planes) + { + return SegmentIntersectsConvex(from, to, new Godot.Collections.Array(planes)); + } +} + +partial class MeshInstance3D +{ + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void CreateMultipleConvexCollisions() + { + CreateMultipleConvexCollisions(settings: null); + } +} + +partial class Node3D +{ + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void LookAt(Vector3 target, Nullable up) + { + LookAt(target, up, useModelFront: false); + } + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void LookAtFromPosition(Vector3 position, Vector3 target, Nullable up) + { + LookAtFromPosition(position, target, up, useModelFront: false); + } +} + +partial class RenderingDevice +{ + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public long DrawListBegin(Rid framebuffer, InitialAction initialColorAction, FinalAction finalColorAction, InitialAction initialDepthAction, FinalAction finalDepthAction, Color[] clearColorValues, float clearDepth, uint clearStencil, Nullable region, Godot.Collections.Array storageTextures) + { + return DrawListBegin(framebuffer, initialColorAction, finalColorAction, initialDepthAction, finalDepthAction, clearColorValues, clearDepth, clearStencil, region, new Godot.Collections.Array(storageTextures)); + } +} + +partial class RichTextLabel +{ + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void PushList(int level, ListType type, bool capitalize) + { + PushList(level, type, capitalize, bullet: "•"); + } + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void PushParagraph(HorizontalAlignment alignment, TextDirection baseDirection, string language, TextServer.StructuredTextParser stParser) + { + PushParagraph(alignment, baseDirection, language, stParser, TextServer.JustificationFlag.WordBound | TextServer.JustificationFlag.Kashida | TextServer.JustificationFlag.SkipLastLine | TextServer.JustificationFlag.DoNotSkipSingleLine); + } +} + +partial class SurfaceTool +{ + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void AddTriangleFan(Vector3[] vertices, Vector2[] uvs, Color[] colors, Vector2[] uv2S, Vector3[] normals, Godot.Collections.Array tangents) + { + AddTriangleFan(vertices, uvs, colors, uv2S, normals, new Godot.Collections.Array(tangents)); + } +} + +partial class Tree +{ + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool EditSelected() + { + return EditSelected(forceEdit: false); + } +} + +partial class UndoRedo +{ + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void CreateAction(string name, MergeMode mergeMode) + { + CreateAction(name, mergeMode, backwardUndoOps: false); + } +} diff --git a/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj b/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj index 56bc74c9dc..16820e363a 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj +++ b/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj @@ -135,6 +135,10 @@ + + + + + + +