diff --git a/gflib/text.c b/gflib/text.c index 59c6e3f4e8..e2adba1cdb 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -932,8 +932,9 @@ bool32 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter) { struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields); - if (subStruct->autoScrollDelay == 49) + if (subStruct->autoScrollDelay == NUM_FRAMES_AUTO_SCROLL_DELAY) { + subStruct->autoScrollDelay = 0; return TRUE; } else @@ -943,21 +944,29 @@ bool32 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter) } } +void SetResultWithButtonPress(bool32 *result) +{ + if (JOY_NEW(A_BUTTON | B_BUTTON)) + { + *result = TRUE; + PlaySE(SE_SELECT); + } +} + bool32 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter) { bool32 result = FALSE; - if (gTextFlags.autoScroll != 0) + if (gTextFlags.autoScroll != 0 || AUTO_SCROLL_TEXT) { result = TextPrinterWaitAutoMode(textPrinter); + + if (AUTO_SCROLL_TEXT) + SetResultWithButtonPress(&result); } else { TextPrinterDrawDownArrow(textPrinter); - if (JOY_NEW(A_BUTTON | B_BUTTON)) - { - result = TRUE; - PlaySE(SE_SELECT); - } + SetResultWithButtonPress(&result); } return result; } @@ -965,17 +974,16 @@ bool32 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter) bool32 TextPrinterWait(struct TextPrinter *textPrinter) { bool32 result = FALSE; - if (gTextFlags.autoScroll != 0) + if (gTextFlags.autoScroll != 0 || AUTO_SCROLL_TEXT) { result = TextPrinterWaitAutoMode(textPrinter); + + if (AUTO_SCROLL_TEXT) + SetResultWithButtonPress(&result); } else { - if (JOY_NEW(A_BUTTON | B_BUTTON)) - { - result = TRUE; - PlaySE(SE_SELECT); - } + SetResultWithButtonPress(&result); } return result; } diff --git a/include/config/general.h b/include/config/general.h index dc39f4919a..ac338a1f50 100644 --- a/include/config/general.h +++ b/include/config/general.h @@ -72,6 +72,9 @@ #define SUMMARY_SCREEN_NATURE_COLORS TRUE // If TRUE, nature-based stat boosts and reductions will be red and blue in the summary screen. #define HQ_RANDOM TRUE // If TRUE, replaces the default RNG with an implementation of SFC32 RNG. May break code that relies on RNG. #define COMPETITIVE_PARTY_SYNTAX TRUE // If TRUE, parties are defined in "competitive syntax". +#define AUTO_SCROLL_TEXT FALSE // If TRUE, text will automatically scroll to the next line after NUM_FRAMES_AUTO_SCROLL_DELAY. Players can still press A_BUTTON or B_BUTTON to scroll on their own. +#define NUM_FRAMES_AUTO_SCROLL_DELAY 49 + // Measurement system constants to be used for UNITS #define UNITS_IMPERIAL 0 // Inches, feet, pounds