summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-08-05 12:05:56 +0000
committeryexo <yexo@openttd.org>2010-08-05 12:05:56 +0000
commit00902294b3077c163df1917121c5bb9a7b48e179 (patch)
tree5eb3d003ae259e5b5ce5817264ded96dab949397 /src
parentd6fa76b044711488de9b5ec822d603a4c968dd57 (diff)
downloadopenttd-00902294b3077c163df1917121c5bb9a7b48e179.tar.xz
(svn r20373) -Feature: [NewGRF] callback 0x156 to use another name for airport layouts than the default "Layout x"
Diffstat (limited to 'src')
-rw-r--r--src/airport_gui.cpp5
-rw-r--r--src/newgrf_callbacks.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp
index ee2b96276..9c86c1161 100644
--- a/src/airport_gui.cpp
+++ b/src/airport_gui.cpp
@@ -258,6 +258,11 @@ public:
case BAIRW_LAYOUT_NUM:
SetDParam(0, STR_STATION_BUILD_AIRPORT_LAYOUT_NAME);
SetDParam(1, _selected_airport_layout + 1);
+ if (_selected_airport_index != -1) {
+ const AirportSpec *as = GetAirportSpecFromClass(_selected_airport_class, _selected_airport_index);
+ StringID string = GetAirportTextCallback(as, _selected_airport_layout, CBID_AIRPORT_LAYOUT_NAME);
+ if (string != STR_UNDEFINED) SetDParam(0, string);
+ }
break;
default: break;
diff --git a/src/newgrf_callbacks.h b/src/newgrf_callbacks.h
index f85bfa859..911ca71c9 100644
--- a/src/newgrf_callbacks.h
+++ b/src/newgrf_callbacks.h
@@ -248,6 +248,9 @@ enum CallbackID {
* used as a custom string ID in the 0xD000 range.
*/
CBID_AIRPORT_ADDITIONAL_TEXT = 0x155, // 15 bit callback
+
+ /** Called to determine text to show as airport layout name. */
+ CBID_AIRPORT_LAYOUT_NAME = 0x156, // 15 bit callback
};
/**