(svn r27940) [1.7] -Backport from trunk:

- Change: When train depots have a horizontal scrollbar, allow scrolling 1 tile beyond the longest train, so you can actually attach a wagon at the end (r27937)
- Fix: When moving wagons in the depot, the drag highlight did not exactly match the length of the dragged wagon chain (r27936)
- Fix: [Win32] Right mouse scrolling didn't work properly with the Windows 10 Fall Creators Update [FS#6629] (r27935)
- Fix: Forest, candyfloss forest and battery farm skipped the first animation frame [FS#6639] (r27932)
- Fix: Glyphs in range U+0020 to U+00FF may only be defined in orig_extra.grf, not in openttd.grf [FS#6620] (r27915)
This commit is contained in:
frosch
2017-12-11 19:24:46 +00:00
committed by Sergii Pylypenko
parent 9f078c357d
commit ae64743448
12 changed files with 294 additions and 261 deletions
+2 -1
View File
@@ -682,7 +682,8 @@ struct DepotWindow : Window {
}
/* 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->hscroll->SetCount(max_width);
/* Always make it longer than the longest train, so you can attach vehicles at the end */
this->hscroll->SetCount(max_width + ScaleGUITrad(2 * VEHICLEINFO_FULL_VEHICLE_WIDTH + 1));
} else {
this->vscroll->SetCount(CeilDiv(this->vehicle_list.Length(), this->num_columns));
}
+18 -12
View File
@@ -491,7 +491,12 @@ static CommandCost ClearTile_Industry(TileIndex tile, DoCommandFlag flags)
return CommandCost(EXPENSES_CONSTRUCTION, indspec->GetRemovalCost());
}
static void TransportIndustryGoods(TileIndex tile)
/**
* Move produced cargo from industry to nearby stations.
* @param tile Industry tile
* @return true if any cargo was moved.
*/
static bool TransportIndustryGoods(TileIndex tile)
{
Industry *i = Industry::GetByTile(tile);
const IndustrySpec *indspec = GetIndustrySpec(i->type);
@@ -516,16 +521,7 @@ static void TransportIndustryGoods(TileIndex tile)
}
}
if (moved_cargo && !StartStopIndustryTileAnimation(i, IAT_INDUSTRY_DISTRIBUTES_CARGO)) {
uint newgfx = GetIndustryTileSpec(GetIndustryGfx(tile))->anim_production;
if (newgfx != INDUSTRYTILE_NOANIM) {
ResetIndustryConstructionStage(tile);
SetIndustryCompleted(tile);
SetIndustryGfx(tile, newgfx);
MarkTileDirtyByTile(tile);
}
}
return moved_cargo;
}
@@ -810,7 +806,17 @@ static void TileLoop_Industry(TileIndex tile)
if (_game_mode == GM_EDITOR) return;
TransportIndustryGoods(tile);
if (TransportIndustryGoods(tile) && !StartStopIndustryTileAnimation(Industry::GetByTile(tile), IAT_INDUSTRY_DISTRIBUTES_CARGO)) {
uint newgfx = GetIndustryTileSpec(GetIndustryGfx(tile))->anim_production;
if (newgfx != INDUSTRYTILE_NOANIM) {
ResetIndustryConstructionStage(tile);
SetIndustryCompleted(tile);
SetIndustryGfx(tile, newgfx);
MarkTileDirtyByTile(tile);
return;
}
}
if (StartStopIndustryTileAnimation(tile, IAT_TILELOOP)) return;
+4 -4
View File
@@ -64,14 +64,14 @@ static int HighlightDragPosition(int px, int max_width, VehicleID selection, boo
bool rtl = _current_text_dir == TD_RTL;
assert(selection != INVALID_VEHICLE);
int dragged_width = WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
int dragged_width = 0;
for (Train *t = Train::Get(selection); t != NULL; t = chain ? t->Next() : (t->HasArticulatedPart() ? t->GetNextArticulatedPart() : NULL)) {
dragged_width += t->GetDisplayImageWidth(NULL);
}
int drag_hlight_left = rtl ? max(px -dragged_width, 0) : px;
int drag_hlight_right = rtl ? px : min(px + dragged_width, max_width);
int drag_hlight_width = max(drag_hlight_right - drag_hlight_left, 0);
int drag_hlight_left = rtl ? max(px - dragged_width + 1, 0) : px;
int drag_hlight_right = rtl ? px : min(px + dragged_width, max_width) - 1;
int drag_hlight_width = max(drag_hlight_right - drag_hlight_left + 1, 0);
if (drag_hlight_width > 0) {
GfxFillRect(drag_hlight_left + WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP + 1,
+16 -2
View File
@@ -34,6 +34,10 @@
#define MAPVK_VK_TO_CHAR (2)
#endif
#ifndef PM_QS_INPUT
#define PM_QS_INPUT 0x20000
#endif
static struct {
HWND main_wnd;
HBITMAP dib_sect;
@@ -737,7 +741,6 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
case WM_MOUSEMOVE: {
int x = (int16)LOWORD(lParam);
int y = (int16)HIWORD(lParam);
POINT pt;
/* If the mouse was not in the window and it has moved it means it has
* come into the window, so start drawing the mouse. Also start
@@ -747,7 +750,18 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
}
if (_cursor.UpdateCursorPosition(x, y, true)) {
if (_cursor.fix_at) {
/* Get all queued mouse events now in case we have to warp the cursor. In the
* end, we only care about the current mouse position and not bygone events. */
MSG m;
while (PeekMessage(&m, hwnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE | PM_NOYIELD | PM_QS_INPUT)) {
x = (int16)LOWORD(m.lParam);
y = (int16)HIWORD(m.lParam);
}
}
if (_cursor.UpdateCursorPosition(x, y, false)) {
POINT pt;
pt.x = _cursor.pos.x;
pt.y = _cursor.pos.y;
ClientToScreen(hwnd, &pt);