From 222c6dde53886b2bd7638250000d386682f31074 Mon Sep 17 00:00:00 2001 From: Toxic_Cookie <66691163+Toxic-Cookie@users.noreply.github.com> Date: Fri, 28 Jan 2022 22:36:40 -0800 Subject: [PATCH] Fixed bug with non-English locales and Blender not using BSDF sometimes. --- NeosBakery/Core/Bakery.cs | 27 +++++++++++++++------------ NeosBakery/Core/Defs.cs | 4 +--- NeosBakery/Properties/AssemblyInfo.cs | 4 ++-- NeosBakery/Python/bake.py | 6 ++++-- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/NeosBakery/Core/Bakery.cs b/NeosBakery/Core/Bakery.cs index 778db3b..e4d6732 100644 --- a/NeosBakery/Core/Bakery.cs +++ b/NeosBakery/Core/Bakery.cs @@ -17,7 +17,7 @@ class Bakery : NeosMod { public override string Name => "NeosBakery"; public override string Author => "Toxic_Cookie"; - public override string Version => "1.0.0"; + public override string Version => "1.0.2"; public override string Link => "https://github.com/Toxic-Cookie/NeosBakery"; public override void OnEngineInit() @@ -47,20 +47,23 @@ static void RectTransform_OnTargetChange(SyncRef reference) await Task.Delay(TimeSpan.FromSeconds(Engine.Current.WorldManager.FocusedWorld.Time.Delta + 0.01f)).ConfigureAwait(continueOnCapturedContext: false); await default(ToWorld); - foreach (Text text in reference.Target.Slot.GetComponentsInChildren()) + List texts = reference.Target.Slot.GetComponentsInChildren(); + + if (texts[0] == null) + { + return; + } + if (!texts[0].Content.Value.Contains("3D")) { - if (text.Content.Value.Contains("Empty")) - { - Slot buttonSlot = text.Slot.Parent.Duplicate(); - buttonSlot.GetComponentInChildren().Content.Value = "Light Baker Wizard"; - buttonSlot.GetComponent>().Destroy(); + return; + } - Button button = buttonSlot.GetComponent