コード例 #1
0
        public void InitializeComponent()
        {
            // Initialize texture references
            MasterMind.TextureLoader.Load(Resources.CooldownTracker, out _overlayRef);

            // Initialize menu
            Menu = MasterMind.Menu.AddSubMenu("Cooldown Tracker", longTitle: "Spell Cooldown Tracker");

            Menu.AddGroupLabel("Information");
            Menu.AddLabel("A spell cooldown tracker helps you in various ways ingame.");
            Menu.AddLabel("It lets you visually see the remaining time the spells are on cooldown.");
            Menu.AddLabel(string.Format("You can enable cooldown tracking for both, {0} and {1}.",
                MasterMind.IsSpectatorMode ? "blue" : "allies", MasterMind.IsSpectatorMode ? "red team" : "enemies"));
            Menu.AddSeparator();

            TrackAllies = Menu.Add("allies", new CheckBox(string.Format("Track {0}", MasterMind.IsSpectatorMode ? "blue team" : "allies")));
            TrackEnemies = Menu.Add("enemies", new CheckBox(string.Format("Track {0}", MasterMind.IsSpectatorMode ? "red team" : "enemies")));
            DrawText = Menu.Add("cooldownText", new CheckBox("Draw cooldown time below spell indicator"));

            // Initialize properties
            OverlaySprite = new EloBuddy.SDK.Rendering.Sprite(() => OverlayTextre);
            SpellCooldownText = new Text(string.Empty, new System.Drawing.Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular))
            {
                Color = Color.GhostWhite
            };

            AlliedTeam = GameObjectTeam.Order;
            if (!MasterMind.IsSpectatorMode)
            {
                AlliedTeam = Player.Instance.Team;
            }

            // Listen to required events
            Drawing.OnEndScene += OnDraw;
        }
コード例 #2
0
ファイル: Gui.cs プロジェクト: sexsimiko33/Elobuddy
        public Gui(Menu mainMenu)
        {
            if (!Program.EnableGui.CurrentValue)
            {
                return;
            }

            var menu = mainMenu.AddSubMenu("Gui");

            menu.AddGroupLabel("++ 2D Options");
            menu.AddSeparator();
            Show2DHud = menu.Add("Show2DHud", new CheckBox("Draw 2D HUD"));
            HudX      = menu.Add("HudX", new Slider("X Offset", Drawing.Width - 310, 0, Drawing.Width));
            HudY      = menu.Add("HudY", new Slider("Y Offset", Drawing.Height / 2 + 100, 0, Drawing.Height));

            menu.AddGroupLabel("++ 3D Options");
            menu.AddSeparator();
            Show3DHud     = menu.Add("Show3DHud", new CheckBox("Draw 3D HUD"));
            ShowSelf3D    = menu.Add("ShowSelf3D", new CheckBox("Draw My UI"));
            ShowTeam3D    = menu.Add("ShowTeam3D", new CheckBox("Draw Team UI"));
            ShowEnemies3D = menu.Add("ShowEnemies3D", new CheckBox("Draw Enemy UI"));

            new RecallTracker().Initialize(menu);

            Flash        = ImageDownloader.CreateSummonerSprite("Flash");
            Heal         = ImageDownloader.CreateSummonerSprite("Heal");
            Exhaust      = ImageDownloader.CreateSummonerSprite("Exhaust");
            Teleport     = ImageDownloader.CreateSummonerSprite("Teleport");
            Ignite       = ImageDownloader.CreateSummonerSprite("Ignite");
            Barrier      = ImageDownloader.CreateSummonerSprite("Barrier");
            Clairvoyance = ImageDownloader.CreateSummonerSprite("Clairvoyance");
            Cleanse      = ImageDownloader.CreateSummonerSprite("Cleanse");
            Ghost        = ImageDownloader.CreateSummonerSprite("Ghost");
            Smite        = ImageDownloader.CreateSummonerSprite("Smite");
            Ultimate     = ImageDownloader.CreateSummonerSprite("r");

            FlashSquare        = ImageDownloader.GetSprite("Flash");
            HealSquare         = ImageDownloader.GetSprite("Heal");
            ExhaustSquare      = ImageDownloader.GetSprite("Exhaust");
            TeleportSquare     = ImageDownloader.GetSprite("Teleport");
            IgniteSquare       = ImageDownloader.GetSprite("Ignite");
            BarrierSquare      = ImageDownloader.GetSprite("Barrier");
            ClairvoyanceSquare = ImageDownloader.GetSprite("Clairvoyance");
            CleanseSquare      = ImageDownloader.GetSprite("Cleanse");
            GhostSquare        = ImageDownloader.GetSprite("Ghost");
            SmiteSquare        = ImageDownloader.GetSprite("Smite");

            FlashSquare.Scale        = new Vector2(0.4f, 0.4f);
            HealSquare.Scale         = new Vector2(0.4f, 0.4f);
            ExhaustSquare.Scale      = new Vector2(0.4f, 0.4f);
            TeleportSquare.Scale     = new Vector2(0.4f, 0.4f);
            IgniteSquare.Scale       = new Vector2(0.4f, 0.4f);
            BarrierSquare.Scale      = new Vector2(0.4f, 0.4f);
            ClairvoyanceSquare.Scale = new Vector2(0.4f, 0.4f);
            CleanseSquare.Scale      = new Vector2(0.4f, 0.4f);
            GhostSquare.Scale        = new Vector2(0.4f, 0.4f);
            SmiteSquare.Scale        = new Vector2(0.4f, 0.4f);

            HudCd = new Text(string.Empty, new Font("Tahoma", 7f, FontStyle.Regular));
        }
コード例 #3
0
ファイル: Tracker.cs プロジェクト: alathuan2/Elobuddy
 public override void Initialize()
 {
     if (!Value.Use("tracker.enable"))
     {
         Logger.Warn("Tracker Disabled!");
         return;
     }
     HeroSpellAvaliblitys = new Dictionary <AIHeroClient, SpellAvaliblity>(EntityManager.Heroes.AllHeroes.Count);
     HeroSpellSprites     = new Dictionary <AIHeroClient, Dictionary <SpellSlot, Sprite> >();
     TrackerHud           = new Sprite(TextureLoader.BitmapToTexture(Resources.SpellLayout2));
     IconManager.IconGenerator.Padding = 0;
     using (new TimeMeasure("Tracker Sprite Generation"))
     {
         foreach (var hero in EntityManager.Heroes.AllHeroes)
         {
             var spellAvaliblity = new SpellAvaliblity(hero);
             HeroSpellAvaliblitys[hero] = spellAvaliblity;
             var spriteDictonary = new Dictionary <SpellSlot, Sprite>();
             foreach (SpellSlot slot in SpellAvaliblity.TrackedSpellSlots)
             {
                 if (slot != SpellSlot.Summoner1 && slot != SpellSlot.Summoner2)
                 {
                     continue;
                 }
                 var spell = spellAvaliblity.GetSpell(slot);
                 spriteDictonary[slot] = IconManager.GetSpellSprite(spell, IconGenerator.IconType.Square, 8, Color.Empty, 1);
             }
             HeroSpellSprites[hero] = spriteDictonary;
         }
     }
 }
コード例 #4
0
ファイル: Tracker.cs プロジェクト: superjo1508/OKTRAIO
        public override void Initialize()
        {
            if (!Value.Use("tracker.enable"))
            {
                Logger.Warn("Tracker Disabled!");
                return;
            }
            HeroSpellAvaliblitys = new Dictionary<AIHeroClient, SpellAvaliblity>(EntityManager.Heroes.AllHeroes.Count);
            HeroSpellSprites = new Dictionary<AIHeroClient, Dictionary<SpellSlot, Sprite>>();
            TrackerHud = new Sprite(TextureLoader.BitmapToTexture(Resources.SpellLayout2));
            IconManager.IconGenerator.Padding = 0;
            using (new TimeMeasure("Tracker Sprite Generation"))
            {
                foreach (var hero in EntityManager.Heroes.AllHeroes)
                {
                    var spellAvaliblity = new SpellAvaliblity(hero);
                    HeroSpellAvaliblitys[hero] = spellAvaliblity;
                    var spriteDictonary = new Dictionary<SpellSlot, Sprite>();
                    foreach (SpellSlot slot in SpellAvaliblity.TrackedSpellSlots)
                    {

                        if (slot != SpellSlot.Summoner1 && slot != SpellSlot.Summoner2) continue;
                        var spell = spellAvaliblity.GetSpell(slot);
                        spriteDictonary[slot] = IconManager.GetSpellSprite(spell, IconGenerator.IconType.Square, 8, Color.Empty, 1);
                    }
                    HeroSpellSprites[hero] = spriteDictonary;
                }
            }
        }
コード例 #5
0
ファイル: WardTracker.cs プロジェクト: tekintr/Elobuddy
            public Ward(AIHeroClient caster, Obj_AI_Base handle, Vector3 position, IWard wardInfo, int duration, GameObjectTeam team)
            {
                // Initialize properties
                Caster       = caster;
                Handle       = handle;
                FakePosition = position;
                Team         = team;
                WardInfo     = wardInfo;
                Duration     = duration * 1000;
                CreationTime = Core.GameTickCount;

                // Initialize rendering
                MinimapSprite = new Sprite(() => MinimapIconTexture);
                TextHandle    = new Text(string.Empty, new Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular));

                // Notify player about placement
                if (!MasterMind.IsSpectatorMode && Team.IsEnemy() &&
                    (Player.Instance.IsInRange(Position, NotifyRange.CurrentValue) || Player.Instance.IsInRange(position, NotifyRange.CurrentValue)))
                {
                    if (NotifyPlace.CurrentValue)
                    {
                        Notifications.Show(new SimpleNotification("A ward has been placed!",
                                                                  string.Format("{0} has placed a {1}", caster != null ? caster.ChampionName : "Unknown", WardInfo.FriendlyName)));
                    }
                    if (NotifyPlacePing.CurrentValue)
                    {
                        TacticalMap.ShowPing(PingCategory.Normal, Position, true);
                    }
                }
            }
コード例 #6
0
ファイル: Tracker.cs プロジェクト: bruno105/OKTRAIO
        public override void Initialize()
        {
            if (!Value.Use("tracker.enable"))
            {
                Logger.Warn("Tracker Disabled!");
                return;
            }
            HeroSpellAvaliblitys = new Dictionary<AIHeroClient, SpellAvaliblity>(EntityManager.Heroes.AllHeroes.Count);
            HeroSpellSprites = new Dictionary<AIHeroClient, SpellSprites>();
            TrackerHud = new Sprite(TextureLoader.BitmapToTexture(Resources.SpellLayout));
            using (new TimeMeasure("Tracker Sprite Generation"))
            {
                foreach (var hero in EntityManager.Heroes.AllHeroes)
                {
                    var spellAvaliblity = new SpellAvaliblity(hero);
                    HeroSpellAvaliblitys[hero] = spellAvaliblity;
                    //var spellSprites = new SpellSprites();
                    //foreach (SpellSlot slot in SpellAvaliblity.TrackedSpellSlots)
                    //{
                    //    var spell = spellAvaliblity.GetSpell(slot);
                    //    spellSprites.AddSpell(slot,
                    //        IconManager.GetSpellSprite(spell, IconGenerator.IconType.Square, Value.Get("tracker.visual.size"), Color.Red, Value.Get("tracker.visual.border.width")),
                    //        IconManager.GetSpellSprite(spell, IconGenerator.IconType.Square, Value.Get("tracker.visual.size"), Color.Green, Value.Get("tracker.visual.border.width")));

                    //}
                    //HeroSpellSprites[hero] = spellSprites;
                }
            }
        }
コード例 #7
0
        public override void Initialize()
        {
            if (!Value.Use("tracker.enable"))
            {
                Logger.Warn("Tracker Disabled!");
                return;
            }
            HeroSpellAvaliblitys = new Dictionary <AIHeroClient, SpellAvaliblity>(EntityManager.Heroes.AllHeroes.Count);
            HeroSpellSprites     = new Dictionary <AIHeroClient, SpellSprites>();
            TrackerHud           = new Sprite(TextureLoader.BitmapToTexture(Resources.SpellLayout));
            using (new TimeMeasure("Tracker Sprite Generation"))
            {
                foreach (var hero in EntityManager.Heroes.AllHeroes)
                {
                    var spellAvaliblity = new SpellAvaliblity(hero);
                    HeroSpellAvaliblitys[hero] = spellAvaliblity;
                    //var spellSprites = new SpellSprites();
                    //foreach (SpellSlot slot in SpellAvaliblity.TrackedSpellSlots)
                    //{
                    //    var spell = spellAvaliblity.GetSpell(slot);
                    //    spellSprites.AddSpell(slot,
                    //        IconManager.GetSpellSprite(spell, IconGenerator.IconType.Square, Value.Get("tracker.visual.size"), Color.Red, Value.Get("tracker.visual.border.width")),
                    //        IconManager.GetSpellSprite(spell, IconGenerator.IconType.Square, Value.Get("tracker.visual.size"), Color.Green, Value.Get("tracker.visual.border.width")));

                    //}
                    //HeroSpellSprites[hero] = spellSprites;
                }
            }
        }
コード例 #8
0
ファイル: ColorPicker.cs プロジェクト: chienhao10/CHOP
 private void Init(Color color)
 {
     _offset             = new Vector2(0, 10);
     _textureLoader      = new TextureLoader();
     _colorPickerSprite  = new Sprite(_textureLoader.Load("ColorPickerSprite", ColorPickerSprite()));
     _colorOverlaySprite = new Sprite(_textureLoader.Load("ColorOverlaySprite", ContructColorOverlaySprite()));
     SelectedColor       = color;
 }
コード例 #9
0
 private void Init(Color color)
 {
     _offset             = new Vector2(0, 10);
     _textureLoader      = new TextureLoader();
     _colorPickerSprite  = new EloBuddy.SDK.Rendering.Sprite(_textureLoader.Load("ColorPickerSprite", Resources.ColorPickerSprite));
     _colorOverlaySprite = new EloBuddy.SDK.Rendering.Sprite(_textureLoader.Load("ColorOverlaySprite", ContructColorOverlaySprite()));
     SelectedColor       = color;
 }
コード例 #10
0
ファイル: MainMenu.cs プロジェクト: RiotSharp/RiotSharp
        internal static void OnThemeChanged(EventArgs args)
        {
            // Update the sprite
            Sprite = new Sprite(() => ThemeManager.CurrentTheme.Texture);

            // Update all controls
            Instance.OnThemeChange();
        }
コード例 #11
0
            public Ward(Obj_AI_Base handle, Type wardType, int duration)
            {
                // Initialize properties
                Handle       = handle;
                WardType     = wardType;
                Duration     = duration * 1000;
                CreationTime = Core.GameTickCount;

                // Initialize rendering
                MinimapSprite = new EloBuddy.SDK.Rendering.Sprite(() => MinimapIconTexture);
                TextHandle    = new Text(string.Empty, new System.Drawing.Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular));
            }
コード例 #12
0
ファイル: Champ.cs プロジェクト: qkwlqk/EloBuddy
 public Champ(AIHeroClient hero, int spriteSize = -1)
 {
     timer = new Text("30", new Font(FontFamily.GenericMonospace, 9, FontStyle.Regular)) { Color = Color.Red };
     if (spriteSize == -1)
         spriteSize = (int)(1700 * Util.MinimapMul);
     this.spriteSize = spriteSize / 2;
     this.hero = hero;
     img = Util.CreateChampTexture(hero.ChampionName, spriteSize);
     spawn = Util.GetSpawn(hero);
     position = spawn;
     side = spawn.X > 1000 ? -1 : 1;
     health = hero.MaxHealth;
     Teleport.OnTeleport += Teleport_OnTeleport;
 }
コード例 #13
0
ファイル: LoadTexture.cs プロジェクト: HentaiBae/KappAIO
        private static List <ChampionSprite> loadChampionSprite()
        {
            var result       = new List <ChampionSprite>();
            var hpTexture    = _textureLoader.Load("HP", Properties.Resources.hp);
            var hp           = new Sprite(hpTexture);
            var hpBitmap     = new Bitmap(Properties.Resources.hp);
            var mpTexture    = _textureLoader.Load("MP", Properties.Resources.mp);
            var mp           = new Sprite(mpTexture);
            var mpBitmap     = new Bitmap(Properties.Resources.mp);
            var xpTexture    = _textureLoader.Load("XP", Properties.Resources.xp);
            var xp           = new Sprite(xpTexture);
            var xpBitmap     = new Bitmap(Properties.Resources.mp);
            var emptyTexture = _textureLoader.Load("Empty", Properties.Resources.empty);
            var empty        = new Sprite(emptyTexture);
            var emptybitmap  = new Bitmap(Properties.Resources.empty);

            foreach (var hero in EntityManager.Heroes.AllHeroes.Where(h => h.ChampionName != "PracticeTool_TargetDummy"))
            {
                var heroIcon       = loadSprite(hero.GetChampionName());
                var heroIconGray   = loadSprite(hero.GetChampionName(), true);
                var CircleheroIcon = loadSprite(hero.GetChampionName(), false, true, hero.IsAlly ? Color.GreenYellow : Color.Red);
                var spells         = new List <SpellSprite>();
                foreach (var slot in wantedSlots)
                {
                    var spell       = hero.Spellbook.GetSpell(slot);
                    var sprite      = loadSprite(hero.GetChampionName(), slot, spell.GetSpellName());
                    var spriteGray  = loadSprite(hero.GetChampionName(), slot, spell.GetSpellName(), true);
                    var spellSprite = new SpellSprite(spell.GetSpellName(), spell.Slot,
                                                      new CustomSprite(sprite, _cacheTexture.FirstOrDefault(t => t.TextureName.Equals($"{spell.GetSpellName()}"))),
                                                      new CustomSprite(spriteGray, _cacheTexture.FirstOrDefault(t => t.TextureName.Equals($"{spell.GetSpellName()}gray"))));
                    spells.Add(spellSprite);
                }

                var championSprite = new ChampionSprite(hero,
                                                        new CustomSprite(heroIcon, _cacheTexture.FirstOrDefault(t => t.TextureName.Equals($"{hero.GetChampionName()}"))),
                                                        new CustomSprite(heroIconGray, _cacheTexture.FirstOrDefault(t => t.TextureName.Equals($"{hero.GetChampionName()}gray"))),
                                                        new CustomSprite(CircleheroIcon, _cacheTexture.FirstOrDefault(t => t.TextureName.Equals($"{hero.GetChampionName()}circle{(hero.IsAlly ? "green" : "red")}"))),
                                                        new CustomSprite(hp, new CachedTexture("hp", hpTexture, hpBitmap, Properties.Resources.hp)),
                                                        new CustomSprite(mp, new CachedTexture("mp", mpTexture, mpBitmap, Properties.Resources.mp)),
                                                        new CustomSprite(xp, new CachedTexture("xp", xpTexture, xpBitmap, Properties.Resources.xp)),
                                                        new CustomSprite(empty, new CachedTexture("empty", emptyTexture, emptybitmap, Properties.Resources.empty)), spells.ToArray());

                result.Add(championSprite);
            }

            return(result);
        }
コード例 #14
0
ファイル: Program.cs プロジェクト: IDI4b0l0/EloBuddy
        public static void Initialize()
        {
            Text = new Font("", new FontDescription
            {
                FaceName        = "Calibri",
                Height          = (Height / 30) * 23,
                OutputPrecision = FontPrecision.Default,
                Quality         = FontQuality.ClearType
            });

            Init.Menu["x"].Cast <Slider>().OnValueChange += OffsetOnOnValueChange;
            Init.Menu["y"].Cast <Slider>().OnValueChange += OffsetOnOnValueChange;
            UpdateOffset(Init.Menu["x"].Cast <Slider>().CurrentValue, Init.Menu["y"].Cast <Slider>().CurrentValue);

            Hud = new Sprite(Texture.FromMemory(
                                 Drawing.Direct3DDevice, (byte[])new ImageConverter().ConvertTo(Resources.baseulthud, typeof(byte[])),
                                 285,
                                 44, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0));

            Bar = new Sprite(Texture.FromMemory(
                                 Drawing.Direct3DDevice, (byte[])new ImageConverter().ConvertTo(Resources.bar, typeof(byte[])), 260,
                                 66, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0));

            Warning = new Sprite(Texture.FromMemory(
                                     Drawing.Direct3DDevice, (byte[])new ImageConverter().ConvertTo(Resources.warning, typeof(byte[])), 40,
                                     40, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0));

            Underline = new Sprite(Texture.FromMemory(
                                       Drawing.Direct3DDevice,
                                       (byte[])new ImageConverter().ConvertTo(Resources.underline_red, typeof(byte[])), 355,
                                       89, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0));
            foreach (var hero in ObjectManager.Get <AIHeroClient>())
            {
                Recalls.Add(new Recall(hero, RecallStatus.Inactive));
            }
            {
                BaseUltSpells.Add(new BaseUltSpell("Ezreal", SpellSlot.R, 1000, 2000, 160, false));
                BaseUltSpells.Add(new BaseUltSpell("Jinx", SpellSlot.R, 600, 1700, 140, true));
                BaseUltSpells.Add(new BaseUltSpell("Ashe", SpellSlot.R, 250, 1600, 130, true));
                BaseUltSpells.Add(new BaseUltSpell("Draven", SpellSlot.R, 400, 2000, 160, true));
                BaseUltSpells.Add(new BaseUltSpell("Karthus", SpellSlot.R, 3125, 0, 0, false));
                BaseUltSpells.Add(new BaseUltSpell("Ziggs", SpellSlot.Q, 250, 3100, 0, false));
                BaseUltSpells.Add(new BaseUltSpell("Lux", SpellSlot.R, 1375, 0, 0, false));
                BaseUltSpells.Add(new BaseUltSpell("Xerath", SpellSlot.R, 700, 600, 0, false));
            }
        }
コード例 #15
0
ファイル: LoadTexture.cs プロジェクト: HentaiBae/KappAIO
        private static Sprite loadSprite(string champ, bool gray = false, bool circle = false, Color criclecolor = new Color())
        {
            try
            {
                var     folder    = FileManager.ChampionFolder(champ);
                var     filePath  = $"{folder}/{champ}.png";
                var     cacheName = $"{champ}{(gray ? "gray" : circle ? "circle" : "")}{(criclecolor == Color.Red ? "red" : criclecolor == Color.GreenYellow ? "green" : "")}";
                Texture texture   = null;
                Image   image     = null;
                Bitmap  bitmap    = null;
                var     cached    = _cacheTexture.FirstOrDefault(t => t.TextureName.Equals(cacheName));

                if (cached != null)
                {
                    texture = cached.Texture;
                    bitmap  = cached.Bitmap;
                }
                else
                {
                    image = Image.FromFile(filePath);
                    var maxSize    = Drawing.Width + Drawing.Height;
                    var customSize = (int)(maxSize * 0.0225);
                    bitmap = circle ? ellipse(trapsrant(resizeImage(image, false, customSize), 75), true, criclecolor) : trapsrant(resizeImage(image), 95);

                    if (gray)
                    {
                        bitmap = trapsrant(ReColor(bitmap), 95);
                    }

                    texture = _textureLoader.Load(bitmap, out _textureName);
                    _cacheTexture.Add(new CachedTexture(cacheName, texture, bitmap, image));
                }

                var sprite = new Sprite(texture);
                sprite.Rectangle = new SharpDX.Rectangle(0, 0, bitmap.Width, bitmap.Height);
                return(sprite);
            }
            catch (Exception)
            {
                Logger.Error($"KappAIO: Failed to load {champ} Sprite");
            }

            return(null);
        }
コード例 #16
0
ファイル: LoadTexture.cs プロジェクト: HentaiBae/KappAIO
        private static Sprite loadSprite(string champ, SpellSlot slot, string name, bool gray = false)
        {
            try
            {
                var     folder    = slot.IsSummonerSpell() ? FileManager.SummonerSpellsFolder : FileManager.ChampionFolder(champ);
                var     filePath  = $"{folder}/{(slot.IsSummonerSpell() ? name : slot.ToString())}.png";
                var     cacheName = $"{name}{(gray ? "gray" : "")}";
                Texture texture   = null;
                Image   image     = null;
                Bitmap  bitmap    = null;
                var     cached    = _cacheTexture.FirstOrDefault(t => t.TextureName.Equals(cacheName));

                if (cached != null)
                {
                    texture = cached.Texture;
                    bitmap  = cached.Bitmap;
                }
                else
                {
                    image  = Image.FromFile(filePath);
                    bitmap = resizeImage(image, true);

                    if (gray)
                    {
                        bitmap = ReColor(bitmap);
                    }

                    texture = _textureLoader.Load(bitmap, out _textureName);
                    _cacheTexture.Add(new CachedTexture(cacheName, texture, bitmap, image));
                }

                var sprite = new Sprite(texture);
                sprite.Rectangle = new SharpDX.Rectangle(0, 0, bitmap.Width, bitmap.Height);

                return(sprite);
            }
            catch (Exception)
            {
                Logger.Error($"KappAIO: Failed to load {champ} {slot} ({name}) Sprite");
            }

            return(null);
        }
コード例 #17
0
ファイル: Champ.cs プロジェクト: oranggersong/EloBuddy
 public Champ(AIHeroClient hero, int spriteSize = -1)
 {
     timer = new Text("30", new Font(FontFamily.GenericMonospace, 9, FontStyle.Regular))
     {
         Color = Color.Red
     };
     if (spriteSize == -1)
     {
         spriteSize = (int)(1700 * Util.MinimapMul);
     }
     this.spriteSize      = spriteSize / 2;
     this.hero            = hero;
     img                  = Util.CreateChampTexture(hero.ChampionName, spriteSize);
     spawn                = Util.GetSpawn(hero);
     position             = spawn;
     side                 = spawn.X > 1000 ? -1 : 1;
     health               = hero.MaxHealth;
     Teleport.OnTeleport += Teleport_OnTeleport;
 }
コード例 #18
0
        public void InitializeComponent()
        {
            // Initialize texture references
            MasterMind.TextureLoader.Load(Resources.MainFrame, out _spellOverlayRef);
            MasterMind.TextureLoader.Load(Resources.SummonerSlots, out _summonerOverlayRef);
            MasterMind.TextureLoader.Load(SummonerSpells, out _summonersRef);
            SummonerAtlas = JsonConvert.DeserializeObject <SummonerAtlas>(Resources.SummonerAtlas);

            // Initialize menu
            Menu = MasterMind.Menu.AddSubMenu("Cooldown Tracker", longTitle: "Spell Cooldown Tracker");

            Menu.AddGroupLabel("Information");
            Menu.AddLabel("A spell cooldown tracker helps you in various ways ingame.");
            Menu.AddLabel("It lets you visually see the remaining time the spells are on cooldown.");
            Menu.AddLabel(string.Format("You can enable cooldown tracking for both, {0} and {1}.",
                                        MasterMind.IsSpectatorMode ? "blue" : "allies", MasterMind.IsSpectatorMode ? "red team" : "enemies"));
            Menu.AddSeparator();

            TrackAllies   = Menu.Add("allies", new CheckBox(string.Format("Track {0}", MasterMind.IsSpectatorMode ? "blue team" : "allies")));
            TrackEnemies  = Menu.Add("enemies", new CheckBox(string.Format("Track {0}", MasterMind.IsSpectatorMode ? "red team" : "enemies")));
            DrawSummoners = Menu.Add("summoners", new CheckBox("Draw summoner spells"));
            DrawText      = Menu.Add("cooldownText", new CheckBox("Draw cooldown time below spell indicator"));

            // Initialize properties
            SpellOverlaySprite    = new Sprite(() => SpellOverlayTexture);
            SummonerOverlaySprite = new Sprite(() => SummonerOverlayTexture);
            SummonersSprite       = new Sprite(() => SummonersTexture);
            CooldownText          = new Text(string.Empty, new Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular))
            {
                Color = Color.GhostWhite
            };

            AlliedTeam = GameObjectTeam.Order;
            if (!MasterMind.IsSpectatorMode)
            {
                AlliedTeam = Player.Instance.Team;
            }

            // Listen to required events
            Drawing.OnEndScene += OnDraw;
        }
コード例 #19
0
        private static void Loading_OnLoadingComplete(EventArgs args)
        {
            // Create the menu
            Menu = MainMenu.AddMenu("TrackerBuddy", "trackerBuddy");
            Menu.AddGroupLabel("Tracker Buddy");
            var mode = Menu.Add("mode", new CheckBox("Low Profile Mode"));

            mode.OnValueChange += delegate
            {
                MainBar = new Sprite(() => Mode == 1 ? TextureLoader["hud2"] : TextureLoader["hud"]);
            };
            Menu.Add("drawText", new CheckBox("Draw Text"));
            Menu.Add("drawAllies", new CheckBox("Draw Allies"));
            Menu.Add("drawEnemies", new CheckBox("Draw Enemies"));
            Menu.Add("drawExp", new CheckBox("Draw Exp"));
            Menu.AddSeparator();
            Menu.AddLabel("by fluxy");

            // Load main hud textures
            TextureLoader.Load("hud", Resources.hud);
            TextureLoader.Load("hud2", Resources.hud2);

            // Initialize main drawings
            Text = new Text("", new Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold))
            {
                Color = System.Drawing.Color.AntiqueWhite
            };
            MainBar = new Sprite(() => Mode == 1 ? TextureLoader["hud2"] : TextureLoader["hud"]);

            // Load summoner spells dynamically
            foreach (var summoner in HeroManager.AllHeroes.SelectMany(o => o.Spellbook.Spells.Where(s => Summoners.Contains(s.Slot))).Select(o => o.Name.ToLower()))
            {
                var summonerName = summoner;
                if (SummonerSpells.ContainsKey(summonerName))
                {
                    continue;
                }

                Bitmap bitmap = null;
                switch (summonerName)
                {
                case "summonerheal":
                    bitmap = Resources.summonerheal;
                    break;

                case "summonerdot":
                    bitmap = Resources.summonerdot;
                    break;

                case "summonerexhaust":
                    bitmap = Resources.summonerexhaust;
                    break;

                case "summonerflash":
                    bitmap = Resources.summonerflash;
                    break;

                case "summonerhaste":
                    bitmap = Resources.summonerhaste;
                    break;

                case "summonermana":
                    bitmap = Resources.summonermana;
                    break;

                case "itemsmiteaoe":
                    bitmap = Resources.itemsmiteaoe;
                    break;

                case "summonerbarrier":
                    bitmap = Resources.summonerbarrier;
                    break;

                case "summonerteleport":
                    bitmap = Resources.summonerteleport;
                    break;

                case "summonersmite":
                    bitmap = Resources.summonersmite;
                    break;

                case "summonerboost":
                    bitmap = Resources.summonerboost;
                    break;

                case "s5_summonersmiteduel":
                    bitmap = Resources.s5_summonersmiteduel;
                    break;

                case "summonerodingarrison":
                    bitmap = Resources.summonerodingarrison;
                    break;

                case "s5_summonersmiteplayerganker":
                    bitmap = Resources.s5_summonersmiteplayerganker;
                    break;

                case "s5_summonersmitequick":
                    bitmap = Resources.s5_summonersmitequick;
                    break;

                case "summonerclairvoyance":
                    bitmap = Resources.summonerclairvoyance;
                    break;

                case "summonersnowball":
                    bitmap = Resources.summonersnowball;
                    break;
                }

                if (bitmap == null)
                {
                    Chat.Print("TRACKER : Tracker does not have a summoner icon for '{0}' yet!", Color.Cyan, summoner);
                    Chat.Print("TRACKER : Please contact Fluxy about this error, thanks.", Color.Cyan);
                    continue;
                }

                TextureLoader.Load(summonerName, bitmap);
                SummonerSpells.Add(summonerName, new Sprite(() => TextureLoader[summonerName]));
            }

            // Listen to required events
            Drawing.OnEndScene += OnDraw;
            AppDomain.CurrentDomain.DomainUnload += OnDomainUnload;
            AppDomain.CurrentDomain.ProcessExit  += OnDomainUnload;
        }
コード例 #20
0
ファイル: LoadTexture.cs プロジェクト: spall9/Worstaddons
        public static void LoadAndStore()
        {
            try
            {
                DisposeEverything();

                TextureLoader.Load("HP", Properties.Resources.HP);
                TextureLoader.Load("MP", Properties.Resources.MP);
                TextureLoader.Load("XP", Properties.Resources.XP);
                TextureLoader.Load("Empty", Properties.Resources.Empty);
                TextureLoader.Load("Recall", Properties.Resources.Recall);
                TextureLoader.Load("Teleport", Properties.Resources.Teleport);
                var hp     = new Sprite(() => TextureLoader["HP"]);
                var mp     = new Sprite(() => TextureLoader["MP"]);
                var xp     = new Sprite(() => TextureLoader["XP"]);
                var emp    = new Sprite(() => TextureLoader["Empty"]);
                var recall = new Sprite(() => TextureLoader["Recall"]);
                var tp     = new Sprite(() => TextureLoader["Teleport"]);

                foreach (var hero in EntityManager.Heroes.AllHeroes)
                {
                    var AllTexture = new List <SharpDX.Direct3D9.Texture>();
                    AllTexture.Clear();
                    var AllImages = new List <Image>();
                    AllImages.Clear();

                    var heroicon    = ResizeImage(Image.FromFile(ChampionIconsFolder + hero.ChampionName + "\\" + hero.ChampionName + ".png"));
                    var heroTexture = TextureLoader.Load(heroicon, out TextureName);
                    AllTexture.Add(heroTexture);
                    AllImages.Add(heroicon);

                    var herodeadIcon    = ReColor(heroicon);
                    var herodeadTexture = TextureLoader.Load(herodeadIcon, out TextureName);
                    AllTexture.Add(herodeadTexture);
                    AllImages.Add(herodeadIcon);

                    foreach (var slot in spellSlots)
                    {
                        var spellicon    = ResizeImage(Image.FromFile(ChampionIconsFolder + hero.ChampionName + "\\" + slot + ".png"));
                        var SpellTexture = TextureLoader.Load(spellicon, out TextureName);
                        AllTexture.Add(SpellTexture);
                        AllImages.Add(spellicon);

                        var notreadyicon    = ReColor(spellicon);
                        var notreadytexture = TextureLoader.Load(notreadyicon, out TextureName);
                        AllTexture.Add(notreadytexture);
                        AllImages.Add(notreadyicon);
                    }

                    foreach (var sum in SummonerSpells)
                    {
                        var spell        = hero.Spellbook.GetSpell(sum);
                        var spellicon    = ResizeImage(Image.FromFile(SummonersIconsFolder + spell.Name + ".png"));
                        var SpellTexture = TextureLoader.Load(spellicon, out TextureName);
                        AllTexture.Add(SpellTexture);
                        AllImages.Add(spellicon);

                        var notreadyicon    = ReColor(spellicon);
                        var notreadytexture = TextureLoader.Load(notreadyicon, out TextureName);
                        AllTexture.Add(notreadytexture);
                        AllImages.Add(notreadyicon);
                    }

                    var newtexture = new ChampionTexture(hero, AllTexture, AllImages, hp, mp, xp, emp, recall, tp);
                    if (!LoadedTexture.Contains(newtexture))
                    {
                        LoadedTexture.Add(newtexture);
                        Logger.Send(hero.Name() + " Texture Stored");
                    }
                }
                TextureManager.FinishedLoadingTexture = true;
            }
            catch (Exception ex)
            {
                Logger.Send("ERROR", ex, Logger.LogLevel.Error);
                DisposeEverything();
            }
        }
コード例 #21
0
ファイル: Program.cs プロジェクト: IDI4b0l0/EloBuddy
        public static void Initialize()
        {
            Text = new Font("",new FontDescription
            {
                FaceName = "Calibri",
                Height = (Height / 30) * 23,
                OutputPrecision = FontPrecision.Default,
                Quality = FontQuality.ClearType
            });

            Init.Menu["x"].Cast<Slider>().OnValueChange += OffsetOnOnValueChange;
            Init.Menu["y"].Cast<Slider>().OnValueChange += OffsetOnOnValueChange;
            UpdateOffset(Init.Menu["x"].Cast<Slider>().CurrentValue, Init.Menu["y"].Cast<Slider>().CurrentValue);

            Hud = new Sprite(Texture.FromMemory(
                Drawing.Direct3DDevice, (byte[])new ImageConverter().ConvertTo(Resources.baseulthud, typeof(byte[])),
                285,
                44, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0));

            Bar = new Sprite(Texture.FromMemory(
            Drawing.Direct3DDevice, (byte[])new ImageConverter().ConvertTo(Resources.bar, typeof(byte[])), 260,
            66, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0));

            Warning = new Sprite(Texture.FromMemory(
            Drawing.Direct3DDevice, (byte[])new ImageConverter().ConvertTo(Resources.warning, typeof(byte[])), 40,
            40, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0));

            Underline = new Sprite(Texture.FromMemory(
            Drawing.Direct3DDevice,
            (byte[])new ImageConverter().ConvertTo(Resources.underline_red, typeof(byte[])), 355,
                89, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0));
            foreach (var hero in ObjectManager.Get<AIHeroClient>())
            {
                Recalls.Add(new Recall(hero, RecallStatus.Inactive));
            }
            {
                BaseUltSpells.Add(new BaseUltSpell("Ezreal", SpellSlot.R, 1000, 2000, 160, false));
                BaseUltSpells.Add(new BaseUltSpell("Jinx", SpellSlot.R, 600, 1700, 140, true));
                BaseUltSpells.Add(new BaseUltSpell("Ashe", SpellSlot.R, 250, 1600, 130, true));
                BaseUltSpells.Add(new BaseUltSpell("Draven", SpellSlot.R, 400, 2000, 160, true));
                BaseUltSpells.Add(new BaseUltSpell("Karthus", SpellSlot.R, 3125, 0, 0, false));
                BaseUltSpells.Add(new BaseUltSpell("Ziggs", SpellSlot.Q, 250, 3100, 0, false));
                BaseUltSpells.Add(new BaseUltSpell("Lux", SpellSlot.R, 1375, 0, 0, false));
                BaseUltSpells.Add(new BaseUltSpell("Xerath", SpellSlot.R, 700, 600, 0, false));
            }

        }
コード例 #22
0
 public PokemonBase(Pokemons poke)
 {
     Poke   = poke;
     Photo  = GetPhoto();
     Sprite = TextureManager.LoadSprite(poke, Photo);
 }
コード例 #23
0
        private static void Loading_OnLoadingComplete(EventArgs args)
        {
            // Create the menu
            Menu = MainMenu.AddMenu("TrackerBuddy", "trackerBuddy");
            Menu.AddGroupLabel("Tracker Buddy");
            var mode = Menu.Add("mode", new CheckBox("Low Profile Mode"));
            mode.OnValueChange += delegate
            {
                MainBar = new Sprite(() => Mode == 1 ? TextureLoader["hud2"] : TextureLoader["hud"]);
            };
            Menu.Add("drawText", new CheckBox("Draw Text"));
            Menu.Add("drawAllies", new CheckBox("Draw Allies"));
            Menu.Add("drawEnemies", new CheckBox("Draw Enemies"));
            Menu.Add("drawExp", new CheckBox("Draw Exp"));
            Menu.AddSeparator();
            Menu.AddLabel("by fluxy");

            // Load main hud textures
            TextureLoader.Load("hud", Resources.hud);
            TextureLoader.Load("hud2", Resources.hud2);

            // Initialize main drawings
            Text = new Text("", new Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold)) { Color = System.Drawing.Color.AntiqueWhite };
            MainBar = new Sprite(() => Mode == 1 ? TextureLoader["hud2"] : TextureLoader["hud"]);

            // Load summoner spells dynamically
            foreach (var summoner in HeroManager.AllHeroes.SelectMany(o => o.Spellbook.Spells.Where(s => Summoners.Contains(s.Slot))).Select(o => o.Name.ToLower()))
            {

                var summonerName = summoner;
                if (SummonerSpells.ContainsKey(summonerName))
                {
                    continue;
                }

                Bitmap bitmap = null;
                switch (summonerName)
                {
                    case "summonerheal":
                        bitmap = Resources.summonerheal;
                        break;
                    case "summonerdot":
                        bitmap = Resources.summonerdot;
                        break;
                    case "summonerexhaust":
                        bitmap = Resources.summonerexhaust;
                        break;
                    case "summonerflash":
                        bitmap = Resources.summonerflash;
                        break;
                    case "summonerhaste":
                        bitmap = Resources.summonerhaste;
                        break;
                    case "summonermana":
                        bitmap = Resources.summonermana;
                        break;
                    case "itemsmiteaoe":
                        bitmap = Resources.itemsmiteaoe;
                        break;
                    case "summonerbarrier":
                        bitmap = Resources.summonerbarrier;
                        break;
                    case "summonerteleport":
                        bitmap = Resources.summonerteleport;
                        break;
                    case "summonersmite":
                        bitmap = Resources.summonersmite;
                        break;
                    case "summonerboost":
                        bitmap = Resources.summonerboost;
                        break;
                    case "s5_summonersmiteduel":
                        bitmap = Resources.s5_summonersmiteduel;
                        break;
                    case "summonerodingarrison":
                        bitmap = Resources.summonerodingarrison;
                        break;
                    case "s5_summonersmiteplayerganker":
                        bitmap = Resources.s5_summonersmiteplayerganker;
                        break;
                    case "s5_summonersmitequick":
                        bitmap = Resources.s5_summonersmitequick;
                        break;
                    case "summonerclairvoyance":
                        bitmap = Resources.summonerclairvoyance;
                        break;
                    case "summonersnowball":
                        bitmap = Resources.summonersnowball;
                        break;
                }

                if (bitmap == null)
                {
                    Chat.Print("TRACKER : Tracker does not have a summoner icon for '{0}' yet!", Color.Cyan, summoner);
                    Chat.Print("TRACKER : Please contact Fluxy about this error, thanks.", Color.Cyan);
                    continue;
                }

                TextureLoader.Load(summonerName, bitmap);
                SummonerSpells.Add(summonerName, new Sprite(() => TextureLoader[summonerName]));
            }

            // Listen to required events
            Drawing.OnEndScene += OnDraw;
            AppDomain.CurrentDomain.DomainUnload += OnDomainUnload;
            AppDomain.CurrentDomain.ProcessExit += OnDomainUnload;
        }
コード例 #24
0
ファイル: Notifications.cs プロジェクト: RiotSharp/RiotSharp
            internal ActiveNotification(INotification handle, int duration)
            {
                // Initialize properties
                Handle       = handle;
                Duration     = duration;
                OffsetX      = -200;
                ContentScale = 1;

                // Initialize rendering

                #region Text

                HeaderText = new Text(Handle.HeaderText, new FontDescription
                {
                    FaceName = Handle.FontName,
                    Height   = TextHeight,
                    Quality  = FontQuality.Antialiased,
                    Weight   = FontWeight.Medium
                })
                {
                    Color     = Handle.HeaderColor,
                    DrawFlags = FontDrawFlags.WordBreak | FontDrawFlags.Right
                };
                ContentText = new Text(Handle.ContentText, new FontDescription
                {
                    FaceName = Handle.FontName,
                    Height   = TextHeight,
                    Quality  = FontQuality.Antialiased,
                    Weight   = FontWeight.Medium
                })
                {
                    Color     = Handle.ContentColor,
                    DrawFlags = FontDrawFlags.WordBreak | FontDrawFlags.Right
                };

                #endregion

                #region Sprite

                if (Handle.Texture.Header != null)
                {
                    Header = new Sprite(Handle.Texture.Header.Texture);
                }
                if (Handle.Texture.Content != null)
                {
                    Content = new Sprite(Handle.Texture.Content.Texture);
                }
                if (Handle.Texture.Footer != null)
                {
                    Footer = new Sprite(Handle.Texture.Footer.Texture);
                }

                #endregion

                Task.Run(() =>
                {
                    // Get max width
                    var maxX = 0;
                    var maxY = 0;
                    foreach (var texture in new[] { Handle.Texture.Header, Handle.Texture.Content, Handle.Texture.Footer }.Where(texture => texture != null))
                    {
                        int width;
                        int height;
                        if (texture.SourceRectangle.HasValue)
                        {
                            width  = texture.SourceRectangle.Value.Width;
                            height = texture.SourceRectangle.Value.Height;
                        }
                        else
                        {
                            var desc = texture.Texture().GetLevelDescription(0);
                            width    = desc.Width;
                            height   = desc.Height;
                        }

                        if (maxX < width)
                        {
                            maxX = width;
                        }
                        if (maxY < height)
                        {
                            maxY = height;
                        }
                    }

                    // Set width and height
                    Width  = maxX;
                    Height = maxY;

                    // Calculate text height
                    var boundingRect = HeaderText.MeasureBounding(Handle.HeaderText, new Rectangle(0, 0, Width - (int)TextOuterPadding.X * 2, MaxNotificationHeight - (int)TextOuterPadding.Y * 2),
                                                                  HeaderText.DrawFlags);
                    HeaderText.Size = new Vector2(boundingRect.Width, boundingRect.Height);

                    boundingRect = ContentText.MeasureBounding(Handle.ContentText,
                                                               new Rectangle(0, 0, Width - (int)TextOuterPadding.X * 2, MaxNotificationHeight - (int)TextOuterPadding.Y * 2 - boundingRect.Height - HeaderToContentSpace),
                                                               ContentText.DrawFlags);
                    ContentText.Size = new Vector2(boundingRect.Width, boundingRect.Height);

                    var notificationHeight = TextOuterPadding.Y * 2 + HeaderText.Size.Y + ContentText.Size.Y + HeaderToContentSpace;
                    if (notificationHeight > maxY)
                    {
                        // Override height
                        Height = (int)Math.Ceiling(notificationHeight);

                        if (Handle.Texture.Content != null)
                        {
                            var relativeHeight = Height;

                            if (Handle.Texture.Header != null)
                            {
                                if (Handle.Texture.Header.SourceRectangle.HasValue)
                                {
                                    relativeHeight -= Handle.Texture.Header.SourceRectangle.Value.Height;
                                }
                                else
                                {
                                    relativeHeight -= Handle.Texture.Header.Texture().GetLevelDescription(0).Height;
                                }
                            }
                            if (Handle.Texture.Footer != null)
                            {
                                if (Handle.Texture.Footer.SourceRectangle.HasValue)
                                {
                                    relativeHeight -= Handle.Texture.Footer.SourceRectangle.Value.Height;
                                }
                                else
                                {
                                    relativeHeight -= Handle.Texture.Footer.Texture().GetLevelDescription(0).Height;
                                }
                            }

                            var contentHeight = Handle.Texture.Content.SourceRectangle.HasValue
                                ? Handle.Texture.Content.SourceRectangle.Value.Height
                                : Handle.Texture.Content.Texture().GetLevelDescription(0).Height;

                            // Set content scaling
                            ContentScale = (float)relativeHeight / contentHeight;
                        }
                    }

                    lock (ActiveNotifications)
                    {
                        // Set notification index
                        Index = (ActiveNotifications.Where(o => !o.IsFadingOut).Max(o => (int?)o.Index) ?? 0) + 1;

                        // Set notification position
                        PositionY = GetIndexY(Index);
                    }

                    // Set the start tick
                    StartTick = Core.GameTickCount;

                    _initialized = true;
                });
            }
コード例 #25
0
ファイル: WardTracker.cs プロジェクト: giaanthunder/EloBuddy
            public Ward(AIHeroClient caster, Obj_AI_Base handle, Vector3 position, IWard wardInfo, int duration, GameObjectTeam team)
            {
                // Initialize properties
                Caster = caster;
                Handle = handle;
                FakePosition = position;
                Team = team;
                WardInfo = wardInfo;
                Duration = duration * 1000;
                CreationTime = Core.GameTickCount;

                // Initialize rendering
                MinimapSprite = new Sprite(() => MinimapIconTexture);
                TextHandle = new Text(string.Empty, new Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular));

                // Notify player about placement
                if (!MasterMind.IsSpectatorMode && Team.IsEnemy() &&
                    (Player.Instance.IsInRange(Position, NotifyRange.CurrentValue) || Player.Instance.IsInRange(position, NotifyRange.CurrentValue)))
                {
                    if (NotifyPlace.CurrentValue)
                    {
                        Notifications.Show(new SimpleNotification("A ward has been placed!",
                            string.Format("{0} has placed a {1}", caster != null ? caster.ChampionName : "Unknown", WardInfo.FriendlyName)));
                    }
                    if (NotifyPlacePing.CurrentValue)
                    {
                        TacticalMap.ShowPing(PingCategory.Normal, Position, true);
                    }
                }
            }
コード例 #26
0
ファイル: Tracker.cs プロジェクト: bruno105/OKTRAIO
 public void AddSpell(SpellSlot slot, Sprite onCooldown, Sprite available)
 {
     CooldownSprites[slot] = onCooldown;
     AvailableSprites[slot] = available;
 }
コード例 #27
0
ファイル: Gui.cs プロジェクト: sexsimiko33/Elobuddy
        public void onDraw(EventArgs args)
        {
            var hudSpace = 0;

            foreach (var hero in InfoLoader.ChampionInfoList.Where(x => !x.Hero.IsDead))
            {
                if (Show2DHud.CurrentValue && hero.Hero.IsEnemy)
                {
                    Sprite sprite8 = hero.HudSprite;
                    if (!hero.Hero.IsHPBarRendered)
                    {
                        sprite8.Color = Color.DimGray;
                    }
                    else
                    {
                        sprite8.Color = Color.White;
                    }
                    Vector2 vector45 = new Vector2(HudX.CurrentValue + hudSpace, HudY.CurrentValue);
                    sprite8.Scale = new Vector2(0.33f, 0.33f);
                    sprite8.Draw(vector45 + new Vector2(-10, 14.5f));
                    Vector2 vector46 = new Vector2(vector45.X - 9f, vector45.Y + 64f);
                    Vector2 vector47 = new Vector2(vector45.X - 8f + 33f + 3f, vector45.Y + 64f);
                    EloBuddy.SDK.Rendering.Line.DrawLine(Color.DarkGoldenrod, 18f, vector46, vector47);

                    Vector2 vector48 = new Vector2(vector45.X - 8f, vector45.Y + 64f);
                    Vector2 vector49 = new Vector2(vector45.X - 8f + 33f + 2f, vector45.Y + 64f);
                    EloBuddy.SDK.Rendering.Line.DrawLine(Color.Black, 16f, vector48, vector49);

                    Color color2 = Color.LimeGreen;
                    if (hero.Hero.HealthPercent < 30f)
                    {
                        color2 = Color.OrangeRed;
                    }
                    else if (hero.Hero.HealthPercent < 50f)
                    {
                        color2 = Color.DarkOrange;
                    }
                    Vector2 vector50 = new Vector2(vector45.X - 7f, vector45.Y + 60f);
                    Vector2 vector51 = new Vector2(vector45.X - 7f + 33f * hero.Hero.HealthPercent * 0.01f, vector45.Y + 60f);
                    EloBuddy.SDK.Rendering.Line.DrawLine(color2, 7f, vector50, vector51);

                    Vector2 vector52 = new Vector2(vector45.X - 7f, vector45.Y + 68f);
                    Vector2 vector53 = new Vector2(vector45.X - 7f + 33f * hero.Hero.ManaPercent * 0.01f, vector45.Y + 68f);
                    EloBuddy.SDK.Rendering.Line.DrawLine(Color.DodgerBlue, 5f, vector52, vector53);

                    var spell4         = hero.Hero.Spellbook.Spells[3];
                    var spellDataInst  = hero.Hero.Spellbook.Spells[4];
                    var spellDataInst2 = hero.Hero.Spellbook.Spells[5];

                    if (spell4 != null)
                    {
                        float   num49    = spell4.CooldownExpires - Game.Time;
                        Vector2 vector54 = new Vector2(vector45.X - 2f, vector45.Y - 30f);
                        Vector2 vector55 = new Vector2(vector45.X + 9f, vector45.Y - 20f);
                        Sprite  sprite9  = GetSummonerIcon("r");
                        sprite9.Scale = new Vector2(0.35f, 0.35f);
                        if (hero.Hero.Level < 6)
                        {
                            sprite9.Color = Color.DimGray;
                            sprite9.Draw(vector54);
                        }
                        else if (num49 < 0f)
                        {
                            sprite9.Color = Color.White;
                            sprite9.Draw(vector54);
                        }
                        else
                        {
                            sprite9.Color = Color.DimGray;
                            sprite9.Draw(vector54);
                            DrawFontTextScreen(HudCd, MakeNiceNumber(num49), Color.White, vector55);
                        }
                    }

                    if (spellDataInst != null)
                    {
                        float   num50    = spellDataInst.CooldownExpires - Game.Time;
                        Vector2 vector56 = new Vector2(vector45.X - 13f, vector45.Y - 10f);
                        Vector2 vector57 = new Vector2(vector45.X - 1f, vector45.Y + 2f);
                        Sprite  sprite10 = GetSummonerIcon(spellDataInst.Name);
                        sprite10.Scale = new Vector2(0.35f, 0.35f);
                        if (num50 < 0f)
                        {
                            sprite10.Color = Color.White;
                            sprite10.Draw(vector56);
                        }
                        else
                        {
                            sprite10.Color = Color.DimGray;
                            sprite10.Draw(vector56);
                            DrawFontTextScreen(HudCd, MakeNiceNumber(num50), Color.White, vector57);
                        }
                    }

                    if (spellDataInst2 != null)
                    {
                        float   num51    = spellDataInst2.CooldownExpires - Game.Time;
                        Vector2 vector58 = new Vector2(vector45.X + 9f, vector45.Y - 10f);
                        Vector2 vector59 = new Vector2(vector45.X + 22f, vector45.Y + 2f);
                        Sprite  sprite11 = GetSummonerIcon(spellDataInst2.Name);
                        sprite11.Scale = new Vector2(0.35f, 0.35f);
                        if (num51 < 0f)
                        {
                            sprite11.Color = Color.White;
                            sprite11.Draw(vector58);
                        }
                        else
                        {
                            sprite11.Color = Color.DimGray;
                            sprite11.Draw(vector58);
                            DrawFontTextScreen(HudCd, MakeNiceNumber(num51), Color.White, vector59);
                        }
                    }
                    hudSpace += 45;
                }
                if (Show3DHud.CurrentValue)
                {
                    var vector6        = hero.Hero.HPBarPosition + new Vector2(-8f, -11f);
                    var spell          = hero.Hero.Spellbook.GetSpell(SpellSlot.Q);
                    var spell2         = hero.Hero.Spellbook.GetSpell(SpellSlot.W);
                    var spell3         = hero.Hero.Spellbook.GetSpell(SpellSlot.E);
                    var spell4         = hero.Hero.Spellbook.GetSpell(SpellSlot.R);
                    var spellDataInst  = hero.Hero.Spellbook.Spells[4];
                    var spellDataInst2 = hero.Hero.Spellbook.Spells[5];

                    if (hero.Hero.IsHPBarRendered && hero.Hero.Position.IsOnScreen() && ((ShowTeam3D.CurrentValue && (hero.Hero.IsAlly && !hero.Hero.IsMe)) ||
                                                                                         (ShowEnemies3D.CurrentValue && hero.Hero.IsEnemy) ||
                                                                                         (ShowSelf3D.CurrentValue && hero.Hero.IsMe)))
                    {
                        if (hero.Hero.IsAlly)
                        {
                            vector6 += new Vector2(1f, -2f);
                        }
                        if (hero.Hero.IsMe)
                        {
                            vector6 += new Vector2(25f, 0f);
                        }
                        Line.DrawLine(Color.DimGray, 9f, vector6 + new Vector2(7f, 34f), vector6 + new Vector2(115f, 34f));
                        Line.DrawLine(Color.Black, 7f, vector6 + new Vector2(8f, 34f), vector6 + new Vector2(113f, 34f));
                        float num11 = spell.CooldownExpires - Game.Time;
                        float num12 = spell2.CooldownExpires - Game.Time;
                        float num13 = spell3.CooldownExpires - Game.Time;
                        float num14 = spell4.CooldownExpires - Game.Time;
                        float num15 = (spell4.SData.CooldownTime > 15f) ? spell4.SData.CooldownTime : 90f;
                        float num16 = Math.Max(Math.Min(num11 / spell.SData.CooldownTime, 1f), 0f);
                        float num17 = Math.Max(Math.Min(num12 / spell2.SData.CooldownTime, 1f), 0f);
                        float num18 = Math.Max(Math.Min(num13 / spell3.SData.CooldownTime, 1f), 0f);
                        float num19 = Math.Max(Math.Min(num14 / num15, 1f), 0f);
                        if (spell.Level > 0)
                        {
                            Vector2 vector7 = vector6 + new Vector2(9f, 34f);
                            Line.DrawLine(num16 > 0f ? Color.Orange : Color.YellowGreen, 5f, vector7, vector6 + new Vector2(33f - 24f * num16, 34f));
                            if (num16 > 0f)
                            {
                                DrawFontTextScreen(HudCd, MakeNiceNumber(num11 + 1f), Color.White, vector7 + new Vector2(14f, 11f));
                            }
                        }
                        if (spell2.Level > 0)
                        {
                            Vector2 vector8 = vector6 + new Vector2(35f, 34f);
                            Line.DrawLine(num17 > 0f ? Color.Orange : Color.YellowGreen, 5f, vector8, vector6 + new Vector2(59f - 24f * num17, 34f));
                            if (num17 > 0f)
                            {
                                DrawFontTextScreen(HudCd, MakeNiceNumber(num12 + 1f), Color.White, vector8 + new Vector2(14f, 11f));
                            }
                        }
                        if (spell3.Level > 0)
                        {
                            Vector2 vector9 = vector6 + new Vector2(61f, 34f);
                            Line.DrawLine((num18 > 0f) ? Color.Orange : Color.YellowGreen, 5f, vector9, vector6 + new Vector2(85f - 24f * num18, 34f));
                            if (num18 > 0f)
                            {
                                DrawFontTextScreen(HudCd, MakeNiceNumber(num13 + 1f), Color.White, vector9 + new Vector2(14f, 11f));
                            }
                        }
                        if (spell4.Level > 0)
                        {
                            Vector2 vector10 = vector6 + new Vector2(87f, 34f);
                            Line.DrawLine((num19 > 0f) ? Color.Orange : Color.YellowGreen, 5f, vector10, vector6 + new Vector2(112f - 24f * num19, 34f));
                            if (num19 > 0f)
                            {
                                DrawFontTextScreen(HudCd, MakeNiceNumber(num14 + 1f), Color.White, vector10 + new Vector2(14f, 11f));
                            }
                        }
                        if (spellDataInst != null)
                        {
                            Sprite  sprite   = GetSummonerIconSquare(spellDataInst.Name);
                            Vector2 vector11 = new Vector2(-50f, 14f);
                            if (hero.Hero.IsMe)
                            {
                                vector11 = new Vector2(117f, 14f);
                            }
                            Vector2 vector12 = vector6 + vector11;
                            float   num20    = spellDataInst.CooldownExpires - Game.Time;
                            if (num20 < 0f)
                            {
                                sprite.Color = Color.White;
                                sprite.Draw(vector12);
                            }
                            else
                            {
                                sprite.Color = Color.DimGray;
                                sprite.Draw(vector12);
                                DrawFontTextScreen(HudCd, MakeNiceNumber(num20), Color.White, vector12 + new Vector2(13f, 13f));
                            }
                        }
                        if (spellDataInst2 != null)
                        {
                            Sprite  sprite2  = GetSummonerIconSquare(spellDataInst2.Name);
                            Vector2 vector13 = new Vector2(-22f, 14f);
                            if (hero.Hero.IsMe)
                            {
                                vector13 = new Vector2(145f, 14f);
                            }
                            Vector2 vector14 = vector6 + vector13;
                            float   num21    = spellDataInst2.CooldownExpires - Game.Time;
                            if (num21 < 0f)
                            {
                                sprite2.Color = Color.White;
                                sprite2.Draw(vector14);
                            }
                            else
                            {
                                sprite2.Color = Color.DimGray;
                                sprite2.Draw(vector14);
                                DrawFontTextScreen(HudCd, MakeNiceNumber(num21), Color.White, vector14 + new Vector2(13f, 13f));
                            }
                        }
                    }
                }
            }
        }
コード例 #28
0
 public void AddSpell(SpellSlot slot, Sprite onCooldown, Sprite available)
 {
     CooldownSprites[slot]  = onCooldown;
     AvailableSprites[slot] = available;
 }
コード例 #29
0
            public Ward(Obj_AI_Base handle, Type wardType, int duration)
            {
                // Initialize properties
                Handle = handle;
                WardType = wardType;
                Duration = duration * 1000;
                CreationTime = Core.GameTickCount;

                // Initialize rendering
                MinimapSprite = new EloBuddy.SDK.Rendering.Sprite(() => MinimapIconTexture);
                TextHandle = new Text(string.Empty, new System.Drawing.Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular));
            }
コード例 #30
0
ファイル: OfficialAddon.cs プロジェクト: hanifzarina/EloBuddy
        public static void Initialize()
        {
            #region LoadTextures

            HUDTexture = new Sprite(Texture.FromMemory(
                Drawing.Direct3DDevice,
                (byte[])new ImageConverter().ConvertTo(Resources.hud, typeof(byte[])), 153,
                36, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0));
            OnCd = new Sprite(Texture.FromMemory(
                Drawing.Direct3DDevice, (byte[])new ImageConverter().ConvertTo(Resources.OnCD, typeof(byte[])), 22,
                9, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0));
            IsReady = new Sprite(Texture.FromMemory(
                Drawing.Direct3DDevice, (byte[])new ImageConverter().ConvertTo(Resources.IsReady, typeof(byte[])), 22,
                9, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0));
            XpBar = new Sprite(Texture.FromMemory(
                Drawing.Direct3DDevice, (byte[])new ImageConverter().ConvertTo(Resources.xpBar, typeof(byte[])), 104,
                3, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0));
            SummonerCd = new Sprite(Texture.FromMemory(
                            Drawing.Direct3DDevice, (byte[])new ImageConverter().ConvertTo(Resources.summonercd, typeof(byte[])),
                            13, 13, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0));

            #region SummonerTextures
            foreach (var hero in ObjectManager.Get<AIHeroClient>())
            {
                foreach (var summoner in Summoners)
                {
                    var spell = hero.Spellbook.GetSpell(summoner);
                    var texture = GetSummonerSprite(spell);

                    if (spell.Slot == SpellSlot.Summoner1)
                    {

                        Summoner1.Add(hero.NetworkId, new Sprite(Texture.FromMemory(
                            Drawing.Direct3DDevice, (byte[])new ImageConverter().ConvertTo(texture, typeof(byte[])),
                            13,
                            13, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0)));
                    }
                    else
                    {
                        Summoner2.Add(hero.NetworkId, new Sprite(Texture.FromMemory(
                            Drawing.Direct3DDevice, (byte[])new ImageConverter().ConvertTo(texture, typeof(byte[])),
                            13,
                            13, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0)));
                    }
                }
            }
            #endregion
            #endregion
            #region SetText

            AbilityText = new Text("", new FontDescription
            {
                FaceName = "Calibri",
                Height = 13,
                OutputPrecision = FontPrecision.Default,
                Quality = FontQuality.ClearType
            });

            #endregion
        }
コード例 #31
0
ファイル: MainMenu.cs プロジェクト: RiotSharp/RiotSharp
        internal static void Initialize()
        {
            // Initialize properties
            SavedValues = new Dictionary <string, Dictionary <string, List <Dictionary <string, object> > > >();
            Instance    = new SimpleControlContainer(ThemeManager.SpriteType.FormComplete, false, true, false)
            {
                IsVisible = false
            };
            Sprite = new Sprite(() => ThemeManager.CurrentTheme.Texture);
            // Control containers
            Instance.Add(AddonButtonContainer = new AddonContainer());
            // Empty controls
            Instance.Add(TitleBar = new EmptyControl(ThemeManager.SpriteType.FormHeader));
            // Buttons
            Instance.Add(ExitButton = new Button(Button.ButtonType.Exit));
            // Text types
            TitleBar.TextObjects.Add(TitleText = new Text("ELOBUDDY", new FontDescription
            {
                FaceName = "Gill Sans MT Pro Medium",
                Height   = 28,
                Quality  = FontQuality.Antialiased,
                Weight   = FontWeight.ExtraBold,
                Width    = 12,
            })
            {
                TextAlign       = Text.Align.Center,
                TextOrientation = Text.Orientation.Center,
                Color           = Color.FromArgb(255, 143, 122, 72),
                Padding         = new Vector2(0, 3)
            });

            // Simple event hooks
            ExitButton.OnActiveStateChanged += delegate
            {
                if (ExitButton.IsActive)
                {
                    IsVisible           = false;
                    ExitButton.IsActive = false;
                }
            };
            TitleBar.OnLeftMouseDown += delegate { MoveOffset = Position - Game.CursorPos2D; };
            TitleBar.OnLeftMouseUp   += delegate { MoveOffset = Vector2.Zero; };

            // Don't pass anything through the menu to the game if the mouse is inside of the menu
            Messages.OnMessage += delegate(Messages.WindowMessage args)
            {
                if (IsMouseInside)
                {
                    args.Process = false;
                }
            };

            // Center menu position
            Position = (new Vector2(Drawing.Width, Drawing.Height) - Instance.Size) / 2;

            // Setup save timer
            SaveTimer          = new Timer(60000);
            SaveTimer.Elapsed += OnSaveTimerElapsed;
            SaveTimer.Start();
            OnSaveTimerElapsed(null, null);

            // Listen to events
            ThemeManager.OnThemeChanged          += OnThemeChanged;
            Sprite.OnMenuDraw                    += OnMenuDraw;
            Messages.OnMessage                   += OnWndMessage;
            AppDomain.CurrentDomain.DomainUnload += OnUnload;
            AppDomain.CurrentDomain.ProcessExit  += OnUnload;

#if DEBUG
            var debugMenu = AddMenu("Debug", "debugging");
            debugMenu.AddGroupLabel("Menu outline (skeleton)");
            debugMenu.Add("drawOutline", new CheckBox("Draw outline", false)).CurrentValue = false;
            debugMenu.AddGroupLabel("Load Bootstrap");
            debugMenu.Add("targetselector", new CheckBox("TargetSelector", false)).CurrentValue = false;
            debugMenu.Add("orbwalker", new CheckBox("Orbwalker", false)).CurrentValue           = false;
            debugMenu.Add("prediction", new CheckBox("Prediction", false)).CurrentValue         = false;
            debugMenu.Add("damagelibrary", new CheckBox("DamageLibrary", false)).CurrentValue   = false;

            debugMenu["drawOutline"].Cast <CheckBox>().OnValueChange += delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
            {
                ControlContainerBase.DrawOutline = args.NewValue;
            };

            debugMenu["targetselector"].Cast <CheckBox>().OnValueChange += delegate
            {
                TargetSelector.Initialize();
                Core.DelayAction(() => debugMenu.Remove("targetselector"), 25);
            };
            debugMenu["orbwalker"].Cast <CheckBox>().OnValueChange += delegate
            {
                Orbwalker.Initialize();
                Core.DelayAction(() => debugMenu.Remove("orbwalker"), 25);
            };
            debugMenu["prediction"].Cast <CheckBox>().OnValueChange += delegate
            {
                Prediction.Initialize();
                Core.DelayAction(() => debugMenu.Remove("prediction"), 25);
            };
            debugMenu["damagelibrary"].Cast <CheckBox>().OnValueChange += delegate
            {
                DamageLibrary.Initialize();
                Core.DelayAction(() => debugMenu.Remove("damagelibrary"), 25);
            };
#endif

            // Indicate that the menu has finished loading
            IsLoaded = true;
        }