Esempio n. 1
0
        public static void Init()
        {
            MainHero = new MainHero();
            MainHero.Init();
            AutoMidas.GetNewInstance(MainHero);
            GameDispatcher.OnUpdate += GameDispatcherOnOnUpdate;
            UpdateManager.Subscribe(TempestUpdater, 500);
            var manager = new InventoryManager(new EnsageServiceContext(MainHero.Hero));

            manager.CollectionChanged += (sender, args) =>
            {
                if (args.Action == NotifyCollectionChangedAction.Add)
                {
                    foreach (InventoryItem iitem in args.NewItems)
                    {
                        if (MenuManager.Items.ContainsKey(iitem.Id.ToString()))
                        {
                            MenuManager.AddNewItem(iitem.Id);
                        }
                    }
                }
                else if (args.Action == NotifyCollectionChangedAction.Remove)
                {
                    foreach (InventoryItem iitem in args.OldItems)
                    {
                        if (MenuManager.Items.ContainsKey(iitem.Id.ToString()))
                        {
                            MenuManager.RemoveOldItem(iitem.Id);
                        }
                    }
                }
            };
        }
Esempio n. 2
0
 public static void Init()
 {
     MainHero = new MainHero();
     MainHero.Init();
     AutoMidas.GetNewInstance(MainHero);
     GameDispatcher.OnUpdate += GameDispatcherOnOnUpdate;
     UpdateManager.Subscribe(TempestUpdater, 500);
 }
Esempio n. 3
0
 private static void TempestUpdater()
 {
     if (TempestManager.Tempest != null && TempestManager.Tempest.IsValid)
     {
         ItemPanel.GetItemPanel().Load();
         TempestHero = new Tempest();
         TempestHero.Init();
         UpdateManager.Unsubscribe(TempestUpdater);
         AutoMidas.GetNewInstance(TempestHero);
         DelayAction.Add(200, () =>
         {
             PushLaneSelector.GetInstance().Load();
         });
     }
 }
Esempio n. 4
0
        public static void Init()
        {
            /*Drawing.OnDraw += args =>
             * {
             *  Drawing.DrawText($"{OrderManager.Orders.AutoPushing.GetLane(Game.MousePosition)}", Drawing.WorldToScreen(Game.MousePosition)+new Vector2(50), Color.White, FontFlags.None);
             * };*/
            MainHero = new MainHero();
            MainHero.Init();
            AutoMidas.GetNewInstance(MainHero);
            UpdateManager.BeginInvoke(() => { UpdateManager.Subscribe(OnUpdate, 250); }, 100);
//            DelayAction.Add(100,() => GameDispatcher.OnUpdate += GameDispatcherOnOnUpdate);

            UpdateManager.Subscribe(TempestUpdater, 500);
            var manager = Program.GetContext.Inventory;

            foreach (var item in manager.Inventory.Items)
            {
                if (MenuManager.Items.ContainsKey(item.Id.ToString()))
                {
                    MenuManager.AddNewItem(item.Id);
                }
            }
            manager.CollectionChanged += (sender, args) =>
            {
                if (args.Action == NotifyCollectionChangedAction.Add)
                {
                    foreach (InventoryItem iitem in args.NewItems)
                    {
                        if (MenuManager.Items.ContainsKey(iitem.Id.ToString()))
                        {
                            MenuManager.AddNewItem(iitem.Id);
                        }
                    }
                }
                else if (args.Action == NotifyCollectionChangedAction.Remove)
                {
                    foreach (InventoryItem iitem in args.OldItems)
                    {
                        if (MenuManager.Items.ContainsKey(iitem.Id.ToString()))
                        {
                            MenuManager.RemoveOldItem(iitem.Id);
                        }
                    }
                }
            };
        }