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

View File

@ -4157,7 +4157,7 @@ sub_805D240: @ 805D240
bl DestroySprite
adds r0, r5, 0
bl DestroyTask
bl sub_812B35C
bl SetHelpContextForMap
_0805D2AE:
pop {r4-r6}
pop {r0}

View File

@ -491,9 +491,9 @@ sub_809DD60: @ 809DD60
bl CreateTask
ldr r0, _0809DD84 @ =sub_809FB70
bl SetMainCallback2
bl HelpSystem_BackupSomeVariable
movs r0, 0x3
bl HelpSystem_SetSomeVariable2
bl BackupHelpContext
movs r0, 0x3 @ HELPCONTEXT_NAMING_SCREEN
bl SetHelpContext
pop {r0}
bx r0
.align 2, 0
@ -868,7 +868,7 @@ _0809E06C:
ldr r0, [r4]
bl Free
str r5, [r4]
bl HelpSystem_RestoreSomeVariable
bl RestoreHelpContext
_0809E096:
movs r0, 0
pop {r4,r5}

View File

@ -4012,7 +4012,7 @@ _08056ACE:
bl sub_8057074
bl sub_80571A8
bl sub_8057140
bl sub_812B35C
bl SetHelpContextForMap
b _08056B62
_08056AE4:
bl InitCurrentFlashLevelScanlineEffect
@ -4152,7 +4152,7 @@ _08056BFE:
bl sub_80CC534
bl sub_80CC59C
_08056C16:
bl sub_812B35C
bl SetHelpContextForMap
b _08056CCA
.align 2, 0
_08056C1C: .4byte gQuestLogState
@ -4275,7 +4275,7 @@ _08056D04:
b _08056D30
_08056D1C:
bl sub_8056F08
bl sub_812B35C
bl SetHelpContextForMap
b _08056D30
_08056D26:
bl map_post_load_hook_exec
@ -4343,7 +4343,7 @@ _08056DAE:
bl sub_8057230
bl sub_8057100
bl sub_805715C
bl sub_812B35C
bl SetHelpContextForMap
b _08056E3E
_08056DC0:
bl InitCurrentFlashLevelScanlineEffect

View File

@ -1411,8 +1411,8 @@ _0808C3CC:
.4byte _0808C5A6
.4byte _0808C680
_0808C3E0:
movs r0, 0x1C
bl HelpSystem_SetSomeVariable2
movs r0, 0x1C @ HELPCONTEXT_BILLS_PC
bl SetHelpContext
ldrb r0, [r5, 0xA]
adds r1, r5, 0
adds r1, 0x26
@ -2715,8 +2715,8 @@ _0808CE18:
bl CreateTask
ldr r1, [r4]
strb r0, [r1, 0x4]
movs r0, 0x1C
bl HelpSystem_SetSomeVariable2
movs r0, 0x1C @ HELPCONTEXT_BILLS_PC
bl SetHelpContext
bl StorageGetCurrentBox
ldr r1, _0808CE58 @ =gUnknown_20397B8
strb r0, [r1]
@ -2766,8 +2766,8 @@ _0808CE8C:
bl CreateTask
ldr r1, [r4]
strb r0, [r1, 0x4]
movs r0, 0x1C
bl HelpSystem_SetSomeVariable2
movs r0, 0x1C @ HELPCONTEXT_BILLS_PC
bl SetHelpContext
ldr r0, _0808CEC4 @ =c2_Box
bl SetMainCallback2
_0808CEB6:

View File

@ -106,8 +106,8 @@ _081345D0:
cmp r0, 0x5
beq _08134604
_081345D4:
movs r0, 0x6
bl HelpSystem_SetSomeVariable2
movs r0, 0x6 @ HELPCONTEXT_POKEMON_INFO
bl SetHelpContext
ldr r2, _081345F8 @ =gUnknown_203B140
ldr r0, [r2]
ldr r3, _081345FC @ =0x00003214
@ -127,8 +127,8 @@ _081345F8: .4byte gUnknown_203B140
_081345FC: .4byte 0x00003214
_08134600: .4byte 0x00003234
_08134604:
movs r0, 0x6
bl HelpSystem_SetSomeVariable2
movs r0, 0x6 @ HELPCONTEXT_POKEMON_INFO
bl SetHelpContext
ldr r0, [r4]
ldr r3, _08134628 @ =0x00003214
adds r0, r3
@ -148,8 +148,8 @@ _08134628: .4byte 0x00003214
_0813462C: .4byte 0x0000321c
_08134630: .4byte 0x00003234
_08134634:
movs r0, 0x8
bl HelpSystem_SetSomeVariable2
movs r0, 0x8 @ HELPCONTEXT_POKEMON_MOVES
bl SetHelpContext
ldr r0, [r4]
ldr r3, _08134710 @ =0x00003214
adds r0, r3
@ -7600,15 +7600,15 @@ _08138460: .4byte 0x00003214
_08138464:
cmp r0, 0x3
bgt _08138476
movs r0, 0x8
movs r0, 0x8 @ HELPCONTEXT_POKEMON_MOVES
b _08138472
_0813846C:
movs r0, 0x6
movs r0, 0x6 @ HELPCONTEXT_POKEMON_INFO
b _08138472
_08138470:
movs r0, 0x7
movs r0, 0x7 @ HELPCONTEXT_POKEMON_SKILLS
_08138472:
bl HelpSystem_SetSomeVariable2
bl SetHelpContext
_08138476:
pop {r0}
bx r0

View File

@ -1,2 +1,2 @@
sHelpSystemState
gSomeVariableBackup
gHelpSystemState
gHelpContextIdBackup

View File

@ -35,6 +35,7 @@
#include "constants/daycare.h"
#include "constants/easy_chat.h"
#include "constants/trainer_card.h"
#include "constants/help_system.h"
.include "asm/macros.inc"
.include "asm/macros/event.inc"
.set FALSE, 0

View File

@ -32,15 +32,15 @@ PalletTown_PlayersHouse_2F_EventScript_Sign:: @ 8168CDB
PalletTown_PlayersHouse_2F_EventScript_PC:: @ 8168CE4
goto_if_questlog EventScript_ReleaseEnd
lockall
setvar VAR_0x8004, 32
special HelpSystem_SetSomeVariable
setvar VAR_0x8004, HELPCONTEXT_BEDROOM_PC
special Script_SetHelpContext
setvar VAR_0x8004, 1
special AnimatePcTurnOn
playse SE_PC_ON
msgbox Text_PlayerBootedUpPC
special BedroomPC
waitstate
special sub_812B35C
special SetHelpContextForMap
releaseall
end
@ -48,6 +48,6 @@ EventScript_PalletTown_PlayersHouse_2F_ShutDownPC:: @ 8168D17
setvar VAR_0x8004, 1
playse SE_PC_OFF
special AnimatePcTurnOff
special sub_812B35C
special SetHelpContextForMap
releaseall
end

View File

@ -1,7 +1,7 @@
EventScript_SetDefeatedEliteFourFlagsVars:: @ 81A651A
clearflag FLAG_HIDE_POSTGAME_GOSSIPERS
call EventScript_ResetEliteFour
special Special_UpdateTrainerFanClubGameClear
special Script_UpdateTrainerFanClubGameClear
specialvar VAR_RESULT, IsNationalPokedexEnabled
compare VAR_RESULT, FALSE
call_if_eq EventScript_SetReadyTryGiveNationalDexScene

View File

@ -2,8 +2,8 @@ EventScript_PC:: @ 81A6955
goto_if_questlog EventScript_ReleaseEnd
lockall
goto_if_set FLAG_SYS_PC_STORAGE_DISABLED, EventScript_PCDisabled
setvar VAR_0x8004, 27
special HelpSystem_SetSomeVariable
setvar VAR_0x8004, HELPCONTEXT_PC
special Script_SetHelpContext
setvar VAR_0x8004, 0
special AnimatePcTurnOn
playse SE_PC_ON
@ -50,8 +50,8 @@ EventScript_AccessPokemonStorage:: @ 81A6A05
msgbox Text_OpenedPkmnStorage
special ShowPokemonStorageSystem
waitstate
setvar VAR_0x8004, 27
special HelpSystem_SetSomeVariable
setvar VAR_0x8004, HELPCONTEXT_PC
special Script_SetHelpContext
goto EventScript_PCMainMenu
end
@ -67,19 +67,19 @@ EventScript_TurnOffPC:: @ 81A6A46
setvar VAR_0x8004, 0
playse SE_PC_OFF
special AnimatePcTurnOff
special sub_812B35C
special SetHelpContextForMap
releaseall
end
EventScript_AccessHallOfFame:: @ 81A6A56
goto_if_unset FLAG_SYS_GAME_CLEAR, EventScript_TurnOffPC
playse SE_PC_LOGIN
setvar VAR_0x8004, 31
special HelpSystem_BackupSomeVariable
special HelpSystem_SetSomeVariable
setvar VAR_0x8004, HELPCONTEXT_PC_MISC
special BackupHelpContext
special Script_SetHelpContext
special HallOfFamePCBeginFade
waitstate
special HelpSystem_RestoreSomeVariable
special RestoreHelpContext
goto EventScript_ChoosePCMenu
end

View File

@ -35,9 +35,9 @@ PokedexRating_EventScript_DexCompleteFanfare:: @ 81A73DC
return
PokedexRating_EventScript_Rate:: @ 81A73E0
setvar VAR_0x8004, 31
special HelpSystem_BackupSomeVariable
special HelpSystem_SetSomeVariable
setvar VAR_0x8004, HELPCONTEXT_PC_MISC
special BackupHelpContext
special Script_SetHelpContext
setvar VAR_0x8004, 0
specialvar VAR_RESULT, GetPokedexCount
copyvar VAR_0x8008, VAR_0x8005
@ -80,5 +80,5 @@ PokedexRating_EventScript_DexComplete:: @ 81A747E
end
PokedexRating_EventScript_EndRating:: @ 81A748F
special HelpSystem_RestoreSomeVariable
special RestoreHelpContext
return

View File

@ -389,9 +389,9 @@ gSpecials:: @ 815FD60
def_special TakePokemonFromRoute5Daycare
def_special DoSeagallopFerryScene
def_special DoesPlayerPartyContainSpecies
def_special HelpSystem_SetSomeVariable
def_special HelpSystem_BackupSomeVariable
def_special HelpSystem_RestoreSomeVariable
def_special Script_SetHelpContext
def_special BackupHelpContext
def_special RestoreHelpContext
def_special ValidateReceivedWonderCard
def_special sub_810B810
def_special InitUnionRoom
@ -408,7 +408,7 @@ gSpecials:: @ 815FD60
def_special ChooseMonForMoveTutor
def_special ChooseMonForWirelessMinigame
def_special SetBattledTrainerFlag
def_special sub_812B35C
def_special SetHelpContextForMap
def_special DoSSAnneDepartureCutscene
def_special IsPokemonJumpSpeciesInParty
def_special IsNationalPokedexEnabled

View File

@ -0,0 +1,42 @@
#ifndef GUARD_CONSTANTS_HELP_SYSTEM_H
#define GUARD_CONSTANTS_HELP_SYSTEM_H
#define HELPCONTEXT_NONE 0
#define HELPCONTEXT_TITLE_SCREEN 1
#define HELPCONTEXT_NEW_GAME 2
#define HELPCONTEXT_NAMING_SCREEN 3
#define HELPCONTEXT_POKEDEX 4
#define HELPCONTEXT_PARTY_MENU 5
#define HELPCONTEXT_POKEMON_INFO 6
#define HELPCONTEXT_POKEMON_SKILLS 7
#define HELPCONTEXT_POKEMON_MOVES 8
#define HELPCONTEXT_BAG 9
#define HELPCONTEXT_TRAINER_CARD_FRONT 10
#define HELPCONTEXT_TRAINER_CARD_BACK 11
#define HELPCONTEXT_SAVE 12
#define HELPCONTEXT_OPTIONS 13
#define HELPCONTEXT_PLAYERS_HOUSE 14
#define HELPCONTEXT_OAKS_LAB 15
#define HELPCONTEXT_POKECENTER 16
#define HELPCONTEXT_MART 17
#define HELPCONTEXT_GYM 18
#define HELPCONTEXT_INDOORS 19
#define HELPCONTEXT_OVERWORLD 20
#define HELPCONTEXT_DUNGEON 21 // Caves and Forests
#define HELPCONTEXT_SURFING 22
#define HELPCONTEXT_WILD_BATTLE 23
#define HELPCONTEXT_TRAINER_BATTLE_SINGLE 24
#define HELPCONTEXT_TRAINER_BATTLE_DOUBLE 25
#define HELPCONTEXT_SAFARI_BATTLE 26
#define HELPCONTEXT_PC 27
#define HELPCONTEXT_BILLS_PC 28
#define HELPCONTEXT_PLAYERS_PC_ITEMS 29
#define HELPCONTEXT_PLAYERS_PC_MAILBOX 30
#define HELPCONTEXT_PC_MISC 31 // Prof Oaks PC and the HoF PC
#define HELPCONTEXT_BEDROOM_PC 32
#define HELPCONTEXT_BEDROOM_PC_ITEMS 33
#define HELPCONTEXT_BEDROOM_PC_MAILBOX 34
#define HELPCONTEXT_UNUSED 35
#define HELPCONTEXT_COUNT 36
#endif //GUARD_CONSTANTS_HELP_SYSTEM_H

View File

@ -4,6 +4,7 @@
#include "global.h"
#include "list_menu.h"
#include "blit.h"
#include "constants/help_system.h"
struct HelpSystemListMenu_sub
{
@ -29,9 +30,10 @@ extern bool8 gHelpSystemEnabled;
extern bool8 gHelpSystemToggleWithRButtonDisabled;
// help_system_812B1E0
void HelpSystem_SetSomeVariable(u8);
void HelpSystem_SetSomeVariable2(u8);
bool8 sub_812B40C(void);
void SetHelpContextDontCheckBattle(u8);
void SetHelpContextForMap(void);
void SetHelpContext(u8);
bool8 HelpSystem_UpdateHasntSeenIntro(void);
bool8 sub_812B45C(void);
void HelpSystem_Disable(void);
void HelpSystem_Enable(void);
@ -44,7 +46,7 @@ bool8 HelpSystemSubroutine_MenuInputHandlerMain(struct HelpSystemListMenu * help
bool8 HelpMenuSubroutine_InitSubmenu(struct HelpSystemListMenu * helpListMenu, struct ListMenuItem * listMenuItemsBuffer);
bool8 HelpMenuSubroutine_ReturnFromSubmenu(struct HelpSystemListMenu * helpListMenu, struct ListMenuItem * listMenuItemsBuffer);
bool8 HelpMenuSubroutine_SubmenuInputHandler(struct HelpSystemListMenu * helpListMenu, struct ListMenuItem * listMenuItemsBuffer);
void sub_812BDEC(void);
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);
@ -89,8 +91,8 @@ void HelpSystem_FillPanel3(void);
void PrintListMenuItems(void);
void PlaceListMenuCursor(void);
bool8 MoveCursor(u8 by, u8 dirn);
void HelpSystem_BackupSomeVariable(void);
void HelpSystem_RestoreSomeVariable(void);
void BackupHelpContext(void);
void RestoreHelpContext(void);
void HelpSystemRenderText(u8 font, u8 * dest, const u8 * src, u8 x, u8 y, u8 width, u8 height);
void HelpSystem_DisableToggleWithRButton(void);

View File

@ -13,7 +13,7 @@ struct PlayerPCItemPageStruct
u8 pageItems;
u8 count;
u8 filler_6[3];
u8 unk_9;
bool8 notInRoom;
u8 scrollIndicatorId;
u8 filler_B[5];
};

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);
}
}
}

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);
}
}

View File

@ -1518,7 +1518,7 @@ static void Task_ListMenuRemoveScrollIndicatorArrowPair(u8 taskId)
void ForcePlayerToStartSurfing(void)
{
HelpSystem_SetSomeVariable2(22);
SetHelpContext(HELPCONTEXT_SURFING);
SetPlayerAvatarTransitionFlags(8);
}

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

File diff suppressed because it is too large Load Diff

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;

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:

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);

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));

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);
}

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:

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();

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); })

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);

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)

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);

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();

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)