Update to 14.0

This commit is contained in:
dP
2024-04-14 01:56:35 +07:00
parent 872e715374
commit 14504ff3b2
73 changed files with 1780 additions and 1570 deletions
+5 -5
View File
@@ -164,14 +164,14 @@ static inline void GetAllCargoSuffixes(CargoSuffixInOut use_input, CargoSuffixTy
uint cargotype = local_id << 16 | use_input;
GetCargoSuffix(cargotype, cst, ind, ind_type, indspec, suffixes[j]);
} else {
suffixes[j].text[0] = '\0';
suffixes[j].text.clear();
suffixes[j].display = CSD_CARGO;
}
}
} else {
/* Compatible behaviour with old 3-in-2-out scheme */
for (uint j = 0; j < lengthof(suffixes); j++) {
suffixes[j].text[0] = '\0';
suffixes[j].text.clear();
suffixes[j].display = CSD_CARGO;
}
switch (use_input) {
@@ -203,7 +203,7 @@ static inline void GetAllCargoSuffixes(CargoSuffixInOut use_input, CargoSuffixTy
*/
void GetCargoSuffix(CargoSuffixInOut use_input, CargoSuffixType cst, const Industry *ind, IndustryType ind_type, const IndustrySpec *indspec, CargoID cargo, uint8_t slot, CargoSuffix &suffix)
{
suffix.text[0] = '\0';
suffix.text.clear();
suffix.display = CSD_CARGO;
if (!IsValidCargoID(cargo)) return;
if (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) {
@@ -3040,7 +3040,7 @@ struct IndustryCargoesWindow : public Window {
pt.x -= nw->pos_x;
pt.y -= nw->pos_y;
int vpos = WidgetDimensions::scaled.framerect.top + CargoesField::small_height - this->vscroll->GetPosition() * nw->resize_y;
int vpos = WidgetDimensions::scaled.frametext.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.
@@ -3048,7 +3048,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 * WidgetDimensions::scaled.framerect.left + ((this->ind_cargo < NUM_INDUSTRYTYPES) ? 0 : (CargoesField::industry_width + CargoesField::cargo_field_width) / 2);
int xpos = 2 * WidgetDimensions::scaled.frametext.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++) {