author | truebrain |
Mon, 30 Jun 2008 21:31:23 +0000 | |
branch | noai |
changeset 11111 | 1b984dab8cec |
parent 10455 | 22c441f5adf9 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
10455
22c441f5adf9
(svn r12997) [NoAI] -Sync: with trunk r12895:12996.
rubidium
parents:
10294
diff
changeset
|
3 |
/** @file newgrf_callbacks.h Callbacks that NewGRFs could implement. */ |
9574 | 4 |
|
2982
286f69caaf05
(svn r3557) - NewGRF: move callback enums to a new file as more than just engines will use them
peter1138
parents:
2971
diff
changeset
|
5 |
#ifndef NEWGRF_CALLBACKS_H |
286f69caaf05
(svn r3557) - NewGRF: move callback enums to a new file as more than just engines will use them
peter1138
parents:
2971
diff
changeset
|
6 |
#define NEWGRF_CALLBACKS_H |
0 | 7 |
|
3007
6f65203dc324
(svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents:
2982
diff
changeset
|
8 |
/** |
6f65203dc324
(svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents:
2982
diff
changeset
|
9 |
* List of implemented NewGRF callbacks. |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
10 |
* Most of these callbacks are only triggered when the corresponding |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
11 |
* bit is set in the callback flags/trigger for a vehicle, house, |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
12 |
* industry, etc. |
3007
6f65203dc324
(svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents:
2982
diff
changeset
|
13 |
* Names are formatted as CBID_<CLASS>_<CALLBACK> |
9703
d2a6acdbd665
(svn r11146) [NoAI] -Sync: with trunk r11035:11045.
rubidium
parents:
9694
diff
changeset
|
14 |
* |
d2a6acdbd665
(svn r11146) [NoAI] -Sync: with trunk r11035:11045.
rubidium
parents:
9694
diff
changeset
|
15 |
* @note Do not forget to add 15 bits callbacks to the switch in |
d2a6acdbd665
(svn r11146) [NoAI] -Sync: with trunk r11035:11045.
rubidium
parents:
9694
diff
changeset
|
16 |
* newgrf_spritegroup.cpp (search for "15 bits callback"). |
3007
6f65203dc324
(svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents:
2982
diff
changeset
|
17 |
*/ |
1883
3b02000cfbe0
(svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents:
1802
diff
changeset
|
18 |
enum CallbackID { |
9694
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
9686
diff
changeset
|
19 |
/** Set when using the callback resolve system, but not to resolve a callback. */ |
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
9686
diff
changeset
|
20 |
CBID_NO_CALLBACK = 0x00, |
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
9686
diff
changeset
|
21 |
|
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
22 |
/** Set when calling a randomizing trigger (almost undocumented). */ |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
23 |
CBID_RANDOM_TRIGGER = 0x01, |
4244
44dcec623504
(svn r5822) - NewGRF: add support for callback 31, vehicle start/stop check. This allows a set to disallow a vehicle from being started, i.e. to not be able to leave the depot. This is almost a partner to callback 1D.
peter1138
parents:
3754
diff
changeset
|
24 |
|
9704 | 25 |
/* There are no callbacks 0x02 - 0x0F. */ |
26 |
||
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
27 |
/** Powered wagons, if the result is lower as 0x40 then the wagon is powered |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
28 |
* @todo : interpret the rest of the result, aka "visual effects". */ |
10294 | 29 |
CBID_TRAIN_WAGON_POWER = 0x10, // 8 bit callback |
9574 | 30 |
|
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
31 |
/** Vehicle length, returns the amount of 1/8's the vehicle is shorter for trains and RVs. */ |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
32 |
CBID_VEHICLE_LENGTH = 0x11, |
9574 | 33 |
|
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
34 |
/** Determine the amount of cargo to load per unit of time when using gradual loading. */ |
10294 | 35 |
CBID_VEHICLE_LOAD_AMOUNT = 0x12, // 8 bit callback |
9574 | 36 |
|
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
37 |
/** Determine whether a newstation should be made available to build. */ |
10294 | 38 |
CBID_STATION_AVAILABILITY = 0x13, // 8 bit callback |
9574 | 39 |
|
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
40 |
/** Choose a sprite layout to draw, instead of the standard 0-7 range. */ |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
41 |
CBID_STATION_SPRITE_LAYOUT = 0x14, |
9517 | 42 |
|
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
43 |
/** Refit capacity, the passed vehicle needs to have its ->cargo_type set to |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
44 |
* the cargo we are refitting to, returns the new cargo capacity. */ |
10294 | 45 |
CBID_VEHICLE_REFIT_CAPACITY = 0x15, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
46 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
47 |
/** Builds articulated engines for trains and RVs. */ |
10294 | 48 |
CBID_VEHICLE_ARTIC_ENGINE = 0x16, // 8 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
49 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
50 |
/** Determine whether the house can be built on the specified tile. */ |
10294 | 51 |
CBID_HOUSE_ALLOW_CONSTRUCTION = 0x17, // 8 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
52 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
53 |
/** AI construction/purchase selection */ |
10294 | 54 |
CBID_GENERIC_AI_PURCHASE_SELECTION = 0x18, // 8 bit callback, not implemented |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
55 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
56 |
/** Determine the cargo "suffixes" for each refit possibility of a cargo. */ |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
57 |
CBID_VEHICLE_CARGO_SUFFIX = 0x19, |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
58 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
59 |
/** Determine the next animation frame for a house. */ |
10294 | 60 |
CBID_HOUSE_ANIMATION_NEXT_FRAME = 0x1A, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
61 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
62 |
/** Called for periodically starting or stopping the animation. */ |
10294 | 63 |
CBID_HOUSE_ANIMATION_START_STOP = 0x1B, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
64 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
65 |
/** Called whenever the construction state of a house changes. */ |
10294 | 66 |
CBID_HOUSE_CONSTRUCTION_STATE_CHANGE = 0x1C, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
67 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
68 |
/** Determine whether a wagon can be attached to an already existing train. */ |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
69 |
CBID_TRAIN_ALLOW_WAGON_ATTACH = 0x1D, |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
70 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
71 |
/** Called to determine the colour of a town building. */ |
10294 | 72 |
CBID_HOUSE_COLOUR = 0x1E, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
73 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
74 |
/** Called to decide how much cargo a town building can accept. */ |
10294 | 75 |
CBID_HOUSE_CARGO_ACCEPTANCE = 0x1F, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
76 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
77 |
/** Called to indicate how long the current animation frame should last. */ |
10294 | 78 |
CBID_HOUSE_ANIMATION_SPEED = 0x20, // 8 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
79 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
80 |
/** Called periodically to determine if a house should be destroyed. */ |
10294 | 81 |
CBID_HOUSE_DESTRUCTION = 0x21, // 8 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
82 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
83 |
/** Called to determine if the given industry type is available */ |
10294 | 84 |
CBID_INDUSTRY_AVAILABLE = 0x22, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
85 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
86 |
/** This callback is called from vehicle purchase lists. It returns a value to be |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
87 |
* used as a custom string ID in the 0xD000 range. */ |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
88 |
CBID_VEHICLE_ADDITIONAL_TEXT = 0x23, |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
89 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
90 |
/** Called when building a station to customize the tile layout */ |
10294 | 91 |
CBID_STATION_TILE_LAYOUT = 0x24, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
92 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
93 |
/** Called for periodically starting or stopping the animation. */ |
10294 | 94 |
CBID_INDTILE_ANIM_START_STOP = 0x25, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
95 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
96 |
/** Called to determine industry tile next animation frame. */ |
10294 | 97 |
CBID_INDTILE_ANIM_NEXT_FRAME = 0x26, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
98 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
99 |
/** Called to indicate how long the current animation frame should last. */ |
10294 | 100 |
CBID_INDTILE_ANIMATION_SPEED = 0x27, // 8 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
101 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
102 |
/** Called to determine if the given industry can be built on specific area. */ |
10294 | 103 |
CBID_INDUSTRY_LOCATION = 0x28, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
104 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
105 |
/** Called on production changes, so it can be adjusted. */ |
10294 | 106 |
CBID_INDUSTRY_PRODUCTION_CHANGE = 0x29, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
107 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
108 |
/** Called to determine which cargoes a town building should accept. */ |
10294 | 109 |
CBID_HOUSE_ACCEPT_CARGO = 0x2A, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
110 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
111 |
/** Called to query the cargo acceptance of the industry tile */ |
10294 | 112 |
CBID_INDTILE_CARGO_ACCEPTANCE = 0x2B, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
113 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
114 |
/** Called to determine which cargoes an industry should accept. */ |
10294 | 115 |
CBID_INDTILE_ACCEPT_CARGO = 0x2C, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
116 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
117 |
/** Called to determine if a specific colour map should be used for a vehicle |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
118 |
* instead of the default livery. */ |
10294 | 119 |
CBID_VEHICLE_COLOUR_MAPPING = 0x2D, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
120 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
121 |
/** Called to determine how much cargo a town building produces. */ |
10294 | 122 |
CBID_HOUSE_PRODUCE_CARGO = 0x2E, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
123 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
124 |
/** Called to determine if the given industry tile can be built on specific tile. */ |
10294 | 125 |
CBID_INDTILE_SHAPE_CHECK = 0x2F, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
126 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
127 |
/** Called to determine the type (if any) of foundation to draw for industry tile. */ |
10294 | 128 |
CBID_INDUSTRY_DRAW_FOUNDATIONS = 0x30, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
129 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
130 |
/** Called when the player (or AI) tries to start or stop a vehicle. Mainly |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
131 |
* used for preventing a vehicle from leaving the depot. */ |
10294 | 132 |
CBID_VEHICLE_START_STOP_CHECK = 0x31, // 15 bit callback, but 0xFF test is done with 8 bit |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
133 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
134 |
/** Called for every vehicle every 32 days (not all on same date though). */ |
10294 | 135 |
CBID_VEHICLE_32DAY_CALLBACK = 0x32, // 2 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
136 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
137 |
/** Called to play a special sound effect */ |
10294 | 138 |
CBID_VEHICLE_SOUND_EFFECT = 0x33, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
139 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
140 |
/** Return the vehicles this given vehicle can be "upgraded" to. */ |
10294 | 141 |
CBID_VEHICLE_AUTOREPLACE_SELECTION = 0x34, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
142 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
143 |
/** Called monthly on production changes, so it can be adjusted more frequently */ |
10294 | 144 |
CBID_INDUSTRY_MONTHLYPROD_CHANGE = 0x35, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
145 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
146 |
/** Called to modify various vehicle properties. Callback parameter 1 |
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
147 |
* specifies the property index, as used in Action 0, to change. */ |
10294 | 148 |
CBID_VEHICLE_MODIFY_PROPERTY = 0x36, // 8/15 bit depends on queried property |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
149 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
150 |
/** Called to determine text to display after cargo name */ |
10294 | 151 |
CBID_INDUSTRY_CARGO_SUFFIX = 0x37, // 15 bit callback, but 0xFF test is done with 8 bit |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
152 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
153 |
/** Called to determine more text in the fund industry window */ |
10294 | 154 |
CBID_INDUSTRY_FUND_MORE_TEXT = 0x38, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
155 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
156 |
/** Called to calculate the income of delivered cargo */ |
10294 | 157 |
CBID_CARGO_PROFIT_CALC = 0x39, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
158 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
159 |
/** Called to determine more text in the industry window */ |
10294 | 160 |
CBID_INDUSTRY_WINDOW_MORE_TEXT = 0x3A, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
161 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
162 |
/** Called to determine industry special effects */ |
10294 | 163 |
CBID_INDUSTRY_SPECIAL_EFFECT = 0x3B, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
164 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
165 |
/** Called to determine if industry can alter the ground below industry tile */ |
10294 | 166 |
CBID_INDUSTRY_AUTOSLOPE = 0x3C, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
167 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
168 |
/** Called to determine if the industry can still accept or refuse more cargo arrival */ |
10294 | 169 |
CBID_INDUSTRY_REFUSE_CARGO = 0x3D, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
170 |
|
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9704
diff
changeset
|
171 |
/* There are no callbacks 0x3E - 0x13F */ |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9704
diff
changeset
|
172 |
|
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9704
diff
changeset
|
173 |
/** Called for periodically starting or stopping the animation. */ |
10294 | 174 |
CBID_STATION_ANIM_START_STOP = 0x140, // 15 bit callback |
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9704
diff
changeset
|
175 |
|
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9704
diff
changeset
|
176 |
/** Called to determine station tile next animation frame. */ |
10294 | 177 |
CBID_STATION_ANIM_NEXT_FRAME = 0x141, // 15 bit callback |
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9704
diff
changeset
|
178 |
|
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9704
diff
changeset
|
179 |
/** Called to indicate how long the current animation frame should last. */ |
10294 | 180 |
CBID_STATION_ANIMATION_SPEED = 0x142, // 8 bit callback |
9704 | 181 |
|
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
182 |
/** Called to determine whether a town building can be destroyed. */ |
10294 | 183 |
CBID_HOUSE_DENY_DESTRUCTION = 0x143, // 15 bit callback |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
184 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
185 |
/** Select an ambient sound to play for a given type of tile. */ |
10294 | 186 |
CBID_SOUNDS_AMBIENT_EFFECT = 0x144, // 15 bit callback, not implemented |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
187 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
188 |
/** Called to calculate part of a station rating. */ |
10294 | 189 |
CBID_CARGO_STATION_RATING_CALC = 0x145, // 15 bit callback, not implemented |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
190 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
191 |
/** Allow signal sprites to be replaced dynamically. */ |
10294 | 192 |
CBID_NEW_SIGNALS_SPRITE_DRAW = 0x146, // 15 bit callback, not implemented |
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
193 |
|
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
194 |
/** Add an offset to the default sprite numbers to show another sprite. */ |
10294 | 195 |
CBID_CANALS_SPRITE_OFFSET = 0x147, // 15 bit callback, not implemented |
9704 | 196 |
|
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9704
diff
changeset
|
197 |
/** Called when a cargo type specified in property 20 is accepted. */ |
10294 | 198 |
CBID_HOUSE_WATCHED_CARGO_ACCEPTED = 0x148, // 15 bit callback, not implemented |
9704 | 199 |
|
200 |
/** Callback done for each tile of a station to check the slope. */ |
|
10294 | 201 |
CBID_STATION_LAND_SLOPE_CHECK = 0x149, // 15 bit callback, not implemented |
9704 | 202 |
|
203 |
/** Called to determine the color of an industry. */ |
|
10294 | 204 |
CBID_INDUSTRY_DECIDE_COLOUR = 0x14A, // 4 bit callback |
9704 | 205 |
|
206 |
/** Customize the input cargo types of a newly build industry. */ |
|
10294 | 207 |
CBID_INDUSTRY_INPUT_CARGO_TYPES = 0x14B, // 8 bit callback |
9704 | 208 |
|
209 |
/** Customize the output cargo types of a newly build industry. */ |
|
10294 | 210 |
CBID_INDUSTRY_OUTPUT_CARGO_TYPES = 0x14C, // 8 bit callback |
1895
398f156479c8
(svn r2401) - Fix: [newgrf] Finish up callback mechanism, implement 'refit capacity' callback slightly more correct.
hackykid
parents:
1883
diff
changeset
|
211 |
}; |
398f156479c8
(svn r2401) - Fix: [newgrf] Finish up callback mechanism, implement 'refit capacity' callback slightly more correct.
hackykid
parents:
1883
diff
changeset
|
212 |
|
3007
6f65203dc324
(svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents:
2982
diff
changeset
|
213 |
/** |
6f65203dc324
(svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents:
2982
diff
changeset
|
214 |
* Callback masks for vehicles, indicates which callbacks are used by a vehicle. |
6f65203dc324
(svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents:
2982
diff
changeset
|
215 |
* Some callbacks are always used and don't have a mask. |
6f65203dc324
(svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents:
2982
diff
changeset
|
216 |
*/ |
6f65203dc324
(svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents:
2982
diff
changeset
|
217 |
enum VehicleCallbackMask { |
9704 | 218 |
CBM_TRAIN_WAGON_POWER = 0, ///< Powered wagons (trains only) |
219 |
CBM_VEHICLE_LENGTH = 1, ///< Vehicle length (trains and road vehicles) |
|
220 |
CBM_VEHICLE_LOAD_AMOUNT = 2, ///< Load amount |
|
221 |
CBM_VEHICLE_REFIT_CAPACITY = 3, ///< Cargo capacity after refit |
|
222 |
CBM_VEHICLE_ARTIC_ENGINE = 4, ///< Add articulated engines (trains only) |
|
223 |
CBM_VEHICLE_CARGO_SUFFIX = 5, ///< Show suffix after cargo name |
|
224 |
CBM_VEHICLE_COLOUR_REMAP = 6, ///< Change colour mapping of vehicle |
|
225 |
CBM_VEHICLE_SOUND_EFFECT = 7, ///< Vehicle uses custom sound effects |
|
1883
3b02000cfbe0
(svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents:
1802
diff
changeset
|
226 |
}; |
3b02000cfbe0
(svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents:
1802
diff
changeset
|
227 |
|
3007
6f65203dc324
(svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents:
2982
diff
changeset
|
228 |
/** |
3505
e9a3a6b79561
(svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents:
3007
diff
changeset
|
229 |
* Callback masks for stations. |
e9a3a6b79561
(svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents:
3007
diff
changeset
|
230 |
*/ |
e9a3a6b79561
(svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents:
3007
diff
changeset
|
231 |
enum StationCallbackMask { |
9704 | 232 |
CBM_STATION_AVAIL = 0, ///< Availability of station in construction window |
233 |
CBM_STATION_SPRITE_LAYOUT = 1, ///< Use callback to select a sprite layout to use |
|
234 |
CBM_STATION_ANIMATION_NEXT_FRAME = 2, ///< Use a custom next frame callback |
|
235 |
CBM_STATION_ANIMATION_SPEED = 3, ///< Customize the animation speed of the station |
|
236 |
CBM_STATION_SLOPE_CHECK = 4, ///< Check slope of new station tiles |
|
3505
e9a3a6b79561
(svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents:
3007
diff
changeset
|
237 |
}; |
e9a3a6b79561
(svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents:
3007
diff
changeset
|
238 |
|
e9a3a6b79561
(svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents:
3007
diff
changeset
|
239 |
/** |
9476 | 240 |
* Callback masks for houses. |
241 |
*/ |
|
242 |
enum HouseCallbackMask { |
|
9704 | 243 |
CBM_HOUSE_ALLOW_CONSTRUCTION = 0, |
244 |
CBM_HOUSE_ANIMATION_NEXT_FRAME = 1, |
|
245 |
CBM_HOUSE_ANIMATION_START_STOP = 2, |
|
246 |
CBM_HOUSE_CONSTRUCTION_STATE_CHANGE = 3, |
|
247 |
CBM_HOUSE_COLOUR = 4, |
|
248 |
CBM_HOUSE_CARGO_ACCEPTANCE = 5, |
|
249 |
CBM_HOUSE_ANIMATION_SPEED = 6, |
|
250 |
CBM_HOUSE_DESTRUCTION = 7, |
|
251 |
CBM_HOUSE_ACCEPT_CARGO = 8, |
|
252 |
CBM_HOUSE_PRODUCE_CARGO = 9, |
|
253 |
CBM_HOUSE_DENY_DESTRUCTION = 10, |
|
9476 | 254 |
}; |
255 |
||
256 |
/** |
|
9517 | 257 |
* Callback masks for cargos. |
258 |
*/ |
|
259 |
enum CargoCallbackMask { |
|
9704 | 260 |
CBM_CARGO_PROFIT_CALC = 0, ///< custom profit calculation |
261 |
CBM_CARGO_STATION_RATING_CALC = 1, ///< custom station rating for this cargo type |
|
9517 | 262 |
}; |
263 |
||
264 |
/** |
|
9574 | 265 |
* Callback masks for Industries |
266 |
*/ |
|
267 |
enum IndustryCallbackMask { |
|
9704 | 268 |
CBM_IND_AVAILABLE = 0, ///< industry availability callback |
269 |
CBM_IND_PRODUCTION_CARGO_ARRIVAL = 1, ///< call production callback when cargo arrives at the industry |
|
270 |
CBM_IND_PRODUCTION_256_TICKS = 2, ///< call production callback every 256 ticks |
|
271 |
CBM_IND_LOCATION = 3, ///< check industry construction on given area |
|
272 |
CBM_IND_PRODUCTION_CHANGE = 4, ///< controls random production change |
|
273 |
CBM_IND_MONTHLYPROD_CHANGE = 5, ///< controls monthly random production change |
|
274 |
CBM_IND_CARGO_SUFFIX = 6, ///< cargo sub-type display |
|
275 |
CBM_IND_FUND_MORE_TEXT = 7, ///< additional text in fund window |
|
276 |
CBM_IND_WINDOW_MORE_TEXT = 8, ///< additional text in industry window |
|
277 |
CBM_IND_SPECIAL_EFFECT = 9, ///< control special effects |
|
9574 | 278 |
CBM_IND_REFUSE_CARGO = 10, ///< option out of accepting cargo |
9704 | 279 |
CBM_IND_DECIDE_COLOUR = 11, ///< give a custom colour to newly build industries |
280 |
CBM_IND_INPUT_CARGO_TYPES = 12, ///< customize the cargos the industry requires |
|
281 |
CBM_IND_OUTPUT_CARGO_TYPES = 13, ///< customize the cargos the industry produces |
|
9574 | 282 |
}; |
283 |
||
284 |
/** |
|
285 |
* Callback masks for industry tiles |
|
286 |
*/ |
|
287 |
enum IndustryTileCallbackMask { |
|
288 |
CBM_INDT_ANIM_NEXT_FRAME = 0, ///< decides next animation frame |
|
289 |
CBM_INDT_ANIM_SPEED = 1, ///< decides animation speed |
|
9641
855e32c08c9b
(svn r10533) [NoAI] -Sync with trunk r10460:r10532.
truelight
parents:
9631
diff
changeset
|
290 |
CBM_INDT_CARGO_ACCEPTANCE = 2, ///< decides amount of cargo acceptance |
9574 | 291 |
CBM_INDT_ACCEPT_CARGO = 3, ///< decides accepted types |
292 |
CBM_INDT_SHAPE_CHECK = 4, ///< decides slope suitability |
|
293 |
CBM_INDT_DRAW_FOUNDATIONS = 5, ///< decides if default foundations need to be drawn |
|
294 |
CBM_INDT_AUTOSLOPE = 6, ///< decides allowance of autosloping |
|
295 |
}; |
|
296 |
||
297 |
/** |
|
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9722
diff
changeset
|
298 |
* Different values for Callback result evaluations |
3007
6f65203dc324
(svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents:
2982
diff
changeset
|
299 |
*/ |
1883
3b02000cfbe0
(svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents:
1802
diff
changeset
|
300 |
enum { |
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9722
diff
changeset
|
301 |
CALLBACK_FAILED = 0xFFFF, ///< Result of a failed callback. |
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9722
diff
changeset
|
302 |
CALLBACK_HOUSEPRODCARGO_END = 0x20FF, ///< Sentinel indicating that the loop for CBID_HOUSE_PRODUCE_CARGO has ended |
1883
3b02000cfbe0
(svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents:
1802
diff
changeset
|
303 |
}; |
3b02000cfbe0
(svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents:
1802
diff
changeset
|
304 |
|
2982
286f69caaf05
(svn r3557) - NewGRF: move callback enums to a new file as more than just engines will use them
peter1138
parents:
2971
diff
changeset
|
305 |
#endif /* NEWGRF_CALLBACKS_H */ |