Example #1
0
 private void OnPlayerNewAbnormality(object source, AbnormalityEventArgs args)
 {
     Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Loaded, new Action(() => {
         Parts.AbnormalityControl AbnormalityBox = new Parts.AbnormalityControl(args.Abnormality);
         this.ActiveAbnormalities.Add(args.Abnormality.InternalID, AbnormalityBox);
         this.RedrawComponent();
     }));
 }
 private void OnPlayerNewAbnormality(object source, AbnormalityEventArgs args)
 {
     // Ignore abnormalities that aren't enabled for this tray
     if (!UserSettings.PlayerConfig.Overlay.AbnormalitiesWidget.BarPresets[AbnormalityTrayIndex].AcceptedAbnormalities.Contains(args.Abnormality.InternalID))
     {
         return;
     }
     Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Loaded, new Action(() => {
         this.WidgetHasContent = true;
         Parts.AbnormalityControl AbnormalityBox = new Parts.AbnormalityControl()
         {
             ShowAbnormalityTimerText   = UserSettings.PlayerConfig.Overlay.AbnormalitiesWidget.BarPresets[AbnormalityTrayIndex].ShowTimeLeftText,
             AbnormalityTimerTextFormat = UserSettings.PlayerConfig.Overlay.AbnormalitiesWidget.BarPresets[AbnormalityTrayIndex].TimeLeftTextFormat
         };
         AbnormalityBox.Initialize(args.Abnormality);
         this.ActiveAbnormalities.Add(args.Abnormality.InternalID, AbnormalityBox);
         this.RedrawComponent();
     }));
 }