Mercurial > hg > openttd
changeset 16855:51e9b8f4d055 draft
(svn r21589) -Codechange: Move PlaceLandBlockInfo() to the right file, introduce a ShowLandInfo() function.
author | alberth <alberth@openttd.org> |
---|---|
date | Tue, 21 Dec 2010 21:46:19 +0000 |
parents | 934c33743757 |
children | eb008b07fd10 |
files | src/gui.h src/misc_gui.cpp src/toolbar_gui.cpp |
diffstat | 3 files changed, 17 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gui.h +++ b/src/gui.h @@ -46,7 +46,7 @@ void ShowHeightmapLoad(); /* misc_gui.cpp */ -void PlaceLandBlockInfo(); +void ShowLandInfo(TileIndex tile); void ShowAboutWindow(); void ShowBuildTreesToolbar(); void ShowTownDirectory();
--- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -329,22 +329,12 @@ } }; -static void Place_LandInfo(TileIndex tile) +void ShowLandInfo(TileIndex tile) { DeleteWindowById(WC_LAND_INFO, 0); new LandInfoWindow(tile); } -void PlaceLandBlockInfo() -{ - if (_cursor.sprite == SPR_CURSOR_QUERY) { - ResetObjectToPlace(); - } else { - _place_proc = Place_LandInfo; - SetObjectToPlace(SPR_CURSOR_QUERY, PAL_NONE, HT_RECT, WC_MAIN_TOOLBAR, 0); - } -} - /** Widgets for the land info window. */ enum AboutWidgets { AW_SCROLLING_TEXT, ///< The actually scrolling text
--- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -755,6 +755,21 @@ /* --- Help button menu --- */ +static void Place_LandInfo(TileIndex tile) +{ + ShowLandInfo(tile); +} + +static void PlaceLandBlockInfo() +{ + if (_cursor.sprite == SPR_CURSOR_QUERY) { + ResetObjectToPlace(); + } else { + _place_proc = Place_LandInfo; + SetObjectToPlace(SPR_CURSOR_QUERY, PAL_NONE, HT_RECT, WC_MAIN_TOOLBAR, 0); + } +} + static void ToolbarHelpClick(Window *w) { PopupMainToolbMenu(w, TBN_HELP, STR_ABOUT_MENU_LAND_BLOCK_INFO, _settings_client.gui.newgrf_developer_tools ? 9 : 8);