Skip to content

Commit bf7ccb8

Browse files
committed
Fixed ModLauncher.dat paths
1 parent 1d7bf7f commit bf7ccb8

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

MainForm.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,15 @@ protected override CreateParams CreateParams
3838
}
3939
}
4040

41+
#if DEBUG
42+
public static string gamePath = @"D:\AHL2_R";
43+
#else
44+
public static string gamePath = Directory.GetCurrentDirectory();
45+
#endif
46+
4147
List<Mod> mods = new List<Mod>();
4248
bool bFullyLoaded = false;
43-
Settings settings = new Settings();
49+
Settings settings = new Settings(gamePath);
4450

4551
public MainForm()
4652
{
@@ -191,12 +197,6 @@ public static bool setRegistryValue(string subkey, string value)
191197
return true;
192198
}
193199

194-
#if DEBUG
195-
public static string gamePath = @"D:\AHL2_R";
196-
#else
197-
public static string gamePath = Directory.GetCurrentDirectory();
198-
#endif
199-
200200
public static string getModDirectory()
201201
{
202202
// return getRegistryValue(FileSystem.Main.getRegistryMainPath(), "LNGameMod");

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
// You can specify all the values or you can default the Build and Revision Numbers
3434
// by using the '*' as shown below:
3535
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("0.9.2.0")]
37-
[assembly: AssemblyFileVersion("0.9.2.0")]
36+
[assembly: AssemblyVersion("0.9.3.0")]
37+
[assembly: AssemblyFileVersion("0.9.3.0")]
3838
[assembly: NeutralResourcesLanguageAttribute("en")]

Settings.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ namespace ModLauncher
1010

1111
class Settings
1212
{
13-
public Settings()
13+
private string GamePath;
14+
public Settings(string gamePath)
1415
{
16+
this.GamePath = gamePath;
1517
// Writing
1618
/*
1719
List<Mod> mods = new List<Mod>();
@@ -41,7 +43,7 @@ public List<Mod> GetMods()
4143
{
4244
try
4345
{
44-
FileStream fstream = new FileStream("ModLauncher.dat", FileMode.OpenOrCreate);
46+
FileStream fstream = new FileStream(this.GamePath + "\\ModLauncher.dat", FileMode.OpenOrCreate);
4547
if (fstream == null || fstream.Length <= 0)
4648
{
4749
fstream.Close();
@@ -70,7 +72,7 @@ public bool WriteSettings( List<Mod> mods )
7072
try
7173
{
7274
// FileStream fstream = new FileStream("ModLauncher.dat", FileMode.OpenOrCreate);
73-
FileStream fstream = new FileStream("ModLauncher.dat", FileMode.Create);
75+
FileStream fstream = new FileStream(this.GamePath + "\\ModLauncher.dat", FileMode.Create);
7476
if (fstream == null)
7577
{
7678
fstream.Close();

0 commit comments

Comments
 (0)