Exemple #1
0
        public override void OnButtonClick(int buttonID)
        {
            switch ((Buttons)buttonID)
            {
            case Buttons.Prev:

            {
                if (_Parent != null && _Parent.TopLevel)
                {
                    Parent.Add(new CreateCharProfessionGump());
                    Parent.Remove(this);
                }
                else
                {
                    Parent.Remove(this);
                    CharCreationGump charCreationGump = UIManager.GetGump <CharCreationGump>();
                    charCreationGump?.StepBack();
                }

                break;
            }
            }

            base.OnButtonClick(buttonID);
        }
Exemple #2
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);
            }
        }
Exemple #3
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);
            }
        }
Exemple #4
0
        public override void OnButtonClick(int buttonID)
        {
            CharCreationGump charCreationGump = UIManager.GetGump <CharCreationGump>();

            switch ((Buttons)buttonID)
            {
            case Buttons.Prev:
                charCreationGump.StepBack();

                break;

            case Buttons.Next:

                if (ValidateValues())
                {
                    for (int i = 0; i < _skills.Length; i++)
                    {
                        if (_skills[i]
                            .SelectedIndex != -1)
                        {
                            Skill skill = _character.Skills[SkillsLoader.Instance.SortedSkills[_skills[i]
                                                                                               .SelectedIndex]
                                                            .Index];

                            skill.ValueFixed = (ushort)_skillSliders[i]
                                               .Value;

                            skill.BaseFixed = 0;
                            skill.CapFixed  = 0;
                            skill.Lock      = Lock.Locked;
                        }
                    }

                    _character.Strength = (ushort)_attributeSliders[0]
                                          .Value;

                    _character.Intelligence = (ushort)_attributeSliders[1]
                                              .Value;

                    _character.Dexterity = (ushort)_attributeSliders[2]
                                           .Value;

                    charCreationGump.SetAttributes(true);
                }

                break;
            }

            base.OnButtonClick(buttonID);
        }
        public override void OnButtonClick(int buttonID)
        {
            CharCreationGump charCreationGump = UIManager.GetGump <CharCreationGump>();

            switch ((Buttons)buttonID)
            {
            case Buttons.FemaleButton:
                _femaleRadio.IsChecked = true;

                break;

            case Buttons.MaleButton:
                _maleRadio.IsChecked = true;

                break;

            case Buttons.HumanButton:
                _humanRadio.IsChecked = true;

                break;

            case Buttons.ElfButton:
                _elfRadio.IsChecked = true;

                break;

            case Buttons.GargoyleButton:
                _gargoyleRadio.IsChecked = true;

                break;

            case Buttons.Next:
                _character.Name = _nameTextBox.Text;

                if (ValidateCharacter(_character))
                {
                    charCreationGump.SetCharacter(_character);
                }

                break;

            case Buttons.Prev:
                charCreationGump.StepBack();

                break;
            }

            base.OnButtonClick(buttonID);
        }
        public override void OnButtonClick(int buttonID)
        {
            CharCreationGump charCreationGump = UIManager.GetGump <CharCreationGump>();

            if (charCreationGump == null)
            {
                return;
            }

            switch ((Buttons)buttonID)
            {
            case Buttons.PreviousScreen:
                charCreationGump.StepBack(_selectedProfession > 0 ? 2 : 1);

                return;

            case Buttons.Finish:

                if (_selectedCity != null)
                {
                    charCreationGump.SetCity(_selectedCity.Index);
                }

                charCreationGump.CreateCharacter(_selectedProfession);
                charCreationGump.IsVisible = false;

                return;
            }

            if (buttonID >= 2)
            {
                buttonID -= 2;
                SetCity(buttonID);
                SetSelectedLabel(buttonID);
            }
        }
Exemple #7
0
        public override void OnButtonClick(int buttonID)
        {
            CharCreationGump charCreationGump = UIManager.GetGump <CharCreationGump>();

            switch ((Buttons)buttonID)
            {
            case Buttons.FemaleButton:
                _femaleRadio.IsClicked  = true;
                _maleRadio.IsClicked    = false;
                _characterInfo.IsFemale = true;

                HandleGenreChange();

                break;

            case Buttons.MaleButton:
                _maleRadio.IsClicked    = true;
                _femaleRadio.IsClicked  = false;
                _characterInfo.IsFemale = false;

                HandleGenreChange();

                break;

            case Buttons.HumanButton:

                _characterInfo.Race = RaceType.HUMAN;

                if (!_humanRadio.IsClicked)
                {
                    _humanRadio.IsClicked = true;

                    if (_elfRadio != null)
                    {
                        _elfRadio.IsClicked = false;
                    }

                    if (_gargoyleRadio != null)
                    {
                        _gargoyleRadio.IsClicked = false;
                    }

                    HandleRaceChanged();
                }

                break;

            case Buttons.ElfButton:

                _characterInfo.Race = RaceType.ELF;

                if (!_elfRadio.IsClicked)
                {
                    _elfRadio.IsClicked   = true;
                    _humanRadio.IsClicked = false;

                    if (_gargoyleRadio != null)
                    {
                        _gargoyleRadio.IsClicked = false;
                    }

                    HandleRaceChanged();
                }

                break;

            case Buttons.GargoyleButton:

                _characterInfo.Race = RaceType.GARGOYLE;

                if (!_gargoyleRadio.IsClicked)
                {
                    _gargoyleRadio.IsClicked = true;
                    _elfRadio.IsClicked      = false;
                    _humanRadio.IsClicked    = false;

                    HandleRaceChanged();
                }

                break;

            case Buttons.Next:
                _character.Name = _nameTextBox.Text;

                if (ValidateCharacter(_character))
                {
                    charCreationGump.SetCharacter(_character);
                }

                break;

            case Buttons.Prev:
                charCreationGump.StepBack();

                break;
            }

            base.OnButtonClick(buttonID);
        }