@@ -98,7 +98,7 @@ private void AddHairRow(WzImage image) {
98
98
99
99
private void AddGridRow ( DataGridView grid , object wzObject ) {
100
100
int id ;
101
- string properties = "" ;
101
+ string properties = BuildProperties ( wzObject ) ;
102
102
string name = null ;
103
103
WzCanvasProperty icon = null ;
104
104
@@ -144,7 +144,6 @@ private void AddGridRow(DataGridView grid, object wzObject) {
144
144
icon = ( WzCanvasProperty ) subProperty . GetFromPath ( "icon" ) ;
145
145
} else { // for breadcrumb like: 'category.img/{ID}/info/icon' (etc.wz)
146
146
string imgName = subProperty . Name ;
147
- properties = BuildProperties ( subProperty ) ;
148
147
id = int . Parse ( imgName ) ;
149
148
if ( ItemConstants . IsEtc ( id ) ) name = StringUtility . GetEtc ( id ) ;
150
149
else if ( ItemConstants . IsCash ( id ) ) name = StringUtility . GetCash ( id ) ;
@@ -170,23 +169,27 @@ private void AddGridRow(DataGridView grid, object wzObject) {
170
169
/// <param name="wzObject">a WzSubProperty or WzImage</param>
171
170
/// <returns></returns>
172
171
private string BuildProperties ( object wzObject ) {
173
- string properties = "" ;
174
172
WzImageProperty infoRoot = null ;
175
- if ( wzObject is WzSubProperty subProperty ) infoRoot = subProperty . GetFromPath ( "info" ) ;
173
+ if ( wzObject is WzSubProperty subProperty ) infoRoot = subProperty . GetFromPath ( "info" ) ?? subProperty . GetFromPath ( "level" ) ;
176
174
else if ( wzObject is WzImage wzImage ) infoRoot = wzImage . GetFromPath ( "info" ) ;
177
- if ( infoRoot ? . WzProperties != null ) {
178
- foreach ( WzImageProperty imgProperties in infoRoot . WzProperties ) {
179
- switch ( imgProperties . PropertyType ) {
180
- default :
181
- properties += $ "\r \n { imgProperties . Name } ={ imgProperties . WzValue } ";
182
- break ;
183
- case WzPropertyType . Canvas :
184
- case WzPropertyType . PNG :
185
- case WzPropertyType . Sound :
186
- break ;
187
- }
188
- }
189
175
176
+ return ExtractProperties ( infoRoot , "" ) ;
177
+ }
178
+
179
+ private string ExtractProperties ( WzImageProperty p , string prefix ) {
180
+ if ( p ? . WzProperties == null ) return "" ;
181
+ string properties = "" ;
182
+ foreach ( WzImageProperty imgProperties in p . WzProperties ) {
183
+ switch ( imgProperties . PropertyType ) {
184
+ default :
185
+ properties += $ "\r \n { prefix } { imgProperties . Name } ={ imgProperties . WzValue } ";
186
+ if ( imgProperties . PropertyType == WzPropertyType . SubProperty ) properties += ExtractProperties ( imgProperties , "\t " + prefix ) ;
187
+ break ;
188
+ case WzPropertyType . Canvas :
189
+ case WzPropertyType . PNG :
190
+ case WzPropertyType . Sound :
191
+ break ;
192
+ }
190
193
}
191
194
return properties ;
192
195
}
@@ -643,7 +646,7 @@ private void Tab_Selected(object sender, TabPage tab) {
643
646
break ;
644
647
}
645
648
case TabControl childTab : {
646
- DataViewer view = ( DataViewer ) childTab . SelectedTab . Controls [ 0 ] ;
649
+ DataViewer view = ( DataViewer ) childTab . SelectedTab . Controls [ 0 ] ;
647
650
GridIOUtility . ImportGrid ( $ "{ TabControlMain . SelectedTab . Text } /{ tab . Text } .bin", view . GridView ,
648
651
AddGridRow ) ;
649
652
break ;
0 commit comments