summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-07-23 18:44:04 +0000
committeralberth <alberth@openttd.org>2010-07-23 18:44:04 +0000
commit27dba2b3b2bfb0967ac56a6c030862c98a7e7839 (patch)
treefaff137651ea31ea3eb940dd3cfefefeb783f3b0 /src
parentf601259f46fa124ed41c6edb735710f119e798bc (diff)
downloadopenttd-27dba2b3b2bfb0967ac56a6c030862c98a7e7839.tar.xz
(svn r20208) -Add: Allow access of the industry cargoes window from the industry view window.
Diffstat (limited to 'src')
-rw-r--r--src/industry_gui.cpp15
-rw-r--r--src/lang/english.txt2
2 files changed, 14 insertions, 3 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 4328597f6..ff3ea465a 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -47,6 +47,8 @@ enum CargoSuffixType {
CST_DIR, ///< Industry-directory window
};
+static void ShowIndustryCargoesWindow(IndustryType id);
+
/**
* Gets the string to display after the cargo name (using callback 37)
* @param cargo the cargo for which the suffix is requested
@@ -614,6 +616,7 @@ enum IndustryViewWidgets {
IVW_VIEWPORT,
IVW_INFO,
IVW_GOTO,
+ IVW_DISPLAY,
};
class IndustryViewWindow : public Window
@@ -806,6 +809,12 @@ public:
}
break;
}
+
+ case IVW_DISPLAY: {
+ Industry *i = Industry::Get(this->window_number);
+ ShowIndustryCargoesWindow(i->type);
+ break;
+ }
}
}
@@ -873,8 +882,8 @@ static const NWidgetPart _nested_industry_view_widgets[] = {
NWidget(WWT_PANEL, COLOUR_CREAM, IVW_INFO), SetMinimalSize(260, 2), SetResize(1, 0),
EndContainer(),
NWidget(NWID_HORIZONTAL),
- NWidget(WWT_PUSHTXTBTN, COLOUR_CREAM, IVW_GOTO), SetMinimalSize(130, 12), SetDataTip(STR_BUTTON_LOCATION, STR_INDUSTRY_VIEW_LOCATION_TOOLTIP),
- NWidget(WWT_PANEL, COLOUR_CREAM), SetResize(1, 0), EndContainer(),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_CREAM, IVW_GOTO), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_BUTTON_LOCATION, STR_INDUSTRY_VIEW_LOCATION_TOOLTIP),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_CREAM, IVW_DISPLAY), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_INDUSTRY_DISPLAY_CHAIN, STR_INDUSTRY_DISPLAY_CHAIN_TOOLTIP),
NWidget(WWT_RESIZEBOX, COLOUR_CREAM),
EndContainer(),
};
@@ -2384,7 +2393,7 @@ const int IndustryCargoesWindow::VERT_TEXT_PADDING = 5; ///< Vertical padding ar
* Open the industry and cargoes window.
* @param id Industry type to display.
*/
-void ShowIndustryCargoesWindow(IndustryType id)
+static void ShowIndustryCargoesWindow(IndustryType id)
{
assert(id < NUM_INDUSTRYTYPES);
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 17f52ef1d..089c7a510 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -2124,6 +2124,8 @@ STR_INDUSTRY_CARGOES_CUSTOMERS :{WHITE}Acceptin
STR_INDUSTRY_CARGOES_HOUSES :{WHITE}Houses
STR_INDUSTRY_CARGOES_INDUSTRY_TOOLTIP :{BLACK}Click at the industry to see its suppliers and customers
STR_INDUSTRY_CARGOES_CARGO_TOOLTIP :{BLACK}{STRING}{}Click at the cargo to see its suppliers and customers
+STR_INDUSTRY_DISPLAY_CHAIN :{BLACK}Display chain
+STR_INDUSTRY_DISPLAY_CHAIN_TOOLTIP :{BLACK}Display cargo supplying and accepting industries
# Land area window
STR_LAND_AREA_INFORMATION_CAPTION :{WHITE}Land Area Information