Changeset - r25985:9340eacb9c72
[Not reviewed]
master
0 1 0
Tyler Trahan - 3 years ago 2021-09-23 19:07:54
tyler@tylertrahan.com
Fix: Changing raw industry funding method redraws GUI (#9572)
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/industry_gui.cpp
Show inline comments
 
@@ -760,24 +760,25 @@ public:
 
	 * 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.
 
	 */
 
	void OnInvalidateData(int data = 0, bool gui_scope = true) override
 
	{
 
		if (!gui_scope) return;
 
		this->SetupArrays();
 

	
 
		const IndustrySpec *indsp = (this->selected_type == INVALID_INDUSTRYTYPE) ? nullptr : GetIndustrySpec(this->selected_type);
 
		if (indsp == nullptr) this->enabled[this->selected_index] = _settings_game.difficulty.industry_density != ID_FUND_ONLY;
 
		this->SetButtons();
 
		this->SetDirty();
 
	}
 
};
 

	
 
void ShowBuildIndustryWindow()
 
{
 
	if (_game_mode != GM_EDITOR && !Company::IsValidID(_local_company)) return;
 
	if (BringWindowToFrontById(WC_BUILD_INDUSTRY, 0)) return;
 
	new BuildIndustryWindow();
 
}
 

	
 
static void UpdateIndustryProduction(Industry *i);
 

	
0 comments (0 inline, 0 general)