Skip to content

Commit 2620149

Browse files
committed
Properly reset values when closing the menu
Also properly restored the Memory Watch coordinates if they were currently being modified.
1 parent b5a857c commit 2620149

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

ttyd-tools/rel/include/menufunctions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ bool checkForClosingErrorMessage();
2727
void correctInventoryCurrentMenuOptionAndPage(uint32_t maxOptionsPerPage);
2828
uint32_t getHighestAdjustableValueDigit(uint32_t currentMenu);
2929
int32_t getDigitBeingChanged(int32_t number, int32_t valueChangedBy);
30-
int32_t getDigitBeingChangedUnsignedHex(uint32_t number, int32_t valueChangedBy);
3130
void setAdjustableValueToMax(uint32_t currentMenu);
3231
void setAdjustableValueToMin(uint32_t currentMenu);
3332
uint32_t adjustableValueButtonControls(uint32_t currentMenu);

ttyd-tools/rel/source/draw.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3044,6 +3044,10 @@ void drawMemoryWatchesOnOverworld()
30443044
uint32_t tempMenuSelectionOption = MenuSelectedOption;
30453045
uint32_t Size = sizeof(MemoryWatch) / sizeof(MemoryWatch[0]);
30463046

3047+
uint32_t Color = 0xFFFFFFFF;
3048+
uint8_t Alpha = 0xFF;
3049+
float Scale = 0.75;
3050+
30473051
for (uint32_t i = 0; i < Size; i++)
30483052
{
30493053
if (MemoryWatch[i].Display)
@@ -3056,9 +3060,6 @@ void drawMemoryWatchesOnOverworld()
30563060
else
30573061
{
30583062
// Draw the watch
3059-
uint32_t Color = 0xFFFFFFFF;
3060-
uint8_t Alpha = 0xFF;
3061-
float Scale = 0.75;
30623063
int32_t PosX = MemoryWatch[i].PosX;
30633064
int32_t PosY = MemoryWatch[i].PosY;
30643065
drawText(getValueString(i), PosX, PosY, Alpha, Color, Scale);

ttyd-tools/rel/source/global.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace mod {
88

9-
const char *VersionNumber = "v3.0.14";
9+
const char *VersionNumber = "v3.0.15";
1010

1111
const char *RootLines[] =
1212
{

ttyd-tools/rel/source/menu.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3202,6 +3202,19 @@ void enableOrDisableMenu()
32023202
}
32033203
else
32043204
{
3205+
if (HideMenu)
3206+
{
3207+
// Restore the memory watch default position if currently modifying it
3208+
if (CurrentMenu == MEMORY_MODIFY)
3209+
{
3210+
uint32_t tempMenuSelectedOption = MenuSelectedOption;
3211+
MemoryWatch[tempMenuSelectedOption].PosX = MemoryWatchPosition.PosX;
3212+
MemoryWatch[tempMenuSelectedOption].PosY = MemoryWatchPosition.PosY;
3213+
}
3214+
}
3215+
3216+
resetMenuToRoot();
3217+
32053218
// Lower the System Level if not in a battle
32063219
lowerSystemLevel();
32073220

ttyd-tools/rel/source/menufunctions.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ void closeMenu()
2424
{
2525
MenuIsDisplayed = false;
2626

27+
resetMenuToRoot();
28+
2729
// Lower the System Level if not in a battle
2830
lowerSystemLevel();
2931

0 commit comments

Comments
 (0)