Exemplo n.º 1
0
            public CustomSelectListCtrlEventArgs(GameObject _gameObject)
            {
                CustomSelectInfoComponent _cmp = _gameObject.GetComponent <CustomSelectInfoComponent>();

                if (_cmp == null || !_cmp.tgl.interactable)
                {
                    return;
                }

                if (_cmp.info.index >= UniversalAutoResolver.BaseSlotID)
                {
                    ResolveInfo _info = UniversalAutoResolver.TryGetResolutionInfo((ChaListDefine.CategoryNo)_cmp.info.category, _cmp.info.index);
                    if (_info != null)
                    {
                        CategoryNo  = (int)_info.CategoryNo;
                        GUID        = _info.GUID;
                        ItemID      = _info.LocalSlot;
                        LocalItemID = _info.Slot;
                    }
                }
                else
                {
                    CategoryNo  = _cmp.info.category;
                    ItemID      = _cmp.info.index;
                    LocalItemID = -1;
                }
            }
Exemplo n.º 2
0
        internal static void CustomSelectListCtrlPostfix(CustomSelectListCtrl __instance, GameObject obj)
        {
            if (null == obj)
            {
                return;
            }
            CustomSelectInfoComponent component = obj.GetComponent <CustomSelectInfoComponent>();

            if (null == component)
            {
                return;
            }
            if (!component.tgl.interactable)
            {
                return;
            }

            if (__instance.onChangeItemFunc != null)
            {
                if (component.info.index >= UniversalAutoResolver.BaseSlotID)
                {
                    ResolveInfo Info = UniversalAutoResolver.TryGetResolutionInfo((ChaListDefine.CategoryNo)component.info.category, component.info.index);
                    if (Info != null)
                    {
                        BepInEx.Logging.Logger.LogWarning($"[CustomSelectListCtrlPostfix][{Info.GUID}][{(int) Info.CategoryNo}][{Info.CategoryNo}][{Info.Slot}][{Info.LocalSlot}]");
                    }
                }
                else
                {
                    BepInEx.Logging.Logger.LogWarning($"[CustomSelectListCtrlPostfix][hardmod][{(ChaListDefine.CategoryNo) component.info.category}][{component.info.category}][{component.info.index}]");
                }
            }
        }
 // Disable indicator for new items
 private static void HarmonyPatch_CustomSelectInfoComponent_Disvisible(CustomSelectInfoComponent __instance) => __instance.objNew.SetActiveIfDifferent(false);