From 00902294b3077c163df1917121c5bb9a7b48e179 Mon Sep 17 00:00:00 2001 From: yexo Date: Thu, 5 Aug 2010 12:05:56 +0000 Subject: (svn r20373) -Feature: [NewGRF] callback 0x156 to use another name for airport layouts than the default "Layout x" --- src/airport_gui.cpp | 5 +++++ src/newgrf_callbacks.h | 3 +++ 2 files changed, 8 insertions(+) (limited to 'src') 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 }; /** -- cgit v1.2.3-70-g09d2