ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cfmaps/cfmap2html
(Generate patch)

Comparing cfmaps/cfmap2html (file contents):
Revision 1.20 by root, Wed Nov 23 06:56:36 2005 UTC vs.
Revision 1.23 by root, Wed Feb 14 02:33:47 2007 UTC

1#!/opt/bin/perl 1#!/opt/bin/perl
2 2
3# cfmap2html - convert crossfire maps to html 3# cfmap2html - convert crossfire maps to html
4# Copyright (C) 2005 Marc Lehmann <gvpe@schmorp.de> 4# Copyright (C) 2005,2007 Marc Lehmann <cfmaps@schmorp.de>
5# 5#
6# CFMAP2HTML is free software; you can redistribute it and/or modify 6# CFMAP2HTML is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by 7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or 8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version. 9# (at your option) any later version.
15# 15#
16# You should have received a copy of the GNU General Public License 16# You should have received a copy of the GNU General Public License
17# along with gvpe; if not, write to the Free Software 17# along with gvpe; if not, write to the Free Software
18# Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18# Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
20our $VERSION = '1.2'; 20our $VERSION = '1.212';
21 21
22use Storable; 22use Storable;
23 23
24my $LIBDIR = $ENV{CROSSFIRE_LIBDIR} 24my $LIBDIR = $ENV{CROSSFIRE_LIBDIR}
25 or die "\$CROSSFIRE_LIBDIR must be set\n"; 25 or die "\$CROSSFIRE_LIBDIR must be set\n";
140 my $o = $arch->{$a->{_name}}; 140 my $o = $arch->{$a->{_name}};
141 my $type = $a->{type} || $o->{type}; 141 my $type = $a->{type} || $o->{type};
142 my $aname = escape_html $a->{_name}; 142 my $aname = escape_html $a->{_name};
143 my $name = escape_html $a->{name} || $o->{name}; 143 my $name = escape_html $a->{name} || $o->{name};
144 144
145 print "<li><a href='/arc.xhtml#", (lc $a->{_name}), "'>$aname \"$name\"</a>\n"; 145 print "<li><a href='/a/$a->{_name}'>$aname \"$name\"</a>\n";
146 for (sort keys %$a) { 146 for (sort keys %$a) {
147 next if $ignore{$_}; 147 next if $ignore{$_};
148 my $v = escape_html $a->{$_}; 148 my $v = escape_html $a->{$_};
149 149
150 if ($_ eq "slaying" && $is_exit{$type}) { # door, teleporter, player_changer 150 if ($_ eq "slaying" && $is_exit{$type}) { # door, teleporter, player_changer
151 $a->{msg} =~ /^final_map\s*(\S+)\s*$/m, $v = $1 151 $a->{msg} =~ /^final_map\s*(\S+)\s*$/m, $v = $1
152 if $v eq "/!"; # random map 152 if $v eq "/!"; # random map
153 153
154 print "slaying => <a href='$v.xhtml'>$v</a>\n"; 154 print "slaying => <a href='$v.xhtml'>$v</a>\n";
155 } elsif ($_ eq "other_arch") { 155 } elsif ($_ eq "other_arch") {
156 print "$_ => <a href='/arc.xhtml#", (lc $a->{$_}), "'>$v</a>\n"; 156 print "$_ => <a href='/a/$a->{$_}'>$v</a>\n";
157 } elsif ($_ eq "inventory") { 157 } elsif ($_ eq "inventory") {
158 print "inventory =>\n"; 158 print "inventory =>\n";
159 print_archs ($a->{$_}); 159 print_archs ($a->{$_});
160 } elsif ($_ eq "msg") { 160 } elsif ($_ eq "msg") {
161 print "<p class='m'>$v</p>"; 161 print "<p class='m'>$v</p>";
175 } 175 }
176 } 176 }
177 print "</tr>"; 177 print "</tr>";
178 } 178 }
179 179
180 print "</table><p class='footer'>created by <a href='http://software.schmorp.de/#crossfire'>cfmap2html</a> version $VERSION</p>", 180 print "</table><p class='footer'>created by <a href='http://software.schmorp.de/pkg/cfmaps'>cfmap2html</a> version $VERSION</p>",
181 "<p class='enlarge'/></body></html>"; 181 "<p class='enlarge'/></body></html>";
182 182
183 close $fh; 183 close $fh;
184 184
185 #system "gzip", "-7f", "$path.xhtml"; 185 #system "gzip", "-7f", "$path.xhtml";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines