Ejemplo n.º 1
0
        public void DrawProgressiveItem(string Image, Dictionary <string, string> Logicnames, int Spacing, List <string> ProgressiveImages = null)
        {
            int row    = Position[0];
            int colomn = Position[1];

            Increaseposition();
            Bitmap CurentImage;

            if (Images.ContainsKey(Image))
            {
                CurentImage = Images[Image];
            }
            else
            {
                CurentImage = Images["Error"];
            }
            string CountNumber = "";
            List <LogicObjects.LogicEntry> AllEntries = new List <LogicObjects.LogicEntry>();
            bool Itemmarked = false;
            int  count      = 0;

            foreach (KeyValuePair <string, string> i in Logicnames)
            {
                LogicObjects.LogicEntry Entry = LogicObjects.MainTrackerInstance.Logic.Find(x => x.DictionaryName == i.Key);
                if (Entry != null && Entry.Useable())
                {
                    CountNumber = i.Value;
                }
                if (Entry != null)
                {
                    AllEntries.Add(Entry);
                }
                if (Entry != null && Entry.GetItemsNewLocation(LogicObjects.MainTrackerInstance.Logic) != null & !Entry.Aquired)
                {
                    Itemmarked = true;
                }
                if (Entry != null && Entry.Useable() && ProgressiveImages != null && count < ProgressiveImages.Count())
                {
                    if (Images.ContainsKey(ProgressiveImages[count]))
                    {
                        CurentImage = Images[ProgressiveImages[count]];
                    }
                }
                count++;
            }
            if (CountNumber == "" && !DebugShowAll)
            {
                CurentImage = new Bitmap(GreyImage(CurentImage));
            }
            if (CountNumber == "" && Itemmarked)
            {
                CountNumber = "X";
            }
            if (CountNumber == "null")
            {
                CountNumber = "";
            }
            var PB = new PictureBox
            {
                BorderStyle = BorderStyle.Fixed3D,
                Image       = CurentImage,
                Width       = Spacing,
                Height      = Spacing,
                SizeMode    = PictureBoxSizeMode.StretchImage,
                Location    = PostionItem(row, colomn, Spacing),
                BackColor   = Color.Transparent
            };

            Controls.Add(PB);
            PB.Click += (s, ee) => FilterProgressiveItem(AllEntries);

            Label lb = new Label();

            lb.Location  = new Point(PostionItem(row, colomn, Spacing).X + 2, PostionItem(row, colomn, Spacing).Y + 2);
            lb.BackColor = Color.Black;
            lb.ForeColor = Color.White;
            lb.Text      = CountNumber;
            lb.AutoSize  = true;
            lb.Font      = new Font("Arial", Spacing / 6);
            Controls.Add(lb);
            while (lb.Width > PB.Width - 4)
            {
                lb.Font = new Font("Arial", lb.Font.SizeInPoints - (float)0.1);
            }
            lb.Click += (s, ee) => FilterProgressiveItem(AllEntries);
            lb.BringToFront();
        }
Ejemplo n.º 2
0
        public void DrawItem(string Image, string Logicname, int Spacing, string Text = "", bool FakeItem = false)
        {
            int row    = Position[0];
            int colomn = Position[1];

            Increaseposition();
            Bitmap CurentImage;

            if (Images.ContainsKey(Image))
            {
                CurentImage = Images[Image];
            }
            else
            {
                CurentImage = Images["Error"];
            }

            LogicObjects.LogicEntry Entry = LogicObjects.MainTrackerInstance.Logic.Find(x => x.DictionaryName == Logicname);
            if (Entry != null && ((!FakeItem && !Entry.Useable()) || (FakeItem && !Entry.Available)) && !DebugShowAll)
            {
                CurentImage = new Bitmap(GreyImage(CurentImage));
            }

            var PB = new PictureBox
            {
                BorderStyle = BorderStyle.Fixed3D,
                Image       = CurentImage,
                Width       = Spacing,
                Height      = Spacing,
                SizeMode    = PictureBoxSizeMode.StretchImage,
                Location    = PostionItem(row, colomn, Spacing),
                BackColor   = Color.Transparent
            };

            Controls.Add(PB);
            PB.Click += (s, ee) => FilterRegularItem(Entry);

            string display = "";

            if (Entry == null)
            {
                display = Text;
            }
            else
            {
                if (Entry.GetItemsNewLocation(LogicObjects.MainTrackerInstance.Logic) != null && !Entry.Aquired)
                {
                    display = (Text == "") ? "X" : "X " + Text;
                }
                else
                {
                    display = Text;
                }
            }

            Label lb = new Label();

            lb.Location  = new Point(PostionItem(row, colomn, Spacing).X + 2, PostionItem(row, colomn, Spacing).Y + 2);
            lb.BackColor = Color.Black;
            lb.ForeColor = Color.White;
            lb.Text      = display;
            lb.AutoSize  = true;
            lb.Font      = new Font("Arial", Spacing / 6);
            Controls.Add(lb);

            while (lb.Width > PB.Width - 4)
            {
                lb.Font = new Font("Arial", lb.Font.SizeInPoints - (float)0.1);
            }

            lb.Click += (s, ee) => FilterRegularItem(Entry);
            lb.BringToFront();
        }