Author: sveinung
Date: Mon Oct 24 13:53:35 2016
New Revision: 34238

URL: http://svn.gna.org/viewcvs/freeciv?rev=34238&view=rev
Log:
freeciv-manual: generate tech help.

It only includes the tech name and the help text (including the auto
generated parts) for now.

See patch #7863

Modified:
    trunk/tools/civmanual.c

Modified: trunk/tools/civmanual.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/civmanual.c?rev=34238&r1=34237&r2=34238&view=diff
==============================================================================
--- trunk/tools/civmanual.c     (original)
+++ trunk/tools/civmanual.c     Mon Oct 24 13:53:35 2016
@@ -79,6 +79,7 @@
   MANUAL_WONDERS,
   MANUAL_GOVS,
   MANUAL_UNITS,
+  MANUAL_TECHS,
   MANUAL_COUNT
 };
 
@@ -615,6 +616,29 @@
         fprintf(doc, SUBITEM_END);
         fprintf(doc, ITEM_END);
       } unit_type_iterate_end;
+      break;
+
+    case MANUAL_TECHS:
+      /* FIXME: this doesn't resemble the wiki manual at all. */
+      /* TRANS: markup ... Freeciv version ... ruleset name ... markup */
+      fprintf(doc, _("%sFreeciv %s tech help (%s)%s\n\n"),
+              TITLE_BEGIN, VERSION_STRING, game.control.name, TITLE_END);
+      advance_iterate(A_FIRST, ptech) {
+        if (valid_advance(ptech)) {
+          char buf[64000];
+
+          fprintf(doc, ITEM_BEGIN, "tech", ptech->item_number);
+          fprintf(doc, "%s%s%s\n\n", SECTION_TITLE_BEGIN,
+                  advance_name_translation(ptech), SECTION_TITLE_END);
+
+          fprintf(doc, SUBITEM_BEGIN, "helptext");
+          helptext_advance(buf, sizeof(buf), NULL, "", ptech->item_number);
+          fprintf(doc, "%s", buf);
+          fprintf(doc, SUBITEM_END);
+
+          fprintf(doc, ITEM_END);
+        }
+      } advance_iterate_end;
       break;
 
     case MANUAL_COUNT:


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to