]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
use title= too
authorRudolf Polzer <divverent@alientrap.org>
Thu, 1 Sep 2011 10:02:04 +0000 (12:02 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 1 Sep 2011 10:02:04 +0000 (12:02 +0200)
misc/tools/weapon-profiler-analyzer.pl

index a6838e9cbb85cf3ca22f2a4ccaae717debd3592d..3f3a4c7c64c1114dfc6b7cb46d00d15f0d15dd80 100755 (executable)
@@ -234,6 +234,20 @@ sub out_text($@)
        }
 }
 
+sub html($)
+{
+       my ($s) = @_;
+       $s =~ s/[^-_A-Za-z0-9 ]/&#@{[ord $&]};/g;
+       return $s;
+}
+
+sub nospace($)
+{
+       my ($s) = @_;
+       $s =~ s/ //g;
+       return $s;
+}
+
 sub out_html($@)
 {
        my ($event, @data) = @_;
@@ -249,13 +263,13 @@ sub out_html($@)
                $map ||= 'any';
                print "<h2>For server $addr type $type map $map</h2>\n";
                print "<table><tr><th>Weapon</th><th>Rating</th>\n";
-               printf '<th><img width=64 height=87 src="http://de.git.xonotic.org/?p=xonotic/xonotic.git;a=blob_plain;f=Docs/htmlfiles/weaponimg/%s_3rd_small.png" alt="%s"></th>', $stats->weaponid_to_model($_), $stats->weaponid_to_name($_) for @columns;
+               printf '<th><img width=64 height=87 src="http://de.git.xonotic.org/?p=xonotic/xonotic.git;a=blob_plain;f=Docs/htmlfiles/weaponimg/%s_3rd_small.png" title="%s" alt="%s"></th>', $stats->weaponid_to_model($_), html $stats->weaponid_to_name($_), html nospace $stats->weaponid_to_name($_) for @columns;
                print "</tr>\n";
        }
        elsif($event eq 'startrow')
        {
                my ($row, $val) = @data;
-               printf '<tr><th><img width=96 height=64 src="http://de.git.xonotic.org/?p=xonotic/xonotic.git;a=blob_plain;f=Docs/htmlfiles/weaponimg/%s_1st_small.png" alt="%s"></th><th align=right>%s</th>', $stats->weaponid_to_model($row), $stats->weaponid_to_name($row), defined $val ? sprintf("%8.5f", $val) : "N/A";
+               printf '<tr><th><img width=96 height=64 src="http://de.git.xonotic.org/?p=xonotic/xonotic.git;a=blob_plain;f=Docs/htmlfiles/weaponimg/%s_1st_small.png" title="%s" alt="%s"></th><th align=right>%s</th>', $stats->weaponid_to_model($row), html $stats->weaponid_to_name($row), html nospace $stats->weaponid_to_name($row), defined $val ? sprintf("%8.5f", $val) : "N/A";
        }
        elsif($event eq 'cell')
        {