mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Implementation if Pyredrid and AsparagusEduardo debug menu plus huge rewrite and tons of additions
V2: Fly, Warp, Flags, Vars, give items, give pkm 2 versions Improved cheats, reworked the vars system vars function now starts at VARS_START and end VARS_END Figured out how to display FieldMessages, reimplemented CheckSafeBlock, cleanup DebugAction_DestroyExtraWindow instead of multiple, renamed text variables cleanup + pokemon simple give pokemon complex nearly done Complex pkm works, items now with icons if statement cleanup alter build tools to include maps per map group Warp functionallity added hex value to flags and vars cleanup Credits
This commit is contained in:
parent
16ecbc6446
commit
6456009a44
1
.gitignore
vendored
1
.gitignore
vendored
@ -33,3 +33,4 @@ porymap.project.cfg
|
|||||||
.vscode/
|
.vscode/
|
||||||
*.a
|
*.a
|
||||||
.fuse_hidden*
|
.fuse_hidden*
|
||||||
|
mgba.sh
|
||||||
|
6
Makefile
6
Makefile
@ -248,6 +248,12 @@ ifeq ($(DINFO),1)
|
|||||||
override CFLAGS += -g
|
override CFLAGS += -g
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# DebugMenu
|
||||||
|
ifeq ($(DDEBUG),1)
|
||||||
|
override ASFLAGS += --defsym DEBUG=1
|
||||||
|
override CPPFLAGS += -D DEBUG=1
|
||||||
|
endif
|
||||||
|
|
||||||
$(C_BUILDDIR)/%.o : $(C_SUBDIR)/%.c $$(c_dep)
|
$(C_BUILDDIR)/%.o : $(C_SUBDIR)/%.c $$(c_dep)
|
||||||
@$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i
|
@$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i
|
||||||
@$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CFLAGS) -o $(C_BUILDDIR)/$*.s
|
@$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CFLAGS) -o $(C_BUILDDIR)/$*.s
|
||||||
|
@ -576,6 +576,8 @@ gStdScripts_End:: @ 81DC2CC
|
|||||||
.include "data/scripts/new_game.inc"
|
.include "data/scripts/new_game.inc"
|
||||||
.include "data/scripts/hall_of_fame.inc"
|
.include "data/scripts/hall_of_fame.inc"
|
||||||
|
|
||||||
|
.include "data/scripts/debug.inc"
|
||||||
|
|
||||||
EventScript_WhiteOut:: @ 8271857
|
EventScript_WhiteOut:: @ 8271857
|
||||||
call EverGrandeCity_HallOfFame_EventScript_ResetEliteFour
|
call EverGrandeCity_HallOfFame_EventScript_ResetEliteFour
|
||||||
goto EventScript_ResetMrBriney
|
goto EventScript_ResetMrBriney
|
||||||
|
60
data/scripts/debug.inc
Normal file
60
data/scripts/debug.inc
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
Debug_ShowFieldMessageStringVar4::
|
||||||
|
special ShowFieldMessageStringVar4
|
||||||
|
waitmessage
|
||||||
|
waitbuttonpress
|
||||||
|
releaseall
|
||||||
|
end
|
||||||
|
|
||||||
|
Debug_CheckWeekDay_Text:
|
||||||
|
.string "Aaaaah, yes!\l"
|
||||||
|
.string "{STR_VAR_1}s are made for dads!\l"
|
||||||
|
.string "And dad's car!$"
|
||||||
|
|
||||||
|
Debug_CheatStart::
|
||||||
|
lockall
|
||||||
|
setflag FLAG_SYS_POKEMON_GET
|
||||||
|
setflag FLAG_RESCUED_BIRCH
|
||||||
|
setflag FLAG_HIDE_ROUTE_101_BIRCH_ZIGZAGOON_BATTLE
|
||||||
|
clearflag FLAG_HIDE_LITTLEROOT_TOWN_BIRCHS_LAB_BIRCH
|
||||||
|
setflag FLAG_HIDE_ROUTE_101_BIRCH_STARTERS_BAG
|
||||||
|
setvar VAR_BIRCH_LAB_STATE, 2
|
||||||
|
setvar VAR_ROUTE101_STATE, 3
|
||||||
|
givemon SPECIES_TREECKO, 20, ITEM_NONE
|
||||||
|
givemon SPECIES_TORCHIC, 20, ITEM_NONE
|
||||||
|
givemon SPECIES_MUDKIP, 20, ITEM_NONE
|
||||||
|
setflag FLAG_SYS_POKEDEX_GET
|
||||||
|
special SetUnlockedPokedexFlags
|
||||||
|
setflag FLAG_RECEIVED_POKEDEX_FROM_BIRCH
|
||||||
|
setvar VAR_CABLE_CLUB_TUTORIAL_STATE, 1
|
||||||
|
@ setflag FLAG_SYS_NATIONAL_DEX
|
||||||
|
@ special EnableNationalPokedex
|
||||||
|
setflag FLAG_RECEIVED_RUNNING_SHOES
|
||||||
|
setflag FLAG_SYS_B_DASH
|
||||||
|
setvar VAR_LITTLEROOT_TOWN_STATE, 4 @ 4: Received Running Shoes
|
||||||
|
setvar VAR_LITTLEROOT_INTRO_STATE, 7 @ 7: Told to go meet rival
|
||||||
|
setvar VAR_LITTLEROOT_HOUSES_STATE_BRENDAN, 2 @ 2: Met Rival's Mom (and is corresponding gender)
|
||||||
|
setvar VAR_LITTLEROOT_HOUSES_STATE_MAY, 2 @ 2: Met Rival's Mom (and is corresponding gender)
|
||||||
|
setvar VAR_LITTLEROOT_RIVAL_STATE, 4 @ 4: Received Pokedex
|
||||||
|
setflag FLAG_RECEIVED_BIKE
|
||||||
|
giveitem ITEM_ACRO_BIKE
|
||||||
|
setvar VAR_BRINEY_HOUSE_STATE, 1
|
||||||
|
setvar VAR_ROUTE116_STATE, 2
|
||||||
|
setflag FLAG_HIDE_ROUTE_116_MR_BRINEY
|
||||||
|
clearflag FLAG_HIDE_BRINEYS_HOUSE_MR_BRINEY
|
||||||
|
clearflag FLAG_HIDE_BRINEYS_HOUSE_PEEKO
|
||||||
|
@ additem ITEM_MAX_REPEL, 10
|
||||||
|
@ giveitem ITEM_EON_TICKET
|
||||||
|
@ setflag FLAG_SYS_HAS_EON_TICKET
|
||||||
|
@ setvar VAR_DISTRIBUTE_EON_TICKET, 0
|
||||||
|
@ giveitem ITEM_MYSTIC_TICKET
|
||||||
|
@ setflag FLAG_ENABLE_SHIP_NAVEL_ROCK
|
||||||
|
@ setflag FLAG_RECEIVED_MYSTIC_TICKET
|
||||||
|
@ giveitem ITEM_AURORA_TICKET
|
||||||
|
@ setflag FLAG_ENABLE_SHIP_BIRTH_ISLAND
|
||||||
|
@ setflag FLAG_RECEIVED_AURORA_TICKET
|
||||||
|
@ setflag FLAG_BADGE06_GET @ Badge for flying filed move
|
||||||
|
@ setweather WEATHER_VOLCANIC_ASH
|
||||||
|
@ doweather
|
||||||
|
closemessage
|
||||||
|
release
|
||||||
|
end
|
@ -40,12 +40,12 @@
|
|||||||
#define FLAG_TEMP_1E (TEMP_FLAGS_START + 0x1E)
|
#define FLAG_TEMP_1E (TEMP_FLAGS_START + 0x1E)
|
||||||
#define FLAG_TEMP_1F (TEMP_FLAGS_START + 0x1F)
|
#define FLAG_TEMP_1F (TEMP_FLAGS_START + 0x1F)
|
||||||
#define TEMP_FLAGS_END FLAG_TEMP_1F
|
#define TEMP_FLAGS_END FLAG_TEMP_1F
|
||||||
|
|
||||||
#define FLAG_UNUSED_0x020 0x20 // Unused Flag
|
#define FLAG_SYS_NO_COLLISION 0x20 // Unused Flag //DEBUG
|
||||||
#define FLAG_UNUSED_0x021 0x21 // Unused Flag
|
#define FLAG_SYS_NO_ENCOUNTER 0x21 // Unused Flag //DEBUG
|
||||||
#define FLAG_UNUSED_0x022 0x22 // Unused Flag
|
#define FLAG_SYS_NO_TRAINER_SEE 0x22 // Unused Flag //DEBUG
|
||||||
#define FLAG_UNUSED_0x023 0x23 // Unused Flag
|
#define FLAG_SYS_NO_BAG_USE 0x23 // Unused Flag //DEBUG
|
||||||
#define FLAG_UNUSED_0x024 0x24 // Unused Flag
|
#define FLAG_SYS_NO_CATCHING 0x24 // Unused Flag //DEBUG
|
||||||
#define FLAG_UNUSED_0x025 0x25 // Unused Flag
|
#define FLAG_UNUSED_0x025 0x25 // Unused Flag
|
||||||
#define FLAG_UNUSED_0x026 0x26 // Unused Flag
|
#define FLAG_UNUSED_0x026 0x26 // Unused Flag
|
||||||
#define FLAG_UNUSED_0x027 0x27 // Unused Flag
|
#define FLAG_UNUSED_0x027 0x27 // Unused Flag
|
||||||
|
@ -593,4 +593,6 @@
|
|||||||
|
|
||||||
#define MAP_GROUPS_COUNT 34
|
#define MAP_GROUPS_COUNT 34
|
||||||
|
|
||||||
|
// static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0};
|
||||||
|
|
||||||
#endif // GUARD_CONSTANTS_MAP_GROUPS_H
|
#endif // GUARD_CONSTANTS_MAP_GROUPS_H
|
||||||
|
8
include/debug.h
Normal file
8
include/debug.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef GUARD_DEBUG_H
|
||||||
|
#define GUARD_DEBUG_H
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
void Debug_ShowMainMenu(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // GUARD_DEBUG_H
|
@ -20,10 +20,12 @@ void EnableResetRTC(void);
|
|||||||
bool32 CanResetRTC(void);
|
bool32 CanResetRTC(void);
|
||||||
u16 *GetVarPointer(u16 id);
|
u16 *GetVarPointer(u16 id);
|
||||||
u16 VarGet(u16 id);
|
u16 VarGet(u16 id);
|
||||||
|
u16 VarGetIfExist(u16 id);
|
||||||
bool8 VarSet(u16 id, u16 value);
|
bool8 VarSet(u16 id, u16 value);
|
||||||
u8 VarGetObjectEventGraphicsId(u8 id);
|
u8 VarGetObjectEventGraphicsId(u8 id);
|
||||||
u8 *GetFlagPointer(u16 id);
|
u8 *GetFlagPointer(u16 id);
|
||||||
u8 FlagSet(u16 id);
|
u8 FlagSet(u16 id);
|
||||||
|
u8 FlagToggle(u16 id);
|
||||||
u8 FlagClear(u16 id);
|
u8 FlagClear(u16 id);
|
||||||
bool8 FlagGet(u16 id);
|
bool8 FlagGet(u16 id);
|
||||||
|
|
||||||
|
@ -99,6 +99,7 @@ SECTIONS {
|
|||||||
src/random.o(.text);
|
src/random.o(.text);
|
||||||
src/util.o(.text);
|
src/util.o(.text);
|
||||||
src/daycare.o(.text);
|
src/daycare.o(.text);
|
||||||
|
src/debug.o(.text);
|
||||||
src/egg_hatch.o(.text);
|
src/egg_hatch.o(.text);
|
||||||
src/battle_interface.o(.text);
|
src/battle_interface.o(.text);
|
||||||
src/battle_anim_smokescreen.o(.text);
|
src/battle_anim_smokescreen.o(.text);
|
||||||
@ -482,6 +483,7 @@ SECTIONS {
|
|||||||
src/trig.o(.rodata);
|
src/trig.o(.rodata);
|
||||||
src/util.o(.rodata);
|
src/util.o(.rodata);
|
||||||
src/daycare.o(.rodata);
|
src/daycare.o(.rodata);
|
||||||
|
src/debug.o(.rodata);
|
||||||
src/egg_hatch.o(.rodata);
|
src/egg_hatch.o(.rodata);
|
||||||
src/battle_gfx_sfx_util.o(.rodata);
|
src/battle_gfx_sfx_util.o(.rodata);
|
||||||
src/battle_interface.o(.rodata);
|
src/battle_interface.o(.rodata);
|
||||||
|
@ -4259,7 +4259,7 @@ static void HandleTurnActionSelectionState(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case B_ACTION_USE_ITEM:
|
case B_ACTION_USE_ITEM:
|
||||||
if (gBattleTypeFlags & (BATTLE_TYPE_LINK
|
if (FlagGet(FLAG_SYS_NO_BAG_USE) || gBattleTypeFlags & (BATTLE_TYPE_LINK //DEBUG
|
||||||
| BATTLE_TYPE_FRONTIER_NO_PYRAMID
|
| BATTLE_TYPE_FRONTIER_NO_PYRAMID
|
||||||
| BATTLE_TYPE_EREADER_TRAINER
|
| BATTLE_TYPE_EREADER_TRAINER
|
||||||
| BATTLE_TYPE_x2000000))
|
| BATTLE_TYPE_x2000000))
|
||||||
|
2008
src/debug.c
Normal file
2008
src/debug.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -184,6 +184,14 @@ u16 VarGet(u16 id)
|
|||||||
return *ptr;
|
return *ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u16 VarGetIfExist(u16 id)
|
||||||
|
{
|
||||||
|
u16 *ptr = GetVarPointer(id);
|
||||||
|
if (!ptr)
|
||||||
|
return 65535;
|
||||||
|
return *ptr;
|
||||||
|
}
|
||||||
|
|
||||||
bool8 VarSet(u16 id, u16 value)
|
bool8 VarSet(u16 id, u16 value)
|
||||||
{
|
{
|
||||||
u16 *ptr = GetVarPointer(id);
|
u16 *ptr = GetVarPointer(id);
|
||||||
@ -216,6 +224,14 @@ u8 FlagSet(u16 id)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u8 FlagToggle(u16 id)
|
||||||
|
{
|
||||||
|
u8 *ptr = GetFlagPointer(id);
|
||||||
|
if (ptr)
|
||||||
|
*ptr ^= 1 << (id & 7);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
u8 FlagClear(u16 id)
|
u8 FlagClear(u16 id)
|
||||||
{
|
{
|
||||||
u8 *ptr = GetFlagPointer(id);
|
u8 *ptr = GetFlagPointer(id);
|
||||||
|
@ -4723,6 +4723,12 @@ static u8 GetCollisionInDirection(struct ObjectEvent *objectEvent, u8 direction)
|
|||||||
u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir)
|
u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir)
|
||||||
{
|
{
|
||||||
u8 direction = dir;
|
u8 direction = dir;
|
||||||
|
|
||||||
|
#if DEBUG //DEBUG
|
||||||
|
if (FlagGet(FLAG_SYS_NO_COLLISION))
|
||||||
|
return COLLISION_NONE;
|
||||||
|
#endif //
|
||||||
|
|
||||||
if (IsCoordOutsideObjectEventMovementRange(objectEvent, x, y))
|
if (IsCoordOutsideObjectEventMovementRange(objectEvent, x, y))
|
||||||
return COLLISION_OUTSIDE_RANGE;
|
return COLLISION_OUTSIDE_RANGE;
|
||||||
else if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(objectEvent, x, y, direction))
|
else if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(objectEvent, x, y, direction))
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "bike.h"
|
#include "bike.h"
|
||||||
#include "coord_event_weather.h"
|
#include "coord_event_weather.h"
|
||||||
#include "daycare.h"
|
#include "daycare.h"
|
||||||
|
#include "debug.h"
|
||||||
#include "faraway_island.h"
|
#include "faraway_island.h"
|
||||||
#include "event_data.h"
|
#include "event_data.h"
|
||||||
#include "event_object_movement.h"
|
#include "event_object_movement.h"
|
||||||
@ -130,6 +131,35 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys)
|
|||||||
input->dpadDirection = DIR_WEST;
|
input->dpadDirection = DIR_WEST;
|
||||||
else if (heldKeys & DPAD_RIGHT)
|
else if (heldKeys & DPAD_RIGHT)
|
||||||
input->dpadDirection = DIR_EAST;
|
input->dpadDirection = DIR_EAST;
|
||||||
|
|
||||||
|
|
||||||
|
//DEBUG
|
||||||
|
if (heldKeys & R_BUTTON)
|
||||||
|
{
|
||||||
|
if(input->pressedSelectButton)
|
||||||
|
{
|
||||||
|
input->input_field_1_0 = TRUE;
|
||||||
|
input->pressedSelectButton = FALSE;
|
||||||
|
}else if(input->pressedStartButton)
|
||||||
|
{
|
||||||
|
input->input_field_1_2 = TRUE;
|
||||||
|
input->pressedStartButton = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (heldKeys & L_BUTTON)
|
||||||
|
{
|
||||||
|
if(input->pressedSelectButton)
|
||||||
|
{
|
||||||
|
input->input_field_1_1 = TRUE;
|
||||||
|
input->pressedSelectButton = FALSE;
|
||||||
|
}else if(input->pressedStartButton)
|
||||||
|
{
|
||||||
|
input->input_field_1_3 = TRUE;
|
||||||
|
input->pressedStartButton = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ProcessPlayerFieldInput(struct FieldInput *input)
|
int ProcessPlayerFieldInput(struct FieldInput *input)
|
||||||
@ -189,6 +219,15 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
|
|||||||
if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE)
|
if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
if (input->input_field_1_2)
|
||||||
|
{
|
||||||
|
PlaySE(SE_WIN_OPEN);
|
||||||
|
Debug_ShowMainMenu();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -668,6 +707,9 @@ void RestartWildEncounterImmunitySteps(void)
|
|||||||
|
|
||||||
static bool8 CheckStandardWildEncounter(u16 metatileBehavior)
|
static bool8 CheckStandardWildEncounter(u16 metatileBehavior)
|
||||||
{
|
{
|
||||||
|
if (FlagGet(FLAG_SYS_NO_ENCOUNTER)) //DEBUG
|
||||||
|
return FALSE;//
|
||||||
|
|
||||||
if (sWildEncounterImmunitySteps < 4)
|
if (sWildEncounterImmunitySteps < 4)
|
||||||
{
|
{
|
||||||
sWildEncounterImmunitySteps++;
|
sWildEncounterImmunitySteps++;
|
||||||
@ -683,7 +725,7 @@ static bool8 CheckStandardWildEncounter(u16 metatileBehavior)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sPreviousPlayerMetatileBehavior = metatileBehavior;
|
sPreviousPlayerMetatileBehavior = metatileBehavior;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool8 TryArrowWarp(struct MapPosition *position, u16 metatileBehavior, u8 direction)
|
static bool8 TryArrowWarp(struct MapPosition *position, u16 metatileBehavior, u8 direction)
|
||||||
|
@ -938,7 +938,11 @@ void ItemUseOutOfBattle_EvolutionStone(u8 taskId)
|
|||||||
|
|
||||||
void ItemUseInBattle_PokeBall(u8 taskId)
|
void ItemUseInBattle_PokeBall(u8 taskId)
|
||||||
{
|
{
|
||||||
if (IsPlayerPartyAndPokemonStorageFull() == FALSE) // have room for mon?
|
if (FlagGet(FLAG_SYS_NO_CATCHING)){ //DEBUG
|
||||||
|
static const u8 sText_BallsCannotBeUsed[] = _("Poké Balls cannot be used\nright now!\p");
|
||||||
|
DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, BagMenu_InitListsMenu);
|
||||||
|
} //
|
||||||
|
else if (IsPlayerPartyAndPokemonStorageFull() == FALSE) // have room for mon?
|
||||||
{
|
{
|
||||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||||
if (!InBattlePyramid())
|
if (!InBattlePyramid())
|
||||||
|
@ -94,7 +94,7 @@ static void InitPlayerTrainerId(void)
|
|||||||
// L=A isnt set here for some reason.
|
// L=A isnt set here for some reason.
|
||||||
static void SetDefaultOptions(void)
|
static void SetDefaultOptions(void)
|
||||||
{
|
{
|
||||||
gSaveBlock2Ptr->optionsTextSpeed = OPTIONS_TEXT_SPEED_MID;
|
gSaveBlock2Ptr->optionsTextSpeed = OPTIONS_TEXT_SPEED_FAST;
|
||||||
gSaveBlock2Ptr->optionsWindowFrameType = 0;
|
gSaveBlock2Ptr->optionsWindowFrameType = 0;
|
||||||
gSaveBlock2Ptr->optionsSound = OPTIONS_SOUND_MONO;
|
gSaveBlock2Ptr->optionsSound = OPTIONS_SOUND_MONO;
|
||||||
gSaveBlock2Ptr->optionsBattleStyle = OPTIONS_BATTLE_STYLE_SHIFT;
|
gSaveBlock2Ptr->optionsBattleStyle = OPTIONS_BATTLE_STYLE_SHIFT;
|
||||||
|
@ -177,6 +177,11 @@ bool8 CheckForTrainersWantingBattle(void)
|
|||||||
{
|
{
|
||||||
u8 i;
|
u8 i;
|
||||||
|
|
||||||
|
#if DEBUG //DEBUG
|
||||||
|
if (FlagGet(FLAG_SYS_NO_TRAINER_SEE))
|
||||||
|
return FALSE;
|
||||||
|
#endif //
|
||||||
|
|
||||||
gNoOfApproachingTrainers = 0;
|
gNoOfApproachingTrainers = 0;
|
||||||
gApproachingTrainerId = 0;
|
gApproachingTrainerId = 0;
|
||||||
|
|
||||||
|
@ -393,11 +393,14 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
|
|||||||
text << "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n//\n\n";
|
text << "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n//\n\n";
|
||||||
|
|
||||||
int group_num = 0;
|
int group_num = 0;
|
||||||
|
vector<int> map_count_vec; //DEBUG
|
||||||
|
|
||||||
for (auto &group : groups_data["group_order"].array_items()) {
|
for (auto &group : groups_data["group_order"].array_items()) {
|
||||||
text << "// Map Group " << group_num << "\n";
|
text << "// Map Group " << group_num << "\n";
|
||||||
vector<Json> map_ids;
|
vector<Json> map_ids;
|
||||||
size_t max_length = 0;
|
|
||||||
|
size_t max_length = 0; //DEBUG
|
||||||
|
int map_count = 0; //DEBUG
|
||||||
|
|
||||||
for (auto &map_name : groups_data[group.string_value()].array_items()) {
|
for (auto &map_name : groups_data[group.string_value()].array_items()) {
|
||||||
string header_filepath = file_dir + map_name.string_value() + dir_separator + "map.json";
|
string header_filepath = file_dir + map_name.string_value() + dir_separator + "map.json";
|
||||||
@ -406,6 +409,7 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
|
|||||||
map_ids.push_back(map_data["id"]);
|
map_ids.push_back(map_data["id"]);
|
||||||
if (map_data["id"].string_value().length() > max_length)
|
if (map_data["id"].string_value().length() > max_length)
|
||||||
max_length = map_data["id"].string_value().length();
|
max_length = map_data["id"].string_value().length();
|
||||||
|
map_count++; //DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
int map_id_num = 0;
|
int map_id_num = 0;
|
||||||
@ -416,9 +420,17 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
|
|||||||
text << "\n";
|
text << "\n";
|
||||||
|
|
||||||
group_num++;
|
group_num++;
|
||||||
|
map_count_vec.push_back(map_count); //DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
text << "#define MAP_GROUPS_COUNT " << group_num << "\n\n";
|
text << "#define MAP_GROUPS_COUNT " << group_num << "\n\n";
|
||||||
|
|
||||||
|
text << "// static const u8 MAP_GROUP_COUNT[] = {"; //DEBUG
|
||||||
|
for(int i=0; i<group_num; i++){ //DEBUG
|
||||||
|
text << map_count_vec[i] << ", "; //DEBUG
|
||||||
|
} //DEBUG
|
||||||
|
text << "0};\n\n"; //DEBUG
|
||||||
|
|
||||||
text << "#endif // GUARD_CONSTANTS_MAP_GROUPS_H\n";
|
text << "#endif // GUARD_CONSTANTS_MAP_GROUPS_H\n";
|
||||||
|
|
||||||
return text.str();
|
return text.str();
|
||||||
|
Loading…
Reference in New Issue
Block a user