Skip to content
This repository was archived by the owner on Jun 23, 2022. It is now read-only.

Commit 67027dd

Browse files
committed
Implemented SettingsPathStore
Replaced RegistryPathStore with SettingsPathStore RegistryPathStore still kept for Debug mode
1 parent 6302f09 commit 67027dd

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Installer/DependencyRegistry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ private static Container defaultContainer()
2828
x.ForSingletonOf<IInstaller>().Use<Installer>();
2929
x.ForSingletonOf<IPrompts>().Use<Prompts>();
3030
x.For<IBsaDiff>().Use<BsaDiff>();
31-
x.For<IPathStore>().Use<RegistryPathStore>();
31+
x.For<IPathStore>().Use<SettingsPathStore>();
3232
});
3333
}
3434
}

Installer/SettingsPathStore.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
using System;
22
using System.Diagnostics;
33
using Microsoft.Win32;
4+
using TaleOfTwoWastelands.Properties;
45

56
namespace TaleOfTwoWastelands
67
{
78
public class SettingsPathStore : IPathStore
89
{
910
public string GetPathFromKey(string keyName)
1011
{
11-
throw new NotImplementedException();
12-
}
12+
return (string)Settings.Default[keyName];
13+
}
1314

14-
public void SetPathFromKey(string keyName, string path)
15+
public void SetPathFromKey(string keyName, string path)
1516
{
16-
throw new NotImplementedException();
17+
Settings.Default[keyName] = path;
18+
Settings.Default.Save();
1719
}
18-
}
20+
}
1921
}

Installer/Tale Of Two Wastelands Installer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
<DependentUpon>Game.resx</DependentUpon>
124124
</Compile>
125125
<Compile Include="SettingsPathStore.cs" />
126-
<Compile Include="RegistryPathStore.cs" />
126+
<Compile Include="RegistryPathStore.cs" Condition="'$(Configuration)'=='Debug'" />
127127
<Compile Include="Properties\Localization.Designer.cs">
128128
<AutoGen>True</AutoGen>
129129
<DesignTime>True</DesignTime>

0 commit comments

Comments
 (0)