diff options
author | Peter Nelson <peter1138@openttd.org> | 2018-05-04 21:29:22 +0100 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-01-11 11:56:21 +0000 |
commit | 2a8fa5fef9021bff67a13899832bf6f0a18e6ea1 (patch) | |
tree | c712f1973d6c74938e968f752a069b499dde7266 /src/newgrf_gui.cpp | |
parent | 916e911806083a2fe06a79f6f10e275015079149 (diff) | |
download | openttd-2a8fa5fef9021bff67a13899832bf6f0a18e6ea1.tar.xz |
Change: Split up Window::OnTick into OnGameTick and OnRealtimeTick. Adjust timers to work with milliseconds instead of ticks.
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r-- | src/newgrf_gui.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index d506eb026..0b0512544 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -403,7 +403,7 @@ struct NewGRFParametersWindow : public Window { par_info->SetValue(this->grf_config, val); this->clicked_button = num; - this->timeout = 5; + this->timeout = 150; } } else if (par_info->type == PTYPE_UINT_ENUM && !par_info->complete_labels && click_count >= 2) { /* Display a query box so users can enter a custom value. */ @@ -483,9 +483,9 @@ struct NewGRFParametersWindow : public Window { } } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { - if (--this->timeout == 0) { + if (TimerElapsed(this->timeout, delta_ms)) { this->clicked_button = UINT_MAX; this->SetDirty(); } |