internal void AccessoryTransferredEvent(object sender, AccessoryTransferEventArgs e) { RendererPropertyList.RemoveAll(x => x.ObjectType == ObjectType.Accessory && x.CoordinateIndex == CurrentCoordinateIndex && x.Slot == e.DestinationSlotIndex); MaterialFloatPropertyList.RemoveAll(x => x.ObjectType == ObjectType.Accessory && x.CoordinateIndex == CurrentCoordinateIndex && x.Slot == e.DestinationSlotIndex); MaterialColorPropertyList.RemoveAll(x => x.ObjectType == ObjectType.Accessory && x.CoordinateIndex == CurrentCoordinateIndex && x.Slot == e.DestinationSlotIndex); List <RendererProperty> newAccessoryRendererPropertyList = new List <RendererProperty>(); List <MaterialFloatProperty> newAccessoryMaterialFloatPropertyList = new List <MaterialFloatProperty>(); List <MaterialColorProperty> newAccessoryMaterialColorPropertyList = new List <MaterialColorProperty>(); foreach (var property in RendererPropertyList.Where(x => x.ObjectType == ObjectType.Accessory && x.CoordinateIndex == CurrentCoordinateIndex && x.Slot == e.SourceSlotIndex)) { newAccessoryRendererPropertyList.Add(new RendererProperty(property.ObjectType, CurrentCoordinateIndex, e.DestinationSlotIndex, property.RendererName, property.Property, property.Value, property.ValueOriginal)); } foreach (var property in MaterialFloatPropertyList.Where(x => x.ObjectType == ObjectType.Accessory && x.CoordinateIndex == CurrentCoordinateIndex && x.Slot == e.SourceSlotIndex)) { newAccessoryMaterialFloatPropertyList.Add(new MaterialFloatProperty(property.ObjectType, CurrentCoordinateIndex, e.DestinationSlotIndex, property.MaterialName, property.Property, property.Value, property.ValueOriginal)); } foreach (var property in MaterialColorPropertyList.Where(x => x.ObjectType == ObjectType.Accessory && x.CoordinateIndex == CurrentCoordinateIndex && x.Slot == e.SourceSlotIndex)) { newAccessoryMaterialColorPropertyList.Add(new MaterialColorProperty(property.ObjectType, CurrentCoordinateIndex, e.DestinationSlotIndex, property.MaterialName, property.Property, property.Value, property.ValueOriginal)); } RendererPropertyList.AddRange(newAccessoryRendererPropertyList); MaterialFloatPropertyList.AddRange(newAccessoryMaterialFloatPropertyList); MaterialColorPropertyList.AddRange(newAccessoryMaterialColorPropertyList); UISystem.gameObject.SetActive(false); ChaControl.StartCoroutine(LoadData(false, true, false)); }
internal static void TransferPartsInfo(ChaControl _chaCtrl, AccessoryTransferEventArgs ev) { int _coordinateIndex = _chaCtrl.fileStatus.coordinateType; ChaFileAccessory.PartsInfo _part = GetPartsInfo(_chaCtrl, _coordinateIndex, ev.SourceSlotIndex); SetPartsInfo(_chaCtrl, _coordinateIndex, ev.DestinationSlotIndex, _part); }
internal void TransferAccessoriesHandler(AccessoryTransferEventArgs e) { if (!HairAccessories.ContainsKey(CurrentCoordinateIndex)) { return; } if (HairAccessories[CurrentCoordinateIndex].TryGetValue(e.SourceSlotIndex, out var hairAccessoryInfo)) { //copy hair accessory info to the destination slot var newHairAccessoryInfo = new HairAccessoryInfo(); newHairAccessoryInfo.ColorMatch = hairAccessoryInfo.ColorMatch; newHairAccessoryInfo.HairGloss = hairAccessoryInfo.HairGloss; newHairAccessoryInfo.OutlineColor = hairAccessoryInfo.OutlineColor; newHairAccessoryInfo.AccessoryColor = hairAccessoryInfo.AccessoryColor; newHairAccessoryInfo.HairLength = hairAccessoryInfo.HairLength; HairAccessories[CurrentCoordinateIndex][e.DestinationSlotIndex] = newHairAccessoryInfo; if (AccessoriesApi.SelectedMakerAccSlot == e.DestinationSlotIndex) { InitCurrentSlot(this, true); } } else { //not a hair accessory, remove hair accessory info from the destination slot HairAccessories[CurrentCoordinateIndex].Remove(e.DestinationSlotIndex); InitCurrentSlot(this, false); } UpdateAccessories(); }
internal void TransferPartsInfo(AccessoryTransferEventArgs ev) { if (!_installed) { return; } Traverse.Create(_pluginCtrl).Method("TransferAccessoriesHandler", new object[] { ev }).GetValue(); }
private static void AccessoriesApi_AccessoryTransferred(object sender, AccessoryTransferEventArgs e) { var controller = GetCharaController(MakerAPI.GetCharacterControl()); if (controller != null) { controller.AccessoryTransferredEvent(sender, e); } }
internal void TransferPartsInfo(AccessoryTransferEventArgs ev) { if (!_installed) { return; } int _coordinateIndex = _chaCtrl.fileStatus.coordinateType; Traverse.Create(_pluginCtrl).Method("TransferAccSlotInfo", new object[] { _coordinateIndex, ev }).GetValue(); }
private void AccessoriesApi_AccessoryTransferred(object sender, AccessoryTransferEventArgs e) { var controller = GetMakerCharaController(); if (controller != null) { controller.AccessoryTransferredEvent(sender, e); } UI.ToggleButtonVisibility(); }
internal void TransferPartsInfo(AccessoryTransferEventArgs ev) { if (!_installed) { return; } int _coordinateIndex = _chaCtrl.fileStatus.coordinateType; Traverse.Create(_pluginCtrl).Method("CloneSlotTriggerProperty", new object[] { ev.SourceSlotIndex, ev.DestinationSlotIndex, _coordinateIndex, _coordinateIndex }).GetValue(); }
internal void TransferPartsInfo(AccessoryTransferEventArgs ev) { RemovePartsInfo(ev.DestinationSlotIndex); int _coordinateIndex = _chaCtrl.fileStatus.coordinateType; foreach (string _key in _containerKeys) { int n = Traverse.Create(_extdataLink[_key]).Property("Count").GetValue <int>(); for (int i = 0; i < n; i++) { object _copy = MoveSlot(_extdataLink[_key].RefElementAt(i).JsonClone(), _coordinateIndex, ev.SourceSlotIndex, ev.DestinationSlotIndex); if (_copy != null) { Traverse.Create(_extdataLink[_key]).Method("Add", new object[] { _copy }).GetValue(); } } } }
internal void AccessoryTransferredEvent(object sender, AccessoryTransferEventArgs e) { AccessoryDynamicBoneData.RemoveAll(x => x.CoordinateIndex == CurrentCoordinateIndex && x.Slot == e.DestinationSlotIndex); List <DynamicBoneData> newAccessoryDynamicBoneData = new List <DynamicBoneData>(); foreach (var dbData in AccessoryDynamicBoneData.Where(x => x.CoordinateIndex == CurrentCoordinateIndex && x.Slot == e.SourceSlotIndex)) { var newDBData = new DynamicBoneData(dbData.CoordinateIndex, e.DestinationSlotIndex, dbData.BoneName); dbData.CopyTo(newDBData); newAccessoryDynamicBoneData.Add(newDBData); } AccessoryDynamicBoneData.AddRange(newAccessoryDynamicBoneData); if (MakerAPI.InsideAndLoaded) { UI.Visible = false; } StartCoroutine(ApplyData()); }
internal void TransferAccSlotInfo(int CoordinateIndex, AccessoryTransferEventArgs ev) { if (!OutfitTriggers.ContainsKey(CoordinateIndex)) { OutfitTriggers[CoordinateIndex] = new List <RouteRule>(); } int srcIdx = ev.SourceSlotIndex; int dstIdx = ev.DestinationSlotIndex; string srcName = $"/ca_slot{srcIdx:00}/"; string dstName = $"/ca_slot{dstIdx:00}/"; OutfitTriggers[CoordinateIndex].RemoveAll(x => x.GameObjectPath.Contains(dstName)); var rules = OutfitTriggers[CoordinateIndex].Where(x => x.GameObjectPath.Contains(srcName)); if (rules?.Count() > 0) { byte[] data = MessagePackSerializer.Serialize(rules.ToList()); OutfitTriggers[CoordinateIndex].ForEach(x => x.GameObjectPath = x.GameObjectPath.Replace(srcName, dstName)); OutfitTriggers[CoordinateIndex].AddRange(MessagePackSerializer.Deserialize <List <RouteRule> >(data)); } }
internal void TransferPartsInfo(AccessoryTransferEventArgs ev) { if (!_installed) { return; } object _extdataLink = GetExtDataLink(); if (_extdataLink == null) { return; } RemovePartsInfo(ev.DestinationSlotIndex); int _coordinateIndex = _chaCtrl.fileStatus.coordinateType; int n = (_extdataLink as IList).Count; for (int i = 0; i < n; i++) { object x = _extdataLink.RefElementAt(i).JsonClone(); if (Traverse.Create(x).Field("CoordinateIndex").GetValue <int>() != _coordinateIndex) { continue; } if (Traverse.Create(x).Field("Slot").GetValue <int>() != ev.SourceSlotIndex) { continue; } Traverse.Create(x).Field("Slot").SetValue(ev.DestinationSlotIndex); Traverse.Create(_extdataLink).Method("Add", new object[] { x }).GetValue(); } }
internal void TransferPartsInfo() { DebugMsg(LogLevel.Warning, $"[TransferPartsInfo][{ChaControl.GetFullname()}] fired"); if (QueueList.Count == 0) { TaskUnlock(); return; } for (int i = 0; i < QueueList.Count; i++) { int srcIndex = QueueList[i].srcSlot; int dstIndex = QueueList[i].dstSlot; DebugMsg(LogLevel.Warning, $"[TransferPartsInfo][{ChaControl.GetFullname()}][{srcIndex}][{dstIndex}]"); AccessoryTransferEventArgs ev = new AccessoryTransferEventArgs(srcIndex, dstIndex); MoreAccessoriesSupport.TransferPartsInfo(ChaControl, ev); MoreAccessoriesSupport.RemovePartsInfo(ChaControl, CurrentCoordinateIndex, srcIndex); foreach (string _name in SupportList) { Traverse.Create(this).Field(_name).Method("TransferPartsInfo", new object[] { ev }).GetValue(); Traverse.Create(this).Field(_name).Method("RemovePartsInfo", new object[] { srcIndex }).GetValue(); } } if (ReferralIndex < 7) { CopyPartsInfo(); } else { ChaControl.ChangeCoordinateTypeAndReload(false); ChaControl.StartCoroutine(RestorePartsInfoCoroutine()); } }
internal void AccessoryTransferEvent(AccessoryTransferEventArgs ev) { TransferAccSlotInfo(CurrentCoordinateIndex, ev); BuildCheckList(); }
private void AccessoriesApi_AccessoryTransferred(object sender, AccessoryTransferEventArgs e) => HideUI();
private void AccessoriesApi_AccessoryTransferred(object sender, AccessoryTransferEventArgs e) => MaterialEditorPlugin.GetCharaController(MakerAPI.GetCharacterControl())?.AccessoryTransferredEvent(sender, e);
private void AccessoriesApi_AccessoryTransferred(object sender, AccessoryTransferEventArgs e) => GetController(MakerAPI.GetCharacterControl()).TransferAccessoriesHandler(e);