Skip to content

Commit 39110c2

Browse files
committed
Bug Fix + Additional Actor Names
Fixed chests not being reset when flags are cleared. The flags are now only cleared during a screen transition. Filled in more of the previously unknown actor names.
1 parent b8bedfa commit 39110c2

File tree

6 files changed

+49
-10
lines changed

6 files changed

+49
-10
lines changed

ttyd-tools/rel/source/codes.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,42 @@ void spawnItem()
587587
}
588588
}
589589

590+
void checkIfAreaFlagsShouldBeCleared()
591+
{
592+
// Only run when the player has chosen to clear some flags
593+
if (!ClearAreaFlags.FlagsShouldBeCleared)
594+
{
595+
return;
596+
}
597+
598+
// Check to see if currently in the process of clearing flags or not
599+
if (!ClearAreaFlags.StartClearingFlags)
600+
{
601+
// Only run if currently in a screen transition
602+
if (!checkForSpecificSeq(ttyd::seqdrv::SeqIndex::kMapChange))
603+
{
604+
return;
605+
}
606+
607+
// Set up the flags to be cleared
608+
ClearAreaFlags.StartClearingFlags = true;
609+
}
610+
else
611+
{
612+
// Keep resetting the flags until the seq changes to Game
613+
if (!checkForSpecificSeq(ttyd::seqdrv::SeqIndex::kGame))
614+
{
615+
// Clear the currently-selected flags
616+
cheatClearAreaFlags(ClearAreaFlags.CurrentOption);
617+
}
618+
else
619+
{
620+
ClearAreaFlags.FlagsShouldBeCleared = false;
621+
ClearAreaFlags.StartClearingFlags = false;
622+
}
623+
}
624+
}
625+
590626
void displaySequenceInPauseMenu()
591627
{
592628
uint32_t PauseMenuAddress = *reinterpret_cast<uint32_t *>(PauseMenuStartAddress);

ttyd-tools/rel/source/draw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2516,7 +2516,7 @@ void drawTitleScreenInfo()
25162516
PosX += 113;
25172517
PosY -= 14;
25182518

2519-
const char *String = "Practice Codes v3.0.1\nCreated by Zephiles";
2519+
const char *String = "Practice Codes v3.0.2\nCreated by Zephiles";
25202520
drawText(String, PosX, PosY, Alpha, TextColor, Scale);
25212521
}
25222522

ttyd-tools/rel/source/global.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,9 @@ const char *BattlesActorsLines[] =
459459
"Unknown 174",
460460
"Unknown 175",
461461
"Unknown 176",
462-
"Unknown 177",
463-
"Unknown 178",
464-
"Unknown 179",
462+
"Goombella - Action Commands Tutorial",
463+
"Frankly - Action Commands Tutorial",
464+
"Frankly - Special Moves Tutorial",
465465
"Frankly - Goomba Trio Fight",
466466
"Unknown 181",
467467
"Unknown 182",
@@ -503,7 +503,7 @@ const char *BattlesActorsLines[] =
503503
"Unknown 218",
504504
"Bomb Squad - Bomb",
505505
"System",
506-
"Unknown 221",
506+
"Goombella - Prologue - Lord Crump Fight",
507507
"Mario",
508508
"Shell Shield",
509509
"Goombella",
@@ -735,8 +735,9 @@ struct AutoIncrement AdjustableValueMenu;
735735
struct CheatsHandleDisplayButtons CheatsDisplayButtons;
736736
struct MarioPartnerPositionsStruct MarioPartnerPositions;
737737
struct SaveAnywhereStruct SaveAnywhere;
738-
struct SpawnItems SpawnItem;
739738
struct ReloadRoomStruct ReloadRoom;
739+
struct SpawnItems SpawnItem;
740+
struct ClearAreaFlagsStruct ClearAreaFlags;
740741
struct TrickDisplay YoshiSkip;
741742
struct TrickDisplay PalaceSkip;
742743
struct OnScreenTimerDisplay OnScreenTimer;

ttyd-tools/rel/source/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ void Mod::run()
550550
saveAnywhere(); // Needs to always run due to the script taking more than one frame
551551
reloadRoom(); // Needs to always run due to the extra code that always does some failsafe checking
552552
bobberyEarly();
553+
checkIfAreaFlagsShouldBeCleared();
553554

554555
// Run each display function
555556
// Only run if the mod menu isn't currently open

ttyd-tools/rel/source/menu.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,8 @@ void menuCheckButton()
852852
case 0:
853853
{
854854
// Selected yes
855-
cheatClearAreaFlags();
855+
ClearAreaFlags.CurrentOption = MenuSecondaryValue;
856+
ClearAreaFlags.FlagsShouldBeCleared = true;
856857
SelectedOption = 0;
857858
break;
858859
}
@@ -2230,7 +2231,7 @@ void drawMenu()
22302231
// Draw the window asking for confirmation to clear the flags
22312232
if (tempSelectedOption == CLEAR_FLAGS)
22322233
{
2233-
const char *ConfirmationMessage = "This will clear all of the GSWF's for the\nselected area. Are you sure you want\nto do this?";
2234+
const char *ConfirmationMessage = "This will clear all of the GSWF's for the\nselected area when the area is reloaded.\nAre you sure you want to do this?";
22342235
drawConfirmationWindow(ConfirmationMessage);
22352236
}
22362237
break;

ttyd-tools/rel/source/menufunctions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,12 +1980,12 @@ int32_t changeItem()
19801980
return 0;
19811981
}
19821982

1983-
void cheatClearAreaFlags()
1983+
void cheatClearAreaFlags(uint32_t currentMenuOption)
19841984
{
19851985
uint32_t LowerBound;
19861986
uint32_t UpperBound;
19871987

1988-
switch (MenuSecondaryValue)
1988+
switch (currentMenuOption)
19891989
{
19901990
case AREA_GOR:
19911991
{

0 commit comments

Comments
 (0)