added preliminary archive creation support.

This commit is contained in:
morkt
2014-07-24 05:43:20 +04:00
parent 56012447d8
commit 0a1f14e051
29 changed files with 568 additions and 58 deletions

View File

@@ -39,8 +39,9 @@ namespace GameRes.Formats
public class AmiOpener : ArchiveFormat
{
public override string Tag { get { return "AMI"; } }
public override string Description { get { return "Amaterasu Translations Muv-Luv archive"; } }
public override string Description { get { return Strings.arcStrings.AMIDescription; } }
public override uint Signature { get { return 0x00494d41; } }
public override bool IsHierarchic { get { return false; } }
public AmiOpener ()
{
@@ -109,7 +110,7 @@ namespace GameRes.Formats
public class GrpFormat : ImageFormat
{
public override string Tag { get { return "GRP"; } }
public override string Description { get { return "âge proprietary image format"; } }
public override string Description { get { return Strings.arcStrings.GRPDescription; } }
public override uint Signature { get { return 0x00505247; } }
public override ImageMetaData ReadMetaData (Stream stream)
@@ -191,7 +192,7 @@ namespace GameRes.Formats
public class ScrFormat : ScriptFormat
{
public override string Tag { get { return "SCR"; } }
public override string Description { get { return "Amaterasu Translations Muv-Luv script file"; } }
public override string Description { get { return Strings.arcStrings.SCRDescription; } }
public override uint Signature { get { return 0x00524353; } }
public override ScriptData Read (string name, Stream stream)

View File

@@ -41,8 +41,9 @@ namespace GameRes.Formats
public class IntOpener : ArchiveFormat
{
public override string Tag { get { return "INT"; } }
public override string Description { get { return "FrontWing game resource archive"; } }
public override string Description { get { return arcStrings.INTDescription; } }
public override uint Signature { get { return 0x0046494b; } }
public override bool IsHierarchic { get { return false; } }
public override ArcFile TryOpen (ArcView file)
{
@@ -267,11 +268,9 @@ namespace GameRes.Formats
{ "Sengoku Tenshi Djibril (trial)", new KeyData { Key=0xef870610, Passphrase="FW-8O9B6WDS" }},
};
IntEncryptionInfo m_info = Settings.Default.INTEncryption ?? new IntEncryptionInfo();
uint? QueryEncryptionInfo ()
{
var widget = new GUI.WidgetINT (m_info);
var widget = new GUI.WidgetINT (Settings.Default.INTEncryption ?? new IntEncryptionInfo());
var args = new ParametersRequestEventArgs
{
Notice = arcStrings.INTNotice,
@@ -284,5 +283,12 @@ namespace GameRes.Formats
Settings.Default.INTEncryption = widget.Info;
return widget.GetKey();
}
public override ResourceOptions GetOptions ()
{
return new ResourceOptions {
Widget = new GUI.WidgetINT (Settings.Default.INTEncryption ?? new IntEncryptionInfo())
};
}
}
}

View File

@@ -49,8 +49,9 @@ namespace GameRes.Formats
public class NpaOpener : ArchiveFormat
{
public override string Tag { get { return "NPA"; } }
public override string Description { get { return "Nitro+ resource archive"; } }
public override string Description { get { return arcStrings.NPADescription; } }
public override uint Signature { get { return 0x0141504e; } } // NPA\x01
public override bool IsHierarchic { get { return true; } }
/// <summary>Known encryption schemes.</summary>
public static readonly string[] KnownSchemes = new string[] {

View File

@@ -16,8 +16,9 @@ namespace GameRes.Formats
public class XflOpener : ArchiveFormat
{
public override string Tag { get { return "XFL"; } }
public override string Description { get { return "Liar-soft game resource archive"; } }
public override string Description { get { return Strings.arcStrings.XFLDescription; } }
public override uint Signature { get { return 0x0001424c; } }
public override bool IsHierarchic { get { return false; } }
public override ArcFile TryOpen (ArcView file)
{
@@ -62,8 +63,9 @@ namespace GameRes.Formats
public class LwgOpener : ArchiveFormat
{
public override string Tag { get { return "LWG"; } }
public override string Description { get { return "Liar-soft image archive"; } }
public override string Description { get { return Strings.arcStrings.LWGDescription; } }
public override uint Signature { get { return 0x0001474c; } }
public override bool IsHierarchic { get { return false; } }
public override ArcFile TryOpen (ArcView file)
{
@@ -112,7 +114,7 @@ namespace GameRes.Formats
public class GscFormat : ScriptFormat
{
public override string Tag { get { return "GSC"; } }
public override string Description { get { return "Liar-soft proprietary script format"; } }
public override string Description { get { return Strings.arcStrings.GSCDescription; } }
public override uint Signature { get { return 0; } }
public override ScriptData Read (string name, Stream stream)

View File

@@ -45,8 +45,9 @@ namespace GameRes.Formats.KiriKiri
public class Xp3Opener : ArchiveFormat
{
public override string Tag { get { return "XP3"; } }
public override string Description { get { return "KiriKiri game engine resource archive"; } }
public override string Description { get { return arcStrings.XP3Description; } }
public override uint Signature { get { return 0x0d335058; } }
public override bool IsHierarchic { get { return false; } }
private static readonly ICrypt NoCryptAlgorithm = new NoCrypt();

View File

@@ -20,8 +20,9 @@ namespace GameRes.Formats
public class YpfOpener : ArchiveFormat
{
public override string Tag { get { return "YPF"; } }
public override string Description { get { return "Yu-Ris game engine resource archive"; } }
public override string Description { get { return arcStrings.YPFDescription; } }
public override uint Signature { get { return 0x00465059; } }
public override bool IsHierarchic { get { return true; } }
private const uint DefaultKey = 0xffffffff;

View File

@@ -60,6 +60,15 @@ namespace GameRes.Formats.Strings {
}
}
/// <summary>
/// Looks up a localized string similar to Amaterasu Translations Muv-Luv archive.
/// </summary>
public static string AMIDescription {
get {
return ResourceManager.GetString("AMIDescription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Archive content is encrypted.
///Choose appropriate encryption scheme..
@@ -79,6 +88,42 @@ namespace GameRes.Formats.Strings {
}
}
/// <summary>
/// Looks up a localized string similar to âge proprietary image format.
/// </summary>
public static string GRPDescription {
get {
return ResourceManager.GetString("GRPDescription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Liar-soft proprietary script format.
/// </summary>
public static string GSCDescription {
get {
return ResourceManager.GetString("GSCDescription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to FrontWing game resource archive.
/// </summary>
public static string INTDescription {
get {
return ResourceManager.GetString("INTDescription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Numeric key should be a 32-bit hexadecimal integer.
/// </summary>
public static string INTKeyRequirement {
get {
return ResourceManager.GetString("INTKeyRequirement", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Numeric key.
/// </summary>
@@ -117,6 +162,60 @@ namespace GameRes.Formats.Strings {
}
}
/// <summary>
/// Looks up a localized string similar to Liar-soft image archive.
/// </summary>
public static string LWGDescription {
get {
return ResourceManager.GetString("LWGDescription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Nitro+ resource archive.
/// </summary>
public static string NPADescription {
get {
return ResourceManager.GetString("NPADescription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Amaterasu Translations Muv-Luv script file.
/// </summary>
public static string SCRDescription {
get {
return ResourceManager.GetString("SCRDescription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Liar-soft game resource archive.
/// </summary>
public static string XFLDescription {
get {
return ResourceManager.GetString("XFLDescription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to KiriKiri game engine resource archive.
/// </summary>
public static string XP3Description {
get {
return ResourceManager.GetString("XP3Description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Yu-Ris game engine resource archive.
/// </summary>
public static string YPFDescription {
get {
return ResourceManager.GetString("YPFDescription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to 8-bit encryption key.
/// </summary>

View File

@@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AMIDescription" xml:space="preserve">
<value>Amaterasu Translations Muv-Luv archive</value>
</data>
<data name="ArcEncryptedNotice" xml:space="preserve">
<value>Archive content is encrypted.
Choose appropriate encryption scheme.</value>
@@ -124,6 +127,18 @@ Choose appropriate encryption scheme.</value>
<data name="ArcNoEncryption" xml:space="preserve">
<value>no encryption</value>
</data>
<data name="GRPDescription" xml:space="preserve">
<value>âge proprietary image format</value>
</data>
<data name="GSCDescription" xml:space="preserve">
<value>Liar-soft proprietary script format</value>
</data>
<data name="INTDescription" xml:space="preserve">
<value>FrontWing game resource archive</value>
</data>
<data name="INTKeyRequirement" xml:space="preserve">
<value>Numeric key should be a 32-bit hexadecimal integer</value>
</data>
<data name="INTLabelNumericKey" xml:space="preserve">
<value>Numeric key</value>
</data>
@@ -138,6 +153,24 @@ Choose appropriate encryption scheme.</value>
Enter archive encryption key or choose
predefined encryption scheme.</value>
</data>
<data name="LWGDescription" xml:space="preserve">
<value>Liar-soft image archive</value>
</data>
<data name="NPADescription" xml:space="preserve">
<value>Nitro+ resource archive</value>
</data>
<data name="SCRDescription" xml:space="preserve">
<value>Amaterasu Translations Muv-Luv script file</value>
</data>
<data name="XFLDescription" xml:space="preserve">
<value>Liar-soft game resource archive</value>
</data>
<data name="XP3Description" xml:space="preserve">
<value>KiriKiri game engine resource archive</value>
</data>
<data name="YPFDescription" xml:space="preserve">
<value>Yu-Ris game engine resource archive</value>
</data>
<data name="YPFLabelKey" xml:space="preserve">
<value>8-bit encryption key</value>
</data>

View File

@@ -124,6 +124,9 @@
<data name="ArcNoEncryption" xml:space="preserve">
<value>без шифрования</value>
</data>
<data name="INTKeyRequirement" xml:space="preserve">
<value>Цифровой ключ должен быть 32-битным шестнадцатиричным числом</value>
</data>
<data name="INTLabelNumericKey" xml:space="preserve">
<value>Цифровой ключ</value>
</data>

View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:GameRes.Formats.Strings"
xmlns:local="clr-namespace:GameRes.Formats.GUI"
MaxWidth="250">
MaxWidth="260">
<Grid.Resources>
<local:KeyConverter x:Key="keyConverter"/>
<Style TargetType="{x:Type TextBox}">
@@ -17,7 +17,7 @@
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition MinWidth="100" Width="*"/>
<ColumnDefinition MinWidth="130" Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>

View File

@@ -118,7 +118,7 @@ namespace GameRes.Formats.GUI
}
catch
{
return new ValidationResult (false, "Numeric key should be a 32-bit hexadecimal integer");
return new ValidationResult (false, Strings.arcStrings.INTKeyRequirement);
}
return new ValidationResult (true, null);
}