start start menu decomp
This commit is contained in:
102
src/battle_ai.c
102
src/battle_ai.c
@@ -27,10 +27,10 @@
|
||||
|
||||
enum
|
||||
{
|
||||
TARGET,
|
||||
USER,
|
||||
TARGET_PARTNER,
|
||||
USER_PARTNER
|
||||
AI_TARGET,
|
||||
AI_USER,
|
||||
AI_TARGET_PARTNER,
|
||||
AI_USER_PARTNER
|
||||
};
|
||||
|
||||
// AI states
|
||||
@@ -1033,7 +1033,7 @@ static void BattleAICmd_if_hp_less_than(void)
|
||||
{
|
||||
u16 index;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
index = sBank_AI;
|
||||
else
|
||||
index = gBankTarget;
|
||||
@@ -1048,7 +1048,7 @@ static void BattleAICmd_if_hp_more_than(void)
|
||||
{
|
||||
u16 index;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
index = sBank_AI;
|
||||
else
|
||||
index = gBankTarget;
|
||||
@@ -1063,7 +1063,7 @@ static void BattleAICmd_if_hp_equal(void)
|
||||
{
|
||||
u16 index;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
index = sBank_AI;
|
||||
else
|
||||
index = gBankTarget;
|
||||
@@ -1078,7 +1078,7 @@ static void BattleAICmd_if_hp_not_equal(void)
|
||||
{
|
||||
u16 index;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
index = sBank_AI;
|
||||
else
|
||||
index = gBankTarget;
|
||||
@@ -1094,7 +1094,7 @@ static void BattleAICmd_if_status(void)
|
||||
u16 index;
|
||||
u32 arg;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
index = sBank_AI;
|
||||
else
|
||||
index = gBankTarget;
|
||||
@@ -1112,7 +1112,7 @@ static void BattleAICmd_if_not_status(void)
|
||||
u16 index;
|
||||
u32 arg;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
index = sBank_AI;
|
||||
else
|
||||
index = gBankTarget;
|
||||
@@ -1130,7 +1130,7 @@ static void BattleAICmd_if_status2(void)
|
||||
u16 index;
|
||||
u32 arg;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
index = sBank_AI;
|
||||
else
|
||||
index = gBankTarget;
|
||||
@@ -1148,7 +1148,7 @@ static void BattleAICmd_if_not_status2(void)
|
||||
u16 index;
|
||||
u32 arg;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
index = sBank_AI;
|
||||
else
|
||||
index = gBankTarget;
|
||||
@@ -1166,7 +1166,7 @@ static void BattleAICmd_if_status3(void)
|
||||
u16 index;
|
||||
u32 arg;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
index = sBank_AI;
|
||||
else
|
||||
index = gBankTarget;
|
||||
@@ -1184,7 +1184,7 @@ static void BattleAICmd_if_not_status3(void)
|
||||
u16 index;
|
||||
u32 arg;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
index = sBank_AI;
|
||||
else
|
||||
index = gBankTarget;
|
||||
@@ -1202,7 +1202,7 @@ static void BattleAICmd_if_side_affecting(void)
|
||||
u16 index;
|
||||
u32 arg1, arg2;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
index = sBank_AI;
|
||||
else
|
||||
index = gBankTarget;
|
||||
@@ -1221,7 +1221,7 @@ static void BattleAICmd_if_not_side_affecting(void)
|
||||
u16 index;
|
||||
u32 arg1, arg2;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
index = sBank_AI;
|
||||
else
|
||||
index = gBankTarget;
|
||||
@@ -1458,14 +1458,14 @@ static u8 BattleAI_GetWantedBank(u8 index)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case USER:
|
||||
case AI_USER:
|
||||
return sBank_AI;
|
||||
case TARGET:
|
||||
case AI_TARGET:
|
||||
default:
|
||||
return gBankTarget;
|
||||
case USER_PARTNER:
|
||||
case AI_USER_PARTNER:
|
||||
return sBank_AI ^ 2;
|
||||
case TARGET_PARTNER:
|
||||
case AI_TARGET_PARTNER:
|
||||
return gBankTarget ^ 2;
|
||||
}
|
||||
}
|
||||
@@ -1738,7 +1738,7 @@ _08132130:\n\
|
||||
|
||||
static void BattleAICmd_get_last_used_bank_move(void)
|
||||
{
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
AI_THINKING_STRUCT->funcResult = gLastUsedMovesByBanks[sBank_AI];
|
||||
else
|
||||
AI_THINKING_STRUCT->funcResult = gLastUsedMovesByBanks[gBankTarget];
|
||||
@@ -1795,7 +1795,7 @@ static void BattleAICmd_count_alive_pokemon(void)
|
||||
|
||||
AI_THINKING_STRUCT->funcResult = 0;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
index = sBank_AI;
|
||||
else
|
||||
index = gBankTarget;
|
||||
@@ -1848,7 +1848,7 @@ static void BattleAICmd_get_ability(void)
|
||||
{
|
||||
u8 index;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
index = sBank_AI;
|
||||
else
|
||||
index = gBankTarget;
|
||||
@@ -1910,7 +1910,7 @@ static void BattleAICmd_check_ability(void)
|
||||
u8 bank = BattleAI_GetWantedBank(gAIScriptPtr[1]);
|
||||
u8 ability = gAIScriptPtr[2];
|
||||
|
||||
if (gAIScriptPtr[1] == TARGET || gAIScriptPtr[1] == TARGET_PARTNER)
|
||||
if (gAIScriptPtr[1] == AI_TARGET || gAIScriptPtr[1] == AI_TARGET_PARTNER)
|
||||
{
|
||||
if (BATTLE_HISTORY->abilities[bank] != 0)
|
||||
{
|
||||
@@ -2290,7 +2290,7 @@ static void BattleAICmd_if_stat_level_less_than(void)
|
||||
{
|
||||
u32 bank;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
bank = sBank_AI;
|
||||
else
|
||||
bank = gBankTarget;
|
||||
@@ -2305,7 +2305,7 @@ static void BattleAICmd_if_stat_level_more_than(void)
|
||||
{
|
||||
u32 bank;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
bank = sBank_AI;
|
||||
else
|
||||
bank = gBankTarget;
|
||||
@@ -2320,7 +2320,7 @@ static void BattleAICmd_if_stat_level_equal(void)
|
||||
{
|
||||
u32 bank;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
bank = sBank_AI;
|
||||
else
|
||||
bank = gBankTarget;
|
||||
@@ -2335,7 +2335,7 @@ static void BattleAICmd_if_stat_level_not_equal(void)
|
||||
{
|
||||
u32 bank;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
bank = sBank_AI;
|
||||
else
|
||||
bank = gBankTarget;
|
||||
@@ -2409,7 +2409,7 @@ static void BattleAICmd_if_has_move(void)
|
||||
|
||||
switch(gAIScriptPtr[1])
|
||||
{
|
||||
case USER:
|
||||
case AI_USER:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (gBattleMons[sBank_AI].moves[i] == *temp_ptr)
|
||||
@@ -2425,7 +2425,7 @@ static void BattleAICmd_if_has_move(void)
|
||||
gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4);
|
||||
return;
|
||||
}
|
||||
case USER_PARTNER:
|
||||
case AI_USER_PARTNER:
|
||||
if (gBattleMons[sBank_AI ^ 2].hp == 0)
|
||||
{
|
||||
gAIScriptPtr += 8;
|
||||
@@ -2449,8 +2449,8 @@ static void BattleAICmd_if_has_move(void)
|
||||
gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4);
|
||||
return;
|
||||
}
|
||||
case TARGET:
|
||||
case TARGET_PARTNER:
|
||||
case AI_TARGET:
|
||||
case AI_TARGET_PARTNER:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (BATTLE_HISTORY->usedMoves[gBankTarget].moves[i] == *temp_ptr)
|
||||
@@ -2476,8 +2476,8 @@ static void BattleAICmd_if_dont_have_move(void)
|
||||
|
||||
switch(gAIScriptPtr[1])
|
||||
{
|
||||
case USER:
|
||||
case USER_PARTNER: // UB: no separate check for user partner
|
||||
case AI_USER:
|
||||
case AI_USER_PARTNER: // UB: no separate check for user partner
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (gBattleMons[sBank_AI].moves[i] == *temp_ptr)
|
||||
@@ -2493,8 +2493,8 @@ static void BattleAICmd_if_dont_have_move(void)
|
||||
gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 4);
|
||||
return;
|
||||
}
|
||||
case TARGET:
|
||||
case TARGET_PARTNER:
|
||||
case AI_TARGET:
|
||||
case AI_TARGET_PARTNER:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (BATTLE_HISTORY->usedMoves[gBankTarget].moves[i] == *temp_ptr)
|
||||
@@ -2519,8 +2519,8 @@ static void BattleAICmd_if_move_effect(void)
|
||||
|
||||
switch (gAIScriptPtr[1])
|
||||
{
|
||||
case USER:
|
||||
case USER_PARTNER:
|
||||
case AI_USER:
|
||||
case AI_USER_PARTNER:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if(gBattleMons[sBank_AI].moves[i] != 0 && gBattleMoves[gBattleMons[sBank_AI].moves[i]].effect == gAIScriptPtr[2])
|
||||
@@ -2531,8 +2531,8 @@ static void BattleAICmd_if_move_effect(void)
|
||||
else
|
||||
gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3);
|
||||
break;
|
||||
case TARGET:
|
||||
case TARGET_PARTNER:
|
||||
case AI_TARGET:
|
||||
case AI_TARGET_PARTNER:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (gBattleMons[sBank_AI].moves[i] != 0 && gBattleMoves[BATTLE_HISTORY->usedMoves[gBankTarget].moves[i]].effect == gAIScriptPtr[2])
|
||||
@@ -2552,8 +2552,8 @@ static void BattleAICmd_if_not_move_effect(void)
|
||||
|
||||
switch (gAIScriptPtr[1])
|
||||
{
|
||||
case USER:
|
||||
case USER_PARTNER:
|
||||
case AI_USER:
|
||||
case AI_USER_PARTNER:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if(gBattleMons[sBank_AI].moves[i] != 0 && gBattleMoves[gBattleMons[sBank_AI].moves[i]].effect == gAIScriptPtr[2])
|
||||
@@ -2564,8 +2564,8 @@ static void BattleAICmd_if_not_move_effect(void)
|
||||
else
|
||||
gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 3);
|
||||
break;
|
||||
case TARGET:
|
||||
case TARGET_PARTNER:
|
||||
case AI_TARGET:
|
||||
case AI_TARGET_PARTNER:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (BATTLE_HISTORY->usedMoves[gBankTarget].moves[i] && gBattleMoves[BATTLE_HISTORY->usedMoves[gBankTarget].moves[i]].effect == gAIScriptPtr[2])
|
||||
@@ -2583,7 +2583,7 @@ static void BattleAICmd_if_any_move_disabled_or_encored(void)
|
||||
{
|
||||
u8 bank;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
bank = sBank_AI;
|
||||
else
|
||||
bank = gBankTarget;
|
||||
@@ -2662,7 +2662,7 @@ static void BattleAICmd_get_hold_effect(void)
|
||||
u8 bank;
|
||||
u16 status;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
bank = sBank_AI;
|
||||
else
|
||||
bank = gBankTarget;
|
||||
@@ -2702,7 +2702,7 @@ static void BattleAICmd_get_gender(void)
|
||||
{
|
||||
u8 bank;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
bank = sBank_AI;
|
||||
else
|
||||
bank = gBankTarget;
|
||||
@@ -2716,7 +2716,7 @@ static void BattleAICmd_is_first_turn(void)
|
||||
{
|
||||
u8 bank;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
bank = sBank_AI;
|
||||
else
|
||||
bank = gBankTarget;
|
||||
@@ -2730,7 +2730,7 @@ static void BattleAICmd_get_stockpile_count(void)
|
||||
{
|
||||
u8 bank;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
bank = sBank_AI;
|
||||
else
|
||||
bank = gBankTarget;
|
||||
@@ -2751,7 +2751,7 @@ static void BattleAICmd_get_used_held_item(void)
|
||||
{
|
||||
u8 bank;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
bank = sBank_AI;
|
||||
else
|
||||
bank = gBankTarget;
|
||||
@@ -2791,7 +2791,7 @@ static void BattleAICmd_get_protect_count(void)
|
||||
{
|
||||
u8 bank;
|
||||
|
||||
if (gAIScriptPtr[1] == USER)
|
||||
if (gAIScriptPtr[1] == AI_USER)
|
||||
bank = sBank_AI;
|
||||
else
|
||||
bank = gBankTarget;
|
||||
|
||||
@@ -70,7 +70,6 @@ struct SaveBlocksInOne
|
||||
struct SaveBlock1 sav1;
|
||||
struct PokemonStorage sav3;
|
||||
};
|
||||
|
||||
/*
|
||||
void MoveSaveBlocks_ResetHeap(void)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "global.h"
|
||||
|
||||
EWRAM_DATA u8 gHeap[0x1C000] = {0};
|
||||
|
||||
static void *sHeapStart;
|
||||
static u32 sHeapSize;
|
||||
|
||||
|
||||
231
src/start_menu.c
Normal file
231
src/start_menu.c
Normal file
@@ -0,0 +1,231 @@
|
||||
#include "global.h"
|
||||
#include "start_menu.h"
|
||||
#include "menu.h"
|
||||
#include "safari_zone.h"
|
||||
#include "event_data.h"
|
||||
#include "window.h"
|
||||
#include "string_util.h"
|
||||
#include "text.h"
|
||||
|
||||
// Menu actions
|
||||
enum
|
||||
{
|
||||
MENU_ACTION_POKEDEX,
|
||||
MENU_ACTION_POKEMON,
|
||||
MENU_ACTION_BAG,
|
||||
MENU_ACTION_POKENAV,
|
||||
MENU_ACTION_PLAYER,
|
||||
MENU_ACTION_SAVE,
|
||||
MENU_ACTION_OPTION,
|
||||
MENU_ACTION_EXIT,
|
||||
MENU_ACTION_RETIRE_SAFARI,
|
||||
MENU_ACTION_PLAYER_LINK,
|
||||
MENU_ACTION_REST_FRONTIER,
|
||||
MENU_ACTION_RETIRE_FRONTIER,
|
||||
MENU_ACTION_PYRAMID_BAG
|
||||
};
|
||||
|
||||
static void BuildStartMenuActions_LinkMode(void);
|
||||
static void BuildStartMenuActions_UnionRoom(void);
|
||||
static void BuildStartMenuActions_SafariZone(void);
|
||||
static void BuildStartMenuActions_BattlePike(void);
|
||||
static void BuildStartMenuActions_BattlePyramid(void);
|
||||
static void BuildStartMenuActions_MultiBattleRoom(void);
|
||||
static void BuildStartMenuActions_Normal(void);
|
||||
u8 StartMenu_PlayerName(void);
|
||||
|
||||
extern bool32 is_c1_link_related_active(void);
|
||||
extern bool32 InUnionRoom(void);
|
||||
extern bool8 InBattlePike(void);
|
||||
extern bool8 InBattlePyramid(void);
|
||||
extern bool8 InMultiBattleRoom(void);
|
||||
extern void sub_81973FC(u8 windowId, u8 a1);
|
||||
extern void sub_8198070(u8 windowId, u8 a1);
|
||||
|
||||
EWRAM_DATA u8 sSafariBallsWindowId = 0;
|
||||
EWRAM_DATA u8 sBattlePyramidFloorWindowId = 0;
|
||||
EWRAM_DATA u8 sStartMenuCursorPos = 0;
|
||||
EWRAM_DATA u8 sNumStartMenuActions = 0;
|
||||
EWRAM_DATA u8 sCurrentStartMenuActions[9] = {0};
|
||||
|
||||
void BuildStartMenuActions(void)
|
||||
{
|
||||
sNumStartMenuActions = 0;
|
||||
if (is_c1_link_related_active() == TRUE)
|
||||
BuildStartMenuActions_LinkMode();
|
||||
else if (InUnionRoom() == TRUE)
|
||||
BuildStartMenuActions_UnionRoom();
|
||||
else if (GetSafariZoneFlag() == TRUE)
|
||||
BuildStartMenuActions_SafariZone();
|
||||
else if (InBattlePike())
|
||||
BuildStartMenuActions_BattlePike();
|
||||
else if (InBattlePyramid())
|
||||
BuildStartMenuActions_BattlePyramid();
|
||||
else if (InMultiBattleRoom())
|
||||
BuildStartMenuActions_MultiBattleRoom();
|
||||
else
|
||||
BuildStartMenuActions_Normal();
|
||||
}
|
||||
|
||||
void AddStartMenuAction(u8 action)
|
||||
{
|
||||
AppendToList(sCurrentStartMenuActions, &sNumStartMenuActions, action);
|
||||
}
|
||||
|
||||
static void BuildStartMenuActions_Normal(void)
|
||||
{
|
||||
if (FlagGet(SYS_POKEDEX_GET) == TRUE)
|
||||
AddStartMenuAction(MENU_ACTION_POKEDEX);
|
||||
if (FlagGet(SYS_POKEMON_GET) == TRUE)
|
||||
AddStartMenuAction(MENU_ACTION_POKEMON);
|
||||
AddStartMenuAction(MENU_ACTION_BAG);
|
||||
if (FlagGet(SYS_POKENAV_GET) == TRUE)
|
||||
AddStartMenuAction(MENU_ACTION_POKENAV);
|
||||
AddStartMenuAction(MENU_ACTION_PLAYER);
|
||||
AddStartMenuAction(MENU_ACTION_SAVE);
|
||||
AddStartMenuAction(MENU_ACTION_OPTION);
|
||||
AddStartMenuAction(MENU_ACTION_EXIT);
|
||||
}
|
||||
|
||||
static void BuildStartMenuActions_SafariZone(void)
|
||||
{
|
||||
AddStartMenuAction(MENU_ACTION_RETIRE_SAFARI);
|
||||
AddStartMenuAction(MENU_ACTION_POKEDEX);
|
||||
AddStartMenuAction(MENU_ACTION_POKEMON);
|
||||
AddStartMenuAction(MENU_ACTION_BAG);
|
||||
AddStartMenuAction(MENU_ACTION_PLAYER);
|
||||
AddStartMenuAction(MENU_ACTION_OPTION);
|
||||
AddStartMenuAction(MENU_ACTION_EXIT);
|
||||
}
|
||||
|
||||
static void BuildStartMenuActions_LinkMode(void)
|
||||
{
|
||||
AddStartMenuAction(MENU_ACTION_POKEMON);
|
||||
AddStartMenuAction(MENU_ACTION_BAG);
|
||||
if (FlagGet(SYS_POKENAV_GET) == TRUE)
|
||||
AddStartMenuAction(MENU_ACTION_POKENAV);
|
||||
AddStartMenuAction(MENU_ACTION_PLAYER_LINK);
|
||||
AddStartMenuAction(MENU_ACTION_OPTION);
|
||||
AddStartMenuAction(MENU_ACTION_EXIT);
|
||||
}
|
||||
|
||||
static void BuildStartMenuActions_UnionRoom(void)
|
||||
{
|
||||
AddStartMenuAction(MENU_ACTION_POKEMON);
|
||||
AddStartMenuAction(MENU_ACTION_BAG);
|
||||
if (FlagGet(SYS_POKENAV_GET) == TRUE)
|
||||
AddStartMenuAction(MENU_ACTION_POKENAV);
|
||||
AddStartMenuAction(MENU_ACTION_PLAYER);
|
||||
AddStartMenuAction(MENU_ACTION_OPTION);
|
||||
AddStartMenuAction(MENU_ACTION_EXIT);
|
||||
}
|
||||
|
||||
static void BuildStartMenuActions_BattlePike(void)
|
||||
{
|
||||
AddStartMenuAction(MENU_ACTION_POKEDEX);
|
||||
AddStartMenuAction(MENU_ACTION_POKEMON);
|
||||
AddStartMenuAction(MENU_ACTION_PLAYER);
|
||||
AddStartMenuAction(MENU_ACTION_OPTION);
|
||||
AddStartMenuAction(MENU_ACTION_EXIT);
|
||||
}
|
||||
|
||||
static void BuildStartMenuActions_BattlePyramid(void)
|
||||
{
|
||||
AddStartMenuAction(MENU_ACTION_POKEMON);
|
||||
AddStartMenuAction(MENU_ACTION_PYRAMID_BAG);
|
||||
AddStartMenuAction(MENU_ACTION_PLAYER);
|
||||
AddStartMenuAction(MENU_ACTION_REST_FRONTIER);
|
||||
AddStartMenuAction(MENU_ACTION_RETIRE_FRONTIER);
|
||||
AddStartMenuAction(MENU_ACTION_OPTION);
|
||||
AddStartMenuAction(MENU_ACTION_EXIT);
|
||||
}
|
||||
|
||||
static void BuildStartMenuActions_MultiBattleRoom(void)
|
||||
{
|
||||
AddStartMenuAction(MENU_ACTION_POKEMON);
|
||||
AddStartMenuAction(MENU_ACTION_PLAYER);
|
||||
AddStartMenuAction(MENU_ACTION_OPTION);
|
||||
AddStartMenuAction(MENU_ACTION_EXIT);
|
||||
}
|
||||
|
||||
extern const struct WindowTemplate gSafariBallsWindowTemplate;
|
||||
extern const struct WindowTemplate gPyramidFloorWindowTemplate_1;
|
||||
extern const struct WindowTemplate gPyramidFloorWindowTemplate_2;
|
||||
extern const u8 gOtherText_SafariStock[];
|
||||
|
||||
void DisplaySafariBallsWindow(void)
|
||||
{
|
||||
sSafariBallsWindowId = AddWindow(&gSafariBallsWindowTemplate);
|
||||
PutWindowTilemap(sSafariBallsWindowId);
|
||||
sub_81973FC(sSafariBallsWindowId, 0);
|
||||
ConvertIntToDecimalStringN(gStringVar1, gNumSafariBalls, STR_CONV_MODE_RIGHT_ALIGN, 2);
|
||||
StringExpandPlaceholders(gStringVar4, gOtherText_SafariStock);
|
||||
PrintTextOnWindow(sSafariBallsWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL);
|
||||
CopyWindowToVram(sSafariBallsWindowId, 2);
|
||||
}
|
||||
|
||||
extern const u8* const gUnknown_08510510[];
|
||||
extern const u8 gOtherText_BattlePyramid_X[];
|
||||
|
||||
void DisplayPyramidFloorWindow(void)
|
||||
{
|
||||
// TODO: fix location
|
||||
if (*(u16*)(&gSaveBlock2Ptr->field_CAA[8]) == 7)
|
||||
sBattlePyramidFloorWindowId = AddWindow(&gPyramidFloorWindowTemplate_1);
|
||||
else
|
||||
sBattlePyramidFloorWindowId = AddWindow(&gPyramidFloorWindowTemplate_2);
|
||||
PutWindowTilemap(sBattlePyramidFloorWindowId);
|
||||
sub_81973FC(sBattlePyramidFloorWindowId, 0);
|
||||
StringCopy(gStringVar1, gUnknown_08510510[*(u16*)(&gSaveBlock2Ptr->field_CAA[8])]);
|
||||
StringExpandPlaceholders(gStringVar4, gOtherText_BattlePyramid_X);
|
||||
PrintTextOnWindow(sBattlePyramidFloorWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL);
|
||||
CopyWindowToVram(sBattlePyramidFloorWindowId, 2);
|
||||
}
|
||||
|
||||
void RemoveExtraStartMenuWindows(void)
|
||||
{
|
||||
if (GetSafariZoneFlag())
|
||||
{
|
||||
sub_8198070(sSafariBallsWindowId, 0);
|
||||
CopyWindowToVram(sSafariBallsWindowId, 2);
|
||||
RemoveWindow(sSafariBallsWindowId);
|
||||
}
|
||||
if (InBattlePyramid())
|
||||
{
|
||||
sub_8198070(sBattlePyramidFloorWindowId, 0);
|
||||
RemoveWindow(sBattlePyramidFloorWindowId);
|
||||
}
|
||||
}
|
||||
|
||||
extern const struct MenuAction sStartMenuItems[];
|
||||
|
||||
/*
|
||||
// Prints n menu items starting at *index
|
||||
static bool32 PrintStartMenuItemsMultistep(s16 *index, u32 n)
|
||||
{
|
||||
s8 _index = *index;
|
||||
|
||||
do
|
||||
{
|
||||
if (sStartMenuItems[sCurrentStartMenuActions[_index]].func == StartMenu_PlayerName)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
} while (++_index > sNumStartMenuActions);
|
||||
|
||||
if (--n == 0)
|
||||
{
|
||||
*index = _index;
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
*index = _index;
|
||||
return TRUE;
|
||||
}
|
||||
}*/
|
||||
@@ -149,7 +149,7 @@ void DeactivateAllTextPrinters (void)
|
||||
gTextPrinters[printer].sub_union.sub.active = 0;
|
||||
}
|
||||
|
||||
u16 Print(u8 windowId, u8 fontId, u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextSubPrinter *, u16))
|
||||
u16 PrintTextOnWindow(u8 windowId, u8 fontId, u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextSubPrinter *, u16))
|
||||
{
|
||||
struct TextSubPrinter subPrinter;
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ bool16 InitWindows(struct WindowTemplate *templates)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u16 AddWindow(struct WindowTemplate *template)
|
||||
u16 AddWindow(const struct WindowTemplate *template)
|
||||
{
|
||||
u16 win;
|
||||
u8 bgLayer;
|
||||
|
||||
Reference in New Issue
Block a user