aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2017-02-24 22:00:10 +0100
committerGitHub2017-02-24 22:00:10 +0100
commit8a547c8711a63c07bef974ad9457f57bf5658634 (patch)
treec1baf5d112f35dc1b80a3087fb6b164712b03b27
parent4b364787863b62f7a141f38646a8772e921fb1e7 (diff)
parent45bd7a8b75ebd8227ec4a09e427a66b1bb2796d1 (diff)
downloadscummvm-rg350-8a547c8711a63c07bef974ad9457f57bf5658634.tar.gz
scummvm-rg350-8a547c8711a63c07bef974ad9457f57bf5658634.tar.bz2
scummvm-rg350-8a547c8711a63c07bef974ad9457f57bf5658634.zip
Merge pull request #908 from rsn8887/upstream
SDL: Fix erratic analog pointer + control options
-rw-r--r--backends/events/sdl/sdl-events.cpp75
-rw-r--r--backends/events/sdl/sdl-events.h2
-rw-r--r--backends/platform/sdl/sdl.cpp14
-rw-r--r--common/system.h13
-rw-r--r--gui/options.cpp119
-rw-r--r--gui/options.h9
-rw-r--r--gui/themes/default.inc76
-rw-r--r--gui/themes/scummclassic.zipbin127529 -> 128803 bytes
-rw-r--r--gui/themes/scummclassic/classic_layout.stx22
-rw-r--r--gui/themes/scummclassic/classic_layout_lowres.stx22
-rw-r--r--gui/themes/scummmodern.zipbin1647069 -> 1648343 bytes
-rw-r--r--gui/themes/scummmodern/scummmodern_layout.stx22
-rw-r--r--gui/themes/scummmodern/scummmodern_layout_lowres.stx22
-rw-r--r--gui/widgets/tab.cpp10
-rw-r--r--gui/widgets/tab.h2
15 files changed, 354 insertions, 54 deletions
diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index 469f1d5a44..8c1194419f 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -231,18 +231,59 @@ bool SdlEventSource::handleKbdMouse(Common::Event &event) {
}
}
+ int16 speedFactor = 25;
+
+ if (g_system->hasFeature(OSystem::kFeatureKbdMouseSpeed)) {
+ switch (ConfMan.getInt("kbdmouse_speed")) {
+ // 0.25 keyboard pointer speed
+ case 0:
+ speedFactor = 100;
+ break;
+ // 0.5 speed
+ case 1:
+ speedFactor = 50;
+ break;
+ // 0.75 speed
+ case 2:
+ speedFactor = 37;
+ break;
+ // 1.0 speed
+ case 3:
+ speedFactor = 25;
+ break;
+ // 1.25 speed
+ case 4:
+ speedFactor = 20;
+ break;
+ // 1.5 speed
+ case 5:
+ speedFactor = 17;
+ break;
+ // 1.75 speed
+ case 6:
+ speedFactor = 14;
+ break;
+ // 2.0 speed
+ case 7:
+ speedFactor = 12;
+ break;
+ default:
+ speedFactor = 25;
+ }
+ }
+
// - The modifier key makes the mouse movement slower
- // - The extra factor "delay/25" ensures velocities
+ // - The extra factor "delay/speedFactor" ensures velocities
// are independent of the kbdMouse update rate
// - all velocities were originally chosen
// at a delay of 25, so that is the reference used here
// - note: operator order is important to avoid overflow
if (_km.modifier) {
- _km.x += ((_km.x_vel / 10) * ((int16)_km.delay_time)) / 25;
- _km.y += ((_km.y_vel / 10) * ((int16)_km.delay_time)) / 25;
+ _km.x += ((_km.x_vel / 10) * ((int16)_km.delay_time)) / speedFactor;
+ _km.y += ((_km.y_vel / 10) * ((int16)_km.delay_time)) / speedFactor;
} else {
- _km.x += (_km.x_vel * ((int16)_km.delay_time)) / 25;
- _km.y += (_km.y_vel * ((int16)_km.delay_time)) / 25;
+ _km.x += (_km.x_vel * ((int16)_km.delay_time)) / speedFactor;
+ _km.y += (_km.y_vel * ((int16)_km.delay_time)) / speedFactor;
}
if (_km.x < 0) {
@@ -826,8 +867,7 @@ bool SdlEventSource::handleJoyAxisMotion(SDL_Event &ev, Common::Event &event) {
if (ev.jaxis.axis == JOY_XAXIS) {
#ifdef JOY_ANALOG
- _km.x_vel = axis / vel_to_axis;
- _km.x_down_count = 0;
+ _km.joy_x = axis;
#else
if (axis != 0) {
_km.x_vel = (axis > 0) ? 1 * MULTIPLIER:-1 * MULTIPLIER;
@@ -842,8 +882,7 @@ bool SdlEventSource::handleJoyAxisMotion(SDL_Event &ev, Common::Event &event) {
axis = -axis;
#endif
#ifdef JOY_ANALOG
- _km.y_vel = -axis / vel_to_axis;
- _km.y_down_count = 0;
+ _km.joy_y = -axis;
#else
if (axis != 0) {
_km.y_vel = (-axis > 0) ? 1 * MULTIPLIER: -1 * MULTIPLIER;
@@ -856,21 +895,25 @@ bool SdlEventSource::handleJoyAxisMotion(SDL_Event &ev, Common::Event &event) {
}
#ifdef JOY_ANALOG
// radial and scaled analog joystick deadzone
- float analogX = (float) (_km.x_vel * vel_to_axis);
- float analogY = (float) (_km.y_vel * vel_to_axis);
- float deadZone = (float) JOY_DEADZONE;
+ float analogX = (float)_km.joy_x;
+ float analogY = (float)_km.joy_y;
+ float deadZone = (float)JOY_DEADZONE;
+ if (g_system->hasFeature(OSystem::kFeatureJoystickDeadzone))
+ deadZone = (float)ConfMan.getInt("joystick_deadzone") * 1000.0f;
float scalingFactor = 1.0f;
float magnitude = 0.0f;
magnitude = sqrt(analogX * analogX + analogY * analogY);
if (magnitude >= deadZone) {
+ _km.x_down_count = 0;
+ _km.y_down_count = 0;
scalingFactor = 1.0f / magnitude * (magnitude - deadZone) / (32769.0f - deadZone);
- _km.x_vel = (int16) (analogX * scalingFactor * 32768.0f / vel_to_axis);
- _km.y_vel = (int16) (analogY * scalingFactor * 32768.0f / vel_to_axis);
+ _km.x_vel = (int16)(analogX * scalingFactor * 32768.0f / vel_to_axis);
+ _km.y_vel = (int16)(analogY * scalingFactor * 32768.0f / vel_to_axis);
} else {
- _km.y_vel = 0;
_km.x_vel = 0;
+ _km.y_vel = 0;
}
#endif
@@ -951,6 +994,8 @@ void SdlEventSource::resetKeyboardEmulation(int16 x_max, int16 y_max) {
_km.delay_time = 12;
_km.last_time = 0;
_km.modifier = false;
+ _km.joy_x = 0;
+ _km.joy_y = 0;
}
bool SdlEventSource::handleResizeEvent(Common::Event &event, int w, int h) {
diff --git a/backends/events/sdl/sdl-events.h b/backends/events/sdl/sdl-events.h
index 334bf8acfc..cf445e9e2c 100644
--- a/backends/events/sdl/sdl-events.h
+++ b/backends/events/sdl/sdl-events.h
@@ -60,7 +60,7 @@ protected:
//@{
struct KbdMouse {
- int16 x, y, x_vel, y_vel, x_max, y_max, x_down_count, y_down_count;
+ int16 x, y, x_vel, y_vel, x_max, y_max, x_down_count, y_down_count, joy_x, joy_y;
uint32 last_time, delay_time, x_down_time, y_down_time;
bool modifier;
};
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 74c40ade10..1c5a7c2cbf 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -179,6 +179,10 @@ bool OSystem_SDL::hasFeature(Feature f) {
#if SDL_VERSION_ATLEAST(2, 0, 0)
if (f == kFeatureClipboardSupport) return true;
#endif
+#ifdef JOY_ANALOG
+ if (f == kFeatureJoystickDeadzone) return true;
+#endif
+ if (f == kFeatureKbdMouseSpeed) return true;
return ModularBackend::hasFeature(f);
}
@@ -274,6 +278,16 @@ void OSystem_SDL::initBackend() {
_inited = true;
+ if (!ConfMan.hasKey("kbdmouse_speed")) {
+ ConfMan.registerDefault("kbdmouse_speed", 3);
+ ConfMan.setInt("kbdmouse_speed", 3);
+ }
+#ifdef JOY_ANALOG
+ if (!ConfMan.hasKey("joystick_deadzone")) {
+ ConfMan.registerDefault("joystick_deadzone", 3);
+ ConfMan.setInt("joystick_deadzone", 3);
+ }
+#endif
ModularBackend::initBackend();
// We have to initialize the graphics manager before the event manager
diff --git a/common/system.h b/common/system.h
index 1b03fb0a15..83bc457707 100644
--- a/common/system.h
+++ b/common/system.h
@@ -351,7 +351,18 @@ public:
/**
* swap menu and back buttons
*/
- kFeatureSwapMenuAndBackButtons
+ kFeatureSwapMenuAndBackButtons,
+
+ /**
+ * keyboard mouse and joystick mouse speed
+ */
+ kFeatureKbdMouseSpeed,
+
+ /**
+ * change analog joystick deadzone
+ */
+ kFeatureJoystickDeadzone
+
};
/**
diff --git a/gui/options.cpp b/gui/options.cpp
index 53fba2f371..955f655f6c 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -78,7 +78,9 @@ enum {
kExtraPathClearCmd = 'clex',
kChoosePluginsDirCmd = 'chpl',
kChooseThemeCmd = 'chtf',
- kUpdatesCheckCmd = 'updc'
+ kUpdatesCheckCmd = 'updc',
+ kKbdMouseSpeedChanged = 'kmsc',
+ kJoystickDeadzoneChanged= 'jodc'
};
enum {
@@ -120,6 +122,8 @@ static const char *savePeriodLabels[] = { _s("Never"), _s("every 5 mins"), _s("e
static const int savePeriodValues[] = { 0, 5 * 60, 10 * 60, 15 * 60, 30 * 60, -1 };
static const char *outputRateLabels[] = { _s("<default>"), _s("8 kHz"), _s("11 kHz"), _s("22 kHz"), _s("44 kHz"), _s("48 kHz"), 0 };
static const int outputRateValues[] = { 0, 8000, 11025, 22050, 44100, 48000, -1 };
+static const char *kbdMouseSpeedLabels[] = { _s("3"), _s("5"), _s("8"), _s("10"), _s("13"), _s("15"), _s("18"), _s("20"), 0 };
+static const int kbdMouseSpeedValues[] = { 0, 1, 2, 3, 4, 5, 6, 7, -1 };
OptionsDialog::OptionsDialog(const Common::String &domain, int x, int y, int w, int h)
: Dialog(x, y, w, h), _domain(domain), _graphicsTabId(-1), _midiTabId(-1), _pathsTabId(-1), _tabWidget(0) {
@@ -140,6 +144,12 @@ void OptionsDialog::init() {
_onscreenCheckbox = 0;
_touchpadCheckbox = 0;
_swapMenuAndBackBtnsCheckbox = 0;
+ _kbdMouseSpeedDesc = 0;
+ _kbdMouseSpeedSlider = 0;
+ _kbdMouseSpeedLabel = 0;
+ _joystickDeadzoneDesc = 0;
+ _joystickDeadzoneSlider = 0;
+ _joystickDeadzoneLabel = 0;
_enableGraphicSettings = false;
_gfxPopUp = 0;
_gfxPopUpDesc = 0;
@@ -229,6 +239,24 @@ void OptionsDialog::build() {
_swapMenuAndBackBtnsCheckbox->setState(state);
}
}
+ if (g_system->hasFeature(OSystem::kFeatureKbdMouseSpeed)) {
+ if (ConfMan.hasKey("kbdmouse_speed", _domain)) {
+ int value = ConfMan.getInt("kbdmouse_speed", _domain);
+ if (_kbdMouseSpeedSlider && value < sizeof(kbdMouseSpeedLabels)) {
+ _kbdMouseSpeedSlider->setValue(value);
+ _kbdMouseSpeedLabel->setLabel(kbdMouseSpeedLabels[value]);
+ }
+ }
+ }
+ if (g_system->hasFeature(OSystem::kFeatureJoystickDeadzone)) {
+ if (ConfMan.hasKey("joystick_deadzone", _domain)) {
+ int value = ConfMan.getInt("joystick_deadzone", _domain);
+ if (_joystickDeadzoneSlider != 0) {
+ _joystickDeadzoneSlider->setValue(value);
+ _joystickDeadzoneLabel->setValue(value);
+ }
+ }
+ }
// Graphic options
if (_fullscreenCheckbox) {
@@ -424,6 +452,16 @@ void OptionsDialog::apply() {
g_system->setFeatureState(OSystem::kFeatureSwapMenuAndBackButtons, _swapMenuAndBackBtnsCheckbox->getState());
}
}
+ if (g_system->hasFeature(OSystem::kFeatureKbdMouseSpeed)) {
+ if (ConfMan.getInt("kbdmouse_speed", _domain) != _kbdMouseSpeedSlider->getValue()) {
+ ConfMan.setInt("kbdmouse_speed", _kbdMouseSpeedSlider->getValue(), _domain);
+ }
+ }
+ if (g_system->hasFeature(OSystem::kFeatureJoystickDeadzone)) {
+ if (ConfMan.getInt("joystick_deadzone", _domain) != _joystickDeadzoneSlider->getValue()) {
+ ConfMan.setInt("joystick_deadzone", _joystickDeadzoneSlider->getValue(), _domain);
+ }
+ }
}
// Graphic options
@@ -737,6 +775,14 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
_soundFontClearButton->setEnabled(false);
draw();
break;
+ case kKbdMouseSpeedChanged:
+ _kbdMouseSpeedLabel->setLabel(kbdMouseSpeedLabels[_kbdMouseSpeedSlider->getValue()]);
+ _kbdMouseSpeedLabel->draw();
+ break;
+ case kJoystickDeadzoneChanged:
+ _joystickDeadzoneLabel->setValue(_joystickDeadzoneSlider->getValue());
+ _joystickDeadzoneLabel->draw();
+ break;
case kApplyCmd:
apply();
break;
@@ -878,21 +924,46 @@ void OptionsDialog::setSubtitleSettingsState(bool enabled) {
_subSpeedLabel->setEnabled(ena);
}
- void OptionsDialog::addControlControls(GuiObject *boss, const Common::String &prefix) {
- // Show On-Screen control
- if (g_system->hasFeature(OSystem::kFeatureOnScreenControl))
- _onscreenCheckbox = new CheckboxWidget(boss, prefix + "grOnScreenCheckbox", _("Show On-screen control"));
-
- // Touchpad Mouse mode
- if (g_system->hasFeature(OSystem::kFeatureTouchpadMode))
- _touchpadCheckbox = new CheckboxWidget(boss, prefix + "grTouchpadCheckbox", _("Touchpad mouse mode"));
+void OptionsDialog::addControlControls(GuiObject *boss, const Common::String &prefix) {
+ // Show On-Screen control
+ if (g_system->hasFeature(OSystem::kFeatureOnScreenControl))
+ _onscreenCheckbox = new CheckboxWidget(boss, prefix + "grOnScreenCheckbox", _("Show On-screen control"));
- // Swap menu and back buttons
- if (g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons))
- _swapMenuAndBackBtnsCheckbox = new CheckboxWidget(boss, prefix + "grSwapMenuAndBackBtnsCheckbox", _("Swap Menu and Back buttons"));
-
- _enableControlSettings = true;
- }
+ // Touchpad Mouse mode
+ if (g_system->hasFeature(OSystem::kFeatureTouchpadMode))
+ _touchpadCheckbox = new CheckboxWidget(boss, prefix + "grTouchpadCheckbox", _("Touchpad mouse mode"));
+
+ // Swap menu and back buttons
+ if (g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons))
+ _swapMenuAndBackBtnsCheckbox = new CheckboxWidget(boss, prefix + "grSwapMenuAndBackBtnsCheckbox", _("Swap Menu and Back buttons"));
+
+ // Keyboard and joystick mouse speed
+ if (g_system->hasFeature(OSystem::kFeatureKbdMouseSpeed)) {
+ if (g_system->getOverlayWidth() > 320)
+ _kbdMouseSpeedDesc = new StaticTextWidget(boss, prefix + "grKbdMouseSpeedDesc", _("Mouse Speed:"), _("Speed multiplier for mouse emulation"));
+ else
+ _kbdMouseSpeedDesc = new StaticTextWidget(boss, prefix + "grKbdMouseSpeedDesc", _c("Mouse Speed:", "lowres"), _("Speed multiplier for mouse emulation"));
+ _kbdMouseSpeedSlider = new SliderWidget(boss, prefix + "grKbdMouseSpeedSlider", _("Speed multiplier for mouse emulation"), kKbdMouseSpeedChanged);
+ _kbdMouseSpeedLabel = new StaticTextWidget(boss, prefix + "grKbdMouseSpeedLabel", " ");
+ _kbdMouseSpeedSlider->setMinValue(0);
+ _kbdMouseSpeedSlider->setMaxValue(7);
+ _kbdMouseSpeedLabel->setFlags(WIDGET_CLEARBG);
+ }
+
+ // Joystick deadzone
+ if (g_system->hasFeature(OSystem::kFeatureJoystickDeadzone)) {
+ if (g_system->getOverlayWidth() > 320)
+ _joystickDeadzoneDesc = new StaticTextWidget(boss, prefix + "grJoystickDeadzoneDesc", _("Joy Deadzone:"), _("Analog Joystick Deadzone"));
+ else
+ _joystickDeadzoneDesc = new StaticTextWidget(boss, prefix + "grJoystickDeadzoneDesc", _c("Joy Deadzone:", "lowres"), _("Analog Joystick Deadzone"));
+ _joystickDeadzoneSlider = new SliderWidget(boss, prefix + "grJoystickDeadzoneSlider", _("Analog Joystick Deadzone"), kJoystickDeadzoneChanged);
+ _joystickDeadzoneLabel = new StaticTextWidget(boss, prefix + "grJoystickDeadzoneLabel", " ");
+ _joystickDeadzoneSlider->setMinValue(1);
+ _joystickDeadzoneSlider->setMaxValue(10);
+ _joystickDeadzoneLabel->setFlags(WIDGET_CLEARBG);
+ }
+ _enableControlSettings = true;
+}
void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &prefix) {
const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes();
@@ -1343,14 +1414,16 @@ void GlobalOptionsDialog::build() {
TabWidget *tab = new TabWidget(this, "GlobalOptions.TabWidget");
//
- // The control tab (currently visible only for AndroidSDL platform, visibility checking by features
+ // The control tab (currently visible only for AndroidSDL, SDL, and Vita platform, visibility checking by features
//
if (g_system->hasFeature(OSystem::kFeatureTouchpadMode) ||
g_system->hasFeature(OSystem::kFeatureOnScreenControl) ||
- g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons)) {
+ g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons) ||
+ g_system->hasFeature(OSystem::kFeatureKbdMouseSpeed) ||
+ g_system->hasFeature(OSystem::kFeatureJoystickDeadzone)) {
tab->addTab(_("Control"));
addControlControls(tab, "GlobalOptions_Control.");
- }
+ }
//
// 1) The graphics tab
@@ -1927,8 +2000,14 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
#ifdef USE_LIBCURL
case kPopUpItemSelectedCmd:
{
- //update container's scrollbar
- reflowLayout();
+ //update container's scrollbar and make sure tabs are not re-arranged
+ if (_tabWidget) {
+ int oldFirstVisible = _tabWidget->getFirstVisible();
+ reflowLayout();
+ _tabWidget->setFirstVisible(oldFirstVisible);
+ } else {
+ reflowLayout();
+ }
break;
}
case kConfigureStorageCmd:
diff --git a/gui/options.h b/gui/options.h
index 6b6cb92378..2f628315e4 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -123,7 +123,14 @@ private:
CheckboxWidget *_touchpadCheckbox;
CheckboxWidget *_onscreenCheckbox;
CheckboxWidget *_swapMenuAndBackBtnsCheckbox;
-
+
+ StaticTextWidget *_kbdMouseSpeedDesc;
+ SliderWidget *_kbdMouseSpeedSlider;
+ StaticTextWidget *_kbdMouseSpeedLabel;
+ StaticTextWidget *_joystickDeadzoneDesc;
+ SliderWidget *_joystickDeadzoneSlider;
+ StaticTextWidget *_joystickDeadzoneLabel;
+
//
// Graphics controls
//
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index d8baae8d0e..f967067adc 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -813,17 +813,39 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</layout>"
"</layout>"
"</dialog>"
-"<dialog name='GlobalOptions_Control' overlays='Dialog.GlobalOptions.TabWidget'>"
-"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
-"<widget name='grOnScreenCheckbox' "
-"type='Checkbox' "
+"<dialog name = 'GlobalOptions_Control' overlays = 'Dialog.GlobalOptions.TabWidget'>"
+"<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>"
+"<widget name = 'grOnScreenCheckbox' "
+"type = 'Checkbox' "
"/>"
-"<widget name='grTouchpadCheckbox' "
-"type='Checkbox' "
+"<widget name = 'grTouchpadCheckbox' "
+"type = 'Checkbox' "
"/>"
-"<widget name='grSwapMenuAndBackBtnsCheckbox' "
-"type='Checkbox' "
+"<widget name = 'grSwapMenuAndBackBtnsCheckbox' "
+"type = 'Checkbox' "
+"/>"
+"<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>"
+"<widget name = 'grKbdMouseSpeedDesc' "
+"type = 'OptionsLabel' "
+"/>"
+"<widget name = 'grKbdMouseSpeedSlider' "
+"type = 'Slider' "
"/>"
+"<widget name = 'grKbdMouseSpeedLabel' "
+"type = 'SmallLabel' "
+"/>"
+"</layout>"
+"<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>"
+"<widget name = 'grJoystickDeadzoneDesc' "
+"type = 'OptionsLabel' "
+"/>"
+"<widget name = 'grJoystickDeadzoneSlider' "
+"type = 'Slider' "
+"/>"
+"<widget name = 'grJoystickDeadzoneLabel' "
+"type = 'SmallLabel' "
+"/>"
+"</layout>"
"</layout>"
"</dialog>"
"<dialog name='GlobalOptions_Graphics' overlays='Dialog.GlobalOptions.TabWidget'>"
@@ -2368,17 +2390,39 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</layout>"
"</layout>"
"</dialog>"
-"<dialog name='GlobalOptions_Control' overlays='Dialog.GlobalOptions.TabWidget'>"
-"<layout type='vertical' padding='16,16,16,16' spacing='6'>"
-"<widget name='grOnScreenCheckbox' "
-"type='Checkbox' "
+"<dialog name = 'GlobalOptions_Control' overlays = 'Dialog.GlobalOptions.TabWidget'>"
+"<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>"
+"<widget name = 'grOnScreenCheckbox' "
+"type = 'Checkbox' "
"/>"
-"<widget name='grTouchpadCheckbox' "
-"type='Checkbox' "
+"<widget name = 'grTouchpadCheckbox' "
+"type = 'Checkbox' "
"/>"
-"<widget name='grSwapMenuAndBackBtnsCheckbox' "
-"type='Checkbox' "
+"<widget name = 'grSwapMenuAndBackBtnsCheckbox' "
+"type = 'Checkbox' "
+"/>"
+"<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>"
+"<widget name = 'grKbdMouseSpeedDesc' "
+"type = 'OptionsLabel' "
+"/>"
+"<widget name = 'grKbdMouseSpeedSlider' "
+"type = 'Slider' "
"/>"
+"<widget name = 'grKbdMouseSpeedLabel' "
+"type = 'SmallLabel' "
+"/>"
+"</layout>"
+"<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>"
+"<widget name = 'grJoystickDeadzoneDesc' "
+"type = 'OptionsLabel' "
+"/>"
+"<widget name = 'grJoystickDeadzoneSlider' "
+"type = 'Slider' "
+"/>"
+"<widget name = 'grJoystickDeadzoneLabel' "
+"type = 'SmallLabel' "
+"/>"
+"</layout>"
"</layout>"
"</dialog>"
"<dialog name='GlobalOptions_Graphics' overlays='Dialog.GlobalOptions.TabWidget'>"
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index d90289a4be..e84768b497 100644
--- a/gui/themes/scummclassic.zip
+++ b/gui/themes/scummclassic.zip
Binary files differ
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index aa91cdb35f..75ffee20cd 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -249,6 +249,28 @@
<widget name = 'grSwapMenuAndBackBtnsCheckbox'
type = 'Checkbox'
/>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
+ <widget name = 'grKbdMouseSpeedDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'grKbdMouseSpeedSlider'
+ type = 'Slider'
+ />
+ <widget name = 'grKbdMouseSpeedLabel'
+ type = 'SmallLabel'
+ />
+ </layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <widget name = 'grJoystickDeadzoneDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'grJoystickDeadzoneSlider'
+ type = 'Slider'
+ />
+ <widget name = 'grJoystickDeadzoneLabel'
+ type = 'SmallLabel'
+ />
+ </layout>
</layout>
</dialog>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index c925a39d18..e46db3e94b 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -246,6 +246,28 @@
<widget name = 'grSwapMenuAndBackBtnsCheckbox'
type = 'Checkbox'
/>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
+ <widget name = 'grKbdMouseSpeedDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'grKbdMouseSpeedSlider'
+ type = 'Slider'
+ />
+ <widget name = 'grKbdMouseSpeedLabel'
+ type = 'SmallLabel'
+ />
+ </layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <widget name = 'grJoystickDeadzoneDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'grJoystickDeadzoneSlider'
+ type = 'Slider'
+ />
+ <widget name = 'grJoystickDeadzoneLabel'
+ type = 'SmallLabel'
+ />
+ </layout>
</layout>
</dialog>
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index f10102503e..ed1e3c0c58 100644
--- a/gui/themes/scummmodern.zip
+++ b/gui/themes/scummmodern.zip
Binary files differ
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 80b913a3a4..754bc251d9 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -263,6 +263,28 @@
<widget name = 'grSwapMenuAndBackBtnsCheckbox'
type = 'Checkbox'
/>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
+ <widget name = 'grKbdMouseSpeedDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'grKbdMouseSpeedSlider'
+ type = 'Slider'
+ />
+ <widget name = 'grKbdMouseSpeedLabel'
+ type = 'SmallLabel'
+ />
+ </layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <widget name = 'grJoystickDeadzoneDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'grJoystickDeadzoneSlider'
+ type = 'Slider'
+ />
+ <widget name = 'grJoystickDeadzoneLabel'
+ type = 'SmallLabel'
+ />
+ </layout>
</layout>
</dialog>
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index 308ba44b7e..eadb305414 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -244,6 +244,28 @@
<widget name = 'grSwapMenuAndBackBtnsCheckbox'
type = 'Checkbox'
/>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
+ <widget name = 'grKbdMouseSpeedDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'grKbdMouseSpeedSlider'
+ type = 'Slider'
+ />
+ <widget name = 'grKbdMouseSpeedLabel'
+ type = 'SmallLabel'
+ />
+ </layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <widget name = 'grJoystickDeadzoneDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'grJoystickDeadzoneSlider'
+ type = 'Slider'
+ />
+ <widget name = 'grJoystickDeadzoneLabel'
+ type = 'SmallLabel'
+ />
+ </layout>
</layout>
</dialog>
diff --git a/gui/widgets/tab.cpp b/gui/widgets/tab.cpp
index cf9dd5d962..8e8c6b48a1 100644
--- a/gui/widgets/tab.cpp
+++ b/gui/widgets/tab.cpp
@@ -277,6 +277,16 @@ void TabWidget::adjustTabs(int value) {
setActiveTab(tabID);
}
+int TabWidget::getFirstVisible() {
+ return _firstVisibleTab;
+}
+
+void TabWidget::setFirstVisible(int tabID) {
+ assert(0 <= tabID && tabID < (int)_tabs.size());
+ _firstVisibleTab = tabID;
+ _boss->draw();
+}
+
void TabWidget::reflowLayout() {
Widget::reflowLayout();
diff --git a/gui/widgets/tab.h b/gui/widgets/tab.h
index 17b85986b5..4516c3c831 100644
--- a/gui/widgets/tab.h
+++ b/gui/widgets/tab.h
@@ -101,6 +101,8 @@ public:
virtual void handleMouseDown(int x, int y, int button, int clickCount);
virtual bool handleKeyDown(Common::KeyState state);
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
+ virtual int getFirstVisible();
+ virtual void setFirstVisible(int tabID);
virtual void reflowLayout();