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:
@@ -498,7 +498,7 @@ struct BuildRailToolbarWindow : 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
|
||||
{
|
||||
if (!gui_scope) return;
|
||||
|
||||
@@ -567,7 +567,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void SetStringParameters(int widget) const
|
||||
void SetStringParameters(int widget) const override
|
||||
{
|
||||
if (widget == WID_RAT_CAPTION) {
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(this->railtype);
|
||||
@@ -581,7 +581,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
{
|
||||
if (widget == WID_RAT_POLYRAIL) {
|
||||
Dimension d = GetSpriteSize(SPR_BLOT);
|
||||
@@ -590,7 +590,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
{
|
||||
if (widget < WID_RAT_BUILD_NS) return;
|
||||
|
||||
@@ -716,7 +716,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
if (_ctrl_pressed) RailToolbar_CtrlChanged(this);
|
||||
}
|
||||
|
||||
virtual EventState OnHotkey(int hotkey)
|
||||
EventState OnHotkey(int hotkey) override
|
||||
{
|
||||
MarkTileDirtyByTile(TileVirtXY(_thd.pos.x, _thd.pos.y)); // redraw tile selection
|
||||
|
||||
@@ -730,7 +730,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
return this->Window::OnHotkey(hotkey);
|
||||
}
|
||||
|
||||
virtual void OnPlaceObject(Point pt, TileIndex tile)
|
||||
void OnPlaceObject(Point pt, TileIndex tile) override
|
||||
{
|
||||
switch (this->last_user_action) {
|
||||
case WID_RAT_BUILD_NS:
|
||||
@@ -792,7 +792,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt)
|
||||
void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) override
|
||||
{
|
||||
/* no dragging if you have pressed the convert button */
|
||||
if (FindWindowById(WC_BUILD_SIGNAL, 0) != NULL && _convert_signal_button && this->IsWidgetLowered(WID_RAT_BUILD_SIGNALS)) return;
|
||||
@@ -800,7 +800,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
VpSelectTilesWithMethod(pt.x, pt.y, select_method);
|
||||
}
|
||||
|
||||
virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile)
|
||||
void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override
|
||||
{
|
||||
if (pt.x != -1) {
|
||||
switch (select_proc) {
|
||||
@@ -853,7 +853,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnPlaceObjectAbort()
|
||||
void OnPlaceObjectAbort() override
|
||||
{
|
||||
this->RaiseButtons();
|
||||
this->DisableWidget(WID_RAT_REMOVE);
|
||||
@@ -867,13 +867,13 @@ struct BuildRailToolbarWindow : Window {
|
||||
DeleteWindowByClass(WC_BUILD_BRIDGE);
|
||||
}
|
||||
|
||||
virtual void OnPlacePresize(Point pt, TileIndex tile)
|
||||
void OnPlacePresize(Point pt, TileIndex tile) override
|
||||
{
|
||||
DoCommand(tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0, DC_AUTO, CMD_BUILD_TUNNEL);
|
||||
VpSetPresizeRange(tile, _build_tunnel_endtile == 0 ? tile : _build_tunnel_endtile);
|
||||
}
|
||||
|
||||
virtual EventState OnCTRLStateChange()
|
||||
EventState OnCTRLStateChange() override
|
||||
{
|
||||
/* do not toggle Remove button by Ctrl when placing station */
|
||||
if (!this->IsWidgetLowered(WID_RAT_BUILD_STATION) && !this->IsWidgetLowered(WID_RAT_BUILD_WAYPOINT) && RailToolbar_CtrlChanged(this)) return ES_HANDLED;
|
||||
@@ -1114,7 +1114,7 @@ public:
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
}
|
||||
|
||||
virtual void OnPaint()
|
||||
void OnPaint() override
|
||||
{
|
||||
bool newstations = _railstation.newstations;
|
||||
const StationSpec *statspec = newstations ? StationClass::Get(_railstation.station_class)->GetSpec(_railstation.station_type) : NULL;
|
||||
@@ -1166,7 +1166,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
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_BRAS_NEWST_LIST: {
|
||||
@@ -1223,7 +1223,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
{
|
||||
DrawPixelInfo tmp_dpi;
|
||||
|
||||
@@ -1297,14 +1297,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnResize()
|
||||
void OnResize() override
|
||||
{
|
||||
if (this->vscroll != NULL) { // New stations available.
|
||||
this->vscroll->SetCapacityFromWidget(this, WID_BRAS_NEWST_LIST);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void SetStringParameters(int widget) const
|
||||
void SetStringParameters(int widget) const override
|
||||
{
|
||||
if (widget == WID_BRAS_SHOW_NEWST_TYPE) {
|
||||
const StationSpec *statspec = StationClass::Get(_railstation.station_class)->GetSpec(_railstation.station_type);
|
||||
@@ -1312,7 +1312,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
{
|
||||
switch (GB(widget, 0, 16)) {
|
||||
case WID_BRAS_PLATFORM_DIR_X:
|
||||
@@ -1488,7 +1488,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnRealtimeTick(uint delta_ms)
|
||||
void OnRealtimeTick(uint delta_ms) override
|
||||
{
|
||||
CheckRedrawStationCoverage(this);
|
||||
}
|
||||
@@ -1654,7 +1654,7 @@ public:
|
||||
_program_signal_button = false;
|
||||
}
|
||||
|
||||
virtual void OnInit()
|
||||
void OnInit() override
|
||||
{
|
||||
/* Calculate maximum signal sprite size. */
|
||||
this->sig_sprite_size.width = 0;
|
||||
@@ -1674,7 +1674,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
if (widget == WID_BS_DRAG_SIGNALS_DENSITY_LABEL) {
|
||||
/* Two digits for signals density. */
|
||||
@@ -1685,7 +1685,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void SetStringParameters(int widget) const
|
||||
void SetStringParameters(int widget) const override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_BS_DRAG_SIGNALS_DENSITY_LABEL:
|
||||
@@ -1694,7 +1694,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
{
|
||||
if (IsInsideMM(widget, WID_BS_SEMAPHORE_NORM, WID_BS_ELECTRIC_PBS_OWAY + 1)) {
|
||||
/* Extract signal from widget number. */
|
||||
@@ -1722,7 +1722,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_BS_SEMAPHORE_NORM:
|
||||
@@ -1801,7 +1801,7 @@ public:
|
||||
* @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
|
||||
{
|
||||
if (!gui_scope) return;
|
||||
this->LowerWidget((_cur_signal_variant == SIG_ELECTRIC ? WID_BS_ELECTRIC_NORM : WID_BS_SEMAPHORE_NORM) + _cur_signal_button);
|
||||
@@ -1891,7 +1891,7 @@ struct BuildRailDepotWindow : public PickerWindowBase {
|
||||
this->LowerWidget(_build_depot_direction + WID_BRAD_DEPOT_NE);
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
if (!IsInsideMM(widget, WID_BRAD_DEPOT_NE, WID_BRAD_DEPOT_NW + 1)) return;
|
||||
|
||||
@@ -1899,14 +1899,14 @@ struct BuildRailDepotWindow : public PickerWindowBase {
|
||||
size->height = ScaleGUITrad(48) + 2;
|
||||
}
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
{
|
||||
if (!IsInsideMM(widget, WID_BRAD_DEPOT_NE, WID_BRAD_DEPOT_NW + 1)) return;
|
||||
|
||||
DrawTrainDepotSprite(r.left + 1 + ScaleGUITrad(31), r.bottom - ScaleGUITrad(31), widget - WID_BRAD_DEPOT_NE + DIAGDIR_NE, _cur_railtype);
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_BRAD_DEPOT_NE:
|
||||
@@ -1980,7 +1980,7 @@ struct BuildRailWaypointWindow : PickerWindowBase {
|
||||
matrix->SetClicked(_cur_waypoint_type);
|
||||
}
|
||||
|
||||
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_BRW_WAYPOINT_MATRIX:
|
||||
@@ -1999,7 +1999,7 @@ struct BuildRailWaypointWindow : PickerWindowBase {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
{
|
||||
switch (GB(widget, 0, 16)) {
|
||||
case WID_BRW_WAYPOINT: {
|
||||
@@ -2014,7 +2014,7 @@ struct BuildRailWaypointWindow : PickerWindowBase {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
{
|
||||
switch (GB(widget, 0, 16)) {
|
||||
case WID_BRW_WAYPOINT: {
|
||||
@@ -2200,7 +2200,7 @@ DropDownList *GetRailTypeDropDownList(bool for_replacement, bool all_option)
|
||||
|
||||
if (all_option) {
|
||||
DropDownListStringItem *item = new DropDownListStringItem(STR_REPLACE_ALL_RAILTYPE, INVALID_RAILTYPE, false);
|
||||
*list->Append() = item;
|
||||
list->push_back(item);
|
||||
}
|
||||
|
||||
Dimension d = { 0, 0 };
|
||||
@@ -2231,7 +2231,7 @@ DropDownList *GetRailTypeDropDownList(bool for_replacement, bool all_option)
|
||||
}
|
||||
item->SetParam(0, rti->strings.menu_text);
|
||||
item->SetParam(1, rti->max_speed);
|
||||
*list->Append() = item;
|
||||
list->push_back(item);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
Reference in New Issue
Block a user