Exemple #1
0
        static void Prefix(ActorMenu __instance, int key)
        {
            if (!Main.enabled || Main.settings.showAllMassage)
            {
                return;
            }
            if (!DateFile.instance.actorLifeMassage.ContainsKey(key))
            {
                return;
            }
            Changer changer  = new Changer();
            int     backupId = changer.getBackupId();

            //Main.Logger.Log("Pre-----" + changer.getActorName(key));
            if (backupId == key)
            {
                return;
            }
            if (backupId != 0)
            {
                //Main.Logger.Log("reset-----" + changer.getActorName(key) + "Count:" + DateFile.instance.actorLifeMassage[key].Count);

                DateFile.instance.actorLifeMassage[backupId] = changer.getBackupMassage(backupId);
                changer.resetBackup();
            }
            List <int[]> newLifeMassage = new List <int[]> {
            };

            changer.backupMassage(key);

            //Main.Logger.Log("setp1" + changer.getActorName(key));
            List <int> tlist = changer.getTypeList();



            int count = DateFile.instance.actorLifeMassage[key].Count;

            //Main.Logger.Log("setp2:MaxCount:" + count);
            //Main.Logger.Log("setp3:showCount:" + tlist.Count);


            for (int i = 0; i < count; i++)
            {
                //Main.Logger.Log("setp4:" + i);
                int[] array = DateFile.instance.actorLifeMassage[key][i];
                int   key2  = array[0];//根据经历类型ID进行筛选
                for (int j = 0; j < tlist.Count; j++)
                {
                    if (tlist[j] == key2)
                    {
                        newLifeMassage.Add(DateFile.instance.actorLifeMassage[key][i]);
                        //Main.Logger.Log("setp6:" + tlist[j]);
                        break;
                    }
                }
            }
            DateFile.instance.actorLifeMassage[key] = newLifeMassage;
        }