openttd updated to 1.5.0-beta2

--HG--
branch : openttd
This commit is contained in:
Pavel Stupnikov
2015-03-01 00:30:53 +03:00
parent 0abb47ce90
commit d201932121
682 changed files with 26103 additions and 16553 deletions

View File

@@ -1,4 +1,4 @@
/* $Id: autoreplace_widget.h 24900 2013-01-08 22:46:42Z planetmaker $ */
/* $Id: autoreplace_widget.h 26811 2014-09-11 17:10:38Z alberth $ */
/*
* This file is part of OpenTTD.
@@ -16,6 +16,11 @@
enum ReplaceVehicleWidgets {
WID_RV_CAPTION, ///< Caption of the window.
/* Sort dropdown at the right. */
WID_RV_SORT_ASCENDING_DESCENDING, ///< Ascending/descending sort order button.
WID_RV_SHOW_HIDDEN_ENGINES, ///< Toggle whether to display the hidden vehicles.
WID_RV_SORT_DROPDOWN, ///< Dropdown for the sort criteria.
/* Left and right matrix + details. */
WID_RV_LEFT_MATRIX, ///< The matrix on the left.
WID_RV_LEFT_SCROLLBAR, ///< The scrollbar for the matrix on the left.

View File

@@ -1,4 +1,4 @@
/* $Id: build_vehicle_widget.h 23600 2011-12-19 20:46:17Z truebrain $ */
/* $Id: build_vehicle_widget.h 26811 2014-09-11 17:10:38Z alberth $ */
/*
* This file is part of OpenTTD.
@@ -15,13 +15,15 @@
/** Widgets of the #BuildVehicleWindow class. */
enum BuildVehicleWidgets {
WID_BV_CAPTION, ///< Caption of window.
WID_BV_SORT_ASSENDING_DESCENDING, ///< Sort direction.
WID_BV_SORT_ASCENDING_DESCENDING, ///< Sort direction.
WID_BV_SORT_DROPDOWN, ///< Criteria of sorting dropdown.
WID_BV_CARGO_FILTER_DROPDOWN, ///< Cargo filter dropdown.
WID_BV_SHOW_HIDDEN_ENGINES, ///< Toggle whether to display the hidden vehicles.
WID_BV_LIST, ///< List of vehicles.
WID_BV_SCROLLBAR, ///< Scrollbar of list.
WID_BV_PANEL, ///< Button panel.
WID_BV_BUILD, ///< Build panel.
WID_BV_SHOW_HIDE, ///< Button to hide or show the selected engine.
WID_BV_BUILD_SEL, ///< Build button.
WID_BV_RENAME, ///< Rename button.
};

View File

@@ -1,4 +1,4 @@
/* $Id: dropdown.cpp 26128 2013-11-26 15:12:54Z rubidium $ */
/* $Id: dropdown.cpp 27131 2015-02-01 12:23:39Z frosch $ */
/*
* This file is part of OpenTTD.
@@ -18,6 +18,8 @@
#include "dropdown_widget.h"
#include "../safeguards.h"
void DropDownListItem::Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const
{
@@ -80,7 +82,7 @@ static const NWidgetPart _nested_dropdown_menu_widgets[] = {
static WindowDesc _dropdown_desc(
WDP_MANUAL, NULL, 0, 0,
WC_DROPDOWN_MENU, WC_NONE,
0,
WDF_NO_FOCUS,
_nested_dropdown_menu_widgets, lengthof(_nested_dropdown_menu_widgets)
);
@@ -114,6 +116,8 @@ struct DropdownWindow : Window {
DropdownWindow(Window *parent, const DropDownList *list, int selected, int button, bool instant_close, const Point &position, const Dimension &size, Colours wi_colour, bool scroll)
: Window(&_dropdown_desc)
{
assert(list->Length() > 0);
this->position = position;
this->CreateNestedTree();
@@ -340,27 +344,18 @@ void ShowDropDownListAt(Window *w, const DropDownList *list, int selected, int b
/* The preferred width equals the calling widget */
uint width = wi_rect.right - wi_rect.left + 1;
/* Longest item in the list, if auto_width is enabled */
uint max_item_width = 0;
if (auto_width) {
/* Find the longest item in the list */
for (const DropDownListItem * const *it = list->Begin(); it != list->End(); ++it) {
const DropDownListItem *item = *it;
max_item_width = max(max_item_width, item->Width() + 5);
}
}
/* Total length of list */
int list_height = 0;
int height = 0;
for (const DropDownListItem * const *it = list->Begin(); it != list->End(); ++it) {
const DropDownListItem *item = *it;
list_height += item->Height(width);
height += item->Height(width);
if (auto_width) max_item_width = max(max_item_width, item->Width() + 5);
}
/* Height of window visible */
int height = list_height;
/* Check if the status bar is visible, as we don't want to draw over it */
int screen_bottom = GetMainViewBottom();
bool scroll = false;
@@ -373,7 +368,7 @@ void ShowDropDownListAt(Window *w, const DropDownList *list, int selected, int b
} else {
/* ... and lastly if it won't, enable the scroll bar and fit the
* list in below the widget */
int avg_height = list_height / (int)list->Length();
int avg_height = height / (int)list->Length();
int rows = (screen_bottom - 4 - top) / avg_height;
height = rows * avg_height;
scroll = true;

View File

@@ -1,4 +1,4 @@
/* $Id: genworld_widget.h 23600 2011-12-19 20:46:17Z truebrain $ */
/* $Id: genworld_widget.h 26885 2014-09-21 12:25:04Z rubidium $ */
/*
* This file is part of OpenTTD.
@@ -25,11 +25,12 @@ enum GenerateLandscapeWidgets {
WID_GL_TOWN_PULLDOWN, ///< Dropdown 'No. of towns'.
WID_GL_INDUSTRY_PULLDOWN, ///< Dropdown 'No. of industries'.
WID_GL_RANDOM_EDITBOX, ///< 'Random seed' editbox.
WID_GL_RANDOM_BUTTON, ///< 'Randomise' button.
WID_GL_GENERATE_BUTTON, ///< 'Generate' button.
WID_GL_MAX_HEIGHTLEVEL_DOWN, ///< Decrease max. heightlevel
WID_GL_MAX_HEIGHTLEVEL_TEXT, ///< Max. heightlevel
WID_GL_MAX_HEIGHTLEVEL_UP, ///< Increase max. heightlevel
WID_GL_START_DATE_DOWN, ///< Decrease start year.
WID_GL_START_DATE_TEXT, ///< Start year.
WID_GL_START_DATE_UP, ///< Increase start year.

View File

@@ -1,4 +1,4 @@
/* $Id: newgrf_widget.h 23932 2012-02-12 10:32:41Z rubidium $ */
/* $Id: newgrf_widget.h 26613 2014-05-24 19:15:57Z alberth $ */
/*
* This file is part of OpenTTD.
@@ -39,6 +39,7 @@ enum NewGRFStateWidgets {
WID_NS_REMOVE, ///< Remove NewGRF from active list.
WID_NS_MOVE_UP, ///< Move NewGRF up in active list.
WID_NS_MOVE_DOWN, ///< Move NewGRF down in active list.
WID_NS_UPGRADE, ///< Upgrade NewGRFs that have a newer version available.
WID_NS_FILTER, ///< Filter list of available NewGRFs.
WID_NS_FILE_LIST, ///< List window of active NewGRFs.
WID_NS_SCROLLBAR, ///< Scrollbar for active NewGRF list.
@@ -60,6 +61,15 @@ enum NewGRFStateWidgets {
WID_NS_SHOW_APPLY, ///< Select display of the buttons below the 'details'.
};
/** Widgets of the #SavePresetWindow class. */
enum SavePresetWidgets {
WID_SVP_PRESET_LIST, ///< List with available preset names.
WID_SVP_SCROLLBAR, ///< Scrollbar for the list available preset names.
WID_SVP_EDITBOX, ///< Edit box for changing the preset name.
WID_SVP_CANCEL, ///< Button to cancel saving the preset.
WID_SVP_SAVE, ///< Button to save the preset.
};
/** Widgets of the #ScanProgressWindow class. */
enum ScanProgressWidgets {
WID_SP_PROGRESS_BAR, ///< Simple progress bar.

View File

@@ -1,4 +1,4 @@
/* $Id: settings_widget.h 26320 2014-02-09 13:04:50Z alberth $ */
/* $Id: settings_widget.h 26990 2014-10-11 13:22:37Z peter1138 $ */
/*
* This file is part of OpenTTD.
@@ -23,7 +23,7 @@ enum GameOptionsWidgets {
WID_GO_LANG_DROPDOWN, ///< Language dropdown.
WID_GO_RESOLUTION_DROPDOWN, ///< Dropdown for the resolution.
WID_GO_FULLSCREEN_BUTTON, ///< Toggle fullscreen.
WID_GO_SCREENSHOT_DROPDOWN, ///< Select the screenshot type... please use PNG!.
WID_GO_GUI_ZOOM_DROPDOWN, ///< Dropdown for the GUI zoom level.
WID_GO_BASE_GRF_DROPDOWN, ///< Use to select a base GRF.
WID_GO_BASE_GRF_STATUS, ///< Info about missing files etc.
WID_GO_BASE_GRF_TEXTFILE, ///< Open base GRF readme, changelog (+1) or license (+2).

View File

@@ -1,4 +1,4 @@
/* $Id: sign_widget.h 24750 2012-11-14 22:51:05Z frosch $ */
/* $Id: sign_widget.h 27020 2014-10-15 18:31:37Z rubidium $ */
/*
* This file is part of OpenTTD.
@@ -34,4 +34,4 @@ enum QueryEditSignWidgets {
WID_QES_NEXT, ///< Next button.
};
#endif /* */
#endif /* SIGN_WIDGET_H */

View File

@@ -1,5 +1,5 @@
/* $Id: story_widget.h 25387 2013-06-09 18:58:36Z rubidium $ */
/* $Id: story_widget.h 26442 2014-04-03 10:54:37Z planetmaker $ */
/*
* This file is part of OpenTTD.
@@ -23,4 +23,4 @@ enum StoryBookWidgets {
WID_SB_NEXT_PAGE, ///< Next button.
};
#endif /* WIDGETS_STORY_WIDGET_H */
#endif /* WIDGETS_STORY_WIDGET_H */