Exemplo n.º 1
0
 public static Dictionary <int, int> LoadTipsMassage(string root, string name)
 {
     if (DateLoader.LoadBaseDate(root, name, out Dictionary <int, Dictionary <int, string> > TipsMassageDate)
         //&& DateLoader.IndexCheck("TipsMassageDate", TipsMassageDate, DateFile.instance.actorFameDate)
         )
     {
         Dictionary <int, int> idRemap = new Dictionary <int, int>();
         int cnt   = 0;
         int maxid = GetMaxid(DateFile.instance.tipsMassageDate);
         lock (DateFile.instance.tipsMassageDate)
         {
             foreach (int id in TipsMassageDate.Keys)
             {
                 idRemap.Add(id, id + maxid);
                 if (!DateFile.instance.tipsMassageDate.Keys.Contains(idRemap[id]))
                 {
                     DateFile.instance.tipsMassageDate.Add(idRemap[id], TipsMassageDate[id]);
                     cnt++;
                 }
             }
         }
         Main.Logger.Log($"成功载入{cnt}/{TipsMassageDate.Keys.ToArray().Length}个提示信息");
     }
     else
     {
         Main.Logger.Log($"载入提示信息失败");
     }
     return(null);
 }
Exemplo n.º 2
0
        }   // End of LoadOtherDate

        public static void LoadFameDate(string root, string name)
        {
            if (DateLoader.LoadBaseDate(root, name, out Dictionary <int, Dictionary <int, string> > FameDate) &&
                DateLoader.IndexCheck("FameDate", FameDate, DateFile.instance.actorFameDate))
            {
                int cnt = 0;
                lock (DateFile.instance.actorFameDate)
                {
                    foreach (int id in FameDate.Keys)
                    {
                        if (!DateFile.instance.actorFameDate.Keys.Contains(id))
                        {
                            DateFile.instance.actorFameDate.Add(id, FameDate[id]);
                            cnt++;
                            Main.Logger.Log($"成功载入名誉影响{FameDate[id][0]}, ID:{id}.");
                        }
                    }
                }
                Main.Logger.Log($"成功载入{cnt}/{FameDate.Keys.ToArray().Length}个名誉影响");
            }
            else
            {
                Main.Logger.Log($"载入名誉项失败");
            }
        }