From e32afcc4ea463adf7f55b17eb6e99a19ff6107c6 Mon Sep 17 00:00:00 2001 From: alberth Date: Fri, 20 Nov 2015 09:25:27 +0000 Subject: [PATCH 1/8] (svn r27450) -Feature[FS#6391](r27446): Lower the sell-chain button in the train depot GUI while dragging a vehicle over it. (Eearslya) --- src/depot_gui.cpp | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 1045f15bd0..4aff4700b3 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -229,7 +229,7 @@ struct DepotWindow : Window { VehicleID vehicle_over; ///< Rail vehicle over which another one is dragged, \c INVALID_VEHICLE if none. VehicleType type; bool generate_list; - bool sell_hovered; ///< A vehicle is being dragged/hovered over the sell button. + int hovered_widget; ///< Index of the widget being hovered during drag/drop. -1 if no drag is in progress. VehicleList vehicle_list; VehicleList wagon_list; uint unitnumber_digits; @@ -244,7 +244,7 @@ struct DepotWindow : Window { this->sel = INVALID_VEHICLE; this->vehicle_over = INVALID_VEHICLE; this->generate_list = true; - this->sell_hovered = false; + this->hovered_widget = -1; this->type = type; this->num_columns = 1; // for non-trains this gets set in FinishInitNested() this->unitnumber_digits = 2; @@ -870,21 +870,26 @@ struct DepotWindow : Window { this->vehicle_over = INVALID_VEHICLE; this->SetWidgetDirty(WID_D_MATRIX); - if (this->sell_hovered) { - this->SetWidgetLoweredState(WID_D_SELL, false); - this->SetWidgetDirty(WID_D_SELL); - this->sell_hovered = false; + if (this->hovered_widget != -1) { + this->SetWidgetLoweredState(this->hovered_widget, false); + this->SetWidgetDirty(this->hovered_widget); + this->hovered_widget = -1; } } virtual void OnMouseDrag(Point pt, int widget) { if (this->sel == INVALID_VEHICLE) return; - bool is_sell_widget = widget == WID_D_SELL; - if (is_sell_widget != this->sell_hovered) { - this->sell_hovered = is_sell_widget; - this->SetWidgetLoweredState(WID_D_SELL, is_sell_widget); - this->SetWidgetDirty(WID_D_SELL); + if (widget != this->hovered_widget) { + if (this->hovered_widget == WID_D_SELL || this->hovered_widget == WID_D_SELL_CHAIN) { + this->SetWidgetLoweredState(this->hovered_widget, false); + this->SetWidgetDirty(this->hovered_widget); + } + this->hovered_widget = widget; + if (this->hovered_widget == WID_D_SELL || this->hovered_widget == WID_D_SELL_CHAIN) { + this->SetWidgetLoweredState(this->hovered_widget, true); + this->SetWidgetDirty(this->hovered_widget); + } } if (this->type != VEH_TRAIN) return; @@ -975,7 +980,7 @@ struct DepotWindow : Window { this->SetDirty(); break; } - this->sell_hovered = false; + this->hovered_widget = -1; _cursor.vehchain = false; } From e1a00bc2443f18d785a60653c2e45cb7ffe39bc8 Mon Sep 17 00:00:00 2001 From: alberth Date: Fri, 20 Nov 2015 10:04:28 +0000 Subject: [PATCH 2/8] (svn r27451) -Feature[FS#6241]: Move sprite 8 positions in sprite aligner with ctrl+click. (based on work by juzza1) --- src/lang/english.txt | 2 +- src/newgrf_debug_gui.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lang/english.txt b/src/lang/english.txt index ad29b3d596..0bd430bad0 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2874,7 +2874,7 @@ STR_SPRITE_ALIGNER_GOTO_TOOLTIP :{BLACK}Go to th STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Previous sprite STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}Proceed to the previous normal sprite, skipping any pseudo/recolour/font sprites and wrapping around from the first sprite to the last STR_SPRITE_ALIGNER_SPRITE_TOOLTIP :{BLACK}Representation of the currently selected sprite. The alignment is ignored when drawing this sprite -STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Move the sprite around, changing the X and Y offsets +STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Move the sprite around, changing the X and Y offsets. Ctrl+Click to move the sprite eight units at a time STR_SPRITE_ALIGNER_RESET_BUTTON :{BLACK}Reset relative STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}Reset the current relative offsets STR_SPRITE_ALIGNER_OFFSETS_ABS :{BLACK}X offset: {NUM}, Y offset: {NUM} (Absolute) diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index 0074af2181..75b06967f7 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -972,10 +972,11 @@ struct SpriteAlignerWindow : Window { this->offs_start_map.Insert(this->current_sprite, XyOffs(spr->x_offs, spr->y_offs)); } switch (widget) { - case WID_SA_UP: spr->y_offs--; break; - case WID_SA_DOWN: spr->y_offs++; break; - case WID_SA_LEFT: spr->x_offs--; break; - case WID_SA_RIGHT: spr->x_offs++; break; + /* Move ten units at a time if ctrl is pressed. */ + case WID_SA_UP: spr->y_offs -= _ctrl_pressed ? 8 : 1; break; + case WID_SA_DOWN: spr->y_offs += _ctrl_pressed ? 8 : 1; break; + case WID_SA_LEFT: spr->x_offs -= _ctrl_pressed ? 8 : 1; break; + case WID_SA_RIGHT: spr->x_offs += _ctrl_pressed ? 8 : 1; break; } /* Of course, we need to redraw the sprite, but where is it used? * Everywhere is a safe bet. */ From 17e6f42f03e944ab5794b861fe8a0aa735f2460a Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 20 Nov 2015 18:45:10 +0000 Subject: [PATCH 3/8] (svn r27452) -Update from WebTranslator v3.0: russian - 1 changes by Lone_Wolf --- src/lang/russian.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/russian.txt b/src/lang/russian.txt index 3338c32c86..6b4c4ccd67 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -3054,7 +3054,7 @@ STR_SPRITE_ALIGNER_GOTO_TOOLTIP :{BLACK}Пере STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Предыдущий спрайт STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}Перейти к предыдущему нормальному спрайту, пропуская изменяющие цвет, шрифтовые, псевдоспрайты. Переход из начала списка к последнему спрайту. STR_SPRITE_ALIGNER_SPRITE_TOOLTIP :{BLACK}Представление выбранного спрайта. Выравнивание не учитывается при прорисовке этого спрайта. -STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Двигайте спрайт, изменяя смещение по X и по Y +STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Двигайте спрайт, изменяя смещение по осям X и Y. С помощью Ctrl+щелчка можно сдвигать спрайты на 8 единиц. STR_SPRITE_ALIGNER_RESET_BUTTON :{BLACK}Сброс смещения STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}Сбросить значения относительного смещения STR_SPRITE_ALIGNER_OFFSETS_ABS :{BLACK}Смещение X: {NUM}; смещение Y: {NUM} (абсолютное) From d8b8f033d5fea54a3e9241a116e71e2d00f01e67 Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 21 Nov 2015 18:45:08 +0000 Subject: [PATCH 4/8] (svn r27453) -Update from WebTranslator v3.0: italian - 1 changes by lorenzodv --- src/lang/italian.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/italian.txt b/src/lang/italian.txt index 3060ed353c..ce69b5e50c 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -2904,7 +2904,7 @@ STR_SPRITE_ALIGNER_GOTO_TOOLTIP :{BLACK}Va allo STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Precedente STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}Procede al precedente sprite normale, saltanto qualsiasi sprite speciale, di ricoloramento o carattere e tornando all'ultimo se viene raggiunto il primo della lista STR_SPRITE_ALIGNER_SPRITE_TOOLTIP :{BLACK}Rappresentazione dello sprite corrente. L'allineamento viene ignorato in questa casella. -STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Sposta lo sprite, cambiando gli spiazzamenti X e Y +STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Sposta lo sprite, cambiando gli spiazzamenti X e Y. CTRL+clic sposta lo sprite di otto unità alla volta STR_SPRITE_ALIGNER_RESET_BUTTON :{BLACK}Reimposta posizione relativa STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}Reimposta gli spiazzamenti relativi attuali STR_SPRITE_ALIGNER_OFFSETS_ABS :{BLACK}Posizione X: {NUM}, Y: {NUM} (assoluto) From ca93b0ef79924c1e3d23476526d93c416561140c Mon Sep 17 00:00:00 2001 From: translators Date: Sun, 22 Nov 2015 18:45:10 +0000 Subject: [PATCH 5/8] (svn r27454) -Update from WebTranslator v3.0: korean - 4 changes by telk5093 --- src/lang/korean.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lang/korean.txt b/src/lang/korean.txt index a727b5233c..34569153da 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -2875,7 +2875,7 @@ STR_SPRITE_ALIGNER_GOTO_TOOLTIP :{BLACK}입력 STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}이전 스프라이트 STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}(위조/재색상/글씨 스프라이트를 제외한) 이전 보통 스프라이트로 이동하고, 첫 번째 스프라이트에 다다르면 마지막으로 돌아갑니다. STR_SPRITE_ALIGNER_SPRITE_TOOLTIP :{BLACK}현재 선택된 스프라이트를 표시합니다. 이 스프라이트가 그려졌을때의 정렬은 무시합니다. -STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}X축이나 Y축 방향으로 스프라이트를 이동시킵니다. +STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}X축이나 Y축 방향으로 스프라이트를 이동시킵니다. CTRL+클릭하면 한 번에 8씩 이동시킬 수 있습니다. STR_SPRITE_ALIGNER_RESET_BUTTON :{BLACK}상대값 초기화 STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}현재 상대값 좌표를 초기화 STR_SPRITE_ALIGNER_OFFSETS_ABS :{BLACK}X 좌표: {NUM}, Y 좌표: {NUM} (절댓값) @@ -3880,9 +3880,9 @@ STR_ORDER_STOP_LOCATION_FAR_END :[먼쪽] STR_ORDER_OUT_OF_RANGE :{RED} (다음 목적지가 항속거리제한을 벗어납니다.) -STR_ORDER_CONDITIONAL_UNCONDITIONAL :[조건 경로] {COMMA}번째 경로로 건너뛰기 -STR_ORDER_CONDITIONAL_NUM :[조건 경로] {COMMA}번째 경로로 건너뛰기 ({STRING} {STRING} {COMMA} 일때) -STR_ORDER_CONDITIONAL_TRUE_FALSE :[조건 경로] {COMMA}번째 경로로 건너뛰기 ({STRING}{STRING}) +STR_ORDER_CONDITIONAL_UNCONDITIONAL :[조건 경로] {COMMA}번 경로로 건너뛰기 +STR_ORDER_CONDITIONAL_NUM :[조건 경로] {COMMA}번 경로로 건너뛰기 ({STRING} {STRING} {COMMA} 일때) +STR_ORDER_CONDITIONAL_TRUE_FALSE :[조건 경로] {COMMA}번 경로로 건너뛰기 ({STRING}{STRING}) STR_INVALID_ORDER :{RED} (잘못된 행선지) From d2cd74223e2ce5c538f306063291129a2bf24db6 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 22 Nov 2015 23:30:09 +0000 Subject: [PATCH 6/8] Fix another out of bound buffer read in viewport map mode. Drawing of non-company tunnels/bridges. Caught by AddressSanitizer. --- src/viewport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viewport.cpp b/src/viewport.cpp index ee4b1ae3d9..ec8d40cafb 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2297,7 +2297,7 @@ static void ViewportMapDrawBridgeTunnel(const ViewPort * const vp, const TunnelB TileIndex tile = tbtm->from_tile; const Owner o = GetTileOwner(tile); - if (!_legend_land_owners[_company_to_list_pos[o]].show_on_map) return; + if (o < MAX_COMPANIES && !_legend_land_owners[_company_to_list_pos[o]].show_on_map) return; uint8 colour; if (vp->map_type == VPMT_OWNER && _settings_client.gui.use_owner_colour_for_tunnelbridge && o < MAX_COMPANIES) { From 52d3f075ea5d5bdac0e874a7d9de8eec074bd9bd Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 22 Nov 2015 23:31:51 +0000 Subject: [PATCH 7/8] Fix over shift left undefined behaviour. The maximum zoom level is now >= 8, so shifting a uint8 by a zoom level results in undefined behaviour. --- src/spritecache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spritecache.cpp b/src/spritecache.cpp index e9ab6b7538..6fd7e6e8c8 100644 --- a/src/spritecache.cpp +++ b/src/spritecache.cpp @@ -269,7 +269,7 @@ static bool PadSingleSprite(SpriteLoader::Sprite *sprite, ZoomLevel zoom, uint p return true; } -static bool PadSprites(SpriteLoader::Sprite *sprite, uint8 sprite_avail) +static bool PadSprites(SpriteLoader::Sprite *sprite, unsigned int sprite_avail) { /* Get minimum top left corner coordinates. */ int min_xoffs = INT32_MAX; @@ -310,7 +310,7 @@ static bool PadSprites(SpriteLoader::Sprite *sprite, uint8 sprite_avail) return true; } -static bool ResizeSprites(SpriteLoader::Sprite *sprite, uint8 sprite_avail, uint32 file_slot, uint32 file_pos) +static bool ResizeSprites(SpriteLoader::Sprite *sprite, unsigned int sprite_avail, uint32 file_slot, uint32 file_pos) { /* Create a fully zoomed image if it does not exist */ ZoomLevel first_avail = static_cast(FIND_FIRST_BIT(sprite_avail)); From 06fc9283f71d92f7d46351e01134659eab9e0012 Mon Sep 17 00:00:00 2001 From: translators Date: Mon, 23 Nov 2015 18:45:08 +0000 Subject: [PATCH 8/8] (svn r27455) -Update from WebTranslator v3.0: spanish - 4 changes by SilverSurferZzZ --- src/lang/spanish.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index 898d397917..23812dcb4a 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -1263,14 +1263,14 @@ STR_CONFIG_SETTING_WARN_LOST_VEHICLE_HELPTEXT :Muestra mensaje STR_CONFIG_SETTING_ORDER_REVIEW :Revisar órdenes de vehículos: {STRING} STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT :Cuando se activa, se comprueban periódicamente las órdenes de los vehículos, y los problemas que se encuentren se reportan con un mensaje STR_CONFIG_SETTING_ORDER_REVIEW_OFF :No -STR_CONFIG_SETTING_ORDER_REVIEW_EXDEPOT :Sí, excluyendo los detenidos -STR_CONFIG_SETTING_ORDER_REVIEW_ON :Todos +STR_CONFIG_SETTING_ORDER_REVIEW_EXDEPOT :Sí, excluyendo a los vehículos detenidos +STR_CONFIG_SETTING_ORDER_REVIEW_ON :Todos los vehículos STR_CONFIG_SETTING_WARN_INCOME_LESS :Avisar si las ganancias de un vehículo son negativas: {STRING} STR_CONFIG_SETTING_WARN_INCOME_LESS_HELPTEXT :Si se activa, se muestra un mensaje cuando un vehículo no haya obtenido ningún beneficio durante un año STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES :Los vehículos nunca caducan: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES_HELPTEXT :Cuando se activa, todos los modelos de vehículos permanecen disponibles para siempre una vez han sido introducidos STR_CONFIG_SETTING_AUTORENEW_VEHICLE :Renovación automática de vehículos cuando se vuelven viejos: {STRING} -STR_CONFIG_SETTING_AUTORENEW_VEHICLE_HELPTEXT :Cuando se activa, los vehículos que se acerquen al final de su vida útil serán reemplazados automáticamente cuando las condiciones de renovación se cumplan +STR_CONFIG_SETTING_AUTORENEW_VEHICLE_HELPTEXT :Cuando se activa, los vehículos próximos al final de su vida útil serán reemplazados automáticamente; siempre y cuando se cumplan las condiciones de renovación STR_CONFIG_SETTING_AUTORENEW_MONTHS :Autorenueva el vehículo {STRING} de su edad máxima STR_CONFIG_SETTING_AUTORENEW_MONTHS_HELPTEXT :Edad relativa con la cual un vehículo debería de ser considerado para ser autorenovado STR_CONFIG_SETTING_AUTORENEW_MONTHS_VALUE_BEFORE :{COMMA} mes{P 0 "" es} antes @@ -2875,7 +2875,7 @@ STR_SPRITE_ALIGNER_GOTO_TOOLTIP :{BLACK}Ir al sp STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Sprite anterior STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}Saltar al sprite anterior (ignorando pseudosprites, sprites recoloreados y sprites de fuente) y pasar del primer al último sprite STR_SPRITE_ALIGNER_SPRITE_TOOLTIP :{BLACK}Representación del sprite seleccionado. Su alineamiento es ignorado al dibujarlo -STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Mover el sprite, cambiando los ajustes X e Y +STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Mover el sprite, cambiando los ajustes X e Y. Ctrl+Click mueve el sprite ocho unidades de una sola vez STR_SPRITE_ALIGNER_RESET_BUTTON :{BLACK}Reiniciar coordenadas relativas STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}Reinicia las coordenadas relativas actuales STR_SPRITE_ALIGNER_OFFSETS_ABS :{BLACK}Coordenada X: {NUM}, Coordenada Y: {NUM} (Absoluta)