-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
106 lines (88 loc) · 3.32 KB
/
Copy pathProgram.cs
File metadata and controls
106 lines (88 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using System.Text;
namespace ed_journal_chat
{
internal class Program
{
private static bool HelpMode = false;
[STAThread]
public static void Main(string[] args)
{
Console.OutputEncoding = Encoding.UTF8;
Options.SelectJournalFile();
Console.WriteLine("Press 'h' for Help!");
if (Config.ActiveJournalFile != null)
{
JournalReader.ParseJournalFile(Config.ActiveJournalFile.FullName);
JournalReader.RunWatcher();
}
char? input = null;
while (!input.Equals('q'))
{
input = Console.ReadKey().KeyChar;
Console.SetCursorPosition(0, Console.CursorTop);
Console.Write(" ");
Console.SetCursorPosition(0, Console.CursorTop);
switch (input)
{
case ' ':
if (CMDR.FSDTarget != null)
{
SetClipboard(CMDR.FSDTarget.Name);
DisplayOutput.FSDTarget(CMDR.FSDTarget);
} else
{
Console.WriteLine("No targeted system found!");
}
break;
case 's':
SetClipboard(CMDR.LastSentText); break;
case 'ы':
SetClipboard(CMDR.LastSentText); break;
case 'r':
SetClipboard(CMDR.LastReceivedText); break;
case 'к':
SetClipboard(CMDR.LastReceivedText); break;
case 'h':
PrintHelp(); break;
}
}
}
private static void SetClipboard(string? s)
{
if (s != null && s.Length > 0)
{
Clipboard.SetText(s);
}
}
private static void PrintHelp()
{
HelpMode = !HelpMode;
if (HelpMode)
{
JournalReader.StopWatcher();
Console.Clear();
Console.WriteLine("'q' close the program");
Console.WriteLine("'space'\tcopy target system to clipboard");
Console.WriteLine("'s'\tcopy last sent message to clipboard");
Console.WriteLine("'r'\tcopy last received message to clipboard");
Console.WriteLine("'h'\topen and close this page");
Console.WriteLine();
Console.WriteLine("Chat colors are as follows:");
foreach(KeyValuePair<string, ConsoleColor> entry in DisplayOutput.ChatColors)
{
Console.ForegroundColor = entry.Value;
Console.WriteLine(DisplayOutput.ChannelTranslations[entry.Key]);
}
Console.ForegroundColor = ConsoleColor.Gray;
} else
{
Console.Clear();
if (Config.ActiveJournalFile != null)
{
JournalReader.ContinueWatcher();
JournalReader.ParseJournalFile(Config.ActiveJournalFile.FullName);
}
}
}
}
}