X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/81aefba6ac586eccbe18b4e90efc175e34fff5ad..61fa0d2d3c57ee17fb43cd8b6f8b5fabc4b69613:/sc.plp?ds=sidebyside diff --git a/sc.plp b/sc.plp index 0966fc4..3437f8f 100644 --- a/sc.plp +++ b/sc.plp @@ -9,7 +9,7 @@ my %scver = ( major => 1, ); -if ($ENV{PATH_INFO} and $ENV{PATH_INFO} eq '/2') { +if ($Request and $Request eq '2') { %scver = ( id => 'hots', name => 'Heart of the Swarm', @@ -40,19 +40,19 @@ Html({ data => [$datafile], }); -print "
Unit properties as seen or measured in $scver{name}\n$patch.\n"; -print "Also see the $_ table.\n" for join(', ', - ('StarCraft 2: HotS') x ($scver{major} < 2), - ('original SC: Brood War') x ($scver{major} > 1), +say "
Unit properties as seen or measured in $scver{name}\n$patch."; +say "Also see the $_ table." for join(', ', + (showlink('StarCraft 2: HotS', '/sc/2')) x ($scver{major} < 2), + (showlink('original SC: Brood War', '/sc')) x ($scver{major} > 1), ); -print "
\n\n"; +say "\n"; sub addupgrade { my ($ref, $increase, $org) = @_; @@ -85,11 +85,9 @@ for my $unit (@{$units}) { sub coltoggle { my ($name, $id, $nolink) = @_; - return sprintf( - (defined $get{order} ? $get{order} eq $id : !$id) ? '%2$s â¼' - : $nolink ? '%2$s' : '%s', - $id && "order=$id", $name - ); + return "$name â¼" if defined $get{order} ? $get{order} eq $id : !$id; + return $name if $nolink; + return showlink($name, '?'.($id && "order=$id")); } :>%s'."\n", + say sprintf ' | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
%s', $race = $_->{race}, ucfirst $race unless $race eq $_->{race}; } |