1
0
mirror of https://git.zap.org.au/git/trader.git synced 2025-02-02 15:08:13 -05:00
Commit Graph

349 Commits

Author SHA1 Message Date
John Zaitseff
d0e1141355 utils.c: Rename the variable from "signed char c" to "int v" 2017-06-18 05:47:25 +10:00
John Zaitseff
6433c44dee Bug fix: if "char" is unsigned (as on some architectures), b64decode() fails 2017-06-15 11:40:24 +10:00
John Zaitseff
24ec66e00e Change "prints" to imperative "print" in a translator comment in help.c 2017-05-24 20:38:32 +10:00
John Zaitseff
e226e6e676 Tweak global game constants for more dynamic play 2017-05-24 07:10:17 +10:00
John Zaitseff
ecf1cfc983 Revise the comments for global game constants 2017-05-24 06:43:49 +10:00
John Zaitseff
e4d884afc9 Replace U+0060 GRAVE ACCENT with U+0027 APOSTROPHE
In the past, GNU tools used quotes `like this'.  Modern practice is to
use quotes 'like this'.  Update Star Traders to follow this newer
standard, including all PO files.
2017-05-20 09:55:20 +10:00
John Zaitseff
bb06d81534 Update ax_with_curses.m4 to latest version from the GNU Autoconf archive
This version changes CURSES_LIB to the plural CURSES_LIBS, and adds the
CURSES_CFLAGS variable.  It also uses pkg-config(1) if that is available.
2017-05-17 09:21:30 +10:00
John Zaitseff
e6493b4184 Fix an off-by-one bug in the macros GALAXY_MAP_RIGHT and GALAXY_MAP_DOWN
This bug has been present since commit e2dbe549b2
dated Sat Jul 16 13:34:13 2011 +1000: almost six years ago!
2017-05-17 09:12:52 +10:00
John Zaitseff
2f79514910 Update the copyright date to 2017 2017-05-14 06:29:44 +10:00
John Zaitseff
5edd10177c Ensure no label has to start with a new-line character 2016-04-16 07:39:51 +10:00
John Zaitseff
a486cd15aa Update the copyright year to 2016 2016-01-05 09:25:51 +11:00
John Zaitseff
09e1db13b0 Allow right-hand column labels in the Exchange window to be wider
In particular, these column labels may now be more than 18 characters
long.  This will only work if the left-hand side is not too wide.
2015-08-26 21:26:39 +10:00
John Zaitseff
f02dba9fad Change "Gemeni Inc" to "Gemini Inc"
This spelling mistake has been present from at least 1990!
2015-08-26 19:11:14 +10:00
John Zaitseff
bd11c1cd9d Update the copyright date to 2015 2015-08-18 08:19:56 +10:00
John Zaitseff
f16f78a509 Update the copyright date to 2015 2015-08-18 07:27:22 +10:00
John Zaitseff
bad1e27f8f Update a translator comment and regenerate the PO files 2014-10-03 09:17:05 +10:00
John Zaitseff
cbb6f58afb Minor change to the translator comment 2014-10-03 08:41:40 +10:00
John Zaitseff
a846f48904 Automatically select between left and right justification of the prompt 2014-10-03 08:38:21 +10:00
John Zaitseff
4ef0578792 Change minimum and maximum share return percentages to -15% and 25% 2014-08-13 11:32:27 +10:00
John Zaitseff
be276094ea Rearrange library includes to allow compilation under Cygwin 2014-06-18 20:56:09 +10:00
John Zaitseff
9cb3a46693 Completely rewrite the scramble() and unscramble() functions
The file output is now completely in ASCII---and will be much harder to
break for casual cheating!
2014-05-23 18:56:24 +10:00
John Zaitseff
3d20e0b307 Add the CRC32 functions from the GNU Portability Library 2014-05-22 18:17:02 +10:00
John Zaitseff
549b2d517d Use separate input and output buffers for scramble() and unscramble() 2014-05-22 15:34:32 +10:00
John Zaitseff
9450fed943 Update the copyright year to 2014 2014-05-22 11:05:51 +10:00
John Zaitseff
207be54145 Default keys are now set by a locale string, not by macros 2013-04-25 22:18:54 +10:00
John Zaitseff
c25ec91e99 Update the copyright year to 2013, and the version number to 7.5 2013-02-02 10:48:43 +11:00
John Zaitseff
674de34873 Adjust the Stock Exchange windows slightly by one line
The company listing is now one line shorter, and the menu of choices
window is one line longer.
2012-04-14 12:36:43 +10:00
John Zaitseff
48bf36b719 The author and maintainer (me!) is willing to help with formatting
Translating the help text is particularly challenging when taking into
account the necessity for correct whitespacing.  Clarify that the author
and maintainer (me!) is willing to help.
2012-04-14 12:19:52 +10:00
John Zaitseff
36cc55ee7f Add more comments regarding the column width of various labels 2012-03-31 10:57:29 +11:00
John Zaitseff
2a5bbc456c Fix an off-by-one error in load_game()
Obviously no one has tried to load a game with MAX_PLAYERS (8) before!
2012-03-29 20:05:51 +11:00
John Zaitseff
71e1cd593e Clarify that help page count is fixed for any given language
The number of pages used by the help text is fixed for any given
language.  Different languages, depending on the actual translation, may
use differing number of pages.
2012-03-29 07:39:53 +11:00
John Zaitseff
5ac3b3787a Update translator comments for company names
Company names should be, ideally, related to constellations and stars in
our galaxy.
2012-03-28 11:45:17 +11:00
John Zaitseff
35abce5052 Revise the game algorithms extensively
In summary: share returns can now be negative, decreasing a player's
income; the bank interest rate now has a minimum; algorithms for changing
share price, share return and bank interest rate are much "smoother" (as
modelled with Gnuplot!); many minimum, maximum and typical values have
been revised.
2012-03-27 10:13:57 +11:00
John Zaitseff
c1c580c133 Add a new-line to the end of empty help text strings
This allows translators to do the same: msgmerge(1) complains if the
translated string ends in "\n" where the original string does not (and
vice versa).
2012-03-25 19:19:02 +11:00
John Zaitseff
e4c2fa9423 Document the difference between "turn" and "move" for translators 2012-03-22 22:11:01 +11:00
John Zaitseff
adde1ed5d1 Simplify a number of translator's comments 2012-03-16 10:13:53 +11:00
John Zaitseff
b44e032953 Add translation comments explaining a number of strings
In particular, bankruptcy affects both players and companies, and the
strings may need to be translated differently.  Also update PO files
appropriately.
2012-03-15 09:09:12 +11:00
John Zaitseff
bc3e1a06a1 Update the copyright year to 2012 2012-03-15 02:36:23 +11:00
John Zaitseff
8bbee054ad Change the handling of default value keycodes to be configurable 2011-08-30 12:45:45 +10:00
John Zaitseff
74aa3e84df Fix a couple of display bugs
Firstly, Ncurses addchstr() and family do not work, it seems, with
multibyte strings, so use addch() instead.  Secondly, PRINTABLE_MAP_VAL
returns a wchar_t wide character, not a byte-sized char.
2011-08-30 09:15:15 +10:00
John Zaitseff
4ca99815b8 Be a little more diligent when it comes to wchar_t vs. wint_t
The %lc format is actually of type wint_t, according to printf(3), not
wchar_t, even though these are of the same underlying type on most (all?)
platforms.
2011-08-29 14:13:29 +10:00
John Zaitseff
752eed74c5 Cosmetic change: replace one space with one tab 2011-08-29 10:40:31 +10:00
John Zaitseff
e3733d8921 Define _XOPEN_SOURCE_EXTENDED, required by old versions of NcursesW
The macro _XOPEN_SOURCE_EXTENDED is required by some old versions of
NcursesW for wide-character function definitions.
2011-08-29 10:38:55 +10:00
John Zaitseff
82ca16e110 Bug fix: wchar_t may be smaller than int
On some platforms (eg, Cygwin), wchar_t is smaller than int, so type
promotion requires an appropriate cast for va_arg.
2011-08-29 10:34:27 +10:00
John Zaitseff
1f3be16193 The "%lc" directive requires a wint_t type, not wchar_t
This is essentially only to keep GCC quiet.
2011-08-29 09:34:29 +10:00
John Zaitseff
dffb4c59fe Implement the single-byte equivalent of getwch()
This implementation assembles a wide character from a stream of
multibyte-forming bytes.
2011-08-26 04:51:44 +10:00
John Zaitseff
4c99f9a57f More (slight) code clean-ups 2011-08-26 03:22:25 +10:00
John Zaitseff
cb67513bb9 Correct a minor bug in cursor decrement (cpos_dec) 2011-08-25 22:15:12 +10:00
John Zaitseff
dfab785ba7 Add a couple more places where the character constant is a wide char 2011-08-25 21:55:10 +10:00
John Zaitseff
167bcd82f5 Remove the unused header file <ctype.h> 2011-08-25 21:45:22 +10:00
John Zaitseff
1c2518a78b Minor clean-up: replace character constants with wide-char versions
Wide-char character constants is not strictly needed for most (all?)
modern C compilers, as ASCII maps to wchar_t directly (as long as
__STDC_ISO_10646__ is defined).  However, it doesn't hurt to be pedantic!
2011-08-25 21:34:41 +10:00
John Zaitseff
61411e3416 Rearrange the order of constants, type declarations and macros 2011-08-25 14:49:51 +10:00
John Zaitseff
10815a2803 Move some global variables to intf.c and intf.h
Move the keycode_company, printable_map_val, chtype_map_val,
keycode_game_move, printable_game_move and chtype_game_move global
variables to intf.c and intf.h.
2011-08-25 14:48:31 +10:00
John Zaitseff
4733e98e7f Change program_name() to be a global variable
We're using global variables all over the place, in any case...
2011-08-25 14:26:25 +10:00
John Zaitseff
485a867b99 Remove superfluous #include directives 2011-08-25 14:09:48 +10:00
John Zaitseff
20473ae409 Use wide-character functions for input routines and most strings
Convert all input routines, and most internal strings, to use
wide-character functions.  All extended characters are supported,
including those having column widths of zero (eg, combining characters),
one (eg, normal Western characters) and two (eg, many East Asian
characters).  This was quite a major undertaking!
2011-08-25 13:19:31 +10:00
John Zaitseff
b951b21894 Add global (wide-character) currency and numeric variables
Add the variables decimal_point, thousands_sep, currency_symbol,
mon_decimal_point and mon_thousands_sep, with code to initialise them.
2011-08-25 12:26:15 +10:00
John Zaitseff
150bcf10c2 Try loading UTF-8 strings with transliteration, if at all possible
Also fix a bug in save_game(): the iconv_open() parameters were the wrong
way around!
2011-08-20 16:27:11 +10:00
John Zaitseff
cf944c58f6 Minor fix: we don't use mbrtowc() in our program 2011-08-20 15:49:19 +10:00
John Zaitseff
a4cc805a65 Use wchar_t in answer_yesno()
Calls to wgetch(win) do not use wchar_t for the moment.
2011-08-20 15:38:26 +10:00
John Zaitseff
4b8d2529a8 Replace '0' with L'0', just in case 2011-08-20 15:27:22 +10:00
John Zaitseff
0a8e05f4d4 Rearrange the order of the internal mkchstr_XXX functions 2011-08-20 15:24:27 +10:00
John Zaitseff
b5b211313e Move chstrdup() to utils.c and rename it to xchstrdup()
The new name is for consistency with other XXXdup() functions used in
this program.
2011-08-20 15:17:09 +10:00
John Zaitseff
bc8dc76f00 Minor white-space formatting change: indent by 8 characters, not 7 2011-08-20 13:34:28 +10:00
John Zaitseff
c90265ec28 Replace "---" with "--": it looks better in text mode 2011-08-20 13:30:31 +10:00
John Zaitseff
4d145813ff Make the show_help() function multibyte-aware
All text in the show_help() function is now processed as wide characters.
2011-08-20 13:27:26 +10:00
John Zaitseff
7b544bbd35 Add the functions xwcrtomb() and xmbstowcs()
The xwcrtomb() and xmbstowcs() functions replace illegal characters with
EILSEQ_REPL ('?').  Adjust other functions, particularly mkchstr() and
friends, to suit.
2011-08-20 13:03:40 +10:00
John Zaitseff
336611559b Add the error-checking function xwcsdup() 2011-08-20 10:40:07 +10:00
John Zaitseff
02fd017807 Make the errno_exit() string a little more regular
This is to match all other such strings in the program.
2011-08-19 17:34:41 +10:00
John Zaitseff
a49c50b4fd Allow mkchstr_conv error strings to be localised 2011-08-19 17:24:28 +10:00
John Zaitseff
6fb62460ca Add some asserts to newtxwin(), just to be on the safe side 2011-08-19 17:20:41 +10:00
John Zaitseff
aeaf08a8a4 Possible bug fix: test for "C" locale when return string is opaque
On some systems the return string from setlocale() may be opaque, so we
need to explicitly set the locale to "C", then test the return value from
that.
2011-08-19 17:14:00 +10:00
John Zaitseff
8a7dfcaf99 Handle multibyte characters correctly in mkchstr()
Internal processing is now done in terms of wide characters (type
wchar_t).
2011-08-19 16:52:27 +10:00
John Zaitseff
3a6f33d2a1 Update some minor comments about character encodings 2011-08-18 15:05:55 +10:00
John Zaitseff
4d6f1478e6 Remove the superfluous argument to chstrdup()
This argument is not required: we KNOW that we have initialised chtype
arrays with an ending NUL!
2011-08-18 14:53:03 +10:00
John Zaitseff
ef3e06ed36 Add the wchar and wctype-h modules from the GNU Portability Library 2011-08-18 12:53:23 +10:00
John Zaitseff
6ef7c7b6da Allow localisation of company letters and map moves (choices) 2011-08-18 12:10:33 +10:00
John Zaitseff
a024ad83e7 Update help text company letter; clarify tilde escapes in general 2011-08-18 09:10:38 +10:00
John Zaitseff
e87c6ce9b3 Allow input keycodes in ask_number_players() to be localised 2011-08-17 22:27:51 +10:00
John Zaitseff
75503ab103 Parameterise answer_yesno() so that the input keycodes can be localised 2011-08-17 22:07:31 +10:00
John Zaitseff
1c4cac2ba1 Add a detailed explanation of the help text markup format 2011-08-17 21:41:38 +10:00
John Zaitseff
c2a3c5ac8f Require Gettext 0.18.1; regularise usage of Ncurses; update version 2011-08-17 19:48:39 +10:00
John Zaitseff
b674c05d56 Add many comments for translators; use pgettext() where appropriate 2011-08-17 19:13:05 +10:00
John Zaitseff
25d586f775 Add some translator comments regarding company names and ordinals 2011-08-17 13:26:55 +10:00
John Zaitseff
5f5c512e45 Highlight the word "one" 2011-08-17 13:26:11 +10:00
John Zaitseff
197de2804f Add calls to ngettext() where appropriate 2011-08-17 13:18:41 +10:00
John Zaitseff
9b11599354 Add some translator comments with the correct pronunciation of my name 2011-08-17 12:21:18 +10:00
John Zaitseff
d953154e5d Mark up strings with xgettext:c-format comments where appropriate 2011-08-17 10:04:57 +10:00
John Zaitseff
0aa74d1f46 Add a space to the "Player %d: " string for consistency 2011-08-16 21:14:56 +10:00
John Zaitseff
6c1c272780 Place all output strings within gettext invocations 2011-08-16 21:03:41 +10:00
John Zaitseff
bf76fa312c Assume MOD_POSIX_CURRENCY_SYMBOL contains only ASCII characters
The GNU library now has "C.UTF-8" as a locale (which is NOT a single-byte
locale!), but we assume the currency symbol in MOD_POSIX_CURRENCY_SYMBOL
contains only ASCII characters.
2011-08-16 20:55:42 +10:00
John Zaitseff
d20cc2b5ec Use chstr-style output functions in gettxline() 2011-08-16 20:45:47 +10:00
John Zaitseff
de6a4e3e66 Remove obsolete old_attrpr, old_center, old_center2 and old_center3 2011-08-16 18:51:56 +10:00
John Zaitseff
cf30933614 Continue to rewrite the interface code to use the new interfaces 2011-08-16 18:48:56 +10:00
John Zaitseff
135842b87d Bug fix for non-colour mode
If the background has A_REVERSE, then A_NORMAL will have no effect.  For
that reason, specify A_NORMAL as the default background after creating a
new window.
2011-08-16 16:25:28 +10:00
John Zaitseff
82647cf691 Move to the new left/center/right functions; add maxlines parameter 2011-08-15 23:54:44 +10:00
John Zaitseff
22677c0d89 Handle floating-point numbers in mkchstr(), with optional precision 2011-08-15 23:12:10 +10:00
John Zaitseff
665605d144 Add convenience functions left(), center() and right() 2011-08-15 21:04:07 +10:00
John Zaitseff
a6c362d2e8 Rename pr_left, pr_center and pr_right to leftch, centerch and rightch 2011-08-15 19:46:26 +10:00
John Zaitseff
907a995b98 Refactor function names; "old_" functions will be removed
Rename prepstr, vprepstr, chbufdup, center, center2, center3 and attrpr
to mkchstr, vmkchstr, chstrdup, old_center, old_center2, old_center3 and
old_attrpr respectively.
2011-08-15 19:12:26 +10:00