1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-12-04 14:46:45 -05:00
Commit Graph

64 Commits

Author SHA1 Message Date
John Zaitseff
86b88e8929 Allow a player to quit at the first prompt ("Enter number of players") 2011-07-11 17:48:16 +10:00
John Zaitseff
cdaeb2e869 Add the init_game() function that initialises the actual game 2011-07-11 16:14:07 +10:00
John Zaitseff
2a3ed550ad Remove the clrline parameter from the center() function 2011-07-11 15:56:01 +10:00
John Zaitseff
4a555235c9 Add the attr parameter to the center() function 2011-07-11 15:45:38 +10:00
John Zaitseff
20f6f6e73a Add the wait_for_key() function 2011-07-11 14:43:16 +10:00
John Zaitseff
5055ea57ac Rename get_yn_answer() to answer_yesno() 2011-07-11 14:23:16 +10:00
John Zaitseff
6436a68f8b Add the prototype and an empty definition for show_help() 2011-07-11 13:57:14 +10:00
John Zaitseff
3ff949efc0 Print the result of the get_yn_answer() function in bold 2011-07-11 13:52:22 +10:00
John Zaitseff
019734c8aa Rename the function getanswer() to get_yn_answer() 2011-07-11 13:37:48 +10:00
John Zaitseff
36a3811cd1 Add the gettxstring() function 2011-07-11 13:18:26 +10:00
John Zaitseff
60ab28c711 Add the modified status variable to gettxline()
Also correct a bug in gettxline() that always returned OK!
2011-07-11 12:28:13 +10:00
John Zaitseff
42e05ee20b Replace individual colour/window attributes with ATTR_ macros 2011-07-11 11:40:52 +10:00
John Zaitseff
dd281f795b Add gettxline() to read a line of input from the keyboard 2011-07-11 10:31:19 +10:00
John Zaitseff
85e09ab4f2 Replace calls to wprintw() with waddstr() where appropriate 2011-07-11 08:05:36 +10:00
John Zaitseff
1995a6a7b0 Remove the superfluous argument attr_end from attrpr()
Instead of using attr_end, simply restore the old window attributes after
printing the string.
2011-07-11 08:01:18 +10:00
John Zaitseff
5e912e6e14 Plan ahead to reduce the title window to a single line
By reducing the title window to a single line, we can fit an extra two
lines of the galaxy map in an 80x24 terminal window.
2011-07-05 10:11:50 +10:00
John Zaitseff
ad4ed4d744 Add input routines gettxchar() and getanswer(); add various macros
In particular, add macros for KEY_TAB, KEY_RETURN and KEY_ESC, and for
CURS_ON and CURS_OFF (instead of using CURS_INVISIBLE and CURS_VISIBLE
directly: this allows redefining CURS_ON to be CURS_NORMAL).  Add more
colour pairs.
2011-07-04 22:02:01 +10:00
John Zaitseff
568c3738b2 Add the attrpr() function; add a missing va_end() call in center()
The attrpr() function prints a string with a particular set of Curses
attributes.
2011-07-04 19:41:55 +10:00
John Zaitseff
ca64093a07 Move definition of "enum curs_type"; rename CURS_VERYVISIBLE
Rename CURS_VERYVISIBLE to CURS_VISIBLE to match the system documentation
for Curses.
2011-07-04 19:15:38 +10:00
John Zaitseff
4279467e14 Define the global variable quit_selected 2011-07-04 18:24:10 +10:00
John Zaitseff
ad10fd4af6 Rename company_names[] to company_name[] for consistency 2016-12-09 08:55:09 +11:00
John Zaitseff
9f6c2af671 Define ATTR: select between attributes for colour and mono screens 2016-12-09 08:54:59 +11:00
John Zaitseff
10c4cb2a22 Add a "y" parameter to center(); add the COL_CENTER macro 2011-07-04 17:54:30 +10:00
John Zaitseff
c0943b9f7d Move (and abstract) the random number functions to utils.c 2011-07-04 17:13:29 +10:00
John Zaitseff
9a39c84bf4 Add source files game.c and game.h
These files will eventually contain many of the game functions.
2011-07-04 15:54:39 +10:00
John Zaitseff
4d5c5b70ca Add the functions init_program() and end_program() 2011-07-04 15:45:03 +10:00
John Zaitseff
4f62ef1b58 Add simple functions to manage a stack of Curses windows 2011-07-04 12:41:30 +10:00
John Zaitseff
2a3e18460e Rename intto_game_filename() to game_filename() 2011-07-04 10:28:50 +10:00
John Zaitseff
d9ff917835 Rename MIN_COLUMNS to MIN_COLS for consistency with the COLS variable
Also define WIN_COLS and WIN_LINES: the current version of Star Traders
will only use this number of lines and columns in a terminal window.  All
calls to newwin() need to have COL_OFFSET and LINE_OFFSET added to the X
and Y starting positions to make this work.
2011-07-02 23:19:40 +10:00
John Zaitseff
3aa98f48bd Add the files help.c and help.h
These file will eventually contain help text describing how to play the
Star Traders game.
2011-07-02 21:50:47 +10:00
John Zaitseff
abd196d2c5 Add the basic I/O functions init_screen(), end_screen() and center() 2011-07-02 21:25:57 +10:00
John Zaitseff
0af905e1d9 Use PACKAGE_NAME where appropriate 2011-07-02 21:19:51 +10:00
John Zaitseff
9e4e4b6d11 Add intf.h and intf.c: basic text input/output interface routines 2011-07-02 14:53:45 +10:00
John Zaitseff
6c90801102 Add the err_exit() and errno_exit() functions 2011-07-02 14:23:35 +10:00
John Zaitseff
162062cbfb Rearrange the __attribute__ compiler directive
The __attribute__ compiler directive should be placed AFTER a function
prototype, as per the GNU C Compiler manual.
2011-07-02 14:01:32 +10:00
John Zaitseff
d5951adb4f Redefine the cursor type as an enum instead of as macros 2011-07-02 12:47:51 +10:00
John Zaitseff
e8590e68eb Add README files to the src and doc subdirectories 2011-07-02 10:17:03 +10:00
John Zaitseff
e8bdcfe304 Remove premature provisions for internationalisation
In particular, remove the use of the "_" macro: real internationalisation
may require this macro in a different form from that used here.
2011-07-02 10:01:37 +10:00
John Zaitseff
ba721ced10 Be stricter about saved game numbers 2011-07-02 09:39:23 +10:00
John Zaitseff
ee94d86b57 Add some more definitions, especially for the Curses library 2011-06-30 21:52:55 +10:00
John Zaitseff
9453cfc402 Use the C99 <stdbool.h> header file 2011-06-30 21:11:36 +10:00
John Zaitseff
3a4c95f927 Add the SysV-compatible curses library
The AX_WITH_CURSES macro is taken from the autoconf-archive project,
available at http://www.gnu.org/software/autoconf-archive/.
2011-06-30 20:31:19 +10:00
John Zaitseff
d6050858d9 Add the __attribute__((noreturn)) function specifier where possible 2011-06-30 16:09:13 +10:00
John Zaitseff
7fa5833fb6 Complete the command line argument processing routines 2011-06-30 15:25:30 +10:00
John Zaitseff
255dc9aa19 Add the process_cmdline(), show_version() and show_usage() functions 2011-06-29 13:15:26 +10:00
John Zaitseff
bdcdf2f131 Add the max_turn, game_loaded and game_filename global variables 2011-06-29 13:09:40 +10:00
John Zaitseff
add2580fe9 Rework the input to autoconf and add checks for the C compiler
Rewrite the input to autoconf: add the definition of PACKAGE_AUTHOR,
add checks for Standard C and for C compiler warnings (via the file
m4/ax_cflags_warn_all.m4 from the GNU Autoconf Archive), rearrange
various macros and the order of Makefile creation.
2011-06-23 22:43:31 +10:00
John Zaitseff
3f728c8652 Add the manual page to the distribution and installation list 2011-06-22 20:36:13 +10:00
John Zaitseff
77deab3d84 Add an automake Makefile for the m4 macro directory 2011-06-16 10:49:55 +10:00
John Zaitseff
0b632e0840 Ignore intermediate build files 2011-06-15 22:58:16 +10:00