Add enums for help system text, label help context

This commit is contained in:
GriffinR
2020-03-04 10:42:40 -05:00
parent 13e06bf7f8
commit 4df660dc76
33 changed files with 1634 additions and 705 deletions
+4 -4
View File
@@ -641,17 +641,17 @@ void CB2_InitBattle(void)
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER)
{
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
HelpSystem_SetSomeVariable2(0x19);
SetHelpContext(HELPCONTEXT_TRAINER_BATTLE_DOUBLE);
else
HelpSystem_SetSomeVariable2(0x18);
SetHelpContext(HELPCONTEXT_TRAINER_BATTLE_SINGLE);
}
else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
{
HelpSystem_SetSomeVariable2(0x1A);
SetHelpContext(HELPCONTEXT_SAFARI_BATTLE);
}
else
{
HelpSystem_SetSomeVariable2(0x17);
SetHelpContext(HELPCONTEXT_WILD_BATTLE);
}
}
}
+2 -2
View File
@@ -1232,7 +1232,7 @@ static bool8 FallWarpEffect_7(struct Task * task)
{
VarSet(VAR_TEMP_1, 1);
SetPlayerAvatarTransitionFlags(PLAYER_AVATAR_FLAG_SURFING);
HelpSystem_SetSomeVariable2(22);
SetHelpContext(HELPCONTEXT_SURFING);
}
DestroyTask(FindTaskIdByFunc(Task_FallWarpFieldEffect));
return FALSE;
@@ -2963,7 +2963,7 @@ static void UseSurfEffect_5(struct Task * task)
ScriptContext2_Disable();
FieldEffectActiveListRemove(FLDEFF_USE_SURF);
DestroyTask(FindTaskIdByFunc(Task_FldEffUseSurf));
HelpSystem_SetSomeVariable2(22);
SetHelpContext(HELPCONTEXT_SURFING);
}
}
+1 -1
View File
@@ -1518,7 +1518,7 @@ static void Task_ListMenuRemoveScrollIndicatorArrowPair(u8 taskId)
void ForcePlayerToStartSurfing(void)
{
HelpSystem_SetSomeVariable2(22);
SetHelpContext(HELPCONTEXT_SURFING);
SetPlayerAvatarTransitionFlags(8);
}
+2 -2
View File
@@ -90,7 +90,7 @@ u8 RunHelpSystemCallback(void)
HelpSystem_FillPanel2();
HelpSystem_PrintText_Row61(gString_Help);
sub_813BD14(1);
if (sub_812B40C() == TRUE)
if (HelpSystem_UpdateHasntSeenIntro() == TRUE)
HelpSystemSubroutine_PrintWelcomeMessage(&gHelpSystemListMenu, gHelpSystemListMenuItems);
else
HelpSystemSubroutine_WelcomeEndGotoMenu(&gHelpSystemListMenu, gHelpSystemListMenuItems);
@@ -1184,7 +1184,7 @@ bool8 MoveCursor(u8 by, u8 dirn)
HelpSystem_FillPanel1();
PrintListMenuItems();
PlaceListMenuCursor();
sub_812BDEC();
HelpSystem_PrintTopicLabel();
sub_813C75C();
}
else
+1479 -595
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -496,9 +496,9 @@ static bool8 LoadBagMenuGraphics(void)
break;
case 19:
if (gBagMenuState.location == ITEMMENULOCATION_ITEMPC)
HelpSystem_SetSomeVariable2(29);
SetHelpContext(HELPCONTEXT_PLAYERS_PC_ITEMS);
else
HelpSystem_SetSomeVariable2(9);
SetHelpContext(HELPCONTEXT_BAG);
gPaletteFade.bufferTransferDisabled = FALSE;
gMain.state++;
break;
+1 -1
View File
@@ -361,7 +361,7 @@ static bool8 ItemPc_DoGfxSetup(void)
gMain.state++;
break;
case 17:
HelpSystem_SetSomeVariable2(29);
SetHelpContext(HELPCONTEXT_PLAYERS_PC_ITEMS);
gMain.state++;
break;
case 18:
+3 -3
View File
@@ -506,10 +506,10 @@ static bool8 DoInitMailView(void)
SetVBlankCallback(NULL);
ScanlineEffect_Stop();
SetGpuReg(REG_OFFSET_DISPCNT, 0);
if (gPlayerPcMenuManager.unk_9 == 0)
HelpSystem_SetSomeVariable2(34);
if (gPlayerPcMenuManager.notInRoom == FALSE)
SetHelpContext(HELPCONTEXT_BEDROOM_PC_MAILBOX);
else
HelpSystem_SetSomeVariable2(30);
SetHelpContext(HELPCONTEXT_PLAYERS_PC_MAILBOX);
break;
case 1:
CpuFill16(0, (void *)OAM, OAM_SIZE);
+1 -1
View File
@@ -512,7 +512,7 @@ static void Task_OaksSpeech1(u8 taskId)
ResetSpriteData();
FreeAllSpritePalettes();
ResetTempTileDataBuffers();
HelpSystem_SetSomeVariable2(2);
SetHelpContext(HELPCONTEXT_NEW_GAME);
break;
case 1:
sOakSpeechResources = AllocZeroed(sizeof(*sOakSpeechResources));
+1 -1
View File
@@ -224,7 +224,7 @@ void CB2_OptionsMenuFromStartMenu(void)
if (sOptionMenuPtr->option[i] > (sOptionMenuItemCounts[i]) - 1)
sOptionMenuPtr->option[i] = 0;
}
HelpSystem_SetSomeVariable2(0xD);
SetHelpContext(HELPCONTEXT_OPTIONS);
SetMainCallback2(CB2_OptionMenu);
}
+1 -1
View File
@@ -566,7 +566,7 @@ static bool8 ShowPartyMenu(void)
++gMain.state;
break;
case 19:
HelpSystem_SetSomeVariable2(5);
SetHelpContext(HELPCONTEXT_PARTY_MENU);
++gMain.state;
break;
case 20:
+18 -18
View File
@@ -153,8 +153,8 @@ void BedroomPC(void)
{
u8 taskId;
gPlayerPcMenuManager.unk_9 = 0;
HelpSystem_BackupSomeVariable();
gPlayerPcMenuManager.notInRoom = FALSE;
BackupHelpContext();
sItemOrder = gUnknown_8402200;
sTopMenuItemCount = 3;
taskId = CreateTask(TaskDummy, 0);
@@ -165,8 +165,8 @@ void PlayerPC(void)
{
u8 taskId;
gPlayerPcMenuManager.unk_9 = 1;
HelpSystem_BackupSomeVariable();
gPlayerPcMenuManager.notInRoom = TRUE;
BackupHelpContext();
sItemOrder = gUnknown_8402203;
sTopMenuItemCount = 3;
taskId = CreateTask(TaskDummy, 0);
@@ -215,7 +215,7 @@ static void Task_TopMenuHandleInput(u8 taskId)
static void Task_ReturnToTopMenu(u8 taskId)
{
HelpSystem_RestoreSomeVariable();
RestoreHelpContext();
DisplayItemMessageOnField(taskId, 2, gText_WhatWouldYouLikeToDo, Task_DrawPlayerPcTopMenu);
}
@@ -238,10 +238,10 @@ static void Task_PlayerPcMailbox(u8 taskId)
gPlayerPcMenuManager.itemsAbove = 0;
PCMailCompaction();
Task_SetPageItemVars(taskId);
if (gPlayerPcMenuManager.unk_9 == 0)
HelpSystem_SetSomeVariable2(34);
if (gPlayerPcMenuManager.notInRoom == FALSE)
SetHelpContext(HELPCONTEXT_BEDROOM_PC_MAILBOX);
else
HelpSystem_SetSomeVariable2(30);
SetHelpContext(HELPCONTEXT_PLAYERS_PC_MAILBOX);
if (MailboxPC_InitBuffers(gPlayerPcMenuManager.count) == TRUE)
{
ClearDialogWindowAndFrame(0, FALSE);
@@ -257,7 +257,7 @@ static void Task_PlayerPcMailbox(u8 taskId)
static void Task_PlayerPcTurnOff(u8 taskId)
{
if (gPlayerPcMenuManager.unk_9 == 0)
if (gPlayerPcMenuManager.notInRoom == FALSE)
ScriptContext1_SetupScript(EventScript_PalletTown_PlayersHouse_2F_ShutDownPC);
else
EnableBothScriptContexts();
@@ -267,10 +267,10 @@ static void Task_PlayerPcTurnOff(u8 taskId)
static void Task_CreateItemStorageSubmenu(u8 taskId, u8 cursorPos)
{
s16 *data = gTasks[taskId].data;
if (gPlayerPcMenuManager.unk_9 == 0)
HelpSystem_SetSomeVariable2(33);
if (gPlayerPcMenuManager.notInRoom == FALSE)
SetHelpContext(HELPCONTEXT_BEDROOM_PC_ITEMS);
else
HelpSystem_SetSomeVariable2(29);
SetHelpContext(HELPCONTEXT_PLAYERS_PC_ITEMS);
tWindowId = AddWindow(&sWindowTemplate_ItemStorageSubmenu);
SetStdWindowBorderStyle(tWindowId, FALSE);
PrintTextArray(tWindowId, 2, GetMenuCursorDimensionByFont(2, 0), 2, 16, 3, sMenuActions_ItemPc);
@@ -580,10 +580,10 @@ static void Task_WaitFadeAndReturnToMailboxPcInputHandler(u8 taskId)
static void CB2_ReturnToMailbox(void)
{
u8 taskId;
if (gPlayerPcMenuManager.unk_9 == 0)
HelpSystem_SetSomeVariable2(34);
if (gPlayerPcMenuManager.notInRoom == FALSE)
SetHelpContext(HELPCONTEXT_BEDROOM_PC_MAILBOX);
else
HelpSystem_SetSomeVariable2(30);
SetHelpContext(HELPCONTEXT_PLAYERS_PC_MAILBOX);
LoadStdWindowFrameGfx();
taskId = CreateTask(Task_WaitFadeAndReturnToMailboxPcInputHandler, 0);
if (MailboxPC_InitBuffers(gPlayerPcMenuManager.count) == TRUE)
@@ -683,10 +683,10 @@ static void CB2_ReturnToMailboxPc_UpdateScrollVariables(void)
{
u8 taskId;
u8 count;
if (gPlayerPcMenuManager.unk_9 == 0)
HelpSystem_SetSomeVariable2(34);
if (gPlayerPcMenuManager.notInRoom == FALSE)
SetHelpContext(HELPCONTEXT_BEDROOM_PC_MAILBOX);
else
HelpSystem_SetSomeVariable2(30);
SetHelpContext(HELPCONTEXT_PLAYERS_PC_MAILBOX);
taskId = CreateTask(Task_WaitFadeAndReturnToMailboxPcInputHandler, 0);
count = gPlayerPcMenuManager.count;
gPlayerPcMenuManager.count = CountPCMail();
+1 -1
View File
@@ -302,7 +302,7 @@ void CB2_OpenPokedexFromStartMenu(void)
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
SetGpuReg(REG_OFFSET_BLDY, 0);
SetMainCallback2(sub_81024D4);
HelpSystem_SetSomeVariable2(4);
SetHelpContext(HELPCONTEXT_POKEDEX);
}
#define FREE_IF_NOT_NULL(ptr0) ({ void * ptr = (ptr0); if (ptr) Free(ptr); })
+4 -4
View File
@@ -36,17 +36,17 @@ void ReshowBattleScreenAfterMenu(void)
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER)
{
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
HelpSystem_SetSomeVariable2(0x19);
SetHelpContext(HELPCONTEXT_TRAINER_BATTLE_DOUBLE);
else
HelpSystem_SetSomeVariable2(0x18);
SetHelpContext(HELPCONTEXT_TRAINER_BATTLE_SINGLE);
}
else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
{
HelpSystem_SetSomeVariable2(0x1A);
SetHelpContext(HELPCONTEXT_SAFARI_BATTLE);
}
else
{
HelpSystem_SetSomeVariable2(0x17);
SetHelpContext(HELPCONTEXT_WILD_BATTLE);
}
}
SetMainCallback2(CB2_ReshowBattleScreenAfterMenu);
+8 -8
View File
@@ -562,8 +562,8 @@ static bool8 StartMenuLinkPlayerCallback(void)
static bool8 StartCB_Save1(void)
{
HelpSystem_BackupSomeVariable();
HelpSystem_SetSomeVariable2(12);
BackupHelpContext();
SetHelpContext(HELPCONTEXT_SAVE);
StartMenu_PrepareForSave();
sStartMenuCallback = StartCB_Save2;
return FALSE;
@@ -579,19 +579,19 @@ static bool8 StartCB_Save2(void)
ClearDialogWindowAndFrameToTransparent(0, TRUE);
sub_80696C0();
ScriptContext2_Disable();
HelpSystem_RestoreSomeVariable();
RestoreHelpContext();
return TRUE;
case SAVECB_RETURN_CANCEL:
ClearDialogWindowAndFrameToTransparent(0, FALSE);
DrawStartMenuInOneGo();
HelpSystem_RestoreSomeVariable();
RestoreHelpContext();
sStartMenuCallback = StartCB_HandleInput;
break;
case SAVECB_RETURN_ERROR:
ClearDialogWindowAndFrameToTransparent(0, TRUE);
sub_80696C0();
ScriptContext2_Disable();
HelpSystem_RestoreSomeVariable();
RestoreHelpContext();
return TRUE;
}
return FALSE;
@@ -614,8 +614,8 @@ static u8 RunSaveDialogCB(void)
void Field_AskSaveTheGame(void)
{
HelpSystem_BackupSomeVariable();
HelpSystem_SetSomeVariable2(12);
BackupHelpContext();
SetHelpContext(HELPCONTEXT_SAVE);
StartMenu_PrepareForSave();
CreateTask(task50_save_game, 80);
}
@@ -645,7 +645,7 @@ static void task50_save_game(u8 taskId)
}
DestroyTask(taskId);
EnableBothScriptContexts();
HelpSystem_RestoreSomeVariable();
RestoreHelpContext();
}
static void CloseSaveMessageWindow(void)
+1 -1
View File
@@ -500,7 +500,7 @@ static void TeachyTvMainCallback(void)
ScheduleBgCopyTilemapToVram(1);
ScheduleBgCopyTilemapToVram(2);
ScheduleBgCopyTilemapToVram(3);
HelpSystem_SetSomeVariable(9); // help system something
SetHelpContextDontCheckBattle(HELPCONTEXT_BAG);
BlendPalettes(0xFFFFFFFF, 0x10, 0);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
SetVBlankCallback(TeachyTvVblankHandler);
+1 -1
View File
@@ -575,7 +575,7 @@ static void SetTitleScreenScene_Run(s16 * data)
switch (data[1])
{
case 0:
HelpSystem_SetSomeVariable2(1);
SetHelpContext(HELPCONTEXT_TITLE_SCREEN);
CreateTask(Task_TitleScreen_BlinkPressStart, 0);
CreateTask(Task_FlameOrLeafSpawner, 5);
SetGpuRegsForTitleScreenRun();
+3 -3
View File
@@ -570,7 +570,7 @@ static void Task_TrainerCard(u8 taskId)
if (JOY_NEW(A_BUTTON))
{
HelpSystem_SetSomeVariable2(11);
SetHelpContext(HELPCONTEXT_TRAINER_CARD_BACK);
FlipTrainerCard();
PlaySE(SE_CARD1);
sTrainerCardDataPtr->mainState = STATE_WAIT_FLIP_TO_BACK;
@@ -609,7 +609,7 @@ static void Task_TrainerCard(u8 taskId)
}
else
{
HelpSystem_SetSomeVariable2(10);
SetHelpContext(HELPCONTEXT_TRAINER_CARD_FRONT);
FlipTrainerCard();
sTrainerCardDataPtr->mainState = STATE_WAIT_FLIP_TO_FRONT;
PlaySE(SE_CARD1);
@@ -1042,7 +1042,7 @@ static void InitBgsAndWindows(void)
static void SetTrainerCardCB2(void)
{
SetMainCallback2(CB2_TrainerCard);
HelpSystem_SetSomeVariable2(10);
SetHelpContext(HELPCONTEXT_TRAINER_CARD_FRONT);
}
static void SetUpTrainerCardTask(void)