Skip to content

Commit 478e3ba

Browse files
committed
Removed the Change Values option in Mario's Stats menu
1 parent f84dd8b commit 478e3ba

File tree

3 files changed

+63
-96
lines changed

3 files changed

+63
-96
lines changed

ttyd-tools/rel/source/draw.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ void drawMarioStats()
10081008
float TextScale = 0.6;
10091009
float IconScale = 0.6;
10101010
int32_t TextPosX = -208;
1011-
int32_t TextPosY = 140;
1011+
int32_t TextPosY = 175;
10121012
int32_t ValuesPosX = TextPosX + 105;
10131013
int32_t IconPosX = TextPosX - 15;
10141014
int32_t IconPosY = TextPosY - 20;
@@ -1035,6 +1035,8 @@ void drawMarioStats()
10351035
uint32_t SelectionTextColor;
10361036
Counter = 0;
10371037

1038+
const uint32_t BeforeStarPowerSlot = 11;
1039+
10381040
bool ExitLoop = false;
10391041
for (uint32_t j = 0; j < TotalColumns; j++)
10401042
{
@@ -1050,12 +1052,12 @@ void drawMarioStats()
10501052
}
10511053

10521054
// Draw the icon
1053-
if (i == 11) // 1 before Star Power
1055+
if (i == BeforeStarPowerSlot) // 1 before Star Power
10541056
{
10551057
// Move the icons up
10561058
IconPosYIncrement = -5;
10571059
}
1058-
else if (i == 13) // 1 after Max Star Power
1060+
else if (i == (BeforeStarPowerSlot + 2)) // 1 after Max Star Power
10591061
{
10601062
// Reset the value
10611063
IconPosYIncrement = 5;
@@ -1068,13 +1070,13 @@ void drawMarioStats()
10681070
drawIcon(IconPosition, StatsMarioIcons[i], IconScale);
10691071

10701072
// Draw the text
1071-
bool CurrentOptionCheck = (CurrentMenuOption == i) && (SelectedOption > 0);
1073+
bool CurrentOptionCheck = (CurrentMenuOption == i);
10721074
SelectionTextColor = getSelectedTextColor(CurrentOptionCheck);
10731075

10741076
drawText(StatsMarioOptionsLines[i], PosX, PosY, Alpha, SelectionTextColor, TextScale);
10751077

10761078
// Draw the values
1077-
if (i != 11) // Special moves -- drawn separately
1079+
if (i != BeforeStarPowerSlot) // Special moves -- drawn separately
10781080
{
10791081
sprintf(tempDisplayBuffer,
10801082
"%" PRId32,
@@ -1104,7 +1106,7 @@ void drawMarioStats()
11041106
float SpecialMovesScale = 0.37;
11051107
int16_t SpecialMoveIcon;
11061108
IconPosition[IconPositionX] = 133;
1107-
IconPosition[IconPositionY] = 66;
1109+
IconPosition[IconPositionY] = 101;
11081110

11091111
int16_t SpecialMovesBits = *reinterpret_cast<int16_t *>(PouchPtr + 0x8C);
11101112
for (uint32_t i = 0; i < 8; i++)
@@ -3485,7 +3487,7 @@ void drawWarpIndexEntranceList()
34853487

34863488
void drawOnScreenTimerButtonCombos()
34873489
{
3488-
int32_t PosY = 0;
3490+
int32_t PosY = 40;
34893491
uint32_t tempOnScreenTimerOptionsSize = OnScreenTimerOptionsSize;
34903492

34913493
for (uint32_t i = 0; i < tempOnScreenTimerOptionsSize; i++)

ttyd-tools/rel/source/global.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -611,11 +611,6 @@ const char *StatsLines[] =
611611
"Followers",
612612
};
613613

614-
const char *StatsMarioLines[] =
615-
{
616-
"Change Values",
617-
};
618-
619614
const char *StatsMarioOptionsLines[] =
620615
{
621616
"Coins",
@@ -1407,10 +1402,7 @@ void initMenuVars()
14071402
Menu[STATS].PreviousMenu = ROOT;
14081403
Menu[STATS].Line = StatsLines;
14091404

1410-
Menu[STATS_MARIO].TotalMenuOptions = sizeof(StatsMarioLines) / sizeof(StatsMarioLines[0]);
1411-
Menu[STATS_MARIO].ColumnSplitAmount = Menu[STATS_MARIO].TotalMenuOptions;
14121405
Menu[STATS_MARIO].PreviousMenu = STATS;
1413-
Menu[STATS_MARIO].Line = StatsMarioLines;
14141406

14151407
Menu[STATS_PARTNERS].TotalMenuOptions = sizeof(StatsPartnerLines) / sizeof(StatsPartnerLines[0]);
14161408
Menu[STATS_PARTNERS].ColumnSplitAmount = Menu[STATS_PARTNERS].TotalMenuOptions;

ttyd-tools/rel/source/menu.cpp

Lines changed: 54 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,98 +1126,70 @@ void menuCheckButton()
11261126
case DPADDOWN:
11271127
case DPADUP:
11281128
{
1129-
if (tempSelectedOption != 0)
1130-
{
1131-
adjustMarioStatsSelection(CurrentButton);
1132-
}
1129+
adjustMarioStatsSelection(CurrentButton);
11331130
break;
11341131
}
11351132
case A:
11361133
{
1137-
switch (tempSelectedOption)
1134+
switch (tempMenuSelectedOption)
11381135
{
11391136
case 0:
11401137
{
1141-
SelectedOption = tempCurrentMenuOption + 1;
1142-
CurrentMenuOption = 0;
1143-
break;
1144-
}
1145-
default:
1146-
{
1147-
switch (tempMenuSelectedOption)
1138+
MenuSelectedOption = tempCurrentMenuOption + 1;
1139+
MenuSelectionStates = tempCurrentMenuOption + 1;
1140+
1141+
switch (tempCurrentMenuOption + 1)
11481142
{
1149-
case 0:
1143+
case SPECIAL_MOVES:
11501144
{
1151-
MenuSelectedOption = tempCurrentMenuOption + 1;
1152-
MenuSelectionStates = tempCurrentMenuOption + 1;
1153-
1154-
switch (tempCurrentMenuOption + 1)
1155-
{
1156-
case SPECIAL_MOVES:
1157-
{
1158-
SecondaryMenuOption = 0;
1159-
break;
1160-
}
1161-
default:
1162-
{
1163-
SecondaryMenuOption = getHighestAdjustableValueDigit(tempCurrentMenu) - 1;
1164-
1165-
uint32_t offset = getMarioStatsValueOffset(tempCurrentMenuOption + 1);
1166-
if (offset == 0)
1167-
{
1168-
break;
1169-
}
1170-
1171-
// Set the current value in the display to the current value of the address being changed
1172-
if (((tempCurrentMenuOption + 1) >= PIANTAS_STORED) &&
1173-
((tempCurrentMenuOption + 1) <= CURRENT_PIANTAS))
1174-
{
1175-
uint32_t PiantaParlorPtr = reinterpret_cast<uint32_t>(
1176-
ttyd::evt_yuugijou::yuugijouWorkPointer);
1177-
1178-
MenuSecondaryValue = *reinterpret_cast<int32_t *>(PiantaParlorPtr + offset);
1179-
}
1180-
else
1181-
{
1182-
uint32_t PouchPtr = reinterpret_cast<uint32_t>(
1183-
ttyd::mario_pouch::pouchGetPtr());
1184-
1185-
MenuSecondaryValue = *reinterpret_cast<int16_t *>(PouchPtr + offset);
1186-
}
1187-
break;
1188-
}
1189-
}
1145+
SecondaryMenuOption = 0;
11901146
break;
11911147
}
11921148
default:
11931149
{
1150+
SecondaryMenuOption = getHighestAdjustableValueDigit(tempCurrentMenu) - 1;
1151+
1152+
uint32_t offset = getMarioStatsValueOffset(tempCurrentMenuOption + 1);
1153+
if (offset == 0)
1154+
{
1155+
break;
1156+
}
1157+
1158+
// Set the current value in the display to the current value of the address being changed
1159+
if (((tempCurrentMenuOption + 1) >= PIANTAS_STORED) &&
1160+
((tempCurrentMenuOption + 1) <= CURRENT_PIANTAS))
1161+
{
1162+
uint32_t PiantaParlorPtr = reinterpret_cast<uint32_t>(
1163+
ttyd::evt_yuugijou::yuugijouWorkPointer);
1164+
1165+
MenuSecondaryValue = *reinterpret_cast<int32_t *>(PiantaParlorPtr + offset);
1166+
}
1167+
else
1168+
{
1169+
uint32_t PouchPtr = reinterpret_cast<uint32_t>(
1170+
ttyd::mario_pouch::pouchGetPtr());
1171+
1172+
MenuSecondaryValue = *reinterpret_cast<int16_t *>(PouchPtr + offset);
1173+
}
11941174
break;
11951175
}
11961176
}
11971177
break;
11981178
}
1179+
default:
1180+
{
1181+
break;
1182+
}
11991183
}
12001184
break;
12011185
}
12021186
case B:
12031187
{
12041188
if (tempMenuSelectedOption == 0)
12051189
{
1206-
switch (tempSelectedOption)
1207-
{
1208-
case 0:
1209-
{
1210-
// Go back to the previous menu
1211-
CurrentMenu = tempPreviousMenu;
1212-
resetMenu();
1213-
break;
1214-
}
1215-
default:
1216-
{
1217-
closeSecondaryMenu();
1218-
break;
1219-
}
1220-
}
1190+
// Go back to the previous menu
1191+
CurrentMenu = tempPreviousMenu;
1192+
resetMenu();
12211193
}
12221194
break;
12231195
}
@@ -3108,25 +3080,26 @@ void drawMenu()
31083080
case STATS_MARIO:
31093081
{
31103082
// Draw the text for the options
3111-
drawSingleColumnSelectedOption();
3083+
drawSingleColumnMain();
31123084

31133085
// Draw each of Mario's stats
31143086
drawMarioStats();
31153087

3116-
if (tempMenuSelectedOption != 0)
3088+
switch (tempMenuSelectedOption)
31173089
{
3118-
switch (tempMenuSelectedOption)
3090+
case 0:
31193091
{
3120-
case SPECIAL_MOVES:
3121-
{
3122-
drawMarioSpecialMovesOptions();
3123-
break;
3124-
}
3125-
default:
3126-
{
3127-
drawAdjustableValue(false, tempCurrentMenu);
3128-
break;
3129-
}
3092+
break;
3093+
}
3094+
case SPECIAL_MOVES:
3095+
{
3096+
drawMarioSpecialMovesOptions();
3097+
break;
3098+
}
3099+
default:
3100+
{
3101+
drawAdjustableValue(false, tempCurrentMenu);
3102+
break;
31303103
}
31313104
}
31323105
break;
@@ -3382,7 +3355,7 @@ void drawMenu()
33823355
bool CurrentDisplay = Displays[tempMenuSelectedOption];
33833356
const char *CurrentLine = DisplaysLines[tempMenuSelectedOption];
33843357

3385-
int32_t PosY = 80;
3358+
int32_t PosY = 100;
33863359
drawBoolOnOrOff(CurrentDisplay, CurrentLine, PosY);
33873360

33883361
// Draw each button combo

0 commit comments

Comments
 (0)