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.18 by root, Wed Feb 22 22:41:22 2006 UTC vs.
Revision 1.22 by root, Thu Feb 23 01:55:54 2006 UTC

12 12
13use base 'Exporter'; 13use base 'Exporter';
14 14
15use Carp (); 15use Carp ();
16use Storable; 16use Storable;
17use File::Spec;
17use List::Util qw(min max); 18use List::Util qw(min max);
18 19
19#XXX: The map_* procedures scream for a map-object 20#XXX: The map_* procedures scream for a map-object
20 21
21our @EXPORT = 22our @EXPORT =
269sub init($) { 270sub init($) {
270 my ($cachedir) = @_; 271 my ($cachedir) = @_;
271 272
272 return if %ARCH; 273 return if %ARCH;
273 274
275 mkdir 0777, $cachedir;
274 *ARCH = read_arch "$LIB/archetypes", "$cachedir/archetypes.pst"; 276 *ARCH = read_arch "$LIB/archetypes", "$cachedir/archetypes.pst";
275} 277}
276 278
277=item $data = arch_attr $arch 279=item $type = arch_attr $arch
278 280
279Returns a hashref describing the object and its attributes. It can contain 281Returns a hashref describing the object and its attributes. It can contain
280the following keys: 282the following keys:
281 283
282 name the name, suitable for display purposes 284 name the name, suitable for display purposes
283 ignore 285 ignore
284 attr 286 attr
285 desc 287 desc
286 use 288 use
287 section => [name => \%attr, name => \%attr] 289 section => [name => \%attr, name => \%attr]
290 import
288 291
289=cut 292=cut
290 293
291sub arch_attr($) { 294sub arch_attr($) {
292 my ($arch) = @_; 295 my ($arch) = @_;
312 315
313 $attr = $_; 316 $attr = $_;
314 } 317 }
315 } 318 }
316 319
317 use PApp::Util; 320 $attr || \%Crossfire::Data::DEFAULT_ATTR;
318 warn PApp::Util::dumpval $attr;
319} 321}
320 322
321sub arch_edit_sections { 323sub arch_edit_sections {
322# if (edit_type == IGUIConstants.TILE_EDIT_NONE) 324# if (edit_type == IGUIConstants.TILE_EDIT_NONE)
323# edit_type = 0; 325# edit_type = 0;
377# return(edit_type); 379# return(edit_type);
378# 380#
379# 381#
380} 382}
381 383
382$CACHEDIR ||= "$ENV{HOME}/.crossfire"; 384$CACHEDIR ||= $ENV{HOME} ? "$ENV{HOME}/.crossfire" : File::Spec->tmpdir;
383 385
384init $CACHEDIR; 386init $CACHEDIR;
385 387
386=head1 AUTHOR 388=head1 AUTHOR
387 389

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines