# newgrf_callbacks.h

Go to the documentation of this file.

    00001 /* $Id: newgrf_callbacks.h 15428 2009-02-09 02:57:15Z rubidium $ */
    00002
    00005 #ifndef NEWGRF_CALLBACKS_H
    00006 #define NEWGRF_CALLBACKS_H
    00007
    00018 enum CallbackID {
    00020   CBID_NO_CALLBACK                     = 0x00,
    00021
    00023   CBID_RANDOM_TRIGGER                  = 0x01,
    00024
    00025   /* There are no callbacks 0x02 - 0x0F. */
    00026
    00028   CBID_TRAIN_WAGON_POWER               = 0x10, // 8 bit callback
    00029
    00031   CBID_VEHICLE_LENGTH                  = 0x11,
    00032
    00034   CBID_VEHICLE_LOAD_AMOUNT             = 0x12, // 8 bit callback
    00035
    00037   CBID_STATION_AVAILABILITY            = 0x13, // 8 bit callback
    00038
    00040   CBID_STATION_SPRITE_LAYOUT           = 0x14,
    00041
    00044   CBID_VEHICLE_REFIT_CAPACITY          = 0x15, // 15 bit callback
    00045
    00047   CBID_VEHICLE_ARTIC_ENGINE            = 0x16, // 8 bit callback
    00048
    00050   CBID_HOUSE_ALLOW_CONSTRUCTION        = 0x17, // 8 bit callback
    00051
    00053   CBID_GENERIC_AI_PURCHASE_SELECTION   = 0x18, // 8 bit callback, not implemented
    00054
    00056   CBID_VEHICLE_CARGO_SUFFIX            = 0x19,
    00057
    00059   CBID_HOUSE_ANIMATION_NEXT_FRAME      = 0x1A, // 15 bit callback
    00060
    00062   CBID_HOUSE_ANIMATION_START_STOP      = 0x1B, // 15 bit callback
    00063
    00065   CBID_HOUSE_CONSTRUCTION_STATE_CHANGE = 0x1C, // 15 bit callback
    00066
    00068   CBID_TRAIN_ALLOW_WAGON_ATTACH        = 0x1D,
    00069
    00071   CBID_HOUSE_COLOUR                    = 0x1E, // 15 bit callback
    00072
    00074   CBID_HOUSE_CARGO_ACCEPTANCE          = 0x1F, // 15 bit callback
    00075
    00077   CBID_HOUSE_ANIMATION_SPEED           = 0x20, // 8 bit callback
    00078
    00080   CBID_HOUSE_DESTRUCTION               = 0x21, // 8 bit callback
    00081
    00083   CBID_INDUSTRY_AVAILABLE              = 0x22, // 15 bit callback
    00084
    00087   CBID_VEHICLE_ADDITIONAL_TEXT         = 0x23,
    00088
    00090   CBID_STATION_TILE_LAYOUT             = 0x24, // 15 bit callback
    00091
    00093   CBID_INDTILE_ANIM_START_STOP         = 0x25, // 15 bit callback
    00094
    00096   CBID_INDTILE_ANIM_NEXT_FRAME         = 0x26, // 15 bit callback
    00097
    00099   CBID_INDTILE_ANIMATION_SPEED         = 0x27, // 8 bit callback
    00100
    00102   CBID_INDUSTRY_LOCATION               = 0x28, // 15 bit callback
    00103
    00105   CBID_INDUSTRY_PRODUCTION_CHANGE      = 0x29, // 15 bit callback
    00106
    00108   CBID_HOUSE_ACCEPT_CARGO              = 0x2A, // 15 bit callback
    00109
    00111   CBID_INDTILE_CARGO_ACCEPTANCE        = 0x2B, // 15 bit callback
    00112
    00114   CBID_INDTILE_ACCEPT_CARGO            = 0x2C, // 15 bit callback
    00115
    00118   CBID_VEHICLE_COLOUR_MAPPING          = 0x2D, // 15 bit callback
    00119
    00121   CBID_HOUSE_PRODUCE_CARGO             = 0x2E, // 15 bit callback
    00122
    00124   CBID_INDTILE_SHAPE_CHECK             = 0x2F, // 15 bit callback
    00125
    00127   CBID_INDUSTRY_DRAW_FOUNDATIONS       = 0x30, // 15 bit callback
    00128
    00131   CBID_VEHICLE_START_STOP_CHECK        = 0x31, // 15 bit callback, but 0xFF test is done with 8 bit
    00132
    00134   CBID_VEHICLE_32DAY_CALLBACK          = 0x32, // 2 bit callback
    00135
    00137   CBID_VEHICLE_SOUND_EFFECT            = 0x33, // 15 bit callback
    00138
    00140   CBID_VEHICLE_AUTOREPLACE_SELECTION   = 0x34, // 15 bit callback
    00141
    00143   CBID_INDUSTRY_MONTHLYPROD_CHANGE     = 0x35, // 15 bit callback
    00144
    00147   CBID_VEHICLE_MODIFY_PROPERTY         = 0x36, // 8/15 bit depends on queried property
    00148
    00150   CBID_INDUSTRY_CARGO_SUFFIX           = 0x37, // 15 bit callback, but 0xFF test is done with 8 bit
    00151
    00153   CBID_INDUSTRY_FUND_MORE_TEXT         = 0x38, // 15 bit callback
    00154
    00156   CBID_CARGO_PROFIT_CALC               = 0x39, // 15 bit callback
    00157
    00159   CBID_INDUSTRY_WINDOW_MORE_TEXT       = 0x3A, // 15 bit callback
    00160
    00162   CBID_INDUSTRY_SPECIAL_EFFECT         = 0x3B, // 15 bit callback
    00163
    00165   CBID_INDUSTRY_AUTOSLOPE              = 0x3C, // 15 bit callback
    00166
    00168   CBID_INDUSTRY_REFUSE_CARGO           = 0x3D, // 15 bit callback
    00169
    00170   /* There are no callbacks 0x3E - 0x13F */
    00171
    00173   CBID_STATION_ANIM_START_STOP         = 0x140, // 15 bit callback
    00174
    00176   CBID_STATION_ANIM_NEXT_FRAME         = 0x141, // 15 bit callback
    00177
    00179   CBID_STATION_ANIMATION_SPEED         = 0x142, // 8 bit callback
    00180
    00182   CBID_HOUSE_DENY_DESTRUCTION          = 0x143, // 15 bit callback
    00183
    00185   CBID_SOUNDS_AMBIENT_EFFECT           = 0x144, // 15 bit callback, not implemented
    00186
    00188   CBID_CARGO_STATION_RATING_CALC       = 0x145, // 15 bit callback, not implemented
    00189
    00191   CBID_NEW_SIGNALS_SPRITE_DRAW         = 0x146, // 15 bit callback, not implemented
    00192
    00194   CBID_CANALS_SPRITE_OFFSET            = 0x147, // 15 bit callback, not implemented
    00195
    00197   CBID_HOUSE_WATCHED_CARGO_ACCEPTED    = 0x148, // 15 bit callback, not implemented
    00198
    00200   CBID_STATION_LAND_SLOPE_CHECK        = 0x149, // 15 bit callback, not implemented
    00201
    00203   CBID_INDUSTRY_DECIDE_COLOUR          = 0x14A, // 4 bit callback
    00204
    00206   CBID_INDUSTRY_INPUT_CARGO_TYPES      = 0x14B, // 8 bit callback
    00207
    00209   CBID_INDUSTRY_OUTPUT_CARGO_TYPES     = 0x14C, // 8 bit callback
    00210
    00212   CBID_HOUSE_CUSTOM_NAME               = 0x14D, // 15 bit callback
    00213 };
    00214
    00219 enum VehicleCallbackMask {
    00220   CBM_TRAIN_WAGON_POWER      = 0,
    00221   CBM_VEHICLE_LENGTH         = 1,
    00222   CBM_VEHICLE_LOAD_AMOUNT    = 2,
    00223   CBM_VEHICLE_REFIT_CAPACITY = 3,
    00224   CBM_VEHICLE_ARTIC_ENGINE   = 4,
    00225   CBM_VEHICLE_CARGO_SUFFIX   = 5,
    00226   CBM_VEHICLE_COLOUR_REMAP   = 6,
    00227   CBM_VEHICLE_SOUND_EFFECT   = 7,
    00228 };
    00229
    00233 enum StationCallbackMask {
    00234   CBM_STATION_AVAIL                = 0,
    00235   CBM_STATION_SPRITE_LAYOUT        = 1,
    00236   CBM_STATION_ANIMATION_NEXT_FRAME = 2,
    00237   CBM_STATION_ANIMATION_SPEED      = 3,
    00238   CBM_STATION_SLOPE_CHECK          = 4,
    00239 };
    00240
    00244 enum HouseCallbackMask {
    00245   CBM_HOUSE_ALLOW_CONSTRUCTION        =  0,
    00246   CBM_HOUSE_ANIMATION_NEXT_FRAME      =  1,
    00247   CBM_HOUSE_ANIMATION_START_STOP      =  2,
    00248   CBM_HOUSE_CONSTRUCTION_STATE_CHANGE =  3,
    00249   CBM_HOUSE_COLOUR                    =  4,
    00250   CBM_HOUSE_CARGO_ACCEPTANCE          =  5,
    00251   CBM_HOUSE_ANIMATION_SPEED           =  6,
    00252   CBM_HOUSE_DESTRUCTION               =  7,
    00253   CBM_HOUSE_ACCEPT_CARGO              =  8,
    00254   CBM_HOUSE_PRODUCE_CARGO             =  9,
    00255   CBM_HOUSE_DENY_DESTRUCTION          = 10,
    00256
    00257 };
    00258
    00262 enum CargoCallbackMask {
    00263   CBM_CARGO_PROFIT_CALC         = 0,
    00264   CBM_CARGO_STATION_RATING_CALC = 1,
    00265 };
    00266
    00270 enum IndustryCallbackMask {
    00271   CBM_IND_AVAILABLE                 =  0,
    00272   CBM_IND_PRODUCTION_CARGO_ARRIVAL  =  1,
    00273   CBM_IND_PRODUCTION_256_TICKS      =  2,
    00274   CBM_IND_LOCATION                  =  3,
    00275   CBM_IND_PRODUCTION_CHANGE         =  4,
    00276   CBM_IND_MONTHLYPROD_CHANGE        =  5,
    00277   CBM_IND_CARGO_SUFFIX              =  6,
    00278   CBM_IND_FUND_MORE_TEXT            =  7,
    00279   CBM_IND_WINDOW_MORE_TEXT          =  8,
    00280   CBM_IND_SPECIAL_EFFECT            =  9,
    00281   CBM_IND_REFUSE_CARGO              = 10,
    00282   CBM_IND_DECIDE_COLOUR             = 11,
    00283   CBM_IND_INPUT_CARGO_TYPES         = 12,
    00284   CBM_IND_OUTPUT_CARGO_TYPES        = 13,
    00285 };
    00286
    00290 enum IndustryTileCallbackMask {
    00291   CBM_INDT_ANIM_NEXT_FRAME          = 0,
    00292   CBM_INDT_ANIM_SPEED               = 1,
    00293   CBM_INDT_CARGO_ACCEPTANCE         = 2,
    00294   CBM_INDT_ACCEPT_CARGO             = 3,
    00295   CBM_INDT_SHAPE_CHECK              = 4,
    00296   CBM_INDT_DRAW_FOUNDATIONS         = 5,
    00297   CBM_INDT_AUTOSLOPE                = 6,
    00298 };
    00299
    00303 enum {
    00304   CALLBACK_FAILED              = 0xFFFF,
    00305   CALLBACK_HOUSEPRODCARGO_END  = 0x20FF,
    00306 };
    00307
    00308 #endif /* NEWGRF_CALLBACKS_H */