diff --git a/src/ManiaTemplates/Lib/MtTransformer.cs b/src/ManiaTemplates/Lib/MtTransformer.cs index 812e9ab..26e326d 100644 --- a/src/ManiaTemplates/Lib/MtTransformer.cs +++ b/src/ManiaTemplates/Lib/MtTransformer.cs @@ -224,7 +224,10 @@ private string CreateSlotRenderMethod(MtComponent component, int scope, MtDataCo AppendSlotRenderArgumentsToList(methodArguments, parentComponent ?? component); //add component properties as arguments - AppendComponentPropertiesToMethodArgumentsList(parentComponent ?? component, methodArguments); + if (parentComponent != null) + { + AppendComponentPropertiesToMethodArgumentsList(parentComponent, methodArguments); + } var output = new StringBuilder(_maniaTemplateLanguage.FeatureBlockStart()) .AppendLine("void " + CreateMethodCall(methodName, string.Join(',', methodArguments), "") + " {"); diff --git a/tests/ManiaTemplates.Tests/Lib/expected.tt b/tests/ManiaTemplates.Tests/Lib/expected.tt index 0cfafe4..f49dc93 100644 --- a/tests/ManiaTemplates.Tests/Lib/expected.tt +++ b/tests/ManiaTemplates.Tests/Lib/expected.tt @@ -90,7 +90,7 @@ __insertedOneTimeManiaScripts.Add("FWKSFxnFcgdsXVn9dn5IW3isD6T8z+2eK6liK8rPSpU=" <#+ } -void Render_Slot_3_default(CRoot_ForEachLoop1 __data,Action __slotRenderer_default,int zIndex = 0,double x = 0.0,double y = 0.0,double w = 0.0,double h = 0.0) { +void Render_Slot_3_default(CRoot_ForEachLoop1 __data,Action __slotRenderer_default) { var numbers = __data.numbers; var enabled = __data.enabled; var __index = __data.__index; @@ -104,7 +104,7 @@ Render_Component_MtContext5(__data: __data, text: $"{(i)}, {(j)} at index {(__in __outerIndex7++; } } -void Render_Slot_8_default(CRoot __data,Action __slotRenderer_default,int zIndex = 0,double x = 0.0,double y = 0.0,double w = 0.0,double h = 0.0) { +void Render_Slot_8_default(CRoot __data,Action __slotRenderer_default) { var numbers = __data.numbers; var enabled = __data.enabled; #> @@ -115,7 +115,7 @@ Render_Component_MtContext6(__data: __data, arg3: (new test())); <#+ } -void Render_Slot_4_default(CRoot __data,Action __slotRenderer_default,int zIndex = 0,double x = 0.0,double y = 0.0,double w = 0.0,double h = 0.0) { +void Render_Slot_4_default(CRoot __data,Action __slotRenderer_default) { var numbers = __data.numbers; var enabled = __data.enabled; Render_Component_MtContext2(__data: __data, __slotRenderer_default: () => Render_Slot_8_default(__data: __data, __slotRenderer_default: () => DoNothing()));