Ejemplo n.º 1
0
        public void Execute(Point startClick, Point endClick)
        {
            var pt = new System.Drawing.Point((int) startClick.X, (int) startClick.Y);

            if (askForColor)
            {
                colorDlg.ShowDialog();
                fillColor = colorDlg.Color;
            }

            Animation animation = Animation.getInstance();
            if (animation.PointInCell(startClick))
            {
                //Already Exisiting Cell
                Cell c = animation.findCell(startClick);
                int frame = _viewModel.currentFrame;
                c.color[frame] = fillColor;

                //Trigers and update on the View
                _viewModel.Cells.Remove(c);
                _viewModel.Cells.Add(c);
            }
            else
            {

                var finder = new RegionFinder(_viewModel.Image, pt, _viewModel.Tolerance);
                finder.LineFound +=
                    line => _viewModel.Cells.Add(new Cell(line.Select(p => new Point(p.X, p.Y)).ToArray(), animation.numFrames(), _viewModel.currentFrame, fillColor));
                finder.Process();

                //Add to the Model
                animation.addCell(_viewModel.Cells.Last());

            }
        }
Ejemplo n.º 2
0
 public void DrawRect(float x, float y, float width, float height, float thickness, Color color)
 {
     for (var i = 0; i < height; i++)
     {
         Drawing.DrawLine(x, y + i, x + width, y + i, thickness, color);
     }
 }
Ejemplo n.º 3
0
 public static void DrawLineInWorld(Vector3 start, Vector3 end, int width, Color color)
 {
     var from = Drawing.WorldToScreen(start);
     var to = Drawing.WorldToScreen(end);
     Drawing.DrawLine(from[0], from[1], to[0], to[1], width, color);
     //Drawing.DrawLine(from.X, from.Y, to.X, to.Y, width, color);
 }
Ejemplo n.º 4
0
        public static void DrawCircleOnMinimap(
            Vector3 center,
            float radius,
            Color color,
            int thickness = 1,
            int quality = 254)
        {
            var pointList = new List<Vector3>();
            for (var i = 0; i < quality; i++)
            {
                var angle = i * Math.PI * 2 / quality;
                pointList.Add(
                    new Vector3(
                        center.X + radius * (float)Math.Cos(angle), center.Y + radius * (float)Math.Sin(angle),
                        center.Z));
            }

            for (var i = 0; i < pointList.Count; i++)
            {
                var a = pointList[i];
                var b = pointList[i == pointList.Count - 1 ? 0 : i + 1];

                var aonScreen = Drawing.WorldToMinimap(a);
                var bonScreen = Drawing.WorldToMinimap(b);

                Drawing.DrawLine(aonScreen.X, aonScreen.Y, bonScreen.X, bonScreen.Y, thickness, color);
            }
        }
Ejemplo n.º 5
0
        public static void drawLine(Vector3 pos1, Vector3 pos2, int bold, Color color)
        {
            var wts1 = Drawing.WorldToScreen(pos1);
            var wts2 = Drawing.WorldToScreen(pos2);

            Drawing.DrawLine(wts1[0], wts1[1], wts2[0], wts2[1], bold, color);
        }
Ejemplo n.º 6
0
 public SpellData(SpellSlot spellSlot, bool checkIfActive, DamageLibrary.SpellStages spellStage, Color c)
 {
     _onlyIfActive = checkIfActive;
     _spellSlot = spellSlot;
     _stage = spellStage;
     Color = c;
 }
Ejemplo n.º 7
0
        public FioraPassive(Obj_GeneralParticleEmitter emitter, AIHeroClient enemy)
            : base(emitter.Index, (uint)emitter.NetworkId, emitter as GameObject)
        {
            Target = enemy;

            if (emitter.Name.Contains("Base_R"))
            {
                Passive = PassiveType.UltPassive;
                Color = Color.White;
            }
            else if (emitter.Name.Contains("Warning"))
            {
                Passive = PassiveType.Prepassive;
                Color = Color.Blue;
            }
            else if (emitter.Name.Contains("Timeout"))
            {
                Passive = PassiveType.PassiveTimeout;
                Color = Color.Red;
            }
            else
            {
                Passive = PassiveType.Passive;
                Color = Color.Green;
            }
            PassiveDistance = Passive == PassiveType.UltPassive ? 400 : 200;
        }
Ejemplo n.º 8
0
        public MLabel
            (
                string key,
                bool light, 
                System.Drawing.Font font,
                System.Drawing.Color foreNormal,
                System.Drawing.Color backNormal,
                System.Drawing.Color foreLight,
                System.Drawing.Color backLight,
                int sizewidth, 
                int sizehegiht
            )
        {
            FontModel = font;
            ForeNormal = foreNormal;
            BackNormal = backNormal;
            ForeLight = foreLight;
            BackLight = backLight;

            Text = key;
            Font = FontModel;
            Cursor = Helper.HCursors;
            TextAlign = Helper.Align;
            ForeColor = light ? ForeLight : ForeNormal;
            BackColor = light ? BackLight : BackNormal;
            Size = new System.Drawing.Size(sizewidth, sizehegiht);

            MouseHover += MLabel_MouseHover;
            MouseLeave += MLabel_MouseLeave;
        }
Ejemplo n.º 9
0
 public static void DrawText(float x, float y, Color c, string text)
 {
     if (text != null)
     {
         Drawing.DrawText(x, y, c, text);
     }
 }
Ejemplo n.º 10
0
 void RaiseMessage(string message, Color color, int rank = 0, bool emphasis = false)
 {
     if (OnMessage != null)
     {
         OnMessage(message, color, rank, emphasis);
     }
 }
 public void BindSelectedColor(Color color)
 {
     BindColorToStyle(color);
     BindColorToVariant(color);
     if (View.IsDisplayDefaultPicture())
     {
         View.EnableUpdatingPreviewImages();
         UpdatePreviewImages(
             View.CreateDefaultPictureItem(),
             PowerPointCurrentPresentationInfo.CurrentSlide.GetNativeSlide(),
             PowerPointPresentation.Current.SlideWidth,
             PowerPointPresentation.Current.SlideHeight);
         View.DisableUpdatingPreviewImages();
         BindStyleToColorPanel();
     }
     else
     {
         UpdatePreviewImages(
             ImageSelectionListSelectedItem.ImageItem ??
             View.CreateDefaultPictureItem(),
             PowerPointCurrentPresentationInfo.CurrentSlide.GetNativeSlide(),
             PowerPointPresentation.Current.SlideWidth,
             PowerPointPresentation.Current.SlideHeight);
     }
 }
Ejemplo n.º 12
0
        public static Color ShiftColor(Color c, int shiftAmount)
        {
            int newRed = c.R;
            int newGreen = c.G;
            int newBlue = c.B;

            // Red to purple
            if (c.R == 255 && c.B < 255 && c.G == 0)
                newBlue = newBlue + shiftAmount;
            // Purple to blue
            else if (c.B == 255 && c.R > 0)
                newRed = newRed - shiftAmount;
            // Blue to light-blue
            else if (c.B == 255 && c.G < 255)
                newGreen = newGreen + shiftAmount;
            // Light-blue to green
            else if (c.G == 255 && c.B > 0)
                newBlue = newBlue - shiftAmount;
            // Green to yellow
            else if (c.G == 255 && c.R < 255)
                newRed = newRed + shiftAmount;
            // Yellow to red
            else if (c.R == 255 && c.G > 0)
                newGreen = newGreen - shiftAmount;

            newRed = BringIntInColorRange(newRed);
            newGreen = BringIntInColorRange(newGreen);
            newBlue = BringIntInColorRange(newBlue);

            return Color.FromArgb(c.A, newRed, newGreen, newBlue);
        }
Ejemplo n.º 13
0
 public CharAttribs( 
     System.Boolean       p1,
     System.Boolean       p2,
     System.Boolean       p3,
     System.Boolean       p4,
     System.Boolean       p5,
     System.Boolean       p6,
     System.Boolean       p7,
     System.Boolean       p12,
     System.Drawing.Color p13,
     System.Boolean       p14,
     System.Drawing.Color p15,
     uc_Chars             p16,
     uc_Chars             p17,
     uc_Chars             p18,
     System.Boolean       p19)
 {
     //prntSome.printSome("CharAttribs");
     IsBold          = p1;
     IsDim           = p2;
     IsUnderscored   = p3;
     IsBlinking      = p4;
     IsInverse       = p5;
     IsPrimaryFont   = p6;
     IsAlternateFont = p7;
     UseAltColor     = p12;
     AltColor        = p13;
     UseAltBGColor   = p14;
     AltBGColor      = p15;
     GL              = p16;
     GR              = p17;
     GS              = p18;
     IsDECSG         = p19;
 }
        /// <summary> Constructor for a new instance of the CustomGrid_Style class </summary>
        /// <param name="Data_Source"> DataTable for which to atuomatically build the style for </param>
        public CustomGrid_Style( DataTable Data_Source )
        {
            // Declare collection of columns
            columns = new List<CustomGrid_ColumnStyle>();
            visibleColumns = new CustomGrid_VisibleColumns( columns );

            // Set some defaults
            default_columnWidth = 100;
            headerHeight = 23;
            rowHeight = 20;
            default_textAlignment = HorizontalAlignment.Center;
            default_backColor = System.Drawing.Color.White;
            default_foreColor = System.Drawing.Color.Black;
            alternating_print_backColor = System.Drawing.Color.Honeydew;
            gridLineColor = System.Drawing.Color.Black;
            headerForeColor = System.Drawing.SystemColors.WindowText;
            headerBackColor = System.Drawing.SystemColors.Control;
            rowSelectForeColor = System.Drawing.SystemColors.WindowText;
            rowSelectBackColor = System.Drawing.SystemColors.Control;
            noMatchesTextColor = System.Drawing.Color.MediumBlue;
            selectedColor = System.Drawing.Color.Yellow;
            sortable = true;
            column_resizable = true;
            primaryKey = -1;
            double_click_delay = 1000;

            // Set this data source
            this.Data_Source = Data_Source;
        }
Ejemplo n.º 15
0
        public FioraPassive(Obj_GeneralParticleEmitter emitter, Obj_AI_Hero enemy)
            : base((ushort) emitter.Index, (uint) emitter.NetworkId)
        {
            Target = enemy;

            if (emitter.Name.Contains("Base_R"))
            {
                //PassiveManager.PassiveList.RemoveAll(
                //    p => p.Target.Equals(Target) && !p.Type.Equals(PassiveType.UltPassive));
                Passive = PassiveType.UltPassive;
                Color = Color.White;
            }
            else if (emitter.Name.Contains("Warning"))
            {
                Passive = PassiveType.Prepassive;
                Color = Color.Blue;
            }
            else if (emitter.Name.Contains("Timeout"))
            {
                PassiveManager.PassiveList.RemoveAll(p => p.Target.Equals(Target) && p.Type.Equals(PassiveType.Passive));
                Passive = PassiveType.PassiveTimeout;
                Color = Color.Red;
            }
            else
            {
                Passive = PassiveType.Passive;
                Color = Color.Green;
            }
            //Console.WriteLine("[PASSIVE] Type: {0} Target: {2} Name: {1}", Passive, Name, Target.Name);
            PassiveDistance = Passive.Equals(PassiveType.UltPassive) ? 320 : 200;
        }
		public static string ColorToRGB(Color color)
		{
			string red = color.R.ToString("X2");
			string green = color.G.ToString("X2");
			string blue = color.B.ToString("X2");
			return String.Format("{0}{1}{2}", red, green, blue);
		}
Ejemplo n.º 17
0
 void RaiseMessage(string message, Color color, bool asChild = false, bool emphasis = false, bool embed = false)
 {
     if (OnMessage != null)
     {
         OnMessage(message, asChild, emphasis, embed, color);
     }
 }
Ejemplo n.º 18
0
 public PlacedWard(Vector3 position, float aliveTo, int networkId, Color drawColor)
 {
     Position = position;
     AliveTo = aliveTo;
     NetworkId = networkId;
     Color = drawColor;
 }
Ejemplo n.º 19
0
        public static void drawLine(Vector3 from, Vector3 to, int width, Color color)
        {
            var wts1 = Drawing.WorldToScreen(from);
            var wts2 = Drawing.WorldToScreen(to);

            Drawing.DrawLine(wts1[0], wts1[1], wts2[0], wts2[1], width, color);
        }
Ejemplo n.º 20
0
        public static void DrawCricleMinimap(Vector2 screenPosition, float radius, Color color, float width = 2F, int quality = -1)
        {
            if (quality == -1)
            {
                quality = (int) (radius / 3 + 15);
            }

            var rad = new Vector2(0, radius);
            var segments = new List<MinimapCircleSegment>();
            var full = true;
            for (var i = 0; i <= quality; i++)
            {
                var pos = (screenPosition + rad).RotateAroundPoint(screenPosition, PI2 * i / quality);
                var contains = MinimapRectangle.Contains(pos);
                if (!contains)
                {
                    full = false;
                }
                segments.Add(new MinimapCircleSegment(pos, contains));
            }

            foreach (var ar in FindArcs(segments, full))
            {
                Line.DrawLine(color, width, ar);
            }
        }
Ejemplo n.º 21
0
 public Serie(string name, Element[] elements)
 {
         this.Name = name;
         this.Elements = elements;
         System.Random r = new System.Random();
         this.Color = System.Drawing.Color.FromArgb(r.Next(0, 255), r.Next(0, 255), r.Next(0, 255));
 }
Ejemplo n.º 22
0
 public void Draw(int thickness, Color color)
 {
     DUtility.DrawLine(rekt[0].To3D(), rekt[1].To3D(), thickness, color);
     DUtility.DrawLine(rekt[1].To3D(), rekt[3].To3D(), thickness, color);
     DUtility.DrawLine(rekt[2].To3D(), rekt[3].To3D(), thickness, color);
     DUtility.DrawLine(rekt[0].To3D(), rekt[2].To3D(), thickness, color);
 }
Ejemplo n.º 23
0
        private void LoadSettings()
        {
            try
            {
                // Try to load saved settings
                //  Common.Configuration.AppConfig.Reload();

                _VisualFeedbackColor = AppConfig.VisualFeedbackColor;
                VisualFeedbackWidthSlider.Value = AppConfig.VisualFeedbackWidth;
                MinimumPointDistanceSlider.Value = AppConfig.MinimumPointDistance;
                chkWindowsStartup.IsChecked = GetStartupStatus();
                OpacitySlider.Value = AppConfig.Opacity;
                chkOrderByLocation.IsChecked = AppConfig.IsOrderByLocation;
                ShowBalloonTipSwitch.IsChecked = AppConfig.ShowBalloonTip;
                ShowTrayIconSwitch.IsChecked = AppConfig.ShowTrayIcon;
                SendLogToggleSwitch.IsChecked = AppConfig.SendErrorReport;

                LanguageComboBox.ItemsSource = LocalizationProvider.Instance.GetLanguageList("ControlPanel");
                LanguageComboBox.SelectedValue = AppConfig.CultureName;

                TimeoutTextBox.Text = AppConfig.GestureTimeout.ToString();
            }
            catch (Exception)
            {
                MessageBox.Show(LocalizationProvider.Instance.GetTextValue("Options.Messages.LoadSettingError"),
                    LocalizationProvider.Instance.GetTextValue("Options.Messages.LoadSettingErrorTitle"), MessageBoxButton.OK,
                    MessageBoxImage.Error);
            }
        }
Ejemplo n.º 24
0
 public MessColor(int id,string keyMess,System.Drawing.Color forecolor,System.Drawing.Color backColor)
 {
     this.id = id;
     this.keyMess = keyMess;
     this.forecolor = forecolor;
     this.backColor = backColor;
 }
Ejemplo n.º 25
0
        public static void DrawCircle(Vector3 center,
            float radius,
            Color color,
            int thickness = 5,
            int quality = 60)
        {
            Render.Circle.DrawCircle(center, radius, color, thickness, false);

            //var pointList = new List<Vector3>();
            //for (var i = 0; i < quality; i++)
            //{
            //    var angle = i * Math.PI * 2 / quality;
            //    pointList.Add(
            //        new Vector3(
            //            center.X + radius * (float)Math.Cos(angle), center.Y + radius * (float)Math.Sin(angle),
            //            center.Z));
            //}

            //for (var i = 0; i < pointList.Count; i++)
            //{
            //    var a = pointList[i];
            //    var b = pointList[i == pointList.Count - 1 ? 0 : i + 1];

            //    var aonScreen = Drawing.WorldToScreen(a);
            //    var bonScreen = Drawing.WorldToScreen(b);

            //    Drawing.DrawLine(aonScreen.X, aonScreen.Y, bonScreen.X, bonScreen.Y, thickness, color);
            //}
        }
Ejemplo n.º 26
0
 /// <summary>
 /// 将文字转换为Html输出格式
 /// </summary>
 /// <param name="form">要输出的内容</param>
 /// <param name="FontName">字体名</param>
 /// <param name="FontSize">字体大小</param>
 /// <param name="FontColor">字体颜色</param>
 /// <returns>格式化后的内容</returns>
 public static string ToHtml(this string form, string FontName, int FontSize, Color FontColor)
 {
     string colorhx = "#" + FontColor.ToArgb().ToString("X6");
     form = form.ToUTF8();
     form = $"<font face=\"{FontName}\" size=\"{FontSize}\"  color=\"{colorhx}\">{form}</font>";
     return form;
 }
Ejemplo n.º 27
0
        public void SelectColor(string idColor)
        {
            colors = new List<System.Drawing.Color>();
            colors.Add(System.Drawing.Color.White);
            colors.Add(System.Drawing.Color.Orange);
            colors.Add(System.Drawing.Color.Blue);
            colors.Add(System.Drawing.Color.Red);
            colors.Add(System.Drawing.Color.Yellow);


            switch (idColor)
            {
                case "up":
                    if (currentcolor < colors.Count-1)
                        currentcolor++;
                    break;

                case "down":
                    if (currentcolor>0)
                        currentcolor--;
                    break;
                                  
            }


            colorLight=colors[currentcolor];
        }
Ejemplo n.º 28
0
		public User(string id, string name, int color, long tick) {
			Id = id;
			Name = name;
			Color = System.Drawing.Color.FromArgb(color);
			LastCommentDate = new DateTime(tick);
			State = UserState.None;
		}
Ejemplo n.º 29
0
 protected override void OnCreateControl()
 {
     base.OnCreateControl();
     this.PlaceholderColor = System.Drawing.Color.LightGray;
     this.inputColor = System.Drawing.SystemColors.WindowText;
     this.UpdateText(base.Focused);
 }
Ejemplo n.º 30
0
 //#----------------------------------------------------------
 //# * Initialize
 //#----------------------------------------------------------
 public Effect_Text(string text, Color color, int x, int y, int maxTick)
     : base(maxTick)
 {
     _text = text;
     _color = color;
     _startPt = new Point2DEx(x, y);
 }
Ejemplo n.º 31
0
        /// <summary>
        /// Adds cell into provided PDF table
        /// </summary>
        /// <param name="table">PDF table</param>
        /// <param name="phrase">Cell content</param>
        /// <param name="borderColor">Cell border color</param>
        internal void AddCell(PdfPTable table, Phrase phrase, System.Drawing.Color borderColor)
        {
            PdfPCell cell = GetCell(borderColor, phrase);

            table.AddCell(cell);
        }
Ejemplo n.º 32
0
        private static void OnDraw(EventArgs Args)
        {
            if (!Me.IsDead && !MenuGUI.IsShopOpen && !MenuGUI.IsChatOpen && !MenuGUI.IsScoreboardOpen)
            {
                if (Menu.Item("DrawQ", true).GetValue <bool>() && Q1.IsReady())
                {
                    Render.Circle.DrawCircle(Me.Position, Q.Range + Me.BoundingRadius, Color.FromArgb(188, 6, 248), 2);
                }

                if (Menu.Item("DrawQMax", true).GetValue <bool>() && Q1.IsReady())
                {
                    Render.Circle.DrawCircle(Me.Position, Q1.Range, Color.FromArgb(154, 249, 39), 2);
                }

                if (Menu.Item("DrawW", true).GetValue <bool>() && W.IsReady())
                {
                    Render.Circle.DrawCircle(Me.Position, W.Range, Color.FromArgb(9, 253, 242), 2);
                }

                if (Menu.Item("DrawDamage", true).GetValue <bool>())
                {
                    foreach (
                        var x in HeroManager.Enemies.Where(e => e.IsValidTarget() && !e.IsDead && !e.IsZombie))
                    {
                        HpBarDraw.Unit = x;
                        HpBarDraw.DrawDmg((float)ComboDamage(x), new ColorBGRA(255, 204, 0, 170));
                    }
                }
            }
        }
Ejemplo n.º 33
0
 public override Task PrintMessageAsync(string message, System.Drawing.Color color)
 {
     return(Task.CompletedTask);
 }
Ejemplo n.º 34
0
        private void InitMenu()
        {
            config = new Menu("Evelynn", "Evelynn", true);
            // Target Selector
            Menu menuTS = new Menu("Selector", "tselect");

            TargetSelector.AddToMenu(menuTS);
            config.AddSubMenu(menuTS);

            // Orbwalker
            Menu menuOrb = new Menu("Orbwalker", "orbwalker");

            orbwalker = new Orbwalking.Orbwalker(menuOrb);
            config.AddSubMenu(menuOrb);

            // Draw settings
            Menu menuD = new Menu("Drawings ", "dsettings");

            menuD.AddItem(new MenuItem("drawaa", "Draw AA range", true))
            .SetValue(new Circle(false, Color.FromArgb(180, 58, 100, 150)));
            menuD.AddItem(new MenuItem("drawqq", "Draw Q range", true))
            .SetValue(new Circle(false, Color.FromArgb(180, 58, 100, 150)));
            menuD.AddItem(new MenuItem("drawww", "Draw W range", true))
            .SetValue(new Circle(false, Color.FromArgb(180, 58, 100, 150)));
            menuD.AddItem(new MenuItem("drawee", "Draw E range", true))
            .SetValue(new Circle(false, Color.FromArgb(180, 58, 100, 150)));
            menuD.AddItem(new MenuItem("drawrr", "Draw R range", true))
            .SetValue(new Circle(false, Color.FromArgb(180, 58, 100, 150)));
            menuD.AddItem(new MenuItem("drawcombo", "Draw combo damage", true)).SetValue(true);
            config.AddSubMenu(menuD);
            // Combo Settings
            Menu menuC = new Menu("Combo ", "csettings");

            menuC.AddItem(new MenuItem("useq", "Use Q", true)).SetValue(true);
            menuC.AddItem(new MenuItem("usew", "Use W to remove slows", true)).SetValue(true);
            menuC.AddItem(new MenuItem("usee", "Use E", true)).SetValue(true);
            menuC.AddItem(new MenuItem("user", "Use R", true)).SetValue(true);
            menuC.AddItem(new MenuItem("useRmin", "R minimum target", true)).SetValue(new Slider(2, 1, 5));
            menuC.AddItem(new MenuItem("selected", "Focus Selected target", true)).SetValue(true);
            menuC.AddItem(new MenuItem("useIgnite", "Use Ignite", true)).SetValue(true);
            menuC = ItemHandler.addItemOptons(menuC);
            config.AddSubMenu(menuC);
            // Harass Settings
            Menu menuH = new Menu("Harass ", "Hsettings");

            menuH.AddItem(new MenuItem("useqH", "Use Q", true)).SetValue(true);
            config.AddSubMenu(menuH);
            // Lasthit Settings
            Menu menuLH = new Menu("Lasthit ", "LHsettings");

            menuLH.AddItem(new MenuItem("useqLH", "Use Q", true)).SetValue(true);
            config.AddSubMenu(menuLH);
            // LaneClear Settings
            Menu menuLC = new Menu("LaneClear ", "Lcsettings");

            menuLC.AddItem(new MenuItem("useqLC", "Use Q", true)).SetValue(true);
            menuLC.AddItem(new MenuItem("useeLC", "Use E", true)).SetValue(true);
            menuLC.AddItem(new MenuItem("minmana", "Keep X% mana", true)).SetValue(new Slider(1, 1, 100));
            config.AddSubMenu(menuLC);
            // Misc Settings
            Menu menuM = new Menu("Misc ", "Msettings");

            menuM = DrawHelper.AddMisc(menuM);
            config.AddSubMenu(menuM);

            config.AddItem(new MenuItem("UnderratedAIO", "by Soresu v" + Program.version.ToString().Replace(",", ".")));
            config.AddToMainMenu();
        }
Ejemplo n.º 35
0
        public override Map Process(XDocument input, ContentProcessorContext context)
        {
            CultureInfo culture = Thread.CurrentThread.CurrentCulture;

            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            Map map = new Map();

            map.LoadTextures = LoadTextures;
            List <Tile> mapTiles = new List <Tile>();
            Dictionary <UInt32, Int32> gid2id = new Dictionary <UInt32, Int32>();

            gid2id.Add(0, -1);

            String mapDirectory = input.Document.Root.Element("File").Attribute("path").Value;

            Decimal Version = Convert.ToDecimal(input.Document.Root.Attribute("version").Value);

            if (Version != 1.0M)
            {
                throw new NotSupportedException("XTiled only supports TMX maps version 1.0");
            }

            switch (input.Document.Root.Attribute("orientation").Value)
            {
            case "orthogonal":
                map.Orientation = MapOrientation.Orthogonal;
                break;

            case "isometric":
                map.Orientation = MapOrientation.Isometric;
                break;

            case "staggered":
                map.Orientation = MapOrientation.Staggered;
                break;

            default:
                throw new NotSupportedException("XTiled supports only orthogonal, isometric or staggered isometric maps");
            }

            map.Width      = Convert.ToInt32(input.Document.Root.Attribute("width").Value);
            map.Height     = Convert.ToInt32(input.Document.Root.Attribute("height").Value);
            map.TileWidth  = Convert.ToInt32(input.Document.Root.Attribute("tilewidth").Value);
            map.TileHeight = Convert.ToInt32(input.Document.Root.Attribute("tileheight").Value);
            map.Bounds     = new Rectangle(0, 0, map.Width * map.TileWidth, map.Height * map.TileHeight);
            if (map.Orientation == MapOrientation.Staggered)
            {
                map.Bounds.Width += map.TileWidth / 2;
                map.Bounds.Height = (map.Height + 1) * (map.TileHeight / 2);
            }

            map.Properties = new Dictionary <String, Property>();
            if (input.Document.Root.Element("properties") != null)
            {
                foreach (var pElem in input.Document.Root.Element("properties").Elements("property"))
                {
                    map.Properties.Add(pElem.Attribute("name").Value, Property.Create(pElem.Attribute("value").Value));
                }
            }

            List <Tileset> tilesets = new List <Tileset>();

            foreach (var elem in input.Document.Root.Elements("tileset"))
            {
                Tileset  t        = new Tileset();
                XElement tElem    = elem;
                UInt32   FirstGID = Convert.ToUInt32(tElem.Attribute("firstgid").Value);

                if (elem.Attribute("source") != null)
                {
                    XDocument tsx = XDocument.Load(elem.Attribute("source").Value);
                    tElem = tsx.Root;
                }

                t.Name       = tElem.Attribute("name") == null ? null : tElem.Attribute("name").Value;
                t.TileWidth  = tElem.Attribute("tilewidth") == null ? 0 : Convert.ToInt32(tElem.Attribute("tilewidth").Value);
                t.TileHeight = tElem.Attribute("tileheight") == null ? 0 : Convert.ToInt32(tElem.Attribute("tileheight").Value);
                t.Spacing    = tElem.Attribute("spacing") == null ? 0 : Convert.ToInt32(tElem.Attribute("spacing").Value);
                t.Margin     = tElem.Attribute("margin") == null ? 0 : Convert.ToInt32(tElem.Attribute("margin").Value);

                if (tElem.Element("tileoffset") != null)
                {
                    t.TileOffsetX = Convert.ToInt32(tElem.Element("tileoffset").Attribute("x").Value);
                    t.TileOffsetY = Convert.ToInt32(tElem.Element("tileoffset").Attribute("y").Value);
                }
                else
                {
                    t.TileOffsetX = 0;
                    t.TileOffsetY = 0;
                }

                if (tElem.Element("image") != null)
                {
                    XElement imgElem = tElem.Element("image");
                    t.ImageFileName         = Path.Combine(mapDirectory, imgElem.Attribute("source").Value);
                    t.ImageWidth            = imgElem.Attribute("width") == null ? -1 : Convert.ToInt32(imgElem.Attribute("width").Value);
                    t.ImageHeight           = imgElem.Attribute("height") == null ? -1 : Convert.ToInt32(imgElem.Attribute("height").Value);
                    t.ImageTransparentColor = null;
                    if (imgElem.Attribute("trans") != null)
                    {
                        System.Drawing.Color sdc = System.Drawing.ColorTranslator.FromHtml("#" + imgElem.Attribute("trans").Value.TrimStart('#'));
                        t.ImageTransparentColor = new Color(sdc.R, sdc.G, sdc.B);
                    }

                    if (t.ImageWidth == -1 || t.ImageHeight == -1)
                    {
                        try {
                            System.Drawing.Image sdi = System.Drawing.Image.FromFile(t.ImageFileName);
                            t.ImageHeight = sdi.Height;
                            t.ImageWidth  = sdi.Width;
                        }
                        catch (Exception ex) {
                            throw new Exception(String.Format("Image size not set for {0} and error loading file.", t.ImageFileName), ex);
                        }
                    }

                    if (LoadTextures)
                    {
                        String assetName = Path.Combine(
                            Path.GetDirectoryName(context.OutputFilename.Remove(0, context.OutputDirectory.Length)),
                            Path.GetFileNameWithoutExtension(context.OutputFilename),
                            tilesets.Count.ToString("00"));

                        OpaqueDataDictionary data = new OpaqueDataDictionary();
                        data.Add("GenerateMipmaps", false);
                        data.Add("ResizeToPowerOfTwo", false);
                        data.Add("PremultiplyAlpha", PremultiplyAlpha);
                        data.Add("TextureFormat", TextureFormat);
                        data.Add("ColorKeyEnabled", t.ImageTransparentColor.HasValue);
                        data.Add("ColorKeyColor", t.ImageTransparentColor ?? Microsoft.Xna.Framework.Color.Magenta);
                        context.BuildAsset <TextureContent, TextureContent>(new ExternalReference <TextureContent>(t.ImageFileName),
                                                                            "TextureProcessor", data, "TextureImporter", assetName);
                    }
                }

                UInt32 gid = FirstGID;
                for (int y = t.Margin; y < t.ImageHeight - t.Margin; y += t.TileHeight + t.Spacing)
                {
                    if (y + t.TileHeight > t.ImageHeight - t.Margin)
                    {
                        continue;
                    }

                    for (int x = t.Margin; x < t.ImageWidth - t.Margin; x += t.TileWidth + t.Spacing)
                    {
                        if (x + t.TileWidth > t.ImageWidth - t.Margin)
                        {
                            continue;
                        }

                        Tile tile = new Tile();
                        tile.Source     = new Rectangle(x, y, t.TileWidth, t.TileHeight);
                        tile.Origin     = new Vector2(t.TileWidth / 2, t.TileHeight / 2);
                        tile.TilesetID  = tilesets.Count;
                        tile.Properties = new Dictionary <String, Property>();
                        mapTiles.Add(tile);

                        gid2id[gid] = mapTiles.Count - 1;
                        gid++;
                    }
                }

                List <Tile> tiles = new List <Tile>();
                foreach (var tileElem in tElem.Elements("tile"))
                {
                    UInt32 id   = Convert.ToUInt32(tileElem.Attribute("id").Value);
                    Tile   tile = mapTiles[gid2id[id + FirstGID]];
                    if (tileElem.Element("properties") != null)
                    {
                        foreach (var pElem in tileElem.Element("properties").Elements("property"))
                        {
                            tile.Properties.Add(pElem.Attribute("name").Value, Property.Create(pElem.Attribute("value").Value));
                        }
                    }
                    tiles.Add(tile);
                }
                t.Tiles = tiles.ToArray();

                t.Properties = new Dictionary <String, Property>();
                if (tElem.Element("properties") != null)
                {
                    foreach (var pElem in tElem.Element("properties").Elements("property"))
                    {
                        t.Properties.Add(pElem.Attribute("name").Value, Property.Create(pElem.Attribute("value").Value));
                    }
                }

                tilesets.Add(t);
            }
            map.Tilesets = tilesets.ToArray();

            TileLayerList layers = new TileLayerList();

            foreach (var lElem in input.Document.Root.Elements("layer"))
            {
                TileLayer l = new TileLayer();
                l.Name    = lElem.Attribute("name") == null ? null : lElem.Attribute("name").Value;
                l.Opacity = lElem.Attribute("opacity") == null ? 1.0f : Convert.ToSingle(lElem.Attribute("opacity").Value);
                l.Visible = lElem.Attribute("visible") == null ? true : lElem.Attribute("visible").Equals("1");

                l.OpacityColor   = Color.White;
                l.OpacityColor.A = Convert.ToByte(255.0f * l.Opacity);

                l.Properties = new Dictionary <String, Property>();
                if (lElem.Element("properties") != null)
                {
                    foreach (var pElem in lElem.Element("properties").Elements("property"))
                    {
                        l.Properties.Add(pElem.Attribute("name").Value, Property.Create(pElem.Attribute("value").Value));
                    }
                }

                TileData[][] tiles = new TileData[(map.Orientation == MapOrientation.Orthogonal || map.Orientation == MapOrientation.Staggered) ? map.Width : map.Height + map.Width - 1][];
                for (int i = 0; i < tiles.Length; i++)
                {
                    tiles[i] = new TileData[(map.Orientation == MapOrientation.Orthogonal || map.Orientation == MapOrientation.Staggered) ? map.Height : map.Height + map.Width - 1];
                }

                if (lElem.Element("data") != null)
                {
                    List <UInt32> gids = new List <UInt32>();
                    if (lElem.Element("data").Attribute("encoding") != null || lElem.Element("data").Attribute("compression") != null)
                    {
                        // parse csv formatted data
                        if (lElem.Element("data").Attribute("encoding") != null && lElem.Element("data").Attribute("encoding").Value.Equals("csv"))
                        {
                            foreach (var gid in lElem.Element("data").Value.Split(",\n\r".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
                            {
                                gids.Add(Convert.ToUInt32(gid));
                            }
                        }
                        else if (lElem.Element("data").Attribute("encoding") != null && lElem.Element("data").Attribute("encoding").Value.Equals("base64"))
                        {
                            Byte[] data = Convert.FromBase64String(lElem.Element("data").Value);

                            if (lElem.Element("data").Attribute("compression") == null)
                            {
                                // uncompressed data
                                for (int i = 0; i < data.Length; i += sizeof(UInt32))
                                {
                                    gids.Add(BitConverter.ToUInt32(data, i));
                                }
                            }
                            else if (lElem.Element("data").Attribute("compression").Value.Equals("gzip"))
                            {
                                // gzip data
                                GZipStream gz     = new GZipStream(new MemoryStream(data), CompressionMode.Decompress);
                                Byte[]     buffer = new Byte[sizeof(UInt32)];
                                while (gz.Read(buffer, 0, buffer.Length) == buffer.Length)
                                {
                                    gids.Add(BitConverter.ToUInt32(buffer, 0));
                                }
                            }
                            else if (lElem.Element("data").Attribute("compression").Value.Equals("zlib"))
                            {
                                // zlib data - first two bytes zlib specific and not part of deflate
                                MemoryStream ms = new MemoryStream(data);
                                ms.ReadByte();
                                ms.ReadByte();
                                DeflateStream gz     = new DeflateStream(ms, CompressionMode.Decompress);
                                Byte[]        buffer = new Byte[sizeof(UInt32)];
                                while (gz.Read(buffer, 0, buffer.Length) == buffer.Length)
                                {
                                    gids.Add(BitConverter.ToUInt32(buffer, 0));
                                }
                            }
                            else
                            {
                                throw new NotSupportedException(String.Format("Compression '{0}' not supported.  XTiled supports gzip or zlib", lElem.Element("data").Attribute("compression").Value));
                            }
                        }
                        else
                        {
                            throw new NotSupportedException(String.Format("Encoding '{0}' not supported.  XTiled supports csv or base64", lElem.Element("data").Attribute("encoding").Value));
                        }
                    }
                    else
                    {
                        // parse xml formatted data
                        foreach (var tElem in lElem.Element("data").Elements("tile"))
                        {
                            gids.Add(Convert.ToUInt32(tElem.Attribute("gid").Value));
                        }
                    }

                    for (int i = 0; i < gids.Count; i++)
                    {
                        TileData td = new TileData();
                        UInt32   ID = gids[i] & ~(FLIPPED_HORIZONTALLY_FLAG | FLIPPED_VERTICALLY_FLAG | FLIPPED_DIAGONALLY_FLAG);
                        td.SourceID = gid2id[ID];
                        if (td.SourceID >= 0)
                        {
                            Boolean FlippedHorizontally = Convert.ToBoolean(gids[i] & FLIPPED_HORIZONTALLY_FLAG);
                            Boolean FlippedVertically   = Convert.ToBoolean(gids[i] & FLIPPED_VERTICALLY_FLAG);
                            Boolean FlippedDiagonally   = Convert.ToBoolean(gids[i] & FLIPPED_DIAGONALLY_FLAG);

                            if (FlippedDiagonally)
                            {
                                td.Rotation = MathHelper.PiOver2;
                                // this works, not 100% why (we are rotating instead of diag flipping, so I guess that's a clue)
                                FlippedHorizontally = false;
                            }
                            else
                            {
                                td.Rotation = 0;
                            }

                            if (FlippedVertically && FlippedHorizontally)
                            {
                                td.Effects = SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically;
                            }
                            else if (FlippedVertically)
                            {
                                td.Effects = SpriteEffects.FlipVertically;
                            }
                            else if (FlippedHorizontally)
                            {
                                td.Effects = SpriteEffects.FlipHorizontally;
                            }
                            else
                            {
                                td.Effects = SpriteEffects.None;
                            }

                            td.Target.Width  = mapTiles[td.SourceID].Source.Width;
                            td.Target.Height = mapTiles[td.SourceID].Source.Height;

                            if (map.Orientation == MapOrientation.Orthogonal)
                            {
                                Int32 x = i % map.Width;
                                Int32 y = i / map.Width;
                                td.Target.X  = x * map.TileWidth + Convert.ToInt32(mapTiles[td.SourceID].Origin.X) + map.Tilesets[mapTiles[td.SourceID].TilesetID].TileOffsetX;
                                td.Target.Y  = y * map.TileHeight + Convert.ToInt32(mapTiles[td.SourceID].Origin.Y) + map.Tilesets[mapTiles[td.SourceID].TilesetID].TileOffsetY;
                                td.Target.Y += map.TileHeight - td.Target.Height;

                                // adjust for off center origin in odd tiles sizes
                                if (FlippedDiagonally && td.Target.Width % 2 == 1)
                                {
                                    td.Target.X += 1;
                                }

                                tiles[x][y] = td;
                            }
                            else if (map.Orientation == MapOrientation.Isometric)
                            {
                                Int32 x = map.Height + i % map.Width - (1 * i / map.Width + 1);
                                Int32 y = i - i / map.Width * map.Width + i / map.Width;
                                td.Target.X  = x * map.TileWidth + Convert.ToInt32(mapTiles[td.SourceID].Origin.X) + map.Tilesets[mapTiles[td.SourceID].TilesetID].TileOffsetX;
                                td.Target.Y  = y * map.TileHeight + Convert.ToInt32(mapTiles[td.SourceID].Origin.Y) + map.Tilesets[mapTiles[td.SourceID].TilesetID].TileOffsetY;
                                td.Target.Y += map.TileHeight - td.Target.Height;
                                td.Target.X  = td.Target.X / 2 + map.TileWidth / 4;
                                td.Target.Y  = td.Target.Y / 2 + map.TileHeight / 4;

                                // adjust for off center origin in odd tiles sizes
                                if (FlippedDiagonally && td.Target.Width % 2 == 1)
                                {
                                    td.Target.X += 1;
                                }

                                tiles[x][y] = td;
                            }
                            else if (map.Orientation == MapOrientation.Staggered)
                            {
                                Int32 x = i % map.Width;
                                Int32 y = i / map.Width;

                                Int32 cx = x, cy = y;

                                td.Target.X  = x * map.TileWidth + Convert.ToInt32(mapTiles[td.SourceID].Origin.X) + map.Tilesets[mapTiles[td.SourceID].TilesetID].TileOffsetX;
                                td.Target.Y  = (y / 2) * map.TileHeight + Convert.ToInt32(mapTiles[td.SourceID].Origin.Y) + map.Tilesets[mapTiles[td.SourceID].TilesetID].TileOffsetY;
                                td.Target.Y += map.TileHeight - td.Target.Height;

                                if (y % 2 == 1)
                                {
                                    td.Target.X += (map.TileWidth / 2);
                                    td.Target.Y += (map.TileHeight / 2);
                                }

                                // adjust for off center origin in odd tiles sizes
                                if (FlippedDiagonally && td.Target.Width % 2 == 1)
                                {
                                    td.Target.X += 1;
                                }

                                //if (y % 2 == 0)
                                tiles[x][y] = td;
                            }
                        }
                    }
                }
                l.Tiles = tiles;

                layers.Add(l);
            }
            map.TileLayers  = layers;
            map.SourceTiles = mapTiles.ToArray();

            ObjectLayerList oLayers = new ObjectLayerList();

            foreach (var olElem in input.Document.Root.Elements("objectgroup"))
            {
                ObjectLayer ol = new ObjectLayer();
                ol.Name    = olElem.Attribute("name") == null ? null : olElem.Attribute("name").Value;
                ol.Opacity = olElem.Attribute("opacity") == null ? 1.0f : Convert.ToSingle(olElem.Attribute("opacity").Value);
                ol.Visible = olElem.Attribute("visible") == null ? true : olElem.Attribute("visible").Equals("1");

                ol.OpacityColor   = Color.White;
                ol.OpacityColor.A = Convert.ToByte(255.0f * ol.Opacity);

                ol.Color = null;
                if (olElem.Attribute("color") != null)
                {
                    System.Drawing.Color sdc = System.Drawing.ColorTranslator.FromHtml("#" + olElem.Attribute("color").Value.TrimStart('#'));
                    ol.Color = new Color(sdc.R, sdc.G, sdc.B, ol.OpacityColor.A);
                }

                ol.Properties = new Dictionary <String, Property>();
                if (olElem.Element("properties") != null)
                {
                    foreach (var pElem in olElem.Element("properties").Elements("property"))
                    {
                        ol.Properties.Add(pElem.Attribute("name").Value, Property.Create(pElem.Attribute("value").Value));
                    }
                }

                List <MapObject> objects = new List <MapObject>();
                foreach (var oElem in olElem.Elements("object"))
                {
                    MapObject o = new MapObject();
                    o.Name          = oElem.Attribute("name") == null ? null : oElem.Attribute("name").Value;
                    o.Type          = oElem.Attribute("type") == null ? null : oElem.Attribute("type").Value;
                    o.Bounds.X      = oElem.Attribute("x") == null ? 0 : Convert.ToInt32(oElem.Attribute("x").Value);
                    o.Bounds.Y      = oElem.Attribute("y") == null ? 0 : Convert.ToInt32(oElem.Attribute("y").Value);
                    o.Bounds.Width  = oElem.Attribute("width") == null ? 0 : Convert.ToInt32(oElem.Attribute("width").Value);
                    o.Bounds.Height = oElem.Attribute("height") == null ? 0 : Convert.ToInt32(oElem.Attribute("height").Value);
                    o.TileID        = oElem.Attribute("gid") == null ? null : (Int32?)gid2id[Convert.ToUInt32(oElem.Attribute("gid").Value)];
                    o.Visible       = oElem.Attribute("visible") == null ? true : oElem.Attribute("visible").Equals("1");

                    if (o.TileID.HasValue)
                    {
                        o.Bounds.X     += Convert.ToInt32(mapTiles[o.TileID.Value].Origin.X); // +map.Tilesets[mapTiles[o.TileID.Value].TilesetID].TileOffsetX;
                        o.Bounds.Y     -= Convert.ToInt32(mapTiles[o.TileID.Value].Origin.Y); // +map.Tilesets[mapTiles[o.TileID.Value].TilesetID].TileOffsetY;
                        o.Bounds.Width  = map.SourceTiles[o.TileID.Value].Source.Width;
                        o.Bounds.Height = map.SourceTiles[o.TileID.Value].Source.Height;
                    }

                    o.Properties = new Dictionary <String, Property>();
                    if (oElem.Element("properties") != null)
                    {
                        foreach (var pElem in oElem.Element("properties").Elements("property"))
                        {
                            o.Properties.Add(pElem.Attribute("name").Value, Property.Create(pElem.Attribute("value").Value));
                        }
                    }

                    o.Polygon = null;
                    if (oElem.Element("polygon") != null)
                    {
                        List <Point> points = new List <Point>();
                        foreach (var point in oElem.Element("polygon").Attribute("points").Value.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
                        {
                            String[] coord = point.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                            points.Add(new Point(o.Bounds.X + Convert.ToInt32(coord[0]), o.Bounds.Y + Convert.ToInt32(coord[1])));
                        }
                        points.Add(points.First()); // connect the last point to the first and close the polygon
                        o.Polygon = Polygon.FromPoints(points);
                        o.Bounds  = o.Polygon.Bounds;
                    }

                    o.Polyline = null;
                    if (oElem.Element("polyline") != null)
                    {
                        List <Point> points = new List <Point>();
                        foreach (var point in oElem.Element("polyline").Attribute("points").Value.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
                        {
                            String[] coord = point.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                            points.Add(new Point(o.Bounds.X + Convert.ToInt32(coord[0]), o.Bounds.Y + Convert.ToInt32(coord[1])));
                        }

                        o.Polyline = Polyline.FromPoints(points);
                        o.Bounds   = o.Polyline.Bounds;
                    }

                    objects.Add(o);
                }
                ol.MapObjects = objects.ToArray();

                oLayers.Add(ol);
            }
            map.ObjectLayers = oLayers;

            ImageLayerList iLayers = new ImageLayerList();

            foreach (var ilElem in input.Document.Root.Elements("imagelayer"))
            {
                ImageLayer il = new ImageLayer();
                il.Name    = ilElem.Attribute("name") == null ? null : ilElem.Attribute("name").Value;
                il.Opacity = ilElem.Attribute("opacity") == null ? 1.0f : Convert.ToSingle(ilElem.Attribute("opacity").Value);
                il.Visible = ilElem.Attribute("visible") == null ? true : ilElem.Attribute("visible").Equals("1");

                il.OpacityColor   = Color.White;
                il.OpacityColor.A = Convert.ToByte(255.0f * il.Opacity);

                il.Color = null;
                if (ilElem.Attribute("color") != null)
                {
                    System.Drawing.Color sdc = System.Drawing.ColorTranslator.FromHtml("#" + ilElem.Attribute("color").Value.TrimStart('#'));
                    il.Color = new Color(sdc.R, sdc.G, sdc.B, il.OpacityColor.A);
                }

                il.Properties = new Dictionary <String, Property>();
                if (ilElem.Element("properties") != null)
                {
                    foreach (var pElem in ilElem.Element("properties").Elements("property"))
                    {
                        il.Properties.Add(pElem.Attribute("name").Value, Property.Create(pElem.Attribute("value").Value));
                    }
                }

                List <MapImage> images = new List <MapImage>();
                foreach (var iElem in ilElem.Elements("image"))
                {
                    MapImage i = new MapImage();
                    i.ImageFileName         = Path.Combine(mapDirectory, iElem.Attribute("source").Value);
                    i.ImageWidth            = iElem.Attribute("width") == null ? -1 : Convert.ToInt32(iElem.Attribute("width").Value);
                    i.ImageHeight           = iElem.Attribute("height") == null ? -1 : Convert.ToInt32(iElem.Attribute("height").Value);
                    i.ImageTransparentColor = null;
                    if (iElem.Attribute("trans") != null)
                    {
                        System.Drawing.Color sdc = System.Drawing.ColorTranslator.FromHtml("#" + iElem.Attribute("trans").Value.TrimStart('#'));
                        i.ImageTransparentColor = new Color(sdc.R, sdc.G, sdc.B);
                    }

                    if (i.ImageWidth == -1 || i.ImageHeight == -1)
                    {
                        try
                        {
                            System.Drawing.Image sdi = System.Drawing.Image.FromFile(i.ImageFileName);
                            i.ImageHeight = sdi.Height;
                            i.ImageWidth  = sdi.Width;
                        }
                        catch (Exception ex)
                        {
                            throw new Exception(String.Format("Image size not set for {0} and error loading file.", i.ImageFileName), ex);
                        }
                    }

                    i.Properties = new Dictionary <String, Property>();
                    if (iElem.Element("properties") != null)
                    {
                        foreach (var pElem in iElem.Element("properties").Elements("property"))
                        {
                            i.Properties.Add(pElem.Attribute("name").Value, Property.Create(pElem.Attribute("value").Value));
                        }
                    }


                    if (LoadTextures)
                    {
                        String assetName = Path.Combine(
                            Path.GetDirectoryName(context.OutputFilename.Remove(0, context.OutputDirectory.Length)),
                            Path.GetFileNameWithoutExtension(context.OutputFilename),
                            "i" + iLayers.Count.ToString("00"), images.Count.ToString("00"));

                        OpaqueDataDictionary data = new OpaqueDataDictionary();
                        data.Add("GenerateMipmaps", false);
                        data.Add("ResizeToPowerOfTwo", false);
                        data.Add("PremultiplyAlpha", PremultiplyAlpha);
                        data.Add("TextureFormat", TextureFormat);
                        data.Add("ColorKeyEnabled", i.ImageTransparentColor.HasValue);
                        data.Add("ColorKeyColor", i.ImageTransparentColor ?? Microsoft.Xna.Framework.Color.Magenta);
                        context.BuildAsset <TextureContent, TextureContent>(new ExternalReference <TextureContent>(i.ImageFileName),
                                                                            "TextureProcessor", data, "TextureImporter", assetName);
                    }

                    images.Add(i);
                }
                il.MapImages = images.ToArray();

                iLayers.Add(il);
            }
            map.ImageLayers = iLayers;

            Int32            layerId = 0, objectId = 0, imageId = 0;
            List <LayerInfo> info = new List <LayerInfo>();

            foreach (var elem in input.Document.Root.Elements())
            {
                if (elem.Name.LocalName.Equals("layer"))
                {
                    info.Add(new LayerInfo()
                    {
                        ID = layerId++, LayerType = LayerType.TileLayer
                    });
                }
                else if (elem.Name.LocalName.Equals("objectgroup"))
                {
                    info.Add(new LayerInfo()
                    {
                        ID = objectId++, LayerType = LayerType.ObjectLayer
                    });
                }
                else if (elem.Name.LocalName.Equals("imagelayer"))
                {
                    info.Add(new LayerInfo()
                    {
                        ID = imageId++, LayerType = LayerType.ImageLayer
                    });
                }
            }
            map.LayerOrder = info.ToArray();

            Thread.CurrentThread.CurrentCulture = culture;
            return(map);
        }
Ejemplo n.º 36
0
        /// <summary>
        /// Add labeled TextBox rectangle into PDF document
        /// </summary>
        /// <param name="label">Label of the TextBox</param>
        /// <param name="currentY">Y position of the TextBox</param>
        /// <param name="textBoxHeight">TextBox height</param>
        /// <param name="lineWidth">TextBox border width</param>
        /// <param name="spacingAfterLabel">Size of the gap between label and TextBox</param>
        /// <param name="borderColor">Border color of the TextBox rectangle</param>
        /// <returns>Returns actual Y position in the PDF document</returns>
        internal float AddTextBox(string label, float currentY, float textBoxHeight, float lineWidth, float spacingAfterLabel, System.Drawing.Color borderColor)
        {
            //simulate the creation of columnText to get its height
            ColumnText ct = GetColumnText(new Paragraph(GetBoldText(label)), LX, currentY, true);

            //if there is no space for labeled TextBox, add new page to PDF document
            if (AddPage(currentY, spacingAfterLabel + (currentY - ct.YLine) + textBoxHeight))
            {
                currentY = NewPage();
            }
            ct       = GetColumnText(new Paragraph(GetBoldText(label)), LX, currentY, false);
            currentY = ct.YLine - spacingAfterLabel;

            ContentByte.SetLineWidth(lineWidth);
            ContentByte.SetColorStroke(new BaseColor(borderColor));
            ContentByte.Rectangle(LX, currentY, RX - RX / 3, -textBoxHeight);
            ContentByte.Stroke();
            currentY -= textBoxHeight;

            return(NewPage(currentY, 0));
        }
Ejemplo n.º 37
0
        /// <summary>
        /// Adds cell into provided PDF table
        /// </summary>
        /// <param name="table">PDF table</param>
        /// <param name="text">Cell content</param>
        /// <param name="borderColor">Cell border color</param>
        internal void AddCell(PdfPTable table, string text, System.Drawing.Color borderColor)
        {
            PdfPCell cell = GetCell(borderColor, text);

            table.AddCell(cell);
        }
Ejemplo n.º 38
0
        private void LoadMenu()
        {
            //key
            var key = new Menu("Key", "Key");
            {
                key.AddItem(new MenuItem("ComboActive", "Combo!", true).SetValue(new KeyBind(32, KeyBindType.Press)));
                key.AddItem(new MenuItem("HarassActive", "Harass!", true).SetValue(new KeyBind("C".ToCharArray()[0], KeyBindType.Press)));
                key.AddItem(new MenuItem("HarassActiveT", "Harass (toggle)!", true).SetValue(new KeyBind("N".ToCharArray()[0], KeyBindType.Toggle)));
                key.AddItem(new MenuItem("LaneClearActive", "Farm!", true).SetValue(new KeyBind("V".ToCharArray()[0], KeyBindType.Press)));
                key.AddItem(new MenuItem("Escape", "Escape with E", true).SetValue(new KeyBind("Z".ToCharArray()[0], KeyBindType.Press)));
                //add to menu
                menu.AddSubMenu(key);
            }

            //Combo menu:
            var combo = new Menu("Combo", "Combo");
            {
                combo.AddItem(new MenuItem("UseQCombo", "Use Q", true).SetValue(true));
                combo.AddItem(new MenuItem("UseWCombo", "Use W", true).SetValue(true));
                combo.AddItem(new MenuItem("UseECombo", "Use E", true).SetValue(true));
                combo.AddItem(new MenuItem("UseRCombo", "Use R", true).SetValue(true));
                //add to menu
                menu.AddSubMenu(combo);
            }
            //Harass menu:
            var harass = new Menu("Harass", "Harass");
            {
                harass.AddItem(new MenuItem("UseQHarass", "Use Q", true).SetValue(true));
                harass.AddItem(new MenuItem("UseWHarass", "Use W", true).SetValue(false));
                harass.AddItem(new MenuItem("UseEHarass", "Use E", true).SetValue(true));
                harass.AddItem(new MenuItem("disableAA", "Disable AA", true).SetValue(true));
                combo.AddSubMenu(HitChanceManager.AddHitChanceMenuCombo(true, false, true, false));
                ManaManager.AddManaManagertoMenu(harass, "Harass", 30);
                //add to menu
                menu.AddSubMenu(harass);
            }
            //Farming menu:
            var farm = new Menu("Farm", "Farm");
            {
                farm.AddItem(new MenuItem("UseQFarm", "Use Q", true).SetValue(false));
                farm.AddItem(new MenuItem("UseWFarm", "Use W", true).SetValue(false));
                farm.AddItem(new MenuItem("UseEFarm", "Use E", true).SetValue(false));
                harass.AddSubMenu(HitChanceManager.AddHitChanceMenuHarass(true, false, true, false));
                ManaManager.AddManaManagertoMenu(farm, "LaneClear", 30);
                //add to menu
                menu.AddSubMenu(farm);
            }

            //Misc Menu:
            var misc = new Menu("Misc", "Misc");
            {
                misc.AddSubMenu(AoeSpellManager.AddHitChanceMenuCombo(true, false, true, true));
                misc.AddItem(new MenuItem("E_GapCloser", "Use E for GapCloser", true).SetValue(true));
                misc.AddItem(new MenuItem("smartKS", "Smart KS", true).SetValue(true));
                misc.AddItem(new MenuItem("Auto_Bloom", "Auto bloom Plant if Enemy near", true).SetValue(true));
                //add to menu
                menu.AddSubMenu(misc);
            }

            //Drawings menu:
            var drawing = new Menu("Drawings", "Drawings");
            {
                drawing.AddItem(new MenuItem("Draw_Disabled", "Disable All", true).SetValue(false));
                drawing.AddItem(new MenuItem("Draw_Q", "Draw Q", true).SetValue(true));
                drawing.AddItem(new MenuItem("Draw_W", "Draw Q", true).SetValue(true));
                drawing.AddItem(new MenuItem("Draw_E", "Draw E", true).SetValue(true));
                drawing.AddItem(new MenuItem("Draw_R", "Draw R", true).SetValue(true));

                MenuItem drawComboDamageMenu = new MenuItem("Draw_ComboDamage", "Draw Combo Damage", true).SetValue(true);
                MenuItem drawFill            = new MenuItem("Draw_Fill", "Draw Combo Damage Fill", true).SetValue(new Circle(true, Color.FromArgb(90, 255, 169, 4)));
                drawing.AddItem(drawComboDamageMenu);
                drawing.AddItem(drawFill);
                DamageIndicator.DamageToUnit      = GetComboDamage;
                DamageIndicator.Enabled           = drawComboDamageMenu.GetValue <bool>();
                DamageIndicator.Fill              = drawFill.GetValue <Circle>().Active;
                DamageIndicator.FillColor         = drawFill.GetValue <Circle>().Color;
                drawComboDamageMenu.ValueChanged +=
                    delegate(object sender, OnValueChangeEventArgs eventArgs)
                {
                    DamageIndicator.Enabled = eventArgs.GetNewValue <bool>();
                };
                drawFill.ValueChanged +=
                    delegate(object sender, OnValueChangeEventArgs eventArgs)
                {
                    DamageIndicator.Fill      = eventArgs.GetNewValue <Circle>().Active;
                    DamageIndicator.FillColor = eventArgs.GetNewValue <Circle>().Color;
                };
                menu.AddSubMenu(drawing);
            }

            var customMenu = new Menu("Custom Perma Show", "Custom Perma Show");
            {
                var myCust = new CustomPermaMenu();
                customMenu.AddItem(new MenuItem("custMenu", "Move Menu", true).SetValue(new KeyBind("L".ToCharArray()[0], KeyBindType.Press)));
                customMenu.AddItem(new MenuItem("enableCustMenu", "Enabled", true).SetValue(true));
                customMenu.AddItem(myCust.AddToMenu("Combo Active: ", "ComboActive"));
                customMenu.AddItem(myCust.AddToMenu("Harass Active: ", "HarassActive"));
                customMenu.AddItem(myCust.AddToMenu("Harass(T) Active: ", "HarassActiveT"));
                customMenu.AddItem(myCust.AddToMenu("Laneclear Active: ", "LaneClearActive"));
                customMenu.AddItem(myCust.AddToMenu("Escape Active: ", "Escape"));
                menu.AddSubMenu(customMenu);
            }
        }
Ejemplo n.º 39
0
        /// <summary>
        /// 画一条由两条连在一起构成的随机正弦函数曲线作干扰线
        /// </summary>
        /// <param name="image"></param>
        /// <param name="color"></param>
        private static void DrawCurve(System.Drawing.Bitmap image, System.Drawing.Color color)
        {
            int fontSize = image.Height / 3;

            int imageH = image.Height;
            int imageL = image.Width;

            System.Random rand = new System.Random();
            double        A    = rand.Next(1, imageH / 2);                                    // 振幅
            double        b    = rand.Next(-imageH / 4, imageH / 4);                          // Y轴方向偏移量
            double        f    = rand.Next(-imageH / 4, imageH / 4);                          // X轴方向偏移量
            double        T    = rand.Next(System.Convert.ToInt32(imageH * 1.5), imageL * 2); // 周期
            double        w    = (2 * System.Math.PI) / T;
            double        py   = 0;

            int    px1 = 0;                                                                                     // 曲线横坐标起始位置
            int    px2 = rand.Next(System.Convert.ToInt32(imageL / 2), System.Convert.ToInt32(imageL * 0.667)); // 曲线横坐标结束位置
            double px;

            for (px = px1; px <= px2; px += 0.9)
            {
                if (w != 0)
                {
                    py = A * System.Math.Sin(w * px + f) + b + imageH / 2;  // y = Asin(ωx+φ) + b
                    int i = (int)((fontSize - 6) / 4);
                    while (i > 0)
                    {
                        int w2 = System.Convert.ToInt32(px + i);
                        if (w2 < 0)
                        {
                            w2 = 0;
                        }
                        if (w2 >= image.Width)
                        {
                            w2 = image.Width - 1;
                        }
                        int h2 = System.Convert.ToInt32(py + i);
                        if (h2 < 0)
                        {
                            h2 = 0;
                        }
                        if (h2 >= image.Height)
                        {
                            h2 = image.Height - 1;
                        }
                        image.SetPixel(w2, h2, color);  // 这里画像素点比imagettftext和imagestring性能要好很多
                        i--;
                    }
                }
            }

            A   = rand.Next(1, imageH / 2);                                    // 振幅
            f   = rand.Next(-imageH / 4, imageH / 4);                          // X轴方向偏移量
            T   = rand.Next(System.Convert.ToInt32(imageH * 1.5), imageL * 2); // 周期
            w   = (2 * System.Math.PI) / T;
            b   = py - A * System.Math.Sin(w * px + f) - imageH / 2;
            px1 = px2;
            px2 = imageL;
            for (px = px1; px <= px2; px += 0.9)
            {
                if (w != 0)
                {
                    py = A * System.Math.Sin(w * px + f) + b + imageH / 2;  // y = Asin(ωx+φ) + b
                    int i = (int)((fontSize - 8) / 4);
                    while (i > 0)
                    {
                        int w2 = System.Convert.ToInt32(px + i);
                        if (w2 < 0)
                        {
                            w2 = 0;
                        }
                        if (w2 >= image.Width)
                        {
                            w2 = image.Width - 1;
                        }
                        int h2 = System.Convert.ToInt32(py + i);
                        if (h2 < 0)
                        {
                            h2 = 0;
                        }
                        if (h2 >= image.Height)
                        {
                            h2 = image.Height - 1;
                        }
                        image.SetPixel(w2, h2, color);  // 这里(while)循环画像素点比imagettftext和imagestring用字体大小一次画出(不用这while循环)性能要好很多
                        i--;
                    }
                }
            }
        }
Ejemplo n.º 40
0
        private void LoadMenu()
        {
            //key
            var key = new Menu("Key", "Key");
            {
                key.AddItem(new MenuItem("ComboActive", "Combo!", true).SetValue(new KeyBind(32, KeyBindType.Press)));
                key.AddItem(new MenuItem("HarassActive", "Harass!", true).SetValue(new KeyBind("C".ToCharArray()[0], KeyBindType.Press)));
                key.AddItem(new MenuItem("HarassActiveT", "Harass (toggle)!", true).SetValue(new KeyBind("N".ToCharArray()[0], KeyBindType.Toggle)));
                key.AddItem(new MenuItem("LaneClearActive", "Farm!", true).SetValue(new KeyBind("V".ToCharArray()[0], KeyBindType.Press)));
                key.AddItem(new MenuItem("snipe", "W/Q Snipe", true).SetValue(new KeyBind("T".ToCharArray()[0], KeyBindType.Press)));
                key.AddItem(new MenuItem("escape", "RUN FOR YOUR LIFE!", true).SetValue(new KeyBind("Z".ToCharArray()[0], KeyBindType.Press)));
                //add to menu
                menu.AddSubMenu(key);
            }

            //spell menu
            var spellMenu = new Menu("SpellMenu", "SpellMenu");
            {
                var qMenu = new Menu("QMenu", "QMenu");
                {
                    qMenu.AddItem(new MenuItem("qHit", "Combo HitChance", true).SetValue(new Slider(3, 1, 3)));
                    qMenu.AddItem(new MenuItem("qHit2", "Harass HitChance", true).SetValue(new Slider(3, 1, 4)));
                    qMenu.AddItem(new MenuItem("detonateQ", "Auto Detonate Q", true).SetValue(true));
                    qMenu.AddItem(new MenuItem("detonateQ2", "Pop Q Behind Enemy", true).SetValue(true));
                    spellMenu.AddSubMenu(qMenu);
                }

                var wMenu = new Menu("WMenu", "WMenu");
                {
                    wMenu.AddItem(new MenuItem("wallKill", "Wall Enemy on killable", true).SetValue(true));
                    spellMenu.AddSubMenu(wMenu);
                }

                var rMenu = new Menu("RMenu", "RMenu");
                {
                    rMenu.AddItem(new MenuItem("checkR", "Auto turn off R", true).SetValue(true));
                    spellMenu.AddSubMenu(rMenu);
                }

                menu.AddSubMenu(spellMenu);
            }

            //Combo menu:
            var combo = new Menu("Combo", "Combo");
            {
                combo.AddItem(new MenuItem("selected", "Focus Selected Target", true).SetValue(true));
                combo.AddItem(new MenuItem("UseQCombo", "Use Q", true).SetValue(true));
                combo.AddItem(new MenuItem("UseWCombo", "Use W", true).SetValue(true));
                combo.AddItem(new MenuItem("UseECombo", "Use E", true).SetValue(true));
                combo.AddItem(new MenuItem("UseRCombo", "Use R", true).SetValue(true));
                menu.AddSubMenu(combo);
            }

            //Harass menu:
            var harass = new Menu("Harass", "Harass");
            {
                harass.AddItem(new MenuItem("UseQHarass", "Use Q", true).SetValue(false));
                harass.AddItem(new MenuItem("UseWHarass", "Use W", true).SetValue(false));
                harass.AddItem(new MenuItem("UseEHarass", "Use E", true).SetValue(true));
                harass.AddItem(new MenuItem("UseRHarass", "Use R", true).SetValue(true));
                menu.AddSubMenu(harass);
            }

            //Farming menu:
            var farm = new Menu("Farm", "Farm");
            {
                farm.AddItem(new MenuItem("UseQFarm", "Use Q", true).SetValue(false));
                farm.AddItem(new MenuItem("UseEFarm", "Use E", true).SetValue(false));
                farm.AddItem(new MenuItem("UseRFarm", "Use R", true).SetValue(false));
                menu.AddSubMenu(farm);
            }

            //Misc Menu:
            var misc = new Menu("Misc", "Misc");
            {
                misc.AddItem(new MenuItem("UseInt", "Use Spells to Interrupt", true).SetValue(true));
                misc.AddItem(new MenuItem("UseGap", "Use W for GapCloser", true).SetValue(true));
                misc.AddItem(new MenuItem("smartKS", "Use Smart KS System", true).SetValue(true));
                menu.AddSubMenu(misc);
            }

            //draw
            //Drawings menu:
            var draw = new Menu("Drawings", "Drawings"); {
                draw.AddItem(new MenuItem("QRange", "Q range", true).SetValue(new Circle(false, Color.FromArgb(100, 255, 0, 255))));
                draw.AddItem(new MenuItem("WRange", "W range", true).SetValue(new Circle(true, Color.FromArgb(100, 255, 0, 255))));
                draw.AddItem(new MenuItem("ERange", "E range", true).SetValue(new Circle(false, Color.FromArgb(100, 255, 0, 255))));
                draw.AddItem(new MenuItem("RRange", "R range", true).SetValue(new Circle(false, Color.FromArgb(100, 255, 0, 255))));

                MenuItem drawComboDamageMenu = new MenuItem("Draw_ComboDamage", "Draw Combo Damage", true).SetValue(true);
                MenuItem drawFill            = new MenuItem("Draw_Fill", "Draw Combo Damage Fill", true).SetValue(new Circle(true, Color.FromArgb(90, 255, 169, 4)));
                draw.AddItem(drawComboDamageMenu);
                draw.AddItem(drawFill);
                DamageIndicator.DamageToUnit      = GetComboDamage;
                DamageIndicator.Enabled           = drawComboDamageMenu.GetValue <bool>();
                DamageIndicator.Fill              = drawFill.GetValue <Circle>().Active;
                DamageIndicator.FillColor         = drawFill.GetValue <Circle>().Color;
                drawComboDamageMenu.ValueChanged +=
                    delegate(object sender, OnValueChangeEventArgs eventArgs)
                {
                    DamageIndicator.Enabled = eventArgs.GetNewValue <bool>();
                };
                drawFill.ValueChanged +=
                    delegate(object sender, OnValueChangeEventArgs eventArgs)
                {
                    DamageIndicator.Fill      = eventArgs.GetNewValue <Circle>().Active;
                    DamageIndicator.FillColor = eventArgs.GetNewValue <Circle>().Color;
                };
                menu.AddSubMenu(draw);
            }
        }
Ejemplo n.º 41
0
        /// <summary>
        /// Gets a font color for a given background color
        /// </summary>
        /// <param name="color">A background color that requires a font color</param>
        /// <returns>A font color for a given background color</returns>
        public static System.Drawing.Color GetFontColor(this System.Drawing.Color color)
        {
            System.Drawing.Color result;

            if (color.B < 26)
            {
                if (color.R < 26)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 77)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 128)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 179)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 230)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
            }
            else if (color.B < 77)
            {
                if (color.R < 26)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 77)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 128)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 179)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 230)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
            }
            else if (color.B < 128)
            {
                if (color.R < 26)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 77)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 128)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 179)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 230)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
            }
            else if (color.B < 179)
            {
                if (color.R < 26)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 77)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 128)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 179)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 230)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
            }
            else if (color.B < 230)
            {
                if (color.R < 26)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 77)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 128)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 179)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 230)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
            }
            else
            {
                if (color.R < 26)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 77)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 128)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 179)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.White;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else if (color.R < 230)
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
                else
                {
                    if (color.G < 26)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 77)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 128)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 179)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else if (color.G < 230)
                    {
                        result = System.Drawing.Color.Black;
                    }
                    else
                    {
                        result = System.Drawing.Color.Black;
                    }
                }
            }

            return(result);
        }
Ejemplo n.º 42
0
        public static void DrawLineRectangle(Vector3 start2, Vector3 end2, int radius, float width, System.Drawing.Color color)
        {
            Vector2 start = start2.To2D();
            Vector2 end   = end2.To2D();
            var     dir   = (end - start).Normalized();
            var     pDir  = dir.Perpendicular();

            var rightStartPos = start + pDir * radius;
            var leftStartPos  = start - pDir * radius;
            var rightEndPos   = end + pDir * radius;
            var leftEndPos    = end - pDir * radius;

            var rStartPos = Drawing.WorldToScreen(new Vector3(rightStartPos.X, rightStartPos.Y, ObjectManager.Player.Position.Z));
            var lStartPos = Drawing.WorldToScreen(new Vector3(leftStartPos.X, leftStartPos.Y, ObjectManager.Player.Position.Z));
            var rEndPos   = Drawing.WorldToScreen(new Vector3(rightEndPos.X, rightEndPos.Y, ObjectManager.Player.Position.Z));
            var lEndPos   = Drawing.WorldToScreen(new Vector3(leftEndPos.X, leftEndPos.Y, ObjectManager.Player.Position.Z));

            Drawing.DrawLine(rStartPos, rEndPos, width, color);
            Drawing.DrawLine(lStartPos, lEndPos, width, color);
            Drawing.DrawLine(rStartPos, lStartPos, width, color);
            Drawing.DrawLine(lEndPos, rEndPos, width, color);
        }
    public static IEnumerable <System.Drawing.Color> Range(this System.Drawing.Color firstColor, System.Drawing.Color lastColor, int count)
    {
        float stepHueClockwise        = GetStepping(firstColor.GetHue(), lastColor.GetHue(), count, Direction.Clockwise);
        float stepHueCounterClockwise = GetStepping(firstColor.GetHue(), lastColor.GetHue(), count, Direction.CounterClockwise);

        if (Math.Abs(stepHueClockwise) >= Math.Abs(stepHueCounterClockwise))
        {
            return(Range(firstColor, lastColor, count, Direction.Clockwise));
        }
        else
        {
            return(Range(firstColor, lastColor, count, Direction.CounterClockwise));
        }
    }
Ejemplo n.º 44
0
        /// <summary>
        /// 正弦曲线Wave扭曲图片
        /// </summary>
        /// <param name="srcBmp">图片路径</param>
        /// <param name="backColor">背景颜色。</param>
        /// <param name="bXDir">扭曲方向,水平方向扭曲为 True;垂直方向为 False。</param>
        /// <param name="dMultValue">波形的幅度倍数,越大扭曲的程度越高,一般为3</param>
        /// <param name="dPhase">波形的起始相位,取值区间[0-2*PI)</param>
        /// <returns></returns>
        private static System.Drawing.Bitmap TwistImage(System.Drawing.Bitmap srcBmp, System.Drawing.Color backColor, bool bXDir, double dMultValue, double dPhase)
        {
            System.Drawing.Bitmap destBmp = new System.Drawing.Bitmap(srcBmp.Width, srcBmp.Height);

            // 将位图背景填充为白色
            System.Drawing.Graphics graph = System.Drawing.Graphics.FromImage(destBmp);
            //graph.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.White), 0, 0, destBmp.Width, destBmp.Height);
            graph.Clear(backColor);
            graph.Dispose();

            double dBaseAxisLen = bXDir ? (double)destBmp.Height : (double)destBmp.Width;

            for (int i = 0; i < destBmp.Width; i++)
            {
                for (int j = 0; j < destBmp.Height; j++)
                {
                    double dx = bXDir ? (PI2 * (double)j) / dBaseAxisLen : (PI2 * (double)i) / dBaseAxisLen;
                    dx += dPhase;
                    double dy = System.Math.Sin(dx);

                    // 取得当前点的颜色
                    int nOldX, nOldY;
                    nOldX = bXDir ? i + (int)(dy * dMultValue) : i;
                    nOldY = bXDir ? j : j + (int)(dy * dMultValue);

                    System.Drawing.Color color = srcBmp.GetPixel(i, j);
                    if (nOldX >= 0 && nOldX < destBmp.Width &&
                        nOldY >= 0 && nOldY < destBmp.Height)
                    {
                        destBmp.SetPixel(nOldX, nOldY, color);
                    }
                }
            }

            return(destBmp);
        }
Ejemplo n.º 45
0
        // System.Drawing.Color

        public static SKColor ToSKColor(this System.Drawing.Color color)
        {
            return((SKColor)(uint)color.ToArgb());
        }
Ejemplo n.º 46
0
 /// <summary>
 /// Gets a color that is the inverse of the given color
 /// </summary>
 /// <param name="color">A color to invert</param>
 /// <returns>A color that is the inverse of the given color</returns>
 public static System.Drawing.Color ToInverse(this System.Drawing.Color color)
 {
     return(System.Drawing.Color.FromArgb(255 - color.R, 255 - color.G, 255 - color.B));
 }
Ejemplo n.º 47
0
 /// <summary>
 /// Recibe el color de fondo del control
 /// </summary>
 /// <param name="queColor">El color a ser aplicado</param>
 public TextBoxColores(System.Drawing.Color queColor)
 {
     this.BackColor = queColor;
 }
    public static IEnumerable <System.Drawing.Color> Range(this System.Drawing.Color firstColor, System.Drawing.Color lastColor, int count, Direction hueDirection)
    {
        var color = firstColor;

        if (count <= 0)
        {
            yield break;
        }
        if (count == 1)
        {
            yield return(firstColor);
        }
        float startingHue    = color.GetHue();
        float stepHue        = GetStepping(firstColor.GetHue(), lastColor.GetHue(), count - 1, hueDirection);
        var   stepSaturation = (lastColor.GetSaturation() - firstColor.GetSaturation()) / (count - 1);
        var   stepBrightness = (lastColor.GetBrightness() - firstColor.GetBrightness()) / (count - 1);
        var   stepAlpha      = (lastColor.A - firstColor.A) / (count - 1.0);

        for (int i = 1; i < count; i++)
        {
            yield return(color);

            var hueValue = startingHue + stepHue * i;
            if (hueValue > 360)
            {
                hueValue -= 360;
            }
            if (hueValue < 0)
            {
                hueValue = 360 + hueValue;
            }
            color = FromAhsb(
                Clamp((int)(color.A + stepAlpha), 0, 255),
                hueValue,
                Clamp(color.GetSaturation() + stepSaturation, 0, 1),
                Clamp(color.GetBrightness() + stepBrightness, 0, 1));
        }
        yield return(lastColor);
    }
Ejemplo n.º 49
0
        private void InitMenu()
        {
            config = new Menu("Ezreal ", "Ezreal", true);
            // Target Selector
            Menu menuTS = new Menu("Selector", "tselect");

            TargetSelector.AddToMenu(menuTS);
            config.AddSubMenu(menuTS);
            // Orbwalker
            Menu menuOrb = new Menu("Orbwalker", "orbwalker");

            orbwalker = new Orbwalking.Orbwalker(menuOrb);
            config.AddSubMenu(menuOrb);
            // Draw settings
            Menu menuD = new Menu("Drawings ", "dsettings");

            menuD.AddItem(new MenuItem("drawqq", "Draw Q range", true))
            .SetValue(new Circle(false, Color.FromArgb(180, 100, 146, 166)));
            menuD.AddItem(new MenuItem("drawww", "Draw W range", true))
            .SetValue(new Circle(false, Color.FromArgb(180, 100, 146, 166)));
            menuD.AddItem(new MenuItem("drawee", "Draw E range", true))
            .SetValue(new Circle(false, Color.FromArgb(180, 100, 146, 166)));
            menuD.AddItem(new MenuItem("drawrr", "Draw R range", true))
            .SetValue(new Circle(false, Color.FromArgb(180, 100, 146, 166)));
            menuD.AddItem(new MenuItem("drawcombo", "Draw combo damage", true)).SetValue(true);
            menuD.AddItem(new MenuItem("Calcq", "   Calc Q", true)).SetValue(true);
            menuD.AddItem(new MenuItem("Calcw", "   Calc W", true)).SetValue(true);
            menuD.AddItem(new MenuItem("Calce", "   Calc E", true)).SetValue(true);
            menuD.AddItem(new MenuItem("Calcr", "   Calc R", true)).SetValue(true);
            config.AddSubMenu(menuD);
            // Combo Settings
            Menu menuC = new Menu("Combo ", "csettings");

            menuC.AddItem(new MenuItem("useq", "Use Q", true)).SetValue(true);
            menuC.AddItem(new MenuItem("usew", "Use W", true)).SetValue(true);
            menuC.AddItem(new MenuItem("usee", "Use E", true)).SetValue(true);
            menuC.AddItem(new MenuItem("useekill", "   Only for kill", true)).SetValue(true);
            menuC.AddItem(new MenuItem("user", "Use R in 1v1", true)).SetValue(true);
            menuC.AddItem(new MenuItem("usermin", "   Min range", true)).SetValue(new Slider(800, 0, 1500));
            menuC.AddItem(new MenuItem("usertf", "R min enemy in teamfight", true)).SetValue(new Slider(3, 1, 5));
            menuC.AddItem(new MenuItem("selected", "Focus Selected target")).SetValue(true);
            menuC.AddItem(new MenuItem("useIgnite", "Use Ignite", true)).SetValue(true);
            menuC = ItemHandler.addItemOptons(menuC);
            config.AddSubMenu(menuC);
            // Harass Settings
            Menu menuH = new Menu("Harass ", "Hsettings");

            menuH.AddItem(new MenuItem("useqH", "Use Q", true)).SetValue(true);
            menuH.AddItem(new MenuItem("usewH", "Use W", true)).SetValue(true);
            menuH.AddItem(new MenuItem("minmanaH", "Keep X% mana", true)).SetValue(new Slider(1, 1, 100));
            config.AddSubMenu(menuH);
            // LaneClear Settings
            Menu menuLC = new Menu("LaneClear ", "Lcsettings");

            menuLC.AddItem(new MenuItem("useqLC", "Use Q", true)).SetValue(true);
            menuLC.AddItem(new MenuItem("minmana", "Keep X% mana", true)).SetValue(new Slider(1, 1, 100));
            config.AddSubMenu(menuLC);
            // Lasthit Settings
            Menu menuLH = new Menu("Lasthit ", "Lasthcsettings");

            menuLH.AddItem(new MenuItem("useqLH", "Use Q", true)).SetValue(true);
            menuLH.AddItem(new MenuItem("qLHDamage", "   Q lasthit damage percent", true))
            .SetValue(new Slider(1, 1, 100));
            menuLH.AddItem(new MenuItem("minmanaLH", "Keep X% mana", true)).SetValue(new Slider(1, 1, 100));
            config.AddSubMenu(menuLH);
            Menu menuM = new Menu("Misc ", "Msettings");

            menuM = Jungle.addJungleOptions(menuM);

            menuM.AddItem(new MenuItem("DmgType", "Damage Type", true))
            .SetValue(new StringList(new[] { "AP", "AD" }, 0));
            Menu autolvlM = new Menu("AutoLevel", "AutoLevel");

            autoLeveler = new AutoLeveler(autolvlM);
            menuM.AddSubMenu(autolvlM);
            Menu autoQ = new Menu("Auto Harass", "autoQ");

            autoQ.AddItem(
                new MenuItem("EzAutoQ", "Auto Q toggle", true).SetShared()
                .SetValue(new KeyBind('H', KeyBindType.Toggle)))
            .SetFontStyle(System.Drawing.FontStyle.Bold, SharpDX.Color.Orange);
            autoQ.AddItem(new MenuItem("EzminmanaaQ", "Keep X% mana", true)).SetValue(new Slider(40, 1, 100));
            autoQ.AddItem(new MenuItem("qHit", "Q hitChance", true).SetValue(new Slider(4, 1, 4)));
            autoQ.AddItem(new MenuItem("ShowState", "Show always", true)).SetValue(true);
            menuM.AddSubMenu(autoQ);
            config.AddSubMenu(menuM);
            config.Item("EzAutoQ", true).Permashow(true, "Auto Q");
            config.AddItem(new MenuItem("packets", "Use Packets")).SetValue(false);
            config.AddItem(new MenuItem("UnderratedAIO", "by Soresu v" + Program.version.ToString().Replace(",", ".")));
            config.AddToMainMenu();
        }
Ejemplo n.º 50
0
 public CalendarResource(object data)
 {
     DataItem          = data;
     ResourceBackColor = System.Drawing.Color.CornflowerBlue;
     ResourceFontColor = System.Drawing.Color.Black;
 }
Ejemplo n.º 51
0
 public static System.Windows.Media.Color ToWPFColor(this System.Drawing.Color color)
 {
     return(System.Windows.Media.Color.FromArgb(color.A, color.R, color.G, color.B));
 }
Ejemplo n.º 52
0
        //Load Menu
        private void LoadMenu()
        {
            //key
            var key = new Menu("Key", "Key"); {
                key.AddItem(new MenuItem("ComboActive", "Combo!", true).SetValue(new KeyBind(32, KeyBindType.Press)));
                key.AddItem(new MenuItem("HarassActive", "Harass!", true).SetValue(new KeyBind("C".ToCharArray()[0], KeyBindType.Press)));
                key.AddItem(new MenuItem("HarassActiveT", "Harass (toggle)!", true).SetValue(new KeyBind("N".ToCharArray()[0], KeyBindType.Toggle)));
                key.AddItem(new MenuItem("LaneClearActive", "Farm!", true).SetValue(new KeyBind("V".ToCharArray()[0], KeyBindType.Press)));
                key.AddItem(new MenuItem("charmCombo", "Q if Charmed in Combo", true).SetValue(new KeyBind("I".ToCharArray()[0], KeyBindType.Toggle)));
                //add to menu
                menu.AddSubMenu(key);
            }

            //Combo menu:
            var combo = new Menu("Combo", "Combo");
            {
                combo.AddItem(new MenuItem("selected", "Focus Selected Target", true).SetValue(true));
                combo.AddItem(new MenuItem("UseQCombo", "Use Q", true).SetValue(true));
                combo.AddItem(new MenuItem("qHit", "Q/E HitChance", true).SetValue(new Slider(3, 1, 4)));
                combo.AddItem(new MenuItem("UseWCombo", "Use W", true).SetValue(true));
                combo.AddItem(new MenuItem("UseECombo", "Use E", true).SetValue(true));
                combo.AddItem(new MenuItem("UseRCombo", "Use R", true).SetValue(true));
                combo.AddItem(new MenuItem("rSpeed", "Use All R fast Duel", true).SetValue(true));
                //add to menu
                menu.AddSubMenu(combo);
            }
            //Harass menu:
            var harass = new Menu("Harass", "Harass");
            {
                harass.AddItem(new MenuItem("UseQHarass", "Use Q", true).SetValue(true));
                harass.AddItem(new MenuItem("qHit2", "Q/E HitChance", true).SetValue(new Slider(3, 1, 4)));
                harass.AddItem(new MenuItem("UseWHarass", "Use W", true).SetValue(false));
                harass.AddItem(new MenuItem("UseEHarass", "Use E", true).SetValue(true));
                harass.AddItem(new MenuItem("longQ", "Cast Long range Q", true).SetValue(true));
                harass.AddItem(new MenuItem("charmHarass", "Only Q if Charmed", true).SetValue(true));
                //add to menu
                menu.AddSubMenu(harass);
            }
            //Farming menu:
            var farm = new Menu("Farm", "Farm");
            {
                farm.AddItem(new MenuItem("UseQFarm", "Use Q", true).SetValue(false));
                farm.AddItem(new MenuItem("UseWFarm", "Use W", true).SetValue(false));
                //add to menu
                menu.AddSubMenu(farm);
            }

            //Misc Menu:
            var misc = new Menu("Misc", "Misc");
            {
                misc.AddItem(new MenuItem("UseInt", "Use E to Interrupt", true).SetValue(true));
                misc.AddItem(new MenuItem("UseGap", "Use E for GapCloser", true).SetValue(true));
                misc.AddItem(new MenuItem("mana", "Mana check before use R", true).SetValue(true));
                misc.AddItem(new MenuItem("dfgCharm", "Require Charmed to DFG", true).SetValue(true));
                misc.AddItem(new MenuItem("EQ", "Use Q onTop of E", true).SetValue(true));
                misc.AddItem(new MenuItem("smartKS", "Smart KS", true).SetValue(true));
                misc.AddItem(new MenuItem("Prediction_Check_Off", "Use Prediciton Mode 2", true).SetValue(false));
                //add to menu
                menu.AddSubMenu(misc);
            }

            //Drawings menu:
            var drawing = new Menu("Drawings", "Drawings");
            {
                drawing.AddItem(
                    new MenuItem("QRange", "Q range", true).SetValue(new Circle(false, Color.FromArgb(100, 255, 0, 255))));
                drawing.AddItem(
                    new MenuItem("WRange", "W range", true).SetValue(new Circle(true, Color.FromArgb(100, 255, 0, 255))));
                drawing.AddItem(
                    new MenuItem("ERange", "E range", true).SetValue(new Circle(false, Color.FromArgb(100, 255, 0, 255))));
                drawing.AddItem(
                    new MenuItem("RRange", "R range", true).SetValue(new Circle(false, Color.FromArgb(100, 255, 0, 255))));
                drawing.AddItem(
                    new MenuItem("cursor", "Draw R Dash Range", true).SetValue(new Circle(false, Color.FromArgb(100, 255, 0, 255))));
                drawing.AddItem(
                    new MenuItem("Draw_Mode", "Draw E Mode", true).SetValue(new Circle(false, Color.FromArgb(100, 255, 0, 255))));

                MenuItem drawComboDamageMenu = new MenuItem("Draw_ComboDamage", "Draw Combo Damage", true).SetValue(true);
                MenuItem drawFill            = new MenuItem("Draw_Fill", "Draw Combo Damage Fill", true).SetValue(new Circle(true, Color.FromArgb(90, 255, 169, 4)));
                drawing.AddItem(drawComboDamageMenu);
                drawing.AddItem(drawFill);
                DamageIndicator.DamageToUnit      = GetComboDamage;
                DamageIndicator.Enabled           = drawComboDamageMenu.GetValue <bool>();
                DamageIndicator.Fill              = drawFill.GetValue <Circle>().Active;
                DamageIndicator.FillColor         = drawFill.GetValue <Circle>().Color;
                drawComboDamageMenu.ValueChanged +=
                    delegate(object sender, OnValueChangeEventArgs eventArgs)
                {
                    DamageIndicator.Enabled = eventArgs.GetNewValue <bool>();
                };
                drawFill.ValueChanged +=
                    delegate(object sender, OnValueChangeEventArgs eventArgs)
                {
                    DamageIndicator.Fill      = eventArgs.GetNewValue <Circle>().Active;
                    DamageIndicator.FillColor = eventArgs.GetNewValue <Circle>().Color;
                };
                menu.AddSubMenu(drawing);
            }
        }
Ejemplo n.º 53
0
        private static void Game_OnGameLoad(EventArgs args)
        {
            //Thanks to Esk0r
            Player = ObjectManager.Player;

            //check to see if correct champ
            if (Player.BaseSkinName != ChampionName)
            {
                return;
            }

            //intalize spell
            Q = new Spell(SpellSlot.Q, 600);
            W = new Spell(SpellSlot.W, 0);
            E = new Spell(SpellSlot.E, 575);
            R = new Spell(SpellSlot.R, 700);

            R.SetSkillshot(0.25f, 175, 700, false, SkillshotType.SkillshotCircle);

            SpellList.Add(Q);
            SpellList.Add(W);
            SpellList.Add(E);
            SpellList.Add(R);

            //Create the menu
            menu = new Menu(ChampionName, ChampionName, true);

            //Orbwalker submenu
            menu.AddSubMenu(new Menu("走砍", "Orbwalking"));

            //Target selector
            var targetSelectorMenu = new Menu("目标选择", "Target Selector");

            SimpleTs.AddToMenu(targetSelectorMenu);
            menu.AddSubMenu(targetSelectorMenu);

            //Orbwalk
            Orbwalker = new Orbwalking.Orbwalker(menu.SubMenu("Orbwalking"));

            //Combo menu:
            menu.AddSubMenu(new Menu("连招", "Combo"));
            menu.SubMenu("Combo").AddItem(new MenuItem("UseQCombo", "使用Q").SetValue(true));
            menu.SubMenu("Combo").AddItem(new MenuItem("UseWCombo", "使用W").SetValue(true));
            menu.SubMenu("Combo").AddItem(new MenuItem("UseECombo", "使用E").SetValue(true));
            menu.SubMenu("Combo").AddItem(new MenuItem("UseRCombo", "使用R").SetValue(true));
            menu.SubMenu("Combo").AddItem(new MenuItem("ComboActive", "连招!").SetValue(new KeyBind(menu.Item("Orbwalk").GetValue <KeyBind>().Key, KeyBindType.Press)));

            //Harass menu:
            menu.AddSubMenu(new Menu("骚扰", "Harass"));
            menu.SubMenu("Harass").AddItem(new MenuItem("UseQHarass", "使用Q").SetValue(true));
            menu.SubMenu("Harass").AddItem(new MenuItem("UseWHarass", "使用W").SetValue(false));
            menu.SubMenu("Harass").AddItem(new MenuItem("UseEHarass", "使用E").SetValue(true));
            menu.SubMenu("Harass").AddItem(new MenuItem("HarassActive", "骚扰").SetValue(new KeyBind(menu.Item("Farm").GetValue <KeyBind>().Key, KeyBindType.Press)));
            menu.SubMenu("Harass").AddItem(new MenuItem("HarassActiveT", "骚扰 (锁定)").SetValue(new KeyBind("Y".ToCharArray()[0], KeyBindType.Toggle)));

            //Farming menu:
            menu.AddSubMenu(new Menu("补兵", "Farm"));
            menu.SubMenu("Farm").AddItem(new MenuItem("UseQFarm", "使用Q").SetValue(false));
            menu.SubMenu("Farm").AddItem(new MenuItem("UseEFarm", "使用E").SetValue(false));
            menu.SubMenu("Farm").AddItem(new MenuItem("LaneClearActive", "清线").SetValue(new KeyBind(menu.Item("LaneClear").GetValue <KeyBind>().Key, KeyBindType.Press)));
            menu.SubMenu("Farm").AddItem(new MenuItem("LastHitQQ", "Q补兵").SetValue(new KeyBind("A".ToCharArray()[0], KeyBindType.Press)));

            //Misc Menu:
            menu.AddSubMenu(new Menu("杂项", "Misc"));
            menu.SubMenu("Misc").AddItem(new MenuItem("UseGap", "W防突").SetValue(true));
            menu.SubMenu("Misc").AddItem(new MenuItem("packet", "封包").SetValue(true));
            menu.SubMenu("Misc").AddItem(new MenuItem("StackE", "自动叠E").SetValue(new KeyBind("T".ToCharArray()[0], KeyBindType.Toggle)));
            menu.SubMenu("Misc").AddItem(new MenuItem("useR_Hit", "R min击中").SetValue(new Slider(2, 5, 0)));
            menu.SubMenu("Misc").AddItem(new MenuItem("MoveToMouse", "跟随鼠标").SetValue(new KeyBind("n".ToCharArray()[0], KeyBindType.Toggle)));

            //Damage after combo:
            var dmgAfterComboItem = new MenuItem("DamageAfterCombo", "显示伤害").SetValue(true);

            Utility.HpBarDamageIndicator.DamageToUnit = GetComboDamage;
            Utility.HpBarDamageIndicator.Enabled      = dmgAfterComboItem.GetValue <bool>();
            dmgAfterComboItem.ValueChanged           += delegate(object sender, OnValueChangeEventArgs eventArgs)
            {
                Utility.HpBarDamageIndicator.Enabled = eventArgs.GetNewValue <bool>();
            };

            //Drawings menu:
            menu.AddSubMenu(new Menu("显示", "Drawings"));
            menu.SubMenu("Drawings")
            .AddItem(new MenuItem("QRange", "Q范围").SetValue(new Circle(false, Color.FromArgb(100, 255, 0, 255))));
            menu.SubMenu("Drawings")
            .AddItem(new MenuItem("WRange", "W范围").SetValue(new Circle(true, Color.FromArgb(100, 255, 0, 255))));
            menu.SubMenu("Drawings")
            .AddItem(new MenuItem("ERange", "E范围").SetValue(new Circle(false, Color.FromArgb(100, 255, 0, 255))));
            menu.SubMenu("Drawings")
            .AddItem(new MenuItem("RRange", "R范围").SetValue(new Circle(false, Color.FromArgb(100, 255, 0, 255))));
            menu.SubMenu("Drawings")
            .AddItem(dmgAfterComboItem);
            menu.AddToMainMenu();

            menu.AddSubMenu(new Menu("超神汉化", "by wuwei"));
            menu.SubMenu("by wuwei").AddItem(new MenuItem("qunhao", "汉化群:386289593"));
            menu.SubMenu("by wuwei").AddItem(new MenuItem("qunhao2", "娃娃群:158994507"));

            //Events
            Game.OnGameUpdate += Game_OnGameUpdate;
            Drawing.OnDraw    += Drawing_OnDraw;
            AntiGapcloser.OnEnemyGapcloser += AntiGapcloser_OnEnemyGapcloser;
            Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast;
            Game.PrintChat(ChampionName + " Loaded! --- By xSalice");
        }
Ejemplo n.º 54
0
        public WaitingRoom()
        {
            Microsoft.Xna.Framework.Rectangle area = new Microsoft.Xna.Framework.Rectangle(
                (int)MyGame.ScreenCenter.X - _buttonWidth / 2
                , (int)(MyGame.ScreenCenter.Y * 1.75f) - _buttonHeight / 2
                , _buttonWidth
                , _buttonHeight);

            _buttonBack     = MyGame.ContentManager.Load <Texture2D>("Images/buttonScroll");
            _roomBackground = MyGame.ContentManager.Load <Texture2D>("Images/WaitingBack");
            _playerUIBack   = MyGame.ContentManager.Load <Texture2D>("Images/playerScroll");

            Texture2D messageBack = MyGame.ContentManager.Load <Texture2D>("Images/messageScroll");

            Rectangle stretchAreaButton = new Rectangle(15, 20, 70, 60);

            UIElements.StretchableImage stretchButtonTexture = new UIElements.StretchableImage(_buttonBack, stretchAreaButton);

            _startButton = new UIElements.SimpleButton(stretchButtonTexture, area, "Start Game");

            _playerUIs = new List <UIElements.LargePLayerUI>();

            _posStart = new Vector2(MyGame.ScreenArea.Width / 5, 470f);
            _offset   = new Vector2(MyGame.ScreenArea.Width / 5, 0f);


            //Create QR Code

            QRCodeEncoder encoder = new QRCodeEncoder();
            string        ip      = Utils.LocalIPAddress();

            Console.WriteLine("\n\n\n\nServer ip : " + ip + "\n\n\n");

            if (ip == "")
            {
                Rectangle stretchAreaMessage           = new Rectangle(30, 30, 40, 40);
                UIElements.StretchableImage stretchImg = new UIElements.StretchableImage(messageBack, stretchAreaMessage);

                Console.WriteLine("Creating dialog");
                _dialog = new ConditionalDialogBox(
                    delegate() { return(Utils.LocalIPAddress() != ""); }
                    , "Network could not be reached\n"
                    + "Please find de way to connect to a reliable, working network\n"
                    + "(Unice hotsport is NOT one of those networks...)"
                    , new Microsoft.Xna.Framework.Rectangle((int)MyGame.ScreenCenter.X, (int)MyGame.ScreenCenter.Y, 600, 600)
                    , stretchImg);

                _dialog.Position = MyGame.ScreenCenter;
                _dialog.Show();
            }
            else
            {
                System.Drawing.Bitmap qrCodeImage = encoder.Encode(ip);

                Color[] pixels = new Color[qrCodeImage.Width * qrCodeImage.Height];
                for (int y = 0; y < qrCodeImage.Height; y++)
                {
                    for (int x = 0; x < qrCodeImage.Width; x++)
                    {
                        System.Drawing.Color c = qrCodeImage.GetPixel(x, y);
                        pixels[(y * qrCodeImage.Width) + x] = new Color(c.R, c.G, c.B, c.A);
                    }
                }

                _QRCode = new Texture2D(
                    MyGame.SpriteBatch.GraphicsDevice,
                    qrCodeImage.Width,
                    qrCodeImage.Height);

                _QRCode.SetData <Color>(pixels);

                int recWidth = MyGame.ScreenArea.Width / 8;
                _QrCodeArea = new Rectangle((int)(MyGame.ScreenCenter.X - recWidth / 2), 30, recWidth, recWidth);

                NodeJSClient.ServerCom.Instance.playerConnectCB = OnPlayerConnect;
                NodeJSClient.ServerCom.Instance.Execute();

                //initializeRadialUI();
            }
        }
Ejemplo n.º 55
0
 public static MColor ToMediaColor(DColor color)
 {
     return(MColor.FromArgb(color.A, color.R, color.G, color.B));
 }
Ejemplo n.º 56
0
        internal static void Draw()
        {
            var menuItem = Program.Menu.Item("DrawQE").GetValue <Circle>();

            if (menuItem.Active)
            {
                Render.Circle.DrawCircle(ObjectManager.Player.Position, Spells.QE.Range, menuItem.Color);
            }
            menuItem = Program.Menu.Item("DrawQEC").GetValue <Circle>();

            if (Program.Menu.Item("drawing").GetValue <bool>())
            {
                foreach (var enemy in ObjectManager.Get <Obj_AI_Hero>().Where(enemy => enemy.Team != ObjectManager.Player.Team))
                {
                    if (enemy.IsVisible && !enemy.IsDead)
                    {
                        //Draw Combo Damage to Enemy HP bars

                        var hpBarPos = enemy.HPBarPosition;
                        hpBarPos.X += 45;
                        hpBarPos.Y += 18;
                        var killText    = "";
                        var combodamage = GetDamage.GetComboDamage(
                            enemy, Program.Menu.Item("UseQ").GetValue <bool>(), Program.Menu.Item("UseW").GetValue <bool>(),
                            Program.Menu.Item("UseE").GetValue <bool>(), Program.Menu.Item("UseR").GetValue <bool>());
                        var PercentHPleftAfterCombo = (enemy.Health - combodamage) / enemy.MaxHealth;
                        var PercentHPleft           = enemy.Health / enemy.MaxHealth;
                        if (PercentHPleftAfterCombo < 0)
                        {
                            PercentHPleftAfterCombo = 0;
                        }
                        double comboXPos     = hpBarPos.X - 36 + (107 * PercentHPleftAfterCombo);
                        double currentHpxPos = hpBarPos.X - 36 + (107 * PercentHPleft);
                        var    barcolor      = Color.FromArgb(100, 0, 220, 0);
                        var    barcolorline  = Color.WhiteSmoke;
                        if (combodamage + ObjectManager.Player.GetSpellDamage(enemy, SpellSlot.Q) +
                            ObjectManager.Player.GetAutoAttackDamage(enemy) * 2 > enemy.Health)
                        {
                            killText = "Killable by: Full Combo + 1Q + 2AA";
                            if (combodamage >= enemy.Health)
                            {
                                killText = "Killable by: Full Combo";
                            }
                            barcolor     = Color.FromArgb(100, 255, 255, 0);
                            barcolorline = Color.SpringGreen;
                            var linecolor = barcolor;
                            if (
                                GetDamage.GetComboDamage(
                                    enemy, Program.Menu.Item("UseQ").GetValue <bool>(), Program.Menu.Item("UseW").GetValue <bool>(),
                                    Program.Menu.Item("UseE").GetValue <bool>(), false) > enemy.Health)
                            {
                                killText  = "Killable by: Q + W + E";
                                barcolor  = Color.FromArgb(130, 255, 70, 0);
                                linecolor = Color.FromArgb(150, 255, 0, 0);
                            }
                            if (Program.Menu.Item("Gank").GetValue <bool>())
                            {
                                var pos = ObjectManager.Player.Position +
                                          Vector3.Normalize(enemy.Position - ObjectManager.Player.Position) * 100;
                                var myPos = Drawing.WorldToScreen(pos);
                                pos = ObjectManager.Player.Position + Vector3.Normalize(enemy.Position - ObjectManager.Player.Position) * 350;
                                var ePos = Drawing.WorldToScreen(pos);
                                Drawing.DrawLine(myPos.X, myPos.Y, ePos.X, ePos.Y, 1, linecolor);
                            }
                        }
                        var killTextPos = Drawing.WorldToScreen(enemy.Position);
                        var hPleftText  = Math.Round(PercentHPleftAfterCombo * 100) + "%";
                        Drawing.DrawLine(
                            (float)comboXPos, hpBarPos.Y, (float)comboXPos, hpBarPos.Y + 5, 1, barcolorline);
                        if (Program.Menu.Item("KillText").GetValue <bool>())
                        {
                            Drawing.DrawText(killTextPos[0] - 105, killTextPos[1] + 25, barcolor, killText);
                        }
                        if (Program.Menu.Item("KillTextHP").GetValue <bool>())
                        {
                            Drawing.DrawText(hpBarPos.X + 98, hpBarPos.Y + 5, barcolor, hPleftText);
                        }
                        if (Program.Menu.Item("DrawHPFill").GetValue <bool>())
                        {
                            var diff = currentHpxPos - comboXPos;
                            for (var i = 0; i < diff; i++)
                            {
                                Drawing.DrawLine(
                                    (float)comboXPos + i, hpBarPos.Y + 2, (float)comboXPos + i,
                                    hpBarPos.Y + 10, 1, barcolor);
                            }
                        }
                    }

                    //Draw QE to cursor circle
                    if (Program.Menu.Item("UseQEC").GetValue <KeyBind>().Active&& Spells.E.IsReady() && Spells.Q.IsReady() && menuItem.Active)
                    {
                        Render.Circle.DrawCircle(Game.CursorPos, 150f,
                                                 (enemy.Distance(Game.CursorPos, true) <= 150 * 150) ? Color.Red : menuItem.Color, 3);
                    }
                }
            }

            foreach (var spell in Spells.SpellList)
            {
                // Draw Spell Ranges
                menuItem = Program.Menu.Item("Draw" + spell.Slot).GetValue <Circle>();
                if (menuItem.Active)
                {
                    Render.Circle.DrawCircle(ObjectManager.Player.Position, spell.Range, menuItem.Color);
                }
            }

            // Dashboard Indicators
            if (Program.Menu.Item("HUD").GetValue <bool>())
            {
                if (Program.Menu.Item("HarassActiveT").GetValue <KeyBind>().Active)
                {
                    Drawing.DrawText(Drawing.Width * 0.90f, Drawing.Height * 0.68f, Color.Yellow, "Auto Harass : On");
                }
                else
                {
                    Drawing.DrawText(Drawing.Width * 0.90f, Drawing.Height * 0.68f, Color.DarkRed, "Auto Harass : Off");
                }

                if (Program.Menu.Item("AutoKST").GetValue <KeyBind>().Active)
                {
                    Drawing.DrawText(Drawing.Width * 0.90f, Drawing.Height * 0.66f, Color.Yellow, "Auto KS : On");
                }
                else
                {
                    Drawing.DrawText(Drawing.Width * 0.90f, Drawing.Height * 0.66f, Color.DarkRed, "Auto KS : Off");
                }
            }
            // Draw QE MAP
            if (Program.Menu.Item("DrawQEMAP").GetValue <bool>())
            {
                var qeTarget = TargetSelector.GetTarget(Spells.QE.Range, TargetSelector.DamageType.Magical);
                var sPos     = Prediction.GetPrediction(qeTarget, Spells.Q.Delay + Spells.E.Delay).UnitPosition;
                var tPos     = Spells.QE.GetPrediction(qeTarget);
                if (tPos != null && ObjectManager.Player.Distance(sPos, true) > Math.Pow(Spells.E.Range, 2) &&
                    (Spells.E.IsReady() || ObjectManager.Player.Spellbook.GetSpell(SpellSlot.E).CooldownExpires - Game.Time < 2) &&
                    ObjectManager.Player.Spellbook.GetSpell(SpellSlot.E).Level > 0)
                {
                    var color = Color.Red;
                    var orb   = ObjectManager.Player.Position + Vector3.Normalize(sPos - ObjectManager.Player.Position) * Spells.E.Range;
                    Spells.QE.Delay = Spells.Q.Delay + Spells.E.Delay + ObjectManager.Player.Distance(orb) / Spells.E.Speed;
                    if (tPos.Hitchance >= HitChance.Medium)
                    {
                        color = Color.Green;
                    }
                    if (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.Q).ManaCost +
                        ObjectManager.Player.Spellbook.GetSpell(SpellSlot.E).ManaCost > ObjectManager.Player.Mana)
                    {
                        color = Color.DarkBlue;
                    }
                    var pos = ObjectManager.Player.Position + Vector3.Normalize(tPos.UnitPosition - ObjectManager.Player.Position) * 700;
                    Render.Circle.DrawCircle(pos, Spells.Q.Width, color);
                    Render.Circle.DrawCircle(tPos.UnitPosition, Spells.Q.Width / 2, color);
                    var sp1 = pos + Vector3.Normalize(ObjectManager.Player.Position - pos) * 100f;
                    var sp  = Drawing.WorldToScreen(sp1);
                    var ep1 = pos + Vector3.Normalize(pos - ObjectManager.Player.Position) * 592;
                    var ep  = Drawing.WorldToScreen(ep1);
                    Drawing.DrawLine(sp.X, sp.Y, ep.X, ep.Y, 2, color);
                }
            }

            if (!Program.Menu.Item("DrawWMAP").GetValue <bool>() || ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).Level <= 0)
            {
                return;
            }
            var color2  = Color.FromArgb(100, 255, 0, 0);
            var wTarget = TargetSelector.GetTarget(Spells.W.Range + Spells.W.Width, TargetSelector.DamageType.Magical);
            var pos2    = Spells.W.GetPrediction(wTarget, true);

            if (pos2.Hitchance >= HitChance.High)
            {
                color2 = Color.FromArgb(100, 50, 150, 255);
            }
            Render.Circle.DrawCircle(pos2.UnitPosition, Spells.W.Width, color2);
        }
Ejemplo n.º 57
0
 public override void SetFontColor(System.Drawing.Color color)
 {
     _comRow.Font.Color = color;
 }
Ejemplo n.º 58
0
 public static DColor ToDrawingColor(MColor color)
 {
     return(DColor.FromArgb(color.A, color.R, color.G, color.B));
 }
Ejemplo n.º 59
0
 public override void SetBackgroudColor(System.Drawing.Color color)
 {
     _comRow.Interior.Color = color;
 }
Ejemplo n.º 60
0
        public static EpplusResult ToExcel(this DataTable dt, string filename = "People.xlsx", bool useTable = false)
        {
            var ep        = new ExcelPackage();
            var sheetname = System.IO.Path.GetFileNameWithoutExtension(filename);
            var ws        = ep.Workbook.Worksheets.Add(sheetname);

            ws.Cells["A1"].LoadFromDataTable(dt, true);
            var count = dt.Rows.Count;

            using (var header = ws.Cells[1, 1, 1, dt.Columns.Count])
            {
                header.Style.Font.Bold        = true;
                header.Style.Fill.PatternType = ExcelFillStyle.Solid;
                header.Style.Fill.BackgroundColor.SetColor(Color.FromArgb(91, 154, 212));
                header.Style.Font.Color.SetColor(Color.White);
            }

            ExcelTable table = null;

            if (useTable)
            {
                var range = ws.Cells[1, 1, count + 1, dt.Columns.Count];
                table            = ws.Tables.Add(range, sheetname);
                table.TableStyle = TableStyles.Light9;
                table.ShowFilter = false;
            }

            for (var i = 0; i < dt.Columns.Count; i++)
            {
                var col  = i + 1;
                var name = dt.Columns[i].ColumnName;
                var type = dt.Columns[i].DataType;

                if (table != null)
                {
                    table.Columns[i].Name = name;
                }

                var colrange = ws.Cells[1, col, count + 2, col];

                if (!name.ToLower().EndsWith("id") && type == typeof(int))
                {
                    colrange.Style.Numberformat.Format = "#,##0";
                    colrange.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right;
                    colrange.AutoFitColumns();
                }
                else if (type == typeof(decimal))
                {
                    colrange.Style.Numberformat.Format = "#,##0";
                    colrange.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right;
                    colrange.AutoFitColumns();
                }
                else if (type == typeof(DateTime))
                {
                    if (name.EndsWith("Time"))
                    {
                        colrange.Style.Numberformat.Format = "m/d/yy h:mm AM/PM";
                        ws.Column(col).Width = 16;
                    }
                    else
                    {
                        colrange.Style.Numberformat.Format = "m/d/yy";
                        ws.Column(col).Width = 12;
                    }
                    colrange.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right;
                }
                else
                {
                    colrange.AutoFitColumns();
                }
            }
            return(new EpplusResult(ep, filename));
        }