added game title lookup facility.

This commit is contained in:
morkt
2016-10-09 10:10:12 +04:00
parent f9f9853810
commit 6a57bfb43d
4 changed files with 51 additions and 22 deletions

View File

@@ -90,7 +90,7 @@ namespace GameRes.Formats.ShiinaRio // 椎名里緒
if (index_offset >= file.MaxOffset)
return null;
var scheme = QueryEncryption();
var scheme = QueryEncryption (file.Name);
if (null == scheme)
return null;
var decoder = new Decoder (version, scheme);
@@ -282,10 +282,18 @@ namespace GameRes.Formats.ShiinaRio // 椎名里緒
return new GUI.WidgetWARC();
}
EncryptionScheme QueryEncryption ()
EncryptionScheme QueryEncryption (string arc_name)
{
var options = Query<WarOptions> (arcStrings.ArcEncryptedNotice);
return options.Scheme;
EncryptionScheme scheme = null;
var title = FormatCatalog.Instance.LookupGame (arc_name);
if (!string.IsNullOrEmpty (title))
scheme = GetScheme (title);
if (null == scheme)
{
var options = Query<WarOptions> (arcStrings.ArcEncryptedNotice);
scheme = options.Scheme;
}
return scheme;
}
static EncryptionScheme GetScheme (string scheme)