Fix minimap industry blinking rate
This commit is contained in:
@@ -1761,30 +1761,6 @@ int SmallMapWindow::GetPositionOnLegend(Point pt)
|
||||
}
|
||||
}
|
||||
|
||||
/* virtual */ void SmallMapWindow::OnRealtimeTick(uint /* delta_ms */)
|
||||
{
|
||||
/* Update the window every now and then */
|
||||
if (this->map_type == SMT_LINKSTATS) {
|
||||
uint32 company_mask = this->GetOverlayCompanyMask();
|
||||
if (this->overlay->GetCompanyMask() != company_mask) {
|
||||
this->overlay->SetCompanyMask(company_mask);
|
||||
} else {
|
||||
this->overlay->SetDirty();
|
||||
}
|
||||
}
|
||||
_smallmap_industry_highlight_state = !_smallmap_industry_highlight_state;
|
||||
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
// /* virtual */ void SmallMapWindow::OnHundredthTick()
|
||||
// {
|
||||
// if (this->show_towns) {
|
||||
// this->UpdateTownCache(true);
|
||||
// this->SetDirty();
|
||||
// }
|
||||
// }
|
||||
|
||||
/** Update all the links on the map. */
|
||||
void SmallMapWindow::UpdateLinks()
|
||||
{
|
||||
@@ -1814,6 +1790,7 @@ void SmallMapWindow::ForceRefresh()
|
||||
{
|
||||
if (_smallmap_industry_highlight != INVALID_INDUSTRYTYPE) return;
|
||||
|
||||
if (this->show_towns) this->UpdateTownCache(true);
|
||||
this->UpdateLinks();
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ protected:
|
||||
}
|
||||
|
||||
/** Blink the industries (if selected) on a regular interval. */
|
||||
IntervalTimer<TimerWindow> blink_interval = {std::chrono::milliseconds(450), [this](auto) {
|
||||
IntervalTimer<TimerWindow> blink_interval = {TIMER_BLINK_INTERVAL, [this](auto) {
|
||||
Blink();
|
||||
}};
|
||||
|
||||
@@ -245,7 +245,6 @@ public:
|
||||
void OnInvalidateData(int data = 0, bool gui_scope = true) override;
|
||||
bool OnRightClick(Point pt, int widget) override;
|
||||
void OnMouseWheel(int wheel) override;
|
||||
void OnRealtimeTick(uint delta_ms) override;
|
||||
// void OnHundredthTick() override;
|
||||
void OnScroll(Point delta) override;
|
||||
void OnMouseOver(Point pt, int widget) override;
|
||||
|
||||
@@ -772,7 +772,7 @@ protected:
|
||||
}
|
||||
|
||||
/** Blink the industries (if selected) on a regular interval. */
|
||||
IntervalTimer<TimerWindow> blink_interval = {std::chrono::milliseconds(450), [this](auto) {
|
||||
IntervalTimer<TimerWindow> blink_interval = {TIMER_BLINK_INTERVAL, [this](auto) {
|
||||
Blink();
|
||||
}};
|
||||
|
||||
|
||||
@@ -32,4 +32,7 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
/** Interval used by blinking interface elements. */
|
||||
static constexpr std::chrono::milliseconds TIMER_BLINK_INTERVAL{450};
|
||||
|
||||
#endif /* TIMER_WINDOW_H */
|
||||
|
||||
Reference in New Issue
Block a user