public ProfessionInfoGump(ProfessionInfo info)
        {
            _info = info;

            ClilocLoader localization = ClilocLoader.Instance;

            ResizePic background = new ResizePic(3000)
            {
                Width  = 175,
                Height = 34
            };

            background.SetTooltip(localization.GetString(info.Description), 250);

            Add(background);

            Add
            (
                new Label(localization.GetString(info.Localization), true, 0x00, font: 1)
            {
                X = 7,
                Y = 8
            }
            );

            Add(new GumpPic(121, -12, info.Graphic, 0));
        }
Пример #2
0
        public void SetProfession(ProfessionInfo info)
        {
            for (int i = 0; i < _skillsCount; i++)
            {
                int skillIndex = info.SkillDefVal[i, 0];

                if (skillIndex >= _character.Skills.Length)
                {
                    continue;
                }

                if (!CUOEnviroment.IsOutlands && (World.ClientFeatures.Flags & CharacterListFlags.CLF_SAMURAI_NINJA) == 0 && (skillIndex == 52 || skillIndex == 53))
                {
                    // reset skills if needed
                    for (int k = 0; k < i; k++)
                    {
                        Skill skill = _character.Skills[info.SkillDefVal[k, 0]];
                        skill.ValueFixed = 0;
                        skill.BaseFixed  = 0;
                        skill.CapFixed   = 0;
                        skill.Lock       = Lock.Locked;
                    }

                    MessageBoxGump messageBox = new MessageBoxGump
                                                (
                        400,
                        300,
                        ClilocLoader.Instance.GetString(1063016),
                        null,
                        true
                                                )
                    {
                        X       = 470 / 2 - 400 / 2 + 100,
                        Y       = 372 / 2 - 300 / 2 + 20,
                        CanMove = false
                    };

                    UIManager.Add(messageBox);

                    return;
                }

                Skill skill2 = _character.Skills[skillIndex];
                skill2.ValueFixed = (ushort)info.SkillDefVal[i, 1];
                skill2.BaseFixed  = 0;
                skill2.CapFixed   = 0;
                skill2.Lock       = Lock.Locked;
            }

            _selectedProfession     = info;
            _character.Strength     = (ushort)_selectedProfession.StatsVal[0];
            _character.Intelligence = (ushort)_selectedProfession.StatsVal[1];
            _character.Dexterity    = (ushort)_selectedProfession.StatsVal[2];

            SetAttributes();

            SetStep(_selectedProfession.DescriptionIndex > 0 ? CharCreationStep.ChooseCity : CharCreationStep.ChooseTrade);
        }
Пример #3
0
        public void SelectProfession(ProfessionInfo info)
        {
            if (info.Type == ProfessionLoader.PROF_TYPE.CATEGORY && FileManager.Profession.Professions.TryGetValue(info, out List <ProfessionInfo> list) && list != null)
            {
                Parent.Add(new CreateCharProfessionGump(info));
                Parent.Remove(this);
            }
            else
            {
                CharCreationGump charCreationGump = Engine.UI.GetByLocalSerial <CharCreationGump>();

                charCreationGump?.SetProfession(info);
            }
        }
Пример #4
0
        public CreateCharProfessionGump(ProfessionInfo parent = null) : base(0, 0)
        {
            _Parent = parent;
            if (parent == null || !FileManager.Profession.Professions.TryGetValue(parent, out List <ProfessionInfo> professions) || professions == null)
            {
                professions = new List <ProfessionInfo>(FileManager.Profession.Professions.Keys);
            }

            /* Build the gump */
            Add(new ResizePic(2600)
            {
                X      = 100,
                Y      = 80,
                Width  = 470,
                Height = 372,
            });

            Add(new GumpPic(291, 42, 0x0589, 0));
            Add(new GumpPic(214, 58, 0x058B, 0));
            Add(new GumpPic(300, 51, 0x15A9, 0));

            ClilocLoader localization = FileManager.Cliloc;

            Add(new Label(localization.Translate(3000326), false, 0x0386, font: 2)
            {
                X = 158,
                Y = 132,
            });

            for (int i = 0; i < professions.Count; i++)
            {
                int cx = i % 2;
                int cy = i / 2;

                Add(new ProfessionInfoGump(professions[i])
                {
                    X = 145 + (cx * 195),
                    Y = 168 + (cy * 70),

                    Selected = SelectProfession,
                });
            }

            Add(new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2)
            {
                X            = 586,
                Y            = 445,
                ButtonAction = ButtonAction.Activate
            });
        }
Пример #5
0
        public void SelectProfession(ProfessionInfo info)
        {
            if (info.Type == ProfessionLoader.PROF_TYPE.CATEGORY && ProfessionLoader.Instance.Professions.TryGetValue(info, out List <ProfessionInfo> list) && list != null)
            {
                Parent.Add(new CreateCharProfessionGump(info));
                Parent.Remove(this);
            }
            else
            {
                CharCreationGump charCreationGump = UIManager.GetGump <CharCreationGump>();

                charCreationGump?.SetProfession(info);
            }
        }
Пример #6
0
        public CreateCharProfessionGump(ProfessionInfo parent = null) : base(0, 0)
        {
            _Parent = parent;
            if (parent == null || !ProfessionLoader.Instance.Professions.TryGetValue(parent, out List <ProfessionInfo> professions) || professions == null)
            {
                professions = new List <ProfessionInfo>(ProfessionLoader.Instance.Professions.Keys);
            }

            /* Build the gump */
            Add(new ResizePic(2600)
            {
                X      = 100,
                Y      = 80,
                Width  = 470,
                Height = 372
            });

            Add(new GumpPic(291, 42, 0x0589, 0));
            Add(new GumpPic(214, 58, 0x058B, 0));
            Add(new GumpPic(300, 51, 0x15A9, 0));

            ClilocLoader localization = ClilocLoader.Instance;

            Add(new Label(localization.GetString(3000326, "Choose a Trade for Your Character"), false, 0x0386, font: 2)
            {
                X = 158,
                Y = 132
            });

            for (int i = 0; i < professions.Count; i++)
            {
                int cx = i % 2;
                int cy = i >> 1;

                Add(new ProfessionInfoGump(professions[i])
                {
                    X = 145 + cx * 195,
                    Y = 168 + cy * 70,

                    Selected = SelectProfession
                });
            }

            Add(new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2)
            {
                X            = 586,
                Y            = 445,
                ButtonAction = ButtonAction.Activate
            });
        }
Пример #7
0
 // NEU - Setzt die default Charakterwerte.
 public void CreateNewChar(PlayerMobile character)
 {
     if (_character == null)
     {
         _character = new PlayerMobile(1);
         World.Mobiles.Add(_character);
     }
     _character.Hue      = 0;
     _character.Name     = "Neuer Charakter";
     _character.Race     = RaceType.HUMAN;
     _character.IsFemale = false;
     _selectedProfession = new ProfessionInfo();
     _selectedProfession.DescriptionIndex = 1;
     SetCharacter(_character);
 }
Пример #8
0
        public void SetCharacter(PlayerMobile character)
        {
            _character = character;
            //SetStep(CharCreationStep.ChooseProfession);

            ProfessionInfo parent = null;

            if (parent == null || !ProfessionLoader.Instance.Professions.TryGetValue(parent, out List <ProfessionInfo> professions) || professions == null)
            {
                professions = new List <ProfessionInfo>(ProfessionLoader.Instance.Professions.Keys);
            }
            SetProfession(professions[0]);
            SetCity(0);
            CreateCharacter((byte)_selectedProfession.DescriptionIndex);
            IsVisible = false;
        }
Пример #9
0
        public void SetProfession(ProfessionInfo info)
        {
            _selectedProfession = info;

            for (int i = 0; i < _skillsCount; i++)
            {
                _character.UpdateSkill(_selectedProfession.SkillDefVal[i, 0], (ushort)_selectedProfession.SkillDefVal[i, 1], 0, Lock.Locked, 0);
            }

            _character.Strength     = (ushort)_selectedProfession.StatsVal[0];
            _character.Intelligence = (ushort)_selectedProfession.StatsVal[1];
            _character.Dexterity    = (ushort)_selectedProfession.StatsVal[2];

            SetAttributes();

            SetStep(_selectedProfession.DescriptionIndex > 0 ? CharCreationStep.ChooseCity : CharCreationStep.ChooseTrade);
        }
Пример #10
0
        public ProfessionInfoGump(ProfessionInfo info)
        {
            _info = info;

            ClilocLoader localization = FileManager.Cliloc;

            ResizePic background = new ResizePic(3000)
            {
                Width  = 175,
                Height = 34,
            };

            background.SetTooltip(localization.Translate(info.Description), 250);

            Add(background);

            Add(new Label(localization.Translate(info.Localization), true, 0x00, font: 1)
            {
                X = 7,
                Y = 8,
            });

            Add(new GumpPic(121, -12, info.Graphic, 0));
        }
Пример #11
0
        public CreateCharTradeGump(PlayerMobile character, ProfessionInfo profession) : base(0, 0)
        {
            _character = character;

            foreach (var skill in _character.Skills)
            {
                skill.ValueFixed = 0;
                skill.BaseFixed  = 0;
                skill.CapFixed   = 0;
                skill.Lock       = Lock.Locked;
            }

            Add(new ResizePic(2600)
            {
                X = 100, Y = 80, Width = 470, Height = 372
            });

            // center menu with fancy top
            // public GumpPic(AControl parent, int x, int y, int gumpID, int hue)
            Add(new GumpPic(291, 42, 0x0589, 0));
            Add(new GumpPic(214, 58, 0x058B, 0));
            Add(new GumpPic(300, 51, 0x15A9, 0));

            // title text
            //TextLabelAscii(AControl parent, int x, int y, int font, int hue, string text, int width = 400)
            Add(new Label(ClilocLoader.Instance.GetString(3000326), false, 0x0386, font: 2)
            {
                X = 148, Y = 132
            });

            // strength, dexterity, intelligence
            Add(new Label(ClilocLoader.Instance.GetString(3000111), false, 1, font: 1)
            {
                X = 158, Y = 170
            });

            Add(new Label(ClilocLoader.Instance.GetString(3000112), false, 1, font: 1)
            {
                X = 158, Y = 250
            });

            Add(new Label(ClilocLoader.Instance.GetString(3000113), false, 1, font: 1)
            {
                X = 158, Y = 330
            });

            // sliders for attributes
            _attributeSliders        = new HSliderBar[3];
            Add(_attributeSliders[0] = new HSliderBar(164, 196, 93, 10, 60, ProfessionInfo._VoidStats[0], HSliderBarStyle.MetalWidgetRecessedBar, true));
            Add(_attributeSliders[1] = new HSliderBar(164, 276, 93, 10, 60, ProfessionInfo._VoidStats[1], HSliderBarStyle.MetalWidgetRecessedBar, true));
            Add(_attributeSliders[2] = new HSliderBar(164, 356, 93, 10, 60, ProfessionInfo._VoidStats[2], HSliderBarStyle.MetalWidgetRecessedBar, true));

            string[] skillList = SkillsLoader.Instance.SortedSkills.Select(s => (
                                                                               (s.Index == 52 ||
                                                                                s.Index == 53 && (World.ClientFeatures.Flags & CharacterListFlags.CLF_SAMURAI_NINJA) == 0)) ||
                                                                           s.Index == 54 ? "" : s.Name).ToArray();

            int y = 172;

            _skillSliders = new HSliderBar[CharCreationGump._skillsCount];
            _skills       = new Combobox[CharCreationGump._skillsCount];

            for (var i = 0; i < CharCreationGump._skillsCount; i++)
            {
                Add(_skills[i]       = new Combobox(344, y, 182, skillList, -1, 200, false, "Click here"));
                Add(_skillSliders[i] = new HSliderBar(344, y + 32, 93, 0, 50, ProfessionInfo._VoidSkills[i, 1], HSliderBarStyle.MetalWidgetRecessedBar, true));
                y += 70;
            }

            Add(new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2)
            {
                X = 586, Y = 445, ButtonAction = ButtonAction.Activate
            });

            Add(new Button((int)Buttons.Next, 0x15A4, 0x15A6, 0x15A5)
            {
                X = 610, Y = 445, ButtonAction = ButtonAction.Activate
            });

            for (int i = 0; i < _attributeSliders.Length; i++)
            {
                for (int j = 0; j < _attributeSliders.Length; j++)
                {
                    if (i != j)
                    {
                        _attributeSliders[i].AddParisSlider(_attributeSliders[j]);
                    }
                }
            }

            for (int i = 0; i < _skillSliders.Length; i++)
            {
                for (int j = 0; j < _skillSliders.Length; j++)
                {
                    if (i != j)
                    {
                        _skillSliders[i].AddParisSlider(_skillSliders[j]);
                    }
                }
            }
        }
Пример #12
0
        public CreateCharTradeGump(PlayerMobile character, ProfessionInfo profession) : base(0, 0)
        {
            var skillCount = 3;

            if (FileManager.ClientVersion >= ClientVersions.CV_70160)
            {
                skillCount = 4;
            }
            _character = character;
            if (profession.TrueName != "advanced")
            {
                for (int i = 0; i < skillCount; i++)
                {
                    _character.UpdateSkill(profession.SkillDefVal[i, 0], (ushort)profession.SkillDefVal[i, 1], 0, Lock.Locked, 0);
                }
                _character.Strength     = (ushort)profession.StatsVal[0];
                _character.Intelligence = (ushort)profession.StatsVal[1];
                _character.Dexterity    = (ushort)profession.StatsVal[2];
                OnButtonClick((int)Buttons.Skip);
                return;
            }

            foreach (var skill in _character.Skills)
            {
                _character.UpdateSkill(skill.Index, 0, 0, Lock.Locked, 0);
            }

            Add(new ResizePic(2600)
            {
                X = 100, Y = 80, Width = 470, Height = 372
            });

            // center menu with fancy top
            // public GumpPic(AControl parent, int x, int y, int gumpID, int hue)
            Add(new GumpPic(291, 42, 0x0589, 0));
            Add(new GumpPic(214, 58, 0x058B, 0));
            Add(new GumpPic(300, 51, 0x15A9, 0));

            // title text
            //TextLabelAscii(AControl parent, int x, int y, int font, int hue, string text, int width = 400)
            Add(new Label(FileManager.Cliloc.GetString(3000326), false, 0x0386, font: 2)
            {
                X = 148, Y = 132
            });

            // strength, dexterity, intelligence
            Add(new Label(FileManager.Cliloc.GetString(3000111), false, 1, font: 1)
            {
                X = 158, Y = 170
            });

            Add(new Label(FileManager.Cliloc.GetString(3000112), false, 1, font: 1)
            {
                X = 158, Y = 250
            });

            Add(new Label(FileManager.Cliloc.GetString(3000113), false, 1, font: 1)
            {
                X = 158, Y = 330
            });

            // sliders for attributes
            _attributeSliders        = new HSliderBar[3];
            Add(_attributeSliders[0] = new HSliderBar(164, 196, 93, 10, 60, ProfessionInfo._VoidStats[0], HSliderBarStyle.MetalWidgetRecessedBar, true));
            Add(_attributeSliders[1] = new HSliderBar(164, 276, 93, 10, 60, ProfessionInfo._VoidStats[1], HSliderBarStyle.MetalWidgetRecessedBar, true));
            Add(_attributeSliders[2] = new HSliderBar(164, 356, 93, 10, 60, ProfessionInfo._VoidStats[2], HSliderBarStyle.MetalWidgetRecessedBar, true));

            string[] skillList = FileManager.Skills.SkillNames;
            int      y         = 172;

            _skillSliders = new HSliderBar[skillCount];
            _skills       = new Combobox[skillCount];

            for (var i = 0; i < skillCount; i++)
            {
                Add(_skills[i]       = new Combobox(344, y, 182, skillList, -1, 200, false, "Click here"));
                Add(_skillSliders[i] = new HSliderBar(344, y + 32, 93, 0, 50, ProfessionInfo._VoidSkills[i, 1], HSliderBarStyle.MetalWidgetRecessedBar, true));
                y += 70;
            }

            if (profession.SkillDefVal.Length >= skillCount)
            {
                for (int i = 0; i < skillCount; i++)
                {
                    _skillSliders[i].Value = ProfessionInfo._VoidSkills[i, 1];
                }

                int GetSkillIndex(string name)
                {
                    /* Not sure if other cases exist.
                     * 7.0.20.0 has a specific function to convert string -> index for each skill in prof.txt. */
                    if (String.Equals(name, "Blacksmith", StringComparison.CurrentCulture))
                    {
                        name = "Blacksmithy";
                    }
                    else if (String.Equals(name, "AnimalLore", StringComparison.CurrentCulture))
                    {
                        name = "Animal Lore";
                    }
                    else if (String.Equals(name, "ItemID", StringComparison.CurrentCulture))
                    {
                        name = "Item Identification";
                    }
                    else if (String.Equals(name, "ArmsLore", StringComparison.CurrentCulture))
                    {
                        name = "Arms Lore";
                    }
                    else if (String.Equals(name, "Bowcraft", StringComparison.CurrentCulture))
                    {
                        name = "Bowcraft/Fletching";
                    }
                    else if (String.Equals(name, "DetectHidden", StringComparison.CurrentCulture))
                    {
                        name = "Detecting Hidden";
                    }
                    else if (String.Equals(name, "Enticement", StringComparison.CurrentCulture))
                    {
                        name = "Discordance";
                    }
                    else if (String.Equals(name, "EvaluateIntelligence", StringComparison.CurrentCulture))
                    {
                        name = "Evaluating Intelligence";
                    }
                    else if (String.Equals(name, "ForensicEvaluation", StringComparison.CurrentCulture))
                    {
                        name = "Forensic Evaluation";
                    }
                    else if (String.Equals(name, "ResistingSpells", StringComparison.CurrentCulture))
                    {
                        name = "Resisting Spells";
                    }
                    else if (String.Equals(name, "SpiritSpeak", StringComparison.CurrentCulture))
                    {
                        name = "Spirit Speak";
                    }
                    else if (String.Equals(name, "AnimalTaming", StringComparison.CurrentCulture))
                    {
                        name = "Animal Taming";
                    }
                    else if (String.Equals(name, "TasteIdentification", StringComparison.CurrentCulture))
                    {
                        name = "Taste Identification";
                    }
                    else if (String.Equals(name, "MaceFighting", StringComparison.CurrentCulture))
                    {
                        name = "Mace Fighting";
                    }
                    else if (String.Equals(name, "Disarm", StringComparison.CurrentCulture))
                    {
                        name = "Remove Trap";
                    }

                    return(Array.IndexOf(skillList, name));
                }

                var skillIndex = 0;
                for (int i = 0; i < skillCount; i++)
                {
                    var index       = GetSkillIndex(FileManager.Skills.SkillNames[profession.SkillDefVal[i, 0]]);
                    var skillCombo  = _skills[skillIndex];
                    var skillSlider = _skillSliders[skillIndex];
                    if (index > 0)
                    {
                        skillCombo.SelectedIndex = index;
                        skillSlider.Value        = profession.SkillDefVal[i, 1];
                    }
                }
            }

            if (profession.StatsVal.Length == 3)
            {
                _attributeSliders[0].Value = profession.StatsVal[0]; //STR
                _attributeSliders[1].Value = profession.StatsVal[2]; //DEX
                _attributeSliders[2].Value = profession.StatsVal[1]; //INT
            }

            Add(new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2)
            {
                X = 586, Y = 445, ButtonAction = ButtonAction.Activate
            });

            Add(new Button((int)Buttons.Next, 0x15A4, 0x15A6, 0x15A5)
            {
                X = 610, Y = 445, ButtonAction = ButtonAction.Activate
            });

            for (int i = 0; i < _attributeSliders.Length; i++)
            {
                for (int j = 0; j < _attributeSliders.Length; j++)
                {
                    if (i != j)
                    {
                        _attributeSliders[i].AddParisSlider(_attributeSliders[j]);
                    }
                }
            }

            for (int i = 0; i < _skillSliders.Length; i++)
            {
                for (int j = 0; j < _skillSliders.Length; j++)
                {
                    if (i != j)
                    {
                        _skillSliders[i].AddParisSlider(_skillSliders[j]);
                    }
                }
            }
        }
Пример #13
0
        public CreateCharTradeGump(PlayerMobile character, ProfessionInfo profession) : base(0, 0)
        {
            _character = character;

            foreach (Skill skill in _character.Skills)
            {
                skill.ValueFixed = 0;
                skill.BaseFixed  = 0;
                skill.CapFixed   = 0;
                skill.Lock       = Lock.Locked;
            }

            Add
            (
                new ResizePic(2600)
            {
                X = 100, Y = 80, Width = 470, Height = 372
            }
            );

            // center menu with fancy top
            // public GumpPic(AControl parent, int x, int y, int gumpID, int hue)
            Add(new GumpPic(291, 42, 0x0589, 0));
            Add(new GumpPic(214, 58, 0x058B, 0));
            Add(new GumpPic(300, 51, 0x15A9, 0));

            bool isAsianLang = string.Compare(Settings.GlobalSettings.Language, "CHT", StringComparison.InvariantCultureIgnoreCase) == 0 ||
                               string.Compare(Settings.GlobalSettings.Language, "KOR", StringComparison.InvariantCultureIgnoreCase) == 0 ||
                               string.Compare(Settings.GlobalSettings.Language, "JPN", StringComparison.InvariantCultureIgnoreCase) == 0;

            bool   unicode = isAsianLang;
            byte   font    = (byte)(isAsianLang ? 1 : 2);
            ushort hue     = (ushort)(isAsianLang ? 0xFFFF : 0x0386);

            // title text
            //TextLabelAscii(AControl parent, int x, int y, int font, int hue, string text, int width = 400)
            Add
            (
                new Label(ClilocLoader.Instance.GetString(3000326), unicode, hue, font: font)
            {
                X = 148, Y = 132
            }
            );

            // strength, dexterity, intelligence
            Add
            (
                new Label(ClilocLoader.Instance.GetString(3000111), unicode, 1, font: 1)
            {
                X = 158, Y = 170
            }
            );

            Add
            (
                new Label(ClilocLoader.Instance.GetString(3000112), unicode, 1, font: 1)
            {
                X = 158, Y = 250
            }
            );

            Add
            (
                new Label(ClilocLoader.Instance.GetString(3000113), unicode, 1, font: 1)
            {
                X = 158, Y = 330
            }
            );

            // sliders for attributes
            _attributeSliders = new HSliderBar[3];

            Add
            (
                _attributeSliders[0] = new HSliderBar
                                       (
                    164,
                    196,
                    93,
                    10,
                    60,
                    ProfessionInfo._VoidStats[0],
                    HSliderBarStyle.MetalWidgetRecessedBar,
                    true
                                       )
            );

            Add
            (
                _attributeSliders[1] = new HSliderBar
                                       (
                    164,
                    276,
                    93,
                    10,
                    60,
                    ProfessionInfo._VoidStats[1],
                    HSliderBarStyle.MetalWidgetRecessedBar,
                    true
                                       )
            );

            Add
            (
                _attributeSliders[2] = new HSliderBar
                                       (
                    164,
                    356,
                    93,
                    10,
                    60,
                    ProfessionInfo._VoidStats[2],
                    HSliderBarStyle.MetalWidgetRecessedBar,
                    true
                                       )
            );

            string[] skillList = new string[SkillsLoader.Instance.SortedSkills.Count];

            for (int i = 0; i < skillList.Length; ++i)
            {
                SkillEntry entry = SkillsLoader.Instance.SortedSkills[i];

                if ((World.ClientFeatures.Flags & CharacterListFlags.CLF_SAMURAI_NINJA) == 0 && (entry.Index == 52 || entry.Index == 47 || entry.Index == 53) || entry.Index == 54)
                {
                    skillList[i] = string.Empty;
                }
                else
                {
                    skillList[i] = entry.Name;
                }
            }


            int y = 172;

            _skillSliders = new HSliderBar[CharCreationGump._skillsCount];
            _skills       = new Combobox[CharCreationGump._skillsCount];

            for (int i = 0; i < CharCreationGump._skillsCount; i++)
            {
                Add
                (
                    _skills[i] = new Combobox
                                 (
                        344,
                        y,
                        182,
                        skillList,
                        -1,
                        200,
                        false,
                        "Click here"
                                 )
                );

                Add
                (
                    _skillSliders[i] = new HSliderBar
                                       (
                        344,
                        y + 32,
                        93,
                        0,
                        50,
                        ProfessionInfo._VoidSkills[i, 1],
                        HSliderBarStyle.MetalWidgetRecessedBar,
                        true
                                       )
                );

                y += 70;
            }

            Add
            (
                new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2)
            {
                X = 586, Y = 445, ButtonAction = ButtonAction.Activate
            }
            );

            Add
            (
                new Button((int)Buttons.Next, 0x15A4, 0x15A6, 0x15A5)
            {
                X = 610, Y = 445, ButtonAction = ButtonAction.Activate
            }
            );

            for (int i = 0; i < _attributeSliders.Length; i++)
            {
                for (int j = 0; j < _attributeSliders.Length; j++)
                {
                    if (i != j)
                    {
                        _attributeSliders[i].AddParisSlider(_attributeSliders[j]);
                    }
                }
            }

            for (int i = 0; i < _skillSliders.Length; i++)
            {
                for (int j = 0; j < _skillSliders.Length; j++)
                {
                    if (i != j)
                    {
                        _skillSliders[i].AddParisSlider(_skillSliders[j]);
                    }
                }
            }
        }
Пример #14
0
        public CreateCharProfessionGump(ProfessionInfo parent = null) : base(0, 0)
        {
            _Parent = parent;

            if (parent == null || !ProfessionLoader.Instance.Professions.TryGetValue(parent, out List <ProfessionInfo> professions) || professions == null)
            {
                professions = new List <ProfessionInfo>(ProfessionLoader.Instance.Professions.Keys);
            }

            /* Build the gump */
            Add
            (
                new ResizePic(2600)
            {
                X      = 100,
                Y      = 80,
                Width  = 470,
                Height = 372
            }
            );

            Add(new GumpPic(291, 42, 0x0589, 0));
            Add(new GumpPic(214, 58, 0x058B, 0));
            Add(new GumpPic(300, 51, 0x15A9, 0));

            ClilocLoader localization = ClilocLoader.Instance;

            bool isAsianLang = string.Compare(Settings.GlobalSettings.Language, "CHT", StringComparison.InvariantCultureIgnoreCase) == 0 ||
                               string.Compare(Settings.GlobalSettings.Language, "KOR", StringComparison.InvariantCultureIgnoreCase) == 0 ||
                               string.Compare(Settings.GlobalSettings.Language, "JPN", StringComparison.InvariantCultureIgnoreCase) == 0;

            bool   unicode = isAsianLang;
            byte   font    = (byte)(isAsianLang ? 1 : 2);
            ushort hue     = (ushort)(isAsianLang ? 0xFFFF : 0x0386);

            Add
            (
                new Label(localization.GetString(3000326, "Choose a Trade for Your Character"), unicode, hue, font: font)
            {
                X = 158,
                Y = 132
            }
            );

            for (int i = 0; i < professions.Count; i++)
            {
                int cx = i % 2;
                int cy = i >> 1;

                Add
                (
                    new ProfessionInfoGump(professions[i])
                {
                    X = 145 + cx * 195,
                    Y = 168 + cy * 70,

                    Selected = SelectProfession
                }
                );
            }

            Add
            (
                new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2)
            {
                X            = 586,
                Y            = 445,
                ButtonAction = ButtonAction.Activate
            }
            );
        }
Пример #15
0
        public void SetProfession(ProfessionInfo info)
        {
            _selectedProfession = info;

            SetStep(CharCreationStep.ChooseTrade);
        }