";
- print "/ ";
- for (0 .. $#path - 1) {
- print "$path[$_] / ";
- }
+for my $path (@ARGV) {
+ (my $base = $path) =~ s/\.map//;
+ if (!-e "$base.xhtml"
+ || -M "$base.xhtml" > -M "$base.pst") {
+
+ Crossfire::load_archetypes
+ unless %ARCH;
+
+ my $meta = Storable::retrieve "$base.pst";
+
+ open my $fh, ">:utf8", "$base.xhtml"
+ or die "$base.xhtml: $!";
+
+ select $fh;
+
+ my $W = $meta->{width} * $T;
+ my $H = $meta->{height} * $T;
+
+ my $W2 = $W + 600;
+
+ my (@path) = split /\//, $base;
+
+ print "",
+ '',
+ "",
+ "",
+ " |
",
+ "Crossfire Map ", + ""; + print "/ "; + for (0 .. $#path - 1) { + print "$path[$_] / "; + } - 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] |
", - escape_html $meta->{info}{msg}, - "
"; - - print "";
- if (my $as = $meta->{map}[$x][$y]) {
- print " ($x|$y)";
-
- sub print_archs {
- print "
| ",
+ "$tile[0] | ||
$tile[3] | ", + "", + " | $tile[1] | |
$tile[2] |
", + escape_html $meta->{info}{msg}, + "
"; + + print "";
+ 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_archs $as;
+ print "";
+ } else {
+ print ""; + } + } + print " |
created by cfmap2html version $VERSION
", - ""; + print "