Пример #1
0
        public void RenameAlert(string name, string newName)
        {
            FindAlertData findAlert = savedAlerts[name];

            AlertByFind.RenameAlert(name, newName, okAction:
                                    () =>
            {
                findAlert.desc.name  = newName;
                savedAlerts[newName] = findAlert;
                savedAlerts.Remove(name);
            });
        }
Пример #2
0
 public override void ExposeData()
 {
     Scribe_Collections.Look(ref savedAlerts, "alertsByFind");
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         if (savedAlerts == null)
         {
             savedAlerts = new Dictionary <string, FindAlertData>();
         }
         foreach (var kvp in savedAlerts)
         {
             AlertByFind.AddAlert(new FindAlertData(kvp.Value.map, kvp.Value.desc.Clone(kvp.Value.map)), overwrite: true);                    //Shouldn't need to overwrite, shouldn't popup window during ExposeData anyway
         }
     }
 }
Пример #3
0
        public void AddAlert(string name, FindDescription desc)
        {
            desc.name = name;             //Remember for current copy

            Map map = desc.allMaps ? null : Find.CurrentMap;

            //Save two FindDescriptions: One to be scribed with ref string, other put in alert with real refs
            //This was a good idea at one point but now I don't care to consolidate them into one ist
            FindDescription refDesc = desc.Clone(null);             //This one has ref string

            refDesc.name = name;
            FindDescription alertDesc = refDesc.Clone(map);             //This one re-resolves reference for this map.

            AlertByFind.AddAlert(new FindAlertData(map, alertDesc), okAction: () => savedAlerts[name] = new FindAlertData(map, refDesc));
        }
Пример #4
0
 public void SetComp(string name, CompareType c)
 {
     AlertByFind.SetComp(name, c);
     savedAlerts[name].desc.countComp = c;
 }
Пример #5
0
 public void SetCount(string name, int c)
 {
     AlertByFind.SetCount(name, c);
     savedAlerts[name].desc.countToAlert = c;
 }
Пример #6
0
 public void SetTicks(string name, int t)
 {
     AlertByFind.SetTicks(name, t);
     savedAlerts[name].desc.ticksToShowAlert = t;
 }
Пример #7
0
 public void SetPriority(string name, AlertPriority p)
 {
     AlertByFind.SetPriority(name, p);
     savedAlerts[name].desc.alertPriority = p;
 }
Пример #8
0
 public void RemoveAlert(string name)
 {
     AlertByFind.RemoveAlert(name);
     savedAlerts.Remove(name);
 }