]> git.pond.sub.org Git - empserver/commitdiff
edit: Print ship and land unit items with field width 5
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 27 Aug 2017 10:37:53 +0000 (12:37 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 5 Jan 2021 06:23:45 +0000 (07:23 +0100)
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 <armbru@pond.sub.org>
src/lib/commands/edit.c
tests/actofgod/journal.log

index 6d60e753ccc039c32071db10b39990802bb6b71b..33da32cb615c9ffe0691e2dcaed14aed3241ac13 100644 (file)
@@ -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
index 71afc3c5a05aad1aea4ea308e3744c6411e0b440..270243f5ea49d0bfc83c3bd6e1e38df4aff2ccb6 100644 (file)
     Play#0 output Play#0 1 Mobility <M>: 0             Fleet <F>:
     Play#0 output Play#0 1 Retreat path <R>: ''                Retreat Flags <W>: 0
     Play#0 output Play#0 1 Plague Stage <a>: 0         Plague Time <b>: 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
     Play#0 output Play#0 1 Mobility <M>: 2             Fleet <F>:
     Play#0 output Play#0 1 Retreat path <R>: ''                Retreat Flags <W>: 0
     Play#0 output Play#0 1 Plague Stage <a>: 0         Plague Time <b>: 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
     Play#0 output Play#0 1 Fortification <F>: 0        Land unit <Y>: -1
     Play#0 output Play#0 1 Ship <S>: -1                Retreat percentage <Z>: 42
     Play#0 output Play#0 1 Retreat path <R>: ''                Retreat Flags <W>: 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