(show_news): New.

(show): Use it to implement show news.
This commit is contained in:
Ron Koenderink 2006-01-29 17:44:29 +00:00
parent 297ee5eab0
commit 1bca66c061
4 changed files with 28 additions and 5 deletions

View file

@ -678,6 +678,7 @@ extern void show_sect_build(int);
extern void show_sect_stats(int); extern void show_sect_stats(int);
extern void show_sect_capab(int); extern void show_sect_capab(int);
extern void show_item(int); extern void show_item(int);
extern void show_news(int);
/* shpsub.c */ /* shpsub.c */
extern void shp_sel(struct nstr_item *, struct emp_qelem *); extern void shp_sel(struct nstr_item *, struct emp_qelem *);
extern void shp_nav(struct emp_qelem *, double *, double *, int *, natid); extern void shp_nav(struct emp_qelem *, double *, double *, int *, natid);

View file

@ -1,16 +1,16 @@
.TH Command SHOW .TH Command SHOW
.NA show "Characteristics of bridges, units, products or sectors" .NA show "Characteristics of bridges, units, products, news or sectors"
.LV Basic .LV Basic
.SY "show <land|nuke|plane|sector|ship> [b|s|c] [tech]" .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 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. given technology level.
.s1 .s1
The format of each output is more fully described in separate info The format of each output is more fully described in separate info
pages (Ship-types, Nuke-types, etc.). pages (Ship-types, Nuke-types, etc.).
.s1 .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 further parameter is required to indicate whether you wish information
about building (b), statistics (s) or capabilities (c) of the selected about building (b), statistics (s) or capabilities (c) of the selected
type. type.
@ -36,4 +36,4 @@ will give something like
3mt fusion 7 210 10 325 $19000 3mt fusion 7 210 10 325 $19000
.FI .FI
.s1 .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"

View file

@ -86,6 +86,10 @@ show(void)
show_item(99999); show_item(99999);
return RET_OK; return RET_OK;
case 'n': case 'n':
if (*(p + 1) == 'e') {
show_news(99999);
return RET_OK;
}
if (opt_DRNUKE) if (opt_DRNUKE)
tlev = ((rlev / drnuke_const) > tlev ? tlev : tlev = ((rlev / drnuke_const) > tlev ? tlev :
(rlev / drnuke_const)); (rlev / drnuke_const));

View file

@ -57,6 +57,7 @@
#include "nat.h" #include "nat.h"
#include "prototypes.h" #include "prototypes.h"
#include "nsc.h" #include "nsc.h"
#include "news.h"
struct look_list { struct look_list {
union { union {
@ -625,3 +626,20 @@ show_item(int tlev)
ip->i_melt_denom, ip->i_name); 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]);
}
}