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.40 by root, Sun Mar 12 23:35:56 2006 UTC vs.
Revision 1.49 by root, Thu Mar 16 22:10:25 2006 UTC

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);
305 import 305 import
306 306
307=cut 307=cut
308 308
309sub arch_attr($) { 309sub arch_attr($) {
310 my ($arch) = @_; 310 my ($obj) = @_;
311 311
312 require Crossfire::Data; 312 require Crossfire::Data;
313 313
314 my $root; 314 my $root;
315 my $attr = { };
316
317 my $arch = $ARCH{ $obj->{_name} };
318 my $type = $obj->{type} || $arch->{type};
315 319
316 if ($arch->{type} > 0) { 320 if ($type > 0) {
317 $root = $Crossfire::Data::ATTR{$arch->{type}+0}; 321 $root = $Crossfire::Data::ATTR{$type};
318 } else { 322 } else {
319 $root = $Crossfire::Data::TYPE{Misc}; 323 $root = $Crossfire::Data::TYPE{Misc};
320 324
321 type: 325 type:
322 for (@Crossfire::Data::ATTR0) { 326 for (@Crossfire::Data::ATTR0) {
324 or die "internal error: ATTR0 without 'required'"; 328 or die "internal error: ATTR0 without 'required'";
325 329
326 keys %$req; 330 keys %$req;
327 while (my ($k, $v) = each %$req) { 331 while (my ($k, $v) = each %$req) {
328 next type 332 next type
329 unless $arch->{$k} == $v; 333 unless $obj->{$k} == $v || $arch->{$k} == $v;
330 } 334 }
331 335
332 $root = $_; 336 $root = $_;
333 } 337 }
334 } 338 }
335 339
336 my $attr = { }; 340 my @import = ($root);
337 341
338 my @import = (\%Crossfire::Data::DEFAULT_ATTR, $root); 342 unshift @import, \%Crossfire::Data::DEFAULT_ATTR
343 unless $type == 116;
344
339 my (%ignore); 345 my (%ignore);
340 my (@section_order, %section, @attr_order); 346 my (@section_order, %section, @attr_order);
341 347
342 while (my $type = shift @import) { 348 while (my $type = shift @import) {
343 push @import, @{$type->{import} || []}; 349 push @import, @{$type->{import} || []};
347 353
348 for (@{$type->{ignore} || []}) { 354 for (@{$type->{ignore} || []}) {
349 $ignore{$_}++ for ref $_ ? @$_ : $_; 355 $ignore{$_}++ for ref $_ ? @$_ : $_;
350 } 356 }
351 357
352 for ([general => ($type->{attr} || {})], @{$type->{section} || []}) { 358 for ([general => ($type->{attr} || [])], @{$type->{section} || []}) {
353 my ($name, $attr) = @$_; 359 my ($name, $attr) = @$_;
354 push @section_order, $name; 360 push @section_order, $name;
355 for (@$attr) { 361 for (@$attr) {
356 my ($k, $v) = @$_; 362 my ($k, $v) = @$_;
357 push @attr_order, $k; 363 push @attr_order, $k;
374 380
375 exists $section{$_} ? [$_ => delete $section{$_}] : (), 381 exists $section{$_} ? [$_ => delete $section{$_}] : (),
376 @section_order 382 @section_order
377 ]; 383 ];
378 384
379 use PApp::Util;
380 warn PApp::Util::dumpval $attr;
381
382 $attr 385 $attr
383} 386}
384 387
385sub arch_edit_sections { 388sub arch_edit_sections {
386# if (edit_type == IGUIConstants.TILE_EDIT_NONE) 389# if (edit_type == IGUIConstants.TILE_EDIT_NONE)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines