OpenTTD Source 20250428-master-g68ba2735ea
|
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 "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 "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 |
Enumerations | |
enum | TownDirectoryHotkeys : int32_t { TDHK_FOCUS_FILTER_BOX } |
Enum referring to the Hotkeys in the town directory window. More... | |
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 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 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 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 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 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 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 57 of file town_gui.cpp.
enum TownDirectoryHotkeys : int32_t |
Enum referring to the Hotkeys in the town directory window.
Enumerator | |
---|---|
TDHK_FOCUS_FILTER_BOX | Focus the filter box. |
Definition at line 711 of file town_gui.cpp.
void CcFoundRandomTown | ( | Commands | cmd, |
const CommandCost & | result, | ||
Money | , | ||
TownID | town_id | ||
) |
Definition at line 1077 of file town_gui.cpp.
void CcFoundTown | ( | Commands | , |
const CommandCost & | result, | ||
TileIndex | tile | ||
) |
Definition at line 1069 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 1344 of file town_gui.cpp.
References HouseSpec::building_flags, DrawNewHouseTileInGUI(), DrawSprite(), HouseSpec::Get(), HouseSpec::grf_prop, NEW_HOUSE_OFFSET, PalSpriteID::pal, RemapCoords(), ScaleSpriteTrad(), PalSpriteID::sprite, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TILE_PIXELS, and TOWN_HOUSE_COMPLETED.
Referenced by HousePickerCallbacks::DrawType().
Get name for a prototype house.
hs | HouseSpec of house. |
Definition at line 1398 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 1590 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 1332 of file town_gui.cpp.
void ShowBuildHousePicker | ( | Window * | parent | ) |
Definition at line 1816 of file town_gui.cpp.
void ShowFoundTownWindow | ( | ) |
Definition at line 1326 of file town_gui.cpp.
|
static |
Definition at line 356 of file town_gui.cpp.
void ShowTownDirectory | ( | ) |
Definition at line 1063 of file town_gui.cpp.
void ShowTownViewWindow | ( | TownID | town | ) |
Definition at line 673 of file town_gui.cpp.
|
staticconstexpr |
Nested widget definition for the build NewGRF rail waypoint window.
Definition at line 1781 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 1082 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 59 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 682 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 642 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 612 of file town_gui.cpp.
TownKdtree _town_local_authority_kdtree {} |
Definition at line 55 of file town_gui.cpp.