ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra/Deliantra.pm
(Generate patch)

Comparing deliantra/Deliantra/Deliantra.pm (file contents):
Revision 1.37 by root, Sun Mar 12 23:21:53 2006 UTC vs.
Revision 1.43 by root, Mon Mar 13 03:30:37 2006 UTC

333 } 333 }
334 } 334 }
335 335
336 my $attr = { }; 336 my $attr = { };
337 337
338 my @import = $root || \%Crossfire::Data::DEFAULT_ATTR; 338 my @import = (\%Crossfire::Data::DEFAULT_ATTR, $root);
339 my (%ignore); 339 my (%ignore);
340 my (@section_order, %section, @attr_order); 340 my (@section_order, %section, @attr_order);
341 341
342 while (my $type = shift @import) { 342 while (my $type = shift @import) {
343 push @import, @{$type->{import} || []}; 343 push @import, @{$type->{import} || []};
347 347
348 for (@{$type->{ignore} || []}) { 348 for (@{$type->{ignore} || []}) {
349 $ignore{$_}++ for ref $_ ? @$_ : $_; 349 $ignore{$_}++ for ref $_ ? @$_ : $_;
350 } 350 }
351 351
352 for ([general => ($type->{attr} || {})], @{$type->{section} || []}) { 352 for ([general => ($type->{attr} || [])], @{$type->{section} || []}) {
353 my ($name, $attr) = @$_; 353 my ($name, $attr) = @$_;
354 push @section_order, $name; 354 push @section_order, $name;
355 warn "$name, $attr\n";#d#
355 for (@$attr) { 356 for (@$attr) {
356 my ($k, $v) = @$_; 357 my ($k, $v) = @$_;
357 push @attr_order, $k; 358 push @attr_order, $k;
358 $section{$name}{$k} ||= $v; 359 $section{$name}{$k} ||= $v;
359 } 360 }
364 map !exists $section{$_} ? () : do { 365 map !exists $section{$_} ? () : do {
365 my $attr = delete $section{$_}; 366 my $attr = delete $section{$_};
366 367
367 [ 368 [
368 $_, 369 $_,
369 map exists $attr->{$_} && !ignore{$_} ? [$_ => delete $attr->{$_}] : (), 370 map exists $attr->{$_} && !$ignore{$_}
371 ? [$_ => delete $attr->{$_}] : (),
370 @attr_order 372 @attr_order
371 ] 373 ]
372 }, 374 },
373 375
374 exists $section{$_} ? [$_ => delete $section{$_}] : (), 376 exists $section{$_} ? [$_ => delete $section{$_}] : (),
375 @section_order 377 @section_order
376 ]; 378 ];
377
378 use PApp::Util;
379 warn PApp::Util::dumpval $attr;
380 379
381 $attr 380 $attr
382} 381}
383 382
384sub arch_edit_sections { 383sub arch_edit_sections {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines