Merge branch 'master' into jgrpp

Replace build and refit, and group collapse implementations
Fix template creation build and refit

# Conflicts:
#	Makefile.bundle.in
#	config.lib
#	src/animated_tile.cpp
#	src/blitter/32bpp_anim.hpp
#	src/blitter/32bpp_base.hpp
#	src/blitter/8bpp_base.hpp
#	src/blitter/null.hpp
#	src/build_vehicle_gui.cpp
#	src/command.cpp
#	src/command_func.h
#	src/console_gui.cpp
#	src/core/smallstack_type.hpp
#	src/date.cpp
#	src/debug.cpp
#	src/genworld_gui.cpp
#	src/ground_vehicle.hpp
#	src/group_gui.cpp
#	src/lang/korean.txt
#	src/linkgraph/linkgraph_gui.h
#	src/main_gui.cpp
#	src/misc_gui.cpp
#	src/network/core/game.h
#	src/network/core/packet.cpp
#	src/network/core/udp.cpp
#	src/network/core/udp.h
#	src/network/network_content.cpp
#	src/network/network_type.h
#	src/network/network_udp.cpp
#	src/newgrf_house.h
#	src/openttd.cpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/os/unix/crashlog_unix.cpp
#	src/os/windows/crashlog_win.cpp
#	src/osk_gui.cpp
#	src/pathfinder/opf/opf_ship.cpp
#	src/rail_cmd.cpp
#	src/rail_gui.cpp
#	src/saveload/saveload.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/smallmap_gui.h
#	src/station_base.h
#	src/station_cmd.cpp
#	src/table/gameopt_settings.ini
#	src/table/newgrf_debug_data.h
#	src/table/settings.ini
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/train_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
#	src/vehiclelist.cpp
#	src/viewport.cpp
#	src/widgets/dropdown.cpp
#	src/window_gui.h
This commit is contained in:
Jonathan G Rennison
2019-03-27 18:12:04 +00:00
422 changed files with 4697 additions and 6619 deletions

View File

@@ -366,7 +366,7 @@ struct DepotWindow : Window {
}
}
void DrawWidget(const Rect &r, int widget) const
void DrawWidget(const Rect &r, int widget) const override
{
if (widget != WID_D_MATRIX) return;
@@ -400,7 +400,7 @@ struct DepotWindow : Window {
uint16 rows_in_display = wid->current_y / wid->resize_y;
uint16 num = this->vscroll->GetPosition() * this->num_columns;
int maxval = min(this->vehicle_list.Length(), num + (rows_in_display * this->num_columns));
int maxval = min(this->vehicle_list.size(), num + (rows_in_display * this->num_columns));
int y;
for (y = r.top + 1; num < maxval; y += this->resize.step_height) { // Draw the rows
for (byte i = 0; i < this->num_columns && num < maxval; i++, num++) {
@@ -415,16 +415,16 @@ struct DepotWindow : Window {
}
}
maxval = min(this->vehicle_list.Length() + this->wagon_list.Length(), (this->vscroll->GetPosition() * this->num_columns) + (rows_in_display * this->num_columns));
maxval = min(this->vehicle_list.size() + this->wagon_list.size(), (this->vscroll->GetPosition() * this->num_columns) + (rows_in_display * this->num_columns));
/* Draw the train wagons without an engine in front. */
for (; num < maxval; num++, y += this->resize.step_height) {
const Vehicle *v = this->wagon_list[num - this->vehicle_list.Length()];
const Vehicle *v = this->wagon_list[num - this->vehicle_list.size()];
this->DrawVehicleInDepot(v, r.left, r.right, y);
}
}
void SetStringParameters(int widget) const
void SetStringParameters(int widget) const override
{
if (widget != WID_D_CAPTION) return;
@@ -467,7 +467,7 @@ struct DepotWindow : Window {
uint pos = ((row + this->vscroll->GetPosition()) * this->num_columns) + xt;
if (this->vehicle_list.Length() + this->wagon_list.Length() <= pos) {
if (this->vehicle_list.size() + this->wagon_list.size() <= pos) {
/* Clicking on 'line' / 'block' without a vehicle */
if (this->type == VEH_TRAIN) {
/* End the dragging */
@@ -480,12 +480,12 @@ struct DepotWindow : Window {
}
bool wagon = false;
if (this->vehicle_list.Length() > pos) {
if (this->vehicle_list.size() > pos) {
*veh = this->vehicle_list[pos];
/* Skip vehicles that are scrolled off the list */
if (this->type == VEH_TRAIN) x += this->hscroll->GetPosition();
} else {
pos -= this->vehicle_list.Length();
pos -= this->vehicle_list.size();
*veh = this->wagon_list[pos];
/* free wagons don't have an initial loco. */
x -= ScaleGUITrad(VEHICLEINFO_FULL_VEHICLE_WIDTH);
@@ -652,7 +652,7 @@ struct DepotWindow : Window {
uint flag_width;
uint flag_height;
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
switch (widget) {
case WID_D_MATRIX: {
@@ -703,12 +703,12 @@ struct DepotWindow : Window {
* @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
void OnInvalidateData(int data = 0, bool gui_scope = true) override
{
this->generate_list = true;
}
virtual void OnPaint()
void OnPaint() override
{
if (this->generate_list) {
/* Generate the vehicle list
@@ -728,7 +728,7 @@ struct DepotWindow : Window {
/* determine amount of items for scroller */
if (this->type == VEH_TRAIN) {
uint max_width = ScaleGUITrad(VEHICLEINFO_FULL_VEHICLE_WIDTH);
for (uint num = 0; num < this->vehicle_list.Length(); num++) {
for (uint num = 0; num < this->vehicle_list.size(); num++) {
uint width = 0;
for (const Train *v = Train::From(this->vehicle_list[num]); v != NULL; v = v->Next()) {
width += v->GetDisplayImageWidth();
@@ -736,11 +736,11 @@ struct DepotWindow : Window {
max_width = max(max_width, width);
}
/* Always have 1 empty row, so people can change the setting of the train */
this->vscroll->SetCount(this->vehicle_list.Length() + this->wagon_list.Length() + 1);
this->vscroll->SetCount(this->vehicle_list.size() + this->wagon_list.size() + 1);
/* Always make it longer than the longest train, so you can attach vehicles at the end, and also see the next vertical tile separator line */
this->hscroll->SetCount(max_width + ScaleGUITrad(2 * VEHICLEINFO_FULL_VEHICLE_WIDTH + 1));
} else {
this->vscroll->SetCount(CeilDiv(this->vehicle_list.Length(), this->num_columns));
this->vscroll->SetCount(CeilDiv(this->vehicle_list.size(), this->num_columns));
}
/* Setup disabled buttons. */
@@ -760,7 +760,7 @@ struct DepotWindow : Window {
this->DrawWidgets();
}
virtual void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
switch (widget) {
case WID_D_MATRIX: { // List
@@ -813,7 +813,7 @@ struct DepotWindow : Window {
case WID_D_SELL_ALL:
/* Only open the confirmation window if there are anything to sell */
if (this->vehicle_list.Length() != 0 || this->wagon_list.Length() != 0) {
if (this->vehicle_list.size() != 0 || this->wagon_list.size() != 0) {
TileIndex tile = this->window_number;
byte vehtype = this->type;
@@ -839,7 +839,7 @@ struct DepotWindow : Window {
}
}
virtual void OnQueryTextFinished(char *str)
void OnQueryTextFinished(char *str) override
{
if (str == NULL) return;
@@ -847,7 +847,7 @@ struct DepotWindow : Window {
DoCommandP(0, GetDepotIndex(this->window_number), 0, CMD_RENAME_DEPOT | CMD_MSG(STR_ERROR_CAN_T_RENAME_DEPOT), NULL, str);
}
virtual bool OnRightClick(Point pt, int widget)
bool OnRightClick(Point pt, int widget) override
{
if (widget != WID_D_MATRIX) return false;
@@ -908,7 +908,7 @@ struct DepotWindow : Window {
* @param v the original vehicle to clone
* @return Always true.
*/
virtual bool OnVehicleSelect(const Vehicle *v)
bool OnVehicleSelect(const Vehicle *v) override
{
if (_ctrl_pressed) {
/* Share-clone, do not open new viewport, and keep tool active */
@@ -924,7 +924,7 @@ struct DepotWindow : Window {
return true;
}
virtual void OnPlaceObjectAbort()
void OnPlaceObjectAbort() override
{
/* abort clone */
this->RaiseWidget(WID_D_CLONE);
@@ -942,7 +942,7 @@ struct DepotWindow : Window {
}
}
virtual void OnMouseDrag(Point pt, int widget)
void OnMouseDrag(Point pt, int widget) override
{
if (this->sel == INVALID_VEHICLE) return;
if (widget != this->hovered_widget) {
@@ -994,7 +994,7 @@ struct DepotWindow : Window {
this->SetWidgetDirty(widget);
}
virtual void OnDragDrop(Point pt, int widget)
void OnDragDrop(Point pt, int widget) override
{
switch (widget) {
case WID_D_MATRIX: {
@@ -1049,7 +1049,7 @@ struct DepotWindow : Window {
_cursor.vehchain = false;
}
virtual void OnTimeout()
void OnTimeout() override
{
if (!this->IsWidgetDisabled(WID_D_SELL)) {
this->RaiseWidget(WID_D_SELL);
@@ -1061,7 +1061,7 @@ struct DepotWindow : Window {
}
}
virtual void OnResize()
void OnResize() override
{
this->vscroll->SetCapacityFromWidget(this, WID_D_MATRIX);
NWidgetCore *nwi = this->GetWidget<NWidgetCore>(WID_D_MATRIX);
@@ -1072,7 +1072,7 @@ struct DepotWindow : Window {
}
}
virtual EventState OnCTRLStateChange()
EventState OnCTRLStateChange() override
{
if (this->sel != INVALID_VEHICLE) {
_cursor.vehchain = _ctrl_pressed;