1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Setting for haptic feedback

This commit is contained in:
Michael
2023-07-08 18:47:38 +02:00
committed by GitHub
parent c786583ce8
commit ff51b8f46b
7 changed files with 36 additions and 5 deletions

View File

@@ -153,6 +153,10 @@ GeneralOptionsTab::GeneralOptionsTab()
{
setBoolSetting("video", "showfps", value);
});
addCallback("hapticFeedbackChanged", [](bool value)
{
setBoolSetting("general", "hapticFeedback", value);
});
//moved from "other" tab that is disabled for now to avoid excessible tabs with barely any content
addCallback("availableCreaturesAsDwellingChanged", [=](int value)
@@ -190,6 +194,9 @@ GeneralOptionsTab::GeneralOptionsTab()
std::shared_ptr<CToggleButton> framerateCheckbox = widget<CToggleButton>("framerateCheckbox");
framerateCheckbox->setSelected(settings["video"]["showfps"].Bool());
std::shared_ptr<CToggleButton> hapticFeedbackCheckbox = widget<CToggleButton>("hapticFeedbackCheckbox");
hapticFeedbackCheckbox->setSelected(settings["general"]["hapticFeedback"].Bool());
std::shared_ptr<CSlider> musicSlider = widget<CSlider>("musicSlider");
musicSlider->scrollTo(CCS->musich->getVolume());