|
| 1 | +using EQTool.Models; |
| 2 | +using EQTool.ViewModels; |
| 3 | +using EQTool.ViewModels.SpellWindow; |
| 4 | +using System; |
| 5 | +using System.Linq; |
| 6 | +using System.Windows.Media; |
| 7 | + |
| 8 | +namespace EQTool.Services.Handlers |
| 9 | +{ |
| 10 | + public class AOWTimerHandler : BaseHandler |
| 11 | + { |
| 12 | + private readonly EQSpells spells; |
| 13 | + private readonly SpellWindowViewModel spellWindowViewModel; |
| 14 | + |
| 15 | + public AOWTimerHandler(EQSpells spells, SpellWindowViewModel spellWindowViewModel, BaseHandlerData baseHandlerData) : base(baseHandlerData) |
| 16 | + { |
| 17 | + this.spells = spells; |
| 18 | + this.spellWindowViewModel = spellWindowViewModel; |
| 19 | + logEvents.LineEvent += LogEvents_LineEvent; |
| 20 | + } |
| 21 | + |
| 22 | + private void LogEvents_LineEvent(object sender, LineEvent e) |
| 23 | + { |
| 24 | + if (e.Line == "The Avatar of War shouts 'Who dares defile my temple?! Come forth and face me!'") |
| 25 | + { |
| 26 | + var spell = spells.AllSpells.FirstOrDefault(a => a.name == "Spirit of Wolf"); |
| 27 | + appDispatcher.DispatchUI(() => |
| 28 | + { |
| 29 | + spellWindowViewModel.TryAdd(new TimerViewModel |
| 30 | + { |
| 31 | + PercentLeft = 100, |
| 32 | + GroupName = CustomTimer.CustomerTime, |
| 33 | + Name = $"The Avatar of War Lockout", |
| 34 | + Rect = spell.Rect, |
| 35 | + Icon = spell.SpellIcon, |
| 36 | + TotalDuration = TimeSpan.FromMinutes(20), |
| 37 | + TotalRemainingDuration = TimeSpan.FromMinutes(20), |
| 38 | + UpdatedDateTime = DateTime.Now, |
| 39 | + ProgressBarColor = Brushes.Orchid |
| 40 | + }, true); |
| 41 | + }); |
| 42 | + } |
| 43 | + |
| 44 | + } |
| 45 | + } |
| 46 | +} |
0 commit comments