Beispiel #1
0
        private Bitmap CreateGeneralSkills(DataRow[] generalSkills)
        {
            Bitmap   generalSkillLayer = null;
            Graphics g = null;

            generalSkillLayer = new Bitmap(_unscaledSize.Width, _unscaledSize.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
                    Bitmap image = _textureHandler.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
                {
                    xOffset = 24;
                    yOffset = 974;

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

                    Bitmap image = _textureHandler.GetImageFromSkillTree(iconName);

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

            if (g != null)
            {
                g.Dispose();
            }
            return(generalSkillLayer);
        }
Beispiel #2
0
        private void CreateControls(ref SkillControls skillControl, int maxLevel, Point loc)
        {
            skillControl.MaxLevel = maxLevel;
            skillControl.Location = new Point(loc.X, loc.Y + 4);

            SizeF size = new SizeF(.7f, .7f);

            skillControl.Label.Scale(size);
            skillControl.AddButton.Scale(size);
            skillControl.SubsButton.Scale(size);

            _skillControls.Add(skillControl);
        }
Beispiel #3
0
        private Bitmap CreateClassSkills(DataRow[] classSkills)
        {
            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;

                skillIconLayer = new Bitmap(_unscaledSize.Width, _unscaledSize.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);

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

                    // draw skillIcon
                    Bitmap image = _textureHandler.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, "CreateClassSkills");
                return(null);
            }
        }
        private Bitmap CreateGeneralSkills(DataRow[] generalSkills)
        {
            Bitmap generalSkillLayer = null;
            Graphics g = null;

            generalSkillLayer = new Bitmap(_unscaledSize.Width, _unscaledSize.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
                    Bitmap image = _textureHandler.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
                {
                    xOffset = 24;
                    yOffset = 974;

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

                    Bitmap image = _textureHandler.GetImageFromSkillTree(iconName);

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

            if (g != null)
            {
                g.Dispose();
            }
            return generalSkillLayer;
        }
        private void CreateControls(ref SkillControls skillControl, int maxLevel, Point loc)
        {
            skillControl.MaxLevel = maxLevel;
            skillControl.Location = new Point(loc.X, loc.Y + 4);

            SizeF size = new SizeF(.7f, .7f);

            skillControl.Label.Scale(size);
            skillControl.AddButton.Scale(size);
            skillControl.SubsButton.Scale(size);

            _skillControls.Add(skillControl);
        }
        private Bitmap CreateClassSkills(DataRow[] classSkills)
        {
            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;

                skillIconLayer = new Bitmap(_unscaledSize.Width, _unscaledSize.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);

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

                    // draw skillIcon
                    Bitmap image = _textureHandler.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, "CreateClassSkills");
                return null;
            }
        }