From 2902cc22c42d36f578c3823a3a8bb9582cd6f00f Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 27 Aug 2017 12:37:53 +0200 Subject: [PATCH] edit: Print ship and land unit items with field width 5 print_items() uses field widths between 3 and 5. They go back all the way to Empire 1, and are fine for the stock game. Widen the narrower ones to 5, because a consistent field width looks tidier, and can avoid misaligned columns with customized ships and land units. Signed-off-by: Markus Armbruster --- src/lib/commands/edit.c | 32 ++++++++++++++++---------------- tests/actofgod/journal.log | 18 +++++++++--------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/lib/commands/edit.c b/src/lib/commands/edit.c index 6d60e753..33da32cb 100644 --- a/src/lib/commands/edit.c +++ b/src/lib/commands/edit.c @@ -267,22 +267,22 @@ print_plane(struct plnstr *plane) static void print_items(short item[]) { - pr("civ mil uw food shl gun pet irn dst oil lcm hcm rad\n"); - pr(" c m u f s g p i d o l h r\n"); - pr("%3d", item[I_CIVIL]); - pr("%4d", item[I_MILIT]); - pr("%4d", item[I_UW]); - pr("%5d", item[I_FOOD]); - pr("%4d", item[I_SHELL]); - pr("%4d", item[I_GUN]); - pr("%5d", item[I_PETROL]); - pr("%5d", item[I_IRON]); - pr("%5d", item[I_DUST]); - pr("%5d", item[I_OIL]); - pr("%5d", item[I_LCM]); - pr("%5d", item[I_HCM]); - pr("%4d", item[I_RAD]); - pr("\n"); + pr(" civ mil uw food sh gun pet iron dust oil lcm hcm rad\n" + " c m u f s g p i d o l h r\n" + "%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d\n", + item[I_CIVIL], + item[I_MILIT], + item[I_UW], + item[I_FOOD], + item[I_SHELL], + item[I_GUN], + item[I_PETROL], + item[I_IRON], + item[I_DUST], + item[I_OIL], + item[I_LCM], + item[I_HCM], + item[I_RAD]); } static void diff --git a/tests/actofgod/journal.log b/tests/actofgod/journal.log index 71afc3c5..270243f5 100644 --- a/tests/actofgod/journal.log +++ b/tests/actofgod/journal.log @@ -1487,9 +1487,9 @@ Play#0 output Play#0 1 Mobility : 0 Fleet : Play#0 output Play#0 1 Retreat path : '' Retreat Flags : 0 Play#0 output Play#0 1 Plague Stage : 0 Plague Time : 0 - Play#0 output Play#0 1 civ mil uw food shl gun pet irn dst oil lcm hcm rad - Play#0 output Play#0 1 c m u f s g p i d o l h r - Play#0 output Play#0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 + Play#0 output Play#0 1 civ mil uw food sh gun pet iron dust oil lcm hcm rad + Play#0 output Play#0 1 c m u f s g p i d o l h r + Play#0 output Play#0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 Play#0 output Play#0 4 %c xxxxx -- thing value : Play#0 input M 2 Play#0 output Play#0 1 Mobility of cs cargo ship (#0) changed from 0 to 2 @@ -1511,9 +1511,9 @@ Play#0 output Play#0 1 Mobility : 2 Fleet : Play#0 output Play#0 1 Retreat path : '' Retreat Flags : 0 Play#0 output Play#0 1 Plague Stage : 0 Plague Time : 0 - Play#0 output Play#0 1 civ mil uw food shl gun pet irn dst oil lcm hcm rad - Play#0 output Play#0 1 c m u f s g p i d o l h r - Play#0 output Play#0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 + Play#0 output Play#0 1 civ mil uw food sh gun pet iron dust oil lcm hcm rad + Play#0 output Play#0 1 c m u f s g p i d o l h r + Play#0 output Play#0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 Play#0 output Play#0 4 %c xxxxx -- thing value : Play#0 input R n Play#0 output Play#0 1 Retreat path of cs cargo ship (#0) changed from to n @@ -1552,9 +1552,9 @@ Play#0 output Play#0 1 Fortification : 0 Land unit : -1 Play#0 output Play#0 1 Ship : -1 Retreat percentage : 42 Play#0 output Play#0 1 Retreat path : '' Retreat Flags : 0 - Play#0 output Play#0 1 civ mil uw food shl gun pet irn dst oil lcm hcm rad - Play#0 output Play#0 1 c m u f s g p i d o l h r - Play#0 output Play#0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 + Play#0 output Play#0 1 civ mil uw food sh gun pet iron dust oil lcm hcm rad + Play#0 output Play#0 1 c m u f s g p i d o l h r + Play#0 output Play#0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 Play#0 output Play#0 4 %c xxxxx -- thing value : Play#0 input M 2 Play#0 output Play#0 1 Mobility of sup supply #0 changed from 0 to 2