mirror of
https://github.com/crskycode/GARbro.git
synced 2025-01-11 20:39:29 +08:00
rearranged archive parameters widgets.
This commit is contained in:
parent
6bf0e89f21
commit
5019124514
@ -273,9 +273,16 @@ namespace GameRes.Formats
|
|||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override ResourceOptions GetOptions ()
|
||||||
|
{
|
||||||
|
return new ResourceOptions {
|
||||||
|
Widget = new GUI.WidgetNPA()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
NpaTitleId QueryGameEncryption ()
|
NpaTitleId QueryGameEncryption ()
|
||||||
{
|
{
|
||||||
var widget = new GUI.WidgetNPA (KnownSchemes[(int)Settings.Default.NPAScheme]);
|
var widget = new GUI.WidgetNPA();
|
||||||
var args = new ParametersRequestEventArgs
|
var args = new ParametersRequestEventArgs
|
||||||
{
|
{
|
||||||
Notice = arcStrings.ArcEncryptedNotice,
|
Notice = arcStrings.ArcEncryptedNotice,
|
||||||
|
@ -55,14 +55,9 @@ namespace GameRes.Formats
|
|||||||
return new ZLibStream (input, CompressionMode.Decompress);
|
return new ZLibStream (input, CompressionMode.Decompress);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint m_last_key = Settings.Default.YPFKey;
|
|
||||||
|
|
||||||
uint QueryEncryptionKey ()
|
uint QueryEncryptionKey ()
|
||||||
{
|
{
|
||||||
uint? key = m_last_key;
|
var widget = new GUI.WidgetYPF();
|
||||||
if (m_last_key > 0xff)
|
|
||||||
key = null;
|
|
||||||
var widget = new GUI.WidgetYPF (key);
|
|
||||||
var args = new ParametersRequestEventArgs
|
var args = new ParametersRequestEventArgs
|
||||||
{
|
{
|
||||||
Notice = arcStrings.YPFNotice,
|
Notice = arcStrings.YPFNotice,
|
||||||
@ -72,10 +67,9 @@ namespace GameRes.Formats
|
|||||||
if (!args.InputResult)
|
if (!args.InputResult)
|
||||||
throw new OperationCanceledException();
|
throw new OperationCanceledException();
|
||||||
|
|
||||||
key = widget.GetKey();
|
uint last_key = widget.GetKey() ?? DefaultKey;
|
||||||
m_last_key = null != key && key.Value < 0x100 ? key.Value : DefaultKey;
|
Settings.Default.YPFKey = last_key;
|
||||||
Settings.Default.YPFKey = m_last_key;
|
return last_key;
|
||||||
return m_last_key;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class Parser
|
private class Parser
|
||||||
@ -99,9 +93,8 @@ namespace GameRes.Formats
|
|||||||
{
|
{
|
||||||
uint dir_offset = 0x20;
|
uint dir_offset = 0x20;
|
||||||
uint dir_remaining = m_dir_size;
|
uint dir_remaining = m_dir_size;
|
||||||
uint num;
|
|
||||||
var dir = new List<Entry> ((int)m_count);
|
var dir = new List<Entry> ((int)m_count);
|
||||||
for (num = 0; num < m_count; ++num)
|
for (uint num = 0; num < m_count; ++num)
|
||||||
{
|
{
|
||||||
if (dir_remaining < 0x17)
|
if (dir_remaining < 0x17)
|
||||||
break;
|
break;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:s="clr-namespace:GameRes.Formats.Strings"
|
xmlns:s="clr-namespace:GameRes.Formats.Strings"
|
||||||
|
xmlns:fmt="clr-namespace:GameRes.Formats"
|
||||||
xmlns:local="clr-namespace:GameRes.Formats.GUI"
|
xmlns:local="clr-namespace:GameRes.Formats.GUI"
|
||||||
MaxWidth="260">
|
MaxWidth="260">
|
||||||
<Grid.Resources>
|
<Grid.Resources>
|
||||||
@ -52,6 +53,7 @@
|
|||||||
<Label Content="{x:Static s:arcStrings.INTLabelScheme}" Target="{Binding ElementName=EncScheme}"
|
<Label Content="{x:Static s:arcStrings.INTLabelScheme}" Target="{Binding ElementName=EncScheme}"
|
||||||
Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right"/>
|
Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right"/>
|
||||||
<ComboBox Name="EncScheme" Grid.Column="1" Grid.Row="2" Margin="0,3,0,0"
|
<ComboBox Name="EncScheme" Grid.Column="1" Grid.Row="2" Margin="0,3,0,0"
|
||||||
|
ItemsSource="{Binding Source={x:Static fmt:IntOpener.KnownSchemes}, Path=Keys, Mode=OneWay}"
|
||||||
Width="{Binding ElementName=Passkey, Path=ActualWidth}"
|
Width="{Binding ElementName=Passkey, Path=ActualWidth}"
|
||||||
SelectedValue="{Binding Path=Scheme}"/>
|
SelectedValue="{Binding Path=Scheme}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -25,7 +25,6 @@ namespace GameRes.Formats.GUI
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.DataContext = encryption_info;
|
this.DataContext = encryption_info;
|
||||||
EncScheme.ItemsSource = IntOpener.KnownSchemes.Keys;
|
|
||||||
|
|
||||||
Passphrase.TextChanged += OnPassphraseChanged;
|
Passphrase.TextChanged += OnPassphraseChanged;
|
||||||
EncScheme.SelectionChanged += OnSchemeChanged;
|
EncScheme.SelectionChanged += OnSchemeChanged;
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
<Grid x:Class="GameRes.Formats.GUI.WidgetNPA"
|
<Grid x:Class="GameRes.Formats.GUI.WidgetNPA"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:fmt="clr-namespace:GameRes.Formats"
|
||||||
|
xmlns:p="clr-namespace:GameRes.Formats.Properties"
|
||||||
MaxWidth="250">
|
MaxWidth="250">
|
||||||
<ComboBox Name="Scheme" Margin="5" Width="180"/>
|
<ComboBox Name="Scheme" Width="180"
|
||||||
|
ItemsSource="{Binding Source={x:Static fmt:NpaOpener.KnownSchemes}, Mode=OneWay}"
|
||||||
|
SelectedIndex="{Binding Source={x:Static p:Settings.Default}, Path=NPAScheme, Mode=TwoWay}"/>
|
||||||
</Grid>
|
</Grid>
|
@ -1,5 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using GameRes.Formats.Properties;
|
||||||
|
|
||||||
namespace GameRes.Formats.GUI
|
namespace GameRes.Formats.GUI
|
||||||
{
|
{
|
||||||
@ -8,11 +9,10 @@ namespace GameRes.Formats.GUI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class WidgetNPA : Grid
|
public partial class WidgetNPA : Grid
|
||||||
{
|
{
|
||||||
public WidgetNPA (string scheme)
|
public WidgetNPA ()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Scheme.ItemsSource = NpaOpener.KnownSchemes;
|
Scheme.SelectedItem = NpaOpener.KnownSchemes[(int)Settings.Default.NPAScheme];
|
||||||
Scheme.SelectedItem = scheme;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetScheme()
|
public string GetScheme()
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
<Grid x:Class="GameRes.Formats.GUI.WidgetXP3"
|
<Grid x:Class="GameRes.Formats.GUI.WidgetXP3"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:fmt="clr-namespace:GameRes.Formats.KiriKiri"
|
||||||
|
xmlns:p="clr-namespace:GameRes.Formats.Properties"
|
||||||
MaxWidth="250">
|
MaxWidth="250">
|
||||||
<ComboBox Name="Scheme" Margin="5" Width="180"/>
|
<ComboBox Name="Scheme" ItemsSource="{Binding Source={x:Static fmt:Xp3Opener.KnownSchemes}, Path=Keys, Mode=OneWay}"
|
||||||
|
SelectedValue="{Binding Source={x:Static p:Settings.Default}, Path=XP3Scheme, Mode=TwoWay}" Width="180"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using GameRes.Formats.KiriKiri;
|
using GameRes.Formats.KiriKiri;
|
||||||
|
using GameRes.Formats.Properties;
|
||||||
|
using GameRes.Formats.Strings;
|
||||||
|
|
||||||
|
|
||||||
namespace GameRes.Formats.GUI
|
namespace GameRes.Formats.GUI
|
||||||
{
|
{
|
||||||
@ -9,16 +12,16 @@ namespace GameRes.Formats.GUI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class WidgetXP3 : Grid
|
public partial class WidgetXP3 : Grid
|
||||||
{
|
{
|
||||||
public WidgetXP3 (string scheme)
|
public WidgetXP3 ()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Scheme.ItemsSource = Xp3Opener.KnownSchemes.Keys;
|
if (null == Scheme.SelectedItem)
|
||||||
Scheme.SelectedItem = scheme;
|
Scheme.SelectedItem = arcStrings.ArcNoEncryption;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetScheme ()
|
public ICrypt GetScheme ()
|
||||||
{
|
{
|
||||||
return Scheme.SelectedItem as string;
|
return Xp3Opener.GetScheme (Scheme.SelectedItem as string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using GameRes.Formats.Properties;
|
||||||
|
|
||||||
namespace GameRes.Formats.GUI
|
namespace GameRes.Formats.GUI
|
||||||
{
|
{
|
||||||
@ -8,11 +9,13 @@ namespace GameRes.Formats.GUI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class WidgetYPF : Grid
|
public partial class WidgetYPF : Grid
|
||||||
{
|
{
|
||||||
public WidgetYPF (uint? key)
|
public WidgetYPF ()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
if (null != key)
|
|
||||||
this.Passkey.Text = key.Value.ToString();
|
uint key = Settings.Default.YPFKey;
|
||||||
|
if (key < 0x100)
|
||||||
|
this.Passkey.Text = key.ToString();
|
||||||
else
|
else
|
||||||
this.Passkey.Text = null;
|
this.Passkey.Text = null;
|
||||||
}
|
}
|
||||||
@ -20,7 +23,7 @@ namespace GameRes.Formats.GUI
|
|||||||
public uint? GetKey ()
|
public uint? GetKey ()
|
||||||
{
|
{
|
||||||
uint key;
|
uint key;
|
||||||
if (uint.TryParse (this.Passkey.Text, out key))
|
if (uint.TryParse (this.Passkey.Text, out key) && key < 0x100)
|
||||||
return key;
|
return key;
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user