CwCheat screen: Detect titles and display them as large text instead of checkboxes

This commit is contained in:
Henrik Rydgård committed 2026-04-24 14:29:09 +02:00
1 parent a1a073bd2c
commit c97007adfe
3 files changed
+30 -3

No files matched your search

+13
View File
@@ -1167,3 +1167,16 @@ bool CheatsInEffect() {
return false;
return cheatEngine->HasCheats();
}
bool DetectCheatTitle(std::string_view name, std::string_view *title) {
// Use Saramagrean title convention (the most common cheats.db file).
const size_t firstOffset = name.find("_[>>>");
const size_t secondOffset = name.find("<<<]_");
bool isTitle = firstOffset != std::string::npos && secondOffset != std::string::npos && firstOffset < secondOffset;
if (!isTitle) {
return false;
}
// Extract the title substring.
*title = std::string_view(name.data() + firstOffset + 5, secondOffset - (firstOffset + 5));
return true;
}