Esempio n. 1
0
        static void Prefix(ActorMenu __instance, int key)
        {
            if (!Main.enabled || Main.settings.showAllMassage)
            {
                return;
            }
            if (!DateFile.instance.actorLifeMassage.ContainsKey(key))
            {
                return;
            }
            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();
                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;
        }
Esempio n. 2
0
        static bool Prefix(ActorMenu __instance, int key)
        {
            if (!Main.enabled || Main.settings.showAllMassage)
            {
                return(true);
            }
            if (!DateFile.instance.actorLifeMassage.ContainsKey(key))
            {
                return(true);
            }
            int backupId = Changer.GetBackupId();

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

                DateFile.instance.actorLifeMassage[backupId] = Changer.GetBackupMassage();
                Changer.ResetBackup();
            }
            List <int[]> newLifeMassage = new List <int[]> {
            };

            Changer.BackupMassage(key);

            //Main.Logger.Log("setp1" + changer.getActorName(key));
            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 messageTyp = DateFile.instance.actorLifeMassage[key][i][0];
                //Main.Logger.Log($"messageTyp: {messageTyp}");
                //根据经历类型ID进行筛选
                if (Changer.MessageTypToShow(messageTyp))
                {
                    newLifeMassage.Add(DateFile.instance.actorLifeMassage[key][i]);
                    //Main.Logger.Log("setp6:" + tlist[j]);
                }
            }
            DateFile.instance.actorLifeMassage[key] = newLifeMassage;
            return(true);
        }
Esempio n. 3
0
 static void Postfix(ActorMenu __instance, int key)
 {
     if (!Main.enabled || Main.settings.showAllMassage)
     {
         return;
     }
     if (!DateFile.instance.actorLifeMassage.ContainsKey(key))
     {
         return;
     }
     if (Changer.GetBackupId() == key)
     {
         //Main.Logger.Log("Exit-----" + "ID:" + key + "Count:" + changer.getBackupMassage(key).Count);
         DateFile.instance.actorLifeMassage[key] = Changer.GetBackupMassage();
         //Main.Logger.Log("ExitReset-----" + changer.getActorName(key) + "Count:" + DateFile.instance.actorLifeMassage[key].Count);
         Changer.ResetBackup();
     }
 }