mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +08:00
(PFS): added option to select filenames encoding (#162)
This commit is contained in:
parent
eafe023de9
commit
8016560d04
@ -135,6 +135,8 @@
|
||||
<Compile Include="elf\ArcAi5DAT.cs" />
|
||||
<Compile Include="elf\ImageRMT.cs" />
|
||||
<Compile Include="Emote\ImageDREF.cs" />
|
||||
<Compile Include="FC01\ArcPAK.cs" />
|
||||
<Compile Include="FrontWing\ArcVAV.cs" />
|
||||
<Compile Include="Groover\ArcPCG.cs" />
|
||||
<Compile Include="HCSystem\ArcPAK.cs" />
|
||||
<Compile Include="HCSystem\ImageOPF.cs" />
|
||||
|
@ -23,11 +23,11 @@
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace GameRes.Formats.Artemis
|
||||
{
|
||||
@ -42,9 +42,12 @@ namespace GameRes.Formats.Artemis
|
||||
|
||||
public PfsOpener ()
|
||||
{
|
||||
Extensions = new string[] { "pfs", "000", "001", "002", "003" };
|
||||
Extensions = new string[] { "pfs", "000", "001", "002", "003", "004", "005" };
|
||||
Settings = new[] { PfsEncoding };
|
||||
}
|
||||
|
||||
EncodingSetting PfsEncoding = new EncodingSetting ("PFSEncodingCP");
|
||||
|
||||
public override ArcFile TryOpen (ArcView file)
|
||||
{
|
||||
if (!file.View.AsciiEqual (0, "pf"))
|
||||
@ -65,7 +68,7 @@ namespace GameRes.Formats.Artemis
|
||||
int count = file.View.ReadInt32 (7);
|
||||
if (!IsSaneCount (count) || 7L + index_size > file.MaxOffset)
|
||||
return null;
|
||||
var encoding = version >= 8 ? System.Text.Encoding.UTF8 : Encodings.cp932;
|
||||
var encoding = PfsEncoding.Get<Encoding>();
|
||||
var index = file.View.ReadBytes (7, index_size);
|
||||
int index_offset = 4;
|
||||
var dir = new List<Entry> (count);
|
||||
|
12
ArcFormats/Properties/Settings.Designer.cs
generated
12
ArcFormats/Properties/Settings.Designer.cs
generated
@ -741,5 +741,17 @@ namespace GameRes.Formats.Properties {
|
||||
this["OGGFixCrc"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("65001")]
|
||||
public int PFSEncodingCP {
|
||||
get {
|
||||
return ((int)(this["PFSEncodingCP"]));
|
||||
}
|
||||
set {
|
||||
this["PFSEncodingCP"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -182,5 +182,8 @@
|
||||
<Setting Name="OGGFixCrc" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="PFSEncodingCP" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">65001</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
9
ArcFormats/Strings/arcStrings.Designer.cs
generated
9
ArcFormats/Strings/arcStrings.Designer.cs
generated
@ -660,6 +660,15 @@ namespace GameRes.Formats.Strings {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Default file names encoding.
|
||||
/// </summary>
|
||||
public static string PFSEncodingCP {
|
||||
get {
|
||||
return ResourceManager.GetString("PFSEncodingCP", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Use default encryption scheme.
|
||||
/// </summary>
|
||||
|
@ -498,4 +498,7 @@ Choose encryption scheme or enter a passphrase.</comment>
|
||||
<data name="ZIPEncodingCP" xml:space="preserve">
|
||||
<value>Default file names encoding</value>
|
||||
</data>
|
||||
<data name="PFSEncodingCP" xml:space="preserve">
|
||||
<value>Default file names encoding</value>
|
||||
</data>
|
||||
</root>
|
@ -399,4 +399,8 @@
|
||||
<value>Default file names encoding</value>
|
||||
<comment>translation pending</comment>
|
||||
</data>
|
||||
<data name="PFSEncodingCP" xml:space="preserve">
|
||||
<value>Default file names encoding</value>
|
||||
<comment>translation pending</comment>
|
||||
</data>
|
||||
</root>
|
@ -398,4 +398,7 @@ Choose encryption scheme or enter a passphrase.</value>
|
||||
<data name="ZIPEncodingCP" xml:space="preserve">
|
||||
<value>Default file names encoding</value>
|
||||
</data>
|
||||
<data name="PFSEncodingCP" xml:space="preserve">
|
||||
<value>Default file names encoding</value>
|
||||
</data>
|
||||
</root>
|
@ -291,6 +291,9 @@
|
||||
<data name="PDScrambleContents" xml:space="preserve">
|
||||
<value>Шифровать содержимое</value>
|
||||
</data>
|
||||
<data name="PFSEncodingCP" xml:space="preserve">
|
||||
<value>Кодировка имён файлов</value>
|
||||
</data>
|
||||
<data name="QLIEDefaultScheme" xml:space="preserve">
|
||||
<value>"Старый" метод шифрования</value>
|
||||
</data>
|
||||
|
@ -400,4 +400,8 @@
|
||||
<value>Default file names encoding</value>
|
||||
<comment>translation pending</comment>
|
||||
</data>
|
||||
<data name="PFSEncodingCP" xml:space="preserve">
|
||||
<value>Default file names encoding</value>
|
||||
<comment>translation pending</comment>
|
||||
</data>
|
||||
</root>
|
@ -184,6 +184,9 @@
|
||||
<setting name="OGGFixCrc" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="PFSEncodingCP" serializeAs="String">
|
||||
<value>65001</value>
|
||||
</setting>
|
||||
</GameRes.Formats.Properties.Settings>
|
||||
</userSettings>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /></startup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user