fixed code to work with new resource settings interface.

This commit is contained in:
morkt
2018-01-08 20:04:23 +04:00
parent 2e2e447c42
commit cd4e1174af
56 changed files with 179 additions and 158 deletions

View File

@@ -23,7 +23,6 @@
// IN THE SOFTWARE.
//
using GameRes.Formats.Properties;
using GameRes.Formats.Strings;
using System;
using System.Collections.Generic;
@@ -114,14 +113,14 @@ namespace GameRes.Formats.FC01
public override ResourceOptions GetDefaultOptions ()
{
return new McgOptions { Key = Settings.Default.MCGLastKey };
return new McgOptions { Key = Properties.Settings.Default.MCGLastKey };
}
public override ResourceOptions GetOptions (object widget)
{
var w = widget as GUI.WidgetMCG;
if (null != w)
Settings.Default.MCGLastKey = w.GetKey();
Properties.Settings.Default.MCGLastKey = w.GetKey ();
return GetDefaultOptions();
}

View File

@@ -29,7 +29,6 @@ using System.ComponentModel.Composition;
using System.IO;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using GameRes.Formats.Properties;
using GameRes.Formats.Strings;
using GameRes.Utility;
@@ -102,7 +101,7 @@ namespace GameRes.Formats.FC01
public override ImageData Read (IBinaryStream stream, ImageMetaData info)
{
var meta = (McgMetaData)info;
byte key = Settings.Default.MCGLastKey;
byte key = Properties.Settings.Default.MCGLastKey;
if (101 == meta.Version)
{
if (null == LastKey)
@@ -127,14 +126,14 @@ namespace GameRes.Formats.FC01
public override ResourceOptions GetDefaultOptions ()
{
return new McgOptions { Key = Settings.Default.MCGLastKey };
return new McgOptions { Key = Properties.Settings.Default.MCGLastKey };
}
public override ResourceOptions GetOptions (object widget)
{
var w = widget as GUI.WidgetMCG;
if (null != w)
Settings.Default.MCGLastKey = w.GetKey();
Properties.Settings.Default.MCGLastKey = w.GetKey ();
return GetDefaultOptions();
}
@@ -272,10 +271,10 @@ namespace GameRes.Formats.FC01
continue;
}
Transform();
Settings.Default.MCGLastKey = m_key;
Properties.Settings.Default.MCGLastKey = m_key;
return;
}
while (m_key != Settings.Default.MCGLastKey);
while (m_key != Properties.Settings.Default.MCGLastKey);
throw new UnknownEncryptionScheme();
}