Document help system
This commit is contained in:
+14
-14
@@ -34,7 +34,7 @@ void SetHelpContextDontCheckBattle(u8);
|
||||
void SetHelpContextForMap(void);
|
||||
void SetHelpContext(u8);
|
||||
bool8 HelpSystem_UpdateHasntSeenIntro(void);
|
||||
bool8 sub_812B45C(void);
|
||||
bool8 HelpSystem_IsSinglePlayer(void);
|
||||
void HelpSystem_Disable(void);
|
||||
void HelpSystem_Enable(void);
|
||||
void HelpSystem_EnableToggleWithRButton(void);
|
||||
@@ -50,7 +50,7 @@ void HelpSystem_PrintTopicLabel(void);
|
||||
bool8 HelpMenuSubroutine_HelpItemPrint(struct HelpSystemListMenu * helpListMenu, struct ListMenuItem * listMenuItemsBuffer);
|
||||
bool8 HelpMenuSubroutine_ReturnFromHelpItem(struct HelpSystemListMenu * helpListMenu, struct ListMenuItem * listMenuItemsBuffer);
|
||||
bool8 HelpMenuSubroutine_HelpItemWaitButton(struct HelpSystemListMenu * helpListMenu, struct ListMenuItem * listMenuItemsBuffer);
|
||||
bool8 sub_812BF88(void);
|
||||
bool8 GetHelpSystemMenuLevel(void);
|
||||
|
||||
// help_system
|
||||
bool8 RunHelpSystemCallback(void);
|
||||
@@ -63,17 +63,17 @@ void RestoreGPURegs(void);
|
||||
void RestoreMapTiles(void);
|
||||
void RestoreMapTextColors(void);
|
||||
void CommitTilemap(void);
|
||||
void sub_813BCF4(void);
|
||||
void sub_813BD14(u8);
|
||||
void sub_813BD5C(u8);
|
||||
void sub_813BDA4(u8);
|
||||
void sub_813BDE8(u8);
|
||||
void sub_813BE30(u8);
|
||||
void sub_813BE78(u8);
|
||||
void sub_813BEE4(u8);
|
||||
void sub_813BF50(u8);
|
||||
void sub_813BFC0(u8);
|
||||
void sub_813C004(u8, u8);
|
||||
void HS_BufferFillMapWithTile1FF(void);
|
||||
void HS_ShowOrHideWordHELPinTopLeft(u8 mode);
|
||||
void HS_ShowOrHideControlsGuideInTopRight(u8 mode);
|
||||
void HS_ShowOrHideMainWindowText(u8 mode);
|
||||
void HS_SetMainWindowBgBrightness(u8 mode);
|
||||
void HS_ShowOrHideToplevelTooltipWindow(u8 mode);
|
||||
void HS_ShowOrHideHeaderAndFooterLines_Lighter(u8 mode);
|
||||
void HS_ShowOrHideHeaderAndFooterLines_Darker(u8 mode);
|
||||
void HS_ShowOrHideVerticalBlackBarsAlongSides(u8 mode);
|
||||
void HS_ShowOrHideHeaderLine_Darker_FooterStyle(u8 mode);
|
||||
void HS_ShowOrHideScrollArrows(u8 which, u8 mode);
|
||||
void HelpSystem_PrintTextRightAlign_Row52(const u8 *str);
|
||||
void HelpSystem_PrintTextAt(const u8 *, u8, u8);
|
||||
void HelpSystem_PrintTwoStrings(const u8 *a0, const u8 *a1);
|
||||
@@ -83,7 +83,7 @@ void HelpSystem_FillPanel1(void);
|
||||
void HelpSystem_InitListMenuController(struct HelpSystemListMenu *, u8, u8);
|
||||
void HelpSystem_SetInputDelay(u8);
|
||||
s32 HelpSystem_GetMenuInput(void);
|
||||
void sub_813C75C(void);
|
||||
void HS_UpdateMenuScrollArrows(void);
|
||||
|
||||
void DecompressAndRenderGlyph(u8 font, u16 glyph, struct Bitmap *srcBlit, struct Bitmap *destBlit, u8 *destBuffer, u8 x, u8 y, u8 width, u8 height);
|
||||
void HelpSystem_PrintText_Row61(const u8 * str);
|
||||
|
||||
+2
-2
@@ -46,7 +46,7 @@ void SE12PanpotControl(s8 pan);
|
||||
bool8 IsSEPlaying(void);
|
||||
bool8 IsBGMPlaying(void);
|
||||
bool8 IsSpecialSEPlaying(void);
|
||||
void sub_8072474(u16 volume);
|
||||
void sub_807249C(void);
|
||||
void SetBGMVolume_SuppressHelpSystemReduction(u16 volume);
|
||||
void BGMVolumeMax_EnableHelySystemReduction(void);
|
||||
|
||||
#endif // GUARD_SOUND_H
|
||||
|
||||
+49
-46
@@ -26,7 +26,7 @@ struct HelpSystemVideoState
|
||||
};
|
||||
|
||||
static EWRAM_DATA u8 sMapTilesBackup[BG_CHAR_SIZE] = {0};
|
||||
EWRAM_DATA u8 gUnknown_203F174 = 0;
|
||||
EWRAM_DATA u8 gDisableHelpSystemVolumeReduce = 0;
|
||||
EWRAM_DATA bool8 gHelpSystemToggleWithRButtonDisabled = FALSE;
|
||||
static EWRAM_DATA u8 sDelayTimer = 0;
|
||||
static EWRAM_DATA u8 sInHelpSystem = 0;
|
||||
@@ -51,7 +51,7 @@ u8 RunHelpSystemCallback(void)
|
||||
return 0;
|
||||
if (JOY_NEW(L_BUTTON | R_BUTTON))
|
||||
{
|
||||
if (!sub_812B45C() || !gHelpSystemEnabled)
|
||||
if (!HelpSystem_IsSinglePlayer() || !gHelpSystemEnabled)
|
||||
{
|
||||
PlaySE(SE_HELP_ERROR);
|
||||
return 0;
|
||||
@@ -59,7 +59,7 @@ u8 RunHelpSystemCallback(void)
|
||||
m4aMPlayStop(&gMPlayInfo_SE1);
|
||||
m4aMPlayStop(&gMPlayInfo_SE2);
|
||||
PlaySE(SE_HELP_OPEN);
|
||||
if (!gUnknown_203F174)
|
||||
if (!gDisableHelpSystemVolumeReduce)
|
||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x80);
|
||||
SaveCallbacks();
|
||||
sInHelpSystem = 1;
|
||||
@@ -81,17 +81,17 @@ u8 RunHelpSystemCallback(void)
|
||||
sVideoState.state = 3;
|
||||
break;
|
||||
case 3:
|
||||
sub_813BCF4();
|
||||
HS_BufferFillMapWithTile1FF();
|
||||
HelpSystem_FillPanel3();
|
||||
HelpSystem_FillPanel2();
|
||||
HelpSystem_PrintText_Row61(gString_Help);
|
||||
sub_813BD14(1);
|
||||
HS_ShowOrHideWordHELPinTopLeft(1);
|
||||
if (HelpSystem_UpdateHasntSeenIntro() == TRUE)
|
||||
HelpSystemSubroutine_PrintWelcomeMessage(&gHelpSystemListMenu, gHelpSystemListMenuItems);
|
||||
else
|
||||
HelpSystemSubroutine_WelcomeEndGotoMenu(&gHelpSystemListMenu, gHelpSystemListMenuItems);
|
||||
sub_813BE78(1);
|
||||
sub_813BF50(1);
|
||||
HS_ShowOrHideHeaderAndFooterLines_Lighter(1);
|
||||
HS_ShowOrHideVerticalBlackBarsAlongSides(1);
|
||||
CommitTilemap();
|
||||
sVideoState.state = 4;
|
||||
break;
|
||||
@@ -121,7 +121,7 @@ u8 RunHelpSystemCallback(void)
|
||||
sVideoState.state = 7;
|
||||
break;
|
||||
case 7:
|
||||
if (!gUnknown_203F174)
|
||||
if (!gDisableHelpSystemVolumeReduce)
|
||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
||||
RestoreMapTextColors();
|
||||
RestoreGPURegs();
|
||||
@@ -223,12 +223,12 @@ void HS_DrawBgTilemapRect(u16 baseTile, u8 left, u8 top, u8 width, u8 height, u1
|
||||
CommitTilemap();
|
||||
}
|
||||
|
||||
void sub_813BCF4(void)
|
||||
void HS_BufferFillMapWithTile1FF(void)
|
||||
{
|
||||
HS_DrawBgTilemapRect(0x1FF, 0, 0, 30, 20, 0);
|
||||
}
|
||||
|
||||
void sub_813BD14(u8 mode)
|
||||
void HS_ShowOrHideWordHELPinTopLeft(u8 mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
@@ -241,7 +241,7 @@ void sub_813BD14(u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_813BD5C(u8 mode)
|
||||
void HS_ShowOrHideControlsGuideInTopRight(u8 mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
@@ -254,7 +254,7 @@ void sub_813BD5C(u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_813BDA4(u8 mode)
|
||||
void HS_ShowOrHideMainWindowText(u8 mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
@@ -267,20 +267,22 @@ void sub_813BDA4(u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_813BDE8(u8 mode)
|
||||
void HS_SetMainWindowBgBrightness(u8 mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case 0:
|
||||
// Brighter
|
||||
HS_DrawBgTilemapRect(0x1FF, 1, 3, 28, 16, 0);
|
||||
break;
|
||||
case 1:
|
||||
// Darker
|
||||
HS_DrawBgTilemapRect(0x1FA, 1, 3, 28, 17, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_813BE30(u8 mode)
|
||||
void HS_ShowOrHideToplevelTooltipWindow(u8 mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
@@ -293,7 +295,7 @@ void sub_813BE30(u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_813BE78(u8 mode)
|
||||
void HS_ShowOrHideHeaderAndFooterLines_Lighter(u8 mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
@@ -308,7 +310,7 @@ void sub_813BE78(u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_813BEE4(u8 mode)
|
||||
void HS_ShowOrHideHeaderAndFooterLines_Darker(u8 mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
@@ -323,7 +325,7 @@ void sub_813BEE4(u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_813BF50(u8 mode)
|
||||
void HS_ShowOrHideVerticalBlackBarsAlongSides(u8 mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
@@ -338,7 +340,7 @@ void sub_813BF50(u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_813BFC0(u8 mode)
|
||||
void HS_ShowOrHideHeaderLine_Darker_FooterStyle(u8 mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
@@ -351,7 +353,7 @@ void sub_813BFC0(u8 mode)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_813C004(u8 a0, u8 mode)
|
||||
void HS_ShowOrHideScrollArrows(u8 which, u8 mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
@@ -360,9 +362,9 @@ void sub_813C004(u8 a0, u8 mode)
|
||||
HS_DrawBgTilemapRect(0x1FF, 28, 18, 1, 1, 0);
|
||||
break;
|
||||
case 1:
|
||||
if (a0 == 0)
|
||||
if (which == 0) // top
|
||||
HS_DrawBgTilemapRect(0x1FE, 28, 3, 1, 1, 0);
|
||||
else
|
||||
else // bottom
|
||||
HS_DrawBgTilemapRect(0x1FD, 28, 18, 1, 1, 0);
|
||||
break;
|
||||
}
|
||||
@@ -635,7 +637,7 @@ void HelpSystem_InitListMenuController(struct HelpSystemListMenu * a0, u8 a1, u8
|
||||
gHelpSystemListMenu.state = 0;
|
||||
if (gHelpSystemListMenu.sub.totalItems < gHelpSystemListMenu.sub.maxShowed)
|
||||
gHelpSystemListMenu.sub.maxShowed = gHelpSystemListMenu.sub.totalItems;
|
||||
sub_813BDA4(0);
|
||||
HS_ShowOrHideMainWindowText(0);
|
||||
HelpSystem_FillPanel1();
|
||||
PrintListMenuItems();
|
||||
PlaceListMenuCursor();
|
||||
@@ -695,23 +697,24 @@ s32 HelpSystem_GetMenuInput(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void sub_813C75C(void)
|
||||
void HS_UpdateMenuScrollArrows(void)
|
||||
{
|
||||
u8 r6 = gHelpSystemListMenu.sub.totalItems - 7;
|
||||
u8 topItemIdx = gHelpSystemListMenu.sub.totalItems - 7;
|
||||
if (gHelpSystemListMenu.sub.totalItems > 7)
|
||||
{
|
||||
s32 r4 = gHelpSystemListMenu.itemsAbove + gHelpSystemListMenu.cursorPos;
|
||||
sub_813C004(0, 0);
|
||||
if (r4 == 0)
|
||||
sub_813C004(1, 1);
|
||||
s32 cursorPos = gHelpSystemListMenu.itemsAbove + gHelpSystemListMenu.cursorPos;
|
||||
HS_ShowOrHideScrollArrows(0, 0); // Hide both
|
||||
if (cursorPos == 0)
|
||||
HS_ShowOrHideScrollArrows(1, 1); // Show bottom
|
||||
else if (gHelpSystemListMenu.itemsAbove == 0 && gHelpSystemListMenu.cursorPos != 0)
|
||||
sub_813C004(1, 1);
|
||||
else if (gHelpSystemListMenu.itemsAbove == r6)
|
||||
sub_813C004(0, 1);
|
||||
HS_ShowOrHideScrollArrows(1, 1); // Show bottom
|
||||
else if (gHelpSystemListMenu.itemsAbove == topItemIdx)
|
||||
HS_ShowOrHideScrollArrows(0, 1); // Show top
|
||||
else if (gHelpSystemListMenu.itemsAbove != 0)
|
||||
{
|
||||
sub_813C004(0, 1);
|
||||
sub_813C004(1, 1);
|
||||
// Show both
|
||||
HS_ShowOrHideScrollArrows(0, 1);
|
||||
HS_ShowOrHideScrollArrows(1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -739,7 +742,7 @@ void PlaceListMenuCursor(void)
|
||||
HelpSystem_PrintTextAt(gText_SelectorArrow2, x, y);
|
||||
}
|
||||
|
||||
void sub_813C860(u8 i)
|
||||
void HS_RemoveSelectionCursorAt(u8 i)
|
||||
{
|
||||
u8 glyphHeight = GetFontAttribute(2, FONTATTR_MAX_LETTER_HEIGHT) + 1;
|
||||
u8 x = gHelpSystemListMenu.sub.left;
|
||||
@@ -749,13 +752,13 @@ void sub_813C860(u8 i)
|
||||
|
||||
u8 TryMoveCursor1(u8 dirn)
|
||||
{
|
||||
u16 r4;
|
||||
u16 midPoint;
|
||||
if (dirn == 0)
|
||||
{
|
||||
if (gHelpSystemListMenu.sub.maxShowed == 1)
|
||||
r4 = 0;
|
||||
midPoint = 0;
|
||||
else
|
||||
r4 = gHelpSystemListMenu.sub.maxShowed - (gHelpSystemListMenu.sub.maxShowed / 2 + (gHelpSystemListMenu.sub.maxShowed & 1)) - 1;
|
||||
midPoint = gHelpSystemListMenu.sub.maxShowed - (gHelpSystemListMenu.sub.maxShowed / 2 + (gHelpSystemListMenu.sub.maxShowed & 1)) - 1;
|
||||
if (gHelpSystemListMenu.itemsAbove == 0)
|
||||
{
|
||||
if (gHelpSystemListMenu.cursorPos != 0)
|
||||
@@ -766,7 +769,7 @@ u8 TryMoveCursor1(u8 dirn)
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
if (gHelpSystemListMenu.cursorPos > r4)
|
||||
if (gHelpSystemListMenu.cursorPos > midPoint)
|
||||
{
|
||||
gHelpSystemListMenu.cursorPos--;
|
||||
return 1;
|
||||
@@ -780,9 +783,9 @@ u8 TryMoveCursor1(u8 dirn)
|
||||
else
|
||||
{
|
||||
if (gHelpSystemListMenu.sub.maxShowed == 1)
|
||||
r4 = 0;
|
||||
midPoint = 0;
|
||||
else
|
||||
r4 = gHelpSystemListMenu.sub.maxShowed / 2 + (gHelpSystemListMenu.sub.maxShowed & 1);
|
||||
midPoint = gHelpSystemListMenu.sub.maxShowed / 2 + (gHelpSystemListMenu.sub.maxShowed & 1);
|
||||
if (gHelpSystemListMenu.itemsAbove == gHelpSystemListMenu.sub.totalItems - gHelpSystemListMenu.sub.maxShowed)
|
||||
{
|
||||
if (gHelpSystemListMenu.cursorPos < gHelpSystemListMenu.sub.maxShowed - 1)
|
||||
@@ -793,7 +796,7 @@ u8 TryMoveCursor1(u8 dirn)
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else if (gHelpSystemListMenu.cursorPos < r4)
|
||||
else if (gHelpSystemListMenu.cursorPos < midPoint)
|
||||
{
|
||||
gHelpSystemListMenu.cursorPos++;
|
||||
return 1;
|
||||
@@ -822,29 +825,29 @@ bool8 MoveCursor(u8 by, u8 dirn)
|
||||
return TRUE;
|
||||
case 1:
|
||||
// changed cursorPos only
|
||||
sub_813C860(r7);
|
||||
HS_RemoveSelectionCursorAt(r7);
|
||||
PlaceListMenuCursor();
|
||||
CommitTilemap();
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
// changed itemsAbove
|
||||
if (sub_812BF88() == TRUE)
|
||||
if (GetHelpSystemMenuLevel() == 1)
|
||||
{
|
||||
HelpSystem_SetInputDelay(2);
|
||||
HelpSystem_FillPanel1();
|
||||
PrintListMenuItems();
|
||||
PlaceListMenuCursor();
|
||||
HelpSystem_PrintTopicLabel();
|
||||
sub_813C75C();
|
||||
HS_UpdateMenuScrollArrows();
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_813BDA4(0);
|
||||
HS_ShowOrHideMainWindowText(0);
|
||||
HelpSystem_FillPanel1();
|
||||
PrintListMenuItems();
|
||||
PlaceListMenuCursor();
|
||||
sub_813BDA4(1);
|
||||
HS_ShowOrHideMainWindowText(1);
|
||||
}
|
||||
CommitTilemap();
|
||||
break;
|
||||
|
||||
+86
-69
@@ -16,10 +16,42 @@
|
||||
#include "constants/maps.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
#define HELP_NONE 0
|
||||
#define HELP_END 0xFF
|
||||
|
||||
// Help Main Topics
|
||||
enum HelpSystemTopics
|
||||
{
|
||||
TOPIC_WHAT_TO_DO,
|
||||
TOPIC_HOW_TO_DO,
|
||||
TOPIC_TERMS,
|
||||
TOPIC_ABOUT_GAME,
|
||||
TOPIC_TYPE_MATCHUP,
|
||||
TOPIC_EXIT,
|
||||
TOPIC_COUNT
|
||||
};
|
||||
|
||||
static EWRAM_DATA u16 sHelpSystemContextId = 0;
|
||||
static EWRAM_DATA u8 sSeenHelpSystemIntro = 0;
|
||||
|
||||
u8 gHelpSystemState[4];
|
||||
struct HelpSystemState
|
||||
{
|
||||
// 0: Top level
|
||||
// 1: Submenu
|
||||
// 2: Help content
|
||||
u8 level;
|
||||
|
||||
// enum HelpSystemTopics
|
||||
u8 topic;
|
||||
|
||||
// Where the player's cursor was at top level
|
||||
u8 scrollMain;
|
||||
|
||||
// Where the player's cursor was at submenu
|
||||
u8 scrollSub;
|
||||
};
|
||||
|
||||
struct HelpSystemState gHelpSystemState;
|
||||
u16 gHelpContextIdBackup;
|
||||
|
||||
static bool32 IsCurrentMapInArray(const u16 * mapIdxs);
|
||||
@@ -34,21 +66,6 @@ static void PrintTextOnPanel2Row52RightAlign(const u8 *);
|
||||
static void ResetHelpSystemCursor(struct HelpSystemListMenu * a0);
|
||||
static void PrintHelpSystemTopicMouseoverDescription(struct HelpSystemListMenu * a0, struct ListMenuItem * a1);
|
||||
|
||||
#define HELP_NONE 0
|
||||
#define HELP_END 0xFF
|
||||
|
||||
// Help Main Topics
|
||||
enum
|
||||
{
|
||||
TOPIC_WHAT_TO_DO,
|
||||
TOPIC_HOW_TO_DO,
|
||||
TOPIC_TERMS,
|
||||
TOPIC_ABOUT_GAME,
|
||||
TOPIC_TYPE_MATCHUP,
|
||||
TOPIC_EXIT,
|
||||
TOPIC_COUNT
|
||||
};
|
||||
|
||||
static const u8 *const sHelpSystemTopicPtrs[TOPIC_COUNT] = {
|
||||
[TOPIC_WHAT_TO_DO] = Help_Text_WhatShouldIDo,
|
||||
[TOPIC_HOW_TO_DO] = Help_Text_HowDoIDoThis,
|
||||
@@ -1878,7 +1895,7 @@ bool8 HelpSystem_UpdateHasntSeenIntro(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_812B45C(void)
|
||||
bool8 HelpSystem_IsSinglePlayer(void)
|
||||
{
|
||||
if (gReceivedRemoteLinkPlayers == TRUE)
|
||||
return FALSE;
|
||||
@@ -1923,10 +1940,10 @@ static void BuildAndPrintMainTopicsListMenu(struct HelpSystemListMenu * helpList
|
||||
ResetHelpSystemListMenu(helpListMenu, listMenuItemsBuffer);
|
||||
BuildMainTopicsListAndMoveToH00(helpListMenu, listMenuItemsBuffer);
|
||||
PrintTextOnPanel2Row52RightAlign(gUnknown_841DFAC);
|
||||
HelpSystem_InitListMenuController(helpListMenu, 0, gHelpSystemState[2]);
|
||||
HelpSystem_InitListMenuController(helpListMenu, 0, gHelpSystemState.scrollMain);
|
||||
PrintHelpSystemTopicMouseoverDescription(helpListMenu, listMenuItemsBuffer);
|
||||
sub_813BDA4(1);
|
||||
sub_813BD5C(1);
|
||||
HS_ShowOrHideMainWindowText(1);
|
||||
HS_ShowOrHideControlsGuideInTopRight(1);
|
||||
}
|
||||
|
||||
static void BuildMainTopicsListAndMoveToH00(struct HelpSystemListMenu * helpListMenu, struct ListMenuItem * listMenuItemsBuffer)
|
||||
@@ -1950,34 +1967,34 @@ static void BuildMainTopicsListAndMoveToH00(struct HelpSystemListMenu * helpList
|
||||
|
||||
static void BuildAndPrintSubmenuList(struct HelpSystemListMenu * helpListMenu, struct ListMenuItem * listMenuItemsBuffer)
|
||||
{
|
||||
sub_813BDE8(0);
|
||||
sub_813BFC0(0);
|
||||
sub_813BE78(1);
|
||||
HS_SetMainWindowBgBrightness(0);
|
||||
HS_ShowOrHideHeaderLine_Darker_FooterStyle(0);
|
||||
HS_ShowOrHideHeaderAndFooterLines_Lighter(1);
|
||||
ResetHelpSystemListMenu(helpListMenu, listMenuItemsBuffer);
|
||||
SetHelpSystemSubmenuItems(helpListMenu, listMenuItemsBuffer);
|
||||
PrintTextOnPanel2Row52RightAlign(gUnknown_841DFC9);
|
||||
HelpSystem_InitListMenuController(helpListMenu, helpListMenu->itemsAbove, helpListMenu->cursorPos);
|
||||
HelpSystem_PrintTextAt(sHelpSystemTopicPtrs[gHelpSystemState[1]], 0, 0);
|
||||
sub_813BDA4(1);
|
||||
sub_813BD5C(1);
|
||||
HelpSystem_PrintTextAt(sHelpSystemTopicPtrs[gHelpSystemState.topic], 0, 0);
|
||||
HS_ShowOrHideMainWindowText(1);
|
||||
HS_ShowOrHideControlsGuideInTopRight(1);
|
||||
}
|
||||
|
||||
static void SetHelpSystemSubmenuItems(struct HelpSystemListMenu * helpListMenu, struct ListMenuItem * listMenuItemsBuffer)
|
||||
{
|
||||
u8 totalItems = 0;
|
||||
const u8 * submenuItems = sHelpSystemSubmenuItemLists[sHelpSystemContextId * 5 + gHelpSystemState[1]]; // accessing as 2D array
|
||||
const u8 * submenuItems = sHelpSystemSubmenuItemLists[sHelpSystemContextId * 5 + gHelpSystemState.topic]; // accessing as 2D array
|
||||
u8 i;
|
||||
for (i = 0; submenuItems[i] != HELP_END; i++)
|
||||
{
|
||||
if (IsHelpSystemSubmenuEnabled(submenuItems[i]) == TRUE)
|
||||
{
|
||||
if (gHelpSystemState[1] == TOPIC_WHAT_TO_DO)
|
||||
if (gHelpSystemState.topic == TOPIC_WHAT_TO_DO)
|
||||
listMenuItemsBuffer[totalItems].label = sHelpSystemSpecializedQuestionTextPtrs[submenuItems[i]];
|
||||
else if (gHelpSystemState[1] == TOPIC_HOW_TO_DO)
|
||||
else if (gHelpSystemState.topic == TOPIC_HOW_TO_DO)
|
||||
listMenuItemsBuffer[totalItems].label = sHelpSystemMenuTopicTextPtrs[submenuItems[i]];
|
||||
else if (gHelpSystemState[1] == TOPIC_TERMS)
|
||||
else if (gHelpSystemState.topic == TOPIC_TERMS)
|
||||
listMenuItemsBuffer[totalItems].label = sHelpSystemTermTextPtrs[submenuItems[i]];
|
||||
else if (gHelpSystemState[1] == TOPIC_ABOUT_GAME)
|
||||
else if (gHelpSystemState.topic == TOPIC_ABOUT_GAME)
|
||||
listMenuItemsBuffer[totalItems].label = sHelpSystemGeneralTopicTextPtrs[submenuItems[i]];
|
||||
else // TOPIC_TYPE_MATCHUP
|
||||
listMenuItemsBuffer[totalItems].label = sHelpSystemTypeMatchupTextPtrs[submenuItems[i]];
|
||||
@@ -2005,7 +2022,7 @@ static void SetHelpSystemSubmenuItems(struct HelpSystemListMenu * helpListMenu,
|
||||
|
||||
static bool8 HelpSystem_ShouldShowBasicTerms(void)
|
||||
{
|
||||
if (FlagGet(FLAG_DEFEATED_BROCK) == TRUE && gHelpSystemState[1] == TOPIC_TERMS)
|
||||
if (FlagGet(FLAG_DEFEATED_BROCK) == TRUE && gHelpSystemState.topic == TOPIC_TERMS)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2014,7 +2031,7 @@ static bool8 IsHelpSystemSubmenuEnabled(u8 id)
|
||||
{
|
||||
u8 i = 0;
|
||||
|
||||
if (gHelpSystemState[1] == TOPIC_WHAT_TO_DO)
|
||||
if (gHelpSystemState.topic == TOPIC_WHAT_TO_DO)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
@@ -2076,7 +2093,7 @@ static bool8 IsHelpSystemSubmenuEnabled(u8 id)
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
if (gHelpSystemState[1] == TOPIC_HOW_TO_DO)
|
||||
if (gHelpSystemState.topic == TOPIC_HOW_TO_DO)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
@@ -2143,7 +2160,7 @@ static bool8 IsHelpSystemSubmenuEnabled(u8 id)
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
if (gHelpSystemState[1] == TOPIC_TERMS)
|
||||
if (gHelpSystemState.topic == TOPIC_TERMS)
|
||||
{
|
||||
if (HelpSystem_ShouldShowBasicTerms() == TRUE)
|
||||
{
|
||||
@@ -2203,7 +2220,7 @@ static bool8 IsHelpSystemSubmenuEnabled(u8 id)
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
if (gHelpSystemState[1] == TOPIC_ABOUT_GAME)
|
||||
if (gHelpSystemState.topic == TOPIC_ABOUT_GAME)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
@@ -2214,7 +2231,7 @@ static bool8 IsHelpSystemSubmenuEnabled(u8 id)
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
if (gHelpSystemState[1] == TOPIC_TYPE_MATCHUP)
|
||||
if (gHelpSystemState.topic == TOPIC_TYPE_MATCHUP)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2273,8 +2290,8 @@ bool8 HelpSystemSubroutine_PrintWelcomeMessage(struct HelpSystemListMenu * helpL
|
||||
{
|
||||
PrintTextOnPanel2Row52RightAlign(gUnknown_841DFA5);
|
||||
PrintWelcomeMessageOnPanel1();
|
||||
sub_813BDA4(1);
|
||||
sub_813BD5C(1);
|
||||
HS_ShowOrHideMainWindowText(1);
|
||||
HS_ShowOrHideControlsGuideInTopRight(1);
|
||||
helpListMenu->state = 9;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2291,7 +2308,7 @@ bool8 HelpSystemSubroutine_WelcomeWaitButton(struct HelpSystemListMenu * helpLis
|
||||
|
||||
bool8 HelpSystemSubroutine_WelcomeEndGotoMenu(struct HelpSystemListMenu * helpListMenu, struct ListMenuItem * listMenuItemsBuffer)
|
||||
{
|
||||
gHelpSystemState[2] = 0;
|
||||
gHelpSystemState.scrollMain = 0;
|
||||
ResetHelpSystemCursor(helpListMenu);
|
||||
BuildAndPrintMainTopicsListMenu(helpListMenu, listMenuItemsBuffer);
|
||||
helpListMenu->state = 0;
|
||||
@@ -2314,7 +2331,7 @@ bool8 HelpSystemSubroutine_MenuInputHandlerMain(struct HelpSystemListMenu * help
|
||||
case -1:
|
||||
break;
|
||||
default:
|
||||
gHelpSystemState[1] = input;
|
||||
gHelpSystemState.topic = input;
|
||||
helpListMenu->state = 1;
|
||||
break;
|
||||
}
|
||||
@@ -2323,11 +2340,11 @@ bool8 HelpSystemSubroutine_MenuInputHandlerMain(struct HelpSystemListMenu * help
|
||||
|
||||
bool8 HelpMenuSubroutine_InitSubmenu(struct HelpSystemListMenu * helpListMenu, struct ListMenuItem * listMenuItemsBuffer)
|
||||
{
|
||||
gHelpSystemState[0] = 1;
|
||||
gHelpSystemState[2] = helpListMenu->cursorPos;
|
||||
gHelpSystemState.level = 1;
|
||||
gHelpSystemState.scrollMain = helpListMenu->cursorPos;
|
||||
ResetHelpSystemCursor(helpListMenu);
|
||||
BuildAndPrintSubmenuList(helpListMenu, listMenuItemsBuffer);
|
||||
sub_813C75C();
|
||||
HS_UpdateMenuScrollArrows();
|
||||
HelpSystem_SetInputDelay(2);
|
||||
helpListMenu->state = 3;
|
||||
return TRUE;
|
||||
@@ -2335,9 +2352,9 @@ bool8 HelpMenuSubroutine_InitSubmenu(struct HelpSystemListMenu * helpListMenu, s
|
||||
|
||||
bool8 HelpMenuSubroutine_ReturnFromSubmenu(struct HelpSystemListMenu * helpListMenu, struct ListMenuItem * listMenuItemsBuffer)
|
||||
{
|
||||
sub_813C004(0, 0);
|
||||
sub_813C004(1, 0);
|
||||
gHelpSystemState[0] = 0;
|
||||
HS_ShowOrHideScrollArrows(0, 0);
|
||||
HS_ShowOrHideScrollArrows(1, 0);
|
||||
gHelpSystemState.level = 0;
|
||||
BuildAndPrintMainTopicsListMenu(helpListMenu, listMenuItemsBuffer);
|
||||
helpListMenu->state = 0;
|
||||
return TRUE;
|
||||
@@ -2359,7 +2376,7 @@ bool8 HelpMenuSubroutine_SubmenuInputHandler(struct HelpSystemListMenu * helpLis
|
||||
case -1:
|
||||
break;
|
||||
default:
|
||||
gHelpSystemState[3] = input;
|
||||
gHelpSystemState.scrollSub = input;
|
||||
helpListMenu->state = 4;
|
||||
break;
|
||||
}
|
||||
@@ -2368,49 +2385,49 @@ bool8 HelpMenuSubroutine_SubmenuInputHandler(struct HelpSystemListMenu * helpLis
|
||||
|
||||
void HelpSystem_PrintTopicLabel(void)
|
||||
{
|
||||
HelpSystem_PrintTextAt(sHelpSystemTopicPtrs[gHelpSystemState[1]], 0, 0);
|
||||
HelpSystem_PrintTextAt(sHelpSystemTopicPtrs[gHelpSystemState.topic], 0, 0);
|
||||
}
|
||||
|
||||
bool8 HelpMenuSubroutine_HelpItemPrint(struct HelpSystemListMenu * helpListMenu, struct ListMenuItem * listMenuItemsBuffer)
|
||||
{
|
||||
gHelpSystemState[0] = 2;
|
||||
sub_813BDA4(0);
|
||||
gHelpSystemState.level = 2;
|
||||
HS_ShowOrHideMainWindowText(0);
|
||||
HelpSystem_FillPanel1();
|
||||
PrintTextOnPanel2Row52RightAlign(gUnknown_841DFBE);
|
||||
sub_813BDE8(1);
|
||||
sub_813BEE4(1);
|
||||
HS_SetMainWindowBgBrightness(1);
|
||||
HS_ShowOrHideHeaderAndFooterLines_Darker(1);
|
||||
|
||||
if (gHelpSystemState[1] == TOPIC_WHAT_TO_DO)
|
||||
if (gHelpSystemState.topic == TOPIC_WHAT_TO_DO)
|
||||
{
|
||||
HelpSystem_PrintTwoStrings(sHelpSystemSpecializedQuestionTextPtrs[gHelpSystemState[3]], sHelpSystemSpecializedAnswerTextPtrs[gHelpSystemState[3]]);
|
||||
HelpSystem_PrintTwoStrings(sHelpSystemSpecializedQuestionTextPtrs[gHelpSystemState.scrollSub], sHelpSystemSpecializedAnswerTextPtrs[gHelpSystemState.scrollSub]);
|
||||
}
|
||||
else if (gHelpSystemState[1] == TOPIC_HOW_TO_DO)
|
||||
else if (gHelpSystemState.topic == TOPIC_HOW_TO_DO)
|
||||
{
|
||||
HelpSystem_PrintTwoStrings(sHelpSystemMenuTopicTextPtrs[gHelpSystemState[3]], sHelpSystemHowToUseMenuTextPtrs[gHelpSystemState[3]]);
|
||||
HelpSystem_PrintTwoStrings(sHelpSystemMenuTopicTextPtrs[gHelpSystemState.scrollSub], sHelpSystemHowToUseMenuTextPtrs[gHelpSystemState.scrollSub]);
|
||||
}
|
||||
else if (gHelpSystemState[1] == TOPIC_TERMS)
|
||||
else if (gHelpSystemState.topic == TOPIC_TERMS)
|
||||
{
|
||||
HelpSystem_PrintTwoStrings(sHelpSystemTermTextPtrs[gHelpSystemState[3]], sHelpSystemTermDefinitionsTextPtrs[gHelpSystemState[3]]);
|
||||
HelpSystem_PrintTwoStrings(sHelpSystemTermTextPtrs[gHelpSystemState.scrollSub], sHelpSystemTermDefinitionsTextPtrs[gHelpSystemState.scrollSub]);
|
||||
}
|
||||
else if (gHelpSystemState[1] == TOPIC_ABOUT_GAME)
|
||||
else if (gHelpSystemState.topic == TOPIC_ABOUT_GAME)
|
||||
{
|
||||
HelpSystem_PrintTwoStrings(sHelpSystemGeneralTopicTextPtrs[gHelpSystemState[3]], sHelpSystemGeneralTopicDescriptionTextPtrs[gHelpSystemState[3]]);
|
||||
HelpSystem_PrintTwoStrings(sHelpSystemGeneralTopicTextPtrs[gHelpSystemState.scrollSub], sHelpSystemGeneralTopicDescriptionTextPtrs[gHelpSystemState.scrollSub]);
|
||||
}
|
||||
else // TOPIC_TYPE_MATCHUP
|
||||
{
|
||||
HelpSystem_PrintTwoStrings(sHelpSystemTypeMatchupTextPtrs[gHelpSystemState[3]], sHelpSystemTypeMatchupDescriptionTextPtrs[gHelpSystemState[3]]);
|
||||
HelpSystem_PrintTwoStrings(sHelpSystemTypeMatchupTextPtrs[gHelpSystemState.scrollSub], sHelpSystemTypeMatchupDescriptionTextPtrs[gHelpSystemState.scrollSub]);
|
||||
}
|
||||
sub_813BDA4(1);
|
||||
sub_813BD5C(1);
|
||||
HS_ShowOrHideMainWindowText(1);
|
||||
HS_ShowOrHideControlsGuideInTopRight(1);
|
||||
helpListMenu->state = 6;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 HelpMenuSubroutine_ReturnFromHelpItem(struct HelpSystemListMenu * helpListMenu, struct ListMenuItem * listMenuItemsBuffer)
|
||||
{
|
||||
gHelpSystemState[0] = 1;
|
||||
gHelpSystemState.level = 1;
|
||||
BuildAndPrintSubmenuList(helpListMenu, listMenuItemsBuffer);
|
||||
sub_813C75C();
|
||||
HS_UpdateMenuScrollArrows();
|
||||
HelpSystem_SetInputDelay(2);
|
||||
helpListMenu->state = 3;
|
||||
return TRUE;
|
||||
@@ -2441,9 +2458,9 @@ static void PrintTextOnPanel2Row52RightAlign(const u8 * str)
|
||||
HelpSystem_PrintTextRightAlign_Row52(str);
|
||||
}
|
||||
|
||||
u8 sub_812BF88(void)
|
||||
u8 GetHelpSystemMenuLevel(void)
|
||||
{
|
||||
return gHelpSystemState[0];
|
||||
return gHelpSystemState.level;
|
||||
}
|
||||
|
||||
static void ResetHelpSystemCursor(struct HelpSystemListMenu * helpListMenu)
|
||||
@@ -2459,5 +2476,5 @@ static void PrintHelpSystemTopicMouseoverDescription(struct HelpSystemListMenu *
|
||||
HelpSystem_PrintText_813C584(sHelpSystemTopicMouseoverDescriptionPtrs[5]);
|
||||
else
|
||||
HelpSystem_PrintText_813C584(sHelpSystemTopicMouseoverDescriptionPtrs[index]);
|
||||
sub_813BE30(1);
|
||||
HS_ShowOrHideToplevelTooltipWindow(1);
|
||||
}
|
||||
|
||||
@@ -868,7 +868,7 @@ void sub_810250C(void)
|
||||
gUnknown_203ACF0->field_6C = sub_8104BBC(1, 1);
|
||||
gUnknown_203ACF0->field_66 = sub_8104BBC(0, 0);
|
||||
gUnknown_203ACF0->field_68 = sub_8104BBC(1, 0);
|
||||
sub_8072474(0x80);
|
||||
SetBGMVolume_SuppressHelpSystemReduction(0x80);
|
||||
ChangeBgX(0, 0, 0);
|
||||
ChangeBgY(0, 0, 0);
|
||||
ChangeBgX(1, 0, 0);
|
||||
@@ -925,7 +925,7 @@ bool8 sub_8102798(void)
|
||||
FREE_IF_NOT_NULL(GetBgTilemapBuffer(1));
|
||||
FREE_IF_NOT_NULL(GetBgTilemapBuffer(2));
|
||||
FREE_IF_NOT_NULL(GetBgTilemapBuffer(3));
|
||||
sub_807249C();
|
||||
BGMVolumeMax_EnableHelySystemReduction();
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
+5
-5
@@ -16,7 +16,7 @@ struct Fanfare
|
||||
|
||||
// TODO: what are these
|
||||
extern u8 gDisableMapMusicChangeOnMapLoad;
|
||||
extern u8 gUnknown_203F174;
|
||||
extern u8 gDisableHelpSystemVolumeReduce;
|
||||
|
||||
// ewram
|
||||
EWRAM_DATA struct MusicPlayerInfo* gMPlay_PokemonCry = NULL;
|
||||
@@ -630,14 +630,14 @@ bool8 IsSpecialSEPlaying(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void sub_8072474(u16 volume)
|
||||
void SetBGMVolume_SuppressHelpSystemReduction(u16 volume)
|
||||
{
|
||||
gUnknown_203F174 = 1;
|
||||
gDisableHelpSystemVolumeReduce = TRUE;
|
||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, volume);
|
||||
}
|
||||
|
||||
void sub_807249C(void)
|
||||
void BGMVolumeMax_EnableHelySystemReduction(void)
|
||||
{
|
||||
gUnknown_203F174 = 0;
|
||||
gDisableHelpSystemVolumeReduce = FALSE;
|
||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 256);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user