155 string tabs =
MakeTabs( depth + 1 );
156 string child_path =
path;
160 bool name_printed =
false;
164 for ( i = 0; i < count; i++ )
166 string child_name =
"";
168 string c_child_path = child_path +
" " + child_name;
170 string child_name_lower = child_name;
173 if ( overridden.Find(child_name_lower) == -1 )
177 result.Insert(
":" +
MakeTabs(depth, check_base_class_of_class) +
"!" +
name );
180 overridden.Insert( child_name_lower );
184 if ( type != CT_CLASS )
186 if ( type != CT_ARRAY )
188 result.Insert(
"-" + tabs +
"!" + child_name +
" = " +
GetGame().ConfigGetTextOut(c_child_path) );
192 result.Insert(
"-" + tabs +
"!" + child_name +
"[] = {" );
196 string tabs_array =
MakeTabs( depth + 2 );
198 for ( j = 0; j < strs.Count(); j++ )
200 result.Insert(
"-" + tabs +
"!" + child_name +
"[]" + j.ToStringLen(6) +
"~" + strs.Get(j) +
"," );
203 result.Insert(
"-" + tabs +
"!" + child_name +
"[]" + j.ToStringLen(6) +
"~}" );
210 if (
GetGame().ConfigGetChildrenCount(c_child_path) > 0 )
213 result.InsertAll( config1 );
217 result.Insert(
":" + tabs +
"!" + child_name );
220 string cc_child_path = c_child_path;
221 string c_config_class_path = config_class_path;
222 string c_child_name = child_name;
228 string base_class =
"";
232 int start = c_config_class_path.
Length() + 1;
233 int len = cc_child_path.
Length();
234 len -= c_config_class_path.
Length() + c_child_name.
Length();
237 if ( base_class !=
"" )
239 string only_child_path =
"";
242 only_child_path = base_class;
246 only_child_path = cc_child_path.
Substring( start, len ) +
" " + base_class;
250 string base_class_path =
GetBaseClassPath( c_config_class_path, c_base_child_path, config_class );
252 if ( base_class_path !=
"" )
255 result.InsertAll( config2 );
260 result.InsertAll( config3 );
265 cc_child_path = base_class_path;
266 c_child_name = base_class;
267 c_config_class_path = cc_child_path.
Substring( 0, cc_child_path.
Length() - only_child_path.
Length() - 1);
280 result.Insert(
":" +
MakeTabs(depth, check_base_class_of_class) +
"#" +
name );
283 if ( !check_base_class_of_class )
288 if ( full_path.Count() > 1 )
290 TStringArray config4 =
GetConfigRecursive( config_class +
" " + full_path.Get(1), full_path.Get(1), config_class +
" " + full_path.Get(1), config_class, overridden, depth );
291 result.InsertAll( config4 );
296 string class_base_class =
"";
299 if ( class_base_class !=
"" )
302 string cc_base_child_path =
GetBaseClassPath( config_class_path, base_child_path, config_class );
304 if ( cc_base_child_path !=
"" )
307 result.InsertAll( config5 );
312 result.InsertAll( config6 );
325 if ( class_path !=
"" )
330 class_path.
Split(
" ", path_nodes );
332 if ( path_nodes.Count() >= 3 )
334 string c_class_path = path_nodes.Get(0) +
" " + path_nodes.Get(1) +
" " + path_nodes.Get(2);
337 string config_class = path_nodes.Get( 1 );
347 string tabs_inherited =
MakeTabs( 1,
true );
348 string check_tabs =
MakeTabs( path_nodes.Count() - 1,
true );
350 nested_start.Insert(
":!" );
351 nested_end.Insert(
":#" );
352 nested_inherited_start.Insert(
":!" );
353 nested_inherited_end.Insert(
":#" );
355 string last_node = filter_char +
MakeTabs( nested_start.Count() ) +
"!";
357 if ( path_nodes.Count() == 3 )
359 last_node = filter_char +
MakeTabs( 1 ) +
"!";
363 for ( i = 1; i < path_nodes.Count() - 2; i++ )
366 tabs_inherited =
MakeTabs( i,
true );
368 string path_node = path_nodes.Get(i+2);
371 nested_start.Insert(
":" + tabs +
"!" + path_node );
372 nested_end.Insert(
":" + tabs +
"#" + path_node );
373 nested_inherited_start.Insert(
":" + tabs_inherited +
"!" + path_node );
374 nested_inherited_end.Insert(
":" + tabs_inherited +
"#" + path_node );
377 last_node = filter_char +
MakeTabs( i ) +
"!";
380 int current_nest = 0;
382 for ( i = 0; i < result.Count(); i++ )
384 string current = result.Get( i );
385 string current_lower = current;
388 int len_current = current.
Length();
390 if ( current_nest < nested_start.Count() )
392 int len_start = nested_start.Get(current_nest).Length();
394 if ( len_current >= len_start )
396 string prefix_start = current_lower;
398 if ( current_nest == 0 )
400 prefix_start = current_lower.
Substring( 0, len_start );
403 if ( prefix_start == nested_start.Get(current_nest) || prefix_start == nested_inherited_start.Get(current_nest) )
411 if ( current_nest >= 1 )
413 int len_end = nested_end.Get(current_nest - 1).Length();
415 if ( len_current >= len_end )
417 string prefix_end = current_lower;
419 if ( current_nest == 0 )
421 prefix_start = current_lower.
Substring( 0, len_start );
424 if ( prefix_end == nested_end.Get(current_nest - 1) || prefix_end == nested_inherited_end.Get(current_nest - 1) )
431 if ( current_nest == nested_start.Count() )
433 string first_char = current.
Substring( 0, 1 );
435 if ( first_char == filter_char )
437 int bang_pos = current.
IndexOf(
"!" );
441 int len_last_node = last_node.
Length();
443 if ( len_current >= len_last_node )
445 string prefix_current = current_lower.
Substring( 0, len_last_node );
447 if ( last_node == prefix_current )
449 filtered.Insert( current.
Substring(bang_pos + 1, current.
Length() - (bang_pos + 1)) );
461 for ( i = 0; i < filtered.Count(); i++ )
463 string c = filtered.Get( i );
467 if ( without_duplications.Find(lower_c) < 0 )
469 without_duplications.Insert( lower_c );
473 lowered.Set( lower_c, c );
478 module_dev.SortStringArray( without_duplications );
480 for ( i = 0; i < without_duplications.Count(); i++ )
482 string cc = without_duplications.Get( i );
484 if ( lowered.Contains(cc) )
486 cc = lowered.
Get( cc );
489 int tilda_index = cc.
IndexOf(
"~" );
490 if ( tilda_index > -1 )
497 cc = spaces + cc.
Substring(tilda_index + 1, cc.
Length() - (tilda_index + 1) );
500 without_duplications.Set( i, cc );
503 return without_duplications;
505 else if ( filter_char ==
":" )
509 for ( i = 0; i < cnt_config; i++ )
511 string config_name =
"";
513 filtered.Insert( config_name );
516 module_dev.SortStringArray( filtered );
519 else if ( filter_char ==
":" )
521 filtered.Insert(
"configfile" );
522 filtered.Insert(
"missionconfigfile" );