Reduce unnecessary status bar redraws
This commit is contained in:
@@ -184,7 +184,7 @@ 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, 2);
|
||||
SetWindowDirty(WC_FINANCES, cid);
|
||||
}
|
||||
|
||||
|
@@ -276,7 +276,9 @@ static void OnNewDay()
|
||||
DisasterDailyLoop();
|
||||
IndustryDailyLoop();
|
||||
|
||||
if (!_settings_client.gui.time_in_minutes || _settings_client.gui.date_with_time > 0) {
|
||||
SetWindowWidgetDirty(WC_STATUS_BAR, 0, 0);
|
||||
}
|
||||
EnginesDailyLoop();
|
||||
|
||||
/* Refresh after possible snowline change */
|
||||
|
@@ -81,6 +81,7 @@ struct StatusBarWindow : Window {
|
||||
int ticker_scroll;
|
||||
GUITimer ticker_timer;
|
||||
GUITimer reminder_timeout;
|
||||
int64 last_minute = 0;
|
||||
|
||||
static const int TICKER_STOP = 1640; ///< scrolling is finished when counter reaches this value
|
||||
static const int REMINDER_START = 1350; ///< time in ms for reminder notification (red dot on the right) to stay
|
||||
@@ -223,7 +224,8 @@ struct StatusBarWindow : Window {
|
||||
{
|
||||
if (_pause_mode != PM_UNPAUSED) return;
|
||||
|
||||
if (_settings_client.gui.time_in_minutes) {
|
||||
if (_settings_client.gui.time_in_minutes && this->last_minute != CURRENT_MINUTE) {
|
||||
this->last_minute = CURRENT_MINUTE;
|
||||
this->SetWidgetDirty(WID_S_LEFT);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user