示例#1
0
        static void Reset_Gifts(Sprite ___wantedBg, WishItemData ___wishData, List <ItemObject> ___allGiftItem, ref GridPage ___page, Sprite ___normalBg)
        {
            int num = ___page.allIcons.Count * ___page.curPage;

            for (int i = 0; i < ___page.allIcons.Count; i++)
            {
                int             num2            = i + num;
                GridIconWithNum gridIconWithNum = ___page.allIcons[i] as GridIconWithNum;

                if (num2 < ___allGiftItem.Count && ___wishData != null && ___wishData.ItemId == ___allGiftItem[num2].ItemDataId)
                {
                    Sprite sprite = ___wantedBg;
                    gridIconWithNum.selectableBg.image.sprite = sprite;
                    gridIconWithNum.Enable();
                    continue;
                }

                gridIconWithNum.selectableBg.image.sprite = ___normalBg;
                SpriteState ss = gridIconWithNum.selectableBg.spriteState;
                ss.highlightedSprite = bkgs;
                ss.pressedSprite     = bkgs;
                gridIconWithNum.selectableBg.spriteState = ss;
            }
        }
示例#2
0
        static void Update_Gifts(ref GridPage ___page, List <ItemObject> ___allGiftItem, Actor ___targetActor, Sprite ___normalBg, Sprite ___wantedBg, int ___curItemIndex, WishItemData ___wishData)
        {
            ReloadTextures();
            int num = ___page.allIcons.Count * ___page.curPage;

            List <int> giftHistory = FavorUtility.GetGiftHistory(___targetActor.InstanceId);

            for (int i = 0; i < ___page.allIcons.Count; i++)
            {
                int             num2            = i + num;
                GridIconWithNum gridIconWithNum = ___page.allIcons[i] as GridIconWithNum;
                SpriteState     ss = gridIconWithNum.selectableBg.spriteState;
                if (num2 < ___allGiftItem.Count)
                {
                    if (___wishData != null && ___wishData.ItemId == ___allGiftItem[num2].ItemDataId)
                    {
                        Sprite sprite = ___wantedBg;
                        gridIconWithNum.selectableBg.image.sprite = sprite;
                        gridIconWithNum.Enable();
                        continue;
                    }

                    if ((settings.ShowOnlyKnown && !giftHistory.Contains(___allGiftItem[num2].ItemBase.ID)))
                    {
                        ss.highlightedSprite = ___normalBg;
                        ss.pressedSprite     = ___normalBg;
                        continue;
                    }

                    GiveGiftResult result = FavorUtility.GetFavorBehaviorInfo(___targetActor.InstanceId, ___allGiftItem[num2].ItemBase.ID);

                    //Dbgl($"num2 {num2} curItemIndex {___curItemIndex} i {i}");

                    switch (result.FeeLevel)
                    {
                    case FeeLevelEnum.Hate:
                        //Dbgl($"item {i}: {___allGiftItem[num2].ItemBase.ID} HATE");
                        if (settings.ShowHated)
                        {
                            gridIconWithNum.selectableBg.image.sprite = (num2 != ___curItemIndex ? hate : hates);
                            ss.highlightedSprite = hates;
                            ss.pressedSprite     = hates;
                        }
                        break;

                    case FeeLevelEnum.DisLike:
                        //Dbgl($"item {i}: {___allGiftItem[num2].ItemBase.ID} DISLIKE");
                        if (settings.ShowDisliked)
                        {
                            gridIconWithNum.selectableBg.image.sprite = (num2 != ___curItemIndex ? dislike : dislikes);
                            ss.highlightedSprite = dislikes;
                            ss.pressedSprite     = dislikes;
                        }
                        break;

                    case FeeLevelEnum.Neutral:
                        //Dbgl($"item {i}: {___allGiftItem[num2].ItemBase.ID} NEUTRAL");
                        if (settings.ShowNeutral)
                        {
                            gridIconWithNum.selectableBg.image.sprite = (num2 != ___curItemIndex ? neutral : neutrals);
                            ss.highlightedSprite = neutrals;
                            ss.pressedSprite     = neutrals;
                        }
                        break;

                    case FeeLevelEnum.Like:
                        //Dbgl($"item {i}: {___allGiftItem[num2].ItemBase.ID} LIKE");
                        if (settings.ShowLiked)
                        {
                            gridIconWithNum.selectableBg.image.sprite = (num2 != ___curItemIndex ? like : likes);
                            ss.highlightedSprite = likes;
                            ss.pressedSprite     = likes;
                        }
                        break;

                    case FeeLevelEnum.Excellent:
                        //Dbgl($"item {i}: {___allGiftItem[num2].ItemBase.ID} LOVE");
                        if (settings.ShowLoved)
                        {
                            gridIconWithNum.selectableBg.image.sprite = (num2 != ___curItemIndex ? love : loves);
                            ss.highlightedSprite = loves;
                            ss.pressedSprite     = loves;
                        }
                        break;
                    }
                }
                else
                {
                    ss.highlightedSprite = ___normalBg;
                    ss.pressedSprite     = ___normalBg;
                }
                gridIconWithNum.selectableBg.spriteState = ss;
            }
        }