From 1fcc0d8d5a8c54a917c862ffea4bd41a723360ad Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 13 Jun 2015 00:00:52 +0200 Subject: [PATCH] sc: indicate specials cost and availability --- sc.plp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sc.plp b/sc.plp index 0503a07..b14e04f 100644 --- a/sc.plp +++ b/sc.plp @@ -250,13 +250,15 @@ sub showrange { join('', $_->{name}, $_->{desc} ? ": $_->{desc}" : '', - $_->{range} ? sprintf(' (%s)', join ', ', - "range $_->{range}", -# sprintf('cost %.0f%%', 100 * $_->{cost} / $row->{energy}), + $_->{range} || $_->{cost} ? sprintf(' (%s)', join ', ', + $_->{range} ? "range $_->{range}" : (), + $_->{cost} ? sprintf('cost %.0f%%', + 100 * $_->{cost} / $row->{energy} + ) : (), ) : '', ), - $_->{abbr}, - } @$specials; + sprintf($_->{build} ? '(%s)' : '%s', $_->{abbr}), + } grep { defined $_->{abbr} } @{$specials}; } sub showunitcols { -- 2.30.0