mirror of https://github.com/PCSX2/pcsx2.git
pcsx2: redo cheat loading on linux. Now it will be fully case insensitive.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5645 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
832016f757
commit
ae5f9f812d
|
@ -182,9 +182,9 @@ static int LoadCheatsFiles(const wxDirName& folderName, wxString& fileSpec, cons
|
||||||
int before = cheatnumber;
|
int before = cheatnumber;
|
||||||
wxString buffer;
|
wxString buffer;
|
||||||
wxTextFile f;
|
wxTextFile f;
|
||||||
bool found = dir.GetFirst(&buffer, fileSpec, wxDIR_FILES);
|
bool found = dir.GetFirst(&buffer, L"*", wxDIR_FILES);
|
||||||
while (found) {
|
while (found) {
|
||||||
if (buffer.Matches(L"*.pnach") || buffer.Matches(L"*.PNACH")) {
|
if (buffer.Upper().Matches(fileSpec.Upper())) {
|
||||||
Console.WriteLn(Color_Gray, L"Found %s file: '%s'", friendlyName.c_str(), buffer.c_str());
|
Console.WriteLn(Color_Gray, L"Found %s file: '%s'", friendlyName.c_str(), buffer.c_str());
|
||||||
int before = cheatnumber;
|
int before = cheatnumber;
|
||||||
f.Open(Path::Combine(dir.GetName(), buffer));
|
f.Open(Path::Combine(dir.GetName(), buffer));
|
||||||
|
@ -211,14 +211,9 @@ int LoadCheats(wxString name, const wxDirName& folderName, const wxString& frien
|
||||||
|
|
||||||
int loaded = 0;
|
int loaded = 0;
|
||||||
|
|
||||||
wxString filespec = name + L"*.*";
|
wxString filespec = name + L"*.pnach";
|
||||||
loaded += LoadCheatsFiles(folderName, filespec, friendlyName);
|
loaded += LoadCheatsFiles(folderName, filespec, friendlyName);
|
||||||
|
|
||||||
if (wxFileName::IsCaseSensitive() && name != name.Upper()) {
|
|
||||||
filespec = name.Upper() + L"*.*";
|
|
||||||
loaded += LoadCheatsFiles(folderName, filespec, friendlyName);
|
|
||||||
}
|
|
||||||
|
|
||||||
Console.WriteLn((loaded ? Color_Green : Color_Gray), L"Overall %d %s loaded", loaded, friendlyName.c_str());
|
Console.WriteLn((loaded ? Color_Green : Color_Gray), L"Overall %d %s loaded", loaded, friendlyName.c_str());
|
||||||
return loaded;
|
return loaded;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue