@@ -113,10 +113,11 @@ class Module {
113113 return s .lines ;
114114 var out = [];
115115 for ( o in getSheetLines (sheets ,psheet ) ) {
116- var objs : Array <Dynamic > = Reflect .field (o , col );
117- if ( objs != null )
118- for ( o in objs )
119- out .push (o );
116+ var objs : Dynamic = Reflect .field (o , col );
117+ if (objs == null ) continue ;
118+ if (! Std .isOfType (objs , Array )) objs = [objs ];
119+ for (o in Std .downcast (objs , Array ))
120+ out .push (o );
120121 }
121122 return out ;
122123 }
@@ -156,9 +157,12 @@ class Module {
156157
157158 var typesCache = new Map <String ,String >();
158159 var hsheets = new Map ();
159- for ( s in data .sheets )
160+ for ( s in data .sheets ){
161+ if ( s .lines != null && s .lines .length == 0 )
162+ s .lines = getSheetLines ( data .sheets , s );
160163 hsheets .set (s .name , s );
161-
164+ }
165+
162166 var defineEnums = new Map <String ,String >();
163167
164168 function makeEnum ( c : Data . Column , tname : String , values : Array <String > ) {
@@ -613,7 +617,7 @@ class Module {
613617
614618 var assigns = [], fields = new Array <haxe.macro. Expr . Field >();
615619 for ( s in data .sheets ) {
616- if ( s .props .hide || s .props .dataFiles != null ) continue ;
620+ if ( /* s.props.hide || */ s .props .dataFiles != null ) continue ;
617621 var tname = makeTypeName (s .name );
618622 var t = tname .toComplex ();
619623 var fname = fieldName (s .name );
@@ -653,6 +657,11 @@ class Module {
653657 }
654658 public static function load ( content : String , allowReload = false ) {
655659 root = cdb. Parser .parse (content , false );
660+ for (s in root .sheets ) {
661+ @:privateAccess
662+ if ( s .lines != null && s .lines .length == 0 )
663+ s .lines = cdb. Module .getSheetLines ( root .sheets , s );
664+ }
656665 {$a {assigns }};
657666 }
658667 }).fields .concat (fields ),
0 commit comments