Formatting FIxes (#58)

This commit is contained in:
Kamron Batman 2019-10-04 23:08:13 -07:00 committed by GitHub
parent 57fb9fb525
commit 096d39609e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1318 changed files with 11633 additions and 22129 deletions

View file

@ -154,14 +154,12 @@ namespace Server.Engines.Help
{
string path = Path.Combine(Core.BaseDirectory, "Data/pageresponse.cfg");
using (StreamWriter op = new StreamWriter(path))
using StreamWriter op = new StreamWriter(path);
for (int i = 0; i < List.Count; ++i)
{
for (int i = 0; i < List.Count; ++i)
{
PredefinedResponse resp = List[i];
PredefinedResponse resp = List[i];
op.WriteLine("{0}\t{1}", resp.Title, resp.Message);
}
op.WriteLine("{0}\t{1}", resp.Title, resp.Message);
}
}
catch (Exception e)
@ -181,20 +179,18 @@ namespace Server.Engines.Help
try
{
using (StreamReader ip = new StreamReader(path))
using StreamReader ip = new StreamReader(path);
string line;
while ((line = ip.ReadLine()?.Trim()) != null)
{
string line;
if (line.Length == 0 || line.StartsWith("#"))
continue;
while ((line = ip.ReadLine()?.Trim()) != null)
{
if (line.Length == 0 || line.StartsWith("#"))
continue;
string[] split = line.Split('\t');
string[] split = line.Split('\t');
if (split.Length == 2)
list.Add(new PredefinedResponse(split[0], split[1]));
}
if (split.Length == 2)
list.Add(new PredefinedResponse(split[0], split[1]));
}
}
catch (Exception e)
@ -305,15 +301,9 @@ namespace Server.Engines.Help
}
}
public string Center(string text)
{
return $"<CENTER>{text}</CENTER>";
}
public string Center(string text) => $"<CENTER>{text}</CENTER>";
public string Color(string text, int color)
{
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
}
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
public void AddTextInput(int x, int y, int w, int h, int id, string def)
{