@@ -25,6 +25,13 @@ export class PinPropertyParser implements CustomPropertyParser {
2525 "PinName" : ( p : PinProperty , value : string ) => { p . name = prettifyText ( BlueprintParserUtils . parseString ( value ) ) ; } ,
2626 "PinFriendlyName" : ( p : PinProperty , value : string ) => { p . friendlyName = prettifyText ( PinPropertyParser . parsePinFriendlyName ( value ) ) ; } ,
2727 "PinType.PinCategory" : ( p : PinProperty , value : string ) => { p . category = PinPropertyParser . parsePinCategory ( value ) ; } ,
28+ "PinType" : ( p : PinProperty , value : string ) => {
29+ // UserDefinedPin format: PinType=(PinCategory="bool")
30+ const categoryMatch = value . match ( / P i n C a t e g o r y = " ( [ ^ " ] + ) " / ) ;
31+ if ( categoryMatch ) {
32+ p . category = PinPropertyParser . parsePinCategory ( `"${ categoryMatch [ 1 ] } "` ) ;
33+ }
34+ } ,
2835 "Direction" : ( p : PinProperty , value : string ) => { p . direction = PinPropertyParser . parseDirection ( value ) ; } ,
2936 "DesiredPinDirection" : ( p : PinProperty , value : string ) => { p . direction = PinPropertyParser . parseDirection ( value ) ; } ,
3037 "PinToolTip" : ( p : PinProperty , value : string ) => { p . toolTip = BlueprintParserUtils . parseString ( value ) ; } ,
@@ -271,9 +278,11 @@ export class PinPropertyParser implements CustomPropertyParser {
271278 case PinCategory . bool :
272279 return { control : CheckBoxControl , data : ( BlueprintParserUtils . parseString ( value ) . toLowerCase ( ) === "true" ) } ;
273280 case PinCategory . struct :
274- return this . parseDefaultValueStruct ( p . subCategoryObject . class , value ) ;
281+ if ( p . subCategoryObject && p . subCategoryObject . class ) {
282+ return this . parseDefaultValueStruct ( p . subCategoryObject . class , value ) ;
283+ }
275284 case PinCategory . byte :
276- if ( p . subCategoryObject . type === "Enum" ) {
285+ if ( p . subCategoryObject && p . subCategoryObject . type === "Enum" ) {
277286 return { control : TextBoxControl , data : BlueprintParserUtils . parseEnumValue ( p . subCategoryObject . class , value ) } ;
278287 } else {
279288 return { control : TextBoxControl , data : BlueprintParserUtils . parseString ( value ) } ;
@@ -366,13 +375,15 @@ export class PinPropertyParser implements CustomPropertyParser {
366375 p . defaultValue = " " ;
367376 p . defaultValueControlClass = TextBoxControl ;
368377 case PinCategory . struct :
369- switch ( p . subCategoryObject . class ) {
370- case StructClass . VECTOR2D :
371- p . defaultValue = [
372- { key : 'X' , value : '0.0' } ,
373- { key : 'Y' , value : '0.0' } ] ;
374- p . defaultValueControlClass = StructBoxControl ;
375- break ;
378+ if ( p . subCategoryObject && p . subCategoryObject . class ) {
379+ switch ( p . subCategoryObject . class ) {
380+ case StructClass . VECTOR2D :
381+ p . defaultValue = [
382+ { key : 'X' , value : '0.0' } ,
383+ { key : 'Y' , value : '0.0' } ] ;
384+ p . defaultValueControlClass = StructBoxControl ;
385+ break ;
386+ }
376387 }
377388 break ;
378389 }
0 commit comments