From 51e7b224ecb2a6b4d9a7db84dfe48c497a1a7923 Mon Sep 17 00:00:00 2001 From: morkt Date: Wed, 10 Jan 2018 17:11:29 +0400 Subject: [PATCH] (WidgetXP3): better remember last used scheme. --- ArcFormats/KiriKiri/WidgetXP3.xaml.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ArcFormats/KiriKiri/WidgetXP3.xaml.cs b/ArcFormats/KiriKiri/WidgetXP3.xaml.cs index 6fe4c5f4..25c1af8d 100644 --- a/ArcFormats/KiriKiri/WidgetXP3.xaml.cs +++ b/ArcFormats/KiriKiri/WidgetXP3.xaml.cs @@ -15,11 +15,14 @@ namespace GameRes.Formats.GUI { public WidgetXP3 () { + var last_selected = Properties.Settings.Default.XP3Scheme; InitializeComponent(); var keys = new[] { new KeyValuePair (arcStrings.ArcNoEncryption, Xp3Opener.NoCryptAlgorithm) }; this.DataContext = keys.Concat (Xp3Opener.KnownSchemes.OrderBy (x => x.Key)); this.Loaded += (s, e) => { - if (-1 == this.Scheme.SelectedIndex) + if (!string.IsNullOrEmpty (last_selected)) + this.Scheme.SelectedValue = last_selected; + else this.Scheme.SelectedIndex = 0; }; }