@@ -297,6 +297,48 @@ SettingsTab::SettingsTab() {
297297 return true ;
298298 });
299299
300+
301+ deadzoneStickLeft->setText (" settings/deadzone/stick_left" _i18n);
302+ deadzoneStickRight->setText (" settings/deadzone/stick_right" _i18n);
303+
304+ updateDeadZoneItems ();
305+
306+ deadzoneStickLeft->registerClickAction ([this ](View* view) {
307+ int currentValue = int (Settings::instance ().get_deadzone_stick_left () * 100 );
308+ bool res = Application::getImeManager ()->openForNumber ([&](long number) {
309+ Settings::instance ().set_deadzone_stick_left (float (number) / 100 .f );
310+ this ->updateDeadZoneItems ();
311+ },
312+ " settings/deadzone/stick_left" _i18n, " settings/deadzone/input_hint" _i18n, 2 ,
313+ currentValue > 0 ? std::to_string (currentValue) : " " , " " ,
314+ " " , 0 );
315+
316+ if (!res) {
317+ Settings::instance ().set_deadzone_stick_left (0 );
318+ this ->updateDeadZoneItems ();
319+ }
320+
321+ return true ;
322+ });
323+
324+ deadzoneStickRight->registerClickAction ([this ](View* view) {
325+ int currentValue = int (Settings::instance ().get_deadzone_stick_right () * 100 );
326+ bool res = Application::getImeManager ()->openForNumber ([&](long number) {
327+ Settings::instance ().set_deadzone_stick_right (float (number) / 100 .f );
328+ this ->updateDeadZoneItems ();
329+ },
330+ " settings/deadzone/stick_right" _i18n, " settings/deadzone/input_hint" _i18n, 2 ,
331+ currentValue > 0 ? std::to_string (currentValue) : " " , " " ,
332+ " " , 0 );
333+
334+ if (!res) {
335+ Settings::instance ().set_deadzone_stick_right (0 );
336+ this ->updateDeadZoneItems ();
337+ }
338+
339+ return true ;
340+ });
341+
300342 float rumbleForceProgress = Settings::instance ().get_rumble_force ();
301343 rumbleForceSlider->getProgressEvent ()->subscribe ([this ](float value) {
302344 std::stringstream stream;
@@ -510,6 +552,24 @@ SettingsTab::SettingsTab() {
510552 });
511553}
512554
555+ void SettingsTab::updateDeadZoneItems () {
556+ if (Settings::instance ().get_deadzone_stick_left () > 0 ) {
557+ deadzoneStickLeft->setDetailTextColor (Application::getTheme ()[" brls/list/listItem_value_color" ]);
558+ deadzoneStickLeft->setDetailText (fmt::format (" {}%" , int (Settings::instance ().get_deadzone_stick_left () * 100 .f )));
559+ } else {
560+ deadzoneStickLeft->setDetailTextColor (Application::getTheme ()[" brls/text_disabled" ]);
561+ deadzoneStickLeft->setDetailText (" hints/off" _i18n);
562+ }
563+
564+ if (Settings::instance ().get_deadzone_stick_right () > 0 ) {
565+ deadzoneStickRight->setDetailTextColor (Application::getTheme ()[" brls/list/listItem_value_color" ]);
566+ deadzoneStickRight->setDetailText (fmt::format (" {}%" , int (Settings::instance ().get_deadzone_stick_right () * 100 )));
567+ } else {
568+ deadzoneStickRight->setDetailTextColor (Application::getTheme ()[" brls/text_disabled" ]);
569+ deadzoneStickRight->setDetailText (" hints/off" _i18n);
570+ }
571+ }
572+
513573void SettingsTab::setupButtonsSelectorCell (
514574 brls::DetailCell* cell, std::vector<ControllerButton> buttons) {
515575 cell->setDetailText (getTextFromButtons (buttons));
0 commit comments