Changeset - r14760:6829705b5544
[Not reviewed]
master
0 2 0
frosch - 14 years ago 2010-03-06 16:26:09
frosch@openttd.org
(svn r19358) -Fix [FS#3663]: Close error messages about missing ownership when the company closes or is taken over. (parts by Alberth).
2 files changed with 8 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/company_cmd.cpp
Show inline comments
 
@@ -75,12 +75,14 @@ Company::~Company()
 
 */
 
void Company::PostDestructor(size_t index)
 
{
 
	InvalidateWindowData(WC_GRAPH_LEGEND, 0, (int)index);
 
	InvalidateWindowData(WC_PERFORMANCE_DETAIL, 0, (int)index);
 
	InvalidateWindowData(WC_COMPANY_LEAGUE, 0, 0);
 
	/* If the currently shown error message has this company in it, the close it. */
 
	InvalidateWindowData(WC_ERRMSG, 0);
 
}
 

	
 
/**
 
 * Sets the local company and updates the settings that are set on a
 
 * per-company basis to reflect the core's state in the GUI.
 
 * @param new_company the new company
src/misc_gui.cpp
Show inline comments
 
@@ -617,12 +617,18 @@ public:
 

	
 
	virtual void OnPaint()
 
	{
 
		this->DrawWidgets();
 
	}
 

	
 
	virtual void OnInvalidateData(int data)
 
	{
 
		/* If company gets shut down, while displaying an error about it, remove the error message. */
 
		if (this->face != INVALID_COMPANY && !Company::IsValidID(this->face)) delete this;
 
	}
 

	
 
	virtual void SetStringParameters(int widget) const
 
	{
 
		if (widget == EMW_CAPTION) CopyInDParam(0, this->decode_params, lengthof(this->decode_params));
 
	}
 

	
 
	virtual void DrawWidget(const Rect &r, int widget) const
0 comments (0 inline, 0 general)