Fix minimap industry blinking rate

This commit is contained in:
dP
2025-06-16 12:51:47 +05:00
parent 02d6792570
commit fb38a2ef46
4 changed files with 6 additions and 27 deletions

View File

@@ -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();
}

View File

@@ -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;

View File

@@ -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();
}};

View File

@@ -32,4 +32,7 @@ public:
};
};
/** Interval used by blinking interface elements. */
static constexpr std::chrono::milliseconds TIMER_BLINK_INTERVAL{450};
#endif /* TIMER_WINDOW_H */