This commit is contained in:
UnknownShadow200 2018-04-14 18:19:40 +10:00
parent ea1c8c222c
commit f5efa79e70
2 changed files with 9 additions and 13 deletions

View file

@ -55,7 +55,7 @@ namespace ClassicalSharp {
public static void Load(string pluginName, bool needsInit) {
try {
string path = Path.Combine("plguins", pluginName + ".dll");
string path = Path.Combine("plugins", pluginName + ".dll");
Assembly lib = Assembly.LoadFrom(path);
Type[] types = lib.GetTypes();

View file

@ -92,7 +92,7 @@ namespace ClassicalSharp {
}
static bool TryGetValue(string key, out string value) {
value = null;
value = null;
int i = FindOption(key);
if (i >= 0) { value = OptionsValues[i]; return true; }
@ -194,7 +194,7 @@ namespace ClassicalSharp {
using (Stream fs = Platform.FileOpen(Filename))
using (StreamReader reader = new StreamReader(fs, false))
{
LoadFrom(reader);
LoadFrom(reader);
}
return true;
} catch (FileNotFoundException) {
@ -236,7 +236,12 @@ namespace ClassicalSharp {
using (Stream fs = Platform.FileCreate(Filename))
using (StreamWriter writer = new StreamWriter(fs))
{
SaveTo(writer);
for (int i = 0; i < OptionsKeys.Count; i++) {
writer.Write(OptionsKeys[i]);
writer.Write('=');
writer.Write(OptionsValues[i]);
writer.WriteLine();
}
}
OptionsChanged.Clear();
@ -246,14 +251,5 @@ namespace ClassicalSharp {
return false;
}
}
static void SaveTo(StreamWriter writer) {
for (int i = 0; i < OptionsKeys.Count; i++) {
writer.Write(OptionsKeys[i]);
writer.Write('=');
writer.Write(OptionsValues[i]);
writer.WriteLine();
}
}
}
}