public void ChangeOutfit_Internal(bool reset) { // Reset all before changing outfits. ChaFileControl chaFileCtrl = ChaCtrl.chaFile; ChaFileControl charFile = CharFile; string fullname = chaFileCtrl.parameter.fullname; chaFileCtrl.CopyCoordinate(charFile.coordinate); chaFileCtrl.CopyCustom(charFile.custom); KKABMXHelper kkabmxHelper = new KKABMXHelper(charFile); KCOXHelper kcoxHelper = new KCOXHelper(charFile); KSOXHelper ksoxHelper = new KSOXHelper(charFile); // Failing to roll will use original outfit instead. if (!reset && Controller.RollForOutfit(out List <Layer> layers, out List <Card> cards, fullname)) { for (int i = 0; i < layers.Count; i++) { Layer layer = layers[i]; Card card = cards[i]; layer.checkList.Apply(card.chaFileCtrl, chaFileCtrl); layer.checkList_KKABMX.Apply(card.KKABMX, kkabmxHelper); layer.checkList_KCOX.Apply(card.KCOX, kcoxHelper); layer.checkList_KSOX.Apply(card.KSOX, ksoxHelper); } } ChangeOutfit_Internal_KKABMX(kkabmxHelper); ChangeOutfit_Internal_KCOX(kcoxHelper); ChangeOutfit_Internal_KSOX(ksoxHelper); _reloadPending = 10; }
public Layer(string path = null) { cards = new HashSet <Card>(); checkList = new CheckList_Generic( Controller.dummyChaFileCtrl, Controller.dummyChaFileCtrl.GetType(), data: Load_CheckList(path, Strings.CHECK_LIST_BIN) ); KKABMXHelper bones = new KKABMXHelper(); checkList_KKABMX = new CheckList_Generic( bones, bones.GetType(), data: Load_CheckList(path, Strings.CHECK_LIST_KKABMX_BIN) ); KCOXHelper clothes = new KCOXHelper(); checkList_KCOX = new CheckList_Generic( clothes, clothes.GetType(), data: Load_CheckList(path, Strings.CHECK_LIST_KCOX_BIN) ); KSOXHelper skin = new KSOXHelper(); checkList_KSOX = new CheckList_Generic( skin, skin.GetType(), data: Load_CheckList(path, Strings.CHECK_LIST_KSOX_BIN) ); if (path != null) { Load(path); } }
public void ChangeOutfit_Internal_KKABMX(KKABMXHelper helper) { List <BoneModifier> data = new List <BoneModifier>(); foreach (KeyValuePair <string, Dictionary <string, Dictionary <string, BoneModifier> > > a in helper.KKABMX) { foreach (KeyValuePair <string, Dictionary <string, BoneModifier> > b in a.Value) { foreach (KeyValuePair <string, BoneModifier> c in b.Value) { if (c.Value != null) { data.Add(c.Value); } } } } for (int i = 0; i < helper.KKABMXCoordinate.Length; i++) { foreach (KeyValuePair <string, Dictionary <string, Dictionary <string, BoneModifier> > > a in helper.KKABMXCoordinate[i]) { foreach (KeyValuePair <string, Dictionary <string, BoneModifier> > b in a.Value) { foreach (KeyValuePair <string, BoneModifier> c in b.Value) { if (c.Value != null) { BoneModifier bone = data.FirstOrDefault(v => v.BoneName == c.Key); if (bone == null) { data.Add(bone = new BoneModifier(c.Key)); } if (!bone.IsCoordinateSpecific()) { bone.MakeCoordinateSpecific(); } bone.CoordinateModifiers[i] = c.Value.CoordinateModifiers[i]; } } } } } kkabmx.SetExtendedData(data.KKABMXData()); }