--- cfmaps/cfmap2html 2005/11/20 00:58:57 1.9 +++ cfmaps/cfmap2html 2005/11/20 08:24:45 1.15 @@ -17,6 +17,8 @@ # along with gvpe; if not, write to the Free Software # Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +our $VERSION = '1.2'; + use Storable; my $LIBDIR = $ENV{CROSSFIRE_LIBDIR} @@ -26,10 +28,6 @@ my $arch; -umask 022; - -our $VERSION = '1.04'; - sub escape_html($) { local $_ = shift; s/([<>&])/sprintf "%d;", ord $1/ge; @@ -51,95 +49,89 @@ $arch ||= Storable::retrieve "$LIBDIR/archetypes.pst"; my $meta = Storable::retrieve "$path.pst"; - open my $fh, ">:utf8", "$path.html" - or die "$path.html: $!"; + open my $fh, ">:utf8", "$path.xhtml" + or die "$path.xhtml: $!"; select $fh; my $W = $meta->{width} * $T; my $H = $meta->{height} * $T; + my $W2 = $W + 600; + my (@path) = split /\//, $path; - print "", - "", + print "", + "", + "", "
", "", + " | |||
",
"Crossfire Map ", - ""; + ""; print "/ "; for (0 .. $#path - 1) { print "$path[$_] / "; } + my @dir = qw(none up right down left); my @tile = map { $meta->{info}{"tile_path_$_"} - ? "" + ? "" : "" } 1..4; #"}"# vim misparses without this comment print "$path[-1]", "", - "", + "", " | ",
"$tile[0] | ||
$tile[3] | ", - "", + " | ", " | $tile[1] |
$tile[2] |
", + print "
", escape_html $meta->{info}{msg}, "
"; print "";
if (my $as = $meta->{map}[$x][$y]) {
- print " ($x|$y)";
+ my @class;
+
+ push @class, "fishy" if grep $_->{invisible} || $_->{face} || exists $_->{no_pass}, @$as;
+ push @class, "exit" if grep $is_exit{$arch->{$_->{_name}}{type}} && $_->{slaying}, @$as;
+
+ print " ";
+ print " | ";
+ } else {
+ print "";
+
+ print join "\n", map "$_",
+ reverse sort { (length $a) <=> (length $b) or $b <=> $a }
+ grep $_, map $_->{connected}, @$as;
+
+ print " ($x|$y)";
sub print_archs {
print " ";
+ print "
";
}
- print " | | ";
}
print "
created by cfmap2html version $VERSION
", - ""; + print " ", + "