@@ -111,7 +111,7 @@ void Mod::changeInventory()
111
111
{
112
112
// Currently in the pause menu
113
113
uint32_t ButtonInput = ttyd::system::keyGetButton (0 );
114
- int16_t PressedOrHeldButtonCount = 0 ;
114
+ uint8_t PressedOrHeldButtonCount = 0 ;
115
115
uint16_t ButtonHoldFrames = 45 ; // 0.75 Seconds
116
116
117
117
uint32_t PauseMenuAddress = *reinterpret_cast <uint32_t *>(PauseMenuAddressesStart);
@@ -149,14 +149,14 @@ void Mod::changeInventory()
149
149
150
150
if (PressedOrHeldButtonCount < 2 )
151
151
{
152
- // Zero or one button(s) are pressed/held, so set FirstButtonPressed to 0 or currently-pressed/held button
153
- FirstButtonPressed = ButtonInput;
152
+ // Zero or one button(s) are pressed/held, so set firstButtonPressed to 0 or currently-pressed/held button
153
+ firstButtonPressed = ButtonInput;
154
154
}
155
155
156
156
// Add item/badge
157
- if (((ButtonInput & InventoryAddItemOrBadgeCombo) == InventoryAddItemOrBadgeCombo) && (FirstButtonPressed == InventoryAddItemOrBadgeFirstButtonCombo))
157
+ if (((ButtonInput & InventoryAddItemOrBadgeCombo) == InventoryAddItemOrBadgeCombo) && (firstButtonPressed == InventoryAddItemOrBadgeFirstButtonCombo))
158
158
{
159
- if (ChangeInventoryButtonHoldCounter == 0 )
159
+ if (changeInventoryButtonHoldCounter == 0 )
160
160
{
161
161
// Add item/badge
162
162
if (CurrentTab == 2 )
@@ -170,11 +170,11 @@ void Mod::changeInventory()
170
170
addItemOrBadge (PouchBadgeInventoryAddress, CursorItem, PowerJump, BadgesLoopCounter, SubMenuEquippedBadges);
171
171
}
172
172
}
173
- ChangeInventoryButtonHoldCounter ++;
173
+ changeInventoryButtonHoldCounter ++;
174
174
}
175
- else if (((ButtonInput & InventoryRemoveItemOrBadgeCombo) == InventoryRemoveItemOrBadgeCombo) && (FirstButtonPressed == InventoryRemoveItemOrBadgeFirstButtonCombo))
175
+ else if (((ButtonInput & InventoryRemoveItemOrBadgeCombo) == InventoryRemoveItemOrBadgeCombo) && (firstButtonPressed == InventoryRemoveItemOrBadgeFirstButtonCombo))
176
176
{
177
- if (ChangeInventoryButtonHoldCounter == 0 )
177
+ if (changeInventoryButtonHoldCounter == 0 )
178
178
{
179
179
// Remove item/badge
180
180
if ((CurrentTab == 2 ) && (CursorItem != 0 ))
@@ -189,11 +189,11 @@ void Mod::changeInventory()
189
189
ttyd::mario_pouch::pouchReviseMarioParam (); // Check equipped badges and adjust BP used
190
190
}
191
191
}
192
- ChangeInventoryButtonHoldCounter ++;
192
+ changeInventoryButtonHoldCounter ++;
193
193
}
194
- else if (((ButtonInput & InventoryPreviousValueCombo) == InventoryPreviousValueCombo) && (FirstButtonPressed == InventoryPreviousValueFirstButtonCombo))
194
+ else if (((ButtonInput & InventoryPreviousValueCombo) == InventoryPreviousValueCombo) && (firstButtonPressed == InventoryPreviousValueFirstButtonCombo))
195
195
{
196
- if (ChangeInventoryButtonHoldCounter == 0 )
196
+ if (changeInventoryButtonHoldCounter == 0 )
197
197
{
198
198
if ((CursorItem > 0 ) && (CursorItem < 236 ))
199
199
{
@@ -207,11 +207,11 @@ void Mod::changeInventory()
207
207
ttyd::mario_pouch::pouchReviseMarioParam (); // Check equipped badges and adjust BP used
208
208
}
209
209
}
210
- ChangeInventoryButtonHoldCounter ++;
210
+ changeInventoryButtonHoldCounter ++;
211
211
}
212
- else if (((ButtonInput & InventoryNextValueCombo) == InventoryNextValueCombo) && (FirstButtonPressed == InventoryNextValueFirstButtonCombo))
212
+ else if (((ButtonInput & InventoryNextValueCombo) == InventoryNextValueCombo) && (firstButtonPressed == InventoryNextValueFirstButtonCombo))
213
213
{
214
- if (ChangeInventoryButtonHoldCounter == 0 )
214
+ if (changeInventoryButtonHoldCounter == 0 )
215
215
{
216
216
if ((CursorItem > 0 ) && (CursorItem < 236 ))
217
217
{
@@ -225,18 +225,18 @@ void Mod::changeInventory()
225
225
ttyd::mario_pouch::pouchReviseMarioParam (); // Check equipped badges and adjust BP used
226
226
}
227
227
}
228
- ChangeInventoryButtonHoldCounter ++;
228
+ changeInventoryButtonHoldCounter ++;
229
229
}
230
230
else
231
231
{
232
232
// Reset counter if no button combo is pressed/held
233
- ChangeInventoryButtonHoldCounter = 0 ;
233
+ changeInventoryButtonHoldCounter = 0 ;
234
234
}
235
235
236
- if (ChangeInventoryButtonHoldCounter > ButtonHoldFrames)
236
+ if (changeInventoryButtonHoldCounter > ButtonHoldFrames)
237
237
{
238
238
// Reset if counter exceeds ButtonHoldFrames
239
- ChangeInventoryButtonHoldCounter = 0 ;
239
+ changeInventoryButtonHoldCounter = 0 ;
240
240
}
241
241
}
242
242
}
0 commit comments