예제 #1
0
        private static bool Prefix(SetGongFaTree __instance, int typ, int gangId, int gangValue)
        {
            if (!Main.enabled)
            {
                return(true);
            }
            int num = DateFile.instance.MianActorID();

            SingletonObject.getInstance <DynamicSetSprite>().SetImageSprite(__instance.gongFaImage, "gongFaImage", typ);
            __instance.gongFaNameText.text = DateFile.instance.baseSkillDate[101 + typ][0];
            int        num2 = (gangValue >= 0) ? Mathf.Max(gangValue / 100 - 2, 0) : (-1);
            List <int> list = new List <int>();

            for (int i = 0; i < __instance.gongFaLevelText.Length; i++)
            {
                __instance.gongFaLevelText[i].text = DateFile.instance.massageDate[7003][3].Split('|')[i];
            }
            for (int j = 0; j < DateFile.instance.allGongFaKey.Count; j++)
            {
                int num3 = DateFile.instance.allGongFaKey[j];
                if (int.Parse(DateFile.instance.gongFaDate[num3][1]) == typ && int.Parse(DateFile.instance.gongFaDate[num3][3]) == gangId)
                {
                    list.Add(num3);
                }
            }
            for (int k = 0; k < __instance.gongFaIcons.Length; k++)
            {
                if (k < list.Count)
                {
                    int num4 = list[k];
                    __instance.gongFaImages[k].SetActive(value: true);
                    __instance.gongFaImages[k].name = "GongFaImage," + num4;
                    if (DateFile.instance.actorGongFas.ContainsKey(num) && DateFile.instance.actorGongFas[num].ContainsKey(num4))
                    {
                        SingletonObject.getInstance <DynamicSetSprite>().SetImageSprite(__instance.gongFaIcons[k], "gongFaSprites", int.Parse(DateFile.instance.gongFaDate[num4][98]));
                        __instance.gongFaNames[k].text = DateFile.instance.SetColoer((num2 < k) ? 20002 : 10003, DateFile.instance.gongFaDate[num4][0]);
                        if (DateFile.instance.GetGongFaLevel(num, num4) >= 100 && DateFile.instance.GetGongFaFLevel(num, num4) >= 10)
                        {
                            __instance.gongFaStudyMassageText[k].text = DateFile.instance.SetColoer(20009, DateFile.instance.massageDate[7007][5].Split('|')[3]);
                        }
                        else
                        {
                            __instance.gongFaStudyMassageText[k].text = DateFile.instance.SetColoer(20008, DateFile.instance.massageDate[7007][5].Split('|')[2]);
                        }
                        continue;
                    }
                    if (num2 < k && int.Parse(DateFile.instance.gongFaDate[num4][16]) == 1 && !Main.settings.showAll)
                    {
                        __instance.gongFaIcons[k].GetComponent <PointerEnter>().enabled = false;
                        SingletonObject.getInstance <DynamicSetSprite>().SetImageSprite(__instance.gongFaIcons[k], "gongFaSprites", int.Parse(DateFile.instance.gongFaDate[num4][98]));
                        __instance.gongFaNames[k].text            = DateFile.instance.SetColoer(10004, DateFile.instance.massageDate[7007][5].Split('|')[0]);
                        __instance.gongFaStudyMassageText[k].text = DateFile.instance.SetColoer(10004, DateFile.instance.massageDate[7007][5].Split('|')[1]);
                    }
                    else
                    {
                        SingletonObject.getInstance <DynamicSetSprite>().SetImageSprite(__instance.gongFaIcons[k], "gongFaSprites", int.Parse(DateFile.instance.gongFaDate[num4][98]));
                        __instance.gongFaNames[k].text            = DateFile.instance.SetColoer((num2 < k) ? 20002 : 10003, DateFile.instance.gongFaDate[num4][0]);
                        __instance.gongFaStudyMassageText[k].text = "";
                    }
                    __instance.gongFaIcons[k].color = ((num2 < k) ? new Color(0f, 0f, 0f) : new Color(1f, 1f, 1f));
                }
                else
                {
                    __instance.gongFaImages[k].SetActive(value: false);
                }
            }
            return(false);
        }
예제 #2
0
        private static bool Prefix(SetGongFaTree __instance, int typ, int gangId, int gangValue)
        {
            //IL_04b0: Unknown result type (might be due to invalid IL or missing references)
            //IL_04c6: Unknown result type (might be due to invalid IL or missing references)
            if (!Main.enabled)
            {
                return(true);
            }
            int num = DateFile.instance.MianActorID();

            __instance.gongFaImage.sprite  = GetSprites.instance.gongFaImage[typ];
            __instance.gongFaNameText.text = DateFile.instance.baseSkillDate[101 + typ][0];
            int        num2  = (gangValue >= 0) ? Mathf.Max(gangValue / 100 - 2, 0) : (-1);
            List <int> list  = new List <int>();
            List <int> list2 = new List <int>(DateFile.instance.gongFaDate.Keys);

            for (int i = 0; i < __instance.gongFaLevelText.Length; i++)
            {
                __instance.gongFaLevelText[i].text = DateFile.instance.massageDate[7003][3].Split('|')[i];
            }
            for (int j = 0; j < list2.Count; j++)
            {
                int num3 = list2[j];
                if (int.Parse(DateFile.instance.gongFaDate[num3][1]) == typ && int.Parse(DateFile.instance.gongFaDate[num3][3]) == gangId)
                {
                    list.Add(num3);
                }
            }
            for (int k = 0; k < __instance.gongFaIcons.Length; k++)
            {
                if (k < list.Count)
                {
                    int num4 = list[k];
                    __instance.gongFaImages[k].SetActive(true);
                    __instance.gongFaImages[k].name = "GongFaImage," + num4;
                    if (DateFile.instance.actorGongFas.ContainsKey(num) && DateFile.instance.actorGongFas[num].ContainsKey(num4))
                    {
                        __instance.gongFaIcons[k].sprite = GetSprites.instance.gongFaSprites[int.Parse(DateFile.instance.gongFaDate[num4][98])];
                        __instance.gongFaNames[k].text   = DateFile.instance.SetColoer((num2 < k) ? 20002 : 10003, DateFile.instance.gongFaDate[num4][0]);
                        if (DateFile.instance.GetGongFaLevel(num, num4) >= 100 && DateFile.instance.GetGongFaFLevel(num, num4) >= 10)
                        {
                            __instance.gongFaStudyMassageText[k].text = DateFile.instance.SetColoer(20009, DateFile.instance.massageDate[7007][5].Split('|')[3]);
                        }
                        else
                        {
                            __instance.gongFaStudyMassageText[k].text = DateFile.instance.SetColoer(20008, DateFile.instance.massageDate[7007][5].Split('|')[2]);
                        }
                        continue;
                    }
                    if (num2 < k && int.Parse(DateFile.instance.gongFaDate[num4][16]) == 1 && !Main.settings.showAll)
                    {
                        __instance.gongFaIcons[k].GetComponent <PointerEnter>().enabled = false;
                        __instance.gongFaIcons[k].sprite          = GetSprites.instance.gongFaSprites[int.Parse(DateFile.instance.gongFaDate[num4][98])];
                        __instance.gongFaNames[k].text            = DateFile.instance.SetColoer(10004, DateFile.instance.massageDate[7007][5].Split('|')[0]);
                        __instance.gongFaStudyMassageText[k].text = DateFile.instance.SetColoer(10004, DateFile.instance.massageDate[7007][5].Split('|')[1]);
                    }
                    else
                    {
                        __instance.gongFaIcons[k].sprite          = GetSprites.instance.gongFaSprites[int.Parse(DateFile.instance.gongFaDate[num4][98])];
                        __instance.gongFaNames[k].text            = DateFile.instance.SetColoer((num2 < k) ? 20002 : 10003, DateFile.instance.gongFaDate[num4][0]);
                        __instance.gongFaStudyMassageText[k].text = "";
                    }
                    __instance.gongFaIcons[k].color = (num2 < k) ? new Color(0f, 0f, 0f) : new Color(1f, 1f, 1f);
                }
                else
                {
                    __instance.gongFaImages[k].SetActive(false);
                }
            }
            return(false);
        }