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

Comparing cfmaps/cfmap2html (file contents):
Revision 1.5 by root, Fri Nov 18 12:04:12 2005 UTC vs.
Revision 1.6 by root, Fri Nov 18 12:34:13 2005 UTC

45 my (@path) = split /\//, $path; 45 my (@path) = split /\//, $path;
46 46
47 print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">", 47 print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">",
48 "<html>", 48 "<html>",
49 "<head>", 49 "<head>",
50 "<title>$path</title>", 50 "<title>Crossfire Map \"$path\"</title>",
51 "<style type='text/css'><!--\n", 51 "<style type='text/css'><!--\n",
52 "body { background: white; text-color: black; }\n", 52 "body { background: white; text-color: black; }\n",
53 "a { text-color: blue; }\n", 53 "a { text-color: blue; }\n",
54 "a:hover { text-color: red; }\n", 54 "a:hover { text-color: red; }\n",
55 "a:visited { text-color: #008; }\n", 55 "a:visited { text-color: #008; }\n",
75 "-->\n</style>", 75 "-->\n</style>",
76 "</head>", 76 "</head>",
77 "<body>"; 77 "<body>";
78 78
79 print "<table id='nav'>", 79 print "<table id='nav'>",
80 "<tr valign='center'><td rowspan='3' style='padding-right: 3em'><h1>"; 80 "<tr valign='center'><td rowspan='3' style='padding-right: 3em'>",
81 "Crossfire Map<br/>",
82 "<span style='font-size: 18pt'>";
81 print "<a href='/'>/</a> "; 83 print "<a href='/'>/</a> ";
82 for (0 .. $#path - 1) { 84 for (0 .. $#path - 1) {
83 print "<a href='/", (join "/", @path[0..$_]), "/'>$path[$_]</a> / "; 85 print "<a href='/", (join "/", @path[0..$_]), "/'>$path[$_]</a> / ";
84 } 86 }
85 87
89 : "" 91 : ""
90 } 1..4; 92 } 1..4;
91 #"}"# vim misparses without this comment 93 #"}"# vim misparses without this comment
92 94
93 print "$path[-1]", 95 print "$path[-1]",
94 "</h1>", 96 "</span>",
95 "<p style='font-size: 8pt;'><a href='/about.txt'>[more about cfmaps.schmorp.de]</a></p>", 97 "<p style='font-size: 8pt;'><a href='/about.txt'>[more about cfmaps.schmorp.de]</a></p>",
96 "</td>", 98 "</td>",
97 "<td/><td>$tile[0]</td><td/></tr>", 99 "<td/><td>$tile[0]</td><td/></tr>",
98 "<tr><td>$tile[3]</td>", 100 "<tr><td>$tile[3]</td>",
99 "<td><img id='thumb' src='@path[-1].jpg'/></td>", 101 "<td><img id='thumb' src='@path[-1].jpg'/></td>",
107 escape_html $meta->{info}{msg}, 109 escape_html $meta->{info}{msg},
108 "</p>"; 110 "</p>";
109 111
110 print "<table id='map'>"; 112 print "<table id='map'>";
111 113
112 my %ignore = map +($_ => 1), qw(_name x y); 114 my %ignore = map +($_ => 1), qw(name _name x y);
113 115
114 for my $y (0.. $meta->{height} - 1) { 116 for my $y (0.. $meta->{height} - 1) {
115 print "<tr>"; 117 print "<tr>";
116 for my $x (0.. $meta->{width} - 1) { 118 for my $x (0.. $meta->{width} - 1) {
117 print "<td>"; 119 print "<td>";
120 122
121 sub print_archs { 123 sub print_archs {
122 print "<ul>"; 124 print "<ul>";
123 for my $a (@{$_[0]}) { 125 for my $a (@{$_[0]}) {
124 my $o = $arch->{$a->{_name}}; 126 my $o = $arch->{$a->{_name}};
127 my $aname = escape_html $a->{_name};
128 my $name = escape_html $a->{name} || $o->{name};
125 print "<li><a href='/archetypes.html#", (lc $a->{_name}), "'>\"$o->{name}\" ($a->{_name})</a>\n"; 129 print "<li><a href='/archetypes.html#", (lc $a->{_name}), "'>$aname \"$name\"</a>\n";
126 for (sort keys %$a) { 130 for (sort keys %$a) {
127 next if $ignore{$_}; 131 next if $ignore{$_};
128 my $v = escape_html $a->{$_}; 132 my $v = escape_html $a->{$_};
129 133
130 if (($o->{type} == 66 || $o->{type} == 41) && $_ eq "slaying") { # door, teleporter 134 if (($o->{type} == 66 || $o->{type} == 41) && $_ eq "slaying") { # door, teleporter

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines