Fix substring issue

internals
CallumDev 4 years ago
parent b0b72b5a83
commit 181ceb5451
  1. 3
      src/CodeGenerator/ImguiDefinitions.cs

@ -355,11 +355,12 @@ 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);
if(ArraySize == 0)
ArraySize = ParseSizeString(sizePart, enums);
Name = Name.Substring(0, startBracket);
}

Loading…
Cancel
Save