From 890b2666d3d4bf1a2b92108c9753fe0b07237ee6 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 23 Sep 2022 09:36:22 +0100 Subject: [PATCH 01/42] Change: Use scaled WidgetDimensions. --- src/ai/ai_gui.cpp | 30 ++--- src/aircraft_gui.cpp | 4 +- src/airport_gui.cpp | 26 ++-- src/autoreplace_gui.cpp | 4 +- src/bootstrap_gui.cpp | 14 +-- src/bridge_gui.cpp | 8 +- src/build_vehicle_gui.cpp | 16 +-- src/cheat_gui.cpp | 46 +++---- src/company_gui.cpp | 102 ++++++++-------- src/console_gui.cpp | 15 ++- src/depot_gui.cpp | 52 ++++---- src/dock_gui.cpp | 14 +-- src/engine_gui.cpp | 4 +- src/error_gui.cpp | 8 +- src/fios_gui.cpp | 46 +++---- src/framerate_gui.cpp | 21 ++-- src/game/game_gui.cpp | 8 +- src/genworld_gui.cpp | 10 +- src/goal_gui.cpp | 19 +-- src/graph_gui.cpp | 102 ++++++++-------- src/group_gui.cpp | 48 ++++---- src/industry_gui.cpp | 118 +++++++++--------- src/linkgraph/linkgraph_gui.cpp | 9 +- src/misc_gui.cpp | 56 ++++----- src/music_gui.cpp | 16 +-- src/network/network_chat_gui.cpp | 7 +- src/network/network_content_gui.cpp | 46 +++---- src/network/network_gui.cpp | 180 +++++++++++++++------------- src/newgrf_debug_gui.cpp | 18 +-- src/newgrf_gui.cpp | 101 ++++++++-------- src/news_gui.cpp | 30 ++--- src/object_gui.cpp | 8 +- src/order_gui.cpp | 8 +- src/rail_gui.cpp | 45 +++---- src/road_gui.cpp | 22 ++-- src/roadveh_gui.cpp | 8 +- src/settings_gui.cpp | 75 +++++++----- src/ship_gui.cpp | 4 +- src/signs_gui.cpp | 15 +-- src/smallmap_gui.cpp | 16 +-- src/smallmap_gui.h | 4 +- src/station_gui.cpp | 44 +++---- src/statusbar_gui.cpp | 4 +- src/story_gui.cpp | 20 ++-- src/subsidy_gui.cpp | 10 +- src/textfile_gui.cpp | 10 +- src/textfile_gui.h | 3 - src/timetable_gui.cpp | 18 +-- src/toolbar_gui.cpp | 14 +-- src/town_gui.cpp | 42 ++++--- src/train_gui.cpp | 8 +- src/transparency_gui.cpp | 6 +- src/tree_gui.cpp | 4 +- src/vehicle_gui.cpp | 87 +++++++------- src/viewport.cpp | 20 ++-- src/viewport_type.h | 8 -- src/widget.cpp | 4 +- src/widgets/dropdown.cpp | 51 ++++---- src/window.cpp | 4 +- src/window_gui.h | 5 - 60 files changed, 881 insertions(+), 864 deletions(-) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index f15c265335..041b9b6f10 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -125,7 +125,7 @@ struct AIListWindow : public Window { switch (widget) { case WID_AIL_LIST: { /* Draw a list of all available AIs. */ - Rect tr = r.Shrink(WD_MATRIX_LEFT, WD_MATRIX_TOP, WD_MATRIX_RIGHT, WD_MATRIX_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.matrix); /* First AI in the list is hardcoded to random */ if (this->vscroll->IsVisible(0)) { DrawString(tr, this->slot == OWNER_DEITY ? STR_AI_CONFIG_NONE : STR_AI_CONFIG_RANDOM_AI, this->selected == -1 ? TC_WHITE : TC_ORANGE); @@ -150,17 +150,17 @@ struct AIListWindow : public Window { } /* Some info about the currently selected AI. */ if (selected_info != nullptr) { - Rect tr = r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMERECT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.frametext, WidgetDimensions::scaled.framerect); SetDParamStr(0, selected_info->GetAuthor()); DrawString(tr, STR_AI_LIST_AUTHOR); - tr.top += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; + tr.top += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; SetDParam(0, selected_info->GetVersion()); DrawString(tr, STR_AI_LIST_VERSION); - tr.top += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; + tr.top += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; if (selected_info->GetURL() != nullptr) { SetDParamStr(0, selected_info->GetURL()); DrawString(tr, STR_AI_LIST_URL); - tr.top += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; + tr.top += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; } SetDParamStr(0, selected_info->GetDescription()); DrawStringMultiLine(tr, STR_JUST_RAW_STRING, TC_WHITE); @@ -253,7 +253,7 @@ static const NWidgetPart _nested_ai_list_widgets[] = { NWidget(WWT_MATRIX, COLOUR_MAUVE, WID_AIL_LIST), SetMinimalSize(188, 112), SetFill(1, 1), SetResize(1, 1), SetMatrixDataTip(1, 0, STR_AI_LIST_TOOLTIP), SetScrollbar(WID_AIL_SCROLLBAR), NWidget(NWID_VSCROLLBAR, COLOUR_MAUVE, WID_AIL_SCROLLBAR), EndContainer(), - NWidget(WWT_PANEL, COLOUR_MAUVE, WID_AIL_INFO_BG), SetMinimalTextLines(8, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM), SetResize(1, 0), + NWidget(WWT_PANEL, COLOUR_MAUVE, WID_AIL_INFO_BG), SetMinimalTextLines(8, WidgetDimensions::unscaled.framerect.Vertical() + WidgetDimensions::unscaled.vsep_normal * 3), SetResize(1, 0), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), @@ -359,10 +359,10 @@ struct AISettingsWindow : public Window { int i = 0; for (; !this->vscroll->IsVisible(i); i++) it++; - Rect ir = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); bool rtl = _current_text_dir == TD_RTL; Rect br = ir.WithWidth(SETTING_BUTTON_WIDTH, rtl); - Rect tr = ir.Indent(SETTING_BUTTON_WIDTH + 8, rtl); + Rect tr = ir.Indent(SETTING_BUTTON_WIDTH + WidgetDimensions::scaled.hsep_wide, rtl); int y = r.top; int button_y_offset = (this->line_height - SETTING_BUTTON_HEIGHT) / 2; @@ -426,7 +426,7 @@ struct AISettingsWindow : public Window { { switch (widget) { case WID_AIS_BACKGROUND: { - Rect r = this->GetWidget(widget)->GetCurrentRect().Shrink(WD_MATRIX_LEFT, 0, WD_MATRIX_RIGHT, 0); + Rect r = this->GetWidget(widget)->GetCurrentRect().Shrink(WidgetDimensions::scaled.matrix, RectPadding::zero); int num = (pt.y - r.top) / this->line_height + this->vscroll->GetPosition(); if (num >= (int)this->visible_settings.size()) break; @@ -791,7 +791,7 @@ struct AIConfigWindow : public Window { { switch (widget) { case WID_AIC_LIST: { - Rect tr = r.Shrink(WD_MATRIX_LEFT, WD_MATRIX_TOP, WD_MATRIX_RIGHT, WD_MATRIX_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.matrix); for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < MAX_COMPANIES; i++) { StringID text; @@ -1042,8 +1042,8 @@ struct AIDebugWindow : public Window { void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget == WID_AID_LOG_PANEL) { - resize->height = FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; - size->height = 14 * resize->height + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + resize->height = FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; + size->height = 14 * resize->height + WidgetDimensions::scaled.framerect.Vertical(); } } @@ -1157,8 +1157,8 @@ struct AIDebugWindow : public Window { ScriptLog::LogData *log = this->GetLogPointer(); if (log == nullptr) return; - Rect br = r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM); - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect br = r.Shrink(WidgetDimensions::scaled.bevel); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < log->used; i++) { int pos = (i + log->pos + 1 - log->used + log->count) % log->count; if (log->lines[pos] == nullptr) break; @@ -1352,7 +1352,7 @@ struct AIDebugWindow : public Window { void OnResize() override { - this->vscroll->SetCapacityFromWidget(this, WID_AID_LOG_PANEL); + this->vscroll->SetCapacityFromWidget(this, WID_AID_LOG_PANEL, WidgetDimensions::scaled.framerect.Vertical()); } static HotkeyList hotkeys; diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp index 3571394117..6516285257 100644 --- a/src/aircraft_gui.cpp +++ b/src/aircraft_gui.cpp @@ -46,7 +46,7 @@ void DrawAircraftDetails(const Aircraft *v, const Rect &r) SetDParam(3, u->Next()->cargo_cap); SetDParam(4, GetCargoSubtypeText(u)); DrawString(r.left, r.right, y, (u->Next()->cargo_cap != 0) ? STR_VEHICLE_INFO_CAPACITY_CAPACITY : STR_VEHICLE_INFO_CAPACITY); - y += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; + y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; } if (u->cargo_cap != 0) { @@ -64,7 +64,7 @@ void DrawAircraftDetails(const Aircraft *v, const Rect &r) } } - y += WD_PAR_VSEP_NORMAL; + y += WidgetDimensions::scaled.vsep_normal; SetDParam(0, feeder_share); DrawString(r.left, r.right, y, STR_VEHICLE_INFO_FEEDER_CARGO_VALUE); } diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index b182127353..ca747ca262 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -340,7 +340,7 @@ public: const AirportSpec *as = AirportSpec::Get(i); if (!as->enabled) continue; - size->width = std::max(size->width, GetStringBoundingBox(as->name).width); + size->width = std::max(size->width, GetStringBoundingBox(as->name).width + padding.width); } this->line_height = FONT_HEIGHT_NORMAL + padding.height; @@ -356,8 +356,8 @@ public: SpriteID sprite = GetCustomAirportSprite(as, layout); if (sprite != 0) { Dimension d = GetSpriteSize(sprite); - d.width += padding.width; - d.height += padding.height; + d.width += WidgetDimensions::scaled.framerect.Horizontal(); + d.height += WidgetDimensions::scaled.framerect.Vertical(); *size = maxdim(d, *size); } } @@ -375,8 +375,6 @@ public: /* STR_BLACK_STRING is used to start the string with {BLACK} */ SetDParam(0, string); Dimension d = GetStringMultiLineBoundingBox(STR_BLACK_STRING, *size); - d.width += padding.width; - d.height += padding.height; *size = maxdim(d, *size); } } @@ -390,8 +388,8 @@ public: { switch (widget) { case WID_AP_AIRPORT_LIST: { - Rect row = r.WithHeight(this->line_height).Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM); - Rect text = r.WithHeight(this->line_height).Shrink(WD_MATRIX_LEFT, WD_MATRIX_TOP, WD_MATRIX_RIGHT, WD_MATRIX_BOTTOM); + Rect row = r.WithHeight(this->line_height).Shrink(WidgetDimensions::scaled.bevel); + Rect text = r.WithHeight(this->line_height).Shrink(WidgetDimensions::scaled.matrix); AirportClass *apclass = AirportClass::Get(_selected_airport_class); for (uint i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < apclass->GetSpecCount(); i++) { const AirportSpec *as = apclass->GetSpec(i); @@ -430,7 +428,7 @@ public: this->DrawWidgets(); Rect r = this->GetWidget(WID_AP_ACCEPTANCE)->GetCurrentRect(); - int top = r.top + ScaleGUITrad(WD_PAR_VSEP_NORMAL); + int top = r.top + WidgetDimensions::scaled.vsep_normal; if (_selected_airport_index != -1) { const AirportSpec *as = AirportClass::Get(_selected_airport_class)->GetSpec(_selected_airport_index); @@ -441,19 +439,19 @@ public: /* show the noise of the selected airport */ SetDParam(0, as->noise_level); DrawString(r.left, r.right, top, STR_STATION_BUILD_NOISE); - top += FONT_HEIGHT_NORMAL + ScaleGUITrad(WD_PAR_VSEP_NORMAL); + top += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; } if (_settings_game.economy.infrastructure_maintenance) { Money monthly = _price[PR_INFRASTRUCTURE_AIRPORT] * as->maintenance_cost >> 3; SetDParam(0, monthly * 12); DrawString(r.left, r.right, top, STR_STATION_BUILD_INFRASTRUCTURE_COST); - top += FONT_HEIGHT_NORMAL + ScaleGUITrad(WD_PAR_VSEP_NORMAL); + top += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; } /* strings such as 'Size' and 'Coverage Area' */ - top = DrawStationCoverageAreaText(r.left, r.right, top, SCT_ALL, rad, false) + ScaleGUITrad(WD_PAR_VSEP_NORMAL); - top = DrawStationCoverageAreaText(r.left, r.right, top, SCT_ALL, rad, true) + ScaleGUITrad(WD_PAR_VSEP_NORMAL); + top = DrawStationCoverageAreaText(r.left, r.right, top, SCT_ALL, rad, false) + WidgetDimensions::scaled.vsep_normal; + top = DrawStationCoverageAreaText(r.left, r.right, top, SCT_ALL, rad, true) + WidgetDimensions::scaled.vsep_normal; } /* Resize background if the window is too small. @@ -607,7 +605,7 @@ static const NWidgetPart _nested_build_airport_widgets[] = { EndContainer(), /* Bottom panel. */ NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_AP_BOTTOMPANEL), - NWidget(WWT_LABEL, COLOUR_DARK_GREEN), SetPadding(WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM, WD_FRAMERECT_LEFT), SetDataTip(STR_STATION_BUILD_COVERAGE_AREA_TITLE, STR_NULL), SetFill(1, 0), + NWidget(WWT_LABEL, COLOUR_DARK_GREEN), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_STATION_BUILD_COVERAGE_AREA_TITLE, STR_NULL), SetFill(1, 0), NWidget(NWID_HORIZONTAL), NWidget(NWID_SPACER), SetMinimalSize(14, 0), SetFill(1, 0), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), @@ -618,7 +616,7 @@ static const NWidgetPart _nested_build_airport_widgets[] = { EndContainer(), NWidget(NWID_SPACER), SetMinimalSize(14, 0), SetFill(1, 0), EndContainer(), - NWidget(WWT_EMPTY, COLOUR_DARK_GREEN, WID_AP_ACCEPTANCE), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), SetResize(0, 1), SetFill(1, 0), + NWidget(WWT_EMPTY, COLOUR_DARK_GREEN, WID_AP_ACCEPTANCE), SetPadding(WidgetDimensions::unscaled.framerect), SetResize(0, 1), SetFill(1, 0), EndContainer(), }; diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 8ca396ca56..35ea32f033 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -422,7 +422,7 @@ public: str = STR_REPLACE_NOT_REPLACING_VEHICLE_SELECTED; } - DrawString(r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMERECT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMERECT_BOTTOM), str, TC_BLACK, SA_HOR_CENTER); + DrawString(r.Shrink(WidgetDimensions::scaled.frametext, WidgetDimensions::scaled.framerect), str, TC_BLACK, SA_HOR_CENTER); break; } @@ -485,7 +485,7 @@ public: ted.capacity = e->GetDisplayDefaultCapacity(&ted.mail_capacity); const Rect r = this->GetWidget(side == 0 ? WID_RV_LEFT_DETAILS : WID_RV_RIGHT_DETAILS)->GetCurrentRect() - .Shrink(WD_FRAMETEXT_LEFT, WD_FRAMERECT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMERECT_BOTTOM); + .Shrink(WidgetDimensions::scaled.frametext, WidgetDimensions::scaled.framerect); int text_end = DrawVehiclePurchaseInfo(r.left, r.right, r.top, this->sel_engine[side], ted); needed_height = std::max(needed_height, (text_end - r.top) / FONT_HEIGHT_NORMAL); } diff --git a/src/bootstrap_gui.cpp b/src/bootstrap_gui.cpp index fa2a0aee99..beab480d0b 100644 --- a/src/bootstrap_gui.cpp +++ b/src/bootstrap_gui.cpp @@ -101,14 +101,14 @@ public: { if (widget == WID_BEM_MESSAGE) { *size = GetStringBoundingBox(STR_MISSING_GRAPHICS_ERROR); - size->height = GetStringHeight(STR_MISSING_GRAPHICS_ERROR, size->width - WD_FRAMETEXT_LEFT - WD_FRAMETEXT_RIGHT) + WD_FRAMETEXT_BOTTOM + WD_FRAMETEXT_TOP; + size->height = GetStringHeight(STR_MISSING_GRAPHICS_ERROR, size->width - WidgetDimensions::scaled.frametext.Horizontal()) + WidgetDimensions::scaled.frametext.Vertical(); } } void DrawWidget(const Rect &r, int widget) const override { if (widget == WID_BEM_MESSAGE) { - DrawStringMultiLine(r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM), STR_MISSING_GRAPHICS_ERROR, TC_FROMSTRING, SA_CENTER); + DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.frametext), STR_MISSING_GRAPHICS_ERROR, TC_FROMSTRING, SA_CENTER); } } @@ -124,7 +124,7 @@ public: static const NWidgetPart _nested_bootstrap_download_status_window_widgets[] = { NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_PANEL, COLOUR_GREY, WID_NCDS_BACKGROUND), - NWidget(NWID_SPACER), SetMinimalSize(350, 0), SetMinimalTextLines(3, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 30), + NWidget(NWID_SPACER), SetMinimalSize(350, 0), SetMinimalTextLines(3, WidgetDimensions::unscaled.framerect.Vertical() + 30), EndContainer(), }; @@ -214,15 +214,15 @@ public: /* We cache the button size. This is safe as no reinit can happen here. */ if (this->button_size.width == 0) { this->button_size = maxdim(GetStringBoundingBox(STR_MISSING_GRAPHICS_YES_DOWNLOAD), GetStringBoundingBox(STR_MISSING_GRAPHICS_NO_QUIT)); - this->button_size.width += WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT; - this->button_size.height += WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM; + this->button_size.width += WidgetDimensions::scaled.frametext.Horizontal(); + this->button_size.height += WidgetDimensions::scaled.frametext.Vertical(); } switch (widget) { case WID_BAFD_QUESTION: /* The question is twice as wide as the buttons, and determine the height based on the width. */ size->width = this->button_size.width * 2; - size->height = GetStringHeight(STR_MISSING_GRAPHICS_SET_MESSAGE, size->width - WD_FRAMETEXT_LEFT - WD_FRAMETEXT_RIGHT) + WD_FRAMETEXT_BOTTOM + WD_FRAMETEXT_TOP; + size->height = GetStringHeight(STR_MISSING_GRAPHICS_SET_MESSAGE, size->width - WidgetDimensions::scaled.frametext.Horizontal()) + WidgetDimensions::scaled.frametext.Vertical(); break; case WID_BAFD_YES: @@ -236,7 +236,7 @@ public: { if (widget != 0) return; - DrawStringMultiLine(r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM), STR_MISSING_GRAPHICS_SET_MESSAGE, TC_FROMSTRING, SA_CENTER); + DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.frametext), STR_MISSING_GRAPHICS_SET_MESSAGE, TC_FROMSTRING, SA_CENTER); } void OnClick(Point pt, int widget, int click_count) override diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 416e529ded..23ae9dbf82 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -194,10 +194,10 @@ public: } sprite_dim.height++; // Sprite is rendered one pixel down in the matrix field. text_dim.height++; // Allowing the bottom row pixels to be rendered on the edge of the matrix field. - resize->height = std::max(sprite_dim.height, text_dim.height) + WD_MATRIX_TOP + WD_MATRIX_BOTTOM; // Max of both sizes + account for matrix edges. + resize->height = std::max(sprite_dim.height, text_dim.height) + padding.height; // Max of both sizes + account for matrix edges. - this->bridgetext_offset = sprite_dim.width + 1; // Left edge of text, 1 pixel distance from the sprite. - size->width = WD_MATRIX_LEFT + this->bridgetext_offset + text_dim.width + WD_MATRIX_RIGHT; + this->bridgetext_offset = sprite_dim.width + WidgetDimensions::scaled.hsep_normal; // Left edge of text, 1 pixel distance from the sprite. + size->width = this->bridgetext_offset + text_dim.width + padding.width; size->height = 4 * resize->height; // Smallest bridge gui is 4 entries high in the matrix. break; } @@ -222,7 +222,7 @@ public: break; case WID_BBS_BRIDGE_LIST: { - Rect tr = r.WithHeight(this->resize.step_height).Shrink(WD_MATRIX_LEFT, WD_MATRIX_TOP, WD_MATRIX_RIGHT, WD_MATRIX_BOTTOM); + Rect tr = r.WithHeight(this->resize.step_height).Shrink(WidgetDimensions::scaled.matrix); for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < (int)this->bridges->size(); i++) { const BridgeSpec *b = this->bridges->at(i).spec; diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 286a392ffa..27717177a9 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -48,7 +48,7 @@ */ uint GetEngineListHeight(VehicleType type) { - return std::max(FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM, GetVehicleImageCellSize(type, EIT_PURCHASE).height); + return std::max(FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.matrix.Vertical(), GetVehicleImageCellSize(type, EIT_PURCHASE).height); } static const NWidgetPart _nested_build_vehicle_widgets[] = { @@ -975,7 +975,7 @@ void DrawEngineList(VehicleType type, const Rect &r, const GUIEngineList *eng_li int sprite_right = GetVehicleImageCellSize(type, EIT_PURCHASE).extend_right; int sprite_width = sprite_left + sprite_right; - Rect ir = r.WithHeight(step_size).Shrink(WD_MATRIX_LEFT, WD_MATRIX_TOP, WD_MATRIX_RIGHT, WD_MATRIX_BOTTOM); + Rect ir = r.WithHeight(step_size).Shrink(WidgetDimensions::scaled.matrix); int sprite_x = ir.WithWidth(sprite_width, rtl).left + sprite_left; int sprite_y_offset = ScaleGUITrad(sprite_y_offsets[type]) + ir.Height() / 2; @@ -987,10 +987,10 @@ void DrawEngineList(VehicleType type, const Rect &r, const GUIEngineList *eng_li count_width = GetStringBoundingBox(STR_TINY_BLACK_COMA).width; } - Rect tr = ir.Indent(sprite_width + 6, rtl); // Name position - Rect cr = tr.Indent(replace_icon.width + 6, !rtl).WithWidth(count_width, !rtl); // Count position - Rect rr = tr.WithWidth(replace_icon.width, !rtl); // Replace icon position - if (show_count) tr = tr.Indent(count_width + 2 + replace_icon.width + 6, !rtl); + Rect tr = ir.Indent(sprite_width + WidgetDimensions::scaled.hsep_wide, rtl); // Name position + Rect cr = tr.Indent(replace_icon.width + WidgetDimensions::scaled.hsep_wide, !rtl).WithWidth(count_width, !rtl); // Count position + Rect rr = tr.WithWidth(replace_icon.width, !rtl); // Replace icon position + if (show_count) tr = tr.Indent(count_width + WidgetDimensions::scaled.hsep_normal + replace_icon.width + WidgetDimensions::scaled.hsep_wide, !rtl); int normal_text_y_offset = (ir.Height() - FONT_HEIGHT_NORMAL) / 2; int small_text_y_offset = ir.Height() - FONT_HEIGHT_SMALL; @@ -1551,7 +1551,7 @@ struct BuildVehicleWindow : Window { case WID_BV_LIST: resize->height = GetEngineListHeight(this->vehicle_type); size->height = 3 * resize->height; - size->width = std::max(size->width, GetVehicleImageCellSize(this->vehicle_type, EIT_PURCHASE).extend_left + GetVehicleImageCellSize(this->vehicle_type, EIT_PURCHASE).extend_right + 165); + size->width = std::max(size->width, GetVehicleImageCellSize(this->vehicle_type, EIT_PURCHASE).extend_left + GetVehicleImageCellSize(this->vehicle_type, EIT_PURCHASE).extend_right + 165) + padding.width; break; case WID_BV_PANEL: @@ -1620,7 +1620,7 @@ struct BuildVehicleWindow : Window { int needed_height = this->details_height; /* Draw details panels. */ if (this->sel_engine != INVALID_ENGINE) { - const Rect r = this->GetWidget(WID_BV_PANEL)->GetCurrentRect().Shrink(WD_FRAMETEXT_LEFT, WD_FRAMERECT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMERECT_BOTTOM); + const Rect r = this->GetWidget(WID_BV_PANEL)->GetCurrentRect().Shrink(WidgetDimensions::scaled.frametext, WidgetDimensions::scaled.framerect); int text_end = DrawVehiclePurchaseInfo(r.left, r.right, r.top, this->sel_engine, this->te); needed_height = std::max(needed_height, (text_end - r.top) / FONT_HEIGHT_NORMAL); } diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index 1e96854df2..030bbeb693 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -208,7 +208,7 @@ static const NWidgetPart _nested_cheat_widgets[] = { EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, WID_C_PANEL), SetDataTip(0x0, STR_CHEATS_TOOLTIP), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY), - NWidget(WWT_LABEL, COLOUR_GREY, WID_C_NOTE), SetFill(1, 1), SetDataTip(STR_CHEATS_NOTE, STR_NULL), SetPadding(WD_PAR_VSEP_NORMAL, 4, WD_PAR_VSEP_NORMAL, 4), + NWidget(WWT_LABEL, COLOUR_GREY, WID_C_NOTE), SetFill(1, 1), SetDataTip(STR_CHEATS_NOTE, STR_NULL), SetPadding(WidgetDimensions::unscaled.frametext), EndContainer(), }; @@ -235,14 +235,14 @@ struct CheatWindow : Window { { if (widget != WID_C_PANEL) return; - const Rect ir = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + const Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); int y = ir.top; bool rtl = _current_text_dir == TD_RTL; - uint box_left = rtl ? ir.right - this->box.width - 5 : ir.left + 5; - uint button_left = rtl ? ir.right - this->box.width - 10 - SETTING_BUTTON_WIDTH : ir.left + this->box.width + 10; - uint text_left = ir.left + (rtl ? 0 : 20 + this->box.width + SETTING_BUTTON_WIDTH); - uint text_right = ir.right - (rtl ? 20 + this->box.width + SETTING_BUTTON_WIDTH : 0); + uint box_left = rtl ? ir.right - this->box.width - WidgetDimensions::scaled.hsep_wide : ir.left + WidgetDimensions::scaled.hsep_wide; + uint button_left = rtl ? ir.right - this->box.width - WidgetDimensions::scaled.hsep_wide * 2 - SETTING_BUTTON_WIDTH : ir.left + this->box.width + WidgetDimensions::scaled.hsep_wide * 2; + uint text_left = ir.left + (rtl ? 0 : WidgetDimensions::scaled.hsep_wide * 4 + this->box.width + SETTING_BUTTON_WIDTH); + uint text_right = ir.right - (rtl ? WidgetDimensions::scaled.hsep_wide * 4 + this->box.width + SETTING_BUTTON_WIDTH : 0); int text_y_offset = (this->line_height - FONT_HEIGHT_NORMAL) / 2; int box_y_offset = (this->line_height - this->box.height) / 2; @@ -258,7 +258,7 @@ struct CheatWindow : Window { case SLE_BOOL: { bool on = (*(bool*)ce->variable); - DrawBoolButton(button_left, y + icon_y_offset, on, true); + DrawBoolButton(button_left, y + button_y_offset, on, true); SetDParam(0, on ? STR_CONFIG_SETTING_ON : STR_CONFIG_SETTING_OFF); break; } @@ -278,8 +278,8 @@ struct CheatWindow : Window { case STR_CHEAT_CHANGE_COMPANY: { SetDParam(0, val + 1); GetString(buf, STR_CHEAT_CHANGE_COMPANY, lastof(buf)); - uint offset = 10 + GetStringBoundingBox(buf).width; - DrawCompanyIcon(_local_company, rtl ? text_right - offset - 10 : text_left + offset, y + icon_y_offset); + uint offset = WidgetDimensions::scaled.hsep_indent + GetStringBoundingBox(buf).width; + DrawCompanyIcon(_local_company, rtl ? text_right - offset - WidgetDimensions::scaled.hsep_indent : text_left + offset, y + icon_y_offset); break; } @@ -321,7 +321,7 @@ struct CheatWindow : Window { /* Draw coloured flag for change company cheat */ case STR_CHEAT_CHANGE_COMPANY: SetDParamMaxValue(0, MAX_COMPANIES); - width = std::max(width, GetStringBoundingBox(ce->str).width + 10 + 10); + width = std::max(width, GetStringBoundingBox(ce->str).width + WidgetDimensions::scaled.hsep_wide * 4); break; default: @@ -333,21 +333,21 @@ struct CheatWindow : Window { } } - this->line_height = std::max(GetSpriteSize(SPR_BOX_CHECKED).height, GetSpriteSize(SPR_BOX_EMPTY).height); + this->line_height = std::max(this->box.height, this->icon.height); this->line_height = std::max(this->line_height, SETTING_BUTTON_HEIGHT); - this->line_height = std::max(this->line_height, FONT_HEIGHT_NORMAL) + WD_PAR_VSEP_NORMAL; + this->line_height = std::max(this->line_height, FONT_HEIGHT_NORMAL) + WidgetDimensions::scaled.framerect.Vertical(); - size->width = width + 20 + this->box.width + SETTING_BUTTON_WIDTH /* stuff on the left */ + 10 /* extra spacing on right */; - size->height = WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + this->line_height * lengthof(_cheats_ui); + size->width = width + WidgetDimensions::scaled.hsep_wide * 4 + this->box.width + SETTING_BUTTON_WIDTH /* stuff on the left */ + WidgetDimensions::scaled.hsep_wide * 2 /* extra spacing on right */; + size->height = WidgetDimensions::scaled.framerect.Vertical() + this->line_height * lengthof(_cheats_ui); } void OnClick(Point pt, int widget, int click_count) override { - const NWidgetBase *wid = this->GetWidget(WID_C_PANEL); - uint btn = (pt.y - wid->pos_y - WD_FRAMERECT_TOP) / this->line_height; - uint x = pt.x - wid->pos_x; + Rect r = this->GetWidget(WID_C_PANEL)->GetCurrentRect().Shrink(WidgetDimensions::scaled.framerect); + uint btn = (pt.y - r.top) / this->line_height; + uint x = pt.x - r.left; bool rtl = _current_text_dir == TD_RTL; - if (rtl) x = wid->current_x - x; + if (rtl) x = r.Width() - 1 - x; if (btn >= lengthof(_cheats_ui)) return; @@ -355,13 +355,13 @@ struct CheatWindow : Window { int value = (int32)ReadValue(ce->variable, ce->type); int oldvalue = value; - if (btn == CHT_CHANGE_DATE && x >= 20 + this->box.width + SETTING_BUTTON_WIDTH) { + if (btn == CHT_CHANGE_DATE && x >= WidgetDimensions::scaled.hsep_wide * 2 + this->box.width + SETTING_BUTTON_WIDTH) { /* Click at the date text directly. */ clicked_widget = CHT_CHANGE_DATE; SetDParam(0, value); ShowQueryString(STR_JUST_INT, STR_CHEAT_CHANGE_DATE_QUERY_CAPT, 8, this, CS_NUMERAL, QSF_ACCEPT_UNCHANGED); return; - } else if (btn == CHT_EDIT_MAX_HL && x >= 20 + this->box.width + SETTING_BUTTON_WIDTH) { + } else if (btn == CHT_EDIT_MAX_HL && x >= WidgetDimensions::scaled.hsep_wide * 2 + this->box.width + SETTING_BUTTON_WIDTH) { clicked_widget = CHT_EDIT_MAX_HL; SetDParam(0, value); ShowQueryString(STR_JUST_INT, STR_CHEAT_EDIT_MAX_HL_QUERY_CAPT, 8, this, CS_NUMERAL, QSF_ACCEPT_UNCHANGED); @@ -369,7 +369,7 @@ struct CheatWindow : Window { } /* Not clicking a button? */ - if (!IsInsideMM(x, 10 + this->box.width, 10 + this->box.width + SETTING_BUTTON_WIDTH)) return; + if (!IsInsideMM(x, WidgetDimensions::scaled.hsep_wide * 2 + this->box.width, WidgetDimensions::scaled.hsep_wide * 2 + this->box.width + SETTING_BUTTON_WIDTH)) return; *ce->been_used = true; @@ -381,10 +381,10 @@ struct CheatWindow : Window { default: /* Take whatever the function returns */ - value = ce->proc(value + ((x >= 10 + this->box.width + SETTING_BUTTON_WIDTH / 2) ? 1 : -1), (x >= 10 + this->box.width + SETTING_BUTTON_WIDTH / 2) ? 1 : -1); + value = ce->proc(value + ((x >= WidgetDimensions::scaled.hsep_wide * 2 + this->box.width + SETTING_BUTTON_WIDTH / 2) ? 1 : -1), (x >= WidgetDimensions::scaled.hsep_wide * 2 + this->box.width + SETTING_BUTTON_WIDTH / 2) ? 1 : -1); /* The first cheat (money), doesn't return a different value. */ - if (value != oldvalue || btn == CHT_MONEY) this->clicked = btn * 2 + 1 + ((x >= 10 + this->box.width + SETTING_BUTTON_WIDTH / 2) != rtl ? 1 : 0); + if (value != oldvalue || btn == CHT_MONEY) this->clicked = btn * 2 + 1 + ((x >= WidgetDimensions::scaled.hsep_wide * 2 + this->box.width + SETTING_BUTTON_WIDTH / 2) != rtl ? 1 : 0); break; } diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 7951f39d7c..77f8ad4e48 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -148,7 +148,7 @@ static uint GetMaxCategoriesWidth() /* Title of category */ max_width = std::max(max_width, GetStringBoundingBox(STR_FINANCES_REVENUE_TITLE + i).width); /* Entries in category */ - max_width = std::max(max_width, _expenses_list_types[i].GetListWidth()); + max_width = std::max(max_width, _expenses_list_types[i].GetListWidth() + WidgetDimensions::scaled.hsep_indent); } return max_width; @@ -292,7 +292,7 @@ static const NWidgetPart _nested_company_finances_widgets[] = { EndContainer(), NWidget(NWID_SELECTION, INVALID_COLOUR, WID_CF_SEL_PANEL), NWidget(WWT_PANEL, COLOUR_GREY), - NWidget(NWID_HORIZONTAL), SetPadding(WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM, WD_FRAMERECT_LEFT), SetPIP(0, 9, 0), + NWidget(NWID_HORIZONTAL), SetPadding(WidgetDimensions::unscaled.framerect), SetPIP(0, WidgetDimensions::unscaled.hsep_wide, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CF_EXPS_CATEGORY), SetMinimalSize(120, 0), SetFill(0, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CF_EXPS_PRICE1), SetMinimalSize(86, 0), SetFill(0, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CF_EXPS_PRICE2), SetMinimalSize(86, 0), SetFill(0, 0), @@ -301,7 +301,7 @@ static const NWidgetPart _nested_company_finances_widgets[] = { EndContainer(), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY), - NWidget(NWID_HORIZONTAL), SetPadding(WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM, WD_FRAMERECT_LEFT), + NWidget(NWID_HORIZONTAL), SetPadding(WidgetDimensions::unscaled.framerect), NWidget(NWID_VERTICAL), // Vertical column with 'bank balance', 'loan' NWidget(WWT_TEXT, COLOUR_GREY), SetDataTip(STR_FINANCES_OWN_FUNDS_TITLE, STR_NULL), SetFill(1, 0), NWidget(WWT_TEXT, COLOUR_GREY), SetDataTip(STR_FINANCES_LOAN_TITLE, STR_NULL), SetFill(1, 0), @@ -607,18 +607,15 @@ public: bool rtl = _current_text_dir == TD_RTL; int icon_y = CenterBounds(r.top, r.bottom, 0); int text_y = CenterBounds(r.top, r.bottom, FONT_HEIGHT_NORMAL); - Rect tr = r.Shrink(WD_DROPDOWNTEXT_LEFT, WD_DROPDOWNTEXT_TOP, WD_DROPDOWNTEXT_RIGHT, WD_DROPDOWNTEXT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.dropdowntext); DrawSprite(SPR_VEH_BUS_SIDE_VIEW, PALETTE_RECOLOUR_START + (this->result % COLOUR_END), rtl ? tr.right - ScaleGUITrad(14) : tr.left + ScaleGUITrad(14), icon_y); - DrawString(rtl ? tr.left : tr.left + ScaleGUITrad(28) + 2, - rtl ? tr.right - ScaleGUITrad(28) - 2 : tr.right, - text_y, this->String(), sel ? TC_WHITE : TC_BLACK); + tr = tr.Indent(ScaleGUITrad(28) + WidgetDimensions::scaled.hsep_normal, rtl); + DrawString(tr.left, tr.right, text_y, this->String(), sel ? TC_WHITE : TC_BLACK); } }; -static const int LEVEL_WIDTH = 10; ///< Indenting width of a sub-group in pixels - typedef GUIList GUIGroupList; /** Company livery colour scheme window. */ @@ -823,14 +820,14 @@ public: } } - size->width = std::max(size->width, 5 + d.width + WD_FRAMERECT_RIGHT); + size->width = std::max(size->width, 5 + d.width + padding.width); break; } case WID_SCL_MATRIX: { /* 11 items in the default rail class */ this->square = GetSpriteSize(SPR_SQUARE); - this->line_height = std::max(this->square.height, (uint)FONT_HEIGHT_NORMAL) + 4; + this->line_height = std::max(this->square.height, (uint)FONT_HEIGHT_NORMAL) + padding.height; size->height = 11 * this->line_height; resize->width = 1; @@ -847,7 +844,7 @@ public: case WID_SCL_PRI_COL_DROPDOWN: { this->square = GetSpriteSize(SPR_SQUARE); - int string_padding = this->square.width + NWidgetScrollbar::GetVerticalDimension().width + 10; + int string_padding = this->square.width + WidgetDimensions::scaled.hsep_normal + padding.width; for (const StringID *id = _colour_dropdown; id != endof(_colour_dropdown); id++) { size->width = std::max(size->width, GetStringBoundingBox(*id).width + string_padding); } @@ -919,21 +916,21 @@ public: /* Coordinates of scheme name column. */ const NWidgetBase *nwi = this->GetWidget(WID_SCL_SPACER_DROPDOWN); - Rect sch = nwi->GetCurrentRect().Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect sch = nwi->GetCurrentRect().Shrink(WidgetDimensions::scaled.framerect); /* Coordinates of first dropdown. */ nwi = this->GetWidget(WID_SCL_PRI_COL_DROPDOWN); - Rect pri = nwi->GetCurrentRect().Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect pri = nwi->GetCurrentRect().Shrink(WidgetDimensions::scaled.framerect); /* Coordinates of second dropdown. */ nwi = this->GetWidget(WID_SCL_SEC_COL_DROPDOWN); - Rect sec = nwi->GetCurrentRect().Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect sec = nwi->GetCurrentRect().Shrink(WidgetDimensions::scaled.framerect); Rect pri_squ = pri.WithWidth(this->square.width, rtl); Rect sec_squ = sec.WithWidth(this->square.width, rtl); - pri = pri.Indent(this->square.width + ScaleGUITrad(2), rtl); - sec = sec.Indent(this->square.width + ScaleGUITrad(2), rtl); + pri = pri.Indent(this->square.width + WidgetDimensions::scaled.hsep_normal, rtl); + sec = sec.Indent(this->square.width + WidgetDimensions::scaled.hsep_normal, rtl); - Rect ir = r.WithHeight(this->resize.step_height).Shrink(WD_MATRIX_LEFT, WD_MATRIX_TOP, WD_MATRIX_RIGHT, WD_MATRIX_BOTTOM); + Rect ir = r.WithHeight(this->resize.step_height).Shrink(WidgetDimensions::scaled.matrix); int square_offs = (ir.Height() - this->square.height) / 2; int text_offs = (ir.Height() - FONT_HEIGHT_NORMAL) / 2; @@ -971,7 +968,7 @@ public: for (uint i = this->vscroll->GetPosition(); i < max; ++i) { const Group *g = this->groups[i]; SetDParam(0, g->index); - draw_livery(STR_GROUP_NAME, g->livery, this->sel == g->index, false, this->indents[i] * LEVEL_WIDTH); + draw_livery(STR_GROUP_NAME, g->livery, this->sel == g->index, false, this->indents[i] * WidgetDimensions::scaled.hsep_indent); } } } @@ -1269,81 +1266,81 @@ static const NWidgetPart _nested_select_company_manager_face_widgets[] = { EndContainer(), NWidget(NWID_SPACER), SetMinimalSize(0, 4), NWidget(NWID_HORIZONTAL), - NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_HAS_MOUSTACHE_EARRING_TEXT), SetFill(1, 0), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), + NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_HAS_MOUSTACHE_EARRING_TEXT), SetFill(1, 0), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_FACE_EYECOLOUR, STR_NULL), SetTextColour(TC_GOLD), SetAlignment(SA_VERT_CENTER | SA_RIGHT), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SCMF_HAS_MOUSTACHE_EARRING), SetDataTip(STR_WHITE_STRING, STR_FACE_MOUSTACHE_EARRING_TOOLTIP), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_HAS_GLASSES_TEXT), SetFill(1, 0), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), + NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_HAS_GLASSES_TEXT), SetFill(1, 0), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_FACE_GLASSES, STR_NULL), SetTextColour(TC_GOLD), SetAlignment(SA_VERT_CENTER | SA_RIGHT), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SCMF_HAS_GLASSES), SetDataTip(STR_WHITE_STRING, STR_FACE_GLASSES_TOOLTIP), EndContainer(), NWidget(NWID_SPACER), SetMinimalSize(0, 2), SetFill(1, 0), NWidget(NWID_HORIZONTAL), - NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_HAIR_TEXT), SetFill(1, 0), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), + NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_HAIR_TEXT), SetFill(1, 0), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_FACE_HAIR, STR_NULL), SetTextColour(TC_GOLD), SetAlignment(SA_VERT_CENTER | SA_RIGHT), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_HAIR_L), SetDataTip(AWV_DECREASE, STR_FACE_HAIR_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SCMF_HAIR), SetDataTip(STR_WHITE_STRING, STR_FACE_HAIR_TOOLTIP), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_HAIR_R), SetDataTip(AWV_INCREASE, STR_FACE_HAIR_TOOLTIP), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_EYEBROWS_TEXT), SetFill(1, 0), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), + NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_EYEBROWS_TEXT), SetFill(1, 0), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_FACE_EYEBROWS, STR_NULL), SetTextColour(TC_GOLD), SetAlignment(SA_VERT_CENTER | SA_RIGHT), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_EYEBROWS_L), SetDataTip(AWV_DECREASE, STR_FACE_EYEBROWS_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SCMF_EYEBROWS), SetDataTip(STR_WHITE_STRING, STR_FACE_EYEBROWS_TOOLTIP), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_EYEBROWS_R), SetDataTip(AWV_INCREASE, STR_FACE_EYEBROWS_TOOLTIP), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_EYECOLOUR_TEXT), SetFill(1, 0), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), + NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_EYECOLOUR_TEXT), SetFill(1, 0), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_FACE_EYECOLOUR, STR_NULL), SetTextColour(TC_GOLD), SetAlignment(SA_VERT_CENTER | SA_RIGHT), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_EYECOLOUR_L), SetDataTip(AWV_DECREASE, STR_FACE_EYECOLOUR_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SCMF_EYECOLOUR), SetDataTip(STR_WHITE_STRING, STR_FACE_EYECOLOUR_TOOLTIP), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_EYECOLOUR_R), SetDataTip(AWV_INCREASE, STR_FACE_EYECOLOUR_TOOLTIP), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_GLASSES_TEXT), SetFill(1, 0), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), + NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_GLASSES_TEXT), SetFill(1, 0), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_FACE_GLASSES, STR_NULL), SetTextColour(TC_GOLD), SetAlignment(SA_VERT_CENTER | SA_RIGHT), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_GLASSES_L), SetDataTip(AWV_DECREASE, STR_FACE_GLASSES_TOOLTIP_2), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SCMF_GLASSES), SetDataTip(STR_WHITE_STRING, STR_FACE_GLASSES_TOOLTIP_2), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_GLASSES_R), SetDataTip(AWV_INCREASE, STR_FACE_GLASSES_TOOLTIP_2), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_NOSE_TEXT), SetFill(1, 0), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), + NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_NOSE_TEXT), SetFill(1, 0), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_FACE_NOSE, STR_NULL), SetTextColour(TC_GOLD), SetAlignment(SA_VERT_CENTER | SA_RIGHT), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_NOSE_L), SetDataTip(AWV_DECREASE, STR_FACE_NOSE_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SCMF_NOSE), SetDataTip(STR_WHITE_STRING, STR_FACE_NOSE_TOOLTIP), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_NOSE_R), SetDataTip(AWV_INCREASE, STR_FACE_NOSE_TOOLTIP), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_LIPS_MOUSTACHE_TEXT), SetFill(1, 0), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), + NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_LIPS_MOUSTACHE_TEXT), SetFill(1, 0), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_FACE_MOUSTACHE, STR_NULL), SetTextColour(TC_GOLD), SetAlignment(SA_VERT_CENTER | SA_RIGHT), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_LIPS_MOUSTACHE_L), SetDataTip(AWV_DECREASE, STR_FACE_LIPS_MOUSTACHE_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SCMF_LIPS_MOUSTACHE), SetDataTip(STR_WHITE_STRING, STR_FACE_LIPS_MOUSTACHE_TOOLTIP), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_LIPS_MOUSTACHE_R), SetDataTip(AWV_INCREASE, STR_FACE_LIPS_MOUSTACHE_TOOLTIP), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_CHIN_TEXT), SetFill(1, 0), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), + NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_CHIN_TEXT), SetFill(1, 0), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_FACE_CHIN, STR_NULL), SetTextColour(TC_GOLD), SetAlignment(SA_VERT_CENTER | SA_RIGHT), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_CHIN_L), SetDataTip(AWV_DECREASE, STR_FACE_CHIN_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SCMF_CHIN), SetDataTip(STR_WHITE_STRING, STR_FACE_CHIN_TOOLTIP), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_CHIN_R), SetDataTip(AWV_INCREASE, STR_FACE_CHIN_TOOLTIP), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_JACKET_TEXT), SetFill(1, 0), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), + NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_JACKET_TEXT), SetFill(1, 0), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_FACE_JACKET, STR_NULL), SetTextColour(TC_GOLD), SetAlignment(SA_VERT_CENTER | SA_RIGHT), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_JACKET_L), SetDataTip(AWV_DECREASE, STR_FACE_JACKET_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SCMF_JACKET), SetDataTip(STR_WHITE_STRING, STR_FACE_JACKET_TOOLTIP), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_JACKET_R), SetDataTip(AWV_INCREASE, STR_FACE_JACKET_TOOLTIP), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_COLLAR_TEXT), SetFill(1, 0), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), + NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_COLLAR_TEXT), SetFill(1, 0), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_FACE_COLLAR, STR_NULL), SetTextColour(TC_GOLD), SetAlignment(SA_VERT_CENTER | SA_RIGHT), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_COLLAR_L), SetDataTip(AWV_DECREASE, STR_FACE_COLLAR_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SCMF_COLLAR), SetDataTip(STR_WHITE_STRING, STR_FACE_COLLAR_TOOLTIP), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_COLLAR_R), SetDataTip(AWV_INCREASE, STR_FACE_COLLAR_TOOLTIP), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_TIE_EARRING_TEXT), SetFill(1, 0), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), + NWidget(WWT_TEXT, INVALID_COLOUR, WID_SCMF_TIE_EARRING_TEXT), SetFill(1, 0), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_FACE_EARRING, STR_NULL), SetTextColour(TC_GOLD), SetAlignment(SA_VERT_CENTER | SA_RIGHT), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_SCMF_TIE_EARRING_L), SetDataTip(AWV_DECREASE, STR_FACE_TIE_EARRING_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SCMF_TIE_EARRING), SetDataTip(STR_WHITE_STRING, STR_FACE_TIE_EARRING_TOOLTIP), @@ -1447,17 +1444,17 @@ public: { /* Size of the boolean yes/no button. */ Dimension yesno_dim = maxdim(GetStringBoundingBox(STR_FACE_YES), GetStringBoundingBox(STR_FACE_NO)); - yesno_dim.width += WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; - yesno_dim.height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + yesno_dim.width += WidgetDimensions::scaled.framerect.Horizontal(); + yesno_dim.height += WidgetDimensions::scaled.framerect.Vertical(); /* Size of the number button + arrows. */ Dimension number_dim = {0, 0}; for (int val = 1; val <= 12; val++) { SetDParam(0, val); number_dim = maxdim(number_dim, GetStringBoundingBox(STR_JUST_INT)); } - uint arrows_width = GetSpriteSize(SPR_ARROW_LEFT).width + GetSpriteSize(SPR_ARROW_RIGHT).width + 2 * (WD_IMGBTN_LEFT + WD_IMGBTN_RIGHT); - number_dim.width += WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT + arrows_width; - number_dim.height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + uint arrows_width = GetSpriteSize(SPR_ARROW_LEFT).width + GetSpriteSize(SPR_ARROW_RIGHT).width + 2 * (WidgetDimensions::scaled.imgbtn.Horizontal()); + number_dim.width += WidgetDimensions::scaled.framerect.Horizontal() + arrows_width; + number_dim.height += WidgetDimensions::scaled.framerect.Vertical(); /* Compute width of both buttons. */ yesno_dim.width = std::max(yesno_dim.width, number_dim.width); number_dim.width = yesno_dim.width - arrows_width; @@ -1796,28 +1793,28 @@ static const NWidgetPart _nested_company_infrastructure_widgets[] = { NWidget(WWT_STICKYBOX, COLOUR_GREY), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY), - NWidget(NWID_VERTICAL), SetPIP(WD_FRAMERECT_TOP, WD_PAR_VSEP_NORMAL * 2, WD_FRAMERECT_BOTTOM), - NWidget(NWID_HORIZONTAL), SetPIP(2, 4, 2), + NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.framerect), SetPIP(0, WidgetDimensions::unscaled.vsep_normal, 0), + NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_wide, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CI_RAIL_DESC), SetMinimalTextLines(2, 0), SetFill(1, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CI_RAIL_COUNT), SetMinimalTextLines(2, 0), SetFill(0, 1), EndContainer(), - NWidget(NWID_HORIZONTAL), SetPIP(2, 4, 2), + NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_wide, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CI_ROAD_DESC), SetMinimalTextLines(2, 0), SetFill(1, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CI_ROAD_COUNT), SetMinimalTextLines(2, 0), SetFill(0, 1), EndContainer(), - NWidget(NWID_HORIZONTAL), SetPIP(2, 4, 2), + NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_wide, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CI_TRAM_DESC), SetMinimalTextLines(2, 0), SetFill(1, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CI_TRAM_COUNT), SetMinimalTextLines(2, 0), SetFill(0, 1), EndContainer(), - NWidget(NWID_HORIZONTAL), SetPIP(2, 4, 2), + NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_wide, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CI_WATER_DESC), SetMinimalTextLines(2, 0), SetFill(1, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CI_WATER_COUNT), SetMinimalTextLines(2, 0), SetFill(0, 1), EndContainer(), - NWidget(NWID_HORIZONTAL), SetPIP(2, 4, 2), + NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_wide, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CI_STATION_DESC), SetMinimalTextLines(3, 0), SetFill(1, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CI_STATION_COUNT), SetMinimalTextLines(3, 0), SetFill(0, 1), EndContainer(), - NWidget(NWID_HORIZONTAL), SetPIP(2, 4, 2), + NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_wide, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CI_TOTAL_DESC), SetFill(1, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CI_TOTAL), SetFill(0, 1), EndContainer(), @@ -1918,12 +1915,12 @@ struct CompanyInfrastructureWindow : Window if (HasBit(this->railtypes, rt)) { lines++; SetDParam(0, GetRailTypeInfo(rt)->strings.name); - size->width = std::max(size->width, GetStringBoundingBox(STR_WHITE_STRING).width + WD_FRAMERECT_LEFT); + size->width = std::max(size->width, GetStringBoundingBox(STR_WHITE_STRING).width + WidgetDimensions::scaled.hsep_indent); } } if (this->railtypes != RAILTYPES_NONE) { lines++; - size->width = std::max(size->width, GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_SIGNALS).width + WD_FRAMERECT_LEFT); + size->width = std::max(size->width, GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_SIGNALS).width + WidgetDimensions::scaled.hsep_indent); } size->height = std::max(size->height, lines * FONT_HEIGHT_NORMAL); @@ -1940,7 +1937,7 @@ struct CompanyInfrastructureWindow : Window if (HasBit(this->roadtypes, rt) && RoadTypeIsRoad(rt) == (widget == WID_CI_ROAD_DESC)) { lines++; SetDParam(0, GetRoadTypeInfo(rt)->strings.name); - size->width = std::max(size->width, GetStringBoundingBox(STR_WHITE_STRING).width + WD_FRAMERECT_LEFT); + size->width = std::max(size->width, GetStringBoundingBox(STR_WHITE_STRING).width + WidgetDimensions::scaled.hsep_indent); } } @@ -1950,13 +1947,13 @@ struct CompanyInfrastructureWindow : Window case WID_CI_WATER_DESC: size->width = std::max(size->width, GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_WATER_SECT).width); - size->width = std::max(size->width, GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_CANALS).width + WD_FRAMERECT_LEFT); + size->width = std::max(size->width, GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_CANALS).width + WidgetDimensions::scaled.hsep_indent); break; case WID_CI_STATION_DESC: size->width = std::max(size->width, GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_STATION_SECT).width); - size->width = std::max(size->width, GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_STATIONS).width + WD_FRAMERECT_LEFT); - size->width = std::max(size->width, GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_AIRPORTS).width + WD_FRAMERECT_LEFT); + size->width = std::max(size->width, GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_STATIONS).width + WidgetDimensions::scaled.hsep_indent); + size->width = std::max(size->width, GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_AIRPORTS).width + WidgetDimensions::scaled.hsep_indent); break; case WID_CI_RAIL_COUNT: @@ -1990,11 +1987,11 @@ struct CompanyInfrastructureWindow : Window max_cost = std::max(max_cost, AirportMaintenanceCost(c->index)); SetDParamMaxValue(0, max_val); - uint count_width = GetStringBoundingBox(STR_WHITE_COMMA).width + 20; // Reserve some wiggle room + uint count_width = GetStringBoundingBox(STR_WHITE_COMMA).width + WidgetDimensions::scaled.hsep_indent; // Reserve some wiggle room if (_settings_game.economy.infrastructure_maintenance) { SetDParamMaxValue(0, this->GetTotalMaintenanceCost() * 12); // Convert to per year - this->total_width = GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL).width + 20; + this->total_width = GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL).width + WidgetDimensions::scaled.hsep_indent * 2; size->width = std::max(size->width, this->total_width); SetDParamMaxValue(0, max_cost * 12); // Convert to per year @@ -2034,9 +2031,10 @@ struct CompanyInfrastructureWindow : Window void DrawWidget(const Rect &r, int widget) const override { const Company *c = Company::Get((CompanyID)this->window_number); + int y = r.top; - Rect ir = r.Indent(LEVEL_WIDTH, _current_text_dir == TD_RTL); + Rect ir = r.Indent(WidgetDimensions::scaled.hsep_indent, _current_text_dir == TD_RTL); switch (widget) { case WID_CI_RAIL_DESC: DrawString(r.left, r.right, y, STR_COMPANY_INFRASTRUCTURE_VIEW_RAIL_SECT); diff --git a/src/console_gui.cpp b/src/console_gui.cpp index eaef1e4efa..972ef23b24 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -31,7 +31,6 @@ #include "safeguards.h" static const uint ICON_HISTORY_SIZE = 20; -static const uint ICON_LINE_SPACING = 2; static const uint ICON_RIGHT_BORDERWIDTH = 10; static const uint ICON_BOTTOM_BORDERWIDTH = 12; @@ -121,14 +120,18 @@ struct IConsoleWindow : Window IConsoleWindow() : Window(&_console_window_desc) { _iconsole_mode = ICONSOLE_OPENED; - this->line_height = FONT_HEIGHT_NORMAL + ICON_LINE_SPACING; - this->line_offset = GetStringBoundingBox("] ").width + 5; this->InitNested(0); this->truncate_timer.SetInterval(3000); ResizeWindow(this, _screen.width, _screen.height / 3); } + void OnInit() override + { + this->line_height = FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.hsep_normal; + this->line_offset = GetStringBoundingBox("] ").width + WidgetDimensions::scaled.frametext.left; + } + void Close() override { _iconsole_mode = ICONSOLE_CLOSED; @@ -156,20 +159,20 @@ struct IConsoleWindow : Window void OnPaint() override { - const int right = this->width - 5; + const int right = this->width - WidgetDimensions::scaled.frametext.right; GfxFillRect(0, 0, this->width - 1, this->height - 1, PC_BLACK); int ypos = this->height - this->line_height; for (size_t line_index = IConsoleWindow::scroll; line_index < _iconsole_buffer.size(); line_index++) { const IConsoleLine &print = _iconsole_buffer[line_index]; SetDParamStr(0, print.buffer); - ypos = DrawStringMultiLine(5, right, -this->line_height, ypos, STR_JUST_RAW_STRING, print.colour, SA_LEFT | SA_BOTTOM | SA_FORCE) - ICON_LINE_SPACING; + ypos = DrawStringMultiLine(WidgetDimensions::scaled.frametext.left, right, -this->line_height, ypos, STR_JUST_RAW_STRING, print.colour, SA_LEFT | SA_BOTTOM | SA_FORCE) - WidgetDimensions::scaled.hsep_normal; if (ypos < 0) break; } /* If the text is longer than the window, don't show the starting ']' */ int delta = this->width - this->line_offset - _iconsole_cmdline.pixels - ICON_RIGHT_BORDERWIDTH; if (delta > 0) { - DrawString(5, right, this->height - this->line_height, "]", (TextColour)CC_COMMAND, SA_LEFT | SA_FORCE); + DrawString(WidgetDimensions::scaled.frametext.left, right, this->height - this->line_height, "]", (TextColour)CC_COMMAND, SA_LEFT | SA_FORCE); delta = 0; } diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index f95f9ade60..050cc06876 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -325,13 +325,13 @@ struct DepotWindow : Window { ScaleGUITrad(_consistent_train_width != 0 ? _consistent_train_width : TRAININFO_DEFAULT_VEHICLE_WIDTH) : 0; - DrawTrainImage(u, image_left + (rtl ? 0 : x_space), image_right - (rtl ? x_space : 0), sprite_y - 1, + DrawTrainImage(u, image_left + (rtl ? 0 : x_space), image_right - (rtl ? x_space : 0), sprite_y, this->sel, EIT_IN_DEPOT, free_wagon ? 0 : this->hscroll->GetPosition(), this->vehicle_over); /* Length of consist in tiles with 1 fractional digit (rounded up) */ SetDParam(0, CeilDiv(u->gcache.cached_total_length * 10, TILE_SIZE)); SetDParam(1, 1); - DrawString(rtl ? left + WD_FRAMERECT_LEFT : right - this->count_width, rtl ? left + this->count_width : right - WD_FRAMERECT_RIGHT, y + (this->resize.step_height - FONT_HEIGHT_SMALL) / 2, STR_TINY_BLACK_DECIMAL, TC_FROMSTRING, SA_RIGHT); // Draw the counter + DrawString(rtl ? left : right - this->count_width, rtl ? left + this->count_width : right, y + (this->resize.step_height - FONT_HEIGHT_SMALL) / 2, STR_TINY_BLACK_DECIMAL, TC_FROMSTRING, SA_RIGHT); // Draw the counter break; } @@ -344,23 +344,23 @@ struct DepotWindow : Window { uint diff_x, diff_y; if (v->IsGroundVehicle()) { /* Arrange unitnumber and flag horizontally */ - diff_x = this->flag_width + WD_FRAMERECT_LEFT; - diff_y = (this->resize.step_height - this->flag_height) / 2 - 2; + diff_x = this->flag_width; + diff_y = (this->resize.step_height - this->flag_height) / 2; } else { /* Arrange unitnumber and flag vertically */ - diff_x = WD_FRAMERECT_LEFT; - diff_y = FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; + diff_x = 0; + diff_y = FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; } int text_left = rtl ? right - this->header_width - 1 : left + diff_x; int text_right = rtl ? right - diff_x : left + this->header_width - 1; if (free_wagon) { - DrawString(text_left, text_right, y + 2, STR_DEPOT_NO_ENGINE); + DrawString(text_left, text_right, y + WidgetDimensions::scaled.framerect.top, STR_DEPOT_NO_ENGINE); } else { - DrawSprite((v->vehstatus & VS_STOPPED) ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, PAL_NONE, rtl ? right - this->flag_width : left + WD_FRAMERECT_LEFT, y + diff_y); + DrawSprite((v->vehstatus & VS_STOPPED) ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, PAL_NONE, rtl ? right - this->flag_width : left + WidgetDimensions::scaled.framerect.left, y + diff_y); SetDParam(0, v->unitnumber); - DrawString(text_left, text_right, y + 2, (uint16)(v->max_age - DAYS_IN_LEAP_YEAR) >= v->age ? STR_BLACK_COMMA : STR_RED_COMMA); + DrawString(text_left, text_right, y + WidgetDimensions::scaled.framerect.top, (uint16)(v->max_age - DAYS_IN_LEAP_YEAR) >= v->age ? STR_BLACK_COMMA : STR_RED_COMMA); } } @@ -373,6 +373,8 @@ struct DepotWindow : Window { /* Set the row and number of boxes in each row based on the number of boxes drawn in the matrix */ const NWidgetCore *wid = this->GetWidget(WID_D_MATRIX); + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); + /* Draw vertical separators at whole tiles. * This only works in two cases: * - All vehicles use VEHICLEINFO_FULL_VEHICLE_WIDTH as reference width. @@ -381,16 +383,16 @@ struct DepotWindow : Window { if (this->type == VEH_TRAIN && _consistent_train_width != 0) { int w = ScaleGUITrad(2 * _consistent_train_width); int col = _colour_gradient[wid->colour][4]; - int image_left = rtl ? r.left + this->count_width : r.left + this->header_width; - int image_right = rtl ? r.right - this->header_width : r.right - this->count_width; + int image_left = rtl ? ir.left + this->count_width : ir.left + this->header_width; + int image_right = rtl ? ir.right - this->header_width : ir.right - this->count_width; int first_line = w + (-this->hscroll->GetPosition()) % w; if (rtl) { for (int x = image_right - first_line; x >= image_left; x -= w) { - GfxDrawLine(x, r.top, x, r.bottom, col, 1, 3); + GfxDrawLine(x, r.top, x, r.bottom, col, ScaleGUITrad(1), ScaleGUITrad(3)); } } else { for (int x = image_left + first_line; x <= image_right; x += w) { - GfxDrawLine(x, r.top, x, r.bottom, col, 1, 3); + GfxDrawLine(x, r.top, x, r.bottom, col, ScaleGUITrad(1), ScaleGUITrad(3)); } } } @@ -400,15 +402,15 @@ struct DepotWindow : Window { uint num = this->vscroll->GetPosition() * this->num_columns; uint maxval = static_cast(std::min(this->vehicle_list.size(), num + (rows_in_display * this->num_columns))); int y; - for (y = r.top + 1; num < maxval; y += this->resize.step_height) { // Draw the rows + for (y = r.top; num < maxval; y += this->resize.step_height) { // Draw the rows for (uint i = 0; i < this->num_columns && num < maxval; i++, num++) { /* Draw all vehicles in the current row */ const Vehicle *v = this->vehicle_list[num]; if (this->num_columns == 1) { - this->DrawVehicleInDepot(v, r.left, r.right, y); + this->DrawVehicleInDepot(v, ir.left, ir.right, y); } else { - int x = r.left + (rtl ? (this->num_columns - i - 1) : i) * this->resize.step_width; - this->DrawVehicleInDepot(v, x, x + this->resize.step_width - 1, y); + int x = ir.left + (rtl ? (this->num_columns - i - 1) : i) * this->resize.step_width; + this->DrawVehicleInDepot(v, x, x + this->resize.step_width - 1 - WidgetDimensions::scaled.framerect.Horizontal(), y); } } } @@ -418,7 +420,7 @@ struct DepotWindow : Window { /* Draw the train wagons without an engine in front. */ for (; num < maxval; num++, y += this->resize.step_height) { const Vehicle *v = this->wagon_list[num - this->vehicle_list.size()]; - this->DrawVehicleInDepot(v, r.left, r.right, y); + this->DrawVehicleInDepot(v, ir.left, ir.right, y); } } @@ -506,7 +508,7 @@ struct DepotWindow : Window { case VEH_SHIP: case VEH_AIRCRAFT: - if (xm <= this->flag_width && ym >= (uint)(FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL)) return MODE_START_STOP; + if (xm <= this->flag_width && ym >= (uint)(FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal)) return MODE_START_STOP; break; default: NOT_REACHED(); @@ -657,7 +659,7 @@ struct DepotWindow : Window { if (this->type == VEH_TRAIN) { SetDParamMaxValue(0, 1000, 0, FS_SMALL); SetDParam(1, 1); - this->count_width = GetStringBoundingBox(STR_TINY_BLACK_DECIMAL).width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; + this->count_width = GetStringBoundingBox(STR_TINY_BLACK_DECIMAL).width + WidgetDimensions::scaled.framerect.Horizontal(); } else { this->count_width = 0; } @@ -665,15 +667,15 @@ struct DepotWindow : Window { SetDParamMaxDigits(0, this->unitnumber_digits); Dimension unumber = GetStringBoundingBox(STR_BLACK_COMMA); const Sprite *spr = GetSprite(SPR_FLAG_VEH_STOPPED, ST_NORMAL); - this->flag_width = UnScaleGUI(spr->width) + WD_FRAMERECT_RIGHT; + this->flag_width = UnScaleGUI(spr->width) + WidgetDimensions::scaled.framerect.right; this->flag_height = UnScaleGUI(spr->height); if (this->type == VEH_TRAIN || this->type == VEH_ROAD) { - min_height = std::max(unumber.height + WD_MATRIX_TOP, UnScaleGUI(spr->height)); - this->header_width = unumber.width + this->flag_width + WD_FRAMERECT_LEFT; + min_height = std::max(unumber.height + WidgetDimensions::scaled.matrix.top, UnScaleGUI(spr->height)); + this->header_width = unumber.width + this->flag_width + WidgetDimensions::scaled.framerect.left; } else { - min_height = unumber.height + UnScaleGUI(spr->height) + WD_MATRIX_TOP + WD_PAR_VSEP_NORMAL + WD_MATRIX_BOTTOM; - this->header_width = std::max(unumber.width, this->flag_width) + WD_FRAMERECT_RIGHT; + min_height = unumber.height + UnScaleGUI(spr->height) + padding.height + WidgetDimensions::scaled.vsep_normal; + this->header_width = std::max(unumber.width, this->flag_width) + WidgetDimensions::scaled.framerect.right; } int base_width = this->count_width + this->header_width; diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index b0fc7f54ff..1e7ff70b94 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -447,9 +447,9 @@ public: /* strings such as 'Size' and 'Coverage Area' */ Rect r = this->GetWidget(BDSW_ACCEPTANCE)->GetCurrentRect(); - int top = r.top + ScaleGUITrad(WD_PAR_VSEP_NORMAL); - top = DrawStationCoverageAreaText(r.left, r.right, top, SCT_ALL, rad, false) + ScaleGUITrad(WD_PAR_VSEP_NORMAL); - top = DrawStationCoverageAreaText(r.left, r.right, top, SCT_ALL, rad, true) + ScaleGUITrad(WD_PAR_VSEP_NORMAL); + int top = r.top + WidgetDimensions::scaled.vsep_normal; + top = DrawStationCoverageAreaText(r.left, r.right, top, SCT_ALL, rad, false) + WidgetDimensions::scaled.vsep_normal; + top = DrawStationCoverageAreaText(r.left, r.right, top, SCT_ALL, rad, true) + WidgetDimensions::scaled.vsep_normal; /* Resize background if the window is too small. * Never make the window smaller to avoid oscillating if the size change affects the acceptance. * (This is the case, if making the window bigger moves the mouse into the window.) */ @@ -486,12 +486,12 @@ static const NWidgetPart _nested_build_dock_station_widgets[] = { NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_STATION_BUILD_DOCK_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), EndContainer(), NWidget(WWT_PANEL, COLOUR_DARK_GREEN, BDSW_BACKGROUND), - NWidget(WWT_LABEL, COLOUR_DARK_GREEN, BDSW_INFO), SetPadding(WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM, WD_FRAMERECT_LEFT), SetDataTip(STR_STATION_BUILD_COVERAGE_AREA_TITLE, STR_NULL), SetFill(1, 0), + NWidget(WWT_LABEL, COLOUR_DARK_GREEN, BDSW_INFO), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_STATION_BUILD_COVERAGE_AREA_TITLE, STR_NULL), SetFill(1, 0), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(14, 0, 14), NWidget(WWT_TEXTBTN, COLOUR_GREY, BDSW_LT_OFF), SetMinimalSize(60, 12), SetFill(1, 0), SetDataTip(STR_STATION_BUILD_COVERAGE_OFF, STR_STATION_BUILD_COVERAGE_AREA_OFF_TOOLTIP), NWidget(WWT_TEXTBTN, COLOUR_GREY, BDSW_LT_ON), SetMinimalSize(60, 12), SetFill(1, 0), SetDataTip(STR_STATION_BUILD_COVERAGE_ON, STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP), EndContainer(), - NWidget(WWT_EMPTY, COLOUR_GREY, BDSW_ACCEPTANCE), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), SetResize(0, 1), + NWidget(WWT_EMPTY, COLOUR_GREY, BDSW_ACCEPTANCE), SetPadding(WidgetDimensions::unscaled.framerect), SetResize(0, 1), EndContainer(), }; @@ -531,8 +531,8 @@ public: switch (widget) { case WID_BDD_X: case WID_BDD_Y: - size->width = ScaleGUITrad(96) + WD_BEVEL_LEFT + WD_BEVEL_RIGHT; - size->height = ScaleGUITrad(64) + WD_BEVEL_TOP + WD_BEVEL_BOTTOM; + size->width = ScaleGUITrad(96) + WidgetDimensions::scaled.fullbevel.Horizontal(); + size->height = ScaleGUITrad(64) + WidgetDimensions::scaled.fullbevel.Vertical(); break; } } diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 8455dfc1d2..35ba1d1582 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -98,7 +98,7 @@ struct EnginePreviewWindow : Window { size->width = std::max(size->width, x - x_offs); SetDParam(0, GetEngineCategoryName(engine)); - size->height = GetStringHeight(STR_ENGINE_PREVIEW_MESSAGE, size->width) + WD_PAR_VSEP_WIDE + FONT_HEIGHT_NORMAL + this->vehicle_space; + size->height = GetStringHeight(STR_ENGINE_PREVIEW_MESSAGE, size->width) + WidgetDimensions::scaled.vsep_wide + FONT_HEIGHT_NORMAL + this->vehicle_space; SetDParam(0, engine); size->height += GetStringHeight(GetEngineInfoString(engine), size->width); } @@ -109,7 +109,7 @@ struct EnginePreviewWindow : Window { EngineID engine = this->window_number; SetDParam(0, GetEngineCategoryName(engine)); - int y = DrawStringMultiLine(r, STR_ENGINE_PREVIEW_MESSAGE, TC_FROMSTRING, SA_HOR_CENTER | SA_TOP) + WD_PAR_VSEP_WIDE; + int y = DrawStringMultiLine(r, STR_ENGINE_PREVIEW_MESSAGE, TC_FROMSTRING, SA_HOR_CENTER | SA_TOP) + WidgetDimensions::scaled.vsep_wide; SetDParam(0, engine); DrawString(r.left, r.right, y, STR_ENGINE_NAME, TC_BLACK, SA_HOR_CENTER); diff --git a/src/error_gui.cpp b/src/error_gui.cpp index e65df1bca4..7d25638821 100644 --- a/src/error_gui.cpp +++ b/src/error_gui.cpp @@ -35,7 +35,7 @@ static const NWidgetPart _nested_errmsg_widgets[] = { NWidget(WWT_CAPTION, COLOUR_RED, WID_EM_CAPTION), SetDataTip(STR_ERROR_MESSAGE_CAPTION, STR_NULL), EndContainer(), NWidget(WWT_PANEL, COLOUR_RED), - NWidget(WWT_EMPTY, COLOUR_RED, WID_EM_MESSAGE), SetPadding(WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM, WD_FRAMETEXT_LEFT), SetFill(1, 0), SetMinimalSize(236, 0), + NWidget(WWT_EMPTY, COLOUR_RED, WID_EM_MESSAGE), SetPadding(WidgetDimensions::unscaled.frametext), SetFill(1, 0), SetMinimalSize(236, 0), EndContainer(), }; @@ -54,7 +54,7 @@ static const NWidgetPart _nested_errmsg_face_widgets[] = { NWidget(WWT_PANEL, COLOUR_RED), NWidget(NWID_HORIZONTAL), NWidget(WWT_EMPTY, COLOUR_RED, WID_EM_FACE), SetPadding(2, 0, 2, 2), SetFill(0, 1), SetMinimalSize(92, 119), - NWidget(WWT_EMPTY, COLOUR_RED, WID_EM_MESSAGE), SetPadding(WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM, WD_FRAMETEXT_LEFT), SetFill(1, 1), SetMinimalSize(236, 0), + NWidget(WWT_EMPTY, COLOUR_RED, WID_EM_MESSAGE), SetPadding(WidgetDimensions::unscaled.frametext), SetFill(1, 1), SetMinimalSize(236, 0), EndContainer(), EndContainer(), }; @@ -206,7 +206,7 @@ public: if (this->textref_stack_size > 0) StopTextRefStackUsage(); uint panel_height = this->height_summary; - if (this->detailed_msg != INVALID_STRING_ID) panel_height += this->height_detailed + WD_PAR_VSEP_WIDE; + if (this->detailed_msg != INVALID_STRING_ID) panel_height += this->height_detailed + WidgetDimensions::scaled.vsep_wide; size->height = std::max(size->height, panel_height); break; @@ -284,7 +284,7 @@ public: DrawStringMultiLine(r, this->summary_msg, TC_FROMSTRING, SA_CENTER); } else { /* Extra space when message is shorter than company face window */ - int extra = (r.Height() - this->height_summary - this->height_detailed - WD_PAR_VSEP_WIDE) / 2; + int extra = (r.Height() - this->height_summary - this->height_detailed - WidgetDimensions::scaled.vsep_wide) / 2; /* Note: NewGRF supplied error message often do not start with a colour code, so default to white. */ DrawStringMultiLine(r.WithHeight(this->height_summary + extra, false), this->summary_msg, TC_WHITE, SA_CENTER); diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index 28ac4a26c2..4d963e5ff3 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -83,8 +83,8 @@ static const NWidgetPart _nested_load_dialog_widgets[] = { NWidget(NWID_VERTICAL), /* Filter box with label */ NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1), SetResize(1, 1), - NWidget(NWID_HORIZONTAL), SetPadding(WD_FRAMERECT_TOP, 0, WD_FRAMERECT_BOTTOM, 0), - SetPIP(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_RIGHT, 0), + NWidget(NWID_HORIZONTAL), SetPadding(WidgetDimensions::unscaled.framerect.top, 0, WidgetDimensions::unscaled.framerect.bottom, 0), + SetPIP(WidgetDimensions::unscaled.frametext.left, WidgetDimensions::unscaled.frametext.right, 0), NWidget(WWT_TEXT, COLOUR_GREY), SetFill(0, 1), SetDataTip(STR_SAVELOAD_FILTER_TITLE , STR_NULL), NWidget(WWT_EDITBOX, COLOUR_GREY, WID_SL_FILTER), SetFill(1, 0), SetMinimalSize(50, 12), SetResize(1, 0), SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP), @@ -141,8 +141,8 @@ static const NWidgetPart _nested_load_heightmap_dialog_widgets[] = { /* Filter box with label */ NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1), SetResize(1, 1), - NWidget(NWID_HORIZONTAL), SetPadding(WD_FRAMERECT_TOP, 0, WD_FRAMERECT_BOTTOM, 0), - SetPIP(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_RIGHT, 0), + NWidget(NWID_HORIZONTAL), SetPadding(WidgetDimensions::unscaled.framerect.top, 0, WidgetDimensions::unscaled.framerect.bottom, 0), + SetPIP(WidgetDimensions::unscaled.frametext.left, WidgetDimensions::unscaled.frametext.right, 0), NWidget(WWT_TEXT, COLOUR_GREY), SetFill(0, 1), SetDataTip(STR_SAVELOAD_FILTER_TITLE , STR_NULL), NWidget(WWT_EDITBOX, COLOUR_GREY, WID_SL_FILTER), SetFill(1, 0), SetMinimalSize(50, 12), SetResize(1, 0), SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP), @@ -188,8 +188,8 @@ static const NWidgetPart _nested_save_dialog_widgets[] = { NWidget(NWID_VERTICAL), /* Filter box with label */ NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1), SetResize(1, 1), - NWidget(NWID_HORIZONTAL), SetPadding(WD_FRAMERECT_TOP, 0, WD_FRAMERECT_BOTTOM, 0), - SetPIP(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_RIGHT, 0), + NWidget(NWID_HORIZONTAL), SetPadding(WidgetDimensions::unscaled.framerect.top, 0, WidgetDimensions::unscaled.framerect.bottom, 0), + SetPIP(WidgetDimensions::unscaled.frametext.left, WidgetDimensions::unscaled.frametext.right, 0), NWidget(WWT_TEXT, COLOUR_GREY), SetFill(0, 1), SetDataTip(STR_SAVELOAD_FILTER_TITLE , STR_NULL), NWidget(WWT_EDITBOX, COLOUR_GREY, WID_SL_FILTER), SetFill(1, 0), SetMinimalSize(50, 12), SetResize(1, 0), SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP), @@ -223,10 +223,10 @@ static const NWidgetPart _nested_save_dialog_widgets[] = { EndContainer(), /* Right side : game details */ - NWidget(WWT_PANEL, COLOUR_GREY), - NWidget(WWT_EMPTY, INVALID_COLOUR, WID_SL_DETAILS), SetResize(1, 1), SetFill(1, 1), + NWidget(NWID_VERTICAL), + NWidget(WWT_PANEL, COLOUR_GREY, WID_SL_DETAILS), SetResize(1, 1), SetFill(1, 1), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(NWID_SPACER), SetResize(1, 0), SetFill(1, 1), + NWidget(WWT_PANEL, COLOUR_GREY), SetResize(1, 0), SetFill(1, 1), EndContainer(), NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), EndContainer(), @@ -437,7 +437,7 @@ public: _fios_path_changed = false; } - Rect ir = r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM); + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); if (str != STR_ERROR_UNABLE_TO_READ_DRIVE) SetDParam(0, tot); DrawString(ir.left, ir.right, ir.top + FONT_HEIGHT_NORMAL, str); @@ -446,10 +446,10 @@ public: } case WID_SL_DRIVES_DIRECTORIES_LIST: { - const Rect br = r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM); + const Rect br = r.Shrink(WidgetDimensions::scaled.bevel); GfxFillRect(br, PC_BLACK); - Rect tr = r.Shrink(WD_INSET_LEFT, WD_INSET_TOP, WD_INSET_RIGHT, 0).WithHeight(this->resize.step_height); + Rect tr = r.Shrink(WidgetDimensions::scaled.inset).WithHeight(this->resize.step_height); uint scroll_pos = this->vscroll->GetPosition(); for (uint row = 0; row < this->fios_items.size() && tr.top < br.bottom; row++) { if (!this->fios_items_shown[row]) { @@ -480,14 +480,14 @@ public: void DrawDetails(const Rect &r) const { /* Header panel */ - int HEADER_HEIGHT = FONT_HEIGHT_NORMAL + WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM; + int HEADER_HEIGHT = FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.frametext.Vertical(); - Rect hr = r.WithHeight(HEADER_HEIGHT).Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM); - Rect tr = r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM); + Rect hr = r.WithHeight(HEADER_HEIGHT).Shrink(WidgetDimensions::scaled.frametext); + Rect tr = r.Shrink(WidgetDimensions::scaled.frametext); tr.top += HEADER_HEIGHT; /* Create the nice grayish rectangle at the details top */ - GfxFillRect(r.WithHeight(HEADER_HEIGHT).Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, 0), PC_GREY); + GfxFillRect(r.WithHeight(HEADER_HEIGHT).Shrink(WidgetDimensions::scaled.bevel.left, WidgetDimensions::scaled.bevel.top, WidgetDimensions::scaled.bevel.right, 0), PC_GREY); DrawString(hr.left, hr.right, hr.top, STR_SAVELOAD_DETAIL_CAPTION, TC_FROMSTRING, SA_HOR_CENTER); if (this->selected == nullptr) return; @@ -520,7 +520,7 @@ public: tr.top += FONT_HEIGHT_NORMAL; } - tr.top += WD_PAR_VSEP_WIDE; + tr.top += WidgetDimensions::scaled.vsep_normal; if (tr.top > tr.bottom) return; /* Start date (if available) */ @@ -541,7 +541,7 @@ public: /* Hide the NewGRF stuff when saving. We also hide the button. */ if (this->fop == SLO_LOAD && (this->abstract_filetype == FT_SAVEGAME || this->abstract_filetype == FT_SCENARIO)) { - tr.top += WD_PAR_VSEP_NORMAL; + tr.top += WidgetDimensions::scaled.vsep_normal; if (tr.top > tr.bottom) return; /* NewGrf compatibility */ @@ -554,7 +554,7 @@ public: /* Hide the company stuff for scenarios */ if (this->abstract_filetype != FT_SCENARIO) { - tr.top += WD_PAR_VSEP_WIDE; + tr.top += WidgetDimensions::scaled.vsep_wide; if (tr.top > tr.bottom) return; /* Companies / AIs */ @@ -580,12 +580,12 @@ public: { switch (widget) { case WID_SL_BACKGROUND: - size->height = 2 * FONT_HEIGHT_NORMAL + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + size->height = 2 * FONT_HEIGHT_NORMAL + padding.height; break; case WID_SL_DRIVES_DIRECTORIES_LIST: resize->height = FONT_HEIGHT_NORMAL; - size->height = resize->height * 10 + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + size->height = resize->height * 10 + padding.height; break; case WID_SL_SORT_BYNAME: case WID_SL_SORT_BYDATE: { @@ -665,7 +665,7 @@ public: break; case WID_SL_DRIVES_DIRECTORIES_LIST: { // Click the listbox - int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SL_DRIVES_DIRECTORIES_LIST, WD_FRAMERECT_TOP); + int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SL_DRIVES_DIRECTORIES_LIST, WidgetDimensions::scaled.inset.top); if (y == INT_MAX) return; /* Get the corresponding non-filtered out item from the list */ @@ -745,7 +745,7 @@ public: void OnMouseOver(Point pt, int widget) override { if (widget == WID_SL_DRIVES_DIRECTORIES_LIST) { - int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SL_DRIVES_DIRECTORIES_LIST, WD_FRAMERECT_TOP); + int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SL_DRIVES_DIRECTORIES_LIST, WidgetDimensions::scaled.inset.top); if (y == INT_MAX) return; /* Get the corresponding non-filtered out item from the list */ diff --git a/src/framerate_gui.cpp b/src/framerate_gui.cpp index 6c9cc541ed..1a676933ee 100644 --- a/src/framerate_gui.cpp +++ b/src/framerate_gui.cpp @@ -380,7 +380,7 @@ static const NWidgetPart _framerate_window_widgets[] = { NWidget(WWT_STICKYBOX, COLOUR_GREY), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY), - NWidget(NWID_VERTICAL), SetPadding(6), SetPIP(0, 3, 0), + NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.frametext), SetPIP(0, WidgetDimensions::unscaled.vsep_normal, 0), NWidget(WWT_TEXT, COLOUR_GREY, WID_FRW_RATE_GAMELOOP), SetDataTip(STR_FRAMERATE_RATE_GAMELOOP, STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP), SetFill(1, 0), SetResize(1, 0), NWidget(WWT_TEXT, COLOUR_GREY, WID_FRW_RATE_DRAWING), SetDataTip(STR_FRAMERATE_RATE_BLITTER, STR_FRAMERATE_RATE_BLITTER_TOOLTIP), SetFill(1, 0), SetResize(1, 0), NWidget(WWT_TEXT, COLOUR_GREY, WID_FRW_RATE_FACTOR), SetDataTip(STR_FRAMERATE_SPEED_FACTOR, STR_FRAMERATE_SPEED_FACTOR_TOOLTIP), SetFill(1, 0), SetResize(1, 0), @@ -388,8 +388,8 @@ static const NWidgetPart _framerate_window_widgets[] = { EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_GREY), - NWidget(NWID_VERTICAL), SetPadding(6), SetPIP(0, 3, 0), - NWidget(NWID_HORIZONTAL), SetPIP(0, 8, 0), + NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.frametext), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), + NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_wide, 0), NWidget(WWT_EMPTY, COLOUR_GREY, WID_FRW_TIMES_NAMES), SetScrollbar(WID_FRW_SCROLLBAR), NWidget(WWT_EMPTY, COLOUR_GREY, WID_FRW_TIMES_CURRENT), SetScrollbar(WID_FRW_SCROLLBAR), NWidget(WWT_EMPTY, COLOUR_GREY, WID_FRW_TIMES_AVERAGE), SetScrollbar(WID_FRW_SCROLLBAR), @@ -447,7 +447,6 @@ struct FramerateWindow : Window { CachedDecimal times_shortterm[PFE_MAX]; ///< cached short term average times CachedDecimal times_longterm[PFE_MAX]; ///< cached long term average times - static constexpr int VSPACING = 3; ///< space between column heading and values static constexpr int MIN_ELEMENTS = 5; ///< smallest number of elements to display FramerateWindow(WindowDesc *desc, WindowNumber number) : Window(desc) @@ -567,7 +566,7 @@ struct FramerateWindow : Window { case WID_FRW_TIMES_NAMES: { size->width = 0; - size->height = FONT_HEIGHT_NORMAL + VSPACING + MIN_ELEMENTS * FONT_HEIGHT_NORMAL; + size->height = FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal + MIN_ELEMENTS * FONT_HEIGHT_NORMAL; resize->width = 0; resize->height = FONT_HEIGHT_NORMAL; for (PerformanceElement e : DISPLAY_ORDER_PFE) { @@ -593,7 +592,7 @@ struct FramerateWindow : Window { SetDParam(1, 2); Dimension item_size = GetStringBoundingBox(STR_FRAMERATE_MS_GOOD); size->width = std::max(size->width, item_size.width); - size->height += FONT_HEIGHT_NORMAL * MIN_ELEMENTS + VSPACING; + size->height += FONT_HEIGHT_NORMAL * MIN_ELEMENTS + WidgetDimensions::scaled.vsep_normal; resize->width = 0; resize->height = FONT_HEIGHT_NORMAL; break; @@ -609,7 +608,7 @@ struct FramerateWindow : Window { int drawable = this->num_displayed; int y = r.top; DrawString(r.left, r.right, y, heading_str, TC_FROMSTRING, SA_CENTER, true); - y += FONT_HEIGHT_NORMAL + VSPACING; + y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; for (PerformanceElement e : DISPLAY_ORDER_PFE) { if (_pf_data[e].num_valid == 0) continue; if (skip > 0) { @@ -631,7 +630,7 @@ struct FramerateWindow : Window { int drawable = this->num_displayed; int y = r.top; DrawString(r.left, r.right, y, STR_FRAMERATE_MEMORYUSE, TC_FROMSTRING, SA_CENTER, true); - y += FONT_HEIGHT_NORMAL + VSPACING; + y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; for (PerformanceElement e : DISPLAY_ORDER_PFE) { if (_pf_data[e].num_valid == 0) continue; if (skip > 0) { @@ -663,7 +662,7 @@ struct FramerateWindow : Window { const Scrollbar *sb = this->GetScrollbar(WID_FRW_SCROLLBAR); uint16 skip = sb->GetPosition(); int drawable = this->num_displayed; - int y = r.top + FONT_HEIGHT_NORMAL + VSPACING; // first line contains headings in the value columns + int y = r.top + FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; // first line contains headings in the value columns for (PerformanceElement e : DISPLAY_ORDER_PFE) { if (_pf_data[e].num_valid == 0) continue; if (skip > 0) { @@ -705,7 +704,7 @@ struct FramerateWindow : Window { case WID_FRW_TIMES_AVERAGE: { /* Open time graph windows when clicking detail measurement lines */ const Scrollbar *sb = this->GetScrollbar(WID_FRW_SCROLLBAR); - int line = sb->GetScrolledRowFromWidget(pt.y, this, widget, VSPACING + FONT_HEIGHT_NORMAL); + int line = sb->GetScrolledRowFromWidget(pt.y, this, widget, WidgetDimensions::scaled.vsep_normal + FONT_HEIGHT_NORMAL); if (line != INT_MAX) { line++; /* Find the visible line that was clicked */ @@ -725,7 +724,7 @@ struct FramerateWindow : Window { void OnResize() override { auto *wid = this->GetWidget(WID_FRW_TIMES_NAMES); - this->num_displayed = (wid->current_y - wid->min_y - VSPACING) / FONT_HEIGHT_NORMAL - 1; // subtract 1 for headings + this->num_displayed = (wid->current_y - wid->min_y - WidgetDimensions::scaled.vsep_normal) / FONT_HEIGHT_NORMAL - 1; // subtract 1 for headings this->GetScrollbar(WID_FRW_SCROLLBAR)->SetCapacity(this->num_displayed); } }; diff --git a/src/game/game_gui.cpp b/src/game/game_gui.cpp index 91cafc925a..d111ff192c 100644 --- a/src/game/game_gui.cpp +++ b/src/game/game_gui.cpp @@ -186,7 +186,7 @@ struct GSConfigWindow : public Window { } /* There is only one slot, unlike with the GS GUI, so it should never be white */ - DrawString(r.Shrink(WD_MATRIX_LEFT, WD_MATRIX_TOP, WD_MATRIX_RIGHT, WD_MATRIX_BOTTOM), text, (IsEditable() ? TC_ORANGE : TC_SILVER)); + DrawString(r.Shrink(WidgetDimensions::scaled.matrix), text, (IsEditable() ? TC_ORANGE : TC_SILVER)); break; } case WID_GSC_SETTINGS: { @@ -195,10 +195,10 @@ struct GSConfigWindow : public Window { int i = 0; for (; !this->vscroll->IsVisible(i); i++) it++; - Rect ir = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); bool rtl = _current_text_dir == TD_RTL; Rect br = ir.WithWidth(SETTING_BUTTON_WIDTH, rtl); - Rect tr = ir.Indent(SETTING_BUTTON_WIDTH + 8, rtl); + Rect tr = ir.Indent(SETTING_BUTTON_WIDTH + WidgetDimensions::scaled.hsep_wide, rtl); int y = r.top; int button_y_offset = (this->line_height - SETTING_BUTTON_HEIGHT) / 2; @@ -290,7 +290,7 @@ struct GSConfigWindow : public Window { break; case WID_GSC_SETTINGS: { - Rect r = this->GetWidget(widget)->GetCurrentRect().Shrink(WD_MATRIX_LEFT, 0, WD_MATRIX_RIGHT, 0); + Rect r = this->GetWidget(widget)->GetCurrentRect().Shrink(WidgetDimensions::scaled.matrix, RectPadding::zero); int num = (pt.y - r.top) / this->line_height + this->vscroll->GetPosition(); if (num >= (int)this->visible_settings.size()) break; diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 7b0f07f16b..bc35ede3ae 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -1405,8 +1405,8 @@ struct GenerateProgressWindow : public Window { SetDParamMaxValue(0, 100); *size = GetStringBoundingBox(STR_GENERATION_PROGRESS); /* We need some spacing for the 'border' */ - size->height += 8; - size->width += 8; + size->height += WidgetDimensions::scaled.frametext.Horizontal(); + size->width += WidgetDimensions::scaled.frametext.Vertical(); break; } @@ -1414,7 +1414,7 @@ struct GenerateProgressWindow : public Window { for (uint i = 0; i < GWP_CLASS_COUNT; i++) { size->width = std::max(size->width, GetStringBoundingBox(_generation_class_table[i]).width); } - size->height = FONT_HEIGHT_NORMAL * 2 + WD_PAR_VSEP_NORMAL; + size->height = FONT_HEIGHT_NORMAL * 2 + WidgetDimensions::scaled.vsep_normal; break; } } @@ -1425,7 +1425,7 @@ struct GenerateProgressWindow : public Window { case WID_GP_PROGRESS_BAR: { /* Draw the % complete with a bar and a text */ DrawFrameRect(r, COLOUR_GREY, FR_BORDERONLY); - Rect br = r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM); + Rect br = r.Shrink(WidgetDimensions::scaled.bevel); DrawFrameRect(br.WithWidth(br.Width() * _gws.percent / 100, false), COLOUR_MAUVE, FR_NONE); SetDParam(0, _gws.percent); DrawString(r.left, r.right, CenterBounds(r.top, r.bottom, FONT_HEIGHT_NORMAL), STR_GENERATION_PROGRESS, TC_FROMSTRING, SA_HOR_CENTER); @@ -1439,7 +1439,7 @@ struct GenerateProgressWindow : public Window { /* And say where we are in that class */ SetDParam(0, _gws.current); SetDParam(1, _gws.total); - DrawString(r.left, r.right, r.top + FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL, STR_GENERATION_PROGRESS_NUM, TC_FROMSTRING, SA_HOR_CENTER); + DrawString(r.left, r.right, r.top + FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal, STR_GENERATION_PROGRESS_NUM, TC_FROMSTRING, SA_HOR_CENTER); } } }; diff --git a/src/goal_gui.cpp b/src/goal_gui.cpp index b6663000b6..1d81131321 100644 --- a/src/goal_gui.cpp +++ b/src/goal_gui.cpp @@ -76,7 +76,7 @@ struct GoalListWindow : public Window { break; case WID_GOAL_LIST: { - int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_GOAL_LIST, WD_FRAMERECT_TOP); + int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_GOAL_LIST, WidgetDimensions::scaled.framerect.top); for (const Goal *s : Goal::Iterate()) { if (s->company == this->window_number) { if (y == 0) { @@ -174,11 +174,12 @@ struct GoalListWindow : public Window { if (widget != WID_GOAL_LIST) return; Dimension d = GetStringBoundingBox(STR_GOALS_NONE); + resize->width = 1; resize->height = d.height; d.height *= 5; - d.width += padding.width + WD_FRAMERECT_RIGHT + WD_FRAMERECT_LEFT; - d.height += padding.height + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + d.width += WidgetDimensions::scaled.framerect.Horizontal(); + d.height += WidgetDimensions::scaled.framerect.Vertical(); *size = maxdim(*size, d); } @@ -192,7 +193,7 @@ struct GoalListWindow : public Window { void DrawListColumn(GoalColumn column, NWidgetBase *wid, uint progress_col_width) const { /* Get column draw area. */ - Rect r = wid->GetCurrentRect().Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect r = wid->GetCurrentRect().Shrink(WidgetDimensions::scaled.framerect); bool rtl = _current_text_dir == TD_RTL; int pos = -this->vscroll->GetPosition(); @@ -206,7 +207,7 @@ struct GoalListWindow : public Window { case GC_GOAL: { /* Display the goal. */ SetDParamStr(0, s->text); - uint width_reduction = progress_col_width > 0 ? progress_col_width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT : 0; + uint width_reduction = progress_col_width > 0 ? progress_col_width + WidgetDimensions::scaled.framerect.Horizontal() : 0; DrawString(r.Indent(width_reduction, !rtl), STR_GOALS_TEXT); break; } @@ -261,7 +262,7 @@ struct GoalListWindow : public Window { void OnResize() override { - this->vscroll->SetCapacityFromWidget(this, WID_GOAL_LIST); + this->vscroll->SetCapacityFromWidget(this, WID_GOAL_LIST, WidgetDimensions::scaled.framerect.Vertical()); } /** @@ -285,8 +286,8 @@ static const NWidgetPart _nested_goals_list_widgets[] = { NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CAPTION, COLOUR_BROWN, WID_GOAL_CAPTION), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(NWID_SELECTION, INVALID_COLOUR, WID_GOAL_SELECT_BUTTONS), - NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_GOAL_GLOBAL_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GOALS_GLOBAL_BUTTON, STR_GOALS_GLOBAL_BUTTON_HELPTEXT), - NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_GOAL_COMPANY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GOALS_COMPANY_BUTTON, STR_GOALS_COMPANY_BUTTON_HELPTEXT), + NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_GOAL_GLOBAL_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WidgetDimensions::unscaled.captiontext.Vertical()), SetDataTip(STR_GOALS_GLOBAL_BUTTON, STR_GOALS_GLOBAL_BUTTON_HELPTEXT), + NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_GOAL_COMPANY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WidgetDimensions::unscaled.captiontext.Vertical()), SetDataTip(STR_GOALS_COMPANY_BUTTON, STR_GOALS_COMPANY_BUTTON_HELPTEXT), EndContainer(), NWidget(WWT_SHADEBOX, COLOUR_BROWN), NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN), @@ -399,7 +400,7 @@ struct GoalQuestionWindow : public Window { if (widget != WID_GQ_QUESTION) return; SetDParamStr(0, this->question); - size->height = GetStringHeight(STR_JUST_RAW_STRING, size->width) + WD_PAR_VSEP_WIDE; + size->height = GetStringHeight(STR_JUST_RAW_STRING, size->width) + WidgetDimensions::scaled.vsep_wide; } void DrawWidget(const Rect &r, int widget) const override diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 95be1d1fab..4bf6f069c8 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -65,11 +65,11 @@ struct GraphLegendWindow : Window { bool rtl = _current_text_dir == TD_RTL; - const Rect ir = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + const Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); Dimension d = GetSpriteSize(SPR_COMPANY_ICON); DrawCompanyIcon(cid, rtl ? ir.right - d.width : ir.left, CenterBounds(ir.top, ir.bottom, d.height)); - const Rect tr = ir.Indent(d.width + ScaleGUITrad(2), rtl); + const Rect tr = ir.Indent(d.width + WidgetDimensions::scaled.hsep_normal, rtl); SetDParam(0, cid); SetDParam(1, cid); DrawString(tr.left, tr.right, CenterBounds(tr.top, tr.bottom, FONT_HEIGHT_NORMAL), STR_COMPANY_NAME_COMPANY_NUM, HasBit(_legend_excluded_companies, cid) ? TC_BLACK : TC_WHITE); @@ -118,8 +118,8 @@ static NWidgetBase *MakeNWidgetCompanyLines(int *biggest_index) for (int widnum = WID_GL_FIRST_COMPANY; widnum <= WID_GL_LAST_COMPANY; widnum++) { NWidgetBackground *panel = new NWidgetBackground(WWT_PANEL, COLOUR_BROWN, widnum); - panel->SetMinimalSize(246, sprite_height + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM); - panel->SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM, FS_NORMAL); + panel->SetMinimalSize(246, sprite_height + WidgetDimensions::unscaled.framerect.Vertical()); + panel->SetMinimalTextLines(1, WidgetDimensions::unscaled.framerect.Vertical(), FS_NORMAL); panel->SetFill(1, 1); panel->SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP); vert->Add(panel); @@ -299,15 +299,15 @@ protected: /* Rect r will be adjusted to contain just the graph, with labels being * placed outside the area. */ - r.top += 5 + GetCharacterHeight(FS_SMALL) / 2; - r.bottom -= (this->month == 0xFF ? 1 : 2) * GetCharacterHeight(FS_SMALL) + 4; - r.left += 9; - r.right -= 5; + r.top += ScaleGUITrad(5) + GetCharacterHeight(FS_SMALL) / 2; + r.bottom -= (this->month == 0xFF ? 1 : 2) * GetCharacterHeight(FS_SMALL) + ScaleGUITrad(4); + r.left += ScaleGUITrad(9); + r.right -= ScaleGUITrad(5); /* Initial number of horizontal lines. */ - int num_hori_lines = 160 / MIN_GRID_PIXEL_SIZE; + int num_hori_lines = 160 / ScaleGUITrad(MIN_GRID_PIXEL_SIZE); /* For the rest of the height, the number of horizontal lines will increase more slowly. */ - int resize = (r.bottom - r.top - 160) / (2 * MIN_GRID_PIXEL_SIZE); + int resize = (r.bottom - r.top - 160) / (2 * ScaleGUITrad(MIN_GRID_PIXEL_SIZE)); if (resize > 0) num_hori_lines += resize; interval = GetValuesInterval(num_hori_lines); @@ -345,7 +345,7 @@ protected: y = r.bottom; for (int i = 0; i < (num_hori_lines + 1); i++) { - GfxFillRect(r.left - 3, y, r.left - 1, y, GRAPH_AXIS_LINE_COLOUR); + GfxFillRect(r.left - ScaleGUITrad(3), y, r.left - 1, y, GRAPH_AXIS_LINE_COLOUR); GfxFillRect(r.left, y, r.right, y, GRAPH_GRID_COLOUR); y -= y_sep; } @@ -372,7 +372,7 @@ protected: for (int i = 0; i < (num_hori_lines + 1); i++) { SetDParam(0, this->format_str_y_axis); SetDParam(1, y_label); - DrawString(r.left - label_width - 4, r.left - 4, y, STR_GRAPH_Y_LABEL, GRAPH_AXIS_LABEL_COLOUR, SA_RIGHT); + DrawString(r.left - label_width - ScaleGUITrad(4), r.left - ScaleGUITrad(4), y, STR_GRAPH_Y_LABEL, GRAPH_AXIS_LABEL_COLOUR, SA_RIGHT); y_label -= y_label_separation; y += y_sep; @@ -381,7 +381,7 @@ protected: /* Draw x-axis labels and markings for graphs based on financial quarters and years. */ if (this->month != 0xFF) { x = r.left; - y = r.bottom + 2; + y = r.bottom + ScaleGUITrad(2); byte month = this->month; Year year = this->year; for (int i = 0; i < this->num_on_x_axis; i++) { @@ -402,7 +402,7 @@ protected: } else { /* Draw x-axis labels for graphs not based on quarterly performance (cargo payment rates). */ x = r.left; - y = r.bottom + 2; + y = r.bottom + ScaleGUITrad(2); uint16 label = this->x_values_start; for (int i = 0; i < this->num_on_x_axis; i++) { @@ -522,8 +522,8 @@ public: SetDParam(1, INT64_MAX); uint y_label_width = GetStringBoundingBox(STR_GRAPH_Y_LABEL).width; - size->width = std::max(size->width, 5 + y_label_width + this->num_on_x_axis * (x_label_width + 5) + 9); - size->height = std::max(size->height, 5 + (1 + MIN_GRAPH_NUM_LINES_Y * 2 + (this->month != 0xFF ? 3 : 1)) * FONT_HEIGHT_SMALL + 4); + size->width = std::max(size->width, ScaleGUITrad(5) + y_label_width + this->num_on_x_axis * (x_label_width + ScaleGUITrad(5)) + ScaleGUITrad(9)); + size->height = std::max(size->height, ScaleGUITrad(5) + (1 + MIN_GRAPH_NUM_LINES_Y * 2 + (this->month != 0xFF ? 3 : 1)) * FONT_HEIGHT_SMALL + ScaleGUITrad(4)); size->height = std::max(size->height, size->width / 3); } @@ -636,7 +636,7 @@ static const NWidgetPart _nested_operating_profit_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_GRAPH_OPERATING_PROFIT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), - NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_CV_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP), + NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_CV_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WidgetDimensions::unscaled.framerect.Vertical() + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP), NWidget(WWT_SHADEBOX, COLOUR_BROWN), NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN), NWidget(WWT_STICKYBOX, COLOUR_BROWN), @@ -687,7 +687,7 @@ static const NWidgetPart _nested_income_graph_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_GRAPH_INCOME_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), - NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_CV_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP), + NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_CV_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WidgetDimensions::unscaled.framerect.Vertical() + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP), NWidget(WWT_SHADEBOX, COLOUR_BROWN), NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN), NWidget(WWT_STICKYBOX, COLOUR_BROWN), @@ -736,7 +736,7 @@ static const NWidgetPart _nested_delivered_cargo_graph_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_GRAPH_CARGO_DELIVERED_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), - NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_CV_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP), + NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_CV_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WidgetDimensions::unscaled.framerect.Vertical() + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP), NWidget(WWT_SHADEBOX, COLOUR_BROWN), NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN), NWidget(WWT_STICKYBOX, COLOUR_BROWN), @@ -791,8 +791,8 @@ static const NWidgetPart _nested_performance_history_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_GRAPH_COMPANY_PERFORMANCE_RATINGS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), - NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_PHG_DETAILED_PERFORMANCE), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_PERFORMANCE_DETAIL_KEY, STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP), - NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_PHG_KEY), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP), + NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_PHG_DETAILED_PERFORMANCE), SetMinimalSize(50, 0), SetMinimalTextLines(1, WidgetDimensions::unscaled.framerect.Vertical() + 2), SetDataTip(STR_PERFORMANCE_DETAIL_KEY, STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP), + NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_PHG_KEY), SetMinimalSize(50, 0), SetMinimalTextLines(1, WidgetDimensions::unscaled.framerect.Vertical() + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP), NWidget(WWT_SHADEBOX, COLOUR_BROWN), NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN), NWidget(WWT_STICKYBOX, COLOUR_BROWN), @@ -841,7 +841,7 @@ static const NWidgetPart _nested_company_value_graph_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_GRAPH_COMPANY_VALUES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), - NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_CV_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP), + NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_CV_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WidgetDimensions::unscaled.framerect.Vertical() + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP), NWidget(WWT_SHADEBOX, COLOUR_BROWN), NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN), NWidget(WWT_STICKYBOX, COLOUR_BROWN), @@ -924,9 +924,9 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { for (const CargoSpec *cs : _sorted_standard_cargo_specs) { SetDParam(0, cs->name); Dimension d = GetStringBoundingBox(STR_GRAPH_CARGO_PAYMENT_CARGO); - d.width += this->legend_width + 4; // colour field - d.width += WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; - d.height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + d.width += this->legend_width + WidgetDimensions::scaled.hsep_normal; // colour field + d.width += WidgetDimensions::scaled.framerect.Horizontal(); + d.height += WidgetDimensions::scaled.framerect.Vertical(); *size = maxdim(d, *size); } @@ -958,16 +958,16 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { /* Redraw frame if lowered */ if (lowered) DrawFrameRect(line, COLOUR_BROWN, FR_LOWERED); - const Rect text = line.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM).Translate(lowered ? 1 : 0, lowered ? 1 : 0); + const Rect text = line.Shrink(WidgetDimensions::scaled.framerect).Translate(lowered ? WidgetDimensions::scaled.pressed : 0, lowered ? WidgetDimensions::scaled.pressed : 0); /* Cargo-colour box with outline */ const Rect cargo = text.WithWidth(this->legend_width, rtl); GfxFillRect(cargo, PC_BLACK); - GfxFillRect(cargo.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), cs->legend_colour); + GfxFillRect(cargo.Shrink(WidgetDimensions::scaled.bevel), cs->legend_colour); /* Cargo name */ SetDParam(0, cs->name); - DrawString(text.Indent(this->legend_width + 4, rtl), STR_GRAPH_CARGO_PAYMENT_CARGO); + DrawString(text.Indent(this->legend_width + WidgetDimensions::scaled.hsep_normal, rtl), STR_GRAPH_CARGO_PAYMENT_CARGO); line = line.Translate(0, this->line_height); } @@ -1079,7 +1079,7 @@ static const NWidgetPart _nested_cargo_payment_rates_widgets[] = { NWidget(NWID_SPACER), SetMinimalSize(5, 0), SetFill(0, 1), SetResize(0, 1), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(NWID_SPACER), SetMinimalSize(WD_RESIZEBOX_WIDTH, 0), SetFill(1, 0), SetResize(1, 0), + NWidget(NWID_SPACER), SetMinimalSize(12, 0), SetFill(1, 0), SetResize(1, 0), NWidget(WWT_TEXT, COLOUR_BROWN, WID_CPR_FOOTER), SetMinimalSize(0, 6), SetPadding(2, 0, 2, 0), SetDataTip(STR_GRAPH_CARGO_PAYMENT_RATES_X_LABEL, STR_NULL), NWidget(NWID_SPACER), SetFill(1, 0), SetResize(1, 0), NWidget(WWT_RESIZEBOX, COLOUR_BROWN, WID_CPR_RESIZE), @@ -1179,7 +1179,7 @@ public: { if (widget != WID_CL_BACKGROUND) return; - Rect ir = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); int icon_y_offset = (this->line_height - this->icon.height) / 2; int text_y_offset = (this->line_height - FONT_HEIGHT_NORMAL) / 2; @@ -1210,7 +1210,7 @@ public: for (uint i = 0; i < MAX_COMPANIES; i++) { this->ordinal_width = std::max(this->ordinal_width, GetStringBoundingBox(STR_ORDINAL_NUMBER_1ST + i).width); } - this->ordinal_width += 5; // Keep some extra spacing + this->ordinal_width += WidgetDimensions::scaled.hsep_wide; // Keep some extra spacing uint widest_width = 0; uint widest_title = 0; @@ -1223,7 +1223,7 @@ public: } this->icon = GetSpriteSize(SPR_COMPANY_ICON); - this->line_height = std::max(this->icon.height + 2, FONT_HEIGHT_NORMAL); + this->line_height = std::max(this->icon.height + WidgetDimensions::scaled.vsep_normal, FONT_HEIGHT_NORMAL); for (const Company *c : Company::Iterate()) { SetDParam(0, c->index); @@ -1232,10 +1232,10 @@ public: widest_width = std::max(widest_width, GetStringBoundingBox(STR_COMPANY_LEAGUE_COMPANY_NAME).width); } - this->text_width = widest_width + 30; // Keep some extra spacing + this->text_width = widest_width + WidgetDimensions::scaled.hsep_indent * 3; // Keep some extra spacing - size->width = WD_FRAMERECT_LEFT + this->ordinal_width + WD_FRAMERECT_RIGHT + this->icon.width + WD_FRAMERECT_LEFT + this->text_width + WD_FRAMERECT_RIGHT; - size->height = WD_FRAMERECT_TOP + this->line_height * MAX_COMPANIES + WD_FRAMERECT_BOTTOM; + size->width = WidgetDimensions::scaled.framerect.Horizontal() + this->ordinal_width + this->icon.width + this->text_width + WidgetDimensions::scaled.framerect.Horizontal(); + size->height = this->line_height * MAX_COMPANIES + WidgetDimensions::scaled.framerect.Vertical(); } @@ -1269,7 +1269,7 @@ static const NWidgetPart _nested_company_league_widgets[] = { NWidget(WWT_SHADEBOX, COLOUR_BROWN), NWidget(WWT_STICKYBOX, COLOUR_BROWN), EndContainer(), - NWidget(WWT_PANEL, COLOUR_BROWN, WID_CL_BACKGROUND), SetMinimalSize(400, 0), SetMinimalTextLines(15, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM), + NWidget(WWT_PANEL, COLOUR_BROWN, WID_CL_BACKGROUND), SetMinimalSize(400, 0), SetMinimalTextLines(15, WidgetDimensions::unscaled.framerect.Vertical()), }; static WindowDesc _company_league_desc( @@ -1324,18 +1324,18 @@ struct PerformanceRatingDetailWindow : Window { { switch (widget) { case WID_PRD_SCORE_FIRST: - this->bar_height = FONT_HEIGHT_NORMAL + 4; - size->height = this->bar_height + 2 * WD_MATRIX_TOP; + this->bar_height = FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.fullbevel.Vertical(); + size->height = this->bar_height + WidgetDimensions::scaled.matrix.Vertical(); uint score_info_width = 0; for (uint i = SCORE_BEGIN; i < SCORE_END; i++) { score_info_width = std::max(score_info_width, GetStringBoundingBox(STR_PERFORMANCE_DETAIL_VEHICLES + i).width); } SetDParamMaxValue(0, 1000); - score_info_width += GetStringBoundingBox(STR_BLACK_COMMA).width + WD_FRAMERECT_LEFT; + score_info_width += GetStringBoundingBox(STR_BLACK_COMMA).width + WidgetDimensions::scaled.hsep_wide; SetDParamMaxValue(0, 100); - this->bar_width = GetStringBoundingBox(STR_PERFORMANCE_DETAIL_PERCENT).width + 20; // Wide bars! + this->bar_width = GetStringBoundingBox(STR_PERFORMANCE_DETAIL_PERCENT).width + WidgetDimensions::scaled.hsep_indent * 2; // Wide bars! /* At this number we are roughly at the max; it can become wider, * but then you need at 1000 times more money. At that time you're @@ -1361,9 +1361,9 @@ struct PerformanceRatingDetailWindow : Window { SetDParam(1, max); uint score_detail_width = GetStringBoundingBox(STR_PERFORMANCE_DETAIL_AMOUNT_CURRENCY).width; - size->width = 7 + score_info_width + 5 + this->bar_width + 5 + score_detail_width + 7; - uint left = 7; - uint right = size->width - 7; + size->width = WidgetDimensions::scaled.frametext.Horizontal() + score_info_width + WidgetDimensions::scaled.hsep_wide + this->bar_width + WidgetDimensions::scaled.hsep_wide + score_detail_width; + uint left = WidgetDimensions::scaled.frametext.left; + uint right = size->width - WidgetDimensions::scaled.frametext.right; bool rtl = _current_text_dir == TD_RTL; this->score_info_left = rtl ? right - score_info_width : left; @@ -1372,8 +1372,8 @@ struct PerformanceRatingDetailWindow : Window { this->score_detail_left = rtl ? left : right - score_detail_width; this->score_detail_right = rtl ? left + score_detail_width : right; - this->bar_left = left + (rtl ? score_detail_width : score_info_width) + 5; - this->bar_right = this->bar_left + this->bar_width; + this->bar_left = left + (rtl ? score_detail_width : score_info_width) + WidgetDimensions::scaled.hsep_wide; + this->bar_right = this->bar_left + this->bar_width - 1; break; } } @@ -1386,7 +1386,7 @@ struct PerformanceRatingDetailWindow : Window { if (IsInsideMM(widget, WID_PRD_COMPANY_FIRST, WID_PRD_COMPANY_LAST + 1)) { if (this->IsWidgetDisabled(widget)) return; CompanyID cid = (CompanyID)(widget - WID_PRD_COMPANY_FIRST); - int offset = (cid == this->company) ? 1 : 0; + int offset = (cid == this->company) ? WidgetDimensions::scaled.pressed : 0; Dimension sprite_size = GetSpriteSize(SPR_COMPANY_ICON); DrawCompanyIcon(cid, CenterBounds(r.left, r.right, sprite_size.width) + offset, CenterBounds(r.top, r.bottom, sprite_size.height) + offset); return; @@ -1411,8 +1411,8 @@ struct PerformanceRatingDetailWindow : Window { needed = SCORE_MAX; } - uint bar_top = r.top + WD_MATRIX_TOP; - uint text_top = bar_top + 2; + uint bar_top = CenterBounds(r.top, r.bottom, this->bar_height); + uint text_top = CenterBounds(r.top, r.bottom, FONT_HEIGHT_NORMAL); DrawString(this->score_info_left, this->score_info_right, text_top, STR_PERFORMANCE_DETAIL_VEHICLES + score_type); @@ -1430,8 +1430,8 @@ struct PerformanceRatingDetailWindow : Window { } /* Draw the bar */ - if (x != this->bar_left) GfxFillRect(this->bar_left, bar_top, x, bar_top + this->bar_height, rtl ? colour_notdone : colour_done); - if (x != this->bar_right) GfxFillRect(x, bar_top, this->bar_right, bar_top + this->bar_height, rtl ? colour_done : colour_notdone); + if (x != this->bar_left) GfxFillRect(this->bar_left, bar_top, x, bar_top + this->bar_height - 1, rtl ? colour_notdone : colour_done); + if (x != this->bar_right) GfxFillRect(x, bar_top, this->bar_right, bar_top + this->bar_height - 1, rtl ? colour_done : colour_notdone); /* Draw it */ SetDParam(0, Clamp(val, 0, needed) * 100 / needed); @@ -1562,7 +1562,7 @@ static const NWidgetPart _nested_performance_rating_detail_widgets[] = { NWidget(WWT_STICKYBOX, COLOUR_BROWN), EndContainer(), NWidget(WWT_PANEL, COLOUR_BROWN), - NWidgetFunction(MakeCompanyButtonRowsGraphGUI), SetPadding(0, 1, 1, 2), + NWidgetFunction(MakeCompanyButtonRowsGraphGUI), SetPadding(2), EndContainer(), NWidgetFunction(MakePerformanceDetailPanels), }; diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 9aa767b440..a597b1e356 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -34,8 +34,6 @@ #include "safeguards.h" -static const int LEVEL_WIDTH = 10; ///< Indenting width of a sub-group in pixels - typedef GUIList GUIGroupList; static const NWidgetPart _nested_group_widgets[] = { @@ -56,7 +54,7 @@ static const NWidgetPart _nested_group_widgets[] = { SetFill(1, 0), SetResize(0, 1), SetScrollbar(WID_GL_LIST_GROUP_SCROLLBAR), NWidget(NWID_VSCROLLBAR, COLOUR_GREY, WID_GL_LIST_GROUP_SCROLLBAR), EndContainer(), - NWidget(WWT_PANEL, COLOUR_GREY, WID_GL_INFO), SetFill(1, 1), SetMinimalTextLines(3, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM), EndContainer(), + NWidget(WWT_PANEL, COLOUR_GREY, WID_GL_INFO), SetFill(1, 1), SetMinimalTextLines(3, WidgetDimensions::unscaled.framerect.Vertical()), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_GL_CREATE_GROUP), SetDataTip(SPR_GROUP_CREATE_TRAIN, STR_GROUP_CREATE_TOOLTIP), @@ -207,7 +205,7 @@ private: this->tiny_step_height = this->column_size[VGC_FOLD].height; this->column_size[VGC_NAME] = maxdim(GetStringBoundingBox(STR_GROUP_DEFAULT_TRAINS + this->vli.vtype), GetStringBoundingBox(STR_GROUP_ALL_TRAINS + this->vli.vtype)); - this->column_size[VGC_NAME].width = std::max(170u, this->column_size[VGC_NAME].width); + this->column_size[VGC_NAME].width = std::max(170u, this->column_size[VGC_NAME].width) + WidgetDimensions::scaled.hsep_indent; this->tiny_step_height = std::max(this->tiny_step_height, this->column_size[VGC_NAME].height); this->column_size[VGC_PROTECT] = GetSpriteSize(SPR_GROUP_REPLACE_PROTECT); @@ -231,16 +229,16 @@ private: this->column_size[VGC_NUMBER] = GetStringBoundingBox(STR_GROUP_COUNT_WITH_SUBGROUP); this->tiny_step_height = std::max(this->tiny_step_height, this->column_size[VGC_NUMBER].height); - this->tiny_step_height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + this->tiny_step_height += WidgetDimensions::scaled.framerect.Vertical(); - return WD_FRAMERECT_LEFT + 8 + - this->column_size[VGC_FOLD].width + 2 + - this->column_size[VGC_NAME].width + 8 + - this->column_size[VGC_PROTECT].width + 2 + - this->column_size[VGC_AUTOREPLACE].width + 2 + - this->column_size[VGC_PROFIT].width + 2 + - this->column_size[VGC_NUMBER].width + 2 + - WD_FRAMERECT_RIGHT; + return WidgetDimensions::scaled.framerect.left + + this->column_size[VGC_FOLD].width + WidgetDimensions::scaled.hsep_normal + + this->column_size[VGC_NAME].width + WidgetDimensions::scaled.hsep_wide + + this->column_size[VGC_PROTECT].width + WidgetDimensions::scaled.hsep_normal + + this->column_size[VGC_AUTOREPLACE].width + WidgetDimensions::scaled.hsep_normal + + this->column_size[VGC_PROFIT].width + WidgetDimensions::scaled.hsep_normal + + this->column_size[VGC_NUMBER].width + + WidgetDimensions::scaled.framerect.right; } /** @@ -257,7 +255,7 @@ private: { /* Highlight the group if a vehicle is dragged over it */ if (g_id == this->group_over) { - GfxFillRect(left + WD_FRAMERECT_LEFT, y + WD_FRAMERECT_TOP + 1, right - WD_FRAMERECT_RIGHT, y + this->tiny_step_height - WD_FRAMERECT_BOTTOM - 1, _colour_gradient[COLOUR_GREY][7]); + GfxFillRect(left + WidgetDimensions::scaled.bevel.left, y + WidgetDimensions::scaled.framerect.top, right - WidgetDimensions::scaled.bevel.right, y + this->tiny_step_height - 1 - WidgetDimensions::scaled.framerect.bottom, _colour_gradient[COLOUR_GREY][7]); } if (g_id == NEW_GROUP) return; @@ -268,7 +266,7 @@ private: bool rtl = _current_text_dir == TD_RTL; /* draw fold / unfold button */ - int x = rtl ? right - WD_FRAMERECT_RIGHT - 8 - this->column_size[VGC_FOLD].width + 1 : left + WD_FRAMERECT_LEFT + 8; + int x = rtl ? right - WidgetDimensions::scaled.framerect.right - this->column_size[VGC_FOLD].width + 1 : left + WidgetDimensions::scaled.framerect.left; if (has_children) { DrawSprite(Group::Get(g_id)->folded ? SPR_CIRCLE_FOLDED : SPR_CIRCLE_UNFOLDED, PAL_NONE, rtl ? x - indent : x + indent, y + (this->tiny_step_height - this->column_size[VGC_FOLD].height) / 2); } @@ -283,19 +281,19 @@ private: SetDParam(0, g_id); str = STR_GROUP_NAME; } - x = rtl ? x - 2 - this->column_size[VGC_NAME].width : x + 2 + this->column_size[VGC_FOLD].width; + x = rtl ? x - WidgetDimensions::scaled.hsep_normal - this->column_size[VGC_NAME].width : x + WidgetDimensions::scaled.hsep_normal + this->column_size[VGC_FOLD].width; DrawString(x + (rtl ? 0 : indent), x + this->column_size[VGC_NAME].width - 1 - (rtl ? indent : 0), y + (this->tiny_step_height - this->column_size[VGC_NAME].height) / 2, str, colour); /* draw autoreplace protection */ - x = rtl ? x - 8 - this->column_size[VGC_PROTECT].width : x + 8 + this->column_size[VGC_NAME].width; + x = rtl ? x - WidgetDimensions::scaled.hsep_wide - this->column_size[VGC_PROTECT].width : x + WidgetDimensions::scaled.hsep_wide + this->column_size[VGC_NAME].width; if (protection) DrawSprite(SPR_GROUP_REPLACE_PROTECT, PAL_NONE, x, y + (this->tiny_step_height - this->column_size[VGC_PROTECT].height) / 2); /* draw autoreplace status */ - x = rtl ? x - 2 - this->column_size[VGC_AUTOREPLACE].width : x + 2 + this->column_size[VGC_PROTECT].width; + x = rtl ? x - WidgetDimensions::scaled.hsep_normal - this->column_size[VGC_AUTOREPLACE].width : x + WidgetDimensions::scaled.hsep_normal + this->column_size[VGC_PROTECT].width; if (stats.autoreplace_defined) DrawSprite(SPR_GROUP_REPLACE_ACTIVE, stats.autoreplace_finished ? PALETTE_CRASH : PAL_NONE, x, y + (this->tiny_step_height - this->column_size[VGC_AUTOREPLACE].height) / 2); /* draw the profit icon */ - x = rtl ? x - 2 - this->column_size[VGC_PROFIT].width : x + 2 + this->column_size[VGC_AUTOREPLACE].width; + x = rtl ? x - WidgetDimensions::scaled.hsep_normal - this->column_size[VGC_PROFIT].width : x + WidgetDimensions::scaled.hsep_normal + this->column_size[VGC_AUTOREPLACE].width; SpriteID spr; uint num_profit_vehicle = GetGroupNumProfitVehicle(this->vli.company, g_id, this->vli.vtype); Money profit_last_year = GetGroupProfitLastYear(this->vli.company, g_id, this->vli.vtype); @@ -311,7 +309,7 @@ private: DrawSprite(spr, PAL_NONE, x, y + (this->tiny_step_height - this->column_size[VGC_PROFIT].height) / 2); /* draw the number of vehicles of the group */ - x = rtl ? x - 2 - this->column_size[VGC_NUMBER].width : x + 2 + this->column_size[VGC_PROFIT].width; + x = rtl ? x - WidgetDimensions::scaled.hsep_normal - this->column_size[VGC_NUMBER].width : x + WidgetDimensions::scaled.hsep_normal + this->column_size[VGC_PROFIT].width; int num_vehicle_with_subgroups = GetGroupNumVehicle(this->vli.company, g_id, this->vli.vtype); int num_vehicle = GroupStatistics::Get(this->vli.company, g_id, this->vli.vtype).num_vehicle; if (IsAllGroupID(g_id) || IsDefaultGroupID(g_id) || num_vehicle_with_subgroups == num_vehicle) { @@ -563,7 +561,7 @@ public: occupancy += v->trip_occupancy; } - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); DrawString(tr, STR_GROUP_PROFIT_THIS_YEAR, TC_BLACK); SetDParam(0, this_year); @@ -593,7 +591,7 @@ public: assert(g->owner == this->owner); - DrawGroupInfo(y1, r.left, r.right, g->index, this->indents[i] * LEVEL_WIDTH, HasBit(g->flags, GroupFlags::GF_REPLACE_PROTECTION), g->folded || (i + 1 < (int)this->groups.size() && indents[i + 1] > this->indents[i])); + DrawGroupInfo(y1, r.left, r.right, g->index, this->indents[i] * WidgetDimensions::scaled.hsep_indent, HasBit(g->flags, GroupFlags::GF_REPLACE_PROTECTION), g->folded || (i + 1 < (int)this->groups.size() && indents[i + 1] > this->indents[i])); y1 += this->tiny_step_height; } @@ -615,7 +613,7 @@ public: for (uint i = this->vscroll->GetPosition(); i < max; ++i) { const Vehicle *v = this->vehgroups[i].GetSingleVehicle(); if (v->group_id != this->vli.index) { - GfxFillRect(mr.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), _colour_gradient[COLOUR_GREY][3], FILLRECT_CHECKER); + GfxFillRect(mr.Shrink(WidgetDimensions::scaled.bevel), _colour_gradient[COLOUR_GREY][3], FILLRECT_CHECKER); } mr = mr.Translate(0, this->resize.step_height); } @@ -679,8 +677,8 @@ public: /* The group has children, check if the user clicked the fold / unfold button. */ NWidgetCore *group_display = this->GetWidget(widget); int x = _current_text_dir == TD_RTL ? - group_display->pos_x + group_display->current_x - WD_FRAMERECT_RIGHT - 8 - this->indents[id_g] * LEVEL_WIDTH - this->column_size[VGC_FOLD].width : - group_display->pos_x + WD_FRAMERECT_LEFT + 8 + this->indents[id_g] * LEVEL_WIDTH; + group_display->pos_x + group_display->current_x - WidgetDimensions::scaled.framerect.right - this->indents[id_g] * WidgetDimensions::scaled.hsep_indent - this->column_size[VGC_FOLD].width : + group_display->pos_x + WidgetDimensions::scaled.framerect.left + this->indents[id_g] * WidgetDimensions::scaled.hsep_indent; if (click_count > 1 || (pt.x >= x && pt.x < (int)(x + this->column_size[VGC_FOLD].width))) { GroupID g = this->vli.index; diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 337776c3ad..17a9992075 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -423,7 +423,7 @@ public: d = maxdim(d, GetStringBoundingBox(GetIndustrySpec(this->index[i])->name)); } resize->height = std::max(this->legend.height, FONT_HEIGHT_NORMAL) + padding.height; - d.width += this->legend.width + ScaleFontTrad(7) + padding.width; + d.width += this->legend.width + WidgetDimensions::scaled.hsep_wide + padding.width; d.height = 5 * resize->height; *size = maxdim(*size, d); break; @@ -514,15 +514,14 @@ public: switch (widget) { case WID_DPI_MATRIX_WIDGET: { bool rtl = _current_text_dir == TD_RTL; - Rect text = r.WithHeight(this->resize.step_height).Shrink(WD_MATRIX_LEFT, WD_MATRIX_TOP, WD_MATRIX_RIGHT, WD_MATRIX_BOTTOM); + Rect text = r.WithHeight(this->resize.step_height).Shrink(WidgetDimensions::scaled.matrix); Rect icon = text.WithWidth(this->legend.width, rtl); - text = text.Indent(this->legend.width + ScaleFontTrad(7), rtl); + text = text.Indent(this->legend.width + WidgetDimensions::scaled.hsep_wide, rtl); /* Vertical offset for legend icon. */ icon.top = r.top + (this->resize.step_height - this->legend.height + 1) / 2; icon.bottom = icon.top + this->legend.height - 1; - int y = r.top; for (uint16 i = 0; i < this->vscroll->GetCapacity() && i + this->vscroll->GetPosition() < this->count; i++) { bool selected = this->selected_index == i + this->vscroll->GetPosition(); @@ -534,7 +533,7 @@ public: /* Draw the name of the industry in white is selected, otherwise, in orange */ DrawString(text, indsp->name, selected ? TC_WHITE : TC_ORANGE); GfxFillRect(icon, selected ? PC_WHITE : PC_BLACK); - GfxFillRect(icon.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), indsp->map_colour); + GfxFillRect(icon.Shrink(WidgetDimensions::scaled.bevel), indsp->map_colour); } text = text.Translate(0, this->resize.step_height); @@ -544,7 +543,7 @@ public: } case WID_DPI_INFOPANEL: { - Rect ir = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); if (this->selected_type == INVALID_INDUSTRYTYPE) { DrawStringMultiLine(ir, STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES_TOOLTIP); @@ -822,7 +821,7 @@ public: this->editbox_line = IL_NONE; this->clicked_line = IL_NONE; this->clicked_button = 0; - this->info_height = WD_FRAMERECT_TOP + 2 * FONT_HEIGHT_NORMAL + WD_FRAMERECT_BOTTOM + 1; // Info panel has at least two lines text. + this->info_height = WidgetDimensions::scaled.framerect.Vertical() + 2 * FONT_HEIGHT_NORMAL; // Info panel has at least two lines text. this->InitNested(window_number); NWidgetViewport *nvp = this->GetWidget(WID_IV_VIEWPORT); @@ -848,16 +847,14 @@ public: /** * Draw the text in the #WID_IV_INFO panel. - * @param left Left edge of the panel. - * @param right Right edge of the panel. - * @param top Top edge of the panel. + * @param r Rectangle of the panel. * @return Expected position of the bottom edge of the panel. */ int DrawInfo(const Rect &r) { Industry *i = Industry::Get(this->window_number); const IndustrySpec *ind = GetIndustrySpec(i->type); - Rect ir = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); bool first = true; bool has_accept = false; @@ -901,7 +898,7 @@ public: default: NOT_REACHED(); } - DrawString(ir.Indent(10, _current_text_dir == TD_RTL), str); + DrawString(ir.Indent(WidgetDimensions::scaled.hsep_indent, _current_text_dir == TD_RTL), str); ir.top += FONT_HEIGHT_NORMAL; } @@ -910,7 +907,7 @@ public: for (byte j = 0; j < lengthof(i->produced_cargo); j++) { if (i->produced_cargo[j] == CT_INVALID) continue; if (first) { - if (has_accept) ir.top += WD_PAR_VSEP_WIDE; + if (has_accept) ir.top += WidgetDimensions::scaled.vsep_wide; DrawString(ir, STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE); ir.top += FONT_HEIGHT_NORMAL; if (this->editable == EA_RATE) this->production_offset_y = ir.top; @@ -921,7 +918,7 @@ public: SetDParam(1, i->last_month_production[j]); SetDParamStr(2, cargo_suffix[j].text); SetDParam(3, ToPercent8(i->last_month_pct_transported[j])); - DrawString(ir.Indent(this->editable == EA_RATE ? SETTING_BUTTON_WIDTH + 10 : 0, false), STR_INDUSTRY_VIEW_TRANSPORTED); + DrawString(ir.Indent(this->editable == EA_RATE ? SETTING_BUTTON_WIDTH + WidgetDimensions::scaled.hsep_indent : 0, false), STR_INDUSTRY_VIEW_TRANSPORTED); /* Let's put out those buttons.. */ if (this->editable == EA_RATE) { DrawArrowButtons(ir.left, ir.top, COLOUR_YELLOW, (this->clicked_line == IL_RATE1 + j) ? this->clicked_button : 0, @@ -932,10 +929,10 @@ public: /* Display production multiplier if editable */ if (this->editable == EA_MULTIPLIER) { - ir.top += WD_PAR_VSEP_WIDE; + ir.top += WidgetDimensions::scaled.vsep_wide; this->production_offset_y = ir.top; SetDParam(0, RoundDivSU(i->prod_level * 100, PRODLEVEL_DEFAULT)); - DrawString(ir.Indent(SETTING_BUTTON_WIDTH + 10, false), STR_INDUSTRY_VIEW_PRODUCTION_LEVEL); + DrawString(ir.Indent(SETTING_BUTTON_WIDTH + WidgetDimensions::scaled.hsep_indent, false), STR_INDUSTRY_VIEW_PRODUCTION_LEVEL); DrawArrowButtons(ir.left, ir.top, COLOUR_YELLOW, (this->clicked_line == IL_MULTIPLIER) ? this->clicked_button : 0, i->prod_level > PRODLEVEL_MINIMUM, i->prod_level < PRODLEVEL_MAXIMUM); ir.top += FONT_HEIGHT_NORMAL; @@ -950,7 +947,7 @@ public: } else { StringID message = GetGRFStringID(ind->grf_prop.grffile->grfid, 0xD000 + callback_res); if (message != STR_NULL && message != STR_UNDEFINED) { - ir.top += WD_PAR_VSEP_WIDE; + ir.top += WidgetDimensions::scaled.vsep_wide; StartTextRefStackUsage(ind->grf_prop.grffile, 6); /* Use all the available space left from where we stand up to the @@ -965,11 +962,12 @@ public: if (!i->text.empty()) { SetDParamStr(0, i->text); - ir.top += WD_PAR_VSEP_WIDE; + ir.top += WidgetDimensions::scaled.vsep_wide; ir.top = DrawStringMultiLine(ir.left, ir.right, ir.top, UINT16_MAX, STR_JUST_RAW_STRING, TC_BLACK); } - return ir.top - 1 + WD_FRAMERECT_BOTTOM; + /* Return required bottom position, the last pixel row plus some padding. */ + return ir.top - 1 + WidgetDimensions::scaled.framerect.bottom; } void SetStringParameters(int widget) const override @@ -1013,8 +1011,8 @@ public: if (line == IL_NONE) return; NWidgetBase *nwi = this->GetWidget(widget); - int left = nwi->pos_x + WD_FRAMETEXT_LEFT; - int right = nwi->pos_x + nwi->current_x - 1 - WD_FRAMERECT_RIGHT; + int left = nwi->pos_x + WidgetDimensions::scaled.framerect.left; + int right = nwi->pos_x + nwi->current_x - 1 - WidgetDimensions::scaled.framerect.right; if (IsInsideMM(pt.x, left, left + SETTING_BUTTON_WIDTH)) { /* Clicked buttons, decrease or increase production */ byte button = (pt.x < left + SETTING_BUTTON_WIDTH / 2) ? 1 : 2; @@ -1049,7 +1047,7 @@ public: this->SetTimeout(); this->clicked_line = line; this->clicked_button = button; - } else if (IsInsideMM(pt.x, left + SETTING_BUTTON_WIDTH + 10, right)) { + } else if (IsInsideMM(pt.x, left + SETTING_BUTTON_WIDTH + WidgetDimensions::scaled.hsep_indent, right)) { /* clicked the text */ this->editbox_line = line; switch (this->editable) { @@ -1181,7 +1179,7 @@ static const NWidgetPart _nested_industry_view_widgets[] = { NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_IV_VIEWPORT), SetMinimalSize(254, 86), SetFill(1, 0), SetResize(1, 1), EndContainer(), EndContainer(), - NWidget(WWT_PANEL, COLOUR_CREAM, WID_IV_INFO), SetMinimalSize(260, 2), SetResize(1, 0), + NWidget(WWT_PANEL, COLOUR_CREAM, WID_IV_INFO), SetMinimalSize(260, 0), SetMinimalTextLines(2, WidgetDimensions::unscaled.framerect.Vertical()), SetResize(1, 0), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PUSHTXTBTN, COLOUR_CREAM, WID_IV_DISPLAY), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_INDUSTRY_DISPLAY_CHAIN, STR_INDUSTRY_DISPLAY_CHAIN_TOOLTIP), @@ -1647,7 +1645,7 @@ public: case WID_ID_INDUSTRY_LIST: { int n = 0; - Rect ir = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); if (this->industries.size() == 0) { DrawString(ir, STR_INDUSTRY_DIRECTORY_NONE); break; @@ -1701,8 +1699,8 @@ public: } resize->height = d.height; d.height *= 5; - d.width += padding.width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; - d.height += padding.height + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + d.width += padding.width; + d.height += padding.height; *size = maxdim(*size, d); break; } @@ -1731,7 +1729,7 @@ public: break; case WID_ID_INDUSTRY_LIST: { - uint p = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_ID_INDUSTRY_LIST, WD_FRAMERECT_TOP); + uint p = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_ID_INDUSTRY_LIST, WidgetDimensions::scaled.framerect.top); if (p < this->industries.size()) { if (_ctrl_pressed) { ShowExtraViewportWindow(this->industries[p]->location.tile); @@ -1892,8 +1890,8 @@ static const uint MAX_CARGOES = 16; ///< Maximum number of cargoes carried in a /** Data about a single field in the #IndustryCargoesWindow panel. */ struct CargoesField { - static const int VERT_INTER_INDUSTRY_SPACE; - static const int BLOB_DISTANCE; + static int vert_inter_industry_space; + static int blob_distance; static Dimension legend; static Dimension cargo_border; @@ -2083,8 +2081,8 @@ struct CargoesField { break; case CFT_INDUSTRY: { - int ypos1 = ypos + VERT_INTER_INDUSTRY_SPACE / 2; - int ypos2 = ypos + normal_height - 1 - VERT_INTER_INDUSTRY_SPACE / 2; + int ypos1 = ypos + vert_inter_industry_space / 2; + int ypos2 = ypos + normal_height - 1 - vert_inter_industry_space / 2; int xpos2 = xpos + industry_width - 1; GfxDrawLine(xpos, ypos1, xpos2, ypos1, INDUSTRY_LINE_COLOUR); GfxDrawLine(xpos, ypos1, xpos, ypos2, INDUSTRY_LINE_COLOUR); @@ -2098,14 +2096,14 @@ struct CargoesField { /* Draw the industry legend. */ int blob_left, blob_right; if (_current_text_dir == TD_RTL) { - blob_right = xpos2 - BLOB_DISTANCE; + blob_right = xpos2 - blob_distance; blob_left = blob_right - CargoesField::legend.width; } else { - blob_left = xpos + BLOB_DISTANCE; + blob_left = xpos + blob_distance; blob_right = blob_left + CargoesField::legend.width; } - GfxFillRect(blob_left, ypos2 - BLOB_DISTANCE - CargoesField::legend.height, blob_right, ypos2 - BLOB_DISTANCE, PC_BLACK); // Border - GfxFillRect(blob_left + 1, ypos2 - BLOB_DISTANCE - CargoesField::legend.height + 1, blob_right - 1, ypos2 - BLOB_DISTANCE - 1, indsp->map_colour); + GfxFillRect(blob_left, ypos2 - blob_distance - CargoesField::legend.height, blob_right, ypos2 - blob_distance, PC_BLACK); // Border + GfxFillRect(blob_left + 1, ypos2 - blob_distance - CargoesField::legend.height + 1, blob_right - 1, ypos2 - blob_distance - 1, indsp->map_colour); } else { DrawString(xpos, xpos2, ypos, STR_INDUSTRY_CARGOES_HOUSES, TC_FROMSTRING, SA_HOR_CENTER); } @@ -2140,8 +2138,8 @@ struct CargoesField { case CFT_CARGO: { int cargo_base = this->GetCargoBase(xpos); - int top = ypos + (this->u.cargo.top_end ? VERT_INTER_INDUSTRY_SPACE / 2 + 1 : 0); - int bot = ypos - (this->u.cargo.bottom_end ? VERT_INTER_INDUSTRY_SPACE / 2 + 1 : 0) + normal_height - 1; + int top = ypos + (this->u.cargo.top_end ? vert_inter_industry_space / 2 + 1 : 0); + int bot = ypos - (this->u.cargo.bottom_end ? vert_inter_industry_space / 2 + 1 : 0) + normal_height - 1; int colpos = cargo_base; for (int i = 0; i < this->u.cargo.num_cargoes; i++) { if (this->u.cargo.top_end) GfxDrawLine(colpos, top - 1, colpos + CargoesField::cargo_line.width - 1, top - 1, CARGO_LINE_COLOUR); @@ -2163,7 +2161,7 @@ struct CargoesField { hor_left = this->u.cargo.supp_cargoes; hor_right = this->u.cargo.cust_cargoes; } - ypos += CargoesField::cargo_border.height + VERT_INTER_INDUSTRY_SPACE / 2 + (FONT_HEIGHT_NORMAL - CargoesField::cargo_line.height) / 2; + ypos += CargoesField::cargo_border.height + vert_inter_industry_space / 2 + (FONT_HEIGHT_NORMAL - CargoesField::cargo_line.height) / 2; for (uint i = 0; i < MAX_CARGOES; i++) { if (hor_left[i] != INVALID_CARGO) { int col = hor_left[i]; @@ -2193,11 +2191,11 @@ struct CargoesField { } case CFT_CARGO_LABEL: - ypos += CargoesField::cargo_border.height + VERT_INTER_INDUSTRY_SPACE / 2; + ypos += CargoesField::cargo_border.height + vert_inter_industry_space / 2; for (uint i = 0; i < MAX_CARGOES; i++) { if (this->u.cargo_label.cargoes[i] != INVALID_CARGO) { const CargoSpec *csp = CargoSpec::Get(this->u.cargo_label.cargoes[i]); - DrawString(xpos + WD_FRAMERECT_LEFT, xpos + industry_width - 1 - WD_FRAMERECT_RIGHT, ypos, csp->name, TC_WHITE, + DrawString(xpos + WidgetDimensions::scaled.framerect.left, xpos + industry_width - 1 - WidgetDimensions::scaled.framerect.right, ypos, csp->name, TC_WHITE, (this->u.cargo_label.left_align) ? SA_LEFT : SA_RIGHT); } ypos += FONT_HEIGHT_NORMAL + CargoesField::cargo_space.height; @@ -2230,7 +2228,7 @@ struct CargoesField { } /* col = 0 -> left of first col, 1 -> left of 2nd col, ... this->u.cargo.num_cargoes right of last-col. */ - int vpos = VERT_INTER_INDUSTRY_SPACE / 2 + CargoesField::cargo_border.width; + int vpos = vert_inter_industry_space / 2 + CargoesField::cargo_border.width; uint row; for (row = 0; row < MAX_CARGOES; row++) { if (pt.y < vpos) return INVALID_CARGO; @@ -2277,7 +2275,7 @@ struct CargoesField { { assert(this->type == CFT_CARGO_LABEL); - int vpos = VERT_INTER_INDUSTRY_SPACE / 2 + CargoesField::cargo_border.height; + int vpos = vert_inter_industry_space / 2 + CargoesField::cargo_border.height; uint row; for (row = 0; row < MAX_CARGOES; row++) { if (pt.y < vpos) return INVALID_CARGO; @@ -2318,9 +2316,9 @@ int CargoesField::normal_height; ///< Height of the non-header rows. int CargoesField::industry_width; ///< Width of an industry field. int CargoesField::cargo_field_width; ///< Width of a cargo field. uint CargoesField::max_cargoes; ///< Largest number of cargoes actually on any industry. -const int CargoesField::VERT_INTER_INDUSTRY_SPACE = 6; ///< Amount of space between two industries in a column. +int CargoesField::vert_inter_industry_space; ///< Amount of space between two industries in a column. -const int CargoesField::BLOB_DISTANCE = 5; ///< Distance of the industry legend colour from the edge of the industry box. +int CargoesField::blob_distance; ///< Distance of the industry legend colour from the edge of the industry box. const int CargoesField::INDUSTRY_LINE_COLOUR = PC_YELLOW; ///< Line colour of the industry type box. const int CargoesField::CARGO_LINE_COLOUR = PC_YELLOW; ///< Line colour around the cargo. @@ -2463,8 +2461,6 @@ next_cargo: ; * customer industries). The remaining two columns are set to #CFT_EMPTY with a width equal to the average of a cargo and an industry column. */ struct IndustryCargoesWindow : public Window { - static const int HOR_TEXT_PADDING, VERT_TEXT_PADDING; - typedef std::vector Fields; Fields fields; ///< Fields to display in the #WID_IC_PANEL. @@ -2487,8 +2483,8 @@ struct IndustryCargoesWindow : public Window { /* Initialize static CargoesField size variables. */ Dimension d = GetStringBoundingBox(STR_INDUSTRY_CARGOES_PRODUCERS); d = maxdim(d, GetStringBoundingBox(STR_INDUSTRY_CARGOES_CUSTOMERS)); - d.width += WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT; - d.height += WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM; + d.width += WidgetDimensions::scaled.frametext.Horizontal(); + d.height += WidgetDimensions::scaled.frametext.Vertical(); CargoesField::small_height = d.height; /* Size of the legend blob -- slightly larger than the smallmap legend blob. */ @@ -2496,7 +2492,7 @@ struct IndustryCargoesWindow : public Window { CargoesField::legend.width = CargoesField::legend.height * 8 / 5; /* Size of cargo lines. */ - CargoesField::cargo_line.width = FONT_HEIGHT_NORMAL; + CargoesField::cargo_line.width = ScaleGUITrad(6); CargoesField::cargo_line.height = CargoesField::cargo_line.width; /* Size of border between cargo lines and industry boxes. */ @@ -2511,6 +2507,9 @@ struct IndustryCargoesWindow : public Window { CargoesField::cargo_stub.width = CargoesField::cargo_line.width / 2; CargoesField::cargo_stub.height = CargoesField::cargo_line.height; /* Unused */ + CargoesField::vert_inter_industry_space = WidgetDimensions::scaled.vsep_wide; + CargoesField::blob_distance = WidgetDimensions::scaled.hsep_normal; + /* Decide about the size of the box holding the text of an industry type. */ this->ind_textsize.width = 0; this->ind_textsize.height = 0; @@ -2537,13 +2536,13 @@ struct IndustryCargoesWindow : public Window { d = maxdim(d, this->cargo_textsize); // Box must also be wide enough to hold any cargo label. this->cargo_textsize = maxdim(this->cargo_textsize, GetStringBoundingBox(STR_INDUSTRY_CARGOES_SELECT_CARGO)); - d.width += 2 * HOR_TEXT_PADDING; + d.width += WidgetDimensions::scaled.frametext.Horizontal(); /* Ensure the height is enough for the industry type text, for the horizontal connections, and for the cargo labels. */ uint min_ind_height = CargoesField::cargo_border.height * 2 + CargoesField::max_cargoes * FONT_HEIGHT_NORMAL + (CargoesField::max_cargoes - 1) * CargoesField::cargo_space.height; - d.height = std::max(d.height + 2 * VERT_TEXT_PADDING, min_ind_height); + d.height = std::max(d.height + WidgetDimensions::scaled.frametext.Vertical(), min_ind_height); CargoesField::industry_width = d.width; - CargoesField::normal_height = d.height + CargoesField::VERT_INTER_INDUSTRY_SPACE; + CargoesField::normal_height = d.height + CargoesField::vert_inter_industry_space; /* Width of a #CFT_CARGO field. */ CargoesField::cargo_field_width = CargoesField::cargo_border.width * 2 + CargoesField::cargo_line.width * CargoesField::max_cargoes + CargoesField::cargo_space.width * (CargoesField::max_cargoes - 1); @@ -2554,8 +2553,8 @@ struct IndustryCargoesWindow : public Window { switch (widget) { case WID_IC_PANEL: resize->height = CargoesField::normal_height; - size->width = WD_FRAMETEXT_LEFT + CargoesField::industry_width * 3 + CargoesField::cargo_field_width * 2 + WD_FRAMETEXT_RIGHT; - size->height = WD_FRAMETEXT_TOP + CargoesField::small_height + 2 * resize->height + WD_FRAMETEXT_BOTTOM; + size->width = CargoesField::industry_width * 3 + CargoesField::cargo_field_width * 2 + WidgetDimensions::scaled.frametext.Horizontal(); + size->height = CargoesField::small_height + 2 * resize->height + WidgetDimensions::scaled.frametext.Vertical(); break; case WID_IC_IND_DROPDOWN: @@ -2906,7 +2905,7 @@ struct IndustryCargoesWindow : public Window { { if (widget != WID_IC_PANEL) return; - Rect ir = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); DrawPixelInfo tmp_dpi, *old_dpi; if (!FillDrawPixelInfo(&tmp_dpi, ir.left, ir.top, ir.Width(), ir.Height())) return; old_dpi = _cur_dpi; @@ -2956,7 +2955,7 @@ struct IndustryCargoesWindow : public Window { pt.x -= nw->pos_x; pt.y -= nw->pos_y; - int vpos = WD_FRAMERECT_TOP + CargoesField::small_height - this->vscroll->GetPosition() * nw->resize_y; + int vpos = WidgetDimensions::scaled.framerect.top + CargoesField::small_height - this->vscroll->GetPosition() * nw->resize_y; if (pt.y < vpos) return false; int row = (pt.y - vpos) / CargoesField::normal_height; // row is relative to row 1. @@ -2964,7 +2963,7 @@ struct IndustryCargoesWindow : public Window { vpos = pt.y - vpos - row * CargoesField::normal_height; // Position in the row + 1 field row++; // rebase row to match index of this->fields. - int xpos = 2 * WD_FRAMERECT_LEFT + ((this->ind_cargo < NUM_INDUSTRYTYPES) ? 0 : (CargoesField::industry_width + CargoesField::cargo_field_width) / 2); + int xpos = 2 * WidgetDimensions::scaled.framerect.left + ((this->ind_cargo < NUM_INDUSTRYTYPES) ? 0 : (CargoesField::industry_width + CargoesField::cargo_field_width) / 2); if (pt.x < xpos) return false; int column; for (column = 0; column <= 5; column++) { @@ -3120,13 +3119,10 @@ struct IndustryCargoesWindow : public Window { void OnResize() override { - this->vscroll->SetCapacityFromWidget(this, WID_IC_PANEL, WD_FRAMERECT_TOP + CargoesField::small_height); + this->vscroll->SetCapacityFromWidget(this, WID_IC_PANEL, WidgetDimensions::scaled.framerect.top + CargoesField::small_height); } }; -const int IndustryCargoesWindow::HOR_TEXT_PADDING = 5; ///< Horizontal padding around the industry type text. -const int IndustryCargoesWindow::VERT_TEXT_PADDING = 5; ///< Vertical padding around the industry type text. - /** * Open the industry and cargoes window. * @param id Industry type to display, \c NUM_INDUSTRYTYPES selects a default industry type. diff --git a/src/linkgraph/linkgraph_gui.cpp b/src/linkgraph/linkgraph_gui.cpp index 44c96aa531..8752894b04 100644 --- a/src/linkgraph/linkgraph_gui.cpp +++ b/src/linkgraph/linkgraph_gui.cpp @@ -509,13 +509,11 @@ static const NWidgetPart _nested_linkgraph_legend_widgets[] = { NWidget(WWT_STICKYBOX, COLOUR_DARK_GREEN), EndContainer(), NWidget(WWT_PANEL, COLOUR_DARK_GREEN), - NWidget(NWID_HORIZONTAL), + NWidget(NWID_HORIZONTAL), SetPadding(WidgetDimensions::unscaled.framerect), SetPIP(0, WidgetDimensions::unscaled.framerect.Horizontal(), 0), NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_LGL_SATURATION), - SetPadding(WD_FRAMERECT_TOP, 0, WD_FRAMERECT_BOTTOM, WD_CAPTIONTEXT_LEFT), NWidgetFunction(MakeSaturationLegendLinkGraphGUI), EndContainer(), NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_LGL_COMPANIES), - SetPadding(WD_FRAMERECT_TOP, 0, WD_FRAMERECT_BOTTOM, WD_CAPTIONTEXT_LEFT), NWidget(NWID_VERTICAL, NC_EQUALSIZE), NWidgetFunction(MakeCompanyButtonRowsLinkGraphGUI), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_LGL_COMPANIES_ALL), SetDataTip(STR_LINKGRAPH_LEGEND_ALL, STR_NULL), @@ -523,7 +521,6 @@ static const NWidgetPart _nested_linkgraph_legend_widgets[] = { EndContainer(), EndContainer(), NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_LGL_CARGOES), - SetPadding(WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM, WD_CAPTIONTEXT_LEFT), NWidget(NWID_VERTICAL, NC_EQUALSIZE), NWidgetFunction(MakeCargoesLegendLinkGraphGUI), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_LGL_CARGOES_ALL), SetDataTip(STR_LINKGRAPH_LEGEND_ALL, STR_NULL), @@ -610,8 +607,8 @@ void LinkGraphLegendWindow::UpdateWidgetSize(int widget, Dimension *size, const void LinkGraphLegendWindow::DrawWidget(const Rect &r, int widget) const { - Rect br = r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM); - if (this->IsWidgetLowered(widget)) br = br.Translate(1, 1); + Rect br = r.Shrink(WidgetDimensions::scaled.bevel); + if (this->IsWidgetLowered(widget)) br = br.Translate(WidgetDimensions::scaled.pressed, WidgetDimensions::scaled.pressed); if (IsInsideMM(widget, WID_LGL_COMPANY_FIRST, WID_LGL_COMPANY_LAST + 1)) { if (this->IsWidgetDisabled(widget)) return; CompanyID cid = (CompanyID)(widget - WID_LGL_COMPANY_FIRST); diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index a7f7d79d8e..d73348e7ab 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -75,10 +75,10 @@ public: { if (widget != WID_LI_BACKGROUND) return; - Rect ir = r.Shrink(WD_FRAMETEXT_LEFT, WD_TEXTPANEL_TOP, WD_FRAMETEXT_RIGHT, WD_TEXTPANEL_BOTTOM); + Rect ir = r.Shrink(WidgetDimensions::scaled.frametext); for (size_t i = 0; i < this->landinfo_data.size(); i++) { DrawString(ir, this->landinfo_data[i], i == 0 ? TC_LIGHT_BLUE : TC_FROMSTRING, SA_HOR_CENTER); - ir.top += FONT_HEIGHT_NORMAL + (i == 0 ? WD_PAR_VSEP_WIDE : WD_PAR_VSEP_NORMAL); + ir.top += FONT_HEIGHT_NORMAL + (i == 0 ? WidgetDimensions::scaled.vsep_wide : WidgetDimensions::scaled.vsep_normal); } if (!this->cargo_acceptance.empty()) { @@ -91,19 +91,19 @@ public: { if (widget != WID_LI_BACKGROUND) return; - size->height = WD_TEXTPANEL_TOP + WD_TEXTPANEL_BOTTOM; + size->height = WidgetDimensions::scaled.frametext.Vertical(); for (size_t i = 0; i < this->landinfo_data.size(); i++) { - uint width = GetStringBoundingBox(this->landinfo_data[i]).width + WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT; + uint width = GetStringBoundingBox(this->landinfo_data[i]).width + WidgetDimensions::scaled.frametext.Horizontal(); size->width = std::max(size->width, width); - size->height += FONT_HEIGHT_NORMAL + (i == 0 ? WD_PAR_VSEP_WIDE : WD_PAR_VSEP_NORMAL); + size->height += FONT_HEIGHT_NORMAL + (i == 0 ? WidgetDimensions::scaled.vsep_wide : WidgetDimensions::scaled.vsep_normal); } if (!this->cargo_acceptance.empty()) { - uint width = GetStringBoundingBox(this->cargo_acceptance).width + WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT; + uint width = GetStringBoundingBox(this->cargo_acceptance).width + WidgetDimensions::scaled.frametext.Horizontal(); size->width = std::max(size->width, std::min(300u, width)); SetDParamStr(0, cargo_acceptance); - size->height += GetStringHeight(STR_JUST_RAW_STRING, size->width - WD_FRAMETEXT_LEFT - WD_FRAMETEXT_RIGHT); + size->height += GetStringHeight(STR_JUST_RAW_STRING, size->width - WidgetDimensions::scaled.frametext.Horizontal()); } } @@ -721,20 +721,20 @@ struct TooltipsWindow : public Window size->height = GetStringHeight(this->string_id, size->width); /* Increase slightly to have some space around the box. */ - size->width += 2 + padding.width; - size->height += 2 + padding.height; + size->width += padding.width + WidgetDimensions::scaled.fullbevel.Horizontal(); + size->height += padding.height + WidgetDimensions::scaled.fullbevel.Vertical(); } void DrawWidget(const Rect &r, int widget) const override { /* There is only one widget. */ GfxFillRect(r, PC_BLACK); - GfxFillRect(r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), PC_LIGHT_YELLOW); + GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), PC_LIGHT_YELLOW); for (uint arg = 0; arg < this->paramcount; arg++) { SetDParam(arg, this->params[arg]); } - DrawStringMultiLine(r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM), this->string_id, TC_FROMSTRING, SA_CENTER); + DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.framerect), this->string_id, TC_FROMSTRING, SA_CENTER); } void OnMouseLoop() override @@ -796,20 +796,20 @@ void QueryString::DrawEditBox(const Window *w, int wid) const bool rtl = _current_text_dir == TD_RTL; Dimension sprite_size = GetSpriteSize(rtl ? SPR_IMG_DELETE_RIGHT : SPR_IMG_DELETE_LEFT); - int clearbtn_width = sprite_size.width + WD_IMGBTN_LEFT + WD_IMGBTN_RIGHT; + int clearbtn_width = sprite_size.width + WidgetDimensions::scaled.imgbtn.Horizontal(); Rect r = wi->GetCurrentRect(); Rect cr = r.WithWidth(clearbtn_width, !rtl); Rect fr = r.Indent(clearbtn_width, !rtl); DrawFrameRect(cr, wi->colour, wi->IsLowered() ? FR_LOWERED : FR_NONE); - DrawSprite(rtl ? SPR_IMG_DELETE_RIGHT : SPR_IMG_DELETE_LEFT, PAL_NONE, cr.left + WD_IMGBTN_LEFT + (wi->IsLowered() ? 1 : 0), CenterBounds(r.top, r.bottom, sprite_size.height) + (wi->IsLowered() ? 1 : 0)); - if (this->text.bytes == 1) GfxFillRect(cr.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), _colour_gradient[wi->colour & 0xF][2], FILLRECT_CHECKER); + DrawSprite(rtl ? SPR_IMG_DELETE_RIGHT : SPR_IMG_DELETE_LEFT, PAL_NONE, cr.left + WidgetDimensions::scaled.imgbtn.left + (wi->IsLowered() ? 1 : 0), CenterBounds(r.top, r.bottom, sprite_size.height) + (wi->IsLowered() ? 1 : 0)); + if (this->text.bytes == 1) GfxFillRect(cr.Shrink(WidgetDimensions::scaled.bevel), _colour_gradient[wi->colour & 0xF][2], FILLRECT_CHECKER); DrawFrameRect(fr, wi->colour, FR_LOWERED | FR_DARKENED); - GfxFillRect(fr.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), PC_BLACK); + GfxFillRect(fr.Shrink(WidgetDimensions::scaled.bevel), PC_BLACK); - fr = fr.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + fr = fr.Shrink(WidgetDimensions::scaled.framerect); /* Limit the drawing of the string inside the widget boundaries */ DrawPixelInfo dpi; if (!FillDrawPixelInfo(&dpi, fr.left, fr.top, fr.Width(), fr.Height())) return; @@ -851,9 +851,9 @@ Point QueryString::GetCaretPosition(const Window *w, int wid) const bool rtl = _current_text_dir == TD_RTL; Dimension sprite_size = GetSpriteSize(rtl ? SPR_IMG_DELETE_RIGHT : SPR_IMG_DELETE_LEFT); - int clearbtn_width = sprite_size.width + WD_IMGBTN_LEFT + WD_IMGBTN_RIGHT; + int clearbtn_width = sprite_size.width + WidgetDimensions::scaled.imgbtn.Horizontal(); - Rect r = wi->GetCurrentRect().Indent(clearbtn_width, !rtl).Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect r = wi->GetCurrentRect().Indent(clearbtn_width, !rtl).Shrink(WidgetDimensions::scaled.framerect); /* Clamp caret position to be inside out current width. */ const Textbuf *tb = &this->text; @@ -880,9 +880,9 @@ Rect QueryString::GetBoundingRect(const Window *w, int wid, const char *from, co bool rtl = _current_text_dir == TD_RTL; Dimension sprite_size = GetSpriteSize(rtl ? SPR_IMG_DELETE_RIGHT : SPR_IMG_DELETE_LEFT); - int clearbtn_width = sprite_size.width + WD_IMGBTN_LEFT + WD_IMGBTN_RIGHT; + int clearbtn_width = sprite_size.width + WidgetDimensions::scaled.imgbtn.Horizontal(); - Rect r = wi->GetCurrentRect().Indent(clearbtn_width, !rtl).Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect r = wi->GetCurrentRect().Indent(clearbtn_width, !rtl).Shrink(WidgetDimensions::scaled.framerect); /* Clamp caret position to be inside our current width. */ const Textbuf *tb = &this->text; @@ -911,9 +911,9 @@ const char *QueryString::GetCharAtPosition(const Window *w, int wid, const Point bool rtl = _current_text_dir == TD_RTL; Dimension sprite_size = GetSpriteSize(rtl ? SPR_IMG_DELETE_RIGHT : SPR_IMG_DELETE_LEFT); - int clearbtn_width = sprite_size.width + WD_IMGBTN_LEFT + WD_IMGBTN_RIGHT; + int clearbtn_width = sprite_size.width + WidgetDimensions::scaled.imgbtn.Horizontal(); - Rect r = wi->GetCurrentRect().Indent(clearbtn_width, !rtl).Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect r = wi->GetCurrentRect().Indent(clearbtn_width, !rtl).Shrink(WidgetDimensions::scaled.framerect); if (!IsInsideMM(pt.y, r.top, r.bottom)) return nullptr; @@ -996,9 +996,9 @@ struct QueryStringWindow : public Window { if (this->flags & QSF_PASSWORD) { assert(this->nested_root->smallest_x > 0); - this->warning_size.width = this->nested_root->current_x - (WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT); + this->warning_size.width = this->nested_root->current_x - WidgetDimensions::scaled.frametext.Horizontal() - WidgetDimensions::scaled.framerect.Horizontal(); this->warning_size.height = GetStringHeight(STR_WARNING_PASSWORD_SECURITY, this->warning_size.width); - this->warning_size.height += WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + this->warning_size.height += WidgetDimensions::scaled.frametext.Vertical() + WidgetDimensions::scaled.framerect.Vertical(); } else { this->warning_size = Dimension{ 0, 0 }; } @@ -1025,7 +1025,7 @@ struct QueryStringWindow : public Window if (widget != WID_QS_WARNING) return; if (this->flags & QSF_PASSWORD) { - DrawStringMultiLine(r.Shrink(WD_FRAMERECT_LEFT + WD_FRAMETEXT_LEFT, WD_FRAMERECT_TOP + WD_FRAMETEXT_TOP, WD_FRAMERECT_RIGHT + WD_FRAMETEXT_RIGHT, WD_FRAMERECT_BOTTOM + WD_FRAMETEXT_BOTTOM), + DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.framerect).Shrink(WidgetDimensions::scaled.frametext), STR_WARNING_PASSWORD_SECURITY, TC_FROMSTRING, SA_CENTER); } } @@ -1168,8 +1168,8 @@ struct QueryWindow : public Window { if (widget != WID_Q_TEXT) return; Dimension d = GetStringMultiLineBoundingBox(this->message, *size); - d.width += WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT; - d.height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + d.width += WidgetDimensions::scaled.frametext.Horizontal(); + d.height += WidgetDimensions::scaled.framerect.Vertical(); *size = d; } @@ -1177,7 +1177,7 @@ struct QueryWindow : public Window { { if (widget != WID_Q_TEXT) return; - DrawStringMultiLine(r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMERECT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMERECT_BOTTOM), + DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.frametext, WidgetDimensions::scaled.framerect), this->message, TC_FROMSTRING, SA_CENTER); } diff --git a/src/music_gui.cpp b/src/music_gui.cpp index 8d4b9a019a..a2bd44add7 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -522,9 +522,9 @@ struct MusicTrackSelectionWindow : public Window { { switch (widget) { case WID_MTS_LIST_LEFT: { - GfxFillRect(r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), PC_BLACK); + GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), PC_BLACK); - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); for (MusicSystem::Playlist::const_iterator song = _music.music_set.begin(); song != _music.music_set.end(); ++song) { SetDParam(0, song->tracknr); SetDParam(1, 2); @@ -536,9 +536,9 @@ struct MusicTrackSelectionWindow : public Window { } case WID_MTS_LIST_RIGHT: { - GfxFillRect(r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), PC_BLACK); + GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), PC_BLACK); - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); for (MusicSystem::Playlist::const_iterator song = _music.active_playlist.begin(); song != _music.active_playlist.end(); ++song) { SetDParam(0, song->tracknr); SetDParam(1, 2); @@ -712,7 +712,7 @@ struct MusicWindow : public Window { { switch (widget) { case WID_M_TRACK_NR: { - GfxFillRect(r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, 0, WD_BEVEL_BOTTOM), PC_BLACK); + GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel.left, WidgetDimensions::scaled.bevel.top, 0, WidgetDimensions::scaled.bevel.bottom), PC_BLACK); if (BaseMusic::GetUsedSet()->num_available == 0) { break; } @@ -722,12 +722,12 @@ struct MusicWindow : public Window { SetDParam(1, 2); str = STR_MUSIC_TRACK_DIGIT; } - DrawString(r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM), str); + DrawString(r.Shrink(WidgetDimensions::scaled.framerect), str); break; } case WID_M_TRACK_NAME: { - GfxFillRect(r.Shrink(0, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), PC_BLACK); + GfxFillRect(r.Shrink(0, WidgetDimensions::scaled.bevel.top, WidgetDimensions::scaled.bevel.right, WidgetDimensions::scaled.bevel.bottom), PC_BLACK); StringID str = STR_MUSIC_TITLE_NONE; MusicSystem::PlaylistEntry entry(_music.GetCurrentSong()); if (BaseMusic::GetUsedSet()->num_available == 0) { @@ -736,7 +736,7 @@ struct MusicWindow : public Window { str = STR_MUSIC_TITLE_NAME; SetDParamStr(0, entry.songname); } - DrawString(r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM), str, TC_FROMSTRING, SA_HOR_CENTER); + DrawString(r.Shrink(WidgetDimensions::scaled.framerect), str, TC_FROMSTRING, SA_HOR_CENTER); break; } diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index cbaf4b9163..5327073be0 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -17,6 +17,7 @@ #include "../window_func.h" #include "../toolbar_gui.h" #include "../core/geometry_func.hpp" +#include "../zoom_func.h" #include "network.h" #include "network_client.h" #include "network_base.h" @@ -106,7 +107,7 @@ void CDECL NetworkAddChatMessage(TextColour colour, uint duration, const std::st void NetworkReInitChatBoxSize() { _chatmsg_box.y = 3 * FONT_HEIGHT_NORMAL; - _chatmsg_box.height = MAX_CHAT_MESSAGES * (FONT_HEIGHT_NORMAL + NETWORK_CHAT_LINE_SPACING) + 4; + _chatmsg_box.height = MAX_CHAT_MESSAGES * (FONT_HEIGHT_NORMAL + ScaleGUITrad(NETWORK_CHAT_LINE_SPACING)) + ScaleGUITrad(4); _chatmessage_backup = ReallocT(_chatmessage_backup, _chatmsg_box.width * _chatmsg_box.height * BlitterFactory::GetCurrentBlitter()->GetBytesPerPixel()); } @@ -116,7 +117,7 @@ void NetworkInitChatMessage() MAX_CHAT_MESSAGES = _settings_client.gui.network_chat_box_height; _chatmsg_list.clear(); - _chatmsg_box.x = 10; + _chatmsg_box.x = ScaleGUITrad(10); _chatmsg_box.width = _settings_client.gui.network_chat_box_width_pct * _screen.width / 100; NetworkReInitChatBoxSize(); _chatmessage_visible = false; @@ -242,7 +243,7 @@ void NetworkDrawChatMessage() for (auto &cmsg : _chatmsg_list) { if (!show_all && cmsg.remove_time < now) continue; - ypos = DrawStringMultiLine(_chatmsg_box.x + 3, _chatmsg_box.x + _chatmsg_box.width - 1, top, ypos, cmsg.message, cmsg.colour, SA_LEFT | SA_BOTTOM | SA_FORCE) - NETWORK_CHAT_LINE_SPACING; + ypos = DrawStringMultiLine(_chatmsg_box.x + ScaleGUITrad(3), _chatmsg_box.x + _chatmsg_box.width - 1, top, ypos, cmsg.message, cmsg.colour, SA_LEFT | SA_BOTTOM | SA_FORCE) - NETWORK_CHAT_LINE_SPACING; if (ypos < top) break; } diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index b1e022c8ed..a9cadab30f 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -82,7 +82,7 @@ void ShowContentTextfileWindow(TextfileType file_type, const ContentInfo *ci) static const NWidgetPart _nested_network_content_download_status_window_widgets[] = { NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_PANEL, COLOUR_GREY, WID_NCDS_BACKGROUND), - NWidget(NWID_SPACER), SetMinimalSize(350, 0), SetMinimalTextLines(3, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 30), + NWidget(NWID_SPACER), SetMinimalSize(350, 0), SetMinimalTextLines(4, WidgetDimensions::unscaled.framerect.Vertical() + WidgetDimensions::unscaled.frametext.Vertical() * 2), NWidget(NWID_HORIZONTAL), NWidget(NWID_SPACER), SetMinimalSize(125, 0), NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NCDS_CANCELOK), SetMinimalSize(101, 12), SetDataTip(STR_BUTTON_CANCEL, STR_NULL), @@ -119,14 +119,17 @@ void BaseNetworkContentDownloadStatusWindow::DrawWidget(const Rect &r, int widge { if (widget != WID_NCDS_BACKGROUND) return; - /* Draw nice progress bar :) */ - DrawFrameRect(r.left + 20, r.top + 4, r.left + 20 + (int)((this->width - 40LL) * this->downloaded_bytes / this->total_bytes), r.top + 14, COLOUR_MAUVE, FR_NONE); + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); + int y = ir.top + WidgetDimensions::scaled.frametext.top; - int y = r.top + 20; + /* Draw nice progress bar :) */ + DrawFrameRect(ir.left, y, ir.left + (int)((ir.Width() - 1LL) * this->downloaded_bytes / this->total_bytes), y + FONT_HEIGHT_NORMAL - 1, COLOUR_MAUVE, FR_NONE); + + y += WidgetDimensions::scaled.frametext.bottom + FONT_HEIGHT_NORMAL; SetDParam(0, this->downloaded_bytes); SetDParam(1, this->total_bytes); SetDParam(2, this->downloaded_bytes * 100LL / this->total_bytes); - DrawString(r.left + 2, r.right - 2, y, STR_CONTENT_DOWNLOAD_PROGRESS_SIZE, TC_FROMSTRING, SA_HOR_CENTER); + DrawString(ir.left, ir.right, y, STR_CONTENT_DOWNLOAD_PROGRESS_SIZE, TC_FROMSTRING, SA_HOR_CENTER); StringID str; if (this->downloaded_bytes == this->total_bytes) { @@ -140,8 +143,8 @@ void BaseNetworkContentDownloadStatusWindow::DrawWidget(const Rect &r, int widge str = STR_CONTENT_DOWNLOAD_INITIALISE; } - y += FONT_HEIGHT_NORMAL + 5; - DrawStringMultiLine(r.left + 2, r.right - 2, y, y + FONT_HEIGHT_NORMAL * 2, str, TC_FROMSTRING, SA_CENTER); + y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.frametext.top; + DrawStringMultiLine(ir.left, ir.right, y, y + FONT_HEIGHT_NORMAL * 2, str, TC_FROMSTRING, SA_CENTER); } void BaseNetworkContentDownloadStatusWindow::OnDownloadProgress(const ContentInfo *ci, int bytes) @@ -524,8 +527,6 @@ public: selected(nullptr), list_pos(0) { - this->checkbox_size = maxdim(maxdim(GetSpriteSize(SPR_BOX_EMPTY), GetSpriteSize(SPR_BOX_CHECKED)), GetSpriteSize(SPR_BLOT)); - this->CreateNestedTree(); this->vscroll = this->GetScrollbar(WID_NCL_SCROLLBAR); this->FinishInitNested(WN_NETWORK_WINDOW_CONTENT_LIST); @@ -556,11 +557,16 @@ public: this->Window::Close(); } + void OnInit() override + { + this->checkbox_size = maxdim(maxdim(GetSpriteSize(SPR_BOX_EMPTY), GetSpriteSize(SPR_BOX_CHECKED)), GetSpriteSize(SPR_BLOT)); + } + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_NCL_CHECKBOX: - size->width = this->checkbox_size.width + WD_MATRIX_RIGHT + WD_MATRIX_LEFT; + size->width = this->checkbox_size.width + padding.width; break; case WID_NCL_TYPE: { @@ -568,7 +574,7 @@ public: for (int i = CONTENT_TYPE_BEGIN; i < CONTENT_TYPE_END; i++) { d = maxdim(d, GetStringBoundingBox(STR_CONTENT_TYPE_BASE_GRAPHICS + i - CONTENT_TYPE_BASE_GRAPHICS)); } - size->width = d.width + WD_MATRIX_RIGHT + WD_MATRIX_LEFT; + size->width = d.width + padding.width; break; } @@ -617,7 +623,7 @@ public: void DrawMatrix(const Rect &r) const { Rect checkbox = this->GetWidget(WID_NCL_CHECKBOX)->GetCurrentRect(); - Rect name = this->GetWidget(WID_NCL_NAME)->GetCurrentRect().Shrink(WD_FRAMERECT_LEFT, 0, WD_FRAMERECT_RIGHT, 0); + Rect name = this->GetWidget(WID_NCL_NAME)->GetCurrentRect().Shrink(WidgetDimensions::scaled.framerect); Rect type = this->GetWidget(WID_NCL_TYPE)->GetCurrentRect(); /* Fill the matrix with the information */ @@ -632,7 +638,7 @@ public: for (/**/; iter != end; iter++) { const ContentInfo *ci = *iter; - if (ci == this->selected) GfxFillRect(mr.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), PC_GREY); + if (ci == this->selected) GfxFillRect(mr.Shrink(WidgetDimensions::scaled.bevel), PC_GREY); SpriteID sprite; SpriteID pal = PAL_NONE; @@ -661,14 +667,14 @@ public: void DrawDetails(const Rect &r) const { /* Height for the title banner */ - int HEADER_HEIGHT = 3 * FONT_HEIGHT_NORMAL + WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM; + int HEADER_HEIGHT = 3 * FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.frametext.Vertical(); - Rect hr = r.WithHeight(HEADER_HEIGHT).Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM); - Rect tr = r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM); + Rect hr = r.WithHeight(HEADER_HEIGHT).Shrink(WidgetDimensions::scaled.frametext); + Rect tr = r.Shrink(WidgetDimensions::scaled.frametext); tr.top += HEADER_HEIGHT; /* Create the nice grayish rectangle at the details top */ - GfxFillRect(r.WithHeight(HEADER_HEIGHT).Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, 0), PC_DARK_BLUE); + GfxFillRect(r.WithHeight(HEADER_HEIGHT).Shrink(WidgetDimensions::scaled.bevel.left, WidgetDimensions::scaled.bevel.top, WidgetDimensions::scaled.bevel.right, 0), PC_DARK_BLUE); DrawString(hr.left, hr.right, hr.top, STR_CONTENT_DETAIL_TITLE, TC_FROMSTRING, SA_HOR_CENTER); /* Draw the total download size */ @@ -681,12 +687,12 @@ public: DrawStringMultiLine(hr.left, hr.right, hr.top + FONT_HEIGHT_NORMAL, hr.bottom, STR_CONTENT_DETAIL_SUBTITLE_UNSELECTED + this->selected->state, TC_FROMSTRING, SA_CENTER); /* Also show the total download size, so keep some space from the bottom */ - tr.bottom -= FONT_HEIGHT_NORMAL + WD_PAR_VSEP_WIDE; + tr.bottom -= FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_wide; if (this->selected->upgrade) { SetDParam(0, STR_CONTENT_TYPE_BASE_GRAPHICS + this->selected->type - CONTENT_TYPE_BASE_GRAPHICS); tr.top = DrawStringMultiLine(tr, STR_CONTENT_DETAIL_UPDATE); - tr.top += WD_PAR_VSEP_WIDE; + tr.top += WidgetDimensions::scaled.vsep_wide; } SetDParamStr(0, this->selected->name); @@ -710,7 +716,7 @@ public: SetDParam(0, STR_CONTENT_TYPE_BASE_GRAPHICS + this->selected->type - CONTENT_TYPE_BASE_GRAPHICS); tr.top = DrawStringMultiLine(tr, STR_CONTENT_DETAIL_TYPE); - tr.top += WD_PAR_VSEP_WIDE; + tr.top += WidgetDimensions::scaled.vsep_wide; SetDParam(0, this->selected->filesize); tr.top = DrawStringMultiLine(tr, STR_CONTENT_DETAIL_FILESIZE); diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 8f1f82d551..4ef92dbe6e 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -391,66 +391,71 @@ protected: * @param y from where to draw? * @param highlight does the line need to be highlighted? */ - void DrawServerLine(const NetworkGameList *cur_item, uint y, bool highlight) const + void DrawServerLine(const NetworkGameList *cur_item, int y, bool highlight) const { - const NWidgetBase *nwi_name = this->GetWidget(WID_NG_NAME); - const NWidgetBase *nwi_info = this->GetWidget(WID_NG_INFO); + Rect name = this->GetWidget(WID_NG_NAME)->GetCurrentRect(); + Rect info = this->GetWidget(WID_NG_INFO)->GetCurrentRect(); /* show highlighted item with a different colour */ - if (highlight) GfxFillRect(nwi_name->pos_x + 1, y + 1, nwi_info->pos_x + nwi_info->current_x - 2, y + this->resize.step_height - 2, PC_GREY); + if (highlight) { + Rect r = {name.left, y, info.right, y + (int)this->resize.step_height - 1}; + Rect ir = r.Shrink(WidgetDimensions::scaled.bevel); + GfxFillRect(ir.left, ir.top, ir.right, ir.bottom, PC_GREY); + } /* offsets to vertically centre text and icons */ int text_y_offset = (this->resize.step_height - FONT_HEIGHT_NORMAL) / 2 + 1; int icon_y_offset = (this->resize.step_height - GetSpriteSize(SPR_BLOT).height) / 2; int lock_y_offset = (this->resize.step_height - GetSpriteSize(SPR_LOCK).height) / 2; - DrawString(nwi_name->pos_x + WD_FRAMERECT_LEFT, nwi_name->pos_x + nwi_name->current_x - WD_FRAMERECT_RIGHT, y + text_y_offset, cur_item->info.server_name, TC_BLACK); + name = name.Shrink(WidgetDimensions::scaled.framerect); + DrawString(name.left, name.right, y + text_y_offset, cur_item->info.server_name, TC_BLACK); /* only draw details if the server is online */ if (cur_item->status == NGLS_ONLINE) { const NWidgetServerListHeader *nwi_header = this->GetWidget(WID_NG_HEADER); if (nwi_header->IsWidgetVisible(WID_NG_CLIENTS)) { - const NWidgetBase *nwi_clients = this->GetWidget(WID_NG_CLIENTS); + Rect clients = this->GetWidget(WID_NG_CLIENTS)->GetCurrentRect(); SetDParam(0, cur_item->info.clients_on); SetDParam(1, cur_item->info.clients_max); SetDParam(2, cur_item->info.companies_on); SetDParam(3, cur_item->info.companies_max); - DrawString(nwi_clients->pos_x, nwi_clients->pos_x + nwi_clients->current_x - 1, y + text_y_offset, STR_NETWORK_SERVER_LIST_GENERAL_ONLINE, TC_FROMSTRING, SA_HOR_CENTER); + DrawString(clients.left, clients.right, y + text_y_offset, STR_NETWORK_SERVER_LIST_GENERAL_ONLINE, TC_FROMSTRING, SA_HOR_CENTER); } if (nwi_header->IsWidgetVisible(WID_NG_MAPSIZE)) { /* map size */ - const NWidgetBase *nwi_mapsize = this->GetWidget(WID_NG_MAPSIZE); + Rect mapsize = this->GetWidget(WID_NG_MAPSIZE)->GetCurrentRect(); SetDParam(0, cur_item->info.map_width); SetDParam(1, cur_item->info.map_height); - DrawString(nwi_mapsize->pos_x, nwi_mapsize->pos_x + nwi_mapsize->current_x - 1, y + text_y_offset, STR_NETWORK_SERVER_LIST_MAP_SIZE_SHORT, TC_FROMSTRING, SA_HOR_CENTER); + DrawString(mapsize.left, mapsize.right, y + text_y_offset, STR_NETWORK_SERVER_LIST_MAP_SIZE_SHORT, TC_FROMSTRING, SA_HOR_CENTER); } if (nwi_header->IsWidgetVisible(WID_NG_DATE)) { /* current date */ - const NWidgetBase *nwi_date = this->GetWidget(WID_NG_DATE); + Rect date = this->GetWidget(WID_NG_DATE)->GetCurrentRect(); YearMonthDay ymd; ConvertDateToYMD(cur_item->info.game_date, &ymd); SetDParam(0, ymd.year); - DrawString(nwi_date->pos_x, nwi_date->pos_x + nwi_date->current_x - 1, y + text_y_offset, STR_JUST_INT, TC_BLACK, SA_HOR_CENTER); + DrawString(date.left, date.right, y + text_y_offset, STR_JUST_INT, TC_BLACK, SA_HOR_CENTER); } if (nwi_header->IsWidgetVisible(WID_NG_YEARS)) { /* number of years the game is running */ - const NWidgetBase *nwi_years = this->GetWidget(WID_NG_YEARS); + Rect years = this->GetWidget(WID_NG_YEARS)->GetCurrentRect(); YearMonthDay ymd_cur, ymd_start; ConvertDateToYMD(cur_item->info.game_date, &ymd_cur); ConvertDateToYMD(cur_item->info.start_date, &ymd_start); SetDParam(0, ymd_cur.year - ymd_start.year); - DrawString(nwi_years->pos_x, nwi_years->pos_x + nwi_years->current_x - 1, y + text_y_offset, STR_JUST_INT, TC_BLACK, SA_HOR_CENTER); + DrawString(years.left, years.right, y + text_y_offset, STR_JUST_INT, TC_BLACK, SA_HOR_CENTER); } /* draw a lock if the server is password protected */ - if (cur_item->info.use_password) DrawSprite(SPR_LOCK, PAL_NONE, nwi_info->pos_x + this->lock_offset, y + lock_y_offset); + if (cur_item->info.use_password) DrawSprite(SPR_LOCK, PAL_NONE, info.left + this->lock_offset, y + lock_y_offset); /* draw red or green icon, depending on compatibility with server */ - DrawSprite(SPR_BLOT, (cur_item->info.compatible ? PALETTE_TO_GREEN : (cur_item->info.version_compatible ? PALETTE_TO_YELLOW : PALETTE_TO_RED)), nwi_info->pos_x + this->blot_offset, y + icon_y_offset + 1); + DrawSprite(SPR_BLOT, (cur_item->info.compatible ? PALETTE_TO_GREEN : (cur_item->info.version_compatible ? PALETTE_TO_YELLOW : PALETTE_TO_RED)), info.left + this->blot_offset, y + icon_y_offset + 1); } } @@ -473,10 +478,6 @@ public: this->list_pos = SLP_INVALID; this->server = nullptr; - this->lock_offset = 5; - this->blot_offset = this->lock_offset + 3 + GetSpriteSize(SPR_LOCK).width; - this->flag_offset = this->blot_offset + 2 + GetSpriteSize(SPR_BLOT).width; - this->CreateNestedTree(); this->vscroll = this->GetScrollbar(WID_NG_SCROLLBAR); this->FinishInitNested(WN_NETWORK_WINDOW_GAME); @@ -512,17 +513,24 @@ public: this->last_sorting = this->servers.GetListing(); } + void OnInit() override + { + this->lock_offset = ScaleGUITrad(5); + this->blot_offset = this->lock_offset + ScaleGUITrad(3) + GetSpriteSize(SPR_LOCK).width; + this->flag_offset = this->blot_offset + ScaleGUITrad(2) + GetSpriteSize(SPR_BLOT).width; + } + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { switch (widget) { case WID_NG_MATRIX: - resize->height = WD_MATRIX_TOP + std::max(GetSpriteSize(SPR_BLOT).height, (uint)FONT_HEIGHT_NORMAL) + WD_MATRIX_BOTTOM; + resize->height = std::max(GetSpriteSize(SPR_BLOT).height, (uint)FONT_HEIGHT_NORMAL) + padding.height; fill->height = resize->height; size->height = 12 * resize->height; break; case WID_NG_LASTJOINED: - size->height = WD_MATRIX_TOP + std::max(GetSpriteSize(SPR_BLOT).height, (uint)FONT_HEIGHT_NORMAL) + WD_MATRIX_BOTTOM; + size->height = std::max(GetSpriteSize(SPR_BLOT).height, (uint)FONT_HEIGHT_NORMAL) + WidgetDimensions::scaled.matrix.Vertical(); break; case WID_NG_LASTJOINED_SPACER: @@ -634,15 +642,15 @@ public: NetworkGameList *sel = this->server; /* Height for the title banner */ - int HEADER_HEIGHT = 3 * FONT_HEIGHT_NORMAL + WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM; + int HEADER_HEIGHT = 3 * FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.frametext.Vertical(); - Rect hr = r.WithHeight(HEADER_HEIGHT).Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM); - Rect tr = r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM); + Rect hr = r.WithHeight(HEADER_HEIGHT).Shrink(WidgetDimensions::scaled.frametext); + Rect tr = r.Shrink(WidgetDimensions::scaled.frametext); tr.top += HEADER_HEIGHT; /* Draw the right menu */ /* Create the nice grayish rectangle at the details top */ - GfxFillRect(r.WithHeight(HEADER_HEIGHT).Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, 0), PC_DARK_BLUE); + GfxFillRect(r.WithHeight(HEADER_HEIGHT).Shrink(WidgetDimensions::scaled.bevel.left, WidgetDimensions::scaled.bevel.top, WidgetDimensions::scaled.bevel.right, 0), PC_DARK_BLUE); if (sel == nullptr) { DrawString(hr.left, hr.right, hr.top, STR_NETWORK_SERVER_LIST_GAME_INFO, TC_FROMSTRING, SA_HOR_CENTER); } else if (sel->status != NGLS_ONLINE) { @@ -704,7 +712,7 @@ public: tr.top = DrawStringMultiLine(tr, STR_NETWORK_SERVER_LIST_GAMESCRIPT); // gamescript name and version } - tr.top += WD_PAR_VSEP_WIDE; + tr.top += WidgetDimensions::scaled.vsep_wide; if (!sel->info.compatible) { DrawString(tr, sel->info.version_compatible ? STR_NETWORK_SERVER_LIST_GRF_MISMATCH : STR_NETWORK_SERVER_LIST_VERSION_MISMATCH, TC_FROMSTRING, SA_HOR_CENTER); // server mismatch @@ -959,7 +967,7 @@ static const NWidgetPart _nested_network_game_widgets[] = { EndContainer(), NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, WID_NG_DETAILS), NWidget(NWID_VERTICAL, NC_EQUALSIZE), SetPIP(5, 5, 5), - NWidget(WWT_EMPTY, INVALID_COLOUR, WID_NG_DETAILS_SPACER), SetMinimalSize(140, 0), SetMinimalTextLines(15, 24 + WD_PAR_VSEP_NORMAL), SetResize(0, 1), SetFill(1, 1), // Make sure it's at least this wide + NWidget(WWT_EMPTY, INVALID_COLOUR, WID_NG_DETAILS_SPACER), SetMinimalSize(140, 0), SetMinimalTextLines(15, 24 + WidgetDimensions::unscaled.vsep_normal), SetResize(0, 1), SetFill(1, 1), // Make sure it's at least this wide NWidget(NWID_HORIZONTAL, NC_NONE), SetPIP(5, 5, 5), NWidget(NWID_SELECTION, INVALID_COLOUR, WID_NG_NEWGRF_MISSING_SEL), NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NG_NEWGRF_MISSING), SetFill(1, 0), SetDataTip(STR_NEWGRF_SETTINGS_FIND_MISSING_CONTENT_BUTTON, STR_NEWGRF_SETTINGS_FIND_MISSING_CONTENT_TOOLTIP), @@ -1073,7 +1081,7 @@ struct NetworkStartServerWindow : public Window { switch (widget) { case WID_NSS_SETPWD: /* If password is set, draw red '*' next to 'Set password' button. */ - if (!_settings_client.network.server_password.empty()) DrawString(r.right + WD_FRAMERECT_LEFT, this->width - WD_FRAMERECT_RIGHT, r.top, "*", TC_RED); + if (!_settings_client.network.server_password.empty()) DrawString(r.right + WidgetDimensions::scaled.framerect.left, this->width - WidgetDimensions::scaled.framerect.right, r.top, "*", TC_RED); } } @@ -1438,8 +1446,8 @@ public: disabled(disabled) { Dimension d = GetSpriteSize(sprite); - this->height = d.height + ScaleGUITrad(WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM); - this->width = d.width + ScaleGUITrad(WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT); + this->height = d.height + WidgetDimensions::scaled.framerect.Vertical(); + this->width = d.width + WidgetDimensions::scaled.framerect.Horizontal(); } virtual ~ButtonCommon() {} @@ -1681,10 +1689,10 @@ private: ButtonCommon *GetButtonAtPoint(Point pt) { uint index = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_CL_MATRIX); - NWidgetBase *widget_matrix = this->GetWidget(WID_CL_MATRIX); + Rect matrix = this->GetWidget(WID_CL_MATRIX)->GetCurrentRect().Shrink(WidgetDimensions::scaled.framerect); bool rtl = _current_text_dir == TD_RTL; - uint x = rtl ? (uint)widget_matrix->pos_x + WD_FRAMERECT_LEFT : widget_matrix->current_x - WD_FRAMERECT_RIGHT; + uint x = rtl ? matrix.left : matrix.right; /* Find the buttons for this row. */ auto button_find = this->buttons.find(index); @@ -1699,7 +1707,7 @@ private: return button.get(); } - int width = button->width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; + int width = button->width + WidgetDimensions::scaled.framerect.Horizontal(); x += rtl ? width : -width; } @@ -1744,8 +1752,8 @@ public: case WID_CL_MATRIX: { uint height = std::max({GetSpriteSize(SPR_COMPANY_ICON).height, GetSpriteSize(SPR_JOIN).height, GetSpriteSize(SPR_ADMIN).height, GetSpriteSize(SPR_CHAT).height}); - height += ScaleGUITrad(WD_FRAMERECT_TOP) + ScaleGUITrad(WD_FRAMERECT_BOTTOM); - this->line_height = std::max(height, (uint)FONT_HEIGHT_NORMAL) + ScaleGUITrad(WD_MATRIX_TOP + WD_MATRIX_BOTTOM); + height += WidgetDimensions::scaled.framerect.Vertical(); + this->line_height = std::max(height, (uint)FONT_HEIGHT_NORMAL) + padding.height; resize->width = 1; resize->height = this->line_height; @@ -1836,14 +1844,14 @@ public: int index = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_CL_MATRIX); bool rtl = _current_text_dir == TD_RTL; - NWidgetBase *widget_matrix = this->GetWidget(WID_CL_MATRIX); + Rect matrix = this->GetWidget(WID_CL_MATRIX)->GetCurrentRect().Shrink(WidgetDimensions::scaled.framerect); Dimension d = GetSpriteSize(SPR_COMPANY_ICON); - uint text_left = widget_matrix->pos_x + (rtl ? (uint)WD_FRAMERECT_LEFT : d.width + 8); - uint text_right = widget_matrix->pos_x + widget_matrix->current_x - (rtl ? d.width + 8 : (uint)WD_FRAMERECT_RIGHT); + uint text_left = matrix.left + (rtl ? 0 : d.width + WidgetDimensions::scaled.hsep_wide); + uint text_right = matrix.right - (rtl ? d.width + WidgetDimensions::scaled.hsep_wide : 0); Dimension d2 = GetSpriteSize(SPR_PLAYER_SELF); - uint offset_x = CLIENT_OFFSET_LEFT - d2.width - 3; + uint offset_x = CLIENT_OFFSET_LEFT - d2.width - ScaleGUITrad(3); uint player_icon_x = rtl ? text_right - offset_x - d2.width : text_left + offset_x; @@ -1976,23 +1984,26 @@ public: * @param y The y-position to start with the buttons. * @param buttons The buttons to draw. */ - void DrawButtons(uint &x, uint y, const std::vector> &buttons) const + void DrawButtons(int &x, uint y, const std::vector> &buttons) const { + Rect r; + for (auto &button : buttons) { bool rtl = _current_text_dir == TD_RTL; - uint left = rtl ? x : x - button->width; - uint right = rtl ? x + button->width : x; + int offset = (this->line_height - button->height) / 2; + r.left = rtl ? x : x - button->width + 1; + r.right = rtl ? x + button->width - 1 : x; + r.top = y + offset; + r.bottom = r.top + button->height - 1; - int offset = std::max(0, ((int)(this->line_height + 1) - (int)button->height) / 2); - - DrawFrameRect(left, y + offset, right, y + offset + button->height, button->colour, FR_NONE); - DrawSprite(button->sprite, PAL_NONE, left + ScaleGUITrad(WD_FRAMERECT_LEFT), y + offset + ScaleGUITrad(WD_FRAMERECT_TOP)); + DrawFrameRect(r, button->colour, FR_NONE); + DrawSprite(button->sprite, PAL_NONE, r.left + WidgetDimensions::scaled.framerect.left, r.top + WidgetDimensions::scaled.framerect.top); if (button->disabled) { - GfxFillRect(left + 1, y + offset + 1, right - 1, y + offset + button->height - 1, _colour_gradient[button->colour & 0xF][2], FILLRECT_CHECKER); + GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), _colour_gradient[button->colour & 0xF][2], FILLRECT_CHECKER); } - int width = button->width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; + int width = button->width + WidgetDimensions::scaled.hsep_normal; x += rtl ? width : -width; } } @@ -2000,30 +2011,27 @@ public: /** * Draw a company and its clients on the matrix. * @param company_id The company to draw. - * @param left The most left pixel of the line. - * @param right The most right pixel of the line. - * @param top The top of the first line. + * @param r The rect to draw within. * @param line The Nth line we are drawing. Updated during this function. */ - void DrawCompany(CompanyID company_id, uint left, uint right, uint top, uint &line) const + void DrawCompany(CompanyID company_id, const Rect &r, uint &line) const { bool rtl = _current_text_dir == TD_RTL; - int text_y_offset = std::max(0, ((int)(this->line_height + 1) - (int)FONT_HEIGHT_NORMAL) / 2) + WD_MATRIX_BOTTOM; + int text_y_offset = CenterBounds(0, this->line_height, FONT_HEIGHT_NORMAL); Dimension d = GetSpriteSize(SPR_COMPANY_ICON); - int offset = std::max(0, ((int)(this->line_height + 1) - (int)d.height) / 2); - - uint text_left = left + (rtl ? (uint)WD_FRAMERECT_LEFT : d.width + 8); - uint text_right = right - (rtl ? d.width + 8 : (uint)WD_FRAMERECT_RIGHT); + int offset = CenterBounds(0, this->line_height, d.height); uint line_start = this->vscroll->GetPosition(); uint line_end = line_start + this->vscroll->GetCapacity(); - uint y = top + (this->line_height * (line - line_start)); + uint y = r.top + (this->line_height * (line - line_start)); /* Draw the company line (if in range of scrollbar). */ if (IsInsideMM(line, line_start, line_end)) { - uint x = rtl ? text_left : text_right; + int icon_left = r.WithWidth(d.width, rtl).left; + Rect tr = r.Indent(d.width + WidgetDimensions::scaled.hsep_normal, rtl); + int &x = rtl ? tr.left : tr.right; /* If there are buttons for this company, draw them. */ auto button_find = this->buttons.find(line); @@ -2032,17 +2040,17 @@ public: } if (company_id == COMPANY_SPECTATOR) { - DrawSprite(SPR_COMPANY_ICON, PALETTE_TO_GREY, rtl ? right - d.width - 4 : left + 4, y + offset); - DrawString(rtl ? x : text_left, rtl ? text_right : x, y + text_y_offset, STR_NETWORK_CLIENT_LIST_SPECTATORS, TC_SILVER); + DrawSprite(SPR_COMPANY_ICON, PALETTE_TO_GREY, icon_left, y + offset); + DrawString(tr.left, tr.right, y + text_y_offset, STR_NETWORK_CLIENT_LIST_SPECTATORS, TC_SILVER); } else if (company_id == COMPANY_NEW_COMPANY) { - DrawSprite(SPR_COMPANY_ICON, PALETTE_TO_GREY, rtl ? right - d.width - 4 : left + 4, y + offset); - DrawString(rtl ? x : text_left, rtl ? text_right : x, y + text_y_offset, STR_NETWORK_CLIENT_LIST_NEW_COMPANY, TC_WHITE); + DrawSprite(SPR_COMPANY_ICON, PALETTE_TO_GREY, icon_left, y + offset); + DrawString(tr.left, tr.right, y + text_y_offset, STR_NETWORK_CLIENT_LIST_NEW_COMPANY, TC_WHITE); } else { - DrawCompanyIcon(company_id, rtl ? right - d.width - 4 : left + 4, y + offset); + DrawCompanyIcon(company_id, icon_left, y + offset); SetDParam(0, company_id); SetDParam(1, company_id); - DrawString(rtl ? x : text_left, rtl ? text_right : x, y + text_y_offset, STR_COMPANY_NAME, TC_SILVER); + DrawString(tr.left, tr.right, y + text_y_offset, STR_COMPANY_NAME, TC_SILVER); } } @@ -2054,11 +2062,12 @@ public: /* Draw the player line (if in range of scrollbar). */ if (IsInsideMM(line, line_start, line_end)) { - uint x = rtl ? text_left : text_right; + Rect tr = r.Indent(WidgetDimensions::scaled.hsep_indent, rtl); /* If there are buttons for this client, draw them. */ auto button_find = this->buttons.find(line); if (button_find != this->buttons.end()) { + int &x = rtl ? tr.left : tr.right; this->DrawButtons(x, y, button_find->second); } @@ -2071,13 +2080,13 @@ public: if (player_icon != 0) { Dimension d2 = GetSpriteSize(player_icon); - uint offset_x = CLIENT_OFFSET_LEFT - 3; - int offset_y = std::max(0, ((int)(this->line_height + 1) - (int)d2.height) / 2); - DrawSprite(player_icon, PALETTE_TO_GREY, rtl ? text_right - offset_x : text_left + offset_x - d2.width, y + offset_y); + int offset_y = CenterBounds(0, this->line_height, d2.height); + DrawSprite(player_icon, PALETTE_TO_GREY, rtl ? tr.right - d2.width : tr.left, y + offset_y); + tr = tr.Indent(d2.width + WidgetDimensions::scaled.hsep_normal, rtl); } SetDParamStr(0, ci->client_name); - DrawString(rtl ? x : text_left + CLIENT_OFFSET_LEFT, rtl ? text_right - CLIENT_OFFSET_LEFT : x, y + text_y_offset, STR_JUST_RAW_STRING, TC_BLACK); + DrawString(tr.left, tr.right, y + text_y_offset, STR_JUST_RAW_STRING, TC_BLACK); } y += this->line_height; @@ -2089,31 +2098,32 @@ public: { switch (widget) { case WID_CL_MATRIX: { + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect, RectPadding::zero); uint line = 0; if (this->hover_index >= 0) { Rect br = r.WithHeight(this->line_height).Translate(0, this->hover_index * this->line_height); - GfxFillRect(br.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), GREY_SCALE(9)); + GfxFillRect(br.Shrink(WidgetDimensions::scaled.bevel), GREY_SCALE(9)); } NetworkClientInfo *own_ci = NetworkClientInfo::GetByClientID(_network_own_client_id); CompanyID client_playas = own_ci == nullptr ? COMPANY_SPECTATOR : own_ci->client_playas; if (client_playas == COMPANY_SPECTATOR && !NetworkMaxCompaniesReached()) { - this->DrawCompany(COMPANY_NEW_COMPANY, r.left, r.right, r.top, line); + this->DrawCompany(COMPANY_NEW_COMPANY, ir, line); } if (client_playas != COMPANY_SPECTATOR) { - this->DrawCompany(client_playas, r.left, r.right, r.top, line); + this->DrawCompany(client_playas, ir, line); } for (const Company *c : Company::Iterate()) { if (client_playas == c->index) continue; - this->DrawCompany(c->index, r.left, r.right, r.top, line); + this->DrawCompany(c->index, ir, line); } /* Spectators */ - this->DrawCompany(COMPANY_SPECTATOR, r.left, r.right, r.top, line); + this->DrawCompany(COMPANY_SPECTATOR, ir, line); break; } @@ -2160,8 +2170,10 @@ struct NetworkJoinStatusWindow : Window { { if (widget != WID_NJS_BACKGROUND) return; + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); + uint8 progress; // used for progress bar - DrawString(r.left + 2, r.right - 2, r.top + 20, STR_NETWORK_CONNECTING_1 + _network_join_status, TC_FROMSTRING, SA_HOR_CENTER); + DrawString(ir.left, ir.right, ir.top + 20, STR_NETWORK_CONNECTING_1 + _network_join_status, TC_FROMSTRING, SA_HOR_CENTER); switch (_network_join_status) { case NETWORK_JOIN_STATUS_CONNECTING: case NETWORK_JOIN_STATUS_AUTHORIZING: case NETWORK_JOIN_STATUS_GETTING_COMPANY_INFO: @@ -2169,13 +2181,13 @@ struct NetworkJoinStatusWindow : Window { break; case NETWORK_JOIN_STATUS_WAITING: SetDParam(0, _network_join_waiting); - DrawString(r.left + 2, r.right - 2, r.top + 20 + FONT_HEIGHT_NORMAL, STR_NETWORK_CONNECTING_WAITING, TC_FROMSTRING, SA_HOR_CENTER); + DrawString(ir.left, ir.right, ir.top + 20 + FONT_HEIGHT_NORMAL, STR_NETWORK_CONNECTING_WAITING, TC_FROMSTRING, SA_HOR_CENTER); progress = 15; // third stage is 15% break; case NETWORK_JOIN_STATUS_DOWNLOADING: SetDParam(0, _network_join_bytes); SetDParam(1, _network_join_bytes_total); - DrawString(r.left + 2, r.right - 2, r.top + 20 + FONT_HEIGHT_NORMAL, _network_join_bytes_total == 0 ? STR_NETWORK_CONNECTING_DOWNLOADING_1 : STR_NETWORK_CONNECTING_DOWNLOADING_2, TC_FROMSTRING, SA_HOR_CENTER); + DrawString(ir.left, ir.right, ir.top + 20 + FONT_HEIGHT_NORMAL, _network_join_bytes_total == 0 ? STR_NETWORK_CONNECTING_DOWNLOADING_1 : STR_NETWORK_CONNECTING_DOWNLOADING_2, TC_FROMSTRING, SA_HOR_CENTER); if (_network_join_bytes_total == 0) { progress = 15; // We don't have the final size yet; the server is still compressing! break; @@ -2213,7 +2225,7 @@ struct NetworkJoinStatusWindow : Window { width = std::max(width, GetStringBoundingBox(STR_NETWORK_CONNECTING_DOWNLOADING_2).width); /* Give a bit more clearing for the widest strings than strictly needed */ - size->width = width + WD_FRAMERECT_LEFT + WD_FRAMERECT_BOTTOM + 10; + size->width = width + padding.width + WidgetDimensions::scaled.hsep_indent; } void OnClick(Point pt, int widget, int click_count) override @@ -2300,9 +2312,9 @@ struct NetworkCompanyPasswordWindow : public Window { void UpdateWarningStringSize() { assert(this->nested_root->smallest_x > 0); - this->warning_size.width = this->nested_root->current_x - (WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT); + this->warning_size.width = this->nested_root->current_x - (WidgetDimensions::scaled.framerect.Horizontal()) * 2; this->warning_size.height = GetStringHeight(STR_WARNING_PASSWORD_SECURITY, this->warning_size.width); - this->warning_size.height += WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + this->warning_size.height += (WidgetDimensions::scaled.framerect.Vertical()) * 2; this->ReInit(); } @@ -2318,7 +2330,7 @@ struct NetworkCompanyPasswordWindow : public Window { { if (widget != WID_NCP_WARNING) return; - DrawStringMultiLine(r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMERECT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMERECT_BOTTOM), + DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.framerect), STR_WARNING_PASSWORD_SECURITY, TC_FROMSTRING, SA_CENTER); } @@ -2411,14 +2423,14 @@ struct NetworkAskRelayWindow : public Window { { if (widget == WID_NAR_TEXT) { *size = GetStringBoundingBox(STR_NETWORK_ASK_RELAY_TEXT); - size->height = GetStringHeight(STR_NETWORK_ASK_RELAY_TEXT, size->width - WD_FRAMETEXT_LEFT - WD_FRAMETEXT_RIGHT) + WD_FRAMETEXT_BOTTOM + WD_FRAMETEXT_TOP; + size->height = GetStringHeight(STR_NETWORK_ASK_RELAY_TEXT, size->width - WidgetDimensions::scaled.frametext.Horizontal()) + WidgetDimensions::scaled.frametext.Vertical(); } } void DrawWidget(const Rect &r, int widget) const override { if (widget == WID_NAR_TEXT) { - DrawStringMultiLine(r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM), STR_NETWORK_ASK_RELAY_TEXT, TC_FROMSTRING, SA_CENTER); + DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.frametext), STR_NETWORK_ASK_RELAY_TEXT, TC_FROMSTRING, SA_CENTER); } } diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index ab8efcffb8..91d2c8de84 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -371,15 +371,15 @@ struct NewGRFInspectWindow : Window { case WID_NGRFI_VEH_CHAIN: { assert(this->HasChainIndex()); GrfSpecFeature f = GetFeatureNum(this->window_number); - size->height = std::max(size->height, GetVehicleImageCellSize((VehicleType)(VEH_TRAIN + (f - GSF_TRAINS)), EIT_IN_DEPOT).height + 2 + WD_BEVEL_TOP + WD_BEVEL_BOTTOM); + size->height = std::max(size->height, GetVehicleImageCellSize((VehicleType)(VEH_TRAIN + (f - GSF_TRAINS)), EIT_IN_DEPOT).height + 2 + WidgetDimensions::scaled.bevel.Vertical()); break; } case WID_NGRFI_MAINPANEL: - resize->height = std::max(11, FONT_HEIGHT_NORMAL + 1); + resize->height = std::max(11, FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal); resize->width = 1; - size->height = 5 * resize->height + WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM; + size->height = 5 * resize->height + WidgetDimensions::scaled.frametext.Vertical(); break; } } @@ -402,7 +402,7 @@ struct NewGRFInspectWindow : Window { offset -= this->vscroll->GetPosition(); if (offset < 0 || offset >= this->vscroll->GetCapacity()) return; - ::DrawString(r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP + (offset * this->resize.step_height), WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM), buf, TC_BLACK); + ::DrawString(r.Shrink(WidgetDimensions::scaled.frametext).Shrink(0, offset * this->resize.step_height, 0, 0), buf, TC_BLACK); } void DrawWidget(const Rect &r, int widget) const override @@ -423,7 +423,7 @@ struct NewGRFInspectWindow : Window { if (u == v) sel_end = total_width; } - Rect br = r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM); + Rect br = r.Shrink(WidgetDimensions::scaled.bevel); int width = br.Width(); int skip = 0; if (total_width > width) { @@ -580,7 +580,7 @@ struct NewGRFInspectWindow : Window { if (nif->variables == nullptr) return; /* Get the line, make sure it's within the boundaries. */ - int line = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_NGRFI_MAINPANEL, WD_FRAMETEXT_TOP); + int line = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_NGRFI_MAINPANEL, WidgetDimensions::scaled.frametext.top); if (line == INT_MAX) return; /* Find the variable related to the line */ @@ -606,7 +606,7 @@ struct NewGRFInspectWindow : Window { void OnResize() override { - this->vscroll->SetCapacityFromWidget(this, WID_NGRFI_MAINPANEL, WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM); + this->vscroll->SetCapacityFromWidget(this, WID_NGRFI_MAINPANEL, WidgetDimensions::scaled.frametext.Vertical()); } /** @@ -874,7 +874,7 @@ struct SpriteAlignerWindow : Window { case WID_SA_SPRITE: { /* Center the sprite ourselves */ const Sprite *spr = GetSprite(this->current_sprite, ST_NORMAL); - Rect ir = r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM); + Rect ir = r.Shrink(WidgetDimensions::scaled.bevel); int x = -UnScaleGUI(spr->x_offs) + (ir.Width() - UnScaleGUI(spr->width) ) / 2; int y = -UnScaleGUI(spr->y_offs) + (ir.Height() - UnScaleGUI(spr->height)) / 2; @@ -897,7 +897,7 @@ struct SpriteAlignerWindow : Window { std::vector &list = _newgrf_debug_sprite_picker.sprites; int max = std::min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), (uint)list.size()); - Rect ir = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); for (int i = this->vscroll->GetPosition(); i < max; i++) { SetDParam(0, list[i]); DrawString(ir, STR_BLACK_COMMA, TC_FROMSTRING, SA_RIGHT | SA_FORCE); diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 2ff58e8077..5d09cf1b7f 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -68,7 +68,7 @@ void ShowNewGRFError() static void ShowNewGRFInfo(const GRFConfig *c, const Rect &r, bool show_params) { - Rect tr = r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.frametext); if (c->error != nullptr) { char message[512]; SetDParamStr(0, c->error->custom_message); // is skipped by built-in messages @@ -213,7 +213,7 @@ struct NewGRFParametersWindow : public Window { } case WID_NP_BACKGROUND: - this->line_height = std::max(SETTING_BUTTON_HEIGHT, FONT_HEIGHT_NORMAL) + WD_MATRIX_TOP + WD_MATRIX_BOTTOM; + this->line_height = std::max(SETTING_BUTTON_HEIGHT, FONT_HEIGHT_NORMAL) + padding.height; resize->width = 1; resize->height = this->line_height; @@ -222,14 +222,14 @@ struct NewGRFParametersWindow : public Window { case WID_NP_DESCRIPTION: /* Minimum size of 4 lines. The 500 is the default size of the window. */ - Dimension suggestion = {500 - WD_FRAMERECT_LEFT - WD_FRAMERECT_RIGHT, (uint)FONT_HEIGHT_NORMAL * 4 + WD_TEXTPANEL_TOP + WD_TEXTPANEL_BOTTOM}; + Dimension suggestion = {500U - WidgetDimensions::scaled.frametext.Horizontal(), (uint)FONT_HEIGHT_NORMAL * 4 + WidgetDimensions::scaled.frametext.Vertical()}; for (uint i = 0; i < this->grf_config->param_info.size(); i++) { const GRFParameterInfo *par_info = this->grf_config->param_info[i]; if (par_info == nullptr) continue; const char *desc = GetGRFStringFromGRFText(par_info->desc); if (desc == nullptr) continue; Dimension d = GetStringMultiLineBoundingBox(desc, suggestion); - d.height += WD_TEXTPANEL_TOP + WD_TEXTPANEL_BOTTOM; + d.height += WidgetDimensions::scaled.frametext.Vertical(); suggestion = maxdim(d, suggestion); } size->height = suggestion.height; @@ -253,16 +253,16 @@ struct NewGRFParametersWindow : public Window { if (par_info == nullptr) return; const char *desc = GetGRFStringFromGRFText(par_info->desc); if (desc == nullptr) return; - DrawStringMultiLine(r.Shrink(WD_FRAMERECT_LEFT, WD_TEXTPANEL_TOP, WD_FRAMERECT_RIGHT, WD_TEXTPANEL_BOTTOM), desc, TC_BLACK); + DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.framerect), desc, TC_BLACK); return; } else if (widget != WID_NP_BACKGROUND) { return; } - Rect ir = r.Shrink(WD_FRAMERECT_LEFT, 0, WD_FRAMERECT_RIGHT, 0); + Rect ir = r.Shrink(WidgetDimensions::scaled.frametext, RectPadding::zero); bool rtl = _current_text_dir == TD_RTL; - uint buttons_left = rtl ? ir.right - SETTING_BUTTON_WIDTH - 3 : ir.left + 4; - Rect tr = r.Indent(SETTING_BUTTON_WIDTH + 8, rtl); + uint buttons_left = rtl ? ir.right - SETTING_BUTTON_WIDTH : ir.left; + Rect tr = ir.Indent(SETTING_BUTTON_WIDTH + WidgetDimensions::scaled.hsep_wide, rtl); int button_y_offset = (this->line_height - SETTING_BUTTON_HEIGHT) / 2; int text_y_offset = (this->line_height - FONT_HEIGHT_NORMAL) / 2; @@ -347,10 +347,9 @@ struct NewGRFParametersWindow : public Window { this->clicked_dropdown = false; } - const NWidgetBase *wid = this->GetWidget(WID_NP_BACKGROUND); - int x = pt.x - wid->pos_x; - if (_current_text_dir == TD_RTL) x = wid->current_x - 1 - x; - x -= 4; + Rect r = this->GetWidget(widget)->GetCurrentRect().Shrink(WidgetDimensions::scaled.frametext, RectPadding::zero); + int x = pt.x - r.left; + if (_current_text_dir == TD_RTL) x = r.Width() - 1 - x; GRFParameterInfo *par_info = (num < this->grf_config->param_info.size()) ? this->grf_config->param_info[num] : nullptr; if (par_info == nullptr) par_info = GetDummyParameterInfo(num); @@ -364,8 +363,7 @@ struct NewGRFParametersWindow : public Window { this->clicked_dropdown = false; this->closing_dropdown = false; } else { - const NWidgetBase *wid = this->GetWidget(WID_NP_BACKGROUND); - int rel_y = (pt.y - (int)wid->pos_y) % this->line_height; + int rel_y = (pt.y - r.top) % this->line_height; Rect wi_rect; wi_rect.left = pt.x - (_current_text_dir == TD_RTL ? SETTING_BUTTON_WIDTH - 1 - x : x);; @@ -731,25 +729,28 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { case WID_NS_FILE_LIST: { Dimension d = maxdim(GetSpriteSize(SPR_SQUARE), GetSpriteSize(SPR_WARNING_SIGN)); - resize->height = std::max(d.height + 2U, FONT_HEIGHT_NORMAL + 2U); + resize->height = std::max(d.height + 2U, FONT_HEIGHT_NORMAL); size->height = std::max(size->height, padding.height + 6 * resize->height); break; } case WID_NS_AVAIL_LIST: - resize->height = std::max(12, FONT_HEIGHT_NORMAL + 2); + { + Dimension d = maxdim(GetSpriteSize(SPR_SQUARE), GetSpriteSize(SPR_WARNING_SIGN)); + resize->height = std::max(d.height + 2U, FONT_HEIGHT_NORMAL); size->height = std::max(size->height, padding.height + 8 * resize->height); break; + } case WID_NS_NEWGRF_INFO_TITLE: { Dimension dim = GetStringBoundingBox(STR_NEWGRF_SETTINGS_INFO_TITLE); - size->height = std::max(size->height, dim.height + WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM); - size->width = std::max(size->width, dim.width + WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT); + size->height = std::max(size->height, dim.height + WidgetDimensions::scaled.frametext.Vertical()); + size->width = std::max(size->width, dim.width + WidgetDimensions::scaled.frametext.Horizontal()); break; } case WID_NS_NEWGRF_INFO: - size->height = std::max(size->height, WD_FRAMERECT_TOP + 10 * FONT_HEIGHT_NORMAL + WD_FRAMERECT_BOTTOM + padding.height + 2); + size->height = std::max(size->height, WidgetDimensions::scaled.framerect.Vertical() + 10 * FONT_HEIGHT_NORMAL); break; case WID_NS_PRESET_LIST: { @@ -833,10 +834,10 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { { switch (widget) { case WID_NS_FILE_LIST: { - const Rect br = r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM); + const Rect br = r.Shrink(WidgetDimensions::scaled.bevel); GfxFillRect(br, PC_BLACK); - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); uint step_height = this->GetWidget(WID_NS_FILE_LIST)->resize_y; Dimension square = GetSpriteSize(SPR_SQUARE); Dimension warning = GetSpriteSize(SPR_WARNING_SIGN); @@ -882,10 +883,10 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { } case WID_NS_AVAIL_LIST: { - const Rect br = r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM); + const Rect br = r.Shrink(WidgetDimensions::scaled.bevel); GfxFillRect(br, this->active_over == -2 ? PC_DARK_GREY : PC_BLACK); - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); uint step_height = this->GetWidget(WID_NS_AVAIL_LIST)->resize_y; int offset_y = (step_height - FONT_HEIGHT_NORMAL) / 2; uint min_index = this->vscroll2->GetPosition(); @@ -903,11 +904,12 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { break; } - case WID_NS_NEWGRF_INFO_TITLE: + case WID_NS_NEWGRF_INFO_TITLE: { /* Create the nice grayish rectangle at the details top. */ - GfxFillRect(r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), PC_DARK_BLUE); + GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), PC_DARK_BLUE); DrawString(r.left, r.right, CenterBounds(r.top, r.bottom, FONT_HEIGHT_NORMAL), STR_NEWGRF_SETTINGS_INFO_TITLE, TC_FROMSTRING, SA_HOR_CENTER); break; + } case WID_NS_NEWGRF_INFO: { const GRFConfig *selected = this->active_sel; @@ -1782,8 +1784,8 @@ public: } }; -const uint NWidgetNewGRFDisplay::INTER_LIST_SPACING = WD_RESIZEBOX_WIDTH + 1; -const uint NWidgetNewGRFDisplay::INTER_COLUMN_SPACING = WD_RESIZEBOX_WIDTH; +const uint NWidgetNewGRFDisplay::INTER_COLUMN_SPACING = 12; +const uint NWidgetNewGRFDisplay::INTER_LIST_SPACING = NWidgetNewGRFDisplay::INTER_COLUMN_SPACING + 1; const uint NWidgetNewGRFDisplay::MAX_EXTRA_INFO_WIDTH = 150; const uint NWidgetNewGRFDisplay::MIN_EXTRA_FOR_3_COLUMNS = 50; @@ -1791,7 +1793,7 @@ static const NWidgetPart _nested_newgrf_actives_widgets[] = { /* Left side, presets. */ NWidget(NWID_HORIZONTAL), NWidget(WWT_TEXT, COLOUR_MAUVE), SetDataTip(STR_NEWGRF_SETTINGS_SELECT_PRESET, STR_NULL), - SetPadding(0, WD_FRAMETEXT_RIGHT, 0, 0), + SetPadding(0, WidgetDimensions::unscaled.frametext.right, 0, 0), NWidget(WWT_DROPDOWN, COLOUR_YELLOW, WID_NS_PRESET_LIST), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_JUST_STRING, STR_NEWGRF_SETTINGS_PRESET_LIST_TOOLTIP), EndContainer(), @@ -1802,10 +1804,10 @@ static const NWidgetPart _nested_newgrf_actives_widgets[] = { SetDataTip(STR_NEWGRF_SETTINGS_PRESET_DELETE, STR_NEWGRF_SETTINGS_PRESET_DELETE_TOOLTIP), EndContainer(), - NWidget(NWID_SPACER), SetMinimalSize(0, WD_RESIZEBOX_WIDTH), SetResize(1, 0), SetFill(1, 0), + NWidget(NWID_SPACER), SetMinimalSize(0, NWidgetNewGRFDisplay::INTER_COLUMN_SPACING), SetResize(1, 0), SetFill(1, 0), NWidget(WWT_PANEL, COLOUR_MAUVE), NWidget(WWT_LABEL, COLOUR_MAUVE), SetDataTip(STR_NEWGRF_SETTINGS_ACTIVE_LIST, STR_NULL), - SetFill(1, 0), SetResize(1, 0), SetPadding(3, WD_FRAMETEXT_RIGHT, 0, WD_FRAMETEXT_LEFT), + SetFill(1, 0), SetResize(1, 0), SetPadding(3, WidgetDimensions::unscaled.frametext.right, 0, WidgetDimensions::unscaled.frametext.left), /* Left side, active grfs. */ NWidget(NWID_HORIZONTAL), SetPadding(0, 2, 0, 2), NWidget(WWT_PANEL, COLOUR_MAUVE), @@ -1817,7 +1819,7 @@ static const NWidgetPart _nested_newgrf_actives_widgets[] = { EndContainer(), /* Buttons. */ NWidget(NWID_SELECTION, INVALID_COLOUR, WID_NS_SHOW_REMOVE), - NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPadding(2, 2, 2, 2), SetPIP(0, WD_RESIZEBOX_WIDTH, 0), + NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPadding(2, 2, 2, 2), SetPIP(0, NWidgetNewGRFDisplay::INTER_COLUMN_SPACING, 0), NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_NS_REMOVE), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_NEWGRF_SETTINGS_REMOVE, STR_NEWGRF_SETTINGS_REMOVE_TOOLTIP), NWidget(NWID_VERTICAL), @@ -1843,10 +1845,10 @@ static const NWidgetPart _nested_newgrf_actives_widgets[] = { static const NWidgetPart _nested_newgrf_availables_widgets[] = { NWidget(WWT_PANEL, COLOUR_MAUVE), NWidget(WWT_LABEL, COLOUR_MAUVE), SetDataTip(STR_NEWGRF_SETTINGS_INACTIVE_LIST, STR_NULL), - SetFill(1, 0), SetResize(1, 0), SetPadding(3, WD_FRAMETEXT_RIGHT, 0, WD_FRAMETEXT_LEFT), + SetFill(1, 0), SetResize(1, 0), SetPadding(3, WidgetDimensions::unscaled.frametext.right, 0, WidgetDimensions::unscaled.frametext.left), /* Left side, available grfs, filter edit box. */ - NWidget(NWID_HORIZONTAL), SetPadding(WD_TEXTPANEL_TOP, 0, WD_TEXTPANEL_BOTTOM, 0), - SetPIP(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_RIGHT), + NWidget(NWID_HORIZONTAL), SetPadding(WidgetDimensions::unscaled.frametext.top, 0, WidgetDimensions::unscaled.frametext.bottom, 0), + SetPIP(WidgetDimensions::unscaled.frametext.left, WidgetDimensions::unscaled.frametext.right, WidgetDimensions::unscaled.frametext.right), NWidget(WWT_TEXT, COLOUR_MAUVE), SetFill(0, 1), SetDataTip(STR_NEWGRF_FILTER_TITLE, STR_NULL), NWidget(WWT_EDITBOX, COLOUR_MAUVE, WID_NS_FILTER), SetFill(1, 0), SetMinimalSize(50, 12), SetResize(1, 0), SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP), @@ -1861,7 +1863,7 @@ static const NWidgetPart _nested_newgrf_availables_widgets[] = { NWidget(NWID_VSCROLLBAR, COLOUR_MAUVE, WID_NS_SCROLL2BAR), EndContainer(), /* Left side, available grfs, buttons. */ - NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPadding(2, 2, 2, 2), SetPIP(0, WD_RESIZEBOX_WIDTH, 0), + NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPadding(2, 2, 2, 2), SetPIP(0, NWidgetNewGRFDisplay::INTER_COLUMN_SPACING, 0), NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_NS_ADD), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_NEWGRF_SETTINGS_ADD, STR_NEWGRF_SETTINGS_ADD_FILE_TOOLTIP), NWidget(NWID_VERTICAL), @@ -1894,7 +1896,7 @@ static const NWidgetPart _nested_newgrf_infopanel_widgets[] = { EndContainer(), NWidget(NWID_SELECTION, INVALID_COLOUR, WID_NS_SHOW_APPLY), /* Right side, buttons. */ - NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(0, WD_RESIZEBOX_WIDTH, 0), + NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(0, NWidgetNewGRFDisplay::INTER_COLUMN_SPACING, 0), NWidget(NWID_VERTICAL), NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_NS_SET_PARAMETERS), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_NEWGRF_SETTINGS_SET_PARAMETERS, STR_NULL), @@ -1932,7 +1934,7 @@ static const NWidgetPart _nested_newgrf_widgets[] = { NWidget(WWT_DEFSIZEBOX, COLOUR_MAUVE), EndContainer(), NWidget(WWT_PANEL, COLOUR_MAUVE), - NWidgetFunction(NewGRFDisplay), SetPadding(WD_RESIZEBOX_WIDTH, WD_RESIZEBOX_WIDTH, 2, WD_RESIZEBOX_WIDTH), + NWidgetFunction(NewGRFDisplay), SetPadding(NWidgetNewGRFDisplay::INTER_COLUMN_SPACING, NWidgetNewGRFDisplay::INTER_COLUMN_SPACING, 2, NWidgetNewGRFDisplay::INTER_COLUMN_SPACING), /* Resize button. */ NWidget(NWID_HORIZONTAL), NWidget(NWID_SPACER), SetFill(1, 0), SetResize(1, 0), @@ -2009,11 +2011,13 @@ static const NWidgetPart _nested_save_preset_widgets[] = { EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY), NWidget(NWID_HORIZONTAL), - NWidget(WWT_INSET, COLOUR_GREY, WID_SVP_PRESET_LIST), SetPadding(2, 1, 0, 2), + NWidget(WWT_INSET, COLOUR_GREY, WID_SVP_PRESET_LIST), SetPadding(2, 1, 2, 2), SetDataTip(0x0, STR_SAVE_PRESET_LIST_TOOLTIP), SetResize(1, 10), SetScrollbar(WID_SVP_SCROLLBAR), EndContainer(), NWidget(NWID_VSCROLLBAR, COLOUR_GREY, WID_SVP_SCROLLBAR), EndContainer(), - NWidget(WWT_EDITBOX, COLOUR_GREY, WID_SVP_EDITBOX), SetPadding(3, 2, 2, 2), SetFill(1, 0), SetResize(1, 0), + EndContainer(), + NWidget(WWT_PANEL, COLOUR_GREY), + NWidget(WWT_EDITBOX, COLOUR_GREY, WID_SVP_EDITBOX), SetPadding(2, 2, 2, 2), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_SAVE_PRESET_TITLE, STR_SAVE_PRESET_EDITBOX_TOOLTIP), EndContainer(), NWidget(NWID_HORIZONTAL), @@ -2076,14 +2080,14 @@ struct SavePresetWindow : public Window { { switch (widget) { case WID_SVP_PRESET_LIST: { - resize->height = FONT_HEIGHT_NORMAL + 2U; + resize->height = FONT_HEIGHT_NORMAL; size->height = 0; for (uint i = 0; i < this->presets.size(); i++) { Dimension d = GetStringBoundingBox(this->presets[i].c_str()); - size->width = std::max(size->width, d.width + WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT); + size->width = std::max(size->width, d.width + padding.width); resize->height = std::max(resize->height, d.height); } - size->height = ClampU((uint)this->presets.size(), 5, 20) * resize->height + 1; + size->height = ClampU((uint)this->presets.size(), 5, 20) * resize->height + padding.height; break; } } @@ -2093,12 +2097,12 @@ struct SavePresetWindow : public Window { { switch (widget) { case WID_SVP_PRESET_LIST: { - const Rect br = r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM); + const Rect br = r.Shrink(WidgetDimensions::scaled.bevel); GfxFillRect(br, PC_BLACK); uint step_height = this->GetWidget(WID_SVP_PRESET_LIST)->resize_y; int offset_y = (step_height - FONT_HEIGHT_NORMAL) / 2; - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); uint min_index = this->vscroll->GetPosition(); uint max_index = std::min(min_index + this->vscroll->GetCapacity(), (uint)this->presets.size()); @@ -2214,7 +2218,7 @@ struct ScanProgressWindow : public Window { /* We really don't know the width. We could determine it by scanning the NewGRFs, * but this is the status window for scanning them... */ size->width = std::max(400U, GetStringBoundingBox(STR_NEWGRF_SCAN_STATUS).width); - size->height = FONT_HEIGHT_NORMAL * 2 + WD_PAR_VSEP_NORMAL; + size->height = FONT_HEIGHT_NORMAL * 2 + WidgetDimensions::scaled.vsep_normal; break; } } @@ -2225,10 +2229,11 @@ struct ScanProgressWindow : public Window { case WID_SP_PROGRESS_BAR: { /* Draw the % complete with a bar and a text */ DrawFrameRect(r.left, r.top, r.right, r.bottom, COLOUR_GREY, FR_BORDERONLY); + Rect ir = r.Shrink(WidgetDimensions::scaled.bevel); uint percent = scanned * 100 / std::max(1U, _settings_client.gui.last_newgrf_count); - DrawFrameRect(r.left + 1, r.top + 1, (int)((r.right - r.left - 2) * percent / 100) + r.left + 1, r.bottom - 1, COLOUR_MAUVE, FR_NONE); + DrawFrameRect(ir.left, ir.top, ir.left + (ir.Width() - 1) * percent / 100, ir.bottom, COLOUR_MAUVE, FR_NONE); SetDParam(0, percent); - DrawString(r.left, r.right, r.top + 5, STR_GENERATION_PROGRESS, TC_FROMSTRING, SA_HOR_CENTER); + DrawString(ir.left, ir.right, CenterBounds(ir.top, ir.bottom, FONT_HEIGHT_NORMAL), STR_GENERATION_PROGRESS, TC_FROMSTRING, SA_HOR_CENTER); break; } @@ -2237,7 +2242,7 @@ struct ScanProgressWindow : public Window { SetDParam(1, _settings_client.gui.last_newgrf_count); DrawString(r.left, r.right, r.top, STR_NEWGRF_SCAN_STATUS, TC_FROMSTRING, SA_HOR_CENTER); - DrawString(r.left, r.right, r.top + FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL, this->last_name == nullptr ? "" : this->last_name, TC_BLACK, SA_HOR_CENTER); + DrawString(r.left, r.right, r.top + FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal, this->last_name == nullptr ? "" : this->last_name, TC_BLACK, SA_HOR_CENTER); break; } } diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 8f7a92cd58..7439d67c3e 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -329,12 +329,14 @@ struct NewsWindow : Window { void DrawNewsBorder(const Rect &r) const { - GfxFillRect(r.left, r.top, r.right, r.bottom, PC_WHITE); + Rect ir = r.Shrink(WidgetDimensions::scaled.bevel); + GfxFillRect(ir, PC_WHITE); - GfxFillRect(r.left, r.top, r.left, r.bottom, PC_BLACK); - GfxFillRect(r.right, r.top, r.right, r.bottom, PC_BLACK); - GfxFillRect(r.left, r.top, r.right, r.top, PC_BLACK); - GfxFillRect(r.left, r.bottom, r.right, r.bottom, PC_BLACK); + ir = ir.Expand(1); + GfxFillRect( r.left, r.top, ir.left, r.bottom, PC_BLACK); + GfxFillRect(ir.right, r.top, r.right, r.bottom, PC_BLACK); + GfxFillRect( r.left, r.top, r.right, ir.top, PC_BLACK); + GfxFillRect( r.left, ir.bottom, r.right, r.bottom, PC_BLACK); } Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override @@ -351,7 +353,7 @@ struct NewsWindow : Window { /* Caption is not a real caption (so that the window cannot be moved) * thus it doesn't get the default sizing of a caption. */ Dimension d2 = GetStringBoundingBox(STR_NEWS_MESSAGE_CAPTION); - d2.height += WD_CAPTIONTEXT_TOP + WD_CAPTIONTEXT_BOTTOM; + d2.height += WidgetDimensions::scaled.captiontext.Vertical(); *size = maxdim(*size, d2); return; } @@ -389,8 +391,8 @@ struct NewsWindow : Window { case WID_N_SHOW_GROUP: if (this->ni->reftype1 == NR_VEHICLE) { Dimension d2 = GetStringBoundingBox(this->GetWidget(WID_N_SHOW_GROUP)->widget_data); - d2.height += WD_CAPTIONTEXT_TOP + WD_CAPTIONTEXT_BOTTOM; - d2.width += WD_CAPTIONTEXT_LEFT + WD_CAPTIONTEXT_RIGHT; + d2.height += WidgetDimensions::scaled.captiontext.Vertical(); + d2.width += WidgetDimensions::scaled.captiontext.Horizontal(); *size = d2; } else { /* Hide 'Show group window' button if this news is not about a vehicle. */ @@ -1151,15 +1153,15 @@ struct MessageHistoryWindow : Window { void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { if (widget == WID_MH_BACKGROUND) { - this->line_height = FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; + this->line_height = FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; resize->height = this->line_height; /* Months are off-by-one, so it's actually 8. Not using * month 12 because the 1 is usually less wide. */ SetDParam(0, ConvertYMDToDate(ORIGINAL_MAX_YEAR, 7, 30)); - this->date_width = GetStringBoundingBox(STR_SHORT_DATE).width; + this->date_width = GetStringBoundingBox(STR_SHORT_DATE).width + ScaleFontTrad(5); - size->height = 4 * resize->height + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; // At least 4 lines are visible. + size->height = 4 * resize->height + WidgetDimensions::scaled.framerect.Vertical(); // At least 4 lines are visible. size->width = std::max(200u, size->width); // At least 200 pixels wide. } } @@ -1183,8 +1185,8 @@ struct MessageHistoryWindow : Window { /* Fill the widget with news items. */ bool rtl = _current_text_dir == TD_RTL; - Rect news = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM).Indent(this->date_width + ScaleFontTrad(5), rtl); - Rect date = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM).WithWidth(this->date_width, rtl); + Rect news = r.Shrink(WidgetDimensions::scaled.framerect).Indent(this->date_width + WidgetDimensions::scaled.hsep_wide, rtl); + Rect date = r.Shrink(WidgetDimensions::scaled.framerect).WithWidth(this->date_width, rtl); int y = news.top; for (int n = this->vscroll->GetCapacity(); n > 0; n--) { SetDParam(0, ni->date); @@ -1215,7 +1217,7 @@ struct MessageHistoryWindow : Window { NewsItem *ni = _latest_news; if (ni == nullptr) return; - for (int n = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_MH_BACKGROUND, WD_FRAMERECT_TOP); n > 0; n--) { + for (int n = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_MH_BACKGROUND, WidgetDimensions::scaled.framerect.top); n > 0; n--) { ni = ni->prev; if (ni == nullptr) return; } diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 98ece0e9d6..8064df362d 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -313,8 +313,8 @@ public: break; case WID_BO_SELECT_IMAGE: - size->width = ScaleGUITrad(64) + WD_BEVEL_LEFT + WD_BEVEL_RIGHT; - size->height = ScaleGUITrad(58) + WD_BEVEL_TOP + WD_BEVEL_BOTTOM; + size->width = ScaleGUITrad(64) + WidgetDimensions::scaled.fullbevel.Horizontal(); + size->height = ScaleGUITrad(58) + WidgetDimensions::scaled.fullbevel.Vertical(); break; default: break; @@ -325,7 +325,7 @@ public: { switch (GB(widget, 0, 16)) { case WID_BO_CLASS_LIST: { - Rect mr = r.Shrink(WD_MATRIX_LEFT, WD_MATRIX_TOP, WD_MATRIX_RIGHT, WD_MATRIX_BOTTOM); + Rect mr = r.Shrink(WidgetDimensions::scaled.matrix); uint pos = 0; for (auto object_class_id : this->object_classes) { ObjectClass *objclass = ObjectClass::Get(object_class_id); @@ -377,7 +377,7 @@ public: if (spec == nullptr) break; if (!spec->IsAvailable()) { - GfxFillRect(r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), PC_BLACK, FILLRECT_CHECKER); + GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), PC_BLACK, FILLRECT_CHECKER); } DrawPixelInfo tmp_dpi; /* Set up a clipping area for the preview. */ diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 2af9c14285..d412a49f7c 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -550,7 +550,7 @@ private: VehicleOrderID GetOrderFromPt(int y) { NWidgetBase *nwid = this->GetWidget(WID_O_ORDER_LIST); - uint sel = (y - nwid->pos_y - WD_FRAMERECT_TOP) / nwid->resize_y; // Selected line in the WID_O_ORDER_LIST panel. + uint sel = (y - nwid->pos_y - WidgetDimensions::scaled.framerect.top) / nwid->resize_y; // Selected line in the WID_O_ORDER_LIST panel. if (sel >= this->vscroll->GetCapacity()) return INVALID_VEH_ORDER_ID; @@ -1074,10 +1074,10 @@ public: { if (widget != WID_O_ORDER_LIST) return; - Rect ir = r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMERECT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect ir = r.Shrink(WidgetDimensions::scaled.frametext, WidgetDimensions::scaled.framerect); bool rtl = _current_text_dir == TD_RTL; SetDParamMaxValue(0, this->vehicle->GetNumOrders(), 2); - int index_column_width = GetStringBoundingBox(STR_ORDER_INDEX).width + 2 * GetSpriteSize(rtl ? SPR_ARROW_RIGHT : SPR_ARROW_LEFT).width + 3; + int index_column_width = GetStringBoundingBox(STR_ORDER_INDEX).width + 2 * GetSpriteSize(rtl ? SPR_ARROW_RIGHT : SPR_ARROW_LEFT).width + WidgetDimensions::scaled.hsep_normal; int middle = rtl ? ir.right - index_column_width : ir.left + index_column_width; int y = ir.top; @@ -1093,7 +1093,7 @@ public: if (i != this->selected_order && i == this->order_over) { /* Highlight dragged order destination. */ - int top = (this->order_over < this->selected_order ? y : y + line_height) - WD_FRAMERECT_TOP; + int top = (this->order_over < this->selected_order ? y : y + line_height) - WidgetDimensions::scaled.framerect.top; int bottom = std::min(top + 2, ir.bottom); top = std::max(top - 3, ir.top); GfxFillRect(ir.left, top, ir.right, bottom, _colour_gradient[COLOUR_GREY][7]); diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index e460672b1f..7302a13bb0 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -968,7 +968,7 @@ private: public: BuildRailStationWindow(WindowDesc *desc, Window *parent, bool newstation) : PickerWindowBase(desc, parent), filter_editbox(EDITBOX_MAX_SIZE * MAX_CHAR_LENGTH, EDITBOX_MAX_SIZE) { - this->coverage_height = 2 * FONT_HEIGHT_NORMAL + 3 * WD_PAR_VSEP_NORMAL; + this->coverage_height = 2 * FONT_HEIGHT_NORMAL + 3 * WidgetDimensions::scaled.vsep_normal; this->vscroll = nullptr; _railstation.newstations = newstation; @@ -1180,9 +1180,9 @@ public: if (this->IsShaded()) return; /* 'Accepts' and 'Supplies' texts. */ Rect r = this->GetWidget(WID_BRAS_COVERAGE_TEXTS)->GetCurrentRect(); - int top = r.top + ScaleGUITrad(WD_PAR_VSEP_NORMAL); - top = DrawStationCoverageAreaText(r.left, r.right, top, SCT_ALL, rad, false) + ScaleGUITrad(WD_PAR_VSEP_NORMAL); - top = DrawStationCoverageAreaText(r.left, r.right, top, SCT_ALL, rad, true) + ScaleGUITrad(WD_PAR_VSEP_NORMAL); + int top = r.top + WidgetDimensions::scaled.vsep_normal; + top = DrawStationCoverageAreaText(r.left, r.right, top, SCT_ALL, rad, false) + WidgetDimensions::scaled.vsep_normal; + top = DrawStationCoverageAreaText(r.left, r.right, top, SCT_ALL, rad, true) + WidgetDimensions::scaled.vsep_normal; /* Resize background if the window is too small. * Never make the window smaller to avoid oscillating if the size change affects the acceptance. * (This is the case, if making the window bigger moves the mouse into the window.) */ @@ -1232,8 +1232,8 @@ public: case WID_BRAS_PLATFORM_DIR_X: case WID_BRAS_PLATFORM_DIR_Y: case WID_BRAS_IMAGE: - size->width = ScaleGUITrad(64) + WD_BEVEL_LEFT + WD_BEVEL_RIGHT; - size->height = ScaleGUITrad(58) + WD_BEVEL_TOP + WD_BEVEL_BOTTOM; + size->width = ScaleGUITrad(64) + WidgetDimensions::scaled.fullbevel.Horizontal(); + size->height = ScaleGUITrad(58) + WidgetDimensions::scaled.fullbevel.Vertical(); break; case WID_BRAS_COVERAGE_TEXTS: @@ -1281,7 +1281,7 @@ public: break; case WID_BRAS_NEWST_LIST: { - Rect ir = r.Shrink(WD_MATRIX_LEFT, WD_MATRIX_TOP, WD_MATRIX_RIGHT, WD_MATRIX_BOTTOM); + Rect ir = r.Shrink(WidgetDimensions::scaled.matrix); uint statclass = 0; for (auto station_class : this->station_classes) { if (this->vscroll->IsVisible(statclass)) { @@ -1301,7 +1301,7 @@ public: /* Check station availability callback */ const StationSpec *statspec = StationClass::Get(_railstation.station_class)->GetSpec(type); if (!IsStationAvailable(statspec)) { - GfxFillRect(r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), PC_BLACK, FILLRECT_CHECKER); + GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), PC_BLACK, FILLRECT_CHECKER); } /* Set up a clipping area for the station preview. */ @@ -1609,7 +1609,7 @@ static const NWidgetPart _nested_station_builder_widgets[] = { NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_BRAS_PLATFORM_DRAG_N_DROP), SetMinimalSize(75, 12), SetDataTip(STR_STATION_BUILD_DRAG_DROP, STR_STATION_BUILD_DRAG_DROP_TOOLTIP), NWidget(NWID_SPACER), SetMinimalSize(2, 0), SetFill(1, 0), EndContainer(), - NWidget(WWT_LABEL, COLOUR_DARK_GREEN), SetDataTip(STR_STATION_BUILD_COVERAGE_AREA_TITLE, STR_NULL), SetPadding(WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM, WD_FRAMERECT_LEFT), SetFill(1, 0), + NWidget(WWT_LABEL, COLOUR_DARK_GREEN), SetDataTip(STR_STATION_BUILD_COVERAGE_AREA_TITLE, STR_NULL), SetPadding(WidgetDimensions::unscaled.framerect), SetFill(1, 0), NWidget(NWID_HORIZONTAL), NWidget(NWID_SPACER), SetMinimalSize(2, 0), SetFill(1, 0), NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_BRAS_HIGHLIGHT_OFF), SetMinimalSize(60, 12), @@ -1634,7 +1634,7 @@ static const NWidgetPart _nested_station_builder_widgets[] = { EndContainer(), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(WWT_EMPTY, INVALID_COLOUR, WID_BRAS_COVERAGE_TEXTS), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), SetFill(1, 1), SetResize(1, 0), + NWidget(WWT_EMPTY, INVALID_COLOUR, WID_BRAS_COVERAGE_TEXTS), SetPadding(WidgetDimensions::unscaled.framerect), SetFill(1, 1), SetResize(1, 0), NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BRAS_SHOW_NEWST_RESIZE), NWidget(NWID_VERTICAL), NWidget(WWT_PANEL, COLOUR_DARK_GREEN), SetFill(0, 1), EndContainer(), @@ -1677,9 +1677,10 @@ private: { Point offset; Dimension sprite_size = GetSpriteSize(image, &offset); - int x = CenterBounds(r.left, r.right, sprite_size.width - offset.x); - int y = r.top - sig_sprite_bottom_offset + WD_IMGBTN_TOP + - (r.bottom - r.top - WD_IMGBTN_TOP - WD_IMGBTN_BOTTOM + sig_sprite_size.height) / 2; // aligned to bottom + Rect ir = r.Shrink(WidgetDimensions::scaled.imgbtn); + int x = CenterBounds(ir.left, ir.right, sprite_size.width - offset.x); // centered + int y = ir.top - sig_sprite_bottom_offset + + (ir.Height() + sig_sprite_size.height) / 2; // aligned to bottom DrawSprite(image, PAL_NONE, x + this->IsWidgetLowered(widget_index), @@ -1740,12 +1741,12 @@ public: { if (widget == WID_BS_DRAG_SIGNALS_DENSITY_LABEL) { /* Two digits for signals density. */ - size->width = std::max(size->width, 2 * GetDigitWidth() + padding.width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT); + size->width = std::max(size->width, 2 * GetDigitWidth() + padding.width + WidgetDimensions::scaled.framerect.Horizontal()); } else if (IsInsideMM(widget, WID_BS_SEMAPHORE_NORM, WID_BS_ELECTRIC_PBS_OWAY + 1)) { - size->width = std::max(size->width, this->sig_sprite_size.width + WD_IMGBTN_LEFT + WD_IMGBTN_RIGHT); - size->height = std::max(size->height, this->sig_sprite_size.height + WD_IMGBTN_TOP + WD_IMGBTN_BOTTOM); + size->width = std::max(size->width, this->sig_sprite_size.width + padding.width); + size->height = std::max(size->height, this->sig_sprite_size.height + padding.height); } else if (widget == WID_BS_CAPTION) { - size->width += WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT; + size->width += WidgetDimensions::scaled.frametext.Horizontal(); } } @@ -1929,8 +1930,8 @@ struct BuildRailDepotWindow : public PickerWindowBase { { if (!IsInsideMM(widget, WID_BRAD_DEPOT_NE, WID_BRAD_DEPOT_NW + 1)) return; - size->width = ScaleGUITrad(64) + WD_BEVEL_LEFT + WD_BEVEL_RIGHT; - size->height = ScaleGUITrad(48) + WD_BEVEL_TOP + WD_BEVEL_BOTTOM; + size->width = ScaleGUITrad(64) + WidgetDimensions::scaled.fullbevel.Horizontal(); + size->height = ScaleGUITrad(48) + WidgetDimensions::scaled.fullbevel.Vertical(); } void DrawWidget(const Rect &r, int widget) const override @@ -2036,8 +2037,8 @@ struct BuildRailWaypointWindow : PickerWindowBase { break; case WID_BRW_WAYPOINT: - size->width = ScaleGUITrad(64) + WD_BEVEL_LEFT + WD_BEVEL_RIGHT; - size->height = ScaleGUITrad(58) + WD_BEVEL_TOP + WD_BEVEL_BOTTOM; + size->width = ScaleGUITrad(64) + WidgetDimensions::scaled.fullbevel.Horizontal(); + size->height = ScaleGUITrad(58) + WidgetDimensions::scaled.fullbevel.Vertical(); break; } } @@ -2060,7 +2061,7 @@ struct BuildRailWaypointWindow : PickerWindowBase { } if (!IsStationAvailable(statspec)) { - GfxFillRect(r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), PC_BLACK, FILLRECT_CHECKER); + GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), PC_BLACK, FILLRECT_CHECKER); } } } diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 8fdb4dd592..046c695925 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -974,8 +974,8 @@ struct BuildRoadDepotWindow : public PickerWindowBase { { if (!IsInsideMM(widget, WID_BROD_DEPOT_NE, WID_BROD_DEPOT_NW + 1)) return; - size->width = ScaleGUITrad(64) + WD_BEVEL_LEFT + WD_BEVEL_RIGHT; - size->height = ScaleGUITrad(48) + WD_BEVEL_TOP + WD_BEVEL_BOTTOM; + size->width = ScaleGUITrad(64) + WidgetDimensions::scaled.fullbevel.Horizontal(); + size->height = ScaleGUITrad(48) + WidgetDimensions::scaled.fullbevel.Vertical(); } void DrawWidget(const Rect &r, int widget) const override @@ -1092,9 +1092,9 @@ struct BuildRoadStationWindow : public PickerWindowBase { /* 'Accepts' and 'Supplies' texts. */ StationCoverageType sct = (this->window_class == WC_BUS_STATION) ? SCT_PASSENGERS_ONLY : SCT_NON_PASSENGERS_ONLY; Rect r = this->GetWidget(WID_BROS_ACCEPTANCE)->GetCurrentRect(); - int top = r.top + ScaleGUITrad(WD_PAR_VSEP_NORMAL); - top = DrawStationCoverageAreaText(r.left, r.right, top, sct, rad, false) + ScaleGUITrad(WD_PAR_VSEP_NORMAL); - top = DrawStationCoverageAreaText(r.left, r.right, top, sct, rad, true) + ScaleGUITrad(WD_PAR_VSEP_NORMAL); + int top = r.top + WidgetDimensions::scaled.vsep_normal; + top = DrawStationCoverageAreaText(r.left, r.right, top, sct, rad, false) + WidgetDimensions::scaled.vsep_normal; + top = DrawStationCoverageAreaText(r.left, r.right, top, sct, rad, true) + WidgetDimensions::scaled.vsep_normal; /* Resize background if the window is too small. * Never make the window smaller to avoid oscillating if the size change affects the acceptance. * (This is the case, if making the window bigger moves the mouse into the window.) */ @@ -1107,8 +1107,8 @@ struct BuildRoadStationWindow : public PickerWindowBase { { if (!IsInsideMM(widget, WID_BROS_STATION_NE, WID_BROS_STATION_Y + 1)) return; - size->width = ScaleGUITrad(64) + WD_BEVEL_LEFT + WD_BEVEL_RIGHT; - size->height = ScaleGUITrad(48) + WD_BEVEL_TOP + WD_BEVEL_BOTTOM; + size->width = ScaleGUITrad(64) + WidgetDimensions::scaled.fullbevel.Horizontal(); + size->height = ScaleGUITrad(48) + WidgetDimensions::scaled.fullbevel.Vertical(); } void DrawWidget(const Rect &r, int widget) const override @@ -1189,7 +1189,7 @@ static const NWidgetPart _nested_road_station_picker_widgets[] = { EndContainer(), NWidget(NWID_SPACER), SetFill(1, 0), EndContainer(), - NWidget(WWT_LABEL, COLOUR_DARK_GREEN, WID_BROS_INFO), SetPadding(WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM, WD_FRAMERECT_LEFT), SetDataTip(STR_STATION_BUILD_COVERAGE_AREA_TITLE, STR_NULL), SetFill(1, 0), + NWidget(WWT_LABEL, COLOUR_DARK_GREEN, WID_BROS_INFO), SetPadding(WidgetDimensions::unscaled.framerect), SetDataTip(STR_STATION_BUILD_COVERAGE_AREA_TITLE, STR_NULL), SetFill(1, 0), NWidget(NWID_HORIZONTAL), SetPadding(3), NWidget(NWID_SPACER), SetFill(1, 0), NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_BROS_LT_OFF), SetMinimalSize(60, 12), @@ -1198,7 +1198,7 @@ static const NWidgetPart _nested_road_station_picker_widgets[] = { SetDataTip(STR_STATION_BUILD_COVERAGE_ON, STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP), NWidget(NWID_SPACER), SetFill(1, 0), EndContainer(), - NWidget(WWT_EMPTY, COLOUR_DARK_GREEN, WID_BROS_ACCEPTANCE), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), SetResize(0, 1), + NWidget(WWT_EMPTY, COLOUR_DARK_GREEN, WID_BROS_ACCEPTANCE), SetPadding(WidgetDimensions::unscaled.framerect), SetResize(0, 1), EndContainer(), }; @@ -1226,7 +1226,7 @@ static const NWidgetPart _nested_tram_station_picker_widgets[] = { EndContainer(), NWidget(NWID_SPACER), SetFill(1, 0), EndContainer(), - NWidget(WWT_LABEL, COLOUR_DARK_GREEN, WID_BROS_INFO), SetPadding(WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM, WD_FRAMERECT_LEFT), SetMinimalSize(140, 14), SetDataTip(STR_STATION_BUILD_COVERAGE_AREA_TITLE, STR_NULL), SetFill(1, 0), + NWidget(WWT_LABEL, COLOUR_DARK_GREEN, WID_BROS_INFO), SetPadding(WidgetDimensions::unscaled.framerect), SetMinimalSize(140, 14), SetDataTip(STR_STATION_BUILD_COVERAGE_AREA_TITLE, STR_NULL), SetFill(1, 0), NWidget(NWID_HORIZONTAL), SetPadding(3), NWidget(NWID_SPACER), SetFill(1, 0), NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_BROS_LT_OFF), SetMinimalSize(60, 12), @@ -1235,7 +1235,7 @@ static const NWidgetPart _nested_tram_station_picker_widgets[] = { SetDataTip(STR_STATION_BUILD_COVERAGE_ON, STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP), NWidget(NWID_SPACER), SetFill(1, 0), EndContainer(), - NWidget(WWT_EMPTY, COLOUR_DARK_GREEN, WID_BROS_ACCEPTANCE), SetPadding(0, WD_FRAMERECT_RIGHT, 0, WD_FRAMERECT_LEFT), SetResize(0, 1), + NWidget(WWT_EMPTY, COLOUR_DARK_GREEN, WID_BROS_ACCEPTANCE), SetPadding(WidgetDimensions::unscaled.framerect), SetResize(0, 1), EndContainer(), }; diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp index 5cd07bbdca..e6fab81240 100644 --- a/src/roadveh_gui.cpp +++ b/src/roadveh_gui.cpp @@ -76,7 +76,7 @@ void DrawRoadVehDetails(const Vehicle *v, const Rect &r) } DrawString(r.left, r.right, y, capacity, TC_BLUE); - y += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; + y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; for (const Vehicle *u = v; u != nullptr; u = u->Next()) { if (u->cargo_cap == 0) continue; @@ -92,13 +92,13 @@ void DrawRoadVehDetails(const Vehicle *v, const Rect &r) DrawString(r.left, r.right, y, str); y += FONT_HEIGHT_NORMAL; } - y += WD_PAR_VSEP_NORMAL; + y += WidgetDimensions::scaled.vsep_normal; } else { SetDParam(0, v->cargo_type); SetDParam(1, v->cargo_cap); SetDParam(4, GetCargoSubtypeText(v)); DrawString(r.left, r.right, y, STR_VEHICLE_INFO_CAPACITY); - y += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; + y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; str = STR_VEHICLE_DETAILS_CARGO_EMPTY; if (v->cargo.StoredCount() > 0) { @@ -109,7 +109,7 @@ void DrawRoadVehDetails(const Vehicle *v, const Rect &r) feeder_share += v->cargo.FeederShare(); } DrawString(r.left, r.right, y, str); - y += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; + y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; } /* Draw Transfer credits text */ diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 95be2ab869..525874e086 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1000,8 +1000,8 @@ uint BaseSettingEntry::Draw(GameSettings *settings_ptr, int left, int right, int if (cur_row >= max_row) return cur_row; bool rtl = _current_text_dir == TD_RTL; - int offset = rtl ? -4 : 4; - int level_width = rtl ? -LEVEL_WIDTH : LEVEL_WIDTH; + int offset = (rtl ? -(int)_circle_size.width : _circle_size.width) / 2; + int level_width = rtl ? -WidgetDimensions::scaled.hsep_indent : WidgetDimensions::scaled.hsep_indent; int x = rtl ? right : left; if (cur_row >= first_row) { @@ -1018,7 +1018,7 @@ uint BaseSettingEntry::Draw(GameSettings *settings_ptr, int left, int right, int int bottom_y = (flags & SEF_LAST_FIELD) ? halfway_y : y + SETTING_HEIGHT - 1; GfxDrawLine(x + offset, y, x + offset, bottom_y, colour); /* Small horizontal line from the last vertical line */ - GfxDrawLine(x + offset, halfway_y, x + level_width - offset, halfway_y, colour); + GfxDrawLine(x + offset, halfway_y, x + level_width - WidgetDimensions::scaled.hsep_normal, halfway_y, colour); x += level_width; this->DrawSetting(settings_ptr, rtl ? left : x, rtl ? x : right, y, this == selected); @@ -1210,8 +1210,8 @@ void SettingEntry::DrawSetting(GameSettings *settings_ptr, int left, int right, bool rtl = _current_text_dir == TD_RTL; uint buttons_left = rtl ? right + 1 - SETTING_BUTTON_WIDTH : left; - uint text_left = left + (rtl ? 0 : SETTING_BUTTON_WIDTH + 5); - uint text_right = right - (rtl ? SETTING_BUTTON_WIDTH + 5 : 0); + uint text_left = left + (rtl ? 0 : SETTING_BUTTON_WIDTH + WidgetDimensions::scaled.hsep_wide); + uint text_right = right - (rtl ? SETTING_BUTTON_WIDTH + WidgetDimensions::scaled.hsep_wide : 0); uint button_y = y + (SETTING_HEIGHT - SETTING_BUTTON_HEIGHT) / 2; /* We do not allow changes of some items when we are a client in a networkgame */ @@ -1558,7 +1558,7 @@ void SettingsPage::DrawSetting(GameSettings *settings_ptr, int left, int right, { bool rtl = _current_text_dir == TD_RTL; DrawSprite((this->folded ? SPR_CIRCLE_FOLDED : SPR_CIRCLE_UNFOLDED), PAL_NONE, rtl ? right - _circle_size.width : left, y + (SETTING_HEIGHT - _circle_size.height) / 2); - DrawString(rtl ? left : left + _circle_size.width + 2, rtl ? right - _circle_size.width - 2 : right, y + (SETTING_HEIGHT - FONT_HEIGHT_NORMAL) / 2, this->title); + DrawString(rtl ? left : left + _circle_size.width + WidgetDimensions::scaled.hsep_normal, rtl ? right - _circle_size.width - WidgetDimensions::scaled.hsep_normal : right, y + (SETTING_HEIGHT - FONT_HEIGHT_NORMAL) / 2, this->title); } /** Construct settings tree */ @@ -1962,10 +1962,10 @@ struct GameSettingsWindow : Window { { switch (widget) { case WID_GS_OPTIONSPANEL: - resize->height = SETTING_HEIGHT = std::max({(int)_circle_size.height, SETTING_BUTTON_HEIGHT, FONT_HEIGHT_NORMAL}) + 1; - resize->width = 1; + resize->height = SETTING_HEIGHT = std::max({(int)_circle_size.height, SETTING_BUTTON_HEIGHT, FONT_HEIGHT_NORMAL}) + WidgetDimensions::scaled.vsep_normal; + resize->width = 1; - size->height = 5 * resize->height + WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM; + size->height = 5 * resize->height + WidgetDimensions::scaled.framerect.Vertical(); break; case WID_GS_HELP_TEXT: { @@ -1978,7 +1978,7 @@ struct GameSettingsWindow : Window { SetDParam(0, setting_types[i]); size->width = std::max(size->width, GetStringBoundingBox(STR_CONFIG_SETTING_TYPE).width); } - size->height = 2 * FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL + + size->height = 2 * FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal + std::max(size->height, GetSettingsTree().GetMaxHelpHeight(size->width)); break; } @@ -2003,7 +2003,7 @@ struct GameSettingsWindow : Window { } /* Reserve the correct number of lines for the 'some search results are hidden' notice in the central settings display panel. */ - const Rect panel = this->GetWidget(WID_GS_OPTIONSPANEL)->GetCurrentRect().Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM); + const Rect panel = this->GetWidget(WID_GS_OPTIONSPANEL)->GetCurrentRect().Shrink(WidgetDimensions::scaled.frametext); StringID warn_str = STR_CONFIG_SETTING_CATEGORY_HIDES - 1 + this->warn_missing; int new_warn_lines; if (this->warn_missing == WHR_NONE) { @@ -2072,7 +2072,7 @@ struct GameSettingsWindow : Window { { switch (widget) { case WID_GS_OPTIONSPANEL: { - Rect tr = r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.frametext, WidgetDimensions::scaled.framerect); tr.top += this->warn_lines * SETTING_HEIGHT; uint last_row = this->vscroll->GetPosition() + this->vscroll->GetCapacity() - this->warn_lines; int next_row = GetSettingsTree().Draw(settings_ptr, tr.left, tr.right, tr.top, @@ -2097,7 +2097,7 @@ struct GameSettingsWindow : Window { this->last_clicked->SetValueDParams(0, sd->def); DrawString(tr, STR_CONFIG_SETTING_DEFAULT_VALUE); - tr.top += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; + tr.top += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; DrawStringMultiLine(tr, this->last_clicked->GetHelpText(), TC_WHITE); } @@ -2161,7 +2161,7 @@ struct GameSettingsWindow : Window { if (widget != WID_GS_OPTIONSPANEL) return; - uint btn = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_GS_OPTIONSPANEL, WD_FRAMETEXT_TOP); + uint btn = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_GS_OPTIONSPANEL, WidgetDimensions::scaled.framerect.top); if (btn == INT_MAX || (int)btn < this->warn_lines) return; btn -= this->warn_lines; @@ -2170,7 +2170,7 @@ struct GameSettingsWindow : Window { if (clicked_entry == nullptr) return; // Clicked below the last setting of the page - int x = (_current_text_dir == TD_RTL ? this->width - 1 - pt.x : pt.x) - WD_FRAMETEXT_LEFT - (clicked_entry->level + 1) * LEVEL_WIDTH; // Shift x coordinate + int x = (_current_text_dir == TD_RTL ? this->width - 1 - pt.x : pt.x) - WidgetDimensions::scaled.frametext.left - (clicked_entry->level + 1) * WidgetDimensions::scaled.hsep_indent; // Shift x coordinate if (x < 0) return; // Clicked left of the entry SettingsPage *clicked_page = dynamic_cast(clicked_entry); @@ -2211,7 +2211,7 @@ struct GameSettingsWindow : Window { this->closing_dropdown = false; const NWidgetBase *wid = this->GetWidget(WID_GS_OPTIONSPANEL); - int rel_y = (pt.y - (int)wid->pos_y - WD_FRAMETEXT_TOP) % wid->resize_y; + int rel_y = (pt.y - (int)wid->pos_y - WidgetDimensions::scaled.framerect.top) % wid->resize_y; Rect wi_rect; wi_rect.left = pt.x - (_current_text_dir == TD_RTL ? SETTING_BUTTON_WIDTH - 1 - x : x); @@ -2439,7 +2439,7 @@ struct GameSettingsWindow : Window { void OnResize() override { - this->vscroll->SetCapacityFromWidget(this, WID_GS_OPTIONSPANEL, WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM); + this->vscroll->SetCapacityFromWidget(this, WID_GS_OPTIONSPANEL, WidgetDimensions::scaled.framerect.Vertical()); } }; @@ -2452,16 +2452,16 @@ static const NWidgetPart _nested_settings_selection_widgets[] = { NWidget(WWT_DEFSIZEBOX, COLOUR_MAUVE), EndContainer(), NWidget(WWT_PANEL, COLOUR_MAUVE), - NWidget(NWID_VERTICAL), SetPIP(WD_TEXTPANEL_TOP, WD_PAR_VSEP_NORMAL, WD_TEXTPANEL_BOTTOM), - NWidget(NWID_HORIZONTAL), SetPIP(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_RIGHT), + NWidget(NWID_VERTICAL), SetPIP(WidgetDimensions::unscaled.frametext.top, WidgetDimensions::unscaled.vsep_normal, WidgetDimensions::unscaled.frametext.bottom), + NWidget(NWID_HORIZONTAL), SetPIP(WidgetDimensions::unscaled.frametext.left, WidgetDimensions::unscaled.hsep_wide, WidgetDimensions::unscaled.frametext.right), NWidget(WWT_TEXT, COLOUR_MAUVE, WID_GS_RESTRICT_CATEGORY), SetDataTip(STR_CONFIG_SETTING_RESTRICT_CATEGORY, STR_NULL), NWidget(WWT_DROPDOWN, COLOUR_MAUVE, WID_GS_RESTRICT_DROPDOWN), SetMinimalSize(100, 12), SetDataTip(STR_BLACK_STRING, STR_CONFIG_SETTING_RESTRICT_DROPDOWN_HELPTEXT), SetFill(1, 0), SetResize(1, 0), EndContainer(), - NWidget(NWID_HORIZONTAL), SetPIP(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_RIGHT), + NWidget(NWID_HORIZONTAL), SetPIP(WidgetDimensions::unscaled.frametext.left, WidgetDimensions::unscaled.hsep_wide, WidgetDimensions::unscaled.frametext.right), NWidget(WWT_TEXT, COLOUR_MAUVE, WID_GS_RESTRICT_TYPE), SetDataTip(STR_CONFIG_SETTING_RESTRICT_TYPE, STR_NULL), NWidget(WWT_DROPDOWN, COLOUR_MAUVE, WID_GS_TYPE_DROPDOWN), SetMinimalSize(100, 12), SetDataTip(STR_BLACK_STRING, STR_CONFIG_SETTING_TYPE_DROPDOWN_HELPTEXT), SetFill(1, 0), SetResize(1, 0), EndContainer(), - NWidget(NWID_HORIZONTAL), SetPIP(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_RIGHT), + NWidget(NWID_HORIZONTAL), SetPIP(WidgetDimensions::unscaled.frametext.left, WidgetDimensions::unscaled.hsep_wide, WidgetDimensions::unscaled.frametext.right), NWidget(WWT_TEXT, COLOUR_MAUVE), SetFill(0, 1), SetDataTip(STR_CONFIG_SETTING_FILTER_TITLE, STR_NULL), NWidget(WWT_EDITBOX, COLOUR_MAUVE, WID_GS_FILTER), SetMinimalSize(50, 12), SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP), SetFill(1, 0), SetResize(1, 0), EndContainer(), @@ -2473,7 +2473,7 @@ static const NWidgetPart _nested_settings_selection_widgets[] = { EndContainer(), NWidget(WWT_PANEL, COLOUR_MAUVE), NWidget(WWT_EMPTY, INVALID_COLOUR, WID_GS_HELP_TEXT), SetMinimalSize(300, 25), SetFill(1, 1), SetResize(1, 0), - SetPadding(WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM, WD_FRAMETEXT_LEFT), + SetPadding(WidgetDimensions::unscaled.frametext), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, WID_GS_EXPAND_ALL), SetDataTip(STR_CONFIG_SETTING_EXPAND_ALL, STR_NULL), @@ -2511,21 +2511,26 @@ void ShowGameSettings() */ void DrawArrowButtons(int x, int y, Colours button_colour, byte state, bool clickable_left, bool clickable_right) { + extern void DrawSpriteIgnorePadding(const Rect &r, SpriteID img, bool clicked, StringAlignment align); + int colour = _colour_gradient[button_colour][2]; Dimension dim = NWidgetScrollbar::GetHorizontalDimension(); - DrawFrameRect(x, y, x + dim.width - 1, y + dim.height - 1, button_colour, (state == 1) ? FR_LOWERED : FR_NONE); - DrawFrameRect(x + dim.width, y, x + dim.width + dim.width - 1, y + dim.height - 1, button_colour, (state == 2) ? FR_LOWERED : FR_NONE); - DrawSprite(SPR_ARROW_LEFT, PAL_NONE, x + WD_IMGBTN_LEFT, y + WD_IMGBTN_TOP); - DrawSprite(SPR_ARROW_RIGHT, PAL_NONE, x + WD_IMGBTN_LEFT + dim.width, y + WD_IMGBTN_TOP); + Rect lr = {x, y, x + (int)dim.width - 1, y + (int)dim.height - 1}; + Rect rr = {x + (int)dim.width, y, x + (int)dim.width * 2 - 1, y + (int)dim.height - 1}; + + DrawFrameRect(lr, button_colour, (state == 1) ? FR_LOWERED : FR_NONE); + DrawFrameRect(rr, button_colour, (state == 2) ? FR_LOWERED : FR_NONE); + DrawSpriteIgnorePadding(lr, SPR_ARROW_LEFT, (state == 1), SA_CENTER); + DrawSpriteIgnorePadding(rr, SPR_ARROW_RIGHT, (state == 2), SA_CENTER); /* Grey out the buttons that aren't clickable */ bool rtl = _current_text_dir == TD_RTL; if (rtl ? !clickable_right : !clickable_left) { - GfxFillRect(x + 1, y, x + dim.width - 1, y + dim.height - 2, colour, FILLRECT_CHECKER); + GfxFillRect(lr.Shrink(WidgetDimensions::scaled.bevel), colour, FILLRECT_CHECKER); } if (rtl ? !clickable_left : !clickable_right) { - GfxFillRect(x + dim.width + 1, y, x + dim.width + dim.width - 1, y + dim.height - 2, colour, FILLRECT_CHECKER); + GfxFillRect(rr.Shrink(WidgetDimensions::scaled.bevel), colour, FILLRECT_CHECKER); } } @@ -2539,13 +2544,17 @@ void DrawArrowButtons(int x, int y, Colours button_colour, byte state, bool clic */ void DrawDropDownButton(int x, int y, Colours button_colour, bool state, bool clickable) { + extern void DrawSpriteIgnorePadding(const Rect &r, SpriteID img, bool clicked, StringAlignment align); + int colour = _colour_gradient[button_colour][2]; - DrawFrameRect(x, y, x + SETTING_BUTTON_WIDTH - 1, y + SETTING_BUTTON_HEIGHT - 1, button_colour, state ? FR_LOWERED : FR_NONE); - DrawSprite(SPR_ARROW_DOWN, PAL_NONE, x + (SETTING_BUTTON_WIDTH - NWidgetScrollbar::GetVerticalDimension().width) / 2 + state, y + 2 + state); + Rect r = {x, y, x + SETTING_BUTTON_WIDTH - 1, y + SETTING_BUTTON_HEIGHT - 1}; + + DrawFrameRect(r, button_colour, state ? FR_LOWERED : FR_NONE); + DrawSpriteIgnorePadding(r, SPR_ARROW_DOWN, state, SA_CENTER); if (!clickable) { - GfxFillRect(x + 1, y, x + SETTING_BUTTON_WIDTH - 1, y + SETTING_BUTTON_HEIGHT - 2, colour, FILLRECT_CHECKER); + GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), colour, FILLRECT_CHECKER); } } @@ -2559,7 +2568,9 @@ void DrawDropDownButton(int x, int y, Colours button_colour, bool state, bool cl void DrawBoolButton(int x, int y, bool state, bool clickable) { static const Colours _bool_ctabs[2][2] = {{COLOUR_CREAM, COLOUR_RED}, {COLOUR_DARK_GREEN, COLOUR_GREEN}}; - DrawFrameRect(x, y, x + SETTING_BUTTON_WIDTH - 1, y + SETTING_BUTTON_HEIGHT - 1, _bool_ctabs[state][clickable], state ? FR_LOWERED : FR_NONE); + + Rect r = {x, y, x + SETTING_BUTTON_WIDTH - 1, y + SETTING_BUTTON_HEIGHT - 1}; + DrawFrameRect(r, _bool_ctabs[state][clickable], state ? FR_LOWERED : FR_NONE); } struct CustomCurrencyWindow : Window { diff --git a/src/ship_gui.cpp b/src/ship_gui.cpp index 6154681547..0d82c2ce04 100644 --- a/src/ship_gui.cpp +++ b/src/ship_gui.cpp @@ -73,7 +73,7 @@ void DrawShipDetails(const Vehicle *v, const Rect &r) SetDParam(1, v->cargo_cap); SetDParam(4, GetCargoSubtypeText(v)); DrawString(r.left, r.right, y, STR_VEHICLE_INFO_CAPACITY); - y += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; + y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; StringID str = STR_VEHICLE_DETAILS_CARGO_EMPTY; if (v->cargo.StoredCount() > 0) { @@ -83,7 +83,7 @@ void DrawShipDetails(const Vehicle *v, const Rect &r) str = STR_VEHICLE_DETAILS_CARGO_FROM; } DrawString(r.left, r.right, y, str); - y += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; + y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; /* Draw Transfer credits text */ SetDParam(0, v->cargo.FeederShare()); diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 0782162b0e..911e0c9363 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -194,7 +194,7 @@ struct SignListWindow : Window, SignList { { switch (widget) { case WID_SIL_LIST: { - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); uint text_offset_y = (this->resize.step_height - FONT_HEIGHT_NORMAL + 1) / 2; /* No signs? */ if (this->vscroll->GetCount() == 0) { @@ -209,7 +209,8 @@ struct SignListWindow : Window, SignList { tr = tr.Indent(this->text_offset, rtl); /* At least one sign available. */ - for (uint16 i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < this->vscroll->GetCount(); i++) { + for (uint16 i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < this->vscroll->GetCount(); i++) + { const Sign *si = this->signs[i]; if (si->owner != OWNER_NONE) DrawCompanyIcon(si->owner, icon_left, tr.top + sprite_offset_y); @@ -232,7 +233,7 @@ struct SignListWindow : Window, SignList { { switch (widget) { case WID_SIL_LIST: { - uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SIL_LIST, WD_FRAMERECT_TOP); + uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SIL_LIST, WidgetDimensions::scaled.framerect.top); if (id_v == INT_MAX) return; const Sign *si = this->signs[id_v]; @@ -257,7 +258,7 @@ struct SignListWindow : Window, SignList { void OnResize() override { - this->vscroll->SetCapacityFromWidget(this, WID_SIL_LIST, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM); + this->vscroll->SetCapacityFromWidget(this, WID_SIL_LIST, WidgetDimensions::scaled.framerect.Vertical()); } void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override @@ -265,9 +266,9 @@ struct SignListWindow : Window, SignList { switch (widget) { case WID_SIL_LIST: { Dimension spr_dim = GetSpriteSize(SPR_COMPANY_ICON); - this->text_offset = WD_FRAMETEXT_LEFT + spr_dim.width + 2; // 2 pixels space between icon and the sign text. + this->text_offset = WidgetDimensions::scaled.frametext.left + spr_dim.width + 2; // 2 pixels space between icon and the sign text. resize->height = std::max(FONT_HEIGHT_NORMAL, spr_dim.height + 2); - Dimension d = {(uint)(this->text_offset + WD_FRAMETEXT_RIGHT), WD_FRAMERECT_TOP + 5 * resize->height + WD_FRAMERECT_BOTTOM}; + Dimension d = {(uint)(this->text_offset + WidgetDimensions::scaled.frametext.right), padding.height + 5 * resize->height}; *size = maxdim(*size, d); break; } @@ -367,7 +368,7 @@ static const NWidgetPart _nested_sign_list_widgets[] = { EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(NWID_VERTICAL), - NWidget(WWT_PANEL, COLOUR_BROWN, WID_SIL_LIST), SetMinimalSize(WD_FRAMETEXT_LEFT + 16 + 255 + WD_FRAMETEXT_RIGHT, 0), + NWidget(WWT_PANEL, COLOUR_BROWN, WID_SIL_LIST), SetMinimalSize(WidgetDimensions::unscaled.frametext.Horizontal() + 16 + 255, 0), SetResize(1, 1), SetFill(1, 0), SetScrollbar(WID_SIL_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_BROWN), SetFill(1, 1), diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index b56feb466b..4d3305cf84 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1191,7 +1191,7 @@ void SmallMapWindow::RebuildColourIndexIfNecessary() this->legend_width = (FONT_HEIGHT_SMALL - ScaleFontTrad(1)) * 8 / 5; /* The width of a column is the minimum width of all texts + the size of the blob + some spacing */ - this->column_width = min_width + this->legend_width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; + this->column_width = min_width + this->legend_width + WidgetDimensions::scaled.framerect.Horizontal(); } /* virtual */ void SmallMapWindow::OnPaint() @@ -1214,7 +1214,7 @@ void SmallMapWindow::RebuildColourIndexIfNecessary() { switch (widget) { case WID_SM_MAP: { - Rect ir = r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM); + Rect ir = r.Shrink(WidgetDimensions::scaled.bevel); DrawPixelInfo new_dpi; if (!FillDrawPixelInfo(&new_dpi, ir.left, ir.top, ir.Width(), ir.Height())) return; this->DrawSmallMap(&new_dpi); @@ -1227,10 +1227,10 @@ void SmallMapWindow::RebuildColourIndexIfNecessary() bool rtl = _current_text_dir == TD_RTL; uint i = 0; // Row counter for industry legend. uint row_height = FONT_HEIGHT_SMALL; - int padding = ScaleFontTrad(1); + int padding = ScaleGUITrad(1); - Rect origin = r.WithWidth(this->column_width, rtl).Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM).WithHeight(row_height); - Rect text = origin.Indent(this->legend_width + padding, rtl); + Rect origin = r.WithWidth(this->column_width, rtl).Shrink(WidgetDimensions::scaled.framerect).WithHeight(row_height); + Rect text = origin.Indent(this->legend_width + WidgetDimensions::scaled.hsep_normal, rtl); Rect icon = origin.WithWidth(this->legend_width, rtl).Shrink(0, padding, 0, 0); StringID string = STR_NULL; @@ -1298,7 +1298,7 @@ void SmallMapWindow::RebuildColourIndexIfNecessary() DrawString(text, tbl->legend); break; } - GfxFillRect(icon.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), legend_colour); // Legend colour + GfxFillRect(icon.Shrink(WidgetDimensions::scaled.bevel), legend_colour); // Legend colour text = text.Translate(0, row_height); icon = icon.Translate(0, row_height); @@ -1396,7 +1396,7 @@ void SmallMapWindow::SetOverlayCargoMask() int SmallMapWindow::GetPositionOnLegend(Point pt) { const NWidgetBase *wi = this->GetWidget(WID_SM_LEGEND); - uint line = (pt.y - wi->pos_y - WD_FRAMERECT_TOP) / FONT_HEIGHT_SMALL; + uint line = (pt.y - wi->pos_y - WidgetDimensions::scaled.framerect.top) / FONT_HEIGHT_SMALL; uint columns = this->GetNumberColumnsLegend(wi->current_x); uint number_of_rows = this->GetNumberRowsLegend(columns); if (line >= number_of_rows) return -1; @@ -1404,7 +1404,7 @@ int SmallMapWindow::GetPositionOnLegend(Point pt) bool rtl = _current_text_dir == TD_RTL; int x = pt.x - wi->pos_x; if (rtl) x = wi->current_x - x; - uint column = (x - WD_FRAMERECT_LEFT) / this->column_width; + uint column = (x - WidgetDimensions::scaled.framerect.left) / this->column_width; return (column * number_of_rows) + line; } diff --git a/src/smallmap_gui.h b/src/smallmap_gui.h index d585ed7b8d..cb2992bbae 100644 --- a/src/smallmap_gui.h +++ b/src/smallmap_gui.h @@ -123,7 +123,7 @@ protected: */ inline uint GetMinLegendWidth() const { - return WD_FRAMERECT_LEFT + this->min_number_of_columns * this->column_width; + return WidgetDimensions::scaled.framerect.left + this->min_number_of_columns * this->column_width; } /** @@ -142,7 +142,7 @@ protected: */ inline uint GetLegendHeight(uint num_columns) const { - return WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + + return WidgetDimensions::scaled.framerect.Vertical() + this->GetNumberRowsLegend(num_columns) * FONT_HEIGHT_SMALL; } diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 5e911c0fbd..2c2b7f4de1 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -433,12 +433,12 @@ public: case WID_STL_LIST: { bool rtl = _current_text_dir == TD_RTL; int max = std::min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->stations.size()); - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); uint line_height = this->GetWidget(widget)->resize_y; /* Spacing between station name and first rating graph. */ - int text_spacing = ScaleFontTrad(5); + int text_spacing = WidgetDimensions::scaled.hsep_wide; /* Spacing between additional rating graphs. */ - int rating_spacing = ScaleFontTrad(4); + int rating_spacing = WidgetDimensions::scaled.hsep_normal; for (int i = this->vscroll->GetPosition(); i < max; ++i) { // do until max number of stations of owner const Station *st = this->stations[i]; @@ -484,9 +484,9 @@ public: default: if (widget >= WID_STL_CARGOSTART) { - Rect br = r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM); + Rect br = r.Shrink(WidgetDimensions::scaled.bevel); const CargoSpec *cs = _sorted_cargo_specs[widget - WID_STL_CARGOSTART]; - int cg_ofst = HasBit(this->cargo_filter, cs->Index()) ? 1 : 0; + int cg_ofst = HasBit(this->cargo_filter, cs->Index()) ? WidgetDimensions::scaled.pressed : 0; br = br.Translate(cg_ofst, cg_ofst); GfxFillRect(br, cs->rating_colour); TextColour tc = GetContrastColour(cs->rating_colour); @@ -641,7 +641,7 @@ public: void OnResize() override { - this->vscroll->SetCapacityFromWidget(this, WID_STL_LIST, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM); + this->vscroll->SetCapacityFromWidget(this, WID_STL_LIST, WidgetDimensions::scaled.framerect.Vertical()); } /** @@ -1368,12 +1368,12 @@ struct StationViewWindow : public Window { switch (widget) { case WID_SV_WAITING: resize->height = FONT_HEIGHT_NORMAL; - size->height = WD_FRAMERECT_TOP + 4 * resize->height + WD_FRAMERECT_BOTTOM; + size->height = 4 * resize->height + padding.height; this->expand_shrink_width = std::max(GetStringBoundingBox("-").width, GetStringBoundingBox("+").width); break; case WID_SV_ACCEPT_RATING_LIST: - size->height = WD_FRAMERECT_TOP + ((this->GetWidget(WID_SV_ACCEPTS_RATINGS)->widget_data == STR_STATION_VIEW_RATINGS_BUTTON) ? this->accepts_lines : this->rating_lines) * FONT_HEIGHT_NORMAL + WD_FRAMERECT_BOTTOM; + size->height = ((this->GetWidget(WID_SV_ACCEPTS_RATINGS)->widget_data == STR_STATION_VIEW_RATINGS_BUTTON) ? this->accepts_lines : this->rating_lines) * FONT_HEIGHT_NORMAL + padding.height; break; case WID_SV_CLOSE_AIRPORT: @@ -1441,7 +1441,7 @@ struct StationViewWindow : public Window { /* Draw waiting cargo. */ NWidgetBase *nwi = this->GetWidget(WID_SV_WAITING); - Rect waiting_rect = nwi->GetCurrentRect().Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect waiting_rect = nwi->GetCurrentRect().Shrink(WidgetDimensions::scaled.framerect); this->DrawEntries(&cargo, waiting_rect, pos, maxrows, 0); scroll_to_row = INT_MAX; } @@ -1800,7 +1800,7 @@ struct StationViewWindow : public Window { int DrawAcceptedCargo(const Rect &r) const { const Station *st = Station::Get(this->window_number); - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); CargoTypes cargo_mask = 0; for (CargoID i = 0; i < NUM_CARGO; i++) { @@ -1808,7 +1808,7 @@ struct StationViewWindow : public Window { } SetDParam(0, cargo_mask); int bottom = DrawStringMultiLine(tr.left, tr.right, tr.top, INT32_MAX, STR_STATION_VIEW_ACCEPTS_CARGO); - return CeilDiv(bottom - r.top - WD_FRAMERECT_TOP, FONT_HEIGHT_NORMAL); + return CeilDiv(bottom - r.top - WidgetDimensions::scaled.framerect.top, FONT_HEIGHT_NORMAL); } /** @@ -1820,12 +1820,12 @@ struct StationViewWindow : public Window { { const Station *st = Station::Get(this->window_number); bool rtl = _current_text_dir == TD_RTL; - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); if (st->town->exclusive_counter > 0) { SetDParam(0, st->town->exclusivity); tr.top = DrawStringMultiLine(tr, st->town->exclusivity == st->owner ? STR_STATION_VIEW_EXCLUSIVE_RIGHTS_SELF : STR_STATION_VIEW_EXCLUSIVE_RIGHTS_COMPANY); - tr.top += WD_PAR_VSEP_WIDE; + tr.top += WidgetDimensions::scaled.vsep_wide; } DrawString(tr, STR_STATION_VIEW_SUPPLY_RATINGS_TITLE); @@ -1843,7 +1843,7 @@ struct StationViewWindow : public Window { DrawString(tr.Indent(6, rtl), STR_STATION_VIEW_CARGO_SUPPLY_RATING); tr.top += FONT_HEIGHT_NORMAL; } - return CeilDiv(tr.top - r.top - WD_FRAMERECT_TOP, FONT_HEIGHT_NORMAL); + return CeilDiv(tr.top - r.top - WidgetDimensions::scaled.framerect.top, FONT_HEIGHT_NORMAL); } /** @@ -1885,7 +1885,7 @@ struct StationViewWindow : public Window { { switch (widget) { case WID_SV_WAITING: - this->HandleCargoWaitingClick(this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SV_WAITING, WD_FRAMERECT_TOP) - this->vscroll->GetPosition()); + this->HandleCargoWaitingClick(this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SV_WAITING, WidgetDimensions::scaled.framerect.top) - this->vscroll->GetPosition()); break; case WID_SV_CATCHMENT: @@ -2064,7 +2064,7 @@ struct StationViewWindow : public Window { void OnResize() override { - this->vscroll->SetCapacityFromWidget(this, WID_SV_WAITING, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM); + this->vscroll->SetCapacityFromWidget(this, WID_SV_WAITING, WidgetDimensions::scaled.framerect.Vertical()); } /** @@ -2280,8 +2280,8 @@ struct SelectStationWindow : Window { resize->height = d.height; d.height *= 5; - d.width += WD_FRAMERECT_RIGHT + WD_FRAMERECT_LEFT; - d.height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + d.width += padding.width; + d.height += padding.height; *size = d; } @@ -2289,7 +2289,7 @@ struct SelectStationWindow : Window { { if (widget != WID_JS_PANEL) return; - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); if (this->vscroll->GetPosition() == 0) { DrawString(tr, T::EXPECTED_FACIL == FACIL_WAYPOINT ? STR_JOIN_WAYPOINT_CREATE_SPLITTED_WAYPOINT : STR_JOIN_STATION_CREATE_SPLITTED_STATION); tr.top += this->resize.step_height; @@ -2310,7 +2310,7 @@ struct SelectStationWindow : Window { { if (widget != WID_JS_PANEL) return; - uint st_index = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_JS_PANEL, WD_FRAMERECT_TOP); + uint st_index = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_JS_PANEL, WidgetDimensions::scaled.framerect.top); bool distant_join = (st_index > 0); if (distant_join) st_index--; @@ -2333,7 +2333,7 @@ struct SelectStationWindow : Window { void OnResize() override { - this->vscroll->SetCapacityFromWidget(this, WID_JS_PANEL, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM); + this->vscroll->SetCapacityFromWidget(this, WID_JS_PANEL, WidgetDimensions::scaled.framerect.Vertical()); } /** @@ -2357,7 +2357,7 @@ struct SelectStationWindow : Window { } /* Show coverage area of station under cursor */ - uint st_index = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_JS_PANEL, WD_FRAMERECT_TOP); + uint st_index = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_JS_PANEL, WidgetDimensions::scaled.framerect.top); if (st_index == 0 || st_index > _stations_nearby_list.size()) { SetViewportCatchmentStation(nullptr, true); } else { diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp index 94fe8085ef..5f53e731bc 100644 --- a/src/statusbar_gui.cpp +++ b/src/statusbar_gui.cpp @@ -137,7 +137,7 @@ struct StatusBarWindow : Window { void DrawWidget(const Rect &r, int widget) const override { - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, 0, WD_FRAMERECT_RIGHT, 0); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect, RectPadding::zero); tr.top = CenterBounds(r.top, r.bottom, FONT_HEIGHT_NORMAL); switch (widget) { case WID_S_LEFT: @@ -171,7 +171,7 @@ struct StatusBarWindow : Window { DrawString(tr, msg, TC_FROMSTRING, SA_HOR_CENTER); } else if (this->ticker_scroll < TICKER_STOP && _statusbar_news_item != nullptr && _statusbar_news_item->string_id != 0) { /* Draw the scrolling news text */ - if (!DrawScrollingStatusText(_statusbar_news_item, ScaleGUITrad(this->ticker_scroll), r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, r.bottom)) { + if (!DrawScrollingStatusText(_statusbar_news_item, ScaleGUITrad(this->ticker_scroll), tr.left, tr.right, tr.top, tr.bottom)) { InvalidateWindowData(WC_STATUS_BAR, 0, SBI_NEWS_DELETED); if (Company::IsValidID(_local_company)) { /* This is the default text */ diff --git a/src/story_gui.cpp b/src/story_gui.cpp index e4b8b4a6d3..bc62aff730 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -278,7 +278,7 @@ protected: */ uint GetAvailablePageContentWidth() const { - return this->GetWidget(WID_SB_PAGE_PANEL)->current_x - WD_FRAMETEXT_LEFT - WD_FRAMETEXT_RIGHT - 1; + return this->GetWidget(WID_SB_PAGE_PANEL)->current_x - WidgetDimensions::scaled.frametext.Horizontal() - 1; } /** @@ -346,7 +346,7 @@ protected: case SPET_BUTTON_TILE: case SPET_BUTTON_VEHICLE: { Dimension dim = GetStringBoundingBox(pe.text, FS_NORMAL); - return dim.height + WD_BEVEL_TOP + WD_BEVEL_BOTTOM + WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM; + return dim.height + WidgetDimensions::scaled.framerect.Vertical() + WidgetDimensions::scaled.frametext.Vertical(); } default: @@ -389,7 +389,7 @@ protected: case SPET_BUTTON_TILE: case SPET_BUTTON_VEHICLE: { Dimension dim = GetStringBoundingBox(pe.text, FS_NORMAL); - return dim.width + WD_BEVEL_LEFT + WD_BEVEL_RIGHT + WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT; + return dim.width + WidgetDimensions::scaled.framerect.Vertical() + WidgetDimensions::scaled.frametext.Vertical(); } default: @@ -533,7 +533,7 @@ protected: uint text_top = y_offset + (element_height - line_height) / 2; DrawSprite(action_sprite, PAL_NONE, 0, sprite_top); - DrawString(sprite_dim.width + WD_FRAMETEXT_LEFT, width, text_top, string_id, TC_BLACK); + DrawString(sprite_dim.width + WidgetDimensions::scaled.frametext.left, width, text_top, string_id, TC_BLACK); y_offset += element_height; } @@ -692,7 +692,7 @@ public: StoryPage *page = this->GetSelPage(); if (page == nullptr) return; - Rect fr = r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM); + Rect fr = r.Shrink(WidgetDimensions::scaled.frametext); /* Set up a clipping region for the panel. */ DrawPixelInfo tmp_dpi; @@ -744,14 +744,14 @@ public: case SPET_BUTTON_PUSH: case SPET_BUTTON_TILE: case SPET_BUTTON_VEHICLE: { - const int tmargin = WD_BEVEL_TOP + WD_FRAMETEXT_TOP; + const int tmargin = WidgetDimensions::scaled.bevel.top + WidgetDimensions::scaled.frametext.top; const FrameFlags frame = this->active_button_id == ce.pe->index ? FR_LOWERED : FR_NONE; const Colours bgcolour = StoryPageButtonData{ ce.pe->referenced_id }.GetColour(); DrawFrameRect(ce.bounds.left, ce.bounds.top - scrollpos, ce.bounds.right, ce.bounds.bottom - scrollpos - 1, bgcolour, frame); SetDParamStr(0, ce.pe->text); - DrawString(ce.bounds.left + WD_BEVEL_LEFT, ce.bounds.right - WD_BEVEL_RIGHT, ce.bounds.top + tmargin - scrollpos, STR_JUST_RAW_STRING, TC_WHITE, SA_CENTER); + DrawString(ce.bounds.left + WidgetDimensions::scaled.bevel.left, ce.bounds.right - WidgetDimensions::scaled.bevel.right, ce.bounds.top + tmargin - scrollpos, STR_JUST_RAW_STRING, TC_WHITE, SA_CENTER); break; } @@ -798,7 +798,7 @@ public: case WID_SB_PAGE_PANEL: { d.height *= 5; - d.height += padding.height + WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM; + d.height += padding.height + WidgetDimensions::scaled.frametext.Vertical(); *size = maxdim(*size, d); break; } @@ -809,7 +809,7 @@ public: void OnResize() override { this->InvalidateStoryPageElementLayout(); - this->vscroll->SetCapacityFromWidget(this, WID_SB_PAGE_PANEL, WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM); + this->vscroll->SetCapacityFromWidget(this, WID_SB_PAGE_PANEL, WidgetDimensions::scaled.frametext.Vertical()); this->vscroll->SetCount(this->GetContentHeight()); } @@ -841,7 +841,7 @@ public: break; case WID_SB_PAGE_PANEL: { - int clicked_y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SB_PAGE_PANEL, WD_FRAMETEXT_TOP); + int clicked_y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SB_PAGE_PANEL, WidgetDimensions::scaled.frametext.top); this->EnsureStoryPageElementLayout(); for (const LayoutCacheElement &ce : this->layout_cache) { diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index 8e3dd82dc7..1a87e1b00b 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -40,7 +40,7 @@ struct SubsidyListWindow : Window { { if (widget != WID_SUL_PANEL) return; - int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SUL_PANEL, WD_FRAMERECT_TOP); + int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SUL_PANEL, WidgetDimensions::scaled.framerect.top); int num = 0; for (const Subsidy *s : Subsidy::Iterate()) { if (!s->IsAwarded()) { @@ -130,11 +130,11 @@ struct SubsidyListWindow : Window { if (widget != WID_SUL_PANEL) return; Dimension d = maxdim(GetStringBoundingBox(STR_SUBSIDIES_OFFERED_TITLE), GetStringBoundingBox(STR_SUBSIDIES_SUBSIDISED_TITLE)); - resize->height = d.height; + resize->height = FONT_HEIGHT_NORMAL; d.height *= 5; - d.width += padding.width; - d.height += padding.height; + d.width += WidgetDimensions::scaled.framerect.Horizontal(); + d.height += WidgetDimensions::scaled.framerect.Vertical(); *size = maxdim(*size, d); } @@ -145,7 +145,7 @@ struct SubsidyListWindow : Window { YearMonthDay ymd; ConvertDateToYMD(_date, &ymd); - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); int pos = -this->vscroll->GetPosition(); const int cap = this->vscroll->GetCapacity(); diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index cf632b7f4b..5d374edb74 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -88,7 +88,7 @@ uint TextfileWindow::ReflowContent() line.bottom = height; } } else { - int max_width = this->GetWidget(WID_TF_BACKGROUND)->current_x - WD_FRAMETEXT_LEFT - WD_FRAMERECT_RIGHT; + int max_width = this->GetWidget(WID_TF_BACKGROUND)->current_x - WidgetDimensions::scaled.frametext.Horizontal(); for (auto &line : this->lines) { line.top = height; height += GetStringHeight(line.text, max_width, FS_MONO) / FONT_HEIGHT_MONO; @@ -111,7 +111,7 @@ uint TextfileWindow::GetContentHeight() case WID_TF_BACKGROUND: resize->height = FONT_HEIGHT_MONO; - size->height = 4 * resize->height + TOP_SPACING + BOTTOM_SPACING; // At least 4 lines are visible. + size->height = 4 * resize->height + WidgetDimensions::scaled.frametext.Vertical(); // At least 4 lines are visible. size->width = std::max(200u, size->width); // At least 200 pixels wide. break; } @@ -128,7 +128,7 @@ void TextfileWindow::SetupScrollbars(bool force_reflow) } else { uint height = force_reflow ? this->ReflowContent() : this->GetContentHeight(); this->vscroll->SetCount(std::min(UINT16_MAX, height)); - this->hscroll->SetCount(this->max_length + WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT); + this->hscroll->SetCount(this->max_length + WidgetDimensions::scaled.frametext.Horizontal()); } this->SetWidgetDisabledState(WID_TF_HSCROLLBAR, IsWidgetLowered(WID_TF_WRAPTEXT)); @@ -148,7 +148,7 @@ void TextfileWindow::SetupScrollbars(bool force_reflow) { if (widget != WID_TF_BACKGROUND) return; - Rect fr = r.Shrink(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM); + Rect fr = r.Shrink(WidgetDimensions::scaled.frametext); DrawPixelInfo new_dpi; if (!FillDrawPixelInfo(&new_dpi, fr.left, fr.top, fr.Width(), fr.Height())) return; @@ -178,7 +178,7 @@ void TextfileWindow::SetupScrollbars(bool force_reflow) /* virtual */ void TextfileWindow::OnResize() { - this->vscroll->SetCapacityFromWidget(this, WID_TF_BACKGROUND, TOP_SPACING + BOTTOM_SPACING); + this->vscroll->SetCapacityFromWidget(this, WID_TF_BACKGROUND, WidgetDimensions::scaled.frametext.Vertical()); this->hscroll->SetCapacityFromWidget(this, WID_TF_BACKGROUND); this->SetupScrollbars(false); diff --git a/src/textfile_gui.h b/src/textfile_gui.h index f2ec9346b2..cdcae73888 100644 --- a/src/textfile_gui.h +++ b/src/textfile_gui.h @@ -36,9 +36,6 @@ struct TextfileWindow : public Window, MissingGlyphSearcher { uint max_length; ///< Maximum length of unwrapped text line. - static const int TOP_SPACING = WD_FRAMETEXT_TOP; ///< Additional spacing at the top of the #WID_TF_BACKGROUND widget. - static const int BOTTOM_SPACING = WD_FRAMETEXT_BOTTOM; ///< Additional spacing at the bottom of the #WID_TF_BACKGROUND widget. - TextfileWindow(TextfileType file_type); ~TextfileWindow(); diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 4fbb47e640..7a48756f57 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -196,24 +196,24 @@ struct TimetableWindow : Window { SetDParamMaxValue(0, MAX_YEAR * DAYS_IN_YEAR, 0, FS_SMALL); this->deparr_time_width = GetStringBoundingBox(STR_JUST_DATE_TINY).width; this->deparr_abbr_width = std::max(GetStringBoundingBox(STR_TIMETABLE_ARRIVAL_ABBREVIATION).width, GetStringBoundingBox(STR_TIMETABLE_DEPARTURE_ABBREVIATION).width); - size->width = WD_FRAMERECT_LEFT + this->deparr_abbr_width + 10 + this->deparr_time_width + WD_FRAMERECT_RIGHT; + size->width = this->deparr_abbr_width + WidgetDimensions::scaled.hsep_wide + this->deparr_time_width + padding.width; FALLTHROUGH; case WID_VT_ARRIVAL_DEPARTURE_SELECTION: case WID_VT_TIMETABLE_PANEL: resize->height = FONT_HEIGHT_NORMAL; - size->height = WD_FRAMERECT_TOP + 8 * resize->height + WD_FRAMERECT_BOTTOM; + size->height = 8 * resize->height + padding.height; break; case WID_VT_SUMMARY_PANEL: - size->height = WD_FRAMERECT_TOP + 2 * FONT_HEIGHT_NORMAL + WD_FRAMERECT_BOTTOM; + size->height = 2 * FONT_HEIGHT_NORMAL + padding.height; break; } } int GetOrderFromTimetableWndPt(int y, const Vehicle *v) { - uint sel = (y - this->GetWidget(WID_VT_TIMETABLE_PANEL)->pos_y - WD_FRAMERECT_TOP) / FONT_HEIGHT_NORMAL; + uint sel = (y - this->GetWidget(WID_VT_TIMETABLE_PANEL)->pos_y - WidgetDimensions::scaled.framerect.top) / FONT_HEIGHT_NORMAL; if (sel >= this->vscroll->GetCapacity()) return INVALID_ORDER; @@ -356,14 +356,14 @@ struct TimetableWindow : Window { switch (widget) { case WID_VT_TIMETABLE_PANEL: { - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); int i = this->vscroll->GetPosition(); VehicleOrderID order_id = (i + 1) / 2; bool final_order = false; bool rtl = _current_text_dir == TD_RTL; SetDParamMaxValue(0, v->GetNumOrders(), 2); - int index_column_width = GetStringBoundingBox(STR_ORDER_INDEX).width + 2 * GetSpriteSize(rtl ? SPR_ARROW_RIGHT : SPR_ARROW_LEFT).width + 3; + int index_column_width = GetStringBoundingBox(STR_ORDER_INDEX).width + 2 * GetSpriteSize(rtl ? SPR_ARROW_RIGHT : SPR_ARROW_LEFT).width + WidgetDimensions::scaled.hsep_normal; int middle = rtl ? tr.right - index_column_width : tr.left + index_column_width; const Order *order = v->GetOrder(order_id); @@ -432,7 +432,7 @@ struct TimetableWindow : Window { VehicleOrderID earlyID = BuildArrivalDepartureList(v, arr_dep) ? cur_order : (VehicleOrderID)INVALID_VEH_ORDER_ID; - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); bool show_late = this->show_expected && v->lateness_counter > DAY_TICKS; Ticks offset = show_late ? 0 : -v->lateness_counter; @@ -470,7 +470,7 @@ struct TimetableWindow : Window { } case WID_VT_SUMMARY_PANEL: { - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); Ticks total_time = v->orders != nullptr ? v->orders->GetTimetableDurationIncomplete() : 0; if (total_time != 0) { @@ -628,7 +628,7 @@ struct TimetableWindow : Window { void OnResize() override { /* Update the scroll bar */ - this->vscroll->SetCapacityFromWidget(this, WID_VT_TIMETABLE_PANEL, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM); + this->vscroll->SetCapacityFromWidget(this, WID_VT_TIMETABLE_PANEL, WidgetDimensions::scaled.framerect.Vertical()); } /** diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 6fe6a82f94..0256cea5ea 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -95,7 +95,7 @@ public: DropDownListCheckedItem(StringID string, int result, bool masked, bool checked) : DropDownListStringItem(string, result, masked), checked(checked) { - this->checkmark_width = GetStringBoundingBox(STR_JUST_CHECKMARK).width + 3; + this->checkmark_width = GetStringBoundingBox(STR_JUST_CHECKMARK).width + WidgetDimensions::scaled.hsep_wide; } uint Width() const override @@ -106,7 +106,7 @@ public: void Draw(const Rect &r, bool sel, Colours bg_colour) const override { bool rtl = _current_text_dir == TD_RTL; - Rect tr = r.Shrink(WD_DROPDOWNTEXT_LEFT, 0, WD_DROPDOWNTEXT_RIGHT, 0); + Rect tr = r.Shrink(WidgetDimensions::scaled.dropdowntext, RectPadding::zero); if (this->checked) { DrawString(tr, STR_JUST_CHECKMARK, sel ? TC_WHITE : TC_BLACK); } @@ -139,12 +139,12 @@ public: CompanyID company = (CompanyID)this->result; SetDParam(0, company); SetDParam(1, company); - return GetStringBoundingBox(STR_COMPANY_NAME_COMPANY_NUM).width + this->icon_size.width + this->lock_size.width + WD_DROPDOWNTEXT_LEFT + WD_DROPDOWNTEXT_RIGHT + 6; + return GetStringBoundingBox(STR_COMPANY_NAME_COMPANY_NUM).width + this->icon_size.width + this->lock_size.width + WidgetDimensions::scaled.dropdowntext.Horizontal() + WidgetDimensions::scaled.hsep_wide; } uint Height(uint width) const override { - return std::max(std::max(this->icon_size.height, this->lock_size.height) + WD_IMGBTN_TOP + WD_IMGBTN_BOTTOM, (uint)FONT_HEIGHT_NORMAL); + return std::max(std::max(this->icon_size.height, this->lock_size.height) + WidgetDimensions::scaled.imgbtn.Vertical(), (uint)FONT_HEIGHT_NORMAL); } void Draw(const Rect &r, bool sel, Colours bg_colour) const override @@ -155,7 +155,7 @@ public: /* It's possible the company is deleted while the dropdown is open */ if (!Company::IsValidID(company)) return; - Rect tr = r.Shrink(WD_DROPDOWNTEXT_LEFT, 0, WD_DROPDOWNTEXT_RIGHT, 0); + Rect tr = r.Shrink(WidgetDimensions::scaled.dropdowntext, RectPadding::zero); int icon_y = CenterBounds(r.top, r.bottom, icon_size.height); int text_y = CenterBounds(r.top, r.bottom, FONT_HEIGHT_NORMAL); int lock_y = CenterBounds(r.top, r.bottom, lock_size.height); @@ -173,7 +173,7 @@ public: } else { col = sel ? TC_WHITE : TC_BLACK; } - tr = tr.Indent(this->icon_size.width + 3, rtl).Indent(this->lock_size.width + 3, !rtl); + tr = tr.Indent(this->icon_size.width + WidgetDimensions::scaled.hsep_normal, rtl).Indent(this->lock_size.width + WidgetDimensions::scaled.hsep_normal, !rtl); DrawString(tr.left, tr.right, text_y, STR_COMPANY_NAME_COMPANY_NUM, col); } }; @@ -2374,7 +2374,7 @@ struct ScenarioEditorToolbarWindow : Window { { switch (widget) { case WID_TE_SPACER: - size->width = std::max(GetStringBoundingBox(STR_SCENEDIT_TOOLBAR_OPENTTD).width, GetStringBoundingBox(STR_SCENEDIT_TOOLBAR_SCENARIO_EDITOR).width) + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; + size->width = std::max(GetStringBoundingBox(STR_SCENEDIT_TOOLBAR_OPENTTD).width, GetStringBoundingBox(STR_SCENEDIT_TOOLBAR_SCENARIO_EDITOR).width) + padding.width; break; case WID_TE_DATE: diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 690082fc22..4cdd1828c1 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -50,7 +50,7 @@ static const NWidgetPart _nested_town_authority_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CAPTION, COLOUR_BROWN, WID_TA_CAPTION), SetDataTip(STR_LOCAL_AUTHORITY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), - NWidget(WWT_TEXTBTN, COLOUR_BROWN, WID_TA_ZONE_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_LOCAL_AUTHORITY_ZONE, STR_LOCAL_AUTHORITY_ZONE_TOOLTIP), + NWidget(WWT_TEXTBTN, COLOUR_BROWN, WID_TA_ZONE_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WidgetDimensions::unscaled.framerect.Vertical() + 2), SetDataTip(STR_LOCAL_AUTHORITY_ZONE, STR_LOCAL_AUTHORITY_ZONE_TOOLTIP), NWidget(WWT_SHADEBOX, COLOUR_BROWN), NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN), NWidget(WWT_STICKYBOX, COLOUR_BROWN), @@ -137,7 +137,7 @@ public: /** Draw the contents of the ratings panel. May request a resize of the window if the contents does not fit. */ void DrawRatings() { - Rect r = this->GetWidget(WID_TA_RATING_INFO)->GetCurrentRect().Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect r = this->GetWidget(WID_TA_RATING_INFO)->GetCurrentRect().Shrink(WidgetDimensions::scaled.framerect); DrawString(r, STR_LOCAL_AUTHORITY_COMPANY_RATINGS); r.top += FONT_HEIGHT_NORMAL; @@ -151,9 +151,9 @@ public: int exclusive_y_offset = (FONT_HEIGHT_NORMAL - exclusive_size.height) / 2; bool rtl = _current_text_dir == TD_RTL; - Rect text = r.Indent(icon_width + exclusive_width + 4, rtl); + Rect text = r.Indent(icon_width + WidgetDimensions::scaled.hsep_normal + exclusive_width + WidgetDimensions::scaled.hsep_normal, rtl); uint icon_left = r.WithWidth(icon_width, rtl).left; - uint exclusive_left = r.Indent(icon_width + 2, rtl).WithWidth(exclusive_width, rtl).left; + uint exclusive_left = r.Indent(icon_width + WidgetDimensions::scaled.hsep_normal, rtl).WithWidth(exclusive_width, rtl).left; /* Draw list of companies */ for (const Company *c : Company::Iterate()) { @@ -193,7 +193,7 @@ public: /** Draws the contents of the actions panel. May re-initialise window to resize panel, if the list does not fit. */ void DrawActions() { - Rect r = this->GetWidget(WID_TA_COMMAND_LIST)->GetCurrentRect().Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect r = this->GetWidget(WID_TA_COMMAND_LIST)->GetCurrentRect().Shrink(WidgetDimensions::scaled.framerect); DrawString(r, STR_LOCAL_AUTHORITY_ACTIONS_TITLE); r.top += FONT_HEIGHT_NORMAL; @@ -227,7 +227,7 @@ public: bool affordable = action_cost < Company::GetIfValid(_local_company)->money; SetDParam(0, action_cost); - DrawStringMultiLine(r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM), + DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.framerect), STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING + this->sel_index, affordable ? TC_YELLOW : TC_RED); } @@ -240,31 +240,29 @@ public: switch (widget) { case WID_TA_ACTION_INFO: { assert(size->width > padding.width && size->height > padding.height); - size->width -= WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; - size->height -= WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; Dimension d = {0, 0}; for (int i = 0; i < TACT_COUNT; i++) { SetDParam(0, _price[PR_TOWN_ACTION] * _town_action_costs[i] >> 8); d = maxdim(d, GetStringMultiLineBoundingBox(STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING + i, *size)); } + d.width += padding.width; + d.height += padding.height; *size = maxdim(*size, d); - size->width += WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; - size->height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; break; } case WID_TA_COMMAND_LIST: - size->height = WD_FRAMERECT_TOP + (TACT_COUNT + 1) * FONT_HEIGHT_NORMAL + WD_FRAMERECT_BOTTOM; + size->height = (TACT_COUNT + 1) * FONT_HEIGHT_NORMAL + padding.height; size->width = GetStringBoundingBox(STR_LOCAL_AUTHORITY_ACTIONS_TITLE).width; for (uint i = 0; i < TACT_COUNT; i++ ) { size->width = std::max(size->width, GetStringBoundingBox(STR_LOCAL_AUTHORITY_ACTION_SMALL_ADVERTISING_CAMPAIGN + i).width); } - size->width += WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; + size->width += padding.width; break; case WID_TA_RATING_INFO: resize->height = FONT_HEIGHT_NORMAL; - size->height = WD_FRAMERECT_TOP + 9 * FONT_HEIGHT_NORMAL + WD_FRAMERECT_BOTTOM; + size->height = 9 * FONT_HEIGHT_NORMAL + padding.height; break; } } @@ -381,7 +379,7 @@ public: { if (widget != WID_TV_INFO) return; - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); SetDParam(0, this->town->cache.population); SetDParam(1, this->town->cache.num_houses); @@ -516,7 +514,7 @@ public: { switch (widget) { case WID_TV_INFO: - size->height = GetDesiredInfoHeight(size->width); + size->height = GetDesiredInfoHeight(size->width) + padding.height; break; } } @@ -527,7 +525,7 @@ public: */ uint GetDesiredInfoHeight(int width) const { - uint aimed_height = 3 * FONT_HEIGHT_NORMAL + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + uint aimed_height = 3 * FONT_HEIGHT_NORMAL; bool first = true; for (int i = TE_BEGIN; i < TE_END; i++) { @@ -547,7 +545,7 @@ public: if (!this->town->text.empty()) { SetDParamStr(0, this->town->text); - aimed_height += GetStringHeight(STR_JUST_RAW_STRING, width - WD_FRAMERECT_LEFT - WD_FRAMERECT_RIGHT); + aimed_height += GetStringHeight(STR_JUST_RAW_STRING, width - WidgetDimensions::scaled.framerect.Horizontal()); } return aimed_height; @@ -819,7 +817,7 @@ public: case WID_TD_LIST: { int n = 0; - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); if (this->towns.size() == 0) { // No towns available. DrawString(tr, STR_TOWN_DIRECTORY_NONE); break; @@ -829,7 +827,7 @@ public: bool rtl = _current_text_dir == TD_RTL; Dimension icon_size = GetSpriteSize(SPR_TOWN_RATING_GOOD); int icon_x = tr.WithWidth(icon_size.width, rtl).left; - tr = tr.Indent(icon_size.width + 2, rtl); + tr = tr.Indent(icon_size.width + WidgetDimensions::scaled.hsep_normal, rtl); for (uint i = this->vscroll->GetPosition(); i < this->towns.size(); i++) { const Town *t = this->towns[i]; @@ -893,8 +891,8 @@ public: d.height = std::max(d.height, icon_size.height); resize->height = d.height; d.height *= 5; - d.width += padding.width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; - d.height += padding.height + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; + d.width += padding.width; + d.height += padding.height; *size = maxdim(*size, d); break; } @@ -931,7 +929,7 @@ public: break; case WID_TD_LIST: { // Click on Town Matrix - uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_TD_LIST, WD_FRAMERECT_TOP); + uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_TD_LIST, WidgetDimensions::scaled.framerect.top); if (id_v >= this->towns.size()) return; // click out of town bounds const Town *t = this->towns[id_v]; diff --git a/src/train_gui.cpp b/src/train_gui.cpp index a84b4161cb..7c7aa9eb85 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -72,8 +72,8 @@ static int HighlightDragPosition(int px, int max_width, VehicleID selection, boo int drag_hlight_width = std::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, - drag_hlight_right - WD_FRAMERECT_RIGHT, ScaleGUITrad(13) - WD_FRAMERECT_BOTTOM, _colour_gradient[COLOUR_GREY][7]); + GfxFillRect(drag_hlight_left + WidgetDimensions::scaled.framerect.left, WidgetDimensions::scaled.framerect.top + 1, + drag_hlight_right - WidgetDimensions::scaled.framerect.right, ScaleGUITrad(13) - WidgetDimensions::scaled.framerect.bottom, _colour_gradient[COLOUR_GREY][7]); } return drag_hlight_width; @@ -400,14 +400,14 @@ void DrawTrainDetails(const Train *v, const Rect &r, int vscroll_pos, uint16 vsc dx = 0; } - int sprite_width = std::max(dx, ScaleGUITrad(TRAIN_DETAILS_MIN_INDENT)) + 3; + int sprite_width = std::max(dx, ScaleGUITrad(TRAIN_DETAILS_MIN_INDENT)) + WidgetDimensions::scaled.hsep_normal; Rect dr = r.Indent(sprite_width, rtl); uint num_lines = std::max(1u, (unsigned)_cargo_summary.size()); for (uint i = 0; i < num_lines; i++) { if (vscroll_pos <= 0 && vscroll_pos > -vscroll_cap) { int py = r.top - line_height * vscroll_pos + text_y_offset; if (i > 0 || separate_sprite_row) { - if (vscroll_pos != 0) GfxFillRect(r.left, py - WD_MATRIX_TOP - 1, r.right, py - WD_MATRIX_TOP, _colour_gradient[COLOUR_GREY][5]); + if (vscroll_pos != 0) GfxFillRect(r.left, py - WidgetDimensions::scaled.matrix.top - 1, r.right, py - WidgetDimensions::scaled.matrix.top, _colour_gradient[COLOUR_GREY][5]); } switch (det_tab) { case TDW_TAB_CARGO: diff --git a/src/transparency_gui.cpp b/src/transparency_gui.cpp index ece2e31bbc..479e0f8b7a 100644 --- a/src/transparency_gui.cpp +++ b/src/transparency_gui.cpp @@ -52,15 +52,15 @@ public: case WID_TT_CATENARY: case WID_TT_LOADING: { uint i = widget - WID_TT_BEGIN; - if (HasBit(_transparency_lock, i)) DrawSprite(SPR_LOCK, PAL_NONE, r.left + WD_BEVEL_LEFT, r.top + WD_BEVEL_TOP); + if (HasBit(_transparency_lock, i)) DrawSprite(SPR_LOCK, PAL_NONE, r.left + WidgetDimensions::scaled.fullbevel.left, r.top + WidgetDimensions::scaled.fullbevel.top); break; } case WID_TT_BUTTONS: { - const Rect fr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + const Rect fr = r.Shrink(WidgetDimensions::scaled.framerect); for (uint i = WID_TT_BEGIN; i < WID_TT_END; i++) { if (i == WID_TT_LOADING) continue; // Do not draw button for invisible loading indicators. - const Rect wr = this->GetWidget(i)->GetCurrentRect().Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM); + const Rect wr = this->GetWidget(i)->GetCurrentRect().Shrink(WidgetDimensions::scaled.fullbevel); DrawFrameRect(wr.left, fr.top, wr.right, fr.bottom, COLOUR_PALE_GREEN, HasBit(_invisibility_opt, i - WID_TT_BEGIN) ? FR_LOWERED : FR_NONE); } diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index e37da43114..f3d3603fbd 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -58,8 +58,8 @@ static Dimension GetMaxTreeSpriteSize() Dimension size, this_size; Point offset; /* Avoid to use it uninitialized */ - size.width = 32; // default width - WD_FRAMERECT_LEFT - size.height = 39; // default height - BUTTON_BOTTOM_OFFSET + size.width = ScaleGUITrad(32); // default width - WD_FRAMERECT_LEFT + size.height = ScaleGUITrad(39); // default height - BUTTON_BOTTOM_OFFSET offset.x = 0; offset.y = 0; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 9df9268960..48656a883f 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -539,7 +539,7 @@ typedef std::vector SubtypeList; ///< List of refit subtypes associ */ static void DrawVehicleRefitWindow(const SubtypeList list[NUM_CARGO], const int sel[2], uint pos, uint rows, uint delta, const Rect &r) { - Rect ir = r.Shrink(WD_MATRIX_LEFT, WD_MATRIX_TOP, WD_MATRIX_RIGHT, WD_MATRIX_LEFT); + Rect ir = r.Shrink(WidgetDimensions::scaled.matrix); uint current = 0; bool rtl = _current_text_dir == TD_RTL; @@ -551,7 +551,7 @@ static void DrawVehicleRefitWindow(const SubtypeList list[NUM_CARGO], const int int iconcenter = rtl ? ir.right - iconwidth / 2 : ir.left + iconwidth / 2; int iconinner = rtl ? ir.right - iconwidth : ir.left + iconwidth; - Rect tr = ir.Indent(iconwidth + 4, rtl); + Rect tr = ir.Indent(iconwidth + WidgetDimensions::scaled.hsep_wide, rtl); /* Draw the list of subtypes for each cargo, and find the selected refit option (by its position). */ for (uint i = 0; current < pos + rows && i < NUM_CARGO; i++) { @@ -571,7 +571,7 @@ static void DrawVehicleRefitWindow(const SubtypeList list[NUM_CARGO], const int if (refit.subtype != 0xFF) { /* Draw tree lines */ int ycenter = tr.top + FONT_HEIGHT_NORMAL / 2; - GfxDrawLine(iconcenter, tr.top - WD_MATRIX_TOP, iconcenter, j == list[i].size() - 1 ? ycenter : tr.top - WD_MATRIX_TOP + delta - 1, linecolour); + GfxDrawLine(iconcenter, tr.top - WidgetDimensions::scaled.matrix.top, iconcenter, j == list[i].size() - 1 ? ycenter : tr.top - WidgetDimensions::scaled.matrix.top + delta - 1, linecolour); GfxDrawLine(iconcenter, ycenter, iconinner, ycenter, linecolour); } else { /* Draw expand/collapse icon */ @@ -864,7 +864,7 @@ struct RefitWindow : public Window { { switch (widget) { case WID_VR_MATRIX: - resize->height = WD_MATRIX_TOP + FONT_HEIGHT_NORMAL + WD_MATRIX_BOTTOM; + resize->height = FONT_HEIGHT_NORMAL + padding.height; size->height = resize->height * 8; break; @@ -873,7 +873,7 @@ struct RefitWindow : public Window { break; case WID_VR_INFO: - size->width = WD_FRAMERECT_LEFT + this->information_width + WD_FRAMERECT_RIGHT; + size->width = this->information_width + padding.height; break; } } @@ -933,8 +933,8 @@ struct RefitWindow : public Window { switch (widget) { case WID_VR_VEHICLE_PANEL_DISPLAY: { Vehicle *v = Vehicle::Get(this->window_number); - DrawVehicleImage(v, this->sprite_left + WD_FRAMERECT_LEFT, this->sprite_right - WD_FRAMERECT_RIGHT, - r.top + WD_FRAMERECT_TOP, INVALID_VEHICLE, EIT_IN_DETAILS, this->hscroll != nullptr ? this->hscroll->GetPosition() : 0); + DrawVehicleImage(v, this->sprite_left + WidgetDimensions::scaled.framerect.left, this->sprite_right - WidgetDimensions::scaled.framerect.right, + r.top + WidgetDimensions::scaled.framerect.top, INVALID_VEHICLE, EIT_IN_DETAILS, this->hscroll != nullptr ? this->hscroll->GetPosition() : 0); /* Highlight selected vehicles. */ if (this->order != INVALID_VEH_ORDER_ID) break; @@ -972,7 +972,7 @@ struct RefitWindow : public Window { } if (left != right) { - DrawFrameRect(left, r.top + WD_FRAMERECT_TOP, right, r.top + WD_FRAMERECT_TOP + ScaleGUITrad(14) - 1, COLOUR_WHITE, FR_BORDERONLY); + DrawFrameRect(left, r.top + WidgetDimensions::scaled.framerect.top, right, r.top + WidgetDimensions::scaled.framerect.top + ScaleGUITrad(14) - 1, COLOUR_WHITE, FR_BORDERONLY); } left = INT32_MIN; @@ -998,7 +998,7 @@ struct RefitWindow : public Window { if (this->cargo != nullptr) { StringID string = this->GetCapacityString(this->cargo); if (string != INVALID_STRING_ID) { - DrawStringMultiLine(r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM), string); + DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.framerect), string); } } break; @@ -1213,7 +1213,7 @@ static const NWidgetPart _nested_vehicle_refit_widgets[] = { NWidget(WWT_MATRIX, COLOUR_GREY, WID_VR_MATRIX), SetMinimalSize(228, 112), SetResize(1, 14), SetFill(1, 1), SetMatrixDataTip(1, 0, STR_NULL), SetScrollbar(WID_VR_SCROLLBAR), NWidget(NWID_VSCROLLBAR, COLOUR_GREY, WID_VR_SCROLLBAR), EndContainer(), - NWidget(WWT_PANEL, COLOUR_GREY, WID_VR_INFO), SetMinimalTextLines(2, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM), SetResize(1, 0), EndContainer(), + NWidget(WWT_PANEL, COLOUR_GREY, WID_VR_INFO), SetMinimalTextLines(2, WidgetDimensions::unscaled.framerect.Vertical()), SetResize(1, 0), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_VR_REFIT), SetFill(1, 0), SetResize(1, 0), NWidget(WWT_RESIZEBOX, COLOUR_GREY), @@ -1616,9 +1616,9 @@ void DrawVehicleImage(const Vehicle *v, int left, int right, int y, VehicleID se uint GetVehicleListHeight(VehicleType type, uint divisor) { /* Name + vehicle + profit */ - uint base = ScaleGUITrad(GetVehicleHeight(type)) + 2 * FONT_HEIGHT_SMALL; + uint base = ScaleGUITrad(GetVehicleHeight(type)) + 2 * FONT_HEIGHT_SMALL + WidgetDimensions::scaled.matrix.Vertical(); /* Drawing of the 4 small orders + profit*/ - if (type >= VEH_SHIP) base = std::max(base, 5U * FONT_HEIGHT_SMALL); + if (type >= VEH_SHIP) base = std::max(base, 5U * FONT_HEIGHT_SMALL + WidgetDimensions::scaled.matrix.Vertical()); if (divisor == 1) return base; @@ -1635,11 +1635,11 @@ uint GetVehicleListHeight(VehicleType type, uint divisor) */ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r) const { - Rect ir = r.WithHeight(line_height).Shrink(WD_MATRIX_LEFT, 0, WD_MATRIX_RIGHT, 0); + Rect ir = r.WithHeight(line_height).Shrink(WidgetDimensions::scaled.matrix, RectPadding::zero); bool rtl = _current_text_dir == TD_RTL; Dimension profit = GetSpriteSize(SPR_PROFIT_LOT); - int text_offset = std::max(profit.width, GetDigitWidth() * this->unitnumber_digits) + WD_FRAMERECT_RIGHT; + int text_offset = std::max(profit.width, GetDigitWidth() * this->unitnumber_digits) + WidgetDimensions::scaled.hsep_normal; Rect tr = ir.Indent(text_offset, rtl); bool show_orderlist = this->vli.vtype >= VEH_SHIP; @@ -1658,16 +1658,16 @@ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int SetDParam(0, vehgroup.GetDisplayProfitThisYear()); SetDParam(1, vehgroup.GetDisplayProfitLastYear()); - DrawString(tr.left, tr.right, ir.bottom - FONT_HEIGHT_SMALL - WD_FRAMERECT_BOTTOM, STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR); + DrawString(tr.left, tr.right, ir.bottom - FONT_HEIGHT_SMALL - WidgetDimensions::scaled.framerect.bottom, STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR); - DrawVehicleProfitButton(vehgroup.GetOldestVehicleAge(), vehgroup.GetDisplayProfitLastYear(), vehgroup.NumVehicles(), vehicle_button_x, ir.top + FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL); + DrawVehicleProfitButton(vehgroup.GetOldestVehicleAge(), vehgroup.GetDisplayProfitLastYear(), vehgroup.NumVehicles(), vehicle_button_x, ir.top + FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal); switch (this->grouping) { case GB_NONE: { const Vehicle *v = vehgroup.GetSingleVehicle(); if (HasBit(v->vehicle_flags, VF_PATHFINDER_LOST)) { - DrawSprite(SPR_WARNING_SIGN, PAL_NONE, vehicle_button_x, ir.top + FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL + profit.height); + DrawSprite(SPR_WARNING_SIGN, PAL_NONE, vehicle_button_x, ir.top + FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal + profit.height); } DrawVehicleImage(v, image_left, image_right, CenterBounds(ir.top, ir.bottom, image_height), selected_vehicle, EIT_IN_LIST, 0); @@ -1692,7 +1692,7 @@ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int } SetDParam(0, v->unitnumber); - DrawString(ir.left, ir.right, ir.top + WD_FRAMERECT_TOP, str); + DrawString(ir.left, ir.right, ir.top + WidgetDimensions::scaled.framerect.top, str); break; } @@ -1700,14 +1700,14 @@ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int assert(vehgroup.NumVehicles() > 0); for (int i = 0; i < static_cast(vehgroup.NumVehicles()); ++i) { - if (image_left + 8 * i >= image_right) break; // Break if there is no more space to draw any more vehicles anyway. - DrawVehicleImage(vehgroup.vehicles_begin[i], image_left + 8 * i, image_right, CenterBounds(ir.top, ir.bottom, image_height), selected_vehicle, EIT_IN_LIST, 0); + if (image_left + WidgetDimensions::scaled.hsep_wide * i >= image_right) break; // Break if there is no more space to draw any more vehicles anyway. + DrawVehicleImage(vehgroup.vehicles_begin[i], image_left + WidgetDimensions::scaled.hsep_wide * i, image_right, CenterBounds(ir.top, ir.bottom, image_height), selected_vehicle, EIT_IN_LIST, 0); } if (show_orderlist) DrawSmallOrderList((vehgroup.vehicles_begin[0])->GetFirstOrder(), olr.left, olr.right, ir.top, this->order_arrow_width); SetDParam(0, vehgroup.NumVehicles()); - DrawString(ir.left, ir.right, ir.top + WD_FRAMERECT_TOP, STR_BLACK_COMMA); + DrawString(ir.left, ir.right, ir.top + WidgetDimensions::scaled.framerect.top, STR_BLACK_COMMA); break; default: @@ -2300,13 +2300,13 @@ struct VehicleDetailsWindow : Window { uint desired_height; if (v->HasArticulatedPart()) { /* An articulated RV has its text drawn under the sprite instead of after it, hence 15 pixels extra. */ - desired_height = WD_FRAMERECT_TOP + ScaleGUITrad(15) + 3 * FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL * 2 + WD_FRAMERECT_BOTTOM; + desired_height = ScaleGUITrad(15) + 3 * FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal * 2; /* Add space for the cargo amount for each part. */ for (const Vehicle *u = v; u != nullptr; u = u->Next()) { if (u->cargo_cap != 0) desired_height += FONT_HEIGHT_NORMAL; } } else { - desired_height = WD_FRAMERECT_TOP + 4 * FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL * 2 + WD_FRAMERECT_BOTTOM; + desired_height = 4 * FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal * 2; } return desired_height; } @@ -2316,7 +2316,7 @@ struct VehicleDetailsWindow : Window { switch (widget) { case WID_VD_TOP_DETAILS: { Dimension dim = { 0, 0 }; - size->height = WD_FRAMERECT_TOP + 4 * FONT_HEIGHT_NORMAL + WD_FRAMERECT_BOTTOM; + size->height = 4 * FONT_HEIGHT_NORMAL + padding.height; for (uint i = 0; i < 4; i++) SetDParamMaxValue(i, INT16_MAX); static const StringID info_strings[] = { @@ -2331,7 +2331,7 @@ struct VehicleDetailsWindow : Window { } SetDParam(0, STR_VEHICLE_INFO_AGE); dim = maxdim(dim, GetStringBoundingBox(STR_VEHICLE_INFO_AGE_RUNNING_COST_YR)); - size->width = dim.width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; + size->width = dim.width + padding.width; break; } @@ -2339,15 +2339,15 @@ struct VehicleDetailsWindow : Window { const Vehicle *v = Vehicle::Get(this->window_number); switch (v->type) { case VEH_ROAD: - size->height = this->GetRoadVehDetailsHeight(v); + size->height = this->GetRoadVehDetailsHeight(v) + padding.height; break; case VEH_SHIP: - size->height = WD_FRAMERECT_TOP + 4 * FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL * 2 + WD_FRAMERECT_BOTTOM; + size->height = 4 * FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal * 2 + padding.height; break; case VEH_AIRCRAFT: - size->height = WD_FRAMERECT_TOP + 5 * FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL * 2 + WD_FRAMERECT_BOTTOM; + size->height = 5 * FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal * 2 + padding.height; break; default: @@ -2357,7 +2357,7 @@ struct VehicleDetailsWindow : Window { } case WID_VD_MATRIX: - resize->height = std::max(ScaleGUITrad(14), WD_MATRIX_TOP + FONT_HEIGHT_NORMAL + WD_MATRIX_BOTTOM); + resize->height = std::max(ScaleGUITrad(14), FONT_HEIGHT_NORMAL + padding.height); size->height = 4 * resize->height; break; @@ -2367,7 +2367,7 @@ struct VehicleDetailsWindow : Window { *size = maxdim(*size, GetStringBoundingBox(*strs++)); } size->width += padding.width; - size->height = FONT_HEIGHT_NORMAL + WD_DROPDOWNTEXT_TOP + WD_DROPDOWNTEXT_BOTTOM; + size->height = FONT_HEIGHT_NORMAL + padding.height; break; } @@ -2377,8 +2377,8 @@ struct VehicleDetailsWindow : Window { size->width = std::max( GetStringBoundingBox(STR_VEHICLE_DETAILS_SERVICING_INTERVAL_PERCENT).width, GetStringBoundingBox(STR_VEHICLE_DETAILS_SERVICING_INTERVAL_DAYS).width - ) + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; - size->height = WD_FRAMERECT_TOP + FONT_HEIGHT_NORMAL + WD_FRAMERECT_BOTTOM; + ) + padding.width; + size->height = FONT_HEIGHT_NORMAL + padding.height; break; } } @@ -2427,7 +2427,7 @@ struct VehicleDetailsWindow : Window { switch (widget) { case WID_VD_TOP_DETAILS: { - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); /* Draw running cost */ SetDParam(1, v->age / DAYS_IN_LEAP_YEAR); @@ -2487,16 +2487,17 @@ struct VehicleDetailsWindow : Window { break; } - case WID_VD_MATRIX: + case WID_VD_MATRIX: { /* For trains only. */ - DrawVehicleDetails(v, r.Shrink(WD_MATRIX_LEFT, 0, WD_MATRIX_RIGHT, 0).WithHeight(this->resize.step_height), this->vscroll->GetPosition(), this->vscroll->GetCapacity(), this->tab); + DrawVehicleDetails(v, r.Shrink(WidgetDimensions::scaled.matrix, RectPadding::zero).WithHeight(this->resize.step_height), this->vscroll->GetPosition(), this->vscroll->GetCapacity(), this->tab); break; + } case WID_VD_MIDDLE_DETAILS: { /* For other vehicles, at the place of the matrix. */ bool rtl = _current_text_dir == TD_RTL; - uint sprite_width = GetSingleVehicleWidth(v, EIT_IN_DETAILS) + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT; - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + uint sprite_width = GetSingleVehicleWidth(v, EIT_IN_DETAILS) + WidgetDimensions::scaled.framerect.Horizontal(); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); /* Articulated road vehicles use a complete line. */ if (v->type == VEH_ROAD && v->HasArticulatedPart()) { @@ -2512,7 +2513,7 @@ struct VehicleDetailsWindow : Window { case WID_VD_SERVICING_INTERVAL: { /* Draw service interval text */ - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM); + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect); SetDParam(0, v->GetServiceInterval()); SetDParam(1, v->date_of_last_service); DrawString(tr.left, tr.right, CenterBounds(r.top, r.bottom, FONT_HEIGHT_NORMAL), @@ -2673,7 +2674,7 @@ static const NWidgetPart _nested_vehicle_view_widgets[] = { EndContainer(), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(WWT_PUSHBTN, COLOUR_GREY, WID_VV_START_STOP), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetResize(1, 0), SetFill(1, 0), + NWidget(WWT_PUSHBTN, COLOUR_GREY, WID_VV_START_STOP), SetResize(1, 0), SetFill(1, 0), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_VV_ORDER_LOCATION), SetMinimalSize(12, 14), SetDataTip(SPR_GOTO_LOCATION, STR_VEHICLE_VIEW_ORDER_LOCATION_TOOLTIP), NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), @@ -2877,7 +2878,7 @@ public: const Vehicle *v = Vehicle::Get(this->window_number); switch (widget) { case WID_VV_START_STOP: - size->height = std::max({size->height, GetSpriteSize(SPR_WARNING_SIGN).height, GetSpriteSize(SPR_FLAG_VEH_STOPPED).height, GetSpriteSize(SPR_FLAG_VEH_RUNNING).height}) + WD_IMGBTN_TOP + WD_IMGBTN_BOTTOM; + size->height = std::max({size->height, (uint)FONT_HEIGHT_NORMAL, GetSpriteSize(SPR_WARNING_SIGN).height, GetSpriteSize(SPR_FLAG_VEH_STOPPED).height, GetSpriteSize(SPR_FLAG_VEH_RUNNING).height}) + padding.height; break; case WID_VV_FORCE_PROCEED: @@ -3025,11 +3026,11 @@ public: /* Draw the flag plus orders. */ bool rtl = (_current_text_dir == TD_RTL); uint icon_width = std::max({GetSpriteSize(SPR_WARNING_SIGN).width, GetSpriteSize(SPR_FLAG_VEH_STOPPED).width, GetSpriteSize(SPR_FLAG_VEH_RUNNING).width}); - int lowered = this->IsWidgetLowered(widget) ? 1 : 0; - Rect tr = r.Shrink(WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM).Translate(lowered, lowered); + int lowered = this->IsWidgetLowered(widget) ? WidgetDimensions::scaled.pressed : 0; + Rect tr = r.Shrink(WidgetDimensions::scaled.framerect).Translate(lowered, lowered); SpriteID image = ((v->vehstatus & VS_STOPPED) != 0) ? SPR_FLAG_VEH_STOPPED : (HasBit(v->vehicle_flags, VF_PATHFINDER_LOST)) ? SPR_WARNING_SIGN : SPR_FLAG_VEH_RUNNING; DrawSprite(image, PAL_NONE, tr.WithWidth(icon_width, rtl).left, CenterBounds(tr.top, tr.bottom, GetSpriteSize(image).height)); - tr = tr.Indent(icon_width + WD_IMGBTN_LEFT + WD_IMGBTN_RIGHT, rtl); + tr = tr.Indent(icon_width + WidgetDimensions::scaled.imgbtn.Horizontal(), rtl); DrawString(tr.left, tr.right, CenterBounds(tr.top, tr.bottom, FONT_HEIGHT_NORMAL), str, text_colour, SA_HOR_CENTER); } diff --git a/src/viewport.cpp b/src/viewport.cpp index 3819266c54..341bace7fa 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1301,7 +1301,7 @@ void ViewportAddString(const DrawPixelInfo *dpi, ZoomLevel small_from, const Vie int right = left + dpi->width; int bottom = top + dpi->height; - int sign_height = ScaleByZoom(VPSM_TOP + FONT_HEIGHT_NORMAL + VPSM_BOTTOM, dpi->zoom); + int sign_height = ScaleByZoom(WidgetDimensions::scaled.framerect.top + FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.framerect.bottom, dpi->zoom); int sign_half_width = ScaleByZoom((small ? sign->width_small : sign->width_normal) / 2, dpi->zoom); if (bottom < sign->top || @@ -1329,8 +1329,8 @@ static Rect ExpandRectWithViewportSignMargins(Rect r, ZoomLevel zoom) /* Pessimistically always use normal font, but also assume small font is never larger in either dimension */ const int fh = FONT_HEIGHT_NORMAL; const int max_tw = _viewport_sign_maxwidth / 2 + 1; - const int expand_y = ScaleByZoom(VPSM_TOP + fh + VPSM_BOTTOM, zoom); - const int expand_x = ScaleByZoom(VPSM_LEFT + max_tw + VPSM_RIGHT, zoom); + const int expand_y = ScaleByZoom(WidgetDimensions::scaled.framerect.top + fh + WidgetDimensions::scaled.framerect.bottom, zoom); + const int expand_x = ScaleByZoom(WidgetDimensions::scaled.framerect.left + max_tw + WidgetDimensions::scaled.framerect.right, zoom); r.left -= expand_x; r.right += expand_x; @@ -1451,14 +1451,14 @@ void ViewportSign::UpdatePosition(int center, int top, StringID str, StringID st char buffer[DRAW_STRING_BUFFER]; GetString(buffer, str, lastof(buffer)); - this->width_normal = VPSM_LEFT + Align(GetStringBoundingBox(buffer).width, 2) + VPSM_RIGHT; + this->width_normal = WidgetDimensions::scaled.framerect.left + Align(GetStringBoundingBox(buffer).width, 2) + WidgetDimensions::scaled.framerect.right; this->center = center; /* zoomed out version */ if (str_small != STR_NULL) { GetString(buffer, str_small, lastof(buffer)); } - this->width_small = VPSM_LEFT + Align(GetStringBoundingBox(buffer, FS_SMALL).width, 2) + VPSM_RIGHT; + this->width_small = WidgetDimensions::scaled.framerect.left + Align(GetStringBoundingBox(buffer, FS_SMALL).width, 2) + WidgetDimensions::scaled.framerect.right; this->MarkDirty(); } @@ -1478,7 +1478,7 @@ void ViewportSign::MarkDirty(ZoomLevel maxzoom) const zoomlevels[zoom].left = this->center - ScaleByZoom(this->width_normal / 2 + 1, zoom); zoomlevels[zoom].top = this->top - ScaleByZoom(1, zoom); zoomlevels[zoom].right = this->center + ScaleByZoom(this->width_normal / 2 + 1, zoom); - zoomlevels[zoom].bottom = this->top + ScaleByZoom(VPSM_TOP + FONT_HEIGHT_NORMAL + VPSM_BOTTOM + 1, zoom); + zoomlevels[zoom].bottom = this->top + ScaleByZoom(WidgetDimensions::scaled.framerect.top + FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.framerect.bottom + 1, zoom); } for (const Window *w : Window::Iterate()) { @@ -1688,7 +1688,7 @@ static void ViewportDrawStrings(ZoomLevel zoom, const StringSpriteToDrawVector * int w = GB(ss.width, 0, 15); int x = UnScaleByZoom(ss.x, zoom); int y = UnScaleByZoom(ss.y, zoom); - int h = VPSM_TOP + (small ? FONT_HEIGHT_SMALL : FONT_HEIGHT_NORMAL) + VPSM_BOTTOM; + int h = WidgetDimensions::scaled.framerect.top + (small ? FONT_HEIGHT_SMALL : FONT_HEIGHT_NORMAL) + WidgetDimensions::scaled.framerect.bottom; SetDParam(0, ss.params[0]); SetDParam(1, ss.params[1]); @@ -1706,13 +1706,13 @@ static void ViewportDrawStrings(ZoomLevel zoom, const StringSpriteToDrawVector * /* Draw the rectangle if 'transparent station signs' is off, * or if we are drawing a general text sign (STR_WHITE_SIGN). */ DrawFrameRect( - x, y, x + w, y + h, ss.colour, + x, y, x + w - 1, y + h - 1, ss.colour, IsTransparencySet(TO_SIGNS) ? FR_TRANSPARENT : FR_NONE ); } } - DrawString(x + VPSM_LEFT, x + w - 1 - VPSM_RIGHT, y + VPSM_TOP, ss.string, colour, SA_HOR_CENTER); + DrawString(x + WidgetDimensions::scaled.framerect.left, x + w - 1 - WidgetDimensions::scaled.framerect.right, y + WidgetDimensions::scaled.framerect.top, ss.string, colour, SA_HOR_CENTER); } } @@ -2131,7 +2131,7 @@ static bool CheckClickOnViewportSign(const Viewport *vp, int x, int y, const Vie { bool small = (vp->zoom >= ZOOM_LVL_OUT_16X); int sign_half_width = ScaleByZoom((small ? sign->width_small : sign->width_normal) / 2, vp->zoom); - int sign_height = ScaleByZoom(VPSM_TOP + (small ? FONT_HEIGHT_SMALL : FONT_HEIGHT_NORMAL) + VPSM_BOTTOM, vp->zoom); + int sign_height = ScaleByZoom(WidgetDimensions::scaled.framerect.top + (small ? FONT_HEIGHT_SMALL : FONT_HEIGHT_NORMAL) + WidgetDimensions::scaled.framerect.bottom, vp->zoom); return y >= sign->top && y < sign->top + sign_height && x >= sign->center - sign_half_width && x < sign->center + sign_half_width; diff --git a/src/viewport_type.h b/src/viewport_type.h index 03374aef96..5200514403 100644 --- a/src/viewport_type.h +++ b/src/viewport_type.h @@ -34,14 +34,6 @@ struct Viewport { LinkGraphOverlay *overlay; }; -/** Margins for the viewport sign */ -enum ViewportSignMargin { - VPSM_LEFT = 1, ///< Left margin - VPSM_RIGHT = 1, ///< Right margin - VPSM_TOP = 1, ///< Top margin - VPSM_BOTTOM = 1, ///< Bottom margin -}; - /** Location information about a sign as seen on the viewport */ struct ViewportSign { int32 center; ///< The center position of the sign diff --git a/src/widget.cpp b/src/widget.cpp index 9d9ca94da4..ab957beaf9 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -33,7 +33,6 @@ const WidgetDimensions WidgetDimensions::unscaled = { {WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM}, ///< fullbevel {WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM}, ///< framerect {WD_FRAMETEXT_LEFT, WD_FRAMETEXT_TOP, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_BOTTOM}, ///< frametext - {WD_FRAMETEXT_LEFT, WD_TEXTPANEL_TOP, WD_FRAMETEXT_RIGHT, WD_TEXTPANEL_BOTTOM}, ///< textpanel {WD_MATRIX_LEFT, WD_MATRIX_TOP, WD_MATRIX_RIGHT, WD_MATRIX_BOTTOM}, ///< matrix {WD_SHADEBOX_LEFT, WD_SHADEBOX_TOP, WD_SHADEBOX_RIGHT, WD_SHADEBOX_BOTTOM}, ///< shadebox {WD_STICKYBOX_LEFT, WD_STICKYBOX_TOP, WD_STICKYBOX_RIGHT, WD_STICKYBOX_BOTTOM}, ///< stickybox @@ -99,7 +98,6 @@ void SetupWidgetDimensions() WidgetDimensions::scaled.fullbevel = ScaleGUITrad(WidgetDimensions::unscaled.fullbevel); WidgetDimensions::scaled.framerect = ScaleGUITrad(WidgetDimensions::unscaled.framerect); WidgetDimensions::scaled.frametext = ScaleGUITrad(WidgetDimensions::unscaled.frametext); - WidgetDimensions::scaled.textpanel = ScaleGUITrad(WidgetDimensions::unscaled.textpanel); WidgetDimensions::scaled.matrix = ScaleGUITrad(WidgetDimensions::unscaled.matrix); WidgetDimensions::scaled.shadebox = ScaleGUITrad(WidgetDimensions::unscaled.shadebox); WidgetDimensions::scaled.stickybox = ScaleGUITrad(WidgetDimensions::unscaled.stickybox); @@ -989,7 +987,7 @@ void NWidgetResizeBase::SetMinimalSizeAbsolute(uint min_x, uint min_y) /** * Set minimal text lines for the widget. * @param min_lines Number of text lines of the widget. - * @param spacing Extra spacing (eg WD_FRAMERECT_TOP + _BOTTOM) of the widget. + * @param spacing Extra unscaled spacing (eg WidgetDimensions::unscaled.framerect.Vertical()) of the widget. * @param size Font size of text. */ void NWidgetResizeBase::SetMinimalTextLines(uint8 min_lines, uint8 spacing, FontSize size) diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index d65f8cd6f8..fd427c2692 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -13,6 +13,7 @@ #include "../strings_func.h" #include "../window_func.h" #include "../guitimer_func.h" +#include "../zoom_func.h" #include "dropdown_type.h" #include "dropdown_widget.h" @@ -25,21 +26,22 @@ void DropDownListItem::Draw(const Rect &r, bool sel, Colours bg_colour) const int c1 = _colour_gradient[bg_colour][3]; int c2 = _colour_gradient[bg_colour][7]; - int mid = (r.top + r.bottom) / 2; - GfxFillRect(r.left + 1, mid - 2, r.right - 1, mid - 2, c1); - GfxFillRect(r.left + 1, mid - 1, r.right - 1, mid - 1, c2); + int mid = CenterBounds(r.top, r.bottom, 0); + GfxFillRect(r.left, mid - WidgetDimensions::scaled.bevel.bottom, r.right, mid - 1, c1); + GfxFillRect(r.left, mid, r.right, mid + WidgetDimensions::scaled.bevel.top - 1, c2); } uint DropDownListStringItem::Width() const { char buffer[512]; GetString(buffer, this->String(), lastof(buffer)); - return GetStringBoundingBox(buffer).width; + return GetStringBoundingBox(buffer).width + WidgetDimensions::scaled.dropdowntext.Horizontal(); } void DropDownListStringItem::Draw(const Rect &r, bool sel, Colours bg_colour) const { - DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top, this->String(), sel ? TC_WHITE : TC_BLACK); + Rect ir = r.Shrink(WidgetDimensions::scaled.dropdowntext); + DrawString(ir.left, ir.right, r.top, this->String(), sel ? TC_WHITE : TC_BLACK); } /** @@ -82,14 +84,14 @@ uint DropDownListIconItem::Height(uint width) const uint DropDownListIconItem::Width() const { - return DropDownListStringItem::Width() + this->dim.width + WD_FRAMERECT_LEFT; + return DropDownListParamStringItem::Width() + this->dim.width + WidgetDimensions::scaled.hsep_wide; } void DropDownListIconItem::Draw(const Rect &r, bool sel, Colours bg_colour) const { bool rtl = _current_text_dir == TD_RTL; - Rect ir = r.Shrink(WD_DROPDOWNTEXT_LEFT, WD_DROPDOWNTEXT_TOP, WD_DROPDOWNTEXT_RIGHT, WD_DROPDOWNTEXT_LEFT); - Rect tr = ir.Indent(this->dim.width + WD_FRAMERECT_LEFT, rtl); + Rect ir = r.Shrink(WidgetDimensions::scaled.dropdowntext); + Rect tr = ir.Indent(this->dim.width + WidgetDimensions::scaled.hsep_normal, rtl); DrawSprite(this->sprite, this->pal, ir.WithWidth(this->dim.width, rtl).left, CenterBounds(r.top, r.bottom, this->sprite_y)); DrawString(tr.left, tr.right, CenterBounds(r.top, r.bottom, FONT_HEIGHT_NORMAL), this->String(), sel ? TC_WHITE : TC_BLACK); } @@ -155,7 +157,7 @@ struct DropdownWindow : Window { uint items_width = size.width - (scroll ? NWidgetScrollbar::GetVerticalDimension().width : 0); NWidgetCore *nwi = this->GetWidget(WID_DM_ITEMS); - nwi->SetMinimalSizeAbsolute(items_width, size.height + 4); + nwi->SetMinimalSizeAbsolute(items_width, size.height + WidgetDimensions::scaled.fullbevel.Vertical() * 2); nwi->colour = wi_colour; nwi = this->GetWidget(WID_DM_SCROLL); @@ -215,8 +217,8 @@ struct DropdownWindow : Window { { if (GetWidgetFromPos(this, _cursor.pos.x - this->left, _cursor.pos.y - this->top) < 0) return false; - const Rect &r = this->GetWidget(WID_DM_ITEMS)->GetCurrentRect(); - int y = _cursor.pos.y - this->top - r.top - 2; + const Rect &r = this->GetWidget(WID_DM_ITEMS)->GetCurrentRect().Shrink(WidgetDimensions::scaled.fullbevel); + int y = _cursor.pos.y - this->top - r.top - WidgetDimensions::scaled.fullbevel.top; int width = r.Width(); int pos = this->vscroll->GetPosition(); @@ -244,22 +246,23 @@ struct DropdownWindow : Window { Colours colour = this->GetWidget(widget)->colour; - int y = r.top + 2; + Rect ir = r.Shrink(WidgetDimensions::scaled.fullbevel).Shrink(RectPadding::zero, WidgetDimensions::scaled.fullbevel); + int y = ir.top; int pos = this->vscroll->GetPosition(); for (const auto &item : this->list) { - int item_height = item->Height(r.Width()); + int item_height = item->Height(ir.Width()); /* Skip items that are scrolled up */ if (--pos >= 0) continue; - if (y + item_height < r.bottom) { + if (y + item_height - 1 <= ir.bottom) { bool selected = (this->selected_index == item->result); - if (selected) GfxFillRect(r.left + 2, y, r.right - 1, y + item_height - 1, PC_BLACK); + if (selected) GfxFillRect(ir.left, y, ir.right, y + item_height - 1, PC_BLACK); - item->Draw({r.left, y, r.right, y + item_height - 1}, selected, colour); + item->Draw({ir.left, y, ir.right, y + item_height - 1}, selected, colour); if (item->masked) { - GfxFillRect(r.left + 1, y, r.right - 1, y + item_height - 1, _colour_gradient[colour][5], FILLRECT_CHECKER); + GfxFillRect(ir.left, y, ir.right, y + item_height - 1, _colour_gradient[colour][5], FILLRECT_CHECKER); } } y += item_height; @@ -373,9 +376,11 @@ void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button for (const auto &item : list) { height += item->Height(width); - if (auto_width) max_item_width = std::max(max_item_width, item->Width() + 5); + if (auto_width) max_item_width = std::max(max_item_width, item->Width()); } + if (auto_width) max_item_width += WidgetDimensions::scaled.fullbevel.Horizontal(); + /* Scrollbar needed? */ bool scroll = false; @@ -383,12 +388,12 @@ void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button bool above = false; /* Available height below (or above, if the dropdown is placed above the widget). */ - uint available_height = std::max(GetMainViewBottom() - top - 4, 0); + uint available_height = std::max(GetMainViewBottom() - top - WidgetDimensions::scaled.fullbevel.Vertical() * 2, 0U); /* If the dropdown doesn't fully fit below the widget... */ if (height > available_height) { - uint available_height_above = std::max(w->top + wi_rect.top - GetMainViewTop() - 4, 0); + uint available_height_above = std::max(w->top + wi_rect.top - GetMainViewTop() - WidgetDimensions::scaled.fullbevel.Vertical() * 2, 0U); /* Put the dropdown above if there is more available space. */ if (available_height_above > available_height) { @@ -414,7 +419,7 @@ void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button /* Set the top position if needed. */ if (above) { - top = w->top + wi_rect.top - height - 4; + top = w->top + wi_rect.top - height - WidgetDimensions::scaled.fullbevel.Vertical() * 2; } } @@ -459,9 +464,9 @@ void ShowDropDownList(Window *w, DropDownList &&list, int selected, int button, if (width != 0) { if (_current_text_dir == TD_RTL) { - wi_rect.left = wi_rect.right + 1 - width; + wi_rect.left = wi_rect.right + 1 - ScaleGUITrad(width); } else { - wi_rect.right = wi_rect.left + width - 1; + wi_rect.right = wi_rect.left + ScaleGUITrad(width) - 1; } } diff --git a/src/window.cpp b/src/window.cpp index 7b121cca57..f7092741e6 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1639,7 +1639,7 @@ static Point GetAutoPlacePosition(int width, int height) */ int left = rtl ? _screen.width - width : 0, top = toolbar_y; int offset_x = rtl ? -(int)NWidgetLeaf::closebox_dimension.width : (int)NWidgetLeaf::closebox_dimension.width; - int offset_y = std::max(NWidgetLeaf::closebox_dimension.height, FONT_HEIGHT_NORMAL + WD_CAPTIONTEXT_TOP + WD_CAPTIONTEXT_BOTTOM); + int offset_y = std::max(NWidgetLeaf::closebox_dimension.height, FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.captiontext.Vertical()); restart: for (const Window *w : Window::Iterate()) { @@ -1705,7 +1705,7 @@ static Point LocalGetWindowPlacement(const WindowDesc *desc, int16 sm_width, int * - Y position: closebox of parent + closebox of child + statusbar * - X position: closebox on left/right, resizebox on right/left (depending on ltr/rtl) */ - int indent_y = std::max(NWidgetLeaf::closebox_dimension.height, FONT_HEIGHT_NORMAL + WD_CAPTIONTEXT_TOP + WD_CAPTIONTEXT_BOTTOM); + int indent_y = std::max(NWidgetLeaf::closebox_dimension.height, FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.captiontext.Vertical()); if (w->top + 3 * indent_y < _screen.height) { pt.y = w->top + indent_y; int indent_close = NWidgetLeaf::closebox_dimension.width; diff --git a/src/window_gui.h b/src/window_gui.h index 6d7ef61118..5228be4b2d 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -43,7 +43,6 @@ struct WidgetDimensions { RectPadding fullbevel; ///< Always-scaled bevel border. RectPadding framerect; ///< Offsets within frame area. RectPadding frametext; ///< Offsets within a text frame area. - RectPadding textpanel; ///< Text panel? RectPadding matrix; ///< Offsets within a matrix cell. RectPadding shadebox; RectPadding stickybox; @@ -100,10 +99,6 @@ enum WidgetDrawDistances { WD_FRAMERECT_TOP = 1, ///< Offset at top to draw the frame rectangular area WD_FRAMERECT_BOTTOM = 1, ///< Offset at bottom to draw the frame rectangular area - /* Extra space at top/bottom of text panels */ - WD_TEXTPANEL_TOP = 6, ///< Offset at top to draw above the text - WD_TEXTPANEL_BOTTOM = 6, ///< Offset at bottom to draw below the text - /* WWT_FRAME */ WD_FRAMETEXT_LEFT = 6, ///< Left offset of the text of the frame. WD_FRAMETEXT_RIGHT = 6, ///< Right offset of the text of the frame. From e554fd7808cd1adab913c4c2135e04a5d26baab0 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 19 May 2021 08:50:43 +0100 Subject: [PATCH 02/42] Change: Hide WidgetDrawDistances from general use. --- src/widget.cpp | 107 +++++++++++++++++++++++++++++++++++++++++++++++ src/window_gui.h | 107 ----------------------------------------------- 2 files changed, 107 insertions(+), 107 deletions(-) diff --git a/src/widget.cpp b/src/widget.cpp index ab957beaf9..fe1dcff893 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -24,6 +24,113 @@ #include "safeguards.h" +/** Distances used in drawing widgets. */ +enum WidgetDrawDistances { + /* WWT_IMGBTN(_2) */ + WD_IMGBTN_LEFT = 1, ///< Left offset of the image in the button. + WD_IMGBTN_RIGHT = 2, ///< Right offset of the image in the button. + WD_IMGBTN_TOP = 1, ///< Top offset of image in the button. + WD_IMGBTN_BOTTOM = 2, ///< Bottom offset of image in the button. + + /* WWT_INSET */ + WD_INSET_LEFT = 2, ///< Left offset of string. + WD_INSET_RIGHT = 2, ///< Right offset of string. + WD_INSET_TOP = 1, ///< Top offset of string. + + WD_VSCROLLBAR_LEFT = 2, ///< Left offset of vertical scrollbar. + WD_VSCROLLBAR_RIGHT = 2, ///< Right offset of vertical scrollbar. + WD_VSCROLLBAR_TOP = 3, ///< Top offset of vertical scrollbar. + WD_VSCROLLBAR_BOTTOM = 3, ///< Bottom offset of vertical scrollbar. + + WD_HSCROLLBAR_LEFT = 3, ///< Left offset of horizontal scrollbar. + WD_HSCROLLBAR_RIGHT = 3, ///< Right offset of horizontal scrollbar. + WD_HSCROLLBAR_TOP = 2, ///< Top offset of horizontal scrollbar. + WD_HSCROLLBAR_BOTTOM = 2, ///< Bottom offset of horizontal scrollbar. + + /* Size of the pure frame bevel without any padding. */ + WD_BEVEL_LEFT = 1, ///< Width of left bevel border. + WD_BEVEL_RIGHT = 1, ///< Width of right bevel border. + WD_BEVEL_TOP = 1, ///< Height of top bevel border. + WD_BEVEL_BOTTOM = 1, ///< Height of bottom bevel border. + + /* FrameRect widgets, all text buttons, panel, editbox */ + WD_FRAMERECT_LEFT = 2, ///< Offset at left to draw the frame rectangular area + WD_FRAMERECT_RIGHT = 2, ///< Offset at right to draw the frame rectangular area + WD_FRAMERECT_TOP = 1, ///< Offset at top to draw the frame rectangular area + WD_FRAMERECT_BOTTOM = 1, ///< Offset at bottom to draw the frame rectangular area + + /* WWT_FRAME */ + WD_FRAMETEXT_LEFT = 6, ///< Left offset of the text of the frame. + WD_FRAMETEXT_RIGHT = 6, ///< Right offset of the text of the frame. + WD_FRAMETEXT_TOP = 6, ///< Top offset of the text of the frame + WD_FRAMETEXT_BOTTOM = 6, ///< Bottom offset of the text of the frame + + /* WWT_MATRIX */ + WD_MATRIX_LEFT = 2, ///< Offset at left of a matrix cell. + WD_MATRIX_RIGHT = 2, ///< Offset at right of a matrix cell. + WD_MATRIX_TOP = 3, ///< Offset at top of a matrix cell. + WD_MATRIX_BOTTOM = 1, ///< Offset at bottom of a matrix cell. + + /* WWT_SHADEBOX */ + WD_SHADEBOX_WIDTH = 12, ///< Width of a standard shade box widget. + WD_SHADEBOX_LEFT = 2, ///< Left offset of shade sprite. + WD_SHADEBOX_RIGHT = 2, ///< Right offset of shade sprite. + WD_SHADEBOX_TOP = 3, ///< Top offset of shade sprite. + WD_SHADEBOX_BOTTOM = 3, ///< Bottom offset of shade sprite. + + /* WWT_STICKYBOX */ + WD_STICKYBOX_WIDTH = 12, ///< Width of a standard sticky box widget. + WD_STICKYBOX_LEFT = 2, ///< Left offset of sticky sprite. + WD_STICKYBOX_RIGHT = 2, ///< Right offset of sticky sprite. + WD_STICKYBOX_TOP = 3, ///< Top offset of sticky sprite. + WD_STICKYBOX_BOTTOM = 3, ///< Bottom offset of sticky sprite. + + /* WWT_DEBUGBOX */ + WD_DEBUGBOX_WIDTH = 12, ///< Width of a standard debug box widget. + WD_DEBUGBOX_LEFT = 2, ///< Left offset of debug sprite. + WD_DEBUGBOX_RIGHT = 2, ///< Right offset of debug sprite. + WD_DEBUGBOX_TOP = 3, ///< Top offset of debug sprite. + WD_DEBUGBOX_BOTTOM = 3, ///< Bottom offset of debug sprite. + + /* WWT_DEFSIZEBOX */ + WD_DEFSIZEBOX_WIDTH = 12, ///< Width of a standard defsize box widget. + WD_DEFSIZEBOX_LEFT = 2, ///< Left offset of defsize sprite. + WD_DEFSIZEBOX_RIGHT = 2, ///< Right offset of defsize sprite. + WD_DEFSIZEBOX_TOP = 3, ///< Top offset of defsize sprite. + WD_DEFSIZEBOX_BOTTOM = 3, ///< Bottom offset of defsize sprite. + + /* WWT_RESIZEBOX */ + WD_RESIZEBOX_WIDTH = 12, ///< Width of a resize box widget. + WD_RESIZEBOX_LEFT = 2, ///< Left offset of resize sprite. + WD_RESIZEBOX_RIGHT = 2, ///< Right offset of resize sprite. + WD_RESIZEBOX_TOP = 2, ///< Top offset of resize sprite. + WD_RESIZEBOX_BOTTOM = 2, ///< Bottom offset of resize sprite. + + /* WWT_CLOSEBOX */ + WD_CLOSEBOX_WIDTH = 11, ///< Width of a close box widget. + WD_CLOSEBOX_LEFT = 2, ///< Left offset of closebox string. + WD_CLOSEBOX_RIGHT = 1, ///< Right offset of closebox string. + WD_CLOSEBOX_TOP = 2, ///< Top offset of closebox string. + WD_CLOSEBOX_BOTTOM = 2, ///< Bottom offset of closebox string. + + /* WWT_CAPTION */ + WD_CAPTION_HEIGHT = 14, ///< Height of a title bar. + WD_CAPTIONTEXT_LEFT = 2, ///< Offset of the caption text at the left. + WD_CAPTIONTEXT_RIGHT = 2, ///< Offset of the caption text at the right. + WD_CAPTIONTEXT_TOP = 2, ///< Offset of the caption text at the top. + WD_CAPTIONTEXT_BOTTOM = 2, ///< Offset of the caption text at the bottom. + + /* Dropdown widget. */ + WD_DROPDOWN_HEIGHT = 12, ///< Height of a drop down widget. + WD_DROPDOWNTEXT_LEFT = 2, ///< Left offset of the dropdown widget string. + WD_DROPDOWNTEXT_RIGHT = 2, ///< Right offset of the dropdown widget string. + WD_DROPDOWNTEXT_TOP = 1, ///< Top offset of the dropdown widget string. + WD_DROPDOWNTEXT_BOTTOM = 1, ///< Bottom offset of the dropdown widget string. + + WD_PAR_VSEP_NORMAL = 2, ///< Normal amount of vertical space between two paragraphs of text. + WD_PAR_VSEP_WIDE = 8, ///< Large amount of vertical space between two paragraphs of text. +}; + const WidgetDimensions WidgetDimensions::unscaled = { {WD_IMGBTN_LEFT, WD_IMGBTN_TOP, WD_IMGBTN_RIGHT, WD_IMGBTN_BOTTOM}, ///< imgbtn {WD_INSET_LEFT, WD_INSET_TOP, WD_INSET_RIGHT, WD_BEVEL_BOTTOM}, ///< inset diff --git a/src/window_gui.h b/src/window_gui.h index 5228be4b2d..569bcf9243 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -64,113 +64,6 @@ struct WidgetDimensions { static WidgetDimensions scaled; ///< Widget dimensions scaled for current zoom level. }; -/** Distances used in drawing widgets. */ -enum WidgetDrawDistances { - /* WWT_IMGBTN(_2) */ - WD_IMGBTN_LEFT = 1, ///< Left offset of the image in the button. - WD_IMGBTN_RIGHT = 2, ///< Right offset of the image in the button. - WD_IMGBTN_TOP = 1, ///< Top offset of image in the button. - WD_IMGBTN_BOTTOM = 2, ///< Bottom offset of image in the button. - - /* WWT_INSET */ - WD_INSET_LEFT = 2, ///< Left offset of string. - WD_INSET_RIGHT = 2, ///< Right offset of string. - WD_INSET_TOP = 1, ///< Top offset of string. - - WD_VSCROLLBAR_LEFT = 2, ///< Left offset of vertical scrollbar. - WD_VSCROLLBAR_RIGHT = 2, ///< Right offset of vertical scrollbar. - WD_VSCROLLBAR_TOP = 3, ///< Top offset of vertical scrollbar. - WD_VSCROLLBAR_BOTTOM = 3, ///< Bottom offset of vertical scrollbar. - - WD_HSCROLLBAR_LEFT = 3, ///< Left offset of horizontal scrollbar. - WD_HSCROLLBAR_RIGHT = 3, ///< Right offset of horizontal scrollbar. - WD_HSCROLLBAR_TOP = 2, ///< Top offset of horizontal scrollbar. - WD_HSCROLLBAR_BOTTOM = 2, ///< Bottom offset of horizontal scrollbar. - - /* Size of the pure frame bevel without any padding. */ - WD_BEVEL_LEFT = 1, ///< Width of left bevel border. - WD_BEVEL_RIGHT = 1, ///< Width of right bevel border. - WD_BEVEL_TOP = 1, ///< Height of top bevel border. - WD_BEVEL_BOTTOM = 1, ///< Height of bottom bevel border. - - /* FrameRect widgets, all text buttons, panel, editbox */ - WD_FRAMERECT_LEFT = 2, ///< Offset at left to draw the frame rectangular area - WD_FRAMERECT_RIGHT = 2, ///< Offset at right to draw the frame rectangular area - WD_FRAMERECT_TOP = 1, ///< Offset at top to draw the frame rectangular area - WD_FRAMERECT_BOTTOM = 1, ///< Offset at bottom to draw the frame rectangular area - - /* WWT_FRAME */ - WD_FRAMETEXT_LEFT = 6, ///< Left offset of the text of the frame. - WD_FRAMETEXT_RIGHT = 6, ///< Right offset of the text of the frame. - WD_FRAMETEXT_TOP = 6, ///< Top offset of the text of the frame - WD_FRAMETEXT_BOTTOM = 6, ///< Bottom offset of the text of the frame - - /* WWT_MATRIX */ - WD_MATRIX_LEFT = 2, ///< Offset at left of a matrix cell. - WD_MATRIX_RIGHT = 2, ///< Offset at right of a matrix cell. - WD_MATRIX_TOP = 3, ///< Offset at top of a matrix cell. - WD_MATRIX_BOTTOM = 1, ///< Offset at bottom of a matrix cell. - - /* WWT_SHADEBOX */ - WD_SHADEBOX_WIDTH = 12, ///< Width of a standard shade box widget. - WD_SHADEBOX_LEFT = 2, ///< Left offset of shade sprite. - WD_SHADEBOX_RIGHT = 2, ///< Right offset of shade sprite. - WD_SHADEBOX_TOP = 3, ///< Top offset of shade sprite. - WD_SHADEBOX_BOTTOM = 3, ///< Bottom offset of shade sprite. - - /* WWT_STICKYBOX */ - WD_STICKYBOX_WIDTH = 12, ///< Width of a standard sticky box widget. - WD_STICKYBOX_LEFT = 2, ///< Left offset of sticky sprite. - WD_STICKYBOX_RIGHT = 2, ///< Right offset of sticky sprite. - WD_STICKYBOX_TOP = 3, ///< Top offset of sticky sprite. - WD_STICKYBOX_BOTTOM = 3, ///< Bottom offset of sticky sprite. - - /* WWT_DEBUGBOX */ - WD_DEBUGBOX_WIDTH = 12, ///< Width of a standard debug box widget. - WD_DEBUGBOX_LEFT = 2, ///< Left offset of debug sprite. - WD_DEBUGBOX_RIGHT = 2, ///< Right offset of debug sprite. - WD_DEBUGBOX_TOP = 3, ///< Top offset of debug sprite. - WD_DEBUGBOX_BOTTOM = 3, ///< Bottom offset of debug sprite. - - /* WWT_DEFSIZEBOX */ - WD_DEFSIZEBOX_WIDTH = 12, ///< Width of a standard defsize box widget. - WD_DEFSIZEBOX_LEFT = 2, ///< Left offset of defsize sprite. - WD_DEFSIZEBOX_RIGHT = 2, ///< Right offset of defsize sprite. - WD_DEFSIZEBOX_TOP = 3, ///< Top offset of defsize sprite. - WD_DEFSIZEBOX_BOTTOM = 3, ///< Bottom offset of defsize sprite. - - /* WWT_RESIZEBOX */ - WD_RESIZEBOX_WIDTH = 12, ///< Width of a resize box widget. - WD_RESIZEBOX_LEFT = 3, ///< Left offset of resize sprite. - WD_RESIZEBOX_RIGHT = 2, ///< Right offset of resize sprite. - WD_RESIZEBOX_TOP = 3, ///< Top offset of resize sprite. - WD_RESIZEBOX_BOTTOM = 2, ///< Bottom offset of resize sprite. - - /* WWT_CLOSEBOX */ - WD_CLOSEBOX_WIDTH = 11, ///< Width of a close box widget. - WD_CLOSEBOX_LEFT = 2, ///< Left offset of closebox string. - WD_CLOSEBOX_RIGHT = 1, ///< Right offset of closebox string. - WD_CLOSEBOX_TOP = 2, ///< Top offset of closebox string. - WD_CLOSEBOX_BOTTOM = 2, ///< Bottom offset of closebox string. - - /* WWT_CAPTION */ - WD_CAPTION_HEIGHT = 14, ///< Height of a title bar. - WD_CAPTIONTEXT_LEFT = 2, ///< Offset of the caption text at the left. - WD_CAPTIONTEXT_RIGHT = 2, ///< Offset of the caption text at the right. - WD_CAPTIONTEXT_TOP = 2, ///< Offset of the caption text at the top. - WD_CAPTIONTEXT_BOTTOM = 2, ///< Offset of the caption text at the bottom. - - /* Dropdown widget. */ - WD_DROPDOWN_HEIGHT = 12, ///< Height of a drop down widget. - WD_DROPDOWNTEXT_LEFT = 2, ///< Left offset of the dropdown widget string. - WD_DROPDOWNTEXT_RIGHT = 2, ///< Right offset of the dropdown widget string. - WD_DROPDOWNTEXT_TOP = 1, ///< Top offset of the dropdown widget string. - WD_DROPDOWNTEXT_BOTTOM = 1, ///< Bottom offset of the dropdown widget string. - - WD_PAR_VSEP_NORMAL = 2, ///< Normal amount of vertical space between two paragraphs of text. - WD_PAR_VSEP_WIDE = 8, ///< Large amount of vertical space between two paragraphs of text. -}; - /* widget.cpp */ void DrawFrameRect(int left, int top, int right, int bottom, Colours colour, FrameFlags flags); From dd90d79e7bfb76ac358755dc4563dbe19221724b Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 23 Sep 2022 09:34:46 +0100 Subject: [PATCH 03/42] Add: Setting to toggle thin vs chunky (scaled) bevels. --- src/lang/english.txt | 3 +++ src/settings_gui.cpp | 24 +++++++++++++++++++++++- src/settings_type.h | 2 ++ src/table/settings/gui_settings.ini | 8 ++++++++ src/widget.cpp | 6 +++++- src/widgets/settings_widget.h | 1 + 6 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/lang/english.txt b/src/lang/english.txt index a13bfebe7c..8883a15850 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1011,6 +1011,9 @@ STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Current STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Interface size STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Select the interface element size to use +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Scale bevels +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Check this box to scale bevels by interface size + STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(auto-detect) STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Double size diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 525874e086..c11393de52 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -475,6 +475,17 @@ struct GameOptionsWindow : Window { this->SetWidgetDirty(WID_GO_REFRESH_RATE_DROPDOWN); break; + case WID_GO_GUI_SCALE_BEVEL_BUTTON: { + _settings_client.gui.scale_bevels = !_settings_client.gui.scale_bevels; + + this->SetWidgetLoweredState(WID_GO_GUI_SCALE_BEVEL_BUTTON, _settings_client.gui.scale_bevels); + this->SetDirty(); + + SetupWidgetDimensions(); + ReInitAllWindows(true); + break; + } + case WID_GO_BASE_SFX_VOLUME: case WID_GO_BASE_MUSIC_VOLUME: { byte &vol = (widget == WID_GO_BASE_MUSIC_VOLUME) ? _settings_client.music.music_vol : _settings_client.music.effect_vol; @@ -572,6 +583,7 @@ struct GameOptionsWindow : Window { _gui_zoom_cfg = new_zoom; UpdateGUIZoom(); UpdateCursorSize(); + SetupWidgetDimensions(); UpdateAllVirtCoords(); FixTitleGameZoom(); ReInitAllWindows(true); @@ -587,6 +599,7 @@ struct GameOptionsWindow : Window { UpdateGUIZoom(); ClearFontCache(); LoadStringWidthTable(); + SetupWidgetDimensions(); UpdateAllVirtCoords(); ReInitAllWindows(true); } @@ -624,6 +637,8 @@ struct GameOptionsWindow : Window { this->SetWidgetDisabledState(WID_GO_VIDEO_VSYNC_BUTTON, !_video_hw_accel); #endif + this->SetWidgetLoweredState(WID_GO_GUI_SCALE_BEVEL_BUTTON, _settings_client.gui.scale_bevels); + bool missing_files = BaseGraphics::GetUsedSet()->GetNumMissing() == 0; this->GetWidget(WID_GO_BASE_GRF_STATUS)->SetDataTip(missing_files ? STR_EMPTY : STR_GAME_OPTIONS_BASE_GRF_STATUS, STR_NULL); @@ -650,7 +665,14 @@ static const NWidgetPart _nested_game_options_widgets[] = { NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_AUTOSAVE_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP), SetFill(1, 0), EndContainer(), NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_GUI_ZOOM_FRAME, STR_NULL), - NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_GUI_ZOOM_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP), SetFill(1, 0), + NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_normal, 0), + NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_GUI_ZOOM_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP), SetFill(1, 0), + NWidget(NWID_HORIZONTAL), + NWidget(WWT_TEXT, COLOUR_GREY), SetMinimalSize(0, 12), SetDataTip(STR_GAME_OPTIONS_GUI_SCALE_BEVELS, STR_NULL), + NWidget(NWID_SPACER), SetMinimalSize(1, 0), SetFill(1, 0), + NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_GO_GUI_SCALE_BEVEL_BUTTON), SetMinimalSize(21, 9), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP), + EndContainer(), + EndContainer(), EndContainer(), NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME, STR_NULL), NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_CURRENCY_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP), SetFill(1, 0), diff --git a/src/settings_type.h b/src/settings_type.h index c53763ee36..2033e746ab 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -193,6 +193,8 @@ struct GUISettings { bool newgrf_show_old_versions; ///< whether to show old versions in the NewGRF list uint8 newgrf_default_palette; ///< default palette to use for NewGRFs without action 14 palette information + bool scale_bevels; ///< bevels are scaled with GUI scale. + /** * Returns true when the user has sufficient privileges to edit newgrfs on a running game * @return whether the user has sufficient privileges to edit newgrfs in an existing game diff --git a/src/table/settings/gui_settings.ini b/src/table/settings/gui_settings.ini index cf4ef71aba..7e4f85ec67 100644 --- a/src/table/settings/gui_settings.ini +++ b/src/table/settings/gui_settings.ini @@ -861,3 +861,11 @@ min = 1 max = 65535 cat = SC_EXPERT +[SDTC_BOOL] +var = gui.scale_bevels +flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC +def = true +post_cb = [](auto) { SetupWidgetDimensions(); ReInitAllWindows(true); } +cat = SC_BASIC +startup = true + diff --git a/src/widget.cpp b/src/widget.cpp index fe1dcff893..7498ff976f 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -201,7 +201,11 @@ void SetupWidgetDimensions() WidgetDimensions::scaled.inset = ScaleGUITrad(WidgetDimensions::unscaled.inset); WidgetDimensions::scaled.vscrollbar = ScaleGUITrad(WidgetDimensions::unscaled.vscrollbar); WidgetDimensions::scaled.hscrollbar = ScaleGUITrad(WidgetDimensions::unscaled.hscrollbar); - WidgetDimensions::scaled.bevel = WidgetDimensions::unscaled.bevel; + if (_settings_client.gui.scale_bevels) { + WidgetDimensions::scaled.bevel = ScaleGUITrad(WidgetDimensions::unscaled.bevel); + } else { + WidgetDimensions::scaled.bevel = WidgetDimensions::unscaled.bevel; + } WidgetDimensions::scaled.fullbevel = ScaleGUITrad(WidgetDimensions::unscaled.fullbevel); WidgetDimensions::scaled.framerect = ScaleGUITrad(WidgetDimensions::unscaled.framerect); WidgetDimensions::scaled.frametext = ScaleGUITrad(WidgetDimensions::unscaled.frametext); diff --git a/src/widgets/settings_widget.h b/src/widgets/settings_widget.h index 8caffece90..e727c4d277 100644 --- a/src/widgets/settings_widget.h +++ b/src/widgets/settings_widget.h @@ -20,6 +20,7 @@ enum GameOptionsWidgets { WID_GO_RESOLUTION_DROPDOWN, ///< Dropdown for the resolution. WID_GO_FULLSCREEN_BUTTON, ///< Toggle fullscreen. WID_GO_GUI_ZOOM_DROPDOWN, ///< Dropdown for the GUI zoom level. + WID_GO_GUI_SCALE_BEVEL_BUTTON, ///< Toggle for chunky bevels. WID_GO_BASE_GRF_DROPDOWN, ///< Use to select a base GRF. WID_GO_BASE_GRF_STATUS, ///< Info about missing files etc. WID_GO_BASE_GRF_TEXTFILE, ///< Open base GRF readme, changelog (+1) or license (+2). From 062ea684229261d0b8b9b44168f938f9f1777022 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 30 Sep 2022 21:36:00 +0100 Subject: [PATCH 04/42] Change: Scale position of font shadow. --- src/fontcache/freetypefontcache.cpp | 11 ++++++----- src/gfx.cpp | 6 ++++-- src/os/macosx/font_osx.cpp | 11 ++++++----- src/os/windows/font_win32.cpp | 11 ++++++----- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/fontcache/freetypefontcache.cpp b/src/fontcache/freetypefontcache.cpp index dac2f87668..06a96e8374 100644 --- a/src/fontcache/freetypefontcache.cpp +++ b/src/fontcache/freetypefontcache.cpp @@ -237,9 +237,10 @@ const Sprite *FreeTypeFontCache::InternalGetGlyph(GlyphID key, bool aa) /* Despite requesting a normal glyph, FreeType may have returned a bitmap */ aa = (slot->bitmap.pixel_mode == FT_PIXEL_MODE_GRAY); - /* Add 1 pixel for the shadow on the medium font. Our sprite must be at least 1x1 pixel */ - uint width = std::max(1U, (uint)slot->bitmap.width + (this->fs == FS_NORMAL)); - uint height = std::max(1U, (uint)slot->bitmap.rows + (this->fs == FS_NORMAL)); + /* Add 1 scaled pixel for the shadow on the medium font. Our sprite must be at least 1x1 pixel */ + uint shadow = (this->fs == FS_NORMAL) ? ScaleGUITrad(1) : 0; + uint width = std::max(1U, (uint)slot->bitmap.width + shadow); + uint height = std::max(1U, (uint)slot->bitmap.rows + shadow); /* Limit glyph size to prevent overflows later on. */ if (width > MAX_GLYPH_DIM || height > MAX_GLYPH_DIM) usererror("Font glyph is too large"); @@ -259,8 +260,8 @@ const Sprite *FreeTypeFontCache::InternalGetGlyph(GlyphID key, bool aa) for (uint y = 0; y < (uint)slot->bitmap.rows; y++) { for (uint x = 0; x < (uint)slot->bitmap.width; x++) { if (HasBit(slot->bitmap.buffer[(x / 8) + y * slot->bitmap.pitch], 7 - (x % 8))) { - sprite.data[1 + x + (1 + y) * sprite.width].m = SHADOW_COLOUR; - sprite.data[1 + x + (1 + y) * sprite.width].a = 0xFF; + sprite.data[shadow + x + (shadow + y) * sprite.width].m = SHADOW_COLOUR; + sprite.data[shadow + x + (shadow + y) * sprite.width].a = 0xFF; } } } diff --git a/src/gfx.cpp b/src/gfx.cpp index 67165fadc1..728750c025 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -564,6 +564,8 @@ static int DrawLayoutLine(const ParagraphLayouter::Line &line, int y, int left, NOT_REACHED(); } + const uint shadow_offset = ScaleGUITrad(1); + TextColour colour = TC_BLACK; bool draw_shadow = false; for (int run_index = 0; run_index < line.CountRuns(); run_index++) { @@ -599,7 +601,7 @@ static int DrawLayoutLine(const ParagraphLayouter::Line &line, int y, int left, if (draw_shadow && (glyph & SPRITE_GLYPH) == 0) { SetColourRemap(TC_BLACK); - GfxMainBlitter(sprite, begin_x + 1, top + 1, BM_COLOUR_REMAP); + GfxMainBlitter(sprite, begin_x + shadow_offset, top + shadow_offset, BM_COLOUR_REMAP); SetColourRemap(colour); } GfxMainBlitter(sprite, begin_x, top, BM_COLOUR_REMAP); @@ -611,7 +613,7 @@ static int DrawLayoutLine(const ParagraphLayouter::Line &line, int y, int left, for (int i = 0; i < 3; i++, x += dot_width) { if (draw_shadow) { SetColourRemap(TC_BLACK); - GfxMainBlitter(dot_sprite, x + 1, y + 1, BM_COLOUR_REMAP); + GfxMainBlitter(dot_sprite, x + shadow_offset, y + shadow_offset, BM_COLOUR_REMAP); SetColourRemap(colour); } GfxMainBlitter(dot_sprite, x, y, BM_COLOUR_REMAP); diff --git a/src/os/macosx/font_osx.cpp b/src/os/macosx/font_osx.cpp index 90888c2015..cb0ffda94b 100644 --- a/src/os/macosx/font_osx.cpp +++ b/src/os/macosx/font_osx.cpp @@ -276,9 +276,10 @@ const Sprite *CoreTextFontCache::InternalGetGlyph(GlyphID key, bool use_aa) uint bb_width = (uint)std::ceil(bounds.size.width) + 1; // Sometimes the glyph bounds are too tight and cut of the last pixel after rounding. uint bb_height = (uint)std::ceil(bounds.size.height); - /* Add 1 pixel for the shadow on the medium font. Our sprite must be at least 1x1 pixel. */ - uint width = std::max(1U, bb_width + (this->fs == FS_NORMAL ? 1 : 0)); - uint height = std::max(1U, bb_height + (this->fs == FS_NORMAL ? 1 : 0)); + /* Add 1 scaled pixel for the shadow on the medium font. Our sprite must be at least 1x1 pixel. */ + uint shadow = (this->fs == FS_NORMAL) ? ScaleGUITrad(1) : 0; + uint width = std::max(1U, bb_width + shadow); + uint height = std::max(1U, bb_height + shadow); /* Limit glyph size to prevent overflows later on. */ if (width > MAX_GLYPH_DIM || height > MAX_GLYPH_DIM) usererror("Font glyph is too large"); @@ -314,8 +315,8 @@ const Sprite *CoreTextFontCache::InternalGetGlyph(GlyphID key, bool use_aa) for (uint y = 0; y < bb_height; y++) { for (uint x = 0; x < bb_width; x++) { if (bmp[y * pitch + x] > 0) { - sprite.data[1 + x + (1 + y) * sprite.width].m = SHADOW_COLOUR; - sprite.data[1 + x + (1 + y) * sprite.width].a = use_aa ? bmp[x + y * pitch] : 0xFF; + sprite.data[shadow + x + (shadow + y) * sprite.width].m = SHADOW_COLOUR; + sprite.data[shadow + x + (shadow + y) * sprite.width].a = use_aa ? bmp[x + y * pitch] : 0xFF; } } } diff --git a/src/os/windows/font_win32.cpp b/src/os/windows/font_win32.cpp index 21fa808ae3..fb62aadb59 100644 --- a/src/os/windows/font_win32.cpp +++ b/src/os/windows/font_win32.cpp @@ -476,9 +476,10 @@ void Win32FontCache::ClearFontCache() GetGlyphOutline(this->dc, key, GGO_GLYPH_INDEX | (aa ? GGO_GRAY8_BITMAP : GGO_BITMAP), &gm, size, bmp, &mat); } - /* Add 1 pixel for the shadow on the medium font. Our sprite must be at least 1x1 pixel. */ - uint width = std::max(1U, (uint)gm.gmBlackBoxX + (this->fs == FS_NORMAL)); - uint height = std::max(1U, (uint)gm.gmBlackBoxY + (this->fs == FS_NORMAL)); + /* Add 1 scaled pixel for the shadow on the medium font. Our sprite must be at least 1x1 pixel. */ + uint shadow = (this->fs == FS_NORMAL) ? ScaleGUITrad(1) : 0; + uint width = std::max(1U, (uint)gm.gmBlackBoxX + shadow); + uint height = std::max(1U, (uint)gm.gmBlackBoxY + shadow); /* Limit glyph size to prevent overflows later on. */ if (width > MAX_GLYPH_DIM || height > MAX_GLYPH_DIM) usererror("Font glyph is too large"); @@ -506,8 +507,8 @@ void Win32FontCache::ClearFontCache() for (uint y = 0; y < gm.gmBlackBoxY; y++) { for (uint x = 0; x < gm.gmBlackBoxX; x++) { if (aa ? (bmp[x + y * pitch] > 0) : HasBit(bmp[(x / 8) + y * pitch], 7 - (x % 8))) { - sprite.data[1 + x + (1 + y) * sprite.width].m = SHADOW_COLOUR; - sprite.data[1 + x + (1 + y) * sprite.width].a = aa ? (bmp[x + y * pitch] << 2) - 1 : 0xFF; + sprite.data[shadow + x + (shadow + y) * sprite.width].m = SHADOW_COLOUR; + sprite.data[shadow + x + (shadow + y) * sprite.width].a = aa ? (bmp[x + y * pitch] << 2) - 1 : 0xFF; } } } From ed60c88b0ac291f4dad05930b6fe57ed3bf1b899 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 5 Sep 2022 21:05:18 +0100 Subject: [PATCH 05/42] Change: Use power-of-2 scaling for some dimensions in GUI. These are related to drawing sprites that are normally drawn on the landscape, and should therefore still follow power-of-2 scaling to fit correctly. --- src/aircraft_cmd.cpp | 2 +- src/aircraft_gui.cpp | 4 ++-- src/build_vehicle_gui.cpp | 2 +- src/depot_gui.cpp | 22 +++++++++++----------- src/dock_gui.cpp | 12 ++++++------ src/highscore_gui.cpp | 16 ++++++++-------- src/object_gui.cpp | 8 ++++---- src/rail_gui.cpp | 20 ++++++++++---------- src/road_gui.cpp | 8 ++++---- src/roadveh_cmd.cpp | 4 ++-- src/roadveh_gui.cpp | 8 ++++---- src/ship_gui.cpp | 2 +- src/sprite.cpp | 2 +- src/station_gui.cpp | 2 +- src/train_cmd.cpp | 20 ++++++++++---------- src/train_gui.cpp | 12 ++++++------ src/vehicle_gui.cpp | 10 +++++----- src/widget.cpp | 2 +- src/zoom_func.h | 10 ++++++++++ 19 files changed, 88 insertions(+), 78 deletions(-) diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index fc10660801..7a33d4c262 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -231,7 +231,7 @@ void DrawAircraftEngine(int left, int right, int preferred_x, int y, EngineID en VehicleSpriteSeq rotor_seq; GetCustomRotorIcon(engine, image_type, &rotor_seq); if (!rotor_seq.IsValid()) rotor_seq.Set(SPR_ROTOR_STOPPED); - rotor_seq.Draw(preferred_x, y - ScaleGUITrad(5), PAL_NONE, false); + rotor_seq.Draw(preferred_x, y - ScaleSpriteTrad(5), PAL_NONE, false); } } diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp index 6516285257..6704b7b80b 100644 --- a/src/aircraft_gui.cpp +++ b/src/aircraft_gui.cpp @@ -93,7 +93,7 @@ void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID s int x = rtl ? right - width - x_offs : left - x_offs; bool helicopter = v->subtype == AIR_HELICOPTER; - int y_offs = ScaleGUITrad(10); + int y_offs = ScaleSpriteTrad(10); int heli_offs = 0; PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v); @@ -103,7 +103,7 @@ void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID s VehicleSpriteSeq rotor_seq; GetCustomRotorSprite(a, image_type, &rotor_seq); if (!rotor_seq.IsValid()) rotor_seq.Set(SPR_ROTOR_STOPPED); - heli_offs = ScaleGUITrad(5); + heli_offs = ScaleSpriteTrad(5); rotor_seq.Draw(x, y + y_offs - heli_offs, PAL_NONE, false); } if (v->index == selection) { diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 27717177a9..31114b8965 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -977,7 +977,7 @@ void DrawEngineList(VehicleType type, const Rect &r, const GUIEngineList *eng_li Rect ir = r.WithHeight(step_size).Shrink(WidgetDimensions::scaled.matrix); int sprite_x = ir.WithWidth(sprite_width, rtl).left + sprite_left; - int sprite_y_offset = ScaleGUITrad(sprite_y_offsets[type]) + ir.Height() / 2; + int sprite_y_offset = ScaleSpriteTrad(sprite_y_offsets[type]) + ir.Height() / 2; Dimension replace_icon = {0, 0}; int count_width = 0; diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 050cc06876..34e9c0a3a7 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -190,17 +190,17 @@ static void InitBlocksizeForVehicles(VehicleType type, EngineImageType image_typ if ((int)x + x_offs > max_extend_right) max_extend_right = x + x_offs; } - int min_extend = ScaleGUITrad(16); - int max_extend = ScaleGUITrad(98); + int min_extend = ScaleSpriteTrad(16); + int max_extend = ScaleSpriteTrad(98); switch (image_type) { case EIT_IN_DEPOT: - _base_block_sizes_depot[type].height = std::max(ScaleGUITrad(GetVehicleHeight(type)), max_height); + _base_block_sizes_depot[type].height = std::max(ScaleSpriteTrad(GetVehicleHeight(type)), max_height); _base_block_sizes_depot[type].extend_left = Clamp(max_extend_left, min_extend, max_extend); _base_block_sizes_depot[type].extend_right = Clamp(max_extend_right, min_extend, max_extend); break; case EIT_PURCHASE: - _base_block_sizes_purchase[type].height = std::max(ScaleGUITrad(GetVehicleHeight(type)), max_height); + _base_block_sizes_purchase[type].height = std::max(ScaleSpriteTrad(GetVehicleHeight(type)), max_height); _base_block_sizes_purchase[type].extend_left = Clamp(max_extend_left, min_extend, max_extend); _base_block_sizes_purchase[type].extend_right = Clamp(max_extend_right, min_extend, max_extend); break; @@ -310,7 +310,7 @@ struct DepotWindow : Window { void DrawVehicleInDepot(const Vehicle *v, int left, int right, int y) const { bool free_wagon = false; - int sprite_y = y + (this->resize.step_height - ScaleGUITrad(GetVehicleHeight(v->type))) / 2; + int sprite_y = y + (this->resize.step_height - ScaleSpriteTrad(GetVehicleHeight(v->type))) / 2; bool rtl = _current_text_dir == TD_RTL; int image_left = rtl ? left + this->count_width : left + this->header_width; @@ -322,7 +322,7 @@ struct DepotWindow : Window { free_wagon = u->IsFreeWagon(); uint x_space = free_wagon ? - ScaleGUITrad(_consistent_train_width != 0 ? _consistent_train_width : TRAININFO_DEFAULT_VEHICLE_WIDTH) : + ScaleSpriteTrad(_consistent_train_width != 0 ? _consistent_train_width : TRAININFO_DEFAULT_VEHICLE_WIDTH) : 0; DrawTrainImage(u, image_left + (rtl ? 0 : x_space), image_right - (rtl ? x_space : 0), sprite_y, @@ -381,7 +381,7 @@ struct DepotWindow : Window { * - All vehicles are 8/8. This cannot be checked for NewGRF, so instead we check for "all vehicles are original vehicles". */ if (this->type == VEH_TRAIN && _consistent_train_width != 0) { - int w = ScaleGUITrad(2 * _consistent_train_width); + int w = ScaleSpriteTrad(2 * _consistent_train_width); int col = _colour_gradient[wid->colour][4]; int image_left = rtl ? ir.left + this->count_width : ir.left + this->header_width; int image_right = rtl ? ir.right - this->header_width : ir.right - this->count_width; @@ -486,7 +486,7 @@ struct DepotWindow : Window { pos -= (uint)this->vehicle_list.size(); *veh = this->wagon_list[pos]; /* free wagons don't have an initial loco. */ - x -= ScaleGUITrad(VEHICLEINFO_FULL_VEHICLE_WIDTH); + x -= ScaleSpriteTrad(VEHICLEINFO_FULL_VEHICLE_WIDTH); wagon = true; } @@ -682,7 +682,7 @@ struct DepotWindow : Window { resize->height = std::max(GetVehicleImageCellSize(this->type, EIT_IN_DEPOT).height, min_height); if (this->type == VEH_TRAIN) { resize->width = 1; - size->width = base_width + 2 * ScaleGUITrad(29); // about 2 parts + size->width = base_width + 2 * ScaleSpriteTrad(29); // about 2 parts size->height = resize->height * 6; } else { resize->width = base_width + GetVehicleImageCellSize(this->type, EIT_IN_DEPOT).extend_left + GetVehicleImageCellSize(this->type, EIT_IN_DEPOT).extend_right; @@ -725,7 +725,7 @@ struct DepotWindow : Window { /* determine amount of items for scroller */ if (this->type == VEH_TRAIN) { - uint max_width = ScaleGUITrad(VEHICLEINFO_FULL_VEHICLE_WIDTH); + uint max_width = ScaleSpriteTrad(VEHICLEINFO_FULL_VEHICLE_WIDTH); for (uint num = 0; num < this->vehicle_list.size(); num++) { uint width = 0; for (const Train *v = Train::From(this->vehicle_list[num]); v != nullptr; v = v->Next()) { @@ -736,7 +736,7 @@ struct DepotWindow : Window { /* Always have 1 empty row, so people can change the setting of the train */ this->vscroll->SetCount((uint)this->vehicle_list.size() + (uint)this->wagon_list.size() + 1); /* Always make it longer than the longest train, so you can attach vehicles at the end, and also see the next vertical tile separator line */ - this->hscroll->SetCount(max_width + ScaleGUITrad(2 * VEHICLEINFO_FULL_VEHICLE_WIDTH + 1)); + this->hscroll->SetCount(max_width + ScaleSpriteTrad(2 * VEHICLEINFO_FULL_VEHICLE_WIDTH + 1)); } else { this->vscroll->SetCount(CeilDiv((uint)this->vehicle_list.size(), this->num_columns)); } diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 1e7ff70b94..0245e51f80 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -549,12 +549,12 @@ public: if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) { DrawPixelInfo *old_dpi = _cur_dpi; _cur_dpi = &tmp_dpi; - int x = (r.Width() - ScaleGUITrad(96)) / 2; - int y = (r.Height() - ScaleGUITrad(64)) / 2; - int x1 = ScaleGUITrad(63); - int x2 = ScaleGUITrad(31); - DrawShipDepotSprite(x + (axis == AXIS_X ? x1 : x2), y + ScaleGUITrad(17), axis, DEPOT_PART_NORTH); - DrawShipDepotSprite(x + (axis == AXIS_X ? x2 : x1), y + ScaleGUITrad(33), axis, DEPOT_PART_SOUTH); + int x = (r.Width() - ScaleSpriteTrad(96)) / 2; + int y = (r.Height() - ScaleSpriteTrad(64)) / 2; + int x1 = ScaleSpriteTrad(63); + int x2 = ScaleSpriteTrad(31); + DrawShipDepotSprite(x + (axis == AXIS_X ? x1 : x2), y + ScaleSpriteTrad(17), axis, DEPOT_PART_NORTH); + DrawShipDepotSprite(x + (axis == AXIS_X ? x2 : x1), y + ScaleSpriteTrad(33), axis, DEPOT_PART_SOUTH); _cur_dpi = old_dpi; } break; diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp index 0ccc288f05..9b57ba659a 100644 --- a/src/highscore_gui.cpp +++ b/src/highscore_gui.cpp @@ -133,7 +133,7 @@ struct EndGameWindow : EndGameHighScoreBaseWindow { void OnPaint() override { this->SetupHighScoreEndWindow(); - Point pt = this->GetTopLeft(ScaleGUITrad(640), ScaleGUITrad(480)); + Point pt = this->GetTopLeft(ScaleSpriteTrad(640), ScaleSpriteTrad(480)); const Company *c = Company::GetIfValid(_local_company); if (c == nullptr) return; @@ -144,11 +144,11 @@ struct EndGameWindow : EndGameHighScoreBaseWindow { SetDParam(0, c->index); SetDParam(1, c->index); SetDParam(2, EndGameGetPerformanceTitleFromValue(c->old_economy[0].performance_history)); - DrawStringMultiLine(pt.x + ScaleGUITrad(15), pt.x + ScaleGUITrad(640) - ScaleGUITrad(25), pt.y + ScaleGUITrad(90), pt.y + ScaleGUITrad(160), STR_HIGHSCORE_PRESIDENT_OF_COMPANY_ACHIEVES_STATUS, TC_FROMSTRING, SA_CENTER); + DrawStringMultiLine(pt.x + ScaleSpriteTrad(15), pt.x + ScaleSpriteTrad(640) - ScaleSpriteTrad(25), pt.y + ScaleSpriteTrad(90), pt.y + ScaleSpriteTrad(160), STR_HIGHSCORE_PRESIDENT_OF_COMPANY_ACHIEVES_STATUS, TC_FROMSTRING, SA_CENTER); } else { SetDParam(0, c->index); SetDParam(1, EndGameGetPerformanceTitleFromValue(c->old_economy[0].performance_history)); - DrawStringMultiLine(pt.x + ScaleGUITrad(36), pt.x + ScaleGUITrad(640), pt.y + ScaleGUITrad(140), pt.y + ScaleGUITrad(206), STR_HIGHSCORE_COMPANY_ACHIEVES_STATUS, TC_FROMSTRING, SA_CENTER); + DrawStringMultiLine(pt.x + ScaleSpriteTrad(36), pt.x + ScaleSpriteTrad(640), pt.y + ScaleSpriteTrad(140), pt.y + ScaleSpriteTrad(206), STR_HIGHSCORE_COMPANY_ACHIEVES_STATUS, TC_FROMSTRING, SA_CENTER); } } }; @@ -185,24 +185,24 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow { const HighScore *hs = _highscore_table[this->window_number]; this->SetupHighScoreEndWindow(); - Point pt = this->GetTopLeft(ScaleGUITrad(640), ScaleGUITrad(480)); + Point pt = this->GetTopLeft(ScaleSpriteTrad(640), ScaleSpriteTrad(480)); SetDParam(0, _settings_game.game_creation.ending_year); - DrawStringMultiLine(pt.x + ScaleGUITrad(70), pt.x + ScaleGUITrad(570), pt.y, pt.y + ScaleGUITrad(140), !_networking ? STR_HIGHSCORE_TOP_COMPANIES_WHO_REACHED : STR_HIGHSCORE_TOP_COMPANIES_NETWORK_GAME, TC_FROMSTRING, SA_CENTER); + DrawStringMultiLine(pt.x + ScaleSpriteTrad(70), pt.x + ScaleSpriteTrad(570), pt.y, pt.y + ScaleSpriteTrad(140), !_networking ? STR_HIGHSCORE_TOP_COMPANIES_WHO_REACHED : STR_HIGHSCORE_TOP_COMPANIES_NETWORK_GAME, TC_FROMSTRING, SA_CENTER); /* Draw Highscore peepz */ for (uint8 i = 0; i < lengthof(_highscore_table[0]); i++) { SetDParam(0, i + 1); - DrawString(pt.x + ScaleGUITrad(40), pt.x + ScaleGUITrad(600), pt.y + ScaleGUITrad(140 + i * 55), STR_HIGHSCORE_POSITION); + DrawString(pt.x + ScaleSpriteTrad(40), pt.x + ScaleSpriteTrad(600), pt.y + ScaleSpriteTrad(140 + i * 55), STR_HIGHSCORE_POSITION); if (hs[i].company[0] != '\0') { TextColour colour = (this->rank == i) ? TC_RED : TC_BLACK; // draw new highscore in red SetDParamStr(0, hs[i].company); - DrawString(pt.x + ScaleGUITrad(71), pt.x + ScaleGUITrad(569), pt.y + ScaleGUITrad(140 + i * 55), STR_JUST_BIG_RAW_STRING, colour); + DrawString(pt.x + ScaleSpriteTrad(71), pt.x + ScaleSpriteTrad(569), pt.y + ScaleSpriteTrad(140 + i * 55), STR_JUST_BIG_RAW_STRING, colour); SetDParam(0, hs[i].title); SetDParam(1, hs[i].score); - DrawString(pt.x + ScaleGUITrad(71), pt.x + ScaleGUITrad(569), pt.y + ScaleGUITrad(140) + FONT_HEIGHT_LARGE + ScaleGUITrad(i * 55), STR_HIGHSCORE_STATS, colour); + DrawString(pt.x + ScaleSpriteTrad(71), pt.x + ScaleSpriteTrad(569), pt.y + ScaleSpriteTrad(140) + FONT_HEIGHT_LARGE + ScaleSpriteTrad(i * 55), STR_HIGHSCORE_STATS, colour); } } } diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 8064df362d..58fd1771c3 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -360,9 +360,9 @@ public: if (spec->grf_prop.grffile == nullptr) { extern const DrawTileSprites _objects[]; const DrawTileSprites *dts = &_objects[spec->grf_prop.local_id]; - DrawOrigTileSeqInGUI(r.Width() / 2 - 1, (r.Height() + matrix_height / 2) / 2 - OBJECT_MARGIN - ScaleGUITrad(TILE_PIXELS), dts, PAL_NONE); + DrawOrigTileSeqInGUI(r.Width() / 2 - 1, (r.Height() + matrix_height / 2) / 2 - OBJECT_MARGIN - ScaleSpriteTrad(TILE_PIXELS), dts, PAL_NONE); } else { - DrawNewObjectTileInGUI(r.Width() / 2 - 1, (r.Height() + matrix_height / 2) / 2 - OBJECT_MARGIN - ScaleGUITrad(TILE_PIXELS), spec, GB(widget, 16, 16)); + DrawNewObjectTileInGUI(r.Width() / 2 - 1, (r.Height() + matrix_height / 2) / 2 - OBJECT_MARGIN - ScaleSpriteTrad(TILE_PIXELS), spec, GB(widget, 16, 16)); } _cur_dpi = old_dpi; } @@ -387,9 +387,9 @@ public: if (spec->grf_prop.grffile == nullptr) { extern const DrawTileSprites _objects[]; const DrawTileSprites *dts = &_objects[spec->grf_prop.local_id]; - DrawOrigTileSeqInGUI(r.Width() / 2 - 1, r.Height() - OBJECT_MARGIN - ScaleGUITrad(TILE_PIXELS), dts, PAL_NONE); + DrawOrigTileSeqInGUI(r.Width() / 2 - 1, r.Height() - OBJECT_MARGIN - ScaleSpriteTrad(TILE_PIXELS), dts, PAL_NONE); } else { - DrawNewObjectTileInGUI(r.Width() / 2 - 1, r.Height() - OBJECT_MARGIN - ScaleGUITrad(TILE_PIXELS), spec, + DrawNewObjectTileInGUI(r.Width() / 2 - 1, r.Height() - OBJECT_MARGIN - ScaleSpriteTrad(TILE_PIXELS), spec, std::min(_selected_object_view, spec->views - 1)); } _cur_dpi = old_dpi; diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 7302a13bb0..c928974b69 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -1257,8 +1257,8 @@ public: if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) { DrawPixelInfo *old_dpi = _cur_dpi; _cur_dpi = &tmp_dpi; - int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31); - int y = (r.Height() + ScaleGUITrad(58)) / 2 - ScaleGUITrad(31); + int x = (r.Width() - ScaleSpriteTrad(64)) / 2 + ScaleSpriteTrad(31); + int y = (r.Height() + ScaleSpriteTrad(58)) / 2 - ScaleSpriteTrad(31); if (!DrawStationTile(x, y, _cur_railtype, AXIS_X, _railstation.station_class, _railstation.station_type)) { StationPickerDrawSprite(x, y, STATION_RAIL, _cur_railtype, INVALID_ROADTYPE, 2); } @@ -1271,8 +1271,8 @@ public: if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) { DrawPixelInfo *old_dpi = _cur_dpi; _cur_dpi = &tmp_dpi; - int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31); - int y = (r.Height() + ScaleGUITrad(58)) / 2 - ScaleGUITrad(31); + int x = (r.Width() - ScaleSpriteTrad(64)) / 2 + ScaleSpriteTrad(31); + int y = (r.Height() + ScaleSpriteTrad(58)) / 2 - ScaleSpriteTrad(31); if (!DrawStationTile(x, y, _cur_railtype, AXIS_Y, _railstation.station_class, _railstation.station_type)) { StationPickerDrawSprite(x, y, STATION_RAIL, _cur_railtype, INVALID_ROADTYPE, 3); } @@ -1308,8 +1308,8 @@ public: if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) { DrawPixelInfo *old_dpi = _cur_dpi; _cur_dpi = &tmp_dpi; - int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31); - int y = (r.Height() + ScaleGUITrad(58)) / 2 - ScaleGUITrad(31); + int x = (r.Width() - ScaleSpriteTrad(64)) / 2 + ScaleSpriteTrad(31); + int y = (r.Height() + ScaleSpriteTrad(58)) / 2 - ScaleSpriteTrad(31); if (!DrawStationTile(x, y, _cur_railtype, _railstation.orientation, _railstation.station_class, type)) { StationPickerDrawSprite(x, y, STATION_RAIL, _cur_railtype, INVALID_ROADTYPE, 2 + _railstation.orientation); } @@ -1942,8 +1942,8 @@ struct BuildRailDepotWindow : public PickerWindowBase { if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) { DrawPixelInfo *old_dpi = _cur_dpi; _cur_dpi = &tmp_dpi; - int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31); - int y = (r.Height() + ScaleGUITrad(48)) / 2 - ScaleGUITrad(31); + int x = (r.Width() - ScaleSpriteTrad(64)) / 2 + ScaleSpriteTrad(31); + int y = (r.Height() + ScaleSpriteTrad(48)) / 2 - ScaleSpriteTrad(31); DrawTrainDepotSprite(x, y, widget - WID_BRAD_DEPOT_NE + DIAGDIR_NE, _cur_railtype); _cur_dpi = old_dpi; } @@ -2054,8 +2054,8 @@ struct BuildRailWaypointWindow : PickerWindowBase { if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) { DrawPixelInfo *old_dpi = _cur_dpi; _cur_dpi = &tmp_dpi; - int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31); - int y = (r.Height() + ScaleGUITrad(58)) / 2 - ScaleGUITrad(31); + int x = (r.Width() - ScaleSpriteTrad(64)) / 2 + ScaleSpriteTrad(31); + int y = (r.Height() + ScaleSpriteTrad(58)) / 2 - ScaleSpriteTrad(31); DrawWaypointSprite(x, y, type, _cur_railtype); _cur_dpi = old_dpi; } diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 046c695925..ca3d91f183 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -986,8 +986,8 @@ struct BuildRoadDepotWindow : public PickerWindowBase { if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) { DrawPixelInfo *old_dpi = _cur_dpi; _cur_dpi = &tmp_dpi; - int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31); - int y = (r.Height() + ScaleGUITrad(48)) / 2 - ScaleGUITrad(31); + int x = (r.Width() - ScaleSpriteTrad(64)) / 2 + ScaleSpriteTrad(31); + int y = (r.Height() + ScaleSpriteTrad(48)) / 2 - ScaleSpriteTrad(31); DrawRoadDepotSprite(x, y, (DiagDirection)(widget - WID_BROD_DEPOT_NE + DIAGDIR_NE), _cur_roadtype); _cur_dpi = old_dpi; } @@ -1121,8 +1121,8 @@ struct BuildRoadStationWindow : public PickerWindowBase { if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) { DrawPixelInfo *old_dpi = _cur_dpi; _cur_dpi = &tmp_dpi; - int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31); - int y = (r.Height() + ScaleGUITrad(48)) / 2 - ScaleGUITrad(31); + int x = (r.Width() - ScaleSpriteTrad(64)) / 2 + ScaleSpriteTrad(31); + int y = (r.Height() + ScaleSpriteTrad(48)) / 2 - ScaleSpriteTrad(31); StationPickerDrawSprite(x, y, st, INVALID_RAILTYPE, _cur_roadtype, widget - WID_BROS_STATION_NE); _cur_dpi = old_dpi; } diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 86271283ce..8ac7c55fa0 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -94,10 +94,10 @@ int RoadVehicle::GetDisplayImageWidth(Point *offset) const int reference_width = ROADVEHINFO_DEFAULT_VEHICLE_WIDTH; if (offset != nullptr) { - offset->x = ScaleGUITrad(reference_width) / 2; + offset->x = ScaleSpriteTrad(reference_width) / 2; offset->y = 0; } - return ScaleGUITrad(this->gcache.cached_veh_length * reference_width / VEHICLE_LENGTH); + return ScaleSpriteTrad(this->gcache.cached_veh_length * reference_width / VEHICLE_LENGTH); } static void GetRoadVehIcon(EngineID engine, EngineImageType image_type, VehicleSpriteSeq *result) diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp index e6fab81240..ca3bbe03f6 100644 --- a/src/roadveh_gui.cpp +++ b/src/roadveh_gui.cpp @@ -27,7 +27,7 @@ */ void DrawRoadVehDetails(const Vehicle *v, const Rect &r) { - int y = r.top + (v->HasArticulatedPart() ? ScaleGUITrad(15) : 0); // Draw the first line below the sprite of an articulated RV instead of after it. + int y = r.top + (v->HasArticulatedPart() ? ScaleSpriteTrad(15) : 0); // Draw the first line below the sprite of an articulated RV instead of after it. StringID str; Money feeder_share = 0; @@ -135,7 +135,7 @@ void DrawRoadVehImage(const Vehicle *v, int left, int right, int y, VehicleID se DrawPixelInfo tmp_dpi, *old_dpi; int max_width = right - left + 1; - if (!FillDrawPixelInfo(&tmp_dpi, left, y, max_width, ScaleGUITrad(14))) return; + if (!FillDrawPixelInfo(&tmp_dpi, left, y, max_width, ScaleSpriteTrad(14))) return; old_dpi = _cur_dpi; _cur_dpi = &tmp_dpi; @@ -149,14 +149,14 @@ void DrawRoadVehImage(const Vehicle *v, int left, int right, int y, VehicleID se PaletteID pal = (u->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(u); VehicleSpriteSeq seq; u->GetImage(dir, image_type, &seq); - seq.Draw(px + (rtl ? -offset.x : offset.x), ScaleGUITrad(6) + offset.y, pal, (u->vehstatus & VS_CRASHED) != 0); + seq.Draw(px + (rtl ? -offset.x : offset.x), ScaleSpriteTrad(6) + offset.y, pal, (u->vehstatus & VS_CRASHED) != 0); } px += rtl ? -width : width; } if (v->index == selection) { - DrawFrameRect((rtl ? px : 0), 0, (rtl ? max_width : px) - 1, ScaleGUITrad(13) - 1, COLOUR_WHITE, FR_BORDERONLY); + DrawFrameRect((rtl ? px : 0), 0, (rtl ? max_width : px) - 1, ScaleSpriteTrad(13) - 1, COLOUR_WHITE, FR_BORDERONLY); } _cur_dpi = old_dpi; diff --git a/src/ship_gui.cpp b/src/ship_gui.cpp index 0d82c2ce04..a6d0ff06c8 100644 --- a/src/ship_gui.cpp +++ b/src/ship_gui.cpp @@ -43,7 +43,7 @@ void DrawShipImage(const Vehicle *v, int left, int right, int y, VehicleID selec int x_offs = UnScaleGUI(rect.left); int x = rtl ? right - width - x_offs : left - x_offs; - y += ScaleGUITrad(10); + y += ScaleSpriteTrad(10); seq.Draw(x, y, GetVehiclePalette(v), false); if (v->index == selection) { diff --git a/src/sprite.cpp b/src/sprite.cpp index a6ff4c9224..7f2bfb1bb9 100644 --- a/src/sprite.cpp +++ b/src/sprite.cpp @@ -125,7 +125,7 @@ void DrawCommonTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 orig } else { int offs_x = child_offset_is_unsigned ? (uint8)dtss->delta_x : dtss->delta_x; int offs_y = child_offset_is_unsigned ? (uint8)dtss->delta_y : dtss->delta_y; - DrawSprite(image, pal, x + child_offset.x + ScaleGUITrad(offs_x), y + child_offset.y + ScaleGUITrad(offs_y)); + DrawSprite(image, pal, x + child_offset.x + ScaleSpriteTrad(offs_x), y + child_offset.y + ScaleSpriteTrad(offs_y)); } } } diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 2c2b7f4de1..c551db17ca 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -811,7 +811,7 @@ static const NWidgetPart _nested_station_view_widgets[] = { */ static void DrawCargoIcons(CargoID i, uint waiting, int left, int right, int y) { - int width = ScaleGUITrad(10); + int width = ScaleSpriteTrad(10); uint num = std::min((waiting + (width / 2)) / width, (right - left) / width); // maximum is width / 10 icons so it won't overflow if (num == 0) return; diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 3659af7bad..d9f4358691 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -451,10 +451,10 @@ int Train::GetDisplayImageWidth(Point *offset) const } if (offset != nullptr) { - offset->x = ScaleGUITrad(reference_width) / 2; - offset->y = ScaleGUITrad(vehicle_pitch); + offset->x = ScaleSpriteTrad(reference_width) / 2; + offset->y = ScaleSpriteTrad(vehicle_pitch); } - return ScaleGUITrad(this->gcache.cached_veh_length * reference_width / VEHICLE_LENGTH); + return ScaleSpriteTrad(this->gcache.cached_veh_length * reference_width / VEHICLE_LENGTH); } static SpriteID GetDefaultTrainSprite(uint8 spritenum, Direction direction) @@ -500,7 +500,7 @@ static void GetRailIcon(EngineID engine, bool rear_head, int &y, EngineImageType GetCustomVehicleIcon(engine, dir, image_type, result); if (result->IsValid()) { if (e->GetGRF() != nullptr) { - y += ScaleGUITrad(e->GetGRF()->traininfo_vehicle_pitch); + y += ScaleSpriteTrad(e->GetGRF()->traininfo_vehicle_pitch); } return; } @@ -528,11 +528,11 @@ void DrawTrainEngine(int left, int right, int preferred_x, int y, EngineID engin seqr.GetBounds(&rectr); preferred_x = Clamp(preferred_x, - left - UnScaleGUI(rectf.left) + ScaleGUITrad(14), - right - UnScaleGUI(rectr.right) - ScaleGUITrad(15)); + left - UnScaleGUI(rectf.left) + ScaleSpriteTrad(14), + right - UnScaleGUI(rectr.right) - ScaleSpriteTrad(15)); - seqf.Draw(preferred_x - ScaleGUITrad(14), yf, pal, pal == PALETTE_CRASH); - seqr.Draw(preferred_x + ScaleGUITrad(15), yr, pal, pal == PALETTE_CRASH); + seqf.Draw(preferred_x - ScaleSpriteTrad(14), yf, pal, pal == PALETTE_CRASH); + seqr.Draw(preferred_x + ScaleSpriteTrad(15), yr, pal, pal == PALETTE_CRASH); } else { VehicleSpriteSeq seq; GetRailIcon(engine, false, y, image_type, &seq); @@ -576,9 +576,9 @@ void GetTrainSpriteSize(EngineID engine, uint &width, uint &height, int &xoffs, seq.GetBounds(&rect); /* Calculate values relative to an imaginary center between the two sprites. */ - width = ScaleGUITrad(TRAININFO_DEFAULT_VEHICLE_WIDTH) + UnScaleGUI(rect.right) - xoffs; + width = ScaleSpriteTrad(TRAININFO_DEFAULT_VEHICLE_WIDTH) + UnScaleGUI(rect.right) - xoffs; height = std::max(height, UnScaleGUI(rect.Height())); - xoffs = xoffs - ScaleGUITrad(TRAININFO_DEFAULT_VEHICLE_WIDTH) / 2; + xoffs = xoffs - ScaleSpriteTrad(TRAININFO_DEFAULT_VEHICLE_WIDTH) / 2; yoffs = std::min(yoffs, UnScaleGUI(rect.top)); } } diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 7c7aa9eb85..4c9a8b0216 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -73,7 +73,7 @@ static int HighlightDragPosition(int px, int max_width, VehicleID selection, boo if (drag_hlight_width > 0) { GfxFillRect(drag_hlight_left + WidgetDimensions::scaled.framerect.left, WidgetDimensions::scaled.framerect.top + 1, - drag_hlight_right - WidgetDimensions::scaled.framerect.right, ScaleGUITrad(13) - WidgetDimensions::scaled.framerect.bottom, _colour_gradient[COLOUR_GREY][7]); + drag_hlight_right - WidgetDimensions::scaled.framerect.right, ScaleSpriteTrad(13) - WidgetDimensions::scaled.framerect.bottom, _colour_gradient[COLOUR_GREY][7]); } return drag_hlight_width; @@ -99,7 +99,7 @@ void DrawTrainImage(const Train *v, int left, int right, int y, VehicleID select int highlight_l = 0; int highlight_r = 0; int max_width = right - left + 1; - int height = ScaleGUITrad(14); + int height = ScaleSpriteTrad(14); if (!FillDrawPixelInfo(&tmp_dpi, left, y, max_width, height)) return; @@ -341,7 +341,7 @@ int GetTrainDetailsWndVScroll(VehicleID veh_id, TrainDetailsWindowTabs det_tab) num += std::max(1u, (unsigned)_cargo_summary.size()); uint length = GetLengthOfArticulatedVehicle(v); - if (length > TRAIN_DETAILS_MAX_INDENT) num++; + if (length > (uint)ScaleSpriteTrad(TRAIN_DETAILS_MAX_INDENT)) num++; } } @@ -382,7 +382,7 @@ void DrawTrainDetails(const Train *v, const Rect &r, int vscroll_pos, uint16 vsc int pitch = 0; const Engine *e = Engine::Get(v->engine_type); if (e->GetGRF() != nullptr) { - pitch = ScaleGUITrad(e->GetGRF()->traininfo_vehicle_pitch); + pitch = ScaleSpriteTrad(e->GetGRF()->traininfo_vehicle_pitch); } PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v); VehicleSpriteSeq seq; @@ -394,13 +394,13 @@ void DrawTrainDetails(const Train *v, const Rect &r, int vscroll_pos, uint16 vsc u = u->Next(); } while (u != nullptr && u->IsArticulatedPart()); - bool separate_sprite_row = (dx > (uint)ScaleGUITrad(TRAIN_DETAILS_MAX_INDENT)); + bool separate_sprite_row = (dx > (uint)ScaleSpriteTrad(TRAIN_DETAILS_MAX_INDENT)); if (separate_sprite_row) { vscroll_pos--; dx = 0; } - int sprite_width = std::max(dx, ScaleGUITrad(TRAIN_DETAILS_MIN_INDENT)) + WidgetDimensions::scaled.hsep_normal; + int sprite_width = std::max(dx, ScaleSpriteTrad(TRAIN_DETAILS_MIN_INDENT)) + WidgetDimensions::scaled.hsep_normal; Rect dr = r.Indent(sprite_width, rtl); uint num_lines = std::max(1u, (unsigned)_cargo_summary.size()); for (uint i = 0; i < num_lines; i++) { diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 48656a883f..d6a30ccdf1 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -972,7 +972,7 @@ struct RefitWindow : public Window { } if (left != right) { - DrawFrameRect(left, r.top + WidgetDimensions::scaled.framerect.top, right, r.top + WidgetDimensions::scaled.framerect.top + ScaleGUITrad(14) - 1, COLOUR_WHITE, FR_BORDERONLY); + DrawFrameRect(left, r.top + WidgetDimensions::scaled.framerect.top, right, r.top + WidgetDimensions::scaled.framerect.top + ScaleSpriteTrad(14) - 1, COLOUR_WHITE, FR_BORDERONLY); } left = INT32_MIN; @@ -1647,7 +1647,7 @@ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int int image_left = (rtl && show_orderlist) ? olr.right : tr.left; int image_right = (!rtl && show_orderlist) ? olr.left : tr.right; - int image_height = ScaleGUITrad(GetVehicleHeight(this->vli.vtype)); + int image_height = ScaleSpriteTrad(GetVehicleHeight(this->vli.vtype)); int vehicle_button_x = rtl ? ir.right - profit.width : ir.left; @@ -3344,7 +3344,7 @@ void SetMouseCursorVehicle(const Vehicle *v, EngineImageType image_type) bool is_ground_vehicle = v->IsGroundVehicle(); while (v != nullptr) { - if (total_width >= ScaleGUITrad(2 * (int)VEHICLEINFO_FULL_VEHICLE_WIDTH)) break; + if (total_width >= ScaleSpriteTrad(2 * (int)VEHICLEINFO_FULL_VEHICLE_WIDTH)) break; PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v); VehicleSpriteSeq seq; @@ -3352,7 +3352,7 @@ void SetMouseCursorVehicle(const Vehicle *v, EngineImageType image_type) if (rotor_seq) { GetCustomRotorSprite(Aircraft::From(v), image_type, &seq); if (!seq.IsValid()) seq.Set(SPR_ROTOR_STOPPED); - y_offset = - ScaleGUITrad(5); + y_offset = -ScaleSpriteTrad(5); } else { v->GetImage(rtl ? DIR_E : DIR_W, image_type, &seq); } @@ -3379,7 +3379,7 @@ void SetMouseCursorVehicle(const Vehicle *v, EngineImageType image_type) if (is_ground_vehicle) { /* Center trains and road vehicles on the front vehicle */ - int offs = (ScaleGUITrad(VEHICLEINFO_FULL_VEHICLE_WIDTH) - total_width) / 2; + int offs = (ScaleSpriteTrad(VEHICLEINFO_FULL_VEHICLE_WIDTH) - total_width) / 2; if (rtl) offs = -offs; for (uint i = 0; i < _cursor.sprite_count; ++i) { _cursor.sprite_pos[i].x += offs; diff --git a/src/widget.cpp b/src/widget.cpp index 7498ff976f..eaf62f63e3 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -786,7 +786,7 @@ static inline void DrawCloseBox(const Rect &r, Colours colour) Dimension d = GetSpriteSize(SPR_CLOSEBOX, &offset); d.width -= offset.x; d.height -= offset.y; - int s = ScaleGUITrad(1); /* Offset to account for shadow of SPR_CLOSEBOX */ + int s = ScaleSpriteTrad(1); /* Offset to account for shadow of SPR_CLOSEBOX */ DrawSprite(SPR_CLOSEBOX, (colour != COLOUR_WHITE ? TC_BLACK : TC_SILVER) | (1U << PALETTE_TEXT_RECOLOUR), CenterBounds(r.left, r.right, d.width - s) - offset.x, CenterBounds(r.top, r.bottom, d.height - s) - offset.y); } diff --git a/src/zoom_func.h b/src/zoom_func.h index f72c7abae4..b9f23d2130 100644 --- a/src/zoom_func.h +++ b/src/zoom_func.h @@ -99,6 +99,16 @@ static inline ZoomLevel UnScaleZoomGUI(ZoomLevel value) return std::clamp(ZoomLevel(value - (ZOOM_LVL_GUI - ZOOM_LVL_OUT_4X)), ZOOM_LVL_MIN, ZOOM_LVL_MAX); } +/** + * Scale traditional pixel dimensions to GUI zoom level, for drawing sprites. + * @param value Pixel amount at #ZOOM_LVL_BASE (traditional "normal" interface size). + * @return Pixel amount at #ZOOM_LVL_GUI (current interface size). + */ +static inline int ScaleSpriteTrad(int value) +{ + return UnScaleGUI(value * ZOOM_LVL_BASE); +} + /** * Scale traditional pixel dimensions to GUI zoom level. * @param value Pixel amount at #ZOOM_LVL_BASE (traditional "normal" interface size). From 13d271217fe31d8c65399047e3f0636c21b36c98 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 2 Oct 2022 19:23:52 +0100 Subject: [PATCH 06/42] Change: Sprite-scale inter-character spacing of fonts. --- src/fontcache/spritefontcache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fontcache/spritefontcache.cpp b/src/fontcache/spritefontcache.cpp index 2b1b0b5335..45a36fe8ef 100644 --- a/src/fontcache/spritefontcache.cpp +++ b/src/fontcache/spritefontcache.cpp @@ -118,7 +118,7 @@ uint SpriteFontCache::GetGlyphWidth(GlyphID key) { SpriteID sprite = this->GetUnicodeGlyph(key); if (sprite == 0) sprite = this->GetUnicodeGlyph('?'); - return SpriteExists(sprite) ? GetSprite(sprite, ST_FONT)->width + ScaleFontTrad(this->fs != FS_NORMAL ? 1 : 0) : 0; + return SpriteExists(sprite) ? GetSprite(sprite, ST_FONT)->width + ScaleSpriteTrad(this->fs != FS_NORMAL ? 1 : 0) : 0; } bool SpriteFontCache::GetDrawGlyphShadow() From 9666e467391ceff4b64a5701a8677d963660ee84 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Tue, 20 Apr 2021 11:49:20 +0100 Subject: [PATCH 07/42] Feature: Variable GUI scale. GUI scale is now variable from 100% to 500%, and no longer restricted to powers-of-2. --- src/fontcache/freetypefontcache.cpp | 9 +- src/fontcache/spritefontcache.cpp | 6 +- src/gfx.cpp | 59 +++++----- src/gfx_func.h | 3 +- src/gfx_layout.cpp | 4 +- src/graph_gui.cpp | 2 +- src/lang/english.txt | 23 ++-- src/news_gui.cpp | 2 +- src/openttd.cpp | 4 +- src/os/macosx/font_osx.cpp | 9 +- src/os/windows/font_win32.cpp | 9 +- src/settings_gui.cpp | 156 +++++++++++++-------------- src/smallmap_gui.cpp | 2 +- src/spritecache.cpp | 16 +-- src/station_gui.cpp | 6 +- src/table/settings/misc_settings.ini | 21 ++-- src/video/cocoa/cocoa_wnd.mm | 2 +- src/video/video_driver.hpp | 8 +- src/video/win32_v.cpp | 2 +- src/widgets/settings_widget.h | 4 +- src/zoom_func.h | 22 +--- src/zoom_type.h | 11 +- 22 files changed, 175 insertions(+), 205 deletions(-) diff --git a/src/fontcache/freetypefontcache.cpp b/src/fontcache/freetypefontcache.cpp index 06a96e8374..29650f3d22 100644 --- a/src/fontcache/freetypefontcache.cpp +++ b/src/fontcache/freetypefontcache.cpp @@ -65,18 +65,19 @@ void FreeTypeFontCache::SetFontSize(FontSize fs, FT_Face face, int pixels) { if (pixels == 0) { /* Try to determine a good height based on the minimal height recommended by the font. */ - int scaled_height = ScaleFontTrad(this->GetDefaultFontHeight(this->fs)); + int scaled_height = ScaleGUITrad(this->GetDefaultFontHeight(this->fs)); pixels = scaled_height; TT_Header *head = (TT_Header *)FT_Get_Sfnt_Table(this->face, ft_sfnt_head); if (head != nullptr) { /* Font height is minimum height plus the difference between the default * height for this font size and the small size. */ - int diff = scaled_height - ScaleFontTrad(this->GetDefaultFontHeight(FS_SMALL)); - pixels = Clamp(std::min(head->Lowest_Rec_PPEM, MAX_FONT_MIN_REC_SIZE) + diff, scaled_height, MAX_FONT_SIZE); + int diff = scaled_height - ScaleGUITrad(this->GetDefaultFontHeight(FS_SMALL)); + /* Clamp() is not used as scaled_height could be greater than MAX_FONT_SIZE, which is not permitted in Clamp(). */ + pixels = std::min(std::max(std::min(head->Lowest_Rec_PPEM, MAX_FONT_MIN_REC_SIZE) + diff, scaled_height), MAX_FONT_SIZE); } } else { - pixels = ScaleFontTrad(pixels); + pixels = ScaleGUITrad(pixels); } this->used_size = pixels; diff --git a/src/fontcache/spritefontcache.cpp b/src/fontcache/spritefontcache.cpp index 45a36fe8ef..373187952e 100644 --- a/src/fontcache/spritefontcache.cpp +++ b/src/fontcache/spritefontcache.cpp @@ -28,7 +28,8 @@ static const int ASCII_LETTERSTART = 32; ///< First printable ASCII letter. SpriteFontCache::SpriteFontCache(FontSize fs) : FontCache(fs), glyph_to_spriteid_map(nullptr) { this->InitializeUnicodeGlyphMap(); - this->height = ScaleFontTrad(this->GetDefaultFontHeight(this->fs)); + this->height = ScaleGUITrad(this->GetDefaultFontHeight(this->fs)); + this->ascender = (this->height - ScaleSpriteTrad(this->GetDefaultFontHeight(this->fs))) / 2; } /** @@ -104,7 +105,8 @@ void SpriteFontCache::ClearGlyphToSpriteMap() void SpriteFontCache::ClearFontCache() { Layouter::ResetFontCache(this->fs); - this->height = ScaleFontTrad(this->GetDefaultFontHeight(this->fs)); + this->height = ScaleGUITrad(this->GetDefaultFontHeight(this->fs)); + this->ascender = (this->height - ScaleSpriteTrad(this->GetDefaultFontHeight(this->fs))) / 2; } const Sprite *SpriteFontCache::GetGlyph(GlyphID key) diff --git a/src/gfx.cpp b/src/gfx.cpp index 728750c025..147a717a85 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -61,12 +61,9 @@ static void GfxMainBlitter(const Sprite *sprite, int x, int y, BlitterMode mode, static ReusableBuffer _cursor_backup; -ZoomLevel _gui_zoom; ///< GUI Zoom level -ZoomLevel _font_zoom; ///< Font Zoom level - -int8 _gui_zoom_cfg; ///< GUI zoom level in config. -int8 _font_zoom_cfg; ///< Font zoom level in config. - +ZoomLevel _gui_zoom = ZOOM_LVL_OUT_4X; ///< GUI Zoom level +int _gui_scale = MIN_INTERFACE_SCALE; ///< GUI scale, 100 is 100%. +int _gui_scale_cfg; ///< GUI scale in config. /** * The rect for repaint. @@ -2028,48 +2025,52 @@ void SortResolutions() void UpdateGUIZoom() { /* Determine real GUI zoom to use. */ - if (_gui_zoom_cfg == ZOOM_LVL_CFG_AUTO) { - _gui_zoom = static_cast(Clamp(VideoDriver::GetInstance()->GetSuggestedUIZoom(), _settings_client.gui.zoom_min, _settings_client.gui.zoom_max)); + if (_gui_scale_cfg == -1) { + _gui_scale = VideoDriver::GetInstance()->GetSuggestedUIScale(); } else { - /* Ensure the gui_zoom is clamped between min/max. Change the - * _gui_zoom_cfg if it isn't, as this is used to visually show the - * selection in the Game Options. */ - _gui_zoom_cfg = Clamp(_gui_zoom_cfg, _settings_client.gui.zoom_min, _settings_client.gui.zoom_max); - _gui_zoom = static_cast(_gui_zoom_cfg); + _gui_scale = Clamp(_gui_scale_cfg, MIN_INTERFACE_SCALE, MAX_INTERFACE_SCALE); } - /* Determine real font zoom to use. */ - if (_font_zoom_cfg == ZOOM_LVL_CFG_AUTO) { - _font_zoom = static_cast(VideoDriver::GetInstance()->GetSuggestedUIZoom()); - } else { - _font_zoom = static_cast(_font_zoom_cfg); - } + int8 new_zoom = ScaleGUITrad(1) <= 1 ? ZOOM_LVL_OUT_4X : ScaleGUITrad(1) >= 4 ? ZOOM_LVL_MIN : ZOOM_LVL_OUT_2X; + /* Ensure the gui_zoom is clamped between min/max. */ + new_zoom = Clamp(new_zoom, _settings_client.gui.zoom_min, _settings_client.gui.zoom_max); + _gui_zoom = static_cast(new_zoom); } /** * Resolve GUI zoom level and adjust GUI to new zoom, if auto-suggestion is requested. + * @param automatic Set if the change is occuring due to OS DPI scaling being changed. * @returns true when the zoom level has changed, caller must call ReInitAllWindows(true) * after resizing the application's window/buffer. */ -bool AdjustGUIZoom() +bool AdjustGUIZoom(bool automatic) { - auto old_zoom = _gui_zoom; + ZoomLevel old_zoom = _gui_zoom; + int old_scale = _gui_scale; UpdateGUIZoom(); - if (old_zoom == _gui_zoom) return false; - GfxClearSpriteCache(); - VideoDriver::GetInstance()->ClearSystemSprites(); + if (old_scale == _gui_scale) return false; + + /* Reload sprites if sprite zoom level has changed. */ + if (old_zoom != _gui_zoom) { + GfxClearSpriteCache(); + VideoDriver::GetInstance()->ClearSystemSprites(); + UpdateCursorSize(); + } + ClearFontCache(); - GfxClearSpriteCache(); + LoadStringWidthTable(); UpdateAllVirtCoords(); /* Adjust all window sizes to match the new zoom level, so that they don't appear to move around when the application is moved to a screen with different DPI. */ auto zoom_shift = old_zoom - _gui_zoom; for (Window *w : Window::Iterate()) { - w->left = AdjustByZoom(w->left, zoom_shift); - w->top = AdjustByZoom(w->top, zoom_shift); - w->width = AdjustByZoom(w->width, zoom_shift); - w->height = AdjustByZoom(w->height, zoom_shift); + if (automatic) { + w->left = (w->left * _gui_scale) / old_scale; + w->top = (w->top * _gui_scale) / old_scale; + w->width = (w->width * _gui_scale) / old_scale; + w->height = (w->height * _gui_scale) / old_scale; + } if (w->viewport != nullptr) { w->viewport->zoom = Clamp(ZoomLevel(w->viewport->zoom - zoom_shift), _settings_client.gui.zoom_min, _settings_client.gui.zoom_max); } diff --git a/src/gfx_func.h b/src/gfx_func.h index 4ed6a81461..5f5b89003e 100644 --- a/src/gfx_func.h +++ b/src/gfx_func.h @@ -79,8 +79,7 @@ void ChangeGameSpeed(bool enable_fast_forward); void DrawMouseCursor(); void ScreenSizeChanged(); void GameSizeChanged(); -void UpdateGUIZoom(); -bool AdjustGUIZoom(); +bool AdjustGUIZoom(bool automatic); void UndrawMouseCursor(); /** Size of the buffer used for drawing strings. */ diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 38f6d62e59..8246e10aca 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -339,12 +339,12 @@ FallbackParagraphLayout::FallbackVisualRun::FallbackVisualRun(Font *font, const /* Positions contains the location of the begin of each of the glyphs, and the end of the last one. */ this->positions = MallocT(this->glyph_count * 2 + 2); this->positions[0] = x; - this->positions[1] = 0; + this->positions[1] = font->fc->GetAscender(); for (int i = 0; i < this->glyph_count; i++) { this->glyphs[i] = font->fc->MapCharToGlyph(chars[i]); this->positions[2 * i + 2] = this->positions[2 * i] + font->fc->GetGlyphWidth(this->glyphs[i]); - this->positions[2 * i + 3] = 0; + this->positions[2 * i + 3] = font->fc->GetAscender(); this->glyph_to_char[i] = i; } } diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 4bf6f069c8..4e2babf61f 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -900,7 +900,7 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { void OnInit() override { /* Width of the legend blob. */ - this->legend_width = (FONT_HEIGHT_SMALL - ScaleFontTrad(1)) * 8 / 5; + this->legend_width = (FONT_HEIGHT_SMALL - ScaleGUITrad(1)) * 8 / 5; } void UpdateExcludedData() diff --git a/src/lang/english.txt b/src/lang/english.txt index 8883a15850..bb85c04ca0 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1008,24 +1008,19 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Check th STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Current driver: {RAW_STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Interface size -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Select the interface element size to use +STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Interface size +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Drag slider to set interface size. Hold Ctrl for continuous adjustment +STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Auto-detect size +STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Check this box to detect interface size automatically STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Scale bevels STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Check this box to scale bevels by interface size -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(auto-detect) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Double size -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Quad size - -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Font size -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Select the interface font size to use - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(auto-detect) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Double size -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Quad size +STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_2X :2x +STR_GAME_OPTIONS_GUI_SCALE_3X :3x +STR_GAME_OPTIONS_GUI_SCALE_4X :4x +STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Graphics diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 7439d67c3e..4f18a5d455 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -1159,7 +1159,7 @@ struct MessageHistoryWindow : Window { /* Months are off-by-one, so it's actually 8. Not using * month 12 because the 1 is usually less wide. */ SetDParam(0, ConvertYMDToDate(ORIGINAL_MAX_YEAR, 7, 30)); - this->date_width = GetStringBoundingBox(STR_SHORT_DATE).width + ScaleFontTrad(5); + this->date_width = GetStringBoundingBox(STR_SHORT_DATE).width + ScaleGUITrad(5); size->height = 4 * resize->height + WidgetDimensions::scaled.framerect.Vertical(); // At least 4 lines are visible. size->width = std::max(200u, size->width); // At least 200 pixels wide. diff --git a/src/openttd.cpp b/src/openttd.cpp index 1e7cd9ae0e..20401892be 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -756,7 +756,9 @@ int openttd_main(int argc, char *argv[]) /* Initialize the zoom level of the screen to normal */ _screen.zoom = ZOOM_LVL_NORMAL; - UpdateGUIZoom(); + + /* The video driver is now selected, now initialise GUI zoom */ + AdjustGUIZoom(false); NetworkStartUp(); // initialize network-core diff --git a/src/os/macosx/font_osx.cpp b/src/os/macosx/font_osx.cpp index cb0ffda94b..b3b4f306db 100644 --- a/src/os/macosx/font_osx.cpp +++ b/src/os/macosx/font_osx.cpp @@ -173,7 +173,7 @@ void CoreTextFontCache::SetFontSize(int pixels) { if (pixels == 0) { /* Try to determine a good height based on the height recommended by the font. */ - int scaled_height = ScaleFontTrad(this->GetDefaultFontHeight(this->fs)); + int scaled_height = ScaleGUITrad(this->GetDefaultFontHeight(this->fs)); pixels = scaled_height; CFAutoRelease font(CTFontCreateWithFontDescriptor(this->font_desc.get(), 0.0f, nullptr)); @@ -197,11 +197,12 @@ void CoreTextFontCache::SetFontSize(int pixels) /* Font height is minimum height plus the difference between the default * height for this font size and the small size. */ - int diff = scaled_height - ScaleFontTrad(this->GetDefaultFontHeight(FS_SMALL)); - pixels = Clamp(std::min(min_size, MAX_FONT_MIN_REC_SIZE) + diff, scaled_height, MAX_FONT_SIZE); + int diff = scaled_height - ScaleGUITrad(this->GetDefaultFontHeight(FS_SMALL)); + /* Clamp() is not used as scaled_height could be greater than MAX_FONT_SIZE, which is not permitted in Clamp(). */ + pixels = std::min(std::max(std::min(min_size, MAX_FONT_MIN_REC_SIZE) + diff, scaled_height), MAX_FONT_SIZE); } } else { - pixels = ScaleFontTrad(pixels); + pixels = ScaleGUITrad(pixels); } this->used_size = pixels; diff --git a/src/os/windows/font_win32.cpp b/src/os/windows/font_win32.cpp index fb62aadb59..962595a016 100644 --- a/src/os/windows/font_win32.cpp +++ b/src/os/windows/font_win32.cpp @@ -392,7 +392,7 @@ void Win32FontCache::SetFontSize(FontSize fs, int pixels) { if (pixels == 0) { /* Try to determine a good height based on the minimal height recommended by the font. */ - int scaled_height = ScaleFontTrad(this->GetDefaultFontHeight(this->fs)); + int scaled_height = ScaleGUITrad(this->GetDefaultFontHeight(this->fs)); pixels = scaled_height; HFONT temp = CreateFontIndirect(&this->logfont); @@ -405,14 +405,15 @@ void Win32FontCache::SetFontSize(FontSize fs, int pixels) /* Font height is minimum height plus the difference between the default * height for this font size and the small size. */ - int diff = scaled_height - ScaleFontTrad(this->GetDefaultFontHeight(FS_SMALL)); - pixels = Clamp(std::min(otm->otmusMinimumPPEM, MAX_FONT_MIN_REC_SIZE) + diff, scaled_height, MAX_FONT_SIZE); + int diff = scaled_height - ScaleGUITrad(this->GetDefaultFontHeight(FS_SMALL)); + /* Clamp() is not used as scaled_height could be greater than MAX_FONT_SIZE, which is not permitted in Clamp(). */ + pixels = std::min(std::max(std::min(otm->otmusMinimumPPEM, MAX_FONT_MIN_REC_SIZE) + diff, scaled_height), MAX_FONT_SIZE); SelectObject(dc, old); DeleteObject(temp); } } else { - pixels = ScaleFontTrad(pixels); + pixels = ScaleGUITrad(pixels); } this->used_size = pixels; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index c11393de52..3b03ef17b8 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -57,22 +57,6 @@ static const StringID _autosave_dropdown[] = { INVALID_STRING_ID, }; -static const StringID _gui_zoom_dropdown[] = { - STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO, - STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL, - STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM, - STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM, - INVALID_STRING_ID, -}; - -static const StringID _font_zoom_dropdown[] = { - STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO, - STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL, - STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM, - STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM, - INVALID_STRING_ID, -}; - static Dimension _circle_size; ///< Dimension of the circle +/- icon. This is here as not all users are within the class of the settings window. static const void *ResolveObject(const GameSettings *settings_ptr, const IntSettingDesc *sd); @@ -158,14 +142,36 @@ static void AddCustomRefreshRates() std::copy(monitorRates.begin(), monitorRates.end(), std::inserter(_refresh_rates, _refresh_rates.end())); } +static const std::map _scale_labels = { + { 100, STR_GAME_OPTIONS_GUI_SCALE_1X }, + { 125, STR_NULL }, + { 150, STR_NULL }, + { 175, STR_NULL }, + { 200, STR_GAME_OPTIONS_GUI_SCALE_2X }, + { 225, STR_NULL }, + { 250, STR_NULL }, + { 275, STR_NULL }, + { 300, STR_GAME_OPTIONS_GUI_SCALE_3X }, + { 325, STR_NULL }, + { 350, STR_NULL }, + { 375, STR_NULL }, + { 400, STR_GAME_OPTIONS_GUI_SCALE_4X }, + { 425, STR_NULL }, + { 450, STR_NULL }, + { 475, STR_NULL }, + { 500, STR_GAME_OPTIONS_GUI_SCALE_5X }, +}; + struct GameOptionsWindow : Window { GameSettings *opt; bool reload; + int gui_scale; GameOptionsWindow(WindowDesc *desc) : Window(desc) { this->opt = &GetGameSettings(); this->reload = false; + this->gui_scale = _gui_scale; AddCustomRefreshRates(); @@ -264,24 +270,6 @@ struct GameOptionsWindow : Window { } break; - case WID_GO_GUI_ZOOM_DROPDOWN: { - *selected_index = _gui_zoom_cfg != ZOOM_LVL_CFG_AUTO ? ZOOM_LVL_OUT_4X - _gui_zoom + 1 : 0; - const StringID *items = _gui_zoom_dropdown; - for (int i = 0; *items != INVALID_STRING_ID; items++, i++) { - list.emplace_back(new DropDownListStringItem(*items, i, i != 0 && _settings_client.gui.zoom_min > ZOOM_LVL_OUT_4X - i + 1)); - } - break; - } - - case WID_GO_FONT_ZOOM_DROPDOWN: { - *selected_index = _font_zoom_cfg != ZOOM_LVL_CFG_AUTO ? ZOOM_LVL_OUT_4X - _font_zoom + 1 : 0; - const StringID *items = _font_zoom_dropdown; - for (int i = 0; *items != INVALID_STRING_ID; items++, i++) { - list.emplace_back(new DropDownListStringItem(*items, i, false)); - } - break; - } - case WID_GO_BASE_GRF_DROPDOWN: list = BuildSetDropDownList(selected_index, (_game_mode == GM_MENU)); break; @@ -304,8 +292,6 @@ struct GameOptionsWindow : Window { case WID_GO_CURRENCY_DROPDOWN: SetDParam(0, _currency_specs[this->opt->locale.currency].name); break; case WID_GO_AUTOSAVE_DROPDOWN: SetDParam(0, _autosave_dropdown[_settings_client.gui.autosave]); break; case WID_GO_LANG_DROPDOWN: SetDParamStr(0, _current_language->own_name); break; - case WID_GO_GUI_ZOOM_DROPDOWN: SetDParam(0, _gui_zoom_dropdown[_gui_zoom_cfg != ZOOM_LVL_CFG_AUTO ? ZOOM_LVL_OUT_4X - _gui_zoom_cfg + 1 : 0]); break; - case WID_GO_FONT_ZOOM_DROPDOWN: SetDParam(0, _font_zoom_dropdown[_font_zoom_cfg != ZOOM_LVL_CFG_AUTO ? ZOOM_LVL_OUT_4X - _font_zoom_cfg + 1 : 0]); break; case WID_GO_BASE_GRF_DROPDOWN: SetDParamStr(0, BaseGraphics::GetUsedSet()->name); break; case WID_GO_BASE_GRF_STATUS: SetDParam(0, BaseGraphics::GetUsedSet()->GetNumInvalid()); break; case WID_GO_BASE_SFX_DROPDOWN: SetDParamStr(0, BaseSounds::GetUsedSet()->name); break; @@ -346,6 +332,10 @@ struct GameOptionsWindow : Window { DrawStringMultiLine(r.left, r.right, r.top, UINT16_MAX, STR_BLACK_RAW_STRING); break; + case WID_GO_GUI_SCALE: + DrawSliderWidget(r, MIN_INTERFACE_SCALE, MAX_INTERFACE_SCALE, this->gui_scale, _scale_labels); + break; + case WID_GO_BASE_SFX_VOLUME: DrawSliderWidget(r, 0, INT8_MAX, _settings_client.music.effect_vol, {}); break; @@ -486,6 +476,30 @@ struct GameOptionsWindow : Window { break; } + case WID_GO_GUI_SCALE: + if (ClickSliderWidget(this->GetWidget(widget)->GetCurrentRect(), pt, MIN_INTERFACE_SCALE, MAX_INTERFACE_SCALE, this->gui_scale)) { + if (!_ctrl_pressed) this->gui_scale = ((this->gui_scale + 12) / 25) * 25; + this->SetWidgetDirty(widget); + } + + if (click_count > 0) this->mouse_capture_widget = widget; + break; + + case WID_GO_GUI_SCALE_AUTO: + { + if (_gui_scale_cfg == -1) { + _gui_scale_cfg = _gui_scale; + this->SetWidgetLoweredState(WID_GO_GUI_SCALE_AUTO, false); + } else { + _gui_scale_cfg = -1; + this->SetWidgetLoweredState(WID_GO_GUI_SCALE_AUTO, true); + if (AdjustGUIZoom(false)) ReInitAllWindows(true); + this->gui_scale = _gui_scale; + } + this->SetWidgetDirty(widget); + break; + } + case WID_GO_BASE_SFX_VOLUME: case WID_GO_BASE_MUSIC_VOLUME: { byte &vol = (widget == WID_GO_BASE_MUSIC_VOLUME) ? _settings_client.music.music_vol : _settings_client.music.effect_vol; @@ -517,6 +531,19 @@ struct GameOptionsWindow : Window { } } + void OnMouseLoop() override + { + if (_left_button_down || this->gui_scale == _gui_scale) return; + + _gui_scale_cfg = this->gui_scale; + + if (AdjustGUIZoom(false)) { + ReInitAllWindows(true); + this->SetWidgetLoweredState(WID_GO_GUI_SCALE_AUTO, false); + this->SetDirty(); + } + } + /** * Set the base media set. * @param index the index of the media set @@ -576,36 +603,6 @@ struct GameOptionsWindow : Window { break; } - case WID_GO_GUI_ZOOM_DROPDOWN: { - int8 new_zoom = index > 0 ? ZOOM_LVL_OUT_4X - index + 1 : ZOOM_LVL_CFG_AUTO; - if (new_zoom != _gui_zoom_cfg) { - GfxClearSpriteCache(); - _gui_zoom_cfg = new_zoom; - UpdateGUIZoom(); - UpdateCursorSize(); - SetupWidgetDimensions(); - UpdateAllVirtCoords(); - FixTitleGameZoom(); - ReInitAllWindows(true); - } - break; - } - - case WID_GO_FONT_ZOOM_DROPDOWN: { - int8 new_zoom = index > 0 ? ZOOM_LVL_OUT_4X - index + 1 : ZOOM_LVL_CFG_AUTO; - if (new_zoom != _font_zoom_cfg) { - GfxClearSpriteCache(); - _font_zoom_cfg = new_zoom; - UpdateGUIZoom(); - ClearFontCache(); - LoadStringWidthTable(); - SetupWidgetDimensions(); - UpdateAllVirtCoords(); - ReInitAllWindows(true); - } - break; - } - case WID_GO_BASE_GRF_DROPDOWN: this->SetMediaSet(index); break; @@ -637,6 +634,7 @@ struct GameOptionsWindow : Window { this->SetWidgetDisabledState(WID_GO_VIDEO_VSYNC_BUTTON, !_video_hw_accel); #endif + this->SetWidgetLoweredState(WID_GO_GUI_SCALE_AUTO, _gui_scale_cfg == -1); this->SetWidgetLoweredState(WID_GO_GUI_SCALE_BEVEL_BUTTON, _settings_client.gui.scale_bevels); bool missing_files = BaseGraphics::GetUsedSet()->GetNumMissing() == 0; @@ -664,16 +662,6 @@ static const NWidgetPart _nested_game_options_widgets[] = { NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_AUTOSAVE_FRAME, STR_NULL), NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_AUTOSAVE_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP), SetFill(1, 0), EndContainer(), - NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_GUI_ZOOM_FRAME, STR_NULL), - NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_normal, 0), - NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_GUI_ZOOM_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP), SetFill(1, 0), - NWidget(NWID_HORIZONTAL), - NWidget(WWT_TEXT, COLOUR_GREY), SetMinimalSize(0, 12), SetDataTip(STR_GAME_OPTIONS_GUI_SCALE_BEVELS, STR_NULL), - NWidget(NWID_SPACER), SetMinimalSize(1, 0), SetFill(1, 0), - NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_GO_GUI_SCALE_BEVEL_BUTTON), SetMinimalSize(21, 9), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP), - EndContainer(), - EndContainer(), - EndContainer(), NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME, STR_NULL), NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_CURRENCY_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP), SetFill(1, 0), EndContainer(), @@ -683,8 +671,20 @@ static const NWidgetPart _nested_game_options_widgets[] = { NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_LANGUAGE, STR_NULL), NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_LANG_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_RAW_STRING, STR_GAME_OPTIONS_LANGUAGE_TOOLTIP), SetFill(1, 0), EndContainer(), - NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_FONT_ZOOM, STR_NULL), - NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_FONT_ZOOM_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP), SetFill(1, 0), + NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_GUI_SCALE_FRAME, STR_NULL), + NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_normal, 0), + NWidget(WWT_EMPTY, COLOUR_GREY, WID_GO_GUI_SCALE), SetMinimalSize(67, 0), SetMinimalTextLines(1, 12 + WidgetDimensions::unscaled.vsep_normal, FS_SMALL), SetFill(0, 0), SetDataTip(0x0, STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP), + NWidget(NWID_HORIZONTAL), + NWidget(WWT_TEXT, COLOUR_GREY), SetMinimalSize(0, 12), SetDataTip(STR_GAME_OPTIONS_GUI_SCALE_AUTO, STR_NULL), + NWidget(NWID_SPACER), SetMinimalSize(1, 0), SetFill(1, 0), + NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_GO_GUI_SCALE_AUTO), SetMinimalSize(21, 9), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP), + EndContainer(), + NWidget(NWID_HORIZONTAL), + NWidget(WWT_TEXT, COLOUR_GREY), SetMinimalSize(0, 12), SetDataTip(STR_GAME_OPTIONS_GUI_SCALE_BEVELS, STR_NULL), + NWidget(NWID_SPACER), SetMinimalSize(1, 0), SetFill(1, 0), + NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_GO_GUI_SCALE_BEVEL_BUTTON), SetMinimalSize(21, 9), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP), + EndContainer(), + EndContainer(), EndContainer(), EndContainer(), EndContainer(), diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 4d3305cf84..f4fdf0013f 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1188,7 +1188,7 @@ void SmallMapWindow::RebuildColourIndexIfNecessary() } /* Width of the legend blob. */ - this->legend_width = (FONT_HEIGHT_SMALL - ScaleFontTrad(1)) * 8 / 5; + this->legend_width = (FONT_HEIGHT_SMALL - ScaleGUITrad(1)) * 8 / 5; /* The width of a column is the minimum width of all texts + the size of the blob + some spacing */ this->column_width = min_width + this->legend_width + WidgetDimensions::scaled.framerect.Horizontal(); diff --git a/src/spritecache.cpp b/src/spritecache.cpp index e3dd33dfc9..a62d2e29ad 100644 --- a/src/spritecache.cpp +++ b/src/spritecache.cpp @@ -517,14 +517,14 @@ static void *ReadSprite(const SpriteCache *sc, SpriteID id, SpriteType sprite_ty return (void*)GetRawSprite(SPR_IMG_QUERY, ST_NORMAL, allocator, encoder); } - if (sprite->type == ST_FONT && ZOOM_LVL_FONT != ZOOM_LVL_NORMAL) { - /* Make ZOOM_LVL_NORMAL be ZOOM_LVL_FONT */ - sprite[ZOOM_LVL_NORMAL].width = sprite[ZOOM_LVL_FONT].width; - sprite[ZOOM_LVL_NORMAL].height = sprite[ZOOM_LVL_FONT].height; - sprite[ZOOM_LVL_NORMAL].x_offs = sprite[ZOOM_LVL_FONT].x_offs; - sprite[ZOOM_LVL_NORMAL].y_offs = sprite[ZOOM_LVL_FONT].y_offs; - sprite[ZOOM_LVL_NORMAL].data = sprite[ZOOM_LVL_FONT].data; - sprite[ZOOM_LVL_NORMAL].colours = sprite[ZOOM_LVL_FONT].colours; + if (sprite->type == ST_FONT && ZOOM_LVL_GUI != ZOOM_LVL_NORMAL) { + /* Make ZOOM_LVL_NORMAL be ZOOM_LVL_GUI */ + sprite[ZOOM_LVL_NORMAL].width = sprite[ZOOM_LVL_GUI].width; + sprite[ZOOM_LVL_NORMAL].height = sprite[ZOOM_LVL_GUI].height; + sprite[ZOOM_LVL_NORMAL].x_offs = sprite[ZOOM_LVL_GUI].x_offs; + sprite[ZOOM_LVL_NORMAL].y_offs = sprite[ZOOM_LVL_GUI].y_offs; + sprite[ZOOM_LVL_NORMAL].data = sprite[ZOOM_LVL_GUI].data; + sprite[ZOOM_LVL_NORMAL].colours = sprite[ZOOM_LVL_GUI].colours; } return encoder->Encode(sprite, allocator); diff --git a/src/station_gui.cpp b/src/station_gui.cpp index c551db17ca..512f025a48 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -163,7 +163,7 @@ static void StationsWndShowStationRating(int left, int right, int y, CargoID typ const CargoSpec *cs = CargoSpec::Get(type); if (!cs->IsValid()) return; - int padding = ScaleFontTrad(1); + int padding = ScaleGUITrad(1); int width = right - left; int colour = cs->rating_colour; TextColour tc = GetContrastColour(colour); @@ -177,7 +177,7 @@ static void StationsWndShowStationRating(int left, int right, int y, CargoID typ } else { /* Draw a (scaled) one pixel-wide bar of additional cargo meter, useful * for stations with only a small amount (<=30) */ - uint rest = ScaleFontTrad(amount) / 5; + uint rest = ScaleGUITrad(amount) / 5; if (rest != 0) { GfxFillRect(left, y + height - rest, left + padding - 1, y + height, colour); } @@ -391,7 +391,7 @@ public: } case WID_STL_LIST: - resize->height = std::max(FONT_HEIGHT_NORMAL, FONT_HEIGHT_SMALL + ScaleFontTrad(3)); + resize->height = std::max(FONT_HEIGHT_NORMAL, FONT_HEIGHT_SMALL + ScaleGUITrad(3)); size->height = padding.height + 5 * resize->height; /* Determine appropriate width for mini station rating graph */ diff --git a/src/table/settings/misc_settings.ini b/src/table/settings/misc_settings.ini index 15e9413ed2..dd3a58e24e 100644 --- a/src/table/settings/misc_settings.ini +++ b/src/table/settings/misc_settings.ini @@ -334,21 +334,12 @@ max = UINT32_MAX cat = SC_EXPERT [SDTG_VAR] -name = ""gui_zoom"" -type = SLE_INT8 -var = _gui_zoom_cfg -def = ZOOM_LVL_CFG_AUTO -min = ZOOM_LVL_CFG_AUTO -max = ZOOM_LVL_OUT_4X -cat = SC_BASIC - -[SDTG_VAR] -name = ""font_zoom"" -type = SLE_INT8 -var = _font_zoom_cfg -def = ZOOM_LVL_CFG_AUTO -min = ZOOM_LVL_CFG_AUTO -max = ZOOM_LVL_OUT_4X +name = ""gui_scale"" +type = SLE_INT32 +var = _gui_scale_cfg +def = -1 +min = -1 +max = MAX_INTERFACE_SCALE cat = SC_BASIC [SDTG_BOOL] diff --git a/src/video/cocoa/cocoa_wnd.mm b/src/video/cocoa/cocoa_wnd.mm index 36d010177d..d4fc5b292e 100644 --- a/src/video/cocoa/cocoa_wnd.mm +++ b/src/video/cocoa/cocoa_wnd.mm @@ -1269,7 +1269,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel /** Screen the window is on changed. */ - (void)windowDidChangeBackingProperties:(NSNotification *)notification { - bool did_adjust = AdjustGUIZoom(); + bool did_adjust = AdjustGUIZoom(true); /* Reallocate screen buffer if necessary. */ driver->AllocateBackingStore(); diff --git a/src/video/video_driver.hpp b/src/video/video_driver.hpp index 6ef06c45f6..b81ec6e2fb 100644 --- a/src/video/video_driver.hpp +++ b/src/video/video_driver.hpp @@ -167,15 +167,13 @@ public: } /** - * Get a suggested default GUI zoom taking screen DPI into account. + * Get a suggested default GUI scale taking screen DPI into account. */ - virtual ZoomLevel GetSuggestedUIZoom() + virtual int GetSuggestedUIScale() { float dpi_scale = this->GetDPIScale(); - if (dpi_scale >= 3.0f) return ZOOM_LVL_NORMAL; - if (dpi_scale >= 1.5f) return ZOOM_LVL_OUT_2X; - return ZOOM_LVL_OUT_4X; + return Clamp(dpi_scale * 100, MIN_INTERFACE_SCALE, MAX_INTERFACE_SCALE); } virtual const char *GetInfoString() const diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index 49c967bfa4..8d8a78a0ca 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -675,7 +675,7 @@ LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } case WM_DPICHANGED: { - auto did_adjust = AdjustGUIZoom(); + auto did_adjust = AdjustGUIZoom(true); /* Resize the window to match the new DPI setting. */ RECT *prcNewWindow = (RECT *)lParam; diff --git a/src/widgets/settings_widget.h b/src/widgets/settings_widget.h index e727c4d277..8f655d945a 100644 --- a/src/widgets/settings_widget.h +++ b/src/widgets/settings_widget.h @@ -19,7 +19,8 @@ enum GameOptionsWidgets { WID_GO_LANG_DROPDOWN, ///< Language dropdown. WID_GO_RESOLUTION_DROPDOWN, ///< Dropdown for the resolution. WID_GO_FULLSCREEN_BUTTON, ///< Toggle fullscreen. - WID_GO_GUI_ZOOM_DROPDOWN, ///< Dropdown for the GUI zoom level. + WID_GO_GUI_SCALE, ///< GUI Scale slider. + WID_GO_GUI_SCALE_AUTO, ///< Autodetect GUI scale button. WID_GO_GUI_SCALE_BEVEL_BUTTON, ///< Toggle for chunky bevels. WID_GO_BASE_GRF_DROPDOWN, ///< Use to select a base GRF. WID_GO_BASE_GRF_STATUS, ///< Info about missing files etc. @@ -35,7 +36,6 @@ enum GameOptionsWidgets { WID_GO_BASE_MUSIC_STATUS, ///< Info about corrupted files etc. WID_GO_BASE_MUSIC_TEXTFILE, ///< Open base music readme, changelog (+1) or license (+2). WID_GO_BASE_MUSIC_DESCRIPTION = WID_GO_BASE_MUSIC_TEXTFILE + TFT_END, ///< Description of selected base music set. - WID_GO_FONT_ZOOM_DROPDOWN, ///< Dropdown for the font zoom level. WID_GO_VIDEO_ACCEL_BUTTON, ///< Toggle for video acceleration. WID_GO_VIDEO_VSYNC_BUTTON, ///< Toggle for video vsync. WID_GO_REFRESH_RATE_DROPDOWN, ///< Dropdown for all available refresh rates. diff --git a/src/zoom_func.h b/src/zoom_func.h index b9f23d2130..abcc050d25 100644 --- a/src/zoom_func.h +++ b/src/zoom_func.h @@ -116,27 +116,7 @@ static inline int ScaleSpriteTrad(int value) */ static inline int ScaleGUITrad(int value) { - return UnScaleGUI(value * ZOOM_LVL_BASE); -} - -/** - * Short-hand to apply font zoom level. - * @param value Pixel amount at #ZOOM_LVL_BEGIN (full zoom in). - * @return Pixel amount at #ZOOM_LVL_FONT (current interface size). - */ -static inline int UnScaleFont(int value) -{ - return UnScaleByZoom(value, ZOOM_LVL_FONT); -} - -/** - * Scale traditional pixel dimensions to Font zoom level. - * @param value Pixel amount at #ZOOM_LVL_BASE (traditional "normal" interface size). - * @return Pixel amount at #ZOOM_LVL_FONT (current interface size). - */ -static inline int ScaleFontTrad(int value) -{ - return UnScaleFont(value * ZOOM_LVL_BASE); + return value * _gui_scale / 100; } #endif /* ZOOM_FUNC_H */ diff --git a/src/zoom_type.h b/src/zoom_type.h index ffa70f7611..7ccc142ef3 100644 --- a/src/zoom_type.h +++ b/src/zoom_type.h @@ -15,8 +15,6 @@ static uint const ZOOM_LVL_SHIFT = 2; static uint const ZOOM_LVL_BASE = 1 << ZOOM_LVL_SHIFT; -static const int8 ZOOM_LVL_CFG_AUTO = -1; - /** All zoom levels we know. */ enum ZoomLevel : byte { /* Our possible zoom-levels */ @@ -50,12 +48,13 @@ enum ZoomLevel : byte { }; DECLARE_POSTFIX_INCREMENT(ZoomLevel) -extern int8 _gui_zoom_cfg; -extern int8 _font_zoom_cfg; +extern int _gui_scale; +extern int _gui_scale_cfg; extern ZoomLevel _gui_zoom; -extern ZoomLevel _font_zoom; #define ZOOM_LVL_GUI (_gui_zoom) -#define ZOOM_LVL_FONT (_font_zoom) + +static const int MIN_INTERFACE_SCALE = 100; +static const int MAX_INTERFACE_SCALE = 500; #endif /* ZOOM_TYPE_H */ From 920e5883343193bb1d677231d6390957ec6f71d5 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Tue, 27 Sep 2022 23:40:16 +0100 Subject: [PATCH 08/42] Change: Use standard dimensions instead of custom widths. --- src/company_gui.cpp | 32 ++++++++++++++------------------ src/network/network_gui.cpp | 4 +--- src/newgrf_gui.cpp | 4 ++-- src/news_gui.cpp | 2 +- src/settings_gui.cpp | 1 - src/smallmap_gui.cpp | 2 +- src/station_gui.cpp | 4 ++-- src/train_gui.cpp | 3 +-- 8 files changed, 22 insertions(+), 30 deletions(-) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 77f8ad4e48..e5f30e3324 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -49,10 +49,6 @@ /** Company GUI constants. */ -static const uint EXP_LINESPACE = 2; ///< Amount of vertical space for a horizontal (sub-)total line. -static const uint EXP_BLOCKSPACE = 10; ///< Amount of vertical space between two blocks of numbers. -static const int EXP_INDENT = 10; ///< Amount of horizontal space for an indented line. - static void DoSelectCompanyManagerFace(Window *parent); static void ShowCompanyInfrastructure(CompanyID company); @@ -122,15 +118,15 @@ static const ExpensesList _expenses_list_types[] = { static uint GetTotalCategoriesHeight() { /* There's an empty line and blockspace on the year row */ - uint total_height = FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE; + uint total_height = FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_wide; for (uint i = 0; i < lengthof(_expenses_list_types); i++) { /* Title + expense list + total line + total + blockspace after category */ - total_height += FONT_HEIGHT_NORMAL + _expenses_list_types[i].GetHeight() + EXP_LINESPACE + FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE; + total_height += FONT_HEIGHT_NORMAL + _expenses_list_types[i].GetHeight() + WidgetDimensions::scaled.vsep_normal + FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_wide; } /* Total income */ - total_height += EXP_LINESPACE + FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE; + total_height += WidgetDimensions::scaled.vsep_normal + FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_wide; return total_height; } @@ -159,7 +155,7 @@ static uint GetMaxCategoriesWidth() */ static void DrawCategory(const Rect &r, int start_y, ExpensesList list) { - Rect tr = r.Indent(EXP_INDENT, _current_text_dir == TD_RTL); + Rect tr = r.Indent(WidgetDimensions::scaled.hsep_indent, _current_text_dir == TD_RTL); tr.top = start_y; ExpensesType et; @@ -179,7 +175,7 @@ static void DrawCategory(const Rect &r, int start_y, ExpensesList list) static void DrawCategories(const Rect &r) { /* Start with an empty space in the year row, plus the blockspace under the year. */ - int y = r.top + FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE; + int y = r.top + FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_wide; for (uint i = 0; i < lengthof(_expenses_list_types); i++) { /* Draw category title and advance y */ @@ -191,14 +187,14 @@ static void DrawCategories(const Rect &r) y += _expenses_list_types[i].GetHeight(); /* Advance y by the height of the total and associated total line */ - y += EXP_LINESPACE + FONT_HEIGHT_NORMAL; + y += WidgetDimensions::scaled.vsep_normal + FONT_HEIGHT_NORMAL; /* Advance y by a blockspace after this category block */ - y += EXP_BLOCKSPACE; + y += WidgetDimensions::scaled.vsep_wide; } /* Draw total profit/loss */ - y += EXP_LINESPACE; + y += WidgetDimensions::scaled.vsep_normal; DrawString(r.left, r.right, y, STR_FINANCES_NET_PROFIT, TC_FROMSTRING, SA_LEFT); } @@ -243,7 +239,7 @@ static Money DrawYearCategory (const Rect &r, int start_y, ExpensesList list, co /* Draw the total at the bottom of the category. */ GfxFillRect(r.left, y, r.right, y, PC_BLACK); - y += EXP_LINESPACE; + y += WidgetDimensions::scaled.vsep_normal; if (sum != 0) DrawPrice(sum, r.left, r.right, y, TC_WHITE); /* Return the sum for the yearly total. */ @@ -266,19 +262,19 @@ static void DrawYearColumn(const Rect &r, int year, const Money (*tbl)[EXPENSES_ /* Year header */ SetDParam(0, year); DrawString(r.left, r.right, y, STR_FINANCES_YEAR, TC_FROMSTRING, SA_RIGHT, true); - y += FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE; + y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_wide; /* Categories */ for (uint i = 0; i < lengthof(_expenses_list_types); i++) { y += FONT_HEIGHT_NORMAL; sum += DrawYearCategory(r, y, _expenses_list_types[i], tbl); /* Expense list + expense category title + expense category total + blockspace after category */ - y += _expenses_list_types[i].GetHeight() + EXP_LINESPACE + FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE; + y += _expenses_list_types[i].GetHeight() + WidgetDimensions::scaled.vsep_normal + FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_wide; } /* Total income. */ GfxFillRect(r.left, y, r.right, y, PC_BLACK); - y += EXP_LINESPACE; + y += WidgetDimensions::scaled.vsep_normal; DrawPrice(sum, r.left, r.right, y, TC_WHITE); } @@ -2002,7 +1998,7 @@ struct CompanyInfrastructureWindow : Window /* Set height of the total line. */ if (widget == WID_CI_TOTAL) { - size->height = _settings_game.economy.infrastructure_maintenance ? std::max(size->height, EXP_LINESPACE + FONT_HEIGHT_NORMAL) : 0; + size->height = _settings_game.economy.infrastructure_maintenance ? std::max(size->height, WidgetDimensions::scaled.vsep_normal + FONT_HEIGHT_NORMAL) : 0; } break; } @@ -2108,7 +2104,7 @@ struct CompanyInfrastructureWindow : Window if (_settings_game.economy.infrastructure_maintenance) { Rect tr = r.WithWidth(this->total_width, _current_text_dir == TD_RTL); GfxFillRect(tr.left, y, tr.right, y, PC_WHITE); - y += EXP_LINESPACE; + y += WidgetDimensions::scaled.vsep_normal; SetDParam(0, this->GetTotalMaintenanceCost() * 12); // Convert to per year DrawString(tr.left, tr.right, y, STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL, TC_FROMSTRING, SA_RIGHT); } diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 4ef92dbe6e..162a8b11a2 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1507,8 +1507,6 @@ private: std::map>> buttons; ///< Per line which buttons are available. - static const int CLIENT_OFFSET_LEFT = 12; ///< Offset of client entries compared to company entries. - /** * Chat button on a Company is clicked. * @param w The instance of this window. @@ -1851,7 +1849,7 @@ public: uint text_right = matrix.right - (rtl ? d.width + WidgetDimensions::scaled.hsep_wide : 0); Dimension d2 = GetSpriteSize(SPR_PLAYER_SELF); - uint offset_x = CLIENT_OFFSET_LEFT - d2.width - ScaleGUITrad(3); + uint offset_x = WidgetDimensions::scaled.hsep_indent - d2.width - ScaleGUITrad(3); uint player_icon_x = rtl ? text_right - offset_x - d2.width : text_left + offset_x; diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 5d09cf1b7f..89b8d08573 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -728,7 +728,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { switch (widget) { case WID_NS_FILE_LIST: { - Dimension d = maxdim(GetSpriteSize(SPR_SQUARE), GetSpriteSize(SPR_WARNING_SIGN)); + Dimension d = maxdim(GetScaledSpriteSize(SPR_SQUARE), GetScaledSpriteSize(SPR_WARNING_SIGN)); resize->height = std::max(d.height + 2U, FONT_HEIGHT_NORMAL); size->height = std::max(size->height, padding.height + 6 * resize->height); break; @@ -736,7 +736,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { case WID_NS_AVAIL_LIST: { - Dimension d = maxdim(GetSpriteSize(SPR_SQUARE), GetSpriteSize(SPR_WARNING_SIGN)); + Dimension d = maxdim(GetScaledSpriteSize(SPR_SQUARE), GetScaledSpriteSize(SPR_WARNING_SIGN)); resize->height = std::max(d.height + 2U, FONT_HEIGHT_NORMAL); size->height = std::max(size->height, padding.height + 8 * resize->height); break; diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 4f18a5d455..cd53aaf7d9 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -1159,7 +1159,7 @@ struct MessageHistoryWindow : Window { /* Months are off-by-one, so it's actually 8. Not using * month 12 because the 1 is usually less wide. */ SetDParam(0, ConvertYMDToDate(ORIGINAL_MAX_YEAR, 7, 30)); - this->date_width = GetStringBoundingBox(STR_SHORT_DATE).width + ScaleGUITrad(5); + this->date_width = GetStringBoundingBox(STR_SHORT_DATE).width + WidgetDimensions::scaled.hsep_wide; size->height = 4 * resize->height + WidgetDimensions::scaled.framerect.Vertical(); // At least 4 lines are visible. size->width = std::max(200u, size->width); // At least 200 pixels wide. diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 3b03ef17b8..b5e31f7f4f 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -789,7 +789,6 @@ void ShowGameOptions() } static int SETTING_HEIGHT = 11; ///< Height of a single setting in the tree view in pixels -static const int LEVEL_WIDTH = 15; ///< Indenting width of a sub-page in pixels /** * Flags for #SettingEntry diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index f4fdf0013f..67aec0e430 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1227,7 +1227,7 @@ void SmallMapWindow::RebuildColourIndexIfNecessary() bool rtl = _current_text_dir == TD_RTL; uint i = 0; // Row counter for industry legend. uint row_height = FONT_HEIGHT_SMALL; - int padding = ScaleGUITrad(1); + int padding = WidgetDimensions::scaled.hsep_normal; Rect origin = r.WithWidth(this->column_width, rtl).Shrink(WidgetDimensions::scaled.framerect).WithHeight(row_height); Rect text = origin.Indent(this->legend_width + WidgetDimensions::scaled.hsep_normal, rtl); diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 512f025a48..82575909c5 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -1762,7 +1762,7 @@ struct StationViewWindow : public Window { } bool rtl = _current_text_dir == TD_RTL; - Rect text = r.Indent(column * this->expand_shrink_width, rtl).Indent(this->expand_shrink_width, !rtl); + Rect text = r.Indent(column * WidgetDimensions::scaled.hsep_indent, rtl).Indent(this->expand_shrink_width, !rtl); Rect shrink = r.WithWidth(this->expand_shrink_width, !rtl); DrawString(text.left, text.right, y, str); @@ -1840,7 +1840,7 @@ struct StationViewWindow : public Window { SetDParam(1, lg != nullptr ? lg->Monthly((*lg)[ge->node].Supply()) : 0); SetDParam(2, STR_CARGO_RATING_APPALLING + (ge->rating >> 5)); SetDParam(3, ToPercent8(ge->rating)); - DrawString(tr.Indent(6, rtl), STR_STATION_VIEW_CARGO_SUPPLY_RATING); + DrawString(tr.Indent(WidgetDimensions::scaled.hsep_indent, rtl), STR_STATION_VIEW_CARGO_SUPPLY_RATING); tr.top += FONT_HEIGHT_NORMAL; } return CeilDiv(tr.top - r.top - WidgetDimensions::scaled.framerect.top, FONT_HEIGHT_NORMAL); diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 4c9a8b0216..d13bbb051e 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -182,7 +182,6 @@ struct CargoSummaryItem { static const uint TRAIN_DETAILS_MIN_INDENT = 32; ///< Minimum indent level in the train details window static const uint TRAIN_DETAILS_MAX_INDENT = 72; ///< Maximum indent level in the train details window; wider than this and we start on a new line -static const int TRAIN_DETAILS_LIST_INDENT = 10; ///< Indent for list items in the Total Cargo window /** Container for the cargo summary information. */ typedef std::vector CargoSummary; @@ -454,7 +453,7 @@ void DrawTrainDetails(const Train *v, const Rect &r, int vscroll_pos, uint16 vsc y += line_height; /* Indent the total cargo capacity details */ - Rect ir = r.Indent(TRAIN_DETAILS_LIST_INDENT, rtl); + Rect ir = r.Indent(WidgetDimensions::scaled.hsep_indent, rtl); for (CargoID i = 0; i < NUM_CARGO; i++) { if (max_cargo[i] > 0 && --vscroll_pos < 0 && vscroll_pos > -vscroll_cap) { SetDParam(0, i); // {CARGO} #1 From ecb5393c55507fc9211522c323591e36abd46913 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 4 Nov 2022 12:32:59 +0000 Subject: [PATCH 09/42] Change: Standardize progress bar layout. Progress bars are drawn differently depending on when it was added, with different layouts and sizes. This change adds a standard padding size to use, and makes all progress bars visually similar, with scaled padding. --- src/bootstrap_gui.cpp | 7 +- src/genworld_gui.cpp | 14 ++-- src/network/network_content_gui.cpp | 84 +++++++++++-------- src/network/network_content_gui.h | 1 + src/network/network_gui.cpp | 121 +++++++++++++++------------ src/newgrf_gui.cpp | 20 ++--- src/widget.cpp | 2 + src/widgets/network_content_widget.h | 5 +- src/widgets/network_widget.h | 5 +- src/window_gui.h | 1 + 10 files changed, 148 insertions(+), 112 deletions(-) diff --git a/src/bootstrap_gui.cpp b/src/bootstrap_gui.cpp index beab480d0b..a1ae02acf6 100644 --- a/src/bootstrap_gui.cpp +++ b/src/bootstrap_gui.cpp @@ -123,8 +123,11 @@ public: /** Nested widgets for the download window. */ static const NWidgetPart _nested_bootstrap_download_status_window_widgets[] = { NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), - NWidget(WWT_PANEL, COLOUR_GREY, WID_NCDS_BACKGROUND), - NWidget(NWID_SPACER), SetMinimalSize(350, 0), SetMinimalTextLines(3, WidgetDimensions::unscaled.framerect.Vertical() + 30), + NWidget(WWT_PANEL, COLOUR_GREY), + NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.modalpopup), + NWidget(WWT_EMPTY, INVALID_COLOUR, WID_NCDS_PROGRESS_BAR), SetFill(1, 0), + NWidget(WWT_EMPTY, INVALID_COLOUR, WID_NCDS_PROGRESS_TEXT), SetFill(1, 0), SetMinimalSize(350, 0), + EndContainer(), EndContainer(), }; diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index bc35ede3ae..042c98260c 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -1322,12 +1322,10 @@ void ShowCreateScenario() static const NWidgetPart _nested_generate_progress_widgets[] = { NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GENERATION_WORLD, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_PANEL, COLOUR_GREY), - NWidget(NWID_HORIZONTAL), SetPIP(20, 0, 20), - NWidget(NWID_VERTICAL), SetPIP(11, 8, 11), - NWidget(WWT_EMPTY, INVALID_COLOUR, WID_GP_PROGRESS_BAR), SetFill(1, 0), - NWidget(WWT_EMPTY, INVALID_COLOUR, WID_GP_PROGRESS_TEXT), SetFill(1, 0), - NWidget(WWT_TEXTBTN, COLOUR_WHITE, WID_GP_ABORT), SetDataTip(STR_GENERATION_ABORT, STR_NULL), SetFill(1, 0), - EndContainer(), + NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.modalpopup), + NWidget(WWT_EMPTY, INVALID_COLOUR, WID_GP_PROGRESS_BAR), SetFill(1, 0), + NWidget(WWT_EMPTY, INVALID_COLOUR, WID_GP_PROGRESS_TEXT), SetFill(1, 0), + NWidget(WWT_TEXTBTN, COLOUR_WHITE, WID_GP_ABORT), SetDataTip(STR_GENERATION_ABORT, STR_NULL), SetFill(1, 0), EndContainer(), EndContainer(), }; @@ -1424,11 +1422,11 @@ struct GenerateProgressWindow : public Window { switch (widget) { case WID_GP_PROGRESS_BAR: { /* Draw the % complete with a bar and a text */ - DrawFrameRect(r, COLOUR_GREY, FR_BORDERONLY); + DrawFrameRect(r, COLOUR_GREY, FR_BORDERONLY | FR_LOWERED); Rect br = r.Shrink(WidgetDimensions::scaled.bevel); DrawFrameRect(br.WithWidth(br.Width() * _gws.percent / 100, false), COLOUR_MAUVE, FR_NONE); SetDParam(0, _gws.percent); - DrawString(r.left, r.right, CenterBounds(r.top, r.bottom, FONT_HEIGHT_NORMAL), STR_GENERATION_PROGRESS, TC_FROMSTRING, SA_HOR_CENTER); + DrawString(br.left, br.right, CenterBounds(br.top, br.bottom, FONT_HEIGHT_NORMAL), STR_GENERATION_PROGRESS, TC_FROMSTRING, SA_HOR_CENTER); break; } diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index a9cadab30f..f7a812b11d 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -81,14 +81,12 @@ void ShowContentTextfileWindow(TextfileType file_type, const ContentInfo *ci) /** Nested widgets for the download window. */ static const NWidgetPart _nested_network_content_download_status_window_widgets[] = { NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), - NWidget(WWT_PANEL, COLOUR_GREY, WID_NCDS_BACKGROUND), - NWidget(NWID_SPACER), SetMinimalSize(350, 0), SetMinimalTextLines(4, WidgetDimensions::unscaled.framerect.Vertical() + WidgetDimensions::unscaled.frametext.Vertical() * 2), - NWidget(NWID_HORIZONTAL), - NWidget(NWID_SPACER), SetMinimalSize(125, 0), - NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NCDS_CANCELOK), SetMinimalSize(101, 12), SetDataTip(STR_BUTTON_CANCEL, STR_NULL), - NWidget(NWID_SPACER), SetFill(1, 0), + NWidget(WWT_PANEL, COLOUR_GREY), + NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.modalpopup), + NWidget(WWT_EMPTY, INVALID_COLOUR, WID_NCDS_PROGRESS_BAR), SetFill(1, 0), + NWidget(WWT_EMPTY, INVALID_COLOUR, WID_NCDS_PROGRESS_TEXT), SetFill(1, 0), SetMinimalSize(350, 0), + NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NCDS_CANCELOK), SetDataTip(STR_BUTTON_CANCEL, STR_NULL), SetFill(1, 0), EndContainer(), - NWidget(NWID_SPACER), SetMinimalSize(0, 4), EndContainer(), }; @@ -115,36 +113,56 @@ void BaseNetworkContentDownloadStatusWindow::Close() this->Window::Close(); } +void BaseNetworkContentDownloadStatusWindow::UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) +{ + switch (widget) { + case WID_NCDS_PROGRESS_BAR: + SetDParamMaxDigits(0, 8); + SetDParamMaxDigits(1, 8); + SetDParamMaxDigits(2, 8); + *size = GetStringBoundingBox(STR_CONTENT_DOWNLOAD_PROGRESS_SIZE); + /* We need some spacing for the 'border' */ + size->height += WidgetDimensions::scaled.frametext.Horizontal(); + size->width += WidgetDimensions::scaled.frametext.Vertical(); + break; + + case WID_NCDS_PROGRESS_TEXT: + size->height = FONT_HEIGHT_NORMAL * 2 + WidgetDimensions::scaled.vsep_normal; + break; + } +} + void BaseNetworkContentDownloadStatusWindow::DrawWidget(const Rect &r, int widget) const { - if (widget != WID_NCDS_BACKGROUND) return; + switch (widget) { + case WID_NCDS_PROGRESS_BAR: { + /* Draw the % complete with a bar and a text */ + DrawFrameRect(r, COLOUR_GREY, FR_BORDERONLY | FR_LOWERED); + Rect ir = r.Shrink(WidgetDimensions::scaled.bevel); + DrawFrameRect(ir.WithWidth((uint64)ir.Width() * this->downloaded_bytes / this->total_bytes, false), COLOUR_MAUVE, FR_NONE); + SetDParam(0, this->downloaded_bytes); + SetDParam(1, this->total_bytes); + SetDParam(2, this->downloaded_bytes * 100LL / this->total_bytes); + DrawString(ir.left, ir.right, CenterBounds(ir.top, ir.bottom, FONT_HEIGHT_NORMAL), STR_CONTENT_DOWNLOAD_PROGRESS_SIZE, TC_FROMSTRING, SA_HOR_CENTER); + break; + } - Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); - int y = ir.top + WidgetDimensions::scaled.frametext.top; - - /* Draw nice progress bar :) */ - DrawFrameRect(ir.left, y, ir.left + (int)((ir.Width() - 1LL) * this->downloaded_bytes / this->total_bytes), y + FONT_HEIGHT_NORMAL - 1, COLOUR_MAUVE, FR_NONE); - - y += WidgetDimensions::scaled.frametext.bottom + FONT_HEIGHT_NORMAL; - SetDParam(0, this->downloaded_bytes); - SetDParam(1, this->total_bytes); - SetDParam(2, this->downloaded_bytes * 100LL / this->total_bytes); - DrawString(ir.left, ir.right, y, STR_CONTENT_DOWNLOAD_PROGRESS_SIZE, TC_FROMSTRING, SA_HOR_CENTER); - - StringID str; - if (this->downloaded_bytes == this->total_bytes) { - str = STR_CONTENT_DOWNLOAD_COMPLETE; - } else if (!this->name.empty()) { - SetDParamStr(0, this->name); - SetDParam(1, this->downloaded_files); - SetDParam(2, this->total_files); - str = STR_CONTENT_DOWNLOAD_FILE; - } else { - str = STR_CONTENT_DOWNLOAD_INITIALISE; + case WID_NCDS_PROGRESS_TEXT: { + StringID str; + if (this->downloaded_bytes == this->total_bytes) { + str = STR_CONTENT_DOWNLOAD_COMPLETE; + } else if (!this->name.empty()) { + SetDParamStr(0, this->name); + SetDParam(1, this->downloaded_files); + SetDParam(2, this->total_files); + str = STR_CONTENT_DOWNLOAD_FILE; + } else { + str = STR_CONTENT_DOWNLOAD_INITIALISE; + } + DrawStringMultiLine(r, str, TC_FROMSTRING, SA_CENTER); + break; + } } - - y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.frametext.top; - DrawStringMultiLine(ir.left, ir.right, y, y + FONT_HEIGHT_NORMAL * 2, str, TC_FROMSTRING, SA_CENTER); } void BaseNetworkContentDownloadStatusWindow::OnDownloadProgress(const ContentInfo *ci, int bytes) diff --git a/src/network/network_content_gui.h b/src/network/network_content_gui.h index 54fbcc36b3..570f15462f 100644 --- a/src/network/network_content_gui.h +++ b/src/network/network_content_gui.h @@ -33,6 +33,7 @@ public: BaseNetworkContentDownloadStatusWindow(WindowDesc *desc); void Close() override; + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override; void DrawWidget(const Rect &r, int widget) const override; void OnDownloadProgress(const ContentInfo *ci, int bytes) override; }; diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 162a8b11a2..cc9adaa01a 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -2166,64 +2166,79 @@ struct NetworkJoinStatusWindow : Window { void DrawWidget(const Rect &r, int widget) const override { - if (widget != WID_NJS_BACKGROUND) return; + switch (widget) { + case WID_NJS_PROGRESS_BAR: { + /* Draw the % complete with a bar and a text */ + DrawFrameRect(r, COLOUR_GREY, FR_BORDERONLY | FR_LOWERED); + Rect ir = r.Shrink(WidgetDimensions::scaled.bevel); + uint8 progress; // used for progress bar + switch (_network_join_status) { + case NETWORK_JOIN_STATUS_CONNECTING: + case NETWORK_JOIN_STATUS_AUTHORIZING: + case NETWORK_JOIN_STATUS_GETTING_COMPANY_INFO: + progress = 10; // first two stages 10% + break; + case NETWORK_JOIN_STATUS_WAITING: + progress = 15; // third stage is 15% + break; + case NETWORK_JOIN_STATUS_DOWNLOADING: + if (_network_join_bytes_total == 0) { + progress = 15; // We don't have the final size yet; the server is still compressing! + break; + } + FALLTHROUGH; - Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); - - uint8 progress; // used for progress bar - DrawString(ir.left, ir.right, ir.top + 20, STR_NETWORK_CONNECTING_1 + _network_join_status, TC_FROMSTRING, SA_HOR_CENTER); - switch (_network_join_status) { - case NETWORK_JOIN_STATUS_CONNECTING: case NETWORK_JOIN_STATUS_AUTHORIZING: - case NETWORK_JOIN_STATUS_GETTING_COMPANY_INFO: - progress = 10; // first two stages 10% - break; - case NETWORK_JOIN_STATUS_WAITING: - SetDParam(0, _network_join_waiting); - DrawString(ir.left, ir.right, ir.top + 20 + FONT_HEIGHT_NORMAL, STR_NETWORK_CONNECTING_WAITING, TC_FROMSTRING, SA_HOR_CENTER); - progress = 15; // third stage is 15% - break; - case NETWORK_JOIN_STATUS_DOWNLOADING: - SetDParam(0, _network_join_bytes); - SetDParam(1, _network_join_bytes_total); - DrawString(ir.left, ir.right, ir.top + 20 + FONT_HEIGHT_NORMAL, _network_join_bytes_total == 0 ? STR_NETWORK_CONNECTING_DOWNLOADING_1 : STR_NETWORK_CONNECTING_DOWNLOADING_2, TC_FROMSTRING, SA_HOR_CENTER); - if (_network_join_bytes_total == 0) { - progress = 15; // We don't have the final size yet; the server is still compressing! - break; + default: // Waiting is 15%, so the resting receivement of map is maximum 70% + progress = 15 + _network_join_bytes * (100 - 15) / _network_join_bytes_total; + break; } - FALLTHROUGH; + DrawFrameRect(ir.WithWidth(ir.Width() * progress / 100, false), COLOUR_MAUVE, FR_NONE); + DrawString(ir.left, ir.right, CenterBounds(ir.top, ir.bottom, FONT_HEIGHT_NORMAL), STR_NETWORK_CONNECTING_1 + _network_join_status, TC_FROMSTRING, SA_HOR_CENTER); + break; + } - default: // Waiting is 15%, so the resting receivement of map is maximum 70% - progress = 15 + _network_join_bytes * (100 - 15) / _network_join_bytes_total; + case WID_NJS_PROGRESS_TEXT: + switch (_network_join_status) { + case NETWORK_JOIN_STATUS_WAITING: + SetDParam(0, _network_join_waiting); + DrawStringMultiLine(r, STR_NETWORK_CONNECTING_WAITING, TC_FROMSTRING, SA_CENTER); + break; + case NETWORK_JOIN_STATUS_DOWNLOADING: + SetDParam(0, _network_join_bytes); + SetDParam(1, _network_join_bytes_total); + DrawStringMultiLine(r, _network_join_bytes_total == 0 ? STR_NETWORK_CONNECTING_DOWNLOADING_1 : STR_NETWORK_CONNECTING_DOWNLOADING_2, TC_FROMSTRING, SA_CENTER); + break; + default: + break; + } + break; } - - /* Draw nice progress bar :) */ - DrawFrameRect(r.left + 20, r.top + 5, (int)((this->width - 20) * progress / 100), r.top + 15, COLOUR_MAUVE, FR_NONE); } void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { - if (widget != WID_NJS_BACKGROUND) return; + switch (widget) { + case WID_NJS_PROGRESS_BAR: + /* Account for the statuses */ + for (uint i = 0; i < NETWORK_JOIN_STATUS_END; i++) { + *size = maxdim(*size, GetStringBoundingBox(STR_NETWORK_CONNECTING_1 + i)); + } + /* For the number of waiting (other) players */ + SetDParamMaxValue(0, MAX_CLIENTS); + *size = maxdim(*size, GetStringBoundingBox(STR_NETWORK_CONNECTING_WAITING)); + /* We need some spacing for the 'border' */ + size->height += WidgetDimensions::scaled.frametext.Horizontal(); + size->width += WidgetDimensions::scaled.frametext.Vertical(); + break; - size->height = 25 + 2 * FONT_HEIGHT_NORMAL; - - /* Account for the statuses */ - uint width = 0; - for (uint i = 0; i < NETWORK_JOIN_STATUS_END; i++) { - width = std::max(width, GetStringBoundingBox(STR_NETWORK_CONNECTING_1 + i).width); + case WID_NJS_PROGRESS_TEXT: + /* Account for downloading ~ 10 MiB */ + SetDParamMaxDigits(0, 8); + SetDParamMaxDigits(1, 8); + *size = maxdim(*size, GetStringBoundingBox(STR_NETWORK_CONNECTING_DOWNLOADING_1)); + *size = maxdim(*size, GetStringBoundingBox(STR_NETWORK_CONNECTING_DOWNLOADING_1)); + break; } - - /* For the number of waiting (other) players */ - SetDParamMaxValue(0, MAX_CLIENTS); - width = std::max(width, GetStringBoundingBox(STR_NETWORK_CONNECTING_WAITING).width); - - /* Account for downloading ~ 10 MiB */ - SetDParamMaxDigits(0, 8); - SetDParamMaxDigits(1, 8); - width = std::max(width, GetStringBoundingBox(STR_NETWORK_CONNECTING_DOWNLOADING_1).width); - width = std::max(width, GetStringBoundingBox(STR_NETWORK_CONNECTING_DOWNLOADING_2).width); - - /* Give a bit more clearing for the widest strings than strictly needed */ - size->width = width + padding.width + WidgetDimensions::scaled.hsep_indent; } void OnClick(Point pt, int widget, int click_count) override @@ -2253,13 +2268,11 @@ struct NetworkJoinStatusWindow : Window { static const NWidgetPart _nested_network_join_status_window_widgets[] = { NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_NETWORK_CONNECTING_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_PANEL, COLOUR_GREY), - NWidget(WWT_EMPTY, COLOUR_GREY, WID_NJS_BACKGROUND), - NWidget(NWID_HORIZONTAL), - NWidget(NWID_SPACER), SetMinimalSize(75, 0), SetFill(1, 0), - NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NJS_CANCELOK), SetMinimalSize(101, 12), SetDataTip(STR_NETWORK_CONNECTION_DISCONNECT, STR_NULL), - NWidget(NWID_SPACER), SetMinimalSize(75, 0), SetFill(1, 0), + NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.modalpopup), + NWidget(WWT_EMPTY, INVALID_COLOUR, WID_NJS_PROGRESS_BAR), SetFill(1, 0), + NWidget(WWT_EMPTY, INVALID_COLOUR, WID_NJS_PROGRESS_TEXT), SetFill(1, 0), SetMinimalSize(350, 0), + NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NJS_CANCELOK), SetMinimalSize(101, 12), SetDataTip(STR_NETWORK_CONNECTION_DISCONNECT, STR_NULL), SetFill(1, 0), EndContainer(), - NWidget(NWID_SPACER), SetMinimalSize(0, 4), EndContainer(), }; diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 89b8d08573..223c1e21af 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -2165,12 +2165,10 @@ static void ShowSavePresetWindow(const char *initial_text) static const NWidgetPart _nested_scan_progress_widgets[] = { NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_NEWGRF_SCAN_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_PANEL, COLOUR_GREY), - NWidget(NWID_HORIZONTAL), SetPIP(20, 0, 20), - NWidget(NWID_VERTICAL), SetPIP(11, 8, 11), - NWidget(WWT_LABEL, INVALID_COLOUR), SetDataTip(STR_NEWGRF_SCAN_MESSAGE, STR_NULL), SetFill(1, 0), - NWidget(WWT_EMPTY, INVALID_COLOUR, WID_SP_PROGRESS_BAR), SetFill(1, 0), - NWidget(WWT_EMPTY, INVALID_COLOUR, WID_SP_PROGRESS_TEXT), SetFill(1, 0), - EndContainer(), + NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.modalpopup), + NWidget(WWT_LABEL, INVALID_COLOUR), SetDataTip(STR_NEWGRF_SCAN_MESSAGE, STR_NULL), SetFill(1, 0), + NWidget(WWT_EMPTY, INVALID_COLOUR, WID_SP_PROGRESS_BAR), SetFill(1, 0), + NWidget(WWT_EMPTY, INVALID_COLOUR, WID_SP_PROGRESS_TEXT), SetFill(1, 0), SetMinimalSize(400, 0), EndContainer(), EndContainer(), }; @@ -2207,8 +2205,8 @@ struct ScanProgressWindow : public Window { SetDParamMaxValue(0, 100); *size = GetStringBoundingBox(STR_GENERATION_PROGRESS); /* We need some spacing for the 'border' */ - size->height += 8; - size->width += 8; + size->height += WidgetDimensions::scaled.frametext.Horizontal(); + size->width += WidgetDimensions::scaled.frametext.Vertical(); break; } @@ -2217,7 +2215,7 @@ struct ScanProgressWindow : public Window { SetDParamMaxDigits(1, 4); /* We really don't know the width. We could determine it by scanning the NewGRFs, * but this is the status window for scanning them... */ - size->width = std::max(400U, GetStringBoundingBox(STR_NEWGRF_SCAN_STATUS).width); + size->width = std::max(size->width, GetStringBoundingBox(STR_NEWGRF_SCAN_STATUS).width); size->height = FONT_HEIGHT_NORMAL * 2 + WidgetDimensions::scaled.vsep_normal; break; } @@ -2228,10 +2226,10 @@ struct ScanProgressWindow : public Window { switch (widget) { case WID_SP_PROGRESS_BAR: { /* Draw the % complete with a bar and a text */ - DrawFrameRect(r.left, r.top, r.right, r.bottom, COLOUR_GREY, FR_BORDERONLY); + DrawFrameRect(r, COLOUR_GREY, FR_BORDERONLY | FR_LOWERED); Rect ir = r.Shrink(WidgetDimensions::scaled.bevel); uint percent = scanned * 100 / std::max(1U, _settings_client.gui.last_newgrf_count); - DrawFrameRect(ir.left, ir.top, ir.left + (ir.Width() - 1) * percent / 100, ir.bottom, COLOUR_MAUVE, FR_NONE); + DrawFrameRect(ir.WithWidth(ir.Width() * percent / 100, false), COLOUR_MAUVE, FR_NONE); SetDParam(0, percent); DrawString(ir.left, ir.right, CenterBounds(ir.top, ir.bottom, FONT_HEIGHT_NORMAL), STR_GENERATION_PROGRESS, TC_FROMSTRING, SA_HOR_CENTER); break; diff --git a/src/widget.cpp b/src/widget.cpp index eaf62f63e3..df50dadb72 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -149,6 +149,7 @@ const WidgetDimensions WidgetDimensions::unscaled = { {WD_CLOSEBOX_LEFT, WD_CLOSEBOX_TOP, WD_CLOSEBOX_RIGHT, WD_CLOSEBOX_BOTTOM}, ///< closebox {WD_CAPTIONTEXT_LEFT, WD_CAPTIONTEXT_TOP, WD_CAPTIONTEXT_RIGHT, WD_CAPTIONTEXT_BOTTOM}, ///< captiontext {WD_DROPDOWNTEXT_LEFT, WD_DROPDOWNTEXT_TOP, WD_DROPDOWNTEXT_RIGHT, WD_DROPDOWNTEXT_BOTTOM}, ///< dropdowntext + {20, 10, 20, 10}, ///< modalpopup 1, ///< pressed WD_PAR_VSEP_NORMAL, ///< vsep_normal WD_PAR_VSEP_WIDE, ///< vsep_wide @@ -218,6 +219,7 @@ void SetupWidgetDimensions() WidgetDimensions::scaled.closebox = ScaleGUITrad(WidgetDimensions::unscaled.closebox); WidgetDimensions::scaled.captiontext = ScaleGUITrad(WidgetDimensions::unscaled.captiontext); WidgetDimensions::scaled.dropdowntext = ScaleGUITrad(WidgetDimensions::unscaled.dropdowntext); + WidgetDimensions::scaled.modalpopup = ScaleGUITrad(WidgetDimensions::unscaled.modalpopup); WidgetDimensions::scaled.pressed = ScaleGUITrad(WidgetDimensions::unscaled.pressed); WidgetDimensions::scaled.vsep_normal = ScaleGUITrad(WidgetDimensions::unscaled.vsep_normal); diff --git a/src/widgets/network_content_widget.h b/src/widgets/network_content_widget.h index fd77f90aaf..49c8153d4a 100644 --- a/src/widgets/network_content_widget.h +++ b/src/widgets/network_content_widget.h @@ -14,8 +14,9 @@ /** Widgets of the #NetworkContentDownloadStatusWindow class. */ enum NetworkContentDownloadStatusWidgets { - WID_NCDS_BACKGROUND, ///< Background of the window. - WID_NCDS_CANCELOK, ///< (Optional) Cancel/OK button. + WID_NCDS_PROGRESS_BAR, ///< Simple progress bar. + WID_NCDS_PROGRESS_TEXT, ///< Text explaining what is happening. + WID_NCDS_CANCELOK, ///< (Optional) Cancel/OK button. }; /** Widgets of the #NetworkContentListWindow class. */ diff --git a/src/widgets/network_widget.h b/src/widgets/network_widget.h index f50bf04e93..058cb090b0 100644 --- a/src/widgets/network_widget.h +++ b/src/widgets/network_widget.h @@ -94,8 +94,9 @@ enum ClientListWidgets { /** Widgets of the #NetworkJoinStatusWindow class. */ enum NetworkJoinStatusWidgets { - WID_NJS_BACKGROUND, ///< Background of the window. - WID_NJS_CANCELOK, ///< Cancel / OK button. + WID_NJS_PROGRESS_BAR, ///< Simple progress bar. + WID_NJS_PROGRESS_TEXT, ///< Text explaining what is happening. + WID_NJS_CANCELOK, ///< Cancel / OK button. }; /** Widgets of the #NetworkCompanyPasswordWindow class. */ diff --git a/src/window_gui.h b/src/window_gui.h index 569bcf9243..4afe9563de 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -52,6 +52,7 @@ struct WidgetDimensions { RectPadding closebox; RectPadding captiontext; ///< Offsets of text within a caption. RectPadding dropdowntext; ///< Offsets of text within a dropdown widget. + RectPadding modalpopup; ///< Padding for a modal popup. int pressed; ///< Offset for contents of depressed widget. int vsep_normal; ///< Normal vertical spacing. From dff03124e5b33ebb5acdcf55da98cbe40c25d6b8 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 4 Nov 2022 12:40:32 +0000 Subject: [PATCH 10/42] Change: Use modalpopup padding for error/query windows. --- src/error_gui.cpp | 4 ++-- src/misc_gui.cpp | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/error_gui.cpp b/src/error_gui.cpp index 7d25638821..d54d0a2705 100644 --- a/src/error_gui.cpp +++ b/src/error_gui.cpp @@ -35,7 +35,7 @@ static const NWidgetPart _nested_errmsg_widgets[] = { NWidget(WWT_CAPTION, COLOUR_RED, WID_EM_CAPTION), SetDataTip(STR_ERROR_MESSAGE_CAPTION, STR_NULL), EndContainer(), NWidget(WWT_PANEL, COLOUR_RED), - NWidget(WWT_EMPTY, COLOUR_RED, WID_EM_MESSAGE), SetPadding(WidgetDimensions::unscaled.frametext), SetFill(1, 0), SetMinimalSize(236, 0), + NWidget(WWT_EMPTY, COLOUR_RED, WID_EM_MESSAGE), SetPadding(WidgetDimensions::unscaled.modalpopup), SetFill(1, 0), SetMinimalSize(236, 0), EndContainer(), }; @@ -54,7 +54,7 @@ static const NWidgetPart _nested_errmsg_face_widgets[] = { NWidget(WWT_PANEL, COLOUR_RED), NWidget(NWID_HORIZONTAL), NWidget(WWT_EMPTY, COLOUR_RED, WID_EM_FACE), SetPadding(2, 0, 2, 2), SetFill(0, 1), SetMinimalSize(92, 119), - NWidget(WWT_EMPTY, COLOUR_RED, WID_EM_MESSAGE), SetPadding(WidgetDimensions::unscaled.frametext), SetFill(1, 1), SetMinimalSize(236, 0), + NWidget(WWT_EMPTY, COLOUR_RED, WID_EM_MESSAGE), SetPadding(WidgetDimensions::unscaled.modalpopup), SetFill(1, 1), SetMinimalSize(236, 0), EndContainer(), EndContainer(), }; diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index d73348e7ab..e506ecf141 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -1229,11 +1229,13 @@ static const NWidgetPart _nested_query_widgets[] = { NWidget(WWT_CLOSEBOX, COLOUR_RED), NWidget(WWT_CAPTION, COLOUR_RED, WID_Q_CAPTION), SetDataTip(STR_JUST_STRING, STR_NULL), EndContainer(), - NWidget(WWT_PANEL, COLOUR_RED), SetPIP(8, 15, 8), - NWidget(WWT_TEXT, COLOUR_RED, WID_Q_TEXT), SetMinimalSize(200, 12), - NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(20, 29, 20), - NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_Q_NO), SetMinimalSize(71, 12), SetFill(1, 1), SetDataTip(STR_QUIT_NO, STR_NULL), - NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_Q_YES), SetMinimalSize(71, 12), SetFill(1, 1), SetDataTip(STR_QUIT_YES, STR_NULL), + NWidget(WWT_PANEL, COLOUR_RED), + NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.modalpopup), + NWidget(WWT_TEXT, COLOUR_RED, WID_Q_TEXT), SetMinimalSize(200, 12), + NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(WidgetDimensions::unscaled.hsep_indent, WidgetDimensions::unscaled.hsep_indent, WidgetDimensions::unscaled.hsep_indent), + NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_Q_NO), SetMinimalSize(71, 12), SetFill(1, 1), SetDataTip(STR_QUIT_NO, STR_NULL), + NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_Q_YES), SetMinimalSize(71, 12), SetFill(1, 1), SetDataTip(STR_QUIT_YES, STR_NULL), + EndContainer(), EndContainer(), EndContainer(), }; From ced4258969c2f1b4df7f974cf2633fa121ec38bf Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 12 Nov 2022 18:47:48 +0000 Subject: [PATCH 11/42] Update: Translations from eints english (au): 18 changes by krysclarke spanish (mexican): 23 changes by absay english (us): 18 changes by 2TallTyler korean: 33 changes by telk5093 russian: 18 changes by Ln-Wolf french: 31 changes by glx22 --- src/lang/afrikaans.txt | 10 ------ src/lang/arabic_egypt.txt | 12 ------- src/lang/basque.txt | 5 --- src/lang/belarusian.txt | 10 ------ src/lang/brazilian_portuguese.txt | 13 -------- src/lang/bulgarian.txt | 6 ---- src/lang/catalan.txt | 13 -------- src/lang/chuvash.txt | 1 - src/lang/croatian.txt | 11 ------- src/lang/czech.txt | 13 -------- src/lang/danish.txt | 13 -------- src/lang/dutch.txt | 13 -------- src/lang/english_AU.txt | 34 ++++++++++---------- src/lang/english_US.txt | 34 ++++++++++---------- src/lang/esperanto.txt | 5 --- src/lang/estonian.txt | 13 -------- src/lang/faroese.txt | 1 - src/lang/finnish.txt | 13 -------- src/lang/french.txt | 48 ++++++++++++++++++---------- src/lang/frisian.txt | 11 ------- src/lang/gaelic.txt | 6 ---- src/lang/galician.txt | 13 -------- src/lang/german.txt | 13 -------- src/lang/greek.txt | 13 -------- src/lang/hebrew.txt | 6 ---- src/lang/hindi.txt | 2 -- src/lang/hungarian.txt | 13 -------- src/lang/icelandic.txt | 1 - src/lang/ido.txt | 1 - src/lang/indonesian.txt | 13 -------- src/lang/irish.txt | 13 -------- src/lang/italian.txt | 13 -------- src/lang/japanese.txt | 13 -------- src/lang/korean.txt | 52 ++++++++++++++++++++----------- src/lang/latin.txt | 11 ------- src/lang/latvian.txt | 13 -------- src/lang/lithuanian.txt | 13 -------- src/lang/luxembourgish.txt | 13 -------- src/lang/macedonian.txt | 1 - src/lang/malay.txt | 6 ---- src/lang/maltese.txt | 1 - src/lang/marathi.txt | 1 - src/lang/norwegian_bokmal.txt | 13 -------- src/lang/norwegian_nynorsk.txt | 6 ---- src/lang/persian.txt | 2 -- src/lang/polish.txt | 13 -------- src/lang/portuguese.txt | 13 -------- src/lang/romanian.txt | 13 -------- src/lang/russian.txt | 34 ++++++++++---------- src/lang/serbian.txt | 13 -------- src/lang/simplified_chinese.txt | 13 -------- src/lang/slovak.txt | 13 -------- src/lang/slovenian.txt | 7 ----- src/lang/spanish.txt | 13 -------- src/lang/spanish_MX.txt | 39 +++++++++++++---------- src/lang/swedish.txt | 13 -------- src/lang/tamil.txt | 11 ------- src/lang/thai.txt | 7 ----- src/lang/traditional_chinese.txt | 13 -------- src/lang/turkish.txt | 13 -------- src/lang/ukrainian.txt | 13 -------- src/lang/urdu.txt | 1 - src/lang/vietnamese.txt | 13 -------- src/lang/welsh.txt | 6 ---- 64 files changed, 141 insertions(+), 651 deletions(-) diff --git a/src/lang/afrikaans.txt b/src/lang/afrikaans.txt index fa3d64399c..171785aa49 100644 --- a/src/lang/afrikaans.txt +++ b/src/lang/afrikaans.txt @@ -969,18 +969,8 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :ander -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK} Koppelvlak groote -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK} Kies die koppelvlak element groote om te gebruik -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normaal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dubbel groote -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Quad grootte -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Skrifgrootte - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normaal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dubbele grootte -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Quad grootte diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt index 44856677f9..90c69fbbe1 100644 --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -961,20 +961,8 @@ STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}لن ي -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}حجم اللوحة -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}حدد العنصر المطلوب -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :تقريب عادي -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :تقريب ×2 -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :تقريب ×4 -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}حجم الخط -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}حدد حجم خط الواجهة المراد استخدامه - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(كشف أوتوماتيكي) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :عادي -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :حجم مزدوج -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :حجم رباعي STR_GAME_OPTIONS_GRAPHICS :{BLACK}الرسومات diff --git a/src/lang/basque.txt b/src/lang/basque.txt index 359dbfdd62..edb10a6c78 100644 --- a/src/lang/basque.txt +++ b/src/lang/basque.txt @@ -940,11 +940,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :besteak -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Interfaze tamaina - -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normala -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Tamaina doblea -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Tamaina laukoitza diff --git a/src/lang/belarusian.txt b/src/lang/belarusian.txt index 92f47c00d2..56b069eba0 100644 --- a/src/lang/belarusian.txt +++ b/src/lang/belarusian.txt @@ -1278,18 +1278,8 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :Iншае -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Памер элементаў інтэрфейсу -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Выберыце памер элементаў інтэрфейсу -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Звычайны -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Падвоены -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Пачацвяроны -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Памер шрыфта -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Абярыце памер шрыфта, выкарыстоўванага ў гульні - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Звычайны -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Падвоены STR_GAME_OPTIONS_REFRESH_RATE :{BLACK}Чашчыня абнаўлення экрана diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index a967782048..29b49f7517 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -998,21 +998,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Marque e STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Motorista atual: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Tamanho da interface -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Selecione o tamanho de elemento de interface a ser usado -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(detecção automática) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dobro -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Quádruplo -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Tamanho da fonte -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Selecione o tamanho da fonte da interface a ser usado - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(detecção automática) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Tamanho duplo -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Tamanho quádruplo STR_GAME_OPTIONS_GRAPHICS :{BLACK}Gráficos diff --git a/src/lang/bulgarian.txt b/src/lang/bulgarian.txt index b5c12422c7..43c6f2d065 100644 --- a/src/lang/bulgarian.txt +++ b/src/lang/bulgarian.txt @@ -948,12 +948,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :друго -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Интерфейс размер -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Изберете размера на интерфейс елемент за използване - -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Нормално -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Двукратно -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Четирикратно diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index d7bd969b78..7aaf5c1ba6 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -998,21 +998,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Seleccio STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Controlador actual: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Mida de la interfície -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Escull la mida dels elements de la interfície -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(detecta automàticament) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Doble -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Quàdruple -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Mida de la lletra -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Seleccioneu la mida de les fonts de la interfície. - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(detecta automàticament) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Doble -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Quàdruple STR_GAME_OPTIONS_GRAPHICS :{BLACK}Gràfics diff --git a/src/lang/chuvash.txt b/src/lang/chuvash.txt index 771ffa1517..7832fac357 100644 --- a/src/lang/chuvash.txt +++ b/src/lang/chuvash.txt @@ -510,7 +510,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :расна - # Custom currency window diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt index 02af4cbdb8..d2ed647896 100644 --- a/src/lang/croatian.txt +++ b/src/lang/croatian.txt @@ -1071,19 +1071,8 @@ STR_GAME_OPTIONS_RESOLUTION_ITEM :{NUM}x{NUM} STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Veličina sučelja -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Odaberite koju ćete veličinu elementa sučelja koristiti -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normalno -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dvostruka veličina -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Četvorostruka veličina -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Veličina fonta -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Odaberite veličinu fonta za sučelje - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normalno -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dvostruka veličina -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Četvorostruka veličina diff --git a/src/lang/czech.txt b/src/lang/czech.txt index f4daa78ba9..d820cd2059 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -1084,21 +1084,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Zaškrtn STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Aktuální ovladač: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Velikost rozhraní -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Zvolit velikost prvků uživatelského rozhraní -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(zjistit automaticky) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normální -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dvojnásobná velikost -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Čtyřnásobná velikost -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Velikost písma -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Zvolit velikost písma - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(zjistit automaticky) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Běžné -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dvojnásobná velikost -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Čtyřnásobná velikost STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafiky diff --git a/src/lang/danish.txt b/src/lang/danish.txt index 385cad9452..38fd8ad873 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -996,21 +996,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Afmærk dette felt for at v-synkronisere skærmen. Ændringer af indstillingen er først effektiv efter spillet er genstartet. Fungerer kun med hardware-acceleration aktiveret. -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}grænseflade størrelse -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Vælg den grænseflade størrelse du ønsker at benytte -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(auto-bestem) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dobbelt størrelse -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Quad (4x) størrelse -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Skriftstørrelse -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Vælg skriftstørrelsen du ønsker i grænsefladen - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(auto-bestem) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dobbelt størrelse -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Quad (4x) størrelse STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafik diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index 2059d68ff2..505d040e72 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -1006,21 +1006,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Selectee STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Huidige driver: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Formaat bedieningselementen -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Selecteer de grootte van bedieningselementen -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(automatische detectie) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normaal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dubbele grootte -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :4x Grootte -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Lettergrootte -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Selecteer de grootte van de letters - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(automatische detectie) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normaal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dubbele grootte -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Viervoudige grootte STR_GAME_OPTIONS_GRAPHICS :{BLACK}Weergave diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index 6ddd6f320b..d1df237513 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -404,6 +404,8 @@ STR_SCENEDIT_FILE_MENU_QUIT :Exit ###length 15 STR_SETTINGS_MENU_GAME_OPTIONS :Game options STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :Settings +STR_SETTINGS_MENU_AI_SETTINGS :AI settings +STR_SETTINGS_MENU_GAMESCRIPT_SETTINGS :Game script settings STR_SETTINGS_MENU_NEWGRF_SETTINGS :NewGRF settings STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Transparency options STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Town names displayed @@ -1006,21 +1008,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Check th STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Current driver: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Interface size -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Select the interface element size to use -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(auto-detect) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Double size -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Quad size -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Font size -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Select the interface font size to use - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(auto-detect) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Double size -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Quad size STR_GAME_OPTIONS_GRAPHICS :{BLACK}Graphics @@ -2067,6 +2056,8 @@ STR_INTRO_HIGHSCORE :{BLACK}Highscor STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Settings STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF Settings STR_INTRO_ONLINE_CONTENT :{BLACK}Check Online Content +STR_INTRO_AI_SETTINGS :{BLACK}AI Settings +STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}Game Script Settings STR_INTRO_QUIT :{BLACK}Exit STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Start a new game. Ctrl+Click skips map configuration @@ -2086,6 +2077,8 @@ STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Display STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Display settings STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Display NewGRF settings STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Check for new and updated content to download +STR_INTRO_TOOLTIP_AI_SETTINGS :{BLACK}Display AI settings +STR_INTRO_TOOLTIP_GAMESCRIPT_SETTINGS :{BLACK}Display Game script settings STR_INTRO_TOOLTIP_QUIT :{BLACK}Exit 'OpenTTD' STR_INTRO_BASESET :{BLACK}The currently selected base graphics set is missing {NUM} sprite{P "" s}. Please check for updates for the baseset. @@ -3145,6 +3138,12 @@ STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}Rivers: STR_MAPGEN_SMOOTHNESS :{BLACK}Smoothness: STR_MAPGEN_VARIETY :{BLACK}Variety distribution: STR_MAPGEN_GENERATE :{WHITE}Generate +STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}NewGRF Settings +STR_MAPGEN_NEWGRF_SETTINGS_TOOLTIP :{BLACK}Display NewGRF settings +STR_MAPGEN_AI_SETTINGS :{BLACK}AI Settings +STR_MAPGEN_AI_SETTINGS_TOOLTIP :{BLACK}Display AI settings +STR_MAPGEN_GS_SETTINGS :{BLACK}Game Script Settings +STR_MAPGEN_GS_SETTINGS_TOOLTIP :{BLACK}Display game script settings ###length 21 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH :English (Original) @@ -4546,6 +4545,8 @@ STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}One of t STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}AI / GameScript Debug window is only available for the server # AI configuration window +STR_AI_CONFIG_CAPTION_AI :{WHITE}AI Configuration +STR_AI_CONFIG_CAPTION_GAMESCRIPT :{WHITE}Game Script Configuration STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}The Game Script that will be loaded in the next game STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}The AIs that will be loaded in the next game STR_AI_CONFIG_HUMAN_PLAYER :Human player @@ -4559,10 +4560,11 @@ STR_AI_CONFIG_MOVE_DOWN :{BLACK}Move Dow STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}Move selected AI down in the list STR_AI_CONFIG_GAMESCRIPT :{SILVER}Game Script +STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}Parameters STR_AI_CONFIG_AI :{SILVER}AIs -STR_AI_CONFIG_CHANGE_AI :AI -STR_AI_CONFIG_CHANGE_GAMESCRIPT :Game Script +STR_AI_CONFIG_CHANGE_AI :{BLACK}Select AI +STR_AI_CONFIG_CHANGE_GAMESCRIPT :{BLACK}Select Game Script STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Load another script STR_AI_CONFIG_CONFIGURE :{BLACK}Configure STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}Configure the parameters of the Script @@ -4591,7 +4593,7 @@ STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Heightma STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Minimap screenshot # AI Parameters -STR_AI_SETTINGS_CAPTION_AI :AI +STR_AI_SETTINGS_CAPTION_AI :{WHITE}AI Parameters STR_AI_SETTINGS_CLOSE :{BLACK}Close STR_AI_SETTINGS_RESET :{BLACK}Reset STR_AI_SETTINGS_SETTING :{STRING}: {ORANGE}{STRING} diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index ee8ef83539..415f5d3fd8 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -404,6 +404,8 @@ STR_SCENEDIT_FILE_MENU_QUIT :Quit ###length 15 STR_SETTINGS_MENU_GAME_OPTIONS :Game options STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :Settings +STR_SETTINGS_MENU_AI_SETTINGS :AI settings +STR_SETTINGS_MENU_GAMESCRIPT_SETTINGS :Game script settings STR_SETTINGS_MENU_NEWGRF_SETTINGS :NewGRF settings STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Transparency options STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Town names displayed @@ -1006,21 +1008,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Check th STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Current driver: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Interface size -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Select the interface element size to use -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(auto-detect) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Double size -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Quad size -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Font size -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Select the interface font size to use - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(auto-detect) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Double size -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Quad size STR_GAME_OPTIONS_GRAPHICS :{BLACK}Graphics @@ -2067,6 +2056,8 @@ STR_INTRO_HIGHSCORE :{BLACK}Highscor STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Settings STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF Settings STR_INTRO_ONLINE_CONTENT :{BLACK}Check Online Content +STR_INTRO_AI_SETTINGS :{BLACK}AI Settings +STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}Game Script Settings STR_INTRO_QUIT :{BLACK}Quit STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Start a new game. Ctrl+Click skips map configuration @@ -2086,6 +2077,8 @@ STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Display STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Display settings STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Display NewGRF settings STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Check for new and updated content to download +STR_INTRO_TOOLTIP_AI_SETTINGS :{BLACK}Display AI settings +STR_INTRO_TOOLTIP_GAMESCRIPT_SETTINGS :{BLACK}Display Game script settings STR_INTRO_TOOLTIP_QUIT :{BLACK}Quit 'OpenTTD' STR_INTRO_BASESET :{BLACK}The currently selected base graphics set is missing {NUM} sprite{P "" s}. Please check for updates for the baseset. @@ -3145,6 +3138,12 @@ STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}Rivers: STR_MAPGEN_SMOOTHNESS :{BLACK}Smoothness: STR_MAPGEN_VARIETY :{BLACK}Variety distribution: STR_MAPGEN_GENERATE :{WHITE}Generate +STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}NewGRF Settings +STR_MAPGEN_NEWGRF_SETTINGS_TOOLTIP :{BLACK}Display NewGRF settings +STR_MAPGEN_AI_SETTINGS :{BLACK}AI Settings +STR_MAPGEN_AI_SETTINGS_TOOLTIP :{BLACK}Display AI settings +STR_MAPGEN_GS_SETTINGS :{BLACK}Game Script Settings +STR_MAPGEN_GS_SETTINGS_TOOLTIP :{BLACK}Display game script settings ###length 21 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH :English (Original) @@ -4546,6 +4545,8 @@ STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}One of t STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}AI/Game Script Debug window is only available for the server # AI configuration window +STR_AI_CONFIG_CAPTION_AI :{WHITE}AI Configuration +STR_AI_CONFIG_CAPTION_GAMESCRIPT :{WHITE}Game Script Configuration STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}The Game Script that will be loaded in the next game STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}The AIs that will be loaded in the next game STR_AI_CONFIG_HUMAN_PLAYER :Human player @@ -4559,10 +4560,11 @@ STR_AI_CONFIG_MOVE_DOWN :{BLACK}Move Dow STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}Move selected AI down in the list STR_AI_CONFIG_GAMESCRIPT :{SILVER}Game Script +STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}Parameters STR_AI_CONFIG_AI :{SILVER}AIs -STR_AI_CONFIG_CHANGE_AI :AI -STR_AI_CONFIG_CHANGE_GAMESCRIPT :Game Script +STR_AI_CONFIG_CHANGE_AI :{BLACK}Select AI +STR_AI_CONFIG_CHANGE_GAMESCRIPT :{BLACK}Select Game Script STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Load another script STR_AI_CONFIG_CONFIGURE :{BLACK}Configure STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}Configure the parameters of the Script @@ -4591,7 +4593,7 @@ STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Heightma STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Minimap screenshot # AI Parameters -STR_AI_SETTINGS_CAPTION_AI :AI +STR_AI_SETTINGS_CAPTION_AI :{WHITE}AI Parameters STR_AI_SETTINGS_CLOSE :{BLACK}Close STR_AI_SETTINGS_RESET :{BLACK}Reset STR_AI_SETTINGS_SETTING :{STRING}: {ORANGE}{STRING} diff --git a/src/lang/esperanto.txt b/src/lang/esperanto.txt index 3b5a5414ca..c7403be55b 100644 --- a/src/lang/esperanto.txt +++ b/src/lang/esperanto.txt @@ -932,11 +932,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :alia -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Interfacgrandeco - -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normala -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Duobla grandeco -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Kvaroble grandeco diff --git a/src/lang/estonian.txt b/src/lang/estonian.txt index 9c46235a62..294ac31447 100644 --- a/src/lang/estonian.txt +++ b/src/lang/estonian.txt @@ -1045,21 +1045,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Märgi, et ekraani v-sync sisse lülitada. Seade kohaldub alles pärast mängu taaskäivitust. Töötab vaid, kui riistvarakiirendus on peal -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Liidese suurus -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Vali kasutatav liideseelementide suurus -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(automaattuvastus) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Tavaline -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Topeltsuurus -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Neljakordne suurus -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Kirja suurus -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Vali kasutatav liideseelementide suurus - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(automaattuvastus) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Tavaline -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Topeltsuurus -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Neljakordne suurus STR_GAME_OPTIONS_GRAPHICS :{BLACK}Graafika diff --git a/src/lang/faroese.txt b/src/lang/faroese.txt index e6bdbbb1de..de06ab374e 100644 --- a/src/lang/faroese.txt +++ b/src/lang/faroese.txt @@ -925,7 +925,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :annað - STR_GAME_OPTIONS_BASE_GRF :{BLACK}Base grafikk sett STR_GAME_OPTIONS_BASE_GRF_TOOLTIP :{BLACK}Vel ta base grafikk setti tú vil brúka STR_GAME_OPTIONS_BASE_GRF_STATUS :{RED}{NUM} vantandi/oyðiløgd fíl{P a ir} diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index db84fe79c0..113c7b8d33 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -997,21 +997,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Valitse STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Nykyinen ajuri: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Käyttöliittymän koko -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Valitse käyttöliittymäelementtien koko -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(tunnista automaattisesti) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Tavallinen -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Kaksinkertainen -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Nelinkertainen -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Kirjasinkoko -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Valitse käyttöliittymän kirjasinkoko - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(tunnista automaattisesti) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normaali -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Kaksinkertainen koko -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Nelinkertainen koko STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafiikka diff --git a/src/lang/french.txt b/src/lang/french.txt index 51671cd917..433def32a3 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -201,6 +201,15 @@ STR_UNITS_POWER_IMPERIAL :{COMMA}{NBSP}hp STR_UNITS_POWER_METRIC :{COMMA}{NBSP}ch STR_UNITS_POWER_SI :{COMMA}{NBSP}kW +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg +STR_UNITS_POWER_METRIC_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg +STR_UNITS_POWER_SI_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_SI :{DECIMAL}{NBSP}W/kg STR_UNITS_WEIGHT_SHORT_IMPERIAL :{G=f}{COMMA}{NBSP}t STR_UNITS_WEIGHT_SHORT_METRIC :{G=f}{COMMA}{NBSP}t @@ -396,6 +405,8 @@ STR_SCENEDIT_FILE_MENU_QUIT :Quitter ###length 15 STR_SETTINGS_MENU_GAME_OPTIONS :Options du Jeu STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :Paramètres +STR_SETTINGS_MENU_AI_SETTINGS :Configuration des IAs +STR_SETTINGS_MENU_GAMESCRIPT_SETTINGS :Configuration du script de jeu STR_SETTINGS_MENU_NEWGRF_SETTINGS :Paramètres NewGRF STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Options de transparence STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Afficher le nom des villes @@ -998,21 +1009,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Cochez c STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Pilote actif{NBSP}: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Taille d'interface -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Choisir la taille d'élément d'interface à utiliser -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(auto-détection) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Taille double -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Taille quadruple -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Taille de police -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Choisir la taille de police d'interface à utiliser - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(auto-détection) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Taille double -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Taille quadruple STR_GAME_OPTIONS_GRAPHICS :{BLACK} Graphiques @@ -2059,6 +2057,8 @@ STR_INTRO_HIGHSCORE :{BLACK}Meilleur STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Paramètres STR_INTRO_NEWGRF_SETTINGS :{BLACK}Paramètres NewGRF STR_INTRO_ONLINE_CONTENT :{BLACK}Vérifier le contenu en ligne +STR_INTRO_AI_SETTINGS :{BLACK}Configuration des IAs +STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}Configuration du script de jeu STR_INTRO_QUIT :{BLACK}Quitter STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Démarrer une nouvelle partie. Ctrl-clic pour passer outre la configuration du terrain. @@ -2078,6 +2078,8 @@ STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Afficher STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Afficher les paramètres STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Afficher la configuration des NewGRF STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Vérifier les contenus nouveaux ou mis à jour téléchargeables +STR_INTRO_TOOLTIP_AI_SETTINGS :{BLACK}Afficher la configuration des IAs +STR_INTRO_TOOLTIP_GAMESCRIPT_SETTINGS :{BLACK}Afficher la configuration du script de jeu STR_INTRO_TOOLTIP_QUIT :{BLACK}Quitter OpenTTD STR_INTRO_BASESET :{BLACK}{NUM} sprite{P "" s} manque{P "" "nt"} dans les graphiques de base actuellement sélectionnés. Veuillez vérifier les mises à jours pour les graphiques de base. @@ -3137,6 +3139,12 @@ STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}Nb. de r STR_MAPGEN_SMOOTHNESS :{BLACK}Lissage{NBSP}: STR_MAPGEN_VARIETY :{BLACK}Variété de distribution{NBSP}: STR_MAPGEN_GENERATE :{WHITE}Créer +STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}Paramètres NewGRF +STR_MAPGEN_NEWGRF_SETTINGS_TOOLTIP :{BLACK}Afficher la configuration des NewGRF +STR_MAPGEN_AI_SETTINGS :{BLACK}Paramètres des IAs +STR_MAPGEN_AI_SETTINGS_TOOLTIP :{BLACK}Afficher la configuration des IAs +STR_MAPGEN_GS_SETTINGS :{BLACK}Configuration du script de jeu +STR_MAPGEN_GS_SETTINGS_TOOLTIP :{BLACK}Afficher la configuration du script de jeu ###length 21 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH :Anglais (originaux) @@ -3874,7 +3882,9 @@ STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Rayon d' STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}Type d'aéronef{NBSP}: {GOLD}{STRING} ###length 3 +STR_CARGO_TYPE_FILTER_ALL :Tous les types de cargaison STR_CARGO_TYPE_FILTER_FREIGHT :Fret +STR_CARGO_TYPE_FILTER_NONE :Aucun ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Choix du véhicule. Cliquer sur un véhicule pour obtenir des informations. Ctrl-clic pour basculer le masquage du type de véhicule @@ -4203,6 +4213,7 @@ STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Poids{NB STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Poids{NBSP}: {LTBLUE}{WEIGHT_SHORT}{BLACK} − Puissance{NBSP}: {LTBLUE}{POWER}{BLACK} − Vitesse max.{NBSP}: {LTBLUE}{VELOCITY}{BLACK} − E.T. max.{NBSP}: {LTBLUE}{FORCE} STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Profit cette année{NBSP}: {LTBLUE}{CURRENCY_LONG} (année précédente{NBSP}: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Profit cette année{NBSP}: {LTBLUE}{CURRENCY_LONG} (année précédente{NBSP}: {CURRENCY_LONG}) {BLACK}Performance min.{NBSP}: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Fiabilité{NBSP}: {LTBLUE}{COMMA}{NBSP}%{BLACK} − Pannes depuis le dernier entretien{NBSP}: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE}{BLACK} − Construit en{NBSP}: {LTBLUE}{NUM}{BLACK} − Valeur{NBSP}: {LTBLUE}{CURRENCY_LONG} @@ -4529,13 +4540,15 @@ STR_AI_DEBUG_CONTINUE :{BLACK}Continue STR_AI_DEBUG_CONTINUE_TOOLTIP :{BLACK}Reprendre la partie et continuer l'IA STR_AI_DEBUG_SELECT_AI_TOOLTIP :{BLACK}Afficher la sortie de débogage de cette IA STR_AI_GAME_SCRIPT :{BLACK}Script de jeu -STR_AI_GAME_SCRIPT_TOOLTIP :{BLACK}Examiner le journal des scripts de jeu +STR_AI_GAME_SCRIPT_TOOLTIP :{BLACK}Examiner le journal du script de jeu STR_ERROR_AI_NO_AI_FOUND :Aucune IA n'a été trouvée.{}Cette IA est factice et ne fera rien.{}Vous pouvez télécharger diverses IA via le système de «{NBSP}Contenu en ligne{NBSP}». STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}L'un des scripts a rencontré un problème. Merci de rapporter ceci à l'auteur du script avec une capture d'écran de la fenêtre de débogage de scripts. STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}La fenêtre de débogage de scripts n'est disponible que pour le serveur # AI configuration window +STR_AI_CONFIG_CAPTION_AI :{WHITE}Configuration d'IA +STR_AI_CONFIG_CAPTION_GAMESCRIPT :{WHITE}Configuration du script de jeu STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}Le script de jeu qui sera chargé dans la prochaine partie STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}Les IAs qui seront chargées dans la prochaine partie STR_AI_CONFIG_HUMAN_PLAYER :Joueur humain @@ -4549,10 +4562,11 @@ STR_AI_CONFIG_MOVE_DOWN :{BLACK}Déplace STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}Déplacer l'IA sélectionnée vers le bas STR_AI_CONFIG_GAMESCRIPT :{SILVER}Script de jeu +STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}Paramètres STR_AI_CONFIG_AI :{SILVER}IA -STR_AI_CONFIG_CHANGE_AI :IA -STR_AI_CONFIG_CHANGE_GAMESCRIPT :Script de jeu +STR_AI_CONFIG_CHANGE_AI :{BLACK}Sélectionner une IA +STR_AI_CONFIG_CHANGE_GAMESCRIPT :{BLACK}Sélectionner le script de jeu STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Charger un autre script STR_AI_CONFIG_CONFIGURE :{BLACK}Configurer STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}Configurer les paramètres du script @@ -4581,7 +4595,7 @@ STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Capture STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Capture d'écran de la mini-carte # AI Parameters -STR_AI_SETTINGS_CAPTION_AI :IA +STR_AI_SETTINGS_CAPTION_AI :{WHITE}Paramètres de l'IA STR_AI_SETTINGS_CLOSE :{BLACK}Fermer STR_AI_SETTINGS_RESET :{BLACK}Réinitialiser STR_AI_SETTINGS_SETTING :{STRING}{NBSP}: {ORANGE}{STRING} diff --git a/src/lang/frisian.txt b/src/lang/frisian.txt index 6d3aab25fc..6a57d529eb 100644 --- a/src/lang/frisian.txt +++ b/src/lang/frisian.txt @@ -966,19 +966,8 @@ STR_GAME_OPTIONS_RESOLUTION_ITEM :{NUM}x{NUM} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Interfacegrutte -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(automatysk) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normaal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dûbele grutte -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Fjouwerdûbele grutte -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Lettergrutte - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(automatysk) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normaal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dûbele grutte -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Fjouwerdûbele grutte STR_GAME_OPTIONS_REFRESH_RATE :{BLACK}Byldferfaskingssnelheid diff --git a/src/lang/gaelic.txt b/src/lang/gaelic.txt index b23638a9e2..22e82c9731 100644 --- a/src/lang/gaelic.txt +++ b/src/lang/gaelic.txt @@ -1153,12 +1153,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :Gnàthaichte -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Meud na h-eadar-aghaidh -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Tagh am meud airson rud san eadar-aghaidh - -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Àbhaisteach -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dà uiread a mheud -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Ceithir uiread a mheud diff --git a/src/lang/galician.txt b/src/lang/galician.txt index 1e7d5d8b75..591fee5804 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -998,21 +998,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Marca es STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Controlador actual: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Tamaño da interface -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Seleciona o tamaño de elementos da interface a usar -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(auto-detectar) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dobre tamaño -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Tamaño do cadro -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Tamaño da letra -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Escoller o tamaño de fonte da interfaz - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(auto-detectar) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Tamaño doble -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Tamaño do cadro STR_GAME_OPTIONS_GRAPHICS :{BLACK}Gráficos diff --git a/src/lang/german.txt b/src/lang/german.txt index c587bc5573..51b3fdc3ad 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -998,21 +998,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Dieses K STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Aktueller Treiber: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Größe der Bedienelemente -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Wähle die Größe der Bedienelemente -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(automatisch erkennen) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Doppelt -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Vierfach -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Schriftgröße -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Die Schriftgröße der Spieloberfläche auswählen - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(automatisch erkennen) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Doppelt -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Vierfach STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafik diff --git a/src/lang/greek.txt b/src/lang/greek.txt index 5c9b856361..90fe6fa9df 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -1103,21 +1103,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Τσεκάρετε αυτό το κουτί για να ενεργοποιήσετε το v-sync στην οθόνη. Η αλλαγή αυτή θα εφαρμοστεί μετά από επανεκκίνηση του παιχνιδιού. Λειτουργεί μόνο με ενεργοποιημένη την επιτάχυνση υλικού -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Μέγεθος διεπαφής -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Επιλέξτε το μέγεθος στοιχείου διεπαφής -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(αυτόματη ανίχνευση) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Κανονικό -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Διπλό μέγεθος -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Τετραπλό μέγεθος -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Μέγεθος γραμματοσειράς -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Επιλέξτε το μέγεθος της γραμματοσειράς διεπαφής - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(αυτόματη ανίχνευση) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Κανονικό -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Διπλό μέγεθος -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Τετραπλό μέγεθος STR_GAME_OPTIONS_GRAPHICS :{BLACK}Γραφικά diff --git a/src/lang/hebrew.txt b/src/lang/hebrew.txt index a7472eb4db..826a5039b5 100644 --- a/src/lang/hebrew.txt +++ b/src/lang/hebrew.txt @@ -967,12 +967,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :אחר -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}גודל ממשק -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}בחר את ממשק גודל העצם לשימוש - -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :רגיל -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :גודל כפול -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :גודל מרובע diff --git a/src/lang/hindi.txt b/src/lang/hindi.txt index f62b0cee54..332cbc8d84 100644 --- a/src/lang/hindi.txt +++ b/src/lang/hindi.txt @@ -288,8 +288,6 @@ STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE :{STRING} ({NUM} -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :सामान्य - diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index d915b8b1f8..522189c58b 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -1061,21 +1061,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Jelöld STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Jelenlegi meghajtó: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Felület mérete -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Használni kívánt felületméret kiválasztása -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(automatikus) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normál -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dupla méret -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Négyszeres méret -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Betűméret -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Használni kívánt betűméret kiválasztása - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(automatikus) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normál -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dupla méret -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Négyszeres méret STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafika diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt index e00b7fcdea..4c32376203 100644 --- a/src/lang/icelandic.txt +++ b/src/lang/icelandic.txt @@ -924,7 +924,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :annað - STR_GAME_OPTIONS_BASE_GRF :{BLACK}Grunngrafík STR_GAME_OPTIONS_BASE_GRF_TOOLTIP :{BLACK}Nota grunngrafíkina STR_GAME_OPTIONS_BASE_GRF_STATUS :{RED}{NUM} týnd{P "" ar} eða ónýt{P "" ar} skrá{P "" r} diff --git a/src/lang/ido.txt b/src/lang/ido.txt index 5dfbe07c6a..243a6acf8a 100644 --- a/src/lang/ido.txt +++ b/src/lang/ido.txt @@ -493,7 +493,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :altra - # Custom currency window diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index 6f603b503b..fd39d2ca88 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -997,21 +997,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Centang STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Pengendali piranti: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Ukuran antarmuka -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Pilih ukuran elemen antarmuka yang akan digunakan -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(deteksi-otomatis) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Kali dua -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Kali empat -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Ukuran font -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Pilih ukuran font antarmuka yang akan digunakan - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(deteksi-otomatis) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Kali dua -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :4 kali STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafik diff --git a/src/lang/irish.txt b/src/lang/irish.txt index f875de3722..bb27932290 100644 --- a/src/lang/irish.txt +++ b/src/lang/irish.txt @@ -996,21 +996,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Cuir tic sa bhosca seo chun v-shioncronú (v-sync) a úsáid ar an scáileán. Má athraítear an socrú seo, ní chuirfear i bhfeidhm é ach tar éis an cluiche a atosú. Ní oibríonn seo ach amháin má tá luasghéarú crua-earraí cumasaithe -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Méid an chomhéadain -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Roghnaigh méid na heiliminte comhéadain a úsáidfear -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(uath-aimsiú) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Gnáth -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Méid dúbailte -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Méid 4x -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Méid na clófhoirne -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Roghnaigh méid na clófhoirne don chomhéadan a úsáidfear - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(uath-aimsiú) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Gnáthmhéid -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Méid dúbailte -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :4x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafaicí diff --git a/src/lang/italian.txt b/src/lang/italian.txt index 3d4a90da33..99df74fad4 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -999,21 +999,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Selezion STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Driver attuale: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Dimensione interfaccia -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Seleziona la dimensione deglie elementi dell'interfaccia grafica -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(rileva automaticamente) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normale -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Doppia -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Quadrupla -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Dimensione caratteri -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Seleziona la dimensione dei caratteri dell'interfaccia - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(rileva automaticamente) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normale -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Doppia -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Quadrupla STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafica diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt index 2de1549041..a838cd2e41 100644 --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -996,21 +996,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK} 垂直 STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}ここをチェックして垂直同期を有効にします。設定はゲームを再起動した後に適用されます。ハードウェアアクセラレーションが有効な環境でしか機能しません。 -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}インターフェイスのサイズ -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}インターフェイス上の単位サイズを指定します -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(自動検出) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :ノーマル -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :2倍 -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :4倍 -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}フォントサイズ -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}使用するインターフェースのフォントサイズを選択します - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(自動検出) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :ノーマル -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :ダブルサイズ -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :4倍 STR_GAME_OPTIONS_GRAPHICS :{BLACK}グラフィクス diff --git a/src/lang/korean.txt b/src/lang/korean.txt index ced54f2b70..6d3f31d38e 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -201,6 +201,15 @@ STR_UNITS_POWER_IMPERIAL :{COMMA}마력 STR_UNITS_POWER_METRIC :{COMMA}마력 STR_UNITS_POWER_SI :{COMMA}kW +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_IMPERIAL :{DECIMAL}마력/t +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_METRIC :{DECIMAL}마력/t +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_SI :{DECIMAL}마력/Mg +STR_UNITS_POWER_METRIC_TO_WEIGHT_IMPERIAL :{DECIMAL}마력/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_METRIC :{DECIMAL}마력/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_SI :{DECIMAL}마력/Mg +STR_UNITS_POWER_SI_TO_WEIGHT_IMPERIAL :{DECIMAL}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_METRIC :{DECIMAL}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_SI :{DECIMAL}W/kg STR_UNITS_WEIGHT_SHORT_IMPERIAL :{COMMA}t STR_UNITS_WEIGHT_SHORT_METRIC :{COMMA}t @@ -396,6 +405,8 @@ STR_SCENEDIT_FILE_MENU_QUIT :게임 종료 ###length 15 STR_SETTINGS_MENU_GAME_OPTIONS :게임 기본 설정 STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :설정 +STR_SETTINGS_MENU_AI_SETTINGS :인공지능 설정 +STR_SETTINGS_MENU_GAMESCRIPT_SETTINGS :게임 스크립트 설정 STR_SETTINGS_MENU_NEWGRF_SETTINGS :NewGRF 설정 STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :투명 설정 STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :도시 이름을 표시함 @@ -998,21 +1009,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}화면 STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}현재 드라이버: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}인터페이스 크기 -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}인터페이스의 크기를 선택합니다. -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(자동 탐지) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :기본 크기 -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :2배 크기 -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :4배 크기 -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}글씨 크기 -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}인터페이스에서 사용할 글씨 크기를 선택하세요 - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(자동 탐지) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :기본 크기 -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :2배 크기 -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :4배 크기 STR_GAME_OPTIONS_GRAPHICS :{BLACK}그래픽 @@ -1682,7 +1680,7 @@ STR_CONFIG_SETTING_AI_BUILDS_SHIPS :컴퓨터의 STR_CONFIG_SETTING_AI_BUILDS_SHIPS_HELPTEXT :이 설정을 켜면, 컴퓨터 플레이어가 선박을 사용할 수 없게 됩니다. STR_CONFIG_SETTING_AI_PROFILE :기본 설정 난이도: {STRING} -STR_CONFIG_SETTING_AI_PROFILE_HELPTEXT :무작위 인공지능이 사용할 난이도 설정이나, 인공지능 또는 게임 스크립트를 추가할 때의 난이도 초기값을 고르십시오. +STR_CONFIG_SETTING_AI_PROFILE_HELPTEXT :무작위 인공지능이 사용할 난이도 설정이나 인공지능 또는 게임 스크립트를 추가할 때 사용할 난이도 초기값을 고르십시오 ###length 3 STR_CONFIG_SETTING_AI_PROFILE_EASY :쉬움 STR_CONFIG_SETTING_AI_PROFILE_MEDIUM :중간 @@ -2059,6 +2057,8 @@ STR_INTRO_HIGHSCORE :{BLACK}고득 STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}설정 STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF 설정 STR_INTRO_ONLINE_CONTENT :{BLACK}온라인 콘텐츠 다운로드 +STR_INTRO_AI_SETTINGS :{BLACK}인공지능 설정 +STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}게임 스크립트 설정 STR_INTRO_QUIT :{BLACK}종료 STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}새 게임을 시작합니다.{}CTRL+클릭하시면 지도 설정을 건너뛰고 바로 시작합니다. @@ -2075,9 +2075,11 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}장난 STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}게임 기본 설정 창을 보여줍니다. STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}고득점 순위표를 보여줍니다. -STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}설정 창을 엽니다. -STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}NewGRF 설정 창을 엽니다. +STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}설정 창을 엽니다 +STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}NewGRF 설정 창을 엽니다 STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}새로 나왔거나 업데이트된 콘텐츠를 체크하여 다운로드합니다. +STR_INTRO_TOOLTIP_AI_SETTINGS :{BLACK}인공지능 설정 창을 엽니다 +STR_INTRO_TOOLTIP_GAMESCRIPT_SETTINGS :{BLACK}게임 스크립트 설정 창을 엽니다 STR_INTRO_TOOLTIP_QUIT :{BLACK}'OpenTTD'를 종료합니다. STR_INTRO_BASESET :{BLACK}현재 선택된 기본 그래픽 세트에는 {NUM}개의 스프라이트가 빠져있습니다. 기본 세트를 업데이트하세요. @@ -3137,6 +3139,12 @@ STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}강: STR_MAPGEN_SMOOTHNESS :{BLACK}지표면을 깎는 방식: STR_MAPGEN_VARIETY :{BLACK}산세 험준도: STR_MAPGEN_GENERATE :{WHITE}만들기 +STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}NewGRF 설정 +STR_MAPGEN_NEWGRF_SETTINGS_TOOLTIP :{BLACK}NewGRF 설정 창을 엽니다 +STR_MAPGEN_AI_SETTINGS :{BLACK}인공지능 설정 +STR_MAPGEN_AI_SETTINGS_TOOLTIP :{BLACK}인공지능 설정 창을 엽니다 +STR_MAPGEN_GS_SETTINGS :{BLACK}게임 스크립트 설정 +STR_MAPGEN_GS_SETTINGS_TOOLTIP :{BLACK}게임 스크립트 설정 창을 엽니다 ###length 21 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH :영국 식 (기본) @@ -3874,6 +3882,9 @@ STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}항속 STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}항공기 종류: {GOLD}{STRING} ###length 3 +STR_CARGO_TYPE_FILTER_ALL :모든 화물 종류 +STR_CARGO_TYPE_FILTER_FREIGHT :무게 +STR_CARGO_TYPE_FILTER_NONE :없음 ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}열차 차량 구매 목록입니다. 차량의 정보를 보려면 클릭하세요. CTRL+클릭하면 해당 차량을 숨김/표시 처리할 수 있습니다 @@ -4535,6 +4546,8 @@ STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}작동 STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}인공지능/게임 스크립트 디버그창은 오직 서버만 사용 가능합니다 # AI configuration window +STR_AI_CONFIG_CAPTION_AI :{WHITE}인공지능 설정 +STR_AI_CONFIG_CAPTION_GAMESCRIPT :{WHITE}게임 스크립트 설정 STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}다음에 게임을 시작할 때 이 게임 스크립트를 불러올 것입니다 STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}다음에 게임을 시작할 때 이 인공지능을 불러올 것입니다 STR_AI_CONFIG_HUMAN_PLAYER :사용자 플레이어 @@ -4548,10 +4561,11 @@ STR_AI_CONFIG_MOVE_DOWN :{BLACK}아래 STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}목록에서 선택한 인공지능의 순서를 한 칸 아래로 옮깁니다 STR_AI_CONFIG_GAMESCRIPT :{SILVER}게임 스크립트 +STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}매개 변수 STR_AI_CONFIG_AI :{SILVER}인공지능 -STR_AI_CONFIG_CHANGE_AI :인공지능 -STR_AI_CONFIG_CHANGE_GAMESCRIPT :게임 스크립트 +STR_AI_CONFIG_CHANGE_AI :{BLACK}인공지능을 선택하세요 +STR_AI_CONFIG_CHANGE_GAMESCRIPT :{BLACK}게임 스크립트를 선택하세요 STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}다른 스크립트 불러오기 STR_AI_CONFIG_CONFIGURE :{BLACK}설정 STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}인공지능의 매개 변수를 설정합니다 @@ -4580,7 +4594,7 @@ STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}높이 STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}미니맵 스크린 샷 # AI Parameters -STR_AI_SETTINGS_CAPTION_AI :인공지능 +STR_AI_SETTINGS_CAPTION_AI :{WHITE}인공지능 매개 변수 STR_AI_SETTINGS_CLOSE :{BLACK}닫기 STR_AI_SETTINGS_RESET :{BLACK}초기화 STR_AI_SETTINGS_SETTING :{STRING}: {ORANGE}{STRING} diff --git a/src/lang/latin.txt b/src/lang/latin.txt index d1e80a8059..aafd9ed650 100644 --- a/src/lang/latin.txt +++ b/src/lang/latin.txt @@ -1145,19 +1145,8 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :alia -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Magnitudo interfaciei -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Eligere magnitudinem interfaciei adhibendam -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Simplex -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Duplex -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Quadruplex -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Magnitudo Litterarum -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Eligere magnitudinem litterarum adhibendam - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Simplex -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Duplex -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Quadruplex diff --git a/src/lang/latvian.txt b/src/lang/latvian.txt index bf001cf379..1fa943e888 100644 --- a/src/lang/latvian.txt +++ b/src/lang/latvian.txt @@ -999,21 +999,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Atzīmē STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Esošais vadītājs: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Lietotāja saskarnes lielums -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Lietotāja saskarnes elementu lieluma izvēle -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(automātiski noteikt) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Parasts -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Divkāršs -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Četrkāršs -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Fonta izmērs -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Izvēlieties saskarnes fonta izmēru - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(automātiski noteikt) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normāls -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Divkāršs izmērs -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Četrkāršs izmērs STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafika diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt index b2cb32c9ba..8e9d324f7f 100644 --- a/src/lang/lithuanian.txt +++ b/src/lang/lithuanian.txt @@ -1197,21 +1197,8 @@ STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}Kad pake STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}Vertikalioji sinchronizacija (VSync) -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Sąsajos elementų dydis -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Pasirinkite vartotojo sąsajos elementų santykinį dydį -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(aptikti automatiškai) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normalus -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dvigubas -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Keturgubas -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Šrifto dydis -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Pasirinkite vartotojo sąsajos šrifto dydį - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(aptikti automatiškai) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normalus -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dvigubas -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Keturgubas STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafika diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt index e9106351b4..6a302f587b 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -996,21 +996,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Wiel des Optioun fir de V-Sync unzeman. Des gëtt eréit no engem Neistart benotzt. Funktionéiert nëmmen wann Hardwarebeschleunigung un ass -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Interfacegréisst -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Wiel d'Gréisst déi fir den Interface soll benotzt ginn -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(auto-Detekt.) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Duebel -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Véierfach -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Schrëftgréisst -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Wiel d'Interface-Schrëftgréisst aus - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(auto-Detekt.) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Duebel Gréisst -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Véierfach STR_GAME_OPTIONS_GRAPHICS :{BLACK}Graphik diff --git a/src/lang/macedonian.txt b/src/lang/macedonian.txt index e3d8518033..627b6bc243 100644 --- a/src/lang/macedonian.txt +++ b/src/lang/macedonian.txt @@ -812,7 +812,6 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_1_MONTH :Секој ме - # Custom currency window diff --git a/src/lang/malay.txt b/src/lang/malay.txt index 8877ab0227..26fe29b50a 100644 --- a/src/lang/malay.txt +++ b/src/lang/malay.txt @@ -923,12 +923,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :lain -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Saiz Antaramuka -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Sila pilih saiz elemen antara muka untuk digunakan - -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Biasa -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Saiz berganda -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Saiz kuad diff --git a/src/lang/maltese.txt b/src/lang/maltese.txt index 6c048f7a31..868f2c059f 100644 --- a/src/lang/maltese.txt +++ b/src/lang/maltese.txt @@ -426,7 +426,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :oħrajn - # Custom currency window diff --git a/src/lang/marathi.txt b/src/lang/marathi.txt index aec6db8d83..4c9e67efce 100644 --- a/src/lang/marathi.txt +++ b/src/lang/marathi.txt @@ -749,7 +749,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :अन्य - # Custom currency window diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index 1ff9988e3e..5a5a2bb82d 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -998,21 +998,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Merk av i denne boksen for å v-synkronisere skjermen. Endring av innstillinger krever omstart av spillet. Fungerer bare med maskinvareakselerasjon aktivert -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Grensesnitt-størrelse -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Velg grensesnitt-størrelsen som skal benyttes -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(finn automatisk) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :2 ganger størrelse -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :4 ganger størrelse -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Skriftstørrelse -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Velg skriftstørrelse for grensesnitt - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(finn automatisk) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dobbel størrelse -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Firedobbel størrelse STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafikk diff --git a/src/lang/norwegian_nynorsk.txt b/src/lang/norwegian_nynorsk.txt index f0d0c47419..9fde3e8f24 100644 --- a/src/lang/norwegian_nynorsk.txt +++ b/src/lang/norwegian_nynorsk.txt @@ -950,12 +950,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :anna -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Grensesnittstorleik -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Vel storleik å bruke på grensesnittet - -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dobbel størrelse -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Firedobbel størrelse diff --git a/src/lang/persian.txt b/src/lang/persian.txt index f0cb891542..11d8674491 100644 --- a/src/lang/persian.txt +++ b/src/lang/persian.txt @@ -941,8 +941,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :دیگر -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :دو برابر - diff --git a/src/lang/polish.txt b/src/lang/polish.txt index 51fce6055d..332bda0c7c 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -1377,21 +1377,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Zaznacz STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Bieżący sterownik: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Rozmiar interfejsu -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Wybierz rozmiar elementów interfejsu -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(wykryj automatycznie) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normalny -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Podwójny -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Poczwórny -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Wielkość czcionki -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Wybierz wielkość czcionki interfejsu - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(wykryj automatycznie) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normalna -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Podwójna -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Poczwórna STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafika diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index 71f782716d..3228c5e2ef 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -1007,21 +1007,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Marque e STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}"Driver" atual: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Tamanho interface -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Seleccionar tamanho do elemento de interface a usar -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(auto-detetar) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dobro do tamanho -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Quádruplo do tamanho -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Tamanho da fonte -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Seleccionar tamanho da fonte de interface a usar - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(auto-detetar) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dobro do tamanho -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Quádruplo do tamanho STR_GAME_OPTIONS_GRAPHICS :{BLACK}Gráficos diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index 3152eeab8c..bb1ed57ca0 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -997,21 +997,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Bifați STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Driver curent: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Mărime interfată -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Alege mărimea elementelor de interfaţa -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(auto-detecție) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normală -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Mărime dublă -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Mărime cvadruplă -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Dimensiune font -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Alege dimensiunea fontului pentru interfață - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(auto-detecție) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Mărime dublă -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Mărime cvadruplă STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafică diff --git a/src/lang/russian.txt b/src/lang/russian.txt index e5a4e409da..e633f26999 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -530,6 +530,8 @@ STR_SCENEDIT_FILE_MENU_QUIT :Выход ###length 15 STR_SETTINGS_MENU_GAME_OPTIONS :Основные настройки STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :Расширенные настройки +STR_SETTINGS_MENU_AI_SETTINGS :Настройки ИИ +STR_SETTINGS_MENU_GAMESCRIPT_SETTINGS :Настройки игровых скриптов STR_SETTINGS_MENU_NEWGRF_SETTINGS :Настройки NewGRF STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Настройки прозрачности STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Показывать названия городов @@ -1151,21 +1153,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Вклю STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Видеодрайвер: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Размер элементов интерфейса -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Выберите размер элементов интерфейса -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(Автовыбор) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Обычный -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Удвоенный -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Учетверённый -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Размер шрифта -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Выберите размер шрифта, используемого в игре - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(Автовыбор) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Нормальный -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Двукратный -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Четырёхкратный STR_GAME_OPTIONS_GRAPHICS :{BLACK}Настройки графики @@ -2218,6 +2207,8 @@ STR_INTRO_HIGHSCORE :{BLACK}Табл STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Расширенные настройки STR_INTRO_NEWGRF_SETTINGS :{BLACK}Настройки NewGRF STR_INTRO_ONLINE_CONTENT :{BLACK}Проверить онлайн-контент +STR_INTRO_AI_SETTINGS :{BLACK}Настройки ИИ +STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}Настройки игровых скриптов STR_INTRO_QUIT :{BLACK}Выход STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Начать новую игру. Ctrl+щелчок пропускает этап настройки карты. @@ -2237,6 +2228,8 @@ STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Пока STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Изменить расширенные настройки игры STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Показать настройки NewGRF STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Найти новый и обновлённый контент для загрузки +STR_INTRO_TOOLTIP_AI_SETTINGS :{BLACK}Показать настройки ИИ +STR_INTRO_TOOLTIP_GAMESCRIPT_SETTINGS :{BLACK}Показать настройки игровых скриптов STR_INTRO_TOOLTIP_QUIT :{BLACK}Выйти из OpenTTD STR_INTRO_BASESET :{BLACK}В выбранном наборе базовой графики отсутству{P 0 е ю ю}т {NUM} спрайт{P "" а ов}. Пожалуйста, обновите набор графики. @@ -3320,6 +3313,12 @@ STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}Коли STR_MAPGEN_SMOOTHNESS :{BLACK}Грубость ландшафта: STR_MAPGEN_VARIETY :{BLACK}Разнообразие ландшафта: STR_MAPGEN_GENERATE :{WHITE}Создать +STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}Настройки NewGRF +STR_MAPGEN_NEWGRF_SETTINGS_TOOLTIP :{BLACK}Показать настройки NewGRF +STR_MAPGEN_AI_SETTINGS :{BLACK}Настройки ИИ +STR_MAPGEN_AI_SETTINGS_TOOLTIP :{BLACK}Показать настройки ИИ +STR_MAPGEN_GS_SETTINGS :{BLACK}Настройки игровых скриптов +STR_MAPGEN_GS_SETTINGS_TOOLTIP :{BLACK}Показать настройки игровых скриптов ###length 21 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH :Английские @@ -4733,6 +4732,8 @@ STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Один STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}Окно отладки ИИ / скрипта доступно только для сервера # AI configuration window +STR_AI_CONFIG_CAPTION_AI :{WHITE}Настройки ИИ +STR_AI_CONFIG_CAPTION_GAMESCRIPT :{WHITE}Настройки игровых скриптов STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}Игровой скрипт, который будет загружен в следующей игре STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}Модули ИИ, которые будут загружены в следующей игре STR_AI_CONFIG_HUMAN_PLAYER :Человек @@ -4746,10 +4747,11 @@ STR_AI_CONFIG_MOVE_DOWN :{BLACK}Вниз STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}Переместить этот модуль ИИ вниз по списку STR_AI_CONFIG_GAMESCRIPT :{SILVER}Игровой скрипт +STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}Параметры STR_AI_CONFIG_AI :{SILVER}ИИ -STR_AI_CONFIG_CHANGE_AI :ИИ -STR_AI_CONFIG_CHANGE_GAMESCRIPT :Игровой скрипт +STR_AI_CONFIG_CHANGE_AI :{BLACK}ИИ +STR_AI_CONFIG_CHANGE_GAMESCRIPT :{BLACK}Игровой скрипт STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Загрузить другой скрипт STR_AI_CONFIG_CONFIGURE :{BLACK}Конфигурация STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}Настроить параметры скрипта @@ -4778,7 +4780,7 @@ STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Сним STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Снимок миникарты # AI Parameters -STR_AI_SETTINGS_CAPTION_AI :ИИ +STR_AI_SETTINGS_CAPTION_AI :{WHITE}Параметры ИИ STR_AI_SETTINGS_CLOSE :{BLACK}Закрыть STR_AI_SETTINGS_RESET :{BLACK}Сброс STR_AI_SETTINGS_SETTING :{STRING}: {ORANGE}{STRING} diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt index 92456d8e25..24956c001c 100644 --- a/src/lang/serbian.txt +++ b/src/lang/serbian.txt @@ -1191,21 +1191,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Štikliranjem se uključuje v-sync. Promena ovog podešavanja će biti vidljiva tek nakon ponovnog pokretanja igre. Radi jedino sa uključenim hardverskim ubrzanjem. -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Veličina interfejsa -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Izaberite većinu elementa koja će se koristiti -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(automatska detekcija) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normalna veličina -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Uvećavajte veličinu dva puta -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Uvećavajte veličinu četiri puta -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Veličina fonta -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Izaberi veličinu fonta za interfejs - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(automatska detekcija) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Uobičajen -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dvostruka veličina -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Četvorostruka veličina STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafike diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index cc48a8956a..13ef1f7883 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -997,21 +997,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}点击 STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}使用中的驱动程序: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}界面大小 -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}选择使用的界面元素大小 -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(自动检测) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :正常大小 -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :两倍大小 -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :四倍大小 -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}字体大小 -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}选择此字体大小 - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(自动检测) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :正常 -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :两倍大小 -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :四倍大小 STR_GAME_OPTIONS_GRAPHICS :{BLACK}图像 diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt index 491a2de9b4..f5c78f064e 100644 --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -1065,21 +1065,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Zaškrtn STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Aktuálny ovládač: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Veľkosť rozhrania -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Výber veľkosti prvkov rozhrania -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(automaticky zistené) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normálna -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dvojnásobná veľkosť -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Štvornásobná veľkosť -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Veľkosť písma -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Výber veľkosti písma v rozhraní - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(automaticky zistené) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normálna -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dvojnásobná veľkosť -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Štvornásobná veľkosť STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafika diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt index 0968312178..10917c2b24 100644 --- a/src/lang/slovenian.txt +++ b/src/lang/slovenian.txt @@ -1105,15 +1105,8 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :drugo -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Velikost vmesnika -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Izberi velikost elementa vmesnika - -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normalno -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dvojna velikost -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Velikost kvadrata -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(samodejno zaznaj) diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index 52b2b7217e..2b2f65d667 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -998,21 +998,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Marca es STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Controlador actual: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Tamaño de la interfaz -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Selecciona el tamaño de los elementos de la interfaz a usar -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(autodetectar) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Tamaño doble -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Tamaño cuádruple -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Tamaño de fuente -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Selecciona el tamaño de fuente a utilizar en la interfaz - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(autodetectar) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Tamaño doble -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Tamaño cuádruple STR_GAME_OPTIONS_GRAPHICS :{BLACK}Gráficos diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index 92142d82dd..c912c948d9 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -203,8 +203,13 @@ STR_UNITS_POWER_SI :{COMMA}{NBSP}kW STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}hp/t STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg STR_UNITS_POWER_METRIC_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg STR_UNITS_POWER_SI_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_SI :{DECIMAL}{NBSP}W/kg STR_UNITS_WEIGHT_SHORT_IMPERIAL :{COMMA}{NBSP}t STR_UNITS_WEIGHT_SHORT_METRIC :{COMMA}{NBSP}t @@ -400,6 +405,8 @@ STR_SCENEDIT_FILE_MENU_QUIT :Salir ###length 15 STR_SETTINGS_MENU_GAME_OPTIONS :Opciones de juego STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :Configuración +STR_SETTINGS_MENU_AI_SETTINGS :Configuración de IA +STR_SETTINGS_MENU_GAMESCRIPT_SETTINGS :Configuración de scripts de juego STR_SETTINGS_MENU_NEWGRF_SETTINGS :Configuración de NewGRF STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Opciones de transparencia STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Mostrar nombres de localidades @@ -1002,21 +1009,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Activar STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Controlador actual: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Tamaño de la interfaz -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Elegir el tamaño de los elementos de la interfaz -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(detectar) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Doble -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Cuádruple -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Tamaño de texto -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Elegir el tamaño de letra de la interfaz - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(detectar) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Doble -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Cuádruple STR_GAME_OPTIONS_GRAPHICS :{BLACK}Gráficos @@ -2063,6 +2057,8 @@ STR_INTRO_HIGHSCORE :{BLACK}Tabla de STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Configuración STR_INTRO_NEWGRF_SETTINGS :{BLACK}Config. NewGRF STR_INTRO_ONLINE_CONTENT :{BLACK}Contenido en línea +STR_INTRO_AI_SETTINGS :{BLACK}Configuración de IA +STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}Scripts de juego STR_INTRO_QUIT :{BLACK}Salir STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Comenzar una nueva partida. Ctrl+Clic omite la configuración del mapa @@ -2082,6 +2078,8 @@ STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Mostrar STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Mostrar configuración STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Mostrar configuración de NewGRF STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Revisar si hay nuevos contenidos actualizados para descargar +STR_INTRO_TOOLTIP_AI_SETTINGS :{BLACK}Mostrar configuración de IA +STR_INTRO_TOOLTIP_GAMESCRIPT_SETTINGS :{BLACK}Mostrar configuración de scripts de juego STR_INTRO_TOOLTIP_QUIT :{BLACK}Salir de 'OpenTTD' STR_INTRO_BASESET :{BLACK}A los gráficos base elegidos les hace falta {NUM} spirte{P "" s}. Necesitan actualizarse. @@ -3141,6 +3139,12 @@ STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}Ríos: STR_MAPGEN_SMOOTHNESS :{BLACK}Suavidad: STR_MAPGEN_VARIETY :{BLACK}Variedad: STR_MAPGEN_GENERATE :{WHITE}Generar +STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}Configuración de NewGRF +STR_MAPGEN_NEWGRF_SETTINGS_TOOLTIP :{BLACK}Mostrar configuración de NewGRF +STR_MAPGEN_AI_SETTINGS :{BLACK}Configuración de IA +STR_MAPGEN_AI_SETTINGS_TOOLTIP :{BLACK}Mostrar configuración de IA +STR_MAPGEN_GS_SETTINGS :{BLACK}Configuración de scripts de juego +STR_MAPGEN_GS_SETTINGS_TOOLTIP :{BLACK}Mostrar configuración de scripts de juego ###length 21 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH :Inglés @@ -4542,6 +4546,8 @@ STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Uno de l STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}La ventana de depuración de scripts solo está disponible para el servidor # AI configuration window +STR_AI_CONFIG_CAPTION_AI :{WHITE}Configuración de IA +STR_AI_CONFIG_CAPTION_GAMESCRIPT :Configuración de scripts de juego STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}Script de juego que será cargado en la próxima partida STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}Scripts de IA que serán cargados la próxima partida STR_AI_CONFIG_HUMAN_PLAYER :Jugador humano @@ -4555,10 +4561,11 @@ STR_AI_CONFIG_MOVE_DOWN :{BLACK}Mover ha STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}Mover la IA elegida una posición hacia abajo STR_AI_CONFIG_GAMESCRIPT :{SILVER}Script de juego +STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}Parámetros STR_AI_CONFIG_AI :{SILVER}IA -STR_AI_CONFIG_CHANGE_AI :IA -STR_AI_CONFIG_CHANGE_GAMESCRIPT :Script de juego +STR_AI_CONFIG_CHANGE_AI :{BLACK}Elegir IA +STR_AI_CONFIG_CHANGE_GAMESCRIPT :{BLACK}Elegir script de juego STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Cargar otro script STR_AI_CONFIG_CONFIGURE :{BLACK}Configurar STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}Configurar los parámetros del script @@ -4587,7 +4594,7 @@ STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Mapa de STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Captura de minimapa # AI Parameters -STR_AI_SETTINGS_CAPTION_AI :IA +STR_AI_SETTINGS_CAPTION_AI :{WHITE}Parámetros de IA STR_AI_SETTINGS_CLOSE :{BLACK}Cerrar STR_AI_SETTINGS_RESET :{BLACK}Reiniciar STR_AI_SETTINGS_SETTING :{STRING}: {ORANGE}{STRING} diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index 3e1e8d488a..45622f76c2 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -997,21 +997,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Markera STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Nuvarande drivrutin: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Gränssnittstorlek -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Välj vilken gränssnittsstorlek som ska användas -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(Upptäck automatiskt) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dubbel storlek -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Fyrdubbel storlek -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Storlek på typsnitt -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Välj vilken storlek som ska användas på gränssnittets typsnitt - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(Upptäck automatiskt) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dubbel storlek -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Kvadrupel storlek STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafik diff --git a/src/lang/tamil.txt b/src/lang/tamil.txt index e26c895b08..8a59b06bbb 100644 --- a/src/lang/tamil.txt +++ b/src/lang/tamil.txt @@ -962,19 +962,8 @@ STR_GAME_OPTIONS_RESOLUTION_ITEM :{NUM}x{NUM} STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}இடைமுக அளவு -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}பயன்படுத்த இடைமுக உறுப்பு அளவை தேர்ந்தெடுக்கவும் -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(தானாக கண்டறி) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :சராசரி -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :இரண்டு மடங்கு -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :நான்கு மடங்கு -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}எழுத்துரு அளவு - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :இயல்பான -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :இரண்டு மடங்கு -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :நான்கு மடங்கு STR_GAME_OPTIONS_REFRESH_RATE_ITEM :{NUM}Hz diff --git a/src/lang/thai.txt b/src/lang/thai.txt index 0d170fb68d..9734606253 100644 --- a/src/lang/thai.txt +++ b/src/lang/thai.txt @@ -965,15 +965,8 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :อื่นๆ -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}ขนาดของแผงควบคุม -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :ปกติ -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :คูณสี่ -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}ขนาดตัวอักษร - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :ปกติ -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :ขนาดใหญ่คูณสอง STR_GAME_OPTIONS_REFRESH_RATE :{BLACK}รีเฟรชเรทของหน้าจอ diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt index e5545a5580..98f8539b17 100644 --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -997,21 +997,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}勾選 STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}使用中的驅動程式: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}介面大小 -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}選擇使用的介面元素大小 -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(自動偵測) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :正常大小 -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :兩倍大小 -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :四倍大小 -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}字體大小 -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}選擇此字體大小 - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(自動偵測) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :正常 -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :兩倍大小 -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :四倍大小 STR_GAME_OPTIONS_GRAPHICS :{BLACK}圖形 diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index e20147d266..2c6560c589 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -998,21 +998,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Dikey se STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Geçerli sürücü: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Arayüz boyutu -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Kullanmak üzere arayüz bileşen boyutunu seçin -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(otomatik-tespit) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :İki kat büyük -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Dört kat büyük -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Yazı boyutu -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :Arayüz boyutunu seç - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(otomatik-tespit) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Normal -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Yazı iki kat büyük -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Dört kat büyük STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafikler diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt index 9bbff10835..e8000edbcf 100644 --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -1124,21 +1124,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC :Вертика STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Увімкнутий прапорець дозволить вертикальну синхронізацію екрану. Налаштування запрацює тільки після перезапуску гри. Працює тільки за увімкнутого прискорення апаратного забезпечення. -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Розмір інтерфейсу -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Оберіть розмір елементів інтерфейсу -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(автоматичо) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Нормальний розмір -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Подвійний розмір -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Почетверний розмір -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Розмір шрифту -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Виберть розмір шрифту інтерфейсу - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(автоматичо) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Нормальний -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Подвійний розмір -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Почетверний розмір STR_GAME_OPTIONS_GRAPHICS :{BLACK}Графіка diff --git a/src/lang/urdu.txt b/src/lang/urdu.txt index 6998d21e4f..0ee79d536b 100644 --- a/src/lang/urdu.txt +++ b/src/lang/urdu.txt @@ -920,7 +920,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :دیگر - STR_GAME_OPTIONS_BASE_GRF :{BLACK}بُنیادی گرافک سیٹ STR_GAME_OPTIONS_BASE_GRF_TOOLTIP :{BLACK}بُنیادی گرافک سیٹ اختیار کریں STR_GAME_OPTIONS_BASE_GRF_STATUS :{RED}{NUM} missing/corrupted file{P "" s} diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index 8d01c65dd7..092a39e631 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -997,21 +997,8 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Đánh d STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Trình điều khiển hiện tại: {STRING} -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Kích thước giao diện -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Chọn kích thước của các đối tượng trên giao diện -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_AUTO :(nhận diện tự động) -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Bình thường -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Gấp 2 lần -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Gấp 4 lần -STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Cỡ chữ -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Chọn cỡ chữ trong giao diện - -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_AUTO :(nhận diện tự động) -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Bình thường -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Phóng to gấp đôi -STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Phóng nhân bốn STR_GAME_OPTIONS_GRAPHICS :{BLACK}Hình ảnh diff --git a/src/lang/welsh.txt b/src/lang/welsh.txt index 3064951178..cd434a529f 100644 --- a/src/lang/welsh.txt +++ b/src/lang/welsh.txt @@ -952,12 +952,6 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :arall -STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Maint rhyngwyneb -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Dewis maint yr elfennau rhyngwyneb i'w defnyddio - -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Arferol -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dyblyg -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Pedwarplyg From 89a2d0a60546cb27055c42a757640ab4882c3210 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sun, 13 Nov 2022 09:30:46 -0700 Subject: [PATCH 12/42] Fix #10154: Don't inconsistently set random company face in network games (#10157) --- src/company_cmd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 6d3f5b6256..a4e5fc9c3b 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -569,8 +569,8 @@ Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY) c->inaugurated_year = _cur_year; /* If starting a player company in singleplayer and a favorite company manager face is selected, choose it. Otherwise, use a random face. - * In a network game, we'll choose the favorite face later in CmdCompanyCtrl to sync it to all clients, but we choose it here for the first (host) company. */ - if (_company_manager_face != 0 && !is_ai) { + * In a network game, we'll choose the favorite face later in CmdCompanyCtrl to sync it to all clients. */ + if (_company_manager_face != 0 && !is_ai && !_networking) { c->face = _company_manager_face; } else { RandomCompanyManagerFaceBits(c->face, (GenderEthnicity)Random(), false, false); From cea62ef73de2e8a447ccb7b48979fcf1c0f47471 Mon Sep 17 00:00:00 2001 From: PeterN Date: Sun, 13 Nov 2022 17:10:34 +0000 Subject: [PATCH 13/42] Fix #10161: Ignore ascender in FallbackLayouter for non-built-in fonts. (#10169) --- src/gfx_layout.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 8246e10aca..01b5421bcf 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -333,18 +333,25 @@ public: FallbackParagraphLayout::FallbackVisualRun::FallbackVisualRun(Font *font, const WChar *chars, int char_count, int x) : font(font), glyph_count(char_count) { + const bool isbuiltin = font->fc->IsBuiltInFont(); + this->glyphs = MallocT(this->glyph_count); this->glyph_to_char = MallocT(this->glyph_count); /* Positions contains the location of the begin of each of the glyphs, and the end of the last one. */ this->positions = MallocT(this->glyph_count * 2 + 2); this->positions[0] = x; - this->positions[1] = font->fc->GetAscender(); for (int i = 0; i < this->glyph_count; i++) { this->glyphs[i] = font->fc->MapCharToGlyph(chars[i]); + if (isbuiltin) { + this->positions[2 * i + 1] = font->fc->GetAscender(); // Apply sprite font's ascender. + } else if (chars[i] >= SCC_SPRITE_START && chars[i] <= SCC_SPRITE_END) { + this->positions[2 * i + 1] = font->fc->GetAscender() - font->fc->GetGlyph(this->glyphs[i])->height - 1; // Align sprite glyphs to font baseline. + } else { + this->positions[2 * i + 1] = 0; // No ascender adjustment. + } this->positions[2 * i + 2] = this->positions[2 * i] + font->fc->GetGlyphWidth(this->glyphs[i]); - this->positions[2 * i + 3] = font->fc->GetAscender(); this->glyph_to_char[i] = i; } } From 553e5e6bbeff9dba694e4888786a9cf45f0cf0d8 Mon Sep 17 00:00:00 2001 From: translators Date: Sun, 13 Nov 2022 18:50:23 +0000 Subject: [PATCH 14/42] Update: Translations from eints english (au): 20 changes by krysclarke spanish (mexican): 7 changes by absay korean: 20 changes by telk5093 russian: 13 changes by Ln-Wolf spanish: 74 changes by MontyMontana --- src/lang/english_AU.txt | 28 ++++++++--- src/lang/korean.txt | 28 ++++++++--- src/lang/russian.txt | 21 +++++--- src/lang/spanish.txt | 107 +++++++++++++++++++++++++++------------- src/lang/spanish_MX.txt | 7 +++ 5 files changed, 134 insertions(+), 57 deletions(-) diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index d1df237513..f5c0b9d4f7 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -1008,8 +1008,19 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Check th STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Current driver: {STRING} +STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Interface size +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Drag slider to set interface size. Hold Ctrl for continuous adjustment +STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Auto-detect size +STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Check this box to detect interface size automatically +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Scale bevels +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Check this box to scale bevels by interface size +STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_2X :2x +STR_GAME_OPTIONS_GUI_SCALE_3X :3x +STR_GAME_OPTIONS_GUI_SCALE_4X :4x +STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Graphics @@ -3469,14 +3480,14 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Buy exclusive t STR_LOCAL_AUTHORITY_ACTION_BRIBE :Bribe the local authority ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}Initiate a small local advertising campaign, to attract more passengers and cargo to your transport services.{}Provides a temporary boost to station rating in a small radius around the town centre.{}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Initiate a medium local advertising campaign, to attract more passengers and cargo to your transport services.{}Provides a temporary boost to station rating in a medium radius around the town centre.{}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Initiate a large local advertising campaign, to attract more passengers and cargo to your transport services.{}Provides a temporary boost to station rating in a large radius around the town centre.{}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}Fund the reconstruction of the urban road network.{}Causes considerable disruption to road traffic for up to 6 months.{}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Build a statue in honour of your company.{}Provides a permanent boost to station rating in this town.{}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}Fund the construction of new buildings in the town.{}Provides a temporary boost to town growth in this town.{}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Buy 1 year's exclusive transport rights in town.{}Town authority will not allow passengers and cargo to use your competitors' stations.{}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Bribe the local authority to increase your rating, at the risk of a severe penalty if caught.{}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW}Initiate a small local advertising campaign, to attract more passengers and cargo to your transport services.{}Provides a temporary boost to station rating in a small radius around the town centre.{}{POP_COLOUR}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{PUSH_COLOUR}{YELLOW}Initiate a medium local advertising campaign, to attract more passengers and cargo to your transport services.{}Provides a temporary boost to station rating in a medium radius around the town centre.{}{POP_COLOUR}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{PUSH_COLOUR}{YELLOW}Initiate a large local advertising campaign, to attract more passengers and cargo to your transport services.{}Provides a temporary boost to station rating in a large radius around the town centre.{}{POP_COLOUR}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW}Fund the reconstruction of the urban road network.{}Causes considerable disruption to road traffic for up to 6 months.{}{POP_COLOUR}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{PUSH_COLOUR}{YELLOW}Build a statue in honour of your company.{}Provides a permanent boost to station rating in this town.{}{POP_COLOUR}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{PUSH_COLOUR}{YELLOW}Fund the construction of new buildings in the town.{}Provides a temporary boost to town growth in this town.{}{POP_COLOUR}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW}Buy 1 year's exclusive transport rights in town.{}Town authority will not allow passengers and cargo to use your competitors' stations.{}{POP_COLOUR}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}Bribe the local authority to increase your rating, at the risk of a severe penalty if caught.{}{POP_COLOUR}Cost: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} Goals @@ -4212,6 +4223,7 @@ STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Weight: STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Weight: {LTBLUE}{WEIGHT_SHORT} {BLACK}Power: {LTBLUE}{POWER}{BLACK} Max. speed: {LTBLUE}{VELOCITY} {BLACK}Max. T.E.: {LTBLUE}{FORCE} STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Profit this year: {LTBLUE}{CURRENCY_LONG} (last year: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Profit this year: {LTBLUE}{CURRENCY_LONG} (last year: {CURRENCY_LONG}) {BLACK}Min. performance: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Reliability: {LTBLUE}{COMMA}% {BLACK}Breakdowns since last service: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Built: {LTBLUE}{NUM}{BLACK} Value: {LTBLUE}{CURRENCY_LONG} diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 6d3f31d38e..4091606856 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -1009,8 +1009,19 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}화면 STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}현재 드라이버: {STRING} +STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}인터페이스 크기 +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}인터페이스 크기를 설정하려면 슬라이더를 드래그하세요. CTRL 키를 누르고 있으면 미세 조정이 가능합니다 +STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}크기 자동 탐지 +STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}인터페이스 크기를 자동으로 탐지하려면 이 박스에 체크하세요 +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}크기 조절 +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}인터페이스 크기를 슬라이더로 조절하려면 이 박스에 체크하세요 +STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_2X :2x +STR_GAME_OPTIONS_GUI_SCALE_3X :3x +STR_GAME_OPTIONS_GUI_SCALE_4X :4x +STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}그래픽 @@ -3470,14 +3481,14 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :수송 권한 STR_LOCAL_AUTHORITY_ACTION_BRIBE :지역 당국에게 뇌물 주기 ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}더 많은 승객과 화물을 유치하기 위해 소규모의 광고 캠페인을 시작합니다.{}도시 중심 주위의 좁은 반경 안에 있는 역 등급을 일시적으로 올려줍니다.{}가격: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}더 많은 승객과 화물을 유치하기 위해 중간 규모의 광고 캠페인을 시작합니다.{}도시 중심 주위의 적당한 반경 안에 있는 역 등급을 일시적으로 올려줍니다.{}가격: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}더 많은 승객과 화물을 유치하기 위해 대규모의 광고 캠페인을 시작합니다.{}도시 중심 주위의 넓은 반경 안에 있는 역 등급을 일시적으로 올려줍니다.{}가격: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}도시 도로망 보수공사를 시행합니다.{}앞으로 6개월간 극심한 도로 혼잡을 일으킵니다.{}가격: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}당신의 회사를 대표하는 '명예의 동상'을 건설합니다.{}이 도시에 있는 역 등급을 영구적으로 올려줍니다.{}가격: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}도시 상업 건물의 건설에 투자합니다.{}도시의 성장을 일시적으로 빠르게 만들어줍니다.{}가격: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}1년 간 수송 권한 독점권을 구입합니다.{}도시 당국은 오직 당신 회사의 역에만 승객과 화물을 실을 것입니다.{}가격: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}성취도를 올리기 위해 처벌을 감수하고 지역 당국에 뇌물을 줍니다.{}가격: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW}더 많은 승객과 화물을 유치하기 위해 소규모의 광고 캠페인을 시작합니다.{}도시 중심 주위의 좁은 반경 안에 있는 역 등급을 일시적으로 올려줍니다.{}{POP_COLOUR}가격: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{PUSH_COLOUR}{YELLOW}더 많은 승객과 화물을 유치하기 위해 중간 규모의 광고 캠페인을 시작합니다.{}도시 중심 주위의 적당한 반경 안에 있는 역 등급을 일시적으로 올려줍니다.{}{POP_COLOUR}가격: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{PUSH_COLOUR}{YELLOW}더 많은 승객과 화물을 유치하기 위해 대규모의 광고 캠페인을 시작합니다.{}도시 중심 주위의 넓은 반경 안에 있는 역 등급을 일시적으로 올려줍니다.{}{POP_COLOUR}가격: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW}도시 도로망 보수공사를 시행합니다.{}앞으로 6개월간 극심한 도로 혼잡을 일으킵니다.{}{POP_COLOUR}가격: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{PUSH_COLOUR}{YELLOW}당신의 회사를 대표하는 '명예의 동상'을 건설합니다.{}이 도시에 있는 역 등급을 영구적으로 올려줍니다.{}{POP_COLOUR}가격: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{PUSH_COLOUR}{YELLOW}도시 상업 건물의 건설에 투자합니다.{}도시의 성장을 일시적으로 빠르게 만들어줍니다.{}가격: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW}1년 간 수송 권한 독점권을 구입합니다.{}도시 당국은 오직 당신 회사의 역에만 승객과 화물을 실을 것입니다.{}{POP_COLOUR}가격: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}성취도를 올리기 위해 처벌을 감수하고 지역 당국에 뇌물을 줍니다.{}{POP_COLOUR}가격: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} 목표 @@ -4213,6 +4224,7 @@ STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}무게: STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}무게: {LTBLUE}{WEIGHT_SHORT} {BLACK}힘: {LTBLUE}{POWER}{BLACK} 최고 속력: {LTBLUE}{VELOCITY} {BLACK}최고 견인력: {LTBLUE}{FORCE} STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}올해 이익: {LTBLUE}{CURRENCY_LONG} (작년: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}올해 이익: {LTBLUE}{CURRENCY_LONG} (작년: {CURRENCY_LONG}) {BLACK}최소 성취도: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}신뢰도: {LTBLUE}{COMMA}% {BLACK}최근 점검 이후 고장 횟수: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}생산: {LTBLUE}{NUM}{BLACK} 가격: {LTBLUE}{CURRENCY_LONG} diff --git a/src/lang/russian.txt b/src/lang/russian.txt index e633f26999..91845fe800 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -1155,6 +1155,11 @@ STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Виде +STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_2X :2x +STR_GAME_OPTIONS_GUI_SCALE_3X :3x +STR_GAME_OPTIONS_GUI_SCALE_4X :4x +STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Настройки графики @@ -3644,14 +3649,14 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Купить э STR_LOCAL_AUTHORITY_ACTION_BRIBE :Взятка местной администрации ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}Провести малую рекламную кампанию для увеличения грузо- и пассажиропотока на ваших станциях.{}Она временно повысит рейтинг ваших станций, построенных рядом с центром города.{}Стоимость: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Провести среднюю рекламную кампанию для увеличения грузо- и пассажиропотока на ваших станциях.{}Она временно повысит рейтинг ваших станций, находящихся не очень далеко от центра города.{}Стоимость: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Провести большую рекламную кампанию для увеличения грузо- и пассажиропотока на ваших станциях.{}Она временно повысит рейтинг ваших станций на значительной площади в городе и окрестностях.{}Стоимость: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}Профинансировать реконструкцию городских дорог.{}Вызывает большие нарушения движения на срок до 6 месяцев.{}Стоимость: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Установить статую в честь вашей компании.{}Она добавит рейтинг вашим станциям.{}Стоимость: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}Профинансировать строительство новых зданий.{}Это временно ускорит рост города.{}Стоимость: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Купить годовые эксклюзивные права на транспортные перевозки в городе.{}Администрация разрешит пользоваться ТОЛЬКО вашими станциями.{}Стоимость: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Дать взятку городской администрации для повышения рейтинга. Существует риск санкций, если факт подкупа раскроется.{}Цена: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW}Провести малую рекламную кампанию для увеличения грузо- и пассажиропотока на ваших станциях.{}Она временно повысит рейтинг ваших станций, построенных рядом с центром города.{}{POP_COLOUR}Стоимость: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{PUSH_COLOUR}{YELLOW}Провести среднюю рекламную кампанию для увеличения грузо- и пассажиропотока на ваших станциях.{}Она временно повысит рейтинг ваших станций, находящихся не очень далеко от центра города.{}{POP_COLOUR}Стоимость: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{PUSH_COLOUR}{YELLOW}Провести большую рекламную кампанию для увеличения грузо- и пассажиропотока на ваших станциях.{}Она временно повысит рейтинг ваших станций на значительной площади в городе и окрестностях.{}{POP_COLOUR}Стоимость: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW}Профинансировать реконструкцию городских дорог.{}Вызывает большие нарушения движения на срок до 6 месяцев.{}{POP_COLOUR}Стоимость: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{PUSH_COLOUR}{YELLOW}Установить статую в честь вашей компании.{}Она добавит рейтинг вашим станциям.{}{POP_COLOUR}Стоимость: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{PUSH_COLOUR}{YELLOW}Профинансировать строительство новых зданий.{}Это временно ускорит рост города.{}{POP_COLOUR}Стоимость: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW}Приобрести годовые эксклюзивные права на транспортные перевозки в городе.{}Городская администрация разрешит пользоваться ТОЛЬКО вашими станциями.{}{POP_COLOUR}Стоимость: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}Дать взятку городской администрации для повышения рейтинга. Существует риск санкций, если факт подкупа раскроется.{}{POP_COLOUR}Цена: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}Задачи компании «{COMPANY}» diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index 2b2f65d667..151b06c834 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -201,6 +201,15 @@ STR_UNITS_POWER_IMPERIAL :{COMMA}{NBSP}hp STR_UNITS_POWER_METRIC :{COMMA}{NBSP}cv STR_UNITS_POWER_SI :{COMMA}{NBSP}kW +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg +STR_UNITS_POWER_METRIC_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg +STR_UNITS_POWER_SI_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_SI :{DECIMAL}{NBSP}W/kg STR_UNITS_WEIGHT_SHORT_IMPERIAL :{COMMA}{NBSP}t STR_UNITS_WEIGHT_SHORT_METRIC :{COMMA}{NBSP}t @@ -227,9 +236,9 @@ STR_UNITS_HEIGHT_METRIC :{COMMA}{NBSP}m STR_UNITS_HEIGHT_SI :{COMMA}{NBSP}m # Common window strings -STR_LIST_FILTER_TITLE :{BLACK}Patrón de filtrado: -STR_LIST_FILTER_OSKTITLE :{BLACK}Escribe un patrón de filtrado -STR_LIST_FILTER_TOOLTIP :{BLACK}Introduzca una o varias palabras clave para filtrar la lista +STR_LIST_FILTER_TITLE :{BLACK}Filtro: +STR_LIST_FILTER_OSKTITLE :{BLACK}Introduce una o varias palabras clave para filtrar la lista +STR_LIST_FILTER_TOOLTIP :{BLACK}Introduce una o varias palabras clave para filtrar la lista STR_TOOLTIP_GROUP_ORDER :{BLACK}Selecciona la orden de agrupamiento STR_TOOLTIP_SORT_ORDER :{BLACK}Selecciona el orden de clasificación (descendiente/ascendiente) @@ -318,7 +327,7 @@ STR_SORT_BY_RANGE :Alcance STR_SORT_BY_POPULATION :Población STR_SORT_BY_RATING :Calificación STR_SORT_BY_NUM_VEHICLES :Número de vehículos -STR_SORT_BY_TOTAL_PROFIT_LAST_YEAR :Beneficio total del último año +STR_SORT_BY_TOTAL_PROFIT_LAST_YEAR :Beneficio total del año anterior STR_SORT_BY_TOTAL_PROFIT_THIS_YEAR :Beneficio total este año STR_SORT_BY_AVERAGE_PROFIT_LAST_YEAR :Beneficio medio el año pasado STR_SORT_BY_AVERAGE_PROFIT_THIS_YEAR :Beneficio medio este año @@ -396,6 +405,8 @@ STR_SCENEDIT_FILE_MENU_QUIT :Salir ###length 15 STR_SETTINGS_MENU_GAME_OPTIONS :Opciones de juego STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :Configuración +STR_SETTINGS_MENU_AI_SETTINGS :Configuración de IA +STR_SETTINGS_MENU_GAMESCRIPT_SETTINGS :{BLACK}Configuración de script de juego STR_SETTINGS_MENU_NEWGRF_SETTINGS :Configuración NewGRF STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Opciones de transparencia STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Ver nombres de municipios @@ -494,7 +505,7 @@ STR_NEWS_MENU_DELETE_ALL_MESSAGES :Borrar todos lo STR_ABOUT_MENU_LAND_BLOCK_INFO :Información del terreno STR_ABOUT_MENU_SEPARATOR : STR_ABOUT_MENU_TOGGLE_CONSOLE :Activar consola -STR_ABOUT_MENU_AI_DEBUG :Depuración de Script de juego / IA +STR_ABOUT_MENU_AI_DEBUG :Depuración de script de juego/IA STR_ABOUT_MENU_SCREENSHOT :Captura de pantalla STR_ABOUT_MENU_SHOW_FRAMERATE :Mostrar fotogramas por segundo - FPS STR_ABOUT_MENU_ABOUT_OPENTTD :Acerca de 'OpenTTD' @@ -982,7 +993,7 @@ STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Seleccio STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE :{STRING} ({NUM}% completo) STR_GAME_OPTIONS_FULLSCREEN :{BLACK}Pantalla completa -STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Marca esta opción para jugar OpenTTD a pantalla completa +STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Marca esta casilla para jugar OpenTTD a pantalla completa STR_GAME_OPTIONS_RESOLUTION :{BLACK}Resolución de pantalla STR_GAME_OPTIONS_RESOLUTION_TOOLTIP :{BLACK}Selecciona la resolución de pantalla a usar @@ -998,8 +1009,19 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Marca es STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Controlador actual: {STRING} +STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Tamaño de la interfaz +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Mueve el control deslizante para seleccionar el tamaño de la interfaz. Presiona Ctrl para seleccionar de forma continua +STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Autodetectar tamaño +STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Marca esta casilla para detectar automáticamente el tamaño de la interfaz +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Escalar bordes +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Marca esta casilla para escalar los bordes según el tamaño de la interfaz +STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_2X :2x +STR_GAME_OPTIONS_GUI_SCALE_3X :3x +STR_GAME_OPTIONS_GUI_SCALE_4X :4x +STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Gráficos @@ -1125,7 +1147,7 @@ STR_WARNING_NO_SUITABLE_AI :{WHITE}No se ha # Settings tree window STR_CONFIG_SETTING_TREE_CAPTION :{WHITE}Configuración -STR_CONFIG_SETTING_FILTER_TITLE :{BLACK}Patrón de filtrado: +STR_CONFIG_SETTING_FILTER_TITLE :{BLACK}Filtro: STR_CONFIG_SETTING_EXPAND_ALL :{BLACK}Expandir todos STR_CONFIG_SETTING_COLLAPSE_ALL :{BLACK}Colapsar todos STR_CONFIG_SETTING_RESET_ALL :{BLACK}Restablecer valores @@ -1669,7 +1691,7 @@ STR_CONFIG_SETTING_AI_BUILDS_SHIPS :Desactivar barc STR_CONFIG_SETTING_AI_BUILDS_SHIPS_HELPTEXT :Activa esta opción para deshabilitar la construcción de barcos para las IA STR_CONFIG_SETTING_AI_PROFILE :Perfil por defecto: {STRING} -STR_CONFIG_SETTING_AI_PROFILE_HELPTEXT :Selecciona el perfil a usar para IA aleatorias o para los valores iniciales cuando se añade una nueva IA o un Script de juego +STR_CONFIG_SETTING_AI_PROFILE_HELPTEXT :Selecciona el perfil a usar para IA aleatorias o para los valores iniciales cuando se añade una nueva IA o un script de juego ###length 3 STR_CONFIG_SETTING_AI_PROFILE_EASY :Fácil STR_CONFIG_SETTING_AI_PROFILE_MEDIUM :Intermedio @@ -2046,6 +2068,8 @@ STR_INTRO_HIGHSCORE :{BLACK}Tabla de STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Configuración STR_INTRO_NEWGRF_SETTINGS :{BLACK}Configuración NewGRF STR_INTRO_ONLINE_CONTENT :{BLACK}Contenido Online +STR_INTRO_AI_SETTINGS :{BLACK}Configuración de IA +STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}Scripts de juego STR_INTRO_QUIT :{BLACK}Salir STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Comeenza una partida nueva. Ctrl+clic omite la configuración del escenario @@ -2063,8 +2087,10 @@ STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE :{BLACK}Seleccio STR_INTRO_TOOLTIP_GAME_OPTIONS :{BLACK}Muestra las opciones de juego STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Muestra la tabla de puntuaciones STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Muestra la configuración -STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Muestra los ajustes de NewGRF +STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Muestra la configuración de NewGRF STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Comprueba si hay contenidos nuevos y actualizados para descargar +STR_INTRO_TOOLTIP_AI_SETTINGS :{BLACK}Muestra la configuración de IA +STR_INTRO_TOOLTIP_GAMESCRIPT_SETTINGS :{BLACK}Muestra la configuración de script de juego STR_INTRO_TOOLTIP_QUIT :{BLACK}Salir de 'OpenTTD' STR_INTRO_BASESET :{BLACK}El conjunto de gráficos base actualmente seleccionado no encuentra {NUM} sprite{P "" s}. Comprueba si hay actualizaciones para el conjunto base, o usa otro totalmente actualizado. @@ -2488,7 +2514,7 @@ STR_CONTENT_SEARCH_EXTERNAL :{BLACK}Buscar e STR_CONTENT_SEARCH_EXTERNAL_TOOLTIP :{BLACK}Busca contenido no disponible en el servicio de contenido de OpenTTD en páginas externas no asociadas con OpenTTD STR_CONTENT_SEARCH_EXTERNAL_DISCLAIMER_CAPTION :{WHITE}¡Estás abandonando OpenTTD! STR_CONTENT_SEARCH_EXTERNAL_DISCLAIMER :{WHITE}Los términos y condiciones para descargar contenido de páginas externas varían.{}Será necesario consultar dichas páginas para obtener instrucciones de cómo instalar el contenido en OpenTTD.{}¿Desea continuar? -STR_CONTENT_FILTER_TITLE :{BLACK}Etiqueta/nombre del filtro +STR_CONTENT_FILTER_TITLE :{BLACK}Filtro de etiqueta/nombre: STR_CONTENT_OPEN_URL :{BLACK}Visitar web STR_CONTENT_OPEN_URL_TOOLTIP :{BLACK}Visitar la página web de este contenido STR_CONTENT_DOWNLOAD_CAPTION :{BLACK}Descargar @@ -2576,7 +2602,9 @@ STR_LINKGRAPH_LEGEND_SATURATED :{TINY_FONT}{BLA STR_LINKGRAPH_LEGEND_OVERLOADED :{TINY_FONT}{BLACK}sobrecargado # Linkgraph tooltip -STR_LINKGRAPH_STATS_TOOLTIP_TIME_EXTENSION :{}Tiempo medio de viaje: {NUM}{NBSP}día{P "" s} +STR_LINKGRAPH_STATS_TOOLTIP :{BLACK}{CARGO_LONG} para ser transportad{G 0 o a}{P 0 "" s} al mes desde {STATION} a {STATION} ({COMMA}% de la capacidad){STRING} +STR_LINKGRAPH_STATS_TOOLTIP_RETURN_EXTENSION :{}{CARGO_LONG} para ser transportad{G 0 o a}{P 0 "" s}) de vuelta ({COMMA}% de la capacidad) +STR_LINKGRAPH_STATS_TOOLTIP_TIME_EXTENSION :{}Tiempo de viaje promedio: {NUM}{NBSP}día{P "" s} # Base for station construction window(s) STR_STATION_BUILD_COVERAGE_AREA_TITLE :{BLACK}Mostrar área de cobertura @@ -3086,7 +3114,7 @@ STR_SAVELOAD_DETAIL_CAPTION :{BLACK}Detalles STR_SAVELOAD_DETAIL_NOT_AVAILABLE :{BLACK}No hay información disponible STR_SAVELOAD_DETAIL_COMPANY_INDEX :{SILVER}{COMMA}: {WHITE}{STRING} STR_SAVELOAD_DETAIL_GRFSTATUS :{SILVER}NewGRF: {WHITE}{STRING} -STR_SAVELOAD_FILTER_TITLE :{BLACK}Patrón de filtrado: +STR_SAVELOAD_FILTER_TITLE :{BLACK}Filtro: STR_SAVELOAD_OVERWRITE_TITLE :{WHITE}Sobrescribir Archivo STR_SAVELOAD_OVERWRITE_WARNING :{YELLOW}¿Estás seguro de que quieres sobrescribir el archivo existente? STR_SAVELOAD_DIRECTORY :{STRING} (Directorio) @@ -3122,6 +3150,12 @@ STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}Ríos: STR_MAPGEN_SMOOTHNESS :{BLACK}Uniformidad: STR_MAPGEN_VARIETY :{BLACK}Variedad: STR_MAPGEN_GENERATE :{WHITE}Generar +STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}Configuración de NewGRF +STR_MAPGEN_NEWGRF_SETTINGS_TOOLTIP :{BLACK}Muestra la configuración de NewGRF +STR_MAPGEN_AI_SETTINGS :{BLACK}Configuración de IA +STR_MAPGEN_AI_SETTINGS_TOOLTIP :{BLACK}Muestra la configuración de IA +STR_MAPGEN_GS_SETTINGS :{BLACK}Configuración de script de juego +STR_MAPGEN_GS_SETTINGS_TOOLTIP :{BLACK}Muestra la configuración de script de juego ###length 21 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH :Inglés @@ -3203,7 +3237,7 @@ STR_NEWGRF_SETTINGS_INFO_TITLE :{WHITE}Informac STR_NEWGRF_SETTINGS_ACTIVE_LIST :{WHITE}Archivos NewGRF activos STR_NEWGRF_SETTINGS_INACTIVE_LIST :{WHITE}Archivos NewGRF inactivos STR_NEWGRF_SETTINGS_SELECT_PRESET :{ORANGE}Seleccionar configuración: -STR_NEWGRF_FILTER_TITLE :{ORANGE}Patrón de filtrado: +STR_NEWGRF_FILTER_TITLE :{ORANGE}Filtro: STR_NEWGRF_SETTINGS_PRESET_LIST_TOOLTIP :{BLACK}Cargar la configuración seleccionada STR_NEWGRF_SETTINGS_PRESET_SAVE :{BLACK}Guardar STR_NEWGRF_SETTINGS_PRESET_SAVE_TOOLTIP :{BLACK}Guardar la lista actual como configuración @@ -3447,14 +3481,14 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Comprar derecho STR_LOCAL_AUTHORITY_ACTION_BRIBE :Sobornar a la autoridad local ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}Inicia una campaña publicitaria local pequeña para atraer más pasajeros y carga a sus servicios de transporte.{}Proporciona un incremento temporal en la calificación de las estaciones en un radio pequeño alrededor del centro del municipio.{}Coste: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Inicia una campaña publicitaria local mediana para atraer más pasajeros y carga a sus servicios de transporte.{}Proporciona un incremento temporal en la calificación de las estaciones en un radio mediano alrededor del centro del municipio.{}Coste: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Inicia una campaña publicitaria local grande para atraer más pasajeros y carga a sus servicios de transporte.{}Proporciona un incremento temporal en la calificación de las estaciones en un radio grande alrededor del centro del municipio.{}Coste: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}Paga la reconstrucción de las carreteras locales.{}Provoca considerables complicaciones de tráfico durante 6 meses.{}Coste: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Construye una estatua en honor a su empresa.{}Proporciona un incremento permanente en la calificación de las estaciones de este municipio.{}Coste: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}Paga la construcción de nuevos edificios comerciales en el municipio.{}Proporciona un incremento temporal en el crecimiento del municipio.{}Coste: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Compra derechos de transporte exclusivos en este municipio durante un año.{}Las autoridades no permitirán el uso de las estaciones de la competencia.{}Coste: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Soborna a las autoridades locales para aumentar su calificación, con el riesgo de sufrir una penalización severa si es descubierto.{}Coste: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW}Inicia una campaña publicitaria local pequeña para atraer más pasajeros y carga a sus servicios de transporte.{}Proporciona un incremento temporal en la calificación de las estaciones en un radio pequeño alrededor del centro del municipio.{}{POP_COLOUR}Coste: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{PUSH_COLOUR}{YELLOW}Inicia una campaña publicitaria local mediana para atraer más pasajeros y carga a sus servicios de transporte.{}Proporciona un incremento temporal en la calificación de las estaciones en un radio mediano alrededor del centro del municipio.{}{POP_COLOUR}Coste: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{PUSH_COLOUR}{YELLOW}Inicia una campaña publicitaria local grande para atraer más pasajeros y carga a sus servicios de transporte.{}Proporciona un incremento temporal en la calificación de las estaciones en un radio grande alrededor del centro del municipio.{}{POP_COLOUR}Coste: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW}Paga la reconstrucción de las carreteras locales.{}Provoca considerables complicaciones de tráfico durante 6 meses.{}{POP_COLOUR}Coste: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{PUSH_COLOUR}{YELLOW}Construye una estatua en honor a su empresa.{}Proporciona un incremento permanente en la calificación de las estaciones de este municipio.{}{POP_COLOUR}Coste: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{PUSH_COLOUR}{YELLOW}Paga la construcción de nuevos edificios comerciales en el municipio.{}Proporciona un incremento temporal en el crecimiento del municipio.{}{POP_COLOUR}Coste: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW}Compra derechos de transporte exclusivos en este municipio durante un año.{}Las autoridades no permitirán el uso de las estaciones de la competencia.{}{POP_COLOUR}Coste: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}Soborna a las autoridades locales para aumentar su calificación, con el riesgo de sufrir una penalización severa si es descubierto.{}{POP_COLOUR}Coste: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}Objetivos de {COMPANY} @@ -3766,7 +3800,7 @@ STR_VEHICLE_LIST_MANAGE_LIST :{BLACK}Administ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Envia instrucciones a todos los vehículos de la lista STR_VEHICLE_LIST_REPLACE_VEHICLES :Reemplazar vehículos STR_VEHICLE_LIST_SEND_FOR_SERVICING :Enviar para Mantenimiento -STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Beneficio este año: {CURRENCY_LONG} (último año: {CURRENCY_LONG}) +STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Beneficio este año: {CURRENCY_LONG} (año anterior: {CURRENCY_LONG}) STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Enviar a Depósito STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Enviar a Depósito @@ -3810,7 +3844,7 @@ STR_GROUP_REMOVE_ALL_VEHICLES :Quitar todos lo STR_GROUP_RENAME_CAPTION :{BLACK}Renombrar un grupo STR_GROUP_PROFIT_THIS_YEAR :Beneficio este año: -STR_GROUP_PROFIT_LAST_YEAR :Beneficio del año pasado: +STR_GROUP_PROFIT_LAST_YEAR :Beneficio del año anterior: STR_GROUP_OCCUPANCY :Utilización actual: STR_GROUP_OCCUPANCY_VALUE :{NUM}% @@ -3859,6 +3893,9 @@ STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Alcance: STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}Tipo de aeronave: {GOLD}{STRING} ###length 3 +STR_CARGO_TYPE_FILTER_ALL :Todos los tipos +STR_CARGO_TYPE_FILTER_FREIGHT :Carga +STR_CARGO_TYPE_FILTER_NONE :Ninguno ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Lista de selección de los vehículos de ferrocarril. Clica en el vehículo para más información. Pulsa Ctrl+clic para mostrar/ocultar el tipo del vehículo @@ -4186,7 +4223,8 @@ STR_VEHICLE_INFO_MAX_SPEED_TYPE_RANGE :{BLACK}Velocida STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Peso: {LTBLUE}{WEIGHT_SHORT} {BLACK}Potencia: {LTBLUE}{POWER}{BLACK} Velocidad Máx.: {LTBLUE}{VELOCITY} STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Peso: {LTBLUE}{WEIGHT_SHORT} {BLACK}Potencia: {LTBLUE}{POWER}{BLACK} Velocidad Máx.: {LTBLUE}{VELOCITY} {BLACK}F.T. Máx.: {LTBLUE}{FORCE} -STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Beneficio este año: {LTBLUE}{CURRENCY_LONG} (último año: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Beneficio este año: {LTBLUE}{CURRENCY_LONG} (año anterior: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Beneficio este año: {LTBLUE}{CURRENCY_LONG} (año anterior: {CURRENCY_LONG}) {BLACK}Mín. rendimiento: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Fiabilidad: {LTBLUE}{COMMA}% {BLACK}Averías desde el último mantenimiento: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Construido: {LTBLUE}{NUM}{BLACK} Valor: {LTBLUE}{CURRENCY_LONG} @@ -4458,7 +4496,7 @@ STR_TIMETABLE_STATUS_NOT_STARTED :{BLACK}Este hor STR_TIMETABLE_STATUS_START_AT :{BLACK}Este horario comenzará el {STRING} STR_TIMETABLE_STARTING_DATE :{BLACK}Fecha de inicio -STR_TIMETABLE_STARTING_DATE_TOOLTIP :{BLACK}Selecciona una fecha como punto de partida de este horario. Ctrl+clic permite fijar el punto de partida de este horario y distribuye todos los vehículos que lo compartan siempre y cuando el horario esté completo +STR_TIMETABLE_STARTING_DATE_TOOLTIP :{BLACK}Selecciona la fecha de inicio del horario. Ctrl+click distribuye uniformemente todos los vehículos que compartan este horario a partir de la fecha proporcionada, basados en su orden relativo, siempre que el horario esté completo STR_TIMETABLE_CHANGE_TIME :{BLACK}Cambiar duración STR_TIMETABLE_WAIT_TIME_TOOLTIP :{BLACK}Cambia la duración de la orden seleccionada @@ -4489,14 +4527,14 @@ STR_TIMETABLE_DEPARTURE_ABBREVIATION :S: # Date window (for timetable) STR_DATE_CAPTION :{WHITE}Seleccionar fecha STR_DATE_SET_DATE :{BLACK}Seleccionar fecha -STR_DATE_SET_DATE_TOOLTIP :{BLACK}Usar la fecha seleccionada como punto de inicio del horario +STR_DATE_SET_DATE_TOOLTIP :{BLACK}Usa la fecha seleccionada como punto de inicio del horario STR_DATE_DAY_TOOLTIP :{BLACK}Selecciona el día STR_DATE_MONTH_TOOLTIP :{BLACK}Selecciona el mes STR_DATE_YEAR_TOOLTIP :{BLACK}Selecciona el año # AI debug window -STR_AI_DEBUG :{WHITE}Depuración de Scripts de juego/IA +STR_AI_DEBUG :{WHITE}Depuración de scripts de juego/IA STR_AI_DEBUG_NAME_AND_VERSION :{BLACK}{STRING} (v{NUM}) STR_AI_DEBUG_NAME_TOOLTIP :{BLACK}Nombre del script STR_AI_DEBUG_SETTINGS :{BLACK}Configuración @@ -4513,13 +4551,15 @@ STR_AI_DEBUG_CONTINUE :{BLACK}Continua STR_AI_DEBUG_CONTINUE_TOOLTIP :{BLACK}Quita la pausa y hace que la IA continúe STR_AI_DEBUG_SELECT_AI_TOOLTIP :{BLACK}Mostrar salida de depuración de esta IA STR_AI_GAME_SCRIPT :{BLACK}Script de juego -STR_AI_GAME_SCRIPT_TOOLTIP :{BLACK}Comprobar el registro del Script de juego +STR_AI_GAME_SCRIPT_TOOLTIP :{BLACK}Analizar el registro del script de juego STR_ERROR_AI_NO_AI_FOUND :No se encontró ninguna IA apropiada para cargar.{}Ésta es una IA por defecto que no realiza acción alguna.{}Puedes descargar nuevas IA mediante el sistema de 'Contenido Online' -STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Uno de los scripts ejecutados ha fallado. Por favor, informa del fallo al autor del script con una captura de la ventana de depuración de Script / IA -STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}La ventana de depuración de Scripts solo está disponible para el servidor +STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Uno de los scripts ejecutados ha fallado. Por favor, informa del fallo al autor del script con una captura de la ventana de depuración de script/IA +STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}La ventana de depuración de scripts solo está disponible para el servidor # AI configuration window +STR_AI_CONFIG_CAPTION_AI :{WHITE}Configuración de IA +STR_AI_CONFIG_CAPTION_GAMESCRIPT :{WHITE}Configuración de scripts de juego STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}Script de juego que será cargado en la próxima partida STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}IA que serán cargadas en la próxima partida STR_AI_CONFIG_HUMAN_PLAYER :Jugador humano @@ -4533,10 +4573,11 @@ STR_AI_CONFIG_MOVE_DOWN :{BLACK}Mover ha STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}Mover la IA seleccionada hacia abajo STR_AI_CONFIG_GAMESCRIPT :{SILVER}Script de juego +STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}Parámetros STR_AI_CONFIG_AI :{SILVER}IA -STR_AI_CONFIG_CHANGE_AI :IA -STR_AI_CONFIG_CHANGE_GAMESCRIPT :Script de juego +STR_AI_CONFIG_CHANGE_AI :{BLACK}Seleccionar IA +STR_AI_CONFIG_CHANGE_GAMESCRIPT :{BLACK}Selecciona script de juego STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Cargar otro script STR_AI_CONFIG_CONFIGURE :{BLACK}Configurar STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}Configura los parámetros del script @@ -4565,7 +4606,7 @@ STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Mapa de STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Minimapa # AI Parameters -STR_AI_SETTINGS_CAPTION_AI :IA +STR_AI_SETTINGS_CAPTION_AI :{WHITE}Parámetros de IA STR_AI_SETTINGS_CLOSE :{BLACK}Cerrar STR_AI_SETTINGS_RESET :{BLACK}Reiniciar STR_AI_SETTINGS_SETTING :{STRING}: {ORANGE}{STRING} diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index c912c948d9..d59df70c36 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -1009,8 +1009,15 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Activar STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Controlador actual: {STRING} +STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Detectar automáticamente +STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Detectar tamaño de la interfaz automáticamente +STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_2X :2x +STR_GAME_OPTIONS_GUI_SCALE_3X :3x +STR_GAME_OPTIONS_GUI_SCALE_4X :4x +STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Gráficos From bba1a16836d02b4cb97ec5acd44dd46f3105d01a Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sun, 13 Nov 2022 07:49:47 -0700 Subject: [PATCH 15/42] Change: Make Company GUI Bank Balance text white --- src/company_gui.cpp | 2 +- src/lang/english.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index e5f30e3324..07899a8675 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -310,7 +310,7 @@ static const NWidgetPart _nested_company_finances_widgets[] = { NWidget(WWT_TEXT, COLOUR_GREY, WID_CF_OWN_VALUE), SetDataTip(STR_FINANCES_TOTAL_CURRENCY, STR_NULL), SetAlignment(SA_VERT_CENTER | SA_RIGHT), NWidget(WWT_TEXT, COLOUR_GREY, WID_CF_LOAN_VALUE), SetDataTip(STR_FINANCES_TOTAL_CURRENCY, STR_NULL), SetAlignment(SA_VERT_CENTER | SA_RIGHT), NWidget(WWT_EMPTY, COLOUR_GREY, WID_CF_BALANCE_LINE), SetMinimalSize(0, 2), SetFill(1, 0), - NWidget(WWT_TEXT, COLOUR_GREY, WID_CF_BALANCE_VALUE), SetDataTip(STR_FINANCES_TOTAL_CURRENCY, STR_NULL), SetAlignment(SA_VERT_CENTER | SA_RIGHT), + NWidget(WWT_TEXT, COLOUR_GREY, WID_CF_BALANCE_VALUE), SetDataTip(STR_FINANCES_BANK_BALANCE, STR_NULL), SetAlignment(SA_VERT_CENTER | SA_RIGHT), EndContainer(), NWidget(NWID_SELECTION, INVALID_COLOUR, WID_CF_SEL_MAXLOAN), NWidget(NWID_HORIZONTAL), diff --git a/src/lang/english.txt b/src/lang/english.txt index bb85c04ca0..dc8f05d84d 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3670,6 +3670,7 @@ STR_FINANCES_LOAN_TITLE :{WHITE}Loan STR_FINANCES_INTEREST_RATE :{WHITE}Loan Interest: {BLACK}{NUM}% STR_FINANCES_MAX_LOAN :{WHITE}Maximum Loan: {BLACK}{CURRENCY_LONG} STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} +STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}Borrow {CURRENCY_LONG} STR_FINANCES_BORROW_TOOLTIP :{BLACK}Increase size of loan. Ctrl+Click borrows as much as possible STR_FINANCES_REPAY_BUTTON :{BLACK}Repay {CURRENCY_LONG} From adf94d7970a59286e2a957ee0caf1adec91bf576 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sun, 13 Nov 2022 08:25:04 -0700 Subject: [PATCH 16/42] Change: Add a Total caption to each category of the finance window --- src/company_gui.cpp | 8 ++++++-- src/lang/english.txt | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 07899a8675..8aa5e97ff7 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -186,8 +186,12 @@ static void DrawCategories(const Rect &r) DrawCategory(r, y, _expenses_list_types[i]); y += _expenses_list_types[i].GetHeight(); - /* Advance y by the height of the total and associated total line */ - y += WidgetDimensions::scaled.vsep_normal + FONT_HEIGHT_NORMAL; + /* Advance y by the height of the horizontal line between amounts and subtotal */ + y += WidgetDimensions::scaled.vsep_normal; + + /* Draw category total and advance y */ + DrawString(r.left, r.right, y, STR_FINANCES_TOTAL_CAPTION, TC_FROMSTRING, SA_RIGHT); + y += FONT_HEIGHT_NORMAL; /* Advance y by a blockspace after this category block */ y += WidgetDimensions::scaled.vsep_wide; diff --git a/src/lang/english.txt b/src/lang/english.txt index dc8f05d84d..bb8eb4c1dd 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3660,6 +3660,7 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}Ships STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}Loan Interest STR_FINANCES_SECTION_OTHER :{GOLD}Other +STR_FINANCES_TOTAL_CAPTION :{WHITE}Total STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} From 0d631a6fda92420fe2c5201f3e5dfd0507ceb621 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sun, 13 Nov 2022 08:32:32 -0700 Subject: [PATCH 17/42] Change: Reword Finance window's Net Profit to Profit --- src/company_gui.cpp | 2 +- src/lang/english.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 8aa5e97ff7..bf43af43d4 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -199,7 +199,7 @@ static void DrawCategories(const Rect &r) /* Draw total profit/loss */ y += WidgetDimensions::scaled.vsep_normal; - DrawString(r.left, r.right, y, STR_FINANCES_NET_PROFIT, TC_FROMSTRING, SA_LEFT); + DrawString(r.left, r.right, y, STR_FINANCES_PROFIT, TC_FROMSTRING, SA_LEFT); } /** diff --git a/src/lang/english.txt b/src/lang/english.txt index bb8eb4c1dd..96eb124257 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3664,7 +3664,7 @@ STR_FINANCES_TOTAL_CAPTION :{WHITE}Total STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Net Profit +STR_FINANCES_PROFIT :{WHITE}Profit STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Bank Balance STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Own Funds STR_FINANCES_LOAN_TITLE :{WHITE}Loan From cbb2d5303d2496bb88a1bdeeae9b89131a7180e5 Mon Sep 17 00:00:00 2001 From: translators Date: Mon, 14 Nov 2022 18:50:11 +0000 Subject: [PATCH 18/42] Update: Translations from eints spanish (mexican): 14 changes by absay english (us): 20 changes by 2TallTyler russian: 5 changes by Ln-Wolf portuguese: 44 changes by azulcosta --- src/lang/brazilian_portuguese.txt | 1 - src/lang/catalan.txt | 1 - src/lang/czech.txt | 1 - src/lang/dutch.txt | 1 - src/lang/english_AU.txt | 1 - src/lang/english_US.txt | 29 ++++++++++----- src/lang/finnish.txt | 1 - src/lang/french.txt | 1 - src/lang/galician.txt | 1 - src/lang/german.txt | 1 - src/lang/hungarian.txt | 1 - src/lang/indonesian.txt | 1 - src/lang/italian.txt | 1 - src/lang/korean.txt | 1 - src/lang/latvian.txt | 1 - src/lang/polish.txt | 1 - src/lang/portuguese.txt | 62 ++++++++++++++++++++++--------- src/lang/romanian.txt | 1 - src/lang/russian.txt | 6 ++- src/lang/simplified_chinese.txt | 1 - src/lang/slovak.txt | 1 - src/lang/spanish.txt | 1 - src/lang/spanish_MX.txt | 24 +++++++----- src/lang/swedish.txt | 1 - src/lang/traditional_chinese.txt | 1 - src/lang/turkish.txt | 1 - src/lang/vietnamese.txt | 1 - 27 files changed, 83 insertions(+), 61 deletions(-) diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index 29b49f7517..17f6b646fe 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -3627,7 +3627,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Outros STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Lucro Líquido STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Balanço Bancário STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Fundos Próprios STR_FINANCES_LOAN_TITLE :{WHITE}Empréstimo diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index 7aaf5c1ba6..ff37e6e361 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -3631,7 +3631,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Altres STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Benefici net STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Balanç bancari STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Fons propis STR_FINANCES_LOAN_TITLE :{WHITE}Préstec diff --git a/src/lang/czech.txt b/src/lang/czech.txt index d820cd2059..2c01ad644c 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -3719,7 +3719,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Další STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Čistý zisk STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Stav na účtu STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Vlastní Prostředky STR_FINANCES_LOAN_TITLE :{WHITE}Půjčka diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index 505d040e72..b44115141b 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -3640,7 +3640,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Overig STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Nettowinst STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Banksaldo STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Eigen kapitaal STR_FINANCES_LOAN_TITLE :{WHITE}Lening diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index f5c0b9d4f7..f612ec0195 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -3663,7 +3663,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Other STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Net Profit STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Bank Balance STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Own Funds STR_FINANCES_LOAN_TITLE :{WHITE}Loan diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index 415f5d3fd8..585c47391e 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -1008,8 +1008,19 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Check th STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Current driver: {STRING} +STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Interface size +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Drag slider to set interface size. Hold Ctrl for continuous adjustment +STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Auto-detect size +STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Check this box to detect interface size automatically +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Scale bevels +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Check this box to scale bevels by interface size +STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_2X :2x +STR_GAME_OPTIONS_GUI_SCALE_3X :3x +STR_GAME_OPTIONS_GUI_SCALE_4X :4x +STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Graphics @@ -1513,7 +1524,7 @@ STR_CONFIG_SETTING_LINKGRAPH_COLOURS_GREEN_TO_BLUE :Green to blue STR_CONFIG_SETTING_LINKGRAPH_COLOURS_GREY_TO_RED :Gray to red STR_CONFIG_SETTING_LINKGRAPH_COLOURS_GREYSCALE :Grayscale -STR_CONFIG_SETTING_SCROLLMODE :Viewport scroll behaviour: {STRING} +STR_CONFIG_SETTING_SCROLLMODE :Viewport scroll behavior: {STRING} STR_CONFIG_SETTING_SCROLLMODE_HELPTEXT :Behavior when scrolling the map ###length 4 STR_CONFIG_SETTING_SCROLLMODE_DEFAULT :Move viewport with RMB, mouse position locked @@ -3469,14 +3480,14 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Buy exclusive t STR_LOCAL_AUTHORITY_ACTION_BRIBE :Bribe the local authority ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}Initiate a small local advertising campaign, to attract more passengers and cargo to your transport services.{}Provides a temporary boost to station rating in a small radius around the town center.{}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW}Initiate a small local advertising campaign, to attract more passengers and cargo to your transport services.{}Provides a temporary boost to station rating in a small radius around the town center.{}{POP_COLOUR}Cost: {CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Initiate a medium local advertising campaign, to attract more passengers and cargo to your transport services.{}Provides a temporary boost to station rating in a medium radius around the town center.{}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Initiate a large local advertising campaign, to attract more passengers and cargo to your transport services.{}Provides a temporary boost to station rating in a large radius around the town center.{}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}Fund the reconstruction of the urban road network.{}Causes considerable disruption to road traffic for up to 6 months.{}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Build a statue in honor of your company.{}Provides a permanent boost to station rating in this town.{}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}Fund the construction of new buildings in the town.{}Provides a temporary boost to town growth in this town.{}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Buy 1 year's exclusive transport rights in town.{}Town authority will not allow passengers and cargo to use your competitors' stations.{}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Bribe the local authority to increase your rating, at the risk of a severe penalty if caught.{}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{PUSH_COLOUR}{YELLOW}Initiate a large local advertising campaign, to attract more passengers and cargo to your transport services.{}Provides a temporary boost to station rating in a large radius around the town center.{}{POP_COLOUR}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW}Fund the reconstruction of the urban road network.{}Causes considerable disruption to road traffic for up to 6 months.{}{POP_COLOUR}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{PUSH_COLOUR}{YELLOW}Build a statue in honor of your company.{}Provides a permanent boost to station rating in this town.{}{POP_COLOUR}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{PUSH_COLOUR}{YELLOW}Fund the construction of new buildings in the town.{}Provides a temporary boost to town growth in this town.{}{POP_COLOUR}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW}Buy 1 year's exclusive transport rights in town.{}Town authority will not allow passengers and cargo to use your competitors' stations.{}{POP_COLOUR}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}Bribe the local authority to increase your rating, at the risk of a severe penalty if caught.{}{POP_COLOUR}Cost: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} Goals @@ -3652,7 +3663,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Other STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Net Profit STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Bank Balance STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Own Funds STR_FINANCES_LOAN_TITLE :{WHITE}Loan @@ -4212,6 +4222,7 @@ STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Weight: STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Weight: {LTBLUE}{WEIGHT_SHORT} {BLACK}Power: {LTBLUE}{POWER}{BLACK} Max. speed: {LTBLUE}{VELOCITY} {BLACK}Max. T.E.: {LTBLUE}{FORCE} STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Profit this year: {LTBLUE}{CURRENCY_LONG} (last year: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Profit this year: {LTBLUE}{CURRENCY_LONG} (last year: {CURRENCY_LONG}) {BLACK}Min. performance: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Reliability: {LTBLUE}{COMMA}% {BLACK}Breakdowns since last maintenance: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Built: {LTBLUE}{NUM}{BLACK} Value: {LTBLUE}{CURRENCY_LONG} diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index 113c7b8d33..4e1330b2b5 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -3626,7 +3626,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Muut STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Puhdas voitto STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Tilin saldo STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Omat varat STR_FINANCES_LOAN_TITLE :{WHITE}Laina diff --git a/src/lang/french.txt b/src/lang/french.txt index 433def32a3..0fdcfecc8c 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -3653,7 +3653,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Autres STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Bénéfice net STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Solde bancaire STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Fonds propres STR_FINANCES_LOAN_TITLE :{WHITE}Emprunt diff --git a/src/lang/galician.txt b/src/lang/galician.txt index 591fee5804..606b3cdd97 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -3627,7 +3627,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Outros STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Beneficio neto STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Balance bancario STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Fondos propios STR_FINANCES_LOAN_TITLE :{WHITE}Préstamo diff --git a/src/lang/german.txt b/src/lang/german.txt index 51b3fdc3ad..5e84c7ee83 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -3632,7 +3632,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Sonstiges STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Reingewinn STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Kontostand STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Eigenes Kapital STR_FINANCES_LOAN_TITLE :{WHITE}Kredit diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index 522189c58b..5aa59be745 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -3695,7 +3695,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Egyéb STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Nettó Profit STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Banki egyenleg STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Saját források STR_FINANCES_LOAN_TITLE :{WHITE}Kölcsön diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index fd39d2ca88..c6eb2c5c58 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -3626,7 +3626,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Lainnya STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Laba bersih STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Saldo Bank STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Dana Pribadi STR_FINANCES_LOAN_TITLE :{WHITE}Pinjaman diff --git a/src/lang/italian.txt b/src/lang/italian.txt index 99df74fad4..93a30bb36e 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -3668,7 +3668,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Altro STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Profitto netto STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Saldo bancario STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Capitale netto STR_FINANCES_LOAN_TITLE :{WHITE}Prestito diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 4091606856..784a8a7efd 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -3664,7 +3664,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}기타 STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}순이익 STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}현 보유 금액 STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}보유 자금 STR_FINANCES_LOAN_TITLE :{WHITE}대출 diff --git a/src/lang/latvian.txt b/src/lang/latvian.txt index 1fa943e888..d0a2b9685b 100644 --- a/src/lang/latvian.txt +++ b/src/lang/latvian.txt @@ -3636,7 +3636,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Citi STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Tīrā peļņa STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Bankas bilance STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Pašu līdzekļi STR_FINANCES_LOAN_TITLE :{WHITE}Aizdevums diff --git a/src/lang/polish.txt b/src/lang/polish.txt index 332bda0c7c..9f9fafc680 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -4011,7 +4011,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Inne STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Zysk netto STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Bilans bankowy STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Środki własne STR_FINANCES_LOAN_TITLE :{WHITE}Pożyczka diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index 3228c5e2ef..cdefd5cb9b 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -405,6 +405,8 @@ STR_SCENEDIT_FILE_MENU_QUIT :Sair ###length 15 STR_SETTINGS_MENU_GAME_OPTIONS :Opções do Jogo STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :Definições +STR_SETTINGS_MENU_AI_SETTINGS :Definições de IA +STR_SETTINGS_MENU_GAMESCRIPT_SETTINGS :Definições de script de jogo STR_SETTINGS_MENU_NEWGRF_SETTINGS :Definições NewGRF STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Opções de Transparência STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Mostrar nomes de localidades @@ -1007,8 +1009,19 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Marque e STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}"Driver" atual: {STRING} +STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Tamanho do interface +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Arraste o controle deslizante para definir o tamanho do interface. Mantenha pressionada a tecla Ctrl para um ajuste contínuo +STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Auto-detetar o tamanho +STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Marque esta caixa para detetar automaticamente o tamanho do interface +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Escalar chanfros +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Marque esta caixa para dimensionar os chanfros por tamanho de interface +STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_2X :2x +STR_GAME_OPTIONS_GUI_SCALE_3X :3x +STR_GAME_OPTIONS_GUI_SCALE_4X :4x +STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Gráficos @@ -1678,7 +1691,7 @@ STR_CONFIG_SETTING_AI_BUILDS_SHIPS :Desactivar navi STR_CONFIG_SETTING_AI_BUILDS_SHIPS_HELPTEXT :Activar esta preferência impossibilita a construção de navios por um jogador controlado pelo computador STR_CONFIG_SETTING_AI_PROFILE :Perfil de preferências por omissão: {STRING} -STR_CONFIG_SETTING_AI_PROFILE_HELPTEXT :Escolher o perfil de preferências a usar para AIs aleatórias ou para valores iniciais ao adicionar uma nova AI ou Script de Jogo +STR_CONFIG_SETTING_AI_PROFILE_HELPTEXT :Escolher o perfil de preferências a usar para IAs aleatórias ou para valores iniciais ao adicionar uma nova IA ou Script de Jogo ###length 3 STR_CONFIG_SETTING_AI_PROFILE_EASY :Fácil STR_CONFIG_SETTING_AI_PROFILE_MEDIUM :Média @@ -2053,8 +2066,10 @@ STR_INTRO_MULTIPLAYER :{BLACK}Multi-jo STR_INTRO_GAME_OPTIONS :{BLACK}Opções de jogo STR_INTRO_HIGHSCORE :{BLACK}Tabela de classificações STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Definições -STR_INTRO_NEWGRF_SETTINGS :{BLACK}Definições NewGRF +STR_INTRO_NEWGRF_SETTINGS :{BLACK}Definições de NewGRF STR_INTRO_ONLINE_CONTENT :{BLACK}Verificar conteúdo online +STR_INTRO_AI_SETTINGS :{BLACK}Definições de IA +STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}Definições de Script de Jogo STR_INTRO_QUIT :{BLACK}Sair STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Iniciar um novo jogo. Ctrl+Clique salta a configuração do mapa @@ -2074,6 +2089,8 @@ STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Mostrar STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Mostrar definições STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Mostrar definições de NewGRF STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Verificar conteúdo novo e actualizado para descarga +STR_INTRO_TOOLTIP_AI_SETTINGS :{BLACK}Mostrar definições de IA +STR_INTRO_TOOLTIP_GAMESCRIPT_SETTINGS :{BLACK}Mostrar definições de Script de Jogo STR_INTRO_TOOLTIP_QUIT :{BLACK}Sair de 'OpenTTD' STR_INTRO_BASESET :{BLACK}O conjunto de gráficos base seleccionado tem {NUM} sprite{P "" s} em falta. Por favor verifique se existem atualizações para o conjunto. @@ -3053,9 +3070,9 @@ STR_FRAMERATE_DRAWING :{BLACK}Renderiz STR_FRAMERATE_DRAWING_VIEWPORTS :{BLACK} Janelas de exibição do mundo: STR_FRAMERATE_VIDEO :{BLACK}Saída de video: STR_FRAMERATE_SOUND :{BLACK}Mistura de Som: -STR_FRAMERATE_ALLSCRIPTS :{BLACK} GS/AI total: +STR_FRAMERATE_ALLSCRIPTS :{BLACK} SJ/IA total: STR_FRAMERATE_GAMESCRIPT :{BLACK} Script de jogo: -STR_FRAMERATE_AI :{BLACK} AI {NUM} {STRING} +STR_FRAMERATE_AI :{BLACK} IA {NUM} {STRING} ###length 15 STR_FRAMETIME_CAPTION_GAMELOOP :Loop de jogo @@ -3072,7 +3089,7 @@ STR_FRAMETIME_CAPTION_VIDEO :Saída de video STR_FRAMETIME_CAPTION_SOUND :Mistura de Som STR_FRAMETIME_CAPTION_ALLSCRIPTS :total scripts GS/AI STR_FRAMETIME_CAPTION_GAMESCRIPT :Script de jogo -STR_FRAMETIME_CAPTION_AI :AI {NUM} {STRING} +STR_FRAMETIME_CAPTION_AI :IA {NUM} {STRING} # Save/load game/scenario @@ -3133,6 +3150,12 @@ STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}Rios: STR_MAPGEN_SMOOTHNESS :{BLACK}Suavidade: STR_MAPGEN_VARIETY :{BLACK}Variedade da distribuição: STR_MAPGEN_GENERATE :{WHITE}Gerar +STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}Definições de NewGRF +STR_MAPGEN_NEWGRF_SETTINGS_TOOLTIP :{BLACK}Mostrar definições de NewGRF +STR_MAPGEN_AI_SETTINGS :{BLACK}Definições de IA +STR_MAPGEN_AI_SETTINGS_TOOLTIP :{BLACK}Mostrar definições de IA +STR_MAPGEN_GS_SETTINGS :{BLACK}Definições de Script de Jogo +STR_MAPGEN_GS_SETTINGS_TOOLTIP :{BLACK}Mostrar definições de script de jogo ###length 21 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH :Inglês @@ -3272,7 +3295,7 @@ STR_SAVE_PRESET_SAVE :{BLACK}Grava STR_SAVE_PRESET_SAVE_TOOLTIP :{BLACK}Grava a predefinição com o nome seleccionado # NewGRF parameters window -STR_NEWGRF_PARAMETERS_CAPTION :{WHITE}Alterar parâmetros NewGRF +STR_NEWGRF_PARAMETERS_CAPTION :{WHITE}Alterar parâmetros de NewGRF STR_NEWGRF_PARAMETERS_CLOSE :{BLACK}Fechar STR_NEWGRF_PARAMETERS_RESET :{BLACK}Repor STR_NEWGRF_PARAMETERS_RESET_TOOLTIP :{BLACK}Retorna todos os parâmetros ao seu valor padrão @@ -3458,14 +3481,14 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Comprar exclusi STR_LOCAL_AUTHORITY_ACTION_BRIBE :Subornar a autoridade local ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}Iniciar uma campanha local publicitária pequena, para atrair mais passageiros e carga à sua empresa.{}Providencia um incremento temporário na avaliação das estações num raio pequeno à volta do centro da localidade.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Iniciar uma campanha local publicitária média, para atrair mais passageiros e carga à sua empresa.{}Providencia um incremento temporário na avaliação das estações num raio médio à volta do centro da localidade.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Iniciar uma campanha local publicitária grande, para atrair mais passageiros e carga à sua empresa.{}Providencia um incremento temporário na avaliação das estações num raio grande à volta do centro da localidade.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}Financiar a reconstrução da rede rodoviária urbana.{}Causa engarrafamentos consideráveis ao tráfego rodoviário até 6 meses.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Construir uma estátua em honra da sua empresa.{}Providencia um incremento permanente na avaliação das estações nesta localidade.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}Financiar a construção de novos edifícios na localidade.{}Providencia um incremento temporário no crescimento desta localidade.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Comprar 1 ano de direitos exclusivos de transportes nesta localidade.{}A autoridade local não permitirá que os passageiros e a carga usem as estações dos seus concorrentes.{}Custo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Subornar a autoridade local para aumentar a sua avaliação, correndo o risco de uma penalidade severa se apanhado.{}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW}Iniciar uma campanha local publicitária pequena, para atrair mais passageiros e carga à sua empresa.{}Providencia um incremento temporário na avaliação das estações num raio pequeno à volta do centro da localidade.{}{POP_COLOUR}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{PUSH_COLOUR}{YELLOW}Iniciar uma campanha local publicitária média, para atrair mais passageiros e carga à sua empresa.{}Providencia um incremento temporário na avaliação das estações num raio médio à volta do centro da localidade.{}{POP_COLOUR}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{PUSH_COLOUR}{YELLOW}Iniciar uma campanha local publicitária grande, para atrair mais passageiros e carga à sua empresa.{}Providencia um incremento temporário na avaliação das estações num raio grande à volta do centro da localidade.{}{POP_COLOUR}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW}Financiar a reconstrução da rede rodoviária urbana.{}Causa engarrafamentos consideráveis ao tráfego rodoviário até 6 meses.{}{POP_COLOUR}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{PUSH_COLOUR}{YELLOW}Construir uma estátua em honra da sua empresa.{}Providencia um incremento permanente na avaliação das estações nesta localidade.{}{POP_COLOUR}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{PUSH_COLOUR}{YELLOW}Financiar a construção de novos edifícios na localidade.{}Providencia um incremento temporário no crescimento desta localidade.{}{POP_COLOUR}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW}Comprar 1 ano de direitos exclusivos de transportes nesta localidade.{}A autoridade local não permitirá que os passageiros e a carga usem as estações dos seus concorrentes.{}{POP_COLOUR}Custo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}Subornar a autoridade local para aumentar a sua avaliação, correndo o risco de uma penalidade severa se for apanhado.{}{POP_COLOUR}Custo: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} Objectivos @@ -3641,7 +3664,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Outros STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Lucro Líquido STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Balanço bancário STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Fundos Próprios STR_FINANCES_LOAN_TITLE :{WHITE}Empréstimo @@ -4201,6 +4223,7 @@ STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Peso: {L STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Peso: {LTBLUE}{WEIGHT_SHORT} {BLACK}Potência: {LTBLUE}{POWER}{BLACK} Velocidade máx.: {LTBLUE}{VELOCITY} {BLACK}Tração Máx.: {LTBLUE}{FORCE} STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Lucro neste ano: {LTBLUE}{CURRENCY_LONG} (último ano: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Lucro deste ano: {LTBLUE}{CURRENCY_LONG} (último ano: {CURRENCY_LONG}) {BLACK}Performance min.: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Fiabilidade: {LTBLUE}{COMMA}% {BLACK}Avarias desde o último serviço: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Construído: {LTBLUE}{NUM}{BLACK} Valor: {LTBLUE}{CURRENCY_LONG} @@ -4534,6 +4557,8 @@ STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Houve um STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}A janela de Depuração de IA/Scripts de jogo está disponível apenas para o servidor # AI configuration window +STR_AI_CONFIG_CAPTION_AI :{WHITE}Configuração de IA +STR_AI_CONFIG_CAPTION_GAMESCRIPT :{WHITE}Configuração de Script de Jogo STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}O Script de jogo que será carregado no próximo jogo STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}As IAs que serão carregadas no próximo jogo STR_AI_CONFIG_HUMAN_PLAYER :Jogador humano @@ -4547,10 +4572,11 @@ STR_AI_CONFIG_MOVE_DOWN :{BLACK}Mover pa STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}Move a IA seleccionada para baixo STR_AI_CONFIG_GAMESCRIPT :{SILVER}Script de jogo +STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}Parâmetros STR_AI_CONFIG_AI :{SILVER}IAs -STR_AI_CONFIG_CHANGE_AI :IA -STR_AI_CONFIG_CHANGE_GAMESCRIPT :Script de jogo +STR_AI_CONFIG_CHANGE_AI :{BLACK}Selecionar IA +STR_AI_CONFIG_CHANGE_GAMESCRIPT :{BLACK}Selecionar Script de Jogo STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Carregar outro script STR_AI_CONFIG_CONFIGURE :{BLACK}Configurar STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}Configurar os parâmetros do script @@ -4579,7 +4605,7 @@ STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Mapa de STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Minimap screenshot # AI Parameters -STR_AI_SETTINGS_CAPTION_AI :IA +STR_AI_SETTINGS_CAPTION_AI :{WHITE}Parâmetros de IA STR_AI_SETTINGS_CLOSE :{BLACK}Fechar STR_AI_SETTINGS_RESET :{BLACK}Repor STR_AI_SETTINGS_SETTING :{STRING}: {ORANGE}{STRING} diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index bb1ed57ca0..0e977158bd 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -3626,7 +3626,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Altele STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Profit Net STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Balanţă curentă STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Fonduri proprii STR_FINANCES_LOAN_TITLE :{WHITE}Credite diff --git a/src/lang/russian.txt b/src/lang/russian.txt index 91845fe800..36d383279d 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -1153,6 +1153,10 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Вклю STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Видеодрайвер: {STRING} +STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Масштаб интерфейса +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Изменяйте масштаб интерфейса с помощью ползунка. Удерживайте Ctrl для тонкой настройки. +STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Автоопределение +STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Нажмите для автоматической установки масштаба интерфейса STR_GAME_OPTIONS_GUI_SCALE_1X :1x @@ -3832,7 +3836,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Проч STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Чистая прибыль STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Баланс: STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Собственные средства STR_FINANCES_LOAN_TITLE :{WHITE}Взято в кредит @@ -4404,6 +4407,7 @@ STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Масс STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Масса: {LTBLUE}{WEIGHT_SHORT} {BLACK}Мощность: {LTBLUE}{POWER}{BLACK} Макс. скорость: {LTBLUE}{VELOCITY} {BLACK}Макс. ТУ: {LTBLUE}{FORCE} STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Прибыль в этом году: {LTBLUE}{CURRENCY_LONG} (в прошлом году: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Прибыль в этом году: {LTBLUE}{CURRENCY_LONG} (в прошлом году: {CURRENCY_LONG}) {BLACK}Мин. удельная мощн.: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Надёжность: {LTBLUE}{COMMA}% {BLACK}Поломок после ТО: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Построен в {LTBLUE}{NUM} г.{BLACK} Стоимость: {LTBLUE}{CURRENCY_LONG} diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index 13ef1f7883..b442ac3146 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -3627,7 +3627,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}其他费 STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}净利润 STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}流动资金 STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}自有资金 STR_FINANCES_LOAN_TITLE :{WHITE}已贷款额 diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt index f5c78f064e..5bb0521c0e 100644 --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -3699,7 +3699,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Ostatné STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Čistý zisk STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Zostatok na účte v banke STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Vlastné prostriedky STR_FINANCES_LOAN_TITLE :{WHITE}Úver diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index 151b06c834..ee367f7a4c 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -3664,7 +3664,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Otros STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Beneficio neto STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Saldo en Banco STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Fondos propios STR_FINANCES_LOAN_TITLE :{WHITE}Préstamo diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index d59df70c36..16026790e6 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -931,7 +931,7 @@ STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT :{BLACK}Copiar u # Game options window STR_GAME_OPTIONS_CAPTION :{WHITE}Opciones de juego STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Divisa -STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Selección de divisa +STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Elegir divisa ###length 42 STR_GAME_OPTIONS_CURRENCY_GBP :Libra británica (GBP) @@ -1009,9 +1009,13 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Activar STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Controlador actual: {STRING} +STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Tamaño de la interfaz +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Mover el deslizador para cambiar el tamaño de la interfaz. Mantener pulsado Ctrl para un control fino STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Detectar automáticamente STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Detectar tamaño de la interfaz automáticamente +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Ajustar biseles +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Ajustar los biseles de la interfaz según el tamaño STR_GAME_OPTIONS_GUI_SCALE_1X :1x STR_GAME_OPTIONS_GUI_SCALE_2X :2x @@ -3477,14 +3481,14 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Comprar los der STR_LOCAL_AUTHORITY_ACTION_BRIBE :Sobornar al ayuntamiento ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}Iniciar una pequeña campaña publicitaria local para atraer más pasajeros y carga a tus servicios de transporte.{}Otorga un aumento temporal a la evaluación de estaciones en un radio pequeño alrededor del centro de la localidad.{}Costo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Iniciar una campaña publicitaria local mediana para atraer más pasajeros y carga a tus servicios de transporte.{}Otorga un aumento temporal a la evaluación de estaciones en un radio mediano alrededor del centro de la localidad.{}Costo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Iniciar una gran campaña publicitaria local para atraer más pasajeros y carga a tus servicios de transporte.{}Otorga un aumento temporal a la evaluación de estaciones en un radio grande alrededor del centro de la localidad.{}Costo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}Pagar la reconstrucción de las carreteras locales.{}Provoca considerables complicaciones al tráfico hasta por 6 meses.{}Costo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Construir una estatua en honor a tu empresa.{}Otorga un aumento permanente a la evaluación estaciones en esta localidad.{}Costo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}Pagar la construcción de nuevos edificios comerciales en la localidad.{}Otorga un aumento temporal a su crecimiento.{}Costo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Comprar los derechos exclusivos de transporte en esta localidad por un año.{}El ayuntamiento solo permitirá el uso de estaciones que sean de tu empresa.{}Costo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Sobornar al ayuntamiento para aumentar mejorar tu evaluación, con el riesgo de una severa penalización si llegas a ser descubierto.{}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW}Iniciar una pequeña campaña publicitaria local para atraer más pasajeros y carga a tus servicios de transporte.{}Otorga un aumento temporal a la evaluación de estaciones en un radio pequeño alrededor del centro de la localidad.{}{POP_COLOUR}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{PUSH_COLOUR}{YELLOW}Iniciar una campaña publicitaria local mediana para atraer más pasajeros y carga a tus servicios de transporte.{}Otorga un aumento temporal a la evaluación de estaciones en un radio mediano alrededor del centro de la localidad.{}{POP_COLOUR}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{PUSH_COLOUR}{YELLOW}Iniciar una gran campaña publicitaria local para atraer más pasajeros y carga a tus servicios de transporte.{}Otorga un aumento temporal a la evaluación de estaciones en un radio grande alrededor del centro de la localidad.{}{POP_COLOUR}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW}Pagar la reconstrucción de las carreteras locales.{}Provoca considerables complicaciones al tráfico hasta por 6 meses.{}{POP_COLOUR}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{PUSH_COLOUR}{YELLOW}Construir una estatua en honor a tu empresa.{}Otorga un aumento permanente a la evaluación estaciones en esta localidad.{}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{PUSH_COLOUR}{YELLOW}Pagar la construcción de nuevos edificios comerciales en la localidad.{}Otorga un aumento temporal a su crecimiento.{}{POP_COLOUR}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW}Comprar los derechos exclusivos de transporte en esta localidad por un año.{}El ayuntamiento solo permitirá el uso de estaciones que sean de tu empresa.{}{POP_COLOUR}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}Sobornar al ayuntamiento para aumentar mejorar tu evaluación, con el riesgo de una severa penalización si llegas a ser descubierto.{}{POP_COLOUR}Costo: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}Metas de {COMPANY} @@ -3660,7 +3664,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Otros STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Utilidad neta STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Saldo en banco STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Fondos propios STR_FINANCES_LOAN_TITLE :{WHITE}Préstamo @@ -4220,6 +4223,7 @@ STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Peso: {L STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Peso: {LTBLUE}{WEIGHT_SHORT} {BLACK}Potencia: {LTBLUE}{POWER}{BLACK} Velocidad máx.: {LTBLUE}{VELOCITY} {BLACK}F.T. máx.: {LTBLUE}{FORCE} STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Ganancias este año: {LTBLUE}{CURRENCY_LONG} (último año: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Ganancias este año: {LTBLUE}{CURRENCY_LONG} (último año: {CURRENCY_LONG}) {BLACK}Mín. rendimiento: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Fiabilidad: {LTBLUE}{COMMA}% {BLACK}Averías desde el último mantenimiento: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Construido: {LTBLUE}{NUM}{BLACK} Valor: {LTBLUE}{CURRENCY_LONG} diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index 45622f76c2..ca5c911106 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -3626,7 +3626,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Övrigt STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Nettoförtjänst STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Banksaldo STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Egna medel STR_FINANCES_LOAN_TITLE :{WHITE}Lån diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt index 98f8539b17..f998e3b468 100644 --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -3626,7 +3626,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}其他 STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}淨收益 STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}銀行餘額 STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}自有資金 STR_FINANCES_LOAN_TITLE :{WHITE}貸款 diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index 2c6560c589..3aa4dfc628 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -3628,7 +3628,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Diğer STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Net Kâr STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Banka Hesabı STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Kendi Sermayem STR_FINANCES_LOAN_TITLE :{WHITE}Kredi diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index 092a39e631..4ecdac3895 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -3631,7 +3631,6 @@ STR_FINANCES_SECTION_OTHER :{GOLD}Khác STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_NET_PROFIT :{WHITE}Lợi Nhuận Ròng STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Số dư hiện có STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Nguồn Vốn Riêng STR_FINANCES_LOAN_TITLE :{WHITE}Đi vay From d30345edfb1f2ed23147fc2592aeb0a8d66b8809 Mon Sep 17 00:00:00 2001 From: translators Date: Tue, 15 Nov 2022 18:47:23 +0000 Subject: [PATCH 19/42] Update: Translations from eints english (au): 3 changes by krysclarke spanish (mexican): 3 changes by absay english (us): 3 changes by 2TallTyler russian: 2 changes by Ln-Wolf french: 11 changes by ZarTek-Creole portuguese: 3 changes by azulcosta polish: 28 changes by pAter-exe --- src/lang/english_AU.txt | 3 +++ src/lang/english_US.txt | 3 +++ src/lang/french.txt | 13 +++++++++++-- src/lang/polish.txt | 31 ++++++++++++++++++++++++++++--- src/lang/portuguese.txt | 3 +++ src/lang/russian.txt | 2 ++ src/lang/spanish_MX.txt | 3 +++ 7 files changed, 53 insertions(+), 5 deletions(-) diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index f612ec0195..d5fc139578 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -3660,15 +3660,18 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}Ships STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}Loan Interest STR_FINANCES_SECTION_OTHER :{GOLD}Other +STR_FINANCES_TOTAL_CAPTION :{WHITE}Total STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} +STR_FINANCES_PROFIT :{WHITE}Profit STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Bank Balance STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Own Funds STR_FINANCES_LOAN_TITLE :{WHITE}Loan STR_FINANCES_INTEREST_RATE :{WHITE}Loan Interest: {BLACK}{NUM}% STR_FINANCES_MAX_LOAN :{WHITE}Maximum Loan: {BLACK}{CURRENCY_LONG} STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} +STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}Borrow {CURRENCY_LONG} STR_FINANCES_BORROW_TOOLTIP :{BLACK}Increase size of loan. Ctrl+Click borrows as much as possible STR_FINANCES_REPAY_BUTTON :{BLACK}Repay {CURRENCY_LONG} diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index 585c47391e..b2da709dc5 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -3660,15 +3660,18 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}Ships STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}Loan Interest STR_FINANCES_SECTION_OTHER :{GOLD}Other +STR_FINANCES_TOTAL_CAPTION :{WHITE}Total STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} +STR_FINANCES_PROFIT :{WHITE}Profit STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Bank Balance STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Own Funds STR_FINANCES_LOAN_TITLE :{WHITE}Loan STR_FINANCES_INTEREST_RATE :{WHITE}Loan Interest: {BLACK}{NUM}% STR_FINANCES_MAX_LOAN :{WHITE}Maximum Loan: {BLACK}{CURRENCY_LONG} STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} +STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}Borrow {CURRENCY_LONG} STR_FINANCES_BORROW_TOOLTIP :{BLACK}Increase size of loan. Ctrl+Click borrows as much as possible STR_FINANCES_REPAY_BUTTON :{BLACK}Repay {CURRENCY_LONG} diff --git a/src/lang/french.txt b/src/lang/french.txt index 0fdcfecc8c..eb3c132590 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -1009,8 +1009,17 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Cochez c STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Pilote actif{NBSP}: {STRING} +STR_GAME_OPTIONS_GUI_SCALE_FRAME :Taille de l'interface +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Faites glisser la souris pour définir la taille de l'interface. Maintenir Ctrl pour un réglage en continu +STR_GAME_OPTIONS_GUI_SCALE_AUTO :détection automatique de la taille +STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Cochez cette case pour détecter automatiquement la taille de l'interface +STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_2X :2x +STR_GAME_OPTIONS_GUI_SCALE_3X :3x +STR_GAME_OPTIONS_GUI_SCALE_4X :4x +STR_GAME_OPTIONS_GUI_SCALE_5X :x5 STR_GAME_OPTIONS_GRAPHICS :{BLACK} Graphiques @@ -3470,10 +3479,10 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Acheter les dro STR_LOCAL_AUTHORITY_ACTION_BRIBE :Corrompre la municipalité ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}Lancez une petite campagne de publicité locale pour attirer plus de passagers et de marchandises vers vos services de transport.{} Augmente temporairement le classement des gares dans un petit rayon autour du centre-ville.{}Coût: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW}Lancez une petite campagne de publicité locale pour attirer plus de passagers et de marchandises vers vos services de transport.{}Fournit une amélioration temporaire de la note des gares dans un petit rayon autour du centre-ville.{}{POP_COLOUR}Coût : {CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Lancer une campagne de publicité moyenne, pour attirer plus de voyageurs et de marchandises sur vos lignes.{}Augmente temporairement le classement de vos gares dans un rayon moyen autour du centre-ville.{}Coût:{CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Lancer une grande campagne de publicité, pour attirer plus de voyageurs et de marchandises sur vos lignes.{}Augmente temporairement le classement des gares dans un rayon important autour du centre-ville.{}Coût: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}Financer la reconstruction du réseau routier local. Provoque de nombreux problèmes de trafic routier pendant 6 mois.{}Coût: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW}Financer la reconstruction du réseau routier.{}Provoque une perturbation considérable du trafic pendant 6 mois au maximum.{}{POP_COLOUR}Coût : {CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Construire une statue en l'honneur de votre compagnie.{}Augmente en permanence le classement de vos stations dans cette ville.{}Coût:{CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}Financer la construction de nouveaux immeubles commerciaux.{}Stimule temporairement la croissance dans cette ville.{}Coût:{CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Achetez les droits de transport exclusifs d'un an pour la ville.{} La municipalité n'autorisera pas les passagers et les marchandises à utiliser les gares de vos concurrents.{} Coût: {CURRENCY_LONG} diff --git a/src/lang/polish.txt b/src/lang/polish.txt index 9f9fafc680..ec227f029a 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -1361,7 +1361,7 @@ STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Wybierz STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE :{STRING} (ukończono {NUM}%) STR_GAME_OPTIONS_FULLSCREEN :{BLACK}Pełny ekran -STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Zaznacz, jeśli chcesz grać w OpenTTD w trybie pełnoekranowym +STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Zaznacz to pole, jeśli chcesz grać w OpenTTD w trybie pełnoekranowym STR_GAME_OPTIONS_RESOLUTION :{BLACK}Rozdzielczość ekranu STR_GAME_OPTIONS_RESOLUTION_TOOLTIP :{BLACK}Wybierz rozdzielczość ekranu @@ -1377,8 +1377,19 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Zaznacz STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Bieżący sterownik: {STRING} +STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Rozmiar interfejsu +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Przeciągnij suwak, aby ustawić rozmiar interfejsu. Przytrzymaj Ctrl, aby uzyskać płynną regulację +STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Wykryj rozmiar automatycznie +STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Zaznacz to pole, aby rozmiar interfejsu był wykrywany automatycznie +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Skaluj fazy krawędzi +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Zaznacz to pole, aby skalować fazy krawędzi zgodnie z rozmiarem interfejsu +STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_2X :2x +STR_GAME_OPTIONS_GUI_SCALE_3X :3x +STR_GAME_OPTIONS_GUI_SCALE_4X :4x +STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafika @@ -2425,6 +2436,8 @@ STR_INTRO_HIGHSCORE :{BLACK}Tabela w STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Ustawienia STR_INTRO_NEWGRF_SETTINGS :{BLACK}Ustawienia NewGRF STR_INTRO_ONLINE_CONTENT :{BLACK}Sprawdź dodatki online +STR_INTRO_AI_SETTINGS :{BLACK}Ustawienia SI +STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}Ustawienia Game Script STR_INTRO_QUIT :{BLACK}Wyjście STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Rozpocznij nową grę. Ctrl+klik pomija konfigurowanie mapy @@ -2444,6 +2457,8 @@ STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Wyświet STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Wyświetl ustawienia gry STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Wyświetl ustawienia NewGRF STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Poszukaj nowych lub zaktualizowanych dodatków do pobrania +STR_INTRO_TOOLTIP_AI_SETTINGS :{BLACK}Wyświetl ustawienia SI +STR_INTRO_TOOLTIP_GAMESCRIPT_SETTINGS :{BLACK}Wyświetl ustawienia Game Script STR_INTRO_TOOLTIP_QUIT :{BLACK}Wyjdź z „OpenTTD” STR_INTRO_BASESET :{BLACK}Aktualnie używany podstawowy zestaw graficzny nie posiada {NUM} wymagan{P ego ych ych} sprite{P 'u 'ów 'ów}. Proszę poszukać aktualizacji dla zestawu podstawowego. @@ -3503,6 +3518,7 @@ STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}Liczba r STR_MAPGEN_SMOOTHNESS :{BLACK}Gładkość: STR_MAPGEN_VARIETY :{BLACK}Różnorodność: STR_MAPGEN_GENERATE :{WHITE}Stwórz +STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}Ustawienia NewGRF ###length 21 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH :Angielskie (Oryginalne) @@ -4008,15 +4024,18 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}Statki STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}Odsetki od pożyczki STR_FINANCES_SECTION_OTHER :{GOLD}Inne +STR_FINANCES_TOTAL_CAPTION :{WHITE}Łącznie STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} +STR_FINANCES_PROFIT :{WHITE}Zysk STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Bilans bankowy STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Środki własne STR_FINANCES_LOAN_TITLE :{WHITE}Pożyczka STR_FINANCES_INTEREST_RATE :{WHITE}Oprocentowanie pożyczki: {BLACK}{NUM}% STR_FINANCES_MAX_LOAN :{WHITE}Maksymalna pożyczka: {BLACK}{CURRENCY_LONG} STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} +STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}Pożyczka {CURRENCY_LONG} STR_FINANCES_BORROW_TOOLTIP :{BLACK}Zwiększ wielkość pożyczki. Ctrl+klik pożycza największą możliwą kwotę STR_FINANCES_REPAY_BUTTON :{BLACK}Zwrot {CURRENCY_LONG} @@ -4101,7 +4120,7 @@ STR_INDUSTRY_DIRECTORY_ITEM_PRODMORE :{ORANGE}{INDUST STR_INDUSTRY_DIRECTORY_LIST_CAPTION :{BLACK}Nazwy przedsiębiorstw - kliknij na nazwę przedsiębiorstwa, aby wyśrodkować na nim widok główny. Ctrl+klik otwiera nowy podgląd na lokalizację przedsiębiorstwa STR_INDUSTRY_DIRECTORY_ACCEPTED_CARGO_FILTER :{BLACK}Akceptowany ładunek: {SILVER}{STRING} STR_INDUSTRY_DIRECTORY_PRODUCED_CARGO_FILTER :{BLACK}Produkowany ładunek: {SILVER}{STRING} -STR_INDUSTRY_DIRECTORY_FILTER_ALL_TYPES :Wszystkie typy ładunku +STR_INDUSTRY_DIRECTORY_FILTER_ALL_TYPES :Wszystkie typy ładunków STR_INDUSTRY_DIRECTORY_FILTER_NONE :Żadne # Industry view @@ -4230,7 +4249,7 @@ STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Koszt: { STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Ładowność: {GOLD}{CARGO_LONG}, {CARGO_LONG} STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Moc: {GOLD}+{POWER}{BLACK} Masa: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Można przystosować do: {GOLD}{STRING} -STR_PURCHASE_INFO_ALL_TYPES :wszystkie typy ładunków +STR_PURCHASE_INFO_ALL_TYPES :Wszystkie typy ładunków STR_PURCHASE_INFO_NONE :Żadne STR_PURCHASE_INFO_ENGINES_ONLY :Tylko lokomotywy STR_PURCHASE_INFO_ALL_BUT :wszystko oprócz {CARGO_LIST} @@ -4239,6 +4258,9 @@ STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Zasięg: STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}Typ samolotu: {GOLD}{STRING} ###length 3 +STR_CARGO_TYPE_FILTER_ALL :Wszystkie typy ładunków +STR_CARGO_TYPE_FILTER_FREIGHT :Fracht +STR_CARGO_TYPE_FILTER_NONE :Żaden ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Lista wyboru pociągów - kliknij na pojazd, aby uzyskać informacje. Ctrl+klik przełącza ukrywanie typu pojazdu @@ -4906,6 +4928,8 @@ STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Jeden z STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}Okno debugowania SI / Game Script jest dostępne tylko na serwerze # AI configuration window +STR_AI_CONFIG_CAPTION_AI :{WHITE}Konfiguracja SI +STR_AI_CONFIG_CAPTION_GAMESCRIPT :{WHITE}Konfiguracja Game Script STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}Game Script, który zostanie załadowany podczas kolejnej gry STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}SI, które zostaną załadowane podczas kolejnej gry STR_AI_CONFIG_HUMAN_PLAYER :Ludzki gracz @@ -4919,6 +4943,7 @@ STR_AI_CONFIG_MOVE_DOWN :{BLACK}Przesuń STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}Przesuń wybraną SI w dół listy STR_AI_CONFIG_GAMESCRIPT :{SILVER}Game Script +STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}Parametry STR_AI_CONFIG_AI :{SILVER}SI STR_AI_CONFIG_CHANGE_AI :SI diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index cdefd5cb9b..3268fc5864 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -3661,15 +3661,18 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}Navios STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}Juros do Empréstimo STR_FINANCES_SECTION_OTHER :{GOLD}Outros +STR_FINANCES_TOTAL_CAPTION :{WHITE}Total STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} +STR_FINANCES_PROFIT :{WHITE}Lucro STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Balanço bancário STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Fundos Próprios STR_FINANCES_LOAN_TITLE :{WHITE}Empréstimo STR_FINANCES_INTEREST_RATE :{WHITE}Juro do Empréstimo: {BLACK}{NUM}% STR_FINANCES_MAX_LOAN :{WHITE}Empréstimo Máximo: {BLACK}{CURRENCY_LONG} STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} +STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}Pedir empréstimo {CURRENCY_LONG} STR_FINANCES_BORROW_TOOLTIP :{BLACK}Aumentar empréstimo. Ctrl+Clique aumenta tanto empréstimo quanto possível STR_FINANCES_REPAY_BUTTON :{BLACK}Pagar empréstimo {CURRENCY_LONG} diff --git a/src/lang/russian.txt b/src/lang/russian.txt index 36d383279d..ebec995b70 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -3833,6 +3833,7 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}Суда STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}Платёж по кредиту STR_FINANCES_SECTION_OTHER :{GOLD}Прочие расходы +STR_FINANCES_TOTAL_CAPTION :{WHITE}Всего STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} @@ -3842,6 +3843,7 @@ STR_FINANCES_LOAN_TITLE :{WHITE}Взят STR_FINANCES_INTEREST_RATE :{WHITE}Проценты по кредиту: {BLACK}{NUM}% STR_FINANCES_MAX_LOAN :{WHITE}Макс. сумма кредита: {BLACK}{CURRENCY_LONG} STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} +STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}Занять {CURRENCY_LONG} STR_FINANCES_BORROW_TOOLTIP :{BLACK}Взять деньги в кредит. Ctrl+щелчок - взять максимально возможную сумму. STR_FINANCES_REPAY_BUTTON :{BLACK}Отдать {CURRENCY_LONG} diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index 16026790e6..196b304433 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -3661,15 +3661,18 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}Barcos STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}T. de interés del préstamo STR_FINANCES_SECTION_OTHER :{GOLD}Otros +STR_FINANCES_TOTAL_CAPTION :{WHITE}Total STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} +STR_FINANCES_PROFIT :{WHITE}Ganancias STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Saldo en banco STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Fondos propios STR_FINANCES_LOAN_TITLE :{WHITE}Préstamo STR_FINANCES_INTEREST_RATE :{WHITE}T. de interés del préstamo: {BLACK}{NUM}% STR_FINANCES_MAX_LOAN :{WHITE}Préstamo máximo: {BLACK}{CURRENCY_LONG} STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} +STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}Pedir préstamo de {CURRENCY_LONG} STR_FINANCES_BORROW_TOOLTIP :{BLACK}Incrementar préstamo. Ctrl+Clic solicita todo el préstamo posible STR_FINANCES_REPAY_BUTTON :{BLACK}Abonar {CURRENCY_LONG} del préstamo From bc5cd4eeda1a4655e2887c3041a6a4af8e42936a Mon Sep 17 00:00:00 2001 From: translators Date: Wed, 16 Nov 2022 18:48:29 +0000 Subject: [PATCH 20/42] Update: Translations from eints russian: 3 changes by Ln-Wolf spanish: 55 changes by MontyMontana polish: 32 changes by pAter-exe --- src/lang/polish.txt | 47 +++++++++++++------ src/lang/russian.txt | 5 +- src/lang/spanish.txt | 107 ++++++++++++++++++++++--------------------- 3 files changed, 90 insertions(+), 69 deletions(-) diff --git a/src/lang/polish.txt b/src/lang/polish.txt index ec227f029a..4a9aa765c9 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -575,10 +575,19 @@ STR_UNITS_VELOCITY_METRIC :{COMMA}{NBSP}km STR_UNITS_VELOCITY_SI :{COMMA}{NBSP}m/s STR_UNITS_VELOCITY_GAMEUNITS :{DECIMAL}{NBSP}p{P ole ola ól}/dzień -STR_UNITS_POWER_IMPERIAL :{COMMA}{NBSP}KM +STR_UNITS_POWER_IMPERIAL :{COMMA}{NBSP}hp STR_UNITS_POWER_METRIC :{COMMA}{NBSP}KM STR_UNITS_POWER_SI :{COMMA}{NBSP}kW +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg +STR_UNITS_POWER_METRIC_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}KM/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}KM/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_SI :{DECIMAL}{NBSP}KM/Mg +STR_UNITS_POWER_SI_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_SI :{DECIMAL}{NBSP}W/kg STR_UNITS_WEIGHT_SHORT_IMPERIAL :{COMMA}{NBSP}t STR_UNITS_WEIGHT_SHORT_METRIC :{COMMA}{NBSP}t @@ -774,6 +783,8 @@ STR_SCENEDIT_FILE_MENU_QUIT :Wyjście ###length 15 STR_SETTINGS_MENU_GAME_OPTIONS :Opcje gry STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :Ustawienia +STR_SETTINGS_MENU_AI_SETTINGS :Ustawienia SI +STR_SETTINGS_MENU_GAMESCRIPT_SETTINGS :Ustawienia Game Script STR_SETTINGS_MENU_NEWGRF_SETTINGS :Ustawienia NewGRF STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Opcje przeźroczystości STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Wyświetlanie nazw miast @@ -2068,7 +2079,7 @@ STR_CONFIG_SETTING_AI_PROFILE_HARD :Trudny STR_CONFIG_SETTING_AI_IN_MULTIPLAYER :Pozwól na SI w grze wieloosobowej: {STRING} STR_CONFIG_SETTING_AI_IN_MULTIPLAYER_HELPTEXT :Pozwól komputerowym graczom SI na udział w grach dla wielu graczy -STR_CONFIG_SETTING_SCRIPT_MAX_OPCODES :ilość #opcodes przed uśpieniem skryptu: {STRING} +STR_CONFIG_SETTING_SCRIPT_MAX_OPCODES :Liczba wysyłanych kodów instrukcji przed zawieszeniem skryptów: {STRING} STR_CONFIG_SETTING_SCRIPT_MAX_OPCODES_HELPTEXT :Maksymalna liczba kroków obliczeniowych, jakie skrypt może zrobić w jednej kolejce STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY :Maksymalne zużycie pamięci na skrypt: {STRING} STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_HELPTEXT :Ilość pamięci jaką może zużywać pojedynczy skrypt zanim zostanie przymusowo zakończony. Może wymagać zwiększenia dla większych map. @@ -2327,7 +2338,7 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER :Jednostka mocy STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_HELPTEXT :Kiedy moc pojazdu jest pokazywana w interfejsie użytkownika, wyświetl ją w wybranych jednostkach ###length 3 STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_IMPERIAL :Imperialne (hp) -STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_METRIC :Metryczne (hp) +STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_METRIC :Metryczne (KM) STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_SI :SI (kW) STR_CONFIG_SETTING_LOCALISATION_UNITS_WEIGHT :Jednostki wagi: {STRING} @@ -3519,6 +3530,11 @@ STR_MAPGEN_SMOOTHNESS :{BLACK}Gładko STR_MAPGEN_VARIETY :{BLACK}Różnorodność: STR_MAPGEN_GENERATE :{WHITE}Stwórz STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}Ustawienia NewGRF +STR_MAPGEN_NEWGRF_SETTINGS_TOOLTIP :{BLACK}Wyświetl ustawienia NewGRF +STR_MAPGEN_AI_SETTINGS :{BLACK}Ustawienia SI +STR_MAPGEN_AI_SETTINGS_TOOLTIP :{BLACK}Wyświetl ustawienia SI +STR_MAPGEN_GS_SETTINGS :{BLACK}Ustawienia Game Script +STR_MAPGEN_GS_SETTINGS_TOOLTIP :{BLACK}Wyświetl ustawienia Game Script ###length 21 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH :Angielskie (Oryginalne) @@ -3844,14 +3860,14 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Kup wyłączno STR_LOCAL_AUTHORITY_ACTION_BRIBE :Daj łapówkę lokalnym władzom ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}Rozpocznij małą kampanię reklamową aby zachęcić trochę pasażerów i fabryk do korzystania z Twoich usług transportowych.{}Zapewnia tymczasowy wzrost oceny stacji w małym promieniu wokół centrum miasta.{}Koszt: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Rozpocznij średnią kampanię reklamową, aby zachęcić więcej pasażerów i fabryk do korzystania z Twoich usług transportowych.{}Zapewnia tymczasowy wzrost oceny stacji w średnim promieniu wokół centrum miasta.{}Koszt: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Rozpocznij dużą kampanię reklamową aby zachęcić mnóstwo pasażerów i fabryk do korzystania z Twoich usług transportowych.{}Zapewnia tymczasowy wzrost oceny stacji w dużym promieniu wokół centrum miasta.{}Koszt: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}Ufunduj remont sieci dróg.{}Spowoduje to zakłócenia w ruchu ulicznym do 6 miesięcy.{}Koszt: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Zbuduj pomnik dla uczczenia twojej firmy.{}Trwale podniesie to ocenę twoich stacji w pobliżu tego miasta.{}Koszt: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}Ufunduj nowe budynki komercyjne w mieście.{}Daje jednorazowy impuls do szybszego wzrostu miasta.{}Koszt: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Kup roczną wyłączność na prawa transportowe w mieście.{} Lokalne władze nie pozwolą pasażerom ani przedsiębiorstwom korzystać z usług innych firm.{}Koszt: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Daj łapówkę lokalnym władzom. Powiększ swoją ocenę, ryzykując poważne kary w razie złapania.{}Koszt: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW}Rozpocznij małą lokalną kampanię reklamową, aby przyciągnąć więcej pasażerów i ładunków do twoich usług transportowych.{}Zapewnia tymczasowe zwiększenie oceny stacji w małym promieniu wokół centrum miasta.{}{POP_COLOUR}Koszt: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{PUSH_COLOUR}{YELLOW}Rozpocznij średnią lokalną kampanię reklamową, aby przyciągnąć więcej pasażerów i ładunków do twoich usług transportowych.{}Zapewnia tymczasowe zwiększenie oceny stacji w umiarkowanym promieniu wokół centrum miasta.{}{POP_COLOUR}Koszt: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{PUSH_COLOUR}{YELLOW}Rozpocznij dużą lokalną kampanię reklamową, aby przyciągnąć więcej pasażerów i ładunków do twoich usług transportowych.{}Zapewnia tymczasowe zwiększenie oceny stacji w dużym promieniu wokół centrum miasta.{}{POP_COLOUR}Koszt: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW}Ufunduj remont sieci dróg.{}Spowoduje to zakłócenia w ruchu ulicznym do 6 miesięcy.{}{POP_COLOUR}Koszt: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{PUSH_COLOUR}{YELLOW}Zbuduj statuę dla uczczenia swojej firmy.{}Trwale podniesie to ocenę twoich stacji w pobliżu tego miasta.{}{POP_COLOUR}Koszt: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{PUSH_COLOUR}{YELLOW}Ufunduj nowe budynki w mieście.{}Zapewnia tymczasowe przyspieszenie rozwoju tego miasta.{}{POP_COLOUR}Koszt: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW}Kup roczną wyłączność na prawa transportowe w mieście.{}Lokalne władze nie pozwolą pasażerom ani przedsiębiorstwom korzystać z usług innych firm.{}{POP_COLOUR}Koszt: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}Przekup lokalne władze, aby zwiększyć swoją ocenę, ryzykując surową karę w przypadku przyłapania.{}{POP_COLOUR}Koszt: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}Cele firmy {COMPANY} @@ -4594,7 +4610,8 @@ STR_VEHICLE_INFO_MAX_SPEED_TYPE_RANGE :{BLACK}Max. pr STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Masa: {LTBLUE}{WEIGHT_SHORT} {BLACK}Moc: {LTBLUE}{POWER}{BLACK} Prędkość maksymalna: {LTBLUE}{VELOCITY} STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Masa: {LTBLUE}{WEIGHT_SHORT} {BLACK}Moc: {LTBLUE}{POWER}{BLACK} Prędkość maksymalna: {LTBLUE}{VELOCITY} {BLACK}Maksymalna siła pociągowa: {LTBLUE}{FORCE} -STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Zysk w tym roku: {LTBLUE}{CURRENCY_LONG} (w zeszłym roku: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Zysk w tym roku: {LTBLUE}{CURRENCY_LONG} (ostatni rok: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Zysk w tym roku: {LTBLUE}{CURRENCY_LONG} (ostatni rok: {CURRENCY_LONG}) {BLACK}Min. wydajność: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Niezawodność: {LTBLUE}{COMMA}% {BLACK}Awarie od ostatniego serwisowania: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Zakupiony: {LTBLUE}{NUM}{BLACK} Wartość: {LTBLUE}{CURRENCY_LONG} @@ -4946,8 +4963,8 @@ STR_AI_CONFIG_GAMESCRIPT :{SILVER}Game Sc STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}Parametry STR_AI_CONFIG_AI :{SILVER}SI -STR_AI_CONFIG_CHANGE_AI :SI -STR_AI_CONFIG_CHANGE_GAMESCRIPT :Game Script +STR_AI_CONFIG_CHANGE_AI :{BLACK}Wybierz SI +STR_AI_CONFIG_CHANGE_GAMESCRIPT :{BLACK}Wybierz Game Script STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Wczytaj kolejny skrypt STR_AI_CONFIG_CONFIGURE :{BLACK}Konfiguruj STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}Konfiguruj parametry skryptu @@ -4976,7 +4993,7 @@ STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Zrzut ek STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Zrzut ekranu minimapy # AI Parameters -STR_AI_SETTINGS_CAPTION_AI :SI +STR_AI_SETTINGS_CAPTION_AI :{WHITE}Parametry SI STR_AI_SETTINGS_CLOSE :{BLACK}Zamknij STR_AI_SETTINGS_RESET :{BLACK}Resetuj STR_AI_SETTINGS_SETTING :{STRING}: {ORANGE}{STRING} diff --git a/src/lang/russian.txt b/src/lang/russian.txt index ebec995b70..0951301f8f 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -3813,8 +3813,8 @@ STR_FINANCES_CAPTION :{WHITE}Фина STR_FINANCES_YEAR :{WHITE}{NUM} ###length 3 -STR_FINANCES_REVENUE_TITLE :{WHITE}Доход -STR_FINANCES_OPERATING_EXPENSES_TITLE :{WHITE}Эксплуатационные расходы +STR_FINANCES_REVENUE_TITLE :{WHITE}Доходы +STR_FINANCES_OPERATING_EXPENSES_TITLE :{WHITE}Операционные расходы STR_FINANCES_CAPITAL_EXPENSES_TITLE :{WHITE}Капитальные расходы @@ -3837,6 +3837,7 @@ STR_FINANCES_TOTAL_CAPTION :{WHITE}Всег STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} +STR_FINANCES_PROFIT :{WHITE}Прибыль STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Баланс: STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Собственные средства STR_FINANCES_LOAN_TITLE :{WHITE}Взято в кредит diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index ee367f7a4c..e380ac6801 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -204,9 +204,9 @@ STR_UNITS_POWER_SI :{COMMA}{NBSP}kW STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}hp/t STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg -STR_UNITS_POWER_METRIC_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}hp/t -STR_UNITS_POWER_METRIC_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t -STR_UNITS_POWER_METRIC_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg +STR_UNITS_POWER_METRIC_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}cv/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}cv/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_SI :{DECIMAL}{NBSP}cv/Mg STR_UNITS_POWER_SI_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}kW/t STR_UNITS_POWER_SI_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}kW/t STR_UNITS_POWER_SI_TO_WEIGHT_SI :{DECIMAL}{NBSP}W/kg @@ -448,14 +448,14 @@ STR_SUBSIDIES_MENU_SUBSIDIES :Subvenciones STR_GRAPH_MENU_OPERATING_PROFIT_GRAPH :Gráfica de beneficio operativo STR_GRAPH_MENU_INCOME_GRAPH :Gráfica de ingresos STR_GRAPH_MENU_DELIVERED_CARGO_GRAPH :Gráfica de carga entregada -STR_GRAPH_MENU_PERFORMANCE_HISTORY_GRAPH :Gráfica de rendimiento +STR_GRAPH_MENU_PERFORMANCE_HISTORY_GRAPH :Gráfica de desempeño STR_GRAPH_MENU_COMPANY_VALUE_GRAPH :Gráfica del valor de la empresa -STR_GRAPH_MENU_CARGO_PAYMENT_RATES :Tarifas de pagos por carga +STR_GRAPH_MENU_CARGO_PAYMENT_RATES :Tarifas de pagos pago de cargas # Company league menu ###length 3 STR_GRAPH_MENU_COMPANY_LEAGUE_TABLE :Tabla de clasificación de empresas -STR_GRAPH_MENU_DETAILED_PERFORMANCE_RATING :Detalles del rendimiento +STR_GRAPH_MENU_DETAILED_PERFORMANCE_RATING :Calificación detallada de desempeño STR_GRAPH_MENU_HIGHSCORE :Tabla de puntuaciones # Industry menu @@ -603,20 +603,20 @@ STR_GRAPH_Y_LABEL_NUMBER :{TINY_FONT}{COM STR_GRAPH_OPERATING_PROFIT_CAPTION :{WHITE}Gráfica de Beneficio Operativo STR_GRAPH_INCOME_CAPTION :{WHITE}Gráfica de Ingresos STR_GRAPH_CARGO_DELIVERED_CAPTION :{WHITE}Unidades de carga entregadas -STR_GRAPH_COMPANY_PERFORMANCE_RATINGS_CAPTION :{WHITE}Calificaciones de rendimiento de empresas (máximo=1000) +STR_GRAPH_COMPANY_PERFORMANCE_RATINGS_CAPTION :{WHITE}Nivel de desempeño de empresas (máximo=1000) STR_GRAPH_COMPANY_VALUES_CAPTION :{WHITE}Valor de la empresa -STR_GRAPH_CARGO_PAYMENT_RATES_CAPTION :{WHITE}Tarifa de pago por carga +STR_GRAPH_CARGO_PAYMENT_RATES_CAPTION :{WHITE}Tarifas de pago de cargas STR_GRAPH_CARGO_PAYMENT_RATES_X_LABEL :{TINY_FONT}{BLACK}Días en tránsito -STR_GRAPH_CARGO_PAYMENT_RATES_TITLE :{TINY_FONT}{BLACK}Pago por entregar 10 unidades (o 1,000 litros) de carga a una distancia de 20 casillas +STR_GRAPH_CARGO_PAYMENT_RATES_TITLE :{TINY_FONT}{BLACK}Pago por entregar 10 unidades (o 10 000 litros) de carga a una distancia de 20 casillas STR_GRAPH_CARGO_ENABLE_ALL :{TINY_FONT}{BLACK}Activar todos STR_GRAPH_CARGO_DISABLE_ALL :{TINY_FONT}{BLACK}Desactivar todos -STR_GRAPH_CARGO_TOOLTIP_ENABLE_ALL :{BLACK}Mostrar todos los tipos de carga en la gráfica de tarifas de pagos por carga -STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Ocultar todos los tipos de carga en la gráfica de tarifas de pagos por carga +STR_GRAPH_CARGO_TOOLTIP_ENABLE_ALL :{BLACK}Mostrar todos los tipos de carga en la gráfica de tarifas de pago de cargas +STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Ocultar todos los tipos de carga en la gráfica de tarifas de pago de cargas STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Mostrar/Ocultar gráfica para este tipo de carga STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING} -STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP :{BLACK}Muestra detalles del rendimiento +STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP :{BLACK}Muestra detalles del nivel de desempeño # Graph key window STR_GRAPH_KEY_CAPTION :{WHITE}Leyenda de las gráficas @@ -636,21 +636,21 @@ STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_PRESIDENT :Presidente STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TYCOON :Magnate # Performance detail window -STR_PERFORMANCE_DETAIL :{WHITE}Detalle de rendimiento +STR_PERFORMANCE_DETAIL :{WHITE}Detalle de nivel de desempeño STR_PERFORMANCE_DETAIL_KEY :{BLACK}Detalle STR_PERFORMANCE_DETAIL_AMOUNT_CURRENCY :{BLACK}({CURRENCY_SHORT}/{CURRENCY_SHORT}) STR_PERFORMANCE_DETAIL_AMOUNT_INT :{BLACK}({COMMA}/{COMMA}) STR_PERFORMANCE_DETAIL_PERCENT :{WHITE}{NUM}% -STR_PERFORMANCE_DETAIL_SELECT_COMPANY_TOOLTIP :{BLACK}Mostrar detalles de esta empresa +STR_PERFORMANCE_DETAIL_SELECT_COMPANY_TOOLTIP :{BLACK}Muestra detalles para esta empresa ###length 10 STR_PERFORMANCE_DETAIL_VEHICLES :{BLACK}Vehículos: STR_PERFORMANCE_DETAIL_STATIONS :{BLACK}Estaciones: STR_PERFORMANCE_DETAIL_MIN_PROFIT :{BLACK}Beneficio Mín.: -STR_PERFORMANCE_DETAIL_MIN_INCOME :{BLACK}Ingreso Mín.: -STR_PERFORMANCE_DETAIL_MAX_INCOME :{BLACK}Ingreso Máx.: +STR_PERFORMANCE_DETAIL_MIN_INCOME :{BLACK}Beneficio Mín.: +STR_PERFORMANCE_DETAIL_MAX_INCOME :{BLACK}Beneficio Máx.: STR_PERFORMANCE_DETAIL_DELIVERED :{BLACK}Entregado: -STR_PERFORMANCE_DETAIL_CARGO :{BLACK}Carga: +STR_PERFORMANCE_DETAIL_CARGO :{BLACK}Cargas: STR_PERFORMANCE_DETAIL_MONEY :{BLACK}Dinero: STR_PERFORMANCE_DETAIL_LOAN :{BLACK}Préstamo: STR_PERFORMANCE_DETAIL_TOTAL :{BLACK}Total: @@ -658,14 +658,14 @@ STR_PERFORMANCE_DETAIL_TOTAL :{BLACK}Total: ###length 10 STR_PERFORMANCE_DETAIL_VEHICLES_TOOLTIP :{BLACK}Cantidad de vehículos que obtuvieron beneficios el año pasado. Incluye vehículos de carretera, trenes, barcos y aeronaves STR_PERFORMANCE_DETAIL_STATIONS_TOOLTIP :{BLACK}Cantidad de partes de estación que han tenido servicio. Las estaciones de tren, paradas de autobús, aeropuertos y demás son contabilizadas por separado, incluso si pertenecen a la misma estación -STR_PERFORMANCE_DETAIL_MIN_PROFIT_TOOLTIP :{BLACK}Beneficio del vehículo con menores ingresos (considerando sólo vehículos con más de 2 años) -STR_PERFORMANCE_DETAIL_MIN_INCOME_TOOLTIP :{BLACK}Cantidad de dinero ganado en el trimestre con el beneficio más bajo de los pasados 12 trimestres -STR_PERFORMANCE_DETAIL_MAX_INCOME_TOOLTIP :{BLACK}Cantidad de dinero ganado en el trimestre con el beneficio más alto de los pasados 12 trimestres -STR_PERFORMANCE_DETAIL_DELIVERED_TOOLTIP :{BLACK}Unidades de carga entregadas en los pasados cuatro trimestres +STR_PERFORMANCE_DETAIL_MIN_PROFIT_TOOLTIP :{BLACK}Beneficio del vehículo menos rentable (considerando sólo vehículos con más de 2 años) +STR_PERFORMANCE_DETAIL_MIN_INCOME_TOOLTIP :{BLACK}Cantidad de dinero ganado en el trimestre con el menor beneficio de los últimos 12 trimestres +STR_PERFORMANCE_DETAIL_MAX_INCOME_TOOLTIP :{BLACK}Cantidad de dinero ganado en el trimestre con el mayor beneficio de los últimos 12 trimestres +STR_PERFORMANCE_DETAIL_DELIVERED_TOOLTIP :{BLACK}Unidades de carga entregadas en los cuatro últimos trimestres STR_PERFORMANCE_DETAIL_CARGO_TOOLTIP :{BLACK}Número de tipos de carga entregados en el último trimestre STR_PERFORMANCE_DETAIL_MONEY_TOOLTIP :{BLACK}Cantidad de dinero que esta empresa tiene en el banco STR_PERFORMANCE_DETAIL_LOAN_TOOLTIP :{BLACK}Cantidad de dinero que esta empresa ha recibido como préstamo -STR_PERFORMANCE_DETAIL_TOTAL_TOOLTIP :{BLACK}Total de puntos ganados del máximo posible +STR_PERFORMANCE_DETAIL_TOTAL_TOOLTIP :{BLACK}Total de puntos obtenidos del máximo posible # Music window STR_MUSIC_JAZZ_JUKEBOX_CAPTION :{WHITE}Selección de Jazz @@ -1615,7 +1615,7 @@ STR_CONFIG_SETTING_TIMETABLE_IN_TICKS :Mostrar horario STR_CONFIG_SETTING_TIMETABLE_IN_TICKS_HELPTEXT :Muestra los tiempos de viaje en los horarios en tics en lugar de en días STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE :Mostrar salidas y llegadas en los horarios: {STRING} -STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE_HELPTEXT :Muestra tiempos de llegada y salida adelantados en los horarios +STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE_HELPTEXT :Muestra fechas de llegada y salida previstas en los horarios STR_CONFIG_SETTING_QUICKGOTO :Creación rápida de órdenes para vehículos: {STRING} STR_CONFIG_SETTING_QUICKGOTO_HELPTEXT :Preselecciona el cursor "Ir a" al abrir la ventana de órdenes @@ -2603,7 +2603,7 @@ STR_LINKGRAPH_LEGEND_OVERLOADED :{TINY_FONT}{BLA # Linkgraph tooltip STR_LINKGRAPH_STATS_TOOLTIP :{BLACK}{CARGO_LONG} para ser transportad{G 0 o a}{P 0 "" s} al mes desde {STATION} a {STATION} ({COMMA}% de la capacidad){STRING} -STR_LINKGRAPH_STATS_TOOLTIP_RETURN_EXTENSION :{}{CARGO_LONG} para ser transportad{G 0 o a}{P 0 "" s}) de vuelta ({COMMA}% de la capacidad) +STR_LINKGRAPH_STATS_TOOLTIP_RETURN_EXTENSION :{}{CARGO_LONG} para ser transportad{G 0 o a}{P 0 "" s} de vuelta ({COMMA}% de la capacidad) STR_LINKGRAPH_STATS_TOOLTIP_TIME_EXTENSION :{}Tiempo de viaje promedio: {NUM}{NBSP}día{P "" s} # Base for station construction window(s) @@ -3617,10 +3617,10 @@ STR_CARGO_RATING_OUTSTANDING :Excepcional STR_STATION_VIEW_CENTER_TOOLTIP :{BLACK}Centrar vista en la posición de la estación. Ctrl+clic abre un punto de vista en dicha posición STR_STATION_VIEW_RENAME_TOOLTIP :{BLACK}Cambia el nombre de la estación -STR_STATION_VIEW_SCHEDULED_TRAINS_TOOLTIP :{BLACK}Muestra todos los trenes que tienen esta estación en su horario -STR_STATION_VIEW_SCHEDULED_ROAD_VEHICLES_TOOLTIP :{BLACK}Muestra todos los vehículos de carretera que tienen esta estación en su horario -STR_STATION_VIEW_SCHEDULED_AIRCRAFT_TOOLTIP :{BLACK}Muestra todas las aeronaves que tienen esta estación en su horario -STR_STATION_VIEW_SCHEDULED_SHIPS_TOOLTIP :{BLACK}Muestra todos los barcos que tienen esta estación en su horario +STR_STATION_VIEW_SCHEDULED_TRAINS_TOOLTIP :{BLACK}Muestra todos los trenes que tienen esta estación en sus órdenes +STR_STATION_VIEW_SCHEDULED_ROAD_VEHICLES_TOOLTIP :{BLACK}Muestra todos los vehículos de carretera que tienen esta estación en sus órdenes +STR_STATION_VIEW_SCHEDULED_AIRCRAFT_TOOLTIP :{BLACK}Muestra todas las aeronaves que tienen esta estación en sus órdenes +STR_STATION_VIEW_SCHEDULED_SHIPS_TOOLTIP :{BLACK}Muestra todos los barcos que tienen esta estación en sus órdenes STR_STATION_VIEW_RENAME_STATION_CAPTION :Renombrar estación/zona de carga @@ -3661,15 +3661,18 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}Barcos STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}Intereses de Préstamo STR_FINANCES_SECTION_OTHER :{GOLD}Otros +STR_FINANCES_TOTAL_CAPTION :{WHITE}Total STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} -STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Saldo en Banco +STR_FINANCES_PROFIT :{WHITE}Beneficio +STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Saldo bancario STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Fondos propios STR_FINANCES_LOAN_TITLE :{WHITE}Préstamo STR_FINANCES_INTEREST_RATE :{WHITE}Tipo de interés del préstamo: {BLACK}{NUM}% STR_FINANCES_MAX_LOAN :{WHITE}Préstamo Máximo: {BLACK}{CURRENCY_LONG} STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} +STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}Pedir Préstamo {CURRENCY_LONG} STR_FINANCES_BORROW_TOOLTIP :{BLACK}Incrementa el préstamo. Ctrl+clic solicita todo el préstamo posible STR_FINANCES_REPAY_BUTTON :{BLACK}Pagar Préstamo {CURRENCY_LONG} @@ -4223,7 +4226,7 @@ STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Peso: {L STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Peso: {LTBLUE}{WEIGHT_SHORT} {BLACK}Potencia: {LTBLUE}{POWER}{BLACK} Velocidad Máx.: {LTBLUE}{VELOCITY} {BLACK}F.T. Máx.: {LTBLUE}{FORCE} STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Beneficio este año: {LTBLUE}{CURRENCY_LONG} (año anterior: {CURRENCY_LONG}) -STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Beneficio este año: {LTBLUE}{CURRENCY_LONG} (año anterior: {CURRENCY_LONG}) {BLACK}Mín. rendimiento: {LTBLUE}{POWER_TO_WEIGHT} +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Beneficio este año: {LTBLUE}{CURRENCY_LONG} (año anterior: {CURRENCY_LONG}) {BLACK}Potencia específica mín.: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Fiabilidad: {LTBLUE}{COMMA}% {BLACK}Averías desde el último mantenimiento: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Construido: {LTBLUE}{NUM}{BLACK} Valor: {LTBLUE}{CURRENCY_LONG} @@ -4390,7 +4393,7 @@ STR_ORDER_CONDITIONAL :Salto de orden STR_ORDER_SHARE :Compartir órdenes STR_ORDERS_GO_TO_TOOLTIP :{BLACK}Añade una nueva orden antes de la orden resaltada, o la añade al final de la lista. Ctrl sobre estaciones ordena 'Carga completa de cualquier carga', sobre puntos de ruta ordena 'sin paradas' y sobre depósitos ordena 'mantenimiento'. Ctrl o Compartir órdenes permite a este vehículo compartir órdenes con el vehículo seleccionado. Clica sobre un vehículo copia las órdenes. Una órden de depósito desactiva el mantenimiento automático del vehículo -STR_ORDERS_VEH_WITH_SHARED_ORDERS_LIST_TOOLTIP :{BLACK}Muestra todos los vehículos con el mismo horario +STR_ORDERS_VEH_WITH_SHARED_ORDERS_LIST_TOOLTIP :{BLACK}Muestra todos los vehículos que comparten estas órdenes y este horario # String parts to build the order string STR_ORDER_GO_TO_WAYPOINT :Ir vía {WAYPOINT} @@ -4470,54 +4473,54 @@ STR_TIMETABLE_ORDER_VIEW_TOOLTIP :{BLACK}Cambia a STR_TIMETABLE_TOOLTIP :{BLACK}Horario - Clica en una orden para resaltarla -STR_TIMETABLE_NO_TRAVEL :Sin viaje +STR_TIMETABLE_NO_TRAVEL :No viajar STR_TIMETABLE_NOT_TIMETABLEABLE :Viajar (automático; programado por la próxima orden manual) STR_TIMETABLE_TRAVEL_NOT_TIMETABLED :Viajar (sin programar) STR_TIMETABLE_TRAVEL_NOT_TIMETABLED_SPEED :Viajar (sin programar) a {2:VELOCITY} como máximo STR_TIMETABLE_TRAVEL_FOR :Viajar durante {STRING} STR_TIMETABLE_TRAVEL_FOR_SPEED :Viajar durante {STRING} a {VELOCITY} como máximo -STR_TIMETABLE_TRAVEL_FOR_ESTIMATED :Viajando (durante {STRING}, sin programar) -STR_TIMETABLE_TRAVEL_FOR_SPEED_ESTIMATED :Viajando (durante {STRING}, sin programar) a {VELOCITY} como máximo -STR_TIMETABLE_STAY_FOR_ESTIMATED :(permaneciendo {STRING}, sin programar) -STR_TIMETABLE_AND_TRAVEL_FOR_ESTIMATED :(viajando durante {STRING}, sin programar) -STR_TIMETABLE_STAY_FOR :y esperar {STRING} +STR_TIMETABLE_TRAVEL_FOR_ESTIMATED :Viajar (durante {STRING}, sin programar) +STR_TIMETABLE_TRAVEL_FOR_SPEED_ESTIMATED :Viajar (durante {STRING}, sin programar) a {VELOCITY} como máximo +STR_TIMETABLE_STAY_FOR_ESTIMATED :(permanecer {STRING}, sin programar) +STR_TIMETABLE_AND_TRAVEL_FOR_ESTIMATED :(viajar durante {STRING}, sin programar) +STR_TIMETABLE_STAY_FOR :y permanecer {STRING} STR_TIMETABLE_AND_TRAVEL_FOR :y viajar durante {STRING} STR_TIMETABLE_DAYS :{COMMA}{NBSP}día{P "" s} STR_TIMETABLE_TICKS :{COMMA}{NBSP}tic{P "" s} -STR_TIMETABLE_TOTAL_TIME :{BLACK}El horario tardará {STRING} en completarse -STR_TIMETABLE_TOTAL_TIME_INCOMPLETE :{BLACK}El horario tardará al menos {STRING} en completarse (no todas las órdenes) +STR_TIMETABLE_TOTAL_TIME :{BLACK}El horario tardará {STRING} en recorrerse +STR_TIMETABLE_TOTAL_TIME_INCOMPLETE :{BLACK}El horario tardará al menos {STRING} en recorrerse (no todas las órdenes) -STR_TIMETABLE_STATUS_ON_TIME :{BLACK}Este vehículo está actualmente en hora -STR_TIMETABLE_STATUS_LATE :{BLACK}Este vehículo está actualmente retrasado {STRING} -STR_TIMETABLE_STATUS_EARLY :{BLACK}Este vehículo está actualmente adelantado {STRING} +STR_TIMETABLE_STATUS_ON_TIME :{BLACK}Este vehículo actualmente es puntual +STR_TIMETABLE_STATUS_LATE :{BLACK}Este vehículo actualmente está retrasado {STRING} +STR_TIMETABLE_STATUS_EARLY :{BLACK}Este vehículo actualmente está adelantado {STRING} STR_TIMETABLE_STATUS_NOT_STARTED :{BLACK}Este horario no ha comenzado STR_TIMETABLE_STATUS_START_AT :{BLACK}Este horario comenzará el {STRING} STR_TIMETABLE_STARTING_DATE :{BLACK}Fecha de inicio -STR_TIMETABLE_STARTING_DATE_TOOLTIP :{BLACK}Selecciona la fecha de inicio del horario. Ctrl+click distribuye uniformemente todos los vehículos que compartan este horario a partir de la fecha proporcionada, basados en su orden relativo, siempre que el horario esté completo +STR_TIMETABLE_STARTING_DATE_TOOLTIP :{BLACK}Selecciona la fecha de inicio del horario. Ctrl+click distribuye uniformemente todos los vehículos que compartan este horario a partir de la fecha proporcionada, basados en su orden relativo, siempre que el horario esté completamente rellenado -STR_TIMETABLE_CHANGE_TIME :{BLACK}Cambiar duración -STR_TIMETABLE_WAIT_TIME_TOOLTIP :{BLACK}Cambia la duración de la orden seleccionada +STR_TIMETABLE_CHANGE_TIME :{BLACK}Modificar duración +STR_TIMETABLE_WAIT_TIME_TOOLTIP :{BLACK}Modifica la duración de la orden seleccionada STR_TIMETABLE_CLEAR_TIME :{BLACK}Borrar duración STR_TIMETABLE_CLEAR_TIME_TOOLTIP :{BLACK}Borra la duración de la orden resaltada -STR_TIMETABLE_CHANGE_SPEED :{BLACK}Cambiar límite de velocidad +STR_TIMETABLE_CHANGE_SPEED :{BLACK}Modificar límite de velocidad STR_TIMETABLE_CHANGE_SPEED_TOOLTIP :{BLACK}Cambia el límite de velocidad de la orden resaltada STR_TIMETABLE_CLEAR_SPEED :{BLACK}Borrar límite de velocidad STR_TIMETABLE_CLEAR_SPEED_TOOLTIP :{BLACK}Borra el límite de velocidad de la orden resaltada -STR_TIMETABLE_RESET_LATENESS :{BLACK}Reiniciar retrasos -STR_TIMETABLE_RESET_LATENESS_TOOLTIP :{BLACK}Pone a cero el retraso del vehículo, así el vehículo estará en hora +STR_TIMETABLE_RESET_LATENESS :{BLACK}Reiniciar retraso +STR_TIMETABLE_RESET_LATENESS_TOOLTIP :{BLACK}Establece en cero el retraso acumulado del vehículo para que sea puntual STR_TIMETABLE_AUTOFILL :{BLACK}Rellenar automáticamente -STR_TIMETABLE_AUTOFILL_TOOLTIP :{BLACK}Rellena la tabla de horarios automáticamente con los valores de la siguiente jornada (Ctrl+clic para tratar de mantener los tiempos de espera) +STR_TIMETABLE_AUTOFILL_TOOLTIP :{BLACK}Rellena el horario automáticamente con los valores del siguiente recorrido (Ctrl+clic para intentar mantener los tiempos de espera) -STR_TIMETABLE_EXPECTED :{BLACK}Esperado +STR_TIMETABLE_EXPECTED :{BLACK}Previsto STR_TIMETABLE_SCHEDULED :{BLACK}Programado -STR_TIMETABLE_EXPECTED_TOOLTIP :{BLACK}Alterna entre esperado y programado +STR_TIMETABLE_EXPECTED_TOOLTIP :{BLACK}Alterna entre fechas previstas y programadas STR_TIMETABLE_ARRIVAL_ABBREVIATION :Ll: STR_TIMETABLE_DEPARTURE_ABBREVIATION :S: @@ -5059,7 +5062,7 @@ STR_ERROR_AIRCRAFT_NOT_ENOUGH_RANGE :{WHITE}... la a # Timetable related errors STR_ERROR_CAN_T_TIMETABLE_VEHICLE :{WHITE}No se puede asignar horario al vehículo... STR_ERROR_TIMETABLE_ONLY_WAIT_AT_STATIONS :{WHITE}Los vehículos sólo pueden esperar en estaciones -STR_ERROR_TIMETABLE_NOT_STOPPING_HERE :{WHITE}Este vehículo no va a detenerse en esta estación +STR_ERROR_TIMETABLE_NOT_STOPPING_HERE :{WHITE}Este vehículo no se detendrá en esta estación # Sign related errors STR_ERROR_TOO_MANY_SIGNS :{WHITE}... demasiados letreros From 6ea3e7e4876a417740a753041496d007fd3d4e8d Mon Sep 17 00:00:00 2001 From: PeterN Date: Wed, 16 Nov 2022 19:02:51 +0000 Subject: [PATCH 21/42] Fix #10164: Incorrect slider handle position in RTL. (#10175) --- src/widgets/slider.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/widgets/slider.cpp b/src/widgets/slider.cpp index 023101e73b..59d0483668 100644 --- a/src/widgets/slider.cpp +++ b/src/widgets/slider.cpp @@ -63,8 +63,9 @@ void DrawSliderWidget(Rect r, int min_value, int max_value, int value, const std } /* Draw a slider handle indicating current value. */ + value -= min_value; if (_current_text_dir == TD_RTL) value = max_value - value; - x = r.left + ((value - min_value) * (r.right - r.left - sw) / max_value); + x = r.left + (value * (r.right - r.left - sw) / max_value); DrawFrameRect(x, r.top, x + sw, r.bottom, COLOUR_GREY, FR_NONE); } From c81c242c5a371c4e3845d93eb4df674ae179fe5f Mon Sep 17 00:00:00 2001 From: PeterN Date: Thu, 17 Nov 2022 09:10:47 +0000 Subject: [PATCH 22/42] Fix: Crash if error message window is too wide for screen. (#10172) This doesn't seem new, just easier to trigger with new scaling. --- src/error_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error_gui.cpp b/src/error_gui.cpp index d54d0a2705..77a96bfc7d 100644 --- a/src/error_gui.cpp +++ b/src/error_gui.cpp @@ -245,8 +245,8 @@ public: pt.y = UnScaleByZoom(pt.y - vp->virtual_top, vp->zoom) + vp->top; pt.y = (pt.y < (_screen.height >> 1)) ? scr_bot - sm_height : scr_top; } else { - pt.x = Clamp(UnScaleByZoom(pt.x - vp->virtual_left, vp->zoom) + vp->left - (sm_width / 2), 0, _screen.width - sm_width); - pt.y = Clamp(UnScaleByZoom(pt.y - vp->virtual_top, vp->zoom) + vp->top - (sm_height / 2), scr_top, scr_bot - sm_height); + pt.x = std::min(std::max(UnScaleByZoom(pt.x - vp->virtual_left, vp->zoom) + vp->left - (sm_width / 2), 0), _screen.width - sm_width); + pt.y = std::min(std::max(UnScaleByZoom(pt.y - vp->virtual_top, vp->zoom) + vp->top - (sm_height / 2), scr_top), scr_bot - sm_height); } return pt; } From 9bf24ec56f9cf740b0139945e19dca8c1643f078 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 14 Nov 2022 22:27:30 +0000 Subject: [PATCH 23/42] Codechange: Reorder and properly declare DrawSpriteIgnorePadding(). Parameters have been rearranged to be closer to those of the standard DrawSprite() function, and PaletteID can now be set. --- src/gfx_func.h | 1 + src/settings_gui.cpp | 10 +++------- src/widget.cpp | 10 +++++----- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/gfx_func.h b/src/gfx_func.h index 5f5b89003e..882f6482ec 100644 --- a/src/gfx_func.h +++ b/src/gfx_func.h @@ -92,6 +92,7 @@ Dimension GetSpriteSize(SpriteID sprid, Point *offset = nullptr, ZoomLevel zoom Dimension GetScaledSpriteSize(SpriteID sprid); /* widget.cpp */ void DrawSpriteViewport(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub = nullptr); void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub = nullptr, ZoomLevel zoom = ZOOM_LVL_GUI); +void DrawSpriteIgnorePadding(SpriteID img, PaletteID pal, const Rect &r, bool clicked, StringAlignment align); /* widget.cpp */ std::unique_ptr DrawSpriteToRgbaBuffer(SpriteID spriteId, ZoomLevel zoom = ZOOM_LVL_GUI); int DrawString(int left, int right, int top, const char *str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false, FontSize fontsize = FS_NORMAL); diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index b5e31f7f4f..ac214fe6ea 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -2532,8 +2532,6 @@ void ShowGameSettings() */ void DrawArrowButtons(int x, int y, Colours button_colour, byte state, bool clickable_left, bool clickable_right) { - extern void DrawSpriteIgnorePadding(const Rect &r, SpriteID img, bool clicked, StringAlignment align); - int colour = _colour_gradient[button_colour][2]; Dimension dim = NWidgetScrollbar::GetHorizontalDimension(); @@ -2542,8 +2540,8 @@ void DrawArrowButtons(int x, int y, Colours button_colour, byte state, bool clic DrawFrameRect(lr, button_colour, (state == 1) ? FR_LOWERED : FR_NONE); DrawFrameRect(rr, button_colour, (state == 2) ? FR_LOWERED : FR_NONE); - DrawSpriteIgnorePadding(lr, SPR_ARROW_LEFT, (state == 1), SA_CENTER); - DrawSpriteIgnorePadding(rr, SPR_ARROW_RIGHT, (state == 2), SA_CENTER); + DrawSpriteIgnorePadding(SPR_ARROW_LEFT, PAL_NONE, lr, (state == 1), SA_CENTER); + DrawSpriteIgnorePadding(SPR_ARROW_RIGHT, PAL_NONE, rr, (state == 2), SA_CENTER); /* Grey out the buttons that aren't clickable */ bool rtl = _current_text_dir == TD_RTL; @@ -2565,14 +2563,12 @@ void DrawArrowButtons(int x, int y, Colours button_colour, byte state, bool clic */ void DrawDropDownButton(int x, int y, Colours button_colour, bool state, bool clickable) { - extern void DrawSpriteIgnorePadding(const Rect &r, SpriteID img, bool clicked, StringAlignment align); - int colour = _colour_gradient[button_colour][2]; Rect r = {x, y, x + SETTING_BUTTON_WIDTH - 1, y + SETTING_BUTTON_HEIGHT - 1}; DrawFrameRect(r, button_colour, state ? FR_LOWERED : FR_NONE); - DrawSpriteIgnorePadding(r, SPR_ARROW_DOWN, state, SA_CENTER); + DrawSpriteIgnorePadding(SPR_ARROW_DOWN, PAL_NONE, r, state, SA_CENTER); if (!clickable) { GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), colour, FILLRECT_CHECKER); diff --git a/src/widget.cpp b/src/widget.cpp index df50dadb72..9c9868988c 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -447,7 +447,7 @@ void DrawFrameRect(int left, int top, int right, int bottom, Colours colour, Fra } } -void DrawSpriteIgnorePadding(const Rect &r, SpriteID img, bool clicked, StringAlignment align) +void DrawSpriteIgnorePadding(SpriteID img, PaletteID pal, const Rect &r, bool clicked, StringAlignment align) { Point offset; Dimension d = GetSpriteSize(img, &offset); @@ -456,7 +456,7 @@ void DrawSpriteIgnorePadding(const Rect &r, SpriteID img, bool clicked, StringAl Point p = GetAlignedPosition(r, d, align); int o = clicked ? WidgetDimensions::scaled.pressed : 0; - DrawSprite(img, PAL_NONE, p.x + o - offset.x, p.y + o - offset.y); + DrawSprite(img, pal, p.x + o - offset.x, p.y + o - offset.y); } /** @@ -474,7 +474,7 @@ static inline void DrawImageButtons(const Rect &r, WidgetType type, Colours colo DrawFrameRect(r.left, r.top, r.right, r.bottom, colour, (clicked) ? FR_LOWERED : FR_NONE); if ((type & WWT_MASK) == WWT_IMGBTN_2 && clicked) img++; // Show different image when clicked for #WWT_IMGBTN_2. - DrawSpriteIgnorePadding(r, img, clicked, align); + DrawSpriteIgnorePadding(img, PAL_NONE, r, clicked, align); } /** @@ -773,7 +773,7 @@ static inline void DrawDebugBox(const Rect &r, Colours colour, bool clicked) static inline void DrawResizeBox(const Rect &r, Colours colour, bool at_left, bool clicked) { DrawFrameRect(r.left, r.top, r.right, r.bottom, colour, (clicked) ? FR_LOWERED : FR_NONE); - DrawSpriteIgnorePadding(r.Shrink(ScaleGUITrad(2)), at_left ? SPR_WINDOW_RESIZE_LEFT : SPR_WINDOW_RESIZE_RIGHT, clicked, at_left ? (SA_LEFT | SA_BOTTOM | SA_FORCE) : (SA_RIGHT | SA_BOTTOM | SA_FORCE)); + DrawSpriteIgnorePadding(at_left ? SPR_WINDOW_RESIZE_LEFT : SPR_WINDOW_RESIZE_RIGHT, PAL_NONE, r.Shrink(ScaleGUITrad(2)), clicked, at_left ? (SA_LEFT | SA_BOTTOM | SA_FORCE) : (SA_RIGHT | SA_BOTTOM | SA_FORCE)); } /** @@ -897,7 +897,7 @@ void Window::DrawSortButtonState(int widget, SortButtonState state) const /* Sort button uses the same sprites as vertical scrollbar */ Dimension dim = NWidgetScrollbar::GetVerticalDimension(); - DrawSpriteIgnorePadding(r.WithWidth(dim.width, _current_text_dir == TD_LTR), state == SBS_DOWN ? SPR_ARROW_DOWN : SPR_ARROW_UP, this->IsWidgetLowered(widget), SA_CENTER); + DrawSpriteIgnorePadding(state == SBS_DOWN ? SPR_ARROW_DOWN : SPR_ARROW_UP, PAL_NONE, r.WithWidth(dim.width, _current_text_dir == TD_LTR), this->IsWidgetLowered(widget), SA_CENTER); } /** From 60404c3aea06ab85836795f3e88d23329829fa0f Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 14 Nov 2022 23:48:34 +0000 Subject: [PATCH 24/42] Fix #8770: Centre vehicle status bar icon. The icon is now centred within its scaled bounding box, which intentionally leaves a little space around the icon when not at 1/2/4x scale. --- src/vehicle_gui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index d6a30ccdf1..ee15c21bcc 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2878,7 +2878,7 @@ public: const Vehicle *v = Vehicle::Get(this->window_number); switch (widget) { case WID_VV_START_STOP: - size->height = std::max({size->height, (uint)FONT_HEIGHT_NORMAL, GetSpriteSize(SPR_WARNING_SIGN).height, GetSpriteSize(SPR_FLAG_VEH_STOPPED).height, GetSpriteSize(SPR_FLAG_VEH_RUNNING).height}) + padding.height; + size->height = std::max({size->height, (uint)FONT_HEIGHT_NORMAL, GetScaledSpriteSize(SPR_WARNING_SIGN).height, GetScaledSpriteSize(SPR_FLAG_VEH_STOPPED).height, GetScaledSpriteSize(SPR_FLAG_VEH_RUNNING).height}) + padding.height; break; case WID_VV_FORCE_PROCEED: @@ -3025,11 +3025,11 @@ public: /* Draw the flag plus orders. */ bool rtl = (_current_text_dir == TD_RTL); - uint icon_width = std::max({GetSpriteSize(SPR_WARNING_SIGN).width, GetSpriteSize(SPR_FLAG_VEH_STOPPED).width, GetSpriteSize(SPR_FLAG_VEH_RUNNING).width}); + uint icon_width = std::max({GetScaledSpriteSize(SPR_WARNING_SIGN).width, GetScaledSpriteSize(SPR_FLAG_VEH_STOPPED).width, GetScaledSpriteSize(SPR_FLAG_VEH_RUNNING).width}); int lowered = this->IsWidgetLowered(widget) ? WidgetDimensions::scaled.pressed : 0; Rect tr = r.Shrink(WidgetDimensions::scaled.framerect).Translate(lowered, lowered); SpriteID image = ((v->vehstatus & VS_STOPPED) != 0) ? SPR_FLAG_VEH_STOPPED : (HasBit(v->vehicle_flags, VF_PATHFINDER_LOST)) ? SPR_WARNING_SIGN : SPR_FLAG_VEH_RUNNING; - DrawSprite(image, PAL_NONE, tr.WithWidth(icon_width, rtl).left, CenterBounds(tr.top, tr.bottom, GetSpriteSize(image).height)); + DrawSpriteIgnorePadding(image, PAL_NONE, tr.WithWidth(icon_width, rtl), false, SA_CENTER); tr = tr.Indent(icon_width + WidgetDimensions::scaled.imgbtn.Horizontal(), rtl); DrawString(tr.left, tr.right, CenterBounds(tr.top, tr.bottom, FONT_HEIGHT_NORMAL), str, text_colour, SA_HOR_CENTER); } From 3040efdb10e82f97fb39624dc8f082f8f5ef7cab Mon Sep 17 00:00:00 2001 From: translators Date: Thu, 17 Nov 2022 18:47:07 +0000 Subject: [PATCH 25/42] Update: Translations from eints spanish (mexican): 74 changes by absay russian: 2 changes by Ln-Wolf spanish: 6 changes by MontyMontana polish: 1 change by pAter-exe --- src/lang/polish.txt | 2 +- src/lang/russian.txt | 2 + src/lang/spanish.txt | 12 ++-- src/lang/spanish_MX.txt | 148 ++++++++++++++++++++-------------------- 4 files changed, 83 insertions(+), 81 deletions(-) diff --git a/src/lang/polish.txt b/src/lang/polish.txt index 4a9aa765c9..d3cd2a699b 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -4971,7 +4971,7 @@ STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}Konfigur # Available AIs window STR_AI_LIST_CAPTION :{WHITE}Dostępne {STRING} -STR_AI_LIST_CAPTION_AI :Gracze SI +STR_AI_LIST_CAPTION_AI :SI STR_AI_LIST_CAPTION_GAMESCRIPT :Game Scripty STR_AI_LIST_TOOLTIP :{BLACK}Kliknij, aby wybrać skrypt diff --git a/src/lang/russian.txt b/src/lang/russian.txt index 0951301f8f..a40b0f7294 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -1158,6 +1158,8 @@ STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Изме STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Автоопределение STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Нажмите для автоматической установки масштаба интерфейса +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Масштабировать рельеф +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Масштабировать рельефные элементы интерфейса STR_GAME_OPTIONS_GUI_SCALE_1X :1x STR_GAME_OPTIONS_GUI_SCALE_2X :2x diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index e380ac6801..b9cc1f48f8 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -237,7 +237,7 @@ STR_UNITS_HEIGHT_SI :{COMMA}{NBSP}m # Common window strings STR_LIST_FILTER_TITLE :{BLACK}Filtro: -STR_LIST_FILTER_OSKTITLE :{BLACK}Introduce una o varias palabras clave para filtrar la lista +STR_LIST_FILTER_OSKTITLE :{BLACK}Introduce texto para filtrar STR_LIST_FILTER_TOOLTIP :{BLACK}Introduce una o varias palabras clave para filtrar la lista STR_TOOLTIP_GROUP_ORDER :{BLACK}Selecciona la orden de agrupamiento @@ -450,7 +450,7 @@ STR_GRAPH_MENU_INCOME_GRAPH :Gráfica de ing STR_GRAPH_MENU_DELIVERED_CARGO_GRAPH :Gráfica de carga entregada STR_GRAPH_MENU_PERFORMANCE_HISTORY_GRAPH :Gráfica de desempeño STR_GRAPH_MENU_COMPANY_VALUE_GRAPH :Gráfica del valor de la empresa -STR_GRAPH_MENU_CARGO_PAYMENT_RATES :Tarifas de pagos pago de cargas +STR_GRAPH_MENU_CARGO_PAYMENT_RATES :Tarifas de pago de cargas # Company league menu ###length 3 @@ -611,9 +611,9 @@ STR_GRAPH_CARGO_PAYMENT_RATES_X_LABEL :{TINY_FONT}{BLA STR_GRAPH_CARGO_PAYMENT_RATES_TITLE :{TINY_FONT}{BLACK}Pago por entregar 10 unidades (o 10 000 litros) de carga a una distancia de 20 casillas STR_GRAPH_CARGO_ENABLE_ALL :{TINY_FONT}{BLACK}Activar todos STR_GRAPH_CARGO_DISABLE_ALL :{TINY_FONT}{BLACK}Desactivar todos -STR_GRAPH_CARGO_TOOLTIP_ENABLE_ALL :{BLACK}Mostrar todos los tipos de carga en la gráfica de tarifas de pago de cargas -STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Ocultar todos los tipos de carga en la gráfica de tarifas de pago de cargas -STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Mostrar/Ocultar gráfica para este tipo de carga +STR_GRAPH_CARGO_TOOLTIP_ENABLE_ALL :{BLACK}Muestra todos los tipos de carga en la gráfica de tarifas de pago de cargas +STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Oculta todos los tipos de carga en la gráfica de tarifas de pago de cargas +STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Alterna entre mostrar/ocultar la gráfica para este tipo de carga STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING} STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP :{BLACK}Muestra detalles del nivel de desempeño @@ -4516,7 +4516,7 @@ STR_TIMETABLE_RESET_LATENESS :{BLACK}Reinicia STR_TIMETABLE_RESET_LATENESS_TOOLTIP :{BLACK}Establece en cero el retraso acumulado del vehículo para que sea puntual STR_TIMETABLE_AUTOFILL :{BLACK}Rellenar automáticamente -STR_TIMETABLE_AUTOFILL_TOOLTIP :{BLACK}Rellena el horario automáticamente con los valores del siguiente recorrido (Ctrl+clic para intentar mantener los tiempos de espera) +STR_TIMETABLE_AUTOFILL_TOOLTIP :{BLACK}Rellena el horario automáticamente con los valores del siguiente recorrido (Ctrl+clic para intentar mantener los tiempos de permanencia en estación) STR_TIMETABLE_EXPECTED :{BLACK}Previsto STR_TIMETABLE_SCHEDULED :{BLACK}Programado diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index 196b304433..a1466d6346 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -315,7 +315,7 @@ STR_SORT_BY_WAITING_TOTAL :Carga total en STR_SORT_BY_WAITING_AVAILABLE :Carga disponible en espera STR_SORT_BY_RATING_MAX :Mayor índice de carga STR_SORT_BY_RATING_MIN :Menor índice de carga -STR_SORT_BY_ENGINE_ID :Id. locomotora (orden clásico) +STR_SORT_BY_ENGINE_ID :ID de vehículo (orden clásico) STR_SORT_BY_COST :Costo STR_SORT_BY_POWER :Potencia STR_SORT_BY_TRACTIVE_EFFORT :Fuerza de tracción @@ -656,7 +656,7 @@ STR_PERFORMANCE_DETAIL_LOAN :{BLACK}Préstam STR_PERFORMANCE_DETAIL_TOTAL :{BLACK}Total: ###length 10 -STR_PERFORMANCE_DETAIL_VEHICLES_TOOLTIP :{BLACK}Cuántos vehículos tuvieron ganancias el último año, contando los de carretera, trenes, barcos y aeronaves +STR_PERFORMANCE_DETAIL_VEHICLES_TOOLTIP :{BLACK}Cuántos vehículos tuvieron ganancias el último año, contando los autotransportes, trenes, barcos y aeronaves STR_PERFORMANCE_DETAIL_STATIONS_TOOLTIP :{BLACK}Número de estaciones abastecidas recientemente. Las estaciones de tren, paradas de autobuses, aeropuertos y demás se contabilizan aparte, aun si pertenecen a la misma estación STR_PERFORMANCE_DETAIL_MIN_PROFIT_TOOLTIP :{BLACK}Utilidad del vehículo con menores ingresos (de entre aquellos con más de 2 años) STR_PERFORMANCE_DETAIL_MIN_INCOME_TOOLTIP :{BLACK}Cantidad de efectivo ganado en el trimestre con la utilidad más baja de los últimos 12 trimestres @@ -790,12 +790,12 @@ STR_SMALLMAP_TOWN :{TINY_FONT}{WHI STR_SMALLMAP_DISABLE_ALL :{BLACK}Ocultar todo STR_SMALLMAP_ENABLE_ALL :{BLACK}Mostrar todo STR_SMALLMAP_SHOW_HEIGHT :{BLACK}Mostrar relieve -STR_SMALLMAP_TOOLTIP_DISABLE_ALL_INDUSTRIES :{BLACK}No mostrar industrias en el mapa +STR_SMALLMAP_TOOLTIP_DISABLE_ALL_INDUSTRIES :{BLACK}Ocultar del mapa las industrias STR_SMALLMAP_TOOLTIP_ENABLE_ALL_INDUSTRIES :{BLACK}Mostrar todas las industrias en el mapa STR_SMALLMAP_TOOLTIP_SHOW_HEIGHT :{BLACK}Alternar vista de relieve -STR_SMALLMAP_TOOLTIP_DISABLE_ALL_COMPANIES :{BLACK}No mostrar propiedades de empresas en el mapa +STR_SMALLMAP_TOOLTIP_DISABLE_ALL_COMPANIES :{BLACK}Ocultar del mapa las propiedades de las empresas STR_SMALLMAP_TOOLTIP_ENABLE_ALL_COMPANIES :{BLACK}Mostrar todas las propiedades de empresas en el mapa -STR_SMALLMAP_TOOLTIP_DISABLE_ALL_CARGOS :{BLACK}Ocultar todas las cargas del mapa +STR_SMALLMAP_TOOLTIP_DISABLE_ALL_CARGOS :{BLACK}Ocultar del mapa las cargas STR_SMALLMAP_TOOLTIP_ENABLE_ALL_CARGOS :{BLACK}Mostrar todas las cargas en el mapa # Status bar messages @@ -831,7 +831,7 @@ STR_NEWS_AIRCRAFT_CRASH :{BIG_FONT}{BLAC STR_NEWS_PLANE_CRASH_OUT_OF_FUEL :{BIG_FONT}{BLACK}¡Accidente aéreo!{}Avión se queda sin combustible, ¡{COMMA} personas mueren en explosión! STR_NEWS_DISASTER_ZEPPELIN :{BIG_FONT}{BLACK}¡Desastre de zepelín en {STATION}! -STR_NEWS_DISASTER_SMALL_UFO :{BIG_FONT}{BLACK}¡Vehículo destruido en la carretara al impactar con ovni! +STR_NEWS_DISASTER_SMALL_UFO :{BIG_FONT}{BLACK}¡Vehículo destruido en la carretera al impactar con ovni! STR_NEWS_DISASTER_AIRPLANE_OIL_REFINERY :{BIG_FONT}{BLACK}¡Explota refinería de petróleo cerca de {TOWN}! STR_NEWS_DISASTER_HELICOPTER_FACTORY :{BIG_FONT}{BLACK}¡Fábrica destruida misteriosamente cerca de {TOWN}! STR_NEWS_DISASTER_BIG_UFO :{BIG_FONT}{BLACK}¡Ovni aterriza cerca de {TOWN}! @@ -1253,16 +1253,16 @@ STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_AUTO :(automático) STR_CONFIG_SETTING_TOO_HIGH_MOUNTAIN :{WHITE}No se puede establecer el límite de elevación del mapa en el valor indicado. Al menos una montaña ya es más alta STR_CONFIG_SETTING_AUTOSLOPE :Alterar terreno debajo de edificios, vías férreas, etc.: {STRING} -STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Permitir la alteración del terreno debajo de infraestructura sin tener que retirarla +STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Permitir alteración de terreno debajo de infraestructura sin tener que retirarla -STR_CONFIG_SETTING_CATCHMENT :Permitir cambiar el tamaño del área de recolección a una forma más real: {STRING} -STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Las áreas de recolección se adecúan a diferentes tamaños, según los tipos de estaciones y aeropuertos +STR_CONFIG_SETTING_CATCHMENT :Permitir áreas de recolección más realistas: {STRING} +STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Las áreas de recolección se ajustarán a los tamaños de los tipos de estaciones y aeropuertos STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES :Las estaciones privadas pueden dar servicio a industrias con estaciones neutrales: {STRING} STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT :Al activarse, las industrias con estaciones integradas (ej. plataformas petrolíferas) podrán aceptar carga de estaciones aledañas. Al desactivarse, tales industrias solo recibirán carga en sus propias estaciones y no aceptarán de otras estaciones, ni la estación integrada brindará servicio a nada más que su industria -STR_CONFIG_SETTING_EXTRADYNAMITE :Permitir mayor eliminación de carreteras, puentes y túneles: {STRING} -STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Hacer más fácil eliminar infraestructura y edificios que sean propiedad de las localidades +STR_CONFIG_SETTING_EXTRADYNAMITE :Permitir eliminación más fácil de propiedades de localidades: {STRING} +STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Hacer más fácil la eliminación de la infraestructura y los edificios que sean propiedad de las localidades STR_CONFIG_SETTING_TRAIN_LENGTH :Longitud máxima de trenes: {STRING} STR_CONFIG_SETTING_TRAIN_LENGTH_HELPTEXT :Longitud máxima permitida para los trenes @@ -1287,8 +1287,8 @@ STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS_HELPTEXT :Grado de inclin STR_CONFIG_SETTING_FORBID_90_DEG :Prohibir a trenes realizar giros de 90°: {STRING} STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :Los giros de 90° ocurren en vías férreas perpendiculares donde el tren gira 90° al pasar de una casilla a otra, en lugar de los 45° habituales en otras combinaciones de vías. -STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS :Permitir la ampliación de estaciones no adyacentes: {STRING} -STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS_HELPTEXT :Permitir añadir de partes a una estación sin tener que estar en contacto directo con las partes existentes. Se debe pulsar Ctrl+Clic para añadir las nuevas partes +STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS :Permitir ampliación de estaciones no adyacentes: {STRING} +STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS_HELPTEXT :Se podrán añadir partes a una estación sin que tengan que estar una al lado de la otra. Ctrl+Clic para añadir las nuevas partes STR_CONFIG_SETTING_INFLATION :Inflación: {STRING} STR_CONFIG_SETTING_INFLATION_HELPTEXT :Activar inflación en la economía, lo que hace que los costos aumenten ligeramente más rápido que los ingresos @@ -1313,7 +1313,7 @@ STR_CONFIG_SETTING_INDUSTRY_PLATFORM :Área plana alr STR_CONFIG_SETTING_INDUSTRY_PLATFORM_HELPTEXT :Cantidad de espacio plano alrededor de las industrias. Esto asegura que haya espacio libre alrededor de las industrias para construir vías férreas, etc. STR_CONFIG_SETTING_MULTIPINDTOWN :Permitir varias industrias similares por localidad: {STRING} -STR_CONFIG_SETTING_MULTIPINDTOWN_HELPTEXT :En general, una localidad admite un solo tipo de industria a la vez, pero con esta opción varias industrias del mismo tipo en una localidad son posibles +STR_CONFIG_SETTING_MULTIPINDTOWN_HELPTEXT :En general, una localidad admite un solo tipo de industria a la vez, pero con esta opción varias industrias del mismo tipo en una localidad serán posibles STR_CONFIG_SETTING_SIGNALSIDE :Mostrar señales: {STRING} STR_CONFIG_SETTING_SIGNALSIDE_HELPTEXT :Elegir el lado de las vías donde se construirán las señales @@ -1323,7 +1323,7 @@ STR_CONFIG_SETTING_SIGNALSIDE_DRIVING_SIDE :En el lado de c STR_CONFIG_SETTING_SIGNALSIDE_RIGHT :A la derecha STR_CONFIG_SETTING_SHOWFINANCES :Mostrar ventana de finanzas al final del año: {STRING} -STR_CONFIG_SETTING_SHOWFINANCES_HELPTEXT :Si se activa, la ventana de finanzas aparecerá al final de cada año para permitir realizar una inspección más fácil del estado financiero de la empresa +STR_CONFIG_SETTING_SHOWFINANCES_HELPTEXT :Al activarse, la ventana de finanzas aparecerá al final de cada año para permitir la inspección más sencilla del estado financiero de la empresa STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT :Todo nuevo recorrido es 'Sin paradas' por defecto: {STRING} STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT_HELPTEXT :Cada vehículo hace parada en cada estación por la que pasa, pero al activar esta opción el vehículo seguirá de largo hasta llegar a su destino. Esta opción solo define el valor por defecto para nuevos recorridos, pero cada recorrido individual puede ajustarse independientemente @@ -1336,7 +1336,7 @@ STR_CONFIG_SETTING_STOP_LOCATION_MIDDLE :mitad STR_CONFIG_SETTING_STOP_LOCATION_FAR_END :final STR_CONFIG_SETTING_AUTOSCROLL :Recorrer vista cuando se mueva el cursor a los bordes: {STRING} -STR_CONFIG_SETTING_AUTOSCROLL_HELPTEXT :Al activarse, las vistas se desplazarán cuando el ratón se acarque a los bordes de la ventana +STR_CONFIG_SETTING_AUTOSCROLL_HELPTEXT :Al activarse, las vistas se desplazarán cuando el ratón se acerque a los bordes de la ventana ###length 4 STR_CONFIG_SETTING_AUTOSCROLL_DISABLED :Desactivado STR_CONFIG_SETTING_AUTOSCROLL_MAIN_VIEWPORT_FULLSCREEN :Vista principal, solo en pantalla completa @@ -1344,19 +1344,19 @@ STR_CONFIG_SETTING_AUTOSCROLL_MAIN_VIEWPORT :Vista principal STR_CONFIG_SETTING_AUTOSCROLL_EVERY_VIEWPORT :Todas las vistas STR_CONFIG_SETTING_BRIBE :Permitir sobornos al ayuntamiento: {STRING} -STR_CONFIG_SETTING_BRIBE_HELPTEXT :Las empresas intentan sobornar a los ayuntamientos. Si un inspector lo descubre, la empresa no podrá operar en la localidad seis meses +STR_CONFIG_SETTING_BRIBE_HELPTEXT :Las empresas podrán sobornar a los ayuntamientos, pero si un inspector lo descubre, la empresa no podrá operar en la localidad durante seis meses -STR_CONFIG_SETTING_ALLOW_EXCLUSIVE :Permitir adquirir los derechos de transporte exclusivos: {STRING} -STR_CONFIG_SETTING_ALLOW_EXCLUSIVE_HELPTEXT :Si una empresa compra los derechos de transporte exclusivos en una localidad, las estaciones de la competencia no recibirán carga nada todo un año +STR_CONFIG_SETTING_ALLOW_EXCLUSIVE :Permitir adquisición de derechos de transporte exclusivos: {STRING} +STR_CONFIG_SETTING_ALLOW_EXCLUSIVE_HELPTEXT :Si una empresa compra los derechos de transporte exclusivos en una localidad, las estaciones de la competencia no recibirán carga todo un año -STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS :Permitir la construcción de nuevos edificios: {STRING} +STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS :Permitir construcción de nuevos edificios: {STRING} STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS_HELPTEXT :Las empresas aportan dinero a los ayuntamientos para que construyan nuevas casas y edificios STR_CONFIG_SETTING_ALLOW_FUND_ROAD :Permitir el pago de la reconstrucción de las carreteras locales: {STRING} -STR_CONFIG_SETTING_ALLOW_FUND_ROAD_HELPTEXT :Las empresas aportan dinero a los ayuntamientos para que reconstruyan sus carreteras y así sabotear a otros servicios de transporte por carretera que operen en la zona +STR_CONFIG_SETTING_ALLOW_FUND_ROAD_HELPTEXT :Las empresas aportan dinero a los ayuntamientos para reconstruir sus carreteras, lo que perjudicando otros servicios de transporte en la zona -STR_CONFIG_SETTING_ALLOW_GIVE_MONEY :Permitir enviar dinero a otras empresas: {STRING} -STR_CONFIG_SETTING_ALLOW_GIVE_MONEY_HELPTEXT :Permitir la transferencia de dinero entre empresas en modo multijugador +STR_CONFIG_SETTING_ALLOW_GIVE_MONEY :Permitir envío de dinero a otras empresas: {STRING} +STR_CONFIG_SETTING_ALLOW_GIVE_MONEY_HELPTEXT :En modo multijugador, las empresas podrán transferirse dinero STR_CONFIG_SETTING_FREIGHT_TRAINS :Multiplicador de peso para simular trenes pesados: {STRING} STR_CONFIG_SETTING_FREIGHT_TRAINS_HELPTEXT :Impacto de llevar carga en los trenes. Un valor mayor exige mayor potencia a los trenes para llevar carga, sobre todo al subir colinas @@ -1366,16 +1366,16 @@ STR_CONFIG_SETTING_PLANE_SPEED_HELPTEXT :Establece la ve STR_CONFIG_SETTING_PLANE_SPEED_VALUE :1/{COMMA} STR_CONFIG_SETTING_PLANE_CRASHES :Cantidad de accidentes aéreos: {STRING} -STR_CONFIG_SETTING_PLANE_CRASHES_HELPTEXT :Probabilidad de que ocurran accidentes aéreos.{}* Las aeronaves grandes son más propensas a accidentes en areopuertos pequeños +STR_CONFIG_SETTING_PLANE_CRASHES_HELPTEXT :Probabilidad de que ocurran accidentes aéreos.{}* Las aeronaves grandes son más propensas a accidentes en aeropuertos pequeños ###length 3 STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Ninguno* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reducida STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal -STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permitir la construcción de paradas de paso en localidades: {STRING} -STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Permitir la construcción de paradas de paso en carreteras que sean propiedad de las localidades -STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Permitir la construcción de paradas paradas de paso en carreteras de la competencia: {STRING} -STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT :Construir paradas de autobuses de paso en carreteras que sean propiedad de otras empresas +STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Permitir construcción de paradas de paso en localidades: {STRING} +STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Se podrán construir paradas de paso en las carreteras que sean propiedad de las localidades +STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Permitir construcción de paradas de paso en carreteras de la competencia: {STRING} +STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT :Se podrán construir paradas de paso en las carreteras que sean propiedad de otras empresas STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}No se puede cambiar esta opción si ya existen vehículos STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Mantenimiento de infraestructura: {STRING} @@ -1403,7 +1403,7 @@ STR_CONFIG_SETTING_WARN_INCOME_LESS_HELPTEXT :Mostrar un mens STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES :Vehículos siempre disponibles: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES_HELPTEXT :Todos los modelos de vehículos estarán disponibles para siempre tras haber sido introducidos -STR_CONFIG_SETTING_AUTORENEW_VEHICLE :Renovar automáticamente vehículos anicuados: {STRING} +STR_CONFIG_SETTING_AUTORENEW_VEHICLE :Renovar automáticamente vehículos viejos: {STRING} STR_CONFIG_SETTING_AUTORENEW_VEHICLE_HELPTEXT :Los vehículos próximos al final de su vida útil serán renovados automáticamente, siempre y cuando se cumplan las condiciones de renovación STR_CONFIG_SETTING_AUTORENEW_MONTHS :Renovar automáticamente el vehículo cumpla {STRING} @@ -1546,8 +1546,8 @@ STR_CONFIG_SETTING_LIVERIES_NONE :Ninguno STR_CONFIG_SETTING_LIVERIES_OWN :Mi empresa STR_CONFIG_SETTING_LIVERIES_ALL :Todas las empresas -STR_CONFIG_SETTING_PREFER_TEAMCHAT :Activar chat de equipo con : {STRING} -STR_CONFIG_SETTING_PREFER_TEAMCHAT_HELPTEXT :Cambiar el acceso al chat interno de la empresa y al chat público entre y +STR_CONFIG_SETTING_PREFER_TEAMCHAT :Activar chat de equipo con la tecla Intro: {STRING} +STR_CONFIG_SETTING_PREFER_TEAMCHAT_HELPTEXT :Cambiar el acceso al chat interno de la empresa y al chat público entre Intro y Ctrl+Intro STR_CONFIG_SETTING_SCROLLWHEEL_MULTIPLIER :Velocidad de la rueda del ratón sobre el mapa: {STRING} STR_CONFIG_SETTING_SCROLLWHEEL_MULTIPLIER_HELPTEXT :Controlar la sensibilidad de la rueda del ratón @@ -1595,7 +1595,7 @@ STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES_SHORT :corto (31-12-20 STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES_ISO :ISO (2008-12-31) STR_CONFIG_SETTING_PAUSE_ON_NEW_GAME :Pausar la partida automáticamente al comenzar: {STRING} -STR_CONFIG_SETTING_PAUSE_ON_NEW_GAME_HELPTEXT :Al activarse, el juego se detendrá automáticamente al comenzar nuevas partidas para permitir revisar el mapa +STR_CONFIG_SETTING_PAUSE_ON_NEW_GAME_HELPTEXT :Al activarse, en cada inicio de partida el juego se detendrá automáticamente, para permitir la inspección del mapa STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL :Al pausar, permitir: {STRING} STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL_HELPTEXT :Acciones se pueden realizar mientras el juego está en pausa. @@ -1684,7 +1684,7 @@ STR_CONFIG_SETTING_AI_BUILDS_TRAINS_HELPTEXT :Activar esta op STR_CONFIG_SETTING_AI_BUILDS_ROAD_VEHICLES :Desactivar autotransportes para la computadora: {STRING} STR_CONFIG_SETTING_AI_BUILDS_ROAD_VEHICLES_HELPTEXT :Activar esta opción deshabilita la construcción de autotransportes por jugadores no humanos -STR_CONFIG_SETTING_AI_BUILDS_AIRCRAFT :Desactivar aeroplanos para la computadora: {STRING} +STR_CONFIG_SETTING_AI_BUILDS_AIRCRAFT :Desactivar aeronaves para la computadora: {STRING} STR_CONFIG_SETTING_AI_BUILDS_AIRCRAFT_HELPTEXT :Activar esta opción deshabilita la construcción de aeronaves por jugadores no humanos STR_CONFIG_SETTING_AI_BUILDS_SHIPS :Desactivar barcos para la computadora: {STRING} @@ -1698,7 +1698,7 @@ STR_CONFIG_SETTING_AI_PROFILE_MEDIUM :Intermedio STR_CONFIG_SETTING_AI_PROFILE_HARD :Difícil STR_CONFIG_SETTING_AI_IN_MULTIPLAYER :Permitir jugadores no humanos en modo multijugador: {STRING} -STR_CONFIG_SETTING_AI_IN_MULTIPLAYER_HELPTEXT :Permitir a los jugadores controlados por la computadora participar en partidas de varios jugadores +STR_CONFIG_SETTING_AI_IN_MULTIPLAYER_HELPTEXT :Los jugadores controlados por la computadora podrán participar en partidas de varios jugadores STR_CONFIG_SETTING_SCRIPT_MAX_OPCODES :#opcodes disponibles antes de que los scripts sean suspendidos: {STRING} STR_CONFIG_SETTING_SCRIPT_MAX_OPCODES_HELPTEXT :Número máximo de operaciones que un script puede realizar por turno @@ -1707,7 +1707,7 @@ STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_HELPTEXT :Cantidad de mem STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_VALUE :{COMMA} MiB STR_CONFIG_SETTING_SERVINT_ISPERCENT :Intervalo de mantenimiento en porcentajes: {STRING} -STR_CONFIG_SETTING_SERVINT_ISPERCENT_HELPTEXT :Escoger si el mantenimiento de vehículos comenzará debido al tiempo pasado desde el último mantenimiento o por una reducción de la fiabilidad menor de un porcentaje determinado +STR_CONFIG_SETTING_SERVINT_ISPERCENT_HELPTEXT :Elegir si el mantenimiento de vehículos se da por días o por fiabilidad menor a un porcentaje específico STR_CONFIG_SETTING_SERVINT_TRAINS :Intervalo de mantenimiento por defecto para trenes: {STRING} STR_CONFIG_SETTING_SERVINT_TRAINS_HELPTEXT :Intervalo de mantenimiento por defecto para nuevos trenes, en caso de no definirse otro explícitamente @@ -1717,7 +1717,7 @@ STR_CONFIG_SETTING_SERVINT_AIRCRAFT :Intervalo de ma STR_CONFIG_SETTING_SERVINT_AIRCRAFT_HELPTEXT :Intervalo de mantenimiento por defecto para nuevas aeronaves, en caso de no definirse otro explícitamente STR_CONFIG_SETTING_SERVINT_SHIPS :Intervalo de mantenimiento por defecto para barcos: {STRING} STR_CONFIG_SETTING_SERVINT_SHIPS_HELPTEXT :Intervalo de mantenimiento por defecto para nuevos barcos, en caso de no definirse otro explícitamente -STR_CONFIG_SETTING_SERVINT_VALUE :{COMMA}{NBSP}día{P 0 "" s}/% +STR_CONFIG_SETTING_SERVINT_VALUE :{COMMA}{NBSP}día{P 0 "" s} o % ###setting-zero-is-special STR_CONFIG_SETTING_SERVINT_DISABLED :Deshabilitado @@ -1783,11 +1783,11 @@ STR_CONFIG_SETTING_NEWS_MESSAGES_SUMMARY :Resumen STR_CONFIG_SETTING_NEWS_MESSAGES_FULL :Completo STR_CONFIG_SETTING_COLOURED_NEWS_YEAR :Noticias a color aparecen en el año: {STRING} -STR_CONFIG_SETTING_COLOURED_NEWS_YEAR_HELPTEXT :Año en el que los periódicos comenzarán a imprimirse a color. Antes de ese año, apacerán en blanco y negro +STR_CONFIG_SETTING_COLOURED_NEWS_YEAR_HELPTEXT :Año en el que los periódicos se imprimirán a color. Antes de ese año, saldrán en blanco y negro STR_CONFIG_SETTING_STARTING_YEAR :Fecha de inicio: {STRING} STR_CONFIG_SETTING_ENDING_YEAR :Año de fin de juego: {STRING} -STR_CONFIG_SETTING_ENDING_YEAR_HELPTEXT :Año en el que se termina el juego para registrar la puntuación de la empresa y mostrar la tabla de puntuaciones, aunque el jugador puede continuar el juego.{}Cualquier fecha anterior al año de incio hará que la tabla de puntuaciones nunca se muestre. +STR_CONFIG_SETTING_ENDING_YEAR_HELPTEXT :Año en el que se termina el juego para registrar la puntuación de la empresa y mostrar la tabla de puntuaciones, aunque el jugador puede continuar el juego.{}Cualquier fecha anterior al año de inicio hará que la tabla de puntuaciones nunca se muestre. STR_CONFIG_SETTING_ENDING_YEAR_VALUE :{NUM} ###setting-zero-is-special STR_CONFIG_SETTING_ENDING_YEAR_ZERO :Nunca @@ -1799,11 +1799,11 @@ STR_CONFIG_SETTING_ECONOMY_TYPE_ORIGINAL :Original STR_CONFIG_SETTING_ECONOMY_TYPE_SMOOTH :Estable STR_CONFIG_SETTING_ECONOMY_TYPE_FROZEN :Rígida -STR_CONFIG_SETTING_ALLOW_SHARES :Permitir comprar acciones de otras empresas: {STRING} -STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT :Al activarse, se pueden comprar y vender acciones de otras empresas. Las acciones de una empresa solamente estarán disponibles cuando la empresa cumpla una edad determinada +STR_CONFIG_SETTING_ALLOW_SHARES :Permitir compra de acciones de otras empresas: {STRING} +STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT :Al activarse, se pueden comprar y vender las acciones de otras empresas, aunque solo estarán disponibles a partir de una edad determinada de las empresas STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES :Edad mínima de la empresa para intercambiar acciones: {STRING} -STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES_HELPTEXT :Estabelcer la edad mínima que debe tener una empresa para que otros puedan comprarle y venderle acciones. +STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES_HELPTEXT :Establecer la edad mínima que debe tener una empresa para que otros puedan comprarle y venderle acciones. STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE :Porcentaje de la utilidad total a pagar por transferencias de carga: {STRING} STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE_HELPTEXT :Porcentaje de utilidad cedida a los transportes intermedios en sistemas de transferencia de carga, dando un mayor control sobre la utilidad de cada vehículo @@ -1815,7 +1815,7 @@ STR_CONFIG_SETTING_DRAG_SIGNALS_FIXED_DISTANCE :Al arrastrar, m STR_CONFIG_SETTING_DRAG_SIGNALS_FIXED_DISTANCE_HELPTEXT :Forma en que se colocan las señales con Ctrl+Arrastrar. Al desactivarse, se colocan señales cerca de túneles y puentes para evitar tramos largos sin señales. Al activarse, se colocan señales cada tanto de casillas, con lo que alinear señales en vías paralelas es más fácil STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Señales mecánicas por defecto antes de: {STRING} -STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Año a partir del cual se usarán señales eléctricas. Antes de ese año se usarán señales mecánicas, las cuales funcionan igual pero tienen distinto aspecto +STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Año a partir del cual se usarán señales eléctricas. Antes de ese año se usarán señales mecánicas, las cuales funcionan igual, pero tienen distinto aspecto STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Cambiar entre tipos de señales: {STRING} STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Elegir la alternación entre señales al usar Ctrl+Clic con la herramienta de señales @@ -1841,10 +1841,10 @@ STR_CONFIG_SETTING_TOWN_LAYOUT_RANDOM :Aleatorio STR_CONFIG_SETTING_ALLOW_TOWN_ROADS :Permitir a las localidades construir carreteras: {STRING} STR_CONFIG_SETTING_ALLOW_TOWN_ROADS_HELPTEXT :Los ayuntamientos construyen carreteras para que las localidades se expandan. Desactivar para impedirlo STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS :Permitir a las localidades construir pasos a nivel: {STRING} -STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS_HELPTEXT :Activar esta opción permite a las localidades construir pasos a nivel +STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS_HELPTEXT :Permite a las localidades construir pasos a nivel -STR_CONFIG_SETTING_NOISE_LEVEL :Permitir el ruido de aeropuertos controlado por localidades: {STRING} -STR_CONFIG_SETTING_NOISE_LEVEL_HELPTEXT :Al desactivarse, puede haber hasta dos aeropuertos por localidad. Al activarse, el número de aeropuertos por localidad depende de su nivel de ruido permitido, el cual depende de la población, el tamaño de cada aeropuerto y la distancia +STR_CONFIG_SETTING_NOISE_LEVEL :Permitir que localidades controlen ruido de aeropuertos: {STRING} +STR_CONFIG_SETTING_NOISE_LEVEL_HELPTEXT :Al desactivarse, solo podrá haber dos aeropuertos por localidad. Al activarse, el número de aeropuertos por localidad se limitará por su nivel de ruido permitido, el cual dependerá de la población, el tamaño del aeropuerto y la distancia STR_CONFIG_SETTING_TOWN_FOUNDING :Fundar localidades: {STRING} STR_CONFIG_SETTING_TOWN_FOUNDING_HELPTEXT :Activar esta opción permite a los jugadores funda nuevas localidades durante la partida @@ -1862,8 +1862,8 @@ STR_CONFIG_SETTING_TOWN_CARGOGENMODE_BITCOUNT :Lineal STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT :Crecimiento de árboles durante la partida: {STRING} STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_HELPTEXT :Controlar la aparición aleatoria de árboles durante la partida. Esto puede afectar industrias que dependen del crecimiento de árboles, como los aserraderos ###length 4 -STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_NO_SPREAD :Crecer pero no expandir {RED}(rompe el aserradero) -STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_RAINFOREST :Crecer pero solo expandir en bosques +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_NO_SPREAD :Crecer, pero no expandir {RED}(rompe el aserradero) +STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_RAINFOREST :Crecer, pero solo expandir en bosques STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_SPREAD_ALL :Crecer y expandir por todos lados STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_NO_GROWTH_NO_SPREAD :No crecer ni expandir {RED}(rompe el aserradero) @@ -1958,7 +1958,7 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_GAMEUNITS :Unidades del ju STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER :Unidades de potencia de vehículos: {STRING} STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_HELPTEXT :Cada vez que se muestre la potencia de un vehículo en la interfaz de usuario, se emplearán las unidades elegidas ###length 3 -STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_IMPERIAL :Imperial (cv) +STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_IMPERIAL :Imperial (hp) STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_METRIC :Métrico (cv) STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_SI :SI (kW) @@ -1990,7 +1990,7 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_IMPERIAL :Imperial (pies) STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_METRIC :Métrico (m) STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_SI :SI (m) -STR_CONFIG_SETTING_LOCALISATION :{ORANGE}Localización +STR_CONFIG_SETTING_LOCALISATION :{ORANGE}Adaptación local STR_CONFIG_SETTING_GRAPHICS :{ORANGE}Gráficos STR_CONFIG_SETTING_SOUND :{ORANGE}Sonido STR_CONFIG_SETTING_INTERFACE :{ORANGE}Interfaz @@ -2003,7 +2003,7 @@ STR_CONFIG_SETTING_ACCOUNTING :{ORANGE}Contabi STR_CONFIG_SETTING_VEHICLES :{ORANGE}Vehículos STR_CONFIG_SETTING_VEHICLES_PHYSICS :{ORANGE}Leyes físicas STR_CONFIG_SETTING_VEHICLES_ROUTING :{ORANGE}Enrutamiento -STR_CONFIG_SETTING_LIMITATIONS :{ORANGE}Limitaciones +STR_CONFIG_SETTING_LIMITATIONS :{ORANGE}Restricciones STR_CONFIG_SETTING_ACCIDENTS :{ORANGE}Desastres y accidentes STR_CONFIG_SETTING_GENWORLD :{ORANGE}Generación de mapa STR_CONFIG_SETTING_ENVIRONMENT :{ORANGE}Entorno @@ -2094,7 +2094,7 @@ STR_INTRO_TOOLTIP_GAMESCRIPT_SETTINGS :{BLACK}Mostrar STR_INTRO_TOOLTIP_QUIT :{BLACK}Salir de 'OpenTTD' STR_INTRO_BASESET :{BLACK}A los gráficos base elegidos les hace falta {NUM} spirte{P "" s}. Necesitan actualizarse. -STR_INTRO_TRANSLATION :{BLACK}Este idioma tiene {NUM} cadena{P "" s} de texto sin traducir todavía. Ayudar a mejorar OpenTTD siriviendo como traductor. Consulta el archivo readme.txt para más detalles. +STR_INTRO_TRANSLATION :{BLACK}Este idioma tiene {NUM} cadena{P "" s} de texto sin traducir todavía. Ayudar a mejorar OpenTTD registrándote como traductor. Consulta el archivo readme.txt para más detalles. # Quit window STR_QUIT_CAPTION :{WHITE}Salir @@ -2120,7 +2120,7 @@ STR_CHEAT_EDIT_MAX_HL :{LTBLUE}Cambiar STR_CHEAT_EDIT_MAX_HL_QUERY_CAPT :{WHITE}Cambiar la elevación máxima de las montañas en el mapa STR_CHEAT_CHANGE_DATE :{LTBLUE}Cambiar fecha: {ORANGE} {DATE_SHORT} STR_CHEAT_CHANGE_DATE_QUERY_CAPT :{WHITE}Cambiar año actual -STR_CHEAT_SETUP_PROD :{LTBLUE}Permitir cambiar los valores de producción: {ORANGE}{STRING} +STR_CHEAT_SETUP_PROD :{LTBLUE}Permitir cambio de valores de producción: {ORANGE}{STRING} # Livery window STR_LIVERY_CAPTION :{WHITE}{COMPANY} - Cromática @@ -2369,7 +2369,7 @@ STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN :Bloquear acceso STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET :Eliminar STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK :Restablecer contraseña -STR_NETWORK_CLIENT_LIST_ASK_CAPTION :{WHITE}Acción de aministrador +STR_NETWORK_CLIENT_LIST_ASK_CAPTION :{WHITE}Acción de administrador STR_NETWORK_CLIENT_LIST_ASK_CLIENT_KICK :{YELLOW}¿Sacar al jugador "{STRING}"? STR_NETWORK_CLIENT_LIST_ASK_CLIENT_BAN :{YELLOW}¿Bloquear acceso al jugador "{STRING}"? STR_NETWORK_CLIENT_LIST_ASK_COMPANY_RESET :{YELLOW}¿Eliminar la empresa "{COMPANY}"? @@ -2568,7 +2568,7 @@ STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD_FILE_NOT_WRITABLE :{WHITE}... no s STR_CONTENT_ERROR_COULD_NOT_EXTRACT :{WHITE}No ha sido posible descomprimir el archivo descargado STR_MISSING_GRAPHICS_SET_CAPTION :{WHITE}Gráficos no encontrados -STR_MISSING_GRAPHICS_SET_MESSAGE :{BLACK}OpenTTD requiere gráficos para funcionar pero no se pudo encontrar ninguno. ¿Permitir que OpenTTD descargue e instale dichos gráficos? +STR_MISSING_GRAPHICS_SET_MESSAGE :{BLACK}OpenTTD requiere gráficos para funcionar pero no se encontró ninguno. ¿Permitir que se descarguen e instalen automáticamente? STR_MISSING_GRAPHICS_YES_DOWNLOAD :{BLACK}Sí, descargar los gráficos STR_MISSING_GRAPHICS_NO_QUIT :{BLACK}No, salir de OpenTTD @@ -2716,7 +2716,7 @@ STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_SECTION :{BLACK}Construi STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_SECTION :{BLACK}Construir sección de tranvía. Ctrl quita los carriles de tranvía. Mayús muestra un costo estimado STR_ROAD_TOOLBAR_TOOLTIP_BUILD_AUTOROAD :{BLACK}Construir carretera con orientación automática. Ctrl quita carreteras. Mayús muestra un costo estimado STR_ROAD_TOOLBAR_TOOLTIP_BUILD_AUTOTRAM :{BLACK}Construir tranvías con orientación automática. Ctrl quita los carriles de tranvía. Mayús muestra un costo estimado -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_VEHICLE_DEPOT :{BLACK}Construir depósito de carretera (para comprar y dar mantenimiento a vehículos). Mayús muestra un costo estimado +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_VEHICLE_DEPOT :{BLACK}Construir depósito de autotransportes (para comprar y dar mantenimiento a vehículos). Mayús muestra un costo estimado STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAM_VEHICLE_DEPOT :{BLACK}Construir depósito de tranvías (para comprar y dar mantenimiento a tranvías). Mayús muestra un costo estimado STR_ROAD_TOOLBAR_TOOLTIP_BUILD_BUS_STATION :{BLACK}Construir parada de autobús. Ctrl activa la ampliación de estaciones. Mayús muestra un costo estimado STR_ROAD_TOOLBAR_TOOLTIP_BUILD_PASSENGER_TRAM_STATION :{BLACK}Construir estación de tranvía de pasajeros. Ctrl activa la ampliación de estaciones. Mayús muestra un costo estimado @@ -2909,7 +2909,7 @@ STR_INDUSTRY_CARGOES_SELECT_INDUSTRY_TOOLTIP :{BLACK}Elegir l # Land area window STR_LAND_AREA_INFORMATION_CAPTION :{WHITE}Información sobre área de terreno -STR_LAND_AREA_INFORMATION_LOCATION_TOOLTIP :{BLACK}Centrar la vista en la casilla.Ctrl+Clic abre una vista aparte +STR_LAND_AREA_INFORMATION_LOCATION_TOOLTIP :{BLACK}Centrar la vista en la casilla. Ctrl+Clic abre una vista aparte STR_LAND_AREA_INFORMATION_COST_TO_CLEAR_N_A :{BLACK}Costo por despejar: {LTBLUE}N/D STR_LAND_AREA_INFORMATION_COST_TO_CLEAR :{BLACK}Costo por despejar: {RED}{CURRENCY_LONG} STR_LAND_AREA_INFORMATION_REVENUE_WHEN_CLEARED :{BLACK}Ingreso por despejar: {LTBLUE}{CURRENCY_LONG} @@ -3082,7 +3082,7 @@ STR_FRAMETIME_CAPTION_GL_ROADVEHS :Ticks de autotr STR_FRAMETIME_CAPTION_GL_SHIPS :Ticks de barcos STR_FRAMETIME_CAPTION_GL_AIRCRAFT :Ticks de areonaves STR_FRAMETIME_CAPTION_GL_LANDSCAPE :Ticks de mapa -STR_FRAMETIME_CAPTION_GL_LINKGRAPH :Retraro en gráfica de distribución +STR_FRAMETIME_CAPTION_GL_LINKGRAPH :Retraso en gráfica de distribución STR_FRAMETIME_CAPTION_DRAWING :Presentación de gráficos STR_FRAMETIME_CAPTION_DRAWING_VIEWPORTS :Presentación de ventanas de vista generales STR_FRAMETIME_CAPTION_VIDEO :Salida de video @@ -3355,7 +3355,7 @@ STR_NEWGRF_ERROR_UNKNOWN_PROPERTY :Propiedad de Ac STR_NEWGRF_ERROR_INVALID_ID :Intento de usar una ID no válida (sprite {3:NUM}) STR_NEWGRF_ERROR_CORRUPT_SPRITE :{YELLOW}{STRING} contiene un sprite con errores. Todos los sprites con errores se muestran como un símbolo de interrogación rojo (?) STR_NEWGRF_ERROR_MULTIPLE_ACTION_8 :Contiene múltiples entradas de Acción 8 (sprite {3:NUM}) -STR_NEWGRF_ERROR_READ_BOUNDS :La lectura excedió el límite de pseudo-sprite (sprite {3:NUM}) +STR_NEWGRF_ERROR_READ_BOUNDS :La lectura excedió el límite de un pseudosprite (sprite {3:NUM}) STR_NEWGRF_ERROR_GRM_FAILED :Recursos GRF solicitados no disponibles (sprite {3:NUM}) STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} fue desactivado por {STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Formato de colocación de sprites no válido o desconocido (sprite {3:NUM}) @@ -3546,11 +3546,11 @@ STR_STORY_BOOK_SPECTATOR_CAPTION :{WHITE}Historia STR_STORY_BOOK_SPECTATOR :Historial global STR_STORY_BOOK_TITLE :{YELLOW}{STRING} STR_STORY_BOOK_GENERIC_PAGE_ITEM :Página {NUM} -STR_STORY_BOOK_SEL_PAGE_TOOLTIP :{BLACK}Permitir ir a una página específica al elegirla en esta lista desplegable +STR_STORY_BOOK_SEL_PAGE_TOOLTIP :{BLACK}Pasar a una página específica al elegirla de esta lista STR_STORY_BOOK_PREV_PAGE :{BLACK}Anterior STR_STORY_BOOK_PREV_PAGE_TOOLTIP :{BLACK}Ir a la página anterior STR_STORY_BOOK_NEXT_PAGE :{BLACK}Siguiente -STR_STORY_BOOK_NEXT_PAGE_TOOLTIP :{BLACK}Ir a la siguiente página +STR_STORY_BOOK_NEXT_PAGE_TOOLTIP :{BLACK}Ir a la página siguiente STR_STORY_BOOK_INVALID_GOAL_REF :{RED}Referencia a objetivos no válida # Station list window @@ -3625,7 +3625,7 @@ STR_STATION_VIEW_SCHEDULED_SHIPS_TOOLTIP :{BLACK}Mostrar STR_STATION_VIEW_RENAME_STATION_CAPTION :Cambiar nombre de estación STR_STATION_VIEW_CLOSE_AIRPORT :{BLACK}Cerrar aeropuerto -STR_STATION_VIEW_CLOSE_AIRPORT_TOOLTIP :{BLACK}No permitir que aterricen aviones en este aeropuerto +STR_STATION_VIEW_CLOSE_AIRPORT_TOOLTIP :{BLACK}Evita el aterrizaje de aeronaves en este aeropuerto # Waypoint/buoy view window STR_WAYPOINT_VIEW_CAPTION :{WHITE}{WAYPOINT} @@ -3687,7 +3687,7 @@ STR_COMPANY_VIEW_INAUGURATED_TITLE :{GOLD}Inaugurac STR_COMPANY_VIEW_COLOUR_SCHEME_TITLE :{GOLD}Cromática: STR_COMPANY_VIEW_VEHICLES_TITLE :{GOLD}Vehículos: STR_COMPANY_VIEW_TRAINS :{WHITE}{COMMA} tren{P "" es} -STR_COMPANY_VIEW_ROAD_VEHICLES :{WHITE}{COMMA} vehículo{P "" s} de carretera +STR_COMPANY_VIEW_ROAD_VEHICLES :{WHITE}{COMMA} autotransporte{P "" s} STR_COMPANY_VIEW_AIRCRAFT :{WHITE}{COMMA} aeronave{P "" s} STR_COMPANY_VIEW_SHIPS :{WHITE}{COMMA} barco{P "" s} STR_COMPANY_VIEW_VEHICLES_NONE :{WHITE}Ninguno @@ -3756,7 +3756,7 @@ STR_INDUSTRY_DIRECTORY_ITEM_PROD3 :{ORANGE}{INDUST STR_INDUSTRY_DIRECTORY_ITEM_PRODMORE :{ORANGE}{INDUSTRY} {STRING}, {STRING}, {STRING} y {NUM} más... STR_INDUSTRY_DIRECTORY_LIST_CAPTION :{BLACK}Nombres de industrias. Clic para centrar la vista en la industria. Ctrl+Clic abre una vista aparte STR_INDUSTRY_DIRECTORY_ACCEPTED_CARGO_FILTER :{BLACK}Carga aceptada: {SILVER}{STRING} -STR_INDUSTRY_DIRECTORY_PRODUCED_CARGO_FILTER :{BLACK}Cargemento producido: {SILVER}{STRING} +STR_INDUSTRY_DIRECTORY_PRODUCED_CARGO_FILTER :{BLACK}Carga producida: {SILVER}{STRING} STR_INDUSTRY_DIRECTORY_FILTER_ALL_TYPES :Todos los tipos STR_INDUSTRY_DIRECTORY_FILTER_NONE :Ninguno @@ -3782,7 +3782,7 @@ STR_CONFIG_GAME_PRODUCTION_LEVEL :{WHITE}Cambiar # Vehicle lists ###length VEHICLE_TYPES STR_VEHICLE_LIST_TRAIN_CAPTION :{WHITE}{STRING}: {COMMA} tren{P "" es} -STR_VEHICLE_LIST_ROAD_VEHICLE_CAPTION :{WHITE}{STRING}: {COMMA} vehículo{P "" s} de carretera +STR_VEHICLE_LIST_ROAD_VEHICLE_CAPTION :{WHITE}{STRING}: {COMMA} autotransporte{P "" s} STR_VEHICLE_LIST_SHIP_CAPTION :{WHITE}{STRING}: {COMMA} barco{P "" s} STR_VEHICLE_LIST_AIRCRAFT_CAPTION :{WHITE}{STRING}: {COMMA} aeronave{P "" s} @@ -3903,7 +3903,7 @@ STR_CARGO_TYPE_FILTER_NONE :Ninguno STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Lista de selección trenes. Clic en un tren para más información. Ctrl+Clic para mostrar u ocultar el tipo de tren STR_BUY_VEHICLE_ROAD_VEHICLE_LIST_TOOLTIP :{BLACK}Lista de selección de autotransportes. Clic en un vehículo para más información. Ctrl+Clic para mostrar u ocultar el tipo del vehículo STR_BUY_VEHICLE_SHIP_LIST_TOOLTIP :{BLACK}Lista de selección de barcos. Clic en un barco para más información. Ctrl+Clic para mostrar u ocultar el tipo de barco -STR_BUY_VEHICLE_AIRCRAFT_LIST_TOOLTIP :{BLACK}Lista de selección de aeronaves. Clic en un aeronave para más información. Ctrl+Clic para mostrar u ocultar el tipo de aeronave +STR_BUY_VEHICLE_AIRCRAFT_LIST_TOOLTIP :{BLACK}Lista de selección de aeronaves. Clic en una aeronave para más información. Ctrl+Clic para mostrar u ocultar el tipo de aeronave ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_BUTTON :{BLACK}Comprar @@ -3927,7 +3927,7 @@ STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Comprar STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Comprar y reformar el tren elegido. Mayús+Clic muestra un precio estimado de compra STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Comprar y reformar el autotransporte elegido. Mayús+Clic muestra un precio estimado de compra STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Comprar y reformar el barco elegido. Mayús+Clic muestra un precio estimado de compra -STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Comprar y reformar la areonave seleccionada. Mayús+Clic muestra un costo estimado de compra +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Comprar y reformar la aeronave seleccionada. Mayús+Clic muestra un costo estimado de compra ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Cambiar nombre @@ -3974,7 +3974,7 @@ STR_DEPOT_RENAME_DEPOT_CAPTION :Cambiar nombre STR_DEPOT_NO_ENGINE :{BLACK}- STR_DEPOT_VEHICLE_TOOLTIP :{BLACK}{ENGINE}{STRING} STR_DEPOT_VEHICLE_TOOLTIP_CHAIN :{BLACK}{NUM} vehículo{P "" s}{STRING} -STR_DEPOT_VEHICLE_TOOLTIP_CARGO :{}{CARGO_LONG} ({CARGO_SHORT}) +STR_DEPOT_VEHICLE_TOOLTIP_CARGO :{}{CARGO_LONG} (capacidad: {CARGO_SHORT}) ###length VEHICLE_TYPES STR_DEPOT_TRAIN_LIST_TOOLTIP :{BLACK}Trenes: arrastrar vehículos de ferrocarril con Clic izquierdo para añadirlos o quitarlos del tren. Clic derecho para más información. Mantener pulsado Ctrl para usar estos comandos con el resto del tren @@ -4108,8 +4108,8 @@ STR_REPLACE_ALL_RAILTYPE :Todos los vehí STR_REPLACE_ALL_ROADTYPE :Todos los autotransportes ###length 2 -STR_REPLACE_HELP_RAILTYPE :{BLACK}Elegir el tipo de vías férreas para las que se desea reemplazar locomotoras -STR_REPLACE_HELP_ROADTYPE :{BLACK}Elegir el tipo de carretera para el que se desea reemplazar locomotoras +STR_REPLACE_HELP_RAILTYPE :{BLACK}Elegir el tipo de vías férreas según el vehículo ferroviario a reemplazar +STR_REPLACE_HELP_ROADTYPE :{BLACK}Elegir el tipo de carretera según el autotransporte a reemplazar ###next-name-looks-similar STR_REPLACE_HELP_REPLACE_INFO_TAB :{BLACK}Mostrar el vehículo que reemplazará al otro de la izquierda @@ -4121,7 +4121,7 @@ STR_REPLACE_MAGLEV_VEHICLES :Trenes maglev STR_REPLACE_ROAD_VEHICLES :Autotransportes STR_REPLACE_TRAM_VEHICLES :Vehículos de tranvía -STR_REPLACE_REMOVE_WAGON :{BLACK}Quitar vagó ({STRING}): {ORANGE}{STRING} +STR_REPLACE_REMOVE_WAGON :{BLACK}Quitar vagones ({STRING}): {ORANGE}{STRING} STR_REPLACE_REMOVE_WAGON_HELP :{BLACK}Hacer que el reemplazo automático mantenga la longitud del tren quitando vagones (empezando por el frente), si el cambio de locomotora produce un tren más largo STR_REPLACE_REMOVE_WAGON_GROUP_HELP :{STRING}. Ctrl+Clic para incluir subgrupos @@ -4361,7 +4361,7 @@ STR_ORDER_CONDITIONAL_AGE :Edad (años) STR_ORDER_CONDITIONAL_REQUIRES_SERVICE :Requiere mantenimiento STR_ORDER_CONDITIONAL_UNCONDITIONALLY :Siempre STR_ORDER_CONDITIONAL_REMAINING_LIFETIME :Vida útil restante (años) -STR_ORDER_CONDITIONAL_MAX_RELIABILITY :Fabilidad máxima +STR_ORDER_CONDITIONAL_MAX_RELIABILITY :Fiabilidad máxima ###next-name-looks-similar STR_ORDER_CONDITIONAL_COMPARATOR_TOOLTIP :{BLACK}Comparación de los datos del vehículo respecto al valor dado @@ -4929,7 +4929,7 @@ STR_ERROR_CAN_T_PLANT_TREE_HERE :{WHITE}No se pu STR_ERROR_CAN_T_BUILD_BRIDGE_HERE :{WHITE}No se puede construir puente aquí... STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST :{WHITE}Primero se debe demoler el puente STR_ERROR_CAN_T_START_AND_END_ON :{WHITE}No se puede comenzar y acabar en la misma posición -STR_ERROR_BRIDGEHEADS_NOT_SAME_HEIGHT :{WHITE}Las estribos del puente no están al mismo nivel +STR_ERROR_BRIDGEHEADS_NOT_SAME_HEIGHT :{WHITE}Los estribos del puente no están al mismo nivel STR_ERROR_BRIDGE_TOO_LOW_FOR_TERRAIN :{WHITE}El puente es demasiado bajo para este terreno STR_ERROR_BRIDGE_TOO_HIGH_FOR_TERRAIN :{WHITE}El puente es demasiado alto para este terreno STR_ERROR_START_AND_END_MUST_BE_IN :{WHITE}Principio y final deben estar alineados @@ -5001,7 +5001,7 @@ STR_ERROR_CAN_T_STOP_START_AIRCRAFT :{WHITE}No se pu STR_ERROR_CAN_T_SEND_TRAIN_TO_DEPOT :{WHITE}No se puede enviar el tren al depósito... STR_ERROR_CAN_T_SEND_ROAD_VEHICLE_TO_DEPOT :{WHITE}No se puede enviar el vehículo al depósito... STR_ERROR_CAN_T_SEND_SHIP_TO_DEPOT :{WHITE}No se puede enviar el barco a astillero... -STR_ERROR_CAN_T_SEND_AIRCRAFT_TO_HANGAR :{WHITE}No se puede enviar el aeronave al hangar +STR_ERROR_CAN_T_SEND_AIRCRAFT_TO_HANGAR :{WHITE}No se puede enviar la aeronave al hangar ###length VEHICLE_TYPES STR_ERROR_CAN_T_BUY_TRAIN :{WHITE}No se puede comprar tren... @@ -5105,7 +5105,7 @@ STR_TOWN_BUILDING_NAME_MODERN_OFFICE_BUILDING_1 :Edificio de ofi STR_TOWN_BUILDING_NAME_WAREHOUSE_1 :Almacén STR_TOWN_BUILDING_NAME_OFFICE_BLOCK_3 :Edificio de oficinas STR_TOWN_BUILDING_NAME_STADIUM_1 :Estadio -STR_TOWN_BUILDING_NAME_OLD_HOUSES_1 :Casas antiguass +STR_TOWN_BUILDING_NAME_OLD_HOUSES_1 :Casas antiguas STR_TOWN_BUILDING_NAME_COTTAGES_1 :Casas rurales STR_TOWN_BUILDING_NAME_HOUSES_1 :Casas STR_TOWN_BUILDING_NAME_FLATS_1 :Departamentos From a044e8e007324ad6c22b83c1b59b73502478b7b7 Mon Sep 17 00:00:00 2001 From: PeterN Date: Thu, 17 Nov 2022 22:45:15 +0000 Subject: [PATCH 26/42] Fix: Scale minimum visible caption by interface scale. (#10180) --- src/window.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/window.cpp b/src/window.cpp index f7092741e6..2ae61648ee 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1996,28 +1996,30 @@ static void PreventHiding(int *nx, int *ny, const Rect &rect, const Window *v, i { if (v == nullptr) return; + const int min_visible = ScaleGUITrad(MIN_VISIBLE_TITLE_BAR); + int v_bottom = v->top + v->height; int v_right = v->left + v->width; - int safe_y = (dir == PHD_UP) ? (v->top - MIN_VISIBLE_TITLE_BAR - rect.top) : (v_bottom + MIN_VISIBLE_TITLE_BAR - rect.bottom); // Compute safe vertical position. + int safe_y = (dir == PHD_UP) ? (v->top - min_visible - rect.top) : (v_bottom + min_visible - rect.bottom); // Compute safe vertical position. - if (*ny + rect.top <= v->top - MIN_VISIBLE_TITLE_BAR) return; // Above v is enough space - if (*ny + rect.bottom >= v_bottom + MIN_VISIBLE_TITLE_BAR) return; // Below v is enough space + if (*ny + rect.top <= v->top - min_visible) return; // Above v is enough space + if (*ny + rect.bottom >= v_bottom + min_visible) return; // Below v is enough space /* Vertically, the rectangle is hidden behind v. */ - if (*nx + rect.left + MIN_VISIBLE_TITLE_BAR < v->left) { // At left of v. - if (v->left < MIN_VISIBLE_TITLE_BAR) *ny = safe_y; // But enough room, force it to a safe position. + if (*nx + rect.left + min_visible < v->left) { // At left of v. + if (v->left < min_visible) *ny = safe_y; // But enough room, force it to a safe position. return; } - if (*nx + rect.right - MIN_VISIBLE_TITLE_BAR > v_right) { // At right of v. - if (v_right > _screen.width - MIN_VISIBLE_TITLE_BAR) *ny = safe_y; // Not enough room, force it to a safe position. + if (*nx + rect.right - min_visible > v_right) { // At right of v. + if (v_right > _screen.width - min_visible) *ny = safe_y; // Not enough room, force it to a safe position. return; } /* Horizontally also hidden, force movement to a safe area. */ - if (px + rect.left < v->left && v->left >= MIN_VISIBLE_TITLE_BAR) { // Coming from the left, and enough room there. - *nx = v->left - MIN_VISIBLE_TITLE_BAR - rect.left; - } else if (px + rect.right > v_right && v_right <= _screen.width - MIN_VISIBLE_TITLE_BAR) { // Coming from the right, and enough room there. - *nx = v_right + MIN_VISIBLE_TITLE_BAR - rect.right; + if (px + rect.left < v->left && v->left >= min_visible) { // Coming from the left, and enough room there. + *nx = v->left - min_visible - rect.left; + } else if (px + rect.right > v_right && v_right <= _screen.width - min_visible) { // Coming from the right, and enough room there. + *nx = v_right + min_visible - rect.right; } else { *ny = safe_y; } @@ -2038,9 +2040,11 @@ static void EnsureVisibleCaption(Window *w, int nx, int ny) if (caption != nullptr) { caption_rect = caption->GetCurrentRect(); + const int min_visible = ScaleGUITrad(MIN_VISIBLE_TITLE_BAR); + /* Make sure the window doesn't leave the screen */ - nx = Clamp(nx, MIN_VISIBLE_TITLE_BAR - caption_rect.right, _screen.width - MIN_VISIBLE_TITLE_BAR - caption_rect.left); - ny = Clamp(ny, 0, _screen.height - MIN_VISIBLE_TITLE_BAR); + nx = Clamp(nx, min_visible - caption_rect.right, _screen.width - min_visible - caption_rect.left); + ny = Clamp(ny, 0, _screen.height - min_visible); /* Make sure the title bar isn't hidden behind the main tool bar or the status bar. */ PreventHiding(&nx, &ny, caption_rect, FindWindowById(WC_MAIN_TOOLBAR, 0), w->left, PHD_DOWN); From a942028803fe12cb5181a6c2110e72507125ccc1 Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 18 Nov 2022 18:49:43 +0000 Subject: [PATCH 27/42] Update: Translations from eints dutch: 42 changes by Afoklala french: 12 changes by glx22 --- src/lang/dutch.txt | 54 +++++++++++++++++++++++++++++++++++---------- src/lang/french.txt | 19 ++++++++++------ 2 files changed, 54 insertions(+), 19 deletions(-) diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index b44115141b..d7cb39698d 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -404,6 +404,8 @@ STR_SCENEDIT_FILE_MENU_QUIT :Afsluiten ###length 15 STR_SETTINGS_MENU_GAME_OPTIONS :Spelopties STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :Instellingen +STR_SETTINGS_MENU_AI_SETTINGS :AI-instellingen +STR_SETTINGS_MENU_GAMESCRIPT_SETTINGS :Spelscript-instellingen STR_SETTINGS_MENU_NEWGRF_SETTINGS :NewGRF-instellingen STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Doorzichtigheidsopties STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Plaatsnamen weergeven @@ -1006,8 +1008,19 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Selectee STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Huidige driver: {STRING} +STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Grootte gebruikersscherm +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Sleep de schuif om de grootte van het gebruikersscherm in te stellen. Hou Ctrl ingedrukt voor geleidelijke aanpassing +STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Grootte automatisch detecteren +STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Vink dit vakje aan om de grootte van het gebruikersscherm automatisch te detecteren +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Randen schalen +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Vink dit vakje aan om randen te schalen op grootte van gebruikersscherm +STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_2X :2x +STR_GAME_OPTIONS_GUI_SCALE_3X :3x +STR_GAME_OPTIONS_GUI_SCALE_4X :4x +STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Weergave @@ -2054,6 +2067,8 @@ STR_INTRO_HIGHSCORE :{BLACK}Scoretab STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Instellingen STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF-instellingen STR_INTRO_ONLINE_CONTENT :{BLACK}Online inhoud zoeken +STR_INTRO_AI_SETTINGS :{BLACK}AI-instellingen +STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}Spelscript-instellingen STR_INTRO_QUIT :{BLACK}Afsluiten STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Start een nieuw spel. Ctrl+klik slaat de kaartconfiguratie over @@ -2073,6 +2088,8 @@ STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Scoretab STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Scherminstellingen STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}NewGRF-instellingen weergeven STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Zoeken naar nieuwe en aangepaste inhoud om te downloaden +STR_INTRO_TOOLTIP_AI_SETTINGS :{BLACK}AI-instellingen weergeven +STR_INTRO_TOOLTIP_GAMESCRIPT_SETTINGS :{BLACK}Spelscript-instellingen weergeven STR_INTRO_TOOLTIP_QUIT :{BLACK}'OpenTTD' afsluiten STR_INTRO_BASESET :{BLACK}De huidige gekozen set grafische elementen mist {NUM} sprite{P "" s}. Controleer of er updates zijn voor deze basisset. @@ -3132,6 +3149,12 @@ STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}Rivieren STR_MAPGEN_SMOOTHNESS :{BLACK}Gladheid: STR_MAPGEN_VARIETY :{BLACK}Landschapsvariatie: STR_MAPGEN_GENERATE :{WHITE}Maken +STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}NewGRF-instellingen +STR_MAPGEN_NEWGRF_SETTINGS_TOOLTIP :{BLACK}NewGRF-instellingen weergeven +STR_MAPGEN_AI_SETTINGS :{BLACK}AI-instellingen +STR_MAPGEN_AI_SETTINGS_TOOLTIP :{BLACK}AI-instellingen weergeven +STR_MAPGEN_GS_SETTINGS :{BLACK}Spelscript-instellingen +STR_MAPGEN_GS_SETTINGS_TOOLTIP :{BLACK}Spelscript-instellingen weergeven ###length 21 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH :Engels (Origineel) @@ -3457,14 +3480,14 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Exclusieve tran STR_LOCAL_AUTHORITY_ACTION_BRIBE :Gemeentebestuur omkopen ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}Begin een kleine reclamecampagne om meer passagiers en vracht naar jouw transportdiensten te trekken.{}Zorgt voor een tijdelijk hogere stationswaardering in een klein gebied rondom het centrum.{}Kosten: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Begin een middelgrote reclamecampagne om meer passagiers en vracht naar jouw transportdiensten te trekken.{}Zorgt voor een tijdelijk hogere stationswaardering in een middelgroot gebied rondom het centrum.{}Kosten: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Begin een grote reclamecampagne om meer passagiers en vracht naar jouw transportdiensten te trekken.{}Zorgt voor een tijdelijk hogere stationswaardering in een groot gebied rondom het centrum.{}Kosten: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}Financier een reconstructie van het wegennetwerk.{}Veroorzaakt tot 6 maanden lang een aanzienlijke verstoring van het wegverkeer.{}Kosten: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Een standbeeld bouwen ter ere van jouw bedrijf.{}Zorgt voor een blijvend hogere stationswaardering in deze stad.{}Kosten: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}De bouw van nieuwe gebouwen in de stad financieren.{}Zorgt voor een tijdelijk hogere groei van deze stad.{}Kosten: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}1 jaar exclusieve transportrechten kopen in deze plaats.{}Het gemeentebestuur staat alleen passagiers en vracht toe bij jouw stations.{}Kosten: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Koop het plaatselijk gezag om om je reputatie te verhogen met het risico op een strenge sanctie wanneer je gepakt wordt.{}Kosten: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW}Begin een kleine reclamecampagne om meer passagiers en vracht naar jouw transportdiensten te trekken.{}Zorgt voor een tijdelijk hogere stationswaardering in een klein gebied rondom het centrum.{}{POP_COLOUR}Kosten: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{PUSH_COLOUR}{YELLOW}Begin een middelgrote reclamecampagne om meer passagiers en vracht naar jouw transportdiensten te trekken.{}Zorgt voor een tijdelijk hogere stationswaardering in een middelgroot gebied rondom het centrum.{}{POP_COLOUR}Kosten: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{PUSH_COLOUR}{YELLOW}Begin een grote reclamecampagne om meer passagiers en vracht naar jouw transportdiensten te trekken.{}Zorgt voor een tijdelijk hogere stationswaardering in een groot gebied rondom het centrum.{}{POP_COLOUR}Kosten: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW}Financier een reconstructie van het wegennetwerk.{}Veroorzaakt tot 6 maanden lang een aanzienlijke verstoring van het wegverkeer.{}{POP_COLOUR}Kosten: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{PUSH_COLOUR}{YELLOW}Bouw een standbeeld ter ere van jouw bedrijf.{}Zorgt voor een blijvend hogere stationswaardering in deze stad.{}{POP_COLOUR}Kosten: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{PUSH_COLOUR}{YELLOW}Financier de bouw van nieuwe gebouwen in de stad.{}Zorgt voor een tijdelijk hogere groei van deze stad.{}{POP_COLOUR}Kosten: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW}1 jaar exclusieve transportrechten kopen in deze plaats.{}Het gemeentebestuur staat alleen passagiers en vracht toe bij jouw stations.{}{POP_COLOUR}Kosten: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}Koop het plaatselijk gezag om om je reputatie te verhogen met het risico op een ernstige sanctie wanneer je gepakt wordt.{}{POP_COLOUR}Kosten: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} Doelen @@ -3637,15 +3660,18 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}Schepen STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD} Rente van lening STR_FINANCES_SECTION_OTHER :{GOLD}Overig +STR_FINANCES_TOTAL_CAPTION :{WHITE}Totaal STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} +STR_FINANCES_PROFIT :{WHITE}Winst STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Banksaldo STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Eigen kapitaal STR_FINANCES_LOAN_TITLE :{WHITE}Lening STR_FINANCES_INTEREST_RATE :{WHITE}Rente op lening: {BLACK}{NUM}% STR_FINANCES_MAX_LOAN :{WHITE}Maximale lening: {BLACK}{CURRENCY_LONG} STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} +STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}{CURRENCY_LONG} lenen STR_FINANCES_BORROW_TOOLTIP :{BLACK}Vergroot lening. Ctrl+klik om zoveel als mogelijk te lenen STR_FINANCES_REPAY_BUTTON :{BLACK}{CURRENCY_LONG} terugbetalen @@ -4199,6 +4225,7 @@ STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Gewicht: STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Gewicht: {LTBLUE}{WEIGHT_SHORT} {BLACK}Vermogen: {LTBLUE}{POWER}{BLACK} Max.snelheid: {LTBLUE}{VELOCITY} {BLACK}Max. tr.kr.: {LTBLUE}{FORCE} STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Winst dit jaar: {LTBLUE}{CURRENCY_LONG} (vorig jaar: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Winst dit jaar: {LTBLUE}{CURRENCY_LONG} (vorig jaar: {CURRENCY_LONG}) {BLACK}Min. prestatie: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Betrouwbaarheid: {LTBLUE}{COMMA}% {BLACK}Aantal keren motorpech sinds laatste onderhoud: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Gebouwd: {LTBLUE}{NUM}{BLACK} Waarde: {LTBLUE}{CURRENCY_LONG} @@ -4512,7 +4539,7 @@ STR_AI_DEBUG :{WHITE}Probleem STR_AI_DEBUG_NAME_AND_VERSION :{BLACK}{STRING} (v{NUM}) STR_AI_DEBUG_NAME_TOOLTIP :{BLACK}Naam van het script STR_AI_DEBUG_SETTINGS :{BLACK}Instellingen -STR_AI_DEBUG_SETTINGS_TOOLTIP :{BLACK}Instellingen van script wijzigen +STR_AI_DEBUG_SETTINGS_TOOLTIP :{BLACK}Script-instellingen wijzigen STR_AI_DEBUG_RELOAD :{BLACK}Computerspeler opnieuw laden STR_AI_DEBUG_RELOAD_TOOLTIP :{BLACK}Computerspeler verwijderen, script opnieuw laden en computerspeler opnieuw starten STR_AI_DEBUG_BREAK_STR_ON_OFF_TOOLTIP :{BLACK}Afbreken in-uitschakelen als een AI-logbericht overeenstemt met de afbreektekst @@ -4532,6 +4559,8 @@ STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Eén van STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}AI-/spelscript-probleemvenster is alleen beschikbaar voor de server # AI configuration window +STR_AI_CONFIG_CAPTION_AI :{WHITE}Configuratie AI +STR_AI_CONFIG_CAPTION_GAMESCRIPT :{WHITE}Configuratie spelscript STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}Het spelscript dat in het volgende spel geladen wordt STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}De AI's die in het volgende spel geladen worden STR_AI_CONFIG_HUMAN_PLAYER :Menselijke speler @@ -4545,10 +4574,11 @@ STR_AI_CONFIG_MOVE_DOWN :{BLACK}Omlaag v STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}Geselecteerde AI naar omlaag verplaatsen in de lijst STR_AI_CONFIG_GAMESCRIPT :{SILVER}Spelscript +STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}Parameters STR_AI_CONFIG_AI :{SILVER}AI's -STR_AI_CONFIG_CHANGE_AI :AI -STR_AI_CONFIG_CHANGE_GAMESCRIPT :Spelscript +STR_AI_CONFIG_CHANGE_AI :{BLACK}AI selecteren +STR_AI_CONFIG_CHANGE_GAMESCRIPT :{BLACK}Spelscript selecteren STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Ander script laden STR_AI_CONFIG_CONFIGURE :{BLACK}Configureren STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}De parameters van het script configureren @@ -4577,7 +4607,7 @@ STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Schermaf STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Schermafbeelding van de minikaart # AI Parameters -STR_AI_SETTINGS_CAPTION_AI :AI +STR_AI_SETTINGS_CAPTION_AI :{WHITE}AI-parameters STR_AI_SETTINGS_CLOSE :{BLACK}Sluiten STR_AI_SETTINGS_RESET :{BLACK}Terugstellen STR_AI_SETTINGS_SETTING :{STRING}: {ORANGE}{STRING} diff --git a/src/lang/french.txt b/src/lang/french.txt index eb3c132590..42c7364ba8 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -1014,6 +1014,8 @@ STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Faites g STR_GAME_OPTIONS_GUI_SCALE_AUTO :détection automatique de la taille STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Cochez cette case pour détecter automatiquement la taille de l'interface +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Mettre à l’échelle les bordures +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Cochez cette case pour mettre les bordures à l'échelle avec la taille de l'interface STR_GAME_OPTIONS_GUI_SCALE_1X :1x STR_GAME_OPTIONS_GUI_SCALE_2X :2x @@ -3479,14 +3481,14 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Acheter les dro STR_LOCAL_AUTHORITY_ACTION_BRIBE :Corrompre la municipalité ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW}Lancez une petite campagne de publicité locale pour attirer plus de passagers et de marchandises vers vos services de transport.{}Fournit une amélioration temporaire de la note des gares dans un petit rayon autour du centre-ville.{}{POP_COLOUR}Coût : {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Lancer une campagne de publicité moyenne, pour attirer plus de voyageurs et de marchandises sur vos lignes.{}Augmente temporairement le classement de vos gares dans un rayon moyen autour du centre-ville.{}Coût:{CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Lancer une grande campagne de publicité, pour attirer plus de voyageurs et de marchandises sur vos lignes.{}Augmente temporairement le classement des gares dans un rayon important autour du centre-ville.{}Coût: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW}Lancez une petite campagne de publicité locale pour attirer plus de passagers et de marchandises vers vos services de transport.{}Fournit une amélioration temporaire de la note des gares dans un petit rayon autour du centre-ville.{}{POP_COLOUR}Coût{NBSP}: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{PUSH_COLOUR}{YELLOW}Lancer une campagne de publicité moyenne, pour attirer plus de voyageurs et de marchandises sur vos lignes.{}Augmente temporairement le classement de vos gares dans un rayon moyen autour du centre-ville.{}{POP_COLOUR}Coût{NBSP}:{CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{PUSH_COLOUR}{YELLOW}Lancer une grande campagne de publicité, pour attirer plus de voyageurs et de marchandises sur vos lignes.{}Augmente temporairement le classement des gares dans un rayon important autour du centre-ville.{}{POP_COLOUR}Coût{NBSP}: {CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW}Financer la reconstruction du réseau routier.{}Provoque une perturbation considérable du trafic pendant 6 mois au maximum.{}{POP_COLOUR}Coût : {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Construire une statue en l'honneur de votre compagnie.{}Augmente en permanence le classement de vos stations dans cette ville.{}Coût:{CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}Financer la construction de nouveaux immeubles commerciaux.{}Stimule temporairement la croissance dans cette ville.{}Coût:{CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Achetez les droits de transport exclusifs d'un an pour la ville.{} La municipalité n'autorisera pas les passagers et les marchandises à utiliser les gares de vos concurrents.{} Coût: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Corrompre la municipalité pour améliorer votre réputation. Risque de pénalisation si le pot-de-vin est dévoilé.{}Coût{NBSP}: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{PUSH_COLOUR}{YELLOW}Construire une statue en l'honneur de votre compagnie.{}Augmente en permanence le classement de vos stations dans cette ville.{}{POP_COLOUR}Coût{NBSP}:{CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{PUSH_COLOUR}{YELLOW}Financer la construction de nouveaux immeubles commerciaux.{}Stimule temporairement la croissance dans cette ville.{}{POP_COLOUR}Coût{NBSP}:{CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW}Achetez les droits de transport exclusifs d'un an pour la ville.{} La municipalité n'autorisera pas les passagers et les marchandises à utiliser les gares de vos concurrents.{}{POP_COLOUR}Coût{NBSP}: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}Corrompre la municipalité pour améliorer votre réputation. Risque de pénalisation si le pot-de-vin est dévoilé.{}{POP_COLOUR}Coût{NBSP}: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}Objectifs de {COMPANY} @@ -3659,15 +3661,18 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}Navires STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}Intérêts du prêt STR_FINANCES_SECTION_OTHER :{GOLD}Autres +STR_FINANCES_TOTAL_CAPTION :{WHITE}Total STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} +STR_FINANCES_PROFIT :{WHITE}Profit STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Solde bancaire STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Fonds propres STR_FINANCES_LOAN_TITLE :{WHITE}Emprunt STR_FINANCES_INTEREST_RATE :{WHITE}Taux d'intérêt de l'emprunt{NBSP}: {BLACK}{NUM}% STR_FINANCES_MAX_LOAN :{WHITE}Emprunt maximum{NBSP}: {BLACK}{CURRENCY_LONG} STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} +STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}Emprunter {CURRENCY_LONG} STR_FINANCES_BORROW_TOOLTIP :{BLACK}Augmenter l'emprunt. Ctrl-clic pour emprunter autant que possible. STR_FINANCES_REPAY_BUTTON :{BLACK}Rembourser {CURRENCY_LONG} From a7adadcf9bfaa7ebf4f5e45cd2dd2cf0a2f05dcf Mon Sep 17 00:00:00 2001 From: PeterN Date: Sat, 19 Nov 2022 21:18:53 +0000 Subject: [PATCH 28/42] Fix: Indent production in industry window and resolve button issues. (#10184) Industry production used to be indented, although a different amount than the industry accepts list. This is now added back, with the standard indent width. Additionally the cheat-mode production modifier buttons now support RTL and the list height now takes account of the button height. --- src/core/geometry_type.hpp | 11 ++++++++ src/industry_gui.cpp | 54 ++++++++++++++++++++++++-------------- 2 files changed, 45 insertions(+), 20 deletions(-) diff --git a/src/core/geometry_type.hpp b/src/core/geometry_type.hpp index 98a1f8f9d3..36933de6ef 100644 --- a/src/core/geometry_type.hpp +++ b/src/core/geometry_type.hpp @@ -208,6 +208,17 @@ struct Rect { ? Rect {this->left, this->bottom - height + 1, this->right, this->bottom} : Rect {this->left, this->top, this->right, this->top + height - 1}; } + + /** + * Test if a point falls inside this Rect. + * @param pt the point to test. + * @return true iif the point falls inside the Rect. + */ + inline bool Contains(const Point &pt) const + { + /* This is a local version of IsInsideMM, to avoid including math_func everywhere. */ + return (uint)(pt.x - this->left) < (uint)(this->right - this->left) && (uint)(pt.y - this->top) < (uint)(this->bottom - this->top); + } }; /** diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 17a9992075..b87d125196 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -813,6 +813,7 @@ class IndustryViewWindow : public Window byte clicked_button; ///< The button that has been clicked (to raise) int production_offset_y; ///< The offset of the production texts/buttons int info_height; ///< Height needed for the #WID_IV_INFO panel + int cheat_line_height; ///< Height of each line for the #WID_IV_INFO panel public: IndustryViewWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc) @@ -830,6 +831,12 @@ public: this->InvalidateData(); } + void OnInit() override + { + /* This only used when the cheat to alter industry production is enabled */ + this->cheat_line_height = std::max(SETTING_BUTTON_HEIGHT + WidgetDimensions::scaled.vsep_normal, FONT_HEIGHT_NORMAL); + } + void OnPaint() override { this->DrawWidgets(); @@ -838,7 +845,7 @@ public: const Rect r = this->GetWidget(WID_IV_INFO)->GetCurrentRect(); int expected = this->DrawInfo(r); - if (expected > r.bottom) { + if (expected != r.bottom) { this->info_height = expected - r.top + 1; this->ReInit(); return; @@ -852,6 +859,7 @@ public: */ int DrawInfo(const Rect &r) { + bool rtl = _current_text_dir == TD_RTL; Industry *i = Industry::Get(this->window_number); const IndustrySpec *ind = GetIndustrySpec(i->type); Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); @@ -860,7 +868,7 @@ public: if (i->prod_level == PRODLEVEL_CLOSURE) { DrawString(ir, STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE); - ir.top += 2 * FONT_HEIGHT_NORMAL; + ir.top += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_wide; } CargoSuffix cargo_suffix[lengthof(i->accepts_cargo)]; @@ -898,11 +906,14 @@ public: default: NOT_REACHED(); } - DrawString(ir.Indent(WidgetDimensions::scaled.hsep_indent, _current_text_dir == TD_RTL), str); + DrawString(ir.Indent(WidgetDimensions::scaled.hsep_indent, rtl), str); ir.top += FONT_HEIGHT_NORMAL; } GetAllCargoSuffixes(CARGOSUFFIX_OUT, CST_VIEW, i, i->type, ind, i->produced_cargo, cargo_suffix); + int line_height = this->editable == EA_RATE ? this->cheat_line_height : FONT_HEIGHT_NORMAL; + int text_y_offset = (line_height - FONT_HEIGHT_NORMAL) / 2; + int button_y_offset = (line_height - SETTING_BUTTON_HEIGHT) / 2; first = true; for (byte j = 0; j < lengthof(i->produced_cargo); j++) { if (i->produced_cargo[j] == CT_INVALID) continue; @@ -918,24 +929,27 @@ public: SetDParam(1, i->last_month_production[j]); SetDParamStr(2, cargo_suffix[j].text); SetDParam(3, ToPercent8(i->last_month_pct_transported[j])); - DrawString(ir.Indent(this->editable == EA_RATE ? SETTING_BUTTON_WIDTH + WidgetDimensions::scaled.hsep_indent : 0, false), STR_INDUSTRY_VIEW_TRANSPORTED); + DrawString(ir.Indent(WidgetDimensions::scaled.hsep_indent + (this->editable == EA_RATE ? SETTING_BUTTON_WIDTH + WidgetDimensions::scaled.hsep_normal : 0), rtl).Translate(0, text_y_offset), STR_INDUSTRY_VIEW_TRANSPORTED); /* Let's put out those buttons.. */ if (this->editable == EA_RATE) { - DrawArrowButtons(ir.left, ir.top, COLOUR_YELLOW, (this->clicked_line == IL_RATE1 + j) ? this->clicked_button : 0, + DrawArrowButtons(ir.Indent(WidgetDimensions::scaled.hsep_indent, rtl).WithWidth(SETTING_BUTTON_WIDTH, rtl).left, ir.top + button_y_offset, COLOUR_YELLOW, (this->clicked_line == IL_RATE1 + j) ? this->clicked_button : 0, i->production_rate[j] > 0, i->production_rate[j] < 255); } - ir.top += FONT_HEIGHT_NORMAL; + ir.top += line_height; } /* Display production multiplier if editable */ if (this->editable == EA_MULTIPLIER) { + line_height = this->cheat_line_height; + text_y_offset = (line_height - FONT_HEIGHT_NORMAL) / 2; + button_y_offset = (line_height - SETTING_BUTTON_HEIGHT) / 2; ir.top += WidgetDimensions::scaled.vsep_wide; this->production_offset_y = ir.top; SetDParam(0, RoundDivSU(i->prod_level * 100, PRODLEVEL_DEFAULT)); - DrawString(ir.Indent(SETTING_BUTTON_WIDTH + WidgetDimensions::scaled.hsep_indent, false), STR_INDUSTRY_VIEW_PRODUCTION_LEVEL); - DrawArrowButtons(ir.left, ir.top, COLOUR_YELLOW, (this->clicked_line == IL_MULTIPLIER) ? this->clicked_button : 0, + DrawString(ir.Indent(WidgetDimensions::scaled.hsep_indent + SETTING_BUTTON_WIDTH + WidgetDimensions::scaled.hsep_normal, rtl).Translate(0, text_y_offset), STR_INDUSTRY_VIEW_PRODUCTION_LEVEL); + DrawArrowButtons(ir.Indent(WidgetDimensions::scaled.hsep_indent, rtl).WithWidth(SETTING_BUTTON_WIDTH, rtl).left, ir.top + button_y_offset, COLOUR_YELLOW, (this->clicked_line == IL_MULTIPLIER) ? this->clicked_button : 0, i->prod_level > PRODLEVEL_MINIMUM, i->prod_level < PRODLEVEL_MAXIMUM); - ir.top += FONT_HEIGHT_NORMAL; + ir.top += line_height; } /* Get the extra message for the GUI */ @@ -991,12 +1005,12 @@ public: case EA_NONE: break; case EA_MULTIPLIER: - if (IsInsideBS(pt.y, this->production_offset_y, FONT_HEIGHT_NORMAL)) line = IL_MULTIPLIER; + if (IsInsideBS(pt.y, this->production_offset_y, this->cheat_line_height)) line = IL_MULTIPLIER; break; case EA_RATE: if (pt.y >= this->production_offset_y) { - int row = (pt.y - this->production_offset_y) / FONT_HEIGHT_NORMAL; + int row = (pt.y - this->production_offset_y) / this->cheat_line_height; for (uint j = 0; j < lengthof(i->produced_cargo); j++) { if (i->produced_cargo[j] == CT_INVALID) continue; row--; @@ -1010,15 +1024,15 @@ public: } if (line == IL_NONE) return; - NWidgetBase *nwi = this->GetWidget(widget); - int left = nwi->pos_x + WidgetDimensions::scaled.framerect.left; - int right = nwi->pos_x + nwi->current_x - 1 - WidgetDimensions::scaled.framerect.right; - if (IsInsideMM(pt.x, left, left + SETTING_BUTTON_WIDTH)) { + bool rtl = _current_text_dir == TD_RTL; + Rect r = this->GetWidget(widget)->GetCurrentRect().Shrink(WidgetDimensions::scaled.framerect).Indent(WidgetDimensions::scaled.hsep_indent, rtl); + + if (r.WithWidth(SETTING_BUTTON_WIDTH, rtl).Contains(pt)) { /* Clicked buttons, decrease or increase production */ - byte button = (pt.x < left + SETTING_BUTTON_WIDTH / 2) ? 1 : 2; + bool decrease = r.WithWidth(SETTING_BUTTON_WIDTH / 2, rtl).Contains(pt); switch (this->editable) { case EA_MULTIPLIER: - if (button == 1) { + if (decrease) { if (i->prod_level <= PRODLEVEL_MINIMUM) return; i->prod_level = std::max(i->prod_level / 2, PRODLEVEL_MINIMUM); } else { @@ -1028,7 +1042,7 @@ public: break; case EA_RATE: - if (button == 1) { + if (decrease) { if (i->production_rate[line - IL_RATE1] <= 0) return; i->production_rate[line - IL_RATE1] = std::max(i->production_rate[line - IL_RATE1] / 2, 0); } else { @@ -1046,8 +1060,8 @@ public: this->SetDirty(); this->SetTimeout(); this->clicked_line = line; - this->clicked_button = button; - } else if (IsInsideMM(pt.x, left + SETTING_BUTTON_WIDTH + WidgetDimensions::scaled.hsep_indent, right)) { + this->clicked_button = (decrease ^ rtl) ? 1 : 2; + } else if (r.Indent(SETTING_BUTTON_WIDTH + WidgetDimensions::scaled.hsep_normal, rtl).Contains(pt)) { /* clicked the text */ this->editbox_line = line; switch (this->editable) { From 62125c9e76be4a9361d0e3d9009ed7a81120fac1 Mon Sep 17 00:00:00 2001 From: translators Date: Sun, 20 Nov 2022 18:46:46 +0000 Subject: [PATCH 29/42] Update: Translations from eints korean: 3 changes by telk5093 turkish: 33 changes by EndChapter --- src/lang/korean.txt | 3 +++ src/lang/turkish.txt | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 784a8a7efd..70b1250b5f 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -3661,15 +3661,18 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}선박 STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}이자 STR_FINANCES_SECTION_OTHER :{GOLD}기타 +STR_FINANCES_TOTAL_CAPTION :{WHITE}종합 STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} +STR_FINANCES_PROFIT :{WHITE}이익 STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}현 보유 금액 STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}보유 자금 STR_FINANCES_LOAN_TITLE :{WHITE}대출 STR_FINANCES_INTEREST_RATE :{WHITE}대출 금리: {BLACK}{NUM}% STR_FINANCES_MAX_LOAN :{WHITE}최대 대출: {BLACK}{CURRENCY_LONG} STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} +STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}{CURRENCY_LONG} 빌리기 STR_FINANCES_BORROW_TOOLTIP :{BLACK}돈을 빌립니다. CTRL+클릭하면 빌릴 수 있는 만큼 빌립니다 STR_FINANCES_REPAY_BUTTON :{BLACK}{CURRENCY_LONG} 갚기 diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index 3aa4dfc628..956e234876 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -201,6 +201,9 @@ STR_UNITS_POWER_IMPERIAL :{COMMA}{NBSP}bg STR_UNITS_POWER_METRIC :{COMMA}{NBSP}bg STR_UNITS_POWER_SI :{COMMA}{NBSP}kW +STR_UNITS_POWER_METRIC_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg +STR_UNITS_POWER_SI_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_SI :{DECIMAL}{NBSP}W/kg STR_UNITS_WEIGHT_SHORT_IMPERIAL :{COMMA}{NBSP}t STR_UNITS_WEIGHT_SHORT_METRIC :{COMMA}{NBSP}t @@ -396,6 +399,8 @@ STR_SCENEDIT_FILE_MENU_QUIT :Oyundan Çık ###length 15 STR_SETTINGS_MENU_GAME_OPTIONS :Seçenekler STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :Ayarlar +STR_SETTINGS_MENU_AI_SETTINGS :YZ ayarları +STR_SETTINGS_MENU_GAMESCRIPT_SETTINGS :Oyun betiği ayarları STR_SETTINGS_MENU_NEWGRF_SETTINGS :NewGRF ayarları STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Şeffaflık seçenekleri STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Şehir isimlerini göster @@ -998,8 +1003,16 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Dikey se STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Geçerli sürücü: {STRING} +STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Arayüz büyüklüğü +STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Büyüklüğü otomatik algıla +STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Arayüz boyutunu otomatik ayarlamak için bu kutucuğu işaretleyin +STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_2X :2x +STR_GAME_OPTIONS_GUI_SCALE_3X :3x +STR_GAME_OPTIONS_GUI_SCALE_4X :4x +STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafikler @@ -2046,6 +2059,7 @@ STR_INTRO_HIGHSCORE :{BLACK}Puan Tab STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Ayarlar STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF Ayarları STR_INTRO_ONLINE_CONTENT :{BLACK}Çevrimiçi İçeriği Kontrol Et +STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}Oyun Betiği Ayarları STR_INTRO_QUIT :{BLACK}Çıkış STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Yeni oyuna başla. Ctrl+Tıklama harita ayarlamasını atlar. @@ -2065,6 +2079,8 @@ STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Puan tab STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Görüntü ayarları STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}NewGRF ayarlarını göster STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}İndirilecek yeni ve güncellenmiş içeriği kontrol et +STR_INTRO_TOOLTIP_AI_SETTINGS :{BLACK}YZ ayarlarını göster +STR_INTRO_TOOLTIP_GAMESCRIPT_SETTINGS :{BLACK}Oyun betiği ayarlarını göster STR_INTRO_TOOLTIP_QUIT :{BLACK}'OpenTTD' den çık STR_INTRO_BASESET :{BLACK}Geçerli seçimdeki temel grafik setinin {NUM} örneği eksik. Lütfen temel setin güncellemelerini kontrol edin. @@ -2585,6 +2601,7 @@ STR_STATION_BUILD_COVERAGE_AREA_OFF_TOOLTIP :{BLACK}Kapsama STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP :{BLACK}Kapsama alanını göster STR_STATION_BUILD_ACCEPTS_CARGO :{BLACK}İstenen: {GOLD}{CARGO_LIST} STR_STATION_BUILD_SUPPLIES_CARGO :{BLACK}Sağladıkları: {GOLD}{CARGO_LIST} +STR_STATION_BUILD_INFRASTRUCTURE_COST :{BLACK}Bakım maliyeti: {GOLD}{CURRENCY_SHORT}/yıl # Join station window STR_JOIN_STATION_CAPTION :{WHITE}İstasyonu birleştir @@ -3120,6 +3137,12 @@ STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}Nehirler STR_MAPGEN_SMOOTHNESS :{BLACK}Düzlük seviyesi: STR_MAPGEN_VARIETY :{BLACK}Çeşitlilik dağılımı: STR_MAPGEN_GENERATE :{WHITE}Oluştur +STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}NewGRF Ayarları +STR_MAPGEN_NEWGRF_SETTINGS_TOOLTIP :{BLACK}NewGRF ayarlarını göster +STR_MAPGEN_AI_SETTINGS :{BLACK}YZ Ayarları +STR_MAPGEN_AI_SETTINGS_TOOLTIP :{BLACK}YZ ayarlarını göster +STR_MAPGEN_GS_SETTINGS :{BLACK}Oyun Betiği Ayarları +STR_MAPGEN_GS_SETTINGS_TOOLTIP :{BLACK}Oyun betiği ayarlarını göster ###length 21 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH :İngiliz (Özgün) @@ -3625,9 +3648,11 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}Gemiler STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}Kredi Faizi STR_FINANCES_SECTION_OTHER :{GOLD}Diğer +STR_FINANCES_TOTAL_CAPTION :{WHITE}Toplam STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} +STR_FINANCES_PROFIT :{WHITE}Kâr STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Banka Hesabı STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Kendi Sermayem STR_FINANCES_LOAN_TITLE :{WHITE}Kredi @@ -3856,6 +3881,9 @@ STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Menzil: STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}Uçak türü: {GOLD}{STRING} ###length 3 +STR_CARGO_TYPE_FILTER_ALL :Tüm kargo tipleri +STR_CARGO_TYPE_FILTER_FREIGHT :Nakliye +STR_CARGO_TYPE_FILTER_NONE :Hiçbiri ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Tren seçim listesi. Bilgi için araç tıklayın. Ctrl+Tıklama araç türünün gizlenmesini açar/kapatır @@ -4184,6 +4212,7 @@ STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Ağırl STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Ağırlık: {LTBLUE}{WEIGHT_SHORT} {BLACK}Güç: {LTBLUE}{POWER}{BLACK} Azami Hız: {LTBLUE}{VELOCITY} {BLACK}Azami Tork: {LTBLUE}{FORCE} STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Bu yılki kar: {LTBLUE}{CURRENCY_LONG} (geçen yıl: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Bu yıl kâr: {LTBLUE}{CURRENCY_LONG} (geçen sene: {CURRENCY_LONG}) {BLACK}Min. performans: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Güvenilirlik: {LTBLUE}{COMMA}% {BLACK}Son bakımdan beri bozulma sayısı: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Üretim: {LTBLUE}{NUM}{BLACK} Değer: {LTBLUE}{CURRENCY_LONG} @@ -4517,6 +4546,8 @@ STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Çalış STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}YZ Hata Ayıklama penceresi sadece sunucu içindir # AI configuration window +STR_AI_CONFIG_CAPTION_AI :{WHITE}YZ Konfigürasyonu +STR_AI_CONFIG_CAPTION_GAMESCRIPT :{WHITE}Oyun Betiği Konfigürasyonu STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}Bir sonraki oyunda yüklenecek Oyun Betiği STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}Bir sonraki oyunda yüklenecek YZ'ler STR_AI_CONFIG_HUMAN_PLAYER :İnsan oyuncu @@ -4532,8 +4563,8 @@ STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}Seçilen STR_AI_CONFIG_GAMESCRIPT :{SILVER}Oyun Betiği STR_AI_CONFIG_AI :{SILVER}YZ'ler -STR_AI_CONFIG_CHANGE_AI :YZ -STR_AI_CONFIG_CHANGE_GAMESCRIPT :Oyun Betiği +STR_AI_CONFIG_CHANGE_AI :{BLACK}YZ Seç +STR_AI_CONFIG_CHANGE_GAMESCRIPT :{BLACK}Oyun Betiği Seç STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Başka bir betik yükle STR_AI_CONFIG_CONFIGURE :{BLACK}Yapılandır STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}Betik parametrelerini yapılandır From afbad255d3e920bf50ffd5ebbbde8d11baafccda Mon Sep 17 00:00:00 2001 From: translators Date: Mon, 21 Nov 2022 18:47:58 +0000 Subject: [PATCH 30/42] Update: Translations from eints turkish: 44 changes by EndChapter spanish: 1 change by MontyMontana --- src/lang/spanish.txt | 2 +- src/lang/turkish.txt | 72 +++++++++++++++++++++++++++----------------- 2 files changed, 45 insertions(+), 29 deletions(-) diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index b9cc1f48f8..f01a975255 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -4929,7 +4929,7 @@ STR_ERROR_CAN_T_PLANT_TREE_HERE :{WHITE}No se pu STR_ERROR_CAN_T_BUILD_BRIDGE_HERE :{WHITE}No puede construirse un puente aquí... STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST :{WHITE}Primero debe demolerse el puente STR_ERROR_CAN_T_START_AND_END_ON :{WHITE}No se puede comenzar y acabar en la misma posición -STR_ERROR_BRIDGEHEADS_NOT_SAME_HEIGHT :{WHITE}Las cabeceras del puente no están al mismo nivel +STR_ERROR_BRIDGEHEADS_NOT_SAME_HEIGHT :{WHITE}Los estribos del puente no están al mismo nivel STR_ERROR_BRIDGE_TOO_LOW_FOR_TERRAIN :{WHITE}El puente es demasiado bajo para el terreno STR_ERROR_BRIDGE_TOO_HIGH_FOR_TERRAIN :{WHITE}El puente es demasiado alto para este terreno. STR_ERROR_START_AND_END_MUST_BE_IN :{WHITE}Comienzo y final deben estar en línea diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index 956e234876..bde22078b8 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -201,8 +201,14 @@ STR_UNITS_POWER_IMPERIAL :{COMMA}{NBSP}bg STR_UNITS_POWER_METRIC :{COMMA}{NBSP}bg STR_UNITS_POWER_SI :{COMMA}{NBSP}kW +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}bg/t +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}bg/t +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_SI :{DECIMAL}{NBSP}bg/Mg +STR_UNITS_POWER_METRIC_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}bg/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}bg/t STR_UNITS_POWER_METRIC_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg STR_UNITS_POWER_SI_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}kW/t STR_UNITS_POWER_SI_TO_WEIGHT_SI :{DECIMAL}{NBSP}W/kg STR_UNITS_WEIGHT_SHORT_IMPERIAL :{COMMA}{NBSP}t @@ -383,7 +389,7 @@ STR_SCENEDIT_TOOLBAR_ROAD_CONSTRUCTION :{BLACK}Yol yap STR_SCENEDIT_TOOLBAR_TRAM_CONSTRUCTION :{BLACK} Tramvay yapımı STR_SCENEDIT_TOOLBAR_PLANT_TREES :{BLACK}Ağaç dik. Shift ile tıklama maliyet tahminini gösterir STR_SCENEDIT_TOOLBAR_PLACE_SIGN :{BLACK}Tabela koy -STR_SCENEDIT_TOOLBAR_PLACE_OBJECT :{BLACK}Nesneyi yerleştirin. Shift ile tıklama maliyet tahminini gösterir +STR_SCENEDIT_TOOLBAR_PLACE_OBJECT :{BLACK}Nesneyi yerleştirin. Ctrl alanı çapraz olarak seçer. Shift inşa etme/değerini gösterme arasında geçiş yapar # Scenario editor file menu ###length 7 @@ -1004,9 +1010,12 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Dikey se STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Geçerli sürücü: {STRING} STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Arayüz büyüklüğü +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Arayüz büyüklüğünü ayarlamak için kaydırın. Sürekli ayarlama için Ctrl tuşunu basılı tutun STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Büyüklüğü otomatik algıla STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Arayüz boyutunu otomatik ayarlamak için bu kutucuğu işaretleyin +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Eğimi ayarla +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Eğimi arayüz boyutuna göre ayarlamak için bu kutucuğu işaretleyin STR_GAME_OPTIONS_GUI_SCALE_1X :1x STR_GAME_OPTIONS_GUI_SCALE_2X :2x @@ -2059,6 +2068,7 @@ STR_INTRO_HIGHSCORE :{BLACK}Puan Tab STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Ayarlar STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF Ayarları STR_INTRO_ONLINE_CONTENT :{BLACK}Çevrimiçi İçeriği Kontrol Et +STR_INTRO_AI_SETTINGS :{BLACK}YZ Ayarları STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}Oyun Betiği Ayarları STR_INTRO_QUIT :{BLACK}Çıkış @@ -2471,13 +2481,13 @@ STR_NETWORK_SERVER_MESSAGE_GAME_REASON_LINK_GRAPH :bağlantı graf STR_NETWORK_MESSAGE_CLIENT_LEAVING :ayrılıyor STR_NETWORK_MESSAGE_CLIENT_JOINED :*** {STRING} oyuna katıldı -STR_NETWORK_MESSAGE_CLIENT_JOINED_ID :*** {STRING} oyuna katıldı (İstemci #{2:NUM}) -STR_NETWORK_MESSAGE_CLIENT_COMPANY_JOIN :*** {STRING} #{2:NUM} numaralı şirkete katıldı +STR_NETWORK_MESSAGE_CLIENT_JOINED_ID :*** {0:STRING} oyuna katıldı (İstemci #{2:NUM}) +STR_NETWORK_MESSAGE_CLIENT_COMPANY_JOIN :*** {0:STRING} #{2:NUM} numaralı şirkete katıldı STR_NETWORK_MESSAGE_CLIENT_COMPANY_SPECTATE :*** {STRING} gözlemcilere katıldı -STR_NETWORK_MESSAGE_CLIENT_COMPANY_NEW :*** {STRING} yeni bir şirket kurdu (#{2:NUM}) -STR_NETWORK_MESSAGE_CLIENT_LEFT :*** {STRING} oyunu terketti ({2:STRING}) +STR_NETWORK_MESSAGE_CLIENT_COMPANY_NEW :*** {0:STRING} yeni bir şirket kurdu (#{2:NUM}) +STR_NETWORK_MESSAGE_CLIENT_LEFT :*** {0:STRING} oyunu terketti ({2:STRING}) STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} adını {STRING} olarak değiştirdi -STR_NETWORK_MESSAGE_GIVE_MONEY :*** {STRING} {1:STRING} adlı şirkete {2:CURRENCY_LONG} verdi +STR_NETWORK_MESSAGE_GIVE_MONEY :*** {0:STRING} {1:STRING} adlı şirkete {2:CURRENCY_LONG} verdi STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}Sunucu kapandı STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Sunucu baştan başlatılıyor...{}Lütfen bekleyin... STR_NETWORK_MESSAGE_KICKED :*** {STRING} atıldı. Sebep: ({STRING}) @@ -2592,6 +2602,9 @@ STR_LINKGRAPH_LEGEND_SATURATED :{TINY_FONT}{BLA STR_LINKGRAPH_LEGEND_OVERLOADED :{TINY_FONT}{BLACK}aşırı dolu # Linkgraph tooltip +STR_LINKGRAPH_STATS_TOOLTIP :{BLACK}{CARGO_LONG} aylık nakledilecek {STATION} istasyonundan {STATION} istasyonuna ({COMMA}% kapasite ile){STRING} +STR_LINKGRAPH_STATS_TOOLTIP_RETURN_EXTENSION :{}{CARGO_LONG} geri nakledilecek ({COMMA}% kapasite ile) +STR_LINKGRAPH_STATS_TOOLTIP_TIME_EXTENSION :{}Ortalama seyahat süresi: {NUM}{NBSP}gün # Base for station construction window(s) STR_STATION_BUILD_COVERAGE_AREA_TITLE :{BLACK}Kapsama alanı @@ -2789,11 +2802,11 @@ STR_LANDSCAPING_TOOLBAR :{WHITE}Arazi d STR_LANDSCAPING_TOOLTIP_LOWER_A_CORNER_OF_LAND :{BLACK}Arazinin bir köşesini alçalt. Sürükleme ilk seçilen köşeyi alçaltır ve seçilen araziyi yeni yüksekliğe indirir. Ctrl bir alanı köşeden köşeye seçer. Shift ile tıklama maliyet tahminini gösterir STR_LANDSCAPING_TOOLTIP_RAISE_A_CORNER_OF_LAND :{BLACK}Arazinin bir köşesini yükselt. Sürükleme ilk seçilen köşeyi yükseltir ve seçilen araziyi yeni yüksekliğe çıkarır. Ctrl bir alanı köşeden köşeye seçer. Shift ile tıklama maliyet tahminini gösterir STR_LANDSCAPING_LEVEL_LAND_TOOLTIP :{BLACK}Bir alanı ilk seçilen köşenin yüksekliğine düzle. Ctrl ile alanı köşeden köşeye seçer. Shift ile tıklama maliyet tahminini gösterir -STR_LANDSCAPING_TOOLTIP_PURCHASE_LAND :{BLACK}Gelecekte kullanım için arazi satın al. Shift ile tıklama maliyet tahminini gösterir +STR_LANDSCAPING_TOOLTIP_PURCHASE_LAND :{BLACK}Gelecekte kullanım için arazi satın al. Ctrl alanı çapraz olarak seçer. Shift ile tıklama maliyet tahminini gösterir # Object construction window STR_OBJECT_BUILD_CAPTION :{WHITE}Nesne Seçimi -STR_OBJECT_BUILD_TOOLTIP :{BLACK}Yapılacak nesneyi seçin. Shift ile tıklama maliyet tahminini gösterir +STR_OBJECT_BUILD_TOOLTIP :{BLACK}Yapılacak nesneyi seçin. Ctrl alanı çapraz olarak seçer. Shift ile tıklama maliyet tahminini gösterir STR_OBJECT_BUILD_CLASS_TOOLTIP :{BLACK}İnşa edilecek nesnenin sınıfını seçin STR_OBJECT_BUILD_PREVIEW_TOOLTIP :{BLACK}Nesnenin önizlemesi STR_OBJECT_BUILD_SIZE :{BLACK}Boyut: {GOLD}{NUM} x {NUM} kare @@ -3328,15 +3341,15 @@ STR_NEWGRF_ERROR_MSG_FATAL :{RED}Ölümcül STR_NEWGRF_ERROR_FATAL_POPUP :{WHITE}Ölümcül bir NewGRF hatası oluştu:{}{STRING} STR_NEWGRF_ERROR_POPUP :{WHITE}NewGRF hatası oluştu:{}{STRING} STR_NEWGRF_ERROR_VERSION_NUMBER :{1:STRING} OpenTTD tarafından belirtilen TTDPatch sürümüyle çalışmayacaktır -STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:STRING}, TTD'nin {STRING} sürümü içindir -STR_NEWGRF_ERROR_UNSET_SWITCH :{1:STRING}, {STRING} ile kullanılmak için tasarlanmıştır -STR_NEWGRF_ERROR_INVALID_PARAMETER :{1:STRING} için geçersiz parametre: {STRING} ({NUM}) -STR_NEWGRF_ERROR_LOAD_BEFORE :{1:STRING} önce, {STRING} ondan sonra yüklenmeli -STR_NEWGRF_ERROR_LOAD_AFTER :{1:STRING} sonra, {STRING} ondan önce yüklenmeli -STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER :{1:STRING} OpenTTD {STRING} veya daha yüksek bir sürüm gerektirir +STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:STRING}, TTD'nin {2:STRING} sürümü içindir +STR_NEWGRF_ERROR_UNSET_SWITCH :{1:STRING}, {2:STRING} ile kullanılmak için tasarlanmıştır +STR_NEWGRF_ERROR_INVALID_PARAMETER :{1:STRING} için geçersiz parametre: {2:STRING} ({3:NUM}) +STR_NEWGRF_ERROR_LOAD_BEFORE :{1:STRING} önce, {2:STRING} ondan sonra yüklenmeli +STR_NEWGRF_ERROR_LOAD_AFTER :Önce {1:STRING}, sonra {2:STRING} yüklenmeli. +STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER :{1:STRING} OpenTTD {2:STRING} veya daha yüksek bir sürüm gerektirir STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE :GRF dosyası çeviri için yapılmış STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED :Çok fazla NewGRF yüklendi -STR_NEWGRF_ERROR_STATIC_GRF_CAUSES_DESYNC :{1:STRING} adlı NewGRF'yi {STRING} ile birlikte kullanmak senkronizasyon sorunu oluşturabilir +STR_NEWGRF_ERROR_STATIC_GRF_CAUSES_DESYNC :{1:STRING} adlı NewGRF'yi {2:STRING} ile birlikte kullanmak senkronizasyon sorunu oluşturabilir STR_NEWGRF_ERROR_UNEXPECTED_SPRITE :Beklenmedik nesne (nesne {3:NUM}) STR_NEWGRF_ERROR_UNKNOWN_PROPERTY :Bilinmeyen Action 0 özelliği {4:HEX} (nesne {3:NUM}) STR_NEWGRF_ERROR_INVALID_ID :Geçersiz ID kullanım girişimi (nesne {3:NUM}) @@ -3468,14 +3481,14 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Ayrıcalıklı STR_LOCAL_AUTHORITY_ACTION_BRIBE :Belediyeye rüşvet ver ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW} Müsteri çekmek için duvarlara poster yapıştır.{}Şehir merkezinin etrafında küçük bir çapta istasyon derecelendirmesinde geçici bir yükseltme sağlar.{}Fiyat: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW} Müsteri çekmek için radyoya reklam ver.{}Şehir merkezinin etrafında orta bir çapta istasyon derecelendirmesinde geçici bir yükseltme sağlar.{}Fiyat: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW} Müsteri çekmek için televizyona reklam ver.{}Şehir merkezinin etrafında büyük bir çapta istasyon derecelendirmesinde geçici bir yükseltme sağlar.{}Fiyat: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW} Yol tamirleri için belediyeye bağış yap.{}6 ay boyunca şehrin yolları kullanılamaz.{}Fiyat: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Şirket sahibinin heykelini dik.{}Şehirdeki istasyon derecelendirmesinde kalıcı bir yükseltme sağlar.{}Fiyatı: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}Şehirde ticari binaların yapımı için bağış yap.{}Bu kasabanın büyümesine geçici bir yükseltme sağlar.{}Fiyatı: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW} Bir yıllık ayrıcalıklı nakliyat haklarını satın al.{} Belediye, rakip istasyonların yolcu ve kargo taşımasına izin vermez.{} Fiyat: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Yakalanma riskini göze alarak belediyeye rüşvet ver.{}Fiyat: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW} Müsteri çekmek için küçük reklam kampanyası düzenle.{}Şehir merkezinin etrafında küçük bir alanda istasyon derecelendirmesinde geçici bir yükseltme sağlar.{}{POP_COLOUR}Fiyat: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{PUSH_COLOUR}{YELLOW} Müsteri çekmek için radyoya reklam ver.{}Şehir merkezinin etrafında orta bir çapta istasyon derecelendirmesinde geçici bir yükseltme sağlar.{}{POP_COLOUR}Fiyat: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{PUSH_COLOUR}{YELLOW} Müsteri çekmek için televizyona reklam ver.{}Şehir merkezinin etrafında büyük bir çapta istasyon derecelendirmesinde geçici bir yükseltme sağlar.{}{POP_COLOUR}Fiyat: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW} Yol tamirleri için belediyeye bağış yap.{}6 ay boyunca şehrin yollarında önemli aksamalara sebep olur.{}{POP_COLOUR}Fiyat: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{PUSH_COLOUR}{YELLOW}Şirket sahibinin heykelini dik.{}Şehirdeki istasyon derecelendirmesinde kalıcı bir yükseltme sağlar.{}{POP_COLOUR}Fiyatı: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{PUSH_COLOUR}{YELLOW}Şehirde ticari binaların yapımı için bağış yap.{}Bu kasabanın büyümesine geçici bir yükseltme sağlar.{}{POP_COLOUR}Fiyatı: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW} Bir yıllık ayrıcalıklı nakliyat haklarını satın al.{} Belediye, rakip istasyonların yolcu ve kargo taşımasına izin vermez.{}{POP_COLOUR} Fiyat: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}Yakalanırsan şiddetli bir ceza alma riskini göze alarak yerel yönetime bölge derecelendirmesini arttırmak için rüşvet ver.{}{POP_COLOUR}Fiyat: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} Hedefler @@ -3659,6 +3672,7 @@ STR_FINANCES_LOAN_TITLE :{WHITE}Kredi STR_FINANCES_INTEREST_RATE :{WHITE}Kredi Faizi: {BLACK}%{NUM} STR_FINANCES_MAX_LOAN :{WHITE}Azami Kredi: {BLACK}{CURRENCY_LONG} STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} +STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}{CURRENCY_LONG} Kredi Al STR_FINANCES_BORROW_TOOLTIP :{BLACK}Borcu arttır. Ctrl+Tıklama alınabilen en yüksek borcu alır STR_FINANCES_REPAY_BUTTON :{BLACK}{CURRENCY_LONG} Geri Öde @@ -3759,7 +3773,7 @@ STR_INDUSTRY_VIEW_PRODUCES_N_CARGO :{BLACK}Üretile STR_INDUSTRY_VIEW_CARGO_LIST_EXTENSION :, {STRING}{STRING} STR_INDUSTRY_VIEW_REQUIRES :{BLACK}Gereken: -STR_INDUSTRY_VIEW_ACCEPT_CARGO :{YELLOW}{STRING}{BLACK}{3:STRING} +STR_INDUSTRY_VIEW_ACCEPT_CARGO :{YELLOW}{0:STRING}{BLACK}{3:STRING} STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT :{YELLOW}{STRING}{BLACK}: {CARGO_SHORT} bekliyor{STRING} STR_CONFIG_GAME_PRODUCTION :{WHITE}Üretimi değiştir (8'in katı, 2040'a kadar) @@ -4053,7 +4067,7 @@ STR_ENGINE_PREVIEW_AIRCRAFT :uçak STR_ENGINE_PREVIEW_SHIP :gemi STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER :{BLACK}Fiyat: {CURRENCY_LONG} Ağırlık: {WEIGHT_SHORT}{}Hız: {VELOCITY} Güç: {POWER}{}İşletme Gideri: {CURRENCY_LONG}/yıl{}Kapasite: {CARGO_LONG} -STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}Maliyet: {CURRENCY_LONG} Ağırlık: {WEIGHT_SHORT}{}Hız: {VELOCITY} Güç: {POWER} Azami Tork: {6:FORCE}{}İşletme Gideri: {4:CURRENCY_LONG}/yıl{}Kapasite: {5:CARGO_LONG} +STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}Maliyet: {0:CURRENCY_LONG} Ağırlık: {1:WEIGHT_SHORT}{}Hız: {2:VELOCITY} Güç: {3:POWER} Azami Tork: {6:FORCE}{}İşletme Gideri: {4:CURRENCY_LONG}/yıl{}Kapasite: {5:CARGO_LONG} STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST :{BLACK}Maliyet: {CURRENCY_LONG} Azami Hız: {VELOCITY}{}Kapasite: {CARGO_LONG}{}İşletme Gideri: {CURRENCY_LONG}/yıl STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_CAP_RUNCOST :{BLACK}Maliyet: {CURRENCY_LONG} Azami Hız: {VELOCITY}{}Uçak türü: {STRING}{}Kapasite: {CARGO_LONG}, {CARGO_LONG}{}İşletme Gideri: {CURRENCY_LONG}/yıl STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_RUNCOST :{BLACK}Maliyet: {CURRENCY_LONG} Azami Hız: {VELOCITY}{}Uçak türü: {STRING}{}Kapasite: {CARGO_LONG}{}İşletme Gideri: {CURRENCY_LONG}//yıl @@ -4217,8 +4231,8 @@ STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Güvenil STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Üretim: {LTBLUE}{NUM}{BLACK} Değer: {LTBLUE}{CURRENCY_LONG} STR_VEHICLE_INFO_NO_CAPACITY :{BLACK}Kapasite: {LTBLUE}Yok{STRING} -STR_VEHICLE_INFO_CAPACITY :{BLACK}Kapasite: {LTBLUE}{CARGO_LONG}{3:STRING} -STR_VEHICLE_INFO_CAPACITY_MULT :{BLACK}Kapasite: {LTBLUE}{CARGO_LONG}{3:STRING} (x{4:NUM}) +STR_VEHICLE_INFO_CAPACITY :{BLACK}Kapasite: {LTBLUE}{0:CARGO_LONG}{3:STRING} +STR_VEHICLE_INFO_CAPACITY_MULT :{BLACK}Kapasite: {LTBLUE}{0:CARGO_LONG}{3:STRING} (x{4:NUM}) STR_VEHICLE_INFO_CAPACITY_CAPACITY :{BLACK}Kapasite: {LTBLUE}{CARGO_LONG}, {CARGO_LONG}{STRING} STR_VEHICLE_INFO_FEEDER_CARGO_VALUE :{BLACK}Aktarma Maliyeti: {LTBLUE}{CURRENCY_LONG} @@ -4561,6 +4575,7 @@ STR_AI_CONFIG_MOVE_DOWN :{BLACK}Aşağı STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}Seçilen YZ'yi listede aşağı taşı STR_AI_CONFIG_GAMESCRIPT :{SILVER}Oyun Betiği +STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}Parametreler STR_AI_CONFIG_AI :{SILVER}YZ'ler STR_AI_CONFIG_CHANGE_AI :{BLACK}YZ Seç @@ -4593,7 +4608,7 @@ STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Yüksekl STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Küçük harita ekran görüntüsü # AI Parameters -STR_AI_SETTINGS_CAPTION_AI :YZ +STR_AI_SETTINGS_CAPTION_AI :{WHITE}YZ Parametreleri STR_AI_SETTINGS_CLOSE :{BLACK}Kapat STR_AI_SETTINGS_RESET :{BLACK}Yeniden başlat STR_AI_SETTINGS_SETTING :{STRING}: {ORANGE}{STRING} @@ -4938,6 +4953,7 @@ STR_ERROR_OBJECT_IN_THE_WAY :{WHITE}Yolda ne STR_ERROR_COMPANY_HEADQUARTERS_IN :{WHITE}... yolda şirket binası var STR_ERROR_CAN_T_PURCHASE_THIS_LAND :{WHITE}Burası satın alınamaz... STR_ERROR_YOU_ALREADY_OWN_IT :{WHITE}... zaten senin! +STR_ERROR_BUILD_OBJECT_LIMIT_REACHED :{WHITE}... Nesne oluşturma sınırına ulaştınız # Group related errors STR_ERROR_GROUP_CAN_T_CREATE :{WHITE}Grup oluşturulamıyor... From e85d2603d9960f4fc2378945ca46b718f064c3cc Mon Sep 17 00:00:00 2001 From: translators Date: Wed, 23 Nov 2022 18:44:39 +0000 Subject: [PATCH 31/42] Update: Translations from eints italian: 27 changes by Rivarossi --- src/lang/italian.txt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/lang/italian.txt b/src/lang/italian.txt index 93a30bb36e..8c31257a8b 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -202,6 +202,12 @@ STR_UNITS_POWER_IMPERIAL :{COMMA}{NBSP}hp STR_UNITS_POWER_METRIC :{COMMA}{NBSP}hp STR_UNITS_POWER_SI :{COMMA}{NBSP}kW +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg +STR_UNITS_POWER_SI_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_SI :{DECIMAL}{NBSP}W/kg STR_UNITS_WEIGHT_SHORT_IMPERIAL :{COMMA}{NBSP}t STR_UNITS_WEIGHT_SHORT_METRIC :{COMMA}{NBSP}t @@ -397,6 +403,8 @@ STR_SCENEDIT_FILE_MENU_QUIT :Esci ###length 15 STR_SETTINGS_MENU_GAME_OPTIONS :Opzioni gioco STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :Impostazioni +STR_SETTINGS_MENU_AI_SETTINGS :Impostazioni IA +STR_SETTINGS_MENU_GAMESCRIPT_SETTINGS :Impostazioni script di gioco STR_SETTINGS_MENU_NEWGRF_SETTINGS :Impostazioni NewGRF STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Opzioni trasparenza STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Mostra nomi città @@ -999,8 +1007,12 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Selezion STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Driver attuale: {STRING} +STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Dimensione dell'interfaccia +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Trascinare il cursore per impostare le dimensioni dell'interfaccia. Tenere premuto Ctrl per una regolazione permanente +STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_4X :4x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafica @@ -2080,6 +2092,7 @@ STR_INTRO_HIGHSCORE :{BLACK}Punteggi STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Impostazioni STR_INTRO_NEWGRF_SETTINGS :{BLACK}Impostazioni NewGRF STR_INTRO_ONLINE_CONTENT :{BLACK}Contenuti online +STR_INTRO_AI_SETTINGS :{BLACK}Impostazioni IA STR_INTRO_QUIT :{BLACK}Esci STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Inizia una nuova partita. CTRL salta la configurazione della mappa. @@ -2099,6 +2112,8 @@ STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Mostra l STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Mostra le impostazioni STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Mostra le impostazioni NewGRF STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Controlla la disponibilità di contenuti nuovi o aggiornati da scaricare +STR_INTRO_TOOLTIP_AI_SETTINGS :{BLACK}Mostra impostazioni IA +STR_INTRO_TOOLTIP_GAMESCRIPT_SETTINGS :{BLACK}Visualizza le impostazioni dello script di gioco STR_INTRO_TOOLTIP_QUIT :{BLACK}Esci da OpenTTD STR_INTRO_BASESET :{BLACK}Nel pacchetto grafico di base attualmente selezionato mancano {NUM} sprite. È consigliabile controllare gli aggiornamenti del pacchetto. @@ -2612,6 +2627,8 @@ STR_LINKGRAPH_LEGEND_SATURATED :{TINY_FONT}{BLA STR_LINKGRAPH_LEGEND_OVERLOADED :{TINY_FONT}{BLACK}sovraccarica # Linkgraph tooltip +STR_LINKGRAPH_STATS_TOOLTIP_RETURN_EXTENSION :{}{CARGO_LONG} da trasportare indietro ({COMMA}% di capacità) +STR_LINKGRAPH_STATS_TOOLTIP_TIME_EXTENSION :{}tempo medio di percorrenza: {NUM}{NBSP}giorn{P "o" i} # Base for station construction window(s) STR_STATION_BUILD_COVERAGE_AREA_TITLE :{BLACK}Evidenzia area coperta @@ -2621,6 +2638,7 @@ STR_STATION_BUILD_COVERAGE_AREA_OFF_TOOLTIP :{BLACK}Non evid STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP :{BLACK}Evidenzia l'area di copertura del sito proposto STR_STATION_BUILD_ACCEPTS_CARGO :{BLACK}Accetta: {GOLD}{CARGO_LIST} STR_STATION_BUILD_SUPPLIES_CARGO :{BLACK}Fornisce: {GOLD}{CARGO_LIST} +STR_STATION_BUILD_INFRASTRUCTURE_COST :{BLACK}Costi di manutenzione: {GOLD}{CURRENCY_SHORT}/anno # Join station window STR_JOIN_STATION_CAPTION :{WHITE}Unisci stazione @@ -3160,6 +3178,8 @@ STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}Fiumi: STR_MAPGEN_SMOOTHNESS :{BLACK}Levigatezza: STR_MAPGEN_VARIETY :{BLACK}Varietà del terreno: STR_MAPGEN_GENERATE :{WHITE}Genera +STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}Impostazioni NewGRF +STR_MAPGEN_GS_SETTINGS_TOOLTIP :BLACK}Visualizza le impostazioni dello script di gioco ###length 21 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH :Inglesi (originali) @@ -3665,6 +3685,7 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}Navi STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}Int. sul prestito STR_FINANCES_SECTION_OTHER :{GOLD}Altro +STR_FINANCES_TOTAL_CAPTION :{WHITE}Totale STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} @@ -3896,6 +3917,7 @@ STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Autonomi STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}Tipo di aeromobile: {GOLD}{STRING} ###length 3 +STR_CARGO_TYPE_FILTER_NONE :Nessuno ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Elenco di selezione dei veicoli ferroviari - fare clic su un veicolo per informazioni. CTRL+clic mostra/nasconde il tipo di veicolo @@ -4224,6 +4246,7 @@ STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Peso: {L STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Peso: {LTBLUE}{WEIGHT_SHORT} {BLACK}Potenza: {LTBLUE}{POWER}{BLACK} Velocità max.: {LTBLUE}{VELOCITY} {BLACK}S.T. max.: {LTBLUE}{FORCE} STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Profitto quest'anno: {LTBLUE}{CURRENCY_LONG} (anno scorso: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Profitti anno corrente: {LTBLUE}{CURRENCY_LONG} (anno scorso: {CURRENCY_LONG}) {BLACK}Min. rendimento: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Affidabilità: {LTBLUE}{COMMA}% {BLACK}Guasti dall'ultima manutenzione: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Costruito nel: {LTBLUE}{NUM}{BLACK} Valore: {LTBLUE}{CURRENCY_LONG} @@ -4557,6 +4580,8 @@ STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Uno degl STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}La finestra di debug IA/Script è disponibile soltanto per il server # AI configuration window +STR_AI_CONFIG_CAPTION_AI :{WHITE}Configurazione IA +STR_AI_CONFIG_CAPTION_GAMESCRIPT :{WHITE}Configurazione script di gioco STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}Lista degli Script che saranno caricati nella prossima partita STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}Lista delle IA che saranno caricate nella prossima partita STR_AI_CONFIG_HUMAN_PLAYER :Giocatore umano @@ -4570,6 +4595,7 @@ STR_AI_CONFIG_MOVE_DOWN :{BLACK}Sposta g STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}Sposta l'IA selezionata più in basso nell'elenco STR_AI_CONFIG_GAMESCRIPT :{SILVER}Script +STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}Parametri STR_AI_CONFIG_AI :{SILVER}IA STR_AI_CONFIG_CHANGE_AI :IA @@ -4947,6 +4973,7 @@ STR_ERROR_OBJECT_IN_THE_WAY :{WHITE}Oggetto STR_ERROR_COMPANY_HEADQUARTERS_IN :{WHITE}... sede della compagnia di mezzo STR_ERROR_CAN_T_PURCHASE_THIS_LAND :{WHITE}Impossibile acquistare quest'area di terreno... STR_ERROR_YOU_ALREADY_OWN_IT :{WHITE}... già posseduto! +STR_ERROR_BUILD_OBJECT_LIMIT_REACHED :{WHITE}... limite di costruzione dell'oggetto raggiunto # Group related errors STR_ERROR_GROUP_CAN_T_CREATE :{WHITE}Impossibile creare il gruppo... From 53682b4b6b1c8695b1d2cf24df85acef662cc44f Mon Sep 17 00:00:00 2001 From: PeterN Date: Wed, 23 Nov 2022 21:01:09 +0000 Subject: [PATCH 32/42] Fix #10114: Wonky depot layout. (#10191) Depot lists internal layout was not handled well. This is improved by throwing more Rects at it: - Vehicle images are now be vertically centred in the rect. - Image clipping is relaxed to cover the rect, improving larger sprites. - Outline highlight is now aware of bevel thickness. --- src/aircraft_gui.cpp | 20 ++++---- src/depot_gui.cpp | 105 +++++++++++++++++++-------------------- src/newgrf_debug_gui.cpp | 2 +- src/roadveh_gui.cpp | 26 +++++----- src/ship_gui.cpp | 14 +++--- src/train_gui.cpp | 22 ++++---- src/vehicle_gui.cpp | 27 +++++----- src/vehicle_gui.h | 10 ++-- 8 files changed, 112 insertions(+), 114 deletions(-) diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp index 6704b7b80b..421ddaf33b 100644 --- a/src/aircraft_gui.cpp +++ b/src/aircraft_gui.cpp @@ -73,12 +73,10 @@ void DrawAircraftDetails(const Aircraft *v, const Rect &r) /** * Draws an image of an aircraft * @param v Front vehicle - * @param left The minimum horizontal position - * @param right The maximum horizontal position - * @param y Vertical position to draw at + * @param r Rect to draw at * @param selection Selected vehicle to draw a frame around */ -void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type) +void DrawAircraftImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type) { bool rtl = _current_text_dir == TD_RTL; @@ -90,25 +88,27 @@ void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID s int width = UnScaleGUI(rect.Width()); int x_offs = UnScaleGUI(rect.left); - int x = rtl ? right - width - x_offs : left - x_offs; + int x = rtl ? r.right - width - x_offs : r.left - x_offs; + /* This magic -1 offset is related to the sprite_y_offsets in build_vehicle_gui.cpp */ + int y = ScaleSpriteTrad(-1) + CenterBounds(r.top, r.bottom, 0); bool helicopter = v->subtype == AIR_HELICOPTER; - int y_offs = ScaleSpriteTrad(10); int heli_offs = 0; PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v); - seq.Draw(x, y + y_offs, pal, (v->vehstatus & VS_CRASHED) != 0); + seq.Draw(x, y, pal, (v->vehstatus & VS_CRASHED) != 0); if (helicopter) { const Aircraft *a = Aircraft::From(v); VehicleSpriteSeq rotor_seq; GetCustomRotorSprite(a, image_type, &rotor_seq); if (!rotor_seq.IsValid()) rotor_seq.Set(SPR_ROTOR_STOPPED); heli_offs = ScaleSpriteTrad(5); - rotor_seq.Draw(x, y + y_offs - heli_offs, PAL_NONE, false); + rotor_seq.Draw(x, y - heli_offs, PAL_NONE, false); } if (v->index == selection) { x += x_offs; - y += UnScaleGUI(rect.top) + y_offs - heli_offs; - DrawFrameRect(x - 1, y - 1, x + width + 1, y + UnScaleGUI(rect.Height()) + heli_offs + 1, COLOUR_WHITE, FR_BORDERONLY); + y += UnScaleGUI(rect.top) - heli_offs; + Rect hr = {x, y, x + width - 1, y + UnScaleGUI(rect.Height()) + heli_offs - 1}; + DrawFrameRect(hr.Expand(WidgetDimensions::scaled.bevel), COLOUR_WHITE, FR_BORDERONLY); } } diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 34e9c0a3a7..dd87a7929f 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -29,6 +29,7 @@ #include "depot_cmd.h" #include "train_cmd.h" #include "vehicle_cmd.h" +#include "core/geometry_func.hpp" #include "widgets/depot_widget.h" @@ -303,18 +304,15 @@ struct DepotWindow : Window { /** * Draw a vehicle in the depot window in the box with the top left corner at x,y. * @param v Vehicle to draw. - * @param left Left side of the box to draw in. - * @param right Right side of the box to draw in. - * @param y Top of the box to draw in. + * @param r Rect to draw in. */ - void DrawVehicleInDepot(const Vehicle *v, int left, int right, int y) const + void DrawVehicleInDepot(const Vehicle *v, const Rect &r) const { bool free_wagon = false; - int sprite_y = y + (this->resize.step_height - ScaleSpriteTrad(GetVehicleHeight(v->type))) / 2; bool rtl = _current_text_dir == TD_RTL; - int image_left = rtl ? left + this->count_width : left + this->header_width; - int image_right = rtl ? right - this->header_width : right - this->count_width; + Rect text = r.Shrink(RectPadding::zero, WidgetDimensions::scaled.matrix); /* Ract for text elements, horizontal is already applied. */ + Rect image = r.Indent(this->header_width, rtl).Indent(this->count_width, !rtl); /* Rect for vehicle images */ switch (v->type) { case VEH_TRAIN: { @@ -325,42 +323,42 @@ struct DepotWindow : Window { ScaleSpriteTrad(_consistent_train_width != 0 ? _consistent_train_width : TRAININFO_DEFAULT_VEHICLE_WIDTH) : 0; - DrawTrainImage(u, image_left + (rtl ? 0 : x_space), image_right - (rtl ? x_space : 0), sprite_y, - this->sel, EIT_IN_DEPOT, free_wagon ? 0 : this->hscroll->GetPosition(), this->vehicle_over); + DrawTrainImage(u, image.Indent(x_space, rtl), this->sel, EIT_IN_DEPOT, free_wagon ? 0 : this->hscroll->GetPosition(), this->vehicle_over); /* Length of consist in tiles with 1 fractional digit (rounded up) */ SetDParam(0, CeilDiv(u->gcache.cached_total_length * 10, TILE_SIZE)); SetDParam(1, 1); - DrawString(rtl ? left : right - this->count_width, rtl ? left + this->count_width : right, y + (this->resize.step_height - FONT_HEIGHT_SMALL) / 2, STR_TINY_BLACK_DECIMAL, TC_FROMSTRING, SA_RIGHT); // Draw the counter + Rect count = text.WithWidth(this->count_width - WidgetDimensions::scaled.hsep_normal, !rtl); + DrawString(count.left, count.right, count.bottom - FONT_HEIGHT_SMALL + 1, STR_TINY_BLACK_DECIMAL, TC_FROMSTRING, SA_RIGHT); // Draw the counter break; } - case VEH_ROAD: DrawRoadVehImage( v, image_left, image_right, sprite_y, this->sel, EIT_IN_DEPOT); break; - case VEH_SHIP: DrawShipImage( v, image_left, image_right, sprite_y, this->sel, EIT_IN_DEPOT); break; - case VEH_AIRCRAFT: DrawAircraftImage(v, image_left, image_right, sprite_y, this->sel, EIT_IN_DEPOT); break; + case VEH_ROAD: DrawRoadVehImage( v, image, this->sel, EIT_IN_DEPOT); break; + case VEH_SHIP: DrawShipImage( v, image, this->sel, EIT_IN_DEPOT); break; + case VEH_AIRCRAFT: DrawAircraftImage(v, image, this->sel, EIT_IN_DEPOT); break; default: NOT_REACHED(); } uint diff_x, diff_y; if (v->IsGroundVehicle()) { /* Arrange unitnumber and flag horizontally */ - diff_x = this->flag_width; - diff_y = (this->resize.step_height - this->flag_height) / 2; + diff_x = this->flag_size.width + WidgetDimensions::scaled.hsep_normal; + diff_y = WidgetDimensions::scaled.matrix.top; } else { /* Arrange unitnumber and flag vertically */ diff_x = 0; - diff_y = FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; + diff_y = WidgetDimensions::scaled.matrix.top + FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal; } - int text_left = rtl ? right - this->header_width - 1 : left + diff_x; - int text_right = rtl ? right - diff_x : left + this->header_width - 1; + text = text.WithWidth(this->header_width - WidgetDimensions::scaled.hsep_normal, rtl).WithHeight(FONT_HEIGHT_NORMAL).Indent(diff_x, rtl); if (free_wagon) { - DrawString(text_left, text_right, y + WidgetDimensions::scaled.framerect.top, STR_DEPOT_NO_ENGINE); + DrawString(text, STR_DEPOT_NO_ENGINE); } else { - DrawSprite((v->vehstatus & VS_STOPPED) ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, PAL_NONE, rtl ? right - this->flag_width : left + WidgetDimensions::scaled.framerect.left, y + diff_y); + Rect flag = r.WithWidth(this->flag_size.width, rtl).WithHeight(this->flag_size.height).Translate(0, diff_y); + DrawSpriteIgnorePadding((v->vehstatus & VS_STOPPED) ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, PAL_NONE, flag, false, SA_CENTER); SetDParam(0, v->unitnumber); - DrawString(text_left, text_right, y + WidgetDimensions::scaled.framerect.top, (uint16)(v->max_age - DAYS_IN_LEAP_YEAR) >= v->age ? STR_BLACK_COMMA : STR_RED_COMMA); + DrawString(text, (uint16)(v->max_age - DAYS_IN_LEAP_YEAR) >= v->age ? STR_BLACK_COMMA : STR_RED_COMMA); } } @@ -373,7 +371,10 @@ struct DepotWindow : Window { /* Set the row and number of boxes in each row based on the number of boxes drawn in the matrix */ const NWidgetCore *wid = this->GetWidget(WID_D_MATRIX); - Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); + /* Set up rect for each cell */ + Rect ir = r.WithHeight(this->resize.step_height); + if (this->num_columns != 1) ir = ir.WithWidth(this->resize.step_width, rtl); + ir = ir.Shrink(WidgetDimensions::scaled.framerect, RectPadding::zero); /* Draw vertical separators at whole tiles. * This only works in two cases: @@ -383,15 +384,14 @@ struct DepotWindow : Window { if (this->type == VEH_TRAIN && _consistent_train_width != 0) { int w = ScaleSpriteTrad(2 * _consistent_train_width); int col = _colour_gradient[wid->colour][4]; - int image_left = rtl ? ir.left + this->count_width : ir.left + this->header_width; - int image_right = rtl ? ir.right - this->header_width : ir.right - this->count_width; + Rect image = ir.Indent(this->header_width, rtl).Indent(this->count_width, !rtl); int first_line = w + (-this->hscroll->GetPosition()) % w; if (rtl) { - for (int x = image_right - first_line; x >= image_left; x -= w) { + for (int x = image.right - first_line; x >= image.left; x -= w) { GfxDrawLine(x, r.top, x, r.bottom, col, ScaleGUITrad(1), ScaleGUITrad(3)); } } else { - for (int x = image_left + first_line; x <= image_right; x += w) { + for (int x = image.left + first_line; x <= image.right; x += w) { GfxDrawLine(x, r.top, x, r.bottom, col, ScaleGUITrad(1), ScaleGUITrad(3)); } } @@ -401,26 +401,22 @@ struct DepotWindow : Window { uint num = this->vscroll->GetPosition() * this->num_columns; uint maxval = static_cast(std::min(this->vehicle_list.size(), num + (rows_in_display * this->num_columns))); - int y; - for (y = r.top; num < maxval; y += this->resize.step_height) { // Draw the rows + for (; num < maxval; ir = ir.Translate(0, this->resize.step_height)) { // Draw the rows + Rect cell = ir; /* Keep track of horizontal cells */ for (uint i = 0; i < this->num_columns && num < maxval; i++, num++) { /* Draw all vehicles in the current row */ const Vehicle *v = this->vehicle_list[num]; - if (this->num_columns == 1) { - this->DrawVehicleInDepot(v, ir.left, ir.right, y); - } else { - int x = ir.left + (rtl ? (this->num_columns - i - 1) : i) * this->resize.step_width; - this->DrawVehicleInDepot(v, x, x + this->resize.step_width - 1 - WidgetDimensions::scaled.framerect.Horizontal(), y); - } + this->DrawVehicleInDepot(v, cell); + cell = cell.Translate(rtl ? -(int)this->resize.step_width : (int)this->resize.step_width, 0); } } maxval = static_cast(std::min(this->vehicle_list.size() + this->wagon_list.size(), (this->vscroll->GetPosition() * this->num_columns) + (rows_in_display * this->num_columns))); /* Draw the train wagons without an engine in front. */ - for (; num < maxval; num++, y += this->resize.step_height) { + for (; num < maxval; num++, ir = ir.Translate(0, this->resize.step_height)) { const Vehicle *v = this->wagon_list[num - this->vehicle_list.size()]; - this->DrawVehicleInDepot(v, ir.left, ir.right, y); + this->DrawVehicleInDepot(v, ir); } } @@ -503,12 +499,12 @@ struct DepotWindow : Window { FALLTHROUGH; case VEH_ROAD: - if (xm <= this->flag_width) return MODE_START_STOP; + if (xm <= this->flag_size.width) return MODE_START_STOP; break; case VEH_SHIP: case VEH_AIRCRAFT: - if (xm <= this->flag_width && ym >= (uint)(FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal)) return MODE_START_STOP; + if (xm <= this->flag_size.width && ym >= (uint)(FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal)) return MODE_START_STOP; break; default: NOT_REACHED(); @@ -645,10 +641,16 @@ struct DepotWindow : Window { } } - uint count_width; - uint header_width; - uint flag_width; - uint flag_height; + uint count_width; ///< Width of length count, including separator. + uint header_width; ///< Width of unit number and flag, including separator. + Dimension flag_size; ///< Size of start/stop flag. + VehicleCellSize cell_size; ///< Vehicle sprite cell size. + + void OnInit() override + { + this->cell_size = GetVehicleImageCellSize(this->type, EIT_IN_DEPOT); + this->flag_size = maxdim(GetScaledSpriteSize(SPR_FLAG_VEH_STOPPED), GetScaledSpriteSize(SPR_FLAG_VEH_RUNNING)); + } void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override { @@ -659,33 +661,30 @@ struct DepotWindow : Window { if (this->type == VEH_TRAIN) { SetDParamMaxValue(0, 1000, 0, FS_SMALL); SetDParam(1, 1); - this->count_width = GetStringBoundingBox(STR_TINY_BLACK_DECIMAL).width + WidgetDimensions::scaled.framerect.Horizontal(); + this->count_width = GetStringBoundingBox(STR_TINY_BLACK_DECIMAL).width + WidgetDimensions::scaled.hsep_normal; } else { this->count_width = 0; } SetDParamMaxDigits(0, this->unitnumber_digits); Dimension unumber = GetStringBoundingBox(STR_BLACK_COMMA); - const Sprite *spr = GetSprite(SPR_FLAG_VEH_STOPPED, ST_NORMAL); - this->flag_width = UnScaleGUI(spr->width) + WidgetDimensions::scaled.framerect.right; - this->flag_height = UnScaleGUI(spr->height); if (this->type == VEH_TRAIN || this->type == VEH_ROAD) { - min_height = std::max(unumber.height + WidgetDimensions::scaled.matrix.top, UnScaleGUI(spr->height)); - this->header_width = unumber.width + this->flag_width + WidgetDimensions::scaled.framerect.left; + min_height = std::max(unumber.height, this->flag_size.height); + this->header_width = unumber.width + WidgetDimensions::scaled.hsep_normal + this->flag_size.width + WidgetDimensions::scaled.hsep_normal; } else { - min_height = unumber.height + UnScaleGUI(spr->height) + padding.height + WidgetDimensions::scaled.vsep_normal; - this->header_width = std::max(unumber.width, this->flag_width) + WidgetDimensions::scaled.framerect.right; + min_height = unumber.height + WidgetDimensions::scaled.vsep_normal + this->flag_size.height; + this->header_width = std::max(unumber.width, this->flag_size.width) + WidgetDimensions::scaled.hsep_normal; } - int base_width = this->count_width + this->header_width; + int base_width = this->count_width + this->header_width + padding.width; - resize->height = std::max(GetVehicleImageCellSize(this->type, EIT_IN_DEPOT).height, min_height); + resize->height = std::max(this->cell_size.height, min_height + padding.height); if (this->type == VEH_TRAIN) { resize->width = 1; size->width = base_width + 2 * ScaleSpriteTrad(29); // about 2 parts size->height = resize->height * 6; } else { - resize->width = base_width + GetVehicleImageCellSize(this->type, EIT_IN_DEPOT).extend_left + GetVehicleImageCellSize(this->type, EIT_IN_DEPOT).extend_right; + resize->width = base_width + this->cell_size.extend_left + this->cell_size.extend_right; size->width = resize->width * (this->type == VEH_ROAD ? 5 : 3); size->height = resize->height * (this->type == VEH_ROAD ? 5 : 3); } diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index 91d2c8de84..e5f566f3a2 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -434,7 +434,7 @@ struct NewGRFInspectWindow : Window { GrfSpecFeature f = GetFeatureNum(this->window_number); int h = GetVehicleImageCellSize((VehicleType)(VEH_TRAIN + (f - GSF_TRAINS)), EIT_IN_DEPOT).height; int y = CenterBounds(br.top, br.bottom, h); - DrawVehicleImage(v->First(), br.left, br.right, y + 1, INVALID_VEHICLE, EIT_IN_DETAILS, skip); + DrawVehicleImage(v->First(), br, INVALID_VEHICLE, EIT_IN_DETAILS, skip); /* Highlight the articulated part (this is different to the whole-vehicle highlighting of DrawVehicleImage */ if (_current_text_dir == TD_RTL) { diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp index ca3bbe03f6..8b3ee04775 100644 --- a/src/roadveh_gui.cpp +++ b/src/roadveh_gui.cpp @@ -120,28 +120,28 @@ void DrawRoadVehDetails(const Vehicle *v, const Rect &r) /** * Draws an image of a road vehicle chain * @param v Front vehicle - * @param left The minimum horizontal position - * @param right The maximum horizontal position - * @param y Vertical position to draw at + * @param r Rect to draw at * @param selection Selected vehicle to draw a frame around * @param skip Number of pixels to skip at the front (for scrolling) */ -void DrawRoadVehImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type, int skip) +void DrawRoadVehImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type, int skip) { bool rtl = _current_text_dir == TD_RTL; Direction dir = rtl ? DIR_E : DIR_W; const RoadVehicle *u = RoadVehicle::From(v); DrawPixelInfo tmp_dpi, *old_dpi; - int max_width = right - left + 1; + int max_width = r.Width(); - if (!FillDrawPixelInfo(&tmp_dpi, left, y, max_width, ScaleSpriteTrad(14))) return; + if (!FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) return; old_dpi = _cur_dpi; _cur_dpi = &tmp_dpi; int px = rtl ? max_width + skip : -skip; - for (; u != nullptr && (rtl ? px > 0 : px < max_width); u = u->Next()) { + int y = r.Height() / 2; + for (; u != nullptr && (rtl ? px > 0 : px < max_width); u = u->Next()) + { Point offset; int width = u->GetDisplayImageWidth(&offset); @@ -149,15 +149,17 @@ void DrawRoadVehImage(const Vehicle *v, int left, int right, int y, VehicleID se PaletteID pal = (u->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(u); VehicleSpriteSeq seq; u->GetImage(dir, image_type, &seq); - seq.Draw(px + (rtl ? -offset.x : offset.x), ScaleSpriteTrad(6) + offset.y, pal, (u->vehstatus & VS_CRASHED) != 0); + seq.Draw(px + (rtl ? -offset.x : offset.x), y + offset.y, pal, (u->vehstatus & VS_CRASHED) != 0); } px += rtl ? -width : width; } - if (v->index == selection) { - DrawFrameRect((rtl ? px : 0), 0, (rtl ? max_width : px) - 1, ScaleSpriteTrad(13) - 1, COLOUR_WHITE, FR_BORDERONLY); - } - _cur_dpi = old_dpi; + + if (v->index == selection) { + int height = ScaleSpriteTrad(12); + Rect hr = {(rtl ? px : 0), 0, (rtl ? max_width : px) - 1, height - 1}; + DrawFrameRect(hr.Translate(r.left, CenterBounds(r.top, r.bottom, height)).Expand(WidgetDimensions::scaled.bevel), COLOUR_WHITE, FR_BORDERONLY); + } } diff --git a/src/ship_gui.cpp b/src/ship_gui.cpp index a6d0ff06c8..93c4a4a9c5 100644 --- a/src/ship_gui.cpp +++ b/src/ship_gui.cpp @@ -24,12 +24,10 @@ /** * Draws an image of a ship * @param v Front vehicle - * @param left The minimum horizontal position - * @param right The maximum horizontal position - * @param y Vertical position to draw at + * @param r Rect to draw at * @param selection Selected vehicle to draw a frame around */ -void DrawShipImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type) +void DrawShipImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type) { bool rtl = _current_text_dir == TD_RTL; @@ -41,15 +39,17 @@ void DrawShipImage(const Vehicle *v, int left, int right, int y, VehicleID selec int width = UnScaleGUI(rect.Width()); int x_offs = UnScaleGUI(rect.left); - int x = rtl ? right - width - x_offs : left - x_offs; + int x = rtl ? r.right - width - x_offs : r.left - x_offs; + /* This magic -1 offset is related to the sprite_y_offsets in build_vehicle_gui.cpp */ + int y = ScaleSpriteTrad(-1) + CenterBounds(r.top, r.bottom, 0); - y += ScaleSpriteTrad(10); seq.Draw(x, y, GetVehiclePalette(v), false); if (v->index == selection) { x += x_offs; y += UnScaleGUI(rect.top); - DrawFrameRect(x - 1, y - 1, x + width + 1, y + UnScaleGUI(rect.Height()) + 1, COLOUR_WHITE, FR_BORDERONLY); + Rect hr = {x, y, x + width - 1, y + UnScaleGUI(rect.Height()) - 1}; + DrawFrameRect(hr.Expand(WidgetDimensions::scaled.bevel), COLOUR_WHITE, FR_BORDERONLY); } } diff --git a/src/train_gui.cpp b/src/train_gui.cpp index d13bbb051e..d06c9f6c4a 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -82,14 +82,12 @@ static int HighlightDragPosition(int px, int max_width, VehicleID selection, boo /** * Draws an image of a whole train * @param v Front vehicle - * @param left The minimum horizontal position - * @param right The maximum horizontal position - * @param y Vertical position to draw at + * @param r Rect to draw at * @param selection Selected vehicle to draw a frame around * @param skip Number of pixels to skip at the front (for scrolling) * @param drag_dest The vehicle another one is dragged over, \c INVALID_VEHICLE if none. */ -void DrawTrainImage(const Train *v, int left, int right, int y, VehicleID selection, EngineImageType image_type, int skip, VehicleID drag_dest) +void DrawTrainImage(const Train *v, const Rect &r, VehicleID selection, EngineImageType image_type, int skip, VehicleID drag_dest) { bool rtl = _current_text_dir == TD_RTL; Direction dir = rtl ? DIR_E : DIR_W; @@ -98,15 +96,15 @@ void DrawTrainImage(const Train *v, int left, int right, int y, VehicleID select /* Position of highlight box */ int highlight_l = 0; int highlight_r = 0; - int max_width = right - left + 1; - int height = ScaleSpriteTrad(14); + int max_width = r.Width(); - if (!FillDrawPixelInfo(&tmp_dpi, left, y, max_width, height)) return; + if (!FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) return; old_dpi = _cur_dpi; _cur_dpi = &tmp_dpi; int px = rtl ? max_width + skip : -skip; + int y = r.Height() / 2; bool sel_articulated = false; bool dragging = (drag_dest != INVALID_VEHICLE); bool drag_at_end_of_train = (drag_dest == v->index); // Head index is used to mark dragging at end of train. @@ -124,7 +122,7 @@ void DrawTrainImage(const Train *v, int left, int right, int y, VehicleID select PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v); VehicleSpriteSeq seq; v->GetImage(dir, image_type, &seq); - seq.Draw(px + (rtl ? -offset.x : offset.x), height / 2 + offset.y, pal, (v->vehstatus & VS_CRASHED) != 0); + seq.Draw(px + (rtl ? -offset.x : offset.x), y + offset.y, pal, (v->vehstatus & VS_CRASHED) != 0); } if (!v->IsArticulatedPart()) sel_articulated = false; @@ -150,13 +148,15 @@ void DrawTrainImage(const Train *v, int left, int right, int y, VehicleID select HighlightDragPosition(px, max_width, selection, _cursor.vehchain); } + _cur_dpi = old_dpi; + if (highlight_l != highlight_r) { /* Draw the highlight. Now done after drawing all the engines, as * the next engine after the highlight could overlap it. */ - DrawFrameRect(highlight_l, 0, highlight_r, height - 1, COLOUR_WHITE, FR_BORDERONLY); + int height = ScaleSpriteTrad(12); + Rect hr = {highlight_l, 0, highlight_r, height - 1}; + DrawFrameRect(hr.Translate(r.left, CenterBounds(r.top, r.bottom, height)).Expand(WidgetDimensions::scaled.bevel), COLOUR_WHITE, FR_BORDERONLY); } - - _cur_dpi = old_dpi; } /** Helper struct for the cargo details information */ diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index ee15c21bcc..3f3a761747 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -933,8 +933,8 @@ struct RefitWindow : public Window { switch (widget) { case WID_VR_VEHICLE_PANEL_DISPLAY: { Vehicle *v = Vehicle::Get(this->window_number); - DrawVehicleImage(v, this->sprite_left + WidgetDimensions::scaled.framerect.left, this->sprite_right - WidgetDimensions::scaled.framerect.right, - r.top + WidgetDimensions::scaled.framerect.top, INVALID_VEHICLE, EIT_IN_DETAILS, this->hscroll != nullptr ? this->hscroll->GetPosition() : 0); + DrawVehicleImage(v, {this->sprite_left + WidgetDimensions::scaled.framerect.left, r.top, this->sprite_right - WidgetDimensions::scaled.framerect.right, r.bottom}, + INVALID_VEHICLE, EIT_IN_DETAILS, this->hscroll != nullptr ? this->hscroll->GetPosition() : 0); /* Highlight selected vehicles. */ if (this->order != INVALID_VEH_ORDER_ID) break; @@ -1590,19 +1590,17 @@ static void DrawSmallOrderList(const Order *order, int left, int right, int y, u /** * Draws an image of a vehicle chain * @param v Front vehicle - * @param left The minimum horizontal position - * @param right The maximum horizontal position - * @param y Vertical position to draw at + * @param r Rect to draw at * @param selection Selected vehicle to draw a frame around * @param skip Number of pixels to skip at the front (for scrolling) */ -void DrawVehicleImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type, int skip) +void DrawVehicleImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type, int skip) { switch (v->type) { - case VEH_TRAIN: DrawTrainImage(Train::From(v), left, right, y, selection, image_type, skip); break; - case VEH_ROAD: DrawRoadVehImage(v, left, right, y, selection, image_type, skip); break; - case VEH_SHIP: DrawShipImage(v, left, right, y, selection, image_type); break; - case VEH_AIRCRAFT: DrawAircraftImage(v, left, right, y, selection, image_type); break; + case VEH_TRAIN: DrawTrainImage(Train::From(v), r, selection, image_type, skip); break; + case VEH_ROAD: DrawRoadVehImage(v, r, selection, image_type, skip); break; + case VEH_SHIP: DrawShipImage(v, r, selection, image_type); break; + case VEH_AIRCRAFT: DrawAircraftImage(v, r, selection, image_type); break; default: NOT_REACHED(); } } @@ -1647,7 +1645,6 @@ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int int image_left = (rtl && show_orderlist) ? olr.right : tr.left; int image_right = (!rtl && show_orderlist) ? olr.left : tr.right; - int image_height = ScaleSpriteTrad(GetVehicleHeight(this->vli.vtype)); int vehicle_button_x = rtl ? ir.right - profit.width : ir.left; @@ -1670,7 +1667,7 @@ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int DrawSprite(SPR_WARNING_SIGN, PAL_NONE, vehicle_button_x, ir.top + FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal + profit.height); } - DrawVehicleImage(v, image_left, image_right, CenterBounds(ir.top, ir.bottom, image_height), selected_vehicle, EIT_IN_LIST, 0); + DrawVehicleImage(v, {image_left, ir.top, image_right, ir.bottom}, selected_vehicle, EIT_IN_LIST, 0); if (!v->name.empty()) { /* The vehicle got a name so we will print it */ @@ -1701,7 +1698,7 @@ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int for (int i = 0; i < static_cast(vehgroup.NumVehicles()); ++i) { if (image_left + WidgetDimensions::scaled.hsep_wide * i >= image_right) break; // Break if there is no more space to draw any more vehicles anyway. - DrawVehicleImage(vehgroup.vehicles_begin[i], image_left + WidgetDimensions::scaled.hsep_wide * i, image_right, CenterBounds(ir.top, ir.bottom, image_height), selected_vehicle, EIT_IN_LIST, 0); + DrawVehicleImage(vehgroup.vehicles_begin[i], {image_left + WidgetDimensions::scaled.hsep_wide * i, ir.top, image_right, ir.bottom}, selected_vehicle, EIT_IN_LIST, 0); } if (show_orderlist) DrawSmallOrderList((vehgroup.vehicles_begin[0])->GetFirstOrder(), olr.left, olr.right, ir.top, this->order_arrow_width); @@ -2501,10 +2498,10 @@ struct VehicleDetailsWindow : Window { /* Articulated road vehicles use a complete line. */ if (v->type == VEH_ROAD && v->HasArticulatedPart()) { - DrawVehicleImage(v, tr.left, tr.right, tr.top, INVALID_VEHICLE, EIT_IN_DETAILS, 0); + DrawVehicleImage(v, tr, INVALID_VEHICLE, EIT_IN_DETAILS, 0); } else { Rect sr = tr.WithWidth(sprite_width, rtl); - DrawVehicleImage(v, sr.left, sr.right, sr.top, INVALID_VEHICLE, EIT_IN_DETAILS, 0); + DrawVehicleImage(v, sr, INVALID_VEHICLE, EIT_IN_DETAILS, 0); } DrawVehicleDetails(v, tr.Indent(sprite_width, rtl), 0, 0, this->tab); diff --git a/src/vehicle_gui.h b/src/vehicle_gui.h index f4c044393a..4a750c0477 100644 --- a/src/vehicle_gui.h +++ b/src/vehicle_gui.h @@ -45,10 +45,10 @@ struct TestedEngineDetails { int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number, TestedEngineDetails &te); -void DrawTrainImage(const Train *v, int left, int right, int y, VehicleID selection, EngineImageType image_type, int skip, VehicleID drag_dest = INVALID_VEHICLE); -void DrawRoadVehImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type, int skip = 0); -void DrawShipImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type); -void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type); +void DrawTrainImage(const Train *v, const Rect &r, VehicleID selection, EngineImageType image_type, int skip, VehicleID drag_dest = INVALID_VEHICLE); +void DrawRoadVehImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type, int skip = 0); +void DrawShipImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type); +void DrawAircraftImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type); void ShowBuildVehicleWindow(TileIndex tile, VehicleType type); @@ -106,7 +106,7 @@ void StartStopVehicle(const Vehicle *v, bool texteffect); Vehicle *CheckClickOnVehicle(const struct Viewport *vp, int x, int y); -void DrawVehicleImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type, int skip); +void DrawVehicleImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type, int skip); void SetMouseCursorVehicle(const Vehicle *v, EngineImageType image_type); #endif /* VEHICLE_GUI_H */ From 0fc7cdb1e4252f47846e57bb16acc33e1b995c6c Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Wed, 23 Nov 2022 15:48:19 -0700 Subject: [PATCH 33/42] Change: Allow building canal by area outside editor (#10173) --- src/dock_gui.cpp | 2 +- src/water_cmd.cpp | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 0245e51f80..c8f0ad46a3 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -192,7 +192,7 @@ struct BuildDocksToolbarWindow : Window { { switch (this->last_clicked_widget) { case WID_DT_CANAL: // Build canal button - VpStartPlaceSizing(tile, (_game_mode == GM_EDITOR) ? VPM_X_AND_Y : VPM_X_OR_Y, DDSP_CREATE_WATER); + VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_WATER); break; case WID_DT_LOCK: // Build lock button diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 4f3ed30620..44be4dc367 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -443,12 +443,6 @@ CommandCost CmdBuildCanal(DoCommandFlag flags, TileIndex tile, TileIndex start_t /* Outside of the editor you can only build canals, not oceans */ if (wc != WATER_CLASS_CANAL && _game_mode != GM_EDITOR) return CMD_ERROR; - /* Outside the editor you can only drag canals, and not areas */ - if (_game_mode != GM_EDITOR) { - TileArea ta(tile, start_tile); - if (ta.w != 1 && ta.h != 1) return CMD_ERROR; - } - CommandCost cost(EXPENSES_CONSTRUCTION); std::unique_ptr iter; From d780ca74edfef639fc3b66ded551371f31a00a3d Mon Sep 17 00:00:00 2001 From: translators Date: Thu, 24 Nov 2022 18:46:20 +0000 Subject: [PATCH 34/42] Update: Translations from eints italian: 50 changes by Rivarossi --- src/lang/italian.txt | 80 +++++++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 30 deletions(-) diff --git a/src/lang/italian.txt b/src/lang/italian.txt index 8c31257a8b..7d3ded47d3 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -202,7 +202,10 @@ STR_UNITS_POWER_IMPERIAL :{COMMA}{NBSP}hp STR_UNITS_POWER_METRIC :{COMMA}{NBSP}hp STR_UNITS_POWER_SI :{COMMA}{NBSP}kW +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}hp/t STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg +STR_UNITS_POWER_METRIC_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}hp/t STR_UNITS_POWER_METRIC_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t STR_UNITS_POWER_METRIC_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg STR_UNITS_POWER_SI_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}kW/t @@ -387,7 +390,7 @@ STR_SCENEDIT_TOOLBAR_ROAD_CONSTRUCTION :{BLACK}Costruzi STR_SCENEDIT_TOOLBAR_TRAM_CONSTRUCTION :{BLACK}Costruzione tranvie STR_SCENEDIT_TOOLBAR_PLANT_TREES :{BLACK}Pianta alberi. MAIUSC alterna fra costruzione e stima dei costi STR_SCENEDIT_TOOLBAR_PLACE_SIGN :{BLACK}Posiziona cartello -STR_SCENEDIT_TOOLBAR_PLACE_OBJECT :{BLACK}Posiziona oggetto. MAIUSC alterna fra costruzione e stima dei costi +STR_SCENEDIT_TOOLBAR_PLACE_OBJECT :{BLACK}Posizionare l'oggetto. Ctrl seleziona l'area in diagonale. Maiuscole alterna la costruzione/visualizzazione della stima dei costi. # Scenario editor file menu ###length 7 @@ -1009,10 +1012,17 @@ STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Driver a STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Dimensione dell'interfaccia STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Trascinare il cursore per impostare le dimensioni dell'interfaccia. Tenere premuto Ctrl per una regolazione permanente +STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Rileva automaticamente le dimensioni +STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Seleziona questa casella per rilevare automaticamente le dimensioni dell'interfaccia +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Scala smussature +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Seleziona questa casella per ridimensionare le smussature in base alle dimensioni dell'interfaccia STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_2X :2x +STR_GAME_OPTIONS_GUI_SCALE_3X :3x STR_GAME_OPTIONS_GUI_SCALE_4X :4x +STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafica @@ -2093,6 +2103,7 @@ STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Impostaz STR_INTRO_NEWGRF_SETTINGS :{BLACK}Impostazioni NewGRF STR_INTRO_ONLINE_CONTENT :{BLACK}Contenuti online STR_INTRO_AI_SETTINGS :{BLACK}Impostazioni IA +STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}Impostazioni script di gioco STR_INTRO_QUIT :{BLACK}Esci STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Inizia una nuova partita. CTRL salta la configurazione della mappa. @@ -2504,13 +2515,13 @@ STR_NETWORK_SERVER_MESSAGE_GAME_REASON_LINK_GRAPH :in attesa di ag STR_NETWORK_MESSAGE_CLIENT_LEAVING :abbandono della partita STR_NETWORK_MESSAGE_CLIENT_JOINED :*** {STRING} è entrato nella partita -STR_NETWORK_MESSAGE_CLIENT_JOINED_ID :*** {STRING} è entrato nella partita (Client #{2:NUM}) -STR_NETWORK_MESSAGE_CLIENT_COMPANY_JOIN :*** {STRING} ha iniziato a controllare la compagnia #{2:NUM} +STR_NETWORK_MESSAGE_CLIENT_JOINED_ID :*** {0:STRING} è entrato nella partita (Client #{2:NUM}) +STR_NETWORK_MESSAGE_CLIENT_COMPANY_JOIN :*** {0:STRING} è entrato a far parte della compagnia #{2:NUM} STR_NETWORK_MESSAGE_CLIENT_COMPANY_SPECTATE :*** {STRING} è diventato spettatore -STR_NETWORK_MESSAGE_CLIENT_COMPANY_NEW :*** {STRING} ha avviato una nuova compagnia (#{2:NUM}) -STR_NETWORK_MESSAGE_CLIENT_LEFT :*** {STRING} ha abbandonato la partita ({2:STRING}) +STR_NETWORK_MESSAGE_CLIENT_COMPANY_NEW :*** {0:STRING} ha fondato una nuova compagnia (#{2:NUM}) +STR_NETWORK_MESSAGE_CLIENT_LEFT :*** {0:STRING} ha abbandonato la partita ({2:STRING}) STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} ha cambiato il loro nome in {STRING} -STR_NETWORK_MESSAGE_GIVE_MONEY :*** {STRING} ha dato {2:CURRENCY_LONG} a {1:STRING} +STR_NETWORK_MESSAGE_GIVE_MONEY :*** {0:STRING} ha dato {2:CURRENCY_LONG} a {1:STRING} STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}Il server ha chiuso la sessione STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Il server si sta riavviando...{}Attendere prego... STR_NETWORK_MESSAGE_KICKED :*** {STRING} è stato espulso. Motivo: ({STRING}) @@ -2627,6 +2638,7 @@ STR_LINKGRAPH_LEGEND_SATURATED :{TINY_FONT}{BLA STR_LINKGRAPH_LEGEND_OVERLOADED :{TINY_FONT}{BLACK}sovraccarica # Linkgraph tooltip +STR_LINKGRAPH_STATS_TOOLTIP :{BLACK}{CARGO_LONG} da trasportare al mese da {STATION} a {STATION} ({COMMA}% di capacità){STRING} STR_LINKGRAPH_STATS_TOOLTIP_RETURN_EXTENSION :{}{CARGO_LONG} da trasportare indietro ({COMMA}% di capacità) STR_LINKGRAPH_STATS_TOOLTIP_TIME_EXTENSION :{}tempo medio di percorrenza: {NUM}{NBSP}giorn{P "o" i} @@ -2830,11 +2842,11 @@ STR_LANDSCAPING_TOOLBAR :{WHITE}Modellaz STR_LANDSCAPING_TOOLTIP_LOWER_A_CORNER_OF_LAND :{BLACK}Abbassa un angolo di terreno. Trascinando, l'area selezionata viene livellata alla nuova quota del primo angolo. CTRL seleziona l'area diagonalmente. MAIUSC alterna fra costruzione e stima dei costi STR_LANDSCAPING_TOOLTIP_RAISE_A_CORNER_OF_LAND :{BLACK}Alza un angolo di terreno. Trascinando, l'area selezionata viene livellata alla nuova quota del primo angolo. CTRL seleziona l'area diagonalmente. MAIUSC alterna fra costruzione e stima dei costi STR_LANDSCAPING_LEVEL_LAND_TOOLTIP :{BLACK}Livella un'area di terreno alla quota del primo angolo selezionato. CTRL seleziona l'area diagonalmente. MAIUSC alterna fra costruzione e stima dei costi -STR_LANDSCAPING_TOOLTIP_PURCHASE_LAND :{BLACK}Acquista terreno per usi futuri. MAIUSC alterna fra costruzione e stima dei costi +STR_LANDSCAPING_TOOLTIP_PURCHASE_LAND :{BLACK}Acquista terreno per usi futuri. Ctrl seleziona l'area in diagonale. MAIUSC alterna la costruzione/visualizzazione della stima dei costi. # Object construction window STR_OBJECT_BUILD_CAPTION :{WHITE}Selezione oggetto -STR_OBJECT_BUILD_TOOLTIP :{BLACK}Seleziona l'oggetto da costruire. MAIUSC alterna fra costruzione e stima dei costi +STR_OBJECT_BUILD_TOOLTIP :{BLACK}Seleziona l'oggetto da costruire. Ctrl seleziona l'area in diagonale. MAIUSC alterna la costruzione/visualizzazione della stima dei costi STR_OBJECT_BUILD_CLASS_TOOLTIP :{BLACK}Seleziona la classe dell'oggetto da costruire STR_OBJECT_BUILD_PREVIEW_TOOLTIP :{BLACK}Anteprima dell'oggetto STR_OBJECT_BUILD_SIZE :{BLACK}Dimensione: {GOLD}{NUM} x {NUM} caselle @@ -3179,6 +3191,10 @@ STR_MAPGEN_SMOOTHNESS :{BLACK}Levigate STR_MAPGEN_VARIETY :{BLACK}Varietà del terreno: STR_MAPGEN_GENERATE :{WHITE}Genera STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}Impostazioni NewGRF +STR_MAPGEN_NEWGRF_SETTINGS_TOOLTIP :{BLACK}Mostra impostazioni NewGRF +STR_MAPGEN_AI_SETTINGS :{BLACK}Impostazioni IA +STR_MAPGEN_AI_SETTINGS_TOOLTIP :{BLACK}Mostra impostazioni IA +STR_MAPGEN_GS_SETTINGS :{BLACK}Impostazioni script di gioco STR_MAPGEN_GS_SETTINGS_TOOLTIP :BLACK}Visualizza le impostazioni dello script di gioco ###length 21 @@ -3365,15 +3381,15 @@ STR_NEWGRF_ERROR_MSG_FATAL :{RED}Errore irr STR_NEWGRF_ERROR_FATAL_POPUP :{WHITE}Si è verificato un errore irreversibile nel NewGRF:{}{STRING} STR_NEWGRF_ERROR_POPUP :{WHITE}Si è verificato un errore in un NewGRF:{}{STRING} STR_NEWGRF_ERROR_VERSION_NUMBER :{1:STRING} non funziona con la versione di TTDPatch riferita da OpenTTD -STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:STRING} è per la versione {STRING} di TTD -STR_NEWGRF_ERROR_UNSET_SWITCH :{1:STRING} è progettato per essere usato con {STRING} -STR_NEWGRF_ERROR_INVALID_PARAMETER :Parametro non valido per {1:STRING}: parametro {STRING} ({NUM}) -STR_NEWGRF_ERROR_LOAD_BEFORE :{1:STRING} deve essere caricato prima di {STRING} -STR_NEWGRF_ERROR_LOAD_AFTER :{1:STRING} deve essere caricato dopo {STRING} -STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER :{1:STRING} richiede OpenTTD versione {STRING} o superiore +STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:STRING} è per la versione {2:STRING} di TTD +STR_NEWGRF_ERROR_UNSET_SWITCH :{1:STRING} è progettato per essere usato con {2:STRING} +STR_NEWGRF_ERROR_INVALID_PARAMETER :Parametro non valido per {1:STRING}: parametro {2:STRING} ({3:NUM}) +STR_NEWGRF_ERROR_LOAD_BEFORE :{1:STRING} deve essere caricato prima di {2:STRING} +STR_NEWGRF_ERROR_LOAD_AFTER :{1:STRING} deve essere caricato dopo {2:STRING} +STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER :{1:STRING} richiede la versione {2:STRING} o superiore di OpenTTD STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE :il file GRF che era progettato per tradurre STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED :Troppi NewGRF caricati -STR_NEWGRF_ERROR_STATIC_GRF_CAUSES_DESYNC :Caricare {1:STRING} come NewGRF statico insieme a {STRING} può causare errori di sincronizzazione +STR_NEWGRF_ERROR_STATIC_GRF_CAUSES_DESYNC :Caricare {1:STRING} come NewGRF statico insieme a {2:STRING} può causare errori di sincronizzazione STR_NEWGRF_ERROR_UNEXPECTED_SPRITE :Sprite inatteso (sprite {3:NUM}) STR_NEWGRF_ERROR_UNKNOWN_PROPERTY :Proprietà {4:HEX} sconosciuta per l'azione 0 (sprite {3:NUM}) STR_NEWGRF_ERROR_INVALID_ID :Tentativo di utilizzare un ID non valido (sprite {3:NUM}) @@ -3505,14 +3521,14 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Acquista esclus STR_LOCAL_AUTHORITY_ACTION_BRIBE :Corrompi l'autorità locale ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}Inizia una piccola campagna pubblicitaria, per attirare più passeggeri e merci ai servizi di trasporto della compagnia.{}Fornisce un aumento temporaneo della valutazione delle stazioni in un piccolo raggio dal centro della città.{}Costo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Inizia una campagna pubblicitaria moderata, per attirare più passeggeri e merci ai servizi di trasporto della compagnia.{}Fornisce un aumento temporaneo della valutazione delle stazioni in un moderato raggio dal centro della città.{}Costo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Inizia una grande campagna pubblicitaria locale, per attirare più passeggeri e merci ai servizi di trasporto della compagnia.{}Fornisce un aumento temporaneo della valutazione delle stazioni in un grande raggio dal centro della città.{}Costo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}Finanzia la ricostruzione della rete stradale cittadina.{}Causa un considerevole disagio al traffico stradale per 6 mesi.{}Costo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Costruisci una statua in onore della compagnia.{}Fornisce un aumento permanente della valutazione delle stazioni in questa città.{}Costo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}Finanzia la costruzione di nuovi edifici nella città.{}Fornisce un aumento temporaneo della crescita della città.{}Costo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Acquista un anno di diritti di trasporto esclusivi in città. L'autorità cittadina non permetterà a passeggeri e merci di usare le stazioni dei tuoi avversari.{}Costo: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Corrompi l'autorità locale per aumentare la tua valutazione, con il rischio di una severa multa se scoperto.{}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW}Iniziate una piccola campagna pubblicitaria locale per attirare più passeggeri e merci sui vostri servizi di trasporto..{}Fornisce un incremento temporane alla valutazione delle stazioni in un piccolo raggio intorno al centro città..{}{POP_COLOUR}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{PUSH_COLOUR}{YELLOW}Avvia una campagna pubblicitaria a livello locale per attirare un maggior numero di passeggeri e merci sui vostri servizi di trasporto..{}Fornisce un incremento temporaneo alla valutazione delle stazioni in un raggio medio intorno al centro città..{}{POP_COLOUR}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{PUSH_COLOUR}{YELLOW}Avvia una vasta campagna pubblicitaria locale, per attirare più passeggeri e merci sui vostri servizi di trasporto.{}Fornisce un incremento temporaneo alla valutazione delle stazioni in un ampio raggio intorno al centro città..{}{POP_COLOUR}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW}Finanziare la ricostruzione della rete stradale urbana.{}Provoca notevoli disagi al traffico stradale per un periodo fino a 6 mesi.{}{POP_COLOUR}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{PUSH_COLOUR}{YELLOW}Costruite una statua in onore della vostra compagnia.{}Fornisce un aumento permanente della valutazione della stazione in questa città..{}{POP_COLOUR}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{PUSH_COLOUR}{YELLOW}Finanziare la costruzione di nuovi edifici in città.{}Fornisce un incremento temporaneo alla crescita di questa città.{}{POP_COLOUR}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW}Acquistate 1 anno di diritti esclusivi di trasporto in città..{}Le autorità cittadine non permetteranno a passeggeri e merci di utilizzare le stazioni dei vostri concorrenti..{}{POP_COLOUR}Costo: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}Corrompere l'autorità locale per aumentare la valutazione, con il rischio di una severa sanzione se si viene scoperti.{}{POP_COLOUR}Costo: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}Obiettivi della {COMPANY} @@ -3689,12 +3705,14 @@ STR_FINANCES_TOTAL_CAPTION :{WHITE}Totale STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} +STR_FINANCES_PROFIT :{WHITE}Profitto STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Saldo bancario STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Capitale netto STR_FINANCES_LOAN_TITLE :{WHITE}Prestito STR_FINANCES_INTEREST_RATE :{WHITE}Interesse sul prestito: {BLACK}{NUM}% STR_FINANCES_MAX_LOAN :{WHITE}Prestito massimo: {BLACK}{CURRENCY_LONG} STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} +STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}Chiedi in prestito {CURRENCY_LONG} STR_FINANCES_BORROW_TOOLTIP :{BLACK}Aumenta l'ammontare del prestito, CTRL+clic chiede in prestito il più possibile STR_FINANCES_REPAY_BUTTON :{BLACK}Ripaga {CURRENCY_LONG} @@ -3795,7 +3813,7 @@ STR_INDUSTRY_VIEW_PRODUCES_N_CARGO :{BLACK}Produce: STR_INDUSTRY_VIEW_CARGO_LIST_EXTENSION :, {STRING}{STRING} STR_INDUSTRY_VIEW_REQUIRES :{BLACK}Richiede: -STR_INDUSTRY_VIEW_ACCEPT_CARGO :{YELLOW}{STRING}{BLACK}{3:STRING} +STR_INDUSTRY_VIEW_ACCEPT_CARGO :{YELLOW}{0:STRING}{BLACK}{3:STRING} STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT :{YELLOW}{STRING}{BLACK}: {CARGO_SHORT} in attesa{STRING} STR_CONFIG_GAME_PRODUCTION :{WHITE}Cambia produzione (multiplo di 8, fino a 2040) @@ -3917,6 +3935,8 @@ STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Autonomi STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}Tipo di aeromobile: {GOLD}{STRING} ###length 3 +STR_CARGO_TYPE_FILTER_ALL :Tutti i tipi di carico +STR_CARGO_TYPE_FILTER_FREIGHT :Merci STR_CARGO_TYPE_FILTER_NONE :Nessuno ###length VEHICLE_TYPES @@ -4087,7 +4107,7 @@ STR_ENGINE_PREVIEW_AIRCRAFT :{G=m}aeromobile STR_ENGINE_PREVIEW_SHIP :{G=f}nave STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER :{BLACK}Costo: {CURRENCY_LONG} Peso: {WEIGHT_SHORT}{}Velocità: {VELOCITY} Potenza: {POWER}{}Costo di esercizio: {CURRENCY_LONG}/anno{}Capacità: {CARGO_LONG} -STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}Costo: {CURRENCY_LONG} Peso: {WEIGHT_SHORT}{}Velocità: {VELOCITY} Potenza: {POWER} S.T. max.: {6:FORCE}{}Costo di esercizio: {4:CURRENCY_LONG}/anno{}Capacità: {5:CARGO_LONG} +STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}Costo: {0:CURRENCY_LONG} Peso: {1:WEIGHT_SHORT}{}Velocità: {2:VELOCITY} Potenza: {3:POWER} S.T. Max.: {6:FORCE}{}Costo di esercizio: {4:CURRENCY_LONG}/anno{}Capacità: {5:CARGO_LONG} STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST :{BLACK}Costo: {CURRENCY_LONG} Velocità max.: {VELOCITY}{}Capacità: {CARGO_LONG}{}Costo di esercizio: {CURRENCY_LONG}/anno STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_CAP_RUNCOST :{BLACK}Costo: {CURRENCY_LONG} Velocità max.: {VELOCITY}{}Tipo aeromobile: {STRING}{}Capacità: {CARGO_LONG}, {CARGO_LONG}{}Costo di esercizio: {CURRENCY_LONG}/anno STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_RUNCOST :{BLACK}Costo: {CURRENCY_LONG} Velocità max.: {VELOCITY}{}Tipo aeromobile: {STRING}{}Capacità: {CARGO_LONG}{}Costo di esercizio: {CURRENCY_LONG}/anno @@ -4251,8 +4271,8 @@ STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Affidabi STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Costruito nel: {LTBLUE}{NUM}{BLACK} Valore: {LTBLUE}{CURRENCY_LONG} STR_VEHICLE_INFO_NO_CAPACITY :{BLACK}Capacità: {LTBLUE}Nessuna{STRING} -STR_VEHICLE_INFO_CAPACITY :{BLACK}Capacità: {LTBLUE}{CARGO_LONG}{3:STRING} -STR_VEHICLE_INFO_CAPACITY_MULT :{BLACK}Capacità: {LTBLUE}{CARGO_LONG}{3:STRING} (x{4:NUM}) +STR_VEHICLE_INFO_CAPACITY :{BLACK}Capacità: {LTBLUE}{0:CARGO_LONG}{3:STRING} +STR_VEHICLE_INFO_CAPACITY_MULT :{BLACK}Capacità: {LTBLUE}{0:CARGO_LONG}{3:STRING} (x{4:NUM}) STR_VEHICLE_INFO_CAPACITY_CAPACITY :{BLACK}Capacità: {LTBLUE}{CARGO_LONG}, {CARGO_LONG}{STRING} STR_VEHICLE_INFO_FEEDER_CARGO_VALUE :{BLACK}Crediti di trasferimento: {LTBLUE}{CURRENCY_LONG} @@ -4598,8 +4618,8 @@ STR_AI_CONFIG_GAMESCRIPT :{SILVER}Script STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}Parametri STR_AI_CONFIG_AI :{SILVER}IA -STR_AI_CONFIG_CHANGE_AI :IA -STR_AI_CONFIG_CHANGE_GAMESCRIPT :Script +STR_AI_CONFIG_CHANGE_AI :{BLACK}Seleziona IA +STR_AI_CONFIG_CHANGE_GAMESCRIPT :{BLACK}Seleziona lo script di gioco STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Carica un altro script STR_AI_CONFIG_CONFIGURE :{BLACK}Configura STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}Configura i parametri dello script @@ -4628,7 +4648,7 @@ STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Screensh STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Screenshot della minimappa # AI Parameters -STR_AI_SETTINGS_CAPTION_AI :AI +STR_AI_SETTINGS_CAPTION_AI :{WHITE}Parametri IA STR_AI_SETTINGS_CLOSE :{BLACK}Chiudi STR_AI_SETTINGS_RESET :{BLACK}Reimposta STR_AI_SETTINGS_SETTING :{STRING}: {ORANGE}{STRING} From e29547a3a25689dd0e57b984a98ba77a4c01a193 Mon Sep 17 00:00:00 2001 From: stormcone <48624099+stormcone@users.noreply.github.com> Date: Thu, 24 Nov 2022 21:58:10 +0100 Subject: [PATCH 35/42] Feature: Show the cargoes the vehicles can carry in the vehicle list window (#8304) --- src/lang/english.txt | 4 ++++ src/settings_gui.cpp | 1 + src/settings_type.h | 1 + src/table/settings/gui_settings.ini | 9 +++++++++ src/vehicle_gui.cpp | 31 ++++++++++++++++++++++++++++- 5 files changed, 45 insertions(+), 1 deletion(-) diff --git a/src/lang/english.txt b/src/lang/english.txt index 96eb124257..3cd979a6e1 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1432,6 +1432,8 @@ STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT :Width of the li STR_CONFIG_SETTING_SHOW_NEWGRF_NAME :Show the NewGRF's name in the build vehicle window: {STRING2} STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT :Add a line to the build vehicle window, showing which NewGRF the selected vehicle comes from. +STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS :Show the cargoes the vehicles can carry in the list windows {STRING2} +STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS_HELPTEXT :If enabled, the vehicle's transportable load will appear above it in the vehicle lists STR_CONFIG_SETTING_LANDSCAPE :Landscape: {STRING2} STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Landscapes define basic gameplay scenarios with different cargoes and town growth requirements. NewGRF and Game Scripts allow finer control though @@ -3802,6 +3804,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Send ins STR_VEHICLE_LIST_REPLACE_VEHICLES :Replace vehicles STR_VEHICLE_LIST_SEND_FOR_SERVICING :Send for Servicing STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profit this year: {CURRENCY_LONG} (last year: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING1} {STRING1} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Send to Depot STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Send to Depot diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index ac214fe6ea..dda359ca06 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1676,6 +1676,7 @@ static SettingsContainer &GetSettingsTree() interface->Add(new SettingEntry("gui.timetable_in_ticks")); interface->Add(new SettingEntry("gui.timetable_arrival_departure")); interface->Add(new SettingEntry("gui.show_newgrf_name")); + interface->Add(new SettingEntry("gui.show_cargo_in_vehicle_lists")); } SettingsPage *advisors = main->Add(new SettingsPage(STR_CONFIG_SETTING_ADVISORS)); diff --git a/src/settings_type.h b/src/settings_type.h index 2033e746ab..a83384cdb3 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -170,6 +170,7 @@ struct GUISettings { uint8 osk_activation; ///< Mouse gesture to trigger the OSK. byte starting_colour; ///< default color scheme for the company to start a new game with bool show_newgrf_name; ///< Show the name of the NewGRF in the build vehicle window + bool show_cargo_in_vehicle_lists; ///< Show the cargoes the vehicles can carry in the list windows bool auto_remove_signals; ///< automatically remove signals when in the way during rail construction uint16 refresh_rate; ///< How often we refresh the screen (time between draw-ticks). uint16 fast_forward_speed_limit; ///< Game speed to use when fast-forward is enabled. diff --git a/src/table/settings/gui_settings.ini b/src/table/settings/gui_settings.ini index 7e4f85ec67..a521408be7 100644 --- a/src/table/settings/gui_settings.ini +++ b/src/table/settings/gui_settings.ini @@ -728,6 +728,15 @@ strhelp = STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT post_cb = [](auto) { MarkWholeScreenDirty(); } cat = SC_ADVANCED +[SDTC_BOOL] +var = gui.show_cargo_in_vehicle_lists +flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC +def = false +str = STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS +strhelp = STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS_HELPTEXT +post_cb = [](auto) { MarkWholeScreenDirty(); } +cat = SC_ADVANCED + ; For the dedicated build we'll enable dates in logs by default. [SDTC_BOOL] ifdef = DEDICATED diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 3f3a761747..467f6731d2 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1669,7 +1669,36 @@ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int DrawVehicleImage(v, {image_left, ir.top, image_right, ir.bottom}, selected_vehicle, EIT_IN_LIST, 0); - if (!v->name.empty()) { + if (_settings_client.gui.show_cargo_in_vehicle_lists) { + /* Get the cargoes the vehicle can carry */ + CargoTypes vehicle_cargoes = 0; + + for (auto u = v; u != nullptr; u = u->Next()) { + if (u->cargo_cap == 0) continue; + + SetBit(vehicle_cargoes, u->cargo_type); + } + + if (!v->name.empty()) { + /* The vehicle got a name so we will print it and the cargoes */ + SetDParam(0, STR_TINY_BLACK_VEHICLE); + SetDParam(1, v->index); + SetDParam(2, STR_VEHICLE_LIST_CARGO); + SetDParam(3, vehicle_cargoes); + DrawString(tr.left, tr.right, ir.top, STR_VEHICLE_LIST_NAME_AND_CARGO); + } else if (v->group_id != DEFAULT_GROUP) { + /* The vehicle has no name, but is member of a group, so print group name and the cargoes */ + SetDParam(0, STR_TINY_GROUP); + SetDParam(1, v->group_id); + SetDParam(2, STR_VEHICLE_LIST_CARGO); + SetDParam(3, vehicle_cargoes); + DrawString(tr.left, tr.right, ir.top, STR_VEHICLE_LIST_NAME_AND_CARGO); + } else { + /* The vehicle has no name, and is not a member of a group, so just print the cargoes */ + SetDParam(0, vehicle_cargoes); + DrawString(tr.left, tr.right, ir.top, STR_VEHICLE_LIST_CARGO); + } + } else if (!v->name.empty()) { /* The vehicle got a name so we will print it */ SetDParam(0, v->index); DrawString(tr.left, tr.right, ir.top, STR_TINY_BLACK_VEHICLE); From b846c574d7fb5aa0ccffbce43262d3fe25688c54 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Thu, 24 Nov 2022 14:08:33 -0700 Subject: [PATCH 36/42] Update: Developer credits (#10190) --- CREDITS.md | 1 + src/misc_gui.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/CREDITS.md b/CREDITS.md index 698ea54ebb..8826c9dcfe 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -10,6 +10,7 @@ - Peter Nelson (peter1138) - Spiritual descendant from newGRF gods (since 0.4.5) - Remko Bijker (Rubidium) - Coder and way more (since 0.4.5) - Patric Stout (TrueBrain) - NoProgrammer (since 0.3), sys op +- Tyler Trahan (2TallTyler) - General coding (since 13) ### Inactive Developers: diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index e506ecf141..2b69c6a10e 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -417,6 +417,7 @@ static const char * const _credits[] = { u8" Peter Nelson (peter1138) - Spiritual descendant from NewGRF gods (since 0.4.5)", u8" Remko Bijker (Rubidium) - Coder and way more (since 0.4.5)", u8" Patric Stout (TrueBrain) - NoProgrammer (since 0.3), sys op", + u8" Tyler Trahan (2TallTyler) - General coding (since 13)", u8"", u8"Inactive Developers:", u8" Grzegorz Duczy\u0144ski (adf88) - General coding (1.7 - 1.8)", From b9ce3de23dadff8d1a3348734df88228b5cb45cb Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 25 Nov 2022 18:46:07 +0000 Subject: [PATCH 37/42] Update: Translations from eints slovak: 72 changes by legitalk --- src/lang/slovak.txt | 102 +++++++++++++++++++++++++++++++------------- 1 file changed, 72 insertions(+), 30 deletions(-) diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt index 5bb0521c0e..445748f4ff 100644 --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -264,6 +264,15 @@ STR_UNITS_POWER_IMPERIAL :{COMMA}hp STR_UNITS_POWER_METRIC :{COMMA}hp STR_UNITS_POWER_SI :{COMMA}kW +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_IMPERIAL_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg +STR_UNITS_POWER_METRIC_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}hp/t +STR_UNITS_POWER_METRIC_TO_WEIGHT_SI :{DECIMAL}{NBSP}hp/Mg +STR_UNITS_POWER_SI_TO_WEIGHT_IMPERIAL :{DECIMAL}{NBSP}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_METRIC :{DECIMAL}{NBSP}kW/t +STR_UNITS_POWER_SI_TO_WEIGHT_SI :{DECIMAL}{NBSP}W/kg STR_UNITS_WEIGHT_SHORT_IMPERIAL :{COMMA}t STR_UNITS_WEIGHT_SHORT_METRIC :{COMMA}t @@ -353,8 +362,8 @@ STR_SORT_BY_PRODUCTION :Produkcia STR_SORT_BY_TYPE :Typ STR_SORT_BY_TRANSPORTED :Prepravené STR_SORT_BY_NUMBER :Číslo -STR_SORT_BY_PROFIT_LAST_YEAR :Profit v minulom roku -STR_SORT_BY_PROFIT_THIS_YEAR :Profit v tomto roku +STR_SORT_BY_PROFIT_LAST_YEAR :Zisk v minulom roku +STR_SORT_BY_PROFIT_THIS_YEAR :Zisk v tomto roku STR_SORT_BY_AGE :Vek STR_SORT_BY_RELIABILITY :Spoľahlivosť STR_SORT_BY_TOTAL_CAPACITY_PER_CARGOTYPE :Kapacita podľa typu nákladu @@ -381,10 +390,10 @@ STR_SORT_BY_RANGE :Rozsah STR_SORT_BY_POPULATION :Populácia STR_SORT_BY_RATING :Hodnotenie STR_SORT_BY_NUM_VEHICLES :Počet vozidiel -STR_SORT_BY_TOTAL_PROFIT_LAST_YEAR :Celkový profit v minulom roku -STR_SORT_BY_TOTAL_PROFIT_THIS_YEAR :Celkový profit v tomto roku -STR_SORT_BY_AVERAGE_PROFIT_LAST_YEAR :Priemerný profit v minulom roku -STR_SORT_BY_AVERAGE_PROFIT_THIS_YEAR :Priemerný profit v tomto roku +STR_SORT_BY_TOTAL_PROFIT_LAST_YEAR :Celkový zisk v minulom roku +STR_SORT_BY_TOTAL_PROFIT_THIS_YEAR :Celkový zisk v tomto roku +STR_SORT_BY_AVERAGE_PROFIT_LAST_YEAR :Priemerný zisk v minulom roku +STR_SORT_BY_AVERAGE_PROFIT_THIS_YEAR :Priemerný zisk v tomto roku # Group by options for vehicle list STR_GROUP_BY_NONE :Žiadne @@ -459,6 +468,8 @@ STR_SCENEDIT_FILE_MENU_QUIT :Ukončiť ###length 15 STR_SETTINGS_MENU_GAME_OPTIONS :Možnosti hry STR_SETTINGS_MENU_CONFIG_SETTINGS_TREE :Nastavenia +STR_SETTINGS_MENU_AI_SETTINGS :Nastavenia AI +STR_SETTINGS_MENU_GAMESCRIPT_SETTINGS :Nastavenia skriptu STR_SETTINGS_MENU_NEWGRF_SETTINGS :Nastavenia NewGRF STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Nastavenia priehľadnosti STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Zobraziť názvy miest @@ -497,7 +508,7 @@ STR_SUBSIDIES_MENU_SUBSIDIES :Dotácie # Graph menu ###length 6 -STR_GRAPH_MENU_OPERATING_PROFIT_GRAPH :Graf prevádzkového profitu +STR_GRAPH_MENU_OPERATING_PROFIT_GRAPH :Graf prevádzkového zisku STR_GRAPH_MENU_INCOME_GRAPH :Graf tržieb STR_GRAPH_MENU_DELIVERED_CARGO_GRAPH :Graf prepraveného nákladu STR_GRAPH_MENU_PERFORMANCE_HISTORY_GRAPH :Graf hodnotenia výkonu @@ -652,7 +663,7 @@ STR_GRAPH_X_LABEL_MONTH_YEAR :{TINY_FONT}{STR STR_GRAPH_Y_LABEL :{TINY_FONT}{STRING} STR_GRAPH_Y_LABEL_NUMBER :{TINY_FONT}{COMMA} -STR_GRAPH_OPERATING_PROFIT_CAPTION :{WHITE}Graf prevádzkového profitu +STR_GRAPH_OPERATING_PROFIT_CAPTION :{WHITE}Graf prevádzkového zisku STR_GRAPH_INCOME_CAPTION :{WHITE}Graf tržieb STR_GRAPH_CARGO_DELIVERED_CAPTION :{WHITE}Graf prepraveného nákladu (jednotiek nákladu) STR_GRAPH_COMPANY_PERFORMANCE_RATINGS_CAPTION :{WHITE}Graf hodnotenia výkonu (najvyššie hodnotenie je 1000) @@ -698,7 +709,7 @@ STR_PERFORMANCE_DETAIL_SELECT_COMPANY_TOOLTIP :{BLACK}Ukázať ###length 10 STR_PERFORMANCE_DETAIL_VEHICLES :{BLACK}Vozidlá: STR_PERFORMANCE_DETAIL_STATIONS :{BLACK}Stanice: -STR_PERFORMANCE_DETAIL_MIN_PROFIT :{BLACK}Min. profit: +STR_PERFORMANCE_DETAIL_MIN_PROFIT :{BLACK}Min. zisk: STR_PERFORMANCE_DETAIL_MIN_INCOME :{BLACK}Min. príjem: STR_PERFORMANCE_DETAIL_MAX_INCOME :{BLACK}Max. príjem: STR_PERFORMANCE_DETAIL_DELIVERED :{BLACK}Prepravené: @@ -710,7 +721,7 @@ STR_PERFORMANCE_DETAIL_TOTAL :{BLACK}Spolu: ###length 10 STR_PERFORMANCE_DETAIL_VEHICLES_TOOLTIP :{BLACK}Počet vozidiel, ktoré dosiahli v minulom roku zisk. Patria sem cestné vozidlá, vlaky, lode a lietadlá STR_PERFORMANCE_DETAIL_STATIONS_TOOLTIP :{BLACK}Počet nedávno obsluhovaných staníc. Železničné stanice, autobusové zastávky, letiská a pod. sa počítajú oddelene aj keď patria do rovnakej stanice -STR_PERFORMANCE_DETAIL_MIN_PROFIT_TOOLTIP :{BLACK}Profit vozidla s najnižšími tržbami (zo všetkých vozidiel starších ako 2 roky) +STR_PERFORMANCE_DETAIL_MIN_PROFIT_TOOLTIP :{BLACK}Zisk vozidla s najnižšími tržbami (zo všetkých vozidiel starších ako 2 roky) STR_PERFORMANCE_DETAIL_MIN_INCOME_TOOLTIP :{BLACK}Množstvo peňazí zarobených v kvartáli s najmenším ziskom v posledných 12 kvartáloch STR_PERFORMANCE_DETAIL_MAX_INCOME_TOOLTIP :{BLACK}Množstvo peňazí zarobených v kvartáli s najväčším ziskom v posledných 12 kvartáloch STR_PERFORMANCE_DETAIL_DELIVERED_TOOLTIP :{BLACK}Počet jednotiek nákladu prepravených v posledných štyroch kvartáloch @@ -882,9 +893,9 @@ STR_NEWS_FIRST_AIRCRAFT_ARRIVAL :{BIG_FONT}{BLAC STR_NEWS_TRAIN_CRASH :{BIG_FONT}{BLACK}Vlakové nešťastie!{}{COMMA} mŕtv{P i i ych} pri požiari po kolízii STR_NEWS_ROAD_VEHICLE_CRASH_DRIVER :{BIG_FONT}{BLACK}Dopravná nehoda!{}Vodič zomrel po kolízii s vlakom -STR_NEWS_ROAD_VEHICLE_CRASH :{BIG_FONT}{BLACK}Dopravná nehoda!{}{COMMA} mŕtvych po kolízii s vlakom +STR_NEWS_ROAD_VEHICLE_CRASH :{BIG_FONT}{BLACK}Dopravná nehoda!{}{COMMA} mŕtv{P i i ych} po kolízii s vlakom STR_NEWS_AIRCRAFT_CRASH :{BIG_FONT}{BLACK}Letecké nešťastie!{}{COMMA} mŕtv{P y i ych} po požiari na {STATION} -STR_NEWS_PLANE_CRASH_OUT_OF_FUEL :{BIG_FONT}{BLACK}Letecké nešťastie!{}Lietadlu došlo palivo, {COMMA} mŕtvych pri požiari +STR_NEWS_PLANE_CRASH_OUT_OF_FUEL :{BIG_FONT}{BLACK}Letecké nešťastie!{}Lietadlu došlo palivo, {COMMA} mŕtv{P y i ych} pri požiari STR_NEWS_DISASTER_ZEPPELIN :{BIG_FONT}{BLACK}Zeppelin zničený pri nehode na {STATION}! STR_NEWS_DISASTER_SMALL_UFO :{BIG_FONT}{BLACK}Cestné vozidlo bolo zničené pri kolízii s 'UFO' @@ -892,7 +903,7 @@ STR_NEWS_DISASTER_AIRPLANE_OIL_REFINERY :{BIG_FONT}{BLAC STR_NEWS_DISASTER_HELICOPTER_FACTORY :{BIG_FONT}{BLACK}Za nejasných okolností bola zničená továreň neďaleko mesta {TOWN}! STR_NEWS_DISASTER_BIG_UFO :{BIG_FONT}{BLACK}'UFO' pristálo neďaleko mesta {TOWN}! STR_NEWS_DISASTER_COAL_MINE_SUBSIDENCE :{BIG_FONT}{BLACK}Zával v uhoľnej bani neďaleko mesta {TOWN}! -STR_NEWS_DISASTER_FLOOD_VEHICLE :{BIG_FONT}{BLACK}Povodeň!{}Najmenej {COMMA} ľudí je nezvestných alebo mŕtvych po obrovských záplavách! +STR_NEWS_DISASTER_FLOOD_VEHICLE :{BIG_FONT}{BLACK}Povodeň!{}Najmenej {COMMA} {P človek ľudia ľudí} {P je sú je} nezvestn{P ý í ých} alebo mŕtv{P y i ych} po obrovských záplavách! STR_NEWS_COMPANY_IN_TROUBLE_TITLE :{BIG_FONT}{BLACK}Dopravná spoločnosť má problémy! STR_NEWS_COMPANY_IN_TROUBLE_DESCRIPTION :{BIG_FONT}{BLACK}{STRING} bude predaná alebo vyhlási bankrot pokiaľ čoskoro nezvýši produktivitu! @@ -1065,8 +1076,19 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Zaškrtn STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Aktuálny ovládač: {STRING} +STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Veľkosť rozhrania +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Potiahnutím posúvača nastavte veľkosť rozhrania. Pre plynulé nastavenie podržte Ctrl +STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Detekovať rozmery automaticky +STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Začiarknutím tohto políčka automaticky zistiť veľkosť rozhrania +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Mierkové úkosy +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Začiarknutím tohto políčka zmeníte úkosy podľa veľkosti rozhrania +STR_GAME_OPTIONS_GUI_SCALE_1X :1x +STR_GAME_OPTIONS_GUI_SCALE_2X :2x +STR_GAME_OPTIONS_GUI_SCALE_3X :3x +STR_GAME_OPTIONS_GUI_SCALE_4X :4x +STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafika @@ -1850,7 +1872,7 @@ STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT :Ak je zapnuté, STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES :Minimálny vek spoločnosti na obchodovanie s podielmi: {STRING} STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES_HELPTEXT :Určuje minimálny vek spoločnosti na to, aby od nej mohli ostatné spoločnosti kupovať a predavať podiely. -STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE :Percentáž profitu na zaplatenie podávacieho systému: {STRING} +STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE :Percentáž zisku na zaplatenie podávacieho systému: {STRING} STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE_HELPTEXT :Percento príjmov dať na strednú ´nohu´ vo feeder systémoch, získate väčšiu kontrolu nad príjmamy STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY :Pri ťahaní, umiestni návestidlo každé: {STRING} @@ -2113,6 +2135,8 @@ STR_INTRO_HIGHSCORE :{BLACK}Najvyš STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Nastavenia STR_INTRO_NEWGRF_SETTINGS :{BLACK}Nastavenia NewGRF STR_INTRO_ONLINE_CONTENT :{BLACK}Skontrolovať online obsah +STR_INTRO_AI_SETTINGS :{BLACK}Nastavenia AI +STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}Nastavenia skriptu STR_INTRO_QUIT :{BLACK}Ukončiť STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Spustiť novú hru. Ctrl+klik preskočí nastavenie mapy @@ -2132,6 +2156,8 @@ STR_INTRO_TOOLTIP_HIGHSCORE :{BLACK}Zobrazi STR_INTRO_TOOLTIP_CONFIG_SETTINGS_TREE :{BLACK}Zobraziť nastavenia STR_INTRO_TOOLTIP_NEWGRF_SETTINGS :{BLACK}Zobraziť nastavenia NewGRF STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Skontrolovať nový a aktualizovaný obsah pre stiahnutie +STR_INTRO_TOOLTIP_AI_SETTINGS :{BLACK}Zobraziť AI nastavenia +STR_INTRO_TOOLTIP_GAMESCRIPT_SETTINGS :{BLACK}Zobraz nastavenia skriptu STR_INTRO_TOOLTIP_QUIT :{BLACK}Ukončiť 'OpenTTD' STR_INTRO_BASESET :{BLACK}Vo vybranej základnej sade grafiky chýba {NUM} prv{P ok ky kov}. Prosím skontrolujte aktualizácie sady grafiky. @@ -3191,6 +3217,12 @@ STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}Rieky: STR_MAPGEN_SMOOTHNESS :{BLACK}Členitosť: STR_MAPGEN_VARIETY :{BLACK}Rozmanitosť distribúcie: STR_MAPGEN_GENERATE :{WHITE}Generovať +STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}Nastavenia NewGRF +STR_MAPGEN_NEWGRF_SETTINGS_TOOLTIP :{BLACK}Zobraziť nastavenia NewGRF +STR_MAPGEN_AI_SETTINGS :{BLACK}Nastavenia AI +STR_MAPGEN_AI_SETTINGS_TOOLTIP :{BLACK}Zobraziť AI nastavenia +STR_MAPGEN_GS_SETTINGS :{BLACK}Nastavenia skriptu +STR_MAPGEN_GS_SETTINGS_TOOLTIP :{BLACK}Zobraz nastavenia skriptu ###length 21 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH :Anglické (pôvodné) @@ -3516,14 +3548,14 @@ STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Zakúpiť exklu STR_LOCAL_AUTHORITY_ACTION_BRIBE :Podplatiť miestnu správu ###length 8 -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{YELLOW}Spustiť malú reklamnú kampaň, ktorá priláka viac cestujúcich a nákladu k vašej spoločnosti.{}Zabezpečí dočasné zvýšenie hodnotenia staníc v malom okruhu okolo centra mesta.{}Cena: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{YELLOW}Spustiť strednú reklamnú kampaň, ktorá priláka viac cestujúcich a nákladu k vašej spoločnosti.{}Zabezpečí dočasné zvýšenie hodnotenia staníc v stredne veľkom okruhu okolo centra mesta.{}Cena: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{YELLOW}Spustiť veľkú reklamnú kampaň, ktorá priláka viac cestujúcich a nákladu k vašej spoločnosti.{}Zabezpečí dočasné zvýšenie hodnotenia staníc vo veľkom okruhu okolo centra mesta.{}Cena: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{YELLOW}Financovať rekonštrukciu mestskej cestnej siete.{}Spôsobí dopravný chaos a zápchy trvajúce ďalších 6 mesiacov.{}Cena: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{YELLOW}Postaviť sochu na počesť vašej spoločnosti.{}Zabezpečí trvalé zvýšenie hodnotenia staníc v tomto meste.{}Cena: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{YELLOW}Financovať výstavbu nových budov v meste.{}Zabezpečí dočasné zrýchlenie rastu tohto mesta.{}Cena: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{YELLOW}Zakúpiť exkluzívne dopravné práva v meste na 1 rok.{}Miestna správa nedovolí cestujúcim a nákladu používať stanice konkurentov.{}Cena: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Podplatiť miestnu správu pre zvýšenie hodnotenia vašej spoločnosti, s rizikom ťažkého postihu pri odhalení.{}Cena: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING :{PUSH_COLOUR}{YELLOW}Spustiť malú reklamnú kampaň, ktorá priláka viac cestujúcich a nákladu k vašej spoločnosti.{}Zabezpečí dočasné zvýšenie hodnotenia staníc v malom okruhu okolo centra mesta.{}{POP_COLOUR}Cena: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_MEDIUM_ADVERTISING :{PUSH_COLOUR}{YELLOW}Spustiť strednú reklamnú kampaň, ktorá priláka viac cestujúcich a nákladu k vašej spoločnosti.{}Zabezpečí dočasné zvýšenie hodnotenia staníc v stredne veľkom okruhu okolo centra mesta.{}{POP_COLOUR}Cena: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{PUSH_COLOUR}{YELLOW}Spustiť veľkú reklamnú kampaň, ktorá priláka viac cestujúcich a nákladu k vašej spoločnosti.{}Zabezpečí dočasné zvýšenie hodnotenia staníc vo veľkom okruhu okolo centra mesta.{}{POP_COLOUR}Cena: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW}Financovať rekonštrukciu mestskej cestnej siete.{}Spôsobí dopravný chaos a zápchy trvajúce ďalších 6 mesiacov.{}{POP_COLOUR}Cena: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{PUSH_COLOUR}{YELLOW}Postaviť sochu na počesť vašej spoločnosti.{}Zabezpečí trvalé zvýšenie hodnotenia staníc v tomto meste.{}{POP_COLOUR}Cena: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{PUSH_COLOUR}{YELLOW}Financovať výstavbu nových budov v meste.{}Zabezpečí dočasné zrýchlenie rastu tohto mesta.{}{POP_COLOUR}Cena: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW}Zakúpiť exkluzívne dopravné práva v meste na 1 rok.{}Miestna správa nedovolí cestujúcim a nákladu používať stanice konkurentov.{}{POP_COLOUR}Cena: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}Podplatiť miestnu správu pre zvýšenie hodnotenia vašej spoločnosti, s rizikom ťažkého postihu pri odhalení.{}{POP_COLOUR}Cena: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} Ciele @@ -3676,7 +3708,7 @@ STR_FINANCES_CAPTION :{WHITE}Financie STR_FINANCES_YEAR :{WHITE}{NUM} ###length 3 -STR_FINANCES_REVENUE_TITLE :Výnosy +STR_FINANCES_REVENUE_TITLE :{WHITE}Výnosy STR_FINANCES_OPERATING_EXPENSES_TITLE :{WHITE}Prevádzkové náklady STR_FINANCES_CAPITAL_EXPENSES_TITLE :{WHITE}Kapitálové výdavky @@ -3696,15 +3728,18 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}Lode STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}Úroky STR_FINANCES_SECTION_OTHER :{GOLD}Ostatné +STR_FINANCES_TOTAL_CAPTION :{WHITE}Spolu STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG} +STR_FINANCES_PROFIT :{WHITE}Zisk STR_FINANCES_BANK_BALANCE_TITLE :{WHITE}Zostatok na účte v banke STR_FINANCES_OWN_FUNDS_TITLE :{WHITE}Vlastné prostriedky STR_FINANCES_LOAN_TITLE :{WHITE}Úver STR_FINANCES_INTEREST_RATE :{WHITE}Úroky: {BLACK}{NUM}% STR_FINANCES_MAX_LOAN :{WHITE}Maximálny úver: {BLACK}{CURRENCY_LONG} STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} +STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}Požičať {CURRENCY_LONG} STR_FINANCES_BORROW_TOOLTIP :{BLACK}Zvýšiť veľkosť úveru. Crtl+klik požičia koľko sa dá STR_FINANCES_REPAY_BUTTON :{BLACK}Splatiť {CURRENCY_LONG} @@ -3834,7 +3869,7 @@ STR_VEHICLE_LIST_MANAGE_LIST :{BLACK}Možnost STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Zadať príkazy všetkým vozidlám v zozname STR_VEHICLE_LIST_REPLACE_VEHICLES :Vymeniť vozidlá STR_VEHICLE_LIST_SEND_FOR_SERVICING :Vykonať servis -STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profit tento rok: {CURRENCY_LONG} (minulý rok: {CURRENCY_LONG}) +STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Zisk tento rok: {CURRENCY_LONG} (minulý rok: {CURRENCY_LONG}) STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Poslať do depa STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Poslať do garáže @@ -3877,8 +3912,8 @@ STR_GROUP_REMOVE_ALL_VEHICLES :Odstrániť vš STR_GROUP_RENAME_CAPTION :{BLACK}Premenovať skupinu -STR_GROUP_PROFIT_THIS_YEAR :Profit v tomto roku: -STR_GROUP_PROFIT_LAST_YEAR :Profit v minulom roku: +STR_GROUP_PROFIT_THIS_YEAR :Zisk v tomto roku: +STR_GROUP_PROFIT_LAST_YEAR :Zisk v minulom roku: STR_GROUP_OCCUPANCY :Súčasné využitie: STR_GROUP_OCCUPANCY_VALUE :{NUM}% @@ -3927,6 +3962,9 @@ STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Dolet: { STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}Typ lietadla: {GOLD}{STRING} ###length 3 +STR_CARGO_TYPE_FILTER_ALL :Všetky druhy nákladu +STR_CARGO_TYPE_FILTER_FREIGHT :Nákladné +STR_CARGO_TYPE_FILTER_NONE :Žiadne ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Výber vlakov. Pre získanie informácií klikni na vlak. CTRL+klik prepne skrytie typu vlaku. @@ -4254,7 +4292,8 @@ STR_VEHICLE_INFO_MAX_SPEED_TYPE_RANGE :{BLACK}Rýchlos STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Hmotnosť: {LTBLUE}{WEIGHT_SHORT} {BLACK}Sila: {LTBLUE}{POWER}{BLACK} Max. rýchlosť: {LTBLUE}{VELOCITY} STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Hmotnosť: {LTBLUE}{WEIGHT_SHORT} {BLACK}Sila: {LTBLUE}{POWER}{BLACK} Max. rýchlosť: {LTBLUE}{VELOCITY} {BLACK}Max. T.E.: {LTBLUE}{FORCE} -STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Profit tento rok: {LTBLUE}{CURRENCY_LONG} (minulý rok: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Zisk v tomto roku: {LTBLUE}{CURRENCY_LONG} (minulý rok: {CURRENCY_LONG}) +STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Zisk v tomto roku: {LTBLUE}{CURRENCY_LONG} (minulý rok: {CURRENCY_LONG}) {BLACK}Min. výkon: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Spoľahlivosť: {LTBLUE}{COMMA}% {BLACK}Poruchy od posledného servisu: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Vyrobený: {LTBLUE}{NUM}{BLACK} Cena: {LTBLUE}{CURRENCY_LONG} @@ -4588,6 +4627,8 @@ STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Jeden z STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}Okno ladenia AI/skriptu je dostupné len pre server # AI configuration window +STR_AI_CONFIG_CAPTION_AI :{WHITE}Konfigurácia AI +STR_AI_CONFIG_CAPTION_GAMESCRIPT :{WHITE}Konfigurácia skriptu STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}Skript, ktorý bude načítaný v ďalšej hre STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}AI, ktoré budú načítané v ďalšiej hre STR_AI_CONFIG_HUMAN_PLAYER :Človek @@ -4601,10 +4642,11 @@ STR_AI_CONFIG_MOVE_DOWN :{BLACK}Posunú STR_AI_CONFIG_MOVE_DOWN_TOOLTIP :{BLACK}Posunúť nižšie vybrané AI v zozname STR_AI_CONFIG_GAMESCRIPT :{SILVER}Herný skript +STR_AI_CONFIG_GAMESCRIPT_PARAM :{SILVER}Parametre STR_AI_CONFIG_AI :{SILVER}AI (umelá inteligencia) -STR_AI_CONFIG_CHANGE_AI :AI -STR_AI_CONFIG_CHANGE_GAMESCRIPT :Skript +STR_AI_CONFIG_CHANGE_AI :{BLACK}Vyber AI +STR_AI_CONFIG_CHANGE_GAMESCRIPT :{BLACK}Vyber skript STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Spusti ďalší skript STR_AI_CONFIG_CONFIGURE :{BLACK}Nastaviť STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}Nastaviť parametre skriptu @@ -4633,7 +4675,7 @@ STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Snímka STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Snímka minimapy # AI Parameters -STR_AI_SETTINGS_CAPTION_AI :Umelá inteligencia +STR_AI_SETTINGS_CAPTION_AI :{WHITE}Parametre AI STR_AI_SETTINGS_CLOSE :{BLACK}Zavrieť STR_AI_SETTINGS_RESET :{BLACK}Resetovať STR_AI_SETTINGS_SETTING :{STRING}: {ORANGE}{STRING} From 5e14a20b3b6be26aa4e6e0a35316eb8f8950a1b8 Mon Sep 17 00:00:00 2001 From: dP Date: Sat, 26 Nov 2022 21:03:03 +0400 Subject: [PATCH 38/42] Feature: [GS] Scriptable league tables (#10001) --- src/CMakeLists.txt | 6 + src/command.cpp | 1 + src/command_type.h | 6 + src/graph_gui.cpp | 185 ------------ src/graph_gui.h | 1 - src/league_base.h | 68 +++++ src/league_cmd.cpp | 176 ++++++++++++ src/league_cmd.h | 29 ++ src/league_gui.cpp | 452 ++++++++++++++++++++++++++++++ src/league_gui.h | 19 ++ src/league_type.h | 40 +++ src/network/network_command.cpp | 1 + src/saveload/CMakeLists.txt | 1 + src/saveload/league_sl.cpp | 89 ++++++ src/saveload/saveload.cpp | 2 + src/script/api/CMakeLists.txt | 2 + src/script/api/game_changelog.hpp | 1 + src/script/api/script_league.cpp | 122 ++++++++ src/script/api/script_league.hpp | 134 +++++++++ src/script/script_instance.cpp | 12 + src/script/script_instance.hpp | 10 + src/toolbar_gui.cpp | 115 +++++--- src/widgets/CMakeLists.txt | 1 + src/widgets/graph_widget.h | 5 - src/widgets/league_widget.h | 24 ++ 25 files changed, 1272 insertions(+), 230 deletions(-) create mode 100644 src/league_base.h create mode 100644 src/league_cmd.cpp create mode 100644 src/league_cmd.h create mode 100644 src/league_gui.cpp create mode 100644 src/league_gui.h create mode 100644 src/league_type.h create mode 100644 src/saveload/league_sl.cpp create mode 100644 src/script/api/script_league.cpp create mode 100644 src/script/api/script_league.hpp create mode 100644 src/widgets/league_widget.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e526c5d595..b27a4ca080 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -216,6 +216,12 @@ add_files( landscape_cmd.h landscape_type.h language.h + league_base.h + league_cmd.h + league_cmd.cpp + league_gui.h + league_gui.cpp + league_type.h livery.h main_gui.cpp map.cpp diff --git a/src/command.cpp b/src/command.cpp index 65e5acf10c..bd85690e2d 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -32,6 +32,7 @@ #include "goal_cmd.h" #include "group_cmd.h" #include "industry_cmd.h" +#include "league_cmd.h" #include "landscape_cmd.h" #include "misc_cmd.h" #include "news_cmd.h" diff --git a/src/command_type.h b/src/command_type.h index 85f5680aea..0ce1a9a58d 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -337,6 +337,12 @@ enum Commands : uint16 { CMD_OPEN_CLOSE_AIRPORT, ///< open/close an airport to incoming aircraft + CMD_CREATE_LEAGUE_TABLE, ///< create a new league table + CMD_CREATE_LEAGUE_TABLE_ELEMENT, ///< create a new element in a league table + CMD_UPDATE_LEAGUE_TABLE_ELEMENT_DATA, ///< update the data fields of a league table element + CMD_UPDATE_LEAGUE_TABLE_ELEMENT_SCORE, ///< update the score of a league table element + CMD_REMOVE_LEAGUE_TABLE_ELEMENT, ///< remove a league table element + CMD_END, ///< Must ALWAYS be on the end of this list!! (period) }; diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 4e2babf61f..792aee681a 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -18,7 +18,6 @@ #include "window_func.h" #include "date_func.h" #include "gfx_func.h" -#include "sortlist_type.h" #include "core/geometry_func.hpp" #include "currency.h" #include "zoom_func.h" @@ -1100,190 +1099,6 @@ void ShowCargoPaymentRates() AllocateWindowDescFront(&_cargo_payment_rates_desc, 0); } -/************************/ -/* COMPANY LEAGUE TABLE */ -/************************/ - -static const StringID _performance_titles[] = { - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ENGINEER, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ENGINEER, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRAFFIC_MANAGER, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRAFFIC_MANAGER, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRANSPORT_COORDINATOR, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRANSPORT_COORDINATOR, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ROUTE_SUPERVISOR, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ROUTE_SUPERVISOR, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_DIRECTOR, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_DIRECTOR, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHIEF_EXECUTIVE, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHIEF_EXECUTIVE, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHAIRMAN, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHAIRMAN, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_PRESIDENT, - STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TYCOON, -}; - -static inline StringID GetPerformanceTitleFromValue(uint value) -{ - return _performance_titles[std::min(value, 1000u) >> 6]; -} - -class CompanyLeagueWindow : public Window { -private: - GUIList companies; - uint ordinal_width; ///< The width of the ordinal number - uint text_width; ///< The width of the actual text - int line_height; ///< Height of the text lines - Dimension icon; ///< Dimenion of the company icon. - - /** - * (Re)Build the company league list - */ - void BuildCompanyList() - { - if (!this->companies.NeedRebuild()) return; - - this->companies.clear(); - - for (const Company *c : Company::Iterate()) { - this->companies.push_back(c); - } - - this->companies.shrink_to_fit(); - this->companies.RebuildDone(); - } - - /** Sort the company league by performance history */ - static bool PerformanceSorter(const Company * const &c1, const Company * const &c2) - { - return c2->old_economy[0].performance_history < c1->old_economy[0].performance_history; - } - -public: - CompanyLeagueWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc) - { - this->InitNested(window_number); - this->companies.ForceRebuild(); - this->companies.NeedResort(); - } - - void OnPaint() override - { - this->BuildCompanyList(); - this->companies.Sort(&PerformanceSorter); - - this->DrawWidgets(); - } - - void DrawWidget(const Rect &r, int widget) const override - { - if (widget != WID_CL_BACKGROUND) return; - - Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); - int icon_y_offset = (this->line_height - this->icon.height) / 2; - int text_y_offset = (this->line_height - FONT_HEIGHT_NORMAL) / 2; - - bool rtl = _current_text_dir == TD_RTL; - Rect ordinal = ir.WithWidth(this->ordinal_width, rtl); - uint icon_left = ir.Indent(rtl ? this->text_width : this->ordinal_width, rtl).left; - Rect text = ir.WithWidth(this->text_width, !rtl); - - for (uint i = 0; i != this->companies.size(); i++) { - const Company *c = this->companies[i]; - DrawString(ordinal.left, ordinal.right, ir.top + text_y_offset, i + STR_ORDINAL_NUMBER_1ST, i == 0 ? TC_WHITE : TC_YELLOW); - - DrawCompanyIcon(c->index, icon_left, ir.top + icon_y_offset); - - SetDParam(0, c->index); - SetDParam(1, c->index); - SetDParam(2, GetPerformanceTitleFromValue(c->old_economy[0].performance_history)); - DrawString(text.left, text.right, ir.top + text_y_offset, STR_COMPANY_LEAGUE_COMPANY_NAME); - ir.top += this->line_height; - } - } - - void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override - { - if (widget != WID_CL_BACKGROUND) return; - - this->ordinal_width = 0; - for (uint i = 0; i < MAX_COMPANIES; i++) { - this->ordinal_width = std::max(this->ordinal_width, GetStringBoundingBox(STR_ORDINAL_NUMBER_1ST + i).width); - } - this->ordinal_width += WidgetDimensions::scaled.hsep_wide; // Keep some extra spacing - - uint widest_width = 0; - uint widest_title = 0; - for (uint i = 0; i < lengthof(_performance_titles); i++) { - uint width = GetStringBoundingBox(_performance_titles[i]).width; - if (width > widest_width) { - widest_title = i; - widest_width = width; - } - } - - this->icon = GetSpriteSize(SPR_COMPANY_ICON); - this->line_height = std::max(this->icon.height + WidgetDimensions::scaled.vsep_normal, FONT_HEIGHT_NORMAL); - - for (const Company *c : Company::Iterate()) { - SetDParam(0, c->index); - SetDParam(1, c->index); - SetDParam(2, _performance_titles[widest_title]); - widest_width = std::max(widest_width, GetStringBoundingBox(STR_COMPANY_LEAGUE_COMPANY_NAME).width); - } - - this->text_width = widest_width + WidgetDimensions::scaled.hsep_indent * 3; // Keep some extra spacing - - size->width = WidgetDimensions::scaled.framerect.Horizontal() + this->ordinal_width + this->icon.width + this->text_width + WidgetDimensions::scaled.framerect.Horizontal(); - size->height = this->line_height * MAX_COMPANIES + WidgetDimensions::scaled.framerect.Vertical(); - } - - - void OnGameTick() override - { - if (this->companies.NeedResort()) { - this->SetDirty(); - } - } - - /** - * Some data on this window has become invalid. - * @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. - */ - void OnInvalidateData(int data = 0, bool gui_scope = true) override - { - if (data == 0) { - /* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */ - this->companies.ForceRebuild(); - } else { - this->companies.ForceResort(); - } - } -}; - -static const NWidgetPart _nested_company_league_widgets[] = { - NWidget(NWID_HORIZONTAL), - NWidget(WWT_CLOSEBOX, COLOUR_BROWN), - NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_COMPANY_LEAGUE_TABLE_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), - NWidget(WWT_SHADEBOX, COLOUR_BROWN), - NWidget(WWT_STICKYBOX, COLOUR_BROWN), - EndContainer(), - NWidget(WWT_PANEL, COLOUR_BROWN, WID_CL_BACKGROUND), SetMinimalSize(400, 0), SetMinimalTextLines(15, WidgetDimensions::unscaled.framerect.Vertical()), -}; - -static WindowDesc _company_league_desc( - WDP_AUTO, "league", 0, 0, - WC_COMPANY_LEAGUE, WC_NONE, - 0, - _nested_company_league_widgets, lengthof(_nested_company_league_widgets) -); - -void ShowCompanyLeagueTable() -{ - AllocateWindowDescFront(&_company_league_desc, 0); -} - /*****************************/ /* PERFORMANCE RATING DETAIL */ /*****************************/ diff --git a/src/graph_gui.h b/src/graph_gui.h index 8338878c01..32c7776456 100644 --- a/src/graph_gui.h +++ b/src/graph_gui.h @@ -16,7 +16,6 @@ void ShowDeliveredCargoGraph(); void ShowPerformanceHistoryGraph(); void ShowCompanyValueGraph(); void ShowCargoPaymentRates(); -void ShowCompanyLeagueTable(); void ShowPerformanceRatingDetail(); #endif /* GRAPH_GUI_H */ diff --git a/src/league_base.h b/src/league_base.h new file mode 100644 index 0000000000..8a70db4ca2 --- /dev/null +++ b/src/league_base.h @@ -0,0 +1,68 @@ +/* + * 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. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file league_base.h %LeagueTable base class. */ + +#ifndef LEAGUE_BASE_H +#define LEAGUE_BASE_H + +#include "company_type.h" +#include "goal_type.h" +#include "league_type.h" +#include "core/pool_type.hpp" + +bool IsValidLink(Link link); + +typedef Pool LeagueTableElementPool; +extern LeagueTableElementPool _league_table_element_pool; + +typedef Pool LeagueTablePool; +extern LeagueTablePool _league_table_pool; + + +/** + * Struct about league table elements. + * Each LeagueTable is composed of one or more elements. Elements are sorted by their rating (higher=better). + **/ +struct LeagueTableElement : LeagueTableElementPool::PoolItem<&_league_table_element_pool> { + LeagueTableID table; ///< Id of the table which this element belongs to + uint64 rating; ///< Value that determines ordering of elements in the table (higher=better) + CompanyID company; ///< Company Id to show the color blob for or INVALID_COMPANY + std::string text; ///< Text of the element + std::string score; ///< String representation of the score associated with the element + Link link; ///< What opens when element is clicked + + /** + * We need an (empty) constructor so struct isn't zeroed (as C++ standard states) + */ + LeagueTableElement() { } + + /** + * (Empty) destructor has to be defined else operator delete might be called with nullptr parameter + */ + ~LeagueTableElement() { } +}; + + +/** Struct about custom league tables */ +struct LeagueTable : LeagueTablePool::PoolItem<&_league_table_pool> { + std::string title; ///< Title of the table + std::string header; ///< Text to show above the table + std::string footer; ///< Text to show below the table + + /** + * We need an (empty) constructor so struct isn't zeroed (as C++ standard states) + */ + LeagueTable() { } + + /** + * (Empty) destructor has to be defined else operator delete might be called with nullptr parameter + */ + ~LeagueTable() { } +}; + +#endif /* LEAGUE_BASE_H */ diff --git a/src/league_cmd.cpp b/src/league_cmd.cpp new file mode 100644 index 0000000000..6e715fd030 --- /dev/null +++ b/src/league_cmd.cpp @@ -0,0 +1,176 @@ +/* + * 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. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file league_cmd.cpp Handling of league tables. */ + +#include "stdafx.h" +#include "league_cmd.h" +#include "league_base.h" +#include "command_type.h" +#include "command_func.h" +#include "industry.h" +#include "story_base.h" +#include "town.h" +#include "window_func.h" +#include "core/pool_func.hpp" + +#include "safeguards.h" + +LeagueTableElementPool _league_table_element_pool("LeagueTableElement"); +INSTANTIATE_POOL_METHODS(LeagueTableElement) + +LeagueTablePool _league_table_pool("LeagueTable"); +INSTANTIATE_POOL_METHODS(LeagueTable) + +/** + * Checks whether a link is valid, i.e. has a valid target. + * @param link the link to check + * @return true iff the link is valid + */ +bool IsValidLink(Link link) +{ + switch (link.type) { + case LT_NONE: return (link.target == 0); + case LT_TILE: return IsValidTile(link.target); + case LT_INDUSTRY: return Industry::IsValidID(link.target); + case LT_TOWN: return Town::IsValidID(link.target); + case LT_COMPANY: return Company::IsValidID(link.target); + case LT_STORY_PAGE: return StoryPage::IsValidID(link.target); + default: return false; + } + return false; +} + +/** + * Create a new league table. + * @param flags type of operation + * @param title Title of the league table + * @param header Text to show above the table + * @param footer Text to show below the table + * @return the cost of this operation or an error + */ +std::tuple CmdCreateLeagueTable(DoCommandFlag flags, const std::string &title, const std::string &header, const std::string &footer) +{ + if (_current_company != OWNER_DEITY) return { CMD_ERROR, INVALID_LEAGUE_TABLE }; + if (!LeagueTable::CanAllocateItem()) return { CMD_ERROR, INVALID_LEAGUE_TABLE }; + if (title.empty()) return { CMD_ERROR, INVALID_LEAGUE_TABLE }; + + if (flags & DC_EXEC) { + LeagueTable *lt = new LeagueTable(); + lt->title = title; + lt->header = header; + lt->footer = footer; + return { CommandCost(), lt->index }; + } + + return { CommandCost(), INVALID_LEAGUE_TABLE }; +} + + +/** + * Create a new element in a league table. + * @param flags type of operation + * @param table Id of the league table this element belongs to + * @param rating Value that elements are ordered by + * @param company Company to show the color blob for or INVALID_COMPANY + * @param text Text of the element + * @param score String representation of the score associated with the element + * @param link_type Type of the referenced object + * @param link_target Id of the referenced object + * @return the cost of this operation or an error + */ +std::tuple CmdCreateLeagueTableElement(DoCommandFlag flags, LeagueTableID table, int64 rating, CompanyID company, const std::string &text, const std::string &score, LinkType link_type, LinkTargetID link_target) +{ + if (_current_company != OWNER_DEITY) return { CMD_ERROR, INVALID_LEAGUE_TABLE_ELEMENT }; + if (!LeagueTableElement::CanAllocateItem()) return { CMD_ERROR, INVALID_LEAGUE_TABLE_ELEMENT }; + Link link{link_type, link_target}; + if (!IsValidLink(link)) return { CMD_ERROR, INVALID_LEAGUE_TABLE_ELEMENT }; + if (company != INVALID_COMPANY && !Company::IsValidID(company)) return { CMD_ERROR, INVALID_LEAGUE_TABLE_ELEMENT }; + + if (flags & DC_EXEC) { + LeagueTableElement *lte = new LeagueTableElement(); + lte->table = table; + lte->rating = rating; + lte->company = company; + lte->text = text; + lte->score = score; + lte->link = link; + InvalidateWindowData(WC_COMPANY_LEAGUE, table); + return { CommandCost(), lte->index }; + } + return { CommandCost(), INVALID_LEAGUE_TABLE_ELEMENT }; +} + +/** + * Update the attributes of a league table element. + * @param flags type of operation + * @param element Id of the element to update + * @param company Company to show the color blob for or INVALID_COMPANY + * @param text Text of the element + * @param link_type Type of the referenced object + * @param link_target Id of the referenced object + * @return the cost of this operation or an error + */ +CommandCost CmdUpdateLeagueTableElementData(DoCommandFlag flags, LeagueTableElementID element, CompanyID company, const std::string &text, LinkType link_type, LinkTargetID link_target) +{ + if (_current_company != OWNER_DEITY) return CMD_ERROR; + auto lte = LeagueTableElement::GetIfValid(element); + if (lte == nullptr) return CMD_ERROR; + if (company != INVALID_COMPANY && !Company::IsValidID(company)) return CMD_ERROR; + Link link{link_type, link_target}; + if (!IsValidLink(link)) return CMD_ERROR; + + if (flags & DC_EXEC) { + lte->company = company; + lte->text = text; + lte->link = link; + InvalidateWindowData(WC_COMPANY_LEAGUE, lte->table); + } + return CommandCost(); +} + +/** + * Update the score of a league table element. + * @param flags type of operation + * @param element Id of the element to update + * @param rating Value that elements are ordered by + * @param score String representation of the score associated with the element + * @return the cost of this operation or an error + */ +CommandCost CmdUpdateLeagueTableElementScore(DoCommandFlag flags, LeagueTableElementID element, int64 rating, const std::string &score) +{ + if (_current_company != OWNER_DEITY) return CMD_ERROR; + auto lte = LeagueTableElement::GetIfValid(element); + if (lte == nullptr) return CMD_ERROR; + + if (flags & DC_EXEC) { + lte->rating = rating; + lte->score = score; + InvalidateWindowData(WC_COMPANY_LEAGUE, lte->table); + } + return CommandCost(); +} + +/** + * Remove a league table element. + * @param flags type of operation + * @param element Id of the element to update + * @return the cost of this operation or an error + */ +CommandCost CmdRemoveLeagueTableElement(DoCommandFlag flags, LeagueTableElementID element) +{ + if (_current_company != OWNER_DEITY) return CMD_ERROR; + auto lte = LeagueTableElement::GetIfValid(element); + if (lte == nullptr) return CMD_ERROR; + + if (flags & DC_EXEC) { + auto table = lte->table; + delete lte; + InvalidateWindowData(WC_COMPANY_LEAGUE, table); + } + return CommandCost(); +} diff --git a/src/league_cmd.h b/src/league_cmd.h new file mode 100644 index 0000000000..e078f87af0 --- /dev/null +++ b/src/league_cmd.h @@ -0,0 +1,29 @@ +/* + * 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. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file league_cmd.h Command definitions related to league tables. */ + +#ifndef LEAGUE_CMD_H +#define LEAGUE_CMD_H + +#include "league_type.h" +#include "command_type.h" +#include "company_type.h" + +std::tuple CmdCreateLeagueTable(DoCommandFlag flags, const std::string &title, const std::string &header, const std::string &footer); +std::tuple CmdCreateLeagueTableElement(DoCommandFlag flags, LeagueTableID table, int64 rating, CompanyID company, const std::string &text, const std::string &score, LinkType link_type, LinkTargetID link_target); +CommandCost CmdUpdateLeagueTableElementData(DoCommandFlag flags, LeagueTableElementID element, CompanyID company, const std::string &text, LinkType link_type, LinkTargetID link_target); +CommandCost CmdUpdateLeagueTableElementScore(DoCommandFlag flags, LeagueTableElementID element, int64 rating, const std::string &score); +CommandCost CmdRemoveLeagueTableElement(DoCommandFlag flags, LeagueTableElementID element); + +DEF_CMD_TRAIT(CMD_CREATE_LEAGUE_TABLE, CmdCreateLeagueTable, CMD_DEITY, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_CREATE_LEAGUE_TABLE_ELEMENT, CmdCreateLeagueTableElement, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_UPDATE_LEAGUE_TABLE_ELEMENT_DATA, CmdUpdateLeagueTableElementData, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_UPDATE_LEAGUE_TABLE_ELEMENT_SCORE, CmdUpdateLeagueTableElementScore, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT) +DEF_CMD_TRAIT(CMD_REMOVE_LEAGUE_TABLE_ELEMENT, CmdRemoveLeagueTableElement, CMD_DEITY, CMDT_OTHER_MANAGEMENT) + +#endif /* LEAGUE_CMD_H */ diff --git a/src/league_gui.cpp b/src/league_gui.cpp new file mode 100644 index 0000000000..a46cd2efa6 --- /dev/null +++ b/src/league_gui.cpp @@ -0,0 +1,452 @@ +/* + * 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. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file league_gui.cpp GUI for league tables. */ + +#include "stdafx.h" +#include "league_gui.h" + +#include "company_base.h" +#include "company_gui.h" +#include "gui.h" +#include "industry.h" +#include "league_base.h" +#include "sortlist_type.h" +#include "story_base.h" +#include "strings_func.h" +#include "tile_map.h" +#include "town.h" +#include "viewport_func.h" +#include "window_gui.h" +#include "widgets/league_widget.h" +#include "table/strings.h" +#include "table/sprites.h" + +#include "safeguards.h" + + +static const StringID _performance_titles[] = { + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ENGINEER, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ENGINEER, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRAFFIC_MANAGER, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRAFFIC_MANAGER, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRANSPORT_COORDINATOR, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRANSPORT_COORDINATOR, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ROUTE_SUPERVISOR, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ROUTE_SUPERVISOR, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_DIRECTOR, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_DIRECTOR, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHIEF_EXECUTIVE, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHIEF_EXECUTIVE, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHAIRMAN, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHAIRMAN, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_PRESIDENT, + STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TYCOON, +}; + +static inline StringID GetPerformanceTitleFromValue(uint value) +{ + return _performance_titles[std::min(value, 1000u) >> 6]; +} + +class PerformanceLeagueWindow : public Window { +private: + GUIList companies; + uint ordinal_width; ///< The width of the ordinal number + uint text_width; ///< The width of the actual text + int line_height; ///< Height of the text lines + Dimension icon; ///< Dimension of the company icon. + + /** + * (Re)Build the company league list + */ + void BuildCompanyList() + { + if (!this->companies.NeedRebuild()) return; + + this->companies.clear(); + + for (const Company *c : Company::Iterate()) { + this->companies.push_back(c); + } + + this->companies.shrink_to_fit(); + this->companies.RebuildDone(); + } + + /** Sort the company league by performance history */ + static bool PerformanceSorter(const Company * const &c1, const Company * const &c2) + { + return c2->old_economy[0].performance_history < c1->old_economy[0].performance_history; + } + +public: + PerformanceLeagueWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc) + { + this->InitNested(window_number); + this->companies.ForceRebuild(); + this->companies.NeedResort(); + } + + void OnPaint() override + { + this->BuildCompanyList(); + this->companies.Sort(&PerformanceSorter); + + this->DrawWidgets(); + } + + void DrawWidget(const Rect &r, int widget) const override + { + if (widget != WID_PLT_BACKGROUND) return; + + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); + int icon_y_offset = (this->line_height - this->icon.height) / 2; + int text_y_offset = (this->line_height - FONT_HEIGHT_NORMAL) / 2; + + bool rtl = _current_text_dir == TD_RTL; + Rect ordinal = ir.WithWidth(this->ordinal_width, rtl); + uint icon_left = ir.Indent(rtl ? this->text_width : this->ordinal_width, rtl).left; + Rect text = ir.WithWidth(this->text_width, !rtl); + + for (uint i = 0; i != this->companies.size(); i++) { + const Company *c = this->companies[i]; + DrawString(ordinal.left, ordinal.right, ir.top + text_y_offset, i + STR_ORDINAL_NUMBER_1ST, i == 0 ? TC_WHITE : TC_YELLOW); + + DrawCompanyIcon(c->index, icon_left, ir.top + icon_y_offset); + + SetDParam(0, c->index); + SetDParam(1, c->index); + SetDParam(2, GetPerformanceTitleFromValue(c->old_economy[0].performance_history)); + DrawString(text.left, text.right, ir.top + text_y_offset, STR_COMPANY_LEAGUE_COMPANY_NAME); + ir.top += this->line_height; + } + } + + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override + { + if (widget != WID_PLT_BACKGROUND) return; + + this->ordinal_width = 0; + for (uint i = 0; i < MAX_COMPANIES; i++) { + this->ordinal_width = std::max(this->ordinal_width, GetStringBoundingBox(STR_ORDINAL_NUMBER_1ST + i).width); + } + this->ordinal_width += WidgetDimensions::scaled.hsep_wide; // Keep some extra spacing + + uint widest_width = 0; + uint widest_title = 0; + for (uint i = 0; i < lengthof(_performance_titles); i++) { + uint width = GetStringBoundingBox(_performance_titles[i]).width; + if (width > widest_width) { + widest_title = i; + widest_width = width; + } + } + + this->icon = GetSpriteSize(SPR_COMPANY_ICON); + this->line_height = std::max(this->icon.height + WidgetDimensions::scaled.vsep_normal, FONT_HEIGHT_NORMAL); + + for (const Company *c : Company::Iterate()) { + SetDParam(0, c->index); + SetDParam(1, c->index); + SetDParam(2, _performance_titles[widest_title]); + widest_width = std::max(widest_width, GetStringBoundingBox(STR_COMPANY_LEAGUE_COMPANY_NAME).width); + } + + this->text_width = widest_width + WidgetDimensions::scaled.hsep_indent * 3; // Keep some extra spacing + + size->width = WidgetDimensions::scaled.framerect.Horizontal() + this->ordinal_width + this->icon.width + this->text_width + WidgetDimensions::scaled.hsep_wide; + size->height = this->line_height * MAX_COMPANIES + WidgetDimensions::scaled.framerect.Vertical(); + } + + void OnGameTick() override + { + if (this->companies.NeedResort()) { + this->SetDirty(); + } + } + + /** + * Some data on this window has become invalid. + * @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. + */ + void OnInvalidateData(int data = 0, bool gui_scope = true) override + { + if (data == 0) { + /* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */ + this->companies.ForceRebuild(); + } else { + this->companies.ForceResort(); + } + } +}; + +static const NWidgetPart _nested_performance_league_widgets[] = { + NWidget(NWID_HORIZONTAL), + NWidget(WWT_CLOSEBOX, COLOUR_BROWN), + NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_COMPANY_LEAGUE_TABLE_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), + NWidget(WWT_SHADEBOX, COLOUR_BROWN), + NWidget(WWT_STICKYBOX, COLOUR_BROWN), + EndContainer(), + NWidget(WWT_PANEL, COLOUR_BROWN, WID_PLT_BACKGROUND), SetMinimalSize(400, 0), SetMinimalTextLines(15, WidgetDimensions::unscaled.framerect.Vertical()), +}; + +static WindowDesc _performance_league_desc( + WDP_AUTO, "league", 0, 0, + WC_COMPANY_LEAGUE, WC_NONE, + 0, + _nested_performance_league_widgets, lengthof(_nested_performance_league_widgets) +); + +void ShowPerformanceLeagueTable() +{ + AllocateWindowDescFront(&_performance_league_desc, 0); +} + +static void HandleLinkClick(Link link) +{ + TileIndex xy; + switch (link.type) { + case LT_NONE: return; + + case LT_TILE: + if (!IsValidTile(link.target)) return; + xy = link.target; + break; + + case LT_INDUSTRY: + if (!Industry::IsValidID(link.target)) return; + xy = Industry::Get(link.target)->location.tile; + break; + + case LT_TOWN: + if (!Town::IsValidID(link.target)) return; + xy = Town::Get(link.target)->xy; + break; + + case LT_COMPANY: + ShowCompany((CompanyID)link.target); + return; + + case LT_STORY_PAGE: { + if (!StoryPage::IsValidID(link.target)) return; + CompanyID story_company = StoryPage::Get(link.target)->company; + ShowStoryBook(story_company, link.target); + return; + } + + default: NOT_REACHED(); + } + + if (_ctrl_pressed) { + ShowExtraViewportWindow(xy); + } else { + ScrollMainWindowToTile(xy); + } +} + + +class ScriptLeagueWindow : public Window { +private: + LeagueTableID table; + std::vector> rows; + uint rank_width; ///< The width of the rank ordinal + uint text_width; ///< The width of the actual text + uint score_width; ///< The width of the score text + uint header_height; ///< Height of the table header + int line_height; ///< Height of the text lines + Dimension icon_size; ///< Dimenion of the company icon. + std::string title; + + /** + * Rebuild the company league list + */ + void BuildTable() + { + this->rows.clear(); + this->title = std::string{}; + auto lt = LeagueTable::GetIfValid(this->table); + if (lt == nullptr) return; + + /* We store title in the window class so we can safely reference the string later */ + this->title = lt->title; + + std::vector elements; + for(LeagueTableElement *lte : LeagueTableElement::Iterate()) { + if (lte->table == this->table) { + elements.push_back(lte); + } + } + std::sort(elements.begin(), elements.end(), [](auto a, auto b) { return a->rating > b->rating; }); + + /* Calculate rank, companies with the same rating share the ranks */ + uint rank = 0; + for (uint i = 0; i != elements.size(); i++) { + auto *lte = elements[i]; + if (i > 0 && elements[i - 1]->rating != lte->rating) rank = i; + this->rows.emplace_back(std::make_pair(rank, lte)); + } + } + +public: + ScriptLeagueWindow(WindowDesc *desc, LeagueTableID table) : Window(desc) + { + this->table = table; + this->BuildTable(); + this->InitNested(table); + } + + void SetStringParameters(int widget) const override + { + if (widget != WID_SLT_CAPTION) return; + SetDParamStr(0, this->title); + } + + void OnPaint() override + { + this->DrawWidgets(); + } + + void DrawWidget(const Rect &r, int widget) const override + { + if (widget != WID_SLT_BACKGROUND) return; + + auto lt = LeagueTable::GetIfValid(this->table); + if (lt == nullptr) return; + + Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); + + if (!lt->header.empty()) { + SetDParamStr(0, lt->header); + ir.top = DrawStringMultiLine(ir.left, ir.right, ir.top, UINT16_MAX, STR_JUST_RAW_STRING, TC_BLACK) + WidgetDimensions::scaled.vsep_wide; + } + + int icon_y_offset = (this->line_height - this->icon_size.height) / 2; + int text_y_offset = (this->line_height - FONT_HEIGHT_NORMAL) / 2; + + /* Calculate positions.of the columns */ + bool rtl = _current_text_dir == TD_RTL; + int spacer = WidgetDimensions::scaled.hsep_wide; + Rect rank_rect = ir.WithWidth(this->rank_width, rtl); + Rect icon_rect = ir.Indent(this->rank_width + (rtl ? 0 : spacer), rtl).WithWidth(this->icon_size.width, rtl); + Rect text_rect = ir.Indent(this->rank_width + spacer + this->icon_size.width, rtl).WithWidth(this->text_width, rtl); + Rect score_rect = ir.Indent(this->rank_width + 2 * spacer + this->icon_size.width + this->text_width, rtl).WithWidth(this->score_width, rtl); + + for (auto [rank, lte] : this->rows) { + DrawString(rank_rect.left, rank_rect.right, ir.top + text_y_offset, rank + STR_ORDINAL_NUMBER_1ST, rank == 0 ? TC_WHITE : TC_YELLOW); + if (this->icon_size.width > 0 && lte->company != INVALID_COMPANY) DrawCompanyIcon(lte->company, icon_rect.left, ir.top + icon_y_offset); + SetDParamStr(0, lte->text); + DrawString(text_rect.left, text_rect.right, ir.top + text_y_offset, STR_JUST_RAW_STRING, TC_BLACK); + SetDParamStr(0, lte->score); + DrawString(score_rect.left, score_rect.right, ir.top + text_y_offset, STR_JUST_RAW_STRING, TC_BLACK, SA_RIGHT); + ir.top += this->line_height; + } + + if (!lt->footer.empty()) { + ir.top += WidgetDimensions::scaled.vsep_wide; + SetDParamStr(0, lt->footer); + ir.top = DrawStringMultiLine(ir.left, ir.right, ir.top, UINT16_MAX, STR_JUST_RAW_STRING, TC_BLACK); + } + } + + void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override + { + if (widget != WID_SLT_BACKGROUND) return; + + auto lt = LeagueTable::GetIfValid(this->table); + if (lt == nullptr) return; + + this->icon_size = GetSpriteSize(SPR_COMPANY_ICON); + this->line_height = std::max(this->icon_size.height + WidgetDimensions::scaled.fullbevel.Vertical(), FONT_HEIGHT_NORMAL); + + /* Calculate maximum width of every column */ + this->rank_width = this->text_width = this->score_width = 0; + bool show_icon_column = false; + for (auto [rank, lte] : this->rows) { + this->rank_width = std::max(this->rank_width, GetStringBoundingBox(STR_ORDINAL_NUMBER_1ST + rank).width); + SetDParamStr(0, lte->text); + this->text_width = std::max(this->text_width, GetStringBoundingBox(STR_JUST_RAW_STRING).width); + SetDParamStr(0, lte->score); + this->score_width = std::max(this->score_width, GetStringBoundingBox(STR_JUST_RAW_STRING).width); + if (lte->company != INVALID_COMPANY) show_icon_column = true; + } + + if (!show_icon_column) this->icon_size.width = 0; + else this->icon_size.width += WidgetDimensions::scaled.hsep_wide; + + size->width = this->rank_width + this->icon_size.width + this->text_width + this->score_width + WidgetDimensions::scaled.framerect.Horizontal() + WidgetDimensions::scaled.hsep_wide * 2; + size->height = this->line_height * std::max(3u, (unsigned)this->rows.size()) + WidgetDimensions::scaled.framerect.Vertical(); + + if (!lt->header.empty()) { + SetDParamStr(0, lt->header); + this->header_height = GetStringHeight(STR_JUST_RAW_STRING, size->width - WidgetDimensions::scaled.framerect.Horizontal()) + WidgetDimensions::scaled.vsep_wide; + size->height += header_height; + } else this->header_height = 0; + + if (!lt->footer.empty()) { + SetDParamStr(0, lt->footer); + size->height += GetStringHeight(STR_JUST_RAW_STRING, size->width - WidgetDimensions::scaled.framerect.Horizontal()) + WidgetDimensions::scaled.vsep_wide; + } + } + + void OnClick(Point pt, int widget, int click_count) override + { + if (widget != WID_SLT_BACKGROUND) return; + + auto *wid = this->GetWidget(WID_SLT_BACKGROUND); + int index = (pt.y - WidgetDimensions::scaled.framerect.top - wid->pos_y - this->header_height) / this->line_height; + if (index >= 0 && (uint)index < this->rows.size()) { + auto lte = this->rows[index].second; + HandleLinkClick(lte->link); + } + } + + /** + * Some data on this window has become invalid. + * @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. + */ + void OnInvalidateData(int data = 0, bool gui_scope = true) override + { + this->BuildTable(); + this->ReInit(); + } +}; + +static const NWidgetPart _nested_script_league_widgets[] = { + NWidget(NWID_HORIZONTAL), + NWidget(WWT_CLOSEBOX, COLOUR_BROWN), + NWidget(WWT_CAPTION, COLOUR_BROWN, WID_SLT_CAPTION), SetDataTip(STR_BLACK_RAW_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), + NWidget(WWT_SHADEBOX, COLOUR_BROWN), + NWidget(WWT_STICKYBOX, COLOUR_BROWN), + EndContainer(), + NWidget(WWT_PANEL, COLOUR_BROWN, WID_SLT_BACKGROUND), SetMinimalSize(400, 0), SetMinimalTextLines(15, WidgetDimensions::scaled.framerect.Vertical()), +}; + +static WindowDesc _script_league_desc( + WDP_AUTO, "league", 0, 0, + WC_COMPANY_LEAGUE, WC_NONE, + 0, + _nested_script_league_widgets, lengthof(_nested_script_league_widgets) +); + +void ShowScriptLeagueTable(LeagueTableID table) +{ + if (!LeagueTable::IsValidID(table)) return; + AllocateWindowDescFront(&_script_league_desc, table); +} + +void ShowFirstLeagueTable() +{ + auto it = LeagueTable::Iterate(); + if (!it.empty()) { + ShowScriptLeagueTable((*it.begin())->index); + } else { + ShowPerformanceLeagueTable(); + } +} diff --git a/src/league_gui.h b/src/league_gui.h new file mode 100644 index 0000000000..602979f1f6 --- /dev/null +++ b/src/league_gui.h @@ -0,0 +1,19 @@ +/* + * 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. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file league_gui.h League table GUI functions. */ + +#ifndef LEAGUE_GUI_H +#define LEAGUE_GUI_H + +#include "league_type.h" + +void ShowPerformanceLeagueTable(); +void ShowScriptLeagueTable(LeagueTableID table); +void ShowFirstLeagueTable(); + +#endif /* LEAGUE_GUI_H */ diff --git a/src/league_type.h b/src/league_type.h new file mode 100644 index 0000000000..3344bc206e --- /dev/null +++ b/src/league_type.h @@ -0,0 +1,40 @@ +/* + * 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. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file league_type.h basic types related to league tables */ + +#ifndef LEAGUE_TYPE_H +#define LEAGUE_TYPE_H + +/** Types of the possible link targets. */ +enum LinkType : byte { + LT_NONE = 0, ///< No link + LT_TILE = 1, ///< Link a tile + LT_INDUSTRY = 2, ///< Link an industry + LT_TOWN = 3, ///< Link a town + LT_COMPANY = 4, ///< Link a company + LT_STORY_PAGE = 5, ///< Link a story page +}; + +typedef uint32 LinkTargetID; ///< Contains either tile, industry ID, town ID, story page ID or company ID + +struct Link { + LinkType type; + LinkTargetID target; + Link(LinkType type, LinkTargetID target): type{type}, target{target} {} + Link(): Link(LT_NONE, 0) {} +}; + +typedef uint8 LeagueTableID; ///< ID of a league table +struct LeagueTable; +static const LeagueTableID INVALID_LEAGUE_TABLE = 0xFF; ///< Invalid/unknown index of LeagueTable + +typedef uint16 LeagueTableElementID; ///< ID of a league table element +struct LeagueTableElement; +static const LeagueTableElementID INVALID_LEAGUE_TABLE_ELEMENT = 0xFFFF; ///< Invalid/unknown index of LeagueTableElement + +#endif /* LEAGUE_TYPE_H */ diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 29b7472923..2285b53360 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -26,6 +26,7 @@ #include "../group_cmd.h" #include "../industry_cmd.h" #include "../landscape_cmd.h" +#include "../league_cmd.h" #include "../misc_cmd.h" #include "../news_cmd.h" #include "../object_cmd.h" diff --git a/src/saveload/CMakeLists.txt b/src/saveload/CMakeLists.txt index 32bcc57ac1..3eea5b6741 100644 --- a/src/saveload/CMakeLists.txt +++ b/src/saveload/CMakeLists.txt @@ -19,6 +19,7 @@ add_files( group_sl.cpp industry_sl.cpp labelmaps_sl.cpp + league_sl.cpp linkgraph_sl.cpp map_sl.cpp misc_sl.cpp diff --git a/src/saveload/league_sl.cpp b/src/saveload/league_sl.cpp new file mode 100644 index 0000000000..7bc66830c3 --- /dev/null +++ b/src/saveload/league_sl.cpp @@ -0,0 +1,89 @@ +/* + * 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. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file league_sl.cpp Code handling saving and loading of league tables */ + +#include "../stdafx.h" + +#include "saveload.h" + +#include "../league_base.h" + +#include "../safeguards.h" + +static const SaveLoad _league_table_elements_desc[] = { + SLE_VAR(LeagueTableElement, table, SLE_UINT8), + SLE_VAR(LeagueTableElement, rating, SLE_UINT64), + SLE_VAR(LeagueTableElement, company, SLE_UINT8), + SLE_SSTR(LeagueTableElement, text, SLE_STR | SLF_ALLOW_CONTROL), + SLE_SSTR(LeagueTableElement, score, SLE_STR | SLF_ALLOW_CONTROL), + SLE_VAR(LeagueTableElement, link.type, SLE_UINT8), + SLE_VAR(LeagueTableElement, link.target, SLE_UINT32), +}; + +struct LEAEChunkHandler : ChunkHandler { + LEAEChunkHandler() : ChunkHandler('LEAE', CH_TABLE) {} + + void Save() const override + { + SlTableHeader(_league_table_elements_desc); + + for (LeagueTableElement *lte : LeagueTableElement::Iterate()) { + SlSetArrayIndex(lte->index); + SlObject(lte, _league_table_elements_desc); + } + } + + void Load() const override + { + const std::vector slt = SlTableHeader(_league_table_elements_desc); + + int index; + while ((index = SlIterateArray()) != -1) { + LeagueTableElement *lte = new (index) LeagueTableElement(); + SlObject(lte, slt); + } + } +}; + +static const SaveLoad _league_tables_desc[] = { + SLE_SSTR(LeagueTable, title, SLE_STR | SLF_ALLOW_CONTROL), +}; + +struct LEATChunkHandler : ChunkHandler { + LEATChunkHandler() : ChunkHandler('LEAT', CH_TABLE) {} + + void Save() const override + { + SlTableHeader(_league_tables_desc); + + for (LeagueTable *lt : LeagueTable::Iterate()) { + SlSetArrayIndex(lt->index); + SlObject(lt, _league_tables_desc); + } + } + + void Load() const override + { + const std::vector slt = SlTableHeader(_league_tables_desc); + + int index; + while ((index = SlIterateArray()) != -1) { + LeagueTable *lt = new (index) LeagueTable(); + SlObject(lt, slt); + } + } +}; + +static const LEAEChunkHandler LEAE; +static const LEATChunkHandler LEAT; +static const ChunkHandlerRef league_chunk_handlers[] = { + LEAE, + LEAT, +}; + +extern const ChunkHandlerTable _league_chunk_handlers(league_chunk_handlers); diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index c8a1a0d29c..be53ef43a6 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -240,6 +240,7 @@ static const std::vector &ChunkHandlers() extern const ChunkHandlerTable _cargomonitor_chunk_handlers; extern const ChunkHandlerTable _goal_chunk_handlers; extern const ChunkHandlerTable _story_page_chunk_handlers; + extern const ChunkHandlerTable _league_chunk_handlers; extern const ChunkHandlerTable _ai_chunk_handlers; extern const ChunkHandlerTable _game_chunk_handlers; extern const ChunkHandlerTable _animated_tile_chunk_handlers; @@ -271,6 +272,7 @@ static const std::vector &ChunkHandlers() _cargomonitor_chunk_handlers, _goal_chunk_handlers, _story_page_chunk_handlers, + _league_chunk_handlers, _engine_chunk_handlers, _town_chunk_handlers, _sign_chunk_handlers, diff --git a/src/script/api/CMakeLists.txt b/src/script/api/CMakeLists.txt index 594d3c46a7..de559d2229 100644 --- a/src/script/api/CMakeLists.txt +++ b/src/script/api/CMakeLists.txt @@ -177,6 +177,7 @@ add_files( script_industrytypelist.hpp script_info_docs.hpp script_infrastructure.hpp + script_league.hpp script_list.hpp script_log.hpp script_map.hpp @@ -247,6 +248,7 @@ add_files( script_industrytype.cpp script_industrytypelist.cpp script_infrastructure.cpp + script_league.cpp script_list.cpp script_log.cpp script_map.cpp diff --git a/src/script/api/game_changelog.hpp b/src/script/api/game_changelog.hpp index 592550ec1b..69773edeeb 100644 --- a/src/script/api/game_changelog.hpp +++ b/src/script/api/game_changelog.hpp @@ -21,6 +21,7 @@ * \li GSCargo::GetWeight * \li GSIndustryType::ResolveNewGRFID * \li GSObjectType::ResolveNewGRFID + * \li GSLeagueTable * * Other changes: * \li GSRoad::HasRoadType now correctly checks RoadType against RoadType diff --git a/src/script/api/script_league.cpp b/src/script/api/script_league.cpp new file mode 100644 index 0000000000..d50eff8446 --- /dev/null +++ b/src/script/api/script_league.cpp @@ -0,0 +1,122 @@ +/* + * 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. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file script_league.cpp Implementation of ScriptLeagueTable. */ + +#include "../../stdafx.h" + +#include "script_league.hpp" + +#include "../script_instance.hpp" +#include "script_error.hpp" +#include "../../league_base.h" +#include "../../league_cmd.h" + +#include "../../safeguards.h" + + +/* static */ bool ScriptLeagueTable::IsValidLeagueTable(LeagueTableID table_id) +{ + return ::LeagueTable::IsValidID(table_id); +} + +/* static */ ScriptLeagueTable::LeagueTableID ScriptLeagueTable::New(Text *title, Text *header, Text *footer) +{ + CCountedPtr title_counter(title); + CCountedPtr header_counter(header); + CCountedPtr footer_counter(footer); + + EnforcePrecondition(LEAGUE_TABLE_INVALID, ScriptObject::GetCompany() == OWNER_DEITY); + EnforcePrecondition(LEAGUE_TABLE_INVALID, title != nullptr); + const char *encoded_title = title->GetEncodedText(); + EnforcePreconditionEncodedText(LEAGUE_TABLE_INVALID, encoded_title); + + auto encoded_header = (header != nullptr ? std::string{ header->GetEncodedText() } : std::string{}); + auto encoded_footer = (footer != nullptr ? std::string{ footer->GetEncodedText() } : std::string{}); + + if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnLeagueTableID, encoded_title, encoded_header, encoded_footer)) return LEAGUE_TABLE_INVALID; + + /* In case of test-mode, we return LeagueTableID 0 */ + return (ScriptLeagueTable::LeagueTableID)0; +} + +/* static */ bool ScriptLeagueTable::IsValidLeagueTableElement(LeagueTableElementID element_id) +{ + return ::LeagueTableElement::IsValidID(element_id); +} + +/* static */ ScriptLeagueTable::LeagueTableElementID ScriptLeagueTable::NewElement(ScriptLeagueTable::LeagueTableID table, int64 rating, ScriptCompany::CompanyID company, Text *text, Text *score, LinkType link_type, uint32 link_target) +{ + CCountedPtr text_counter(text); + CCountedPtr score_counter(score); + + EnforcePrecondition(LEAGUE_TABLE_ELEMENT_INVALID, ScriptObject::GetCompany() == OWNER_DEITY); + + EnforcePrecondition(LEAGUE_TABLE_ELEMENT_INVALID, IsValidLeagueTable(table)); + + EnforcePrecondition(LEAGUE_TABLE_ELEMENT_INVALID, company == ScriptCompany::COMPANY_INVALID || ScriptCompany::ResolveCompanyID(company) != ScriptCompany::COMPANY_INVALID); + CompanyID c = (::CompanyID)company; + if (company == ScriptCompany::COMPANY_INVALID) c = INVALID_COMPANY; + + EnforcePrecondition(LEAGUE_TABLE_ELEMENT_INVALID, text != nullptr); + const char *encoded_text_ptr = text->GetEncodedText(); + EnforcePreconditionEncodedText(LEAGUE_TABLE_ELEMENT_INVALID, encoded_text_ptr); + std::string encoded_text = encoded_text_ptr; // save into string so GetEncodedText can reuse the internal buffer + + EnforcePrecondition(LEAGUE_TABLE_ELEMENT_INVALID, score != nullptr); + const char *encoded_score = score->GetEncodedText(); + EnforcePreconditionEncodedText(LEAGUE_TABLE_ELEMENT_INVALID, encoded_score); + + EnforcePrecondition(LEAGUE_TABLE_ELEMENT_INVALID, IsValidLink(Link((::LinkType)link_type, link_target))); + + if (!ScriptObject::Command::Do(&ScriptInstance::DoCommandReturnLeagueTableElementID, table, rating, c, encoded_text, encoded_score, (::LinkType)link_type, (::LinkTargetID)link_target)) return LEAGUE_TABLE_ELEMENT_INVALID; + + /* In case of test-mode, we return LeagueTableElementID 0 */ + return (ScriptLeagueTable::LeagueTableElementID)0; +} + +/* static */ bool ScriptLeagueTable::UpdateElementData(LeagueTableElementID element, ScriptCompany::CompanyID company, Text *text, LinkType link_type, LinkTargetID link_target) +{ + CCountedPtr text_counter(text); + + EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); + EnforcePrecondition(false, IsValidLeagueTableElement(element)); + + EnforcePrecondition(false, company == ScriptCompany::COMPANY_INVALID || ScriptCompany::ResolveCompanyID(company) != ScriptCompany::COMPANY_INVALID); + CompanyID c = (::CompanyID)company; + if (company == ScriptCompany::COMPANY_INVALID) c = INVALID_COMPANY; + + EnforcePrecondition(false, text != nullptr); + const char *encoded_text = text->GetEncodedText(); + EnforcePreconditionEncodedText(false, encoded_text); + + EnforcePrecondition(false, IsValidLink(Link((::LinkType)link_type, link_target))); + + return ScriptObject::Command::Do(element, c, encoded_text, (::LinkType)link_type, (::LinkTargetID)link_target); +} + +/* static */ bool ScriptLeagueTable::UpdateElementScore(LeagueTableElementID element, int64 rating, Text *score) +{ + CCountedPtr score_counter(score); + + EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); + EnforcePrecondition(false, IsValidLeagueTableElement(element)); + + EnforcePrecondition(false, score != nullptr); + const char *encoded_score = score->GetEncodedText(); + EnforcePreconditionEncodedText(false, encoded_score); + + return ScriptObject::Command::Do(element, rating, encoded_score); +} + +/* static */ bool ScriptLeagueTable::RemoveElement(LeagueTableElementID element) +{ + EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); + EnforcePrecondition(false, IsValidLeagueTableElement(element)); + + return ScriptObject::Command::Do(element); +} diff --git a/src/script/api/script_league.hpp b/src/script/api/script_league.hpp new file mode 100644 index 0000000000..d6fc2bbfea --- /dev/null +++ b/src/script/api/script_league.hpp @@ -0,0 +1,134 @@ +/* + * 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. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file script_league.hpp Everything to manipulate league tables. */ + +#ifndef SCRIPT_LEAGUE_HPP +#define SCRIPT_LEAGUE_HPP + +#include "script_company.hpp" +#include "script_text.hpp" +#include "../../league_type.h" + +/** + * Class that handles league table related functions. + * + * To create a league table: + * 1. Create the league table + * 2. Create league table elements that will be shown in the table in the order of their rating (higher=better). + * + * @api game + */ +class ScriptLeagueTable : public ScriptObject { +public: + /** + * The league table IDs. + */ + enum LeagueTableID { + LEAGUE_TABLE_INVALID = ::INVALID_LEAGUE_TABLE, ///< An invalid league table id. + }; + + /** + * The league table element IDs. + */ + enum LeagueTableElementID { + LEAGUE_TABLE_ELEMENT_INVALID = ::INVALID_LEAGUE_TABLE_ELEMENT, ///< An invalid league table element id. + }; + + /** + * The type of a link. + */ + enum LinkType : byte { + LINK_NONE = ::LT_NONE, ///< No link + LINK_TILE = ::LT_TILE, ///< Link a tile + LINK_INDUSTRY = ::LT_INDUSTRY, ///< Link an industry + LINK_TOWN = ::LT_TOWN, ///< Link a town + LINK_COMPANY = ::LT_COMPANY, ///< Link a company + LINK_STORY_PAGE = ::LT_STORY_PAGE, ///< Link a story page + }; + + /** + * Check whether this is a valid league table ID. + * @param table_id The LeagueTableID to check. + * @return true iff this league table is valid. + */ + static bool IsValidLeagueTable(LeagueTableID table_id); + + /** + * Check whether this is a valid league table element ID. + * @param element_id The LeagueTableElementID to check. + * @return true iff this league table element is valid. + */ + static bool IsValidLeagueTableElement(LeagueTableElementID element_id); + + /** + * Create a new league table. + * @param title League table title (can be either a raw string, or ScriptText object). + * @return The new LeagueTableID, or LEAGUE_TABLE_INVALID if it failed. + * @pre No ScriptCompanyMode may be in scope. + * @pre title != nullptr && len(title) != 0. + */ + static LeagueTableID New(Text *title, Text *header, Text *footer); + + /** + * Create a new league table element. + * @param table Id of the league table this element belongs to. + * @param rating Value that elements are ordered by. + * @param company Company to show the color blob for or INVALID_COMPANY. + * @param text Text of the element (can be either a raw string, or ScriptText object). + * @param score String representation of the score associated with the element (can be either a raw string, or ScriptText object). + * @param link_type Type of the referenced object. + * @param link_target Id of the referenced object. + * @return The new LeagueTableElementID, or LEAGUE_TABLE_ELEMENT_INVALID if it failed. + * @pre No ScriptCompanyMode may be in scope. + * @pre IsValidLeagueTable(table). + * @pre text != nullptr && len(text) != 0. + * @pre score != nullptr && len(score) != 0. + * @pre IsValidLink(Link(link_type, link_target)). + */ + static LeagueTableElementID NewElement(LeagueTableID table, int64 rating, ScriptCompany::CompanyID company, Text *text, Text *score, LinkType link_type, LinkTargetID link_target); + + /** + * Update the attributes of a league table element. + * @param element Id of the element to update + * @param company Company to show the color blob for or INVALID_COMPANY. + * @param text Text of the element (can be either a raw string, or ScriptText object). + * @param link_type Type of the referenced object. + * @param link_target Id of the referenced object. + * @return True if the action succeeded. + * @pre No ScriptCompanyMode may be in scope. + * @pre IsValidLeagueTableElement(element). + * @pre text != nullptr && len(text) != 0. + * @pre IsValidLink(Link(link_type, link_target)). + */ + static bool UpdateElementData(LeagueTableElementID element, ScriptCompany::CompanyID company, Text *text, LinkType link_type, LinkTargetID link_target); + + /** + * Create a new league table element. + * @param element Id of the element to update + * @param rating Value that elements are ordered by. + * @param score String representation of the score associated with the element (can be either a raw string, or ScriptText object). + * @return True if the action succeeded. + * @pre No ScriptCompanyMode may be in scope. + * @pre IsValidLeagueTableElement(element). + * @pre score != nullptr && len(score) != 0. + */ + static bool UpdateElementScore(LeagueTableElementID element, int64 rating, Text *score); + + + /** + * Remove a league table element. + * @param element Id of the element to update + * @return True if the action succeeded. + * @pre No ScriptCompanyMode may be in scope. + * @pre IsValidLeagueTableElement(element). + */ + static bool RemoveElement(LeagueTableElementID element); +}; + + +#endif /* SCRIPT_LEAGUE_HPP */ diff --git a/src/script/script_instance.cpp b/src/script/script_instance.cpp index bcd8b2d4bd..55133491ba 100644 --- a/src/script/script_instance.cpp +++ b/src/script/script_instance.cpp @@ -26,6 +26,7 @@ #include "../company_base.h" #include "../company_func.h" #include "../fileio_func.h" +#include "../league_type.h" #include "../misc/endian_buffer.hpp" #include "../safeguards.h" @@ -298,6 +299,17 @@ void ScriptInstance::CollectGarbage() instance->engine->InsertResult(EndianBufferReader::ToValue(ScriptObject::GetLastCommandResData())); } +/* static */ void ScriptInstance::DoCommandReturnLeagueTableElementID(ScriptInstance *instance) +{ + instance->engine->InsertResult(EndianBufferReader::ToValue(ScriptObject::GetLastCommandResData())); +} + +/* static */ void ScriptInstance::DoCommandReturnLeagueTableID(ScriptInstance *instance) +{ + instance->engine->InsertResult(EndianBufferReader::ToValue(ScriptObject::GetLastCommandResData())); +} + + ScriptStorage *ScriptInstance::GetStorage() { return this->storage; diff --git a/src/script/script_instance.hpp b/src/script/script_instance.hpp index 57f8dcc72f..6ea5bb1332 100644 --- a/src/script/script_instance.hpp +++ b/src/script/script_instance.hpp @@ -115,6 +115,16 @@ public: */ static void DoCommandReturnStoryPageElementID(ScriptInstance *instance); + /** + * Return a LeagueTableID reply for a DoCommand. + */ + static void DoCommandReturnLeagueTableID(ScriptInstance *instance); + + /** + * Return a LeagueTableElementID reply for a DoCommand. + */ + static void DoCommandReturnLeagueTableElementID(ScriptInstance *instance); + /** * Get the controller attached to the instance. */ diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 0256cea5ea..1785a2021f 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -51,6 +51,8 @@ #include "guitimer_func.h" #include "screenshot_gui.h" #include "misc_cmd.h" +#include "league_gui.h" +#include "league_base.h" #include "widgets/toolbar_widget.h" @@ -250,7 +252,6 @@ static void PopupMainCompanyToolbMenu(Window *w, int widget, int grey = 0) PopupMainToolbMenu(w, widget, std::move(list), _local_company == COMPANY_SPECTATOR ? (widget == WID_TN_COMPANIES ? CTMN_CLIENT_LIST : CTMN_SPECTATOR) : (int)_local_company); } - static ToolbarMode _toolbar_mode; static CallBackFunction SelectSignTool() @@ -672,59 +673,95 @@ static CallBackFunction MenuClickGoal(int index) return CBF_NONE; } -/* --- Graphs button menu --- */ +/* --- Graphs and League Table button menu --- */ + +/** + * Enum for the League Toolbar's and Graph Toolbar's related buttons. + * Use continuous numbering as League Toolbar can be combined into the Graph Toolbar. + */ +static const int GRMN_OPERATING_PROFIT_GRAPH = -1; ///< Show operating profit graph +static const int GRMN_INCOME_GRAPH = -2; ///< Show income graph +static const int GRMN_DELIVERED_CARGO_GRAPH = -3; ///< Show delivered cargo graph +static const int GRMN_PERFORMANCE_HISTORY_GRAPH = -4; ///< Show performance history graph +static const int GRMN_COMPANY_VALUE_GRAPH = -5; ///< Show company value graph +static const int GRMN_CARGO_PAYMENT_RATES = -6; ///< Show cargo payment rates graph +static const int LTMN_PERFORMANCE_LEAGUE = -7; ///< Show default league table +static const int LTMN_PERFORMANCE_RATING = -8; ///< Show detailed performance rating +static const int LTMN_HIGHSCORE = -9; ///< Show highscrore table + +static void AddDropDownLeagueTableOptions(DropDownList &list) { + if (LeagueTable::GetNumItems() > 0) { + for (LeagueTable *lt : LeagueTable::Iterate()) { + list.emplace_back(new DropDownListCharStringItem(lt->title, lt->index, false)); + } + } else { + list.emplace_back(new DropDownListStringItem(STR_GRAPH_MENU_COMPANY_LEAGUE_TABLE, LTMN_PERFORMANCE_LEAGUE, false)); + list.emplace_back(new DropDownListStringItem(STR_GRAPH_MENU_DETAILED_PERFORMANCE_RATING, LTMN_PERFORMANCE_RATING, false)); + if (!_networking) { + list.emplace_back(new DropDownListStringItem(STR_GRAPH_MENU_HIGHSCORE, LTMN_HIGHSCORE, false)); + } + } +} static CallBackFunction ToolbarGraphsClick(Window *w) { - PopupMainToolbMenu(w, WID_TN_GRAPHS, STR_GRAPH_MENU_OPERATING_PROFIT_GRAPH, (_toolbar_mode == TB_NORMAL) ? 6 : 8); + DropDownList list; + + list.emplace_back(new DropDownListStringItem(STR_GRAPH_MENU_OPERATING_PROFIT_GRAPH, GRMN_OPERATING_PROFIT_GRAPH, false)); + list.emplace_back(new DropDownListStringItem(STR_GRAPH_MENU_INCOME_GRAPH, GRMN_INCOME_GRAPH, false)); + list.emplace_back(new DropDownListStringItem(STR_GRAPH_MENU_DELIVERED_CARGO_GRAPH, GRMN_DELIVERED_CARGO_GRAPH, false)); + list.emplace_back(new DropDownListStringItem(STR_GRAPH_MENU_PERFORMANCE_HISTORY_GRAPH, GRMN_PERFORMANCE_HISTORY_GRAPH, false)); + list.emplace_back(new DropDownListStringItem(STR_GRAPH_MENU_COMPANY_VALUE_GRAPH, GRMN_COMPANY_VALUE_GRAPH, false)); + list.emplace_back(new DropDownListStringItem(STR_GRAPH_MENU_CARGO_PAYMENT_RATES, GRMN_CARGO_PAYMENT_RATES, false)); + + if (_toolbar_mode != TB_NORMAL) AddDropDownLeagueTableOptions(list); + + ShowDropDownList(w, std::move(list), 0, WID_TN_GRAPHS, 140, true, true); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); + + return CBF_NONE; +} + +static CallBackFunction ToolbarLeagueClick(Window *w) +{ + DropDownList list; + + AddDropDownLeagueTableOptions(list); + + ShowDropDownList(w, std::move(list), 0, WID_TN_LEAGUE, 140, true, true); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); + return CBF_NONE; } /** - * Handle click on the entry in the Graphs menu. + * Handle click on the entry in the Graphs or CompanyLeague. * * @param index Graph to show. * @return #CBF_NONE */ -static CallBackFunction MenuClickGraphs(int index) +static CallBackFunction MenuClickGraphsOrLeague(int index) { switch (index) { - case 0: ShowOperatingProfitGraph(); break; - case 1: ShowIncomeGraph(); break; - case 2: ShowDeliveredCargoGraph(); break; - case 3: ShowPerformanceHistoryGraph(); break; - case 4: ShowCompanyValueGraph(); break; - case 5: ShowCargoPaymentRates(); break; - /* functions for combined graphs/league button */ - case 6: ShowCompanyLeagueTable(); break; - case 7: ShowPerformanceRatingDetail(); break; + case GRMN_OPERATING_PROFIT_GRAPH: ShowOperatingProfitGraph(); break; + case GRMN_INCOME_GRAPH: ShowIncomeGraph(); break; + case GRMN_DELIVERED_CARGO_GRAPH: ShowDeliveredCargoGraph(); break; + case GRMN_PERFORMANCE_HISTORY_GRAPH: ShowPerformanceHistoryGraph(); break; + case GRMN_COMPANY_VALUE_GRAPH: ShowCompanyValueGraph(); break; + case GRMN_CARGO_PAYMENT_RATES: ShowCargoPaymentRates(); break; + case LTMN_PERFORMANCE_LEAGUE: ShowPerformanceLeagueTable(); break; + case LTMN_PERFORMANCE_RATING: ShowPerformanceRatingDetail(); break; + case LTMN_HIGHSCORE: ShowHighscoreTable(); break; + default: { + if (LeagueTable::IsValidID(index)) { + ShowScriptLeagueTable((LeagueTableID)index); + } + } } return CBF_NONE; } -/* --- League button menu --- */ -static CallBackFunction ToolbarLeagueClick(Window *w) -{ - PopupMainToolbMenu(w, WID_TN_LEAGUE, STR_GRAPH_MENU_COMPANY_LEAGUE_TABLE, _networking ? 2 : 3); - return CBF_NONE; -} - -/** - * Handle click on the entry in the CompanyLeague menu. - * - * @param index Menu entry number. - * @return #CBF_NONE - */ -static CallBackFunction MenuClickLeague(int index) -{ - switch (index) { - case 0: ShowCompanyLeagueTable(); break; - case 1: ShowPerformanceRatingDetail(); break; - case 2: ShowHighscoreTable(); break; - } - return CBF_NONE; -} /* --- Industries button menu --- */ @@ -1299,8 +1336,8 @@ static MenuClickedProc * const _menu_clicked_procs[] = { MenuClickCompany, // 9 MenuClickStory, // 10 MenuClickGoal, // 11 - MenuClickGraphs, // 12 - MenuClickLeague, // 13 + MenuClickGraphsOrLeague, // 12 + MenuClickGraphsOrLeague, // 13 MenuClickIndustry, // 14 MenuClickShowTrains, // 15 MenuClickShowRoad, // 16 @@ -2020,7 +2057,7 @@ struct MainToolbarWindow : Window { case MTHK_STORY: ShowStoryBook(_local_company); break; case MTHK_GOAL: ShowGoalsList(_local_company); break; case MTHK_GRAPHS: ShowOperatingProfitGraph(); break; - case MTHK_LEAGUE: ShowCompanyLeagueTable(); break; + case MTHK_LEAGUE: ShowFirstLeagueTable(); break; case MTHK_INDUSTRIES: ShowBuildIndustryWindow(); break; case MTHK_TRAIN_LIST: ShowVehicleListWindow(_local_company, VEH_TRAIN); break; case MTHK_ROADVEH_LIST: ShowVehicleListWindow(_local_company, VEH_ROAD); break; diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index 61490fff8a..f766d1cff7 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -27,6 +27,7 @@ add_files( highscore_widget.h industry_widget.h intro_widget.h + league_widget.h link_graph_legend_widget.h main_widget.h misc_widget.h diff --git a/src/widgets/graph_widget.h b/src/widgets/graph_widget.h index 7c6478f640..2548c990cd 100644 --- a/src/widgets/graph_widget.h +++ b/src/widgets/graph_widget.h @@ -51,11 +51,6 @@ enum CargoPaymentRatesWidgets { WID_CPR_MATRIX_SCROLLBAR,///< Cargo list scrollbar. }; -/** Widget of the #CompanyLeagueWindow class. */ -enum CompanyLeagueWidgets { - WID_CL_BACKGROUND, ///< Background of the window. -}; - /** Widget of the #PerformanceRatingDetailWindow class. */ enum PerformanceRatingDetailsWidgets { WID_PRD_SCORE_FIRST, ///< First entry in the score list. diff --git a/src/widgets/league_widget.h b/src/widgets/league_widget.h new file mode 100644 index 0000000000..381d379a7e --- /dev/null +++ b/src/widgets/league_widget.h @@ -0,0 +1,24 @@ +/* + * 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. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file league_widget.h Types related to the graph widgets. */ + +#ifndef WIDGETS_LEAGUE_WIDGET_H +#define WIDGETS_LEAGUE_WIDGET_H + +/** Widget of the #PerformanceLeagueWindow class. */ +enum PerformanceLeagueWidgets { + WID_PLT_BACKGROUND, ///< Background of the window. +}; + +/** Widget of the #ScriptLeagueWindow class. */ +enum ScriptLeagueWidgets { + WID_SLT_CAPTION, ///< Caption of the window. + WID_SLT_BACKGROUND, ///< Background of the window. +}; + +#endif /* WIDGETS_LEAGUE_WIDGET_H */ From 8a78fa71214d48263edd0a89d89c1845b97ebad0 Mon Sep 17 00:00:00 2001 From: Bernard Teo Date: Sun, 27 Nov 2022 01:03:21 +0800 Subject: [PATCH 39/42] Feature: Contextual actions for vehicles grouped by shared orders (#8425) --- src/depot_gui.cpp | 45 ++++++++++++++++++++++++++++++++++++++++++++ src/group_gui.cpp | 16 ++++++++-------- src/lang/english.txt | 4 ++++ src/order_gui.cpp | 37 ++++++++++++++++++++++++++++++++++++ src/vehicle.cpp | 36 +++++++++++++++++++++++++++++++++++ src/vehicle_func.h | 3 +++ src/vehicle_gui.cpp | 45 +++++++++++++++++++++++++++++++++++--------- src/vehicle_gui.h | 4 ++++ src/window_gui.h | 29 ++++++++++++++++++++++++++-- 9 files changed, 200 insertions(+), 19 deletions(-) diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index dd87a7929f..7f454946ce 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -24,8 +24,10 @@ #include "tilehighlight_func.h" #include "window_gui.h" #include "vehiclelist.h" +#include "vehicle_func.h" #include "order_backup.h" #include "zoom_func.h" +#include "error.h" #include "depot_cmd.h" #include "train_cmd.h" #include "vehicle_cmd.h" @@ -917,6 +919,49 @@ struct DepotWindow : Window { return true; } + /** + * Clones a vehicle from a vehicle list. If this doesn't make sense (because not all vehicles in the list have the same orders), then it displays an error. + * @return This always returns true, which indicates that the contextual action handled the mouse click. + * Note that it's correct behaviour to always handle the click even though an error is displayed, + * because users aren't going to expect the default action to be performed just because they overlooked that cloning doesn't make sense. + */ + bool OnVehicleSelect(VehicleList::const_iterator begin, VehicleList::const_iterator end) override + { + if (!_ctrl_pressed) { + /* If CTRL is not pressed: If all the vehicles in this list have the same orders, then copy orders */ + if (AllEqual(begin, end, [](const Vehicle *v1, const Vehicle *v2) { + return VehiclesHaveSameEngineList(v1, v2); + })) { + if (AllEqual(begin, end, [](const Vehicle *v1, const Vehicle *v2) { + return VehiclesHaveSameOrderList(v1, v2); + })) { + OnVehicleSelect(*begin); + } else { + ShowErrorMessage(STR_ERROR_CAN_T_BUY_TRAIN + (*begin)->type, STR_ERROR_CAN_T_COPY_ORDER_VEHICLE_LIST, WL_INFO); + } + } else { + ShowErrorMessage(STR_ERROR_CAN_T_BUY_TRAIN + (*begin)->type, STR_ERROR_CAN_T_CLONE_VEHICLE_LIST, WL_INFO); + } + } else { + /* If CTRL is pressed: If all the vehicles in this list share orders, then copy orders */ + if (AllEqual(begin, end, [](const Vehicle *v1, const Vehicle *v2) { + return VehiclesHaveSameEngineList(v1, v2); + })) { + if (AllEqual(begin, end, [](const Vehicle *v1, const Vehicle *v2) { + return v1->FirstShared() == v2->FirstShared(); + })) { + OnVehicleSelect(*begin); + } else { + ShowErrorMessage(STR_ERROR_CAN_T_BUY_TRAIN + (*begin)->type, STR_ERROR_CAN_T_SHARE_ORDER_VEHICLE_LIST, WL_INFO); + } + } else { + ShowErrorMessage(STR_ERROR_CAN_T_BUY_TRAIN + (*begin)->type, STR_ERROR_CAN_T_CLONE_VEHICLE_LIST, WL_INFO); + } + } + + return true; + } + void OnPlaceObjectAbort() override { /* abort clone */ diff --git a/src/group_gui.cpp b/src/group_gui.cpp index a597b1e356..5a423a7cde 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -884,14 +884,14 @@ public: } case GB_SHARED_ORDERS: { - const Vehicle *v = vehgroup.vehicles_begin[0]; - /* We do not support VehicleClicked() here since the contextual action may only make sense for individual vehicles */ - - if (vindex == v->index) { - if (vehgroup.NumVehicles() == 1) { - ShowVehicleViewWindow(v); - } else { - ShowVehicleListWindow(v); + if (!VehicleClicked(vehgroup)) { + const Vehicle* v = vehgroup.vehicles_begin[0]; + if (vindex == v->index) { + if (vehgroup.NumVehicles() == 1) { + ShowVehicleViewWindow(v); + } else { + ShowVehicleListWindow(v); + } } } break; diff --git a/src/lang/english.txt b/src/lang/english.txt index 3cd979a6e1..8621a3cec9 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -5029,6 +5029,8 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Can't ch STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... vehicle is destroyed +STR_ERROR_CAN_T_CLONE_VEHICLE_LIST :{WHITE}... not all vehicles are identical + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}No vehicles will be available at all STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Change your NewGRF configuration STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}No vehicles are available yet @@ -5055,6 +5057,8 @@ STR_ERROR_CAN_T_SKIP_TO_ORDER :{WHITE}Can't sk STR_ERROR_CAN_T_COPY_SHARE_ORDER :{WHITE}... vehicle can't go to all stations STR_ERROR_CAN_T_ADD_ORDER :{WHITE}... vehicle can't go to that station STR_ERROR_CAN_T_ADD_ORDER_SHARED :{WHITE}... a vehicle sharing this order can't go to that station +STR_ERROR_CAN_T_COPY_ORDER_VEHICLE_LIST :{WHITE}... not all vehicles have the same orders +STR_ERROR_CAN_T_SHARE_ORDER_VEHICLE_LIST :{WHITE}... not all vehicles are sharing orders STR_ERROR_CAN_T_SHARE_ORDER_LIST :{WHITE}Can't share order list... STR_ERROR_CAN_T_STOP_SHARING_ORDER_LIST :{WHITE}Can't stop sharing order list... diff --git a/src/order_gui.cpp b/src/order_gui.cpp index d412a49f7c..816a1b85b3 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -29,6 +29,9 @@ #include "aircraft.h" #include "engine_func.h" #include "vehicle_func.h" +#include "vehiclelist.h" +#include "vehicle_func.h" +#include "error.h" #include "order_cmd.h" #include "company_cmd.h" @@ -1466,6 +1469,40 @@ public: return true; } + /** + * Clones an order list from a vehicle list. If this doesn't make sense (because not all vehicles in the list have the same orders), then it displays an error. + * @return This always returns true, which indicates that the contextual action handled the mouse click. + * Note that it's correct behaviour to always handle the click even though an error is displayed, + * because users aren't going to expect the default action to be performed just because they overlooked that cloning doesn't make sense. + */ + bool OnVehicleSelect(VehicleList::const_iterator begin, VehicleList::const_iterator end) override + { + bool share_order = _ctrl_pressed || this->goto_type == OPOS_SHARE; + if (this->vehicle->GetNumOrders() != 0 && !share_order) return false; + + if (!share_order) { + /* If CTRL is not pressed: If all the vehicles in this list have the same orders, then copy orders */ + if (AllEqual(begin, end, [](const Vehicle *v1, const Vehicle *v2) { + return VehiclesHaveSameOrderList(v1, v2); + })) { + OnVehicleSelect(*begin); + } else { + ShowErrorMessage(STR_ERROR_CAN_T_COPY_ORDER_LIST, STR_ERROR_CAN_T_COPY_ORDER_VEHICLE_LIST, WL_INFO); + } + } else { + /* If CTRL is pressed: If all the vehicles in this list share orders, then copy orders */ + if (AllEqual(begin, end, [](const Vehicle *v1, const Vehicle *v2) { + return v1->FirstShared() == v2->FirstShared(); + })) { + OnVehicleSelect(*begin); + } else { + ShowErrorMessage(STR_ERROR_CAN_T_SHARE_ORDER_LIST, STR_ERROR_CAN_T_SHARE_ORDER_VEHICLE_LIST, WL_INFO); + } + } + + return true; + } + void OnPlaceObjectAbort() override { this->goto_type = OPOS_NONE; diff --git a/src/vehicle.cpp b/src/vehicle.cpp index eeb22be5be..eab9c1ccaa 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -3013,3 +3013,39 @@ uint32 Vehicle::GetDisplayMinPowerToWeight() const if (max_weight == 0) return 0; return GetGroundVehicleCache()->cached_power * 10u / max_weight; } + +/** + * Checks if two vehicle chains have the same list of engines. + * @param v1 First vehicle chain. + * @param v1 Second vehicle chain. + * @return True if same, false if different. + */ +bool VehiclesHaveSameEngineList(const Vehicle *v1, const Vehicle *v2) +{ + while (true) { + if (v1 == nullptr && v2 == nullptr) return true; + if (v1 == nullptr || v2 == nullptr) return false; + if (v1->GetEngine() != v2->GetEngine()) return false; + v1 = v1->GetNextVehicle(); + v2 = v2->GetNextVehicle(); + } +} + +/** + * Checks if two vehicles have the same list of orders. + * @param v1 First vehicles. + * @param v1 Second vehicles. + * @return True if same, false if different. + */ +bool VehiclesHaveSameOrderList(const Vehicle *v1, const Vehicle *v2) +{ + const Order *o1 = v1->GetFirstOrder(); + const Order *o2 = v2->GetFirstOrder(); + while (true) { + if (o1 == nullptr && o2 == nullptr) return true; + if (o1 == nullptr || o2 == nullptr) return false; + if (!o1->Equals(*o2)) return false; + o1 = o1->next; + o2 = o2->next; + } +} diff --git a/src/vehicle_func.h b/src/vehicle_func.h index aa3a027dfb..13fc352e46 100644 --- a/src/vehicle_func.h +++ b/src/vehicle_func.h @@ -174,4 +174,7 @@ void GetVehicleSet(VehicleSet &set, Vehicle *v, uint8 num_vehicles); void CheckCargoCapacity(Vehicle *v); +bool VehiclesHaveSameEngineList(const Vehicle *v1, const Vehicle *v2); +bool VehiclesHaveSameOrderList(const Vehicle *v1, const Vehicle *v2); + #endif /* VEHICLE_FUNC_H */ diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 467f6731d2..8dc4120268 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2018,16 +2018,16 @@ public: case GB_SHARED_ORDERS: { assert(vehgroup.NumVehicles() > 0); - const Vehicle *v = vehgroup.vehicles_begin[0]; - /* We do not support VehicleClicked() here since the contextual action may only make sense for individual vehicles */ - - if (_ctrl_pressed) { - ShowOrdersWindow(v); - } else { - if (vehgroup.NumVehicles() == 1) { - ShowVehicleViewWindow(v); + if (!VehicleClicked(vehgroup)) { + const Vehicle *v = vehgroup.vehicles_begin[0]; + if (_ctrl_pressed) { + ShowOrdersWindow(v); } else { - ShowVehicleListWindow(v); + if (vehgroup.NumVehicles() == 1) { + ShowVehicleViewWindow(v); + } else { + ShowVehicleListWindow(v); + } } } break; @@ -3288,6 +3288,33 @@ bool VehicleClicked(const Vehicle *v) return _thd.GetCallbackWnd()->OnVehicleSelect(v); } +/** + * Dispatch a "vehicle group selected" event if any window waits for it. + * @param begin iterator to the start of the range of vehicles + * @param end iterator to the end of the range of vehicles + * @return did any window accept vehicle group selection? + */ +bool VehicleClicked(VehicleList::const_iterator begin, VehicleList::const_iterator end) +{ + assert(begin != end); + if (!(_thd.place_mode & HT_VEHICLE)) return false; + + /* If there is only one vehicle in the group, act as if we clicked a single vehicle */ + if (begin + 1 == end) return _thd.GetCallbackWnd()->OnVehicleSelect(*begin); + + return _thd.GetCallbackWnd()->OnVehicleSelect(begin, end); +} + +/** + * Dispatch a "vehicle group selected" event if any window waits for it. + * @param vehgroup the GUIVehicleGroup representing the vehicle group + * @return did any window accept vehicle group selection? + */ +bool VehicleClicked(const GUIVehicleGroup &vehgroup) +{ + return VehicleClicked(vehgroup.vehicles_begin, vehgroup.vehicles_end); +} + void StopGlobalFollowVehicle(const Vehicle *v) { Window *w = FindWindowById(WC_MAIN_WINDOW, 0); diff --git a/src/vehicle_gui.h b/src/vehicle_gui.h index 4a750c0477..af8a354e6f 100644 --- a/src/vehicle_gui.h +++ b/src/vehicle_gui.h @@ -12,6 +12,8 @@ #include "window_type.h" #include "vehicle_type.h" +#include "vehicle_gui_base.h" +#include "vehiclelist.h" #include "order_type.h" #include "station_type.h" #include "engine_type.h" @@ -102,6 +104,8 @@ static inline WindowClass GetWindowClassForVehicleType(VehicleType vt) /* Unified window procedure */ void ShowVehicleViewWindow(const Vehicle *v); bool VehicleClicked(const Vehicle *v); +bool VehicleClicked(VehicleList::const_iterator begin, VehicleList::const_iterator end); +bool VehicleClicked(const GUIVehicleGroup &vehgroup); void StartStopVehicle(const Vehicle *v, bool texteffect); Vehicle *CheckClickOnVehicle(const struct Viewport *vp, int x, int y); diff --git a/src/window_gui.h b/src/window_gui.h index 4afe9563de..8bd5dc39ee 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -11,7 +11,10 @@ #define WINDOW_GUI_H #include +#include +#include +#include "vehiclelist.h" #include "vehicle_type.h" #include "viewport_type.h" #include "company_type.h" @@ -681,11 +684,20 @@ public: /** * The user clicked on a vehicle while HT_VEHICLE has been set. - * @param v clicked vehicle. It is guaranteed to be v->IsPrimaryVehicle() == true - * @return True if the click is handled, false if it is ignored. + * @param v clicked vehicle + * @return true if the click is handled, false if it is ignored + * @pre v->IsPrimaryVehicle() == true */ virtual bool OnVehicleSelect(const struct Vehicle *v) { return false; } + /** + * The user clicked on a vehicle while HT_VEHICLE has been set. + * @param v clicked vehicle + * @return True if the click is handled, false if it is ignored + * @pre v->IsPrimaryVehicle() == true + */ + virtual bool OnVehicleSelect(VehicleList::const_iterator begin, VehicleList::const_iterator end) { return false; } + /** * The user cancelled a tile highlight mode that has been set. */ @@ -806,6 +818,19 @@ public: using IterateFromFront = AllWindows; //!< Iterate all windows in Z order from front to back. }; +/** + * Generic helper function that checks if all elements of the range are equal with respect to the given predicate. + * @param begin The start of the range. + * @param end The end of the range. + * @param pred The predicate to use. + * @return True if all elements are equal, false otherwise. + */ +template +inline bool AllEqual(It begin, It end, Pred pred) +{ + return std::adjacent_find(begin, end, std::not_fn(pred)) == end; +} + /** * Get the nested widget with number \a widnum from the nested widget tree. * @tparam NWID Type of the nested widget. From 35c4af5cb760d79ce0dfa322c52865d8cc998bb2 Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 26 Nov 2022 18:45:39 +0000 Subject: [PATCH 40/42] Update: Translations from eints english (au): 4 changes by krysclarke spanish: 10 changes by MontyMontana portuguese: 62 changes by azulcosta --- src/lang/afrikaans.txt | 1 + src/lang/arabic_egypt.txt | 1 + src/lang/basque.txt | 1 + src/lang/belarusian.txt | 1 + src/lang/brazilian_portuguese.txt | 1 + src/lang/bulgarian.txt | 1 + src/lang/catalan.txt | 1 + src/lang/chuvash.txt | 1 + src/lang/croatian.txt | 1 + src/lang/czech.txt | 1 + src/lang/danish.txt | 1 + src/lang/dutch.txt | 1 + src/lang/english_AU.txt | 5 ++ src/lang/english_US.txt | 1 + src/lang/esperanto.txt | 1 + src/lang/estonian.txt | 1 + src/lang/faroese.txt | 1 + src/lang/finnish.txt | 1 + src/lang/french.txt | 1 + src/lang/frisian.txt | 1 + src/lang/gaelic.txt | 1 + src/lang/galician.txt | 1 + src/lang/german.txt | 1 + src/lang/greek.txt | 1 + src/lang/hebrew.txt | 1 + src/lang/hindi.txt | 1 + src/lang/hungarian.txt | 1 + src/lang/icelandic.txt | 1 + src/lang/ido.txt | 1 + src/lang/indonesian.txt | 1 + src/lang/irish.txt | 1 + src/lang/italian.txt | 1 + src/lang/japanese.txt | 1 + src/lang/korean.txt | 1 + src/lang/latin.txt | 1 + src/lang/latvian.txt | 1 + src/lang/lithuanian.txt | 1 + src/lang/luxembourgish.txt | 1 + src/lang/macedonian.txt | 1 + src/lang/malay.txt | 1 + src/lang/maltese.txt | 1 + src/lang/marathi.txt | 1 + src/lang/norwegian_bokmal.txt | 1 + src/lang/norwegian_nynorsk.txt | 1 + src/lang/persian.txt | 1 + src/lang/polish.txt | 1 + src/lang/portuguese.txt | 121 ++++++++++++++++-------------- src/lang/romanian.txt | 1 + src/lang/russian.txt | 1 + src/lang/serbian.txt | 1 + src/lang/simplified_chinese.txt | 1 + src/lang/slovak.txt | 1 + src/lang/slovenian.txt | 1 + src/lang/spanish.txt | 17 +++-- src/lang/spanish_MX.txt | 1 + src/lang/swedish.txt | 1 + src/lang/tamil.txt | 1 + src/lang/thai.txt | 1 + src/lang/traditional_chinese.txt | 1 + src/lang/turkish.txt | 1 + src/lang/ukrainian.txt | 1 + src/lang/urdu.txt | 1 + src/lang/vietnamese.txt | 1 + src/lang/welsh.txt | 1 + 64 files changed, 140 insertions(+), 64 deletions(-) diff --git a/src/lang/afrikaans.txt b/src/lang/afrikaans.txt index 171785aa49..0ffe652dfb 100644 --- a/src/lang/afrikaans.txt +++ b/src/lang/afrikaans.txt @@ -4697,6 +4697,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Kan nie STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... voertuig is vernietig + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Geen voertuie gaan beskikbaar wees nie STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Verander jou NewGRF stellings STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Geen voertuie is op die oomblik beskikbaar nie diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt index 90c69fbbe1..5010285d85 100644 --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -4330,6 +4330,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}لا ي STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... العربة تحطمت + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}لن تتوافر اى وسائل نقل على اﻹطلاق STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}لا تتوافر اى آليه نقل بعد diff --git a/src/lang/basque.txt b/src/lang/basque.txt index edb10a6c78..77e39b70df 100644 --- a/src/lang/basque.txt +++ b/src/lang/basque.txt @@ -4431,6 +4431,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Ezin da STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... garraioa suntsituta + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Ez da ibilgailu erabilgarririk egongo STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Aldatu zure NewGRF konfigurazioa STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Ez dago ibilgailu erabilgarririk oraindik diff --git a/src/lang/belarusian.txt b/src/lang/belarusian.txt index 56b069eba0..1f0de65e7f 100644 --- a/src/lang/belarusian.txt +++ b/src/lang/belarusian.txt @@ -5050,6 +5050,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Не а STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... транспартны сродак зьнішчаны + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Усе транспартныя сродкі будуць недаступныя STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Зьмяніце канфігурацыю модуля NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Няма даступных транспартных сродкаў diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index 17f6b646fe..4c86815eb0 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -4978,6 +4978,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Impossí STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... veículo está destruído + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Não haverá nenhum veículo disponível STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Altere sua configuração de NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Não há veículos disponíveis ainda diff --git a/src/lang/bulgarian.txt b/src/lang/bulgarian.txt index 43c6f2d065..a7ddae4638 100644 --- a/src/lang/bulgarian.txt +++ b/src/lang/bulgarian.txt @@ -4516,6 +4516,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Инте STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... машината е унищожена + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Никакви превозни средства няма да бъдат налични STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Промени своята NewGRF конфигурация STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Няма налични превозни средства все още diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index ff37e6e361..64f6e08e9c 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -4983,6 +4983,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}No es po STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... vehicle està destruït + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}No hi haurà cap vehicle disponible STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Canvia la teva configuració dels NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Encara no hi ha vehicles disponibles diff --git a/src/lang/chuvash.txt b/src/lang/chuvash.txt index 7832fac357..aa6e64b28e 100644 --- a/src/lang/chuvash.txt +++ b/src/lang/chuvash.txt @@ -1695,6 +1695,7 @@ STR_ERROR_OBJECT_IN_THE_WAY :{WHITE}Ҫул + # Specific vehicle errors diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt index d2ed647896..983e468ef9 100644 --- a/src/lang/croatian.txt +++ b/src/lang/croatian.txt @@ -4885,6 +4885,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Nije mog STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... vozilo je uništeno + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Neće biti dostupno nijedno vozilo STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Promijenite konfiguraciju NewGRF-a STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Još nema dostupnih vozila diff --git a/src/lang/czech.txt b/src/lang/czech.txt index 2c01ad644c..674ee9aece 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -5080,6 +5080,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Nelze zm STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... vozidlo bylo zničeno + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Žádná vozidla nejsou dostupná STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Zmeň nastavení NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Zatím nejsou dostupná žádná vozidla diff --git a/src/lang/danish.txt b/src/lang/danish.txt index 38fd8ad873..6eb976c779 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -4959,6 +4959,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Kan ikke STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... fartøjet er ødelagt + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Ingen køretøjer vil være tilgængelige overhovedet STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Skift din NewGRF-konfiguration STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Ingen køretøjer er tilgængelige endnu diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index d7cb39698d..c85a819b47 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -5025,6 +5025,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Kan onde STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... voertuig is vernietigd + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Er zullen geen voertuigen beschikbaar zijn STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Pas je NewGRF-configuratie aan STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Nog geen voertuigen beschikbaar diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index d5fc139578..baddaebd37 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -1432,6 +1432,8 @@ STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT :Width of the li STR_CONFIG_SETTING_SHOW_NEWGRF_NAME :Show the NewGRF's name in the build vehicle window: {STRING} STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT :Add a line to the build vehicle window, showing which NewGRF the selected vehicle comes from. +STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS :Show the cargoes the vehicles can carry in the list windows {STRING} +STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS_HELPTEXT :If enabled, the vehicle's transportable load will appear above it in the vehicle lists STR_CONFIG_SETTING_LANDSCAPE :Landscape: {STRING} STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Landscapes define basic gameplay scenarios with different cargoes and town growth requirements. NewGRF and Game Scripts allow finer control though @@ -3802,6 +3804,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Send ins STR_VEHICLE_LIST_REPLACE_VEHICLES :Replace vehicles STR_VEHICLE_LIST_SEND_FOR_SERVICING :Send for Servicing STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Profit this year: {CURRENCY_LONG} (last year: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Send to Depot STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Send to Depot @@ -5025,6 +5029,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Can't ch STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... vehicle is destroyed + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}No vehicles will be available at all STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Change your NewGRF configuration STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}No vehicles are available yet diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index b2da709dc5..f63aaa78aa 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -5025,6 +5025,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Can't ch STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... vehicle is destroyed + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}No vehicles will be available at all STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Change your NewGRF configuration STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}No vehicles are available yet diff --git a/src/lang/esperanto.txt b/src/lang/esperanto.txt index c7403be55b..f20cf63b61 100644 --- a/src/lang/esperanto.txt +++ b/src/lang/esperanto.txt @@ -3940,6 +3940,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Ne povas STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... veturilo estas detrua + # Specific vehicle errors STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Ne povas igi trajnon transiri signalon je danĝero... STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Ne povas inversigi direkton de trajno... diff --git a/src/lang/estonian.txt b/src/lang/estonian.txt index 294ac31447..41df762a84 100644 --- a/src/lang/estonian.txt +++ b/src/lang/estonian.txt @@ -4959,6 +4959,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Hooldusv STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... sõiduk hävitatud + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Ühtegi sõidukit ei ole saadaval STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Muuda NewGRF-i seadistust STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Sõidukeid ei ole veel saadaval diff --git a/src/lang/faroese.txt b/src/lang/faroese.txt index de06ab374e..12f962fe9f 100644 --- a/src/lang/faroese.txt +++ b/src/lang/faroese.txt @@ -4083,6 +4083,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Kann ikk STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... akfar smildra sundur + # Specific vehicle errors STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Kann ikki fáa tok at fara framvið jarnbreytatekin tá vandi er... STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Kann ikki venda toki vi... diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index 4e1330b2b5..95ddf18e3a 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -4977,6 +4977,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Huoltov STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... kulkuneuvo on tuhoutunut + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Yhtään kulkuneuvoa ei ole saatavilla STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Muuta NewGRF-asetuksiasi STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Kulkuneuvoja ei ole vielä saatavilla diff --git a/src/lang/french.txt b/src/lang/french.txt index 42c7364ba8..0f13c97c57 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -5026,6 +5026,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Impossib STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... véhicule détruit + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Aucun véhicule ne sera disponible STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Modifier votre configuration NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Il n'y a pas encore de véhicules disponibles diff --git a/src/lang/frisian.txt b/src/lang/frisian.txt index 6a57d529eb..1bd08edc4a 100644 --- a/src/lang/frisian.txt +++ b/src/lang/frisian.txt @@ -4265,6 +4265,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Kin tiid STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... wein verneatige + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Hielendal gjin fiertugen talitten STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Feroarje jo NewGRF-konfiguraasje STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Der binne noch gjin fiertugen beskikber diff --git a/src/lang/gaelic.txt b/src/lang/gaelic.txt index 22e82c9731..224640d9b6 100644 --- a/src/lang/gaelic.txt +++ b/src/lang/gaelic.txt @@ -4832,6 +4832,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Cha ghab STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... chaidh an carbad a mhilleadh + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Cha bhi carbad sam bith ri làimh STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Atharraich an rèiteachadh NewGRF agad STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Chan eil carbad ri fhaighinn fhathast diff --git a/src/lang/galician.txt b/src/lang/galician.txt index 606b3cdd97..b431fb850e 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -4978,6 +4978,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Non se p STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... o vehículo está destruído + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Non haberá vehículos dispoñibles STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Cambia a túa configuración NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Aínda non hai vehículos dispoñíbeis diff --git a/src/lang/german.txt b/src/lang/german.txt index 5e84c7ee83..50e0fce943 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -4984,6 +4984,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Das Wart STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... Fahrzeug ist zerstört + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Es sind keine Fahrzeuge verfügbar! STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Bitte die NewGRF-Einstellungen ändern, damit Fahrzeuge früher verfügbar sind STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Noch keine Fahrzeuge verfügbar diff --git a/src/lang/greek.txt b/src/lang/greek.txt index 90fe6fa9df..b1270254b3 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -5072,6 +5072,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Δεν STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... το όχημα καταστράφηκε + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Δεν θα είναι κανένα όχημα διαθέσιμο STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Αλλάξτε τις ρύθμισεις NewGRF σας STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Κανένα όχημα δεν είναι διαθέσιμο ακόμη diff --git a/src/lang/hebrew.txt b/src/lang/hebrew.txt index 826a5039b5..1df455c325 100644 --- a/src/lang/hebrew.txt +++ b/src/lang/hebrew.txt @@ -4611,6 +4611,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}לא נ STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... הרכב נהרס + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}כלי תחבורה לא יהיו זמינים STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}שנה הגדרות NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}כלי תחבורה עדיין לא זמינים diff --git a/src/lang/hindi.txt b/src/lang/hindi.txt index 332cbc8d84..e932ff8199 100644 --- a/src/lang/hindi.txt +++ b/src/lang/hindi.txt @@ -1370,6 +1370,7 @@ STR_ERROR_CAN_T_SELL_TRAIN :{WHITE}रे + # Specific vehicle errors diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index 5aa59be745..6e6fae4b51 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -5047,6 +5047,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Nem vál STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... jármű megsemmisült + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Egyáltalán nincsenek elérhető járművek STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Változtasd meg a NewGRF konfigurációdat! STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Még nincsenek elérhető járművek diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt index 4c32376203..d6eace4dc9 100644 --- a/src/lang/icelandic.txt +++ b/src/lang/icelandic.txt @@ -4316,6 +4316,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Get ekki STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... ökutæki er eyðilagt + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Engin farartæki verða í boði STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Breyta NewGRF stillingunum þínum diff --git a/src/lang/ido.txt b/src/lang/ido.txt index 243a6acf8a..e0160976a9 100644 --- a/src/lang/ido.txt +++ b/src/lang/ido.txt @@ -1569,6 +1569,7 @@ STR_ERROR_TOO_MANY_VEHICLES_IN_GAME :{WHITE}Tro mult + # Specific vehicle errors diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index c6eb2c5c58..e96bd1c9da 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -4977,6 +4977,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Tidak da STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... kendaraan hancur + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Tak satupun kendaraan tersedia STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Tukarkan konfigurasi NewGRF anda STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Belum ada kendaraan yang tersedia saat ini diff --git a/src/lang/irish.txt b/src/lang/irish.txt index bb27932290..ddcca1fff6 100644 --- a/src/lang/irish.txt +++ b/src/lang/irish.txt @@ -4949,6 +4949,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Ní féi STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... tá an fheithicil scriosta + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Ní bheidh aon fheithicil ar fáil ar chor ar bith STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Athraigh do chumraíocht NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Níl aon fheithicil ar fáil fós diff --git a/src/lang/italian.txt b/src/lang/italian.txt index 7d3ded47d3..4a3b3577b5 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -5066,6 +5066,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Impossib STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... il veicolo è distrutto + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Non sarà disponibile alcun veicolo STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Cambiare i NewGRF configurati STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Non sono ancora disponibili veicoli diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt index a838cd2e41..5d174f7bd9 100644 --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -4959,6 +4959,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}点検 STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}輸送機器が破壊されます + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}利用できる輸送機器が全くなくなります STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}NewGRFの設定を変更してください STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}利用可能な輸送機器がありません diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 70b1250b5f..53d02f31d7 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -5026,6 +5026,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}점검 STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... 차량이 파괴되었습니다 + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}사용할 수 있는 차량이 모두 없어질 것입니다 STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}NewGRF 설정을 변경하십시오 STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}사용할 수 있는 차량이 하나도 없습니다 diff --git a/src/lang/latin.txt b/src/lang/latin.txt index aafd9ed650..2c4b8f5fff 100644 --- a/src/lang/latin.txt +++ b/src/lang/latin.txt @@ -4825,6 +4825,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Non lice STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... vehiculum est destructum! + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Nulla vehicula omnino parabilia erunt STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Muta configurationem NewGRF tuam STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Nulla vehicula adhuc parabilia sunt diff --git a/src/lang/latvian.txt b/src/lang/latvian.txt index d0a2b9685b..11a1ea83ed 100644 --- a/src/lang/latvian.txt +++ b/src/lang/latvian.txt @@ -4988,6 +4988,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Nevar ma STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... transportlīdzeklis ir iznīcināts + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Vispār nebūs pieejami transporta līdzekļi STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Mainiet jūsu NewGRF konfogurāciju STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Transportlīdzekļi vēl nav pieejami diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt index 8e9d324f7f..693afe1d36 100644 --- a/src/lang/lithuanian.txt +++ b/src/lang/lithuanian.txt @@ -5167,6 +5167,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Aptarnav STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... automobilis sunaikintas + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Nebus įmanoma įsigyti jokių transporto priemonių STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Pakeiskite plėtinių nuostatas STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Kol kas negalima įsigyti jokių transporto priemonių diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt index 6a302f587b..e318c052d9 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -4955,6 +4955,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}De Servi STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... Gefier ass zerstéiert + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Keng Gefierer verfügbar STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Änner d'NewGRF Konfiguratioun STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Nach keng Gefierer verfügbar diff --git a/src/lang/macedonian.txt b/src/lang/macedonian.txt index 627b6bc243..ebc94aafec 100644 --- a/src/lang/macedonian.txt +++ b/src/lang/macedonian.txt @@ -2113,6 +2113,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Не м STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... возилото е уништено + # Specific vehicle errors diff --git a/src/lang/malay.txt b/src/lang/malay.txt index 26fe29b50a..14fe8a13ff 100644 --- a/src/lang/malay.txt +++ b/src/lang/malay.txt @@ -4223,6 +4223,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Tidak bo STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... kenderaan sudah musnah + STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Mulakan permainan baru selepas {DATE_SHORT} atau gunakan NewGRF yang digunakan kenderaan terdahulu # Specific vehicle errors diff --git a/src/lang/maltese.txt b/src/lang/maltese.txt index 868f2c059f..eafe24e61f 100644 --- a/src/lang/maltese.txt +++ b/src/lang/maltese.txt @@ -1437,6 +1437,7 @@ STR_ERROR_TOO_MANY_VEHICLES_IN_GAME :{WHITE}Hemm wis + # Specific vehicle errors STR_ERROR_CAN_T_REVERSE_DIRECTION_TRAIN :{WHITE}Ma tistax tbiddel id-direzzjoni tal-ferrovija... diff --git a/src/lang/marathi.txt b/src/lang/marathi.txt index 4c9e67efce..2d87eed5ca 100644 --- a/src/lang/marathi.txt +++ b/src/lang/marathi.txt @@ -1863,6 +1863,7 @@ STR_ERROR_BRIDGE_THROUGH_MAP_BORDER :{WHITE}पू + # Specific vehicle errors diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index 5a5a2bb82d..816ac9dcb3 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -4963,6 +4963,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Kan ikke STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}...{NBSP}kjøretøy er ødelagt + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Ingen kjøretøyer vil være tilgjengelig i det hele tatt STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Endre din NewGRF konfigurasjon STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Ingen kjøretøyer er tilgjengelig ennå diff --git a/src/lang/norwegian_nynorsk.txt b/src/lang/norwegian_nynorsk.txt index 9fde3e8f24..db12631506 100644 --- a/src/lang/norwegian_nynorsk.txt +++ b/src/lang/norwegian_nynorsk.txt @@ -4456,6 +4456,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Kan ikkj STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... køyretøy er øydelagd + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Ingen køyretøy vert tilgjengelege STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Byt NewGRF-innstillingar STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Det finst ikkje nokon køyretøy enno diff --git a/src/lang/persian.txt b/src/lang/persian.txt index 11d8674491..cd84c536eb 100644 --- a/src/lang/persian.txt +++ b/src/lang/persian.txt @@ -3757,6 +3757,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}امکا STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... وسیله نقلیه منهدم شد + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}بطور کلی هیچ خودرویی در دسترس نخواهد بود STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}تنظیمات مربوط به NewGRF را تغییر دهید STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}هنوز خودرویی در دسترس نیست diff --git a/src/lang/polish.txt b/src/lang/polish.txt index d3cd2a699b..4f42867e7e 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -5411,6 +5411,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Nie moż STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... pojazd jest zniszczony + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Żadne pojazdy nie będą dostępne STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Zmień konfigurację swoich NewGRF-ów STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Obecnie żaden pojazd nie jest dostępny diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index 3268fc5864..87680e84cb 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -268,10 +268,10 @@ STR_SHOW_HIDDEN_ENGINES_VEHICLE_SHIP :{BLACK}Mostrar STR_SHOW_HIDDEN_ENGINES_VEHICLE_AIRCRAFT :{BLACK}Mostrar escondido ###length VEHICLE_TYPES -STR_SHOW_HIDDEN_ENGINES_VEHICLE_TRAIN_TOOLTIP :{BLACK}Ao activar este botão, os veículos ferroviários ocultos também serão exibidos -STR_SHOW_HIDDEN_ENGINES_VEHICLE_ROAD_VEHICLE_TOOLTIP :{BLACK}Ao activar este botão, os veículos rodoviários ocultos também serão exibidos -STR_SHOW_HIDDEN_ENGINES_VEHICLE_SHIP_TOOLTIP :{BLACK}Ao activar este botão, os navios ocultos também serão exibidos -STR_SHOW_HIDDEN_ENGINES_VEHICLE_AIRCRAFT_TOOLTIP :{BLACK}Ao activar este botão, os aviões ocultos também serão exibidos +STR_SHOW_HIDDEN_ENGINES_VEHICLE_TRAIN_TOOLTIP :{BLACK}Ao ativar este botão, os veículos ferroviários ocultos também serão exibidos +STR_SHOW_HIDDEN_ENGINES_VEHICLE_ROAD_VEHICLE_TOOLTIP :{BLACK}Ao ativar este botão, os veículos rodoviários ocultos também serão exibidos +STR_SHOW_HIDDEN_ENGINES_VEHICLE_SHIP_TOOLTIP :{BLACK}Ao ativar este botão, os navios ocultos também serão exibidos +STR_SHOW_HIDDEN_ENGINES_VEHICLE_AIRCRAFT_TOOLTIP :{BLACK}Ao ativar este botão, os aviões ocultos também serão exibidos # Query window STR_BUTTON_DEFAULT :{BLACK}Padrão @@ -318,7 +318,7 @@ STR_SORT_BY_RATING_MIN :Menor carga STR_SORT_BY_ENGINE_ID :EngineID (ordem clássica) STR_SORT_BY_COST :Custo STR_SORT_BY_POWER :Potência -STR_SORT_BY_TRACTIVE_EFFORT :Força de Tracção +STR_SORT_BY_TRACTIVE_EFFORT :Esforço de tração STR_SORT_BY_INTRO_DATE :Data de Introdução STR_SORT_BY_RUNNING_COST :Custo de circulação STR_SORT_BY_POWER_VS_RUNNING_COST :Potência/Custo de circulação @@ -609,8 +609,8 @@ STR_GRAPH_COMPANY_VALUES_CAPTION :{WHITE}Valor da STR_GRAPH_CARGO_PAYMENT_RATES_CAPTION :{WHITE}Tarifas por carga STR_GRAPH_CARGO_PAYMENT_RATES_X_LABEL :{TINY_FONT}{BLACK}Dias em trânsito STR_GRAPH_CARGO_PAYMENT_RATES_TITLE :{TINY_FONT}{BLACK}Pagamento por entregar 10 unidades (ou 10 000 litros) de carga numa distância de 20 quadrados -STR_GRAPH_CARGO_ENABLE_ALL :{TINY_FONT}{BLACK}Activar tudo -STR_GRAPH_CARGO_DISABLE_ALL :{TINY_FONT}{BLACK}Desactivar tudo +STR_GRAPH_CARGO_ENABLE_ALL :{TINY_FONT}{BLACK}Ativar tudo +STR_GRAPH_CARGO_DISABLE_ALL :{TINY_FONT}{BLACK}Desativar tudo STR_GRAPH_CARGO_TOOLTIP_ENABLE_ALL :{BLACK}Mostrar todas as cargas no gráfico de tarifas por carga STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Não mostrar carga no gráfico de tarifas por carga STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Mostrar/ocultar gráfico para o tipo de carga @@ -787,8 +787,8 @@ STR_SMALLMAP_INDUSTRY :{TINY_FONT}{STR STR_SMALLMAP_LINKSTATS :{TINY_FONT}{STRING} STR_SMALLMAP_COMPANY :{TINY_FONT}{COMPANY} STR_SMALLMAP_TOWN :{TINY_FONT}{WHITE}{TOWN} -STR_SMALLMAP_DISABLE_ALL :{BLACK}Desactivar tudo -STR_SMALLMAP_ENABLE_ALL :{BLACK}Activar tudo +STR_SMALLMAP_DISABLE_ALL :{BLACK}Desativar tudo +STR_SMALLMAP_ENABLE_ALL :{BLACK}Ativar tudo STR_SMALLMAP_SHOW_HEIGHT :{BLACK}Mostrar altura STR_SMALLMAP_TOOLTIP_DISABLE_ALL_INDUSTRIES :{BLACK}Não mostrar indústrias no mapa STR_SMALLMAP_TOOLTIP_ENABLE_ALL_INDUSTRIES :{BLACK}Mostrar todas as indústrias no mapa @@ -982,7 +982,7 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :{BLACK}Seleccio # Autosave dropdown ###length 5 -STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_OFF :Desactivado +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_OFF :Desativado STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_1_MONTH :Cada mês STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_3_MONTHS :Cada 3 meses STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_6_MONTHS :Cada 6 meses @@ -1188,7 +1188,7 @@ STR_CONFIG_SETTING_CATEGORY_AND_TYPE_HIDES :{BLACK}Mostrar ###length 3 STR_CONFIG_SETTING_OFF :Desligado STR_CONFIG_SETTING_ON :Ligado -STR_CONFIG_SETTING_DISABLED :Desactivado +STR_CONFIG_SETTING_DISABLED :Desativado ###length 3 STR_CONFIG_SETTING_COMPANIES_OFF :Desligado @@ -1209,7 +1209,7 @@ STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN :Valor máximo d STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN_HELPTEXT :Quantia máxima que uma companhia pode pedir (sem ter em conta a inflação) STR_CONFIG_SETTING_INTEREST_RATE :Taxa de juro: {STRING} -STR_CONFIG_SETTING_INTEREST_RATE_HELPTEXT :Taxa de juro do empréstimo; também controla a inflacção, se activo +STR_CONFIG_SETTING_INTEREST_RATE_HELPTEXT :Taxa de juro do empréstimo; também controla a inflação, se ativo STR_CONFIG_SETTING_RUNNING_COSTS :Custos operacionais: {STRING} STR_CONFIG_SETTING_RUNNING_COSTS_HELPTEXT :Configurar nível de manutenção e custos operacionais de veículos e infraestrutura @@ -1234,13 +1234,13 @@ STR_CONFIG_SETTING_CONSTRUCTION_COSTS :Custos de const STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT :Configurar o nível de construção e custos de compra STR_CONFIG_SETTING_RECESSIONS :Recessões: {STRING} -STR_CONFIG_SETTING_RECESSIONS_HELPTEXT :Se activo, podem ocorrer recessões em intervalos de poucos anos. Durante uma recessão a produção em geral é mais baixa (volta aos níveis anteriores quando termina) +STR_CONFIG_SETTING_RECESSIONS_HELPTEXT :Se ativo, podem ocorrer recessões em intervalos de poucos anos. Durante uma recessão a produção em geral é mais baixa (volta aos níveis anteriores quando termina) STR_CONFIG_SETTING_TRAIN_REVERSING :Desabilitar inversão de combóios nas estações: {STRING} -STR_CONFIG_SETTING_TRAIN_REVERSING_HELPTEXT :Quando activo, os combóios não podem inverter marcha em estações não-terminais, mesmo se existir um caminho mais curto para o destino seguinte com inversão +STR_CONFIG_SETTING_TRAIN_REVERSING_HELPTEXT :Quando ativo, os comboios não podem inverter marcha em estações não-terminais, mesmo se existir um caminho mais curto para o próximo destino ao inverter STR_CONFIG_SETTING_DISASTERS :Desastres: {STRING} -STR_CONFIG_SETTING_DISASTERS_HELPTEXT :Activa desastres que podem ocasionalmente bloquear ou destruir veículos ou infraestruturas +STR_CONFIG_SETTING_DISASTERS_HELPTEXT :Ativa desastres que podem ocasionalmente bloquear ou destruir veículos ou infraestruturas STR_CONFIG_SETTING_CITY_APPROVAL :Atitude da autoridade local: {STRING} STR_CONFIG_SETTING_CITY_APPROVAL_HELPTEXT :Escolha de que forma o ruído e dano ambiental causado pelas empresas afeta o rating da povoação e futuras ações de construção nessa povoação @@ -1259,7 +1259,7 @@ STR_CONFIG_SETTING_CATCHMENT :Dimensionamento STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Haver diferentes áreas de cobertura para diferentes tipos de estações e aeroportos STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES :Estações da companhia podem servir industrias equipadas com estações neutras: {STRING} -STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT :Quando activo, industrias com estações incluídas (com as Petrolíferas) podem ser servidas por estações da companhia construídas nas redondezas. Quando inactivo, estas industrias só podem ser servidas pela sua própria estação. Qualquer estação da companhia não poderá servir a industria, nem a estação incluída poder servir outra entidade senão a própria industria +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT :Quando ativo, industrias com estações incluídas (com as Petrolíferas) podem ser servidas por estações da companhia construídas nas redondezas. Quando inativo, estas industrias só podem ser servidas pela sua própria estação. Qualquer estação da companhia não poderá servir a industria, nem a estação incluída pode servir outra entidade senão a própria industria STR_CONFIG_SETTING_EXTRADYNAMITE :Permite remover mais estradas, pontes e túneis detidos pela cidade: {STRING} STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Facilitar a remoçar de edifícios e infraestruturas detidas pela localidade @@ -1272,10 +1272,10 @@ STR_CONFIG_SETTING_SMOKE_AMOUNT :Quantidade de f STR_CONFIG_SETTING_SMOKE_AMOUNT_HELPTEXT :Assignar quanto fumo ou quantas faíscas são emitidas pelos veículos STR_CONFIG_SETTING_TRAIN_ACCELERATION_MODEL :Modelo de aceleração de comboios: {STRING} -STR_CONFIG_SETTING_TRAIN_ACCELERATION_MODEL_HELPTEXT :Escolha o modelo de física para a aceleração de comboios. O modelo "original" penalisa as inclinações para todos os veículos. O modelo "realista" penalisa as curvas e inclinações tendo em conta várias propriedades do objecto, como o tamanho e esforço tractivo +STR_CONFIG_SETTING_TRAIN_ACCELERATION_MODEL_HELPTEXT :Escolha o modelo de física para a aceleração de comboios. O modelo "original" penaliza as inclinações para todos os veículos. O modelo "realista" penaliza as curvas e inclinações tendo em conta várias propriedades do comboio, tais como o comprimento e o esforço de tração STR_CONFIG_SETTING_ROAD_VEHICLE_ACCELERATION_MODEL :Tipo de aceleração dos veículos rodoviários: {STRING} -STR_CONFIG_SETTING_ROAD_VEHICLE_ACCELERATION_MODEL_HELPTEXT :Escolha o modelo de física para a aceleração de veículos de estrada. O modelo "original" penalisa as inclinações para todos os veículos. O modelo "realista" penalisa as curvas e inclinações tendo em conta várias propriedades do motor, como o esforço tractivo +STR_CONFIG_SETTING_ROAD_VEHICLE_ACCELERATION_MODEL_HELPTEXT :Escolha o modelo de física para a aceleração de veículos de estrada. O modelo "original" penaliza as inclinações para todos os veículos. O modelo "realista" penaliza as curvas e inclinações tendo em conta várias propriedades do motor, tais como o esforço de tração STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS :Ângulo de inclinação para comboios: {STRING} STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS_HELPTEXT :Ângulo de inclinação de um quadrado para um comboio. Valores mais elevados tornam a subida mais difícil @@ -1336,7 +1336,7 @@ STR_CONFIG_SETTING_STOP_LOCATION_MIDDLE :no meio STR_CONFIG_SETTING_STOP_LOCATION_FAR_END :no extremo longe STR_CONFIG_SETTING_AUTOSCROLL :Deslocar janela quando o rato está na borda do mapa: {STRING} -STR_CONFIG_SETTING_AUTOSCROLL_HELPTEXT :Quando activo, os visualizadores começam a deslocar-se logo que o rato esteja no extremo da janela +STR_CONFIG_SETTING_AUTOSCROLL_HELPTEXT :Quando ativo, os visualizadores começam a deslocar-se logo que o rato esteja no extremo da janela ###length 4 STR_CONFIG_SETTING_AUTOSCROLL_DISABLED :Desligado STR_CONFIG_SETTING_AUTOSCROLL_MAIN_VIEWPORT_FULLSCREEN :Visualizador principal, só ecrã cheio @@ -1379,13 +1379,13 @@ STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT :Permite constru STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Não é possível mudar quando já existem veículos. STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Manutenção de infraestruturas: {STRING} -STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Quando activo, as infraestruturas têm custos de manutenção. O custo cresce mais do que proporcionalmente com o tamanho da rede e com isso afecta mais as companhias maiores comparado com as mais pequeneas +STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Quando ativo, as infraestruturas têm custos de manutenção. O custo cresce mais do que proporcionalmente com o tamanho da rede e com isso afeta mais as companhias maiores comparando com as mais pequenas STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR :Côr de inicio da empresa: {STRING} STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT :Escolher côr de inicio da empresa STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Aeroportos nunca expiram: {STRING} -STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Activar esta preferência torna cada tipo de aeroporto disponível para sempre após a sua introdução +STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Ativar esta preferência torna cada tipo de aeroporto disponível para sempre após a sua introdução STR_CONFIG_SETTING_WARN_LOST_VEHICLE :Avisar se o veículo está perdido: {STRING} STR_CONFIG_SETTING_WARN_LOST_VEHICLE_HELPTEXT :Mostrar mensagens sobre veículos que não conseguem encontrar o caminho para o seu próximo destino. @@ -1398,13 +1398,13 @@ STR_CONFIG_SETTING_ORDER_REVIEW_EXDEPOT :Sim, mas exclui STR_CONFIG_SETTING_ORDER_REVIEW_ON :De todos os veículos STR_CONFIG_SETTING_WARN_INCOME_LESS :Avisar se o lucro de um veiculo for negativo: {STRING} -STR_CONFIG_SETTING_WARN_INCOME_LESS_HELPTEXT :Quando activo, uma notícia é enviada quando um veículo não deu lucro durante um ano +STR_CONFIG_SETTING_WARN_INCOME_LESS_HELPTEXT :Quando ativo, uma notícia é enviada quando um veículo não deu lucro durante um ano STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES :Veículos nunca expiram: {STRING} -STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES_HELPTEXT :Quando activo, todos os modelos de veículos permanecerão disponíveis para sempre após a sua introdução +STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES_HELPTEXT :Quando ativo, todos os modelos de veículos permanecerão disponíveis para sempre após a sua introdução STR_CONFIG_SETTING_AUTORENEW_VEHICLE :Auto-renovação de veículos quando ficam velhos: {STRING} -STR_CONFIG_SETTING_AUTORENEW_VEHICLE_HELPTEXT :Quando activo, um veículo a chegar ao fim de vida é automaticamente substituído quando as condições de renovação estão reunidas +STR_CONFIG_SETTING_AUTORENEW_VEHICLE_HELPTEXT :Quando ativo, um veículo a chegar ao fim de vida é automaticamente substituído quando as condições de renovação estão reunidas STR_CONFIG_SETTING_AUTORENEW_MONTHS :Renovar automaticamente quando um veículo chega a {STRING} a idade máxima STR_CONFIG_SETTING_AUTORENEW_MONTHS_HELPTEXT :Idade relativa a partir da qual um veículo deva ser indicado para auto-renovação @@ -1433,6 +1433,8 @@ STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT :Largura da linh STR_CONFIG_SETTING_SHOW_NEWGRF_NAME :Exibir o nome do "NewGRF" na janela de compra de veículos: {STRING} STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT :Adiciona uma linha à janela de compra de veículos, mostrando a qual "NewGRF" pertence o veículo selecionado. +STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS :Mostrar as cargas que os veículos podem transportar nas janelas de listagem {STRING} +STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS_HELPTEXT :Quando ativo, a carga transportável do veículo aparecerá acima nas listas de veículos STR_CONFIG_SETTING_LANDSCAPE :Cenário: {STRING} STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Os climas definem a jogabilidade base dos cenários com diferentes cargas e requisitos de crescimento das localidades. Os "NewGRF" e "Scripts" de Jogo permitem um controlo mais preciso. @@ -1534,7 +1536,7 @@ STR_CONFIG_SETTING_SCROLLMODE_RMB :Mover mapa com STR_CONFIG_SETTING_SCROLLMODE_LMB :Mover mapa com Botão Esquerdo Rato STR_CONFIG_SETTING_SMOOTH_SCROLLING :Suavizar deslocamento da navegação no mapa: {STRING} -STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Controla como a vista principal navega para uma posição específica ao clicar no mapa pequeno ou ao dar um comando para navegar para um objecto específico no mapa. Se activo, a vista principal navega suavemente, se inactivo a vista salta directamente para o destino. +STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Controla como a vista principal navega para uma posição específica ao clicar no mapa pequeno ou ao dar um comando para navegar para um objeto específico no mapa. Se ativo, a vista principal navega suavemente, se inativo a vista salta diretamente para o destino. STR_CONFIG_SETTING_MEASURE_TOOLTIP :Mostrar medidas nas várias ferramentas de construção: {STRING} STR_CONFIG_SETTING_MEASURE_TOOLTIP_HELPTEXT :Mostrar distâncias em quadrados e diferenças de altura enquanto arrasta o rato durante tarefas de construção @@ -1553,7 +1555,7 @@ STR_CONFIG_SETTING_SCROLLWHEEL_MULTIPLIER :Velocidade da r STR_CONFIG_SETTING_SCROLLWHEEL_MULTIPLIER_HELPTEXT :Controlo de sensibilidade da roda de rolagem do rato STR_CONFIG_SETTING_SCROLLWHEEL_SCROLLING :Função da roda do rato: {STRING} -STR_CONFIG_SETTING_SCROLLWHEEL_SCROLLING_HELPTEXT :Activar navegação com rodas de scroll bidimensional +STR_CONFIG_SETTING_SCROLLWHEEL_SCROLLING_HELPTEXT :Ativar "scroll" com rodas de rato bidimensionais ###length 3 STR_CONFIG_SETTING_SCROLLWHEEL_ZOOM :Ampliar mapa STR_CONFIG_SETTING_SCROLLWHEEL_SCROLL :Percorrer mapa @@ -1562,7 +1564,7 @@ STR_CONFIG_SETTING_SCROLLWHEEL_OFF :Desligado STR_CONFIG_SETTING_OSK_ACTIVATION :Teclado no ecrã: {STRING} STR_CONFIG_SETTING_OSK_ACTIVATION_HELPTEXT :Selecione o método de abertura de teclado virtual para escrita de texto em caixas, usando apenas o cursor. Esta opção destina-se principalmente para equipamentos pequenos sem teclado físico. ###length 4 -STR_CONFIG_SETTING_OSK_ACTIVATION_DISABLED :Desactivado +STR_CONFIG_SETTING_OSK_ACTIVATION_DISABLED :Desativado STR_CONFIG_SETTING_OSK_ACTIVATION_DOUBLE_CLICK :Duplo clique STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK_FOCUS :Clique simples (quando em foco) STR_CONFIG_SETTING_OSK_ACTIVATION_SINGLE_CLICK :Clique (imediatamente) @@ -1582,7 +1584,7 @@ STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_CONTROL : + clique STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_OFF :Desligado STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE :Fechar janelas ao fazer clique direito: {STRING} -STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE_HELPTEXT :Fecha uma janela ao fazer clique direito dentro dela. Desactiva os textos de ajuda ao fazer clique direito! +STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE_HELPTEXT :Fecha uma janela ao fazer clique direito dentro dela. Desativa os textos de ajuda ao fazer clique direito! STR_CONFIG_SETTING_AUTOSAVE :Guardar automaticamente: {STRING} STR_CONFIG_SETTING_AUTOSAVE_HELPTEXT :Seleccione o intervalo entre gravações automáticas @@ -1595,7 +1597,7 @@ STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES_SHORT :curto (31-12-20 STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES_ISO :ISO (2008-12-31) STR_CONFIG_SETTING_PAUSE_ON_NEW_GAME :Pausa automática ao iniciar um novo jogo: {STRING} -STR_CONFIG_SETTING_PAUSE_ON_NEW_GAME_HELPTEXT :Quando activo, o jogo ficará em pausa automaticamente num novo jogo, permitindo o estudo ao pormenor do mapa +STR_CONFIG_SETTING_PAUSE_ON_NEW_GAME_HELPTEXT :Quando ativo, o jogo ficará em pausa automaticamente num novo jogo, permitindo o estudo ao pormenor do mapa STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL :Durante pausa permitir: {STRING} STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL_HELPTEXT :Seleccionar que acções podem ser feitas enquanto o jogo está em pausa @@ -1606,7 +1608,7 @@ STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL_ALL_NON_LANDSCAPING :Todas expecto a STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL_ALL_ACTIONS :Todas as acções STR_CONFIG_SETTING_ADVANCED_VEHICLE_LISTS :Usar a lista avançada de veículos: {STRING} -STR_CONFIG_SETTING_ADVANCED_VEHICLE_LISTS_HELPTEXT :Activar a utilização de listas avançadas de veículos para o agrupamento de veículos +STR_CONFIG_SETTING_ADVANCED_VEHICLE_LISTS_HELPTEXT :Ativar a utilização de listas avançadas de veículos para o agrupamento de veículos STR_CONFIG_SETTING_LOADING_INDICATORS :Usar indicadores de carga: {STRING} STR_CONFIG_SETTING_LOADING_INDICATORS_HELPTEXT :Seleccionar se os indicadores de carga são mostrados acima de veículos em carga ou descarga @@ -1630,7 +1632,7 @@ STR_CONFIG_SETTING_DEFAULT_RAIL_TYPE_MOST_USED :Mais utilizado STR_CONFIG_SETTING_SHOW_TRACK_RESERVATION :Mostrar caminho de ferro reservado: {STRING} STR_CONFIG_SETTING_SHOW_TRACK_RESERVATION_HELPTEXT :Dar cores diferentes aos carris reservados para ajudar a detectar problemas com combóios que recusam entrar em bloqueios baseados em caminhos -STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS :Deixar ferramentas de construção activas depois de usadas: {STRING} +STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS :Deixar ferramentas de construção ativas depois de usadas: {STRING} STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS_HELPTEXT :Manter as ferramentas de construção de pontes, túneis, etc. abertas após uso STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS :Remover automaticamente os sinais durante a construção de vias férreas: {STRING} @@ -1678,17 +1680,17 @@ STR_CONFIG_SETTING_MAX_AIRCRAFT_HELPTEXT :Número máximo STR_CONFIG_SETTING_MAX_SHIPS :Máximo de navios por empresa: {STRING} STR_CONFIG_SETTING_MAX_SHIPS_HELPTEXT :Número máximo de navios que uma companhia pode ter -STR_CONFIG_SETTING_AI_BUILDS_TRAINS :Desactivar comboios para o computador: {STRING} -STR_CONFIG_SETTING_AI_BUILDS_TRAINS_HELPTEXT :Activar esta preferência impossibilita a criação de comboios por jogadores controlados pelo computador +STR_CONFIG_SETTING_AI_BUILDS_TRAINS :Desativar comboios para o computador: {STRING} +STR_CONFIG_SETTING_AI_BUILDS_TRAINS_HELPTEXT :Ativar esta preferência impossibilita a criação de comboios por jogadores controlados pelo computador -STR_CONFIG_SETTING_AI_BUILDS_ROAD_VEHICLES :Desactivar veículos rodoviários para o computador: {STRING} -STR_CONFIG_SETTING_AI_BUILDS_ROAD_VEHICLES_HELPTEXT :Activar esta preferência impossibilita a construção de veículos de estrada por um jogador controlado pelo computador +STR_CONFIG_SETTING_AI_BUILDS_ROAD_VEHICLES :Desativar veículos rodoviários para o computador: {STRING} +STR_CONFIG_SETTING_AI_BUILDS_ROAD_VEHICLES_HELPTEXT :Ativar esta preferência impossibilita a construção de veículos de estrada por um jogador controlado pelo computador -STR_CONFIG_SETTING_AI_BUILDS_AIRCRAFT :Desactivar aeronaves para o computador: {STRING} -STR_CONFIG_SETTING_AI_BUILDS_AIRCRAFT_HELPTEXT :Activar esta preferência impossibilita a construção de aeronaves por um jogador controlado pelo computador +STR_CONFIG_SETTING_AI_BUILDS_AIRCRAFT :Desativar aeronaves para o computador: {STRING} +STR_CONFIG_SETTING_AI_BUILDS_AIRCRAFT_HELPTEXT :Ativar esta preferência impossibilita a construção de aeronaves por um jogador controlado pelo computador -STR_CONFIG_SETTING_AI_BUILDS_SHIPS :Desactivar navios para o computador: {STRING} -STR_CONFIG_SETTING_AI_BUILDS_SHIPS_HELPTEXT :Activar esta preferência impossibilita a construção de navios por um jogador controlado pelo computador +STR_CONFIG_SETTING_AI_BUILDS_SHIPS :Desativar navios para o computador: {STRING} +STR_CONFIG_SETTING_AI_BUILDS_SHIPS_HELPTEXT :Ativar esta preferência impossibilita a construção de navios por um jogador controlado pelo computador STR_CONFIG_SETTING_AI_PROFILE :Perfil de preferências por omissão: {STRING} STR_CONFIG_SETTING_AI_PROFILE_HELPTEXT :Escolher o perfil de preferências a usar para IAs aleatórias ou para valores iniciais ao adicionar uma nova IA ou Script de Jogo @@ -1707,7 +1709,7 @@ STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_HELPTEXT :Definir o volum STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_VALUE :{COMMA} MiB STR_CONFIG_SETTING_SERVINT_ISPERCENT :Os intervalos de serviço são em percentagem: {STRING} -STR_CONFIG_SETTING_SERVINT_ISPERCENT_HELPTEXT :Escolher se a manutenção de veículos é activada pelo tempo passado deste a última manutenção, ou pela fiabilidade abaixo de uma certa percentagem da fiabilidade máxima +STR_CONFIG_SETTING_SERVINT_ISPERCENT_HELPTEXT :Escolher se a manutenção de veículos é ativada pelo tempo decorrido deste a última manutenção, ou pela fiabilidade abaixo de uma certa percentagem da fiabilidade máxima STR_CONFIG_SETTING_SERVINT_TRAINS :Intervalo de serviço para comboios por omissão: {STRING} STR_CONFIG_SETTING_SERVINT_TRAINS_HELPTEXT :Definir o intervalo de manutenção por omissão para novos veículos sobre carris, se não for configurado um intervalo de manutenção explícito para o veículo @@ -1725,10 +1727,10 @@ STR_CONFIG_SETTING_NOSERVICE :Não fazer manu STR_CONFIG_SETTING_NOSERVICE_HELPTEXT :Quando ativo, os veículos não farão manutenção se não puderem avariar STR_CONFIG_SETTING_WAGONSPEEDLIMITS :Ativar limites de velocidade para vagões: {STRING} -STR_CONFIG_SETTING_WAGONSPEEDLIMITS_HELPTEXT :Quando activo, usar também os limites de velocidade das carruagens para decidir a velocidade máxima de um comboio +STR_CONFIG_SETTING_WAGONSPEEDLIMITS_HELPTEXT :Quando ativo, aplica também os limites de velocidade dos vagões para decidir a velocidade máxima do comboio -STR_CONFIG_SETTING_DISABLE_ELRAILS :Desactivar carris electrificados: {STRING} -STR_CONFIG_SETTING_DISABLE_ELRAILS_HELPTEXT :Activar esta preferência desactiva o requisito de electrificar carris para que composições eléctricas os possam utilizar +STR_CONFIG_SETTING_DISABLE_ELRAILS :Desativar carris eletrificados: {STRING} +STR_CONFIG_SETTING_DISABLE_ELRAILS_HELPTEXT :Ativar esta preferência desativa o requisito de eletrificar carris para que composições elétricas os possam utilizar STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OWN :Chegada do primeiro veículo à estação do jogador: {STRING} STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OWN_HELPTEXT :Mostrar um jornal na chegada do primeiro veículo a uma estação nova do jogador @@ -1800,7 +1802,7 @@ STR_CONFIG_SETTING_ECONOMY_TYPE_SMOOTH :Suave STR_CONFIG_SETTING_ECONOMY_TYPE_FROZEN :Congelada STR_CONFIG_SETTING_ALLOW_SHARES :Permite comprar acções de outras empresas: {STRING} -STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT :Quando activo, permite a compra e venda de acções de companhias. As acções apenas estarão disponíveis quando a companhia atinge uma determinada idade. +STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT :Quando ativo, permite a compra e venda de ações de companhias. As ações apenas estarão disponíveis quando a companhia atinge uma determinada idade. STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES :Idade mínima da empresa para negociar ações: {STRING} STR_CONFIG_SETTING_MIN_YEARS_FOR_SHARES_HELPTEXT :Definir a idade mínima de uma companhia a partir da qual outros jogadores poderão comprar ou vender ações da mesma. @@ -1812,7 +1814,7 @@ STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY :Ao arrastar, co STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY_HELPTEXT :Define a distância a que os sinais serão construídos num carril até ao próximo obstáculo (sinal, junção), se os sinais são arrastados STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY_VALUE :{COMMA} quadrado{P 0 "" s} STR_CONFIG_SETTING_DRAG_SIGNALS_FIXED_DISTANCE :Ao arrastar, manter distância fixa entre sinais: {STRING} -STR_CONFIG_SETTING_DRAG_SIGNALS_FIXED_DISTANCE_HELPTEXT :Seleccionar o comportamento da colocação de sinais ao usar Ctrl+arrasto. Se desactivado, sinais são colocados à volta de túneis ou pontes para evitar longos trajectos sem sinais. Se activo, sinais são colocados a cada N mosaicos, facilitando o alinhamento de sinais em linhas paralelas +STR_CONFIG_SETTING_DRAG_SIGNALS_FIXED_DISTANCE_HELPTEXT :Selecionar o comportamento da colocação de sinais ao usar Ctrl+arrasto. Se desativado, os sinais são colocados à volta de túneis ou pontes para evitar longos trajetos sem sinais. Se ativo, os sinais são colocados a cada N mosaicos, facilitando o alinhamento de sinais em linhas paralelas STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Usar automaticamente sinais clássicos antes de: {STRING} STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Configurar o ano em que sinais eléctricos podem ser usados para os carris. Antes deste ano, sinais não-eléctricos serão usados (que têm a mesma funcionalidade, mas aspecto diferente) @@ -1839,15 +1841,15 @@ STR_CONFIG_SETTING_TOWN_LAYOUT_3X3_GRID :grelha 3x3 STR_CONFIG_SETTING_TOWN_LAYOUT_RANDOM :Aleatório STR_CONFIG_SETTING_ALLOW_TOWN_ROADS :As localidades têm permissão para construir estradas: {STRING} -STR_CONFIG_SETTING_ALLOW_TOWN_ROADS_HELPTEXT :Permite às localidades a construção de estradas para crescimento. Desactivar para não permitir às autoridades a construção de estradas +STR_CONFIG_SETTING_ALLOW_TOWN_ROADS_HELPTEXT :Permite às localidades a construção de estradas para crescimento. Desativar para prevenir a construção de estradas pelas autoridades locais. STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS :Localidades podem construir passagens de nível: {STRING} -STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS_HELPTEXT :Activar esta preferência permite às localidades construir cruzamentos nivelados +STR_CONFIG_SETTING_ALLOW_TOWN_LEVEL_CROSSINGS_HELPTEXT :Ativar esta preferência permite às localidades construir cruzamentos nivelados STR_CONFIG_SETTING_NOISE_LEVEL :Permitir que a localidade controle o nível de ruído dos aeroportos: {STRING} -STR_CONFIG_SETTING_NOISE_LEVEL_HELPTEXT :Com esta preferência desactivada, podem haver dois aeroportos em cada localidade. Com esta preferência activa, o número de aeroportos numa localidade é limitado pela aceitação do ruído na mesma, que depende da população, do tamanho do aeroporto e da sua distância +STR_CONFIG_SETTING_NOISE_LEVEL_HELPTEXT :Com esta preferência desativada, podem haver dois aeroportos em cada localidade. Com esta preferência ativa, o número de aeroportos numa localidade é limitado pela aceitação do ruído na mesma, que depende da população, do tamanho do aeroporto e da sua distância STR_CONFIG_SETTING_TOWN_FOUNDING :Fundar localidades no jogo: {STRING} -STR_CONFIG_SETTING_TOWN_FOUNDING_HELPTEXT :Activar esta preferência permite aos jogadores fundar novas povoações no jogo +STR_CONFIG_SETTING_TOWN_FOUNDING_HELPTEXT :Ativar esta preferência permite aos jogadores fundar novas povoações no jogo ###length 3 STR_CONFIG_SETTING_TOWN_FOUNDING_FORBIDDEN :Proibido STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :Permitido @@ -2120,7 +2122,7 @@ STR_CHEAT_EDIT_MAX_HL :{LTBLUE}Editar STR_CHEAT_EDIT_MAX_HL_QUERY_CAPT :{WHITE}Editar altura máxima de montanhas no mapa STR_CHEAT_CHANGE_DATE :{LTBLUE}Alterar data: {ORANGE}{DATE_SHORT} STR_CHEAT_CHANGE_DATE_QUERY_CAPT :{WHITE}Alterar ano actual -STR_CHEAT_SETUP_PROD :{LTBLUE}Activar modificação de valores de produção: {ORANGE}{STRING} +STR_CHEAT_SETUP_PROD :{LTBLUE}Ativar modificação de valores de produção: {ORANGE}{STRING} # Livery window STR_LIVERY_CAPTION :{WHITE}{COMPANY} - Novo Esquema de Cores @@ -2192,7 +2194,7 @@ STR_FACE_AFRICAN :{BLACK}Africano STR_FACE_SELECT_AFRICAN :{BLACK}Seleccionar Caras Africanas STR_FACE_YES :Sim STR_FACE_NO :Não -STR_FACE_MOUSTACHE_EARRING_TOOLTIP :{BLACK}Activar bigode ou brinco +STR_FACE_MOUSTACHE_EARRING_TOOLTIP :{BLACK}Ativar bigode ou brinco STR_FACE_HAIR :Cabelo: STR_FACE_HAIR_TOOLTIP :{BLACK}Mudar cabelo STR_FACE_EYEBROWS :Sobrancelhas: @@ -2200,7 +2202,7 @@ STR_FACE_EYEBROWS_TOOLTIP :{BLACK}Mudar so STR_FACE_EYECOLOUR :Cor dos olhos: STR_FACE_EYECOLOUR_TOOLTIP :{BLACK}Mudar cor dos olhos STR_FACE_GLASSES :Óculos: -STR_FACE_GLASSES_TOOLTIP :{BLACK}Activar óculos +STR_FACE_GLASSES_TOOLTIP :{BLACK}Ativar óculos STR_FACE_GLASSES_TOOLTIP_2 :{BLACK}Mudar óculos STR_FACE_NOSE :Nariz: STR_FACE_NOSE_TOOLTIP :{BLACK}Mudar nariz @@ -2722,7 +2724,7 @@ STR_ROAD_TOOLBAR_TOOLTIP_BUILD_BUS_STATION :{BLACK}Construi STR_ROAD_TOOLBAR_TOOLTIP_BUILD_PASSENGER_TRAM_STATION :{BLACK}Construir paragem de eléctricos para passageiros. Ctrl permite juntar estações. Shift alterna contruir/mostrar custo estimado STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Construir área de carregamento de camiões. Ctrl permite juntar estações. Shift alterna contruir/mostrar custo estimado STR_ROAD_TOOLBAR_TOOLTIP_BUILD_CARGO_TRAM_STATION :{BLACK}Construir paragem de eléctricos para carga. Ctrl permite juntar estações. Shift alterna contruir/mostrar custo estimado -STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_ONE_WAY_ROAD :{BLACK}Activar/Desactivar estradas de sentido único +STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_ONE_WAY_ROAD :{BLACK}Ativar/Desativar estradas de sentido único STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_BRIDGE :{BLACK}Construir ponte de estrada. Shift alterna contruir/mostrar custo estimado STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_BRIDGE :{BLACK}Construir ponte para eléctricos. Shift alterna contruir/mostrar custo estimado STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_TUNNEL :{BLACK}Construir túnel de estrada. Shift alterna contruir/mostrar custo estimado @@ -3234,8 +3236,8 @@ STR_GENERATION_PREPARING_GAME :{BLACK}A prepar # NewGRF settings STR_NEWGRF_SETTINGS_CAPTION :{WHITE}Definições NewGRF STR_NEWGRF_SETTINGS_INFO_TITLE :{WHITE}Informação detalhada do NewGRF -STR_NEWGRF_SETTINGS_ACTIVE_LIST :{WHITE}Ficheiros NewGRF activos -STR_NEWGRF_SETTINGS_INACTIVE_LIST :{WHITE}Ficheiros NewGRF inactivos +STR_NEWGRF_SETTINGS_ACTIVE_LIST :{WHITE}Ficheiros NewGRF ativos +STR_NEWGRF_SETTINGS_INACTIVE_LIST :{WHITE}Ficheiros NewGRF inativos STR_NEWGRF_SETTINGS_SELECT_PRESET :{ORANGE}Seleccionar predefinição: STR_NEWGRF_FILTER_TITLE :{ORANGE}Filtro: STR_NEWGRF_SETTINGS_PRESET_LIST_TOOLTIP :{BLACK}Carrega a predefinição seleccionada @@ -3281,7 +3283,7 @@ STR_NEWGRF_SETTINGS_PARAMETER_NONE :Nenhum STR_NEWGRF_SETTINGS_NO_INFO :{BLACK}Sem informação disponível STR_NEWGRF_SETTINGS_NOT_FOUND :{RED}Ficheiro correspondente não encontrado -STR_NEWGRF_SETTINGS_DISABLED :{RED}Desactivado +STR_NEWGRF_SETTINGS_DISABLED :{RED}Desativado STR_NEWGRF_SETTINGS_INCOMPATIBLE :{RED}Incompatível com esta versão do OpenTTD # NewGRF save preset window @@ -3357,7 +3359,7 @@ STR_NEWGRF_ERROR_CORRUPT_SPRITE :{YELLOW}{STRING STR_NEWGRF_ERROR_MULTIPLE_ACTION_8 :Contém múltiplas entradas Action 8 - (sprite {3:NUM}) STR_NEWGRF_ERROR_READ_BOUNDS :Leitura além dos limites do pseudo-sprite (sprite {3:NUM}) STR_NEWGRF_ERROR_GRM_FAILED :Recursos GRF pedidos não disponíveis (sprite {3:NUM}) -STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} foi desactivado por {STRING} +STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{1:STRING} foi desativado por {STRING} STR_NEWGRF_ERROR_INVALID_SPRITE_LAYOUT :Formato de Gráfico Inválido ou desconhecido (sprite {3:NUM}) STR_NEWGRF_ERROR_LIST_PROPERTY_TOO_LONG :Demasiados elementos na lista de valores de propriedade (sprite {3:NUM}, propriedade {4:HEX}) STR_NEWGRF_ERROR_INDPROD_CALLBACK :Revogação da produção industrial inválida (sprite {3:NUM}, "{2:STRING}") @@ -3371,7 +3373,7 @@ STR_NEWGRF_COMPATIBLE_LOADED :{ORANGE}Ficheir STR_NEWGRF_TOO_MANY_NEWGRFS :{WHITE}Impossivel adicionar ficheiro: alcançado limite de ficheiros NewGRF STR_NEWGRF_COMPATIBLE_LOAD_WARNING :{WHITE}GRF(s) compatíveis carregados para ficheiros em falta -STR_NEWGRF_DISABLED_WARNING :{WHITE}Ficheiro(s) GRF em falta foram desactivados +STR_NEWGRF_DISABLED_WARNING :{WHITE}Ficheiro(s) GRF em falta foram desativados STR_NEWGRF_UNPAUSE_WARNING_TITLE :{YELLOW}Ficheiro(s) GRF em falta STR_NEWGRF_UNPAUSE_WARNING :{WHITE}Sair da pausa pode causar problemas ao OpenTTD. Não envie informações sobre este tipo de problemas.{}Deseja realmente sair da pausa? @@ -3803,6 +3805,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Enviar i STR_VEHICLE_LIST_REPLACE_VEHICLES :Substituir Veículos STR_VEHICLE_LIST_SEND_FOR_SERVICING :Enviar para Serviço STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Lucro deste ano: {CURRENCY_LONG} (último ano: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Enviar para Depósito STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Enviar para Depósito @@ -5026,6 +5030,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Não é STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... o veículo está destruido + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Nenhum veículo estará disponível STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Mudar a sua configuração NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Nenhum veículo ainda disponível diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index 0e977158bd..4ff528863d 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -4977,6 +4977,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Nu se po STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... vehiculul este distrus + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Niciun vehicul nu va fi disponibil STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Schimbă configuraţia NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Niciun vehicul nu este disponibil încă diff --git a/src/lang/russian.txt b/src/lang/russian.txt index a40b0f7294..bf74524972 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -5212,6 +5212,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Нево STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... транспортное средство уничтожено + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Все транспортные средства будут недоступны STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Измените конфигурацию модуля NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Нет доступных транспортных средств diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt index 24956c001c..2227791454 100644 --- a/src/lang/serbian.txt +++ b/src/lang/serbian.txt @@ -5166,6 +5166,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Servisni STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... vozilo je uništeno + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Nijedno vozilo neće biti dostupno STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Promenite konfiguraciju za NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Nijedno vozilo još uvek nije dostupno diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index b442ac3146..990d1305ef 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -4978,6 +4978,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}不能 STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... 运具已撞毁 + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}没有可用的运输工具 STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}请改动您的 NewGRF 设置 STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}暂时沒有可用的运输工具 diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt index 445748f4ff..0abcd6f08b 100644 --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -5093,6 +5093,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Nemožno STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... vozidlo je zničené + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Žiadne vozidlá nebudú k dispozícii STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Zmena vašej konfigurácie NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Zatiaľ nie sú dostupné žiadne vozidlá diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt index 10917c2b24..b07af30796 100644 --- a/src/lang/slovenian.txt +++ b/src/lang/slovenian.txt @@ -4714,6 +4714,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Ni mogo STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... vozilo je uničeno + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Sploh ni razpoložljivih vozil STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Zamenjaj svojo NewGRF konfiguracijo STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Ni še vozil na razpolago. diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index f01a975255..c306c42c6a 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -1138,7 +1138,7 @@ STR_TERRAIN_TYPE_CUSTOM :Altura personal STR_TERRAIN_TYPE_CUSTOM_VALUE :Altura personalizada ({NUM}) ###length 4 -STR_CITY_APPROVAL_LENIENT :Tolerante +STR_CITY_APPROVAL_LENIENT :Indulgente STR_CITY_APPROVAL_TOLERANT :Tolerante STR_CITY_APPROVAL_HOSTILE :Hostil STR_CITY_APPROVAL_PERMISSIVE :Permisiva (sin efecto sobre las acciones de las compañías) @@ -1433,6 +1433,8 @@ STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT :Grosor de las l STR_CONFIG_SETTING_SHOW_NEWGRF_NAME :Mostrar el nombre del NewGRF en la ventana de compra de vehículos: {STRING} STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT :Añade una línea a la ventana de compra de vehículos, mostrando a qué NewGRF pertenece el vehículo seleccionado. +STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS :Mostrar las cargas que pueden llevar los vehículos en las ventanas con listas {STRING} +STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS_HELPTEXT :Si se activa, las cargas que los vehículos pueden transportar aparecerán encima de éstos en las listas de vehículos STR_CONFIG_SETTING_LANDSCAPE :Terreno: {STRING} STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Los terrenos definen escenarios con diferentes tipos de carga y requisitos de crecimiento de municipios. Es posible modificarlos empleando NewGRF y scripts de juego @@ -1991,7 +1993,7 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_METRIC :Métrico (m) STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_SI :SI (m) STR_CONFIG_SETTING_LOCALISATION :{ORANGE}Localización -STR_CONFIG_SETTING_GRAPHICS :{ORANGE}Gráficas +STR_CONFIG_SETTING_GRAPHICS :{ORANGE}Gráficos STR_CONFIG_SETTING_SOUND :{ORANGE}Efectos de sonido STR_CONFIG_SETTING_INTERFACE :{ORANGE}Interfaz STR_CONFIG_SETTING_INTERFACE_GENERAL :{ORANGE}General @@ -2894,14 +2896,14 @@ STR_FUND_INDUSTRY_REMOVE_ALL_INDUSTRIES_QUERY :{YELLOW}¿Está STR_INDUSTRY_CARGOES_INDUSTRY_CAPTION :{WHITE}Cadena de industrias para la industria {STRING} STR_INDUSTRY_CARGOES_CARGO_CAPTION :{WHITE}Cadena de industrias para la carga {STRING} STR_INDUSTRY_CARGOES_PRODUCERS :{WHITE}Industrias proveedoras -STR_INDUSTRY_CARGOES_CUSTOMERS :{WHITE}Industrias clientes +STR_INDUSTRY_CARGOES_CUSTOMERS :{WHITE}Industrias consumidoras STR_INDUSTRY_CARGOES_HOUSES :{WHITE}Casas STR_INDUSTRY_CARGOES_INDUSTRY_TOOLTIP :{BLACK}Clica en la industria para ver sus proveedores y clientes -STR_INDUSTRY_CARGOES_CARGO_TOOLTIP :{BLACK}{STRING}{}Clica en la carga para mostrar sus proveedores y clientes +STR_INDUSTRY_CARGOES_CARGO_TOOLTIP :{BLACK}{STRING}{}Clica en la carga para mostrar sus proveedores y consumidores STR_INDUSTRY_DISPLAY_CHAIN :{BLACK}Mostrar cadena STR_INDUSTRY_DISPLAY_CHAIN_TOOLTIP :{BLACK}Muestra industrias que suministran o aceptan la carga -STR_INDUSTRY_CARGOES_NOTIFY_SMALLMAP :{BLACK}Enlazar al mapa -STR_INDUSTRY_CARGOES_NOTIFY_SMALLMAP_TOOLTIP :{BLACK}Muestra las industrias seleccionadas también en el minimapa +STR_INDUSTRY_CARGOES_NOTIFY_SMALLMAP :{BLACK}Mostran en el minimapa +STR_INDUSTRY_CARGOES_NOTIFY_SMALLMAP_TOOLTIP :{BLACK}Muestra las industrias seleccionadas en el minimapa STR_INDUSTRY_CARGOES_SELECT_CARGO :{BLACK}Seleccionar carga STR_INDUSTRY_CARGOES_SELECT_CARGO_TOOLTIP :{BLACK}Selecciona el tipo de carga a mostrar STR_INDUSTRY_CARGOES_SELECT_INDUSTRY :{BLACK}Seleccionar industria @@ -3803,6 +3805,8 @@ STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP :{BLACK}Envia in STR_VEHICLE_LIST_REPLACE_VEHICLES :Reemplazar vehículos STR_VEHICLE_LIST_SEND_FOR_SERVICING :Enviar para Mantenimiento STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Beneficio este año: {CURRENCY_LONG} (año anterior: {CURRENCY_LONG}) +STR_VEHICLE_LIST_CARGO :{TINY_FONT}{BLACK}[{CARGO_LIST}] +STR_VEHICLE_LIST_NAME_AND_CARGO :{TINY_FONT}{BLACK}{STRING} {STRING} STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT :Enviar a Depósito STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT :Enviar a Depósito @@ -5026,6 +5030,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}No se pu STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... el vehículo está destruido + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Ningún vehículo estará disponible STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Es necesario modificar la configuración NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}En esta fecha no hay vehículos disponibles diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index a1466d6346..62c112a1a8 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -5026,6 +5026,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}No se pu STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... el vehículo está destruido + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}No habrá vehículos disponibles STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Se debe modificar la configuración de NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Todavía no hay vehículos disponibles diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index ca5c911106..745add1fb6 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -4977,6 +4977,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Kan inte STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... fordonet är förstört + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Inga fordon alls kommer att vara tillgängliga STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Ändra din konfiguration av NewGRF:er STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Inga fordon är tillgängliga än diff --git a/src/lang/tamil.txt b/src/lang/tamil.txt index 8a59b06bbb..52f8ba87ad 100644 --- a/src/lang/tamil.txt +++ b/src/lang/tamil.txt @@ -4502,6 +4502,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}சர STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... வாகனம் அழிக்கப்பட்டுள்ளது + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}எந்த வாகனங்களும் தற்போது கிடையாது STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}தங்களது NewGRF அமைப்பினை மாற்றவும் STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}தற்போது எந்த வாகனங்களும் கிடையாது diff --git a/src/lang/thai.txt b/src/lang/thai.txt index 9734606253..305f9402ef 100644 --- a/src/lang/thai.txt +++ b/src/lang/thai.txt @@ -4675,6 +4675,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}ไม STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... ยานพาหนะถูกทำลาย + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}ไม่มียานพาหานะให้เลือก STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}เปลี่ยนการกำหนดค่าสำหรับ NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}ยังไม่มียานพาหานะให้เลือก diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt index f998e3b468..82b44b9df7 100644 --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -4977,6 +4977,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}不能 STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... 車輛已被摧毀 + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}沒有可用的車輛 STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}請修改您的 NewGRF 設定 STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}未有可用的車輛 diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index bde22078b8..ebe7633e2d 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -5026,6 +5026,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Servis a STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... araç imha edilmiş + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Hiçbir araç kullanılabilir olmayacak STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Yeni NewGRF yapılandırmanızı değiştirin STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Henüz hiçbir araç kullanılabilir değil diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt index e8000edbcf..1641265a48 100644 --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -5091,6 +5091,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Не м STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... транспорт знищено + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Недоступний жоден транспортний засіб STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Змінити налаштування встановленого NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Жоден вид транспорту ще не став доступним diff --git a/src/lang/urdu.txt b/src/lang/urdu.txt index 0ee79d536b..464858b0b5 100644 --- a/src/lang/urdu.txt +++ b/src/lang/urdu.txt @@ -2899,6 +2899,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}مرمت + # Specific vehicle errors diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index 4ecdac3895..f74d70e212 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -4983,6 +4983,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Không t STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... xe đã bị phá hủy + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Không có phương tiện nào sẵn sàng cả STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Thay đổi tham số NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Chưa có phương tiện nào có sẵn diff --git a/src/lang/welsh.txt b/src/lang/welsh.txt index cd434a529f..0764d9e3cd 100644 --- a/src/lang/welsh.txt +++ b/src/lang/welsh.txt @@ -4582,6 +4582,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Methu ne STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... cerbyd wedi ei ddinistrio + STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}Ni fydd cerbydau ar gael o gwbl STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Newid eich ffurfweddiad NewGRF STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Dim cerbydau ar gael eto From a7ffd47c6477d73c61121d51a60ea96f26c20d0a Mon Sep 17 00:00:00 2001 From: PeterN Date: Sun, 27 Nov 2022 15:13:09 +0000 Subject: [PATCH 41/42] Fix #10191: Incorrect refit highlight position. (#10195) Refit highlight was not correct for non-power-of-2 interface scale. --- src/vehicle_gui.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 8dc4120268..926f2b5e7b 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -933,7 +933,7 @@ struct RefitWindow : public Window { switch (widget) { case WID_VR_VEHICLE_PANEL_DISPLAY: { Vehicle *v = Vehicle::Get(this->window_number); - DrawVehicleImage(v, {this->sprite_left + WidgetDimensions::scaled.framerect.left, r.top, this->sprite_right - WidgetDimensions::scaled.framerect.right, r.bottom}, + DrawVehicleImage(v, {this->sprite_left, r.top, this->sprite_right, r.bottom}, INVALID_VEHICLE, EIT_IN_DETAILS, this->hscroll != nullptr ? this->hscroll->GetPosition() : 0); /* Highlight selected vehicles. */ @@ -947,6 +947,11 @@ struct RefitWindow : public Window { int left = INT32_MIN; int width = 0; + /* Determine top & bottom position of the highlight.*/ + const int height = ScaleSpriteTrad(12); + const int highlight_top = CenterBounds(r.top, r.bottom, height); + const int highlight_bottom = highlight_top + height - 1; + for (Train *u = Train::From(v); u != nullptr; u = u->Next()) { /* Start checking. */ const bool contained = std::find(vehicles_to_refit.begin(), vehicles_to_refit.end(), u->index) != vehicles_to_refit.end(); @@ -967,12 +972,13 @@ struct RefitWindow : public Window { left = std::max(0, left); if (_current_text_dir == TD_RTL) { - right = this->GetWidget(WID_VR_VEHICLE_PANEL_DISPLAY)->current_x - left; + right = r.Width() - left; left = right - width; } if (left != right) { - DrawFrameRect(left, r.top + WidgetDimensions::scaled.framerect.top, right, r.top + WidgetDimensions::scaled.framerect.top + ScaleSpriteTrad(14) - 1, COLOUR_WHITE, FR_BORDERONLY); + Rect hr = {left, highlight_top, right, highlight_bottom}; + DrawFrameRect(hr.Expand(WidgetDimensions::scaled.bevel), COLOUR_WHITE, FR_BORDERONLY); } left = INT32_MIN; From 1c82200e0f46b92710f42e45353293f1fbcf325b Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sun, 27 Nov 2022 11:20:07 -0700 Subject: [PATCH 42/42] Doc: Prepare for 13.0-beta2 release (#10149) --- changelog.txt | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/changelog.txt b/changelog.txt index 12d3ffe756..650c42586e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,32 @@ +13.0-beta2 (2022-11-27) +------------------------------------------------------------------------ +Feature: Allow AI/GS to be fully modified in scenario editor (#10152) +Feature: Display power-to-weight ratio in ground vehicle details GUI (#10123) +Feature: Variable interface scaling (with chunky bevels!) (#10114) +Feature: Hotkey to honk a vehicle's horn (#10110) +Feature: Split AI/Game Script configuration windows and add them to world gen window (#10058) +Feature: [GS] Scriptable league tables (#10001) +Feature: Multi-track level crossings (#9931) +Feature: Improved local authority action window (#9928) +Feature: Automatic console command screenshot numbering with a filename ending in '#' (#9781) +Feature: Add buttons to toggle music in the Game Options menu (#9727) +Feature: Contextual actions for vehicles grouped by shared orders (#8425) +Feature: Add cargo filter support to vehicle list (#8308) +Feature: Show the cargoes the vehicles can carry in the vehicle list window (#8304) +Change: Allow building canal by area outside editor (#10173) +Change: Minor improvements to the new Finance GUI (#10168) +Change: Let AI developers edit non-editable AI/Game Script Parameters (#8895) +Change: Allow building docks on clearable watered object tiles (#8514) +Fix #8770: Center vehicle status bar icon (#10178) +Fix: Crash if error message window is too wide for screen. (#10172) +Fix #10155: Network games not syncing company settings properly (#10158) +Fix #10154: Network game desync related to setting a random company face (#10157) +Fix #10011: Incorrect infrastructure totals when overbuilding bay road stop (#10143) +Fix #10117: Object burst limit allowed one fewer object than the setting (#10120) +Fix #10023: Allow negative input in text fields when needed (#10112) +Fix #9908: Fix crash which could occur when a company was deleted when a depot window was open (#9912) + + 13.0-beta1 (2022-10-31) ------------------------------------------------------------------------ Feature: Airport construction GUI displays infrastructure cost (#10094)