diff options
author | Patric Stout <truebrain@openttd.org> | 2021-02-28 15:41:03 +0100 |
---|---|---|
committer | Charles Pigott <charlespigott@googlemail.com> | 2021-02-28 18:04:51 +0000 |
commit | c3dc27e37e177675c8a54ef507de48b61ed6da2c (patch) | |
tree | e42eb666cf8f22c17a0a4042bc62043ecda6c3b8 /src/toolbar_gui.cpp | |
parent | 73fd634209a9d54dd167a579e4bb3cced177b896 (diff) | |
download | openttd-c3dc27e37e177675c8a54ef507de48b61ed6da2c.tar.xz |
Add: settings to limit your fast-forward game speed
By default this setting is set to 2500% normal game speed.
Diffstat (limited to 'src/toolbar_gui.cpp')
-rw-r--r-- | src/toolbar_gui.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 6a851d2b5..ea50661e4 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -283,7 +283,8 @@ static CallBackFunction ToolbarPauseClick(Window *w) */ static CallBackFunction ToolbarFastForwardClick(Window *w) { - _fast_forward ^= true; + ChangeGameSpeed(_game_speed == 100); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); return CBF_NONE; } @@ -2127,7 +2128,7 @@ struct MainToolbarWindow : Window { this->SetWidgetDirty(WID_TN_PAUSE); } - if (this->IsWidgetLowered(WID_TN_FAST_FORWARD) != !!_fast_forward) { + if (this->IsWidgetLowered(WID_TN_FAST_FORWARD) != (_game_speed != 100)) { this->ToggleWidgetLoweredState(WID_TN_FAST_FORWARD); this->SetWidgetDirty(WID_TN_FAST_FORWARD); } @@ -2508,7 +2509,7 @@ struct ScenarioEditorToolbarWindow : Window { this->SetDirty(); } - if (this->IsWidgetLowered(WID_TE_FAST_FORWARD) != !!_fast_forward) { + if (this->IsWidgetLowered(WID_TE_FAST_FORWARD) != (_game_speed != 100)) { this->ToggleWidgetLoweredState(WID_TE_FAST_FORWARD); this->SetDirty(); } |