示例#1
0
 public CourContainer(Courier cour, bool isAlly, OverlayInformation main)
 {
     Cour   = cour;
     IsAlly = isAlly;
     Main   = main;
     Items  = new List <Item>();
     UpdateManager.Subscribe(UpdateItems, 500);
 }
示例#2
0
        public Updater(OverlayInformation overlayInformation)
        {
            Main        = overlayInformation;
            Heroes      = new List <HeroContainer>();
            AllyHeroes  = new List <HeroContainer>();
            EnemyHeroes = new List <HeroContainer>();

            Couriers      = new List <CourContainer>();
            AllyCouriers  = new List <CourContainer>();
            EnemyCouriers = new List <CourContainer>();

            foreach (var entity in ObjectManager.GetDormantEntities <Hero>())
            {
                OnNewHero(null, entity);
            }
            foreach (var entity in ObjectManager.GetEntities <Hero>())
            {
                OnNewHero(null, entity);
            }

            foreach (var entity in ObjectManager.GetDormantEntities <Courier>())
            {
                OnNewCour(null, entity);
            }
            foreach (var entity in ObjectManager.GetEntities <Courier>())
            {
                OnNewCour(null, entity);
            }

            EntityManager <Hero> .EntityAdded    += OnNewHero;
            EntityManager <Courier> .EntityAdded += OnNewCour;

            EntityManager <Hero> .EntityRemoved    += OnHeroRemoved;
            EntityManager <Courier> .EntityRemoved += OnCourRemoved;

            /*UpdateManager.Subscribe(() =>
             * {
             *  foreach (var container in Heroes)
             *  {
             *      var hero = container.Hero;
             *      if (hero == null)
             *      {
             *          Log.Error(new string('-', Console.BufferWidth));
             *          Log.Error($"---> ({container.Name}) is null | {container.Id}");
             *          Log.Error(new string('-', Console.BufferWidth));
             *      }
             *      else if (!hero.IsValid)
             *      {
             *          Log.Error(new string('-', Console.BufferWidth));
             *          Log.Error($"---> ({container.Name}) is not Valid | {container.Id}");
             *          Log.Error(new string('-', Console.BufferWidth));
             *      }
             *  }
             * }, 5);*/
        }
示例#3
0
        public Config(OverlayInformation overlayInformation)
        {
            Factory = MenuFactory.Create("Overlay Information");
            Factory.Target.SetFontColor(Color.YellowGreen);

            Main                = overlayInformation;
            TopPanel            = new TopPanel(this);
            HeroOverlay         = new HeroOverlay(this);
            CourEsp             = new CourEsp(this);
            ItemPanel           = new ItemPanel(this);
            NetworthPanel       = new NetworthPanel(this);
            ShrineHelper        = new ShrineHelper(this);
            TpCatcher           = new TpCatcher(this);
            LastPositionTracker = new LastPositionTracker(this);
            OpenDotaHelper      = new OpenDotaHelper(this);
            ShowMeMore          = new ShowMeMore(this);
            RoshanTimer         = new RoshanTimer(this);
            ShowIllusions       = new ShowIllusions(this);
        }
示例#4
0
        public HeroContainer(Hero hero, bool isAlly, OverlayInformation main)
        {
            Name         = hero.Name;
            Id           = hero.Player == null ? 0 : hero.Player.Id;
            HolderHelper = new Holder();
            IsAlly       = isAlly;
            Main         = main;
            IsOwner      = hero.Equals(ObjectManager.LocalHero);
            Hero         = hero;
            //Ultimate = hero.Spellbook.Spells.First(x => x.AbilityType == AbilityType.Ultimate);
            LastTimeUnderVision = Game.RawGameTime;
            Items      = new List <AbilityHolder>();
            DangItems  = new List <AbilityHolder>();
            Abilities2 = new List <AbilityHolder>();
            foreach (var ability in GetAllAbilities)
            {
                var holder = HolderHelper.GetOrCreate(ability);//new AbilityHolder(ability);
                Abilities2.Add(holder);
                if (holder.IsUltimate)
                {
                    Ultimate = holder;
                }
                Log.Info($"{ability.Name} -> {(ability.AbilityType == AbilityType.Basic ? "basic" : "ultimate")}");
            }
            HeroInventory = Hero.Inventory;

            /*_manager = new InventoryManager(new EnsageServiceContext(hero));
             * //manager.CollectionChanged += ManagerOnCollectionChanged;
             * _manager.CollectionChanged += (sender, args) =>
             * {
             *  //Items.Clear();
             *  DangItems.Clear();
             *  Items = _manager.Inventory.Items.ToList();
             *  Networth = 0;
             *  var tmpAgh = hero.HasAghanimsScepter();
             *
             *  if (!AghanimState && tmpAgh || AghanimState && !tmpAgh)
             *  {
             *      RefreshAbilities();
             *  }
             *  AghanimState = tmpAgh;
             *  foreach (var item in Items)
             *  {
             *      Networth += item.Cost;
             *      try
             *      {
             *          if (DangeItemList.Contains(item.Id))
             *              DangItems.Add(item);
             *      }
             *      catch (Exception e)
             *      {
             *          Console.WriteLine("GEGE -> "+e);
             *      }
             *  }
             * };*/
            UpdateInfo();
            UpdateItems();
            UpdateManager.Subscribe(UpdateItems, 500);
            UpdateManager.Subscribe(UpdateInfo, 250);
            UpdateManager.Subscribe(FlushChecker, 1000);

            var dividedWeStand = hero.Spellbook.SpellR as DividedWeStand;

            if (dividedWeStand != null && hero.ClassId == ClassId.CDOTA_Unit_Hero_Meepo && dividedWeStand.UnitIndex > 0)
            {
                DontDraw = true;
            }

            var classId = hero.ClassId;

            if (classId == ClassId.CDOTA_Unit_Hero_Rubick || classId == ClassId.CDOTA_Unit_Hero_DoomBringer /* ||
                                                                                                             * classId == ClassId.CDOTA_Unit_Hero_Invoker*/)
            {
                UpdateManager.Subscribe(AbilityUpdater, 750);
            }

            /*Main.Context.Value.AbilityDetector.AbilityCasted += (sender, args) =>
             * {
             *  Game.PrintMessage(args.Ability.Ability.Name);
             * };
             * Main.Context.Value.AbilityDetector.AbilityCastStarted += (sender, args) =>
             * {
             *  Game.PrintMessage(args.Ability.Ability.Name);
             * };*/
        }
示例#5
0
        public HeroContainer(Hero hero, bool isAlly, OverlayInformation main)
        {
            var itemString = hero.HeroId.ToString().Remove(0, 14);

            main.Context.Value.TextureManager.LoadFromFile(hero.HeroId.ToString(),
                                                           $@"{GamePath}\game\dota\materials\ensage_ui\miniheroes\png\{itemString}.png");

            /*Log.Warn($"Texture Name: {itemString}");
             * Log.Warn($"GamePath: {$@"{GamePath}\game\dota\materials\ensage_ui\miniheroes\png\{itemString}.png"}");*/
            //$@"resource\flash3\images\heroes\miniheroes\{hero.HeroId}.png");
            Name         = hero.Name;
            Id           = hero.Player == null ? 0 : hero.Player.Id;
            HolderHelper = new Holder();
            IsAlly       = isAlly;
            Main         = main;
            IsOwner      = hero.Equals(ObjectManager.LocalHero);
            Hero         = hero;
            //Ultimate = hero.Spellbook.Spells.First(x => x.AbilityType == AbilityType.Ultimate);
            LastTimeUnderVision = Game.RawGameTime;
            Items             = new List <AbilityHolder>();
            DangItems         = new List <AbilityHolder>();
            InvisBreakerItems = new List <AbilityHolder>();
            Abilities2        = new List <AbilityHolder>();
            foreach (var ability in GetAllAbilities)
            {
                var holder = HolderHelper.GetOrCreate(ability); //new AbilityHolder(ability);
                Abilities2.Add(holder);
                if (holder.IsUltimate)
                {
                    Ultimate = holder;
                }
                Log.Info($"{ability.Name} -> {(ability.AbilityType == AbilityType.Basic ? "basic" : "ultimate")}");
            }

            HeroInventory = Hero.Inventory;

            /*_manager = new InventoryManager(new EnsageServiceContext(hero));
             * //manager.CollectionChanged += ManagerOnCollectionChanged;
             * _manager.CollectionChanged += (sender, args) =>
             * {
             *  //Items.Clear();
             *  DangItems.Clear();
             *  Items = _manager.Inventory.Items.ToList();
             *  Networth = 0;
             *  var tmpAgh = hero.HasAghanimsScepter();
             *
             *  if (!AghanimState && tmpAgh || AghanimState && !tmpAgh)
             *  {
             *      RefreshAbilities();
             *  }
             *  AghanimState = tmpAgh;
             *  foreach (var item in Items)
             *  {
             *      Networth += item.Cost;
             *      try
             *      {
             *          if (DangeItemList.Contains(item.Id))
             *              DangItems.Add(item);
             *      }
             *      catch (Exception e)
             *      {
             *          Console.WriteLine("GEGE -> "+e);
             *      }
             *  }
             * };*/
            UpdateInfo();
            UpdateItems();
            UpdateManager.Subscribe(UpdateItems, 500);
            UpdateManager.Subscribe(UpdateInfo, 250);
            UpdateManager.Subscribe(FlushChecker, 1000);

            var dividedWeStand = hero.Spellbook.SpellR as DividedWeStand;

            if (dividedWeStand != null && hero.HeroId == HeroId.npc_dota_hero_meepo && dividedWeStand.UnitIndex > 0)
            {
                DontDraw = true;
            }

            HeroId = hero.HeroId;
            if (HeroId == HeroId.npc_dota_hero_rubick || HeroId == HeroId.npc_dota_hero_doom_bringer /* ||
                                                                                                      * classId == ClassId.CDOTA_Unit_Hero_Invoker*/|| HeroId == HeroId.npc_dota_hero_morphling)
            {
                UpdateManager.Subscribe(AbilityUpdater, 750);
            }

            /*Main.Context.Value.AbilityDetector.AbilityCasted += (sender, args) =>
             * {
             *  Game.PrintMessage(args.Ability.Ability.Name);
             * };
             * Main.Context.Value.AbilityDetector.AbilityCastStarted += (sender, args) =>
             * {
             *  Game.PrintMessage(args.Ability.Ability.Name);
             * };*/
        }