Пример #1
0
        internal static void ProcessQueue(List <QueueItem> Queue)
        {
            ChaControl chaCtrl       = MakerAPI.GetCharacterControl();
            object     MEpluginCtrl  = MaterialEditor.GetController(chaCtrl);
            object     HACpluginCtrl = HairAccessoryCustomizer.GetController(chaCtrl);
            object     ASSpluginCtrl = AccStateSync.GetController(chaCtrl);
            object     MRpluginCtrl  = MaterialRouter.GetController(chaCtrl);
            object     DBEpluginCtrl = DynamicBoneEditor.GetController(chaCtrl);
            object     APKpluginCtrl = AAAPK.GetController(chaCtrl);

            HairAccessoryCustomizer.HairAccessoryInfos = new Dictionary <int, HairAccessoryCustomizer.HairAccessoryInfo>();
            int Coordinate = chaCtrl.fileStatus.coordinateType;

            foreach (QueueItem item in Queue)
            {
                Logger.LogDebug($"{item.srcSlot} -> {item.dstSlot}");
                HairAccessoryCustomizer.StoreSetting(chaCtrl, HACpluginCtrl, item.srcSlot);                 // need to do this before move PartsInfo
                MoreAccessories.ModifyPartsInfo(chaCtrl, Coordinate, item.srcSlot, item.dstSlot);
                MaterialEditor.ModifySetting(MEpluginCtrl, Coordinate, item.srcSlot, item.dstSlot);
                AccStateSync.ModifySetting(ASSpluginCtrl, Coordinate, item.srcSlot, item.dstSlot);
                MaterialRouter.ModifySetting(MRpluginCtrl, Coordinate, item.srcSlot, item.dstSlot);
                DynamicBoneEditor.ModifySetting(DBEpluginCtrl, Coordinate, item.srcSlot, item.dstSlot);
                AAAPK.ModifySetting(APKpluginCtrl, Coordinate, item.srcSlot, item.dstSlot);
            }

            ChaCustom.CustomBase.Instance.chaCtrl.ChangeCoordinateTypeAndReload(false);
            ChaCustom.CustomBase.Instance.updateCustomUI = true;

            foreach (QueueItem item in Queue)
            {
                HairAccessoryCustomizer.ModifySetting(HACpluginCtrl, item.srcSlot, item.dstSlot);                 // need to do this after updateCustomUI
            }
        }
Пример #2
0
        private void Start()
        {
            Instance = this;
            Logger   = base.Logger;

            IsDark = typeof(ChaControl).GetProperties(AccessTools.all).Any(x => x.Name == "exType");

            MoreAccessories.InitSupport();
            MaterialEditor.InitSupport();
            HairAccessoryCustomizer.InitSupport();
            AccStateSync.InitSupport();
            MaterialRouter.InitSupport();
            DynamicBoneEditor.InitSupport();
            AAAPK.InitSupport();

            MakerAPI.RegisterCustomSubCategories += (sender, ev) =>
            {
                HooksInstance = Harmony.CreateAndPatchAll(typeof(Hooks));
                MaterialEditor.HookInit();

                MakerCategory category = new MakerCategory("05_ParameterTop", "tglMovUrAcc", MakerConstants.Parameter.Attribute.Position + 1, "MovUrAcc");

                CatBatchTransfer(ev, category);
                ev.AddControl(new MakerSeparator(category, this));

                CatBatchRemove(ev, category);
                ev.AddControl(new MakerSeparator(category, this));

                CatParentSort(ev, category);
                ev.AddControl(new MakerSeparator(category, this));

                CatPacking(ev, category);
                ev.AddControl(new MakerSeparator(category, this));

                CatTrimMoreacc(ev, category);

                ev.AddSubCategory(category);

                btnLock = false;
            };

            MakerAPI.MakerExiting += (sender, ev) =>
            {
                HooksInstance.UnpatchAll(HooksInstance.Id);
                HooksInstance = null;
            };
        }