mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-02 17:03:13 +00:00
AGS: Fixes for importing character into QFG2
This commit is contained in:
parent
0b68518ae6
commit
d9381a9d86
@ -76,16 +76,19 @@ void ListBox_Clear(GUIListBox *listbox) {
|
||||
void FillDirList(std::set<String> &files, const String &path) {
|
||||
String dirName = Path::GetDirectoryPath(path);
|
||||
String filePattern = Path::get_filename(path);
|
||||
|
||||
if (dirName.CompareLeftNoCase(get_install_dir()) == 0) {
|
||||
String subDir = dirName.Mid(get_install_dir().GetLength());
|
||||
if (!subDir.IsEmpty() && subDir[0u] == '/')
|
||||
subDir.ClipLeft(1);
|
||||
dirName = ConfMan.get("path");
|
||||
} else if (dirName.CompareLeftNoCase(get_save_game_directory()) == 0) {
|
||||
String subDir = dirName.Mid(get_save_game_directory().GetLength());
|
||||
if (!subDir.IsEmpty() && subDir[0u] == '/')
|
||||
subDir.ClipLeft(1);
|
||||
dirName = Path::ConcatPaths(ConfMan.get("savepath"), subDir);
|
||||
// Save files listing
|
||||
Common::StringArray matches = g_system->getSavefileManager()->listSavefiles(filePattern);
|
||||
for (uint idx = 0; idx < matches.size(); ++idx)
|
||||
files.insert(matches[idx]);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
Common::FSDirectory dir(dirName);
|
||||
@ -101,7 +104,6 @@ void ListBox_FillDirList(GUIListBox *listbox, const char *filemask) {
|
||||
_G(guis_need_update) = 1;
|
||||
|
||||
ResolvedPath rp;
|
||||
ResolveScriptPath("$SAVEGAMEDIR$/agssave.*", true, rp);
|
||||
if (!ResolveScriptPath(filemask, true, rp))
|
||||
return;
|
||||
|
||||
|
@ -86,6 +86,9 @@ String GetPathInASCII(const String &path);
|
||||
String GetCmdLinePathInASCII(const char *arg, int arg_index);
|
||||
|
||||
inline String get_filename(const String &pathAndName) {
|
||||
size_t p = pathAndName.FindCharReverse('/');
|
||||
if (p != String::npos)
|
||||
return String(pathAndName.GetNullableCStr() + p + 1);
|
||||
return Common::FSNode(pathAndName).getName();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user