mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-02 10:43:44 +01:00
CwCheat screen: Detect titles and display them as large text instead of checkboxes
This commit is contained in:
1 parent
a1a073bd2c
commit
c97007adfe
3 files changed
+30
-3
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user