OpenTTD Source 20241224-master-gee860a5c8e
|
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 <sstream>
#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 { 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 | DrawNewHouseTileInGUI (int x, int y, const HouseSpec *spec, HouseID house_id, int view) |
Draw representation of a house tile for GUI purposes. | |
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. | |
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, 0, _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, 0, _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, 0, _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, 0, _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, WDF_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, WDF_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.
enum TownDirectoryHotkeys |
Enum referring to the Hotkeys in the town directory window.
Enumerator | |
---|---|
TDHK_FOCUS_FILTER_BOX | Focus the filter box. |
Definition at line 727 of file town_gui.cpp.
void CcFoundRandomTown | ( | Commands | cmd, |
const CommandCost & | result, | ||
Money | , | ||
TownID | town_id | ||
) |
Definition at line 1098 of file town_gui.cpp.
void CcFoundTown | ( | Commands | , |
const CommandCost & | result, | ||
TileIndex | tile | ||
) |
Definition at line 1090 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 1405 of file town_gui.cpp.
References HouseSpec::building_flags, DrawNewHouseTileInGUI(), DrawSprite(), HouseSpec::Get(), HouseSpec::grf_prop, NEW_HOUSE_OFFSET, PalSpriteID::pal, RemapCoords(), ScaleGUITrad(), PalSpriteID::sprite, GRFFilePropsBase< Tcnt >::spritegroup, TILE_PIXELS, TOWN_HOUSE_COMPLETED, and UnScaleGUI().
Referenced by HousePickerCallbacks::DrawType().
Draw representation of a house tile for GUI purposes.
x | Position x of image. |
y | Position y of image. |
spec | House spec to draw. |
house_id | House ID to draw. |
view | The house's 'view'. |
Definition at line 1367 of file town_gui.cpp.
References CALLBACK_FAILED, HouseSpec::callback_mask, CBID_HOUSE_COLOUR, CBID_NO_CALLBACK, CBM_HOUSE_COLOUR, DrawNewGRFTileSeqInGUI(), DrawSprite(), GB(), DrawTileSprites::ground, GroundSpritePaletteTransform(), HasBit(), INVALID_TILE, PalSpriteID::pal, HouseSpec::random_colour, SpriteGroup::Resolve(), PalSpriteID::sprite, SPRITE_MODIFIER_CUSTOM_SPRITE, SPRITE_WIDTH, and TOWN_HOUSE_COMPLETED.
Referenced by DrawHouseInGUI().
Get name for a prototype house.
hs | HouseSpec of house. |
Definition at line 1459 of file town_gui.cpp.
References HouseSpec::building_name, CALLBACK_FAILED, CBID_HOUSE_CUSTOM_NAME, ErrorUnknownCallbackResult(), GetGRFStringID(), HouseSpec::grf_prop, GRFFilePropsBase< Tcnt >::grffile, HouseSpec::Index(), and INVALID_TILE.
Referenced by BuildHouseWindow::GetHouseInformation(), and HousePickerCallbacks::GetTypeName().
void InitializeTownGui | ( | ) |
Definition at line 1354 of file town_gui.cpp.
void ShowBuildHousePicker | ( | Window * | parent | ) |
Definition at line 1787 of file town_gui.cpp.
void ShowFoundTownWindow | ( | ) |
Definition at line 1348 of file town_gui.cpp.
|
static |
Definition at line 357 of file town_gui.cpp.
void ShowTownDirectory | ( | ) |
Definition at line 1084 of file town_gui.cpp.
void ShowTownViewWindow | ( | TownID | town | ) |
Definition at line 689 of file town_gui.cpp.
|
staticconstexpr |
Nested widget definition for the build NewGRF rail waypoint window.
Definition at line 1758 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 1103 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 61 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 698 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 658 of file town_gui.cpp.
|
staticconstexpr |
Definition at line 628 of file town_gui.cpp.
TownKdtree _town_local_authority_kdtree {} |
Definition at line 57 of file town_gui.cpp.