private void UpdateEquipments() { bool isFemale = _femaleRadio.IsChecked; RaceType race = GetSelectedRace(); Layer layer; CharacterCreationValues.ComboContent content; _character.Hue = CurrentColorOption[Layer.Invalid].Item2; if (!isFemale && race != RaceType.ELF) { layer = Layer.Beard; content = CharacterCreationValues.GetFacialHairComboContent(race); Item iti = CreateItem(content.GetGraphic(CurrentOption[layer]), CurrentColorOption[layer].Item2, layer); _character.PushToBack(iti); } layer = Layer.Hair; content = CharacterCreationValues.GetHairComboContent(isFemale, race); Item it = CreateItem(content.GetGraphic(CurrentOption[layer]), CurrentColorOption[layer].Item2, layer); _character.PushToBack(it); }
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(); }
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(); }