Пример #1
0
        private void HandleGenreChange()
        {
            bool isFemale = _femaleRadio.IsChecked;
            var  race     = GetSelectedRace();

            CurrentOption[Layer.Beard] = 0;
            CurrentOption[Layer.Hair]  = 1;

            if (_paperDoll != null)
            {
                Remove(_paperDoll);
            }

            if (_hairCombobox != null)
            {
                Remove(_hairCombobox);
                Remove(_hairLabel);
            }

            if (_facialCombobox != null)
            {
                Remove(_facialCombobox);
                Remove(_facialLabel);
            }

            foreach (var customPicker in Children.OfType <CustomColorPicker>().ToList())
            {
                Remove(customPicker);
            }

            // Hair
            CharacterCreationValues.ComboContent content = CharacterCreationValues.GetHairComboContent(isFemale, race);

            Add(_hairLabel = new Label(ClilocLoader.Instance.GetString(race == RaceType.GARGOYLE ? 1112309 : 3000121), false, 0, font: 9)
            {
                X = 98, Y = 142
            }, 1);
            Add(_hairCombobox = new Combobox(97, 155, 120, content.Labels, CurrentOption[Layer.Hair]), 1);
            _hairCombobox.OnOptionSelected += Hair_OnOptionSelected;

            // Facial Hair
            if (!isFemale && race != RaceType.ELF)
            {
                content = CharacterCreationValues.GetFacialHairComboContent(race);

                Add(_facialLabel = new Label(ClilocLoader.Instance.GetString(race == RaceType.GARGOYLE ? 1112511 : 3000122), false, 0, font: 9)
                {
                    X = 98, Y = 186
                }, 1);
                Add(_facialCombobox = new Combobox(97, 199, 120, content.Labels, CurrentOption[Layer.Beard]), 1);
                _facialCombobox.OnOptionSelected += Facial_OnOptionSelected;
            }
            else
            {
                _facialCombobox = null;
                _facialLabel    = null;
            }

            // Skin
            ushort[] pallet = CharacterCreationValues.GetSkinPallet(race);
            AddCustomColorPicker(489, 141, pallet, Layer.Invalid, 3000183, 8, pallet.Length >> 3);

            // Shirt Color
            AddCustomColorPicker(489, 183, null, Layer.Shirt, 3000440, 10, 20);

            // Pants Color
            if (race != RaceType.GARGOYLE)
            {
                AddCustomColorPicker(489, 225, null, Layer.Pants, 3000441, 10, 20);
            }

            // Hair
            pallet = CharacterCreationValues.GetHairPallet(race);
            AddCustomColorPicker(489, 267, pallet, Layer.Hair, race == RaceType.GARGOYLE ? 1112322 : 3000184, 8, pallet.Length >> 3);

            if (!isFemale && race != RaceType.ELF)
            {
                // Facial
                pallet = CharacterCreationValues.GetHairPallet(race);
                AddCustomColorPicker(489, 309, pallet, Layer.Beard, race == RaceType.GARGOYLE ? 1112512 : 3000446, 8, pallet.Length >> 3);
            }

            CreateCharacter(isFemale, race);

            UpdateEquipments();

            Add(_paperDoll = new PaperDollInteractable(262, 135, _character, null)
            {
                AcceptMouseInput = false
            }, 1);

            _paperDoll.Update();
        }
Пример #2
0
        private void BuildGump()
        {
            AcceptMouseInput = false;
            CanBeSaved       = true;
            CanMove          = true;
            LocalSerial      = Mobile.Serial;

            if (Mobile == World.Player)
            {
                Add(new GumpPic(0, 0, 0x07d0, 0));

                //HELP BUTTON
                Add(new Button((int)Buttons.Help, 0x07ef, 0x07f0, 0x07f1)
                {
                    X = 185, Y = 44 + 27 * 0, ButtonAction = ButtonAction.Activate
                });

                //OPTIONS BUTTON
                Add(new Button((int)Buttons.Options, 0x07d6, 0x07d7, 0x07d8)
                {
                    X = 185, Y = 44 + 27 * 1, ButtonAction = ButtonAction.Activate
                });

                // LOG OUT BUTTON
                Add(new Button((int)Buttons.LogOut, 0x07d9, 0x07da, 0x07db)
                {
                    X = 185, Y = 44 + 27 * 2, ButtonAction = ButtonAction.Activate
                });

                // QUESTS BUTTON
                Add(new Button((int)Buttons.Quests, 0x57b5, 0x57b7, 0x57b6)
                {
                    X = 185, Y = 44 + 27 * 3, ButtonAction = ButtonAction.Activate
                });

                // SKILLS BUTTON
                Add(new Button((int)Buttons.Skills, 0x07df, 0x07e0, 0x07e1)
                {
                    X = 185, Y = 44 + 27 * 4, ButtonAction = ButtonAction.Activate
                });

                // GUILD BUTTON
                Add(new Button((int)Buttons.Guild, 0x57b2, 0x57b4, 0x57b3)
                {
                    X = 185, Y = 44 + 27 * 5, ButtonAction = ButtonAction.Activate
                });
                // TOGGLE PEACE/WAR BUTTON
                _isWarMode = Mobile.InWarMode;
                ushort[] btngumps = _isWarMode ? WarModeBtnGumps : PeaceModeBtnGumps;

                Add(_warModeBtn = new Button((int)Buttons.PeaceWarToggle, btngumps[0], btngumps[1], btngumps[2])
                {
                    X = 185, Y = 44 + 27 * 6, ButtonAction = ButtonAction.Activate
                });

                // STATUS BUTTON
                Add(new Button((int)Buttons.Status, 0x07eb, 0x07ec, 0x07ed)
                {
                    X = 185, Y = 44 + 27 * 7, ButtonAction = ButtonAction.Activate
                });
                // Virtue menu
                Add(_virtueMenuPic = new GumpPic(79, 4, 0x0071, 0));
                _virtueMenuPic.MouseDoubleClick += VirtueMenu_MouseDoubleClickEvent;

                int       profileX     = 25;
                const int SCROLLS_STEP = 14;

                if (World.ClientFlags.PaperdollBooks)
                {
                    Add(_combatBook = new GumpPic(156, 200, 0x2B34, 0));
                    _combatBook.MouseDoubleClick += (sender, e) => { GameActions.OpenAbilitiesBook(); };
                    if (FileManager.ClientVersion >= ClientVersions.CV_7000)
                    {
                        Add(_racialAbilitiesBook = new GumpPic(23, 200, 0x2B28, 0));
                        _racialAbilitiesBook.MouseDoubleClick += (sender, e) =>
                        {
                            if (Engine.UI.GetByLocalSerial <RacialAbilitiesBookGump>() == null)
                            {
                                Engine.UI.Add(new RacialAbilitiesBookGump(100, 100));
                            }
                        };
                        profileX += SCROLLS_STEP;
                    }
                }

                Add(_profilePic = new GumpPic(profileX, 196, 0x07D2, 0));
                _profilePic.MouseDoubleClick += Profile_MouseDoubleClickEvent;

                profileX += SCROLLS_STEP;

                Add(_partyManifestPic = new GumpPic(profileX, 196, 0x07D2, 0));
                _partyManifestPic.MouseDoubleClick += PartyManifest_MouseDoubleClickEvent;
            }
            else
            {
                Add(new GumpPic(0, 0, 0x07d1, 0));

                // STATUS BUTTON
                Add(new Button((int)Buttons.Status, 0x07eb, 0x07ec, 0x07ed)
                {
                    X            = 185,
                    Y            = 44 + 27 * 7,
                    ButtonAction = ButtonAction.Activate
                });
            }

            // Equipment slots for hat/earrings/neck/ring/bracelet
            Add(new EquipmentSlot(2, 76, Mobile, Layer.Helmet));
            Add(new EquipmentSlot(2, 76 + 22, Mobile, Layer.Earrings));
            Add(new EquipmentSlot(2, 76 + 22 * 2, Mobile, Layer.Necklace));
            Add(new EquipmentSlot(2, 76 + 22 * 3, Mobile, Layer.Ring));
            Add(new EquipmentSlot(2, 76 + 22 * 4, Mobile, Layer.Bracelet));
            Add(new EquipmentSlot(2, 76 + 22 * 5, Mobile, Layer.Tunic));

            // Paperdoll control!
            _paperDollInteractable = new PaperDollInteractable(8, 21, Mobile);
            //_paperDollInteractable.MouseOver += (sender, e) =>
            //{
            //    OnMouseOver(e.X, e.Y);
            //};
            Add(_paperDollInteractable);

            // Name and title
            Label titleLabel = new Label(Title, false, 0x0386, 185)
            {
                X = 39, Y = 262
            };

            Add(titleLabel);
        }
Пример #3
0
        private void HandleGenreChange()
        {
            RaceType race = _characterInfo.Race;

            CurrentOption[Layer.Beard] = 0;
            CurrentOption[Layer.Hair]  = 1;

            if (_paperDoll != null)
            {
                Remove(_paperDoll);
            }

            if (_hairCombobox != null)
            {
                Remove(_hairCombobox);
                Remove(_hairLabel);
            }

            if (_facialCombobox != null)
            {
                Remove(_facialCombobox);
                Remove(_facialLabel);
            }

            foreach (CustomColorPicker customPicker in Children.OfType <CustomColorPicker>().ToList())
            {
                Remove(customPicker);
            }

            // Hair
            CharacterCreationValues.ComboContent content = CharacterCreationValues.GetHairComboContent(_characterInfo.IsFemale, race);

            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 ? 3 : 9);
            ushort hue     = (ushort)(isAsianLang ? 0xFFFF : 0);

            Add
            (
                _hairLabel = new Label(ClilocLoader.Instance.GetString(race == RaceType.GARGOYLE ? 1112309 : 3000121), unicode, hue, font: font)
            {
                X = 98, Y = 140
            },
                1
            );

            Add
            (
                _hairCombobox = new Combobox
                                (
                    97,
                    155,
                    120,
                    content.Labels,
                    CurrentOption[Layer.Hair]
                                ),
                1
            );

            _hairCombobox.OnOptionSelected += Hair_OnOptionSelected;

            // Facial Hair
            if (!_characterInfo.IsFemale && race != RaceType.ELF)
            {
                content = CharacterCreationValues.GetFacialHairComboContent(race);

                Add
                (
                    _facialLabel = new Label(ClilocLoader.Instance.GetString(race == RaceType.GARGOYLE ? 1112511 : 3000122), unicode, hue, font: font)
                {
                    X = 98, Y = 184
                },
                    1
                );

                Add
                (
                    _facialCombobox = new Combobox
                                      (
                        97,
                        199,
                        120,
                        content.Labels,
                        CurrentOption[Layer.Beard]
                                      ),
                    1
                );

                _facialCombobox.OnOptionSelected += Facial_OnOptionSelected;
            }
            else
            {
                _facialCombobox = null;
                _facialLabel    = null;
            }

            // Skin
            ushort[] pallet = CharacterCreationValues.GetSkinPallet(race);

            AddCustomColorPicker
            (
                489,
                141,
                pallet,
                Layer.Invalid,
                3000183,
                8,
                pallet.Length >> 3
            );

            // Shirt Color
            AddCustomColorPicker
            (
                489,
                183,
                null,
                Layer.Shirt,
                3000440,
                10,
                20
            );

            // Pants Color
            if (race != RaceType.GARGOYLE)
            {
                AddCustomColorPicker
                (
                    489,
                    225,
                    null,
                    Layer.Pants,
                    3000441,
                    10,
                    20
                );
            }

            // Hair
            pallet = CharacterCreationValues.GetHairPallet(race);

            AddCustomColorPicker
            (
                489,
                267,
                pallet,
                Layer.Hair,
                race == RaceType.GARGOYLE ? 1112322 : 3000184,
                8,
                pallet.Length >> 3
            );

            if (!_characterInfo.IsFemale && race != RaceType.ELF)
            {
                // Facial
                pallet = CharacterCreationValues.GetHairPallet(race);

                AddCustomColorPicker
                (
                    489,
                    309,
                    pallet,
                    Layer.Beard,
                    race == RaceType.GARGOYLE ? 1112512 : 3000446,
                    8,
                    pallet.Length >> 3
                );
            }

            CreateCharacter(_characterInfo.IsFemale, race);

            UpdateEquipments();

            Add
            (
                _paperDoll = new PaperDollInteractable(262, 135, _character, null)
            {
                AcceptMouseInput = false
            },
                1
            );

            _paperDoll.Update();
        }
Пример #4
0
        private void HandleGenreChange()
        {
            Genre genre = _maleRadio.IsChecked ? Genre.Male : Genre.Female;

            CurrentOption[Layer.Beard] = 1;
            CurrentOption[Layer.Hair]  = 1;

            if (_paperDoll != null)
            {
                RemoveChildren(_paperDoll);
            }

            if (_hairCombobox != null)
            {
                RemoveChildren(_hairCombobox);
                RemoveChildren(_hairLabel);
            }

            if (_facialCombobox != null)
            {
                RemoveChildren(_facialCombobox);
                RemoveChildren(_facialLabel);
            }

            foreach (var customPicker in Children.OfType <CustomColorPicker>().ToList())
            {
                RemoveChildren(customPicker);
            }

            ComboContent content;

            // Hair
            content = GENRE_MAPPING[genre][Layer.Hair];
            AddChildren(_hairLabel = new Label(IO.Resources.Cliloc.GetString(3000121), false, 0x07F4, font: 9)
            {
                X = 98, Y = 142
            });
            AddChildren(_hairCombobox       = new Combobox(97, 155, 120, content.Labels, CurrentOption[Layer.Hair]));
            _hairCombobox.OnOptionSelected += Hair_OnOptionSelected;

            // Facial Hair
            if (genre == Genre.Male)
            {
                content = GENRE_MAPPING[genre][Layer.Beard];
                AddChildren(_facialLabel = new Label(IO.Resources.Cliloc.GetString(3000122), false, 0x07F4, font: 9)
                {
                    X = 98, Y = 186
                });
                AddChildren(_facialCombobox       = new Combobox(97, 199, 120, content.Labels, CurrentOption[Layer.Beard]));
                _facialCombobox.OnOptionSelected += Facial_OnOptionSelected;
            }
            else
            {
                _facialCombobox = null;
                _facialLabel    = null;
            }

            // Skin
            ushort[] pallet = Data.CharacterCreationValues.HumanSkinTone;
            AddCustomColorPicker(489, 141, pallet, Layer.Invalid, 3000183, 8, pallet.Length / 8);

            // Shirt Color
            AddCustomColorPicker(489, 183, null, Layer.Shirt, 3000440, 10, 20);


            // Pants Color
            AddCustomColorPicker(489, 225, null, Layer.Pants, 3000441, 10, 20);

            // Hair
            pallet = Data.CharacterCreationValues.HumanHairColor;
            AddCustomColorPicker(489, 267, pallet, Layer.Hair, 3000184, 8, pallet.Length / 8);

            if (genre == Genre.Male)
            {
                // Facial
                pallet = Data.CharacterCreationValues.HumanHairColor;
                AddCustomColorPicker(489, 309, pallet, Layer.Beard, 3000446, 8, pallet.Length / 8);
            }

            _character = CreateCharacter(genre, RaceType.HUMAN);
            UpdateEquipments();
            AddChildren(_paperDoll = new PaperDollInteractable(262, 135, _character)
            {
                AcceptMouseInput = false
            });
        }
Пример #5
0
        private void BuildGump()
        {
            AcceptMouseInput = false;
            CanBeSaved       = true;
            CanMove          = true;
            LocalSerial      = Mobile.Serial;

            if (Mobile == World.Player)
            {
                AddChildren(new GumpPic(0, 0, 0x07d0, 0));

                //HELP BUTTON
                AddChildren(new Button((int)Buttons.Help, 0x07ef, 0x07f0, 0x07f1)
                {
                    X = 185, Y = 44 + 27 * 0, ButtonAction = ButtonAction.Activate
                });

                //OPTIONS BUTTON
                AddChildren(new Button((int)Buttons.Options, 0x07d6, 0x07d7, 0x07d8)
                {
                    X = 185, Y = 44 + 27 * 1, ButtonAction = ButtonAction.Activate
                });

                // LOG OUT BUTTON
                AddChildren(new Button((int)Buttons.LogOut, 0x07d9, 0x07da, 0x07db)
                {
                    X = 185, Y = 44 + 27 * 2, ButtonAction = ButtonAction.Activate
                });

                // QUESTS BUTTON
                AddChildren(new Button((int)Buttons.Quests, 0x57b5, 0x57b7, 0x57b6)
                {
                    X = 185, Y = 44 + 27 * 3, ButtonAction = ButtonAction.Activate
                });

                // SKILLS BUTTON
                AddChildren(new Button((int)Buttons.Skills, 0x07df, 0x07e0, 0x07e1)
                {
                    X = 185, Y = 44 + 27 * 4, ButtonAction = ButtonAction.Activate
                });

                // GUILD BUTTON
                AddChildren(new Button((int)Buttons.Guild, 0x57b2, 0x57b4, 0x57b3)
                {
                    X = 185, Y = 44 + 27 * 5, ButtonAction = ButtonAction.Activate
                });
                // TOGGLE PEACE/WAR BUTTON
                _isWarMode = Mobile.InWarMode;
                ushort[] btngumps = _isWarMode ? WarModeBtnGumps : PeaceModeBtnGumps;

                AddChildren(_warModeBtn = new Button((int)Buttons.PeaceWarToggle, btngumps[0], btngumps[1], btngumps[2])
                {
                    X = 185, Y = 44 + 27 * 6, ButtonAction = ButtonAction.Activate
                });

                // STATUS BUTTON
                AddChildren(new Button((int)Buttons.Status, 0x07eb, 0x07ec, 0x07ed)
                {
                    X = 185, Y = 44 + 27 * 7, ButtonAction = ButtonAction.Activate
                });
                // Virtue menu
                AddChildren(_virtueMenuPic       = new GumpPic(80, 8, 0x0071, 0));
                _virtueMenuPic.MouseDoubleClick += VirtueMenu_MouseDoubleClickEvent;
                // Special moves book
                //AddChildren(_specialMovesBookPic = new GumpPic(178, 220, 0x2B34, 0));
                //_specialMovesBookPic.MouseDoubleClick += SpecialMoves_MouseDoubleClickEvent;
                // Party manifest caller
                AddChildren(_partyManifestPic       = new GumpPic(44, 195, 2002, 0));
                _partyManifestPic.MouseDoubleClick += PartyManifest_MouseDoubleClickEvent;
            }
            else
            {
                AddChildren(new GumpPic(0, 0, 0x07d1, 0));
            }

            // Equipment slots for hat/earrings/neck/ring/bracelet
            AddChildren(new EquipmentSlot(2, 76, Mobile, Layer.Helmet));
            AddChildren(new EquipmentSlot(2, 76 + 22, Mobile, Layer.Earrings));
            AddChildren(new EquipmentSlot(2, 76 + 22 * 2, Mobile, Layer.Necklace));
            AddChildren(new EquipmentSlot(2, 76 + 22 * 3, Mobile, Layer.Ring));
            AddChildren(new EquipmentSlot(2, 76 + 22 * 4, Mobile, Layer.Bracelet));
            AddChildren(new EquipmentSlot(2, 76 + 22 * 5, Mobile, Layer.Tunic));

            // Paperdoll control!
            _paperDollInteractable = new PaperDollInteractable(8, 21, Mobile);
            //_paperDollInteractable.MouseOver += (sender, e) =>
            //{
            //    OnMouseOver(e.X, e.Y);
            //};
            AddChildren(_paperDollInteractable);

            // Name and title
            Label titleLabel = new Label(Title, false, 0x0386, 185)
            {
                X = 39, Y = 262
            };

            AddChildren(titleLabel);
        }