Removed the playing of some navigation sounds during textlist and carousel navigation.

This commit is contained in:
Leon Styhre 2022-03-25 23:17:56 +01:00
parent 51e883cd45
commit e7aeb8e2b4
2 changed files with 12 additions and 34 deletions

View file

@ -292,34 +292,28 @@ template <typename T> bool CarouselComponent<T>::input(InputConfig* config, Inpu
}
if constexpr (std::is_same_v<T, FileData*>) {
if (config->isMappedLike("leftshoulder", input)) {
if (getCursor() == 0) {
if (!NavigationSounds::getInstance().isPlayingThemeNavigationSound(SCROLLSOUND))
NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND);
return true;
}
if (mCancelTransitionsCallback)
mCancelTransitionsCallback();
List::listInput(-10);
return true;
}
if (config->isMappedLike("rightshoulder", input)) {
if (getCursor() == static_cast<int>(mEntries.size()) - 1) {
if (!NavigationSounds::getInstance().isPlayingThemeNavigationSound(SCROLLSOUND))
NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND);
return true;
}
if (mCancelTransitionsCallback)
mCancelTransitionsCallback();
List::listInput(10);
return true;
}
if (config->isMappedLike("lefttrigger", input)) {
if (getCursor() == 0)
return true;
mTriggerJump = true;
if (mCancelTransitionsCallback)
mCancelTransitionsCallback();
return this->listFirstRow();
}
if (config->isMappedLike("righttrigger", input)) {
if (getCursor() == static_cast<int>(mEntries.size()) - 1)
return true;
mTriggerJump = true;
if (mCancelTransitionsCallback)
mCancelTransitionsCallback();

View file

@ -227,47 +227,31 @@ template <typename T> bool TextListComponent<T>::input(InputConfig* config, Inpu
return true;
}
if (config->isMappedLike("leftshoulder", input)) {
if (getCursor() == 0) {
if (!NavigationSounds::getInstance().isPlayingThemeNavigationSound(SCROLLSOUND))
NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND);
return true;
}
if (mCancelTransitionsCallback)
mCancelTransitionsCallback();
List::listInput(-10);
return true;
}
if (config->isMappedLike("rightshoulder", input)) {
if (getCursor() == static_cast<int>(mEntries.size()) - 1) {
if (!NavigationSounds::getInstance().isPlayingThemeNavigationSound(SCROLLSOUND))
NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND);
return true;
}
if (mCancelTransitionsCallback)
mCancelTransitionsCallback();
List::listInput(10);
return true;
}
if (config->isMappedLike("righttrigger", input)) {
if (getCursor() == static_cast<int>(mEntries.size()) - 1) {
if (!NavigationSounds::getInstance().isPlayingThemeNavigationSound(SCROLLSOUND))
NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND);
return true;
}
if (mCancelTransitionsCallback)
mCancelTransitionsCallback();
return this->listLastRow();
}
if (config->isMappedLike("lefttrigger", input)) {
if (getCursor() == 0) {
if (!NavigationSounds::getInstance().isPlayingThemeNavigationSound(SCROLLSOUND))
NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND);
if (getCursor() == 0)
return true;
}
if (mCancelTransitionsCallback)
mCancelTransitionsCallback();
return this->listFirstRow();
}
if (config->isMappedLike("righttrigger", input)) {
if (getCursor() == static_cast<int>(mEntries.size()) - 1)
return true;
if (mCancelTransitionsCallback)
mCancelTransitionsCallback();
return this->listLastRow();
}
}
else {
if (config->isMappedLike("up", input) || config->isMappedLike("down", input) ||