Beispiel #1
0
 public void RemoveAllAlarmsForModule(FailureModule fm)
 {
     audioSource.audio.volume = 0;
     Logger.Info("[DangIt] [AlarmManager] Removing alarms...");
     if (this.loops.Keys.Contains(fm))
     {
         fm.AlarmsDoneCallback();
         loops.Remove(fm);
         RemovePartFailure(fm.part);
     }
 }
Beispiel #2
0
 public bool HasAlarmsForModule(FailureModule fm)
 {
     if (this.loops.Keys.Contains(fm))
     {
         int i;
         loops.TryGetValue(fm, out i);
         if (i != 0)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #3
0
 public void AddAlarm(FailureModule fm, int number)
 {
     AddPartFailure(fm.part);
     if (number != 0)
     {
         Log.Info("[DangIt] [AlarmManager] Adding '" + number + "' alarms from '" + fm.ToString());
         loops.Add(fm, number);
     }
     else
     {
         Log.Info("[DangIt] [AlarmManager] No alarms added: Would have added 0 alarms");
     }
 }
Beispiel #4
0
 public void AddAlarm(FailureModule fm, int number)
 {
     AddPartFailure(fm.part);
     audioSource.audio.volume = DangIt.Instance.CurrentSettings.GetMappedVolume(); //This seems like an OK place for this, because if I put it in the constructor...
                                                                                   // ...you would have to reboot to change it, but I don't want to add lag by adding it to each frame in Update()
     if (number != 0)
     {
         Logger.Info("[DangIt] [AlarmManager] Adding '" + number.ToString() + "' alarms from '" + fm.ToString() + "'");
         loops.Add(fm, number);
     }
     else
     {
         Logger.Info("[DangIt] [AlarmManager] No alarms added: Would have added 0 alarms");
     }
 }