Freeciv21
Develop your civilization from humble roots to a global empire
helpdata.h
Go to the documentation of this file.
1 /*__ ___ ***************************************
2 / \ / \ Copyright (c) 1996-2020 Freeciv21 and Freeciv
3 \_ \ / __/ contributors. This file is part of Freeciv21.
4  _\ \ / /__ Freeciv21 is free software: you can redistribute it
5  \___ \____/ __/ and/or modify it under the terms of the GNU General
6  \_ _/ Public License as published by the Free Software
7  | @ @ \_ Foundation, either version 3 of the License,
8  | or (at your option) any later version.
9  _/ /\ You should have received a copy of the GNU
10  /o) (o/\ \_ General Public License along with Freeciv21.
11  \_____/ / If not, see https://www.gnu.org/licenses/.
12  \____/ ********************************************************/
13 #pragma once
14 
15 #include "fc_types.h"
16 
17 struct nation_set;
18 
19 // This must be in same order as names in helpdata.cpp
37  HELP_LAST
38 };
39 
40 // TRANS: "Overview" topic in built-in help
41 #define HELP_OVERVIEW_ITEM N_("?help:Overview")
42 #define HELP_PLAYING_ITEM N_("Strategy and Tactics")
43 #define HELP_LANGUAGES_ITEM N_("Languages")
44 #define HELP_CONNECTING_ITEM N_("Connecting")
45 #define HELP_CHATLINE_ITEM N_("Chatline")
46 #define HELP_WORKLIST_EDITOR_ITEM N_("Worklist Editor")
47 #define HELP_CMA_ITEM N_("Citizen Governor")
48 #define HELP_CONTROLS_ITEM N_("Controls")
49 #define HELP_RULESET_ITEM N_("About Current Ruleset")
50 #define HELP_TILESET_ITEM N_("About Current Tileset")
51 #define HELP_NATIONS_ITEM N_("About Nations")
52 #define HELP_ECONOMY_ITEM N_("Economy")
53 #define HELP_CITIES_ITEM N_("Cities")
54 #define HELP_IMPROVEMENTS_ITEM N_("City Improvements")
55 #define HELP_UNITS_ITEM N_("Units")
56 #define HELP_COMBAT_ITEM N_("Combat")
57 #define HELP_ZOC_ITEM N_("Zones of Control")
58 #define HELP_TECHS_ITEM N_("Technology")
59 #define HELP_EXTRAS_ITEM N_("Extras")
60 #define HELP_TERRAIN_ITEM N_("Terrain")
61 #define HELP_WONDERS_ITEM N_("Wonders of the World")
62 #define HELP_GOVERNMENT_ITEM N_("Government")
63 #define HELP_EFFECTS_ITEM N_("Effects")
64 #define HELP_DIPLOMACY_ITEM N_("Diplomacy")
65 #define HELP_SPACE_RACE_ITEM N_("Space Race")
66 #define HELP_COPYING_ITEM N_("Copying")
67 #define HELP_ABOUT_ITEM N_("About Freeciv21")
68 #define HELP_MULTIPLIER_ITEM N_("Policies")
69 
70 struct help_item {
71  char *topic, *text;
72  enum help_page_type type;
73 };
74 
75 void boot_help_texts(const nation_set *nations_to_show,
77 void free_help_texts();
78 
80 const struct help_item *
81 get_help_item_spec(const char *name, enum help_page_type htype, int *pos);
82 
83 char *helptext_building(char *buf, size_t bufsz, struct player *pplayer,
84  const char *user_text,
85  const struct impr_type *pimprove,
86  const nation_set *nations_to_show);
87 char *helptext_unit(char *buf, size_t bufsz, struct player *pplayer,
88  const char *user_text, const struct unit_type *utype,
89  const nation_set *nations_to_show);
90 void helptext_advance(char *buf, size_t bufsz, struct player *pplayer,
91  const char *user_text, int i,
92  const nation_set *nations_to_show);
93 void helptext_terrain(char *buf, size_t bufsz, struct player *pplayer,
94  const char *user_text, struct terrain *pterrain);
95 void helptext_extra(char *buf, size_t bufsz, struct player *pplayer,
96  const char *user_text, struct extra_type *pextra);
97 void helptext_goods(char *buf, size_t bufsz, struct player *pplayer,
98  const char *user_text, struct goods_type *pgood);
99 void helptext_specialist(char *buf, size_t bufsz, struct player *pplayer,
100  const char *user_text, struct specialist *pspec);
101 void helptext_government(char *buf, size_t bufsz, struct player *pplayer,
102  const char *user_text, struct government *gov);
103 void helptext_nation(char *buf, size_t bufsz, struct nation_type *pnation,
104  const char *user_text);
105 
106 char *helptext_unit_upkeep_str(const struct unit_type *punittype);
107 const char *helptext_road_bonus_str(const struct terrain *pterrain,
108  const struct road_type *proad);
109 const char *helptext_extra_for_terrain_str(struct extra_type *pextra,
110  struct terrain *pterrain,
111  enum unit_activity act);
char * helptext_unit_upkeep_str(const struct unit_type *punittype)
Returns pointer to static string with eg: "1 shield, 1 unhappy".
Definition: helpdata.cpp:4611
void helptext_advance(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, int i, const nation_set *nations_to_show)
Append misc dynamic text for advance/technology.
Definition: helpdata.cpp:2886
void helptext_government(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, struct government *gov)
Append text for government.
Definition: helpdata.cpp:3942
void helptext_extra(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, struct extra_type *pextra)
Append misc dynamic text for extras.
Definition: helpdata.cpp:3395
char * helptext_unit(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, const struct unit_type *utype, const nation_set *nations_to_show)
Append misc dynamic text for units.
Definition: helpdata.cpp:1639
const char * helptext_road_bonus_str(const struct terrain *pterrain, const struct road_type *proad)
Return a textual representation of the F/P/T bonus a road provides to a terrain if supplied,...
Definition: helpdata.cpp:3229
const struct help_item * get_help_item_spec(const char *name, enum help_page_type htype, int *pos)
The following few functions are essentially wrappers for the help_nodes help_list.
Definition: helpdata.cpp:1118
char * helptext_building(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, const struct impr_type *pimprove, const nation_set *nations_to_show)
FIXME: Also, in principle these could be auto-generated once, inserted into pitem->text,...
Definition: helpdata.cpp:1181
void helptext_goods(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, struct goods_type *pgood)
Append misc dynamic text for goods.
Definition: helpdata.cpp:3853
struct help_item * new_help_item(help_page_type type)
Allocate and initialize new help item.
Definition: helpdata.cpp:656
void free_help_texts()
Free all allocations associated with help_nodes.
Definition: helpdata.cpp:73
const char * helptext_extra_for_terrain_str(struct extra_type *pextra, struct terrain *pterrain, enum unit_activity act)
Return a brief description specific to the extra and terrain, when extra is built by cause 'act'.
Definition: helpdata.cpp:3361
void boot_help_texts(const nation_set *nations_to_show, help_item *tileset_help)
pplayer may be nullptr.
Definition: helpdata.cpp:682
void helptext_specialist(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, struct specialist *pspec)
Append misc dynamic text for specialists.
Definition: helpdata.cpp:3905
void helptext_terrain(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, struct terrain *pterrain)
Append text for terrain.
Definition: helpdata.cpp:3115
help_page_type
Definition: helpdata.h:20
@ HELP_ANY
Definition: helpdata.h:21
@ HELP_MULTIPLIER
Definition: helpdata.h:35
@ HELP_TERRAIN
Definition: helpdata.h:27
@ HELP_EXTRA
Definition: helpdata.h:28
@ HELP_NATIONS
Definition: helpdata.h:34
@ HELP_LAST
Definition: helpdata.h:37
@ HELP_IMPROVEMENT
Definition: helpdata.h:24
@ HELP_UNIT
Definition: helpdata.h:23
@ HELP_SPECIALIST
Definition: helpdata.h:30
@ HELP_GOVERNMENT
Definition: helpdata.h:31
@ HELP_EFFECT
Definition: helpdata.h:36
@ HELP_GOODS
Definition: helpdata.h:29
@ HELP_WONDER
Definition: helpdata.h:25
@ HELP_TECH
Definition: helpdata.h:26
@ HELP_RULESET
Definition: helpdata.h:32
@ HELP_TEXT
Definition: helpdata.h:22
@ HELP_TILESET
Definition: helpdata.h:33
void helptext_nation(char *buf, size_t bufsz, struct nation_type *pnation, const char *user_text)
Returns nation legend and characteristics.
Definition: helpdata.cpp:4653
const char * name
Definition: inputfile.cpp:118
char * topic
Definition: helpdata.h:71
enum help_page_type type
Definition: helpdata.h:72
char * text
Definition: helpdata.h:71
Functions for handling the nations.
Definition: nation.cpp:33
Definition: player.h:231
Definition: road.h:54
help_item * tileset_help(const struct tileset *t)
Creates the help item for the given tileset.
Definition: tilespec.cpp:3859