private void AdvancedParent() { if (!MakerAPI.InsideAndLoaded) { return; } if (AdditionalAccessoryAdvancedParentUI.Instance.enabled) { AdditionalAccessoryAdvancedParentUI.Hide(); } else { int currentSlot = AccessoriesApi.SelectedMakerAccSlot; AdditionalAccessoryControlsController aacController = MakerAPI.GetCharacterControl().gameObject.GetComponent <AdditionalAccessoryControlsController>(); AdditionalAccessoryAdvancedParentUI.Show(aacController.SlotData[currentSlot], MakerAPI.GetCharacterControl()); } }
// Handle Maker Acc Slot Change private void UpdateUI(object sender, AccessorySlotEventArgs args) { if (args.SlotIndex >= 0) { #if DEBUG Log.LogInfo($"Changing Displayed Slot to {args.SlotIndex}"); #endif AdditionalAccessoryControlsController aacController = MakerAPI.GetCharacterControl().gameObject.GetComponent <AdditionalAccessoryControlsController>(); if (args.SlotIndex >= aacController.SlotData.Length) { #if DEBUG Log.LogInfo($"New Slot Added: {args.SlotIndex}"); #endif aacController.AddOrUpdateSlot(args.SlotIndex, AdditionalAccessorySlotData.EmptySlot(args.SlotIndex)); } if (aacController.SlotData[args.SlotIndex] != null && !aacController.SlotData[args.SlotIndex].IsEmpty) { #if DEBUG Log.LogInfo($"New Slot Set: {aacController.SlotData[args.SlotIndex]}"); #endif AdditionalAccessoryUI.Change(aacController.SlotData[args.SlotIndex], aacController.ChaControl); advancedParentLabel.Text = $"Adv Parent: {aacController.SlotData[args.SlotIndex].AdvancedParentShort}"; AdditionalAccessoryAdvancedParentUI.Change(aacController.SlotData[args.SlotIndex], aacController.ChaControl); } else { #if DEBUG Log.LogInfo("No Slot Data or Slot Empty."); #endif advancedParentLabel.Text = "Adv Parent: None"; AdditionalAccessoryUI.Hide(); AdditionalAccessoryAdvancedParentUI.Hide(); } } }