Add Cheat Manager (#2964)

* add cheatmanager

* use modloader to load cheats for manager

* addressed nits
This commit is contained in:
Emmanuel Hansen 2022-01-03 08:39:43 +00:00 committed by GitHub
parent dc8a1d5cba
commit e98abf1820
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 388 additions and 13 deletions

View file

@ -664,7 +664,20 @@ namespace Ryujinx.HLE.HOS
Logger.Info?.Print(LogClass.ModLoader, $"Installing cheat '{cheat.Name}'");
tamperMachine.InstallAtmosphereCheat(cheat.Name, cheat.Instructions, tamperInfo, exeAddress);
tamperMachine.InstallAtmosphereCheat(cheat.Name, cheatId, cheat.Instructions, tamperInfo, exeAddress);
}
EnableCheats(titleId, tamperMachine);
}
internal void EnableCheats(ulong titleId, TamperMachine tamperMachine)
{
var contentDirectory = FindTitleDir(new DirectoryInfo(Path.Combine(GetModsBasePath(), AmsContentsDir)), $"{titleId:x16}");
string enabledCheatsPath = Path.Combine(contentDirectory.FullName, CheatDir, "enabled.txt");
if (File.Exists(enabledCheatsPath))
{
tamperMachine.EnableCheats(File.ReadAllLines(enabledCheatsPath));
}
}