mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r20209) -Add: Allow access to the industry cargoes window from the fund industry window.
This commit is contained in:
parent
27dba2b3b2
commit
a9b492c050
|
@ -159,6 +159,7 @@ enum DynamicPlaceIndustriesWidgets {
|
||||||
DPIW_MATRIX_WIDGET,
|
DPIW_MATRIX_WIDGET,
|
||||||
DPIW_SCROLLBAR,
|
DPIW_SCROLLBAR,
|
||||||
DPIW_INFOPANEL,
|
DPIW_INFOPANEL,
|
||||||
|
DPIW_DISPLAY_WIDGET,
|
||||||
DPIW_FUND_WIDGET,
|
DPIW_FUND_WIDGET,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -176,6 +177,8 @@ static const NWidgetPart _nested_build_industry_widgets[] = {
|
||||||
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, DPIW_INFOPANEL), SetResize(1, 0),
|
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, DPIW_INFOPANEL), SetResize(1, 0),
|
||||||
EndContainer(),
|
EndContainer(),
|
||||||
NWidget(NWID_HORIZONTAL),
|
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_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),
|
NWidget(WWT_RESIZEBOX, COLOUR_DARK_GREEN),
|
||||||
EndContainer(),
|
EndContainer(),
|
||||||
|
@ -474,11 +477,15 @@ public:
|
||||||
ResetObjectToPlace();
|
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);
|
if (this->enabled[this->selected_index] && click_count > 1) this->OnClick(pt, DPIW_FUND_WIDGET, 1);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
case DPIW_DISPLAY_WIDGET:
|
||||||
|
if (this->selected_type != INVALID_INDUSTRYTYPE) ShowIndustryCargoesWindow(this->selected_type);
|
||||||
|
break;
|
||||||
|
|
||||||
case DPIW_FUND_WIDGET: {
|
case DPIW_FUND_WIDGET: {
|
||||||
if (this->selected_type == INVALID_INDUSTRYTYPE) {
|
if (this->selected_type == INVALID_INDUSTRYTYPE) {
|
||||||
this->HandleButtonClick(DPIW_FUND_WIDGET);
|
this->HandleButtonClick(DPIW_FUND_WIDGET);
|
||||||
|
@ -558,7 +565,7 @@ public:
|
||||||
/* Only if result does match the previous state would it require a redraw. */
|
/* Only if result does match the previous state would it require a redraw. */
|
||||||
if (call_back_result != this->enabled[this->selected_index]) {
|
if (call_back_result != this->enabled[this->selected_index]) {
|
||||||
this->enabled[this->selected_index] = call_back_result;
|
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();
|
this->SetDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -581,7 +588,7 @@ public:
|
||||||
|
|
||||||
const IndustrySpec *indsp = (this->selected_type == INVALID_INDUSTRYTYPE) ? NULL : GetIndustrySpec(this->selected_type);
|
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;
|
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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue