@@ -7,24 +7,27 @@ namespace TaleOfTwoWastelands.UI
77 public class Prompts : IPrompts
88 {
99 private readonly FileDialog openDialog , saveDialog ;
10+
1011 private readonly ILog Log ;
12+ private readonly IPathStore _store ;
1113
12- public string Fallout3Path { get ; private set ; }
14+ public string Fallout3Path { get ; private set ; }
1315 public string FalloutNVPath { get ; private set ; }
1416 public string TTWSavePath { get ; private set ; }
1517
16- public Prompts ( OpenFileDialog openDialog , SaveFileDialog saveDialog , ILog log )
18+ public Prompts ( OpenFileDialog openDialog , SaveFileDialog saveDialog , ILog log , IPathStore store )
1719 {
1820 Log = log ;
21+ _store = store ;
1922
2023 this . openDialog = openDialog ;
2124 this . saveDialog = saveDialog ;
2225
2326 if ( Program . IsElevated )
2427 {
25- Fallout3Path = RegistryHelper . GetPathFromKey ( "Fallout3" ) ;
26- FalloutNVPath = RegistryHelper . GetPathFromKey ( "FalloutNV" ) ;
27- TTWSavePath = RegistryHelper . GetPathFromKey ( "TaleOfTwoWastelands" ) ;
28+ Fallout3Path = store . GetPathFromKey ( "Fallout3" ) ;
29+ FalloutNVPath = store . GetPathFromKey ( "FalloutNV" ) ;
30+ TTWSavePath = store . GetPathFromKey ( "TaleOfTwoWastelands" ) ;
2831 }
2932 }
3033
@@ -72,7 +75,7 @@ private string FindByUserPrompt(FileDialog dialog, string name, string keyName,
7275 var path = Path . GetDirectoryName ( dialog . FileName ) ;
7376 Log . File ( "User {2}changed {0} directory to '{1}'" , name , path , manual ? "manually " : " " ) ;
7477
75- RegistryHelper . SetPathFromKey ( keyName , path ) ;
78+ _store . SetPathFromKey ( keyName , path ) ;
7679
7780 return path ;
7881 }
0 commit comments