[Scummvm-git-logs] scummvm master -> 015937d58629c5fdde58a8e02321f703345a3680
tag2015
noreply at scummvm.org
Wed Jan 31 13:53:08 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
015937d586 AGS: Add workaround for qfg2agdi to allow importing sci exported chars
Commit: 015937d58629c5fdde58a8e02321f703345a3680
https://github.com/scummvm/scummvm/commit/015937d58629c5fdde58a8e02321f703345a3680
Author: Walter Agazzi (walter.agazzi at protonmail.com)
Date: 2024-01-31T14:50:07+01:00
Commit Message:
AGS: Add workaround for qfg2agdi to allow importing sci exported chars
Fixes TRAC #12335
Changed paths:
engines/ags/engine/ac/file.cpp
engines/ags/engine/ac/listbox.cpp
diff --git a/engines/ags/engine/ac/file.cpp b/engines/ags/engine/ac/file.cpp
index 87d6eef184b..f70eaa2e496 100644
--- a/engines/ags/engine/ac/file.cpp
+++ b/engines/ags/engine/ac/file.cpp
@@ -418,8 +418,15 @@ bool ResolveScriptPath(const String &orig_sc_path, bool read_only, ResolvedPath
debugC(::AGS::kDebugFilePath, "Adding ScummVM game target prefix and flatten path");
child_path.Replace('/', '-');
String gameTarget = ConfMan.getActiveDomainName();
- if (child_path.CompareLeftNoCase(gameTarget) != 0)
- child_path = String::FromFormat("%s-%s", gameTarget.GetCStr(), child_path.GetCStr());
+
+ // When in Quest for Glory II "import a hero" window, don't add the gamename prefix when listing saves. This way
+ // we can show saves created by the Sierra games
+ if (strcmp(_GP(game).guid, "{a46a9171-f6f9-456c-9b2b-a509b560ddc0}") || !(_G(displayed_room) == 1) || !read_only) {
+ if (child_path.CompareLeftNoCase(gameTarget) != 0)
+ child_path = String::FromFormat("%s-%s", gameTarget.GetCStr(), child_path.GetCStr());
+ } else {
+ debug("ResolveScriptPath: Skipping gameprefix for QfG2AGDI!");
+ }
}
#else
// Create a proper ResolvedPath with FSLocation separating base location
diff --git a/engines/ags/engine/ac/listbox.cpp b/engines/ags/engine/ac/listbox.cpp
index 9ee19cd093a..42bc5adce20 100644
--- a/engines/ags/engine/ac/listbox.cpp
+++ b/engines/ags/engine/ac/listbox.cpp
@@ -42,6 +42,9 @@
#include "ags/ags.h"
#include "ags/globals.h"
+#include "gui/message.h"
+#include "common/translation.h"
+
namespace AGS3 {
using namespace AGS::Shared;
@@ -68,7 +71,18 @@ static void FillSaveList(std::set<String> &files, const String &filePattern) {
size_t wildcard = filePattern.FindChar('*');
assert(wildcard != String::NoIndex);
Common::String prefix(filePattern.GetCStr(), wildcard);
- Common::StringArray matches = g_system->getSavefileManager()->listSavefiles(filePattern);
+ Common::StringArray matches;
+
+ // WORKAROUND: For QfG2 AGDI import screen, list only the QfG1 exported characters
+ if ((strcmp(_GP(game).guid, "{a46a9171-f6f9-456c-9b2b-a509b560ddc0}") == 0) && _G(displayed_room) == 1) {
+ ::GUI::MessageDialog dialog(_("The game will now list characters exported from the Sierra games that can be imported:\n"
+ "1. Save files named qfg1*.sav or qfg1vga*.sav inside ScummVM save directory, or\n"
+ "2. Any .sav file inside the QfG2 Remake game directory"), "Ok");
+ dialog.runModal();
+
+ matches = g_system->getSavefileManager()->listSavefiles("qfg1*.sav");
+ } else
+ matches = g_system->getSavefileManager()->listSavefiles(filePattern);
for (uint idx = 0; idx < matches.size(); ++idx) {
Common::String name = matches[idx];
More information about the Scummvm-git-logs
mailing list