1 |
william |
5 |
using System; |
2 |
|
|
using System.Collections.Generic; |
3 |
|
|
using System.ComponentModel; |
4 |
|
|
using System.Data; |
5 |
|
|
using System.Drawing; |
6 |
|
|
using System.Linq; |
7 |
|
|
using System.Text; |
8 |
|
|
using System.Windows.Forms; |
9 |
william |
17 |
using RomCheater.Logging; |
10 |
william |
34 |
using RomCheater.Properties; |
11 |
|
|
using RomCheater.UserSettingsSupport; |
12 |
william |
83 |
using RomCheater.PluginFramework.Core; |
13 |
william |
86 |
using System.Diagnostics; |
14 |
william |
87 |
using RomCheater.PluginFramework.Interfaces; |
15 |
william |
5 |
|
16 |
|
|
namespace RomCheater |
17 |
|
|
{ |
18 |
william |
13 |
public partial class Main : Form |
19 |
william |
5 |
{ |
20 |
william |
86 |
PluginLoader loader = null; |
21 |
william |
87 |
IConfigPlugin ConfigPlugin = null; |
22 |
|
|
IInputPlugin InputPlugin = null; |
23 |
|
|
IWindowPlugin WindowPlugin = null; |
24 |
william |
34 |
static Main() |
25 |
|
|
{ |
26 |
|
|
SettingSubscriber.AddSubscriber(Settings.Default); |
27 |
|
|
} |
28 |
william |
20 |
private const string t = "RomCheater"; |
29 |
william |
17 |
#region LogWriterSupport |
30 |
|
|
static LogWriter _LoggerInstance; |
31 |
|
|
static LogWriter LoggerInstance |
32 |
|
|
{ |
33 |
|
|
get { return _LoggerInstance; } |
34 |
|
|
set { _LoggerInstance = value; } |
35 |
|
|
} |
36 |
|
|
#endregion |
37 |
|
|
|
38 |
|
|
|
39 |
william |
13 |
public Main() |
40 |
william |
5 |
{ |
41 |
|
|
InitializeComponent(); |
42 |
william |
83 |
load_loggerflags(); |
43 |
william |
17 |
LoggerInstance = logwriter; |
44 |
william |
23 |
LoggerInstance.CreateNewLog(false); |
45 |
william |
87 |
load_plugins(); |
46 |
william |
5 |
} |
47 |
william |
14 |
|
48 |
william |
83 |
private void load_loggerflags() |
49 |
|
|
{ |
50 |
|
|
logger.SetLoggingFlags((loggerflags)Logging.Properties.Settings.Default.LoggingFlags); |
51 |
|
|
} |
52 |
william |
87 |
private void load_plugins() |
53 |
|
|
{ |
54 |
|
|
loader = new PluginLoader(); |
55 |
|
|
loader.LoadPlugins(); |
56 |
william |
83 |
|
57 |
william |
87 |
ConfigPlugin = loader.GetConfigPlugin(RomCheater.Properties.Settings.Default.LastConfigPlugin); |
58 |
|
|
if (ConfigPlugin != null) |
59 |
|
|
logger.Info.WriteLine("Loaded Config Plugin: {0}", ConfigPlugin.ToString()); |
60 |
|
|
InputPlugin = loader.GetInputPlugin(RomCheater.Properties.Settings.Default.LastInputPlugin); |
61 |
|
|
if (InputPlugin != null) |
62 |
|
|
logger.Info.WriteLine("Loaded Input Plugin: {0}", InputPlugin.ToString()); |
63 |
|
|
WindowPlugin = loader.GetWindowPlugin(RomCheater.Properties.Settings.Default.LastWindowPlugin); |
64 |
|
|
if (WindowPlugin != null) |
65 |
|
|
logger.Info.WriteLine("Loaded Window Plugin: {0}", WindowPlugin.ToString()); |
66 |
|
|
|
67 |
|
|
} |
68 |
|
|
|
69 |
william |
14 |
private void mnuItemExit_Click(object sender, EventArgs e) |
70 |
|
|
{ |
71 |
|
|
this.Close(); |
72 |
|
|
} |
73 |
william |
16 |
|
74 |
|
|
private void btnCopyLogToClipboard_Click(object sender, EventArgs e) |
75 |
|
|
{ |
76 |
|
|
|
77 |
|
|
} |
78 |
william |
17 |
|
79 |
|
|
private void Main_Load(object sender, EventArgs e) |
80 |
william |
87 |
{ |
81 |
william |
17 |
} |
82 |
william |
63 |
|
83 |
|
|
private void mnuItemConfig_Click(object sender, EventArgs e) |
84 |
|
|
{ |
85 |
william |
86 |
RomCheaterConfigDialog dlg = new RomCheaterConfigDialog(loader); |
86 |
william |
63 |
dlg.ShowDialog(); |
87 |
|
|
} |
88 |
william |
69 |
|
89 |
|
|
private void mnuItemOpenProcess_Click(object sender, EventArgs e) |
90 |
|
|
{ |
91 |
william |
86 |
//List<Process> procs = loader.LoadedConfigPlugins[0].ValidProcessesForPlugin; |
92 |
william |
69 |
} |
93 |
william |
5 |
} |
94 |
|
|
} |