Debug: Add GRF inspect window support for cargoes

This commit is contained in:
Jonathan G Rennison
2022-10-08 21:53:56 +01:00
parent 5cc56a6145
commit 669b3f2e04
3 changed files with 80 additions and 5 deletions

View File

@@ -1887,7 +1887,7 @@ static const NWidgetPart _nested_industry_cargoes_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_IC_CAPTION), SetDataTip(STR_INDUSTRY_CARGOES_INDUSTRY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_DEBUGBOX, COLOUR_BROWN, WID_IC_DEBUG),
NWidget(WWT_DEBUGBOX, COLOUR_BROWN),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
@@ -2857,7 +2857,6 @@ struct IndustryCargoesWindow : public Window {
this->vscroll->SetCount(num_indrows);
this->SetDirty();
this->NotifySmallmap();
this->SetWidgetDisabledState(WID_IC_DEBUG, false);
}
/**
@@ -2929,7 +2928,6 @@ struct IndustryCargoesWindow : public Window {
this->vscroll->SetCount(num_indrows);
this->SetDirty();
this->NotifySmallmap();
this->SetWidgetDisabledState(WID_IC_DEBUG, true);
}
/**
@@ -3208,6 +3206,8 @@ struct IndustryCargoesWindow : public Window {
{
if (this->ind_cargo < NUM_INDUSTRYTYPES) {
::ShowNewGRFInspectWindow(GSF_INDUSTRIES, this->ind_cargo | (1 << 26));
} else {
::ShowNewGRFInspectWindow(GSF_CARGOES, this->ind_cargo - NUM_INDUSTRYTYPES);
}
}
};