Skip to content

Commit 34bfe2b

Browse files
committed
added AOW timer
1 parent cb4edb4 commit 34bfe2b

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

EQTool/EQTool.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@
335335
<Compile Include="Services\Handlers\ConHandler.cs" />
336336
<Compile Include="Services\Handlers\DisciplineCooldownHandler.cs" />
337337
<Compile Include="Services\Handlers\EnterWorldHandler.cs" />
338+
<Compile Include="Services\Handlers\AOWTimerHandler.cs" />
338339
<Compile Include="Services\Handlers\TriggerHandler.cs" />
339340
<Compile Include="Services\IO\FileReader.cs" />
340341
<Compile Include="Services\DebugOutput.cs" />
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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

Comments
 (0)