sc: colourise negative supply values (providers)
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 22 Jun 2015 07:56:29 +0000 (09:56 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 22 Jun 2015 13:38:51 +0000 (15:38 +0200)
sc.css
sc.plp

diff --git a/sc.css b/sc.css
index 0f2bb88810599a3849293c92a08f55dbe0099b74..17aec8160b73c5ae906b39de2b92eb3214c56c8f 100644 (file)
--- a/sc.css
+++ b/sc.css
@@ -37,6 +37,9 @@ table h2 {
 .units td.unit + td.unit {
        padding-left: 0;
 }
 .units td.unit + td.unit {
        padding-left: 0;
 }
+.unit-supply {
+       color: #080;
+}
 .unit-o {color: #C08} /* organic */
 .unit-u {color: #44C} /* mechanic */
 .unit-p {color: #0A8} /* psionic */
 .unit-o {color: #C08} /* organic */
 .unit-u {color: #44C} /* mechanic */
 .unit-p {color: #0A8} /* psionic */
diff --git a/sc.plp b/sc.plp
index e1132b855564884470427bcdb21b7a1ad5ebf15c..09ae989cc26ea4b03dc1cf0bb9c62be3a07926a3 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -265,8 +265,9 @@ sub showrange {
                                $_->{attr}->{massive}
                                        && '<span class="unit-massive" title="massive">⚓</span>',
                        ),
                                $_->{attr}->{massive}
                                        && '<span class="unit-massive" title="massive">⚓</span>',
                        ),
-                       '<td class="val unit">' . (
-                               defined $_->{pop} && $_->{pop} == .5 ? '½' : $_->{pop}
+                       sprintf('<td class="val unit%s">%s',
+                               defined $_->{pop} && $_->{pop} < 0 && ' unit-supply',
+                               defined $_->{pop} && $_->{pop} == .5 ? '½' : $_->{pop},
                        ),
                        '<td class="unit unit-type">' . join('', grep { $_ }
                                (defined $_->{organic} ? !$_->{organic} : $_->{attr}->{mech})
                        ),
                        '<td class="unit unit-type">' . join('', grep { $_ }
                                (defined $_->{organic} ? !$_->{organic} : $_->{attr}->{mech})