diff --git a/Common/UI/PopupScreens.cpp b/Common/UI/PopupScreens.cpp index a15832fc79..71b599da02 100644 --- a/Common/UI/PopupScreens.cpp +++ b/Common/UI/PopupScreens.cpp @@ -155,14 +155,14 @@ PopupSliderChoice::PopupSliderChoice(int *value, int minValue, int maxValue, con OnClick.Handle(this, &PopupSliderChoice::HandleClick); } -PopupSliderChoiceFloat::PopupSliderChoiceFloat(float *value, float minValue, float maxValue, const std::string &text, ScreenManager *screenManager, const std::string &units, LayoutParams *layoutParams) - : AbstractChoiceWithValueDisplay(text, layoutParams), value_(value), minValue_(minValue), maxValue_(maxValue), step_(1.0f), units_(units), screenManager_(screenManager) { +PopupSliderChoiceFloat::PopupSliderChoiceFloat(float *value, float minValue, float maxValue, float defaultValue, const std::string &text, ScreenManager *screenManager, const std::string &units, LayoutParams *layoutParams) + : AbstractChoiceWithValueDisplay(text, layoutParams), value_(value), minValue_(minValue), maxValue_(maxValue), defaultValue_(defaultValue), step_(1.0f), units_(units), screenManager_(screenManager) { fmt_ = "%2.2f"; OnClick.Handle(this, &PopupSliderChoiceFloat::HandleClick); } -PopupSliderChoiceFloat::PopupSliderChoiceFloat(float *value, float minValue, float maxValue, const std::string &text, float step, ScreenManager *screenManager, const std::string &units, LayoutParams *layoutParams) - : AbstractChoiceWithValueDisplay(text, layoutParams), value_(value), minValue_(minValue), maxValue_(maxValue), step_(step), units_(units), screenManager_(screenManager) { +PopupSliderChoiceFloat::PopupSliderChoiceFloat(float *value, float minValue, float maxValue, float defaultValue, const std::string &text, float step, ScreenManager *screenManager, const std::string &units, LayoutParams *layoutParams) + : AbstractChoiceWithValueDisplay(text, layoutParams), value_(value), minValue_(minValue), maxValue_(maxValue), defaultValue_(defaultValue), step_(step), units_(units), screenManager_(screenManager) { fmt_ = "%2.2f"; OnClick.Handle(this, &PopupSliderChoiceFloat::HandleClick); } @@ -207,7 +207,7 @@ std::string PopupSliderChoice::ValueText() const { EventReturn PopupSliderChoiceFloat::HandleClick(EventParams &e) { restoreFocus_ = HasFocus(); - SliderFloatPopupScreen *popupScreen = new SliderFloatPopupScreen(value_, minValue_, maxValue_, ChopTitle(text_), step_, units_, liveUpdate_); + SliderFloatPopupScreen *popupScreen = new SliderFloatPopupScreen(value_, minValue_, maxValue_, defaultValue_, ChopTitle(text_), step_, units_, liveUpdate_); popupScreen->OnChange.Handle(this, &PopupSliderChoiceFloat::HandleChange); popupScreen->SetHasDropShadow(hasDropShadow_); if (e.v) @@ -325,6 +325,7 @@ void SliderPopupScreen::CreatePopupContents(UI::ViewGroup *parent) { void SliderFloatPopupScreen::CreatePopupContents(UI::ViewGroup *parent) { using namespace UI; UIContext &dc = *screenManager()->getUIContext(); + auto di = GetI18NCategory("Dialog"); sliderValue_ = *value_; LinearLayout *vert = parent->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(UI::Margins(10, 10)))); @@ -336,16 +337,27 @@ void SliderFloatPopupScreen::CreatePopupContents(UI::ViewGroup *parent) { lin->Add(new Button(" - "))->OnClick.Handle(this, &SliderFloatPopupScreen::OnDecrease); lin->Add(new Button(" + "))->OnClick.Handle(this, &SliderFloatPopupScreen::OnIncrease); - char temp[64]; - sprintf(temp, "%0.3f", sliderValue_); - edit_ = new TextEdit(temp, Title(), "", new LinearLayoutParams(10.0f)); + edit_ = new TextEdit("", Title(), "", new LinearLayoutParams(1.0f)); edit_->SetMaxLen(16); edit_->SetTextColor(dc.theme->itemStyle.fgColor); edit_->SetTextAlign(FLAG_DYNAMIC_ASCII); edit_->OnTextChange.Handle(this, &SliderFloatPopupScreen::OnTextChange); + changing_ = true; + UpdateTextBox(); + changing_ = false; lin->Add(edit_); if (!units_.empty()) - lin->Add(new TextView(units_, new LinearLayoutParams(10.0f)))->SetTextColor(dc.theme->itemStyle.fgColor); + lin->Add(new TextView(units_))->SetTextColor(dc.theme->itemStyle.fgColor); + + if (defaultValue_ != NO_DEFAULT_FLOAT) { + lin->Add(new Button(di->T("Reset")))->OnClick.Add([=](UI::EventParams &) { + sliderValue_ = defaultValue_; + if (liveUpdate_) { + *value_ = defaultValue_; + } + return UI::EVENT_DONE; + }); + } // slider_ = parent->Add(new SliderFloat(&sliderValue_, minValue_, maxValue_, new LinearLayoutParams(UI::Margins(10, 5)))); if (IsFocusMovementEnabled()) @@ -359,9 +371,7 @@ EventReturn SliderFloatPopupScreen::OnDecrease(EventParams ¶ms) { sliderValue_ -= step_; slider_->Clamp(); changing_ = true; - char temp[64]; - sprintf(temp, "%0.3f", sliderValue_); - edit_->SetText(temp); + UpdateTextBox(); changing_ = false; if (liveUpdate_) { *value_ = sliderValue_; @@ -376,9 +386,7 @@ EventReturn SliderFloatPopupScreen::OnIncrease(EventParams ¶ms) { sliderValue_ += step_; slider_->Clamp(); changing_ = true; - char temp[64]; - sprintf(temp, "%0.3f", sliderValue_); - edit_->SetText(temp); + UpdateTextBox(); changing_ = false; if (liveUpdate_) { *value_ = sliderValue_; @@ -388,9 +396,7 @@ EventReturn SliderFloatPopupScreen::OnIncrease(EventParams ¶ms) { EventReturn SliderFloatPopupScreen::OnSliderChange(EventParams ¶ms) { changing_ = true; - char temp[64]; - sprintf(temp, "%0.3f", sliderValue_); - edit_->SetText(temp); + UpdateTextBox(); changing_ = false; if (liveUpdate_) { *value_ = sliderValue_; @@ -398,6 +404,12 @@ EventReturn SliderFloatPopupScreen::OnSliderChange(EventParams ¶ms) { return EVENT_DONE; } +void SliderFloatPopupScreen::UpdateTextBox() { + char temp[64]; + sprintf(temp, "%0.3f", sliderValue_); + edit_->SetText(temp); +} + EventReturn SliderFloatPopupScreen::OnTextChange(EventParams ¶ms) { if (!changing_) { sliderValue_ = atof(edit_->GetText().c_str()); diff --git a/Common/UI/PopupScreens.h b/Common/UI/PopupScreens.h index e6b306c626..88ec46a1a2 100644 --- a/Common/UI/PopupScreens.h +++ b/Common/UI/PopupScreens.h @@ -7,6 +7,8 @@ namespace UI { +static const float NO_DEFAULT_FLOAT = -1000000.0f; + class ListPopupScreen : public PopupScreen { public: ListPopupScreen(std::string title) : PopupScreen(title) {} @@ -98,8 +100,8 @@ private: class SliderFloatPopupScreen : public PopupScreen { public: - SliderFloatPopupScreen(float *value, float minValue, float maxValue, const std::string &title, float step = 1.0f, const std::string &units = "", bool liveUpdate = false) - : PopupScreen(title, "OK", "Cancel"), units_(units), value_(value), originalValue_(*value), minValue_(minValue), maxValue_(maxValue), step_(step), liveUpdate_(liveUpdate) {} + SliderFloatPopupScreen(float *value, float minValue, float maxValue, float defaultValue, const std::string &title, float step = 1.0f, const std::string &units = "", bool liveUpdate = false) + : PopupScreen(title, "OK", "Cancel"), units_(units), value_(value), originalValue_(*value), minValue_(minValue), maxValue_(maxValue), defaultValue_(defaultValue), step_(step), liveUpdate_(liveUpdate) {} void CreatePopupContents(UI::ViewGroup *parent) override; const char *tag() const override { return "SliderFloatPopup"; } @@ -112,6 +114,7 @@ private: EventReturn OnTextChange(EventParams ¶ms); EventReturn OnSliderChange(EventParams ¶ms); void OnCompleted(DialogResult result) override; + void UpdateTextBox(); UI::SliderFloat *slider_ = nullptr; UI::TextEdit *edit_ = nullptr; std::string units_; @@ -120,6 +123,7 @@ private: float *value_; float minValue_; float maxValue_; + float defaultValue_; float step_; bool changing_ = false; bool liveUpdate_; @@ -307,8 +311,8 @@ private: class PopupSliderChoiceFloat : public AbstractChoiceWithValueDisplay { public: - PopupSliderChoiceFloat(float *value, float minValue, float maxValue, const std::string &text, ScreenManager *screenManager, const std::string &units = "", LayoutParams *layoutParams = 0); - PopupSliderChoiceFloat(float *value, float minValue, float maxValue, const std::string &text, float step, ScreenManager *screenManager, const std::string &units = "", LayoutParams *layoutParams = 0); + PopupSliderChoiceFloat(float *value, float minValue, float maxValue, float defaultValue, const std::string &text, ScreenManager *screenManager, const std::string &units = "", LayoutParams *layoutParams = 0); + PopupSliderChoiceFloat(float *value, float minValue, float maxValue, float defaultValue, const std::string &text, float step, ScreenManager *screenManager, const std::string &units = "", LayoutParams *layoutParams = 0); void SetFormat(const char *fmt) { fmt_ = fmt; @@ -334,6 +338,7 @@ private: float *value_; float minValue_; float maxValue_; + float defaultValue_; float step_; const char *fmt_; std::string zeroLabel_; diff --git a/Core/Config.cpp b/Core/Config.cpp index 3d708ff4d0..b0ea691409 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1002,7 +1002,6 @@ static const ConfigSetting controlSettings[] = { ConfigSetting("TouchButtonOpacity", &g_Config.iTouchButtonOpacity, 65, true, true), ConfigSetting("TouchButtonHideSeconds", &g_Config.iTouchButtonHideSeconds, 20, true, true), ConfigSetting("AutoCenterTouchAnalog", &g_Config.bAutoCenterTouchAnalog, false, true, true), - ConfigSetting("AnalogAutoRotSpeed", &g_Config.fAnalogAutoRotSpeed, 8.0f, true, true), // Snap touch control position ConfigSetting("TouchSnapToGrid", &g_Config.bTouchSnapToGrid, false, true, true), @@ -1026,7 +1025,8 @@ static const ConfigSetting controlSettings[] = { ConfigSetting("AnalogDeadzone", &g_Config.fAnalogDeadzone, 0.15f, true, true), ConfigSetting("AnalogInverseDeadzone", &g_Config.fAnalogInverseDeadzone, 0.0f, true, true), ConfigSetting("AnalogSensitivity", &g_Config.fAnalogSensitivity, 1.1f, true, true), - ConfigSetting("AnalogIsCircular", &g_Config.bAnalogIsCircular, false , true, true), + ConfigSetting("AnalogIsCircular", &g_Config.bAnalogIsCircular, false, true, true), + ConfigSetting("AnalogAutoRotSpeed", &g_Config.fAnalogAutoRotSpeed, 8.0f, true, true), ConfigSetting("AnalogLimiterDeadzone", &g_Config.fAnalogLimiterDeadzone, 0.6f, true, true), diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index 0f33b1aa5a..7d370b5789 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -536,12 +536,12 @@ void AnalogSetupScreen::CreateViews() { scrollContents->Add(new ItemHeader(co->T("Analog Settings", "Analog Settings"))); // TODO: Would be nicer if these didn't pop up... - scrollContents->Add(new PopupSliderChoiceFloat(&g_Config.fAnalogDeadzone, 0.0f, 0.5f, co->T("Deadzone radius"), 0.01f, screenManager(), "/ 1.0")); - scrollContents->Add(new PopupSliderChoiceFloat(&g_Config.fAnalogInverseDeadzone, 0.0f, 1.0f, co->T("Low end radius"), 0.01f, screenManager(), "/ 1.0")); - scrollContents->Add(new PopupSliderChoiceFloat(&g_Config.fAnalogSensitivity, 0.0f, 2.0f, co->T("Sensitivity (scale)", "Sensitivity"), 0.01f, screenManager(), "x")); + scrollContents->Add(new PopupSliderChoiceFloat(&g_Config.fAnalogDeadzone, 0.0f, 0.5f, 0.15f, co->T("Deadzone radius"), 0.01f, screenManager(), "/ 1.0")); + scrollContents->Add(new PopupSliderChoiceFloat(&g_Config.fAnalogInverseDeadzone, 0.0f, 1.0f, 0.0f, co->T("Low end radius"), 0.01f, screenManager(), "/ 1.0")); + scrollContents->Add(new PopupSliderChoiceFloat(&g_Config.fAnalogSensitivity, 0.0f, 2.0f, 1.1f, co->T("Sensitivity (scale)", "Sensitivity"), 0.01f, screenManager(), "x")); // TODO: This should probably be a slider. scrollContents->Add(new CheckBox(&g_Config.bAnalogIsCircular, co->T("Circular stick input"))); - scrollContents->Add(new PopupSliderChoiceFloat(&g_Config.fAnalogAutoRotSpeed, 0.0f, 20.0f, co->T("Auto-rotation speed"), 1.0f, screenManager())); + scrollContents->Add(new PopupSliderChoiceFloat(&g_Config.fAnalogAutoRotSpeed, 0.1f, 20.0f, 8.0f, co->T("Auto-rotation speed"), 1.0f, screenManager())); scrollContents->Add(new Choice(co->T("Reset to defaults")))->OnClick.Handle(this, &AnalogSetupScreen::OnResetToDefaults); LinearLayout *theTwo = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(1.0f)); diff --git a/UI/DisplayLayoutScreen.cpp b/UI/DisplayLayoutScreen.cpp index 6e5a68970c..e8ea672dd0 100644 --- a/UI/DisplayLayoutScreen.cpp +++ b/UI/DisplayLayoutScreen.cpp @@ -244,7 +244,7 @@ void DisplayLayoutScreen::CreateViews() { stretch->SetDisabledPtr(&g_Config.bDisplayIntegerScale); rightColumn->Add(stretch); - PopupSliderChoiceFloat *aspectRatio = new PopupSliderChoiceFloat(&g_Config.fDisplayAspectRatio, 0.5f, 2.0f, gr->T("Aspect Ratio"), screenManager()); + PopupSliderChoiceFloat *aspectRatio = new PopupSliderChoiceFloat(&g_Config.fDisplayAspectRatio, 0.1f, 2.0f, 1.0f, gr->T("Aspect Ratio"), screenManager()); rightColumn->Add(aspectRatio); aspectRatio->SetEnabledFunc([]() { return !g_Config.bDisplayStretch && !g_Config.bDisplayIntegerScale; @@ -445,10 +445,10 @@ void DisplayLayoutScreen::CreateViews() { if (duplicated) { auto sliderName = StringFromFormat("%s %s", ps->T(setting.name), ps->T("(duplicated setting, previous slider will be used)")); - PopupSliderChoiceFloat *settingValue = settingContainer->Add(new PopupSliderChoiceFloat(&value, setting.minValue, setting.maxValue, sliderName, setting.step, screenManager())); + PopupSliderChoiceFloat *settingValue = settingContainer->Add(new PopupSliderChoiceFloat(&value, setting.minValue, setting.maxValue, setting.value, sliderName, setting.step, screenManager())); settingValue->SetEnabled(false); } else { - PopupSliderChoiceFloat *settingValue = settingContainer->Add(new PopupSliderChoiceFloat(&value, setting.minValue, setting.maxValue, ps->T(setting.name), setting.step, screenManager())); + PopupSliderChoiceFloat *settingValue = settingContainer->Add(new PopupSliderChoiceFloat(&value, setting.minValue, setting.maxValue, setting.value, ps->T(setting.name), setting.step, screenManager())); settingValue->SetLiveUpdate(true); settingValue->SetHasDropShadow(false); settingValue->SetEnabledFunc([=] { diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 563d1f24f2..3bcb283210 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -759,7 +759,7 @@ void GameSettingsScreen::CreateControlsSettings(UI::ViewGroup *controlsSettings) #if defined(USING_WIN_UI) controlsSettings->Add(new CheckBox(&g_Config.bIgnoreWindowsKey, co->T("Ignore Windows Key"))); #endif // #if defined(USING_WIN_UI) - auto analogLimiter = new PopupSliderChoiceFloat(&g_Config.fAnalogLimiterDeadzone, 0.0f, 1.0f, co->T("Analog Limiter"), 0.10f, screenManager(), "/ 1.0"); + auto analogLimiter = new PopupSliderChoiceFloat(&g_Config.fAnalogLimiterDeadzone, 0.0f, 1.0f, 0.6f, co->T("Analog Limiter"), 0.10f, screenManager(), "/ 1.0"); controlsSettings->Add(analogLimiter); analogLimiter->OnChange.Add([=](EventParams &e) { settingInfo_->Show(co->T("AnalogLimiter Tip", "When the analog limiter button is pressed"), e.v); @@ -774,8 +774,8 @@ void GameSettingsScreen::CreateControlsSettings(UI::ViewGroup *controlsSettings) return UI::EVENT_CONTINUE; }); controlsSettings->Add(new CheckBox(&g_Config.bMouseConfine, co->T("Confine Mouse", "Trap mouse within window/display area")))->SetEnabledPtr(&g_Config.bMouseControl); - controlsSettings->Add(new PopupSliderChoiceFloat(&g_Config.fMouseSensitivity, 0.01f, 1.0f, co->T("Mouse sensitivity"), 0.01f, screenManager(), "x"))->SetEnabledPtr(&g_Config.bMouseControl); - controlsSettings->Add(new PopupSliderChoiceFloat(&g_Config.fMouseSmoothing, 0.0f, 0.95f, co->T("Mouse smoothing"), 0.05f, screenManager(), "x"))->SetEnabledPtr(&g_Config.bMouseControl); + controlsSettings->Add(new PopupSliderChoiceFloat(&g_Config.fMouseSensitivity, 0.01f, 1.0f, 0.1f, co->T("Mouse sensitivity"), 0.01f, screenManager(), "x"))->SetEnabledPtr(&g_Config.bMouseControl); + controlsSettings->Add(new PopupSliderChoiceFloat(&g_Config.fMouseSmoothing, 0.0f, 0.95f, 0.9f, co->T("Mouse smoothing"), 0.05f, screenManager(), "x"))->SetEnabledPtr(&g_Config.bMouseControl); #endif } } @@ -945,11 +945,11 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) { if (!draw->GetBugs().Has(Draw::Bugs::RASPBERRY_SHADER_COMP_HANG)) { // We use shaders without tint capability on hardware with this driver bug. - PopupSliderChoiceFloat *tint = new PopupSliderChoiceFloat(&g_Config.fUITint, 0.0, 1.0, sy->T("Color Tint"), 0.01f, screenManager()); + PopupSliderChoiceFloat *tint = new PopupSliderChoiceFloat(&g_Config.fUITint, 0.0f, 1.0f, 0.0f, sy->T("Color Tint"), 0.01f, screenManager()); tint->SetHasDropShadow(false); tint->SetLiveUpdate(true); systemSettings->Add(tint); - PopupSliderChoiceFloat *saturation = new PopupSliderChoiceFloat(&g_Config.fUISaturation, 0.0, 2.0, sy->T("Color Saturation"), 0.01f, screenManager()); + PopupSliderChoiceFloat *saturation = new PopupSliderChoiceFloat(&g_Config.fUISaturation, 0.0f, 2.0f, 1.0f, sy->T("Color Saturation"), 0.01f, screenManager()); saturation->SetHasDropShadow(false); saturation->SetLiveUpdate(true); systemSettings->Add(saturation); @@ -1137,19 +1137,19 @@ void GameSettingsScreen::CreateVRSettings(UI::ViewGroup *vrSettings) { vrSettings->Add(new CheckBox(&g_Config.bForce72Hz, vr->T("Force 72Hz update"))); vrSettings->Add(new ItemHeader(vr->T("VR camera"))); - vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fCanvasDistance, 1.0f, 15.0f, vr->T("Distance to 2D menus and scenes"), 1.0f, screenManager(), "")); - vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fFieldOfViewPercentage, 100.0f, 200.0f, vr->T("Field of view scale"), 10.0f, screenManager(), vr->T("% of native FoV"))); - vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fHeadUpDisplayScale, 0.0f, 1.5f, vr->T("Heads-up display scale"), 0.1f, screenManager(), "")); + vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fCanvasDistance, 1.0f, 15.0f, 12.0f, vr->T("Distance to 2D menus and scenes"), 1.0f, screenManager(), "")); + vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fFieldOfViewPercentage, 100.0f, 200.0f, 100.0f, vr->T("Field of view scale"), 10.0f, screenManager(), vr->T("% of native FoV"))); + vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fHeadUpDisplayScale, 0.0f, 1.5f, 0.3f, vr->T("Heads-up display scale"), 0.1f, screenManager(), "")); vrSettings->Add(new ItemHeader(vr->T("Experts only"))); vrSettings->Add(new CheckBox(&g_Config.bManualForceVR, vr->T("Manual switching between flat screen and VR using SCREEN key"))); vrSettings->Add(new CheckBox(&g_Config.bHeadRotationEnabled, vr->T("Map HMD rotations on keys instead of VR camera"))); - PopupSliderChoiceFloat *vrHeadRotationScale = vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fHeadRotationScale, 0.1f, 10.0f, vr->T("Game camera rotation step per frame"), 0.1f, screenManager(), "°")); + PopupSliderChoiceFloat *vrHeadRotationScale = vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fHeadRotationScale, 0.1f, 10.0f, 5.0f, vr->T("Game camera rotation step per frame"), 0.1f, screenManager(), "°")); vrHeadRotationScale->SetEnabledPtr(&g_Config.bHeadRotationEnabled); CheckBox *vrHeadRotationSmoothing = vrSettings->Add(new CheckBox(&g_Config.bHeadRotationSmoothing, vr->T("Game camera uses rotation smoothing"))); vrHeadRotationSmoothing->SetEnabledPtr(&g_Config.bHeadRotationEnabled); vrSettings->Add(new CheckBox(&g_Config.bEnableMotions, vr->T("Map controller movements to keys"))); - PopupSliderChoiceFloat *vrMotions = vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fMotionLength, 0.3f, 1.0f, vr->T("Motion needed to generate action"), 0.1f, screenManager(), vr->T("m"))); + PopupSliderChoiceFloat *vrMotions = vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fMotionLength, 0.3f, 1.0f, 0.5f, vr->T("Motion needed to generate action"), 0.1f, screenManager(), vr->T("m"))); vrMotions->SetEnabledPtr(&g_Config.bEnableMotions); static const char *cameraPitchModes[] = { "Disabled", "Top view -> First person", "First person -> Top view" }; vrSettings->Add(new PopupMultiChoice(&g_Config.iCameraPitch, vr->T("Modify camera type"), cameraPitchModes, 0, 3, "", screenManager())); @@ -1830,7 +1830,7 @@ void DeveloperToolsScreen::CreateViews() { if (!keyExisted) value = setting.value; - PopupSliderChoiceFloat *settingValue = list->Add(new PopupSliderChoiceFloat(&value, setting.minValue, setting.maxValue, ps->T(setting.name), setting.step, screenManager())); + PopupSliderChoiceFloat *settingValue = list->Add(new PopupSliderChoiceFloat(&value, setting.minValue, setting.maxValue, setting.value, ps->T(setting.name), setting.step, screenManager())); settingValue->SetEnabledFunc([=] { return !g_Config.bSkipBufferEffects && enableStereo(); }); @@ -2206,8 +2206,8 @@ void GestureMappingScreen::CreateViews() { vert->Add(new PopupMultiChoice(&g_Config.iSwipeDown, mc->T("Swipe Down"), gestureButton, 0, ARRAY_SIZE(gestureButton), mc->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled); vert->Add(new PopupMultiChoice(&g_Config.iSwipeLeft, mc->T("Swipe Left"), gestureButton, 0, ARRAY_SIZE(gestureButton), mc->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled); vert->Add(new PopupMultiChoice(&g_Config.iSwipeRight, mc->T("Swipe Right"), gestureButton, 0, ARRAY_SIZE(gestureButton), mc->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled); - vert->Add(new PopupSliderChoiceFloat(&g_Config.fSwipeSensitivity, 0.01f, 1.0f, co->T("Swipe sensitivity"), 0.01f, screenManager(), "x"))->SetEnabledPtr(&g_Config.bGestureControlEnabled); - vert->Add(new PopupSliderChoiceFloat(&g_Config.fSwipeSmoothing, 0.0f, 0.95f, co->T("Swipe smoothing"), 0.05f, screenManager(), "x"))->SetEnabledPtr(&g_Config.bGestureControlEnabled); + vert->Add(new PopupSliderChoiceFloat(&g_Config.fSwipeSensitivity, 0.01f, 1.0f, 1.0f, co->T("Swipe sensitivity"), 0.01f, screenManager(), "x"))->SetEnabledPtr(&g_Config.bGestureControlEnabled); + vert->Add(new PopupSliderChoiceFloat(&g_Config.fSwipeSmoothing, 0.0f, 0.95f, 0.3f, co->T("Swipe smoothing"), 0.05f, screenManager(), "x"))->SetEnabledPtr(&g_Config.bGestureControlEnabled); vert->Add(new ItemHeader(co->T("Double tap"))); vert->Add(new PopupMultiChoice(&g_Config.iDoubleTapGesture, mc->T("Double tap button"), gestureButton, 0, ARRAY_SIZE(gestureButton), mc->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled); diff --git a/UI/TiltAnalogSettingsScreen.cpp b/UI/TiltAnalogSettingsScreen.cpp index 45509278b8..a9f7c22415 100644 --- a/UI/TiltAnalogSettingsScreen.cpp +++ b/UI/TiltAnalogSettingsScreen.cpp @@ -122,7 +122,7 @@ void TiltAnalogSettingsScreen::CreateViews() { settings->Add(new ItemHeader(co->T("Sensitivity"))); if (g_Config.iTiltInputType == 1) { - settings->Add(new PopupSliderChoiceFloat(&g_Config.fTiltAnalogDeadzoneRadius, 0.0f, 0.8f, co->T("Deadzone radius"), 0.01f, screenManager(), "/ 1.0"))->SetEnabledFunc(enabledFunc); + settings->Add(new PopupSliderChoiceFloat(&g_Config.fTiltAnalogDeadzoneRadius, 0.0f, 0.8f, 0.0f, co->T("Deadzone radius"), 0.01f, screenManager(), "/ 1.0"))->SetEnabledFunc(enabledFunc); } settings->Add(new PopupSliderChoice(&g_Config.iTiltSensitivityX, 0, 100, co->T("Tilt Sensitivity along X axis"), screenManager(), "%"))->SetEnabledFunc(enabledFunc); settings->Add(new PopupSliderChoice(&g_Config.iTiltSensitivityY, 0, 100, co->T("Tilt Sensitivity along Y axis"), screenManager(), "%"))->SetEnabledFunc(enabledFunc);