Merge branch 'origin/master' commit 'a499e9acdd385b57dd43caf88af3a6f7f53716ba'

This commit is contained in:
pelya
2020-03-20 00:10:46 +02:00
1448 changed files with 32573 additions and 27146 deletions

View File

@@ -1,5 +1,3 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
@@ -90,7 +88,7 @@ public:
return size;
}
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_BT_TYPE_11 && widget <= WID_BT_TYPE_34) {
Dimension d = GetMaxTreeSpriteSize();
@@ -108,7 +106,7 @@ public:
}
}
virtual void DrawWidget(const Rect &r, int widget) const
void DrawWidget(const Rect &r, int widget) const override
{
if (widget < WID_BT_TYPE_11 || widget > WID_BT_TYPE_34 || widget - WID_BT_TYPE_11 >= this->count) return;
@@ -117,7 +115,7 @@ public:
DrawSprite(tree_sprites[i].sprite, tree_sprites[i].pal, (r.left + r.right) / 2 + WD_FRAMERECT_LEFT, r.bottom - 7);
}
virtual void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
switch (widget) {
case WID_BT_TYPE_11: case WID_BT_TYPE_12: case WID_BT_TYPE_13: case WID_BT_TYPE_14:
@@ -144,18 +142,18 @@ public:
}
}
virtual void OnPlaceObject(Point pt, TileIndex tile)
void OnPlaceObject(Point pt, TileIndex tile) override
{
VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_PLANT_TREES);
MoveAllWindowsOffScreen();
}
virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt)
void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) override
{
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 && select_proc == DDSP_PLANT_TREES) {
DoCommandP(end_tile, this->tree_to_plant, start_tile,
@@ -167,13 +165,13 @@ public:
/**
* Initialize the window data
*/
virtual void OnInit()
void OnInit() override
{
this->base = _tree_base_by_landscape[_settings_game.game_creation.landscape];
this->count = _tree_count_by_landscape[_settings_game.game_creation.landscape];
}
virtual void OnPlaceObjectAbort()
void OnPlaceObjectAbort() override
{
MoveAllHiddenWindowsBackToScreen();
this->RaiseButtons();