Skip to content

Commit 752f4c3

Browse files
committed
ModAPI.Common: refactor LauncherSettings.cs
1 parent 63c1ee1 commit 752f4c3

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

ModAPI.Common/LauncherSettings.cs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,13 @@ public static bool ForceGamePath
6161
private static string GetConfigPath()
6262
{
6363
var programPath = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
64-
return Path.Combine(new string[] {programPath, FileName});
64+
return Path.Combine(programPath, FileName);
6565
}
6666

67-
6867
public static bool Load()
6968
{
70-
return Load(GetConfigPath());
71-
}
72-
73-
public static bool Load(string path)
74-
{
75-
if (File.Exists(FileName))
69+
string path = GetConfigPath();
70+
if (File.Exists(path))
7671
{
7772
string xmlIn = File.ReadAllText(path);
7873
if (!String.IsNullOrEmpty(xmlIn))
@@ -100,8 +95,9 @@ public static bool Load(string path)
10095
}
10196
}
10297

103-
public static void Save(string path)
98+
public static void Save()
10499
{
100+
string path = GetConfigPath();
105101
var document = new XmlDocument();
106102

107103
var mainNode = document.CreateElement("Settings");
@@ -117,10 +113,5 @@ public static void Save(string path)
117113

118114
document.Save(path);
119115
}
120-
121-
public static void Save()
122-
{
123-
Save(GetConfigPath());
124-
}
125116
}
126117
}

0 commit comments

Comments
 (0)