/[RomCheater]/trunk/RomCheater/Main.cs
ViewVC logotype

Diff of /trunk/RomCheater/Main.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater/Main.cs	2012/05/09 19:41:06	86
+++ trunk/RomCheater/Main.cs	2012/05/09 19:51:42	87
@@ -11,12 +11,16 @@
 using RomCheater.UserSettingsSupport;
 using RomCheater.PluginFramework.Core;
 using System.Diagnostics;
+using RomCheater.PluginFramework.Interfaces;
 
 namespace RomCheater
 {
     public partial class Main : Form
     {
         PluginLoader loader = null;
+        IConfigPlugin ConfigPlugin = null;
+        IInputPlugin InputPlugin = null;
+        IWindowPlugin WindowPlugin = null;
         static Main()
         {
             SettingSubscriber.AddSubscriber(Settings.Default);
@@ -38,12 +42,29 @@
             load_loggerflags();
             LoggerInstance = logwriter;
             LoggerInstance.CreateNewLog(false);
+            load_plugins();
         }
 
         private void load_loggerflags()
         {
             logger.SetLoggingFlags((loggerflags)Logging.Properties.Settings.Default.LoggingFlags);
         }
+        private void load_plugins()
+        {
+            loader = new PluginLoader();
+            loader.LoadPlugins();
+
+            ConfigPlugin = loader.GetConfigPlugin(RomCheater.Properties.Settings.Default.LastConfigPlugin);
+            if (ConfigPlugin != null)
+                logger.Info.WriteLine("Loaded Config Plugin: {0}", ConfigPlugin.ToString());
+            InputPlugin = loader.GetInputPlugin(RomCheater.Properties.Settings.Default.LastInputPlugin);
+            if (InputPlugin != null)
+                logger.Info.WriteLine("Loaded Input Plugin: {0}", InputPlugin.ToString());
+            WindowPlugin = loader.GetWindowPlugin(RomCheater.Properties.Settings.Default.LastWindowPlugin);
+            if (WindowPlugin != null)
+                logger.Info.WriteLine("Loaded Window Plugin: {0}", WindowPlugin.ToString());
+
+        }
 
         private void mnuItemExit_Click(object sender, EventArgs e)
         {
@@ -56,9 +77,7 @@
         }
 
         private void Main_Load(object sender, EventArgs e)
-        {
-            loader = new PluginLoader();
-            loader.LoadPlugins();            
+        {        
         }
 
         private void mnuItemConfig_Click(object sender, EventArgs e)

 

  ViewVC Help
Powered by ViewVC 1.1.22