Changeset - r11368:058349c3a02c
src/ai/ai_gui.cpp
Show inline comments
 
@@ -186,30 +186,30 @@ static const Widget _ai_list_widgets[] =
 
{    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_MAUVE,   11,  199,    0,   13,  STR_AI_LIST_CAPTION,      STR_018C_WINDOW_TITLE_DRAG_THIS},   // AIL_WIDGET_CAPTION
 
{     WWT_MATRIX,     RESIZE_RB,  COLOUR_MAUVE,    0,  187,   14,  125,  0x501,                    STR_AI_AILIST_TIP},                 // AIL_WIDGET_LIST
 
{  WWT_SCROLLBAR,    RESIZE_LRB,  COLOUR_MAUVE,  188,  199,   14,  125,  0x0,                      STR_0190_SCROLL_BAR_SCROLLS_LIST }, // AIL_WIDGET_SCROLLBAR
 
{      WWT_PANEL,    RESIZE_RTB,  COLOUR_MAUVE,    0,  199,  126,  209,  0x0,                      STR_NULL},                          // AIL_WIDGET_INFO_BG
 
{ WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_MAUVE,    0,   99,  210,  221,  STR_AI_ACCEPT,            STR_AI_ACCEPT_TIP},                 // AIL_WIDGET_ACCEPT
 
{ WWT_PUSHTXTBTN,    RESIZE_RTB,  COLOUR_MAUVE,  100,  199,  210,  221,  STR_AI_CANCEL,            STR_AI_CANCEL_TIP},                 // AIL_WIDGET_CANCEL
 
{ WWT_PUSHTXTBTN,    RESIZE_RTB,  COLOUR_MAUVE,    0,  187,  222,  233,  STR_CONTENT_INTRO_BUTTON, STR_CONTENT_INTRO_BUTTON_TIP},      // AIL_WIDGET_DOWNLOAD_CONTENT
 
{  WWT_RESIZEBOX,   RESIZE_LRTB,  COLOUR_MAUVE,  188,  199,  222,  233,  STR_NULL,                 STR_RESIZE_BUTTON},                 // AIL_WIDGET_RESIZE
 
{   WIDGETS_END},
 
};
 

	
 
/* Window definition for the ai list window. */
 
static const WindowDesc _ai_list_desc = {
 
static const WindowDesc _ai_list_desc(
 
	WDP_CENTER, WDP_CENTER, 200, 234, 200, 234,
 
	WC_AI_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_ai_list_widgets
 
};
 
);
 

	
 
void ShowAIListWindow(CompanyID slot)
 
{
 
	DeleteWindowByClass(WC_AI_LIST);
 
	new AIListWindow(&_ai_list_desc, slot);
 
}
 

	
 
/**
 
 * Window for settings the parameters of an AI.
 
 */
 
struct AISettingsWindow : public Window {
 
	/** Enum referring to the widgets of the AI settings window */
 
@@ -368,58 +368,58 @@ struct AISettingsWindow : public Window 
 
static const Widget _ai_settings_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_MAUVE,    0,   10,    0,   13,  STR_00C5,                 STR_018B_CLOSE_WINDOW},             // AIS_WIDGET_CLOSEBOX
 
{    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_MAUVE,   11,  199,    0,   13,  STR_AI_SETTINGS_CAPTION,  STR_018C_WINDOW_TITLE_DRAG_THIS},   // AIS_WIDGET_CAPTION
 
{     WWT_MATRIX,     RESIZE_RB,  COLOUR_MAUVE,    0,  187,   14,  195,  0x501,                    STR_NULL},                          // AIS_WIDGET_BACKGROUND
 
{  WWT_SCROLLBAR,    RESIZE_LRB,  COLOUR_MAUVE,  188,  199,   14,  195,  0x0,                      STR_0190_SCROLL_BAR_SCROLLS_LIST }, // AIS_WIDGET_SCROLLBAR
 
{ WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_MAUVE,    0,   93,  196,  207,  STR_AI_CLOSE,             STR_NULL},                          // AIS_WIDGET_ACCEPT
 
{ WWT_PUSHTXTBTN,    RESIZE_RTB,  COLOUR_MAUVE,   94,  187,  196,  207,  STR_AI_RESET,             STR_NULL},                          // AIS_WIDGET_RESET
 
{  WWT_RESIZEBOX,   RESIZE_LRTB,  COLOUR_MAUVE,  188,  199,  196,  207,  STR_NULL,                 STR_RESIZE_BUTTON},                 // AIS_WIDGET_RESIZE
 
{   WIDGETS_END},
 
};
 

	
 
/* Window definition for the AI settings window. */
 
static const WindowDesc _ai_settings_desc = {
 
static const WindowDesc _ai_settings_desc(
 
	WDP_CENTER, WDP_CENTER, 200, 208, 500, 208,
 
	WC_AI_SETTINGS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_ai_settings_widgets
 
};
 
);
 

	
 
void ShowAISettingsWindow(CompanyID slot)
 
{
 
	DeleteWindowByClass(WC_AI_LIST);
 
	DeleteWindowByClass(WC_AI_SETTINGS);
 
	new AISettingsWindow(&_ai_settings_desc, slot);
 
}
 

	
 
/* Widget definition for the configure AI window. */
 
static const Widget _ai_config_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_MAUVE,    0,   10,    0,   13,  STR_00C5,               STR_018B_CLOSE_WINDOW},            // AIC_WIDGET_CLOSEBOX
 
{    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_MAUVE,   11,  299,    0,   13,  STR_AI_CONFIG_CAPTION,  STR_018C_WINDOW_TITLE_DRAG_THIS},  // AIC_WIDGET_CAPTION
 
{      WWT_PANEL,     RESIZE_RB,  COLOUR_MAUVE,    0,  299,   14,  171,  0x0,                    STR_NULL},                         // AIC_WIDGET_BACKGROUND
 
{     WWT_MATRIX,     RESIZE_RB,  COLOUR_MAUVE,    0,  287,   30,  141,  0x501,                  STR_AI_LIST_TIP},                  // AIC_WIDGET_LIST
 
{  WWT_SCROLLBAR,     RESIZE_LRB, COLOUR_MAUVE,  288,  299,   30,  141,  STR_NULL,               STR_0190_SCROLL_BAR_SCROLLS_LIST}, // AIC_WIDGET_SCROLLBAR
 
{ WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_YELLOW,  10,  102,  151,  162,  STR_AI_CHANGE,          STR_AI_CHANGE_TIP},                // AIC_WIDGET_CHANGE
 
{ WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_YELLOW, 103,  195,  151,  162,  STR_AI_CONFIGURE,       STR_AI_CONFIGURE_TIP},             // AIC_WIDGET_CONFIGURE
 
{ WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_YELLOW, 196,  289,  151,  162,  STR_AI_CLOSE,           STR_NULL},                         // AIC_WIDGET_CLOSE
 
{   WIDGETS_END},
 
};
 

	
 
/* Window definition for the configure AI window. */
 
static const WindowDesc _ai_config_desc = {
 
static const WindowDesc _ai_config_desc(
 
	WDP_CENTER, WDP_CENTER, 300, 172, 300, 172,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_ai_config_widgets
 
};
 
);
 

	
 
/**
 
 * Window to configure which AIs will start.
 
 */
 
struct AIConfigWindow : public Window {
 
	/** Enum referring to the widgets of the AI config window */
 
	enum AIConfigWindowWidgets {
 
		AIC_WIDGET_CLOSEBOX = 0, ///< Close window button
 
		AIC_WIDGET_CAPTION,      ///< Window caption
 
		AIC_WIDGET_BACKGROUND,   ///< Window background
 
		AIC_WIDGET_LIST,         ///< List with currently selected AIs
 
		AIC_WIDGET_SCROLLBAR,    ///< Scrollbar to scroll through the selected AIs
 
@@ -759,29 +759,29 @@ static const Widget _ai_debug_widgets[] 
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,   261,   297,    14,    26, 0x0,                        STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,    38,    27,    39, 0x0,                        STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,    39,    75,    27,    39, 0x0,                        STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,    76,   112,    27,    39, 0x0,                        STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,   113,   149,    27,    39, 0x0,                        STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,   150,   186,    27,    39, 0x0,                        STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,   187,   223,    27,    39, 0x0,                        STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,   224,   260,    27,    39, 0x0,                        STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, // AID_WIDGET_COMPANY_BUTTON_END
 
{  WWT_RESIZEBOX,   RESIZE_LRTB,  COLOUR_GREY,   287,   298,   229,   240, STR_NULL,                   STR_RESIZE_BUTTON},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _ai_debug_desc = {
 
static const WindowDesc _ai_debug_desc(
 
	WDP_AUTO, WDP_AUTO, 299, 241, 299, 241,
 
	WC_AI_DEBUG, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 
	_ai_debug_widgets
 
};
 
);
 

	
 
void ShowAIDebugWindow(CompanyID show_company)
 
{
 
	if (!_networking || _network_server) {
 
		AIDebugWindow *w = (AIDebugWindow *)BringWindowToFrontById(WC_AI_DEBUG, 0);
 
		if (w == NULL) w = new AIDebugWindow(&_ai_debug_desc, 0);
 
		if (show_company != INVALID_COMPANY) w->ChangeToAI(show_company);
 
	} else {
 
		ShowErrorMessage(INVALID_STRING_ID, STR_AI_DEBUG_SERVER_ONLY, 0, 0);
 
	}
 
}
src/airport_gui.cpp
Show inline comments
 
@@ -129,30 +129,30 @@ struct BuildAirToolbarWindow : Window {
 
};
 

	
 
static const Widget _air_toolbar_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,   COLOUR_DARK_GREEN,     0,    10,     0,    13, STR_00C5,            STR_018B_CLOSE_WINDOW },
 
{    WWT_CAPTION,   RESIZE_NONE,   COLOUR_DARK_GREEN,    11,    51,     0,    13, STR_A000_AIRPORTS,   STR_018C_WINDOW_TITLE_DRAG_THIS },
 
{  WWT_STICKYBOX,   RESIZE_NONE,   COLOUR_DARK_GREEN,    52,    63,     0,    13, 0x0,                 STR_STICKY_BUTTON },
 
{     WWT_IMGBTN,   RESIZE_NONE,   COLOUR_DARK_GREEN,     0,    41,    14,    35, SPR_IMG_AIRPORT,     STR_A01E_BUILD_AIRPORT },
 
{     WWT_IMGBTN,   RESIZE_NONE,   COLOUR_DARK_GREEN,    42,    63,    14,    35, SPR_IMG_DYNAMITE,    STR_018D_DEMOLISH_BUILDINGS_ETC },
 
{   WIDGETS_END},
 
};
 

	
 

	
 
static const WindowDesc _air_toolbar_desc = {
 
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_CONSTRUCTION,
 
	_air_toolbar_widgets,
 
};
 
	_air_toolbar_widgets
 
);
 

	
 
void ShowBuildAirToolbar()
 
{
 
	if (!IsValidCompanyID(_local_company)) return;
 

	
 
	DeleteWindowByClass(WC_BUILD_TOOLBAR);
 
	AllocateWindowDescFront<BuildAirToolbarWindow>(&_air_toolbar_desc, TRANSPORT_AIR);
 
}
 

	
 
class AirportPickerWindow : public PickerWindowBase {
 

	
 
	enum {
 
@@ -290,28 +290,28 @@ static const Widget _build_airport_picke
 
{    WWT_TEXTBTN,   RESIZE_NONE,   COLOUR_GREY,         2,   145,    77,    88, STR_METRO_AIRPORT ,               STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT},
 
{    WWT_TEXTBTN,   RESIZE_NONE,   COLOUR_GREY,         2,   145,   103,   114, STR_INTERNATIONAL_AIRPORT,        STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT},
 
{    WWT_TEXTBTN,   RESIZE_NONE,   COLOUR_GREY,         2,   145,    39,    50, STR_COMMUTER_AIRPORT,             STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT},
 
{    WWT_TEXTBTN,   RESIZE_NONE,   COLOUR_GREY,         2,   145,   165,   176, STR_HELIDEPOT,                    STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT},
 
{    WWT_TEXTBTN,   RESIZE_NONE,   COLOUR_GREY,         2,   145,   115,   126, STR_INTERCONTINENTAL_AIRPORT,     STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT},
 
{    WWT_TEXTBTN,   RESIZE_NONE,   COLOUR_GREY,         2,   145,   153,   164, STR_HELISTATION,                  STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT},
 
{    WWT_TEXTBTN,   RESIZE_NONE,   COLOUR_GREY,        14,    73,   191,   202, STR_02DB_OFF,                     STR_3065_DON_T_HIGHLIGHT_COVERAGE},
 
{    WWT_TEXTBTN,   RESIZE_NONE,   COLOUR_GREY,        74,   133,   191,   202, STR_02DA_ON,                      STR_3064_HIGHLIGHT_COVERAGE_AREA},
 
{      WWT_LABEL,   RESIZE_NONE,   COLOUR_DARK_GREEN,   0,   147,   178,   191, STR_3066_COVERAGE_AREA_HIGHLIGHT, STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_airport_desc = {
 
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_CONSTRUCTION,
 
	_build_airport_picker_widgets,
 
};
 
	_build_airport_picker_widgets
 
);
 

	
 
static void ShowBuildAirportPicker(Window *parent)
 
{
 
	new AirportPickerWindow(&_build_airport_desc, parent);
 
}
 

	
 
void InitializeAirportGui()
 
{
 
	_selected_airport_type = AT_SMALL;
 
}
src/autoreplace_gui.cpp
Show inline comments
 
@@ -461,33 +461,33 @@ static const Widget _replace_vehicle_wid
 
{      WWT_PANEL,    RESIZE_RTB,  COLOUR_GREY,   139,   305,   106,   117, 0x0,                             STR_REPLACE_HELP_REPLACE_INFO_TAB},
 
{ WWT_PUSHTXTBTN,   RESIZE_LRTB,  COLOUR_GREY,   306,   443,   106,   117, STR_REPLACE_VEHICLES_STOP,       STR_REPLACE_HELP_STOP_BUTTON},
 
{  WWT_RESIZEBOX,   RESIZE_LRTB,  COLOUR_GREY,   444,   455,   106,   117, STR_NULL,                        STR_RESIZE_BUTTON},
 

	
 
{ WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_GREY,     0,   138,   128,   139, STR_REPLACE_ENGINE_WAGON_SELECT, STR_REPLACE_ENGINE_WAGON_SELECT_HELP},
 
{      WWT_PANEL,     RESIZE_TB,  COLOUR_GREY,   139,   153,   128,   139, 0x0,                             STR_NULL},
 
{   WWT_DROPDOWN,    RESIZE_RTB,  COLOUR_GREY,   154,   289,   128,   139, 0x0,                             STR_REPLACE_HELP_RAILTYPE},
 
{      WWT_PANEL,   RESIZE_LRTB,  COLOUR_GREY,   290,   305,   128,   139, 0x0,                             STR_NULL},
 
{ WWT_PUSHTXTBTN,   RESIZE_LRTB,  COLOUR_GREY,   306,   443,   128,   139, STR_REPLACE_REMOVE_WAGON,        STR_REPLACE_REMOVE_WAGON_HELP},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _replace_rail_vehicle_desc = {
 
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_CONSTRUCTION,
 
	_replace_vehicle_widgets,
 
};
 
	_replace_vehicle_widgets
 
);
 

	
 
static const WindowDesc _replace_vehicle_desc = {
 
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_CONSTRUCTION,
 
	_replace_vehicle_widgets,
 
};
 
	_replace_vehicle_widgets
 
);
 

	
 
RailType ReplaceVehicleWindow::sel_railtype = RAILTYPE_RAIL;
 

	
 
void ShowReplaceGroupVehicleWindow(GroupID id_g, VehicleType vehicletype)
 
{
 
	DeleteWindowById(WC_REPLACE_VEHICLE, vehicletype);
 
	new ReplaceVehicleWindow(vehicletype == VEH_TRAIN ? &_replace_rail_vehicle_desc : &_replace_vehicle_desc, vehicletype, id_g);
 
}
src/bridge_gui.cpp
Show inline comments
 
@@ -259,30 +259,30 @@ static const Widget _build_bridge_widget
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,  11, 199,   0,  13, STR_100D_SELECT_RAIL_BRIDGE, STR_018C_WINDOW_TITLE_DRAG_THIS},  // BBSW_CAPTION
 

	
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,  80,  14,  25, STR_SORT_BY,                 STR_SORT_ORDER_TIP},               // BBSW_DROPDOWN_ORDER
 
{   WWT_DROPDOWN,   RESIZE_NONE,  COLOUR_DARK_GREEN,  81, 199,  14,  25, 0x0,                         STR_SORT_CRITERIA_TIP},            // BBSW_DROPDOWN_CRITERIA
 

	
 
{     WWT_MATRIX, RESIZE_BOTTOM,  COLOUR_DARK_GREEN,   0, 187,  26, 113, 0x401,                       STR_101F_BRIDGE_SELECTION_CLICK},  // BBSW_BRIDGE_LIST
 
{  WWT_SCROLLBAR, RESIZE_BOTTOM,  COLOUR_DARK_GREEN, 188, 199,  26, 101, 0x0,                         STR_0190_SCROLL_BAR_SCROLLS_LIST}, // BBSW_SCROLLBAR
 
{  WWT_RESIZEBOX,     RESIZE_TB,  COLOUR_DARK_GREEN, 188, 199, 102, 113, 0x0,                         STR_RESIZE_BUTTON},                // BBSW_RESIZEBOX
 
{   WIDGETS_END},
 
};
 

	
 
/* Window definition for the rail bridge selection window */
 
static const WindowDesc _build_bridge_desc = {
 
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_CONSTRUCTION,
 
	_build_bridge_widgets,
 
};
 
	_build_bridge_widgets
 
);
 

	
 
/**
 
 * Prepare the data for the build a bridge window.
 
 *  If we can't build a bridge under the given conditions
 
 *  show an error message.
 
 *
 
 * @parma start The start tile of the bridge
 
 * @param end The end tile of the bridge
 
 * @param transport_type The transport type
 
 * @param road_rail_type The road/rail type
 
 */
 
void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transport_type, byte road_rail_type)
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -1078,30 +1078,30 @@ struct BuildVehicleWindow : Window {
 
	virtual void OnResize(Point new_size, Point delta)
 
	{
 
		if (delta.x != 0 && !this->listview_mode) {
 
			ResizeButtons(this, BUILD_VEHICLE_WIDGET_BUILD, BUILD_VEHICLE_WIDGET_RENAME);
 
		}
 
		if (delta.y == 0) return;
 

	
 
		this->vscroll.cap += delta.y / (int)GetVehicleListHeight(this->vehicle_type);
 
		this->widget[BUILD_VEHICLE_WIDGET_LIST].data = (this->vscroll.cap << 8) + 1;
 
	}
 
};
 

	
 
static const WindowDesc _build_vehicle_desc = {
 
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_CONSTRUCTION,
 
	_build_vehicle_widgets,
 
};
 
	_build_vehicle_widgets
 
);
 

	
 
void ShowBuildVehicleWindow(TileIndex tile, VehicleType type)
 
{
 
	/* We want to be able to open both Available Train as Available Ships,
 
	 *  so if tile == INVALID_TILE (Available XXX Window), use 'type' as unique number.
 
	 *  As it always is a low value, it won't collide with any real tile
 
	 *  number. */
 
	uint num = (tile == INVALID_TILE) ? (int)type : tile;
 

	
 
	assert(IsCompanyBuildableVehicleType(type));
 

	
 
	DeleteWindowById(WC_BUILD_VEHICLE, num);
src/cheat_gui.cpp
Show inline comments
 
@@ -226,25 +226,25 @@ struct CheatWindow : Window {
 
		this->flags4 |= WF_TIMEOUT_BEGIN;
 

	
 
		SetDirty();
 
	}
 

	
 
	virtual void OnTimeout()
 
	{
 
		this->clicked = 0;
 
		this->SetDirty();
 
	}
 
};
 

	
 
static const WindowDesc _cheats_desc = {
 
static const WindowDesc _cheats_desc(
 
	240, 22, 400, 170, 400, 170,
 
	WC_CHEATS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_cheat_widgets,
 
};
 
	_cheat_widgets
 
);
 

	
 

	
 
void ShowCheatWindow()
 
{
 
	DeleteWindowById(WC_CHEATS, 0);
 
	new CheatWindow(&_cheats_desc);
 
}
src/company_gui.cpp
Show inline comments
 
@@ -301,37 +301,37 @@ struct CompanyFinancesWindow : Window {
 

	
 
			case CFW_WIDGET_INCREASE_LOAN: // increase loan
 
				DoCommandP(0, 0, _ctrl_pressed, CMD_INCREASE_LOAN | CMD_MSG(STR_702C_CAN_T_BORROW_ANY_MORE_MONEY));
 
				break;
 

	
 
			case CFW_WIDGET_REPAY_LOAN: // repay loan
 
				DoCommandP(0, 0, _ctrl_pressed, CMD_DECREASE_LOAN | CMD_MSG(STR_702F_CAN_T_REPAY_LOAN));
 
				break;
 
		}
 
	}
 
};
 

	
 
static const WindowDesc _company_finances_desc = {
 
static const WindowDesc _company_finances_desc(
 
	WDP_AUTO, WDP_AUTO, 407, 60 + 10, 407, 60 + 10,
 
	WC_FINANCES, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 
	_company_finances_widgets,
 
};
 
	_company_finances_widgets
 
);
 

	
 
static const WindowDesc _company_finances_small_desc = {
 
static const WindowDesc _company_finances_small_desc(
 
	WDP_AUTO, WDP_AUTO, 280, 60, 280, 60,
 
	WC_FINANCES, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 
	_company_finances_small_widgets,
 
};
 
	_company_finances_small_widgets
 
);
 

	
 
/**
 
 * Open the small/large finance window of the company
 
 *
 
 * @param company        the company who's finances are requested to be seen
 
 * @param show_small     show large or small version opf the window
 
 * @param show_stickied  previous "stickyness" of the window
 
 * @param top            previous top position of the window
 
 * @param left           previous left position of the window
 
 *
 
 * @pre is company a valid company
 
 */
 
@@ -617,30 +617,30 @@ static const Widget _select_company_live
 
{   WWT_IMGBTN, RESIZE_NONE,  COLOUR_GREY,  22,  43,  14,  35, SPR_IMG_TRAINLIST,          STR_LIVERY_TRAIN_TIP },
 
{   WWT_IMGBTN, RESIZE_NONE,  COLOUR_GREY,  44,  65,  14,  35, SPR_IMG_TRUCKLIST,          STR_LIVERY_ROADVEH_TIP },
 
{   WWT_IMGBTN, RESIZE_NONE,  COLOUR_GREY,  66,  87,  14,  35, SPR_IMG_SHIPLIST,           STR_LIVERY_SHIP_TIP },
 
{   WWT_IMGBTN, RESIZE_NONE,  COLOUR_GREY,  88, 109,  14,  35, SPR_IMG_AIRPLANESLIST,      STR_LIVERY_AIRCRAFT_TIP },
 
{    WWT_PANEL, RESIZE_NONE,  COLOUR_GREY, 110, 399,  14,  35, 0x0,                        STR_NULL },
 
{    WWT_PANEL, RESIZE_NONE,  COLOUR_GREY,   0, 149,  36,  47, 0x0,                        STR_NULL },
 
{ WWT_DROPDOWN, RESIZE_NONE,  COLOUR_GREY, 150, 274,  36,  47, STR_02BD,                   STR_LIVERY_PRIMARY_TIP },
 
{ WWT_DROPDOWN, RESIZE_NONE,  COLOUR_GREY, 275, 399,  36,  47, STR_02E1,                   STR_LIVERY_SECONDARY_TIP },
 
{   WWT_MATRIX, RESIZE_NONE,  COLOUR_GREY,   0, 399,  48,  48 + 1 * 14, (1 << 8) | 1,      STR_LIVERY_PANEL_TIP },
 
{ WIDGETS_END },
 
};
 

	
 
static const WindowDesc _select_company_livery_desc = {
 
static const WindowDesc _select_company_livery_desc(
 
	WDP_AUTO, WDP_AUTO, 400, 49 + 1 * 14, 400, 49 + 1 * 14,
 
	WC_COMPANY_COLOUR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_select_company_livery_widgets,
 
};
 
	_select_company_livery_widgets
 
);
 

	
 
/**
 
 * Draws the face of a company manager's face.
 
 * @param cmf   the company manager's face
 
 * @param colour the (background) colour of the gradient
 
 * @param x     x-position to draw the face
 
 * @param y     y-position to draw the face
 
 */
 
void DrawCompanyManagerFace(CompanyManagerFace cmf, int colour, int x, int y)
 
{
 
	GenderEthnicity ge = (GenderEthnicity)GetCompanyManagerFaceBits(cmf, CMFV_GEN_ETHN, GE_WM);
 

	
 
@@ -1084,38 +1084,38 @@ public:
 
			this->face = strtoul(str, NULL, 10);
 
			ScaleAllCompanyManagerFaceBits(this->face);
 
			ShowErrorMessage(INVALID_STRING_ID, STR_FACE_FACECODE_SET, 0, 0);
 
			this->UpdateData();
 
			this->SetDirty();
 
		} else {
 
			ShowErrorMessage(INVALID_STRING_ID, STR_FACE_FACECODE_ERR, 0, 0);
 
		}
 
	}
 
};
 

	
 
/** normal/simple company manager face selection window description */
 
static const WindowDesc _select_company_manager_face_desc = {
 
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_CONSTRUCTION,
 
	_select_company_manager_face_widgets,
 
};
 
	_select_company_manager_face_widgets
 
);
 

	
 
/** advanced company manager face selection window description */
 
static const WindowDesc _select_company_manager_face_adv_desc = {
 
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_CONSTRUCTION,
 
	_select_company_manager_face_adv_widgets,
 
};
 
	_select_company_manager_face_adv_widgets
 
);
 

	
 
/**
 
 * Open the simple/advanced company manager face selection window
 
 *
 
 * @param parent the parent company window
 
 * @param adv    simple or advanced face selection window
 
 * @param top    previous top position of the window
 
 * @param left   previous left position of the window
 
 */
 
static void DoSelectCompanyManagerFace(Window *parent, bool adv, int top, int left)
 
{
 
	if (!IsValidCompanyID((CompanyID)parent->window_number)) return;
 
@@ -1447,30 +1447,30 @@ struct CompanyWindow : Window
 
				DoCommandP(0, 0, 0, CMD_RENAME_COMPANY | CMD_MSG(STR_700C_CAN_T_CHANGE_COMPANY_NAME), NULL, str);
 
				break;
 

	
 
#ifdef ENABLE_NETWORK
 
			case CW_WIDGET_COMPANY_JOIN:
 
				NetworkClientRequestMove((CompanyID)this->window_number, str);
 
				break;
 
#endif /* ENABLE_NETWORK */
 
		}
 
	}
 
};
 

	
 
static const WindowDesc _company_desc = {
 
static const WindowDesc _company_desc(
 
	WDP_AUTO, WDP_AUTO, 360, 170, 360, 170,
 
	WC_COMPANY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_company_widgets,
 
};
 
	_company_widgets
 
);
 

	
 
void ShowCompany(CompanyID company)
 
{
 
	if (!IsValidCompanyID(company)) return;
 

	
 
	AllocateWindowDescFront<CompanyWindow>(&_company_desc, company);
 
}
 

	
 

	
 

	
 
struct BuyCompanyWindow : Window {
 
	BuyCompanyWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number)
 
@@ -1506,24 +1506,24 @@ struct BuyCompanyWindow : Window {
 
	}
 
};
 

	
 
static const Widget _buy_company_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_LIGHT_BLUE,     0,    10,     0,    13, STR_00C5,              STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_LIGHT_BLUE,    11,   333,     0,    13, STR_00B3_MESSAGE_FROM, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_LIGHT_BLUE,     0,   333,    14,   136, 0x0,                   STR_NULL},
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_LIGHT_BLUE,   148,   207,   117,   128, STR_00C9_NO,           STR_NULL},
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_LIGHT_BLUE,   218,   277,   117,   128, STR_00C8_YES,          STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _buy_company_desc = {
 
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_CONSTRUCTION,
 
	_buy_company_widgets,
 
};
 
	_buy_company_widgets
 
);
 

	
 

	
 
void ShowBuyCompanyDialog(CompanyID company)
 
{
 
	AllocateWindowDescFront<BuyCompanyWindow>(&_buy_company_desc, company);
 
}
src/console_gui.cpp
Show inline comments
 
@@ -308,30 +308,30 @@ struct IConsoleWindow : Window
 
				}
 
		}
 
		return ES_HANDLED;
 
	}
 
};
 

	
 
int IConsoleWindow::scroll = 0;
 

	
 
static const Widget _iconsole_window_widgets[] = {
 
	{WIDGETS_END}
 
};
 

	
 
static const WindowDesc _iconsole_window_desc = {
 
static const WindowDesc _iconsole_window_desc(
 
	0, 0, 2, 2, 2, 2,
 
	WC_CONSOLE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_iconsole_window_widgets,
 
};
 
	_iconsole_window_widgets
 
);
 

	
 
void IConsoleGUIInit()
 
{
 
	_iconsole_historypos = ICON_HISTORY_SIZE - 1;
 
	_iconsole_mode = ICONSOLE_CLOSED;
 

	
 
	IConsoleLine::Reset();
 
	memset(_iconsole_history, 0, sizeof(_iconsole_history));
 

	
 
	_iconsole_cmdline.buf = CallocT<char>(ICON_CMDLN_SIZE); // create buffer and zero it
 
	_iconsole_cmdline.maxsize = ICON_CMDLN_SIZE;
 

	
src/depot_gui.cpp
Show inline comments
 
@@ -88,51 +88,51 @@ static const Widget _depot_widgets[] = {
 
	 * This calculation is based on right in DEPOT_WIDGET_LOCATION and it presumes left of DEPOT_WIDGET_BUILD is 0            */
 
	{ WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_GREY,     0,     0,    15,    26, 0x0,                 STR_NULL},                         // DEPOT_WIDGET_BUILD
 
	{    WWT_TEXTBTN,     RESIZE_TB,  COLOUR_GREY,     0,     0,    15,    26, 0x0,                 STR_NULL},                         // DEPOT_WIDGET_CLONE
 
	{ WWT_PUSHTXTBTN,    RESIZE_RTB,  COLOUR_GREY,     0,   -12,    15,    26, STR_00E4_LOCATION,   STR_NULL},                         // DEPOT_WIDGET_LOCATION
 
	{ WWT_PUSHTXTBTN,   RESIZE_LRTB,  COLOUR_GREY,   -11,     0,    15,    26, 0x0,                 STR_NULL},                         // DEPOT_WIDGET_VEHICLE_LIST
 
	{ WWT_PUSHIMGBTN,   RESIZE_LRTB,  COLOUR_GREY,     1,    11,    15,    26, SPR_FLAG_VEH_STOPPED,STR_NULL},                         // DEPOT_WIDGET_STOP_ALL
 
	{ WWT_PUSHIMGBTN,   RESIZE_LRTB,  COLOUR_GREY,    12,    23,    15,    26, SPR_FLAG_VEH_RUNNING,STR_NULL},                         // DEPOT_WIDGET_START_ALL
 
	{  WWT_RESIZEBOX,   RESIZE_LRTB,  COLOUR_GREY,    24,    35,    15,    26, 0x0,                 STR_RESIZE_BUTTON},                // DEPOT_WIDGET_RESIZE
 
	{   WIDGETS_END},
 
};
 

	
 

	
 
static const WindowDesc _train_depot_desc = {
 
static const WindowDesc _train_depot_desc(
 
	WDP_AUTO, WDP_AUTO, 36, 27, 362, 123,
 
	WC_VEHICLE_DEPOT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_depot_widgets,
 
};
 
	_depot_widgets
 
);
 

	
 
static const WindowDesc _road_depot_desc = {
 
static const WindowDesc _road_depot_desc(
 
	WDP_AUTO, WDP_AUTO, 36, 27, 316, 97,
 
	WC_VEHICLE_DEPOT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_depot_widgets,
 
};
 
	_depot_widgets
 
);
 

	
 
static const WindowDesc _ship_depot_desc = {
 
static const WindowDesc _ship_depot_desc(
 
	WDP_AUTO, WDP_AUTO, 36, 27, 306, 99,
 
	WC_VEHICLE_DEPOT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_depot_widgets,
 
};
 
	_depot_widgets
 
);
 

	
 
static const WindowDesc _aircraft_depot_desc = {
 
static const WindowDesc _aircraft_depot_desc(
 
	WDP_AUTO, WDP_AUTO, 36, 27, 332, 99,
 
	WC_VEHICLE_DEPOT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_depot_widgets,
 
};
 
	_depot_widgets
 
);
 

	
 
extern int WagonLengthToPixels(int len);
 
extern void DepotSortList(VehicleList *list);
 

	
 
/**
 
 * This is the Callback method after the cloning attempt of a vehicle
 
 * @param success indicates completion (or not) of the operation
 
 * @param tile unused
 
 * @param p1 unused
 
 * @param p2 unused
 
 */
 
void CcCloneVehicle(bool success, TileIndex tile, uint32 p1, uint32 p2)
src/dock_gui.cpp
Show inline comments
 
@@ -265,30 +265,30 @@ static const Widget _build_docks_toolb_w
 

	
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,    44,    48,    14,    35, 0x0,                             STR_NULL},                               // DTW_SEPERATOR
 

	
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    49,    70,    14,    35, SPR_IMG_DYNAMITE,                STR_018D_DEMOLISH_BUILDINGS_ETC},        // DTW_DEMOLISH
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    71,    92,    14,    35, SPR_IMG_SHIP_DEPOT,              STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING}, // DTW_DEPOT
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    93,   114,    14,    35, SPR_IMG_SHIP_DOCK,               STR_981D_BUILD_SHIP_DOCK},               // DTW_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   115,   136,    14,    35, SPR_IMG_BOUY,                    STR_9834_POSITION_BUOY_WHICH_CAN},       // DTW_BUOY
 
{     WWT_EMPTY,    RESIZE_NONE,  COLOUR_DARK_GREEN,     0,     0,     0,     0, 0x0,                             STR_NULL},                               // DTW_RIVER
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   137,   159,    14,    35, SPR_IMG_AQUEDUCT,                STR_BUILD_AQUEDUCT},                     // DTW_BUILD_AQUEDUCT
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_docks_toolbar_desc = {
 
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_CONSTRUCTION,
 
	_build_docks_toolb_widgets,
 
};
 
	_build_docks_toolb_widgets
 
);
 

	
 
void ShowBuildDocksToolbar()
 
{
 
	if (!IsValidCompanyID(_local_company)) return;
 

	
 
	DeleteWindowByClass(WC_BUILD_TOOLBAR);
 
	AllocateWindowDescFront<BuildDocksToolbarWindow>(&_build_docks_toolbar_desc, TRANSPORT_WATER);
 
}
 

	
 
/* Widget definition for the build docks in scenario editor window */
 
static const Widget _build_docks_scen_toolb_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    10,     0,    13, STR_00C5,                           STR_018B_CLOSE_WINDOW},           // DTW_CLOSEBOX
 
@@ -300,30 +300,30 @@ static const Widget _build_docks_scen_to
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,    44,    48,    14,    35, 0x0,                                STR_NULL},                        // DTW_SEPERATOR
 

	
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    49,    70,    14,    35, SPR_IMG_DYNAMITE,                   STR_018D_DEMOLISH_BUILDINGS_ETC}, // DTW_DEMOLISH
 
{     WWT_EMPTY,    RESIZE_NONE,  COLOUR_DARK_GREEN,     0,     0,     0,     0, 0x0,                                STR_NULL},                        // DTW_DEPOT
 
{     WWT_EMPTY,    RESIZE_NONE,  COLOUR_DARK_GREEN,     0,     0,     0,     0, 0x0,                                STR_NULL},                        // DTW_STATION
 
{     WWT_EMPTY,    RESIZE_NONE,  COLOUR_DARK_GREEN,     0,     0,     0,     0, 0x0,                                STR_NULL},                        // DTW_BUOY
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    71,    92,    14,    35, SPR_IMG_BUILD_RIVER,                STR_CREATE_RIVER},                // DTW_RIVER
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    93,   114,    14,    35, SPR_IMG_AQUEDUCT,                   STR_BUILD_AQUEDUCT},              // DTW_BUILD_AQUEDUCT
 
{   WIDGETS_END},
 
};
 

	
 
/* Window definition for the build docks in scenario editor window */
 
static const WindowDesc _build_docks_scen_toolbar_desc = {
 
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_CONSTRUCTION,
 
	_build_docks_scen_toolb_widgets,
 
};
 
	_build_docks_scen_toolb_widgets
 
);
 

	
 
void ShowBuildDocksScenToolbar()
 
{
 
	AllocateWindowDescFront<BuildDocksToolbarWindow>(&_build_docks_scen_toolbar_desc, TRANSPORT_WATER);
 
}
 

	
 
struct BuildDocksStationWindow : public PickerWindowBase {
 
private:
 
	enum BuildDockStationWidgets {
 
		BDSW_CLOSE,
 
		BDSW_CAPTION,
 
		BDSW_BACKGROUND,
 
@@ -386,30 +386,30 @@ public:
 
};
 

	
 
static const Widget _build_dock_station_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    10,     0,    13, STR_00C5,                         STR_018B_CLOSE_WINDOW},             // BDSW_CLOSE
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,    11,   147,     0,    13, STR_3068_DOCK,                    STR_018C_WINDOW_TITLE_DRAG_THIS},   // BDSW_CAPTION
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,   147,    14,    74, 0x0,                              STR_NULL},                          // BDSW_BACKGROUND
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,          14,    73,    30,    40, STR_02DB_OFF,                     STR_3065_DON_T_HIGHLIGHT_COVERAGE}, // BDSW_LT_OFF
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,          74,   133,    30,    40, STR_02DA_ON,                      STR_3064_HIGHLIGHT_COVERAGE_AREA},  // BDSW_LT_ON
 
{      WWT_LABEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,   147,    17,    30, STR_3066_COVERAGE_AREA_HIGHLIGHT, STR_NULL},                          // BDSW_INFO
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_dock_station_desc = {
 
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_CONSTRUCTION,
 
	_build_dock_station_widgets,
 
};
 
	_build_dock_station_widgets
 
);
 

	
 
static void ShowBuildDockStationPicker(Window *parent)
 
{
 
	new BuildDocksStationWindow(&_build_dock_station_desc, parent);
 
}
 

	
 
struct BuildDocksDepotWindow : public PickerWindowBase {
 
private:
 
	enum BuildDockDepotWidgets {
 
		BDDW_CLOSE,
 
		BDDW_CAPTION,
 
		BDDW_BACKGROUND,
 
@@ -460,30 +460,30 @@ public:
 
	}
 
};
 

	
 
static const Widget _build_docks_depot_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    10,     0,    13, STR_00C5,                        STR_018B_CLOSE_WINDOW},                  // BDDW_CLOSE
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,    11,   203,     0,    13, STR_3800_SHIP_DEPOT_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS},        // BDDW_CAPTION
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,   203,    14,    85, 0x0,                             STR_NULL},                               // BDDW_BACKGROUND
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,           3,   100,    17,    82, 0x0,                             STR_3803_SELECT_SHIP_DEPOT_ORIENTATION}, // BDDW_X
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         103,   200,    17,    82, 0x0,                             STR_3803_SELECT_SHIP_DEPOT_ORIENTATION}, // BDDW_Y
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_docks_depot_desc = {
 
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_CONSTRUCTION,
 
	_build_docks_depot_widgets,
 
};
 
	_build_docks_depot_widgets
 
);
 

	
 

	
 
static void ShowBuildDocksDepotPicker(Window *parent)
 
{
 
	new BuildDocksDepotWindow(&_build_docks_depot_desc, parent);
 
}
 

	
 

	
 
void InitializeDockGui()
 
{
 
	_ship_depot_direction = AXIS_X;
 
}
src/engine_gui.cpp
Show inline comments
 
@@ -88,30 +88,30 @@ struct EnginePreviewWindow : Window {
 
	{
 
		switch (widget) {
 
			case 4:
 
				DoCommandP(0, this->window_number, 0, CMD_WANT_ENGINE_PREVIEW);
 
				/* Fallthrough */
 
			case 3:
 
				delete this;
 
				break;
 
		}
 
	}
 
};
 

	
 
static const WindowDesc _engine_preview_desc = {
 
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_CONSTRUCTION,
 
	_engine_preview_widgets,
 
};
 
	_engine_preview_widgets
 
);
 

	
 

	
 
void ShowEnginePreviewWindow(EngineID engine)
 
{
 
	AllocateWindowDescFront<EnginePreviewWindow>(&_engine_preview_desc, engine);
 
}
 

	
 
uint GetTotalCapacityOfArticulatedParts(EngineID engine, VehicleType type)
 
{
 
	uint total = 0;
 

	
 
	uint16 *cap = GetCapacityOfArticulatedParts(engine, type);
src/genworld_gui.cpp
Show inline comments
 
@@ -628,37 +628,37 @@ struct GenerateLandscapeWindow : public 
 
					break;
 

	
 
				case GLAND_TOWN_PULLDOWN:
 
					_settings_newgame.game_creation.custom_town_number = Clamp(value, 1, CUSTOM_TOWN_MAX_NUMBER);
 
					break;
 
			}
 

	
 
			this->SetDirty();
 
		}
 
	}
 
};
 

	
 
static const WindowDesc _generate_landscape_desc = {
 
static const WindowDesc _generate_landscape_desc(
 
	WDP_CENTER, WDP_CENTER, 338, 313, 338, 313,
 
	WC_GENERATE_LANDSCAPE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_generate_landscape_widgets,
 
};
 
	_generate_landscape_widgets
 
);
 

	
 
static const WindowDesc _heightmap_load_desc = {
 
static const WindowDesc _heightmap_load_desc(
 
	WDP_CENTER, WDP_CENTER, 338, 236, 338, 236,
 
	WC_GENERATE_LANDSCAPE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS,
 
	_heightmap_load_widgets,
 
};
 
	_heightmap_load_widgets
 
);
 

	
 
static void _ShowGenerateLandscape(glwp_modes mode)
 
{
 
	uint x = 0;
 
	uint y = 0;
 

	
 
	DeleteWindowByClass(WC_GENERATE_LANDSCAPE);
 

	
 
	/* Always give a new seed if not editor */
 
	if (_game_mode != GM_EDITOR) _settings_newgame.game_creation.generation_seed = InteractiveRandom();
 

	
 
	if (mode == GLWP_HEIGHTMAP) {
 
@@ -876,51 +876,51 @@ static const Widget _create_scenario_wid
 
{     WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 216, 227, 113, 124, SPR_ARROW_DOWN,          STR_029E_MOVE_THE_STARTING_DATE},        // CSCEN_START_DATE_DOWN
 
{    WWT_TEXTBTN, RESIZE_NONE, COLOUR_ORANGE, 228, 314, 113, 124, STR_GENERATE_DATE,       STR_NULL},                               // CSCEN_START_DATE_TEXT
 
{     WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 315, 326, 113, 124, SPR_ARROW_UP,            STR_029F_MOVE_THE_STARTING_DATE},        // CSCEN_START_DATE_UP
 

	
 
/* Flat map height */
 
{       WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 135, 278, 132, 142, STR_FLAT_WORLD_HEIGHT,   STR_NULL},                               // CSCEN_FLAT_LAND_HEIGHT_LABEL
 
{     WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 282, 293, 131, 142, SPR_ARROW_DOWN,          STR_FLAT_WORLD_HEIGHT_DOWN},             // CSCEN_FLAT_LAND_HEIGHT_DOWN
 
{    WWT_TEXTBTN, RESIZE_NONE, COLOUR_ORANGE, 294, 314, 131, 142, STR_NUM_3,               STR_NULL},                               // CSCEN_FLAT_LAND_HEIGHT_TEXT
 
{     WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 315, 326, 131, 142, SPR_ARROW_UP,            STR_FLAT_WORLD_HEIGHT_UP},               // CSCEN_FLAT_LAND_HEIGHT_UP
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _create_scenario_desc = {
 
static const WindowDesc _create_scenario_desc(
 
	WDP_CENTER, WDP_CENTER, 338, 170, 338, 170,
 
	WC_GENERATE_LANDSCAPE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS,
 
	_create_scenario_widgets,
 
};
 
	_create_scenario_widgets
 
);
 

	
 
void ShowCreateScenario()
 
{
 
	DeleteWindowByClass(WC_GENERATE_LANDSCAPE);
 
	new CreateScenarioWindow(&_create_scenario_desc, GLWP_SCENARIO);
 
}
 

	
 

	
 
static const Widget _generate_progress_widgets[] = {
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    0,   180,     0,    13, STR_GENERATION_WORLD,   STR_018C_WINDOW_TITLE_DRAG_THIS}, // GPWW_CAPTION
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,    0,   180,    14,    96, 0x0,                    STR_NULL},                        // GPWW_BACKGROUND
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_WHITE,  20,   161,    74,    85, STR_GENERATION_ABORT,   STR_NULL},                        // GPWW_ABORT
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _generate_progress_desc = {
 
static const WindowDesc _generate_progress_desc(
 
	WDP_CENTER, WDP_CENTER, 181, 97, 181, 97,
 
	WC_GENERATE_PROGRESS_WINDOW, WC_NONE,
 
	WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_generate_progress_widgets,
 
};
 
	_generate_progress_widgets
 
);
 

	
 
struct tp_info {
 
	uint percent;
 
	StringID cls;
 
	uint current;
 
	uint total;
 
	int timer;
 
};
 

	
 
static tp_info _tp;
 

	
 
static void AbortGeneratingWorldCallback(Window *w, bool confirmed)
src/graph_gui.cpp
Show inline comments
 
@@ -89,30 +89,30 @@ static const Widget _graph_legend_widget
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,    88,    99, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   100,   111, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   112,   123, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   124,   135, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   136,   147, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   148,   159, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   160,   171, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   172,   183, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,   247,   184,   195, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _graph_legend_desc = {
 
static const WindowDesc _graph_legend_desc(
 
	WDP_AUTO, WDP_AUTO, 250, 198, 250, 198,
 
	WC_GRAPH_LEGEND, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_graph_legend_widgets,
 
};
 
	_graph_legend_widgets
 
);
 

	
 
static void ShowGraphLegend()
 
{
 
	AllocateWindowDescFront<GraphLegendWindow>(&_graph_legend_desc, 0);
 
}
 

	
 
/******************/
 
/* BASE OF GRAPHS */
 
/*****************/
 

	
 
struct BaseGraphWindow : Window {
 
protected:
 
@@ -430,30 +430,30 @@ struct OperatingProfitGraphWindow : Base
 
		return c->old_economy[j].income + c->old_economy[j].expenses;
 
	}
 
};
 

	
 
static const Widget _operating_profit_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                        STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   525,     0,    13, STR_7025_OPERATING_PROFIT_GRAPH, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   526,   575,     0,    13, STR_704C_KEY,                    STR_704D_SHOW_KEY_TO_GRAPHS},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   575,    14,   173, 0x0,                             STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _operating_profit_desc = {
 
static const WindowDesc _operating_profit_desc(
 
	WDP_AUTO, WDP_AUTO, 576, 174, 576, 174,
 
	WC_OPERATING_PROFIT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_operating_profit_widgets,
 
};
 
	_operating_profit_widgets
 
);
 

	
 

	
 
void ShowOperatingProfitGraph()
 
{
 
	AllocateWindowDescFront<OperatingProfitGraphWindow>(&_operating_profit_desc, 0);
 
}
 

	
 

	
 
/****************/
 
/* INCOME GRAPH */
 
/****************/
 

	
 
@@ -469,30 +469,30 @@ struct IncomeGraphWindow : BaseGraphWind
 
		return c->old_economy[j].income;
 
	}
 
};
 

	
 
static const Widget _income_graph_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,              STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   525,     0,    13, STR_7022_INCOME_GRAPH, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   526,   575,     0,    13, STR_704C_KEY,          STR_704D_SHOW_KEY_TO_GRAPHS},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   575,    14,   141, 0x0,                   STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _income_graph_desc = {
 
static const WindowDesc _income_graph_desc(
 
	WDP_AUTO, WDP_AUTO, 576, 142, 576, 142,
 
	WC_INCOME_GRAPH, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_income_graph_widgets,
 
};
 
	_income_graph_widgets
 
);
 

	
 
void ShowIncomeGraph()
 
{
 
	AllocateWindowDescFront<IncomeGraphWindow>(&_income_graph_desc, 0);
 
}
 

	
 
/*******************/
 
/* DELIVERED CARGO */
 
/*******************/
 

	
 
struct DeliveredCargoGraphWindow : BaseGraphWindow {
 
	DeliveredCargoGraphWindow(const WindowDesc *desc, WindowNumber window_number) :
 
@@ -506,30 +506,30 @@ struct DeliveredCargoGraphWindow : BaseG
 
		return c->old_economy[j].delivered_cargo;
 
	}
 
};
 

	
 
static const Widget _delivered_cargo_graph_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                          STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   525,     0,    13, STR_7050_UNITS_OF_CARGO_DELIVERED, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   526,   575,     0,    13, STR_704C_KEY,                      STR_704D_SHOW_KEY_TO_GRAPHS},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   575,    14,   141, 0x0,                               STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _delivered_cargo_graph_desc = {
 
static const WindowDesc _delivered_cargo_graph_desc(
 
	WDP_AUTO, WDP_AUTO, 576, 142, 576, 142,
 
	WC_DELIVERED_CARGO, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_delivered_cargo_graph_widgets,
 
};
 
	_delivered_cargo_graph_widgets
 
);
 

	
 
void ShowDeliveredCargoGraph()
 
{
 
	AllocateWindowDescFront<DeliveredCargoGraphWindow>(&_delivered_cargo_graph_desc, 0);
 
}
 

	
 
/***********************/
 
/* PERFORMANCE HISTORY */
 
/***********************/
 

	
 
struct PerformanceHistoryGraphWindow : BaseGraphWindow {
 
	PerformanceHistoryGraphWindow(const WindowDesc *desc, WindowNumber window_number) :
 
@@ -550,30 +550,30 @@ struct PerformanceHistoryGraphWindow : B
 
	}
 
};
 

	
 
static const Widget _performance_history_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                             STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   475,     0,    13, STR_7051_COMPANY_PERFORMANCE_RATINGS, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   526,   575,     0,    13, STR_704C_KEY,                         STR_704D_SHOW_KEY_TO_GRAPHS},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   476,   525,     0,    13, STR_PERFORMANCE_DETAIL_KEY,           STR_704D_SHOW_KEY_TO_GRAPHS},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   575,    14,   237, 0x0,                                  STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _performance_history_desc = {
 
static const WindowDesc _performance_history_desc(
 
	WDP_AUTO, WDP_AUTO, 576, 238, 576, 238,
 
	WC_PERFORMANCE_HISTORY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_performance_history_widgets,
 
};
 
	_performance_history_widgets
 
);
 

	
 
void ShowPerformanceHistoryGraph()
 
{
 
	AllocateWindowDescFront<PerformanceHistoryGraphWindow>(&_performance_history_desc, 0);
 
}
 

	
 
/*****************/
 
/* COMPANY VALUE */
 
/*****************/
 

	
 
struct CompanyValueGraphWindow : BaseGraphWindow {
 
	CompanyValueGraphWindow(const WindowDesc *desc, WindowNumber window_number) :
 
@@ -587,30 +587,30 @@ struct CompanyValueGraphWindow : BaseGra
 
		return c->old_economy[j].company_value;
 
	}
 
};
 

	
 
static const Widget _company_value_graph_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   525,     0,    13, STR_7052_COMPANY_VALUES, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   526,   575,     0,    13, STR_704C_KEY,            STR_704D_SHOW_KEY_TO_GRAPHS},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   575,    14,   237, 0x0,                     STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _company_value_graph_desc = {
 
static const WindowDesc _company_value_graph_desc(
 
	WDP_AUTO, WDP_AUTO, 576, 238, 576, 238,
 
	WC_COMPANY_VALUE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_company_value_graph_widgets,
 
};
 
	_company_value_graph_widgets
 
);
 

	
 
void ShowCompanyValueGraph()
 
{
 
	AllocateWindowDescFront<CompanyValueGraphWindow>(&_company_value_graph_desc, 0);
 
}
 

	
 
/*****************/
 
/* PAYMENT RATES */
 
/*****************/
 

	
 
struct PaymentRatesGraphWindow : BaseGraphWindow {
 
	PaymentRatesGraphWindow(const WindowDesc *desc, WindowNumber window_number) :
 
@@ -711,30 +711,30 @@ struct PaymentRatesGraphWindow : BaseGra
 
			this->SetDirty();
 
		}
 
	}
 
};
 

	
 
static const Widget _cargo_payment_rates_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                     STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   567,     0,    13, STR_7061_CARGO_PAYMENT_RATES, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{      WWT_PANEL, RESIZE_BOTTOM,  COLOUR_GREY,     0,   567,    14,    45, 0x0,                          STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _cargo_payment_rates_desc = {
 
static const WindowDesc _cargo_payment_rates_desc(
 
	WDP_AUTO, WDP_AUTO, 568, 46, 568, 46,
 
	WC_PAYMENT_RATES, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_cargo_payment_rates_widgets,
 
};
 
	_cargo_payment_rates_widgets
 
);
 

	
 

	
 
void ShowCargoPaymentRates()
 
{
 
	AllocateWindowDescFront<PaymentRatesGraphWindow>(&_cargo_payment_rates_desc, 0);
 
}
 

	
 
/************************/
 
/* COMPANY LEAGUE TABLE */
 
/************************/
 

	
 
static const StringID _performance_titles[] = {
 
@@ -834,30 +834,30 @@ public:
 
	}
 
};
 

	
 

	
 
static const Widget _company_league_widgets[] = {
 
{   WWT_CLOSEBOX, RESIZE_NONE,  COLOUR_GREY,   0,  10,  0,  13, STR_00C5,                      STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION, RESIZE_NONE,  COLOUR_GREY,  11, 387,  0,  13, STR_7053_COMPANY_LEAGUE_TABLE, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{  WWT_STICKYBOX, RESIZE_NONE,  COLOUR_GREY, 388, 399,  0,  13, STR_NULL,                      STR_STICKY_BUTTON},
 
{      WWT_PANEL, RESIZE_NONE,  COLOUR_GREY,   0, 399, 14, 166, 0x0,                           STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _company_league_desc = {
 
static const WindowDesc _company_league_desc(
 
	WDP_AUTO, WDP_AUTO, 400, 167, 400, 167,
 
	WC_COMPANY_LEAGUE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_company_league_widgets,
 
};
 
	_company_league_widgets
 
);
 

	
 
void ShowCompanyLeagueTable()
 
{
 
	AllocateWindowDescFront<CompanyLeagueWindow>(&_company_league_desc, 0);
 
}
 

	
 
/*****************************/
 
/* PERFORMANCE RATING DETAIL */
 
/*****************************/
 

	
 
struct PerformanceRatingDetailWindow : Window {
 
private:
 
@@ -1079,23 +1079,23 @@ static const Widget _performance_rating_
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,   224,   260,    14,    26, 0x0,                    STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,   261,   297,    14,    26, 0x0,                    STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     2,    38,    27,    39, 0x0,                    STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,    39,    75,    27,    39, 0x0,                    STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,    76,   112,    27,    39, 0x0,                    STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,   113,   149,    27,    39, 0x0,                    STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,   150,   186,    27,    39, 0x0,                    STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,   187,   223,    27,    39, 0x0,                    STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,   224,   260,    27,    39, 0x0,                    STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _performance_rating_detail_desc = {
 
static const WindowDesc _performance_rating_detail_desc(
 
	WDP_AUTO, WDP_AUTO, 299, 241, 299, 241,
 
	WC_PERFORMANCE_DETAIL, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_performance_rating_detail_widgets,
 
};
 
	_performance_rating_detail_widgets
 
);
 

	
 
void ShowPerformanceRatingDetail()
 
{
 
	AllocateWindowDescFront<PerformanceRatingDetailWindow>(&_performance_rating_detail_desc, 0);
 
}
src/group_gui.cpp
Show inline comments
 
@@ -691,30 +691,30 @@ public:
 
	/**
 
	 * Tests whether a given vehicle is selected in the window, and unselects it if necessary.
 
	 * Called when the vehicle is deleted.
 
	 * @param vehicle Vehicle that is going to be deleted
 
	 */
 
	void UnselectVehicle(VehicleID vehicle)
 
	{
 
		if (this->vehicle_sel == vehicle) ResetObjectToPlace();
 
	}
 
};
 

	
 

	
 
static WindowDesc _group_desc = {
 
static WindowDesc _group_desc(
 
	WDP_AUTO, WDP_AUTO, 460, 194, 460, 246,
 
	WC_INVALID, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_group_widgets,
 
};
 
	_group_widgets
 
);
 

	
 
void ShowCompanyGroup(CompanyID company, VehicleType vehicle_type)
 
{
 
	if (!IsValidCompanyID(company)) return;
 

	
 
	_group_desc.cls = GetWindowClassForVehicleType(vehicle_type);
 
	WindowNumber num = (vehicle_type << 11) | VLW_GROUP_LIST | company;
 
	AllocateWindowDescFront<VehicleGroupWindow>(&_group_desc, num);
 
}
 

	
 
/**
 
 * Removes the highlight of a vehicle in a group window
src/highscore_gui.cpp
Show inline comments
 
@@ -157,37 +157,37 @@ struct HighScoreWindow : EndGameHighScor
 
				SetDParam(1, hs[i].score);
 
				DrawString(x + 71, y + 160 + (i * 55), STR_HIGHSCORE_STATS, colour);
 
			}
 
		}
 
	}
 
};
 

	
 
static const Widget _highscore_widgets[] = {
 
{      WWT_PANEL, RESIZE_NONE,  COLOUR_END, 0, 640, 0, 480, 0x0, STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _highscore_desc = {
 
static const WindowDesc _highscore_desc(
 
	0, 0, 641, 481, 641, 481,
 
	WC_HIGHSCORE, WC_NONE,
 
	0,
 
	_highscore_widgets,
 
};
 
	_highscore_widgets
 
);
 

	
 
static const WindowDesc _endgame_desc = {
 
static const WindowDesc _endgame_desc(
 
	0, 0, 641, 481, 641, 481,
 
	WC_ENDSCREEN, WC_NONE,
 
	0,
 
	_highscore_widgets,
 
};
 
	_highscore_widgets
 
);
 

	
 
/** Show the highscore table for a given difficulty. When called from
 
 * endgame ranking is set to the top5 element that was newly added
 
 * and is thus highlighted */
 
void ShowHighscoreTable(int difficulty, int8 ranking)
 
{
 
	DeleteWindowByClass(WC_HIGHSCORE);
 
	new HighScoreWindow(&_highscore_desc, difficulty, ranking);
 
}
 

	
 
/** Show the endgame victory screen in 2050. Update the new highscore
 
 * if it was high enough */
src/industry_gui.cpp
Show inline comments
 
@@ -76,30 +76,30 @@ enum DynamicPlaceIndustriesWidgets {
 
static const Widget _build_industry_widgets[] = {
 
{   WWT_CLOSEBOX,    RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    10,     0,    13, STR_00C5,                       STR_018B_CLOSE_WINDOW},            // DPIW_CLOSEBOX
 
{    WWT_CAPTION,   RESIZE_RIGHT,  COLOUR_DARK_GREEN,    11,   169,     0,    13, STR_0314_FUND_NEW_INDUSTRY,     STR_018C_WINDOW_TITLE_DRAG_THIS},  // DPIW_CAPTION
 
{     WWT_MATRIX,      RESIZE_RB,  COLOUR_DARK_GREEN,     0,   157,    14,   118, 0x801,                          STR_INDUSTRY_SELECTION_HINT},      // DPIW_MATRIX_WIDGET
 
{  WWT_SCROLLBAR,     RESIZE_LRB,  COLOUR_DARK_GREEN,   158,   169,    14,   118, 0x0,                            STR_0190_SCROLL_BAR_SCROLLS_LIST}, // DPIW_SCROLLBAR
 
{      WWT_PANEL,     RESIZE_RTB,  COLOUR_DARK_GREEN,     0,   169,   119,   199, 0x0,                            STR_NULL},                         // DPIW_INFOPANEL
 
{    WWT_TEXTBTN,     RESIZE_RTB,  COLOUR_DARK_GREEN,     0,   157,   200,   211, STR_FUND_NEW_INDUSTRY,          STR_NULL},                         // DPIW_FUND_WIDGET
 
{  WWT_RESIZEBOX,    RESIZE_LRTB,  COLOUR_DARK_GREEN,   158,   169,   200,   211, 0x0,                            STR_RESIZE_BUTTON},                // DPIW_RESIZE_WIDGET
 
{   WIDGETS_END},
 
};
 

	
 
/** Window definition of the dynamic place industries gui */
 
static const WindowDesc _build_industry_desc = {
 
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_CONSTRUCTION,
 
	_build_industry_widgets,
 
};
 
	_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
 
	uint16 callback_timer;                      ///< timer counter for callback eventual verification
 
	bool timer_enabled;                         ///< timer can be used
 
	uint16 count;                               ///< How many industries are loaded
 
	IndustryType index[NUM_INDUSTRYTYPES + 1];  ///< Type of industry, in the order it was loaded
 
	StringID text[NUM_INDUSTRYTYPES + 1];       ///< Text coming from CBM_IND_FUND_MORE_TEXT (if ever)
 
	bool enabled[NUM_INDUSTRYTYPES + 1];        ///< availability state, coming from CBID_INDUSTRY_AVAILABLE (if ever)
 

	
 
	void SetupArrays()
 
@@ -664,30 +664,30 @@ static const Widget _industry_view_widge
 
{    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_CREAM,    11,   247,     0,    13, STR_4801,          STR_018C_WINDOW_TITLE_DRAG_THIS},  // IVW_CAPTION
 
{  WWT_STICKYBOX,     RESIZE_LR,  COLOUR_CREAM,   248,   259,     0,    13, 0x0,               STR_STICKY_BUTTON},                // IVW_STICKY
 
{      WWT_PANEL,     RESIZE_RB,  COLOUR_CREAM,     0,   259,    14,   105, 0x0,               STR_NULL},                         // IVW_BACKGROUND
 
{      WWT_INSET,     RESIZE_RB,  COLOUR_CREAM,     2,   257,    16,   103, 0x0,               STR_NULL},                         // IVW_VIEWPORT
 
{      WWT_PANEL,    RESIZE_RTB,  COLOUR_CREAM,     0,   259,   106,   107, 0x0,               STR_NULL},                         // IVW_INFO
 
{ WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_CREAM,     0,   129,   108,   119, STR_00E4_LOCATION, STR_482C_CENTER_THE_MAIN_VIEW_ON}, // IVW_GOTO
 
{      WWT_PANEL,    RESIZE_RTB,  COLOUR_CREAM,   130,   247,   108,   119, 0x0,               STR_NULL},                         // IVW_SPACER
 
{  WWT_RESIZEBOX,   RESIZE_LRTB,  COLOUR_CREAM,   248,   259,   108,   119, 0x0,               STR_RESIZE_BUTTON},                // IVW_RESIZE
 
{   WIDGETS_END},
 
};
 

	
 
/** Window definition of the view industy gui */
 
static const WindowDesc _industry_view_desc = {
 
static const WindowDesc _industry_view_desc(
 
	WDP_AUTO, WDP_AUTO, 260, 120, 260, 120,
 
	WC_INDUSTRY_VIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_industry_view_widgets,
 
};
 
	_industry_view_widgets
 
);
 

	
 
void ShowIndustryViewWindow(int industry)
 
{
 
	AllocateWindowDescFront<IndustryViewWindow>(&_industry_view_desc, industry);
 
}
 

	
 
/** Names of the widgets of the industry directory gui */
 
enum IndustryDirectoryWidgets {
 
	IDW_CLOSEBOX = 0,
 
	IDW_CAPTION,
 
	IDW_STICKY,
 
	IDW_DROPDOWN_ORDER,
 
@@ -976,23 +976,23 @@ GUIIndustryList::SortFunction * const In
 

	
 
/* Names of the sorting functions */
 
const StringID IndustryDirectoryWindow::sorter_names[] = {
 
	STR_SORT_BY_DROPDOWN_NAME,
 
	STR_SORT_BY_TYPE,
 
	STR_SORT_BY_PRODUCTION,
 
	STR_SORT_BY_TRANSPORTED,
 
	INVALID_STRING_ID
 
};
 

	
 

	
 
/** Window definition of the industy directory gui */
 
static const WindowDesc _industry_directory_desc = {
 
static const WindowDesc _industry_directory_desc(
 
	WDP_AUTO, WDP_AUTO, 428, 190, 428, 190,
 
	WC_INDUSTRY_DIRECTORY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_industry_directory_widgets,
 
};
 
	_industry_directory_widgets
 
);
 

	
 
void ShowIndustryDirectory()
 
{
 
	AllocateWindowDescFront<IndustryDirectoryWindow>(&_industry_directory_desc, 0);
 
}
src/intro_gui.cpp
Show inline comments
 
@@ -142,30 +142,30 @@ public:
 
				if (!_network_available) {
 
					ShowErrorMessage(INVALID_STRING_ID, STR_NETWORK_ERR_NOTAVAILABLE, 0, 0);
 
				} else {
 
					ShowNetworkContentListWindow();
 
				}
 
				break;
 
			case SGI_AI_SETTINGS:     ShowAIConfigWindow(); break;
 
			case SGI_EXIT:            HandleExitGameRequest(); break;
 
		}
 
	}
 
};
 

	
 
static const WindowDesc _select_game_desc = {
 
static const WindowDesc _select_game_desc(
 
	WDP_CENTER, WDP_CENTER, 336, 213, 336, 213,
 
	WC_SELECT_GAME, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_select_game_widgets,
 
};
 
	_select_game_widgets
 
);
 

	
 
void ShowSelectGameWindow()
 
{
 
	new SelectGameWindow(&_select_game_desc);
 
}
 

	
 
static void AskExitGameCallback(Window *w, bool confirmed)
 
{
 
	if (confirmed) _exit_game = true;
 
}
 

	
 
void AskExitGame()
src/misc_gui.cpp
Show inline comments
 
@@ -42,30 +42,30 @@ SaveLoadDialogMode _saveload_mode;
 

	
 
static bool _fios_path_changed;
 
static bool _savegame_sort_dirty;
 
int _caret_timer;
 

	
 
static const Widget _land_info_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                       STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   299,     0,    13, STR_01A3_LAND_AREA_INFORMATION, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{      WWT_PANEL, RESIZE_BOTTOM,  COLOUR_GREY,     0,   299,    14,    99, 0x0,                            STR_NULL},
 
{    WIDGETS_END},
 
};
 

	
 
static const WindowDesc _land_info_desc = {
 
static const WindowDesc _land_info_desc(
 
	WDP_AUTO, WDP_AUTO, 300, 100, 300, 100,
 
	WC_LAND_INFO, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_land_info_widgets,
 
};
 
	_land_info_widgets
 
);
 

	
 
class LandInfoWindow : public Window {
 
	enum {
 
		LAND_INFO_CENTERED_LINES   = 12,                       ///< Up to 12 centered lines
 
		LAND_INFO_MULTICENTER_LINE = LAND_INFO_CENTERED_LINES, ///< One multicenter line
 
		LAND_INFO_LINE_END,
 

	
 
		LAND_INFO_LINE_BUFF_SIZE = 512,
 
	};
 

	
 
public:
 
	char landinfo_data[LAND_INFO_LINE_END][LAND_INFO_LINE_BUFF_SIZE];
 
@@ -274,30 +274,30 @@ void PlaceLandBlockInfo()
 
		SetObjectToPlace(SPR_CURSOR_QUERY, PAL_NONE, VHM_RECT, WC_MAIN_TOOLBAR, 0);
 
	}
 
}
 

	
 
static const Widget _about_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,         STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   419,     0,    13, STR_015B_OPENTTD, STR_NULL},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   419,    14,   271, 0x0,              STR_NULL},
 
{      WWT_FRAME,   RESIZE_NONE,  COLOUR_GREY,     5,   414,    40,   245, STR_NULL,         STR_NULL},
 
{    WIDGETS_END},
 
};
 

	
 
static const WindowDesc _about_desc = {
 
static const WindowDesc _about_desc(
 
	WDP_CENTER, WDP_CENTER, 420, 272, 420, 272,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_about_widgets,
 
};
 
	_about_widgets
 
);
 

	
 
struct AboutWindow : public Window {
 
	int scroll_height;
 
	uint16 counter;
 

	
 
	AboutWindow() : Window(&_about_desc)
 
	{
 
		this->counter = 5;
 
		this->scroll_height = this->height - 40;
 
		this->FindWindowPlacementAndResize(&_about_desc);
 
	}
 

	
 
@@ -1169,30 +1169,30 @@ struct QueryStringWindow : public QueryS
 

	
 
static const Widget _query_string_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,        STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   259,     0,    13, STR_012D,        STR_NULL},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   259,    14,    29, 0x0,             STR_NULL},
 
{    WWT_EDITBOX,   RESIZE_NONE,  COLOUR_GREY,     2,   257,    16,    27, 0x0,             STR_NULL}, // QUERY_STR_WIDGET_TEXT
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,     0,    86,    30,    41, STR_DEFAULT,     STR_NULL}, // QUERY_STR_WIDGET_DEFAULT
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,    87,   172,    30,    41, STR_012E_CANCEL, STR_NULL}, // QUERY_STR_WIDGET_CANCEL
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,   173,   259,    30,    41, STR_012F_OK,     STR_NULL}, // QUERY_STR_WIDGET_OK
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _query_string_desc = {
 
static const WindowDesc _query_string_desc(
 
	190, 219, 260, 42, 260, 42,
 
	WC_QUERY_STRING, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_query_string_widgets,
 
};
 
	_query_string_widgets
 
);
 

	
 
/** Show a query popup window with a textbox in it.
 
 * @param str StringID for the text shown in the textbox
 
 * @param caption StringID of text shown in caption of querywindow
 
 * @param maxsize maximum size in bytes (including terminating '\0')
 
 * @param maxwidth maximum width in pixels allowed
 
 * @param parent pointer to a Window that will handle the events (ok/cancel) of this
 
 *        window. If NULL, results are handled by global function HandleOnEditText
 
 * @param afilter filters out unwanted character input
 
 * @param flags various flags, @see QueryStringFlags
 
 */
 
void ShowQueryString(StringID str, StringID caption, uint maxsize, uint maxwidth, Window *parent, CharSetFilter afilter, QueryStringFlags flags)
 
@@ -1309,30 +1309,30 @@ struct QueryWindow : public Window {
 
};
 

	
 

	
 
static const Widget _query_widgets[] = {
 
{  WWT_CLOSEBOX, RESIZE_NONE,  COLOUR_RED,      0,  10,   0,  13, STR_00C5,        STR_018B_CLOSE_WINDOW},
 
{   WWT_CAPTION, RESIZE_NONE,  COLOUR_RED,     11, 209,   0,  13, STR_NULL,        STR_NULL},
 
{     WWT_PANEL, RESIZE_NONE,  COLOUR_RED,      0, 209,  14,  81, 0x0, /*OVERRIDE*/STR_NULL},
 
{WWT_PUSHTXTBTN, RESIZE_NONE,  COLOUR_YELLOW,  20,  90,  62,  73, STR_00C9_NO,     STR_NULL},
 
{WWT_PUSHTXTBTN, RESIZE_NONE,  COLOUR_YELLOW, 120, 190,  62,  73, STR_00C8_YES,    STR_NULL},
 
{   WIDGETS_END },
 
};
 

	
 
static const WindowDesc _query_desc = {
 
static const WindowDesc _query_desc(
 
	WDP_CENTER, WDP_CENTER, 210, 82, 210, 82,
 
	WC_CONFIRM_POPUP_QUERY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_DEF_WIDGET | WDF_MODAL,
 
	_query_widgets,
 
};
 
	_query_widgets
 
);
 

	
 
/** Show a modal confirmation window with standard 'yes' and 'no' buttons
 
 * The window is aligned to the centre of its parent.
 
 * NOTE: You cannot use BindCString as parameter for this window!
 
 * @param caption string shown as window caption
 
 * @param message string that will be shown for the window
 
 * @param parent pointer to parent window, if this pointer is NULL the parent becomes
 
 * the main window WC_MAIN_WINDOW
 
 * @param callback callback function pointer to set in the window descriptor
 
 */
 
void ShowQuery(StringID caption, StringID message, Window *parent, QueryCallbackProc *callback)
 
{
 
@@ -1724,37 +1724,37 @@ public:
 
			this->widget[SLWW_SAVE_GAME].right += delta.x;
 
		}
 

	
 
		this->vscroll.cap += delta.y / 10;
 
	}
 

	
 
	virtual void OnInvalidateData(int data)
 
	{
 
		BuildFileList();
 
	}
 
};
 

	
 
static const WindowDesc _load_dialog_desc = {
 
static const WindowDesc _load_dialog_desc(
 
	WDP_CENTER, WDP_CENTER, 257, 154, 257, 294,
 
	WC_SAVELOAD, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_load_dialog_widgets,
 
};
 
	_load_dialog_widgets
 
);
 

	
 
static const WindowDesc _save_dialog_desc = {
 
static const WindowDesc _save_dialog_desc(
 
	WDP_CENTER, WDP_CENTER, 257, 180, 257, 320,
 
	WC_SAVELOAD, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_save_dialog_widgets,
 
};
 
	_save_dialog_widgets
 
);
 

	
 
/** These values are used to convert the file/operations mode into a corresponding file type.
 
 * So each entry, as expressed by the related comment, is based on the enum   */
 
static const FileType _file_modetotype[] = {
 
	FT_SAVEGAME,  ///< used for SLD_LOAD_GAME
 
	FT_SCENARIO,  ///< used for SLD_LOAD_SCENARIO
 
	FT_SAVEGAME,  ///< used for SLD_SAVE_GAME
 
	FT_SCENARIO,  ///< used for SLD_SAVE_SCENARIO
 
	FT_HEIGHTMAP, ///< used for SLD_LOAD_HEIGHTMAP
 
	FT_SAVEGAME,  ///< SLD_NEW_GAME
 
};
 

	
src/music_gui.cpp
Show inline comments
 
@@ -336,30 +336,30 @@ static const Widget _music_track_selecti
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,   186,   245,    52,    59, 0x0,                              STR_01F4_SELECT_OLD_STYLE_MUSIC},        // MTSW_OLD
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,   186,   245,    60,    67, 0x0,                              STR_01F5_SELECT_NEW_STYLE_MUSIC},        // MTSW_NEW
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,   186,   245,    68,    75, 0x0,                              STR_0330_SELECT_EZY_STREET_STYLE},       // MTSW_EZY
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,   186,   245,    76,    83, 0x0,                              STR_01F6_SELECT_CUSTOM_1_USER_DEFINED},  // MTSW_CUSTOM1
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,   186,   245,    84,    91, 0x0,                              STR_01F7_SELECT_CUSTOM_2_USER_DEFINED},  // MTSW_CUSTOM2
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,   186,   245,   108,   115, 0x0,                              STR_01F8_CLEAR_CURRENT_PROGRAM_CUSTOM1}, // MTSW_CLEAR
 
#if 0
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,   186,   245,   124,   131, 0x0,                              STR_01F9_SAVE_MUSIC_SETTINGS},           // MTSW_SAVE
 
#endif
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _music_track_selection_desc = {
 
static const WindowDesc _music_track_selection_desc(
 
	104, 131, 432, 218, 432, 218,
 
	WC_MUSIC_TRACK_SELECTION, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_music_track_selection_widgets,
 
};
 
	_music_track_selection_widgets
 
);
 

	
 
static void ShowMusicTrackSelection()
 
{
 
	AllocateWindowDescFront<MusicTrackSelectionWindow>(&_music_track_selection_desc, 0);
 
}
 

	
 
struct MusicWindow : public Window {
 
private:
 
	enum MusicWidgets {
 
		MW_CLOSE,
 
		MW_CAPTION,
 
		MW_PREV,
 
@@ -537,23 +537,23 @@ static const Widget _music_window_widget
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,    59,   240,    45,    53, 0x0,                   STR_NULL},                                 // MW_INFO
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,     6,    55,    42,    49, 0x0,                   STR_01FB_TOGGLE_PROGRAM_SHUFFLE},          // MW_SHUFFLE
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,   244,   293,    42,    49, 0x0,                   STR_01FC_SHOW_MUSIC_TRACK_SELECTION},      // MW_PROGRAMME
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,     0,    49,    58,    65, 0x0,                   STR_01F3_SELECT_ALL_TRACKS_PROGRAM},       // MW_ALL
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,    50,    99,    58,    65, 0x0,                   STR_01F4_SELECT_OLD_STYLE_MUSIC},          // MW_OLD
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,   100,   149,    58,    65, 0x0,                   STR_01F5_SELECT_NEW_STYLE_MUSIC},          // MW_NEW
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,   150,   199,    58,    65, 0x0,                   STR_0330_SELECT_EZY_STREET_STYLE},         // MW_EZY
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,   200,   249,    58,    65, 0x0,                   STR_01F6_SELECT_CUSTOM_1_USER_DEFINED},    // MW_CUSTOM1
 
{    WWT_PUSHBTN,   RESIZE_NONE,  COLOUR_GREY,   250,   299,    58,    65, 0x0,                   STR_01F7_SELECT_CUSTOM_2_USER_DEFINED},    // MW_CUSTOM2
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _music_window_desc = {
 
static const WindowDesc _music_window_desc(
 
	0, 22, 300, 66, 300, 66,
 
	WC_MUSIC_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_music_window_widgets,
 
};
 
	_music_window_widgets
 
);
 

	
 
void ShowMusicWindow()
 
{
 
	AllocateWindowDescFront<MusicWindow>(&_music_window_desc, 0);
 
}
src/network/network_chat_gui.cpp
Show inline comments
 
@@ -492,26 +492,26 @@ public:
 
		ShowOnScreenKeyboard(this, wid, 0, 3);
 
	}
 
};
 

	
 
static const Widget _chat_window_widgets[] = {
 
{   WWT_CLOSEBOX, RESIZE_NONE,   COLOUR_GREY,   0,  10,  0, 13, STR_00C5,                  STR_018B_CLOSE_WINDOW},
 
{      WWT_PANEL, RESIZE_RIGHT,  COLOUR_GREY,  11, 319,  0, 13, 0x0,                       STR_NULL}, // background
 
{    WWT_EDITBOX, RESIZE_RIGHT,  COLOUR_GREY,  75, 257,  1, 12, STR_NETWORK_CHAT_OSKTITLE, STR_NULL}, // text box
 
{ WWT_PUSHTXTBTN, RESIZE_LR,     COLOUR_GREY, 258, 319,  1, 12, STR_NETWORK_SEND,          STR_NULL}, // send button
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _chat_window_desc = {
 
static const WindowDesc _chat_window_desc(
 
	WDP_CENTER, -26, 320, 14, 640, 14, // x, y, width, height
 
	WC_SEND_NETWORK_MSG, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET,
 
	_chat_window_widgets,
 
};
 
	_chat_window_widgets
 
);
 

	
 
void ShowNetworkChatQueryWindow(DestType type, int dest)
 
{
 
	DeleteWindowById(WC_SEND_NETWORK_MSG, 0);
 
	new NetworkChatWindow (&_chat_window_desc, type, dest);
 
}
 

	
 
#endif /* ENABLE_NETWORK */
src/network/network_content_gui.cpp
Show inline comments
 
@@ -19,30 +19,30 @@
 
#include "table/strings.h"
 
#include "../table/sprites.h"
 

	
 
/** Widgets for the download window */
 
static const Widget _network_content_download_status_window_widget[] = {
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,      0,   349,     0,    13, STR_CONTENT_DOWNLOAD_TITLE, STR_018C_WINDOW_TITLE_DRAG_THIS}, // NCDSWW_CAPTION
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,      0,   349,    14,    84, 0x0,                        STR_NULL},                        // NCDSWW_BACKGROUND
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_WHITE,   125,   225,    69,    80, STR_012E_CANCEL,            STR_NULL},                        // NCDSWW_CANCELOK
 
{   WIDGETS_END},
 
};
 

	
 
/** Window description for the download window */
 
static const WindowDesc _network_content_download_status_window_desc = {
 
static const WindowDesc _network_content_download_status_window_desc(
 
	WDP_CENTER, WDP_CENTER, 350, 85, 350, 85,
 
	WC_NETWORK_STATUS_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_MODAL,
 
	_network_content_download_status_window_widget,
 
};
 
	_network_content_download_status_window_widget
 
);
 

	
 
/** Window for showing the download status of content */
 
struct NetworkContentDownloadStatusWindow : public Window, ContentCallback {
 
	/** Widgets used by this window */
 
	enum Widgets {
 
		NCDSWW_CAPTION,    ///< Caption of the window
 
		NCDSWW_BACKGROUND, ///< Background
 
		NCDSWW_CANCELOK,   ///< Cancel/OK button
 
	};
 

	
 
private:
 
	ClientNetworkContentSocketHandler *connection; ///< Our connection with the content server
 
@@ -751,30 +751,30 @@ static const Widget _network_content_lis
 
{ WWT_PUSHTXTBTN,   RESIZE_TB,     COLOUR_WHITE,         10,   110,   252,   263, STR_CONTENT_SELECT_ALL_CAPTION,     STR_CONTENT_SELECT_ALL_CAPTION_TIP},     // NCLWW_SELECT_ALL
 
{ WWT_PUSHTXTBTN,   RESIZE_TB,     COLOUR_WHITE,         10,   110,   252,   263, STR_CONTENT_SELECT_UPDATES_CAPTION, STR_CONTENT_SELECT_UPDATES_CAPTION_TIP}, // NCLWW_SELECT_UPDATES
 
{ WWT_PUSHTXTBTN,   RESIZE_TB,     COLOUR_WHITE,        118,   218,   252,   263, STR_CONTENT_UNSELECT_ALL_CAPTION,   STR_CONTENT_UNSELECT_ALL_CAPTION_TIP},   // NCLWW_UNSELECT
 
{ WWT_PUSHTXTBTN,   RESIZE_LRTB,   COLOUR_WHITE,        226,   326,   252,   263, STR_012E_CANCEL,                    STR_NULL},                               // NCLWW_CANCEL
 
{ WWT_PUSHTXTBTN,   RESIZE_LRTB,   COLOUR_WHITE,        334,   434,   252,   263, STR_CONTENT_DOWNLOAD_CAPTION,       STR_CONTENT_DOWNLOAD_CAPTION_TIP},       // NCLWW_DOWNLOAD
 

	
 
{  WWT_RESIZEBOX,   RESIZE_LRTB,   COLOUR_LIGHT_BLUE,   438,   449,   266,   277, 0x0,                                STR_RESIZE_BUTTON },                     // NCLWW_RESIZE
 

	
 
{   WIDGETS_END},
 
};
 

	
 
/** Window description of the content list */
 
static const WindowDesc _network_content_list_desc = {
 
static const WindowDesc _network_content_list_desc(
 
	WDP_CENTER, WDP_CENTER, 450, 278, 630, 460,
 
	WC_NETWORK_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_network_content_list_widgets,
 
};
 
	_network_content_list_widgets
 
);
 

	
 
/**
 
 * Show the content list window with a given set of content
 
 * @param cv the content to show, or NULL when it has to search for itself
 
 * @param type the type to (only) show
 
 */
 
void ShowNetworkContentListWindow(ContentVector *cv, ContentType type)
 
{
 
#if defined(WITH_ZLIB)
 
	_network_content_client.Clear();
 
	if (cv == NULL) {
 
		_network_content_client.RequestContentList(type);
src/network/network_gui.cpp
Show inline comments
 
@@ -802,30 +802,30 @@ static const Widget _network_game_window
 

	
 
/* BOTTOM */
 
{ WWT_PUSHTXTBTN,   RESIZE_TB,     COLOUR_WHITE,         10,   110,   246,   257, STR_NETWORK_FIND_SERVER,          STR_NETWORK_FIND_SERVER_TIP},      // NGWW_FIND
 
{ WWT_PUSHTXTBTN,   RESIZE_TB,     COLOUR_WHITE,        118,   218,   246,   257, STR_NETWORK_ADD_SERVER,           STR_NETWORK_ADD_SERVER_TIP},       // NGWW_ADD
 
{ WWT_PUSHTXTBTN,   RESIZE_TB,     COLOUR_WHITE,        226,   326,   246,   257, STR_NETWORK_START_SERVER,         STR_NETWORK_START_SERVER_TIP},     // NGWW_START
 
{ WWT_PUSHTXTBTN,   RESIZE_TB,     COLOUR_WHITE,        334,   434,   246,   257, STR_012E_CANCEL,                  STR_NULL},                         // NGWW_CANCEL
 

	
 
{  WWT_RESIZEBOX,   RESIZE_LRTB,   COLOUR_LIGHT_BLUE,   438,   449,   252,   263, 0x0,                              STR_RESIZE_BUTTON },
 

	
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _network_game_window_desc = {
 
static const WindowDesc _network_game_window_desc(
 
	WDP_CENTER, WDP_CENTER, 450, 264, 780, 264,
 
	WC_NETWORK_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_network_game_window_widgets,
 
};
 
	_network_game_window_widgets
 
);
 

	
 
void ShowNetworkGameWindow()
 
{
 
	static bool first = true;
 
	DeleteWindowById(WC_NETWORK_WINDOW, 0);
 

	
 
	/* Only show once */
 
	if (first) {
 
		char * const *srv;
 

	
 
		first = false;
 
		/* add all servers from the config file to our list */
 
@@ -1126,30 +1126,30 @@ static const Widget _network_start_serve
 

	
 
{       WWT_TEXT,   RESIZE_NONE,   COLOUR_LIGHT_BLUE,   280,   419,   191,   203, STR_NETWORK_LANGUAGE_SPOKEN,        STR_NULL},
 
{ WWT_DROPDOWNIN,   RESIZE_NONE,   COLOUR_LIGHT_BLUE,   280,   410,   205,   216, STR_NETWORK_LANGUAGE_COMBO,         STR_NETWORK_LANGUAGE_TIP},             // NSSW_LANGUAGE_BTN
 

	
 
/* Buttons Start / Load / Cancel */
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,   COLOUR_WHITE,         40,   140,   224,   235, STR_NETWORK_START_GAME,             STR_NETWORK_START_GAME_TIP},           // NSSW_START
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,   COLOUR_WHITE,        150,   250,   224,   235, STR_NETWORK_LOAD_GAME,              STR_NETWORK_LOAD_GAME_TIP},            // NSSW_LOAD
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,   COLOUR_WHITE,        260,   360,   224,   235, STR_012E_CANCEL,                    STR_NULL},                             // NSSW_CANCEL
 

	
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _network_start_server_window_desc = {
 
static const WindowDesc _network_start_server_window_desc(
 
	WDP_CENTER, WDP_CENTER, 420, 244, 420, 244,
 
	WC_NETWORK_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_network_start_server_window_widgets,
 
};
 
	_network_start_server_window_widgets
 
);
 

	
 
static void ShowNetworkStartServerWindow()
 
{
 
	DeleteWindowById(WC_NETWORK_WINDOW, 0);
 

	
 
	new NetworkStartServerWindow(&_network_start_server_window_desc);
 
}
 

	
 
/** Enum for NetworkLobbyWindow, referring to _network_lobby_window_widgets */
 
enum NetworkLobbyWindowWidgets {
 
	NLWW_CLOSE    =  0, ///< Close 'X' button
 
	NLWW_MATRIX   =  5, ///< List of companies
 
@@ -1352,30 +1352,30 @@ static const Widget _network_lobby_windo
 
{      WWT_PANEL,   RESIZE_NONE,   COLOUR_LIGHT_BLUE,   173,   404,    38,   190, 0x0,                         STR_NULL},                         // NLWW_DETAILS
 

	
 
/* buttons */
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,   COLOUR_WHITE,         10,   151,   200,   211, STR_NETWORK_JOIN_COMPANY,    STR_NETWORK_JOIN_COMPANY_TIP},     // NLWW_JOIN
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,   COLOUR_WHITE,         10,   151,   215,   226, STR_NETWORK_NEW_COMPANY,     STR_NETWORK_NEW_COMPANY_TIP},      // NLWW_NEW
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,   COLOUR_WHITE,        158,   268,   200,   211, STR_NETWORK_SPECTATE_GAME,   STR_NETWORK_SPECTATE_GAME_TIP},    // NLWW_SPECTATE
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,   COLOUR_WHITE,        158,   268,   215,   226, STR_NETWORK_REFRESH,         STR_NETWORK_REFRESH_TIP},          // NLWW_REFRESH
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,   COLOUR_WHITE,        278,   388,   200,   211, STR_012E_CANCEL,             STR_NULL},                         // NLWW_CANCEL
 

	
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _network_lobby_window_desc = {
 
static const WindowDesc _network_lobby_window_desc(
 
	WDP_CENTER, WDP_CENTER, 420, 235, 420, 235,
 
	WC_NETWORK_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_network_lobby_window_widgets,
 
};
 
	_network_lobby_window_widgets
 
);
 

	
 
/* Show the networklobbywindow with the selected server
 
 * @param ngl Selected game pointer which is passed to the new window */
 
static void ShowNetworkLobbyWindow(NetworkGameList *ngl)
 
{
 
	DeleteWindowById(WC_NETWORK_WINDOW, 0);
 

	
 
	NetworkTCPQueryServer(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port)); // company info
 
	NetworkUDPQueryServer(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port)); // general data
 

	
 
	new NetworkLobbyWindow(&_network_lobby_window_desc, ngl);
 
}
 
@@ -1413,30 +1413,30 @@ static const Widget _client_list_widgets
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   237,     0,    13, STR_NETWORK_CLIENT_LIST,  STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{  WWT_STICKYBOX,   RESIZE_NONE,  COLOUR_GREY,   238,   249,     0,    13, STR_NULL,                 STR_STICKY_BUTTON},
 

	
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   249,    14,    14 + CLNWND_ROWSIZE + 1, 0x0, STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const Widget _client_list_popup_widgets[] = {
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   99,     0,     0,     0, STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _client_list_desc = {
 
static const WindowDesc _client_list_desc(
 
	WDP_AUTO, WDP_AUTO, 250, 1, 250, 1,
 
	WC_CLIENT_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_client_list_widgets,
 
};
 
	_client_list_widgets
 
);
 

	
 
/* Finds the Xth client-info that is active */
 
static const NetworkClientInfo *NetworkFindClientInfo(byte client_no)
 
{
 
	const NetworkClientInfo *ci;
 

	
 
	FOR_ALL_CLIENT_INFOS(ci) {
 
		if (client_no == 0) return ci;
 
		client_no--;
 
	}
 

	
 
	return NULL;
 
@@ -1838,30 +1838,30 @@ struct NetworkJoinStatusWindow : Window 
 
			SEND_COMMAND(PACKET_CLIENT_PASSWORD)(pw_type, str);
 
		}
 
	}
 
};
 

	
 
static const Widget _network_join_status_window_widget[] = {
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,      0,   249,     0,    13, STR_NETWORK_CONNECTING, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,      0,   249,    14,    84, 0x0,                    STR_NULL},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_WHITE,    75,   175,    69,    80, STR_NETWORK_DISCONNECT, STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _network_join_status_window_desc = {
 
static const WindowDesc _network_join_status_window_desc(
 
	WDP_CENTER, WDP_CENTER, 250, 85, 250, 85,
 
	WC_NETWORK_STATUS_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_MODAL,
 
	_network_join_status_window_widget,
 
};
 
	_network_join_status_window_widget
 
);
 

	
 
void ShowJoinStatusWindow()
 
{
 
	DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
 
	new NetworkJoinStatusWindow(&_network_join_status_window_desc);
 
}
 

	
 

	
 
/** Enum for NetworkGameWindow, referring to _network_game_window_widgets */
 
enum NetworkCompanyPasswordWindowWidgets {
 
	NCPWW_CLOSE,                    ///< Close 'X' button
 
	NCPWW_CAPTION,                  ///< Caption of the whole window
 
@@ -1951,27 +1951,27 @@ struct NetworkCompanyPasswordWindow : pu
 
static const Widget _ncp_window_widgets[] = {
 
{   WWT_CLOSEBOX,  RESIZE_NONE,  COLOUR_GREY,   0,  10,  0, 13, STR_00C5,                          STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,  RESIZE_NONE,  COLOUR_GREY,  11, 299,  0, 13, STR_COMPANY_PASSWORD_CAPTION,      STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{      WWT_PANEL,  RESIZE_NONE,  COLOUR_GREY,   0, 299, 14, 50, 0x0,                               STR_NULL},
 
{       WWT_TEXT,  RESIZE_NONE,  COLOUR_GREY,   5, 100, 19, 30, STR_COMPANY_PASSWORD,              STR_NULL},
 
{    WWT_EDITBOX,  RESIZE_NONE,  COLOUR_GREY, 101, 294, 19, 30, STR_SET_COMPANY_PASSWORD,          STR_NULL},
 
{    WWT_TEXTBTN,  RESIZE_NONE,  COLOUR_GREY, 101, 294, 35, 46, STR_MAKE_DEFAULT_COMPANY_PASSWORD, STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP},
 
{ WWT_PUSHTXTBTN,  RESIZE_NONE,  COLOUR_GREY,   0, 149, 51, 62, STR_012E_CANCEL,                   STR_COMPANY_PASSWORD_CANCEL},
 
{ WWT_PUSHTXTBTN,  RESIZE_NONE,  COLOUR_GREY, 150, 299, 51, 62, STR_012F_OK,                       STR_COMPANY_PASSWORD_OK},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _ncp_window_desc = {
 
static const WindowDesc _ncp_window_desc(
 
	WDP_AUTO, WDP_AUTO, 300, 63, 300, 63,
 
	WC_COMPANY_PASSWORD_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 
	_ncp_window_widgets,
 
};
 
	_ncp_window_widgets
 
);
 

	
 
void ShowNetworkCompanyPasswordWindow(Window *parent)
 
{
 
	DeleteWindowById(WC_COMPANY_PASSWORD_WINDOW, 0);
 

	
 
	new NetworkCompanyPasswordWindow(&_ncp_window_desc, parent);
 
}
 

	
 
#endif /* ENABLE_NETWORK */
src/newgrf_gui.cpp
Show inline comments
 
@@ -245,30 +245,30 @@ static const Widget _newgrf_add_dlg_widg
 
{    WWT_CAPTION,   RESIZE_RIGHT,  COLOUR_GREY,  11, 306,   0,  13, STR_NEWGRF_ADD_CAPTION,  STR_018C_WINDOW_TITLE_DRAG_THIS }, // ANGRFW_CAPTION
 
{      WWT_PANEL,      RESIZE_RB,  COLOUR_GREY,   0, 294,  14, 121, 0x0,                     STR_NULL },                        // ANGRFW_BACKGROUND
 
{      WWT_INSET,      RESIZE_RB,  COLOUR_GREY,   2, 292,  16, 119, 0x0,                     STR_NULL },                        // ANGRFW_GRF_LIST
 
{  WWT_SCROLLBAR,     RESIZE_LRB,  COLOUR_GREY, 295, 306,  14, 121, 0x0,                     STR_NULL },                        // ANGRFW_SCROLLBAR
 
{      WWT_PANEL,     RESIZE_RTB,  COLOUR_GREY,   0, 306, 122, 224, 0x0,                     STR_NULL },                        // ANGRFW_GRF_INFO
 
{ WWT_PUSHTXTBTN,     RESIZE_RTB,  COLOUR_GREY,   0, 146, 225, 236, STR_NEWGRF_ADD_FILE,     STR_NEWGRF_ADD_FILE_TIP },         // ANGRFW_ADD
 
{ WWT_PUSHTXTBTN,    RESIZE_LRTB,  COLOUR_GREY, 147, 294, 225, 236, STR_NEWGRF_RESCAN_FILES, STR_NEWGRF_RESCAN_FILES_TIP },     // ANGRFW_RESCAN
 
{  WWT_RESIZEBOX,    RESIZE_LRTB,  COLOUR_GREY, 295, 306, 225, 236, 0x0,                     STR_RESIZE_BUTTON },               // ANGRFW_RESIZE
 
{   WIDGETS_END },
 
};
 

	
 
/* Window definition for the add a newgrf window */
 
static const WindowDesc _newgrf_add_dlg_desc = {
 
static const WindowDesc _newgrf_add_dlg_desc(
 
	WDP_CENTER, WDP_CENTER, 307, 237, 307, 337,
 
	WC_SAVELOAD, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_newgrf_add_dlg_widgets,
 
};
 
	_newgrf_add_dlg_widgets
 
);
 

	
 
static GRFPresetList _grf_preset_list;
 

	
 
class DropDownListPresetItem : public DropDownListItem {
 
public:
 
	DropDownListPresetItem(int result) : DropDownListItem(result, false) {}
 

	
 
	virtual ~DropDownListPresetItem() {}
 

	
 
	bool Selectable() const
 
	{
 
		return true;
 
@@ -744,30 +744,30 @@ static const Widget _newgrf_widgets[] = 
 
{     WWT_MATRIX,    RESIZE_RB,  COLOUR_MAUVE,    0, 287,  46, 115, 0x501,                       STR_NEWGRF_FILE_TIP },              // SNGRFS_FILE_LIST
 
{  WWT_SCROLLBAR,   RESIZE_LRB,  COLOUR_MAUVE,  288, 299,  46, 115, 0x0,                         STR_0190_SCROLL_BAR_SCROLLS_LIST }, // SNGRFS_SCROLLBAR
 
{      WWT_PANEL,   RESIZE_RTB,  COLOUR_MAUVE,    0, 299, 116, 238, STR_NULL,                    STR_NULL },                         // SNGRFS_NEWGRF_INFO
 
{ WWT_PUSHTXTBTN,    RESIZE_TB,  COLOUR_MAUVE,    0,  99, 239, 250, STR_NEWGRF_SET_PARAMETERS,   STR_NULL },                         // SNGRFS_SET_PARAMETERS
 
{ WWT_PUSHTXTBTN,   RESIZE_RTB,  COLOUR_MAUVE,  100, 199, 239, 250, STR_NEWGRF_TOGGLE_PALETTE,   STR_NEWGRF_TOGGLE_PALETTE_TIP },    // SNGRFS_TOGGLE_PALETTE
 
{ WWT_PUSHTXTBTN,   RESIZE_RTB,  COLOUR_MAUVE,  200, 299, 239, 250, STR_NEWGRF_APPLY_CHANGES,    STR_NULL },                         // SNGRFS_APPLY_CHANGES
 
{ WWT_PUSHTXTBTN,   RESIZE_RTB,  COLOUR_MAUVE,    0, 287, 251, 262, STR_CONTENT_INTRO_BUTTON,    STR_CONTENT_INTRO_BUTTON_TIP },     // SNGRFS_DOWNLOAD_CONTENT
 
{  WWT_RESIZEBOX,  RESIZE_LRTB,  COLOUR_MAUVE,  288, 299, 251, 262, 0x0,                         STR_RESIZE_BUTTON },                // SNGRFS_RESIZE
 
{ WIDGETS_END },
 
};
 

	
 
/* Window definition of the manage newgrfs window */
 
static const WindowDesc _newgrf_desc = {
 
static const WindowDesc _newgrf_desc(
 
	WDP_CENTER, WDP_CENTER, 300, 263, 300, 263,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_newgrf_widgets,
 
};
 
	_newgrf_widgets
 
);
 

	
 
/** Callback function for the newgrf 'apply changes' confirmation window
 
 * @param w Window which is calling this callback
 
 * @param confirmed boolean value, true when yes was clicked, false otherwise
 
 */
 
static void NewGRFConfirmationCallback(Window *w, bool confirmed)
 
{
 
	if (confirmed) {
 
		NewGRFWindow *nw = dynamic_cast<NewGRFWindow*>(w);
 
		GRFConfig *c;
 
		int i = 0;
 

	
src/news_gui.cpp
Show inline comments
 
@@ -316,58 +316,58 @@ struct NewsWindow : Window {
 
	}
 
};
 

	
 
/* static */ uint NewsWindow::duration; ///< Remaining time for showing current news message
 

	
 

	
 
static const Widget _news_type13_widgets[] = {
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_WHITE,     0,   429,     0,   169, 0x0, STR_NULL},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_WHITE,     0,    10,     0,    11, 0x0, STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static WindowDesc _news_type13_desc = {
 
static WindowDesc _news_type13_desc(
 
	WDP_CENTER, 476, 430, 170, 430, 170,
 
	WC_NEWS_WINDOW, WC_NONE,
 
	WDF_DEF_WIDGET,
 
	_news_type13_widgets,
 
};
 
	_news_type13_widgets
 
);
 

	
 
static const Widget _news_type2_widgets[] = {
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_WHITE,     0,   429,     0,   129, 0x0, STR_NULL},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_WHITE,     0,    10,     0,    11, 0x0, STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static WindowDesc _news_type2_desc = {
 
static WindowDesc _news_type2_desc(
 
	WDP_CENTER, 476, 430, 130, 430, 130,
 
	WC_NEWS_WINDOW, WC_NONE,
 
	WDF_DEF_WIDGET,
 
	_news_type2_widgets,
 
};
 
	_news_type2_widgets
 
);
 

	
 
static const Widget _news_type0_widgets[] = {
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_LIGHT_BLUE,     0,   279,    14,    86, 0x0,              STR_NULL},
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_LIGHT_BLUE,     0,    10,     0,    13, STR_00C5,         STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_LIGHT_BLUE,    11,   279,     0,    13, STR_012C_MESSAGE, STR_NULL},
 
{      WWT_INSET,   RESIZE_NONE,  COLOUR_LIGHT_BLUE,     2,   277,    16,    64, 0x0,              STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static WindowDesc _news_type0_desc = {
 
static WindowDesc _news_type0_desc(
 
	WDP_CENTER, 476, 280, 87, 280, 87,
 
	WC_NEWS_WINDOW, WC_NONE,
 
	WDF_DEF_WIDGET,
 
	_news_type0_widgets,
 
};
 
	_news_type0_widgets
 
);
 

	
 

	
 
/** Open up an own newspaper window for the news item */
 
static void ShowNewspaper(NewsItem *ni)
 
{
 
	SoundFx sound = _news_type_data[_news_subtype_data[ni->subtype].type].sound;
 
	if (sound != 0) SndPlayFx(sound);
 

	
 
	int top = _screen.height;
 
	Window *w;
 
	switch (_news_subtype_data[ni->subtype].display_mode) {
 
		case NM_NORMAL:
 
@@ -764,30 +764,30 @@ struct MessageHistoryWindow : Window {
 
};
 

	
 
static const Widget _message_history_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_BROWN,     0,    10,     0,    13, STR_00C5,            STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_BROWN,    11,   387,     0,    13, STR_MESSAGE_HISTORY, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{  WWT_STICKYBOX,     RESIZE_LR,  COLOUR_BROWN,   388,   399,     0,    13, 0x0,                 STR_STICKY_BUTTON},
 
{      WWT_PANEL,     RESIZE_RB,  COLOUR_BROWN,     0,   387,    14,   139, 0x0,                 STR_MESSAGE_HISTORY_TIP},
 
{  WWT_SCROLLBAR,    RESIZE_LRB,  COLOUR_BROWN,   388,   399,    14,   127, 0x0,                 STR_0190_SCROLL_BAR_SCROLLS_LIST},
 
{  WWT_RESIZEBOX,   RESIZE_LRTB,  COLOUR_BROWN,   388,   399,   128,   139, 0x0,                 STR_RESIZE_BUTTON},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _message_history_desc = {
 
static const WindowDesc _message_history_desc(
 
	240, 22, 400, 140, 400, 140,
 
	WC_MESSAGE_HISTORY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_message_history_widgets,
 
};
 
	_message_history_widgets
 
);
 

	
 
/** Display window with news messages history */
 
void ShowMessageHistory()
 
{
 
	DeleteWindowById(WC_MESSAGE_HISTORY, 0);
 
	new MessageHistoryWindow(&_message_history_desc);
 
}
 

	
 

	
 
/** News settings window widget offset constants */
 
enum {
 
	WIDGET_NEWSOPT_DROP_SUMMARY = 4,  ///< Dropdown that adjusts at once the level for all settings
 
@@ -973,25 +973,25 @@ NEWS_SETTINGS_LINE(26, NT_ECONOMY,      
 
NEWS_SETTINGS_LINE(26, NT_INDUSTRY_COMPANY, STR_INDUSTRY_CHANGES_SERVED_BY_COMPANY),
 
NEWS_SETTINGS_LINE(26, NT_INDUSTRY_OTHER,   STR_INDUSTRY_CHANGES_SERVED_BY_OTHER),
 
NEWS_SETTINGS_LINE(26, NT_INDUSTRY_NOBODY,  STR_OTHER_INDUSTRY_PRODUCTION_CHANGES),
 
NEWS_SETTINGS_LINE(26, NT_ADVICE,           STR_020B_ADVICE_INFORMATION_ON_COMPANY),
 
NEWS_SETTINGS_LINE(26, NT_NEW_VEHICLES,     STR_020C_NEW_VEHICLES),
 
NEWS_SETTINGS_LINE(26, NT_ACCEPTANCE,       STR_020D_CHANGES_OF_CARGO_ACCEPTANCE),
 
NEWS_SETTINGS_LINE(26, NT_SUBSIDIES,        STR_020E_SUBSIDIES),
 
NEWS_SETTINGS_LINE(26, NT_GENERAL,          STR_020F_GENERAL_INFORMATION),
 

	
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _message_options_desc = {
 
static const WindowDesc _message_options_desc(
 
	270,  22,  410,  65 + NT_END * NEWS_SETTING_BASELINE_SKIP,
 
	           410,  65 + NT_END * NEWS_SETTING_BASELINE_SKIP,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_message_options_widgets,
 
};
 
	_message_options_widgets
 
);
 

	
 
void ShowMessageOptions()
 
{
 
	DeleteWindowById(WC_GAME_OPTIONS, 0);
 
	new MessageOptionsWindow(&_message_options_desc);
 
}
src/order_gui.cpp
Show inline comments
 
@@ -1172,30 +1172,30 @@ static const Widget _orders_train_widget
 

	
 
	{   WWT_DROPDOWN,   RESIZE_TB,     COLOUR_GREY,     0,   123,    76,    87, STR_NULL,                STR_ORDER_CONDITIONAL_VARIABLE_TOOLTIP},   // ORDER_WIDGET_COND_VARIABLE
 
	{   WWT_DROPDOWN,   RESIZE_TB,     COLOUR_GREY,   124,   247,    76,    87, STR_NULL,                STR_ORDER_CONDITIONAL_COMPARATOR_TOOLTIP}, // ORDER_WIDGET_COND_COMPARATOR
 
	{ WWT_PUSHTXTBTN,   RESIZE_TB,     COLOUR_GREY,   248,   371,    76,    87, STR_CONDITIONAL_VALUE,   STR_ORDER_CONDITIONAL_VALUE_TOOLTIP},      // ORDER_WIDGET_COND_VALUE
 

	
 
	{      WWT_PANEL,   RESIZE_RTB,    COLOUR_GREY,   372,   373,    76,    99, 0x0,                     STR_NULL},                            // ORDER_WIDGET_RESIZE_BAR
 
	{ WWT_PUSHIMGBTN,   RESIZE_LRTB,   COLOUR_GREY,   372,   385,    76,    87, SPR_SHARED_ORDERS_ICON,  STR_VEH_WITH_SHARED_ORDERS_LIST_TIP}, // ORDER_WIDGET_SHARED_ORDER_LIST
 

	
 
	{  WWT_RESIZEBOX,   RESIZE_LRTB,   COLOUR_GREY,   374,   385,    88,    99, 0x0,                     STR_RESIZE_BUTTON},                   // ORDER_WIDGET_RESIZE
 
	{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _orders_train_desc = {
 
static const WindowDesc _orders_train_desc(
 
	WDP_AUTO, WDP_AUTO, 386, 100, 386, 100,
 
	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_orders_train_widgets,
 
};
 
	_orders_train_widgets
 
);
 

	
 
/**
 
 * Widget definition for "your" orders (!train)
 
 */
 
static const Widget _orders_widgets[] = {
 
	{   WWT_CLOSEBOX,   RESIZE_NONE,   COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                STR_018B_CLOSE_WINDOW},               // ORDER_WIDGET_CLOSEBOX
 
	{    WWT_CAPTION,   RESIZE_RIGHT,  COLOUR_GREY,    11,   373,     0,    13, STR_8829_ORDERS,         STR_018C_WINDOW_TITLE_DRAG_THIS},     // ORDER_WIDGET_CAPTION
 
	{ WWT_PUSHTXTBTN,   RESIZE_LR,     COLOUR_GREY,   313,   373,     0,    13, STR_TIMETABLE_VIEW,      STR_TIMETABLE_VIEW_TOOLTIP},          // ORDER_WIDGET_TIMETABLE_VIEW
 
	{  WWT_STICKYBOX,   RESIZE_LR,     COLOUR_GREY,   374,   385,     0,    13, STR_NULL,                STR_STICKY_BUTTON},                   // ORDER_WIDGET_STICKY
 

	
 
	{      WWT_PANEL,   RESIZE_RB,     COLOUR_GREY,     0,   373,    14,    75, 0x0,                     STR_8852_ORDERS_LIST_CLICK_ON_ORDER}, // ORDER_WIDGET_ORDER_LIST
 

	
 
@@ -1217,30 +1217,30 @@ static const Widget _orders_widgets[] = 
 

	
 
	{   WWT_DROPDOWN,   RESIZE_TB,     COLOUR_GREY,     0,   123,    76,    87, STR_NULL,                STR_ORDER_CONDITIONAL_VARIABLE_TOOLTIP},   // ORDER_WIDGET_COND_VARIABLE
 
	{   WWT_DROPDOWN,   RESIZE_TB,     COLOUR_GREY,   124,   247,    76,    87, STR_NULL,                STR_ORDER_CONDITIONAL_COMPARATOR_TOOLTIP}, // ORDER_WIDGET_COND_COMPARATOR
 
	{ WWT_PUSHTXTBTN,   RESIZE_TB,     COLOUR_GREY,   248,   371,    76,    87, STR_CONDITIONAL_VALUE,   STR_ORDER_CONDITIONAL_VALUE_TOOLTIP},      // ORDER_WIDGET_COND_VALUE
 

	
 
	{      WWT_PANEL,   RESIZE_RTB,    COLOUR_GREY,   372,   373,    76,    99, 0x0,                     STR_NULL},                            // ORDER_WIDGET_RESIZE_BAR
 
	{ WWT_PUSHIMGBTN,   RESIZE_LRTB,   COLOUR_GREY,   372,   385,    76,    87, SPR_SHARED_ORDERS_ICON,  STR_VEH_WITH_SHARED_ORDERS_LIST_TIP}, // ORDER_WIDGET_SHARED_ORDER_LIST
 

	
 
	{  WWT_RESIZEBOX,   RESIZE_LRTB,   COLOUR_GREY,   374,   385,    88,    99, 0x0,                     STR_RESIZE_BUTTON},                   // ORDER_WIDGET_RESIZE
 
	{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _orders_desc = {
 
static const WindowDesc _orders_desc(
 
	WDP_AUTO, WDP_AUTO, 386, 100, 386, 100,
 
	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_orders_widgets,
 
};
 
	_orders_widgets
 
);
 

	
 
/**
 
 * Widget definition for competitor orders
 
 */
 
static const Widget _other_orders_widgets[] = {
 
	{   WWT_CLOSEBOX,   RESIZE_NONE,   COLOUR_GREY,     0,    10,     0,    13, STR_00C5,           STR_018B_CLOSE_WINDOW},               // ORDER_WIDGET_CLOSEBOX
 
	{    WWT_CAPTION,   RESIZE_RIGHT,  COLOUR_GREY,    11,   373,     0,    13, STR_8829_ORDERS,    STR_018C_WINDOW_TITLE_DRAG_THIS},     // ORDER_WIDGET_CAPTION
 
	{ WWT_PUSHTXTBTN,   RESIZE_LR,     COLOUR_GREY,   313,   373,     0,    13, STR_TIMETABLE_VIEW, STR_TIMETABLE_VIEW_TOOLTIP},          // ORDER_WIDGET_TIMETABLE_VIEW
 
	{  WWT_STICKYBOX,   RESIZE_LR,     COLOUR_GREY,   374,   385,     0,    13, STR_NULL,           STR_STICKY_BUTTON},                   // ORDER_WIDGET_STICKY
 

	
 
	{      WWT_PANEL,   RESIZE_RB,     COLOUR_GREY,     0,   373,    14,    75, 0x0,                STR_8852_ORDERS_LIST_CLICK_ON_ORDER}, // ORDER_WIDGET_ORDER_LIST
 

	
 
@@ -1262,30 +1262,30 @@ static const Widget _other_orders_widget
 

	
 
	{      WWT_EMPTY,   RESIZE_NONE,   COLOUR_GREY,     0,     0,    76,    87, 0x0,                STR_NULL},                            // ORDER_WIDGET_COND_VARIABLE
 
	{      WWT_EMPTY,   RESIZE_NONE,   COLOUR_GREY,     0,     0,    76,    87, 0x0,                STR_NULL},                            // ORDER_WIDGET_COND_COMPARATOR
 
	{      WWT_EMPTY,   RESIZE_NONE,   COLOUR_GREY,     0,     0,    76,    87, 0x0,                STR_NULL},                            // ORDER_WIDGET_COND_VALUE
 

	
 
	{      WWT_PANEL,   RESIZE_RTB,    COLOUR_GREY,     0,   373,    76,    87, 0x0,                STR_NULL},                            // ORDER_WIDGET_RESIZE_BAR
 
	{      WWT_EMPTY,   RESIZE_TB,     COLOUR_GREY,     0,     0,    76,    87, 0x0,                STR_NULL},                            // ORDER_WIDGET_SHARED_ORDER_LIST
 

	
 
	{  WWT_RESIZEBOX,   RESIZE_LRTB,   COLOUR_GREY,   374,   385,    76,    87, 0x0,                STR_RESIZE_BUTTON},                   // ORDER_WIDGET_RESIZE
 
	{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _other_orders_desc = {
 
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_CONSTRUCTION,
 
	_other_orders_widgets,
 
};
 
	_other_orders_widgets
 
);
 

	
 
void ShowOrdersWindow(const Vehicle *v)
 
{
 
	DeleteWindowById(WC_VEHICLE_DETAILS, v->index, false);
 
	DeleteWindowById(WC_VEHICLE_TIMETABLE, v->index, false);
 
	if (BringWindowToFrontById(WC_VEHICLE_ORDERS, v->index) != NULL) return;
 

	
 
	if (v->owner != _local_company) {
 
		new OrdersWindow(&_other_orders_desc, v);
 
	} else {
 
		new OrdersWindow((v->type == VEH_TRAIN || v->type == VEH_ROAD) ? &_orders_train_desc : &_orders_desc, v);
 
	}
src/osk_gui.cpp
Show inline comments
 
@@ -299,30 +299,30 @@ static const Widget _osk_widgets[] = {
 
{    WWT_PUSHBTN, RESIZE_NONE,  COLOUR_GREY,   102,   117,   103,   118, 0x0,    STR_NULL},
 
{    WWT_PUSHBTN, RESIZE_NONE,  COLOUR_GREY,   120,   135,   103,   118, 0x0,    STR_NULL},
 
{    WWT_PUSHBTN, RESIZE_NONE,  COLOUR_GREY,   138,   153,   103,   118, 0x0,    STR_NULL},
 
{    WWT_PUSHBTN, RESIZE_NONE,  COLOUR_GREY,   156,   171,   103,   118, 0x0,    STR_NULL},
 
{    WWT_PUSHBTN, RESIZE_NONE,  COLOUR_GREY,   174,   189,   103,   118, 0x0,    STR_NULL},
 
{    WWT_PUSHBTN, RESIZE_NONE,  COLOUR_GREY,   192,   207,   103,   118, 0x0,    STR_NULL},
 
{    WWT_PUSHBTN, RESIZE_NONE,  COLOUR_GREY,   210,   225,   103,   118, 0x0,    STR_NULL},
 
{    WWT_PUSHBTN, RESIZE_NONE,  COLOUR_GREY,   228,   243,   103,   118, 0x0,    STR_NULL},
 

	
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _osk_desc = {
 
static const WindowDesc _osk_desc(
 
	WDP_CENTER, WDP_CENTER, 256, 140, 256, 140,
 
	WC_OSK, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_osk_widgets,
 
};
 
	_osk_widgets
 
);
 

	
 
/**
 
 * Retrieve keyboard layout from language string or (if set) config file.
 
 * Also check for invalid characters.
 
 */
 
void GetKeyboardLayout()
 
{
 
	char keyboard[2][OSK_KEYBOARD_ENTRIES * 4 + 1];
 
	char errormark[2][OSK_KEYBOARD_ENTRIES + 1]; // used for marking invalid chars
 
	bool has_error = false; // true when an invalid char is detected
 

	
 
	if (StrEmpty(_keyboard_opt[0])) {
src/rail_gui.cpp
Show inline comments
 
@@ -783,30 +783,30 @@ static const Widget _build_rail_widgets[
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   158,   179,    14,    35, SPR_IMG_WAYPOINT,               STR_CONVERT_RAIL_TO_WAYPOINT_TIP},        // RTW_BUILD_WAYPOINT
 

	
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   180,   221,    14,    35, SPR_IMG_RAIL_STATION,           STR_101A_BUILD_RAILROAD_STATION},         // RTW_BUILD_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   222,   243,    14,    35, SPR_IMG_RAIL_SIGNALS,           STR_101B_BUILD_RAILROAD_SIGNALS},         // RTW_BUILD_SIGNALS
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   244,   285,    14,    35, SPR_IMG_BRIDGE,                 STR_101C_BUILD_RAILROAD_BRIDGE},          // RTW_BUILD_BRIDGE
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   286,   305,    14,    35, SPR_IMG_TUNNEL_RAIL,            STR_101D_BUILD_RAILROAD_TUNNEL},          // RTW_BUILD_TUNNEL
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   306,   327,    14,    35, SPR_IMG_REMOVE,                 STR_101E_TOGGLE_BUILD_REMOVE_FOR},        // RTW_REMOVE
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   328,   349,    14,    35, SPR_IMG_CONVERT_RAIL,           STR_CONVERT_RAIL_TIP},                    // RTW_CONVERT_RAIL
 

	
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_rail_desc = {
 
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_CONSTRUCTION,
 
	_build_rail_widgets,
 
};
 
	_build_rail_widgets
 
);
 

	
 

	
 
/** Configures the rail toolbar for railtype given
 
 * @param railtype the railtype to display
 
 * @param w the window to modify
 
 */
 
static void SetupRailToolbar(RailType railtype, Window *w)
 
{
 
	const RailtypeInfo *rti = GetRailTypeInfo(railtype);
 

	
 
	assert(railtype < RAILTYPE_END);
 
	w->widget[RTW_CAPTION].data = rti->strings.toolbar_caption;
 
@@ -1325,38 +1325,38 @@ static const Widget _newstation_builder_
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        37,   111,   216,   227, STR_DRAG_DROP,                   STR_STATION_DRAG_DROP},               // BRSW_PLATFORM_DRAG_N_DROP
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        14,    73,   242,   253, STR_02DB_OFF,                    STR_3065_DON_T_HIGHLIGHT_COVERAGE},   // BRSW_HIGHLIGHT_OFF
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        74,   133,   242,   253, STR_02DA_ON,                     STR_3064_HIGHLIGHT_COVERAGE_AREA},    // BRSW_HIGHLIGHT_ON
 

	
 
/* newstations gui additions */
 
{ WWT_DROPDOWNIN,   RESIZE_NONE,  COLOUR_GREY,         7,   140,    17,    28, STR_02BD,                        STR_SELECT_STATION_CLASS_TIP},        // BRSW_NEWST_DROPDOWN
 
{     WWT_MATRIX,   RESIZE_NONE,  COLOUR_GREY,         7,   128,    32,   102, 0x501,                           STR_SELECT_STATION_TYPE_TIP},         // BRSW_NEWST_LIST
 
{  WWT_SCROLLBAR,   RESIZE_NONE,  COLOUR_GREY,       129,   140,    32,   102, 0x0,                             STR_0190_SCROLL_BAR_SCROLLS_LIST},    // BRSW_NEWST_SCROLL
 
{   WIDGETS_END},
 
};
 

	
 
/** High level window description of the default station-build window */
 
static const WindowDesc _station_builder_desc = {
 
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_CONSTRUCTION,
 
	_station_builder_widgets,
 
};
 
	_station_builder_widgets
 
);
 

	
 
/** High level window description of the newGRF station-build window */
 
static const WindowDesc _newstation_builder_desc = {
 
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_CONSTRUCTION,
 
	_newstation_builder_widgets,
 
};
 
	_newstation_builder_widgets
 
);
 

	
 
/** Open station build window */
 
static void ShowStationBuilder(Window *parent)
 
{
 
	if (GetNumStationClasses() <= 2 && GetNumCustomStations(STAT_CLASS_DFLT) == 1) {
 
		new BuildRailStationWindow(&_station_builder_desc, parent, false);
 
	} else {
 
		new BuildRailStationWindow(&_newstation_builder_desc, parent, true);
 
	}
 
}
 

	
 
/** Enum referring to the widgets of the signal window */
 
@@ -1502,30 +1502,30 @@ static const Widget _signal_builder_widg
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,  88, 109,  41,  67, STR_NULL,               STR_BUILD_SIGNAL_ELECTRIC_PBS_TIP},     // BSW_ELECTRIC_PBS
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN, 110, 131,  41,  67, STR_NULL,               STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TIP},// BSW_ELECTRIC_PBS_OWAY
 

	
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN, 132, 153,  14,  40, SPR_IMG_SIGNAL_CONVERT, STR_SIGNAL_CONVERT_TIP},                // BSW_CONVERT
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN, 132, 153,  41,  67, STR_NULL,               STR_DRAG_SIGNALS_DENSITY_TIP},          // BSW_DRAG_SIGNALS_DENSITY
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,  COLOUR_GREY,       134, 142,  54,  65, SPR_ARROW_LEFT,         STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP}, // BSW_DRAG_SIGNALS_DENSITY_DECREASE
 
{ WWT_PUSHIMGBTN,   RESIZE_NONE,  COLOUR_GREY,       143, 151,  54,  65, SPR_ARROW_RIGHT,        STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP}, // BSW_DRAG_SIGNALS_DENSITY_INCREASE
 

	
 
{   WIDGETS_END},
 
};
 

	
 
/** Signal selection window description */
 
static const WindowDesc _signal_builder_desc = {
 
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_CONSTRUCTION,
 
	_signal_builder_widgets,
 
};
 
	_signal_builder_widgets
 
);
 

	
 
/**
 
 * Open the signal selection window
 
 */
 
static void ShowSignalBuilder(Window *parent)
 
{
 
	new BuildSignalWindow(&_signal_builder_desc, parent);
 
}
 

	
 
struct BuildRailDepotWindow : public PickerWindowBase {
 
private:
 
	/** Enum referring to the widgets of the build rail depot window */
 
@@ -1576,30 +1576,30 @@ public:
 
/** Widget definition of the build rail depot window */
 
static const Widget _build_depot_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,    10,     0,    13, STR_00C5,                         STR_018B_CLOSE_WINDOW},                     // BRDW_CLOSEBOX
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,  11,   139,     0,    13, STR_1014_TRAIN_DEPOT_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS},           // BRDW_CAPTION
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,   139,    14,   121, 0x0,                              STR_NULL},                                  // BRDW_BACKGROUND
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        71,   136,    17,    66, 0x0,                              STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO}, // BRDW_DEPOT_NE
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        71,   136,    69,   118, 0x0,                              STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO}, // BRDW_DEPOT_SE
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         3,    68,    69,   118, 0x0,                              STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO}, // BRDW_DEPOT_SW
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         3,    68,    17,    66, 0x0,                              STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO}, // BRDW_DEPOT_NW
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_depot_desc = {
 
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_CONSTRUCTION,
 
	_build_depot_widgets,
 
};
 
	_build_depot_widgets
 
);
 

	
 
static void ShowBuildTrainDepotPicker(Window *parent)
 
{
 
	new BuildRailDepotWindow(&_build_depot_desc, parent);
 
}
 

	
 
struct BuildRailWaypointWindow : PickerWindowBase {
 
private:
 
	/** Enum referring to the widgets of the build NewGRF rail waypoint window */
 
	enum BuildRailWaypointWidgets {
 
		BRWW_CLOSEBOX = 0,
 
		BRWW_CAPTION,
 
@@ -1677,30 +1677,30 @@ static const Widget _build_waypoint_widg
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,   343,    14,    91, 0x0,          STR_NULL},                         // BRWW_BACKGROUND
 

	
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,     3,    68,    17,    76, 0x0,          STR_WAYPOINT_GRAPHICS_TIP},        // BRWW_WAYPOINT_1
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,    71,   136,    17,    76, 0x0,          STR_WAYPOINT_GRAPHICS_TIP},        // BRWW_WAYPOINT_2
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   139,   204,    17,    76, 0x0,          STR_WAYPOINT_GRAPHICS_TIP},        // BRWW_WAYPOINT_3
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   207,   272,    17,    76, 0x0,          STR_WAYPOINT_GRAPHICS_TIP},        // BRWW_WAYPOINT_4
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   275,   340,    17,    76, 0x0,          STR_WAYPOINT_GRAPHICS_TIP},        // BRWW_WAYPOINT_5
 

	
 
{ WWT_HSCROLLBAR,   RESIZE_NONE,  COLOUR_DARK_GREEN,     1,   343,     80,    91, 0x0,          STR_HSCROLL_BAR_SCROLLS_LIST},     // BRWW_SCROLL
 
{    WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_waypoint_desc = {
 
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_CONSTRUCTION,
 
	_build_waypoint_widgets,
 
};
 
	_build_waypoint_widgets
 
);
 

	
 
static void ShowBuildWaypointPicker(Window *parent)
 
{
 
	new BuildRailWaypointWindow(&_build_waypoint_desc, parent);
 
}
 

	
 
/**
 
 * Initialize rail building GUI settings
 
 */
 
void InitializeRailGui()
 
{
 
	_build_depot_direction = DIAGDIR_NW;
src/road_gui.cpp
Show inline comments
 
@@ -635,58 +635,58 @@ static const Widget _build_road_widgets[
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    66,    87,    14,    35, SPR_IMG_DYNAMITE,           STR_018D_DEMOLISH_BUILDINGS_ETC},   // RTW_DEMOLISH
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    88,   109,    14,    35, SPR_IMG_ROAD_DEPOT,         STR_180C_BUILD_ROAD_VEHICLE_DEPOT}, // RTW_DEPOT
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   110,   131,    14,    35, SPR_IMG_BUS_STATION,        STR_180D_BUILD_BUS_STATION},        // RTW_BUS_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   132,   153,    14,    35, SPR_IMG_TRUCK_BAY,          STR_180E_BUILD_TRUCK_LOADING_BAY},  // RTW_TRUCK_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   154,   175,    14,    35, SPR_IMG_ROAD_ONE_WAY,       STR_TOGGLE_ONE_WAY_ROAD},           // RTW_ONE_WAY
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   176,   218,    14,    35, SPR_IMG_BRIDGE,             STR_180F_BUILD_ROAD_BRIDGE},        // RTW_BUILD_BRIDGE
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   219,   240,    14,    35, SPR_IMG_ROAD_TUNNEL,        STR_1810_BUILD_ROAD_TUNNEL},        // RTW_BUILD_TUNNEL
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   241,   262,    14,    35, SPR_IMG_REMOVE,             STR_1811_TOGGLE_BUILD_REMOVE_FOR},  // RTW_REMOVE
 

	
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_road_desc = {
 
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_CONSTRUCTION,
 
	_build_road_widgets,
 
};
 
	_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
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,    11,   228,     0,    13, STR_WHITE_TRAMWAY_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},      // RTW_CAPTION
 
{  WWT_STICKYBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,   229,   240,     0,    13, 0x0,                            STR_STICKY_BUTTON},                    // RTW_STICKY
 

	
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,    21,    14,    35, SPR_IMG_TRAMWAY_X_DIR,          STR_BUILD_TRAMWAY_SECTION},            // RTW_ROAD_X
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    22,    43,    14,    35, SPR_IMG_TRAMWAY_Y_DIR,          STR_BUILD_TRAMWAY_SECTION},            // RTW_ROAD_Y
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    44,    65,    14,    35, SPR_IMG_AUTOTRAM,               STR_BUILD_AUTOTRAM_TIP},               // RTW_AUTOROAD
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    66,    87,    14,    35, SPR_IMG_DYNAMITE,               STR_018D_DEMOLISH_BUILDINGS_ETC},      // RTW_DEMOLISH
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    88,   109,    14,    35, SPR_IMG_ROAD_DEPOT,             STR_BUILD_TRAM_VEHICLE_DEPOT},         // RTW_DEPOT
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   110,   131,    14,    35, SPR_IMG_BUS_STATION,            STR_BUILD_PASSENGER_TRAM_STATION},     // RTW_BUS_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   132,   153,    14,    35, SPR_IMG_TRUCK_BAY,              STR_BUILD_CARGO_TRAM_STATION},         // RTW_TRUCK_STATION
 
{      WWT_EMPTY,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,     0,     0,     0, 0x0,                            STR_NULL},                             // RTW_ONE_WAY
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   154,   196,    14,    35, SPR_IMG_BRIDGE,                 STR_BUILD_TRAMWAY_BRIDGE},             // RTW_BUILD_BRIDGE
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   197,   218,    14,    35, SPR_IMG_ROAD_TUNNEL,            STR_BUILD_TRAMWAY_TUNNEL},             // RTW_BUILD_TUNNEL
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   219,   240,    14,    35, SPR_IMG_REMOVE,                 STR_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS}, // RTW_REMOVE
 

	
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_tramway_desc = {
 
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_CONSTRUCTION,
 
	_build_tramway_widgets,
 
};
 
	_build_tramway_widgets
 
);
 

	
 
void ShowBuildRoadToolbar(RoadType roadtype)
 
{
 
	if (!IsValidCompanyID(_local_company)) return;
 
	_cur_roadtype = roadtype;
 

	
 
	DeleteWindowByClass(WC_BUILD_TOOLBAR);
 
	AllocateWindowDescFront<BuildRoadToolbarWindow>(roadtype == ROADTYPE_ROAD ? &_build_road_desc : &_build_tramway_desc, TRANSPORT_ROAD);
 
}
 

	
 
/** Widget definition of the build road toolbar in the scenario editor */
 
static const Widget _build_road_scen_widgets[] = {
 
@@ -699,30 +699,30 @@ static const Widget _build_road_scen_wid
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    44,    65,    14,    35, SPR_IMG_AUTOROAD,           STR_BUILD_AUTOROAD_TIP},           // RTW_AUTOROAD
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    66,    87,    14,    35, SPR_IMG_DYNAMITE,           STR_018D_DEMOLISH_BUILDINGS_ETC},  // RTW_DEMOLISH
 
{      WWT_EMPTY,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,     0,     0,     0, 0x0,                        STR_NULL},                         // RTW_DEPOT
 
{      WWT_EMPTY,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,     0,     0,     0, 0x0,                        STR_NULL},                         // RTW_BUS_STATION
 
{      WWT_EMPTY,   RESIZE_NONE,  COLOUR_DARK_GREEN,     0,     0,     0,     0, 0x0,                        STR_NULL},                         // RTW_TRUCK_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,    88,   109,    14,    35, SPR_IMG_ROAD_ONE_WAY,       STR_TOGGLE_ONE_WAY_ROAD},          // RTW_ONE_WAY
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   110,   152,    14,    35, SPR_IMG_BRIDGE,             STR_180F_BUILD_ROAD_BRIDGE},       // RTW_BUILD_BRIDGE
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   153,   174,    14,    35, SPR_IMG_ROAD_TUNNEL,        STR_1810_BUILD_ROAD_TUNNEL},       // RTW_BUILD_TUNNEL
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   175,   196,    14,    35, SPR_IMG_REMOVE,             STR_1811_TOGGLE_BUILD_REMOVE_FOR}, // RTW_REMOVE
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_road_scen_desc = {
 
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_CONSTRUCTION,
 
	_build_road_scen_widgets,
 
};
 
	_build_road_scen_widgets
 
);
 

	
 
void ShowBuildRoadScenToolbar()
 
{
 
	_cur_roadtype = ROADTYPE_ROAD;
 
	AllocateWindowDescFront<BuildRoadToolbarWindow>(&_build_road_scen_desc, 0);
 
}
 

	
 
struct BuildRoadDepotWindow : public PickerWindowBase {
 
private:
 
	/** Enum referring to the widgets of the build road depot window */
 
	enum BuildRoadDepotWidgets {
 
		BRDW_CLOSEBOX = 0,
 
@@ -778,30 +778,30 @@ public:
 
/** Widget definition of the build road depot window */
 
static const Widget _build_road_depot_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,    0,    10,     0,    13, STR_00C5,                        STR_018B_CLOSE_WINDOW},              // BRDW_CLOSEBOX
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,   11,   139,     0,    13, STR_1806_ROAD_DEPOT_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS},    // BRDW_CAPTION
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,    0,   139,    14,   121, 0x0,                             STR_NULL},                           // BRDW_BACKGROUND
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         71,   136,    17,    66, 0x0,                             STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, // BRDW_DEPOT_NE
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         71,   136,    69,   118, 0x0,                             STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, // BRDW_DEPOT_SE
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,          3,    68,    69,   118, 0x0,                             STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, // BRDW_DEPOT_SW
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,          3,    68,    17,    66, 0x0,                             STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, // BRDW_DEPOT_NW
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_road_depot_desc = {
 
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_CONSTRUCTION,
 
	_build_road_depot_widgets,
 
};
 
	_build_road_depot_widgets
 
);
 

	
 
static void ShowRoadDepotPicker(Window *parent)
 
{
 
	new BuildRoadDepotWindow(&_build_road_depot_desc, parent);
 
}
 

	
 
struct BuildRoadStationWindow : public PickerWindowBase {
 
private:
 
	/** Enum referring to the widgets of the build road station window */
 
	enum BuildRoadStationWidgets {
 
		BRSW_CLOSEBOX = 0,
 
		BRSW_CAPTION,
 
@@ -926,29 +926,29 @@ static const Widget _rv_station_picker_w
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        71,   136,    69,   118, 0x0,                              STR_NULL},                          // BRSW_STATION_SE
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         3,    68,    69,   118, 0x0,                              STR_NULL},                          // BRSW_STATION_SW
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         3,    68,    17,    66, 0x0,                              STR_NULL},                          // BRSW_STATION_NW
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,       139,   204,    17,    66, 0x0,                              STR_NULL},                          // BRSW_STATION_X
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,       139,   204,    69,   118, 0x0,                              STR_NULL},                          // BRSW_STATION_Y
 

	
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        10,    69,   133,   144, STR_02DB_OFF,                     STR_3065_DON_T_HIGHLIGHT_COVERAGE}, // BRSW_LT_OFF
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,        70,   129,   133,   144, STR_02DA_ON,                      STR_3064_HIGHLIGHT_COVERAGE_AREA},  // BRSW_LT_ON
 
{      WWT_LABEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,   139,   120,   133, STR_3066_COVERAGE_AREA_HIGHLIGHT, STR_NULL},                          // BRSW_INFO
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _rv_station_picker_desc = {
 
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_CONSTRUCTION,
 
	_rv_station_picker_widgets,
 
};
 
	_rv_station_picker_widgets
 
);
 

	
 
static void ShowRVStationPicker(Window *parent, RoadStopType rs)
 
{
 
	new BuildRoadStationWindow(&_rv_station_picker_desc, parent, rs);
 
}
 

	
 
void InitializeRoadGui()
 
{
 
	_road_depot_orientation = DIAGDIR_NW;
 
	_road_station_picker_orientation = DIAGDIR_NW;
 
}
src/settings_gui.cpp
Show inline comments
 
@@ -343,30 +343,30 @@ static const Widget _game_options_widget
 
{ WWT_DROPDOWNIN,   RESIZE_NONE,  COLOUR_GREY,    20,   169,   160,   171, STR_OPTIONS_RES_CBO,               STR_OPTIONS_RES_TIP},
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,   149,   169,   176,   184, STR_EMPTY,                         STR_OPTIONS_FULLSCREEN_TIP},
 

	
 
{      WWT_FRAME,   RESIZE_NONE,  COLOUR_GREY,   190,   359,   146,   190, STR_OPTIONS_SCREENSHOT_FORMAT,     STR_NULL},
 
{ WWT_DROPDOWNIN,   RESIZE_NONE,  COLOUR_GREY,   200,   349,   160,   171, STR_OPTIONS_SCREENSHOT_FORMAT_CBO, STR_OPTIONS_SCREENSHOT_FORMAT_TIP},
 

	
 
{      WWT_FRAME,   RESIZE_NONE,  COLOUR_GREY,    10,   179,   197,   232, STR_OPTIONS_BASE_GRF,              STR_NULL},
 
{ WWT_DROPDOWNIN,   RESIZE_NONE,  COLOUR_GREY,    20,   169,   211,   222, STR_OPTIONS_BASE_GRF_CBO,          STR_OPTIONS_BASE_GRF_TIP},
 

	
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _game_options_desc = {
 
static const WindowDesc _game_options_desc(
 
	WDP_CENTER, WDP_CENTER, 370, 243, 370, 243,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_game_options_widgets,
 
};
 
	_game_options_widgets
 
);
 

	
 

	
 
void ShowGameOptions()
 
{
 
	DeleteWindowById(WC_GAME_OPTIONS, 0);
 
	new GameOptionsWindow(&_game_options_desc);
 
}
 

	
 
extern void StartupEconomy();
 

	
 
/* Widget definition for the game difficulty settings window */
 
static const Widget _game_difficulty_widgets[] = {
 
@@ -377,30 +377,30 @@ static const Widget _game_difficulty_wid
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_YELLOW,    97,   183,    16,    27, STR_6802_MEDIUM,              STR_NULL},                        // GDW_LVL_MEDIUM
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_YELLOW,   184,   270,    16,    27, STR_6803_HARD,                STR_NULL},                        // GDW_LVL_HARD
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_YELLOW,   271,   357,    16,    27, STR_6804_CUSTOM,              STR_NULL},                        // GDW_LVL_CUSTOM
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREEN,     10,   357,    28,    39, STR_6838_SHOW_HI_SCORE_CHART, STR_NULL},                        // GDW_HIGHSCORE
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_MAUVE,      0,   369,    42,   262, 0x0,                          STR_NULL},                        // GDW_SETTING_BG
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_MAUVE,      0,   369,   263,   278, 0x0,                          STR_NULL},                        // GDW_LOWER_BG
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_YELLOW,   105,   185,   265,   276, STR_OPTIONS_SAVE_CHANGES,     STR_NULL},                        // GDW_ACCEPT
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_YELLOW,   186,   266,   265,   276, STR_012E_CANCEL,              STR_NULL},                        // GDW_CANCEL
 
{   WIDGETS_END},
 
};
 

	
 
/* Window definition for the game difficulty settings window */
 
static const WindowDesc _game_difficulty_desc = {
 
static const WindowDesc _game_difficulty_desc(
 
	WDP_CENTER, WDP_CENTER, 370, 279, 370, 279,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_game_difficulty_widgets,
 
};
 
	_game_difficulty_widgets
 
);
 

	
 
void SetDifficultyLevel(int mode, DifficultySettings *gm_opt);
 

	
 
struct GameDifficultyWindow : public Window {
 
private:
 
	static const uint GAME_DIFFICULTY_NUM = 18;
 
	bool clicked_increase;
 
	uint8 clicked_button;
 
	uint8 timeout;
 

	
 
	/* Temporary holding place of values in the difficulty window until 'Save' is clicked */
 
	GameSettings opt_mod_temp;
 
@@ -1420,30 +1420,30 @@ GameSettings *GameSettingsWindow::settin
 
const int GameSettingsWindow::SETTINGTREE_LEFT_OFFSET = 5;
 
const int GameSettingsWindow::SETTINGTREE_TOP_OFFSET = 19;
 

	
 
static const Widget _settings_selection_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_MAUVE,     0,    10,     0,    13, STR_00C5,                        STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_MAUVE,    11,   411,     0,    13, STR_CONFIG_SETTING_CAPTION,      STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{      WWT_PANEL,     RESIZE_RB,  COLOUR_MAUVE,     0,   399,    14,   187, 0x0,                             STR_NULL}, // SETTINGSEL_OPTIONSPANEL
 
{  WWT_SCROLLBAR,    RESIZE_LRB,  COLOUR_MAUVE,   400,   411,    14,   175, 0x0,                             STR_0190_SCROLL_BAR_SCROLLS_LIST}, // SETTINGSEL_SCROLLBAR
 
{  WWT_RESIZEBOX,   RESIZE_LRTB,  COLOUR_MAUVE,   400,   411,   176,   187, 0x0,                             STR_RESIZE_BUTTON}, // SETTINGSEL_RESIZE
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _settings_selection_desc = {
 
static const WindowDesc _settings_selection_desc(
 
	WDP_CENTER, WDP_CENTER, 412, 188, 450, 397,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 
	_settings_selection_widgets,
 
};
 
	_settings_selection_widgets
 
);
 

	
 
void ShowGameSettings()
 
{
 
	DeleteWindowById(WC_GAME_OPTIONS, 0);
 
	new GameSettingsWindow(&_settings_selection_desc);
 
}
 

	
 

	
 
/**
 
 * Draw [<][>] boxes.
 
 * @param x the x position to draw
 
 * @param y the y position to draw
 
@@ -1653,24 +1653,24 @@ struct CustomCurrencyWindow : Window {
 
		this->click = 0;
 
		this->SetDirty();
 
	}
 
};
 

	
 
static const Widget _cust_currency_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,            STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   229,     0,    13, STR_CURRENCY_WINDOW, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   229,    14,   119, 0x0,                 STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _cust_currency_desc = {
 
static const WindowDesc _cust_currency_desc(
 
	WDP_CENTER, WDP_CENTER, 230, 120, 230, 120,
 
	WC_CUSTOM_CURRENCY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_cust_currency_widgets,
 
};
 
	_cust_currency_widgets
 
);
 

	
 
static void ShowCustCurrency()
 
{
 
	DeleteWindowById(WC_CUSTOM_CURRENCY, 0);
 
	new CustomCurrencyWindow(&_cust_currency_desc);
 
}
src/signs_gui.cpp
Show inline comments
 
@@ -142,30 +142,30 @@ struct SignListWindow : Window, SignList
 
};
 

	
 
static const Widget _sign_list_widget[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,              STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_GREY,    11,   345,     0,    13, STR_SIGN_LIST_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{  WWT_STICKYBOX,     RESIZE_LR,  COLOUR_GREY,   346,   357,     0,    13, 0x0,                   STR_STICKY_BUTTON},
 
{      WWT_PANEL,     RESIZE_RB,  COLOUR_GREY,     0,   345,    14,   137, 0x0,                   STR_NULL},
 
{  WWT_SCROLLBAR,    RESIZE_LRB,  COLOUR_GREY,   346,   357,    14,   125, 0x0,                   STR_0190_SCROLL_BAR_SCROLLS_LIST},
 
{  WWT_RESIZEBOX,   RESIZE_LRTB,  COLOUR_GREY,   346,   357,   126,   137, 0x0,                   STR_RESIZE_BUTTON},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _sign_list_desc = {
 
static const WindowDesc _sign_list_desc(
 
	WDP_AUTO, WDP_AUTO, 358, 138, 358, 138,
 
	WC_SIGN_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_sign_list_widget,
 
};
 
	_sign_list_widget
 
);
 

	
 

	
 
void ShowSignList()
 
{
 
	AllocateWindowDescFront<SignListWindow>(&_sign_list_desc, 0);
 
}
 

	
 
/**
 
 * Actually rename the sign.
 
 * @param index the sign to rename.
 
 * @param text  the new name.
 
 * @return true if the window will already be removed after returning.
 
@@ -322,30 +322,30 @@ static const Widget _query_sign_edit_wid
 
{  WWT_CAPTION, RESIZE_NONE,  COLOUR_GREY,  11, 259,   0,  13, STR_012D,          STR_NULL },
 
{    WWT_PANEL, RESIZE_NONE,  COLOUR_GREY,   0, 259,  14,  29, STR_NULL,          STR_NULL },
 
{  WWT_EDITBOX, RESIZE_NONE,  COLOUR_GREY,   2, 257,  16,  27, STR_SIGN_OSKTITLE, STR_NULL },  // Text field
 
{  WWT_TEXTBTN, RESIZE_NONE,  COLOUR_GREY,   0,  60,  30,  41, STR_012F_OK,       STR_NULL },
 
{  WWT_TEXTBTN, RESIZE_NONE,  COLOUR_GREY,  61, 120,  30,  41, STR_012E_CANCEL,   STR_NULL },
 
{  WWT_TEXTBTN, RESIZE_NONE,  COLOUR_GREY, 121, 180,  30,  41, STR_0290_DELETE,   STR_NULL },
 
{    WWT_PANEL, RESIZE_NONE,  COLOUR_GREY, 181, 237,  30,  41, STR_NULL,          STR_NULL },
 
{  WWT_TEXTBTN, RESIZE_NONE,  COLOUR_GREY, 238, 248,  30,  41, STR_6819,          STR_PREVIOUS_SIGN_TOOLTIP },
 
{  WWT_TEXTBTN, RESIZE_NONE,  COLOUR_GREY, 249, 259,  30,  41, STR_681A,          STR_NEXT_SIGN_TOOLTIP },
 
{ WIDGETS_END },
 
};
 

	
 
static const WindowDesc _query_sign_edit_desc = {
 
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_CONSTRUCTION,
 
	_query_sign_edit_widgets,
 
};
 
	_query_sign_edit_widgets
 
);
 

	
 
void HandleClickOnSign(const Sign *si)
 
{
 
	if (_ctrl_pressed && si->owner == _local_company) {
 
		RenameSign(si->index, NULL);
 
		return;
 
	}
 
	ShowRenameSignWindow(si);
 
}
 

	
 
void ShowRenameSignWindow(const Sign *si)
 
{
src/smallmap_gui.cpp
Show inline comments
 
@@ -1046,30 +1046,30 @@ public:
 
		this->SetDirty();
 
	}
 

	
 
	virtual void OnResize(Point new_size, Point delta)
 
	{
 
		if (delta.x != 0 && this->map_type == SMT_INDUSTRY) this->ResizeLegend();
 
	}
 
};
 

	
 
SmallMapWindow::SmallMapType SmallMapWindow::map_type = SMT_CONTOUR;
 
bool SmallMapWindow::show_towns = true;
 

	
 
static const WindowDesc _smallmap_desc = {
 
static const WindowDesc _smallmap_desc(
 
	WDP_AUTO, WDP_AUTO, 350, 214, 446, 314,
 
	WC_SMALLMAP, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_smallmap_widgets,
 
};
 
	_smallmap_widgets
 
);
 

	
 
void ShowSmallMap()
 
{
 
	AllocateWindowDescFront<SmallMapWindow>(&_smallmap_desc, 0);
 
}
 

	
 
/* Extra ViewPort Window Stuff */
 
static const Widget _extra_view_port_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,    0,   13, STR_00C5,                         STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_GREY,    11,   287,    0,   13, STR_EXTRA_VIEW_PORT_TITLE,        STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{  WWT_STICKYBOX,     RESIZE_LR,  COLOUR_GREY,   288,   299,    0,   13, 0x0,                              STR_STICKY_BUTTON},
 
{      WWT_PANEL,     RESIZE_RB,  COLOUR_GREY,     0,   299,   14,   33, 0x0,                              STR_NULL},
 
@@ -1188,30 +1188,30 @@ public:
 
	virtual void OnMouseWheel(int wheel)
 
	{
 
		ZoomInOrOutToCursorWindow(wheel < 0, this);
 
	}
 

	
 
	virtual void OnInvalidateData(int data = 0)
 
	{
 
		/* Only handle zoom message if intended for us (msg ZOOM_IN/ZOOM_OUT) */
 
		HandleZoomMessage(this, this->viewport, EVW_ZOOMIN, EVW_ZOOMOUT);
 
	}
 
};
 

	
 
static const WindowDesc _extra_view_port_desc = {
 
static const WindowDesc _extra_view_port_desc(
 
	WDP_AUTO, WDP_AUTO, 300, 68, 300, 268,
 
	WC_EXTRA_VIEW_PORT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_extra_view_port_widgets,
 
};
 
	_extra_view_port_widgets
 
);
 

	
 
void ShowExtraViewPortWindow(TileIndex tile)
 
{
 
	int i = 0;
 

	
 
	/* find next free window number for extra viewport */
 
	while (FindWindowById(WC_EXTRA_VIEW_PORT, i) != NULL) i++;
 

	
 
	new ExtraViewportWindow(&_extra_view_port_desc, i, tile);
 
}
 

	
 
bool ScrollMainWindowTo(int x, int y, bool instant)
src/station_gui.cpp
Show inline comments
 
@@ -603,30 +603,30 @@ static const Widget _company_stations_wi
 

	
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,    83,    88,    14,    24, 0x0,               STR_NULL},                         // SLW_PAN_BETWEEN
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,    89,   102,    14,    24, 0x0,               STR_NO_WAITING_CARGO},             // SLW_NOCARGOWAITING
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,   103,   116,    14,    24, 0x0,               STR_SELECT_ALL_TYPES},             // SLW_CARGOALL
 
{      WWT_PANEL,  RESIZE_RIGHT,  COLOUR_GREY,   117,   357,    14,    24, 0x0,               STR_NULL},                         // SLW_PAN_RIGHT
 

	
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,     0,    80,    25,    36, STR_SORT_BY,       STR_SORT_ORDER_TIP},               // SLW_SORTBY
 
{   WWT_DROPDOWN,   RESIZE_NONE,  COLOUR_GREY,    81,   243,    25,    36, 0x0,               STR_SORT_CRITERIA_TIP},            // SLW_SORTDROPBTN
 
{      WWT_PANEL,  RESIZE_RIGHT,  COLOUR_GREY,   244,   357,    25,    36, 0x0,               STR_NULL},                         // SLW_PAN_SORT_RIGHT
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _company_stations_desc = {
 
static const WindowDesc _company_stations_desc(
 
	WDP_AUTO, WDP_AUTO, 358, 162, 358, 162,
 
	WC_STATION_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_company_stations_widgets,
 
};
 
	_company_stations_widgets
 
);
 

	
 
/**
 
 * Opens window with list of company's stations
 
 *
 
 * @param company whose stations' list show
 
 */
 
void ShowCompanyStations(CompanyID company)
 
{
 
	if (!IsValidCompanyID(company)) return;
 

	
 
	AllocateWindowDescFront<CompanyStationsWindow>(&_company_stations_desc, company);
 
}
 
@@ -974,30 +974,30 @@ struct StationViewWindow : public Window
 

	
 
		DoCommandP(0, this->window_number, 0, CMD_RENAME_STATION | CMD_MSG(STR_3031_CAN_T_RENAME_STATION), NULL, str);
 
	}
 

	
 
	virtual void OnResize(Point new_size, Point delta)
 
	{
 
		if (delta.x != 0) ResizeButtons(this, SVW_LOCATION, SVW_RENAME);
 
		this->vscroll.cap += delta.y / (int)this->resize.step_height;
 
	}
 
};
 

	
 

	
 
static const WindowDesc _station_view_desc = {
 
static const WindowDesc _station_view_desc(
 
	WDP_AUTO, WDP_AUTO, 249, 110, 249, 110,
 
	WC_STATION_VIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_station_view_widgets,
 
};
 
	_station_view_widgets
 
);
 

	
 
/**
 
 * Opens StationViewWindow for given station
 
 *
 
 * @param station station which window should be opened
 
 */
 
void ShowStationViewWindow(StationID station)
 
{
 
	AllocateWindowDescFront<StationViewWindow>(&_station_view_desc, station);
 
}
 

	
 
static SmallVector<StationID, 8> _stations_nearby_list;
 
@@ -1190,30 +1190,30 @@ struct SelectStationWindow : Window {
 
	virtual void OnResize(Point new_size, Point delta)
 
	{
 
		this->vscroll.cap = (this->widget[JSW_PANEL].bottom - this->widget[JSW_PANEL].top) / 10;
 
	}
 

	
 
	virtual void OnInvalidateData(int data)
 
	{
 
		FindStationsNearby(this->tile, this->size_x, this->size_y, true);
 
		this->SetDirty();
 
	}
 
};
 

	
 
static const WindowDesc _select_station_desc = {
 
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_CONSTRUCTION,
 
	_select_station_widgets,
 
};
 
	_select_station_widgets
 
);
 

	
 

	
 
/**
 
 * Check whether we need to show the station selection window.
 
 * @param cmd Command to build the station.
 
 * @param w Width of the to-be-built station
 
 * @param h Height of the to-be-built station
 
 * @return whether we need to show the station selection window.
 
 */
 
static bool StationJoinerNeeded(CommandContainer cmd, int w, int h)
 
{
 
	/* Only show selection if distant join is enabled in the settings */
src/statusbar_gui.cpp
Show inline comments
 
@@ -173,30 +173,30 @@ struct StatusBarWindow : Window {
 
			this->InvalidateWidget(SBW_MIDDLE);
 
		}
 
	}
 
};
 

	
 
static const Widget _main_status_widgets[] = {
 
{      WWT_PANEL,   RESIZE_NONE,   COLOUR_GREY,     0,   139,     0,    11, 0x0, STR_NULL},
 
{    WWT_PUSHBTN,   RESIZE_RIGHT,  COLOUR_GREY,   140,   179,     0,    11, 0x0, STR_02B7_SHOW_LAST_MESSAGE_OR_NEWS},
 
{    WWT_PUSHBTN,   RESIZE_LR,     COLOUR_GREY,   180,   319,     0,    11, 0x0, STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static WindowDesc _main_status_desc = {
 
static WindowDesc _main_status_desc(
 
	WDP_CENTER, 0, 320, 12, 640, 12,
 
	WC_STATUS_BAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_NO_FOCUS,
 
	_main_status_widgets,
 
};
 
	_main_status_widgets
 
);
 

	
 
/**
 
 * Checks whether the news ticker is currently being used.
 
 */
 
bool IsNewsTickerShown()
 
{
 
	const StatusBarWindow *w = dynamic_cast<StatusBarWindow*>(FindWindowById(WC_STATUS_BAR, 0));
 
	return w != NULL && w->ticker_scroll > StatusBarWindow::TICKER_STOP;
 
}
 

	
 
void ShowStatusBar()
 
{
src/subsidy_gui.cpp
Show inline comments
 
@@ -172,24 +172,24 @@ struct SubsidyListWindow : Window {
 

	
 
static const Widget _subsidies_list_widgets[] = {
 
{   WWT_CLOSEBOX, RESIZE_NONE,   COLOUR_BROWN,   0,  10,   0,  13, STR_00C5,           STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION, RESIZE_RIGHT,  COLOUR_BROWN,  11, 307,   0,  13, STR_2025_SUBSIDIES, STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{  WWT_STICKYBOX, RESIZE_LR,     COLOUR_BROWN, 308, 319,   0,  13, STR_NULL,           STR_STICKY_BUTTON},
 
{      WWT_PANEL, RESIZE_RB,     COLOUR_BROWN,   0, 307,  14, 126, 0x0,                STR_01FD_CLICK_ON_SERVICE_TO_CENTER},
 
{  WWT_SCROLLBAR, RESIZE_LRB,    COLOUR_BROWN, 308, 319,  14, 114, 0x0,                STR_0190_SCROLL_BAR_SCROLLS_LIST},
 
{  WWT_RESIZEBOX, RESIZE_LRTB,   COLOUR_BROWN, 308, 319, 115, 126, 0x0,                STR_RESIZE_BUTTON},
 

	
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _subsidies_list_desc = {
 
static const WindowDesc _subsidies_list_desc(
 
	WDP_AUTO, WDP_AUTO, 320, 127, 320, 127,
 
	WC_SUBSIDIES_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_subsidies_list_widgets,
 
};
 
	_subsidies_list_widgets
 
);
 

	
 

	
 
void ShowSubsidiesList()
 
{
 
	AllocateWindowDescFront<SubsidyListWindow>(&_subsidies_list_desc, 0);
 
}
src/terraform_gui.cpp
Show inline comments
 
@@ -316,30 +316,30 @@ static const Widget _terraform_widgets[]
 
{    WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,  66,  69,  14,  35, 0x0,                    STR_NULL},                           // TTW_SEPERATOR
 
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,  21,  14,  35, SPR_IMG_TERRAFORM_DOWN,  STR_018E_LOWER_A_CORNER_OF_LAND},   // TTW_LOWER_LAND
 
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,  22,  43,  14,  35, SPR_IMG_TERRAFORM_UP,    STR_018F_RAISE_A_CORNER_OF_LAND},   // TTW_RAISE_LAND
 
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,  44,  65,  14,  35, SPR_IMG_LEVEL_LAND,      STR_LEVEL_LAND_TOOLTIP},            // TTW_LEVEL_LAND
 
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,  70,  91,  14,  35, SPR_IMG_DYNAMITE,        STR_018D_DEMOLISH_BUILDINGS_ETC},   // TTW_DEMOLISH
 
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,  92, 113,  14,  35, SPR_IMG_BUY_LAND,        STR_0329_PURCHASE_LAND_FOR_FUTURE}, // TTW_BUY_LAND
 
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN, 114, 135,  14,  35, SPR_IMG_PLANTTREES,      STR_0185_PLANT_TREES_PLACE_SIGNS},  // TTW_PLANT_TREES
 
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN, 136, 157,  14,  35, SPR_IMG_SIGN,            STR_0289_PLACE_SIGN},               // TTW_PLACE_SIGN
 

	
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _terraform_desc = {
 
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_CONSTRUCTION,
 
	_terraform_widgets,
 
};
 
	_terraform_widgets
 
);
 

	
 
void ShowTerraformToolbar(Window *link)
 
{
 
	if (!IsValidCompanyID(_local_company)) return;
 

	
 
	Window *w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
 
	if (link == NULL) return;
 

	
 
	if (w == NULL) {
 
		w = FindWindowById(WC_SCEN_LAND_GEN, 0);
 
	} else {
 
		w->top = 22;
 
@@ -697,23 +697,23 @@ struct ScenarioEditorLandscapeGeneration
 
					break;
 
			}
 
		}
 
	}
 

	
 
	virtual void OnPlaceObjectAbort()
 
	{
 
		this->RaiseButtons();
 
		this->SetDirty();
 
	}
 
};
 

	
 
static const WindowDesc _scen_edit_land_gen_desc = {
 
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_CONSTRUCTION,
 
	_scen_edit_land_gen_widgets,
 
};
 
	_scen_edit_land_gen_widgets
 
);
 

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

	
 
	{ WWT_PUSHTXTBTN,   RESIZE_TB,     COLOUR_GREY,     0,   109,   118,   129, STR_TIMETABLE_CHANGE_TIME,  STR_TIMETABLE_WAIT_TIME_TOOLTIP},      // TTV_CHANGE_TIME
 
	{ WWT_PUSHTXTBTN,   RESIZE_TB,     COLOUR_GREY,   110,   219,   118,   129, STR_CLEAR_TIME,             STR_TIMETABLE_CLEAR_TIME_TOOLTIP},     // TTV_CLEAR_TIME
 
	{ WWT_PUSHTXTBTN,   RESIZE_TB,     COLOUR_GREY,   220,   337,   118,   129, STR_RESET_LATENESS,         STR_TIMETABLE_RESET_LATENESS_TOOLTIP}, // TTV_RESET_LATENESS
 
	{ WWT_PUSHTXTBTN,   RESIZE_TB,     COLOUR_GREY,   338,   387,   118,   129, STR_TIMETABLE_AUTOFILL,     STR_TIMETABLE_AUTOFILL_TOOLTIP},       // TTV_AUTOFILL
 

	
 
	{      WWT_PANEL,   RESIZE_RTB,    COLOUR_GREY,   388,   387,   118,   129, STR_NULL,                   STR_NULL},                             // TTV_EMPTY
 
	{  WWT_RESIZEBOX,   RESIZE_LRTB,   COLOUR_GREY,   388,   399,   118,   129, STR_NULL,                   STR_RESIZE_BUTTON},                    // TTV_RESIZE
 

	
 
	{    WIDGETS_END }
 
};
 

	
 
static const WindowDesc _timetable_desc = {
 
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_CONSTRUCTION,
 
	_timetable_widgets,
 
};
 
	_timetable_widgets
 
);
 

	
 
void ShowTimetableWindow(const Vehicle *v)
 
{
 
	DeleteWindowById(WC_VEHICLE_DETAILS, v->index, false);
 
	DeleteWindowById(WC_VEHICLE_ORDERS, v->index, false);
 
	AllocateWindowDescFront<TimetableWindow>(&_timetable_desc, v->index);
 
}
src/toolbar_gui.cpp
Show inline comments
 
@@ -1171,30 +1171,30 @@ static const Widget _toolb_normal_widget
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_GREY,     0,     0,     0,    21, SPR_IMG_BUILDROAD,       STR_0182_BUILD_ROADS},              // TBN_ROADS
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_GREY,     0,     0,     0,    21, SPR_IMG_BUILDWATER,      STR_0183_BUILD_SHIP_DOCKS},         // TBN_WATER
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_GREY,     0,     0,     0,    21, SPR_IMG_BUILDAIR,        STR_0184_BUILD_AIRPORTS},           // TBN_AIR
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_GREY,     0,     0,     0,    21, SPR_IMG_LANDSCAPING,     STR_LANDSCAPING_TOOLBAR_TIP},       // TBN_LANDSCAPE tree icon is SPR_IMG_PLANTTREES
 

	
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_GREY,     0,     0,     0,    21, SPR_IMG_MUSIC,           STR_01D4_SHOW_SOUND_MUSIC_WINDOW},  // TBN_MUSICSOUND
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_GREY,     0,     0,     0,    21, SPR_IMG_MESSAGES,        STR_0203_SHOW_LAST_MESSAGE_NEWS},   // TBN_NEWSREPORT
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_GREY,     0,     0,     0,    21, SPR_IMG_QUERY,           STR_0186_LAND_BLOCK_INFORMATION},   // TBN_HELP
 
{     WWT_IMGBTN,   RESIZE_NONE,  COLOUR_GREY,     0,     0,     0,    21, SPR_SWITCH_TOOLBAR,      STR_EMPTY},                         // TBN_SWITCHBAR
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _toolb_normal_desc = {
 
static const WindowDesc _toolb_normal_desc(
 
	0, 0, 0, TBP_BUTTONHEIGHT, 640, TBP_BUTTONHEIGHT,
 
	WC_MAIN_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_NO_FOCUS,
 
	_toolb_normal_widgets,
 
};
 
	_toolb_normal_widgets
 
);
 

	
 

	
 
/* --- Toolbar handling for the scenario editor */
 

	
 
static ToolbarButtonProc * const _scen_toolbar_button_procs[] = {
 
	ToolbarPauseClick,
 
	ToolbarFastForwardClick,
 
	ToolbarOptionsClick,
 
	ToolbarScenSaveOrLoad,
 
	ToolbarBtn_NULL,
 
	ToolbarBtn_NULL,
 
	ToolbarScenDateBackward,
 
@@ -1424,30 +1424,30 @@ static const Widget _toolb_scen_widgets[
 
{   WWT_EMPTY, RESIZE_NONE,  COLOUR_GREY,   0,   0,  0,  0, 0x0,                 STR_NULL},
 
{   WWT_EMPTY, RESIZE_NONE,  COLOUR_GREY,   0,   0,  0,  0, 0x0,                 STR_NULL},
 
{   WWT_EMPTY, RESIZE_NONE,  COLOUR_GREY,   0,   0,  0,  0, 0x0,                 STR_NULL},
 
{   WWT_EMPTY, RESIZE_NONE,  COLOUR_GREY,   0,   0,  0,  0, 0x0,                 STR_NULL},
 
{   WWT_EMPTY, RESIZE_NONE,  COLOUR_GREY,   0,   0,  0,  0, 0x0,                 STR_NULL},
 
{   WWT_EMPTY, RESIZE_NONE,  COLOUR_GREY,   0,   0,  0,  0, 0x0,                 STR_NULL},
 
{  WWT_IMGBTN, RESIZE_NONE,  COLOUR_GREY,   0,   0,  0, 21, SPR_IMG_MUSIC,       STR_01D4_SHOW_SOUND_MUSIC_WINDOW},
 
{   WWT_EMPTY, RESIZE_NONE,  COLOUR_GREY,   0,   0,  0,  0, 0x0,                 STR_NULL},
 
{  WWT_IMGBTN, RESIZE_NONE,  COLOUR_GREY,   0,   0,  0, 21, SPR_IMG_QUERY,       STR_0186_LAND_BLOCK_INFORMATION},
 
{WIDGETS_END},
 
};
 

	
 
static const WindowDesc _toolb_scen_desc = {
 
static const WindowDesc _toolb_scen_desc(
 
	0, 0, 130, TBP_BUTTONHEIGHT, 640, TBP_BUTTONHEIGHT,
 
	WC_MAIN_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_NO_FOCUS,
 
	_toolb_scen_widgets,
 
};
 
	_toolb_scen_widgets
 
);
 

	
 
/* --- Allocating the toolbar --- */
 

	
 
void AllocateToolbar()
 
{
 
	/* Clean old GUI values; railtype is (re)set by rail_gui.cpp */
 
	_last_built_roadtype = ROADTYPE_ROAD;
 

	
 
	if (_game_mode == GM_EDITOR) {
 
		new ScenarioEditorToolbarWindow(&_toolb_scen_desc);;
 
	} else {
 
		new MainToolbarWindow(&_toolb_normal_desc);
src/town_gui.cpp
Show inline comments
 
@@ -196,30 +196,30 @@ public:
 
			case TWA_EXECUTE:
 
				DoCommandP(this->town->xy, this->window_number, this->sel_index, CMD_DO_TOWN_ACTION | CMD_MSG(STR_00B4_CAN_T_DO_THIS));
 
				break;
 
		}
 
	}
 

	
 
	virtual void OnHundredthTick()
 
	{
 
		this->SetDirty();
 
	}
 
};
 

	
 
static const WindowDesc _town_authority_desc = {
 
static const WindowDesc _town_authority_desc(
 
	WDP_AUTO, WDP_AUTO, 317, 222, 317, 222,
 
	WC_TOWN_AUTHORITY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_town_authority_widgets,
 
};
 
	_town_authority_widgets
 
);
 

	
 
static void ShowTownAuthorityWindow(uint town)
 
{
 
	AllocateWindowDescFront<TownAuthorityWindow>(&_town_authority_desc, town);
 
}
 

	
 
struct TownViewWindow : Window {
 
private:
 
	Town *town;
 

	
 
	enum TownViewWidget {
 
		TVW_CAPTION = 1,
 
@@ -423,30 +423,30 @@ static const Widget _town_view_widgets[]
 
{  WWT_STICKYBOX,   RESIZE_NONE,  COLOUR_BROWN,   248,   259,     0,    13, 0x0,                      STR_STICKY_BUTTON},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_BROWN,     0,   259,    14,   105, 0x0,                      STR_NULL},
 
{      WWT_INSET,   RESIZE_NONE,  COLOUR_BROWN,     2,   257,    16,   103, 0x0,                      STR_NULL},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_BROWN,     0,   259,   106,   137, 0x0,                      STR_NULL},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_BROWN,     0,    85,   138,   149, STR_00E4_LOCATION,        STR_200B_CENTER_THE_MAIN_VIEW_ON},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_BROWN,    86,   171,   138,   149, STR_2020_LOCAL_AUTHORITY, STR_2021_SHOW_INFORMATION_ON_LOCAL},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_BROWN,   172,   247,     0,    13, STR_0130_RENAME,          STR_200C_CHANGE_TOWN_NAME},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_BROWN,    86,   171,   138,   149, STR_023C_EXPAND,          STR_023B_INCREASE_SIZE_OF_TOWN},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_BROWN,   172,   259,   138,   149, STR_0290_DELETE,          STR_0291_DELETE_THIS_TOWN_COMPLETELY},
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _town_view_desc = {
 
static const WindowDesc _town_view_desc(
 
	WDP_AUTO, WDP_AUTO, 260, TownViewWindow::TVW_HEIGHT_NORMAL, 260, TownViewWindow::TVW_HEIGHT_NORMAL,
 
	WC_TOWN_VIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 
	_town_view_widgets,
 
};
 
	_town_view_widgets
 
);
 

	
 
void ShowTownViewWindow(TownID town)
 
{
 
	AllocateWindowDescFront<TownViewWindow>(&_town_view_desc, town);
 
}
 

	
 
static const Widget _town_directory_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_BROWN,     0,    10,     0,    13, STR_00C5,               STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_BROWN,    11,   195,     0,    13, STR_2000_TOWNS,         STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{  WWT_STICKYBOX,   RESIZE_NONE,  COLOUR_BROWN,   196,   207,     0,    13, 0x0,                    STR_STICKY_BUTTON},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_BROWN,     0,    98,    14,    25, STR_SORT_BY_NAME,       STR_SORT_ORDER_TIP},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_BROWN,    99,   195,    14,    25, STR_SORT_BY_POPULATION, STR_SORT_ORDER_TIP},
 
@@ -640,30 +640,30 @@ public:
 
	}
 
};
 

	
 
Listing TownDirectoryWindow::last_sorting = {false, 0};
 
const Town *TownDirectoryWindow::last_town = NULL;
 

	
 
/* Available town directory sorting functions */
 
GUITownList::SortFunction * const TownDirectoryWindow::sorter_funcs[] = {
 
	&TownNameSorter,
 
	&TownPopulationSorter,
 
};
 

	
 
static const WindowDesc _town_directory_desc = {
 
static const WindowDesc _town_directory_desc(
 
	WDP_AUTO, WDP_AUTO, 208, 202, 208, 202,
 
	WC_TOWN_DIRECTORY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_town_directory_widgets,
 
};
 
	_town_directory_widgets
 
);
 

	
 
void ShowTownDirectory()
 
{
 
	if (BringWindowToFrontById(WC_TOWN_DIRECTORY, 0)) return;
 
	new TownDirectoryWindow(&_town_directory_desc);
 
}
 

	
 
void CcBuildTown(bool success, TileIndex tile, uint32 p1, uint32 p2)
 
{
 
	if (success) {
 
		SndPlayTileFx(SND_1F_SPLAT, tile);
 
		if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
 
@@ -829,24 +829,24 @@ public:
 
			ShowErrorMessage(STR_023A_TOO_MANY_TOWNS, STR_0236_CAN_T_BUILD_TOWN_HERE, 0, 0);
 
			return;
 
		}
 

	
 
		DoCommandP(tile, town_size | city << 2 | town_layout << 3, townnameparts, CMD_BUILD_TOWN | CMD_MSG(STR_0236_CAN_T_BUILD_TOWN_HERE), CcBuildTown);
 
	}
 
};
 

	
 
TownSize FoundTownWindow::town_size = TS_MEDIUM; // select medium-sized towns per default;
 
bool FoundTownWindow::city;
 
TownLayout FoundTownWindow::town_layout;
 

	
 
static const WindowDesc _found_town_desc = {
 
static const WindowDesc _found_town_desc(
 
	WDP_AUTO, WDP_AUTO, 160, 162, 160, 162,
 
	WC_FOUND_TOWN, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	_found_town_widgets,
 
};
 
	_found_town_widgets
 
);
 

	
 
void ShowBuildTownWindow()
 
{
 
	if (_game_mode != GM_EDITOR && !IsValidCompanyID(_local_company)) return;
 
	AllocateWindowDescFront<FoundTownWindow>(&_found_town_desc, 0);
 
}
src/transparency_gui.cpp
Show inline comments
 
@@ -104,23 +104,23 @@ static const Widget _transparency_widget
 
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,  66,  87,  14,  35, SPR_IMG_INDUSTRY,     STR_TRANSPARENT_INDUSTRIES_DESC},
 
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,  88, 109,  14,  35, SPR_IMG_COMPANY_LIST, STR_TRANSPARENT_BUILDINGS_DESC},
 
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN, 110, 152,  14,  35, SPR_IMG_BRIDGE,       STR_TRANSPARENT_BRIDGES_DESC},
 
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN, 153, 174,  14,  35, SPR_IMG_TRANSMITTER,  STR_TRANSPARENT_STRUCTURES_DESC},
 
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN, 175, 196,  14,  35, SPR_BUILD_X_ELRAIL,   STR_TRANSPARENT_CATENARY_DESC},
 
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN, 197, 218,  14,  35, SPR_IMG_TRAINLIST,    STR_TRANSPARENT_LOADING_DESC},
 

	
 
{    WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0, 218,  36,  48, 0x0,                  STR_TRANSPARENT_INVISIBLE_DESC},
 

	
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _transparency_desc = {
 
static const WindowDesc _transparency_desc(
 
	WDP_ALIGN_TBR, 94, 219, 49, 219, 49,
 
	WC_TRANSPARENCY_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_transparency_widgets,
 
};
 
	_transparency_widgets
 
);
 

	
 
void ShowTransparencyToolbar(void)
 
{
 
	AllocateWindowDescFront<TransparenciesWindow>(&_transparency_desc, 0);
 
}
src/tree_gui.cpp
Show inline comments
 
@@ -162,24 +162,24 @@ static const Widget _build_trees_widgets
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        37,    70,    63,   108, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT}, // BTW_TYPE_22
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        72,   105,    63,   108, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT}, // BTW_TYPE_23
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,       107,   140,    63,   108, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT}, // BTW_TYPE_24
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         2,    35,   110,   155, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT}, // BTW_TYPE_31
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        37,    70,   110,   155, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT}, // BTW_TYPE_32
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        72,   105,   110,   155, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT}, // BTW_TYPE_33
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,       107,   140,   110,   155, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT}, // BTW_TYPE_34
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,         2,   140,   157,   168, STR_TREES_RANDOM_TYPE, STR_TREES_RANDOM_TYPE_TIP},          // BTW_TYPE_RANDOM
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,         2,   140,   170,   181, STR_028A_RANDOM_TREES, STR_028B_PLANT_TREES_RANDOMLY_OVER}, // BTW_MANY_RANDOM
 
{    WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_trees_desc = {
 
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_CONSTRUCTION,
 
	_build_trees_widgets,
 
};
 
	_build_trees_widgets
 
);
 

	
 
void ShowBuildTreesToolbar()
 
{
 
	if (_game_mode != GM_EDITOR && !IsValidCompanyID(_local_company)) return;
 
	AllocateWindowDescFront<BuildTreesWindow>(&_build_trees_desc, 0);
 
}
src/vehicle_gui.cpp
Show inline comments
 
@@ -403,30 +403,30 @@ struct RefitWindow : public Window {
 
static const Widget _vehicle_refit_widgets[] = {
 
	{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,                            STR_018B_CLOSE_WINDOW},
 
	{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   239,     0,    13, STR_983B_REFIT,                      STR_018C_WINDOW_TITLE_DRAG_THIS},
 
	{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,     0,   239,    14,    27, STR_983F_SELECT_CARGO_TYPE_TO_CARRY, STR_983D_SELECT_TYPE_OF_CARGO_FOR},
 
	{     WWT_MATRIX, RESIZE_BOTTOM,  COLOUR_GREY,     0,   227,    28,   139, 0x801,                               STR_EMPTY},
 
	{  WWT_SCROLLBAR, RESIZE_BOTTOM,  COLOUR_GREY,   228,   239,    28,   139, 0x0,                                 STR_0190_SCROLL_BAR_SCROLLS_LIST},
 
	{      WWT_PANEL,     RESIZE_TB,  COLOUR_GREY,     0,   239,   140,   161, 0x0,                                 STR_NULL},
 
	{ WWT_PUSHTXTBTN,     RESIZE_TB,  COLOUR_GREY,     0,   227,   162,   173, 0x0,                                 STR_NULL},
 
	{  WWT_RESIZEBOX,     RESIZE_TB,  COLOUR_GREY,   228,   239,   162,   173, 0x0,                                 STR_RESIZE_BUTTON},
 
	{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _vehicle_refit_desc = {
 
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_CONSTRUCTION,
 
	_vehicle_refit_widgets,
 
};
 
	_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 ( ? )
 
 */
 
void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order, Window *parent)
 
{
 
	DeleteWindowById(WC_VEHICLE_REFIT, v->index);
 
	RefitWindow *w = new RefitWindow(&_vehicle_refit_desc, v, order);
 
	w->parent = parent;
 
}
 

	
 
@@ -1125,30 +1125,30 @@ struct VehicleListWindow : public BaseVe
 
			this->vehicles.ForceRebuild();
 
			return;
 
		}
 

	
 
		if (data == 0) {
 
			this->vehicles.ForceRebuild();
 
		} else {
 
			this->vehicles.ForceResort();
 
		}
 
	}
 
};
 

	
 
static WindowDesc _vehicle_list_desc = {
 
static WindowDesc _vehicle_list_desc(
 
	WDP_AUTO, WDP_AUTO, 260, 194, 260, 246,
 
	WC_INVALID, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_vehicle_list_widgets,
 
};
 
	_vehicle_list_widgets
 
);
 

	
 
static void ShowVehicleListWindowLocal(CompanyID company, uint16 VLW_flag, VehicleType vehicle_type, uint16 unique_number)
 
{
 
	if (!IsValidCompanyID(company)) return;
 

	
 
	_vehicle_list_desc.cls = GetWindowClassForVehicleType(vehicle_type);
 
	WindowNumber num = (unique_number << 16) | (vehicle_type << 11) | VLW_flag | company;
 
	AllocateWindowDescFront<VehicleListWindow>(&_vehicle_list_desc, num);
 
}
 

	
 
void ShowVehicleListWindow(CompanyID company, VehicleType vehicle_type)
 
{
 
@@ -1535,30 +1535,30 @@ struct VehicleDetailsWindow : Window {
 

	
 
	virtual void OnResize(Point new_size, Point delta)
 
	{
 
		if (delta.x != 0) ResizeButtons(this, VLD_WIDGET_DETAILS_CARGO_CARRIED, VLD_WIDGET_DETAILS_TOTAL_CARGO);
 
		if (delta.y == 0) return;
 

	
 
		this->vscroll.cap += delta.y / 14;
 
		this->widget[VLD_WIDGET_MIDDLE_DETAILS].data = (this->vscroll.cap << 8) + 1;
 
	}
 
};
 

	
 
/** Vehicle details window descriptor. */
 
static const WindowDesc _vehicle_details_desc = {
 
static const WindowDesc _vehicle_details_desc(
 
	WDP_AUTO, WDP_AUTO, 405, 113, 405, 113,
 
	WC_VEHICLE_DETAILS, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_vehicle_details_widgets,
 
};
 
	_vehicle_details_widgets
 
);
 

	
 
/** Shows the vehicle details window of the given vehicle. */
 
static void ShowVehicleDetailsWindow(const Vehicle *v)
 
{
 
	DeleteWindowById(WC_VEHICLE_ORDERS, v->index, false);
 
	DeleteWindowById(WC_VEHICLE_TIMETABLE, v->index, false);
 
	AllocateWindowDescFront<VehicleDetailsWindow>(&_vehicle_details_desc, v->index);
 
}
 

	
 

	
 
/* Unified vehicle GUI - Vehicle View Window */
 

	
 
@@ -1576,40 +1576,40 @@ static const Widget _vehicle_view_widget
 
	{ WWT_PUSHIMGBTN,    RESIZE_LR,  COLOUR_GREY, 232, 249,  68,  85, SPR_SHOW_ORDERS,          0x0 /* filled later */ },          // VVW_WIDGET_SHOW_ORDERS
 
	{ WWT_PUSHIMGBTN,    RESIZE_LR,  COLOUR_GREY, 232, 249,  86, 103, SPR_SHOW_VEHICLE_DETAILS, 0x0 /* filled later */ },          // VVW_WIDGET_SHOW_DETAILS
 
	{ WWT_PUSHIMGBTN,    RESIZE_LR,  COLOUR_GREY, 232, 249,  32,  49, 0x0 /* filled later */,   0x0 /* filled later */ },          // VVW_WIDGET_CLONE_VEH
 
	{      WWT_PANEL,   RESIZE_LRB,  COLOUR_GREY, 232, 249, 104, 103, 0x0,                      STR_NULL },                        // VVW_WIDGET_EMPTY_BOTTOM_RIGHT
 
	{  WWT_RESIZEBOX,  RESIZE_LRTB,  COLOUR_GREY, 238, 249, 104, 115, 0x0,                      STR_NULL },                        // VVW_WIDGET_RESIZE
 
	{ WWT_PUSHIMGBTN,    RESIZE_LR,  COLOUR_GREY, 232, 249,  50,  67, SPR_FORCE_VEHICLE_TURN,   STR_9020_FORCE_VEHICLE_TO_TURN_AROUND }, // VVW_WIDGET_TURN_AROUND
 
	{ WWT_PUSHIMGBTN,    RESIZE_LR,  COLOUR_GREY, 232, 249,  50,  67, SPR_IGNORE_SIGNALS,       STR_884A_FORCE_TRAIN_TO_PROCEED },       // VVW_WIDGET_FORCE_PROCEED
 
{   WIDGETS_END},
 
};
 

	
 

	
 
/** Vehicle view window descriptor for all vehicles but trains. */
 
static const WindowDesc _vehicle_view_desc = {
 
static const WindowDesc _vehicle_view_desc(
 
	WDP_AUTO, WDP_AUTO, 250, 116, 250, 116,
 
	WC_VEHICLE_VIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_vehicle_view_widgets,
 
};
 
	_vehicle_view_widgets
 
);
 

	
 
/** Vehicle view window descriptor for trains. Only minimum_height and
 
 *  default_height are different for train view.
 
 */
 
static const WindowDesc _train_view_desc = {
 
static const WindowDesc _train_view_desc(
 
	WDP_AUTO, WDP_AUTO, 250, 134, 250, 134,
 
	WC_VEHICLE_VIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_vehicle_view_widgets,
 
};
 
	_vehicle_view_widgets
 
);
 

	
 

	
 
/* Just to make sure, nobody has changed the vehicle type constants, as we are
 
	 using them for array indexing in a number of places here. */
 
assert_compile(VEH_TRAIN == 0);
 
assert_compile(VEH_ROAD == 1);
 
assert_compile(VEH_SHIP == 2);
 
assert_compile(VEH_AIRCRAFT == 3);
 

	
 
/** Zoom levels for vehicle views indexed by vehicle type. */
 
static const ZoomLevel _vehicle_view_zoom_levels[] = {
 
	ZOOM_LVL_TRAIN,
src/waypoint_gui.cpp
Show inline comments
 
@@ -102,24 +102,24 @@ public:
 
static const Widget _waypoint_view_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_00C5,              STR_018B_CLOSE_WINDOW},                 // WAYPVW_CLOSEBOX
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   247,     0,    13, STR_WAYPOINT_VIEWPORT, STR_018C_WINDOW_TITLE_DRAG_THIS},       // WAYPVW_CAPTION
 
{  WWT_STICKYBOX,   RESIZE_NONE,  COLOUR_GREY,   248,   259,     0,    13, 0x0,                   STR_STICKY_BUTTON},                     // WAYPVW_STICKY
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   259,    14,   105, 0x0,                   STR_NULL},                              // WAYPVW_VIEWPORTPANEL
 
{      WWT_INSET,   RESIZE_NONE,  COLOUR_GREY,     2,   257,    16,   103, 0x0,                   STR_NULL},                              // WAYPVW_SPACER
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,     0,   121,   106,   117, STR_00E4_LOCATION,     STR_3053_CENTER_MAIN_VIEW_ON_STATION},  // WAYPVW_CENTERVIEW
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   122,   244,   106,   117, STR_0130_RENAME,       STR_CHANGE_WAYPOINT_NAME},              // WAYPVW_RENAME
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   245,   259,   106,   117, STR_TRAIN,             STR_SCHEDULED_TRAINS_TIP },             // WAYPVW_SHOW_TRAINS
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _waypoint_view_desc = {
 
static const WindowDesc _waypoint_view_desc(
 
	WDP_AUTO, WDP_AUTO, 260, 118, 260, 118,
 
	WC_WAYPOINT_VIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 
	_waypoint_view_widgets,
 
};
 
	_waypoint_view_widgets
 
);
 

	
 
void ShowWaypointWindow(const Waypoint *wp)
 
{
 
	if (!wp->IsValid()) return;  // little safety
 
	AllocateWindowDescFront<WaypointWindow>(&_waypoint_view_desc, wp->index);
 
}
src/window.cpp
Show inline comments
 
@@ -43,24 +43,41 @@ Window *_focused_window;
 

	
 
Point _cursorpos_drag_start;
 

	
 
int _scrollbar_start_pos;
 
int _scrollbar_size;
 
byte _scroller_click_timeout;
 

	
 
bool _scrolling_scrollbar;
 
bool _scrolling_viewport;
 

	
 
byte _special_mouse_mode;
 

	
 
/** Window description constructor. */
 
WindowDesc::WindowDesc(int16 left, int16 top, int16 min_width, int16 min_height, int16 def_width, int16 def_height,
 
			WindowClass window_class, WindowClass parent_class, uint32 flags, const Widget *widgets)
 
{
 
	this->left = left;
 
	this->top = top;
 
	this->minimum_width = min_width;
 
	this->minimum_height = min_height;
 
	this->default_width = def_width;
 
	this->default_height = def_height;
 
	this->cls = window_class;
 
	this->parent_cls = parent_class;
 
	this->flags = flags;
 
	this->widgets = widgets;
 
}
 

	
 

	
 
/**
 
 * Set the window that has the focus
 
 * @param w The window to set the focus on
 
 */
 
void SetFocusedWindow(Window *w)
 
{
 
	if (_focused_window == w) return;
 

	
 
	/* Invalidate focused widget */
 
	if (_focused_window != NULL && _focused_window->focused_widget != NULL) {
 
		uint focused_widget_id = _focused_window->focused_widget - _focused_window->widget;
 
		_focused_window->InvalidateWidget(focused_widget_id);
src/window_gui.h
Show inline comments
 
@@ -29,25 +29,29 @@ DECLARE_ENUM_AS_BIT_SET(FrameFlags);
 

	
 
/* wiget.cpp */
 
void DrawFrameRect(int left, int top, int right, int bottom, Colours colour, FrameFlags flags);
 

	
 
/* window.cpp */
 
extern Window *_z_front_window;
 
extern Window *_z_back_window;
 
extern Window *_focused_window;
 

	
 
/**
 
 * High level window description
 
 */
 
struct WindowDesc {
 
struct WindowDesc : ZeroedMemoryAllocator {
 

	
 
	WindowDesc(int16 left, int16 top, int16 min_width, int16 min_height, int16 def_width, int16 def_height,
 
			WindowClass window_class, WindowClass parent_class, uint32 flags, const Widget *widgets);
 

	
 
	int16 left;             ///< Prefered x position of left edge of the window, @see WindowDefaultPosition()
 
	int16 top;              ///< Prefered y position of the top of the window, @see WindowDefaultPosition()
 
	int16 minimum_width;    ///< Minimal width of the window
 
	int16 minimum_height;   ///< Minimal height of the window
 
	int16 default_width;    ///< Prefered initial width of the window
 
	int16 default_height;   ///< Prefered initial height of the window
 
	WindowClass cls;        ///< Class of the window, @see WindowClass
 
	WindowClass parent_cls; ///< Class of the parent window, @see WindowClass
 
	uint32 flags;           ///< Flags, @see WindowDefaultFlags
 
	const Widget *widgets;  ///< List of widgets with their position and size for the window
 
};
 

	
0 comments (0 inline, 0 general)