From 8b18022752a29f48d1005a8287af990b8e2743db Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 17 Jan 2021 10:17:41 +0100 Subject: [PATCH] Adjusted the game description text scrolling parameters. --- es-app/src/guis/GuiScraperSearch.cpp | 8 +++++++- es-core/src/components/ScrollableContainer.cpp | 5 +++-- es-core/src/components/ScrollableContainer.h | 8 ++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/es-app/src/guis/GuiScraperSearch.cpp b/es-app/src/guis/GuiScraperSearch.cpp index 2b8cd80ad..8a93d4877 100644 --- a/es-app/src/guis/GuiScraperSearch.cpp +++ b/es-app/src/guis/GuiScraperSearch.cpp @@ -65,7 +65,13 @@ GuiScraperSearch::GuiScraperSearch( // Selected result description and container. mDescContainer = std::make_shared(mWindow); - mDescContainer->setScrollParameters(1500, 1000, 11, AUTO_WIDTH_MOD); + + // Adjust the game description text scrolling parameters depending on the search type. + if (mSearchType == NEVER_AUTO_ACCEPT) + mDescContainer->setScrollParameters(1500, 1500, 11, AUTO_WIDTH_MOD); + else + mDescContainer->setScrollParameters(4000, 1500, 11, AUTO_WIDTH_MOD); + mResultDesc = std::make_shared(mWindow, "Result desc", Font::get(FONT_SIZE_SMALL), 0x777777FF); mDescContainer->addChild(mResultDesc.get()); diff --git a/es-core/src/components/ScrollableContainer.cpp b/es-core/src/components/ScrollableContainer.cpp index f4be4a09a..654429838 100644 --- a/es-core/src/components/ScrollableContainer.cpp +++ b/es-core/src/components/ScrollableContainer.cpp @@ -60,8 +60,9 @@ void ScrollableContainer::setAutoScroll(bool autoScroll) } } -void ScrollableContainer::setScrollParameters(float autoScrollResetDelayConstant, - float autoScrollDelayConstant, int autoScrollSpeedConstant, float autoWidthModConstant) +void ScrollableContainer::setScrollParameters(float autoScrollDelayConstant, + float autoScrollResetDelayConstant, int autoScrollSpeedConstant, + float autoWidthModConstant) { mAutoScrollResetDelayConstant = autoScrollResetDelayConstant; mAutoScrollDelayConstant = autoScrollDelayConstant; diff --git a/es-core/src/components/ScrollableContainer.h b/es-core/src/components/ScrollableContainer.h index 109c03fcc..98e8aab1d 100644 --- a/es-core/src/components/ScrollableContainer.h +++ b/es-core/src/components/ScrollableContainer.h @@ -10,9 +10,9 @@ #ifndef ES_CORE_COMPONENTS_SCROLLABLE_CONTAINER_H #define ES_CORE_COMPONENTS_SCROLLABLE_CONTAINER_H -#define AUTO_SCROLL_RESET_DELAY 3500.0f // Time before resetting to top after we reach the bottom. -#define AUTO_SCROLL_DELAY 2000.0f // Time to wait before we start to scroll. -#define AUTO_SCROLL_SPEED 38 // Relative scrolling speed (lower is faster). +#define AUTO_SCROLL_DELAY 2400.0f // Time to wait before we start to scroll. +#define AUTO_SCROLL_RESET_DELAY 4000.0f // Time before resetting to top after we reach the bottom. +#define AUTO_SCROLL_SPEED 48 // Relative scrolling speed (lower is faster). #define AUTO_WIDTH_MOD 350.0f // Line width modifier to use to calculate scrolling speed. #include "GuiComponent.h" @@ -25,7 +25,7 @@ public: Vector2f getScrollPos() const; void setScrollPos(const Vector2f& pos); void setAutoScroll(bool autoScroll); - void setScrollParameters(float autoScrollResetDelayConstant, float autoScrollDelayConstant, + void setScrollParameters(float autoScrollDelayConstant, float autoScrollResetDelayConstant, int autoScrollSpeedConstant, float autoWidthModConstant) override; void reset();