Changeset - r17378:417d56e77854
[Not reviewed]
master
0 2 0
frosch - 13 years ago 2011-02-23 20:45:52
frosch@openttd.org
(svn r22134) -Codechange: Move ReInit() of the landinfo window from DeleteNewGRFInspectWindow() into a InvalidateData call.
2 files changed with 11 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/misc_gui.cpp
Show inline comments
 
@@ -327,12 +327,22 @@ public:
 
	}
 

	
 
	virtual void ShowNewGRFInspectWindow() const
 
	{
 
		::ShowNewGRFInspectWindow(GetGrfSpecFeature(this->tile), this->tile);
 
	}
 

	
 
	virtual void OnInvalidateData(int data)
 
	{
 
		switch (data) {
 
			case 1:
 
				/* ReInit, "debug" sprite might have changed */
 
				this->ReInit();
 
				break;
 
		}
 
	}
 
};
 

	
 
/**
 
 * Show land information window.
 
 * @param tile The tile to show information about.
 
 */
src/newgrf_debug_gui.cpp
Show inline comments
 
@@ -516,14 +516,13 @@ void DeleteNewGRFInspectWindow(GrfSpecFe
 
	if (feature == GSF_INVALID) return;
 

	
 
	WindowNumber wno = GetInspectWindowNumber(feature, index);
 
	DeleteWindowById(WC_NEWGRF_INSPECT, wno);
 

	
 
	/* Reinitialise the land information window to remove the "debug" sprite if needed. */
 
	Window *w = FindWindowById(WC_LAND_INFO, 0);
 
	if (w != NULL) w->ReInit();
 
	InvalidateWindowData(WC_LAND_INFO, 0, 1);
 
}
 

	
 
/**
 
 * Can we inspect the data given a certain feature and index.
 
 * The index is normally an in-game location/identifier, such
 
 * as a TileIndex or an IndustryID depending on the feature
0 comments (0 inline, 0 general)