@@ -3075,42 +3075,73 @@ void drawCheatsResolveFades()
3075
3075
3076
3076
void drawCheatsLockFlags ()
3077
3077
{
3078
- // Draw the text indicating which area has its flags locked
3079
- uint32_t Color = 0xFFFFFFFF ;
3078
+ // Draw the Yes/No text for each option
3080
3079
uint8_t Alpha = 0xFF ;
3081
3080
int32_t PosX = -232 ;
3082
- int32_t PosY = 60 ;
3081
+ int32_t PosY = 180 ;
3083
3082
float Scale = 0.6 ;
3083
+ uint32_t Color;
3084
3084
3085
- const char *String = " Current Area Local Flags Locked" ;
3086
- drawText (String, PosX, PosY, Alpha, Color, Scale);
3087
- PosY -= 20 ;
3088
-
3089
- // Get the text for which area has its flags locked
3090
- char CurrentAreaLockedText[64 ];
3091
- char *tempAreaLockedText = LockFlags.AreaLocked ;
3085
+ const char *String;
3092
3086
3093
- // Make sure the current area with its flags locked is valid
3094
- if (!Cheat[LOCK_FLAGS]. Active || tempAreaLockedText[ 0 ] == ' \0 ' )
3087
+ uint32_t Size = sizeof (LockFlags. MemoryRegionLocked ) / sizeof (LockFlags. MemoryRegionLocked [ 0 ]);
3088
+ for ( uint32_t i = 0 ; i < Size; i++ )
3095
3089
{
3096
- strcpy (CurrentAreaLockedText, " None" );
3090
+ getYesNoTextAndColor (LockFlags.MemoryRegionLocked [i], &String, &Color);
3091
+ drawText (String, PosX + 120 , PosY, Alpha, Color, Scale);
3092
+ PosY -= 20 ;
3097
3093
}
3098
- else
3094
+ PosY -= 60 ;
3095
+
3096
+ auto getAreaText = [](char *stringOut, char *areaLocked, bool flag)
3099
3097
{
3100
- strcpy (CurrentAreaLockedText, tempAreaLockedText);
3101
-
3102
- // Check to see if the current area is one that can have its flags cleared
3103
- const char **tempAreaText = CheatsClearAreaFlagsAreas;
3104
- uint32_t Size = CheatsClearAreaFlagsAreasSize;
3105
- for (uint32_t i = 0 ; i < Size; i++)
3098
+ // Make sure the current area with its flags locked is valid
3099
+ if (!flag || areaLocked[0 ] == ' \0 ' )
3106
3100
{
3107
- if (compareStrings (tempAreaLockedText, tempAreaText[i]))
3101
+ strcpy (stringOut, " None" );
3102
+ return static_cast <uint32_t >(0x4B4B4BFF );
3103
+ }
3104
+ else
3105
+ {
3106
+ strcpy (stringOut, areaLocked);
3107
+
3108
+ // Check to see if the current area is one that can have its flags cleared
3109
+ const char **tempAreaText = CheatsClearAreaFlagsAreas;
3110
+ uint32_t Size = CheatsClearAreaFlagsAreasSize;
3111
+ for (uint32_t i = 0 ; i < Size; i++)
3108
3112
{
3109
- strcpy (CurrentAreaLockedText, CheatsClearAreaFlagsAreasFullNames[i]);
3110
- break ;
3113
+ if (compareStrings (areaLocked, tempAreaText[i]))
3114
+ {
3115
+ strcpy (stringOut, CheatsClearAreaFlagsAreasFullNames[i]);
3116
+ break ;
3117
+ }
3111
3118
}
3112
3119
}
3113
- }
3120
+ return static_cast <uint32_t >(0xFFFFFFFF );
3121
+ };
3122
+
3123
+ // Draw the text indicating which area has its LSW flags locked
3124
+ Color = 0xFFFFFFFF ;
3125
+ String = " Current Area LSW Flags Locked" ;
3126
+ drawText (String, PosX, PosY, Alpha, Color, Scale);
3127
+ PosY -= 20 ;
3128
+
3129
+ // Get the text for which area has its LSW flags locked
3130
+ char CurrentAreaLockedText[64 ];
3131
+ Color = getAreaText (CurrentAreaLockedText, LockFlags.LSWsAreaLocked , LockFlags.MemoryRegionLocked [4 ]);
3132
+
3133
+ // Draw the text for which area has its flags locked
3134
+ drawText (CurrentAreaLockedText, PosX, PosY, Alpha, Color, Scale);
3135
+ PosY -= 40 ;
3136
+
3137
+ // Draw the text indicating which area has its LSWF flags locked
3138
+ Color = 0xFFFFFFFF ;
3139
+ String = " Current Area LSWF Flags Locked" ;
3140
+ drawText (String, PosX, PosY, Alpha, Color, Scale);
3141
+ PosY -= 20 ;
3142
+
3143
+ // Get the text for which area has its LSWF flags locked
3144
+ Color = getAreaText (CurrentAreaLockedText, LockFlags.LSWFsAreaLocked , LockFlags.MemoryRegionLocked [5 ]);
3114
3145
3115
3146
// Draw the text for which area has its flags locked
3116
3147
drawText (CurrentAreaLockedText, PosX, PosY, Alpha, Color, Scale);
0 commit comments