Esempio n. 1
0
        private void CreateControls(ref SkillControls skillControl, int maxLevel, Point loc)
        {
            skillControl.MaxLevel = maxLevel;
            skillControl.Location = new Point(loc.X, loc.Y + 4);

            _skillControls.Add(skillControl);
            _panel.Controls.Add(skillControl.AddButton);
            _panel.Controls.Add(skillControl.SubsButton);
            _panel.Controls.Add(skillControl.Label);
        }
Esempio n. 2
0
        private Bitmap CreateGeneralSkills(DataRow[] generalSkills, bool drawBG)
        {
            Bitmap   generalSkillLayer = null;
            Graphics g = null;

            if (drawBG)
            {
                generalSkillLayer = new Bitmap(_completeSkillPanel.Size.Width, _completeSkillPanel.Size.Height);
                g = Graphics.FromImage(generalSkillLayer);
                g.Clear(Color.Transparent);
            }

            int xOffset   = 0;
            int yOffset   = 0;
            int distanceX = 80;
            int distanceY = 80;

            foreach (DataRow generalSkill in generalSkills)
            {
                int    x         = (int)generalSkill["skillPageColumn"];
                int    y         = (int)generalSkill["skillPageRow"];
                string skillName = (string)generalSkill["skill"];
                string iconName  = (string)generalSkill["largeIcon"];
                int    maxLevel  = (int)generalSkill["maxLevel"];

                if (skillName.Contains("Swiftness_Boost"))
                {
                    xOffset = 20;
                    yOffset = 970;

                    Point loc = new Point(x * distanceX + xOffset, y * distanceY + yOffset);
                    // draw skillIconPanel
                    // _g.DrawImage(_skillIconPanel, loc);

                    // draw skillIcon
                    if (drawBG)
                    {
                        Bitmap image = _skillPanel.GetImageFromSkillTree(iconName);
                        g.DrawImage(image, new Point(loc.X + 4, loc.Y + 4));
                        image.Dispose();
                    }

                    // set controls
                    SkillControls skillControl = new SkillControls((int)generalSkill["code"], skillName);
                    CreateControls(ref skillControl, maxLevel, loc);
                }
                else if (drawBG)
                {
                    xOffset = 24;
                    yOffset = 974;

                    Point loc = new Point(x * distanceX + xOffset, y * distanceY + yOffset);

                    Bitmap image = _skillPanel.GetImageFromSkillTree(iconName);

                    g.DrawImage(image, new Point(loc.X, loc.Y));
                    image.Dispose();
                }
            }

            if (g != null)
            {
                g.Dispose();
            }
            return(generalSkillLayer);
        }
Esempio n. 3
0
        private Bitmap CreateClassSkills(DataRow[] classSkills, bool drawBG)
        {
            try
            {
                /*
                 * SKILLTABS:
                 *
                 * 0 = general skills (sprint, left_weapon, right_weapon, recall...)
                 * 1 = Blademaster
                 * 3 = Guardian
                 * 6 = Evoker
                 * 8 = Summoner
                 * 11 = Marksman
                 * 13 = Engineer
                 */

                //TODO:
                //When adding a skillpoint, check if the (skills) prerequisites were met

                Bitmap   skillIconLayer = null;
                Graphics g = null;

                if (drawBG)
                {
                    skillIconLayer = new Bitmap(_completeSkillPanel.Size.Width, _completeSkillPanel.Size.Height);
                    g = Graphics.FromImage(skillIconLayer);
                    g.Clear(Color.Transparent);
                }

                int xOffset   = 48;      //144;
                int yOffset   = 96 + 24; //192;
                int distanceX = 120;
                int distanceY = 122 - 4;

                foreach (DataRow skill in classSkills)
                {
                    int    x             = (int)skill["skillPageColumn"];
                    int    y             = (int)skill["skillPageRow"];
                    string skillName     = (string)skill["skill"];
                    string iconName      = (string)skill["largeIcon"];
                    int    maxLevel      = (int)skill["maxLevel"];
                    int    currentIndex  = (int)skill["index"];
                    int    requiredSkill = (int)skill["requiredskills1"];

                    Point loc = new Point(x * distanceX + xOffset, y * distanceY + yOffset);

                    if (drawBG)
                    {
                        // draw skillIconPanel
                        g.DrawImage(_skillIconPanel, loc);

                        // draw skillIcon
                        Bitmap image = _skillPanel.GetImageFromSkillTree(iconName);
                        g.DrawImage(image, new Point(loc.X + 4, loc.Y + 4));
                        image.Dispose();
                    }

                    // set controls
                    SkillControls skillControl = new SkillControls((int)skill["code"], skillName);
                    CreateControls(ref skillControl, maxLevel, loc);
                    skillControl.GridPosition = new Point(x, y);
                    skillControl.Size         = _skillIconPanel.Size;
                }

                if (g != null)
                {
                    g.Dispose();
                }
                return(skillIconLayer);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return(null);
            }
        }