예제 #1
0
        public CommonForceUltimate(ZedMenu zedMenu, ZedSpells zedSpells, Orbwalking.Orbwalker orbwalker)
        {
            player = ObjectManager.Player;

            this.zedMenu = zedMenu;
            r = zedSpells.R;
            zedOrbwalker = orbwalker;

            mouseImage1 = new Render.Sprite(Resources.mouse1, new Vector2(0, 0));
            mouseImage1.Scale = new Vector2(0.50f, 0.50f);
            mouseImage1.Add();

            mouseImage2 = new Render.Sprite(Resources.mouse2, new Vector2(0, 0));
            mouseImage2.Scale = new Vector2(0.50f, 0.50f);
            mouseImage2.Add();

            denyMouseImage = new Render.Sprite(Resources.denymouse, new Vector2(0, 0));
            denyMouseImage.Scale = new Vector2(0.50f, 0.50f);
            denyMouseImage.Add();
            denyMouseImage.Visible = false;

            Text.Add();
            Text.Visible = false;

            Game.OnWndProc += CheckMouseButtons;
            Game.OnUpdate += ShowAnimation;
        }
예제 #2
0
 private static void Game_OnGameLoad(EventArgs args)
 {
     sImage = new Render.Sprite(ImageLoader.Load("kaczorek"), new Vector2(100, 100));
     sImage.Scale = new Vector2(100, 100);
     sImage.Add(0);
     Drawing.OnDraw += Drawing_OnDraw;
 }
예제 #3
0
        public static void Game_OnGameLoad()
        {
            try
            {
                foreach (var sName in
                    SummonersNames)
                {
                    SummonerTextures.Add(sName, GetSummonerTexture(sName));
                }

                CdFrame = new Render.Sprite(Resources.hud, Vector2.Zero );
                ReadyLine = new Render.Line(Vector2.Zero, Vector2.Zero, 2, Color.Black);
                Text = new Render.Text("", Vector2.Zero, 13, Color.Black);
            }
            catch (Exception e)
            {
                Console.WriteLine(@"/ff can't load the textures: " + e);
            }
            Drawing.OnPresent += Drawing_OnEndScene;
            Drawing.OnPreReset += DrawingOnOnPreReset;
            Drawing.OnPostReset += DrawingOnOnPostReset;
             //       Drawing.OnDraw += Drawing_OnEndScene;
            AppDomain.CurrentDomain.DomainUnload += CurrentDomain_DomainUnload;
            AppDomain.CurrentDomain.ProcessExit += CurrentDomain_DomainUnload;
        }
예제 #4
0
        public AnnieButtons(Annie annie)
        {
            this.annie = annie;

            ShowEasyButton = (KoreanUtils.GetParamBool(annie.MainMenu, "showeeasybutton"));

            int posX = KoreanUtils.GetParamInt(annie.MainMenu, "easybuttonpositionx");
            posX = (posX == 0) ? 50 : posX;
            int posY = KoreanUtils.GetParamInt(annie.MainMenu, "easybuttonpositiony");
            posY = (posY == 0) ? 50 : posY;
            Vector2 pos = new Vector2(posX, posY);

            StunButtonOn = new Render.Sprite(Resources.StunON, pos);
            StunButtonOn.Scale = new Vector2(0.90f, 0.90f);
            StunButtonOn.Add();

            StunButtonOff = new Render.Sprite(Resources.StunOFF, pos);
            StunButtonOff.Scale = new Vector2(0.90f, 0.90f);
            StunButtonOff.Add();

            if (ShowEasyButton)
            {
                StunButtonOn.Visible = KoreanUtils.GetParamBool(annie.MainMenu, "savestunforcombo");
                StunButtonOff.Visible = !StunButtonOn.Visible;
            }

            KoreanUtils.GetParam(annie.MainMenu, "savestunforcombo").ValueChanged += SaveStunForComboValueChanged;
            Game.OnWndProc += ButtonControl;
        }
예제 #5
0
        private static void onGameLoad(EventArgs args)
        {
            Spellbook.OnCastSpell += Spellbook_OnCastSpell;
            Obj_AI_Base.OnIssueOrder += GameObject_issueOrder;
            Game.OnWndProc += Game_OnWndProc;
            Drawing.OnDraw += OnDraw;

            Option = new Menu("StreamSharp", "Stream Sharp", true);
            Option.SubMenu("Keys").AddItem(new MenuItem("X", "LastHit").SetValue((new KeyBind("X".ToCharArray()[0], KeyBindType.Press))));
            Option.SubMenu("Keys").AddItem(new MenuItem("C", "Harras").SetValue((new KeyBind("C".ToCharArray()[0], KeyBindType.Press))));
            Option.SubMenu("Keys").AddItem(new MenuItem("V", "Clear").SetValue((new KeyBind("V".ToCharArray()[0], KeyBindType.Press))));
            Option.SubMenu("Keys").AddItem(new MenuItem("Space", "Combo").SetValue((new KeyBind(32, KeyBindType.Press))));
            Option.AddToMainMenu();

            CursorAttack = new Render.Sprite(Properties.Resources.Attack, new Vector2((Drawing.Width / 2) - 500, (Drawing.Height / 2) - 350));
            CursorAttack.Add(0);
            CursorAttack.Visible = false;
            CursorAttack.OnDraw();

            CursorMove = new Render.Sprite(Properties.Resources.normal, new Vector2((Drawing.Width / 2) - 500, (Drawing.Height / 2) - 350));
            CursorMove.Add(0);
            CursorMove.OnDraw();


        }
예제 #6
0
        public void LoadOKTW()
        {
            Config.SubMenu("About OKTW©").AddItem(new MenuItem("logo", "Intro logo OKTW").SetValue(true));

            if (Config.Item("logo").GetValue<bool>())
            {
                Intro = new Render.Sprite(LoadImg("intro"), new Vector2((Drawing.Width / 2) - 500, (Drawing.Height / 2) - 350));
                Intro.Add(0);
                Intro.OnDraw();
            }

            Utility.DelayAction.Add(7000, () => Intro.Remove());

            Config.SubMenu("Utility, Draws OKTW©").AddItem(new MenuItem("disableDraws", "DISABLE UTILITY DRAWS").SetValue(false));

            Config.SubMenu("Utility, Draws OKTW©").SubMenu("Enemy info grid").AddItem(new MenuItem("championInfo", "Game Info").SetValue(true));
            Config.SubMenu("Utility, Draws OKTW©").SubMenu("Enemy info grid").AddItem(new MenuItem("ShowKDA", "Show flash and R CD").SetValue(true));
            Config.SubMenu("Utility, Draws OKTW©").SubMenu("Enemy info grid").AddItem(new MenuItem("ShowRecall", "Show recall").SetValue(true));
            Config.SubMenu("Utility, Draws OKTW©").SubMenu("Enemy info grid").AddItem(new MenuItem("posX", "posX").SetValue(new Slider(20, 100, 0)));
            Config.SubMenu("Utility, Draws OKTW©").SubMenu("Enemy info grid").AddItem(new MenuItem("posY", "posY").SetValue(new Slider(10, 100, 0)));

            Config.SubMenu("Utility, Draws OKTW©").AddItem(new MenuItem("GankAlert", "Gank Alert").SetValue(true));
            Config.SubMenu("Utility, Draws OKTW©").AddItem(new MenuItem("HpBar", "Dmg indicators BAR OKTW© style").SetValue(true));
            Config.SubMenu("Utility, Draws OKTW©").AddItem(new MenuItem("ShowClicks", "Show enemy clicks").SetValue(true));
            Config.SubMenu("Utility, Draws OKTW©").AddItem(new MenuItem("SS", "SS notification").SetValue(true));
            Config.SubMenu("Utility, Draws OKTW©").AddItem(new MenuItem("RF", "R and Flash notification").SetValue(true));
            Config.SubMenu("Utility, Draws OKTW©").AddItem(new MenuItem("showWards", "Show hidden objects, wards").SetValue(true));
            Config.SubMenu("Utility, Draws OKTW©").AddItem(new MenuItem("minimap", "Mini-map hack").SetValue(true));

            if (Program.AIOmode != 2)
            {
                Config.SubMenu(Player.ChampionName).SubMenu("Farm").SubMenu("SPELLS FARM TOGGLE").AddItem(new MenuItem("spellFarm", "OKTW spells farm").SetValue(true)).Show();
                Config.SubMenu(Player.ChampionName).SubMenu("Farm").SubMenu("SPELLS FARM TOGGLE").AddItem(new MenuItem("spellFarmMode", "SPELLS FARM TOGGLE MODE").SetValue(new StringList(new[] { "Scroll down", "Scroll press", "Key toggle", "Disable" }, 1)));
                Config.SubMenu(Player.ChampionName).SubMenu("Farm").SubMenu("SPELLS FARM TOGGLE").AddItem(new MenuItem("spellFarmKeyToggle", "Key toggle").SetValue(new KeyBind("N".ToCharArray()[0], KeyBindType.Toggle)));
                Config.SubMenu(Player.ChampionName).SubMenu("Farm").SubMenu("SPELLS FARM TOGGLE").AddItem(new MenuItem("showNot", "Show notification").SetValue(true));
                Config.Item("spellFarm").Permashow(true);
            }

            Tahoma13B = new Font( Drawing.Direct3DDevice, new FontDescription
               { FaceName = "Tahoma", Height = 14, Weight = FontWeight.Bold, OutputPrecision = FontPrecision.Default, Quality = FontQuality.ClearType });

            Tahoma13 = new Font( Drawing.Direct3DDevice, new FontDescription
                { FaceName = "Tahoma", Height = 14, OutputPrecision = FontPrecision.Default, Quality = FontQuality.ClearType });

            TextBold = new Font(Drawing.Direct3DDevice, new FontDescription
                {FaceName = "Impact", Height = 30, Weight = FontWeight.Normal, OutputPrecision = FontPrecision.Default, Quality = FontQuality.ClearType});

            Q = new Spell(SpellSlot.Q);
            E = new Spell(SpellSlot.E);
            W = new Spell(SpellSlot.W);
            R = new Spell(SpellSlot.R);

            Game.OnUpdate += Game_OnUpdate;
            Drawing.OnDraw += OnDraw;
            Drawing.OnEndScene += Drawing_OnEndScene;
            Game.OnWndProc += Game_OnWndProc;
        }
예제 #7
0
        public static void Initialize()
        {
            AdSprite = new Render.Sprite(Properties.Resources.PopBlanc, AdPosition);
            AdSprite.Add();

            adDisplayed = LeagueSharp.Common.Utils.TickCount;

            Game.OnUpdate += Game_OnUpdate;
            Game.OnWndProc += Game_OnWndProc;
        }
예제 #8
0
		public Overlay()
		{
			if(Drawing.Width != 1920 || Drawing.Height != 1080 || Utility.Map.GetMap()._MapType != Utility.Map.MapType.SummonersRift)
				return;
			Program.Menu.AddSubMenu(new Menu("HUD", "HUD"));
			Program.Menu.SubMenu("HUD").AddItem(new MenuItem("showHud", "Show HUD").SetValue(true));

			Hud = new Render.Sprite(Properties.Resources.Overlay2, new Vector2(1, 1));
			Hud.Add();
			Drawing.OnDraw += Drawing_OnDraw;
		}
예제 #9
0
        /// <summary>
        /// Initializes the sprite reference. To be called when the assembly is loaded.
        /// </summary>
        internal static void InitalizeSprite()
        {
            sprite = new Render.Sprite(Properties.Resources.ScopeSprite, new Vector2());
            {
                sprite.Scale = new Vector2(1.0f, 1.0f);
                sprite.PositionUpdate = () => RTargetPosition;
                sprite.VisibleCondition = s => DrawCondition;
            }

            sprite.Add();
        }
예제 #10
0
        private static void Game_OnGameLoad(EventArgs args)
        {
            config = new Menu("Custom Overlay", "Custom Overlay", true);
            config.AddItem(new MenuItem("slider", "Choose Overlay").SetValue(new Slider(1, 1, 42)));

            sprite = new Render.Sprite(Properties.Resources.hud_1, new Vector2(1, 1));
            sprite.Add(0);

            Game.PrintChat("<font color='#FF00BF'>Custom Overlay Loaded By</font> <font color='#FF0000'>The</font><font color='#FFFF00'>Kush</font><font color='#40FF00'>Style</font>");

            Game.OnGameUpdate += OnGameUpdate;
        }
예제 #11
0
        public SpriteBox(Bitmap bitmap, Vector2 position)
        {
            MainSprite = new Render.Sprite(bitmap, position)
            {
                VisibleCondition = sender => Key.LeftShift.IsKeyPressed() || Key.RightShift.IsKeyPressed()
            };

            Game.OnUpdate += Game_OnGameUpdate;
            Game.OnWndProc += Game_OnWndProc;
            AppDomain.CurrentDomain.DomainUnload += CurrentDomain_DomainUnload;
            AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
        }
예제 #12
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="CPSlider" /> class.
        /// </summary>
        /// <param name="x">
        ///     The X.
        /// </param>
        /// <param name="y">
        ///     The Y.
        /// </param>
        /// <param name="height">
        ///     The Height.
        /// </param>
        /// <param name="percent">
        ///     The Percent.
        /// </param>
        public CPSlider(int x, int y, int height, float percent = 1)
        {
            this.xPos = x;
            this.yPos = y;
            this.Height = height - Resources.CPActiveSlider.Height;
            this.percent = percent;

            this.ActiveSprite = new Render.Sprite(Resources.CPActiveSlider, new Vector2(this.X, this.Y));
            this.InactiveSprite = new Render.Sprite(Resources.CPInactiveSlider, new Vector2(this.X, this.Y));

            this.ActiveSprite.Add(2);
            this.InactiveSprite.Add(2);
        }
예제 #13
0
        public Camp(int campId, string name, Vector2 position, int respawnTime)
        {
            _respawnDuration = respawnTime * 60 * 1000;
            _isMajor = IsMajorCamp(name);
            Name = name;
            Sprite = GetMapSprite(Name, position);
            RenderText = GetRenderText(position, _isMajor);
            RespawnTime = 0;

            foreach (var obj in ObjectManager.Get<Obj_AI_Minion>().Where(obj => obj.CampNumber == campId))
                CampObject = obj;

            Game.OnGameUpdate += Game_OnGameUpdate;
        }
예제 #14
0
        private static void OnGameUpdate(EventArgs args)
        {
            UpdateImage((Bitmap)Properties.Resources.ResourceManager.GetObject(string.Format("hud_{0}", config.Item("slider").GetValue<Slider>().Value)));

            CustomEvents.Game.OnGameLoad += eventArgs =>
            {
                config = new Menu("Custom Overlay", "Custom Overlay", true);
                config.AddItem(new MenuItem("slider", "Choose Overlay").SetValue(new Slider(1, 1,42)));

                sprite = new Render.Sprite(Properties.Resources.hud_1, new Vector2(1, 1));
                sprite.Add(0);
                Game.PrintChat("<font color='#FF00BF'>Custom Overlay Loaded By</font> <font color='#FF0000'>The</font><font color='#FFFF00'>Kush</font><font color='#40FF00'>Style</font>");
            };
        }
예제 #15
0
        private static void Game_Load(EventArgs args)
        {
            HUD = LoadHUD();

            Camps = Camp.GetCamps(_pos, _scale);

            foreach (var camp in Camps)
            {
                camp.Value.Draw();
                camp.Value.Kill(0);
            }

            Game.OnGameProcessPacket += Game_OnGameProcessPacket;
        }
예제 #16
0
        public ZedComboSelector(ZedMenu zedMenu)
        {
            this.zedMenu = zedMenu;

            theLineImage = new Render.Sprite(Resources.ZedTheLine, new Vector2(1F, 1F));
            theLineImage.Scale = new Vector2(0.9f, 0.9f);
            theLineImage.Add();
            theLineImage.Visible = false;

            allStarImage = new Render.Sprite(Resources.ZedStar, new Vector2(1F, 1F));
            allStarImage.Scale = new Vector2(0.9f, 0.9f);
            allStarImage.Add();
            allStarImage.Visible = false;

            Game.OnWndProc += Game_OnWndProc;
        }
예제 #17
0
        private static Render.Sprite loadleaguesharp()
        {
            _posLsharp = GetScaledVector(_posLsharp);

            var loadlsharp = new Render.Sprite(Resources.lsharpicon, _posLsharp)
            {
                Scale = _scale,
                Color = new ColorBGRA(255f, 255f, 255f, 20f)
            };
            loadlsharp.Position = GetPosition(loadlsharp.Width - 700);

            loadlsharp.Show();
            loadlsharp.Add(0);

            return loadlsharp;
        }
예제 #18
0
        public HeroTracker(Obj_AI_Hero hero, Bitmap bmp)
        {
            Hero = hero;

            RecallStatus = Packet.S2C.Teleport.Status.Unknown;
            Hero = hero;
            var image = new Render.Sprite(bmp, new Vector2(0, 0));
            image.GrayScale();
            image.Scale = new Vector2(MinimapHack.Instance().Menu.IconScale, MinimapHack.Instance().Menu.IconScale);
            image.VisibleCondition = sender => !hero.IsVisible && !hero.IsDead;
            image.PositionUpdate = delegate
            {
                Vector2 v2 = Drawing.WorldToMinimap(LastLocation);
                v2.X -= image.Width / 2f;
                v2.Y -= image.Height / 2f;
                return v2;
            };
            image.Add(0);
            LastSeen = 0;
            LastLocation = hero.ServerPosition;
            PredictedLocation = hero.ServerPosition;
            BeforeRecallLocation = hero.ServerPosition;

            Text = new Render.Text(0, 0, "", MinimapHack.Instance().Menu.SSTimerSize, Color.White)
            {
                VisibleCondition =
                    sender =>
                        !hero.IsVisible && !Hero.IsDead && MinimapHack.Instance().Menu.SSTimer && LastSeen > 20f &&
                        MinimapHack.Instance().Menu.SSTimerStart <= Game.ClockTime - LastSeen,
                PositionUpdate = delegate
                {
                    Vector2 v2 = Drawing.WorldToMinimap(LastLocation);
                    v2.Y += MinimapHack.Instance().Menu.SSTimerOffset;
                    return v2;
                },
                TextUpdate = () => Program.Format(Game.ClockTime - LastSeen),
                OutLined = true,
                Centered = true
            };
            Text.Add(0);

            Obj_AI_Base.OnTeleport += Obj_AI_Base_OnTeleport;
            Game.OnGameUpdate += Game_OnGameUpdate;
            Drawing.OnEndScene += Drawing_OnEndScene;
        }
예제 #19
0
파일: HbTracker.cs 프로젝트: Backup521/Sion
        static HbTracker()
        {
            try
            {
                foreach (var sName in SummonersNames)
                {
                    SummonerTextures.Add(sName, GetSummonerTexture(sName));
                }

                CdFrame = new Render.Sprite(Resources.hud, Vector2.Zero);
                ReadyLine = new Render.Line(Vector2.Zero, Vector2.Zero, 2, Color.Black);
                Text = new Render.Text("", Vector2.Zero, 13, Color.Black);
            }
            catch (Exception e)
            {
                Console.WriteLine(@"/ff can't load the textures: " + e);
            }

            Drawing.OnDraw += Drawing_OnEndScene;
        }
예제 #20
0
            /*private Vector2 TextPos
            {
                get
                {
                    return  Drawing.WorldToScreen(new Vector2(Pos.X,Pos.Y+25).To3D());
                }
            }

            private String GetHp
            {
                get
                {
                    var condition = (Hero != null && PennyJinx.IsMenuEnabled("SpriteDraw") && PennyJinx._r.IsReady());
                    return condition?"Killable! " + Hero.Health + " HP":"Error getting HP";
                }
            }*/
            //Constructor
            public ScopeSprite()
            {
                _texture = Texture.FromMemory(
                    Drawing.Direct3DDevice,
                    (byte[])new ImageConverter().ConvertTo(Resources.scope, typeof(byte[])), 300, 300, 0,
                    Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0);

                _sprite = new Render.Sprite(_texture, new Vector2(0, 0))
                {
                    VisibleCondition = s => Condition,
                    PositionUpdate =
                        () => Pos,
                    Scale = new Vector2(0.65f, 0.65f)
                };
                _sprite.Add(0);
                Drawing.OnEndScene += Drawing_OnEndScene;
                Drawing.OnPreReset += Drawing_OnPreReset;
                Drawing.OnPostReset += Drawing_OnPostReset;
                AppDomain.CurrentDomain.DomainUnload += CurrentDomainOnDomainUnload;
                AppDomain.CurrentDomain.ProcessExit += CurrentDomainOnDomainUnload;
            }
예제 #21
0
        public CommonForceUltimate(ICommonChampion champion)
        {
            this.champion = champion;

            MouseImage1 = new Render.Sprite(Resources.Mouse1, new Vector2(0, 0));
            MouseImage1.Scale = new Vector2(0.50f, 0.50f);
            MouseImage1.Add();

            MouseImage2 = new Render.Sprite(Resources.Mouse2, new Vector2(0, 0));
            MouseImage2.Scale = new Vector2(0.50f, 0.50f);
            MouseImage2.Add();

            DenyMouseImage = new Render.Sprite(Resources.DenyMouse, new Vector2(0, 0));
            DenyMouseImage.Scale = new Vector2(0.50f, 0.50f);
            DenyMouseImage.Add();
            DenyMouseImage.Visible = false;

            text.Add();
            text.Visible = false;

            Game.OnWndProc += CheckMouseButtons;
            Game.OnUpdate += ShowAnimation;
        }
예제 #22
0
        private static void GameOnOnGameLoad(EventArgs args)
        {
            _greenBar = new Render.Sprite(Resource1.bar_green, new Vector2(Drawing.Width / 2 - ImgWidth / 2, 100));
            _redBar = new Render.Sprite(Resource1.bar_red, new Vector2(Drawing.Width / 2 - ImgWidth / 2, 100));

            _leftText = new Render.Text(
                "2375", _redBar.X - Drawing.GetTextExtent("2375").Width, _redBar.Y, 12, Color.White);
            _middleText = new Render.Text(
                "50%", Drawing.Width / 2 - Drawing.GetTextExtent("50%").Width / 2, _redBar.Y, 12, Color.White);
            _rightText = new Render.Text(
                "2375", _redBar.X + Drawing.GetTextExtent("2375").Width, _redBar.Y, 12, Color.White);

            _redBar.Add();
            _greenBar.Add();
            _leftText.Add();
            _middleText.Add();
            _rightText.Add();

            UpdateDrawings();

            Game.OnProcessPacket += Game_OnGameProcessPacket;
            Game.PrintChat("Golderino by ChewyMoon loaded.");
        }
예제 #23
0
        private void InitSummonerImage(Bitmap bmp)
        {
            Game.OnUpdate += Drawing_OnDraw;
            
            sImage = new Render.Sprite(bmp, new Vector2(0, 0));

            //sImage.Scale = new Vector2(0.5f, 0.5f);
            sImage.VisibleCondition = sender => !(!hero.IsHPBarRendered
                    || (hero.IsAlly && !Tracker.menu.Item("TrackAllyCooldown").GetValue<bool>())
                    || (hero.IsEnemy && !Tracker.menu.Item("TrackEnemyCooldown").GetValue<bool>()));

            sImage.PositionUpdate = delegate
            {
                var summoner2OffSet = isSummoner1 ? 0 : sImage.Height;

                var startX = heroHPBarPosition.X - 9;
                var startY = heroHPBarPosition.Y + summoner2OffSet +
                    (hero.IsAlly ? Tracker.allyOffsetY : Tracker.enemyOffsetY);

                return new Vector2(startX, startY);
            };
            sImage.Add(0); 
           
        }
예제 #24
0
 private static Render.Sprite GetSpriteFromFile(string filePath)
 {
     var sprite = new Render.Sprite(filePath, Vector2.Zero);
     return sprite;
 }
예제 #25
0
        /// <summary>
        /// Creates the render objects.
        /// </summary>
        public void CreateRenderObjects()
        {
            TextObject = new Render.Text((int)Drawing.WorldToScreen(Position).X, (int)Drawing.WorldToScreen(Position).Y, "", 17, new ColorBGRA(255, 255, 255, 255))
            {
                VisibleCondition = sender => Render.OnScreen(Drawing.WorldToScreen(Position)) && WardTrackerBase.moduleMenu["dz191.dza.ward.track"].Cast<CheckBox>().CurrentValue,
                PositionUpdate = () => new Vector2(Drawing.WorldToScreen(Position).X, Drawing.WorldToScreen(Position).Y + 12),
                TextUpdate = () => (Environment.TickCount < startTick + WardTypeW.WardDuration && WardTypeW.WardDuration < float.MaxValue) ? (Utils.FormatTime(Math.Abs(Environment.TickCount - (startTick + WardTypeW.WardDuration)) / 1000f)) : string.Empty
            };
            TextObject.Add(0);

            MinimapSpriteObject = new Render.Sprite(MinimapBitmap, new Vector2())
            {
                PositionUpdate =  () => MinimapPosition,
                VisibleCondition = sender => WardTrackerBase.moduleMenu["dz191.dza.ward.track"].Cast<CheckBox>().CurrentValue && Environment.TickCount <  this.startTick + this.WardTypeW.WardDuration,
                Scale = new Vector2(0.7f, 0.7f)
            };
            MinimapSpriteObject.Add(0);
        }
예제 #26
0
        public static void InitSprites(bool bypass = false)
        {
            try
            {
                if (!MenuExtensions.GetItemValue<bool>("dz191.dza.hud.show") && !bypass)
                {
                    return;
                }

                HudSprite = new Render.Sprite(Resources.TFHelperBG, CurrentPosition)
                {
                    PositionUpdate = () => CurrentPosition,
                    VisibleCondition = delegate { return ShouldBeVisible; },
                };
                HudSprite.Crop(0, 0, (int) SpriteWidth, CroppedHeight);

                ExpandShrinkButton = new Render.Sprite(Resources.Expand, CurrentPosition)
                {
                    PositionUpdate = () => new Vector2(CurrentPosition.X + SpriteWidth - 20, CurrentPosition.Y + CroppedHeight - 20),
                    Scale = new Vector2(0.7f, 0.7f),
                    VisibleCondition = delegate { return ShouldBeVisible; }
                };

                ExpandShrinkButton.Add(1);
                HudSprite.Add(0);
            }
            catch (Exception ex)
            {
                LogHelper.AddToLog(new LogItem("Hud_Init", ex, LogSeverity.Error));
            }
        }
예제 #27
0
        private static void OnWndProc(WndEventArgs args)
        {
            if (HudSprite == null || !ShouldBeVisible)
            {
                return;
            }

            if (IsDragging)
            {
                Variables.Menu.Item("dz191.dza.hud.x")
                   .SetValue(new Slider((int)(Utils.GetCursorPos().X - XDistanceFromEdge), 0, Drawing.Direct3DDevice.Viewport.Width));
                Variables.Menu.Item("dz191.dza.hud.y")
                    .SetValue(new Slider((int)(Utils.GetCursorPos().Y - YDistanceFromEdge), 0, Drawing.Direct3DDevice.Viewport.Height));
            }

            if (IsInside(Utils.GetCursorPos()) && args.Msg == (uint)WindowsMessages.WM_LBUTTONDOWN)
            {
                if (!IsDragging)
                {
                    if (InitialDragPoint == new Vector2())
                    {
                        InitialDragPoint = CurrentPosition;
                        XDistanceFromEdge = Math.Abs(InitialDragPoint.X - Utils.GetCursorPos().X);
                        YDistanceFromEdge = Math.Abs(InitialDragPoint.Y - Utils.GetCursorPos().Y);
                    }

                    IsDragging = true;
                }
            }
            else if (IsDragging && args.Msg == (uint)WindowsMessages.WM_LBUTTONUP)
            {
                HudSprite.PositionUpdate = () => CurrentPosition;

                Variables.Menu.Item("dz191.dza.hud.x")
                    .SetValue(new Slider((int)(Utils.GetCursorPos().X - XDistanceFromEdge), 0, Drawing.Direct3DDevice.Viewport.Width));
                Variables.Menu.Item("dz191.dza.hud.y")
                    .SetValue(new Slider((int)(Utils.GetCursorPos().Y - YDistanceFromEdge), 0, Drawing.Direct3DDevice.Viewport.Height));

                InitialDragPoint = new Vector2();
                XDistanceFromEdge = 0;
                YDistanceFromEdge = 0;

                IsDragging = false;
            }

            if (args.Msg == (uint) WindowsMessages.WM_LBUTTONUP)
            {
                if (
                    Utils.GetCursorPos()
                        .Distance(new Vector2(CurrentPosition.X + SpriteWidth - 15,
                            CurrentPosition.Y + CroppedHeight - 15)) < 7)
                {
                    if (CurrentStatus == SpriteStatus.Shrinked)
                    {
                        CurrentStatus = SpriteStatus.Expanded;
                        HudSprite.Crop(0, 0, (int) SpriteWidth, (int)SpriteHeight);

                        ExpandShrinkButton.Remove();
                        ExpandShrinkButton = new Render.Sprite(Resources.Shrink, CurrentPosition)
                        {
                            PositionUpdate = () => new Vector2(CurrentPosition.X + SpriteWidth - 20, CurrentPosition.Y + CroppedHeight - 20),
                            Scale = new Vector2(0.7f, 0.7f),
                            VisibleCondition = delegate { return ShouldBeVisible; }
                        };

                        ExpandShrinkButton.Add(1);
                    }
                    else
                    {
                        CurrentStatus = SpriteStatus.Shrinked;
                        HudSprite.Crop(0, 0, (int)SpriteWidth, CroppedHeight);

                        ExpandShrinkButton.Remove();
                        ExpandShrinkButton = new Render.Sprite(Resources.Expand, CurrentPosition)
                        {
                            PositionUpdate = () => new Vector2(CurrentPosition.X + SpriteWidth - 20, CurrentPosition.Y + CroppedHeight - 20),
                            Scale = new Vector2(0.7f, 0.7f),
                            VisibleCondition = delegate { return ShouldBeVisible; }
                        };

                        ExpandShrinkButton.Add(1);
                    }

                }
            }
        }
예제 #28
0
            /// <summary>
            ///     Initializes a new instance of the <see cref="Notification" /> class.
            /// </summary>
            /// <param name="Text">
            ///     The text.
            /// </param>
            /// <param name="Bit">
            ///     The bit.
            /// </param>
            public Notification(string Text, Bitmap Bit)
            {
                this.Sprite = new Render.Sprite(Bit, new Vector2(X, Y));
                this.Text = new Render.Text(
                    Text,
                    new Vector2(X, Y),
                    12,
                    new ColorBGRA(this.PresetColor.R, this.PresetColor.G, this.PresetColor.B, this.PresetColor.A));
                this.Text.Centered = true;

                this.Text.Add();
                this.Sprite.Add();
            }
예제 #29
0
        public static void InitKillSprite(OnKillSprite sprite)
        {
            if (IsDrawing)
            {
                CurrentSprite = null;

                IsDrawing = false;
                sprite.IsDrawing = true;
                sprite.Sprite.Visible = false;
                sprite.Sprite.Remove();
            }

            IsDrawing = true;
            sprite.IsDrawing = true;
            sprite.Sprite.Visible = true;
            sprite.Sprite.Scale = new Vector2(Scale, Scale);
            sprite.Sprite.VisibleCondition = delegate
            { return sprite.IsDrawing; };
            sprite.Sprite.Position = new Vector2(X, Y);
            sprite.Sprite.PositionUpdate += () => new Vector2(X, Y);
            CurrentSprite = sprite.Sprite;
            sprite.Sprite.Add();

            Utility.DelayAction.Add(
                               WaifuSharp.Menu.Item("waifusharp.options.duration").GetValue<Slider>().Value, () =>
                               {
                                   CurrentSprite = null;

                                   IsDrawing = false;
                                   sprite.IsDrawing = true;
                                   sprite.Sprite.Visible = false;
                                   sprite.Sprite.Remove();
                               });
        }
예제 #30
0
            public LastPosition(Obj_AI_Hero hero)
            {
                Hero = hero;
                var mPos = Drawing.WorldToMinimap(hero.Position);
                var spawnPoint = ObjectManager.Get<GameObject>().FirstOrDefault(s => s is Obj_SpawnPoint && s.IsEnemy);

                _sprite =
                    new Render.Sprite(
                        (Bitmap) Resources.ResourceManager.GetObject(string.Format("LP_{0}", hero.ChampionName)) ??
                        Resources.LP_Aatrox, new Vector2(mPos.X, mPos.Y))
                    {
                        VisibleCondition = delegate
                        {
                            try
                            {
                                if (hero.IsVisible)
                                {
                                    Recalled = false;
                                }
                                return Active && !Hero.IsVisible && !Hero.IsDead;
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine(ex.ToString());
                                return false;
                            }
                        },
                        PositionUpdate = delegate
                        {
                            try
                            {
                                if (Recall && Recalled)
                                {
                                    if (!Equals(spawnPoint, default(Obj_SpawnPoint)))
                                    {
                                        var p =
                                            Drawing.WorldToMinimap(spawnPoint.Position);
                                        return new Vector2(p.X - (_sprite.Size.X/2), p.Y - (_sprite.Size.Y/2));
                                    }
                                }
                                var pos = Drawing.WorldToMinimap(hero.Position);
                                return new Vector2(pos.X - (_sprite.Size.X/2), pos.Y - (_sprite.Size.Y/2));
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine(ex.ToString());
                                return default(Vector2);
                            }
                        },
                    };
                _recallSprite =
                    new Render.Sprite(Resources.LP_Recall, new Vector2(mPos.X, mPos.Y))
                    {
                        VisibleCondition = delegate
                        {
                            try
                            {
                                return Active && !Hero.IsVisible && !Hero.IsDead && Recall && IsRecalling;
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine(ex.ToString());
                                return false;
                            }
                        },
                        PositionUpdate = delegate
                        {
                            try
                            {
                                var pos = Drawing.WorldToMinimap(hero.Position);
                                return new Vector2(pos.X - (_recallSprite.Size.X/2), pos.Y - (_recallSprite.Size.Y/2));
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine(ex.ToString());
                                return default(Vector2);
                            }
                        },
                    };
            }