From 354da078a3dd2f6de1363ab8ca9a389cad9edcc7 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 18 Dec 2022 12:24:12 +0100 Subject: [PATCH] Fixed multiple issues where the wrong navigation sound would play. --- es-core/src/components/primary/CarouselComponent.h | 5 ++++- es-core/src/components/primary/GridComponent.h | 4 +++- es-core/src/components/primary/TextListComponent.h | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/es-core/src/components/primary/CarouselComponent.h b/es-core/src/components/primary/CarouselComponent.h index 18566bd1f..da5bb04b3 100644 --- a/es-core/src/components/primary/CarouselComponent.h +++ b/es-core/src/components/primary/CarouselComponent.h @@ -92,7 +92,10 @@ private: void onCursorChanged(const CursorState& state) override; void onScroll() override { - NavigationSounds::getInstance().playThemeNavigationSound(SYSTEMBROWSESOUND); + if (mGamelistView) + NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND); + else + NavigationSounds::getInstance().playThemeNavigationSound(SYSTEMBROWSESOUND); } void stopScrolling() override diff --git a/es-core/src/components/primary/GridComponent.h b/es-core/src/components/primary/GridComponent.h index 0f2b483c9..b4eba3d7e 100644 --- a/es-core/src/components/primary/GridComponent.h +++ b/es-core/src/components/primary/GridComponent.h @@ -76,8 +76,10 @@ public: private: void onScroll() override { - if (!NavigationSounds::getInstance().isPlayingThemeNavigationSound(SCROLLSOUND)) + if (mGamelistView) NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND); + else + NavigationSounds::getInstance().playThemeNavigationSound(SYSTEMBROWSESOUND); } void onCursorChanged(const CursorState& state) override; bool isScrolling() const override { return List::isScrolling(); } diff --git a/es-core/src/components/primary/TextListComponent.h b/es-core/src/components/primary/TextListComponent.h index 26946facb..cdb7c02bd 100644 --- a/es-core/src/components/primary/TextListComponent.h +++ b/es-core/src/components/primary/TextListComponent.h @@ -86,8 +86,11 @@ private: void onShow() override { mLoopTime = 0; } void onScroll() override { - if (!NavigationSounds::getInstance().isPlayingThemeNavigationSound(SCROLLSOUND)) + if (mGamelistView && + !NavigationSounds::getInstance().isPlayingThemeNavigationSound(SCROLLSOUND)) NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND); + else if (!mGamelistView) + NavigationSounds::getInstance().playThemeNavigationSound(SYSTEMBROWSESOUND); } void onCursorChanged(const CursorState& state) override; bool isScrolling() const override { return List::isScrolling(); } @@ -126,6 +129,7 @@ private: std::shared_ptr mFont; std::string mIndicators; std::string mCollectionIndicators; + bool mGamelistView; bool mLegacyMode; bool mFadeAbovePrimary; LetterCase mLetterCase; @@ -161,6 +165,7 @@ TextListComponent::TextListComponent() , mFont {Font::get(FONT_SIZE_MEDIUM)} , mIndicators {"symbols"} , mCollectionIndicators {"symbols"} + , mGamelistView {std::is_same_v ? true : false} , mLegacyMode {false} , mFadeAbovePrimary {false} , mLetterCase {LetterCase::NONE}