]> git.pond.sub.org Git - empserver/commitdiff
(show_news): New.
authorRon Koenderink <rkoenderink@yahoo.ca>
Sun, 29 Jan 2006 17:44:29 +0000 (17:44 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Sun, 29 Jan 2006 17:44:29 +0000 (17:44 +0000)
(show): Use it to implement show news.

include/prototypes.h
info/show.t
src/lib/commands/show.c
src/lib/subs/show.c

index f93cdd70f2eeb63cf3abf81215652c794c794887..fefad9c647cf235becb7dc2af8d60ab5475cc829 100644 (file)
@@ -678,6 +678,7 @@ extern void show_sect_build(int);
 extern void show_sect_stats(int);
 extern void show_sect_capab(int);
 extern void show_item(int);
+extern void show_news(int);
 /* shpsub.c */
 extern void shp_sel(struct nstr_item *, struct emp_qelem *);
 extern void shp_nav(struct emp_qelem *, double *, double *, int *, natid);
index 369969b565f79fbe0996568ff47badc679ced0a0..a42061ad531fba6a5f7c5f0c2409e7073f5739cb 100644 (file)
@@ -1,16 +1,16 @@
 .TH Command SHOW
-.NA show "Characteristics of bridges, units, products or sectors"
+.NA show "Characteristics of bridges, units, products, news or sectors"
 .LV Basic
 .SY "show <land|nuke|plane|sector|ship> [b|s|c] [tech]"
-.SY "show <bridge|item|tower>"
+.SY "show <bridge|item|news|tower>"
 The show command describes the characteristics of bridge spans, bridge
-towers, planes, ships, land units, nukes, items and sectors for a
+towers, planes, ships, land units, nukes, items, news and sectors for a
 given technology level.
 .s1
 The format of each output is more fully described in separate info
 pages (Ship-types, Nuke-types, etc.).
 .s1
-Except for bridge (bridge span), items and tower (bridge tower), a
+Except for bridge (bridge span), items, news and tower (bridge tower), a
 further parameter is required to indicate whether you wish information
 about building (b), statistics (s) or capabilities (c) of the selected
 type.
@@ -36,4 +36,4 @@ will give something like
 3mt fusion       7 210  10  325 $19000
 .FI
 .s1
-.SA "Ship-types, Nuke-types, Plane-types, Unit-types, Sector-types, Ships, Planes, LandUnits, Products"
+.SA "Ship-types, Nuke-types, Plane-types, Unit-types, Sector-types, Ships, Planes, LandUnits, Products, newspaper"
index a643ba89da5fbd5f154669e029023477f2c4de94..5314847f179966d5d122759dc25d523c9c7ae32d 100644 (file)
@@ -86,6 +86,10 @@ show(void)
        show_item(99999);
        return RET_OK;
     case 'n':
+       if (*(p + 1) == 'e') {
+           show_news(99999);
+           return RET_OK;
+       }
        if (opt_DRNUKE)
            tlev = ((rlev / drnuke_const) > tlev ? tlev :
                    (rlev / drnuke_const));
index 84dd29bddfca1993959f486ec0b1cd7ce74fe73e..b69e61b2e3eb1c219ad43bb10f5263bfa27581d8 100644 (file)
@@ -57,6 +57,7 @@
 #include "nat.h"
 #include "prototypes.h"
 #include "nsc.h"
+#include "news.h"
 
 struct look_list {
     union {
@@ -625,3 +626,20 @@ show_item(int tlev)
           ip->i_melt_denom, ip->i_name);
     }
 }
+
+void
+show_news(int tlev)
+{
+    int i, j;
+    
+    pr("id category           good will\n");
+    pr("    messsages\n");
+
+    for (i = 1; i < N_MAX_VERB + 1; i++) {
+       pr("%-2d %-20.20s %4d\n", rpt[i].r_uid,
+           page_headings[rpt[i].r_newspage], rpt[i].r_good_will);
+
+       for (j = 0; j < NUM_RPTS; j++)
+           pr("    %s\n", rpt[i].r_newstory[j]);
+    }
+}