Changeset - r24824:25e416ad7835
[Not reviewed]
master
0 2 0
Jonathan G Rennison - 4 years ago 2021-02-18 11:29:30
j.g.rennison@gmail.com
Fix: Whole status bar instead of money widget refreshed on money change (#8692)

This could result in the rest of the status bar being
redrawn unnecessarily frequently
2 files changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/company_cmd.cpp
Show inline comments
 
@@ -32,12 +32,13 @@
 
#include "vehicle_base.h"
 
#include "vehicle_func.h"
 
#include "smallmap_gui.h"
 
#include "game/game.hpp"
 
#include "goal_base.h"
 
#include "story_base.h"
 
#include "widgets/statusbar_widget.h"
 

	
 
#include "table/strings.h"
 

	
 
#include "safeguards.h"
 

	
 
void ClearEnginesHiddenFlagOfCompany(CompanyID cid);
 
@@ -179,13 +180,13 @@ static bool IsValidCompanyManagerFace(Co
 
 * @param company Company that changed, and needs its windows refreshed.
 
 */
 
void InvalidateCompanyWindows(const Company *company)
 
{
 
	CompanyID cid = company->index;
 

	
 
	if (cid == _local_company) SetWindowDirty(WC_STATUS_BAR, 0);
 
	if (cid == _local_company) SetWindowWidgetDirty(WC_STATUS_BAR, 0, WID_S_RIGHT);
 
	SetWindowDirty(WC_FINANCES, cid);
 
}
 

	
 
/**
 
 * Verify whether the company can pay the bill.
 
 * @param[in,out] cost Money to pay, is changed to an error if the company does not have enough money.
src/date.cpp
Show inline comments
 
@@ -16,12 +16,13 @@
 
#include "date_func.h"
 
#include "vehicle_base.h"
 
#include "rail_gui.h"
 
#include "linkgraph/linkgraph.h"
 
#include "saveload/saveload.h"
 
#include "newgrf_profiling.h"
 
#include "widgets/statusbar_widget.h"
 

	
 
#include "safeguards.h"
 

	
 
Year      _cur_year;   ///< Current year, starting at 0
 
Month     _cur_month;  ///< Current month (0..11)
 
Date      _date;       ///< Current date in days (day counter)
 
@@ -252,13 +253,13 @@ static void OnNewDay()
 

	
 
	if (_network_server) NetworkServerDailyLoop();
 

	
 
	DisasterDailyLoop();
 
	IndustryDailyLoop();
 

	
 
	SetWindowWidgetDirty(WC_STATUS_BAR, 0, 0);
 
	SetWindowWidgetDirty(WC_STATUS_BAR, 0, WID_S_LEFT);
 
	EnginesDailyLoop();
 

	
 
	/* Refresh after possible snowline change */
 
	SetWindowClassesDirty(WC_TOWN_VIEW);
 
}
 

	
0 comments (0 inline, 0 general)