Add AUTO_SCROLL_TEXT and NUM_FRAMES_AUTO_SCROLL_DELAY (#5054)
* Added AUTO_SCROLL_TEXT * Moved NUM_FRAMES_AUTO_SCROLL_DELAY * Moved NUM_FRAMES_AUTO_SCROLL_DELAY per https://github.com/rh-hideout/pokeemerald-expansion/pull/5054/files#r1698268265 * Apply suggestions from https://github.com/rh-hideout/pokeemerald-expansion/pull/5054/files#r1698268524 Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Added ability to skip text with button press per https://github.com/rh-hideout/pokeemerald-expansion/pull/5054\#issuecomment-2267100771 * Update gflib/text.h per https://github.com/rh-hideout/pokeemerald-expansion/pull/5054#issuecomment-2274402891 * Update text.h * Fixed alignment per https://github.com/rh-hideout/pokeemerald-expansion/pull/5054/files\#r1711780606 * Moved NUM_FRAMES_AUTO_SCROLL_DELAY * Update gflib/text.c Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> --------- Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
This commit is contained in:
parent
5cb1be7e5c
commit
fee26e29f5
2 changed files with 24 additions and 13 deletions
34
gflib/text.c
34
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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue