Merge branch 'enhanced_viewport_overlay-sx' into jgrpp

This commit is contained in:
Jonathan G Rennison
2015-11-24 01:06:51 +00:00
9 changed files with 36 additions and 30 deletions

View File

@@ -231,7 +231,7 @@ struct DepotWindow : Window {
VehicleID vehicle_over; ///< Rail vehicle over which another one is dragged, \c INVALID_VEHICLE if none. VehicleID vehicle_over; ///< Rail vehicle over which another one is dragged, \c INVALID_VEHICLE if none.
VehicleType type; VehicleType type;
bool generate_list; 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 vehicle_list;
VehicleList wagon_list; VehicleList wagon_list;
uint unitnumber_digits; uint unitnumber_digits;
@@ -246,7 +246,7 @@ struct DepotWindow : Window {
this->sel = INVALID_VEHICLE; this->sel = INVALID_VEHICLE;
this->vehicle_over = INVALID_VEHICLE; this->vehicle_over = INVALID_VEHICLE;
this->generate_list = true; this->generate_list = true;
this->sell_hovered = false; this->hovered_widget = -1;
this->type = type; this->type = type;
this->num_columns = 1; // for non-trains this gets set in FinishInitNested() this->num_columns = 1; // for non-trains this gets set in FinishInitNested()
this->unitnumber_digits = 2; this->unitnumber_digits = 2;
@@ -872,21 +872,26 @@ struct DepotWindow : Window {
this->vehicle_over = INVALID_VEHICLE; this->vehicle_over = INVALID_VEHICLE;
this->SetWidgetDirty(WID_D_MATRIX); this->SetWidgetDirty(WID_D_MATRIX);
if (this->sell_hovered) { if (this->hovered_widget != -1) {
this->SetWidgetLoweredState(WID_D_SELL, false); this->SetWidgetLoweredState(this->hovered_widget, false);
this->SetWidgetDirty(WID_D_SELL); this->SetWidgetDirty(this->hovered_widget);
this->sell_hovered = false; this->hovered_widget = -1;
} }
} }
virtual void OnMouseDrag(Point pt, int widget) virtual void OnMouseDrag(Point pt, int widget)
{ {
if (this->sel == INVALID_VEHICLE) return; if (this->sel == INVALID_VEHICLE) return;
bool is_sell_widget = widget == WID_D_SELL; if (widget != this->hovered_widget) {
if (is_sell_widget != this->sell_hovered) { if (this->hovered_widget == WID_D_SELL || this->hovered_widget == WID_D_SELL_CHAIN) {
this->sell_hovered = is_sell_widget; this->SetWidgetLoweredState(this->hovered_widget, false);
this->SetWidgetLoweredState(WID_D_SELL, is_sell_widget); this->SetWidgetDirty(this->hovered_widget);
this->SetWidgetDirty(WID_D_SELL); }
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; if (this->type != VEH_TRAIN) return;
@@ -977,7 +982,7 @@ struct DepotWindow : Window {
this->SetDirty(); this->SetDirty();
break; break;
} }
this->sell_hovered = false; this->hovered_widget = -1;
_cursor.vehchain = false; _cursor.vehchain = false;
} }

View File

@@ -3193,7 +3193,7 @@ STR_SPRITE_ALIGNER_GOTO_TOOLTIP :{BLACK}Go to th
STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Previous sprite 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_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_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_BUTTON :{BLACK}Reset relative
STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}Reset the current relative offsets STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}Reset the current relative offsets
STR_SPRITE_ALIGNER_OFFSETS_ABS :{BLACK}X offset: {NUM}, Y offset: {NUM} (Absolute) STR_SPRITE_ALIGNER_OFFSETS_ABS :{BLACK}X offset: {NUM}, Y offset: {NUM} (Absolute)

View File

@@ -2904,7 +2904,7 @@ STR_SPRITE_ALIGNER_GOTO_TOOLTIP :{BLACK}Va allo
STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Precedente 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_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_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_BUTTON :{BLACK}Reimposta posizione relativa
STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}Reimposta gli spiazzamenti relativi attuali STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}Reimposta gli spiazzamenti relativi attuali
STR_SPRITE_ALIGNER_OFFSETS_ABS :{BLACK}Posizione X: {NUM}, Y: {NUM} (assoluto) STR_SPRITE_ALIGNER_OFFSETS_ABS :{BLACK}Posizione X: {NUM}, Y: {NUM} (assoluto)

View File

@@ -2875,7 +2875,7 @@ STR_SPRITE_ALIGNER_GOTO_TOOLTIP :{BLACK}입력
STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}이전 스프라이트 STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}이전 스프라이트
STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}(위조/재색상/글씨 스프라이트를 제외한) 이전 보통 스프라이트로 이동하고, 첫 번째 스프라이트에 다다르면 마지막으로 돌아갑니다. STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}(위조/재색상/글씨 스프라이트를 제외한) 이전 보통 스프라이트로 이동하고, 첫 번째 스프라이트에 다다르면 마지막으로 돌아갑니다.
STR_SPRITE_ALIGNER_SPRITE_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_BUTTON :{BLACK}상대값 초기화
STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}현재 상대값 좌표를 초기화 STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}현재 상대값 좌표를 초기화
STR_SPRITE_ALIGNER_OFFSETS_ABS :{BLACK}X 좌표: {NUM}, Y 좌표: {NUM} (절댓값) 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_OUT_OF_RANGE :{RED} (다음 목적지가 항속거리제한을 벗어납니다.)
STR_ORDER_CONDITIONAL_UNCONDITIONAL :[조건 경로] {COMMA}번 경로로 건너뛰기 STR_ORDER_CONDITIONAL_UNCONDITIONAL :[조건 경로] {COMMA}번 경로로 건너뛰기
STR_ORDER_CONDITIONAL_NUM :[조건 경로] {COMMA}번 경로로 건너뛰기 ({STRING} {STRING} {COMMA} 일때) STR_ORDER_CONDITIONAL_NUM :[조건 경로] {COMMA}번 경로로 건너뛰기 ({STRING} {STRING} {COMMA} 일때)
STR_ORDER_CONDITIONAL_TRUE_FALSE :[조건 경로] {COMMA}번 경로로 건너뛰기 ({STRING}{STRING}) STR_ORDER_CONDITIONAL_TRUE_FALSE :[조건 경로] {COMMA}번 경로로 건너뛰기 ({STRING}{STRING})
STR_INVALID_ORDER :{RED} (잘못된 행선지) STR_INVALID_ORDER :{RED} (잘못된 행선지)

View File

@@ -3060,7 +3060,7 @@ STR_SPRITE_ALIGNER_GOTO_TOOLTIP :{BLACK}Пере
STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Предыдущий спрайт STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Предыдущий спрайт
STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}Перейти к предыдущему нормальному спрайту, пропуская изменяющие цвет, шрифтовые, псевдоспрайты. Переход из начала списка к последнему спрайту. STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}Перейти к предыдущему нормальному спрайту, пропуская изменяющие цвет, шрифтовые, псевдоспрайты. Переход из начала списка к последнему спрайту.
STR_SPRITE_ALIGNER_SPRITE_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_BUTTON :{BLACK}Сброс смещения
STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}Сбросить значения относительного смещения STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}Сбросить значения относительного смещения
STR_SPRITE_ALIGNER_OFFSETS_ABS :{BLACK}Смещение X: {NUM}; смещение Y: {NUM} (абсолютное) STR_SPRITE_ALIGNER_OFFSETS_ABS :{BLACK}Смещение X: {NUM}; смещение Y: {NUM} (абсолютное)

View File

@@ -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 :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_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_OFF :No
STR_CONFIG_SETTING_ORDER_REVIEW_EXDEPOT :Sí, excluyendo los detenidos STR_CONFIG_SETTING_ORDER_REVIEW_EXDEPOT :Sí, excluyendo a los vehículos detenidos
STR_CONFIG_SETTING_ORDER_REVIEW_ON :Todos 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 :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_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 :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_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 :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 :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_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 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_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_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_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_BUTTON :{BLACK}Reiniciar coordenadas relativas
STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}Reinicia las coordenadas relativas actuales STR_SPRITE_ALIGNER_RESET_TOOLTIP :{BLACK}Reinicia las coordenadas relativas actuales
STR_SPRITE_ALIGNER_OFFSETS_ABS :{BLACK}Coordenada X: {NUM}, Coordenada Y: {NUM} (Absoluta) STR_SPRITE_ALIGNER_OFFSETS_ABS :{BLACK}Coordenada X: {NUM}, Coordenada Y: {NUM} (Absoluta)

View File

@@ -976,10 +976,11 @@ struct SpriteAlignerWindow : Window {
this->offs_start_map.Insert(this->current_sprite, XyOffs(spr->x_offs, spr->y_offs)); this->offs_start_map.Insert(this->current_sprite, XyOffs(spr->x_offs, spr->y_offs));
} }
switch (widget) { switch (widget) {
case WID_SA_UP: spr->y_offs--; break; /* Move ten units at a time if ctrl is pressed. */
case WID_SA_DOWN: spr->y_offs++; break; case WID_SA_UP: spr->y_offs -= _ctrl_pressed ? 8 : 1; break;
case WID_SA_LEFT: spr->x_offs--; break; case WID_SA_DOWN: spr->y_offs += _ctrl_pressed ? 8 : 1; break;
case WID_SA_RIGHT: spr->x_offs++; 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? /* Of course, we need to redraw the sprite, but where is it used?
* Everywhere is a safe bet. */ * Everywhere is a safe bet. */

View File

@@ -269,7 +269,7 @@ static bool PadSingleSprite(SpriteLoader::Sprite *sprite, ZoomLevel zoom, uint p
return true; 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. */ /* Get minimum top left corner coordinates. */
int min_xoffs = INT32_MAX; int min_xoffs = INT32_MAX;
@@ -310,7 +310,7 @@ static bool PadSprites(SpriteLoader::Sprite *sprite, uint8 sprite_avail)
return true; 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 */ /* Create a fully zoomed image if it does not exist */
ZoomLevel first_avail = static_cast<ZoomLevel>(FIND_FIRST_BIT(sprite_avail)); ZoomLevel first_avail = static_cast<ZoomLevel>(FIND_FIRST_BIT(sprite_avail));

View File

@@ -2300,7 +2300,7 @@ static void ViewportMapDrawBridgeTunnel(const ViewPort * const vp, const TunnelB
TileIndex tile = tbtm->from_tile; TileIndex tile = tbtm->from_tile;
const Owner o = GetTileOwner(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; uint8 colour;
if (vp->map_type == VPMT_OWNER && _settings_client.gui.use_owner_colour_for_tunnelbridge && o < MAX_COMPANIES) { if (vp->map_type == VPMT_OWNER && _settings_client.gui.use_owner_colour_for_tunnelbridge && o < MAX_COMPANIES) {