|
@@ -594,14 +594,20 @@ public:
|
|
|
|
|
|
virtual void OnPlaceObjectAbort()
|
|
|
{
|
|
|
this->RaiseButtons();
|
|
|
}
|
|
|
|
|
|
virtual void OnInvalidateData(int data = 0)
|
|
|
/**
|
|
|
* Some data on this window has become invalid.
|
|
|
* @param data Information about the changed data.
|
|
|
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
|
|
|
*/
|
|
|
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
|
|
|
{
|
|
|
if (!gui_scope) return;
|
|
|
this->SetupArrays();
|
|
|
|
|
|
const IndustrySpec *indsp = (this->selected_type == INVALID_INDUSTRYTYPE) ? NULL : GetIndustrySpec(this->selected_type);
|
|
|
if (indsp == NULL) this->enabled[this->selected_index] = _settings_game.difficulty.industry_density != ID_FUND_ONLY;
|
|
|
this->SetButtons();
|
|
|
}
|
|
@@ -944,14 +950,20 @@ public:
|
|
|
break;
|
|
|
}
|
|
|
UpdateIndustryProduction(i);
|
|
|
this->SetDirty();
|
|
|
}
|
|
|
|
|
|
virtual void OnInvalidateData(int data)
|
|
|
/**
|
|
|
* Some data on this window has become invalid.
|
|
|
* @param data Information about the changed data.
|
|
|
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
|
|
|
*/
|
|
|
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
|
|
|
{
|
|
|
if (!gui_scope) return;
|
|
|
const Industry *i = Industry::Get(this->window_number);
|
|
|
if (IsProductionAlterable(i)) {
|
|
|
const IndustrySpec *ind = GetIndustrySpec(i->type);
|
|
|
this->editable = ind->UsesSmoothEconomy() ? EA_RATE : EA_MULTIPLIER;
|
|
|
} else {
|
|
|
this->editable = EA_NONE;
|
|
@@ -1343,14 +1355,20 @@ public:
|
|
|
virtual void OnHundredthTick()
|
|
|
{
|
|
|
this->industries.ForceResort();
|
|
|
this->BuildSortIndustriesList();
|
|
|
}
|
|
|
|
|
|
virtual void OnInvalidateData(int data)
|
|
|
/**
|
|
|
* Some data on this window has become invalid.
|
|
|
* @param data Information about the changed data.
|
|
|
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
|
|
|
*/
|
|
|
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
|
|
|
{
|
|
|
if (!gui_scope) return;
|
|
|
/* We can only set the trigger for resorting/rebuilding.
|
|
|
* We cannot safely resort at this point, as there might be multiple scheduled invalidations,
|
|
|
* and a rebuild needs to be done first though it is scheduled later. */
|
|
|
if (data == 0) {
|
|
|
this->industries.ForceRebuild();
|
|
|
} else {
|
|
@@ -2391,19 +2409,21 @@ struct IndustryCargoesWindow : public Wi
|
|
|
this->vscroll->SetCount(CeilDiv(WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM + CargoesField::small_height + num_indrows * CargoesField::normal_height, nwp->resize_y));
|
|
|
this->SetDirty();
|
|
|
this->NotifySmallmap();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Notify the window about external events.
|
|
|
* Some data on this window has become invalid.
|
|
|
* @param data Information about the changed data.
|
|
|
* - data = 0 .. NUM_INDUSTRYTYPES - 1: Display the chain around the given industry.
|
|
|
* - data = NUM_INDUSTRYTYPES: Stop sending updates to the smallmap window.
|
|
|
* @param data The event.
|
|
|
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
|
|
|
*/
|
|
|
virtual void OnInvalidateData(int data)
|
|
|
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
|
|
|
{
|
|
|
if (!gui_scope) return;
|
|
|
if (data == NUM_INDUSTRYTYPES) {
|
|
|
if (this->IsWidgetLowered(ICW_NOTIFY)) {
|
|
|
this->RaiseWidget(ICW_NOTIFY);
|
|
|
this->SetWidgetDirty(ICW_NOTIFY);
|
|
|
}
|
|
|
return;
|