|
OpenTTD Source 20251104-master-g3befbdd52f
|
GUI for towns. More...
#include "stdafx.h"#include "town.h"#include "viewport_func.h"#include "error.h"#include "gui.h"#include "house.h"#include "newgrf_cargo.h"#include "newgrf_house.h"#include "newgrf_text.h"#include "picker_gui.h"#include "command_func.h"#include "company_func.h"#include "company_base.h"#include "company_gui.h"#include "network/network.h"#include "string_func.h"#include "strings_func.h"#include "sound_func.h"#include "tilehighlight_func.h"#include "sortlist_type.h"#include "road_cmd.h"#include "landscape.h"#include "querystring_gui.h"#include "window_func.h"#include "townname_func.h"#include "core/backup_type.hpp"#include "core/geometry_func.hpp"#include "core/string_consumer.hpp"#include "genworld.h"#include "fios.h"#include "stringfilter_type.h"#include "dropdown_func.h"#include "town_kdtree.h"#include "town_cmd.h"#include "timer/timer.h"#include "timer/timer_game_calendar.h"#include "timer/timer_window.h"#include "zoom_func.h"#include "hotkeys.h"#include "graph_gui.h"#include "widgets/town_widget.h"#include "table/strings.h"#include "safeguards.h"Go to the source code of this file.
Data Structures | |
| struct | TownAuthorityWindow |
| Town authority window. More... | |
| struct | TownViewWindow |
| struct | TownDirectoryWindow |
| Town directory window class. More... | |
| struct | FoundTownWindow |
| Found a town window class. More... | |
| class | HousePickerCallbacks |
| struct | BuildHouseWindow |
Typedefs | |
| typedef GUIList< const Town *, const bool & > | GUITownList |
Functions | |
| static void | ShowTownAuthorityWindow (uint town) |
| void | ShowTownViewWindow (TownID town) |
| void | ShowTownDirectory () |
| void | CcFoundTown (Commands, const CommandCost &result, TileIndex tile) |
| void | CcFoundRandomTown (Commands, const CommandCost &result, Money, TownID town_id) |
| void | ShowFoundTownWindow () |
| void | InitializeTownGui () |
| void | DrawHouseInGUI (int x, int y, HouseID house_id, int view) |
| Draw a house that does not exist. | |
| static StringID | GetHouseName (const HouseSpec *hs) |
| Get name for a prototype house. | |
| static CargoTypes | GetProducedCargoOfHouse (const HouseSpec *hs) |
| Get the cargo types produced by a house. | |
| void | ShowBuildHousePicker (Window *parent) |
Variables | |
| TownKdtree | _town_local_authority_kdtree {} |
| static constexpr std::initializer_list< NWidgetPart > | _nested_town_authority_widgets |
| static WindowDesc | _town_authority_desc (WDP_AUTO, "view_town_authority", 317, 222, WC_TOWN_AUTHORITY, WC_NONE, {}, _nested_town_authority_widgets) |
| static constexpr std::initializer_list< NWidgetPart > | _nested_town_game_view_widgets |
| static WindowDesc | _town_game_view_desc (WDP_AUTO, "view_town", 260, TownViewWindow::WID_TV_HEIGHT_NORMAL, WC_TOWN_VIEW, WC_NONE, {}, _nested_town_game_view_widgets) |
| static constexpr std::initializer_list< NWidgetPart > | _nested_town_editor_view_widgets |
| static WindowDesc | _town_editor_view_desc (WDP_AUTO, "view_town_scen", 260, TownViewWindow::WID_TV_HEIGHT_NORMAL, WC_TOWN_VIEW, WC_NONE, {}, _nested_town_editor_view_widgets) |
| static constexpr std::initializer_list< NWidgetPart > | _nested_town_directory_widgets |
| static WindowDesc | _town_directory_desc (WDP_AUTO, "list_towns", 208, 202, WC_TOWN_DIRECTORY, WC_NONE, {}, _nested_town_directory_widgets, &TownDirectoryWindow::hotkeys) |
| static constexpr std::initializer_list< NWidgetPart > | _nested_found_town_widgets |
| static WindowDesc | _found_town_desc (WDP_AUTO, "build_town", 160, 162, WC_FOUND_TOWN, WC_NONE, WindowDefaultFlag::Construction, _nested_found_town_widgets) |
| static constexpr std::initializer_list< NWidgetPart > | _nested_build_house_widgets |
| Nested widget definition for the build NewGRF rail waypoint window. | |
| static WindowDesc | _build_house_desc (WDP_AUTO, "build_house", 0, 0, WC_BUILD_HOUSE, WC_BUILD_TOOLBAR, WindowDefaultFlag::Construction, _nested_build_house_widgets, &BuildHouseWindow::hotkeys) |
GUI for towns.
Definition in file town_gui.cpp.
| typedef GUIList<const Town*, const bool &> GUITownList |
Definition at line 59 of file town_gui.cpp.
| void CcFoundRandomTown | ( | Commands | cmd, |
| const CommandCost & | result, | ||
| Money | , | ||
| TownID | town_id | ||
| ) |
Definition at line 1066 of file town_gui.cpp.
| void CcFoundTown | ( | Commands | , |
| const CommandCost & | result, | ||
| TileIndex | tile | ||
| ) |
Definition at line 1058 of file town_gui.cpp.
| void DrawHouseInGUI | ( | int | x, |
| int | y, | ||
| HouseID | house_id, | ||
| int | view | ||
| ) |
Draw a house that does not exist.
| x | Position x of image. |
| y | Position y of image. |
| house_id | House ID to draw. |
| view | The house's 'view'. |
Definition at line 1370 of file town_gui.cpp.
References HouseSpec::building_flags, DrawNewHouseTileInGUI(), DrawSprite(), HouseSpec::Get(), HouseSpec::grf_prop, StandardGRFFileProps::HasSpriteGroups(), NEW_HOUSE_OFFSET, SpriteBounds::origin, PalSpriteID::pal, RemapCoords(), ScaleSpriteTrad(), PalSpriteID::sprite, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TILE_PIXELS, TOWN_HOUSE_COMPLETED, UnScaleGUI(), Coord2D< T >::x, Coord3D< T >::x, Coord2D< T >::y, Coord3D< T >::y, and Coord3D< T >::z.
Referenced by HousePickerCallbacks::DrawType().
Get name for a prototype house.
| hs | HouseSpec of house. |
Definition at line 1424 of file town_gui.cpp.
References HouseSpec::building_name, CALLBACK_FAILED, CBID_HOUSE_CUSTOM_NAME, ErrorUnknownCallbackResult(), GetGRFStringID(), HouseSpec::grf_prop, GRFFilePropsBase::grffile, GRFSTR_MISC_GRF_TEXT, HouseSpec::Index(), and INVALID_TILE.
Referenced by BuildHouseWindow::GetHouseInformation(), and HousePickerCallbacks::GetTypeName().
|
static |
Get the cargo types produced by a house.
| hs | HouseSpec of the house. |
Definition at line 1617 of file town_gui.cpp.
References CALLBACK_FAILED, CALLBACK_HOUSEPRODCARGO_END, HouseSpec::callback_mask, CBID_HOUSE_PRODUCE_CARGO, GB(), GetCargoTranslation(), HouseSpec::grf_prop, GRFFilePropsBase::grffile, HouseSpec::Index(), INVALID_TILE, IsValidCargoType(), ProduceCargo, SetBit(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), CargoSpec::town_production_cargoes, TPE_MAIL, and TPE_PASSENGERS.
Referenced by BuildHouseWindow::GetHouseInformation().
| void InitializeTownGui | ( | ) |
Definition at line 1358 of file town_gui.cpp.
| void ShowBuildHousePicker | ( | Window * | parent | ) |
Definition at line 1843 of file town_gui.cpp.
| void ShowFoundTownWindow | ( | ) |
Definition at line 1352 of file town_gui.cpp.
|
static |
Definition at line 340 of file town_gui.cpp.
| void ShowTownDirectory | ( | ) |
Definition at line 1052 of file town_gui.cpp.
| void ShowTownViewWindow | ( | TownID | town | ) |
Definition at line 680 of file town_gui.cpp.
|
staticconstexpr |
Nested widget definition for the build NewGRF rail waypoint window.
Definition at line 1808 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 1071 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 61 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 689 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 645 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 614 of file town_gui.cpp.
| TownKdtree _town_local_authority_kdtree {} |
Definition at line 57 of file town_gui.cpp.