Example #1
0
 public void Initialize(InitializationInput input)
 {
     if (InitFunc != null)
     {
         InitFunc.Invoke(input);
     }
 }
        private static void LoadProduct()
        {
            lock (Locker)
            {
                if (Product != null)
                {
                    return;
                }
                Product = Load();
                _loaded = true;
                if (Product == null)
                {
                    return;
                }

                CombatProp     = Product.GetType().GetProperty("CombatBehavior");
                HealProp       = Product.GetType().GetProperty("HealBehavior");
                PullProp       = Product.GetType().GetProperty("PullBehavior");
                PreCombatProp  = Product.GetType().GetProperty("PreCombatBuffBehavior");
                PullBuffProp   = Product.GetType().GetProperty("PullBuffBehavior");
                CombatBuffProp = Product.GetType().GetProperty("CombatBuffBehavior");
                RestProp       = Product.GetType().GetProperty("RestBehavior");
                PulseFunc      = Product.GetType().GetMethod("Pulse");
                InitFunc       = Product.GetType().GetMethod("Initialize");
                ShutdownFunc   = Product.GetType().GetMethod("Shutdown");
                ButtonFunc     = Product.GetType().GetMethod("OnButtonPress");
                if (InitFunc == null)
                {
                    return;
                }
                InitFunc.Invoke(Product, null);
            }
        }
Example #3
0
        private static void LoadPlugin()
        {
            lock (ObjLock)
            {
                if (Plugin != null)
                {
                    return;
                }
                Plugin = Load();

                if (Plugin == null)
                {
                    return;
                }

                StartFunc  = Plugin.GetType().GetMethod("Start");
                StopFunc   = Plugin.GetType().GetMethod("Stop");
                ButtonFunc = Plugin.GetType().GetMethod("OnButtonPress");
                RootFunc   = Plugin.GetType().GetMethod("get_Root");
                InitFunc   = Plugin.GetType().GetMethod("Initialize");
                if (InitFunc != null)
                {
                    InitFunc.Invoke(Plugin, null);
                }
            }
        }
Example #4
0
        private static void LoadProduct()
        {
            lock (locker)
            {
                if (Product != null)
                {
                    return;
                }
                Product = Load();
                loaded  = true;
                if (Product == null)
                {
                    return;
                }

                StartFunc  = Product.GetType().GetMethod("Start");
                StopFunc   = Product.GetType().GetMethod("Stop");
                ButtonFunc = Product.GetType().GetMethod("OnButtonPress");
                RootFunc   = Product.GetType().GetMethod("GetRoot");
                InitFunc   = Product.GetType().GetMethod("OnInitialize", new[] { typeof(int) });
                if (InitFunc != null)
                {
#if RB_CN
                    Log($"{ProjectName}CN loaded.");
                    InitFunc.Invoke(Product, new[] { (object)3 });
#elif RB_64
                    Log($"{ProjectName}64 loaded.");
                    InitFunc.Invoke(Product, new[] { (object)2 });
#else
                    Log($"{ProjectName}32 loaded.");
                    InitFunc.Invoke(Product, new[] { (object)1 });
#endif
                }
            }
        }
Example #5
0
        private static void LoadPlugin()
        {
            lock (ObjLock)
            {
                if (Plugin != null)
                {
                    return;
                }
                Plugin = Load();

                if (Plugin == null)
                {
                    return;
                }

                StartFunc    = Plugin.GetType().GetMethod("OnEnabled");
                StopFunc     = Plugin.GetType().GetMethod("OnDisabled");
                ShutdownFunc = Plugin.GetType().GetMethod("OnShutdown");
                ButtonFunc   = Plugin.GetType().GetMethod("OnButtonPress");
                InitFunc     = Plugin.GetType().GetMethod("OnInitialize");
                PulseFunc    = Plugin.GetType().GetMethod("OnPulse");
                if (InitFunc != null)
                {
                    InitFunc.Invoke(Plugin, null);
                }
            }
        }
Example #6
0
        private static void LoadProduct()
        {
            lock (Locker)
            {
                if (Product != null)
                {
                    return;
                }
                Product = Load();
                _loaded = true;
                if (Product == null)
                {
                    return;
                }

                PulseFunc    = Product.GetType().GetMethod("OnPulse");
                EnabledFunc  = Product.GetType().GetMethod("OnEnabled");
                DisabledFunc = Product.GetType().GetMethod("OnDisabled");
                ShutDownFunc = Product.GetType().GetMethod("ShutDown");
                ButtonFunc   = Product.GetType().GetMethod("OnButtonPress");
                InitFunc     = Product.GetType().GetMethod("OnInitialize", new[] { typeof(int) });
                if (InitFunc != null)
                {
#if RB_CN
                    Log($"{ProjectName} CN loaded.");
                    InitFunc.Invoke(Product, new[] { (object)2 });
#else
                    Log($"{ProjectName} 64 loaded.");
                    InitFunc.Invoke(Product, new[] { (object)1 });
#endif
                }
            }
        }
Example #7
0
 public override void Initialize()
 {
     if (Plugin == null)
     {
         LoadPlugin();
     }
     if (Plugin != null)
     {
         InitFunc.Invoke(Plugin, null);
     }
 }
Example #8
0
 public override void OnInitialize()
 {
     if (!_loaded && Product == null)
     {
         LoadProduct();
     }
     if (Product != null)
     {
         InitFunc.Invoke(Product, null);
     }
 }
Example #9
0
        private static void LoadProduct()
        {
            lock (Locker)
            {
                if (Product != null)
                {
                    return;
                }
                Product = Load();
                _loaded = true;
                if (Product == null)
                {
                    return;
                }

                CombatProp     = Product.GetType().GetProperty("CombatBehavior");
                HealProp       = Product.GetType().GetProperty("HealBehavior");
                PullProp       = Product.GetType().GetProperty("PullBehavior");
                PreCombatProp  = Product.GetType().GetProperty("PreCombatBuffBehavior");
                PullBuffProp   = Product.GetType().GetProperty("PullBuffBehavior");
                CombatBuffProp = Product.GetType().GetProperty("CombatBuffBehavior");
                RestProp       = Product.GetType().GetProperty("RestBehavior");
                PulseFunc      = Product.GetType().GetMethod("Pulse");
                ShutDownFunc   = Product.GetType().GetMethod("ShutDown");
                ButtonFunc     = Product.GetType().GetMethod("OnButtonPress");
                InitFunc       = Product.GetType().GetMethod("OnInitialize", new[] { typeof(int) });
                if (InitFunc != null)
                {
#if RB_CN
                    Log($"{ProjectName} CN loaded.");
                    InitFunc.Invoke(Product, new[] { (object)2 });
#else
                    Log($"{ProjectName} 64 loaded.");
                    InitFunc.Invoke(Product, new[] { (object)1 });
#endif
                }
            }
        }