Merge branch 'master' into jgrpp
# Conflicts: # src/airport_gui.cpp # src/blitter/32bpp_optimized.cpp # src/blitter/32bpp_simple.cpp # src/blitter/32bpp_sse2.cpp # src/blitter/8bpp_optimized.cpp # src/blitter/8bpp_simple.cpp # src/blitter/null.cpp # src/build_vehicle_gui.cpp # src/company_gui.cpp # src/crashlog.cpp # src/dropdown.cpp # src/dropdown_type.h # src/genworld_gui.cpp # src/gfx.cpp # src/main_gui.cpp # src/newgrf_debug_gui.cpp # src/news_gui.cpp # src/news_type.h # src/openttd.cpp # src/order_gui.cpp # src/settings.cpp # src/settings_gui.cpp # src/signs.cpp # src/smallmap_gui.cpp # src/spritecache.cpp # src/spriteloader/grf.cpp # src/texteff.cpp # src/toolbar_gui.cpp # src/town_cmd.cpp # src/vehicle.cpp # src/vehicle_gui.cpp # src/video/opengl.cpp # src/viewport.cpp # src/waypoint_cmd.cpp # src/zoom_type.h
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "string_func.h"
|
||||
#include "sortlist_type.h"
|
||||
#include "dropdown_func.h"
|
||||
#include "dropdown_common_type.h"
|
||||
#include "company_base.h"
|
||||
#include "core/geometry_func.hpp"
|
||||
#include "core/random_func.hpp"
|
||||
@@ -1793,14 +1794,14 @@ public:
|
||||
DropDownList list;
|
||||
|
||||
/* Add item for disabling filtering. */
|
||||
list.push_back(std::make_unique<DropDownListStringItem>(this->GetCargoFilterLabel(CargoFilterCriteria::CF_ANY), CargoFilterCriteria::CF_ANY, false));
|
||||
list.push_back(MakeDropDownListStringItem(this->GetCargoFilterLabel(CargoFilterCriteria::CF_ANY), CargoFilterCriteria::CF_ANY));
|
||||
/* Add item for industries not producing anything, e.g. power plants */
|
||||
list.push_back(std::make_unique<DropDownListStringItem>(this->GetCargoFilterLabel(CargoFilterCriteria::CF_NONE), CargoFilterCriteria::CF_NONE, false));
|
||||
list.push_back(MakeDropDownListStringItem(this->GetCargoFilterLabel(CargoFilterCriteria::CF_NONE), CargoFilterCriteria::CF_NONE));
|
||||
|
||||
/* Add cargos */
|
||||
Dimension d = GetLargestCargoIconSize();
|
||||
for (const CargoSpec *cs : _sorted_standard_cargo_specs) {
|
||||
list.push_back(std::make_unique<DropDownListIconItem>(d, cs->GetCargoIcon(), PAL_NONE, cs->name, cs->Index(), false));
|
||||
list.push_back(MakeDropDownListIconItem(d, cs->GetCargoIcon(), PAL_NONE, cs->name, cs->Index()));
|
||||
}
|
||||
|
||||
return list;
|
||||
@@ -3151,7 +3152,7 @@ struct IndustryCargoesWindow : public Window {
|
||||
} else {
|
||||
DropDownList list;
|
||||
auto add_item = [&](StringID string, int result) {
|
||||
std::unique_ptr<DropDownListStringItem> item(new DropDownListStringItem(string, result, false));
|
||||
std::unique_ptr<DropDownListStringItem> item = std::make_unique<DropDownListStringItem>(string, result, false);
|
||||
item->SetColourFlags(TC_FORCED);
|
||||
list.emplace_back(std::move(item));
|
||||
};
|
||||
@@ -3167,7 +3168,7 @@ struct IndustryCargoesWindow : public Window {
|
||||
DropDownList lst;
|
||||
Dimension d = GetLargestCargoIconSize();
|
||||
for (const CargoSpec *cs : _sorted_standard_cargo_specs) {
|
||||
lst.push_back(std::make_unique<DropDownListIconItem>(d, cs->GetCargoIcon(), PAL_NONE, cs->name, cs->Index(), false));
|
||||
lst.push_back(MakeDropDownListIconItem(d, cs->GetCargoIcon(), PAL_NONE, cs->name, cs->Index()));
|
||||
}
|
||||
if (!lst.empty()) {
|
||||
int selected = (this->ind_cargo >= NUM_INDUSTRYTYPES) ? (int)(this->ind_cargo - NUM_INDUSTRYTYPES) : -1;
|
||||
@@ -3181,7 +3182,7 @@ struct IndustryCargoesWindow : public Window {
|
||||
for (IndustryType ind : _sorted_industry_types) {
|
||||
const IndustrySpec *indsp = GetIndustrySpec(ind);
|
||||
if (!indsp->enabled) continue;
|
||||
lst.push_back(std::make_unique<DropDownListStringItem>(indsp->name, ind, false));
|
||||
lst.push_back(MakeDropDownListStringItem(indsp->name, ind));
|
||||
}
|
||||
if (!lst.empty()) {
|
||||
int selected = (this->ind_cargo < NUM_INDUSTRYTYPES) ? (int)this->ind_cargo : -1;
|
||||
|
Reference in New Issue
Block a user