mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
refactored ResourceOptions handling.
This commit is contained in:
@@ -21,10 +21,10 @@ namespace GameRes.Formats.GUI
|
||||
/// </summary>
|
||||
public partial class WidgetINT : Grid
|
||||
{
|
||||
public WidgetINT (IntEncryptionInfo encryption_info)
|
||||
public WidgetINT ()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = encryption_info;
|
||||
this.DataContext = GameRes.Formats.Properties.Settings.Default.INTEncryption ?? new IntEncryptionInfo();
|
||||
|
||||
Passphrase.TextChanged += OnPassphraseChanged;
|
||||
EncScheme.SelectionChanged += OnSchemeChanged;
|
||||
@@ -61,24 +61,6 @@ namespace GameRes.Formats.GUI
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public uint? GetKey ()
|
||||
{
|
||||
if (null != Info.Key && Info.Key.HasValue)
|
||||
return Info.Key;
|
||||
|
||||
if (!string.IsNullOrEmpty (Info.Scheme))
|
||||
{
|
||||
IntOpener.KeyData keydata;
|
||||
if (IntOpener.KnownSchemes.TryGetValue (Info.Scheme, out keydata))
|
||||
return keydata.Key;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty (Info.Password))
|
||||
return IntOpener.EncodePassPhrase (Info.Password);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[ValueConversion(typeof(uint?), typeof(string))]
|
||||
|
||||
Reference in New Issue
Block a user