Changeset - r10998:94dcb82c0e64
[Not reviewed]
master
0 24 0
rubidium - 16 years ago 2009-02-04 16:59:41
rubidium@openttd.org
(svn r15338) -Fix [FS#2598]: close all construction related windows whenever changing company.
24 files changed with 64 insertions and 43 deletions:
0 comments (0 inline, 0 general)
src/airport_gui.cpp
Show inline comments
 
@@ -138,13 +138,13 @@ static const Widget _air_toolbar_widgets
 
};
 

	
 

	
 
static const WindowDesc _air_toolbar_desc = {
 
	WDP_ALIGN_TBR, 22, 64, 36, 64, 36,
 
	WC_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	_air_toolbar_widgets,
 
};
 

	
 
void ShowBuildAirToolbar()
 
{
 
	if (!IsValidCompanyID(_local_company)) return;
 
@@ -299,13 +299,13 @@ static const Widget _build_airport_picke
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_airport_desc = {
 
	WDP_AUTO, WDP_AUTO, 148, 240, 148, 240,
 
	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	_build_airport_picker_widgets,
 
};
 

	
 
static void ShowBuildAirportPicker(Window *parent)
 
{
 
	new AirportPickerWindow(&_build_airport_desc, parent);
src/autoreplace_gui.cpp
Show inline comments
 
@@ -469,20 +469,20 @@ static const Widget _replace_vehicle_wid
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _replace_rail_vehicle_desc = {
 
	WDP_AUTO, WDP_AUTO, 456, 140, 456, 140,
 
	WC_REPLACE_VEHICLE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE | WDF_CONSTRUCTION,
 
	_replace_vehicle_widgets,
 
};
 

	
 
static const WindowDesc _replace_vehicle_desc = {
 
	WDP_AUTO, WDP_AUTO, 456, 118, 456, 118,
 
	WC_REPLACE_VEHICLE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE | WDF_CONSTRUCTION,
 
	_replace_vehicle_widgets,
 
};
 

	
 
RailType ReplaceVehicleWindow::sel_railtype = RAILTYPE_RAIL;
 

	
 
void ShowReplaceGroupVehicleWindow(GroupID id_g, VehicleType vehicletype)
src/bridge_gui.cpp
Show inline comments
 
@@ -267,13 +267,13 @@ static const Widget _build_bridge_widget
 
};
 

	
 
/* Window definition for the rail bridge selection window */
 
static const WindowDesc _build_bridge_desc = {
 
	WDP_AUTO, WDP_AUTO, 200, 114, 200, 114,
 
	WC_BUILD_BRIDGE, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE | WDF_CONSTRUCTION,
 
	_build_bridge_widgets,
 
};
 

	
 
/**
 
 * Prepare the data for the build a bridge window.
 
 *  If we can't build a bridge under the given conditions
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -1179,13 +1179,13 @@ struct BuildVehicleWindow : Window {
 
	}
 
};
 

	
 
static const WindowDesc _build_vehicle_desc = {
 
	WDP_AUTO, WDP_AUTO, 240, 174, 240, 256,
 
	WC_BUILD_VEHICLE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE | WDF_CONSTRUCTION,
 
	_build_vehicle_widgets,
 
};
 

	
 
void ShowBuildVehicleWindow(TileIndex tile, VehicleType type)
 
{
 
	/* We want to be able to open both Available Train as Available Ships,
src/cheat_gui.cpp
Show inline comments
 
@@ -43,14 +43,12 @@ static int32 ClickMoneyCheat(int32 p1, i
 
 */
 
static int32 ClickChangeCompanyCheat(int32 p1, int32 p2)
 
{
 
	while ((uint)p1 < GetCompanyPoolSize()) {
 
		if (IsValidCompanyID((CompanyID)p1)) {
 
			SetLocalCompany((CompanyID)p1);
 

	
 
			MarkWholeScreenDirty();
 
			return _local_company;
 
		}
 
		p1 += p2;
 
	}
 

	
 
	return _local_company;
src/company_cmd.cpp
Show inline comments
 
@@ -80,12 +80,18 @@ void SetLocalCompany(CompanyID new_compa
 
		const Company *c = GetCompany(new_company);
 
		_settings_client.gui.autorenew        = c->engine_renew;
 
		_settings_client.gui.autorenew_months = c->engine_renew_months;
 
		_settings_client.gui.autorenew_money  = c->engine_renew_money;
 
		InvalidateWindow(WC_GAME_OPTIONS, 0);
 
	}
 

	
 
	/* Delete any construction windows... */
 
	DeleteConstructionWindows();
 

	
 
	/* ... and redraw the whole screen. */
 
	MarkWholeScreenDirty();
 
}
 

	
 
bool IsHumanCompany(CompanyID company)
 
{
 
	return !GetCompany(company)->is_ai;
 
}
src/company_gui.cpp
Show inline comments
 
@@ -1093,21 +1093,21 @@ public:
 
};
 

	
 
/** normal/simple company manager face selection window description */
 
static const WindowDesc _select_company_manager_face_desc = {
 
	WDP_AUTO, WDP_AUTO, 190, 163, 190, 163,
 
	WC_COMPANY_MANAGER_FACE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION,
 
	_select_company_manager_face_widgets,
 
};
 

	
 
/** advanced company manager face selection window description */
 
static const WindowDesc _select_company_manager_face_adv_desc = {
 
	WDP_AUTO, WDP_AUTO, 220, 220, 220, 220,
 
	WC_COMPANY_MANAGER_FACE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION,
 
	_select_company_manager_face_adv_widgets,
 
};
 

	
 
/**
 
 * Open the simple/advanced company manager face selection window
 
 *
 
@@ -1515,13 +1515,13 @@ static const Widget _buy_company_widgets
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _buy_company_desc = {
 
	153, 171, 334, 137, 334, 137,
 
	WC_BUY_COMPANY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	_buy_company_widgets,
 
};
 

	
 

	
 
void ShowBuyCompanyDialog(CompanyID company)
 
{
src/dock_gui.cpp
Show inline comments
 
@@ -273,13 +273,13 @@ static const Widget _build_docks_toolb_w
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_docks_toolbar_desc = {
 
	WDP_ALIGN_TBR, 22, 160, 36, 160, 36,
 
	WC_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	_build_docks_toolb_widgets,
 
};
 

	
 
void ShowBuildDocksToolbar()
 
{
 
	if (!IsValidCompanyID(_local_company)) return;
 
@@ -308,13 +308,13 @@ static const Widget _build_docks_scen_to
 
};
 

	
 
/* Window definition for the build docks in scenario editor window */
 
static const WindowDesc _build_docks_scen_toolbar_desc = {
 
	WDP_AUTO, WDP_AUTO, 115, 36, 115, 36,
 
	WC_SCEN_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	_build_docks_scen_toolb_widgets,
 
};
 

	
 
void ShowBuildDocksScenToolbar()
 
{
 
	AllocateWindowDescFront<BuildDocksToolbarWindow>(&_build_docks_scen_toolbar_desc, TRANSPORT_WATER);
 
@@ -394,13 +394,13 @@ static const Widget _build_dock_station_
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_dock_station_desc = {
 
	WDP_AUTO, WDP_AUTO, 148, 75, 148, 75,
 
	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	_build_dock_station_widgets,
 
};
 

	
 
static void ShowBuildDockStationPicker(Window *parent)
 
{
 
	new BuildDocksStationWindow(&_build_dock_station_desc, parent);
 
@@ -468,13 +468,13 @@ static const Widget _build_docks_depot_w
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_docks_depot_desc = {
 
	WDP_AUTO, WDP_AUTO, 204, 86, 204, 86,
 
	WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	_build_docks_depot_widgets,
 
};
 

	
 

	
 
static void ShowBuildDocksDepotPicker(Window *parent)
 
{
src/engine_gui.cpp
Show inline comments
 
@@ -96,13 +96,13 @@ struct EnginePreviewWindow : Window {
 
	}
 
};
 

	
 
static const WindowDesc _engine_preview_desc = {
 
	WDP_CENTER, WDP_CENTER, 300, 192, 300, 192,
 
	WC_ENGINE_PREVIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	_engine_preview_widgets,
 
};
 

	
 

	
 
void ShowEnginePreviewWindow(EngineID engine)
 
{
src/industry_gui.cpp
Show inline comments
 
@@ -85,13 +85,13 @@ static const Widget _build_industry_widg
 
};
 

	
 
/** Window definition of the dynamic place industries gui */
 
static const WindowDesc _build_industry_desc = {
 
	WDP_AUTO, WDP_AUTO, 170, 212, 170, 212,
 
	WC_BUILD_INDUSTRY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE | WDF_CONSTRUCTION,
 
	_build_industry_widgets,
 
};
 

	
 
class BuildIndustryWindow : public Window {
 
	int selected_index;                         ///< index of the element in the matrix
 
	IndustryType selected_type;                 ///< industry corresponding to the above index
src/network/network_client.cpp
Show inline comments
 
@@ -843,16 +843,12 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER
 
	/* if not valid player, force spectator, else check player exists */
 
	if (!IsValidCompanyID(company_id)) company_id = COMPANY_SPECTATOR;
 

	
 
	if (client_id == _network_own_client_id) {
 
		_network_playas = company_id;
 
		SetLocalCompany(company_id);
 

	
 
		/* Disable any buttons in any windows the client is now not supposed to get to, and do it fast. */
 
		/* Do this ASAP else the client has a chance of sending DoCommands with an incorrect company_id (=kick)! */
 
		MarkWholeScreenDirty();
 
	}
 

	
 
	return NETWORK_RECV_STATUS_OKAY;
 
}
 

	
 
DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CONFIG_UPDATE)
src/openttd.cpp
Show inline comments
 
@@ -348,13 +348,12 @@ static void LoadIntroGame()
 
	} else {
 
		SetLocalCompany(COMPANY_FIRST);
 
	}
 

	
 
	_pause_game = 0;
 
	_cursor.fix_at = false;
 
	MarkWholeScreenDirty();
 

	
 
	CheckForMissingGlyphsInLoadedLanguagePack();
 

	
 
	/* Play main theme */
 
	if (_music_driver->IsSongPlaying()) ResetMusic();
 
}
 
@@ -789,14 +788,12 @@ static void MakeNewGame(bool from_height
 
	GenerateWorld(from_heightmap ? GW_HEIGHTMAP : GW_NEWGAME, 1 << _settings_game.game_creation.map_x, 1 << _settings_game.game_creation.map_y);
 
}
 

	
 
static void MakeNewEditorWorldDone()
 
{
 
	SetLocalCompany(OWNER_NONE);
 

	
 
	MarkWholeScreenDirty();
 
}
 

	
 
static void MakeNewEditorWorld()
 
{
 
	_game_mode = GM_EDITOR;
 

	
src/order_gui.cpp
Show inline comments
 
@@ -1271,13 +1271,13 @@ static const Widget _other_orders_widget
 
	{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _other_orders_desc = {
 
	WDP_AUTO, WDP_AUTO, 386, 88, 386, 88,
 
	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE | WDF_CONSTRUCTION,
 
	_other_orders_widgets,
 
};
 

	
 
void ShowOrdersWindow(const Vehicle *v)
 
{
 
	DeleteWindowById(WC_VEHICLE_DETAILS, v->index, false);
src/rail_gui.cpp
Show inline comments
 
@@ -790,13 +790,13 @@ static const Widget _build_rail_widgets[
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_rail_desc = {
 
	WDP_ALIGN_TBR, 22, 350, 36, 350, 36,
 
	WC_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	_build_rail_widgets,
 
};
 

	
 

	
 
/** Configures the rail toolbar for railtype given
 
 * @param railtype the railtype to display
 
@@ -1332,21 +1332,21 @@ static const Widget _newstation_builder_
 
};
 

	
 
/** High level window description of the default station-build window */
 
static const WindowDesc _station_builder_desc = {
 
	WDP_AUTO, WDP_AUTO, 148, 200, 148, 200,
 
	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	_station_builder_widgets,
 
};
 

	
 
/** High level window description of the newGRF station-build window */
 
static const WindowDesc _newstation_builder_desc = {
 
	WDP_AUTO, WDP_AUTO, 148, 290, 148, 290,
 
	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	_newstation_builder_widgets,
 
};
 

	
 
/** Open station build window */
 
static void ShowStationBuilder(Window *parent)
 
{
 
@@ -1509,13 +1509,13 @@ static const Widget _signal_builder_widg
 
};
 

	
 
/** Signal selection window description */
 
static const WindowDesc _signal_builder_desc = {
 
	WDP_AUTO, WDP_AUTO, 154, 68, 154, 68,
 
	WC_BUILD_SIGNAL, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION,
 
	_signal_builder_widgets,
 
};
 

	
 
/**
 
 * Open the signal selection window
 
 */
 
@@ -1583,13 +1583,13 @@ static const Widget _build_depot_widgets
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_depot_desc = {
 
	WDP_AUTO, WDP_AUTO, 140, 122, 140, 122,
 
	WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	_build_depot_widgets,
 
};
 

	
 
static void ShowBuildTrainDepotPicker(Window *parent)
 
{
 
	new BuildRailDepotWindow(&_build_depot_desc, parent);
 
@@ -1684,13 +1684,13 @@ static const Widget _build_waypoint_widg
 
{    WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_waypoint_desc = {
 
	WDP_AUTO, WDP_AUTO, 344, 92, 344, 92,
 
	WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	_build_waypoint_widgets,
 
};
 

	
 
static void ShowBuildWaypointPicker(Window *parent)
 
{
 
	new BuildRailWaypointWindow(&_build_waypoint_desc, parent);
src/road_gui.cpp
Show inline comments
 
@@ -641,13 +641,13 @@ static const Widget _build_road_widgets[
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_road_desc = {
 
	WDP_ALIGN_TBR, 22, 263, 36, 263, 36,
 
	WC_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	_build_road_widgets,
 
};
 

	
 
/** Widget definition of the build tram toolbar */
 
static const Widget _build_tramway_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    10,     0,    13, STR_00C5,                       STR_018B_CLOSE_WINDOW},                // RTW_CLOSEBOX
 
@@ -669,13 +669,13 @@ static const Widget _build_tramway_widge
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_tramway_desc = {
 
	WDP_ALIGN_TBR, 22, 241, 36, 241, 36,
 
	WC_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	_build_tramway_widgets,
 
};
 

	
 
void ShowBuildRoadToolbar(RoadType roadtype)
 
{
 
	if (!IsValidCompanyID(_local_company)) return;
 
@@ -705,13 +705,13 @@ static const Widget _build_road_scen_wid
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_road_scen_desc = {
 
	WDP_AUTO, WDP_AUTO, 197, 36, 197, 36,
 
	WC_SCEN_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	_build_road_scen_widgets,
 
};
 

	
 
void ShowBuildRoadScenToolbar()
 
{
 
	_cur_roadtype = ROADTYPE_ROAD;
 
@@ -784,13 +784,13 @@ static const Widget _build_road_depot_wi
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_road_depot_desc = {
 
	WDP_AUTO, WDP_AUTO, 140, 122, 140, 122,
 
	WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	_build_road_depot_widgets,
 
};
 

	
 
static void ShowRoadDepotPicker(Window *parent)
 
{
 
	new BuildRoadDepotWindow(&_build_road_depot_desc, parent);
 
@@ -932,13 +932,13 @@ static const Widget _rv_station_picker_w
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _rv_station_picker_desc = {
 
	WDP_AUTO, WDP_AUTO, 207, 177, 207, 177,
 
	WC_BUS_STATION, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	_rv_station_picker_widgets,
 
};
 

	
 
static void ShowRVStationPicker(Window *parent, RoadStopType rs)
 
{
 
	new BuildRoadStationWindow(&_rv_station_picker_desc, parent, rs);
src/signs_gui.cpp
Show inline comments
 
@@ -329,13 +329,13 @@ static const Widget _query_sign_edit_wid
 
{ WIDGETS_END },
 
};
 

	
 
static const WindowDesc _query_sign_edit_desc = {
 
	190, 170, 260, 42, 260, 42,
 
	WC_QUERY_STRING, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	_query_sign_edit_widgets,
 
};
 

	
 
void HandleClickOnSign(const Sign *si)
 
{
 
	if (_ctrl_pressed && si->owner == _local_company) {
src/station_gui.cpp
Show inline comments
 
@@ -1207,13 +1207,13 @@ struct SelectStationWindow : Window {
 
	}
 
};
 

	
 
static const WindowDesc _select_station_desc = {
 
	WDP_AUTO, WDP_AUTO, 200, 92, 200, 182,
 
	WC_SELECT_STATION, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE | WDF_CONSTRUCTION,
 
	_select_station_widgets,
 
};
 

	
 

	
 
/**
 
 * Check whether we need to show the station selection window.
src/terraform_gui.cpp
Show inline comments
 
@@ -325,13 +325,13 @@ static const Widget _terraform_widgets[]
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _terraform_desc = {
 
	WDP_ALIGN_TBR, 22 + 36, 158, 36, 158, 36,
 
	WC_SCEN_LAND_GEN, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	_terraform_widgets,
 
};
 

	
 
void ShowTerraformToolbar(Window *link)
 
{
 
	if (!IsValidCompanyID(_local_company)) return;
 
@@ -706,13 +706,13 @@ struct ScenarioEditorLandscapeGeneration
 
	}
 
};
 

	
 
static const WindowDesc _scen_edit_land_gen_desc = {
 
	WDP_AUTO, WDP_AUTO, 163, 103, 163, 103,
 
	WC_SCEN_LAND_GEN, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	_scen_edit_land_gen_widgets,
 
};
 

	
 
void ShowEditorTerraformToolbar()
 
{
 
	AllocateWindowDescFront<ScenarioEditorLandscapeGenerationWindow>(&_scen_edit_land_gen_desc, 0);
src/timetable_gui.cpp
Show inline comments
 
@@ -354,13 +354,13 @@ static const Widget _timetable_widgets[]
 
	{    WIDGETS_END }
 
};
 

	
 
static const WindowDesc _timetable_desc = {
 
	WDP_AUTO, WDP_AUTO, 400, 130, 400, 130,
 
	WC_VEHICLE_TIMETABLE, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE | WDF_CONSTRUCTION,
 
	_timetable_widgets,
 
};
 

	
 
void ShowTimetableWindow(const Vehicle *v)
 
{
 
	DeleteWindowById(WC_VEHICLE_DETAILS, v->index, false);
src/tree_gui.cpp
Show inline comments
 
@@ -171,13 +171,13 @@ static const Widget _build_trees_widgets
 
{    WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_trees_desc = {
 
	WDP_AUTO, WDP_AUTO, 143, 184, 143, 184,
 
	WC_BUILD_TREES, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	_build_trees_widgets,
 
};
 

	
 
void ShowBuildTreesToolbar()
 
{
 
	if (_game_mode != GM_EDITOR && !IsValidCompanyID(_local_company)) return;
src/vehicle_gui.cpp
Show inline comments
 
@@ -411,13 +411,13 @@ static const Widget _vehicle_refit_widge
 
	{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _vehicle_refit_desc = {
 
	WDP_AUTO, WDP_AUTO, 240, 174, 240, 174,
 
	WC_VEHICLE_REFIT, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE | WDF_CONSTRUCTION,
 
	_vehicle_refit_widgets,
 
};
 

	
 
/** Show the refit window for a vehicle
 
* @param *v The vehicle to show the refit window for
 
* @param order of the vehicle ( ? )
src/window.cpp
Show inline comments
 
@@ -2188,12 +2188,34 @@ restart_search:
 
			delete w;
 
			goto restart_search;
 
		}
 
	}
 
}
 

	
 
/**
 
 * Delete all windows that are used for construction of vehicle etc.
 
 * Once done with that invalidate the others to ensure they get refreshed too.
 
 */
 
void DeleteConstructionWindows()
 
{
 
	Window *w;
 

	
 
restart_search:
 
	/* When we find the window to delete, we need to restart the search
 
	 * as deleting this window could cascade in deleting (many) others
 
	 * anywhere in the z-array */
 
	FOR_ALL_WINDOWS_FROM_BACK(w) {
 
		if (w->desc_flags & WDF_CONSTRUCTION) {
 
			delete w;
 
			goto restart_search;
 
		}
 
	}
 

	
 
	FOR_ALL_WINDOWS_FROM_BACK(w) w->SetDirty();
 
}
 

	
 
/** Delete all always on-top windows to get an empty screen */
 
void HideVitalWindows()
 
{
 
	DeleteWindowById(WC_TOOLBAR_MENU, 0);
 
	DeleteWindowById(WC_MAIN_TOOLBAR, 0);
 
	DeleteWindowById(WC_STATUS_BAR, 0);
src/window_func.h
Show inline comments
 
@@ -25,12 +25,13 @@ void InputLoop();
 
void InvalidateThisWindowData(Window *w, int data = 0);
 
void InvalidateWindowData(WindowClass cls, WindowNumber number, int data = 0);
 
void InvalidateWindowClassesData(WindowClass cls, int data = 0);
 

	
 
void DeleteNonVitalWindows();
 
void DeleteAllNonVitalWindows();
 
void DeleteConstructionWindows();
 
void HideVitalWindows();
 
void ShowVitalWindows();
 

	
 
void InvalidateWindowWidget(WindowClass cls, WindowNumber number, byte widget_index);
 
void InvalidateWindow(WindowClass cls, WindowNumber number);
 
void InvalidateWindowClasses(WindowClass cls);
src/window_gui.h
Show inline comments
 
@@ -121,12 +121,13 @@ struct WindowDesc {
 
 * Window default widget/window handling flags
 
 */
 
enum WindowDefaultFlag {
 
	WDF_STD_TOOLTIPS    =   1 << 0, ///< use standard routine when displaying tooltips
 
	WDF_DEF_WIDGET      =   1 << 1, ///< Default widget control for some widgets in the on click event, @see DispatchLeftClickEvent()
 
	WDF_STD_BTN         =   1 << 2, ///< Default handling for close and titlebar widgets (widget no 0 and 1)
 
	WDF_CONSTRUCTION    =   1 << 3, ///< This window is used for construction; close it whenever changing company.
 

	
 
	WDF_UNCLICK_BUTTONS =   1 << 4, ///< Unclick buttons when the window event times out
 
	WDF_STICKY_BUTTON   =   1 << 5, ///< Set window to sticky mode; they are not closed unless closed with 'X' (widget 2)
 
	WDF_RESIZABLE       =   1 << 6, ///< Window can be resized
 
	WDF_MODAL           =   1 << 7, ///< The window is a modal child of some other window, meaning the parent is 'inactive'
 
};
0 comments (0 inline, 0 general)