diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-04 13:33:25 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-04 13:33:25 +0100 |
commit | 63154299997fdf8b7d724c68d2f13c36fd18f099 (patch) | |
tree | ba758a4d2cf6e7008521f0f6484b7a98baa3fcb0 /modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample | |
parent | 1a7f694b40c5e99f5621646222cd075c0ddfbf84 (diff) | |
parent | 42233284b1824d3dd4070556a690c92f89e19ce2 (diff) | |
download | redot-engine-63154299997fdf8b7d724c68d2f13c36fd18f099.tar.gz |
Merge pull request #89007 from paulloz/dotnet/fix-interpolated-string-scriptpropertydefval
[.NET] Fix interpolated strings in ScriptPropertyDefVal
Diffstat (limited to 'modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample')
-rw-r--r-- | modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedComplexStrings.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedComplexStrings.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedComplexStrings.cs new file mode 100644 index 0000000000..907257b125 --- /dev/null +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedComplexStrings.cs @@ -0,0 +1,26 @@ +using Godot; + +namespace Godot.SourceGenerators.Sample +{ + public partial class ExportedComplexStrings : Node + { + [Export] + private string _fieldInterpolated1 = $"The quick brown fox jumps over ({Engine.GetVersionInfo()})"; + + [Export] + private string _fieldInterpolated2 = $"The quick brown fox jumps over ({Engine.GetVersionInfo()["major"],0:G}) the lazy dog."; + + [Export] + private string _fieldInterpolated3 = $"{((int)Engine.GetVersionInfo()["major"]) * -1 * -1:G} the lazy dog."; + + [Export] + private string _fieldInterpolated4 = $"{":::fff,,}<,<}},,}]"}"; + + [Export] + public string PropertyInterpolated1 + { + get; + private set; + } = $"The quick brown fox jumps over {GD.VarToStr($"the lazy {Engine.GetVersionInfo()} do")}g."; + } +} |