changeset 15550:02df68b0a3c0 draft

(svn r20209) -Add: Allow access to the industry cargoes window from the fund industry window.
author alberth <alberth@openttd.org>
date Fri, 23 Jul 2010 18:46:52 +0000
parents 79711faf7037
children fdcba2335701
files src/industry_gui.cpp
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -159,6 +159,7 @@
 	DPIW_MATRIX_WIDGET,
 	DPIW_SCROLLBAR,
 	DPIW_INFOPANEL,
+	DPIW_DISPLAY_WIDGET,
 	DPIW_FUND_WIDGET,
 };
 
@@ -176,6 +177,8 @@
 	NWidget(WWT_PANEL, COLOUR_DARK_GREEN, DPIW_INFOPANEL), SetResize(1, 0),
 	EndContainer(),
 	NWidget(NWID_HORIZONTAL),
+		NWidget(WWT_TEXTBTN, COLOUR_DARK_GREEN, DPIW_DISPLAY_WIDGET), SetFill(1, 0), SetResize(1, 0),
+				SetDataTip(STR_INDUSTRY_DISPLAY_CHAIN, STR_INDUSTRY_DISPLAY_CHAIN_TOOLTIP),
 		NWidget(WWT_TEXTBTN, COLOUR_DARK_GREEN, DPIW_FUND_WIDGET), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_JUST_STRING, STR_NULL),
 		NWidget(WWT_RESIZEBOX, COLOUR_DARK_GREEN),
 	EndContainer(),
@@ -474,11 +477,15 @@
 						ResetObjectToPlace();
 					}
 
-					this->SetWidgetDisabledState(DPIW_FUND_WIDGET, !this->enabled[this->selected_index]);
+					this->SetWidgetsDisabledState(!this->enabled[this->selected_index], DPIW_DISPLAY_WIDGET, DPIW_FUND_WIDGET, WIDGET_LIST_END);
 					if (this->enabled[this->selected_index] && click_count > 1) this->OnClick(pt, DPIW_FUND_WIDGET, 1);
 				}
 			} break;
 
+			case DPIW_DISPLAY_WIDGET:
+				if (this->selected_type != INVALID_INDUSTRYTYPE) ShowIndustryCargoesWindow(this->selected_type);
+				break;
+
 			case DPIW_FUND_WIDGET: {
 				if (this->selected_type == INVALID_INDUSTRYTYPE) {
 					this->HandleButtonClick(DPIW_FUND_WIDGET);
@@ -558,7 +565,7 @@
 				/* Only if result does match the previous state would it require a redraw. */
 				if (call_back_result != this->enabled[this->selected_index]) {
 					this->enabled[this->selected_index] = call_back_result;
-					this->SetWidgetDisabledState(DPIW_FUND_WIDGET, !this->enabled[this->selected_index]);
+					this->SetWidgetsDisabledState(!this->enabled[this->selected_index], DPIW_DISPLAY_WIDGET, DPIW_FUND_WIDGET, WIDGET_LIST_END);
 					this->SetDirty();
 				}
 			}
@@ -581,7 +588,7 @@
 
 		const IndustrySpec *indsp = (this->selected_type == INVALID_INDUSTRYTYPE) ? NULL : GetIndustrySpec(this->selected_type);
 		if (indsp == NULL) this->enabled[this->selected_index] = _settings_game.difficulty.number_industries != 0;
-		this->SetWidgetDisabledState(DPIW_FUND_WIDGET, !this->enabled[this->selected_index]);
+		this->SetWidgetsDisabledState(!this->enabled[this->selected_index], DPIW_DISPLAY_WIDGET, DPIW_FUND_WIDGET, WIDGET_LIST_END);
 	}
 };