Merge tag '13.0-beta2' into jgrpp

# Conflicts:
#	src/cheat_gui.cpp
#	src/company_gui.cpp
#	src/console_gui.cpp
#	src/depot_gui.cpp
#	src/error_gui.cpp
#	src/gfx.cpp
#	src/graph_gui.cpp
#	src/group_gui.cpp
#	src/lang/english.txt
#	src/lang/korean.txt
#	src/lang/polish.txt
#	src/misc_gui.cpp
#	src/network/network_content_gui.h
#	src/newgrf_debug_gui.cpp
#	src/order_gui.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/settings_gui.cpp
#	src/settings_type.h
#	src/station_gui.cpp
#	src/subsidy_gui.cpp
#	src/table/settings/gui_settings.ini
#	src/timetable_gui.cpp
#	src/town_gui.cpp
#	src/train_cmd.cpp
#	src/vehicle_gui.cpp
#	src/viewport.cpp
#	src/water_cmd.cpp
#	src/widgets/dropdown.cpp
#	src/window_gui.h
This commit is contained in:
Jonathan G Rennison
2022-12-04 20:25:38 +00:00
172 changed files with 3061 additions and 2809 deletions

View File

@@ -25,12 +25,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 += ScaleGUITrad(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);
}
}
@@ -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,12 +83,12 @@ 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());
DrawString(r.left, r.right, y, STR_VEHICLE_INFO_FEEDER_CARGO_VALUE);
y += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL;
y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal;
if (Ship::From(v)->critical_breakdown_count > 0) {
SetDParam(0, Ship::From(v)->GetDisplayEffectiveMaxSpeed());