static void ChooseDoll(UnitEntityData unitEntityData) { if (!unitEntityData.IsMainCharacter && !unitEntityData.IsCustomCompanion() && GUILayout.Button("Destroy Doll", GUILayout.Width(DefaultLabelWidth))) { unitEntityData.Descriptor.Doll = null; unitEntityData.Descriptor.ForcceUseClassEquipment = false; CharacterManager.RebuildCharacter(unitEntityData); } var doll = DollResourcesManager.GetDoll(unitEntityData); var race = doll.Race; var gender = unitEntityData.Gender; CustomizationOptions customizationOptions = gender != Gender.Male ? race.FemaleOptions : race.MaleOptions; ChooseRace(unitEntityData, doll); ChooseEEL(unitEntityData, doll, "Face", customizationOptions.Heads, doll.Head, (EquipmentEntityLink ee) => doll.SetHead(ee)); ChooseEEL(unitEntityData, doll, "Hair", customizationOptions.Hair, doll.Hair, (EquipmentEntityLink ee) => doll.SetHair(ee)); if (customizationOptions.Beards.Length > 0) { ChooseEEL(unitEntityData, doll, "Beards", customizationOptions.Beards, doll.Beard, (EquipmentEntityLink ee) => doll.SetBeard(ee)); } if (BlueprintRoot.Instance.DlcSettings.Tieflings.Enabled) { if (customizationOptions.Horns.Length > 0) { ChooseEEL(unitEntityData, doll, "Horns", customizationOptions.Horns, doll.Horn, (EquipmentEntityLink ee) => doll.SetHorn(ee)); } } ChooseRamp(unitEntityData, doll, "Hair Color", doll.GetHairRamps(), doll.HairRampIndex, (int index) => doll.SetHairColor(index)); ChooseRamp(unitEntityData, doll, "Skin Color", doll.GetSkinRamps(), doll.SkinRampIndex, (int index) => doll.SetSkinColor(index)); if (BlueprintRoot.Instance.DlcSettings.Tieflings.Enabled) { ChooseRamp(unitEntityData, doll, "Horn Color", doll.GetHornsRamps(), doll.HornsRampIndex, (int index) => doll.SetHornsColor(index)); } ChooseRamp(unitEntityData, doll, "Primary Outfit Color", doll.GetOutfitRampsPrimary(), doll.EquipmentRampIndex, (int index) => doll.SetEquipColors(index, doll.EquipmentRampIndexSecondary)); ChooseRamp(unitEntityData, doll, "Secondary Outfit Color", doll.GetOutfitRampsSecondary(), doll.EquipmentRampIndexSecondary, (int index) => doll.SetEquipColors(doll.EquipmentRampIndex, index)); ChooseVisualPreset(unitEntityData, doll, "Body Type", doll.Race.Presets, doll.RacePreset); if (unitEntityData.Descriptor.Doll.LeftHanded && GUILayout.Button("Set Right Handed", GUILayout.Width(DefaultLabelWidth))) { unitEntityData.Descriptor.LeftHandedOverride = false; doll.SetLeftHanded(false); unitEntityData.Descriptor.Doll = doll.CreateData(); ViewManager.ReplaceView(unitEntityData, null); unitEntityData.View.HandsEquipment.HandleEquipmentSetChanged(); } else if (!unitEntityData.Descriptor.Doll.LeftHanded && GUILayout.Button("Set Left Handed", GUILayout.Width(DefaultLabelWidth))) { unitEntityData.Descriptor.LeftHandedOverride = true; doll.SetLeftHanded(true); unitEntityData.Descriptor.Doll = doll.CreateData(); ViewManager.ReplaceView(unitEntityData, null); unitEntityData.View.HandsEquipment.HandleEquipmentSetChanged(); } ChoosePortrait(unitEntityData); if (unitEntityData.IsMainCharacter || unitEntityData.IsCustomCompanion()) { ChooseAsks(unitEntityData); } }
static void ChooseDoll(UnitEntityData unitEntityData) { try { if (!unitEntityData.IsMainCharacter && !unitEntityData.IsCustomCompanion() && GUILayout.Button("Destroy Doll", GUILayout.Width(DefaultLabelWidth))) { unitEntityData.Descriptor.Doll = null; unitEntityData.Descriptor.ForcceUseClassEquipment = false; CharacterManager.RebuildCharacter(unitEntityData); } var doll = DollResourcesManager.GetDoll(unitEntityData); var race = doll.Race; var gender = unitEntityData.Gender; CustomizationOptions customizationOptions = gender != Gender.Male ? race.FemaleOptions : race.MaleOptions; ChooseRace(unitEntityData, doll); ChooseEEL(unitEntityData, doll, "Face", customizationOptions.Heads, doll.Head.m_Link, (EquipmentEntityLink ee) => doll.SetHead(ee)); ChooseEEL(unitEntityData, doll, "Hair", customizationOptions.Hair, doll.Hair.m_Link, (EquipmentEntityLink ee) => doll.SetHair(ee)); if (customizationOptions.Beards.Length > 0) { ChooseEEL(unitEntityData, doll, "Beards", customizationOptions.Beards, doll.Beard.m_Link, (EquipmentEntityLink ee) => doll.SetBeard(ee)); } if (customizationOptions.Horns.Length > 0) { ChooseEEL(unitEntityData, doll, "Horns", customizationOptions.Horns, doll.Horn.m_Link, (EquipmentEntityLink ee) => doll.SetHorn(ee)); } ChooseRamp(unitEntityData, doll, "Hair Color", doll.GetHairRamps(), doll.HairRampIndex, (int index) => doll.SetHairColor(index)); ChooseRamp(unitEntityData, doll, "Skin Color", doll.GetSkinRamps(), doll.SkinRampIndex, (int index) => doll.SetSkinColor(index)); ChooseRamp(unitEntityData, doll, "Horn Color", doll.GetHornsRamps(), doll.HornsRampIndex, (int index) => doll.SetHornsColor(index)); ChooseRamp(unitEntityData, doll, "Primary Outfit Color", doll.GetOutfitRampsPrimary(), doll.EquipmentRampIndex, (int index) => doll.SetEquipColors(index, doll.EquipmentRampIndexSecondary)); ChooseRamp(unitEntityData, doll, "Secondary Outfit Color", doll.GetOutfitRampsSecondary(), doll.EquipmentRampIndexSecondary, (int index) => doll.SetEquipColors(doll.EquipmentRampIndex, index)); ReferenceArrayProxy <BlueprintRaceVisualPreset, BlueprintRaceVisualPresetReference> presets = doll.Race.Presets; BlueprintRaceVisualPreset racePreset = doll.RacePreset; /*if (unitEntityData.Descriptor.LeftHandedOverride == true && GUILayout.Button("Set Right Handed", GUILayout.Width(DefaultLabelWidth))) * { * unitEntityData.Descriptor.LeftHandedOverride = false; * unitEntityData.Descriptor.Doll = doll.CreateData(); * ViewManager.ReplaceView(unitEntityData, null); * unitEntityData.View.HandsEquipment.HandleEquipmentSetChanged(); * } * else if (unitEntityData.Descriptor.LeftHandedOverride == false && GUILayout.Button("Set Left Handed", GUILayout.Width(DefaultLabelWidth))) * { * unitEntityData.Descriptor.LeftHandedOverride = true; * unitEntityData.Descriptor.Doll = doll.CreateData(); * ViewManager.ReplaceView(unitEntityData, null); * unitEntityData.View.HandsEquipment.HandleEquipmentSetChanged(); * }*/ ChoosePortrait(unitEntityData); if (unitEntityData.IsMainCharacter || unitEntityData.IsCustomCompanion()) { ChooseAsks(unitEntityData); } } catch (Exception e) { Main.logger.Log(e.ToString()); } }