openttd updated to 1.5.0-beta2
--HG-- branch : openttd
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: industry_gui.cpp 26241 2014-01-12 18:00:39Z frosch $ */
|
||||
/* $Id: industry_gui.cpp 26960 2014-10-05 11:20:02Z peter1138 $ */
|
||||
|
||||
/*
|
||||
* This file is part of OpenTTD.
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "newgrf_industries.h"
|
||||
#include "newgrf_text.h"
|
||||
#include "newgrf_debug.h"
|
||||
#include "network/network.h"
|
||||
#include "strings_func.h"
|
||||
#include "company_func.h"
|
||||
#include "tilehighlight_func.h"
|
||||
@@ -41,6 +42,8 @@
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
bool _ignore_restrictions;
|
||||
uint64 _displayed_industries; ///< Communication from the industry chain window to the smallmap window about what industries to display.
|
||||
|
||||
@@ -117,12 +120,10 @@ static int CDECL IndustryTypeNameSorter(const IndustryType *a, const IndustryTyp
|
||||
static char industry_name[2][64];
|
||||
|
||||
const IndustrySpec *indsp1 = GetIndustrySpec(*a);
|
||||
SetDParam(0, indsp1->name);
|
||||
GetString(industry_name[0], STR_JUST_STRING, lastof(industry_name[0]));
|
||||
GetString(industry_name[0], indsp1->name, lastof(industry_name[0]));
|
||||
|
||||
const IndustrySpec *indsp2 = GetIndustrySpec(*b);
|
||||
SetDParam(0, indsp2->name);
|
||||
GetString(industry_name[1], STR_JUST_STRING, lastof(industry_name[1]));
|
||||
GetString(industry_name[1], indsp2->name, lastof(industry_name[1]));
|
||||
|
||||
int r = strnatcmp(industry_name[0], industry_name[1]); // Sort by name (natural sorting).
|
||||
|
||||
@@ -639,7 +640,8 @@ static inline bool IsProductionAlterable(const Industry *i)
|
||||
{
|
||||
const IndustrySpec *is = GetIndustrySpec(i->type);
|
||||
return ((_game_mode == GM_EDITOR || _cheats.setup_prod.value) &&
|
||||
(is->production_rate[0] != 0 || is->production_rate[1] != 0 || is->IsRawIndustry()));
|
||||
(is->production_rate[0] != 0 || is->production_rate[1] != 0 || is->IsRawIndustry()) &&
|
||||
!_networking);
|
||||
}
|
||||
|
||||
class IndustryViewWindow : public Window
|
||||
@@ -1281,7 +1283,7 @@ public:
|
||||
switch (widget) {
|
||||
case WID_ID_DROPDOWN_ORDER: {
|
||||
Dimension d = GetStringBoundingBox(this->GetWidget<NWidgetCore>(widget)->widget_data);
|
||||
d.width += padding.width + WD_SORTBUTTON_ARROW_WIDTH * 2; // Doubled since the string is centred and it also looks better.
|
||||
d.width += padding.width + Window::SortButtonWidth() * 2; // Doubled since the string is centred and it also looks better.
|
||||
d.height += padding.height;
|
||||
*size = maxdim(*size, d);
|
||||
break;
|
||||
@@ -1669,8 +1671,7 @@ struct CargoesField {
|
||||
ypos += (normal_height - FONT_HEIGHT_NORMAL) / 2;
|
||||
if (this->u.industry.ind_type < NUM_INDUSTRYTYPES) {
|
||||
const IndustrySpec *indsp = GetIndustrySpec(this->u.industry.ind_type);
|
||||
SetDParam(0, indsp->name);
|
||||
DrawString(xpos, xpos2, ypos, STR_JUST_STRING, TC_WHITE, SA_HOR_CENTER);
|
||||
DrawString(xpos, xpos2, ypos, indsp->name, TC_WHITE, SA_HOR_CENTER);
|
||||
|
||||
/* Draw the industry legend. */
|
||||
int blob_left, blob_right;
|
||||
@@ -2001,7 +2002,7 @@ struct CargoesRow {
|
||||
if (!hs->enabled) continue;
|
||||
|
||||
for (uint j = 0; j < lengthof(hs->accepts_cargo); j++) {
|
||||
if (cargo_fld->u.cargo.vertical_cargoes[i] == hs->accepts_cargo[j]) {
|
||||
if (hs->cargo_acceptance[j] > 0 && cargo_fld->u.cargo.vertical_cargoes[i] == hs->accepts_cargo[j]) {
|
||||
cargo_fld->ConnectCargo(cargo_fld->u.cargo.vertical_cargoes[i], false);
|
||||
goto next_cargo;
|
||||
}
|
||||
@@ -2193,7 +2194,7 @@ struct IndustryCargoesWindow : public Window {
|
||||
if (!hs->enabled || !(hs->building_availability & climate_mask)) continue;
|
||||
|
||||
for (uint j = 0; j < lengthof(hs->accepts_cargo); j++) {
|
||||
if (cargoes[i] == hs->accepts_cargo[j]) return true;
|
||||
if (hs->cargo_acceptance[j] > 0 && cargoes[i] == hs->accepts_cargo[j]) return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user