Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,23 @@ static void TestResTypes()
ResWithTypes.Xtras.MyResCsv.Should().Be("res://TestScenes/Feature148.ResourceTree/Resources/xtras/MyRes.csv");

ResWithScenes.ResourceTreeTestsTscn.Should().BeOfType<PackedScene>().And.NotBeNull();

ResWithTypes.MyAnimationAnim.Should().BeOfType<Animation>().And.NotBeNull();
ResWithTypes.MyAtlasTextureAtlastex.Should().BeOfType<AtlasTexture>().And.NotBeNull();
ResWithTypes.MyFontFontdata.Should().BeOfType<Font>().And.NotBeNull();
ResWithTypes.MyJsonJson.Should().BeOfType<Json>().And.NotBeNull();
ResWithTypes.MyMaterialMaterial.Should().BeOfType<FogMaterial>().And.NotBeNull();
ResWithTypes.MyMeshMesh.Should().BeOfType<ArrayMesh>().And.NotBeNull();
ResWithTypes.MyMeshRes.Should().BeOfType<ArrayMesh>().And.NotBeNull();
ResWithTypes.MyMeshLibraryMeshlib.Should().BeOfType<MeshLibrary>().And.NotBeNull();
ResWithTypes.MyMultiMeshMultimesh.Should().BeOfType<MultiMesh>().And.NotBeNull();
ResWithTypes.MyOccluderOcc.Should().BeOfType<Occluder3D>().And.NotBeNull();
ResWithTypes.MyPhysicsMaterialPhymat.Should().BeOfType<PhysicsMaterial>().And.NotBeNull();
ResWithTypes.MyShaderGdshader.Should().BeOfType<Shader>().And.NotBeNull();
ResWithTypes.MyShapeShape.Should().BeOfType<Shape3D>().And.NotBeNull();
ResWithTypes.MyThemeTheme.Should().BeOfType<Theme>().And.NotBeNull();
// Meaningless type, can probably be ignored.
//ResWithTypes.MyTranslationTranslation.Should().BeOfType<Translation>().And.NotBeNull();
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
null
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shader_type spatial;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://7y4o7dwsdkev
Binary file not shown.
Binary file not shown.
Binary file not shown.
14 changes: 14 additions & 0 deletions SourceGenerators/ResourceTreeExtensions/ResourceTreeScraper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,21 @@ string TryGetType(string file, out string[] exports)
string TryGetTypeFromExtension() => Path.GetExtension(file) switch
{
".tres" => MiniTresScraper.GetType(compilation, file),
".res" => "Resource",
".tscn" or ".scn" => "PackedScene",
".mesh" => "Mesh",
".multimesh" => "MultiMesh",
".meshlib" => "MeshLibrary",
".material" => "Material",
".gdshader" => "Shader",
".atlastex" => "AtlasTexture",
".fontdata" => "Font",
".theme" => "Theme",
".anim" => "Animation",
".occ" => "Occluder3D",
".shape" => "Shape3D",
".phymat" => "PhysicsMaterial",
".json" => "JSON",
".uid" => cfg.Uid ? UID : null,
".cs" => "CSharpScript",
".gd" => "GDScript",
Expand Down