@@ -297,6 +297,20 @@ void getOnOffTextAndColor(bool valueToCheck, const char **textOut, uint32_t *col
297
297
}
298
298
}
299
299
300
+ void getYesNoTextAndColor (bool valueToCheck, const char **textOut, uint32_t *colorOut)
301
+ {
302
+ if (valueToCheck)
303
+ {
304
+ *textOut = " Yes" ;
305
+ *colorOut = 0x1BBE23FF ; // Green
306
+ }
307
+ else
308
+ {
309
+ *textOut = " No" ;
310
+ *colorOut = 0xFF1414FF ; // Red
311
+ }
312
+ }
313
+
300
314
uint32_t getSelectedTextColor (bool valueToCheck)
301
315
{
302
316
if (valueToCheck)
@@ -1467,17 +1481,7 @@ void drawMemoryModifyList()
1467
1481
{
1468
1482
// Draw the Yes/No text for whether the watch is shown as hex or not
1469
1483
const char *YesNoText;
1470
- if (MemoryWatch[tempMenuSelectedOption].ShowAsHex )
1471
- {
1472
- YesNoText = " Yes" ;
1473
- Color = 0x1BBE23FF ;
1474
- }
1475
- else
1476
- {
1477
- YesNoText = " No" ;
1478
- Color = 0xFF1414FF ;
1479
- }
1480
-
1484
+ getYesNoTextAndColor (MemoryWatch[tempMenuSelectedOption].ShowAsHex , &YesNoText, &Color);
1481
1485
drawText (YesNoText, PosX + PosX_Offset, PosY, Alpha, Color, Scale);
1482
1486
break ;
1483
1487
}
@@ -3454,16 +3458,7 @@ void drawWarpByEventMenuDetails()
3454
3458
3455
3459
// Draw the text for whether the standard inventory should be kept or not
3456
3460
const char *String;
3457
- if (WarpByEvent.ShouldKeepInventory )
3458
- {
3459
- Color = 0x1BBE23FF ;
3460
- String = " Yes" ;
3461
- }
3462
- else
3463
- {
3464
- Color = 0xFF1414FF ;
3465
- String = " No" ;
3466
- }
3461
+ getYesNoTextAndColor (WarpByEvent.ShouldKeepInventory , &String, &Color);
3467
3462
3468
3463
int32_t tempPosX = PosX + 147 ;
3469
3464
@@ -3475,17 +3470,7 @@ void drawWarpByEventMenuDetails()
3475
3470
PosY -= 20 ;
3476
3471
3477
3472
// Draw the text for whether specific flags should be set or not
3478
- if (WarpByEvent.ShouldSetFlags )
3479
- {
3480
- Color = 0x1BBE23FF ;
3481
- String = " Yes" ;
3482
- }
3483
- else
3484
- {
3485
- Color = 0xFF1414FF ;
3486
- String = " No" ;
3487
- }
3488
-
3473
+ getYesNoTextAndColor (WarpByEvent.ShouldSetFlags , &String, &Color);
3489
3474
drawText (String, tempPosX, PosY, Alpha, Color, Scale);
3490
3475
PosY -= 60 ;
3491
3476
0 commit comments