Merge branch 'master' into jgrpp
# Conflicts: # .github/workflows/ci-build.yml # .github/workflows/commit-checker.yml # src/command.cpp # src/company_cmd.cpp # src/company_gui.cpp # src/crashlog.cpp # src/economy.cpp # src/lang/english.txt # src/lang/german.txt # src/lang/korean.txt # src/misc_gui.cpp # src/newgrf_config.cpp # src/openttd.cpp # src/settings_gui.cpp # src/ship_cmd.cpp # src/table/settings/gui_settings.ini
This commit is contained in:
@@ -184,8 +184,9 @@ 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 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<CargoSummaryItem> CargoSummary;
|
||||
@@ -426,6 +427,10 @@ void DrawTrainDetails(const Train *v, int left, int right, int y, int vscroll_po
|
||||
/* get rid of awkward offset */
|
||||
y -= WD_MATRIX_TOP;
|
||||
|
||||
/* Indent the total cargo capacity details */
|
||||
int offs_left = _current_text_dir == TD_LTR ? TRAIN_DETAILS_LIST_INDENT : 0;
|
||||
int offs_right = _current_text_dir == TD_LTR ? 0 : TRAIN_DETAILS_LIST_INDENT;
|
||||
|
||||
int sprite_height = ScaleGUITrad(GetVehicleHeight(VEH_TRAIN));
|
||||
int line_height = std::max(sprite_height, WD_MATRIX_TOP + FONT_HEIGHT_NORMAL + WD_MATRIX_BOTTOM);
|
||||
int sprite_y_offset = line_height / 2;
|
||||
@@ -565,7 +570,7 @@ void DrawTrainDetails(const Train *v, int left, int right, int y, int vscroll_po
|
||||
SetDParam(2, i); // {SHORTCARGO} #1
|
||||
SetDParam(3, max_cargo[i]); // {SHORTCARGO} #2
|
||||
SetDParam(4, _settings_game.vehicle.freight_trains);
|
||||
DrawString(left, right, y + text_y_offset, FreightWagonMult(i) > 1 ? STR_VEHICLE_DETAILS_TRAIN_TOTAL_CAPACITY_MULT : STR_VEHICLE_DETAILS_TRAIN_TOTAL_CAPACITY);
|
||||
DrawString(left + offs_left, right - offs_right, y + text_y_offset, FreightWagonMult(i) > 1 ? STR_VEHICLE_DETAILS_TRAIN_TOTAL_CAPACITY_MULT : STR_VEHICLE_DETAILS_TRAIN_TOTAL_CAPACITY);
|
||||
y += line_height;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user