|
|
|
@ -50,7 +50,7 @@ struct GraphLegendWindow : Window {
|
|
|
|
|
this->InitNested(window_number);
|
|
|
|
|
|
|
|
|
|
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
|
|
|
|
|
if (!HasBit(_legend_excluded_companies, c)) this->LowerWidget(c + WID_GL_FIRST_COMPANY);
|
|
|
|
|
if (!HasBit(_legend_excluded_companies, c)) this->LowerWidget(WID_GL_FIRST_COMPANY + c);
|
|
|
|
|
|
|
|
|
|
this->OnInvalidateData(c);
|
|
|
|
|
}
|
|
|
|
@ -58,7 +58,7 @@ struct GraphLegendWindow : Window {
|
|
|
|
|
|
|
|
|
|
void DrawWidget(const Rect &r, WidgetID widget) const override
|
|
|
|
|
{
|
|
|
|
|
if (!IsInsideMM(widget, WID_GL_FIRST_COMPANY, MAX_COMPANIES + WID_GL_FIRST_COMPANY)) return;
|
|
|
|
|
if (!IsInsideMM(widget, WID_GL_FIRST_COMPANY, WID_GL_FIRST_COMPANY + MAX_COMPANIES)) return;
|
|
|
|
|
|
|
|
|
|
CompanyID cid = (CompanyID)(widget - WID_GL_FIRST_COMPANY);
|
|
|
|
|
|
|
|
|
@ -78,7 +78,7 @@ struct GraphLegendWindow : Window {
|
|
|
|
|
|
|
|
|
|
void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
|
|
|
|
|
{
|
|
|
|
|
if (!IsInsideMM(widget, WID_GL_FIRST_COMPANY, MAX_COMPANIES + WID_GL_FIRST_COMPANY)) return;
|
|
|
|
|
if (!IsInsideMM(widget, WID_GL_FIRST_COMPANY, WID_GL_FIRST_COMPANY + MAX_COMPANIES)) return;
|
|
|
|
|
|
|
|
|
|
ToggleBit(_legend_excluded_companies, widget - WID_GL_FIRST_COMPANY);
|
|
|
|
|
this->ToggleWidgetLoweredState(widget);
|
|
|
|
@ -1282,9 +1282,9 @@ struct PerformanceRatingDetailWindow : Window {
|
|
|
|
|
if (IsInsideMM(widget, WID_PRD_COMPANY_FIRST, WID_PRD_COMPANY_LAST + 1)) {
|
|
|
|
|
/* Is it no on disable? */
|
|
|
|
|
if (!this->IsWidgetDisabled(widget)) {
|
|
|
|
|
this->RaiseWidget(this->company + WID_PRD_COMPANY_FIRST);
|
|
|
|
|
this->RaiseWidget(WID_PRD_COMPANY_FIRST + this->company);
|
|
|
|
|
this->company = (CompanyID)(widget - WID_PRD_COMPANY_FIRST);
|
|
|
|
|
this->LowerWidget(this->company + WID_PRD_COMPANY_FIRST);
|
|
|
|
|
this->LowerWidget(WID_PRD_COMPANY_FIRST + this->company);
|
|
|
|
|
this->SetDirty();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1309,13 +1309,13 @@ struct PerformanceRatingDetailWindow : Window {
|
|
|
|
|
if (!gui_scope) return;
|
|
|
|
|
/* Disable the companies who are not active */
|
|
|
|
|
for (CompanyID i = COMPANY_FIRST; i < MAX_COMPANIES; i++) {
|
|
|
|
|
this->SetWidgetDisabledState(i + WID_PRD_COMPANY_FIRST, !Company::IsValidID(i));
|
|
|
|
|
this->SetWidgetDisabledState(WID_PRD_COMPANY_FIRST + i, !Company::IsValidID(i));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Check if the currently selected company is still active. */
|
|
|
|
|
if (this->company != INVALID_COMPANY && !Company::IsValidID(this->company)) {
|
|
|
|
|
/* Raise the widget for the previous selection. */
|
|
|
|
|
this->RaiseWidget(this->company + WID_PRD_COMPANY_FIRST);
|
|
|
|
|
this->RaiseWidget(WID_PRD_COMPANY_FIRST + this->company);
|
|
|
|
|
this->company = INVALID_COMPANY;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1327,7 +1327,7 @@ struct PerformanceRatingDetailWindow : Window {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make sure the widget is lowered */
|
|
|
|
|
this->LowerWidget(this->company + WID_PRD_COMPANY_FIRST);
|
|
|
|
|
this->LowerWidget(WID_PRD_COMPANY_FIRST + this->company);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|