Merge commit 'a8b575671894ffe1329ef37dca4989c0e60d70f5'

These merges are becoming more awful every time

Conflicts:
	src/ai/ai_gui.cpp
	src/build_vehicle_gui.cpp
	src/cheat_gui.cpp
	src/company_gui.cpp
	src/depot_gui.cpp
	src/dock_gui.cpp
	src/error_gui.cpp
	src/genworld_gui.cpp
	src/misc_gui.cpp
	src/network/network_content_gui.cpp
	src/network/network_gui.cpp
	src/newgrf_gui.cpp
	src/news_gui.cpp
	src/rail_gui.cpp
	src/rev.cpp.in
	src/road_gui.cpp
	src/settings_gui.cpp
	src/settings_gui.h
	src/signs_gui.cpp
	src/station_gui.cpp
	src/table/settings.ini
	src/terraform_gui.cpp
	src/toolbar_gui.cpp
	src/toolbar_gui.h
	src/vehicle_gui.cpp
	src/video/sdl_v.cpp
	src/viewport.cpp
	src/widget.cpp
	src/widgets/settings_widget.h
This commit is contained in:
pelya
2016-03-27 22:33:11 +03:00
527 changed files with 33650 additions and 23739 deletions
+14 -13
View File
@@ -42,12 +42,12 @@
#include "table/strings.h"
#include <bitset>
#include "safeguards.h"
bool _ignore_restrictions;
uint64 _displayed_industries; ///< Communication from the industry chain window to the smallmap window about what industries to display.
assert_compile(NUM_INDUSTRYTYPES <= 64); // Make sure all industry types fit in _displayed_industries.
std::bitset<NUM_INDUSTRYTYPES> _displayed_industries; ///< Communication from the industry chain window to the smallmap window about what industries to display.
/** Cargo suffix type (for which window is it requested) */
enum CargoSuffixType {
@@ -226,7 +226,7 @@ class BuildIndustryWindow : public Window {
* The tests performed after the enabled allow to load the industries
* In the same way they are inserted by grf (if any)
*/
for (uint8 i = 0; i < NUM_INDUSTRYTYPES; i++) {
for (uint i = 0; i < NUM_INDUSTRYTYPES; i++) {
IndustryType ind = _sorted_industry_types[i];
const IndustrySpec *indsp = GetIndustrySpec(ind);
if (indsp->enabled) {
@@ -1303,7 +1303,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;
@@ -2315,7 +2315,8 @@ struct IndustryCargoesWindow : public Window {
{
this->GetWidget<NWidgetCore>(WID_IC_CAPTION)->widget_data = STR_INDUSTRY_CARGOES_INDUSTRY_CAPTION;
this->ind_cargo = it;
_displayed_industries = 1ULL << it;
_displayed_industries.reset();
_displayed_industries.set(it);
this->fields.Clear();
CargoesRow *row = this->fields.Append();
@@ -2359,12 +2360,12 @@ struct IndustryCargoesWindow : public Window {
if (HasCommonValidCargo(central_sp->accepts_cargo, lengthof(central_sp->accepts_cargo), indsp->produced_cargo, lengthof(indsp->produced_cargo))) {
this->PlaceIndustry(1 + supp_count * num_indrows / num_supp, 0, it);
SetBit(_displayed_industries, it);
_displayed_industries.set(it);
supp_count++;
}
if (HasCommonValidCargo(central_sp->produced_cargo, lengthof(central_sp->produced_cargo), indsp->accepts_cargo, lengthof(indsp->accepts_cargo))) {
this->PlaceIndustry(1 + cust_count * num_indrows / num_cust, 4, it);
SetBit(_displayed_industries, it);
_displayed_industries.set(it);
cust_count++;
}
}
@@ -2393,7 +2394,7 @@ struct IndustryCargoesWindow : public Window {
{
this->GetWidget<NWidgetCore>(WID_IC_CAPTION)->widget_data = STR_INDUSTRY_CARGOES_CARGO_CAPTION;
this->ind_cargo = cid + NUM_INDUSTRYTYPES;
_displayed_industries = 0;
_displayed_industries.reset();
this->fields.Clear();
CargoesRow *row = this->fields.Append();
@@ -2428,12 +2429,12 @@ struct IndustryCargoesWindow : public Window {
if (HasCommonValidCargo(&cid, 1, indsp->produced_cargo, lengthof(indsp->produced_cargo))) {
this->PlaceIndustry(1 + supp_count * num_indrows / num_supp, 0, it);
SetBit(_displayed_industries, it);
_displayed_industries.set(it);
supp_count++;
}
if (HasCommonValidCargo(&cid, 1, indsp->accepts_cargo, lengthof(indsp->accepts_cargo))) {
this->PlaceIndustry(1 + cust_count * num_indrows / num_cust, 2, it);
SetBit(_displayed_industries, it);
_displayed_industries.set(it);
cust_count++;
}
}
@@ -2624,7 +2625,7 @@ struct IndustryCargoesWindow : public Window {
case WID_IC_IND_DROPDOWN: {
DropDownList *lst = new DropDownList;
for (uint8 i = 0; i < NUM_INDUSTRYTYPES; i++) {
for (uint i = 0; i < NUM_INDUSTRYTYPES; i++) {
IndustryType ind = _sorted_industry_types[i];
const IndustrySpec *indsp = GetIndustrySpec(ind);
if (!indsp->enabled) continue;
@@ -2711,7 +2712,7 @@ const int IndustryCargoesWindow::VERT_TEXT_PADDING = 5; ///< Vertical padding ar
static void ShowIndustryCargoesWindow(IndustryType id)
{
if (id >= NUM_INDUSTRYTYPES) {
for (uint8 i = 0; i < NUM_INDUSTRYTYPES; i++) {
for (uint i = 0; i < NUM_INDUSTRYTYPES; i++) {
const IndustrySpec *indsp = GetIndustrySpec(_sorted_industry_types[i]);
if (indsp->enabled) {
id = _sorted_industry_types[i];