# HG changeset patch # User frosch # Date 2011-02-23 20:45:52 # Node ID 417d56e77854c367bf6d20f0b32d54f9880d72a6 # Parent 911241be2fa4b01292b7caabd901db62cee0e6c0 (svn r22134) -Codechange: Move ReInit() of the landinfo window from DeleteNewGRFInspectWindow() into a InvalidateData call. diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -330,6 +330,16 @@ public: { ::ShowNewGRFInspectWindow(GetGrfSpecFeature(this->tile), this->tile); } + + virtual void OnInvalidateData(int data) + { + switch (data) { + case 1: + /* ReInit, "debug" sprite might have changed */ + this->ReInit(); + break; + } + } }; /** diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -519,8 +519,7 @@ void DeleteNewGRFInspectWindow(GrfSpecFe 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); } /**