annotate src/newgrf_callbacks.h @ 11085:8da1855e9f14 draft

(svn r15428) -Codechange: consistently use colour instead of having both color and colour.
author rubidium <rubidium@openttd.org>
date Mon, 09 Feb 2009 02:57:15 +0000
parents 09cd1607d223
children bc7926153e19
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
1 /* $Id$ */
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
2
9111
d48433370037 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium <rubidium@openttd.org>
parents: 9021
diff changeset
3 /** @file newgrf_callbacks.h Callbacks that NewGRFs could implement. */
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
4
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
5 #ifndef NEWGRF_CALLBACKS_H
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
6 #define NEWGRF_CALLBACKS_H
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
7
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
8 /**
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
9 * List of implemented NewGRF callbacks.
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
10 * Most of these callbacks are only triggered when the corresponding
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
11 * bit is set in the callback flags/trigger for a vehicle, house,
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
12 * industry, etc.
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
13 * Names are formatted as CBID_<CLASS>_<CALLBACK>
7600
b7b90b4d0594 (svn r11127) -Fix: truncate the result of 8 bits callbacks.
rubidium <rubidium@openttd.org>
parents: 7582
diff changeset
14 *
b7b90b4d0594 (svn r11127) -Fix: truncate the result of 8 bits callbacks.
rubidium <rubidium@openttd.org>
parents: 7582
diff changeset
15 * @note Do not forget to add 15 bits callbacks to the switch in
b7b90b4d0594 (svn r11127) -Fix: truncate the result of 8 bits callbacks.
rubidium <rubidium@openttd.org>
parents: 7582
diff changeset
16 * newgrf_spritegroup.cpp (search for "15 bits callback").
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
17 */
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
18 enum CallbackID {
7327
0ab2820a1e52 (svn r10690) -Codechange: use the enum that describes all callback IDs in favor of "just" using an untyped integer.
rubidium <rubidium@openttd.org>
parents: 7283
diff changeset
19 /** Set when using the callback resolve system, but not to resolve a callback. */
0ab2820a1e52 (svn r10690) -Codechange: use the enum that describes all callback IDs in favor of "just" using an untyped integer.
rubidium <rubidium@openttd.org>
parents: 7283
diff changeset
20 CBID_NO_CALLBACK = 0x00,
0ab2820a1e52 (svn r10690) -Codechange: use the enum that describes all callback IDs in favor of "just" using an untyped integer.
rubidium <rubidium@openttd.org>
parents: 7283
diff changeset
21
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
22 /** Set when calling a randomizing trigger (almost undocumented). */
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
23 CBID_RANDOM_TRIGGER = 0x01,
7169
bb0d45d67816 (svn r10443) -Fix: randomizing triggers should be called with callback type set to 1
peter1138 <peter1138@openttd.org>
parents: 6490
diff changeset
24
7642
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
25 /* There are no callbacks 0x02 - 0x0F. */
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
26
10941
09cd1607d223 (svn r15280) -Cleanup: ancient and vastly out of date comment...
peter1138 <peter1138@openttd.org>
parents: 10837
diff changeset
27 /** Powered wagons and visual effects. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
28 CBID_TRAIN_WAGON_POWER = 0x10, // 8 bit callback
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
29
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
30 /** Vehicle length, returns the amount of 1/8's the vehicle is shorter for trains and RVs. */
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
31 CBID_VEHICLE_LENGTH = 0x11,
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
32
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
33 /** Determine the amount of cargo to load per unit of time when using gradual loading. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
34 CBID_VEHICLE_LOAD_AMOUNT = 0x12, // 8 bit callback
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
35
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
36 /** Determine whether a newstation should be made available to build. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
37 CBID_STATION_AVAILABILITY = 0x13, // 8 bit callback
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
38
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
39 /** Choose a sprite layout to draw, instead of the standard 0-7 range. */
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
40 CBID_STATION_SPRITE_LAYOUT = 0x14,
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
41
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
42 /** Refit capacity, the passed vehicle needs to have its ->cargo_type set to
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
43 * the cargo we are refitting to, returns the new cargo capacity. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
44 CBID_VEHICLE_REFIT_CAPACITY = 0x15, // 15 bit callback
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
45
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
46 /** Builds articulated engines for trains and RVs. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
47 CBID_VEHICLE_ARTIC_ENGINE = 0x16, // 8 bit callback
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
48
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
49 /** Determine whether the house can be built on the specified tile. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
50 CBID_HOUSE_ALLOW_CONSTRUCTION = 0x17, // 8 bit callback
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
51
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
52 /** AI construction/purchase selection */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
53 CBID_GENERIC_AI_PURCHASE_SELECTION = 0x18, // 8 bit callback, not implemented
6332
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
54
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
55 /** Determine the cargo "suffixes" for each refit possibility of a cargo. */
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
56 CBID_VEHICLE_CARGO_SUFFIX = 0x19,
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
57
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
58 /** Determine the next animation frame for a house. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
59 CBID_HOUSE_ANIMATION_NEXT_FRAME = 0x1A, // 15 bit callback
6332
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
60
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
61 /** Called for periodically starting or stopping the animation. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
62 CBID_HOUSE_ANIMATION_START_STOP = 0x1B, // 15 bit callback
6332
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
63
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
64 /** Called whenever the construction state of a house changes. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
65 CBID_HOUSE_CONSTRUCTION_STATE_CHANGE = 0x1C, // 15 bit callback
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
66
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
67 /** Determine whether a wagon can be attached to an already existing train. */
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
68 CBID_TRAIN_ALLOW_WAGON_ATTACH = 0x1D,
6332
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
69
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
70 /** Called to determine the colour of a town building. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
71 CBID_HOUSE_COLOUR = 0x1E, // 15 bit callback
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
72
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
73 /** Called to decide how much cargo a town building can accept. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
74 CBID_HOUSE_CARGO_ACCEPTANCE = 0x1F, // 15 bit callback
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
75
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
76 /** Called to indicate how long the current animation frame should last. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
77 CBID_HOUSE_ANIMATION_SPEED = 0x20, // 8 bit callback
6332
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
78
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
79 /** Called periodically to determine if a house should be destroyed. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
80 CBID_HOUSE_DESTRUCTION = 0x21, // 8 bit callback
6332
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
81
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
82 /** Called to determine if the given industry type is available */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
83 CBID_INDUSTRY_AVAILABLE = 0x22, // 15 bit callback
6332
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
84
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
85 /** This callback is called from vehicle purchase lists. It returns a value to be
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
86 * used as a custom string ID in the 0xD000 range. */
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
87 CBID_VEHICLE_ADDITIONAL_TEXT = 0x23,
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
88
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
89 /** Called when building a station to customize the tile layout */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
90 CBID_STATION_TILE_LAYOUT = 0x24, // 15 bit callback
6332
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
91
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
92 /** Called for periodically starting or stopping the animation. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
93 CBID_INDTILE_ANIM_START_STOP = 0x25, // 15 bit callback
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
94
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
95 /** Called to determine industry tile next animation frame. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
96 CBID_INDTILE_ANIM_NEXT_FRAME = 0x26, // 15 bit callback
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
97
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
98 /** Called to indicate how long the current animation frame should last. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
99 CBID_INDTILE_ANIMATION_SPEED = 0x27, // 8 bit callback
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
100
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
101 /** Called to determine if the given industry can be built on specific area. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
102 CBID_INDUSTRY_LOCATION = 0x28, // 15 bit callback
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
103
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
104 /** Called on production changes, so it can be adjusted. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
105 CBID_INDUSTRY_PRODUCTION_CHANGE = 0x29, // 15 bit callback
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
106
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
107 /** Called to determine which cargoes a town building should accept. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
108 CBID_HOUSE_ACCEPT_CARGO = 0x2A, // 15 bit callback
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
109
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
110 /** Called to query the cargo acceptance of the industry tile */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
111 CBID_INDTILE_CARGO_ACCEPTANCE = 0x2B, // 15 bit callback
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
112
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
113 /** Called to determine which cargoes an industry should accept. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
114 CBID_INDTILE_ACCEPT_CARGO = 0x2C, // 15 bit callback
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
115
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
116 /** Called to determine if a specific colour map should be used for a vehicle
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
117 * instead of the default livery. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
118 CBID_VEHICLE_COLOUR_MAPPING = 0x2D, // 15 bit callback
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
119
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
120 /** Called to determine how much cargo a town building produces. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
121 CBID_HOUSE_PRODUCE_CARGO = 0x2E, // 15 bit callback
5717
5e23e918212d (svn r8211) -Codechange: (NewGRF) Implement callback 2D, explicit vehicle colour map
peter1138 <peter1138@openttd.org>
parents: 5475
diff changeset
122
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
123 /** Called to determine if the given industry tile can be built on specific tile. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
124 CBID_INDTILE_SHAPE_CHECK = 0x2F, // 15 bit callback
6332
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
125
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
126 /** Called to determine the type (if any) of foundation to draw for industry tile. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
127 CBID_INDUSTRY_DRAW_FOUNDATIONS = 0x30, // 15 bit callback
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
128
10207
c54d140df948 (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium <rubidium@openttd.org>
parents: 9111
diff changeset
129 /** Called when the company (or AI) tries to start or stop a vehicle. Mainly
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
130 * used for preventing a vehicle from leaving the depot. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
131 CBID_VEHICLE_START_STOP_CHECK = 0x31, // 15 bit callback, but 0xFF test is done with 8 bit
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
132
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
133 /** Called for every vehicle every 32 days (not all on same date though). */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
134 CBID_VEHICLE_32DAY_CALLBACK = 0x32, // 2 bit callback
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
135
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
136 /** Called to play a special sound effect */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
137 CBID_VEHICLE_SOUND_EFFECT = 0x33, // 15 bit callback
6332
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
138
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
139 /** Return the vehicles this given vehicle can be "upgraded" to. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
140 CBID_VEHICLE_AUTOREPLACE_SELECTION = 0x34, // 15 bit callback
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
141
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
142 /** Called monthly on production changes, so it can be adjusted more frequently */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
143 CBID_INDUSTRY_MONTHLYPROD_CHANGE = 0x35, // 15 bit callback
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
144
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
145 /** Called to modify various vehicle properties. Callback parameter 1
6490
fcc1843c68c6 (svn r9671) -Codechange: Implement NewGRF callback 36, which allows changing of various properties which were previously static. Vehicle max speed and train power/te/running costs are adjustable.
peter1138 <peter1138@openttd.org>
parents: 6413
diff changeset
146 * specifies the property index, as used in Action 0, to change. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
147 CBID_VEHICLE_MODIFY_PROPERTY = 0x36, // 8/15 bit depends on queried property
6490
fcc1843c68c6 (svn r9671) -Codechange: Implement NewGRF callback 36, which allows changing of various properties which were previously static. Vehicle max speed and train power/te/running costs are adjustable.
peter1138 <peter1138@openttd.org>
parents: 6413
diff changeset
148
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
149 /** Called to determine text to display after cargo name */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
150 CBID_INDUSTRY_CARGO_SUFFIX = 0x37, // 15 bit callback, but 0xFF test is done with 8 bit
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
151
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
152 /** Called to determine more text in the fund industry window */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
153 CBID_INDUSTRY_FUND_MORE_TEXT = 0x38, // 15 bit callback
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
154
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
155 /** Called to calculate the income of delivered cargo */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
156 CBID_CARGO_PROFIT_CALC = 0x39, // 15 bit callback
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
157
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
158 /** Called to determine more text in the industry window */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
159 CBID_INDUSTRY_WINDOW_MORE_TEXT = 0x3A, // 15 bit callback
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
160
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
161 /** Called to determine industry special effects */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
162 CBID_INDUSTRY_SPECIAL_EFFECT = 0x3B, // 15 bit callback
6359
21fea0b1dca7 (svn r9411) -Codechange: Add support for loading of newcargo data.
peter1138 <peter1138@openttd.org>
parents: 6332
diff changeset
163
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
164 /** Called to determine if industry can alter the ground below industry tile */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
165 CBID_INDUSTRY_AUTOSLOPE = 0x3C, // 15 bit callback
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
166
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
167 /** Called to determine if the industry can still accept or refuse more cargo arrival */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
168 CBID_INDUSTRY_REFUSE_CARGO = 0x3D, // 15 bit callback
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
169
7791
654d0780a613 (svn r11341) -Codechange: add missing callback ID enums, add stub for house property 20 and reorder unimplemented action 0 properties
glx <glx@openttd.org>
parents: 7650
diff changeset
170 /* There are no callbacks 0x3E - 0x13F */
654d0780a613 (svn r11341) -Codechange: add missing callback ID enums, add stub for house property 20 and reorder unimplemented action 0 properties
glx <glx@openttd.org>
parents: 7650
diff changeset
171
654d0780a613 (svn r11341) -Codechange: add missing callback ID enums, add stub for house property 20 and reorder unimplemented action 0 properties
glx <glx@openttd.org>
parents: 7650
diff changeset
172 /** Called for periodically starting or stopping the animation. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
173 CBID_STATION_ANIM_START_STOP = 0x140, // 15 bit callback
7791
654d0780a613 (svn r11341) -Codechange: add missing callback ID enums, add stub for house property 20 and reorder unimplemented action 0 properties
glx <glx@openttd.org>
parents: 7650
diff changeset
174
654d0780a613 (svn r11341) -Codechange: add missing callback ID enums, add stub for house property 20 and reorder unimplemented action 0 properties
glx <glx@openttd.org>
parents: 7650
diff changeset
175 /** Called to determine station tile next animation frame. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
176 CBID_STATION_ANIM_NEXT_FRAME = 0x141, // 15 bit callback
7791
654d0780a613 (svn r11341) -Codechange: add missing callback ID enums, add stub for house property 20 and reorder unimplemented action 0 properties
glx <glx@openttd.org>
parents: 7650
diff changeset
177
654d0780a613 (svn r11341) -Codechange: add missing callback ID enums, add stub for house property 20 and reorder unimplemented action 0 properties
glx <glx@openttd.org>
parents: 7650
diff changeset
178 /** Called to indicate how long the current animation frame should last. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
179 CBID_STATION_ANIMATION_SPEED = 0x142, // 8 bit callback
7642
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
180
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
181 /** Called to determine whether a town building can be destroyed. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
182 CBID_HOUSE_DENY_DESTRUCTION = 0x143, // 15 bit callback
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
183
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
184 /** Select an ambient sound to play for a given type of tile. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
185 CBID_SOUNDS_AMBIENT_EFFECT = 0x144, // 15 bit callback, not implemented
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
186
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
187 /** Called to calculate part of a station rating. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
188 CBID_CARGO_STATION_RATING_CALC = 0x145, // 15 bit callback, not implemented
6359
21fea0b1dca7 (svn r9411) -Codechange: Add support for loading of newcargo data.
peter1138 <peter1138@openttd.org>
parents: 6332
diff changeset
189
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
190 /** Allow signal sprites to be replaced dynamically. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
191 CBID_NEW_SIGNALS_SPRITE_DRAW = 0x146, // 15 bit callback, not implemented
7215
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
192
ba8faf180ec2 (svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.
rubidium <rubidium@openttd.org>
parents: 7212
diff changeset
193 /** Add an offset to the default sprite numbers to show another sprite. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
194 CBID_CANALS_SPRITE_OFFSET = 0x147, // 15 bit callback, not implemented
7642
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
195
7791
654d0780a613 (svn r11341) -Codechange: add missing callback ID enums, add stub for house property 20 and reorder unimplemented action 0 properties
glx <glx@openttd.org>
parents: 7650
diff changeset
196 /** Called when a cargo type specified in property 20 is accepted. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
197 CBID_HOUSE_WATCHED_CARGO_ACCEPTED = 0x148, // 15 bit callback, not implemented
7642
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
198
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
199 /** Callback done for each tile of a station to check the slope. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
200 CBID_STATION_LAND_SLOPE_CHECK = 0x149, // 15 bit callback, not implemented
7642
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
201
11085
8da1855e9f14 (svn r15428) -Codechange: consistently use colour instead of having both color and colour.
rubidium <rubidium@openttd.org>
parents: 10941
diff changeset
202 /** Called to determine the colour of an industry. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
203 CBID_INDUSTRY_DECIDE_COLOUR = 0x14A, // 4 bit callback
7642
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
204
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
205 /** Customize the input cargo types of a newly build industry. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
206 CBID_INDUSTRY_INPUT_CARGO_TYPES = 0x14B, // 8 bit callback
7642
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
207
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
208 /** Customize the output cargo types of a newly build industry. */
9021
e5aba9a61144 (svn r12820) -Documentation: Mark callbacks as 8 or 15 bit in 'newgrf_callbacks.h'.
frosch <frosch@openttd.org>
parents: 9003
diff changeset
209 CBID_INDUSTRY_OUTPUT_CARGO_TYPES = 0x14C, // 8 bit callback
10837
191f10c27915 (svn r15172) -Feature: Allow a grf to customize house name via callback 0x14D, during Tile Inquiry process
belugas <belugas@openttd.org>
parents: 10207
diff changeset
210
191f10c27915 (svn r15172) -Feature: Allow a grf to customize house name via callback 0x14D, during Tile Inquiry process
belugas <belugas@openttd.org>
parents: 10207
diff changeset
211 /** Called on the Get Tile Description for an house tile. */
191f10c27915 (svn r15172) -Feature: Allow a grf to customize house name via callback 0x14D, during Tile Inquiry process
belugas <belugas@openttd.org>
parents: 10207
diff changeset
212 CBID_HOUSE_CUSTOM_NAME = 0x14D, // 15 bit callback
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
213 };
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
214
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
215 /**
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
216 * Callback masks for vehicles, indicates which callbacks are used by a vehicle.
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
217 * Some callbacks are always used and don't have a mask.
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
218 */
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
219 enum VehicleCallbackMask {
7642
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
220 CBM_TRAIN_WAGON_POWER = 0, ///< Powered wagons (trains only)
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
221 CBM_VEHICLE_LENGTH = 1, ///< Vehicle length (trains and road vehicles)
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
222 CBM_VEHICLE_LOAD_AMOUNT = 2, ///< Load amount
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
223 CBM_VEHICLE_REFIT_CAPACITY = 3, ///< Cargo capacity after refit
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
224 CBM_VEHICLE_ARTIC_ENGINE = 4, ///< Add articulated engines (trains only)
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
225 CBM_VEHICLE_CARGO_SUFFIX = 5, ///< Show suffix after cargo name
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
226 CBM_VEHICLE_COLOUR_REMAP = 6, ///< Change colour mapping of vehicle
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
227 CBM_VEHICLE_SOUND_EFFECT = 7, ///< Vehicle uses custom sound effects
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
228 };
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
229
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
230 /**
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
231 * Callback masks for stations.
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
232 */
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
233 enum StationCallbackMask {
7642
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
234 CBM_STATION_AVAIL = 0, ///< Availability of station in construction window
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
235 CBM_STATION_SPRITE_LAYOUT = 1, ///< Use callback to select a sprite layout to use
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
236 CBM_STATION_ANIMATION_NEXT_FRAME = 2, ///< Use a custom next frame callback
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
237 CBM_STATION_ANIMATION_SPEED = 3, ///< Customize the animation speed of the station
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
238 CBM_STATION_SLOPE_CHECK = 4, ///< Check slope of new station tiles
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
239 };
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
240
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
241 /**
6332
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
242 * Callback masks for houses.
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
243 */
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
244 enum HouseCallbackMask {
7642
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
245 CBM_HOUSE_ALLOW_CONSTRUCTION = 0,
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
246 CBM_HOUSE_ANIMATION_NEXT_FRAME = 1,
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
247 CBM_HOUSE_ANIMATION_START_STOP = 2,
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
248 CBM_HOUSE_CONSTRUCTION_STATE_CHANGE = 3,
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
249 CBM_HOUSE_COLOUR = 4,
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
250 CBM_HOUSE_CARGO_ACCEPTANCE = 5,
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
251 CBM_HOUSE_ANIMATION_SPEED = 6,
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
252 CBM_HOUSE_DESTRUCTION = 7,
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
253 CBM_HOUSE_ACCEPT_CARGO = 8,
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
254 CBM_HOUSE_PRODUCE_CARGO = 9,
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
255 CBM_HOUSE_DENY_DESTRUCTION = 10,
10837
191f10c27915 (svn r15172) -Feature: Allow a grf to customize house name via callback 0x14D, during Tile Inquiry process
belugas <belugas@openttd.org>
parents: 10207
diff changeset
256
6332
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
257 };
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
258
60486b0b3e39 (svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros <maedhros@openttd.org>
parents: 6310
diff changeset
259 /**
6359
21fea0b1dca7 (svn r9411) -Codechange: Add support for loading of newcargo data.
peter1138 <peter1138@openttd.org>
parents: 6332
diff changeset
260 * Callback masks for cargos.
21fea0b1dca7 (svn r9411) -Codechange: Add support for loading of newcargo data.
peter1138 <peter1138@openttd.org>
parents: 6332
diff changeset
261 */
21fea0b1dca7 (svn r9411) -Codechange: Add support for loading of newcargo data.
peter1138 <peter1138@openttd.org>
parents: 6332
diff changeset
262 enum CargoCallbackMask {
7642
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
263 CBM_CARGO_PROFIT_CALC = 0, ///< custom profit calculation
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
264 CBM_CARGO_STATION_RATING_CALC = 1, ///< custom station rating for this cargo type
6359
21fea0b1dca7 (svn r9411) -Codechange: Add support for loading of newcargo data.
peter1138 <peter1138@openttd.org>
parents: 6332
diff changeset
265 };
21fea0b1dca7 (svn r9411) -Codechange: Add support for loading of newcargo data.
peter1138 <peter1138@openttd.org>
parents: 6332
diff changeset
266
21fea0b1dca7 (svn r9411) -Codechange: Add support for loading of newcargo data.
peter1138 <peter1138@openttd.org>
parents: 6332
diff changeset
267 /**
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
268 * Callback masks for Industries
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
269 */
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
270 enum IndustryCallbackMask {
7642
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
271 CBM_IND_AVAILABLE = 0, ///< industry availability callback
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
272 CBM_IND_PRODUCTION_CARGO_ARRIVAL = 1, ///< call production callback when cargo arrives at the industry
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
273 CBM_IND_PRODUCTION_256_TICKS = 2, ///< call production callback every 256 ticks
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
274 CBM_IND_LOCATION = 3, ///< check industry construction on given area
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
275 CBM_IND_PRODUCTION_CHANGE = 4, ///< controls random production change
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
276 CBM_IND_MONTHLYPROD_CHANGE = 5, ///< controls monthly random production change
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
277 CBM_IND_CARGO_SUFFIX = 6, ///< cargo sub-type display
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
278 CBM_IND_FUND_MORE_TEXT = 7, ///< additional text in fund window
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
279 CBM_IND_WINDOW_MORE_TEXT = 8, ///< additional text in industry window
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
280 CBM_IND_SPECIAL_EFFECT = 9, ///< control special effects
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
281 CBM_IND_REFUSE_CARGO = 10, ///< option out of accepting cargo
7642
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
282 CBM_IND_DECIDE_COLOUR = 11, ///< give a custom colour to newly build industries
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
283 CBM_IND_INPUT_CARGO_TYPES = 12, ///< customize the cargos the industry requires
610b2a5d634a (svn r11173) -Codechange: rename some callback enums so they are more uniform.
rubidium <rubidium@openttd.org>
parents: 7615
diff changeset
284 CBM_IND_OUTPUT_CARGO_TYPES = 13, ///< customize the cargos the industry produces
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
285 };
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
286
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
287 /**
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
288 * Callback masks for industry tiles
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
289 */
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
290 enum IndustryTileCallbackMask {
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
291 CBM_INDT_ANIM_NEXT_FRAME = 0, ///< decides next animation frame
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
292 CBM_INDT_ANIM_SPEED = 1, ///< decides animation speed
7199
0814b1155c40 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium <rubidium@openttd.org>
parents: 7198
diff changeset
293 CBM_INDT_CARGO_ACCEPTANCE = 2, ///< decides amount of cargo acceptance
6413
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
294 CBM_INDT_ACCEPT_CARGO = 3, ///< decides accepted types
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
295 CBM_INDT_SHAPE_CHECK = 4, ///< decides slope suitability
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
296 CBM_INDT_DRAW_FOUNDATIONS = 5, ///< decides if default foundations need to be drawn
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
297 CBM_INDT_AUTOSLOPE = 6, ///< decides allowance of autosloping
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
298 };
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
299
087adf9081fc (svn r9549) -Codechange: Add definition of callbacks and callback masks for both industries and industry tiles
belugas <belugas@openttd.org>
parents: 6359
diff changeset
300 /**
8287
988d9721ef31 (svn r11851) -Codechange: A few magic numbers removal, plus a little code style
belugas <belugas@openttd.org>
parents: 7803
diff changeset
301 * Different values for Callback result evaluations
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
302 */
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
303 enum {
8287
988d9721ef31 (svn r11851) -Codechange: A few magic numbers removal, plus a little code style
belugas <belugas@openttd.org>
parents: 7803
diff changeset
304 CALLBACK_FAILED = 0xFFFF, ///< Result of a failed callback.
988d9721ef31 (svn r11851) -Codechange: A few magic numbers removal, plus a little code style
belugas <belugas@openttd.org>
parents: 7803
diff changeset
305 CALLBACK_HOUSEPRODCARGO_END = 0x20FF, ///< Sentinel indicating that the loop for CBID_HOUSE_PRODUCE_CARGO has ended
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
306 };
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
307
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
308 #endif /* NEWGRF_CALLBACKS_H */