… | |
… | |
263 | my ($a) = @_; |
263 | my ($a) = @_; |
264 | |
264 | |
265 | my $o = $ARCH{$a->{_name}} |
265 | my $o = $ARCH{$a->{_name}} |
266 | or return; |
266 | or return; |
267 | |
267 | |
268 | my $face = $FACE{$a->{face} || $o->{face}} |
268 | my $face = $FACE{$a->{face} || $o->{face} || "blank.111"} |
269 | or (warn "no face data found for arch '$a->{_name}'"), return; |
269 | or (warn "no face data found for arch '$a->{_name}'"), return; |
270 | |
270 | |
271 | if ($face->{w} > 1 || $face->{h} > 1) { |
271 | if ($face->{w} > 1 || $face->{h} > 1) { |
272 | # bigface |
272 | # bigface |
273 | return (0, 0, $face->{w} - 1, $face->{h} - 1); |
273 | return (0, 0, $face->{w} - 1, $face->{h} - 1); |
… | |
… | |
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 | for (@$attr) { |
355 | for (@$attr) { |
356 | my ($k, $v) = @$_; |
356 | my ($k, $v) = @$_; |
357 | push @attr_order, $k; |
357 | push @attr_order, $k; |
… | |
… | |
364 | map !exists $section{$_} ? () : do { |
364 | map !exists $section{$_} ? () : do { |
365 | my $attr = delete $section{$_}; |
365 | my $attr = delete $section{$_}; |
366 | |
366 | |
367 | [ |
367 | [ |
368 | $_, |
368 | $_, |
369 | map exists $attr->{$_} && !ignore{$_} ? [$_ => delete $attr->{$_}] : (), |
369 | map exists $attr->{$_} && !$ignore{$_} |
|
|
370 | ? [$_ => delete $attr->{$_}] : (), |
370 | @attr_order |
371 | @attr_order |
371 | ] |
372 | ] |
372 | }, |
373 | }, |
373 | |
374 | |
374 | exists $section{$_} ? [$_ => delete $section{$_}] : (), |
375 | exists $section{$_} ? [$_ => delete $section{$_}] : (), |
375 | @section_order |
376 | @section_order |
376 | ]; |
377 | ]; |
377 | |
|
|
378 | use PApp::Util; |
|
|
379 | warn PApp::Util::dumpval $attr; |
|
|
380 | |
378 | |
381 | $attr |
379 | $attr |
382 | } |
380 | } |
383 | |
381 | |
384 | sub arch_edit_sections { |
382 | sub arch_edit_sections { |