private void AccessoriesApi_SelectedMakerAccSlotChanged(object sender, AccessorySlotEventArgs e)
        {
            if (ReloadingChara)
            {
                return;
            }
            if (!MakerAPI.InsideAndLoaded)
            {
                return;
            }

            var  controller = GetController(MakerAPI.GetCharacterControl());
            bool hairAcc    = controller.IsHairAccessory(e.SlotIndex);
            bool didInit    = controller.InitHairAccessoryInfo(e.SlotIndex);

            if (hairAcc)
            {
                if (didInit)
                {
                    //switching to a hair accessory that previously had no data. Meaning this card was made before this plugin. ColorMatch and HairGloss should be off.
                    controller.SetColorMatch(false, e.SlotIndex);
                    controller.SetHairGloss(false, e.SlotIndex);
                }

                InitCurrentSlot(controller, true);
                controller.UpdateAccessory(e.SlotIndex);
            }
            else
            {
                InitCurrentSlot(controller, false);
            }
        }
Example #2
0
        internal void AccessoryKindChangeEvent(object sender, AccessorySlotEventArgs e)
        {
            AccessoryDynamicBoneData.RemoveAll(x => x.CoordinateIndex == CurrentCoordinateIndex && x.Slot == e.SlotIndex);

            if (MakerAPI.InsideAndLoaded && UI.Visible)
            {
                UI.ShowUI(0);
            }
        }
Example #3
0
        private static void AccessoriesApi_AccessoryKindChanged(object sender, AccessorySlotEventArgs e)
        {
            var controller = GetCharaController(MakerAPI.GetCharacterControl());

            if (controller != null)
            {
                controller.AccessoryKindChangeEvent(sender, e);
            }
        }
Example #4
0
        private static void AccessoriesApi_AccessoryKindChanged(object sender, AccessorySlotEventArgs e)
        {
            var controller = GetMakerCharaController();

            if (controller != null)
            {
                controller.AccessoryKindChangeEvent(sender, e);
            }
            UI.ToggleButtonVisibility();
        }
Example #5
0
 private void AccessoriesApi_SelectedMakerAccSlotChanged(object sender, AccessorySlotEventArgs e)
 {
     if (MakerAPI.InsideAndLoaded)
     {
         if (UI.Visible)
         {
             UI.ShowUI(0);
         }
         UI.ToggleButtonVisibility();
     }
 }
Example #6
0
            internal void AccessorySelectedSlotChangeEvent(object sender, AccessorySlotEventArgs e)
            {
                if (!MakerAPI.InsideAndLoaded)
                {
                    return;
                }

                AccessorySelectedSlotChanging = true;

                if (UISystem.gameObject.activeInHierarchy)
                {
                    PopulateListAccessory();
                }

                ChaControl.StartCoroutine(ResetEvents());
            }
        private void AccessoriesApi_AccessoryKindChanged(object sender, AccessorySlotEventArgs e)
        {
            if (ReloadingChara)
            {
                return;
            }

            var  controller = GetController(MakerAPI.GetCharacterControl());
            bool hairAcc    = controller.IsHairAccessory(e.SlotIndex);

            controller.InitHairAccessoryInfo(e.SlotIndex);
            if (hairAcc)
            {
                InitCurrentSlot(controller, true);
                controller.UpdateAccessory(e.SlotIndex);
            }
            else
            {
                InitCurrentSlot(controller, false);
            }
        }
Example #8
0
            internal void AccessoryKindChangeEvent(object sender, AccessorySlotEventArgs e)
            {
                if (AccessorySelectedSlotChanging)
                {
                    return;
                }
                if (CoordinateChanging)
                {
                    return;
                }

                //User switched accessories, remove all edited properties for this slot
                RendererPropertyList.RemoveAll(x => x.ObjectType == ObjectType.Accessory && x.CoordinateIndex == CurrentCoordinateIndex && x.Slot == e.SlotIndex);
                MaterialFloatPropertyList.RemoveAll(x => x.ObjectType == ObjectType.Accessory && x.CoordinateIndex == CurrentCoordinateIndex && x.Slot == e.SlotIndex);
                MaterialColorPropertyList.RemoveAll(x => x.ObjectType == ObjectType.Accessory && x.CoordinateIndex == CurrentCoordinateIndex && x.Slot == e.SlotIndex);

                if (UISystem.gameObject.activeInHierarchy)
                {
                    PopulateListAccessory();
                }
            }
Example #9
0
        // 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();
                }
            }
        }
 private void AccessoriesApi_SelectedMakerAccSlotChanged(object sender, AccessorySlotEventArgs e) => HideUI();
 private void AccessoriesApi_AccessoryKindChanged(object sender, AccessorySlotEventArgs e) => HideUI();
Example #12
0
 private void AccessoriesApi_AccessoryKindChanged(object sender, AccessorySlotEventArgs e) => MaterialEditorPlugin.GetCharaController(MakerAPI.GetCharacterControl())?.AccessoryKindChangeEvent(sender, e);
Example #13
0
 private void AccessoriesApi_SelectedMakerAccSlotChanged(object sender, AccessorySlotEventArgs e) => GetCharaController(MakerAPI.GetCharacterControl())?.AccessorySelectedSlotChangeEvent(sender, e);