Add: settings to limit your fast-forward game speed

By default this setting is set to 2500% normal game speed.

(cherry picked from commit c3dc27e37e)

# Conflicts:
#	src/gfx.cpp
#	src/gfx_func.h
#	src/settings_type.h
#	src/video/cocoa/cocoa_v.mm
#	src/video/video_driver.cpp
#	src/video/win32_v.cpp
This commit is contained in:
Patric Stout
2021-02-28 14:41:03 +00:00
committed by Jonathan G Rennison
parent 535fdb5c89
commit f183ded9fe
17 changed files with 84 additions and 69 deletions

View File

@@ -40,7 +40,7 @@ bool _ctrl_pressed; ///< Is Ctrl pressed?
bool _shift_pressed; ///< Is Shift pressed?
bool _invert_ctrl;
bool _invert_shift;
byte _fast_forward;
uint16 _game_speed = 100; ///< Current game-speed; 100 is 1x, 0 is infinite.
bool _left_button_down; ///< Is left mouse button pressed?
bool _left_button_clicked; ///< Is left mouse button clicked?
bool _right_button_down; ///< Is right mouse button pressed?
@@ -2212,3 +2212,12 @@ void UpdateGUIZoom()
_font_zoom = static_cast<ZoomLevel>(_font_zoom_cfg);
}
}
void ChangeGameSpeed(bool enable_fast_forward)
{
if (enable_fast_forward) {
_game_speed = _settings_client.gui.fast_forward_speed_limit;
} else {
_game_speed = 100;
}
}