ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater.CheatPlugin/CheatCodePlugin.cs
(Generate patch)

Comparing trunk/RomCheater.CheatPlugin/CheatCodePlugin.cs (file contents):
Revision 440 by william, Tue May 28 19:10:10 2013 UTC vs.
Revision 442 by william, Tue May 28 19:35:34 2013 UTC

--- trunk/RomCheater.CheatPlugin/CheatCodePlugin.cs	2013/05/28 19:10:10	440
+++ trunk/RomCheater.CheatPlugin/CheatCodePlugin.cs	2013/05/28 19:35:34	442
@@ -1,4 +1,5 @@
-´╗┐using System;
+´╗┐//#define PLUGIN_ENABLED // when defined the plugin is enabled, otherwise it will not be shown
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -39,23 +40,27 @@ namespace RomCheater.CheatPlugin
 
         public override void Config()
         {
-            Logging.logger.Warn.WriteLine("This plugin has no configurable settings.");
+            Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - has no configurable settings", name, ID);
         }
 
-        public override void Show()
+        public override void Show() { Show(null); }
+        public override void Show(DockPanel dockPanel) { Show(dockPanel, DockState.Document); }
+        public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); }
+        private void InternalShow(DockPanel dockPanel, DockState dockState)
         {
+#if PLUGIN_ENABLED
             var t = new CheatCodeDockContent();
-            t.Show();
-        }
-        public override void Show(DockPanel dockPanel)
-        {
-            var t = new CheatCodeDockContent();
-            t.Show(dockPanel);
-        }
-        public override void Show(DockPanel dockPanel, DockState dockState)
-        {
-            var t = new CheatCodeDockContent();
-            t.Show(dockPanel, dockState);
+            if (dockPanel == null)
+            {
+                t.Show();
+            }
+            else
+            {
+                t.Show(dockPanel, dockState);
+            }
+#else
+            Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - is currently disabled", name, ID);
+#endif
         }
     }
 }