Refactored StaticDataService to use local resources for ItemBaseTypes.txt and ItemClasses.txt instead of the old files in APPDATA that aren't used anymore.
Bumped develop version to 1.0.0-beta2
This commit is contained in:
parent
c6d75cfff6
commit
7e4e6fe42e
|
@ -586,8 +586,8 @@
|
|||
<Content Include="Resources\AlertSounds\SH22Vaal.mp3">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Resources\ItemBaseTypes.txt" />
|
||||
<Content Include="Resources\ItemClasses.txt" />
|
||||
<EmbeddedResource Include="Resources\ItemBaseTypes.txt" />
|
||||
<EmbeddedResource Include="Resources\ItemClasses.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Filtration.Common\Filtration.Common.csproj">
|
||||
|
|
|
@ -11,7 +11,7 @@ using System.Runtime.CompilerServices;
|
|||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0")]
|
||||
[assembly: AssemblyInformationalVersion("1.0.0-beta1")]
|
||||
[assembly: AssemblyInformationalVersion("1.0.0-beta2")]
|
||||
|
||||
[assembly: InternalsVisibleTo("Filtration.Tests")]
|
||||
[assembly: InternalsVisibleTo("Filtration.ItemFilterPreview.Tests")]
|
||||
|
|
|
@ -224,6 +224,93 @@ namespace Filtration.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to A Mother's Parting Gift
|
||||
///Abandoned Wealth
|
||||
///Aberrant Fossil
|
||||
///Abyssal Axe
|
||||
///Abyssal Cry
|
||||
///Abyssal Sceptre
|
||||
///Academy Map
|
||||
///Acid Lakes Map
|
||||
///Added Chaos Damage Support
|
||||
///Added Cold Damage Support
|
||||
///Added Fire Damage Support
|
||||
///Added Lightning Damage Support
|
||||
///Additional Accuracy Support
|
||||
///Aetheric Fossil
|
||||
///Agate Amulet
|
||||
///Albino Rhoa Feather
|
||||
///Alchemy Shard
|
||||
///Alder Spiked Shield
|
||||
///Alira's Amulet
|
||||
///Alleyways Map
|
||||
///Allflame
|
||||
///Alloyed Spiked Shield
|
||||
///Alteration Shard
|
||||
///Amber Amulet
|
||||
///Ambush Boots
|
||||
///Ambush Leaguestone
|
||||
///Ambush Mitts
|
||||
///Ambus [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string ItemBaseTypes {
|
||||
get {
|
||||
return ResourceManager.GetString("ItemBaseTypes", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Abyss Jewel
|
||||
///Active Skill Gems
|
||||
///Amulets
|
||||
///Axe
|
||||
///Belts
|
||||
///Body Armours
|
||||
///Boots
|
||||
///Bows
|
||||
///Claws
|
||||
///Currency
|
||||
///Daggers
|
||||
///Delve Socketable Currency
|
||||
///Divination Card
|
||||
///Fishing Rods
|
||||
///Flasks
|
||||
///Gems
|
||||
///Gloves
|
||||
///Helmets
|
||||
///Hybrid Flasks
|
||||
///Incursion Item
|
||||
///Jewel
|
||||
///Labyrinth Item
|
||||
///Labyrinth Map Item
|
||||
///Labyrinth Trinket
|
||||
///Large Relics
|
||||
///Leaguestone
|
||||
///Life Flasks
|
||||
///Mace
|
||||
///Mana Flasks
|
||||
///Map Fragments
|
||||
///Maps
|
||||
///Misc Map Items
|
||||
///One Hand Axes
|
||||
///One Hand Maces
|
||||
///One Hand Swords
|
||||
///Pantheon Soul
|
||||
///Piece
|
||||
///Quest Items
|
||||
///Quivers
|
||||
///Rings
|
||||
///Sceptres
|
||||
///Shields
|
||||
///Stackable [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string ItemClasses {
|
||||
get {
|
||||
return ResourceManager.GetString("ItemClasses", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
|
||||
/// </summary>
|
||||
|
|
|
@ -202,4 +202,10 @@
|
|||
<data name="SH22Vaal" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\AlertSounds\SH22Vaal.mp3;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="ItemBaseTypes" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ItemBaseTypes.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
<data name="ItemClasses" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ItemClasses.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1,9 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Filtration.Common.Services;
|
||||
using Filtration.Common.Utilities;
|
||||
using Filtration.Properties;
|
||||
|
||||
namespace Filtration.Services
|
||||
{
|
||||
|
@ -15,11 +14,8 @@ namespace Filtration.Services
|
|||
|
||||
internal class StaticDataService : IStaticDataService
|
||||
{
|
||||
private readonly IFileSystemService _fileSystemService;
|
||||
|
||||
public StaticDataService(IFileSystemService fileSystemService)
|
||||
public StaticDataService()
|
||||
{
|
||||
_fileSystemService = fileSystemService;
|
||||
PopulateStaticData();
|
||||
}
|
||||
|
||||
|
@ -29,32 +25,8 @@ namespace Filtration.Services
|
|||
|
||||
private void PopulateStaticData()
|
||||
{
|
||||
var itemBaseTypesPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Filtration\ItemBaseTypes.txt";
|
||||
var itemClassesPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Filtration\ItemClasses.txt";
|
||||
|
||||
string itemBaseTypes;
|
||||
try
|
||||
{
|
||||
itemBaseTypes = _fileSystemService.ReadFileAsString(itemBaseTypesPath);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
itemBaseTypes = string.Empty;
|
||||
}
|
||||
|
||||
ItemBaseTypes = new LineReader(() => new StringReader(itemBaseTypes)).ToList();
|
||||
|
||||
string itemClasses;
|
||||
try
|
||||
{
|
||||
itemClasses = _fileSystemService.ReadFileAsString(itemClassesPath);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
itemClasses = string.Empty;
|
||||
}
|
||||
|
||||
ItemClasses = new LineReader(() => new StringReader(itemClasses)).ToList();
|
||||
ItemBaseTypes = new LineReader(() => new StringReader(Resources.ItemBaseTypes)).ToList();
|
||||
ItemClasses = new LineReader(() => new StringReader(Resources.ItemClasses)).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue