Пример #1
0
 private static void TempestUpdater()
 {
     if (TempestManager.Tempest != null && TempestManager.Tempest.IsValid)
     {
         if (MenuManager.IsItemPanelEnable)
         {
             ItemPanel.GetItemPanel().Load();
         }
         TempestHero = new Tempest();
         TempestHero.Init();
         UpdateManager.Unsubscribe(TempestUpdater);
         AutoMidas.GetNewInstance(TempestHero);
         DelayAction.Add(200, () =>
         {
             if (MenuManager.IsAutoPushPanelEnable)
             {
                 PushLaneSelector.GetInstance().Load();
             }
         });
     }
 }
Пример #2
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);
            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);
                        }
                    }
                }
            };
        }