From 181ceb5451ea5569886c7b04cbb81a0140d742d3 Mon Sep 17 00:00:00 2001 From: CallumDev Date: Tue, 25 Aug 2020 19:00:58 +0930 Subject: [PATCH] Fix substring issue --- src/CodeGenerator/ImguiDefinitions.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/CodeGenerator/ImguiDefinitions.cs b/src/CodeGenerator/ImguiDefinitions.cs index 3d4ac96..7e8e9e7 100644 --- a/src/CodeGenerator/ImguiDefinitions.cs +++ b/src/CodeGenerator/ImguiDefinitions.cs @@ -355,12 +355,13 @@ namespace CodeGenerator TemplateType = templateType; ArraySize = asize; int startBracket = name.IndexOf('['); - if (startBracket != -1 && ArraySize == 0) + if (startBracket != -1) { //This is only for older cimgui binding jsons int endBracket = name.IndexOf(']'); string sizePart = name.Substring(startBracket + 1, endBracket - startBracket - 1); - ArraySize = ParseSizeString(sizePart, enums); + if(ArraySize == 0) + ArraySize = ParseSizeString(sizePart, enums); Name = Name.Substring(0, startBracket); } IsFunctionPointer = Type.IndexOf('(') != -1; @@ -517,4 +518,4 @@ namespace CodeGenerator return new OverloadDefinition(ExportedName, FriendlyName, parameters, DefaultValues, ReturnType, StructName, Comment, IsConstructor, IsDestructor); } } -} \ No newline at end of file +}