(svn r14041) -Feature(tte): make it possible to filter list_patches output like it's done for other list_* console commands

This commit is contained in:
glx
2008-08-11 17:15:31 +00:00
parent 2a935c9025
commit 9fa2cbd93e
3 changed files with 8 additions and 5 deletions

View File

@@ -2385,11 +2385,14 @@ void IConsoleGetPatchSetting(const char *name)
}
}
void IConsoleListPatches()
void IConsoleListPatches(const char *prefilter)
{
IConsolePrintF(CC_WARNING, "All patches with their current value:");
for (const SettingDesc *sd = _patch_settings; sd->save.cmd != SL_END; sd++) {
if (prefilter != NULL) {
if (strncmp(sd->desc.name, prefilter, min(strlen(sd->desc.name), strlen(prefilter))) != 0) continue;
}
char value[80];
const void *ptr = GetVariableAddress((_game_mode == GM_MENU) ? &_settings_newgame : &_settings_game, &sd->save);