Top |
gboolean | expand-abbreviations | Read / Write / Construct |
char * | graphics-file | Read / Write / Construct |
gboolean | ignore-errors | Read / Write / Construct |
guint | interpreter-number | Read / Write / Construct |
gboolean | piracy-mode | Read / Write / Construct |
int | random-seed | Read / Write |
gboolean | random-seed-set | Read / Write / Construct |
gboolean | tandy-bit | Read / Write / Construct |
gboolean | typo-correction | Read / Write / Construct |
enum | ChimaraIFFormat |
enum | ChimaraIFInterpreter |
enum | ChimaraIFZmachineVersion |
ChimaraIF |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── ChimaraGlk ╰── ChimaraIF
The ChimaraIF widget, given an interactive fiction game file to run, selects an appropriate interpreter plugin and runs it. Interpreter options are set by setting properties on the widget.
Using it in a GTK program is similar to using ChimaraGlk (which see).
Use chimara_if_run_game()
to start playing an interactive fiction game.
GtkWidget *
chimara_if_new (void
);
Creates and initializes a new ChimaraIF widget.
void chimara_if_set_preferred_interpreter (ChimaraIF *self
,ChimaraIFFormat format
,ChimaraIFInterpreter interpreter
);
The function chimara_if_run_game()
picks an appropriate interpreter for the
type of game file it is given. This function sets which interpreter is picked
for a certain game file format. Most formats, notably the Z-machine, have
had many different interpreters written for them over the years, all with
slightly different quirks and capabilities, so there is plenty of choice.
self |
A ChimaraIF widget. |
|
format |
The game format to set the preferred interpreter plugin for. |
|
interpreter |
The preferred interpreter plugin for |
ChimaraIFInterpreter chimara_if_get_preferred_interpreter (ChimaraIF *self
,ChimaraIFFormat format
);
Looks up the preferred interpreter for the game file format format
. See
chimara_if_set_preferred_interpreter()
.
self |
A ChimaraIF widget. |
|
format |
The game format to query the preferred interpreter plugin for. |
gboolean chimara_if_run_game (ChimaraIF *self
,const char *game_path
,GError **error
);
Autodetects the type of a game file and runs it using an appropriate
interpreter plugin. If there is more than one interpreter that supports the
file format, the preferred one will be picked, according to
chimara_if_set_preferred_interpreter()
.
gboolean chimara_if_run_game_file (ChimaraIF *self
,GFile *game_file
,GError **error
);
Autodetects the type of a game file and runs it using an appropriate
interpreter plugin. See chimara_if_run_game()
for more information.
ChimaraIFFormat
chimara_if_get_format (ChimaraIF *self
);
Returns the file format of the currently running game.
ChimaraIFInterpreter
chimara_if_get_interpreter (ChimaraIF *self
);
Returns the interpreter plugin currently running.
Allowed values for the “interpreter-number” property. All trademarks are the property of their respective owners.
“expand-abbreviations”
property“expand-abbreviations” gboolean
Most Z-machine games, in particular ones compiled with the Inform library, support the following one-letter abbreviations:
D — Down |
E — East |
G — aGain |
I — Inventory |
L — Look |
N — North |
O — Oops |
Q — Quit |
S — South |
U — Up |
W — West |
X — eXamine |
Y — Yes |
Z — wait (ZZZZ...) |
Some early Infocom games might not recognize these abbreviations. Setting
this property to TRUE
will cause the interpreter to expand the
abbreviations to the full words before passing the commands on to the
game. Frotz only expands G, X, and Z; Nitfol expands all of the above
plus the following nonstandard ones:
C — Close |
K — attacK |
P — oPen |
R — dRop |
T — Take |
Only affects Z-machine interpreters. Behaves differently on Frotz and Nitfol.
Owner: ChimaraIF
Flags: Read / Write / Construct
Default value: FALSE
“graphics-file”
property “graphics-file” char *
Some Z-machine interpreters accept an extra argument that indicates a
separate Blorb file containing graphics and sound resources. The
interpreter will check if the file specified in this property really
exists, and if so, use it as a resource file. If this property is set to
NULL
, the interpreter will not look for an extra file.
Only affects Frotz and Nitfol.
Owner: ChimaraIF
Flags: Read / Write / Construct
Default value: NULL
“ignore-errors”
property“ignore-errors” gboolean
Setting this property to TRUE
will cause the interpreter to ignore
certain Z-machine runtime errors.
If this is turned on, Frotz will ignore any fatal errors.
Nitfol, on the other hand, will warn about any shady behavior at all if
this is turned off.
Only affects Z-machine interpreters. Behaves differently on Frotz and Nitfol.
Owner: ChimaraIF
Flags: Read / Write / Construct
Default value: FALSE
“interpreter-number”
property“interpreter-number” guint
Infocom gave each port of their interpreter a different number. The Frotz and Nitfol plugins can emulate any of these platforms. Some games behave slightly differently depending on what platform they are on. Set this property to a ChimaraIFZmachineVersion value to emulate a certain platform.
Note that Nitfol pretends to be an Apple IIe by default.
Only affects Z-machine interpreters.
Owner: ChimaraIF
Flags: Read / Write / Construct
Allowed values: <= 11
Default value: 0
“piracy-mode”
property“piracy-mode” gboolean
The Z-machine specification defines a facility for games to ask the
interpreter they are running on whether this copy of the game is pirated.
How the interpreter is supposed to magically determine that it is running
pirate software is unclear, and so the majority of games and interpreters
ignore this feature. Set this property to TRUE
if you want the
interpreter to pretend it has detected a pirated game.
Only affects Z-machine interpreters.
Owner: ChimaraIF
Flags: Read / Write / Construct
Default value: FALSE
“random-seed”
property “random-seed” int
If the “random-seed-set” property is TRUE
, then the interpreter
will use the value of this property as a seed for the random number
generator. Use this feature to duplicate sequences of random numbers
for testing games.
Note that the value -1 is a valid random number seed for
Nitfol, whereas it will cause Frotz to pick an arbitrary seed even when
“random-seed-set” is TRUE
.
Only affects Z-machine interpreters. Behaves slightly differently on Frotz and Nitfol.
Owner: ChimaraIF
Flags: Read / Write
Default value: 0
“random-seed-set”
property“random-seed-set” gboolean
Whether to use or ignore the “random-seed” property.
Only affects Z-machine interpreters.
Owner: ChimaraIF
Flags: Read / Write / Construct
Default value: FALSE
“tandy-bit”
property“tandy-bit” gboolean
Some early Infocom games were sold by the Tandy Corporation. Setting this
property to TRUE
changes the wording of some Version 3 Infocom games
slightly, so as to be less offensive.
See http://www.ifarchive.org/if-archive/infocom/info/tandy_bits.html.
Only affects Z-machine interpreters.
Owner: ChimaraIF
Flags: Read / Write / Construct
Default value: FALSE
“typo-correction”
property“typo-correction” gboolean
Nitfol has an automatic typo-correction facility, where it searches the
game dictionary for words which differ by one letter from any unknown
input words. Set this property to FALSE
to turn this feature off.
Only affects Nitfol.
Owner: ChimaraIF
Flags: Read / Write / Construct
Default value: TRUE
“command”
signalvoid user_function (ChimaraIF *self, char *input, char *response, gpointer user_data)
Emitted once for each input-response cycle of an interactive fiction game. Note that games with nontraditional input systems (i.e. not all taking place in the same text buffer window) may confuse this signal.
It may happen that input
is NULL
, in which case response
is not due to
a user command, but contains the text printed at the beginning of the
game, up until the first prompt.
self |
The widget that received the signal |
|
input |
The command typed into the game, or |
|
response |
The game's response to the command |
|
user_data |
user data set when the signal handler was connected. |