changed debug_config.h to overworld_config.h,

changed no bag use and no catching flags to battle_config.h,
removed TX reference (big sad)
This commit is contained in:
TheXaman 2022-09-02 12:33:42 +02:00
parent ad57551db1
commit 367b12801e
13 changed files with 49 additions and 52 deletions

View File

@ -138,6 +138,8 @@
#define B_FLAG_INVERSE_BATTLE 0 // If this flag is set, the battle's type effectiveness are inversed. For example, fire is super effective against water.
#define B_FLAG_FORCE_DOUBLE_WILD 0 // If this flag is set, all land and surfing wild battles will be double battles.
#define B_SMART_WILD_AI_FLAG 0 // If not 0, you can set this flag in a script to enable smart wild pokemon
#define B_FLAG_NO_BAG_USE FLAG_UNUSED_0x023 // If this flag is set, the debug function in the Utility submenu to disable the bag in battle can be used.
#define B_FLAG_NO_CATCHING FLAG_UNUSED_0x024 // If this flag is set, the debug function in the Utility submenu to disable catching of wild Pokémon can be used.
// Var Settings
// To use the following features in scripting, replace the 0s with the var ID you're assigning it to.

View File

@ -1,15 +0,0 @@
#ifndef GUARD_CONSTANTS_DEBUG_CONFIG_H
#define GUARD_CONSTANTS_DEBUG_CONFIG_H
#define TX_DEBUG_SYSTEM TRUE // Enables a overworld debug menu for changing flags, variables, giving pokemon and more, accessed by pressing R plus START.
#define TX_DEBUG_SYSTEM_IN_MENU FALSE // Replaces the overworld debug menu button combination with a start menu entry (replaces the exit entry).
// Replace the used flags with others or disable with a 0
#define TX_DEBUG_FLAG_NO_COLLISION FLAG_UNUSED_0x020 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used.
#define TX_DEBUG_FLAG_NO_ENCOUNTER FLAG_UNUSED_0x021 // If this flag is set, the debug function in the Utility submenu to disable wild encounters can be used.
#define TX_DEBUG_FLAG_NO_TRAINER_SEE FLAG_UNUSED_0x022 // If this flag is set, the debug function in the Utility submenu to disable battles with trainer can be used.
#define TX_DEBUG_FLAG_NO_BAG_USE FLAG_UNUSED_0x023 // If this flag is set, the debug function in the Utility submenu to disable the bag in battle can be used.
#define TX_DEBUG_FLAG_NO_CATCHING FLAG_UNUSED_0x024 // If this flag is set, the debug function in the Utility submenu to disable catching of wild Pokémon can be used.
#define TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU FLAG_UNUSED_0x025 // If this flag is set, the debug function in debug menu to access the player PC works.
#endif // GUARD_CONSTANTS_DEBUG_CONFIG_H

View File

@ -2,7 +2,7 @@
#define GUARD_CONSTANTS_GLOBAL_H
#include "constants/battle_config.h"
#include "constants/debug_config.h"
#include "constants/overworld_config.h"
// Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen.
// In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen.

View File

@ -0,0 +1,14 @@
#ifndef GUARD_CONSTANTS_OVERWORLD_CONFIG_H
#define GUARD_CONSTANTS_OVERWORLD_CONFIG_H
// Debug options
#define DEBUG_SYSTEM_ENABLE TRUE // Enables a overworld debug menu for changing flags, variables, giving pokemon and more, accessed by pressing R plus START.
#define DEBUG_SYSTEM_IN_MENU FALSE // Replaces the overworld debug menu button combination with a start menu entry (replaces the exit entry).
// Replace the used flags with others or disable with a 0
#define DEBUG_FLAG_NO_COLLISION FLAG_UNUSED_0x020 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used.
#define DEBUG_FLAG_NO_ENCOUNTER FLAG_UNUSED_0x021 // If this flag is set, the debug function in the Utility submenu to disable wild encounters can be used.
#define DEBUG_FLAG_NO_TRAINER_SEE FLAG_UNUSED_0x022 // If this flag is set, the debug function in the Utility submenu to disable battles with trainer can be used.
#define DEBUG_FLAG_PC_FROM_DEBUG_MENU FLAG_UNUSED_0x025 // If this flag is set, the debug function in debug menu to access the player PC works.
#endif // GUARD_CONSTANTS_OVERWORLD_CONFIG_H

View File

@ -1,7 +1,7 @@
#ifndef GUARD_DEBUG_H
#define GUARD_DEBUG_H
#include "constants/debug_config.h"
#include "constants/overworld_config.h"
void Debug_ShowMainMenu(void);

View File

@ -4001,8 +4001,7 @@ static void HandleTurnActionSelectionState(void)
}
break;
case B_ACTION_USE_ITEM:
#if TX_DEBUG_SYSTEM == TRUE
if (FlagGet(TX_DEBUG_FLAG_NO_BAG_USE))
if (FlagGet(B_FLAG_NO_BAG_USE))
{
RecordedBattle_ClearBattlerAction(gActiveBattler, 1);
gSelectionBattleScripts[gActiveBattler] = BattleScript_ActionSelectionItemsCantBeUsed;
@ -4011,7 +4010,6 @@ static void HandleTurnActionSelectionState(void)
*(gBattleStruct->stateIdAfterSelScript + gActiveBattler) = STATE_BEFORE_ACTION_CHOSEN;
return;
}
#endif
if ((gBattleTypeFlags & (BATTLE_TYPE_LINK
| BATTLE_TYPE_FRONTIER_NO_PYRAMID

View File

@ -55,7 +55,7 @@
#include "constants/songs.h"
#include "constants/species.h"
#if TX_DEBUG_SYSTEM == TRUE
#if DEBUG_SYSTEM_ENABLE == TRUE
// *******************************
// Enums
enum { // Main
@ -1447,56 +1447,56 @@ static void DebugAction_Flags_ToggleFrontierPass(u8 taskId)
}
static void DebugAction_Flags_CollisionOnOff(u8 taskId)
{
if(FlagGet(TX_DEBUG_FLAG_NO_COLLISION))
if(FlagGet(DEBUG_FLAG_NO_COLLISION))
{
FlagClear(TX_DEBUG_FLAG_NO_COLLISION);
FlagClear(DEBUG_FLAG_NO_COLLISION);
PlaySE(SE_PC_OFF);
}else{
FlagSet(TX_DEBUG_FLAG_NO_COLLISION);
FlagSet(DEBUG_FLAG_NO_COLLISION);
PlaySE(SE_PC_LOGIN);
}
}
static void DebugAction_Flags_EncounterOnOff(u8 taskId)
{
if(FlagGet(TX_DEBUG_FLAG_NO_ENCOUNTER))
if(FlagGet(DEBUG_FLAG_NO_ENCOUNTER))
{
FlagClear(TX_DEBUG_FLAG_NO_ENCOUNTER);
FlagClear(DEBUG_FLAG_NO_ENCOUNTER);
PlaySE(SE_PC_OFF);
}else{
FlagSet(TX_DEBUG_FLAG_NO_ENCOUNTER);
FlagSet(DEBUG_FLAG_NO_ENCOUNTER);
PlaySE(SE_PC_LOGIN);
}
}
static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId)
{
if(FlagGet(TX_DEBUG_FLAG_NO_TRAINER_SEE))
if(FlagGet(DEBUG_FLAG_NO_TRAINER_SEE))
{
FlagClear(TX_DEBUG_FLAG_NO_TRAINER_SEE);
FlagClear(DEBUG_FLAG_NO_TRAINER_SEE);
PlaySE(SE_PC_OFF);
}else{
FlagSet(TX_DEBUG_FLAG_NO_TRAINER_SEE);
FlagSet(DEBUG_FLAG_NO_TRAINER_SEE);
PlaySE(SE_PC_LOGIN);
}
}
static void DebugAction_Flags_BagUseOnOff(u8 taskId)
{
if(FlagGet(TX_DEBUG_FLAG_NO_BAG_USE))
if(FlagGet(B_FLAG_NO_BAG_USE))
{
FlagClear(TX_DEBUG_FLAG_NO_BAG_USE);
FlagClear(B_FLAG_NO_BAG_USE);
PlaySE(SE_PC_OFF);
}else{
FlagSet(TX_DEBUG_FLAG_NO_BAG_USE);
FlagSet(B_FLAG_NO_BAG_USE);
PlaySE(SE_PC_LOGIN);
}
}
static void DebugAction_Flags_CatchingOnOff(u8 taskId)
{
if(FlagGet(TX_DEBUG_FLAG_NO_CATCHING))
if(FlagGet(B_FLAG_NO_CATCHING))
{
FlagClear(TX_DEBUG_FLAG_NO_CATCHING);
FlagClear(B_FLAG_NO_CATCHING);
PlaySE(SE_PC_OFF);
}else{
FlagSet(TX_DEBUG_FLAG_NO_CATCHING);
FlagSet(B_FLAG_NO_CATCHING);
PlaySE(SE_PC_LOGIN);
}
}
@ -2723,7 +2723,7 @@ static void Task_WaitFadeAccessPC(u8 taskId)
if (!gPaletteFade.active)
{
DestroyTask(taskId);
FlagSet(TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU);
FlagSet(DEBUG_FLAG_PC_FROM_DEBUG_MENU);
EnterPokeStorage(2);
}
}

View File

@ -4630,8 +4630,8 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir)
{
u8 direction = dir;
#if TX_DEBUG_SYSTEM == TRUE
if (FlagGet(TX_DEBUG_FLAG_NO_COLLISION))
#if DEBUG_SYSTEM_ENABLE == TRUE
if (FlagGet(DEBUG_FLAG_NO_COLLISION))
return COLLISION_NONE;
#endif

View File

@ -131,7 +131,7 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys)
else if (heldKeys & DPAD_RIGHT)
input->dpadDirection = DIR_EAST;
#if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == FALSE
#if DEBUG_SYSTEM_ENABLE == TRUE && DEBUG_SYSTEM_IN_MENU == FALSE
if ((heldKeys & R_BUTTON) && input->pressedStartButton)
{
input->input_field_1_2 = TRUE;
@ -197,7 +197,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE)
return TRUE;
#if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == FALSE
#if DEBUG_SYSTEM_ENABLE == TRUE && DEBUG_SYSTEM_IN_MENU == FALSE
if (input->input_field_1_2)
{
PlaySE(SE_WIN_OPEN);
@ -686,8 +686,8 @@ void RestartWildEncounterImmunitySteps(void)
static bool8 CheckStandardWildEncounter(u16 metatileBehavior)
{
#if TX_DEBUG_SYSTEM == TRUE
if (FlagGet(TX_DEBUG_FLAG_NO_ENCOUNTER))
#if DEBUG_SYSTEM_ENABLE == TRUE
if (FlagGet(DEBUG_FLAG_NO_ENCOUNTER))
return FALSE;
#endif

View File

@ -982,14 +982,12 @@ static const u8 sText_CantThrowPokeBall_TwoMons[] = _("Cannot throw a ball!\nThe
static const u8 sText_CantThrowPokeBall_SemiInvulnerable[] = _("Cannot throw a ball!\nThere's no Pokémon in sight!\p");
void ItemUseInBattle_PokeBall(u8 taskId)
{
#if TX_DEBUG_SYSTEM == TRUE
if (FlagGet(TX_DEBUG_FLAG_NO_CATCHING))
if (FlagGet(B_FLAG_NO_CATCHING))
{
static const u8 sText_BallsCannotBeUsed[] = _("Poké Balls cannot be used\nright now!\p");
DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, CloseItemMessage);
return;
}
#endif
switch (GetBallThrowableState())
{

View File

@ -1669,7 +1669,7 @@ static void FieldTask_ReturnToPcMenu(void)
MainCallback vblankCb = gMain.vblankCallback;
SetVBlankCallback(NULL);
if (!FlagGet(TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU))
if (!FlagGet(DEBUG_FLAG_PC_FROM_DEBUG_MENU))
{
taskId = CreateTask(Task_PCMainMenu, 80);
gTasks[taskId].tState = 0;
@ -1678,7 +1678,7 @@ static void FieldTask_ReturnToPcMenu(void)
}
else
{
FlagClear(TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU);
FlagClear(DEBUG_FLAG_PC_FROM_DEBUG_MENU);
ScriptContext_Enable();
}
SetVBlankCallback(vblankCb);

View File

@ -286,7 +286,7 @@ static void BuildStartMenuActions(void)
}
else
{
#if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == TRUE
#if DEBUG_SYSTEM_ENABLE == TRUE && DEBUG_SYSTEM_IN_MENU == TRUE
BuildDebugStartMenu();
#else
BuildNormalStartMenu();
@ -760,7 +760,7 @@ static bool8 StartMenuDebugCallback(void)
RemoveExtraStartMenuWindows();
HideStartMenuDebug(); // Hide start menu without enabling movement
#if TX_DEBUG_SYSTEM == TRUE
#if DEBUG_SYSTEM_ENABLE == TRUE
Debug_ShowMainMenu();
#endif

View File

@ -193,8 +193,8 @@ bool8 CheckForTrainersWantingBattle(void)
{
u8 i;
#if TX_DEBUG_SYSTEM == TRUE
if (FlagGet(TX_DEBUG_FLAG_NO_TRAINER_SEE))
#if DEBUG_SYSTEM_ENABLE == TRUE
if (FlagGet(DEBUG_FLAG_NO_TRAINER_SEE))
return FALSE;
#endif