Skip to content

Commit dedad0d

Browse files
committed
Include stockPrefabs file
1 parent 707ea6f commit dedad0d

File tree

10 files changed

+18
-9
lines changed

10 files changed

+18
-9
lines changed

FanScript.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FanScript.Generators", "Fan
1313
EndProject
1414
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FanScript.Cli", "FanScript.Cli\FanScript.Cli.csproj", "{F6FD8705-1271-4792-AA60-E20546980D6F}"
1515
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FanScript.Midi", "FanScript.Midi\FanScript.Midi.csproj", "{9121436C-B9D9-4993-BB56-256B05C51BAA}"
16+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FanScript.Midi", "FanScript.Midi\FanScript.Midi.csproj", "{9121436C-B9D9-4993-BB56-256B05C51BAA}"
1717
EndProject
1818
Global
1919
GlobalSection(SolutionConfigurationPlatforms) = preSolution

FanScript/Compiler/Binding/BoundConstant.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using FanScript.Compiler.Symbols;
1+
using FanScript.Compiler.Exceptions;
2+
using FanScript.Compiler.Symbols;
23
using MathUtils.Vectors;
34

45
namespace FanScript.Compiler.Binding
@@ -39,7 +40,7 @@ object getDefault(TypeSymbol type)
3940
else if (type == TypeSymbol.Rotation)
4041
return new Rotation(Vector3F.Zero);
4142
else
42-
throw new InvalidDataException($"Unknown type: '{type}'");
43+
throw new UnexpectedSymbolException(type);
4344
}
4445
}
4546
}

FanScript/Compiler/Emit/BlockBuilders/GameFileBlockBuilder.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using FancadeLoaderLib;
22
using FancadeLoaderLib.Editing.Utils;
3+
using FancadeLoaderLib.Partial;
34
using MathUtils.Vectors;
45

56
/*
@@ -38,13 +39,13 @@ public override object Build(Vector3I startPos, params object[] args)
3839

3940
Block[] blocks = PreBuild(startPos, false);
4041

41-
PrefabList stockPrefabs;
42-
using (FcBinaryReader reader = new FcBinaryReader("baseBlocks.fcbl")) // fcbl - Fancade block list
43-
stockPrefabs = PrefabList.Load(reader);
42+
PartialPrefabList stockPrefabs;
43+
using (FcBinaryReader reader = new FcBinaryReader("stockPrefabs.fcppl")) // fcppl - Fancade partial prefab list
44+
stockPrefabs = PartialPrefabList.Load(reader);
4445

4546
Prefab prefab = game.Prefabs[prefabIndex];
4647

47-
Dictionary<ushort, PrefabGroup> groupCache = new Dictionary<ushort, PrefabGroup>();
48+
Dictionary<ushort, PartialPrefabGroup> groupCache = new();
4849

4950
for (int i = 0; i < blocks.Length; i++)
5051
{

FanScript/Compiler/Emit/Emitter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ private EmitStore emitBinaryExpression(BoundBinaryExpression expression)
630630
else if (expression.Type == TypeSymbol.Vector3 || expression.Type == TypeSymbol.Rotation)
631631
return emitBinaryExpression_VecOrRot(expression);
632632
else
633-
throw new InvalidDataException($"Unknown TypeSymbol '{expression.Type}'");
633+
throw new UnexpectedSymbolException(expression.Type);
634634
}
635635
private EmitStore emitBinaryExpression_FloatOrBool(BoundBinaryExpression expression)
636636
{

FanScript/Compiler/Modifiers.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using FanScript.Documentation.Attributes;
44
using System.Collections.Frozen;
55
using System.Collections.ObjectModel;
6+
using System.ComponentModel;
67
using System.Diagnostics.CodeAnalysis;
78
using System.Text;
89

@@ -171,7 +172,7 @@ public static Modifiers FromKind(SyntaxKind kind)
171172
SyntaxKind.GlobalModifier => Modifiers.Global,
172173
SyntaxKind.SavedModifier => Modifiers.Saved,
173174
SyntaxKind.InlineModifier => Modifiers.Inline,
174-
_ => throw new InvalidDataException($"SyntaxKind '{kind}' isn't a modifier"),
175+
_ => throw new InvalidEnumArgumentException(nameof(kind), (int)kind, typeof(SyntaxKind)),
175176
};
176177

177178
public static Modifiers Colaps(this IEnumerable<Modifiers> enumerable)

FanScript/FanScript.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,10 @@
4141
<ProjectReference Include="..\FanScript.Midi\FanScript.Midi.csproj" />
4242
</ItemGroup>
4343

44+
<ItemGroup>
45+
<None Update="stockPrefabs.fcppl">
46+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
47+
</None>
48+
</ItemGroup>
49+
4450
</Project>

FanScript/stockPrefabs.fcppl

5.69 KB
Binary file not shown.

FancadeLoaderLib.Editing.dll

1.5 KB
Binary file not shown.

FancadeLoaderLib.dll

8 KB
Binary file not shown.

MathUtils.dll

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)