Merge remote-tracking branch 'upstream/master'

This commit is contained in:
pelya
2021-01-25 00:50:42 +02:00
1076 changed files with 25433 additions and 61762 deletions
+61
View File
@@ -0,0 +1,61 @@
add_files(
ai_widget.h
airport_widget.h
autoreplace_widget.h
bootstrap_widget.h
bridge_widget.h
build_vehicle_widget.h
cheat_widget.h
company_widget.h
console_widget.h
date_widget.h
depot_widget.h
dock_widget.h
dropdown.cpp
dropdown_func.h
dropdown_type.h
dropdown_widget.h
engine_widget.h
error_widget.h
fios_widget.h
framerate_widget.h
genworld_widget.h
goal_widget.h
graph_widget.h
group_widget.h
highscore_widget.h
industry_widget.h
intro_widget.h
link_graph_legend_widget.h
main_widget.h
misc_widget.h
music_widget.h
network_chat_widget.h
network_content_widget.h
network_widget.h
newgrf_debug_widget.h
newgrf_widget.h
news_widget.h
object_widget.h
order_widget.h
osk_widget.h
rail_widget.h
road_widget.h
screenshot_widget.h
settings_widget.h
sign_widget.h
smallmap_widget.h
station_widget.h
statusbar_widget.h
story_widget.h
subsidy_widget.h
terraform_widget.h
timetable_widget.h
toolbar_widget.h
town_widget.h
transparency_widget.h
tree_widget.h
vehicle_widget.h
viewport_widget.h
waypoint_widget.h
)
+1
View File
@@ -12,6 +12,7 @@
/** Widgets of the #CheatWindow class. */
enum CheatWidgets {
WID_C_NOTE, ///< Note on top of panel for use of cheat.
WID_C_PANEL, ///< Panel where all cheats are shown in.
};
+3
View File
@@ -46,6 +46,9 @@ enum CompanyWidgets {
WID_C_VIEW_INFRASTRUCTURE, ///< Panel about infrastructure.
WID_C_SELECT_GIVE_MONEY, ///< Selection widget for the give money button.
WID_C_GIVE_MONEY, ///< Button to give money.
WID_C_HAS_PASSWORD, ///< Has company password lock.
WID_C_SELECT_MULTIPLAYER, ///< Multiplayer selection panel.
WID_C_COMPANY_PASSWORD, ///< Button to set company password.
+6 -6
View File
@@ -65,7 +65,7 @@ StringID DropDownListParamStringItem::String() const
StringID DropDownListCharStringItem::String() const
{
SetDParamStr(0, this->raw_string);
SetDParamStr(0, this->raw_string.c_str());
return this->string;
}
@@ -83,7 +83,7 @@ DropDownListIconItem::DropDownListIconItem(SpriteID sprite, PaletteID pal, Strin
uint DropDownListIconItem::Height(uint width) const
{
return max(this->dim.height, DropDownListParamStringItem::Height(width));
return std::max(this->dim.height, DropDownListParamStringItem::Height(width));
}
uint DropDownListIconItem::Width() const
@@ -436,7 +436,7 @@ void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button
for (const auto &item : list) {
height += item->Height(width);
if (auto_width) max_item_width = max(max_item_width, item->Width() + 5);
if (auto_width) max_item_width = std::max(max_item_width, item->Width() + 5);
}
/* Scrollbar needed? */
@@ -446,12 +446,12 @@ void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button
bool above = false;
/* Available height below (or above, if the dropdown is placed above the widget). */
uint available_height = (uint)max(_screen.height - top - 4, 0);
uint available_height = std::max(_screen.height - top - 4, 0);
/* If the dropdown doesn't fully fit below the widget... */
if (height > available_height) {
uint available_height_above = (uint)max(w->top + wi_rect.top - GetMainViewTop() - 4, 0);
uint available_height_above = std::max(w->top + wi_rect.top - GetMainViewTop() - 4, 0);
/* Put the dropdown above if there is more available space. */
if (available_height_above > available_height) {
@@ -481,7 +481,7 @@ void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button
}
}
if (auto_width) width = max(width, max_item_width);
if (auto_width) width = std::max(width, max_item_width);
Point dw_pos = { w->left + (_current_text_dir == TD_RTL ? wi_rect.right + 1 - (int)width : wi_rect.left), top};
Dimension dw_size = {width, height};
+2 -2
View File
@@ -69,9 +69,9 @@ public:
*/
class DropDownListCharStringItem : public DropDownListStringItem {
public:
const char *raw_string;
std::string raw_string;
DropDownListCharStringItem(const char *raw_string, int result, bool masked) : DropDownListStringItem(STR_JUST_RAW_STRING, result, masked), raw_string(raw_string) {}
DropDownListCharStringItem(const std::string &raw_string, int result, bool masked) : DropDownListStringItem(STR_JUST_RAW_STRING, result, masked), raw_string(raw_string) {}
StringID String() const override;
};
+2
View File
@@ -13,6 +13,8 @@
/** Widgets of the #VehicleGroupWindow class. */
enum GroupListWidgets {
WID_GL_CAPTION, ///< Caption of the window.
WID_GL_GROUP_BY_ORDER, ///< Group order.
WID_GL_GROUP_BY_DROPDOWN, ///< Group by dropdown list.
WID_GL_SORT_BY_ORDER, ///< Sort order.
WID_GL_SORT_BY_DROPDOWN, ///< Sort by dropdown list.
WID_GL_LIST_VEHICLE, ///< List of the vehicles.
+2
View File
@@ -12,6 +12,7 @@
/** Widgets of the #LandInfoWindow class. */
enum LandInfoWidgets {
WID_LI_LOCATION, ///< Scroll to location.
WID_LI_BACKGROUND, ///< Background of the window.
};
@@ -24,6 +25,7 @@ enum ToolTipsWidgets {
enum AboutWidgets {
WID_A_SCROLLING_TEXT, ///< The actually scrolling text.
WID_A_WEBSITE, ///< URL of OpenTTD website.
WID_A_COPYRIGHT, ///< Copyright string
};
/** Widgets of the #QueryStringWindow class. */
+2 -3
View File
@@ -14,8 +14,6 @@
enum NetworkGameWidgets {
WID_NG_MAIN, ///< Main panel.
WID_NG_CONNECTION, ///< Label in front of connection droplist.
WID_NG_CONN_BTN, ///< 'Connection' droplist button.
WID_NG_CLIENT_LABEL, ///< Label in front of client name edit box.
WID_NG_CLIENT, ///< Panel with editbox to set client name.
WID_NG_FILTER_LABEL, ///< Label in front of the filter/search edit box.
@@ -45,7 +43,8 @@ enum NetworkGameWidgets {
WID_NG_NEWGRF_MISSING, ///< 'Find missing NewGRF online' button.
WID_NG_NEWGRF_MISSING_SEL, ///< Selection widget for the above button.
WID_NG_FIND, ///< 'Find server' button.
WID_NG_SEARCH_INTERNET, ///< 'Search internet server' button.
WID_NG_SEARCH_LAN, ///< 'Search LAN server' button.
WID_NG_ADD, ///< 'Add server' button.
WID_NG_START, ///< 'Start server' button.
WID_NG_CANCEL, ///< 'Cancel' button.
+1
View File
@@ -24,6 +24,7 @@ enum SignListWidgets {
/** Widgets of the #SignWindow class. */
enum QueryEditSignWidgets {
WID_QES_CAPTION, ///< Caption of the window.
WID_QES_LOCATION, ///< Scroll to sign location.
WID_QES_TEXT, ///< Text of the query.
WID_QES_OK, ///< OK button.
WID_QES_CANCEL, ///< Cancel button.
+2 -2
View File
@@ -13,10 +13,10 @@
/** Widgets of the #StationViewWindow class. */
enum StationViewWidgets {
WID_SV_CAPTION, ///< Caption of the window.
WID_SV_SORT_ORDER, ///< 'Sort order' button
WID_SV_SORT_BY, ///< 'Sort by' button
WID_SV_GROUP, ///< label for "group by"
WID_SV_GROUP_BY, ///< 'Group by' button
WID_SV_SORT_ORDER, ///< 'Sort order' button
WID_SV_SORT_BY, ///< 'Sort by' button
WID_SV_WAITING, ///< List of waiting cargo.
WID_SV_SCROLLBAR, ///< Scrollbar.
WID_SV_ACCEPT_RATING_LIST, ///< List of accepted cargoes / rating of cargoes.
+5 -12
View File
@@ -12,20 +12,13 @@
/** Widgets of the #BuildTreesWindow class. */
enum BuildTreesWidgets {
WID_BT_TYPE_11, ///< Tree 1st column 1st row.
WID_BT_TYPE_12, ///< Tree 1st column 2nd row.
WID_BT_TYPE_13, ///< Tree 1st column 3rd row.
WID_BT_TYPE_14, ///< Tree 1st column 4th row.
WID_BT_TYPE_21, ///< Tree 2st column 1st row.
WID_BT_TYPE_22, ///< Tree 2st column 2nd row.
WID_BT_TYPE_23, ///< Tree 2st column 3rd row.
WID_BT_TYPE_24, ///< Tree 2st column 4th row.
WID_BT_TYPE_31, ///< Tree 3st column 1st row.
WID_BT_TYPE_32, ///< Tree 3st column 2nd row.
WID_BT_TYPE_33, ///< Tree 3st column 3rd row.
WID_BT_TYPE_34, ///< Tree 3st column 4th row.
WID_BT_TYPE_RANDOM, ///< Button to build random type of tree.
WID_BT_SE_PANE, ///< Selection pane to show/hide scenario editor tools.
WID_BT_MODE_NORMAL, ///< Select normal/rectangle planting mode.
WID_BT_MODE_FOREST_SM, ///< Select small forest planting mode.
WID_BT_MODE_FOREST_LG, ///< Select large forest planting mode.
WID_BT_MANY_RANDOM, ///< Button to build many random trees.
WID_BT_TYPE_BUTTON_FIRST, ///< First tree type selection button. (This must be last in the enum.)
};
#endif /* WIDGETS_TREE_WIDGET_H */
+5 -2
View File
@@ -15,7 +15,9 @@ enum VehicleViewWidgets {
WID_VV_CAPTION, ///< Caption of window.
WID_VV_VIEWPORT, ///< Viewport widget.
WID_VV_START_STOP, ///< Start or stop this vehicle, and show information about the current state.
WID_VV_CENTER_MAIN_VIEW, ///< Center the main view on this vehicle.
WID_VV_RENAME, ///< Rename vehicle
WID_VV_LOCATION, ///< Center the main view on this vehicle.
WID_VV_ORDER_LOCATION, ///< Center the main view on the order's target location.
WID_VV_GOTO_DEPOT, ///< Order this vehicle to go to the depot.
WID_VV_REFIT, ///< Open the refit window.
WID_VV_SHOW_ORDERS, ///< Show the orders of this vehicle.
@@ -43,7 +45,6 @@ enum VehicleRefitWidgets {
/** Widgets of the #VehicleDetailsWindow class. */
enum VehicleDetailsWidgets {
WID_VD_CAPTION, ///< Caption of window.
WID_VD_RENAME_VEHICLE, ///< Rename this vehicle.
WID_VD_TOP_DETAILS, ///< Panel with generic details.
WID_VD_INCREASE_SERVICING_INTERVAL, ///< Increase the servicing interval.
WID_VD_DECREASE_SERVICING_INTERVAL, ///< Decrease the servicing interval.
@@ -61,6 +62,8 @@ enum VehicleDetailsWidgets {
/** Widgets of the #VehicleListWindow class. */
enum VehicleListWidgets {
WID_VL_CAPTION, ///< Caption of window.
WID_VL_GROUP_ORDER, ///< Group order.
WID_VL_GROUP_BY_PULLDOWN, ///< Group by dropdown list.
WID_VL_SORT_ORDER, ///< Sort order.
WID_VL_SORT_BY_PULLDOWN, ///< Sort by dropdown list.
WID_VL_LIST, ///< List of the vehicles.