/[RomCheater]/trunk/RomCheater.RVAScratchPad/Form1.cs
ViewVC logotype

Diff of /trunk/RomCheater.RVAScratchPad/Form1.cs

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

--- trunk/RomCheater.RVAScratchPad/Form1.cs	2013/06/18 10:25:55	713
+++ trunk/RomCheater.RVAScratchPad/Form1.cs	2013/06/18 10:59:36	716
@@ -62,34 +62,12 @@
         {
             loader = new PluginLoader();
             loader.LoadPlugins(silent);
-
-
-            ConfigPlugin = loader.GetGenericConfigPlugin();
-            if (ConfigPlugin != null && !silent)
-                logger.Info.WriteLine("Loaded Config Plugin: {0}", ConfigPlugin.ToString());
-
-            //var UserControlPlugins = new List<IUserControlPlugin>(loader.LoadedUserControlPlugins);
-            //foreach (var userplugin in UserControlPlugins) { }
-
-
-            //var config_guids = loader.GetKnownPluginGuids<IConfigPlugin>();
-            //var input_guids = loader.GetKnownPluginGuids<IInputPlugin>();
-            //var window_guids = loader.GetKnownPluginGuids<IWindowPlugin>();
-            //var userplugin_guids = loader.GetKnownPluginGuids<IUserControlPlugin>();
-            //var plugin1 = loader.GetPluginByName<IUserControlPlugin>("ScratchPad Plugin");
-            //var plugin2 = loader.GetPluginByName<IUserControlPlugin>("RVA Calculator Plugin");
-
-
-            //var plugin1 = PluginCollection.UserControlPlugins.CheatCodePlugin.Plugin;
-            //var plugin2 = PluginCollection.UserControlPlugins.EmuMMAPPlugin.Plugin;
-            //var plugin3 = PluginCollection.UserControlPlugins.RVACalculatorPlugin.Plugin;
-            //var plugin4 = PluginCollection.UserControlPlugins.ScratchPadPlugin.Plugin;
-
-            //var plugin1 = PluginCollection.GetPluginByName(PluginNames.ScratchPadPlugin);
-            //var plugin2 = PluginCollection.GetPluginByName(PluginNames.RVACalculatorPlugin);            
-
-            var plugins = PluginCollection.GetPluginsByType(PluginType.Window);
-
+            var config = PluginCollection.GetPluginByName(PluginNames.GenericConfig);
+            var scratchpad = PluginCollection.GetPluginByName(PluginNames.ScratchPadPlugin);
+            var rvacalc = PluginCollection.GetPluginByName(PluginNames.RVACalculatorPlugin);
+            ConfigPlugin = loader.GetPluginByGuid<IConfigPlugin>(config.ID.ToString());
+            ScratchPadPlugin = loader.GetPluginByGuid<IUserControlPlugin>(scratchpad.ID.ToString());
+            RVACalcPlugin = loader.GetPluginByGuid<IUserControlPlugin>(rvacalc.ID.ToString());
         }
 
 
@@ -129,12 +107,24 @@
         {
             m_LogWindow = new FloatingLogWindow();
             m_wb = new FloatingWebBrowser();
+            m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
         }
         #region SetupDockWindowHandler support
         public void SetupDockWindowHandler()
         {
             SetupLogWindowHandler();
             SetupWebBrowserWindowHandler();
+            SetupPluginWindowHandlers();
+        }
+        private void SetupPluginWindowHandlers()
+        {
+            //if (RVACalcPlugin != null)
+            //{
+                
+            //}
+            //if (ScratchPadPlugin != null)
+            //{
+            //}
         }
         private void SetupLogWindowHandler()
         {
@@ -148,7 +138,7 @@
             if (m_wb == null) return;
             //m_wb.Shown += new EventHandler(AddDockToWindowList);
             //m_wb.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
-            //m_wb.Activate();
+            m_wb.Activate();
         }
         #endregion
         public void ShowDocks()
@@ -157,6 +147,8 @@
             SetupLogWindowHandler();
             ShowWebBrowser();
             SetupWebBrowserWindowHandler();
+            ShowPluginWindows();
+            SetupPluginWindowHandlers();
         }
         public void ShowLogWindow()
         {
@@ -177,6 +169,13 @@
             m_wb.CloseButtonVisible = false;
             m_wb.Show(dockPanel);
         }
+        public void ShowPluginWindows()
+        {
+            // RVA Calc
+            RVACalcPlugin.Show(dockPanel);
+            // ScratchPad
+            ScratchPadPlugin.Show(dockPanel);
+        }
         #endregion
 
         private void Form1_FormClosing(object sender, FormClosingEventArgs e)

 

  ViewVC Help
Powered by ViewVC 1.1.22