Skip to content

Commit

Permalink
More codegen edge case handling and support for older projects.
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Feb 22, 2024
1 parent 5a94d4e commit f711b5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions FRBDK/Glue/Glue/CodeGeneration/CustomVariableCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1418,12 +1418,14 @@ public static ICodeBlock AppendAssignmentForCustomVariableInInstance(NamedObject
rootElementForVariable = ObjectFinder.Self.GetElement(referencedNamedObject.SourceClassType);
rootVariable = customVariable.SourceObjectProperty;

customVariable = rootElementForVariable.GetCustomVariable(customVariable.SourceObjectProperty);
customVariable = rootElementForVariable.GetCustomVariable(customVariable.SourceObjectProperty)
// If one wasn't found, stick with this one:
?? customVariable;
}
else
{
var nosAti = referencedNamedObject?.GetAssetTypeInfo();
var nosAtiVariableDefinition = nosAti.VariableDefinitions?.FirstOrDefault(item => item.Name == customVariable.SourceObjectProperty);
var nosAtiVariableDefinition = nosAti?.VariableDefinitions?.FirstOrDefault(item => item.Name == customVariable.SourceObjectProperty);

if (nosAtiVariableDefinition?.CustomGenerationFunc != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public override ICodeBlock GenerateInitialize(ICodeBlock codeBlock, IElement ele

var rfs = GumPluginCodeGenerator.GetGumScreenRfs(element);

if (hasForms && rfs?.RuntimeType != "FlatRedBall.Gum.GumIdb")
if (hasForms && rfs?.RuntimeType != "FlatRedBall.Gum.GumIdb" && rfs?.RuntimeType != "Gum.Wireframe.GraphicalUiElement")
{
var rfsName = rfs.GetInstanceName();
var formsObjectType = FormsClassCodeGenerator.Self.GetFullRuntimeNamespaceFor(elementName, "Screens") +
Expand Down

0 comments on commit f711b5c

Please sign in to comment.