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

Comparing deliantra/gde/GCE/Util.pm (file contents):
Revision 1.13 by elmex, Sat Apr 1 18:45:05 2006 UTC vs.
Revision 1.17 by elmex, Tue Apr 4 11:29:54 2006 UTC

18use Crossfire; 18use Crossfire;
19use Crossfire::MapWidget; 19use Crossfire::MapWidget;
20use File::Spec::Functions; 20use File::Spec::Functions;
21use Cwd 'abs_path'; 21use Cwd 'abs_path';
22 22
23our @EXPORT = qw(insert_arch_stack_layer replace_arch_stack_layer new_arch_pb fill_pb_from_arch arch_is_floor stack_find_floor stack_find_wall stack_find arch_is_wall arch_is_monster add_table_widget quick_msg def arch_is_exit map2abs exit_paths); 23our @EXPORT = qw(insert_arch_stack_layer replace_arch_stack_layer new_arch_pb fill_pb_from_arch arch_is_floor stack_find_floor stack_find_wall stack_find arch_is_wall arch_is_monster add_table_widget quick_msg def arch_is_exit map2abs exit_paths pseudohtml2txt);
24
25sub pseudohtml2txt {
26 my ($html) = @_;
27
28 $html =~ s/<br\s*?\/?>/\n/gsi;
29 $html =~ s/<b>(.*?)<\/b>/_\1_/gsi;
30 $html =~ s/<li>/\n* /gi;
31 $html =~ s/<\/?\s*li>//gi;
32 $html =~ s/<\/?\s*ul>//gi;
33 $html =~ s/&gt;/>/g;
34 $html =~ s/&lt;/</g;
35 $html
36}
24 37
25sub exit_paths { 38sub exit_paths {
26 my ($mappath, $map1path, $map2path) = @_; 39 my ($mappath, $map1path, $map2path) = @_;
27 $mappath = abs_path $mappath; 40 $mappath = abs_path $mappath;
28 $map1path = abs_path $map1path; 41 $map1path = abs_path $map1path;
52} 65}
53 66
54sub map2abs { 67sub map2abs {
55 my ($dest, $mape) = @_; 68 my ($dest, $mape) = @_;
56 69
70 $mappath = abs_path $mappath;
57 my $dir; 71 my $dir;
58 if (File::Spec->file_name_is_absolute($dest)) { 72 if (File::Spec->file_name_is_absolute($dest)) {
59 $dir = catdir ($::CFG->{MAPDIR}, $dest); 73 $dir = catdir ($::CFG->{MAPDIR}, $dest);
60 } else { 74 } else {
61 my ($v, $p, $f) = File::Spec->splitpath ($mape->{path}); 75 my ($v, $p, $f) = File::Spec->splitpath ($mape->{path});

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines