diff --git a/GameData/ConformalDecals/Plugins/ConformalDecals.dll b/GameData/ConformalDecals/Plugins/ConformalDecals.dll index 9adb6fd..170c6b6 100644 Binary files a/GameData/ConformalDecals/Plugins/ConformalDecals.dll and b/GameData/ConformalDecals/Plugins/ConformalDecals.dll differ diff --git a/Source/ConformalDecals/DecalConfig.cs b/Source/ConformalDecals/DecalConfig.cs index 15fe1fb..81702d2 100644 --- a/Source/ConformalDecals/DecalConfig.cs +++ b/Source/ConformalDecals/DecalConfig.cs @@ -50,8 +50,6 @@ namespace ConformalDecals { public static IEnumerable Fonts => _fontList.Values; - public static DecalFont FallbackFont { get; private set; } - public static bool IsBlacklisted(Shader shader) { return IsBlacklisted(shader.name); } @@ -96,7 +94,7 @@ namespace ConformalDecals { foreach (var fontNode in node.GetNodes("FONT")) { try { - var font = new DecalFont(fontNode, allFonts); + var font = DecalFont.Parse(fontNode, allFonts); _fontList.Add(font.Name, font); } catch (Exception e) { diff --git a/Source/ConformalDecals/ModuleConformalFlag.cs b/Source/ConformalDecals/ModuleConformalFlag.cs index b52a83a..ecbefd4 100644 --- a/Source/ConformalDecals/ModuleConformalFlag.cs +++ b/Source/ConformalDecals/ModuleConformalFlag.cs @@ -83,7 +83,7 @@ namespace ConformalDecals { } protected override void UpdateTextures() { - _flagTextureProperty ??= materialProperties.AddOrGetTextureProperty("_Decal"); + _flagTextureProperty ??= materialProperties.AddOrGetTextureProperty("_Decal", true); base.UpdateTextures(); if (useCustomFlag) { diff --git a/Source/ConformalDecals/Text/DecalFont.cs b/Source/ConformalDecals/Text/DecalFont.cs index bf422ee..95d7179 100644 --- a/Source/ConformalDecals/Text/DecalFont.cs +++ b/Source/ConformalDecals/Text/DecalFont.cs @@ -46,21 +46,25 @@ namespace ConformalDecals.Text { public bool SmallCapsMask => (_fontStyleMask & FontStyles.SmallCaps) != 0; - public DecalFont(ConfigNode node, IEnumerable fontAssets) { + public static DecalFont Parse(ConfigNode node, IEnumerable fontAssets) { if (node == null) throw new ArgumentNullException(nameof(node)); if (fontAssets == null) throw new ArgumentNullException(nameof(fontAssets)); + var font = ScriptableObject.CreateInstance(); + var name = ParseUtil.ParseString(node, "name"); - _fontAsset = fontAssets.First(o => o.name == name); - if (FontAsset == null) { + var fontAsset = fontAssets.First(o => o.name == name); + if (fontAsset == null) { throw new FormatException($"Could not find font asset named {name}"); } - _title = ParseUtil.ParseString(node, "title", true, name); - _fontStyle = (FontStyles) ParseUtil.ParseInt(node, "style", true); - _fontStyleMask = (FontStyles) ParseUtil.ParseInt(node, "styleMask", true); - } + font._fontAsset = fontAsset; + font._title = ParseUtil.ParseString(node, "title", true, name); + font._fontStyle = (FontStyles) ParseUtil.ParseInt(node, "style", true); + font._fontStyleMask = (FontStyles) ParseUtil.ParseInt(node, "styleMask", true); + return font; + } public void SetupSample(TMP_Text tmp) { if (tmp == null) throw new ArgumentNullException(nameof(tmp));