mirror of https://github.com/OpenTTD/OpenTTD
(svn r20415) -Add: Clicking at the smallmap disables updates from the industry chain window.
parent
2fa665114e
commit
7ad1f5ccef
|
@ -2281,11 +2281,21 @@ struct IndustryCargoesWindow : public Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify the window to display another industry type.
|
* Notify the window about external events.
|
||||||
* @param data The new industry type to display.
|
* - 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.
|
||||||
*/
|
*/
|
||||||
virtual void OnInvalidateData(int data)
|
virtual void OnInvalidateData(int data)
|
||||||
{
|
{
|
||||||
|
if (data == NUM_INDUSTRYTYPES) {
|
||||||
|
if (this->IsWidgetLowered(ICW_NOTIFY)) {
|
||||||
|
this->RaiseWidget(ICW_NOTIFY);
|
||||||
|
this->SetWidgetDirty(ICW_NOTIFY);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
assert(data >= 0 && data < NUM_INDUSTRYTYPES);
|
assert(data >= 0 && data < NUM_INDUSTRYTYPES);
|
||||||
this->ComputeIndustryDisplay(data);
|
this->ComputeIndustryDisplay(data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1154,6 +1154,9 @@ public:
|
||||||
|
|
||||||
virtual void OnClick(Point pt, int widget, int click_count)
|
virtual void OnClick(Point pt, int widget, int click_count)
|
||||||
{
|
{
|
||||||
|
/* User clicked something, notify the industry chain window to stop sending newly selected industries. */
|
||||||
|
InvalidateWindowClassesData(WC_INDUSTRY_CARGOES, NUM_INDUSTRYTYPES);
|
||||||
|
|
||||||
switch (widget) {
|
switch (widget) {
|
||||||
case SM_WIDGET_MAP: { // Map window
|
case SM_WIDGET_MAP: { // Map window
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue