--- cfmaps/cfmap2html 2005/11/20 01:05:34 1.10 +++ cfmaps/cfmap2html 2005/11/23 06:56:36 1.20 @@ -17,7 +17,7 @@ # 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.05'; +our $VERSION = '1.2'; use Storable; @@ -28,8 +28,6 @@ my $arch; -umask 022; - sub escape_html($) { local $_ = shift; s/([<>&])/sprintf "%d;", ord $1/ge; @@ -51,95 +49,90 @@ $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} || exists $_->{no_pick}, @$as;
+ push @class, "exit" if grep $is_exit{$arch->{$_->{_name}}{type}} && $_->{slaying}, @$as;
+ push @class, "dialog" if grep $_->{msg} =~ /^\@match/m, @$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 " ", + "