/
Details_TimeLine.lua
1785 lines (1451 loc) · 63.5 KB
/
Details_TimeLine.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
local addonId, timeLine = ...
local Loc = LibStub("AceLocale-3.0"):GetLocale("Details_TimeLine")
local Details = Details
local detailsFramework = _G.DetailsFramework
--create the plugin object
local TimeLine = Details:NewPluginObject("Details_TimeLine", _G.DETAILSPLUGIN_ALWAYSENABLED)
TimeLine:SetPluginDescription(Loc ["STRING_PLUGIN_DESC"])
TimeLine.version_string = "v109"
timeLine.PluginAbsoluteName = "DETAILS_PLUGIN_TIME_LINE"
local timeLineFrame = TimeLine.Frame
detailsFramework:ApplyStandardBackdrop(timeLineFrame)
local debugmode = false
local _
local wipe = table.wipe
local bitBand = bit.band
local CreateFrame = CreateFrame
local unpack = unpack
local _GetSpellInfo = Details.getspellinfo
local GetSpellInfo = GetSpellInfo
local myName = UnitName("player")
local GameCooltip = GameCooltip
local date = date
local CONST_MENU_Y_POS = 24
local CONST_TIMELINE_LABELS_Y = 55
local CONST_LINE_START_Y = 52
--event frame
TimeLine.EventFrame = CreateFrame("frame")
--table.insert(UISpecialFrames, "Details_TimeLine")
local tabType_Cooldown = "cooldowns_timeline"
local tabType_Debuff = "debuff_timeline"
local tabType_EnemySpells = "spellcast_boss"
local tabType_BossSpells = "boss_spells"
local allDisplayTypes = {
tabType_Cooldown,
tabType_Debuff,
tabType_EnemySpells,
tabType_BossSpells
}
local red = {1, 0, 0, .25}
local green = {0, 1, 0, .25}
local class_icons_with_alpha = [[Interface\AddOns\Details\images\classes_small_alpha]]
local BUTTON_BACKGROUND_COLOR = {.5, .5, .5, .3}
local BUTTON_BACKGROUND_COLOR2 = {.4, .4, .4, .3}
local combatObject
--shortcut for current combat
local bIsInCombat = false
local function CreatePluginFrames()
local DetailsPluginContainerWindow = DetailsPluginContainerWindow
TimeLine.combat_data = {} --temp avoid errors on initialization
if (not Details) then
return
end
--templates
local options_dropdown_template = detailsFramework:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")
local options_button_template = detailsFramework:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")
detailsFramework.button_templates ["ADL_BUTTON_TEMPLATE"] = {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {.3, .3, .3, .9},
onentercolor = {.6, .6, .6, .9},
backdropbordercolor = {0, 0, 0, 1},
onenterbordercolor = {0, 0, 0, 1},
}
options_button_template = detailsFramework:GetTemplate("button", "ADL_BUTTON_TEMPLATE")
local currentSelectedType = allDisplayTypes[2]
local currentSegment = 1
local closeButton = detailsFramework:CreateCloseButton(timeLineFrame)
closeButton:SetPoint("topright", timeLineFrame, "topright", -4, -6)
--title bar
local titleBar = CreateFrame("frame", nil, timeLineFrame, "BackdropTemplate")
titleBar:SetPoint("topleft", timeLineFrame, "topleft", 2, -3)
titleBar:SetPoint("topright", timeLineFrame, "topright", -2, -3)
titleBar:SetHeight(20)
titleBar:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
titleBar:SetBackdropColor(.5, .5, .5, 1)
titleBar:SetBackdropBorderColor(0, 0, 0, 1)
local nameBackgroundTexture = timeLineFrame:CreateTexture(nil, "background")
nameBackgroundTexture:SetTexture([[Interface\PetBattles\_PetBattleHorizTile]], true)
nameBackgroundTexture:SetHorizTile(true)
nameBackgroundTexture:SetTexCoord(0, 1, 126/256, 19/256)
nameBackgroundTexture:SetPoint("topleft", timeLineFrame, "topleft", 2, -22)
nameBackgroundTexture:SetPoint("bottomright", timeLineFrame, "bottomright")
nameBackgroundTexture:SetHeight(54)
nameBackgroundTexture:SetVertexColor(0, 0, 0, 0.2)
--window title
local titleLabel = detailsFramework:NewLabel(titleBar, titleBar, nil, "titulo", "Details! Time Line", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
titleLabel:SetPoint("center", timeLineFrame, "center")
titleLabel:SetPoint("top", timeLineFrame, "top", 0, -7)
local search
TimeLine.debuff_temp_table = {}
TimeLine.current_enemy_spells = {}
TimeLine.current_spells_individual = {}
--record if button is shown
TimeLine.showing = false
TimeLine.open = false
--record if boss window is open or not
TimeLine.window_open = false
TimeLine.rows = {}
--new combat
TimeLine.current_battle_cooldowns_timeline = {}
--called on "COMBAT_PLAYER_ENTER" details event
function TimeLine:NewCombat()
TimeLine.EventFrame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
TimeLine.current_battle_cooldowns_timeline = {}
TimeLine.debuff_temp_table = {}
TimeLine.current_enemy_spells = {}
TimeLine.current_spells_individual = {}
end
function TimeLine:CanShowIcon()
if (#TimeLine.combat_data > 0) then
TimeLine:ShowIcon()
else
TimeLine:HideIcon()
end
end
function TimeLine:FinishCombat(bIsCombatValid)
TimeLine.EventFrame:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
if (not bIsCombatValid) then
wipe(TimeLine.current_battle_cooldowns_timeline or {})
wipe(TimeLine.debuff_temp_table or {})
wipe(TimeLine.current_enemy_spells or {})
wipe(TimeLine.current_spells_individual or {})
return
end
--is in debug mode?
if (debugmode and combatObject and not combatObject.is_boss) then
combatObject.is_boss = {
index = 1,
name = Details:GetBossName(1098, 1),
zone = "Throne of Thunder",
mapid = 1098,
encounter = "Jin'Rohk the Breaker"
}
end
--is a boss encounter
if (combatObject and combatObject.is_boss) then
--combat information
table.insert(TimeLine.combat_data, 1, {})
--save the encounter elapsed time
TimeLine.combat_data[1].total_time = combatObject:GetCombatTime()
--save the encounter name
local boss = combatObject.is_boss
if (boss) then
TimeLine.combat_data[1].name = boss.name
else
TimeLine.combat_data[1].name = combatObject.enemy
end
--save the date
local startDate, endDate = combatObject:GetDate()
TimeLine.combat_data[1].date_start = startDate or date("%H:%M:%S")
TimeLine.combat_data[1].date_end = endDate or date("%H:%M:%S")
--cooldowns
table.insert(TimeLine.cooldowns_timeline, 1, TimeLine.current_battle_cooldowns_timeline)
--debuffs - close opened debuffs
for playerName, playerTable in pairs(TimeLine.debuff_temp_table) do
for spellId, spellTable in pairs(playerTable) do
if (spellTable.active) then
spellTable.active = false
table.insert(spellTable, combatObject:GetCombatTime())
end
end
end
--debufs - store debuff data
table.insert(TimeLine.debuff_timeline, 1, TimeLine.debuff_temp_table)
--boss spells
table.insert(TimeLine.spellcast_boss, 1, TimeLine.current_enemy_spells)
table.insert(TimeLine.boss_spells, 1, TimeLine.current_spells_individual)
--deaths
local deaths = {}
local deathList = combatObject:GetDeaths()
for i, deathTable in ipairs(deathList) do
local thisDeath = {}
local timeOfDeath = deathTable[2]
local playerName = deathTable[3]
local lastEvents = {}
for eventIndex = #deathTable[1], 1, -1 do
local damageEvent = deathTable[1][eventIndex]
if (type(damageEvent[1]) == "boolean" and damageEvent[1]) then
local time = damageEvent[4]
if (time + 8 > timeOfDeath) then
table.insert(lastEvents, 1, damageEvent)
if (#lastEvents >= 3) then
break
end
end
end
end
thisDeath.time = deathTable.dead_at
thisDeath.events = lastEvents
if (not deaths[playerName]) then
deaths[playerName] = {}
end
table.insert(deaths[playerName], thisDeath)
end
table.insert(TimeLine.deaths_data, 1, deaths)
--limit segments
if (#TimeLine.cooldowns_timeline > TimeLine.db.max_segments) then
table.remove(TimeLine.cooldowns_timeline, TimeLine.db.max_segments+1)
table.remove(TimeLine.debuff_timeline, TimeLine.db.max_segments+1)
table.remove(TimeLine.combat_data, TimeLine.db.max_segments+1)
table.remove(TimeLine.deaths_data, TimeLine.db.max_segments+1)
table.remove(TimeLine.spellcast_boss, TimeLine.db.max_segments+1)
end
--show icon
if (TimeLine.open) then
TimeLine:Refresh()
end
TimeLine:ShowIcon()
else
--discart cooldown table
wipe(TimeLine.current_battle_cooldowns_timeline or {})
wipe(TimeLine.debuff_temp_table or {})
wipe(TimeLine.current_enemy_spells or {})
wipe(TimeLine.current_spells_individual or {})
end
end
function TimeLine:OnDetailsEvent(event, ...)
if (event == "HIDE") then --plugin hidded, disabled
self.open = false
elseif (event == "SHOW") then --plugin hidded, disabled
self.open = true
TimeLine:RefreshScale()
elseif (event == "COMBAT_PLAYER_ENTER") then --combat started
combatObject = select(1, ...)
if (not combatObject and Details) then
combatObject = Details:GetCurrentCombat()
if (not combatObject) then
return
end
end
--create the tables to store the data of this combat
TimeLine:NewCombat()
bIsInCombat = true
elseif (event == "COMBAT_INVALID") then
--when a combat got invalidated for some reason, when it happen, this event is guaranteed to be called before COMBAT_PLAYER_LEAVE
local bIsCombatValid = false
TimeLine:FinishCombat(bIsCombatValid)
bIsInCombat = false
elseif (event == "COMBAT_PLAYER_LEAVE") then
if (bIsInCombat) then
local bIsCombatValid = true
TimeLine:FinishCombat(bIsCombatValid)
bIsInCombat = false
end
elseif (event == "DETAILS_DATA_RESET") then
wipe(TimeLine.cooldowns_timeline)
wipe(TimeLine.combat_data)
wipe(TimeLine.debuff_timeline)
wipe(TimeLine.deaths_data)
TimeLine:Refresh()
TimeLine:CloseWindow()
TimeLine:HideIcon()
elseif (event == "DETAILS_STARTED") then
TimeLine:CanShowIcon()
elseif (event == "PLUGIN_DISABLED") then
TimeLine:HideIcon()
TimeLine:CloseWindow()
timeLineFrame:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
elseif (event == "PLUGIN_ENABLED") then
timeLineFrame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
TimeLine:CanShowIcon()
end
end
--show icon on toolbar
function TimeLine:ShowIcon()
TimeLine.showing = true
--[1] button to show [2] button animation: "star", "blink" or true(blink)
TimeLine:ShowToolbarIcon(TimeLine.ToolbarButton, "star")
end
-- hide icon on toolbar
function TimeLine:HideIcon()
TimeLine.showing = false
TimeLine:HideToolbarIcon(TimeLine.ToolbarButton)
end
function TimeLine:DelaySegmentRefresh()
for index, combat in ipairs(TimeLine.combat_data) do
if (combat.name) then
return Details_TimeLineSegmentDropdown.MyObject:Select(currentSegment, true)
end
end
end
function TimeLine.RefreshWindow()
--refresh it
TimeLine:Refresh()
--refresh segments dropdown
TimeLine:ScheduleTimer("DelaySegmentRefresh", 1)
return true
end
--user clicked on button, need open or close window
function TimeLine:OpenWindow()
if (TimeLine.Frame:IsShown()) then
return TimeLine:CloseWindow()
else
TimeLine.open = true
end
--build all window data
TimeLine:Refresh()
TimeLine:ScheduleTimer("DelaySegmentRefresh", 0.5)
DetailsPluginContainerWindow.OpenPlugin(TimeLine)
--hide cooltip
GameCooltip:Hide()
return true
end
function TimeLine:CloseWindow()
--TimeLineFrame:Hide()
DetailsPluginContainerWindow.ClosePlugin()
TimeLine.open = false
return true
end
local cooltip_menu = function()
GameCooltip:Reset()
GameCooltip:SetType("menu")
GameCooltip:SetOption("TextSize", Details.font_sizes.menus)
GameCooltip:SetOption("TextFont", Details.font_faces.menus)
GameCooltip:SetOption("LineHeightSizeOffset", 3)
GameCooltip:SetOption("VerticalOffset", 2)
GameCooltip:SetOption("VerticalPadding", -4)
GameCooltip:SetOption("FrameHeightSizeOffset", -3)
Details:SetTooltipMinWidth()
--build the menu options
--debuffs
GameCooltip:AddLine("Enemy Debuff Timeline")
GameCooltip:AddMenu(1, function()
DetailsPluginContainerWindow.OpenPlugin(TimeLine)
currentSelectedType = tabType_Debuff
TimeLine:Refresh()
TimeLine:RefreshButtons()
TimeLine:ScheduleTimer("DelaySegmentRefresh", 0.5)
GameCooltip:Hide()
end, "main")
GameCooltip:AddIcon([[Interface\ICONS\Spell_Shadow_ShadowWordPain]], 1, 1, 16, 16, 5/64, 59/64, 5/64, 59/64)
--cooldowns
GameCooltip:AddLine("Raid Cooldown Timeline")
GameCooltip:AddMenu(1, function()
DetailsPluginContainerWindow.OpenPlugin(TimeLine)
currentSelectedType = tabType_Cooldown
TimeLine:Refresh()
TimeLine:RefreshButtons()
TimeLine:ScheduleTimer("DelaySegmentRefresh", 0.5)
GameCooltip:Hide()
end, "graph")
GameCooltip:AddIcon([[Interface\ICONS\Spell_Holy_GuardianSpirit]], 1, 1, 16, 16, 5/64, 59/64, 5/64, 59/64)
--enemy spells
GameCooltip:AddLine("Enemy Cast Timeline")
GameCooltip:AddMenu(1, function()
DetailsPluginContainerWindow.OpenPlugin(TimeLine)
currentSelectedType = tabType_EnemySpells
TimeLine:Refresh()
TimeLine:RefreshButtons()
TimeLine:ScheduleTimer("DelaySegmentRefresh", 0.5)
GameCooltip:Hide()
end, "graph")
GameCooltip:AddIcon([[Interface\ICONS\Spell_Shadow_SummonVoidWalker]], 1, 1, 16, 16, 5/64, 59/64, 5/64, 59/64)
--spell individual
GameCooltip:AddLine("Enemy Spells Timeline")
GameCooltip:AddMenu(1, function()
DetailsPluginContainerWindow.OpenPlugin(TimeLine)
currentSelectedType = tabType_BossSpells
TimeLine:Refresh()
TimeLine:RefreshButtons()
TimeLine:ScheduleTimer("DelaySegmentRefresh", 0.5)
GameCooltip:Hide()
end, "graph")
GameCooltip:AddIcon([[Interface\ICONS\Spell_Shadow_Requiem]], 1, 1, 16, 16, 5/64, 59/64, 5/64, 59/64)
--apply the backdrop settings to the menu
Details:FormatCooltipBackdrop()
GameCooltip:SetOwner(TIMELINE_BUTTON, "bottom", "top", 0, 0)
GameCooltip:ShowCooltip()
end
--create the button to show on toolbar [1] function OnClick [2] texture [3] tooltip [4] width or 14 [5] height or 14 [6] frame name or nil
TimeLine.ToolbarButton = Details.ToolBar:NewPluginToolbarButton(TimeLine.OpenWindow, [[Interface\Addons\Details_TimeLine\icon]], Loc ["STRING_PLUGIN_NAME"], Loc ["STRING_TOOLTIP"], 12, 12, "TIMELINE_BUTTON", cooltip_menu)
TimeLine.ToolbarButton.shadow = true
--setpoint anchors mod if needed
TimeLine.ToolbarButton.y = 0
TimeLine.ToolbarButton.x = 0
--build main frame
timeLineFrame:SetFrameStrata("HIGH")
timeLineFrame:SetToplevel(true)
timeLineFrame:SetPoint("center", UIParent, "center", 0, 0)
timeLineFrame.Width = 925
timeLineFrame.Height = 575
local CONST_TOTAL_TIMELINES = 21 --timers shown in the top of the window
local CONST_ROW_HEIGHT = 18
local CONST_VALID_WIDHT = 784
local CONST_PLAYERFIELD_SIZE = 96
local CONST_VALID_HEIGHT = 528
local mode_buttons_width = 120
local mode_buttons_height = 20
timeLineFrame:SetSize(timeLineFrame.Width, timeLineFrame.Height)
--[=
timeLineFrame:EnableMouse(true)
timeLineFrame:SetResizable(false)
timeLineFrame:SetMovable(true)
timeLineFrame:SetScript("OnMouseDown",
function(self, botao)
if (botao == "LeftButton") then
if (self.isMoving) then
return
end
self:StartMoving()
self.isMoving = true
elseif (botao == "RightButton") then
if (self.isMoving) then
return
end
TimeLine:CloseWindow()
end
end)
timeLineFrame:SetScript("OnMouseUp",
function(self)
if (self.isMoving) then
self:StopMovingOrSizing()
self.isMoving = false
end
end)
--
--]=]
timeLineFrame:SetBackdrop(Details.PluginDefaults and Details.PluginDefaults.Backdrop or {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,
insets = {left = 1, right = 1, top = 1, bottom = 1}})
timeLineFrame:SetBackdropColor(unpack(Details.PluginDefaults and Details.PluginDefaults.BackdropColor or {0, 0, 0, .6}))
timeLineFrame:SetBackdropBorderColor(unpack(Details.PluginDefaults and Details.PluginDefaults.BackdropBorderColor or {0, 0, 0, 1}))
timeLineFrame.bg1 = timeLineFrame:CreateTexture(nil, "background")
timeLineFrame.bg1:SetTexture([[Interface\AddOns\Details\images\background]], true)
timeLineFrame.bg1:SetAlpha(0.7)
timeLineFrame.bg1:SetVertexColor(0.27, 0.27, 0.27)
timeLineFrame.bg1:SetVertTile(true)
timeLineFrame.bg1:SetHorizTile(true)
timeLineFrame.bg1:SetAllPoints()
local gradientBelowTheLine = detailsFramework:CreateTexture(timeLineFrame, {gradient = "vertical", fromColor = {0, 0, 0, 0.2}, toColor = "transparent"}, 1, 95, "artwork", {0, 1, 0, 1}, "gradientBelowTheLine")
gradientBelowTheLine:SetPoint("bottoms")
-- statusbar below the timeline chart
TimeLine.Times = {}
for i = 1, CONST_TOTAL_TIMELINES do
local timeLabel = detailsFramework:NewLabel(timeLineFrame, nil, "$parentTime"..i, nil, "00:00")
timeLabel:SetPoint("topleft", timeLineFrame, "topleft", (CONST_PLAYERFIELD_SIZE - 29) + (i * 39), -CONST_TIMELINE_LABELS_Y)
TimeLine.Times[i] = timeLabel
timeLabel.fontsize = 10
timeLabel.fontcolor = "white"
timeLabel.alpha = 1
local line = detailsFramework:NewImage(timeLineFrame, nil, 1, CONST_VALID_HEIGHT, "border", nil, nil, "$parentTime"..i.."Bar")
line:SetColorTexture(1, 1, 1, .15)
line:SetPoint("topleft", timeLabel, "topleft", 0, -10)
end
function TimeLine:UpdateTimeLine(totalTime)
local linha = TimeLine.Times[CONST_TOTAL_TIMELINES]
local minutes, seconds = math.floor(totalTime / 60), math.floor(totalTime % 60)
local secondsString = tostring(seconds)
local minutesString = tostring(minutes)
if (seconds < 10) then
secondsString = "0" .. seconds
end
if (minutes > 0) then
if (minutes < 10) then
minutesString = "0" .. minutes
end
linha:SetText(minutesString .. ":" .. secondsString)
else
linha:SetText("00:" .. secondsString)
end
local timeDivision = totalTime /(CONST_TOTAL_TIMELINES - 1) --786 -- 49.125
for i = 2, CONST_TOTAL_TIMELINES -1 do
local line = TimeLine.Times[i]
local thisTime = timeDivision *(i-1)
local amountMinutes, amountSeconds = math.floor(thisTime / 60), math.floor(thisTime % 60)
if (amountSeconds < 10) then
amountSeconds = "0" .. amountSeconds
end
if (amountMinutes > 0) then
if (amountMinutes < 10) then
amountMinutes = "0" .. amountMinutes
end
line:SetText(amountMinutes .. ":" .. amountSeconds)
else
line:SetText("00:" .. amountSeconds)
end
end
end
--dropdown select type(label)
local select_type_label = detailsFramework:NewLabel(timeLineFrame, nil, "$parentTypeLabel", nil, Loc ["STRING_TYPE"])
--dropdown select type(dropdown)
local selectTypeOption = function(_, _, selected)
currentSelectedType = selected
TimeLine:Refresh()
end
local type_menu = {
{value = tabType_Cooldown, label = Loc ["STRING_TYPE_COOLDOWN"], onclick = selectTypeOption, icon = [[Interface\ICONS\Spell_Holy_GuardianSpirit]]},
{value = tabType_Debuff, label = Loc ["STRING_TYPE_DEBUFF"], onclick = selectTypeOption, icon = [[Interface\ICONS\Spell_Shadow_ShadowWordPain]]}
}
local buildTypeMenu = function()
return type_menu
end
local select_type_dropdown = detailsFramework:NewDropDown(timeLineFrame, nil, "$parentTypeDropdown", nil, 120, 20, buildTypeMenu, 1, options_dropdown_template)
--dropdown select combat(dropdown)
local selectCombatOption = function(_, _, segment)
currentSegment = segment
TimeLine:Refresh()
end
local buildCombatMenu = function()
local t = {}
for index, combat in ipairs(TimeLine.combat_data) do
--[=[
combat:
["date_end"] = "22:50:45",
["date_start"] = "22:45:04",
["name"] = "Echo of Neltharion",
["total_time"] = 340.691,
--]=]
if (combat.name) then
local amountMinutes, amountSeconds = math.floor(combat.total_time/60), math.floor(combat.total_time%60)
local bossIcon = Details:GetBossEncounterTexture(combat.name) or ""
t [#t+1] = {value = index, label = combat.name, onclick = selectCombatOption, icon = bossIcon, iconsize = {32, 20}, texcoord = {0, 1, 0, 0.9}, desc = amountMinutes .. "m " .. amountSeconds .. "s " .. "(" ..(combat.date_start or "") .. " - " ..(combat.date_end or "") .. ")"}
end
end
return t
end
local selectSegmentDropdown = detailsFramework:NewDropDown(timeLineFrame, nil, "$parentSegmentDropdown", nil, 150, 20, buildCombatMenu, nil, options_dropdown_template)
--select which tab is shown (cooldowns, debuffs, enemy cast, enemy spells)
local selectWhatToShow = function(_, _, mode)
currentSelectedType = mode
TimeLine:Refresh()
TimeLine:RefreshButtons()
end
--select Cooldowns button
local iconSize = 14
local leftPadding = 0
local textDistance = 4
--header background
local headerFrame = CreateFrame("frame", "EncounterDetailsHeaderFrame", timeLineFrame, "BackdropTemplate")
headerFrame:EnableMouse(false)
headerFrame:SetPoint("topleft", titleBar, "bottomleft", -1, -1)
headerFrame:SetPoint("topright", titleBar, "bottomright", 1, -1)
headerFrame:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
headerFrame:SetBackdropColor(.7, .7, .7, .4)
headerFrame:SetHeight(46)
local gradientTop = detailsFramework:CreateTexture(headerFrame,
{gradient = "vertical", fromColor = {0, 0, 0, 0.5}, toColor = "transparent"}, 1, 48, "artwork", {0, 1, 0, 1})
gradientTop:SetPoint("bottoms", 1, 1)
timeLineFrame.gradientTop = gradientTop
local showCooldownsButton = detailsFramework:NewButton(timeLineFrame, _, "$parentModeCooldownsButton", "ModeCooldownsButton", mode_buttons_width, mode_buttons_height, selectWhatToShow, tabType_Cooldown, nil, nil, "Cooldowns", 1)
showCooldownsButton:SetPoint("topleft", timeLineFrame, "topleft", 2, -CONST_MENU_Y_POS)
showCooldownsButton:SetTemplate(detailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
showCooldownsButton:SetIcon([[Interface\ICONS\Spell_Holy_GuardianSpirit]], nil, nil, nil, {.1, .9, .1, .9}, nil, textDistance, leftPadding)
showCooldownsButton.icon:SetSize(iconSize, iconSize)
--cooldown button for the breakdown window
local showCooldownsButtonBreakdown = detailsFramework:NewButton(timeLineFrame, _, "$parentModeCooldownsButtonBreakdown", "ModeCooldownsButton", mode_buttons_width, mode_buttons_height, selectWhatToShow, tabType_Cooldown, nil, nil, "Cooldowns", 1)
showCooldownsButtonBreakdown:SetTemplate(detailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
showCooldownsButtonBreakdown:SetIcon([[Interface\ICONS\Spell_Holy_GuardianSpirit]], nil, nil, nil, {.1, .9, .1, .9}, nil, textDistance, leftPadding)
showCooldownsButtonBreakdown.icon:SetSize(iconSize, iconSize)
_G.DetailsBreakdownWindow.RegisterPluginButton(showCooldownsButtonBreakdown, TimeLine, timeLine.PluginAbsoluteName)
local showDebuffsButton = detailsFramework:NewButton(timeLineFrame, _, "$parentModeDebuffsButton", "ModeDebuffsButton", mode_buttons_width, mode_buttons_height, selectWhatToShow, tabType_Debuff, nil, nil, "Debuffs", 1, options_button_template)
showDebuffsButton:SetPoint("bottomleft", showCooldownsButton, "bottomright", 2, 0)
showDebuffsButton:SetTemplate(detailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
showDebuffsButton:SetIcon([[Interface\ICONS\Spell_Shadow_ShadowWordPain]], nil, nil, nil, {.1, .9, .1, .9}, nil, textDistance, leftPadding)
showDebuffsButton.icon:SetSize(iconSize, iconSize)
--debuffs button for the breakdown window
local showDebuffsButtonBreakdown = detailsFramework:NewButton(timeLineFrame, _, "$parentModeDebuffsButtonBreakdown", "ModeDebuffsButton", mode_buttons_width, mode_buttons_height, selectWhatToShow, tabType_Debuff, nil, nil, "Debuffs", 1, options_button_template)
showDebuffsButtonBreakdown:SetTemplate(detailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
showDebuffsButtonBreakdown:SetIcon([[Interface\ICONS\Spell_Shadow_ShadowWordPain]], nil, nil, nil, {.1, .9, .1, .9}, nil, textDistance, leftPadding)
showDebuffsButtonBreakdown.icon:SetSize(iconSize, iconSize)
_G.DetailsBreakdownWindow.RegisterPluginButton(showDebuffsButtonBreakdown, TimeLine, timeLine.PluginAbsoluteName)
local showEnemyspellsButton = detailsFramework:NewButton(timeLineFrame, _, "$parentModeEnemyCastButton", "ModeEnemyCastButton", mode_buttons_width, mode_buttons_height, selectWhatToShow, tabType_EnemySpells, nil, nil, "Enemy Cast", 1, options_button_template)
showEnemyspellsButton:SetPoint("bottomleft", showDebuffsButton, "bottomright", 2, 0)
showEnemyspellsButton:SetTemplate(detailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
showEnemyspellsButton:SetIcon([[Interface\ICONS\Spell_Shadow_SummonVoidWalker]], nil, nil, nil, {.1, .9, .1, .9}, nil, textDistance, leftPadding)
showEnemyspellsButton.icon:SetSize(iconSize, iconSize)
--enemies button for the breakdown window
local showEnemyspellsButtonBreakdown = detailsFramework:NewButton(timeLineFrame, _, "$parentModeEnemyCastButtonBreakdown", "ModeEnemyCastButton", mode_buttons_width, mode_buttons_height, selectWhatToShow, tabType_EnemySpells, nil, nil, "Enemy Cast", 1, options_button_template)
showEnemyspellsButtonBreakdown:SetTemplate(detailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
showEnemyspellsButtonBreakdown:SetIcon([[Interface\ICONS\Spell_Shadow_SummonVoidWalker]], nil, nil, nil, {.1, .9, .1, .9}, nil, textDistance, leftPadding)
showEnemyspellsButtonBreakdown.icon:SetSize(iconSize, iconSize)
_G.DetailsBreakdownWindow.RegisterPluginButton(showEnemyspellsButtonBreakdown, TimeLine, timeLine.PluginAbsoluteName)
local showSpellsIndividualButton = detailsFramework:NewButton(timeLineFrame, _, "$parentModeEnemySpellsButton", "ModeEnemySpellsButton", mode_buttons_width, mode_buttons_height, selectWhatToShow, tabType_BossSpells, nil, nil, "Enemy Spells", 1, options_button_template)
showSpellsIndividualButton:SetPoint("bottomleft", showEnemyspellsButton, "bottomright", 2, 0)
showSpellsIndividualButton:SetTemplate(detailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
showSpellsIndividualButton:SetIcon([[Interface\ICONS\Spell_Shadow_Requiem]], nil, nil, nil, {.1, .9, .1, .9}, nil, textDistance, leftPadding)
showSpellsIndividualButton.icon:SetSize(iconSize, iconSize)
--spells button for the breakdown window
local showSpellsIndividualButtonBreakdown = detailsFramework:NewButton(timeLineFrame, _, "$parentModeEnemySpellsButtonBreakdown", "ModeEnemySpellsButton", mode_buttons_width, mode_buttons_height, selectWhatToShow, tabType_BossSpells, nil, nil, "Enemy Spells", 1, options_button_template)
showSpellsIndividualButtonBreakdown:SetTemplate(detailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
showSpellsIndividualButtonBreakdown:SetIcon([[Interface\ICONS\Spell_Shadow_Requiem]], nil, nil, nil, {.1, .9, .1, .9}, nil, textDistance, leftPadding)
showSpellsIndividualButtonBreakdown.icon:SetSize(iconSize, iconSize)
_G.DetailsBreakdownWindow.RegisterPluginButton(showSpellsIndividualButtonBreakdown, TimeLine, timeLine.PluginAbsoluteName)
local allButtons = {showCooldownsButton, showDebuffsButton, showEnemyspellsButton, showSpellsIndividualButton}
local setButtonAsPressed = function(button)
button:SetTemplate(detailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE"))
end
function TimeLine:RefreshButtons()
for _, button in ipairs(allButtons) do
button:SetTemplate(detailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
end
if (currentSelectedType == tabType_Cooldown) then
setButtonAsPressed(showCooldownsButton)
elseif (currentSelectedType == tabType_Debuff) then
setButtonAsPressed(showDebuffsButton)
elseif (currentSelectedType == tabType_EnemySpells) then
setButtonAsPressed(showEnemyspellsButton)
elseif (currentSelectedType == tabType_BossSpells) then
setButtonAsPressed(showSpellsIndividualButton)
end
end
TimeLine:RefreshButtons()
--erase data button
local eraseDataButton_Callback = function()
wipe(TimeLine.cooldowns_timeline)
wipe(TimeLine.combat_data)
wipe(TimeLine.debuff_timeline)
wipe(TimeLine.deaths_data)
TimeLine:Refresh()
if (TimeLine.open) then
TimeLine:HideIcon()
TimeLine:CloseWindow()
end
end
local eraseDataButton = detailsFramework:NewButton(timeLineFrame, _, "$parentDeleteButton", "DeleteButton", 100, 20, eraseDataButton_Callback, nil, nil, nil, Loc ["STRING_RESET"], 1, detailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
eraseDataButton:SetPoint("topright", timeLineFrame, "topright", -2, -CONST_MENU_Y_POS)
eraseDataButton:SetIcon([[Interface\Buttons\UI-StopButton]], nil, nil, nil, {0, 1, 0, 1}, nil, nil, 2)
local optionsButton = detailsFramework:NewButton(timeLineFrame, _, "$parentOptionsPanelButton", "OptionsPanelButton", 100, 20, TimeLine.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS"], 1, detailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE"))
optionsButton:SetPoint("right", eraseDataButton, "left", 2, 0)
optionsButton:SetIcon([[Interface\Buttons\UI-OptionsButton]], nil, nil, nil, {0, 1, 0, 1}, nil, nil, 2)
eraseDataButton:SetWidth(75)
optionsButton:SetWidth(75)
do
local useIconsFunc = function()
TimeLine.db.useicons = not TimeLine.db.useicons
TimeLine:Refresh()
end
local useIconsText = detailsFramework:CreateLabel(timeLineFrame, Loc ["STRING_SPELLICONS"], 9, "orange", "GameFontNormal", "UseIconsLabel", nil, "overlay")
useIconsText:SetPoint("right", optionsButton, "left", -4, 0)
local useIconsCheckbox = detailsFramework:CreateSwitch(timeLineFrame, useIconsFunc, false)
useIconsCheckbox:SetTemplate(detailsFramework:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE"))
useIconsCheckbox:SetAsCheckBox()
useIconsCheckbox:SetSize(16, 16)
useIconsCheckbox:SetPoint("right", useIconsText, "left", -2, 0)
timeLineFrame.useIconsCheckbox = useIconsCheckbox
useIconsText:Hide()
useIconsCheckbox:Hide()
end
function TimeLine:UpdateShowSpellIconState()
timeLineFrame.useIconsCheckbox:SetValue(TimeLine.db.useicons)
end
--search field ~search
local onPressEnter = function(_, _, text)
if (type(text) == "string") then
search = string.lower(text)
TimeLine:Refresh()
end
end
local searchTextEntry = detailsFramework:NewTextEntry(timeLineFrame, _, "$parentSearch", "searchbox", 120, 20, onPressEnter, nil, nil, nil, nil, options_button_template)
searchTextEntry:SetAsSearchBox()
searchTextEntry:SetHook("OnEscapePressed", function() search = nil; searchTextEntry:SetText(""); searchTextEntry:ClearFocus(); TimeLine:Refresh() end)
searchTextEntry:SetHook("OnEditFocusLost", function()
if (searchTextEntry:GetText() == "") then
search = nil
TimeLine:Refresh()
end
end)
searchTextEntry:SetHook("OnTextChanged", function()
if (searchTextEntry:GetText() ~= "") then
search = string.lower(searchTextEntry:GetText())
TimeLine:Refresh()
else
search = nil
TimeLine:Refresh()
end
end)
--set the point on the segment box and search box
searchTextEntry:SetPoint("right", selectSegmentDropdown, "left", -8, 0)
selectSegmentDropdown:SetPoint("right", optionsButton, "left", -2, 0)
local backdrop_row = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}
function TimeLine:HideRows()
for i = 1, #TimeLine.rows do
local row = TimeLine.rows[i]
row:Hide()
end
end
local topBar = detailsFramework:NewImage(timeLineFrame, nil, CONST_VALID_WIDHT + CONST_PLAYERFIELD_SIZE, 1, "overlay", nil, nil, "$parentRowTopLine")
topBar:SetColorTexture(1, 1, 1, .4)
local bottomBar = detailsFramework:NewImage(timeLineFrame, nil, CONST_VALID_WIDHT + CONST_PLAYERFIELD_SIZE, 1, "overlay", nil, nil, "$parentRowBottomLine")
bottomBar:SetColorTexture(1, 1, 1, .4)
local row_on_enter = function(self)
topBar:Show()
bottomBar:Show()
topBar:SetPoint("bottomleft", self, "topleft")
topBar:SetPoint("bottomright", self, "topright")
bottomBar:SetPoint("topleft", self, "bottomleft")
bottomBar:SetPoint("topright", self, "bottomright")
self:SetBackdropColor(0.8, 0.8, 0.8, 0.4)
end
local row_on_leave = function(self)
topBar:Hide()
bottomBar:Hide()
self:SetBackdropColor(unpack(self.backdropColor))
end
local block_backdrop_onenter = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize = 8,
insets = {left = 0, right = 0, top = 0, bottom = 0}}
local block_on_enter = function(self)
self:SetBackdrop(block_backdrop_onenter)
self:SetBackdropBorderColor(0, 0, 0, .9)
self.texture:SetBlendMode("ADD")
local parent = self:GetParent()
topBar:SetPoint("bottomleft", parent, "topleft")
topBar:SetPoint("bottomright", parent, "topright")
bottomBar:SetPoint("topleft", parent, "bottomleft")
bottomBar:SetPoint("topright", parent, "bottomright")
self:GetParent():SetBackdropColor(0.8, 0.8, 0.8, 0.4)
topBar:Show()
bottomBar:Show()
local spell = self.spell
local spell_name, _, spell_icon = GetSpellInfo(spell[1])
GameCooltip:Reset()
Details:CooltipPreset(2)
GameCooltip:SetOption("TextSize", 10)
Details:SetCooltipForPlugins()
local playerName = spell[4]
local playerTable = TimeLine[currentSelectedType][currentSegment][playerName]
local time = spell[2]
local duration = spell[5]
if (currentSelectedType == tabType_Cooldown) then
GameCooltip:AddLine(spell_name, nil, 1, "white")
GameCooltip:AddIcon(spell_icon, 1, 1, 14, 14, .1, .9, .1, .9)
local amountMinutes, amountSeconds = math.floor(spell[2]/60), math.floor(spell[2]%60)
GameCooltip:AddLine(Loc ["STRING_TIME"] .. ": |cFFFFFFFF" .. amountMinutes .. "m " .. amountSeconds .. "s |r")
local class = TimeLine:GetClass(spell[3] or "")
local formatedTargetName = detailsFramework:AddClassColorToText(spell[3] or "", class)
GameCooltip:AddLine(Loc ["STRING_TARGET"] .. ": |cFFFFFFFF" .. formatedTargetName .. "|r")
for index, spellused in ipairs(playerTable) do
if (spellused[3] ~= spell[1]) then --spellids diferentes
--tempo de luta que o cooldown foi usado
-- se ele foi usado antes e se foi usado a 8 seg de diferen�a
if ((spellused[1] <= time and spellused[1] + 8 >= time) or(spellused[1] >= time and spellused[1] - 8 <= time) ) then
local spellName, _, spellIcon = GetSpellInfo(spellused[3])
GameCooltip:AddLine(spellName, nil, 1, "silver")
GameCooltip:AddIcon(spellIcon, 1, 1, 14, 14, .1, .9, .1, .9)
local amountMinutes, amountSeconds = math.floor(spellused[1]/60), math.floor(spellused[1]%60)
GameCooltip:AddLine(Loc ["STRING_TIME"] .. ": " .. amountMinutes .. "m " .. amountSeconds .. "s ", nil, 1, "silver")
local class = TimeLine:GetClass(spellused[2] or "")
local formatedTargetName = detailsFramework:AddClassColorToText(spellused[2] or "", class)
GameCooltip:AddLine(Loc ["STRING_TARGET"] .. ": |cFFFFFFFF" .. formatedTargetName .. "|r")
GameCooltip:AddLine(" ")
end
end
end
elseif (currentSelectedType == tabType_Debuff) then
GameCooltip:AddLine(spell_name, nil, 1, "white")
GameCooltip:AddIcon(spell_icon, 1, 1, 14, 14, .1, .9, .1, .9)
local amountMinutes, amountSeconds = math.floor(spell[2]/60), math.floor(spell[2]%60)
GameCooltip:AddLine(Loc ["STRING_TIME"] .. ": |cFFFFFFFF" .. amountMinutes .. "m " .. amountSeconds .. "s |r")
GameCooltip:AddLine(Loc ["STRING_SOURCE"] .. ": |cFFFFFFFF" ..(spell[6].source or Loc ["STRING_UNKNOWN"]) .. "|r")
GameCooltip:AddLine(Loc ["STRING_ELAPSED"] .. ": |cFFFFFFFF" .. string.format("%.1f", duration) .. " " .. Loc ["STRING_SECONDS"] .. "|r")
local blocks = self:GetParent().blocks
for _, block in ipairs(blocks) do
if (block.debuff_start and block:IsShown() and block ~= self and((block.debuff_start <= time and block.debuff_start + 8 >= time) or(block.debuff_start >= time and block.debuff_start - 8 <= time))) then
GameCooltip:AddLine(" ")
local spellName, _, spellIcon = GetSpellInfo(block.spell [1])
GameCooltip:AddLine(spellName)
GameCooltip:AddIcon(spellIcon, 1, 1, 14, 14, .1, .9, .1, .9)
local amountMinutes, amountSeconds = math.floor(block.debuff_start / 60), math.floor(block.debuff_start % 60)
GameCooltip:AddLine(Loc ["STRING_TIME"] .. ": |cFFFFFFFF" .. amountMinutes .. "m " .. amountSeconds .. "s ")
GameCooltip:AddLine(Loc ["STRING_SOURCE"] .. ": |cFFFFFFFF" ..(block.spell [6].source or Loc ["STRING_UNKNOWN"]))
GameCooltip:AddLine(Loc ["STRING_ELAPSED"] .. ": |cFFFFFFFF" .. string.format("%.1f", block.spell [5]) .. " " .. Loc ["STRING_SECONDS"])
end
end
GameCooltip:AddLine(" ")
elseif (currentSelectedType == tabType_EnemySpells) then
GameCooltip:AddLine(spell_name, nil, 1, "white")
GameCooltip:AddIcon(spell_icon, 1, 1, 14, 14, .1, .9, .1, .9)
local amountMinutes, amountSeconds = math.floor(spell [2]/60), math.floor(spell [2]%60)
GameCooltip:AddLine(Loc ["STRING_TIME"] .. ": |cFFFFFFFF" .. amountMinutes .. "m " .. amountSeconds .. "s |r")
GameCooltip:AddLine(Loc ["STRING_SOURCE"] .. ": |cFFFFFFFF" ..(spell [6].source or Loc ["STRING_UNKNOWN"]) .. "|r")
local class = TimeLine:GetClass(self.TargetName or "")
local formatedTargetName = detailsFramework:AddClassColorToText(self.TargetName or "", class)
GameCooltip:AddLine(Loc ["STRING_TARGET"] .. ": |cFFFFFFFF" .. formatedTargetName .. "|r")
local blocks = self:GetParent().blocks
for _, block in ipairs(blocks) do
if (block.cast_start and block:IsShown() and block ~= self and((block.cast_start <= time and block.cast_start + 8 >= time) or(block.cast_start >= time and block.cast_start - 8 <= time))) then
GameCooltip:AddLine("")
local spell_name, _, spell_icon = GetSpellInfo(block.spell [1])
GameCooltip:AddLine(spell_name)
GameCooltip:AddIcon(spell_icon, 1, 1, 14, 14, .1, .9, .1, .9)
local amountMinutes, amountSeconds = math.floor(block.cast_start / 60), math.floor(block.cast_start % 60)
GameCooltip:AddLine(Loc ["STRING_TIME"] .. ": |cFFFFFFFF" .. amountMinutes .. "m " .. amountSeconds .. "s ")
GameCooltip:AddLine(Loc ["STRING_SOURCE"] .. ": |cFFFFFFFF" ..(block.SourceName or Loc ["STRING_UNKNOWN"]))
local targetName = block.TargetName or ""
local class = TimeLine:GetClass(targetName)
local formatedTargetName = detailsFramework:AddClassColorToText(targetName, class)
GameCooltip:AddLine(Loc ["STRING_TARGET"] .. ": |cFFFFFFFF" .. formatedTargetName .. "|r")
end
end
elseif (currentSelectedType == tabType_BossSpells) then
GameCooltip:AddLine(spell_name, nil, 1, "white")
GameCooltip:AddIcon(spell_icon, 1, 1, 14, 14, .1, .9, .1, .9)
local amountMinutes, amountSeconds = math.floor(spell [2]/60), math.floor(spell [2]%60)
GameCooltip:AddLine(Loc ["STRING_TIME"] .. ": |cFFFFFFFF" .. amountMinutes .. "m " .. amountSeconds .. "s |r")
GameCooltip:AddLine(Loc ["STRING_SOURCE"] .. ": |cFFFFFFFF" ..(spell [6].source or Loc ["STRING_UNKNOWN"]) .. "|r")
local class = TimeLine:GetClass(self.TargetName or "")
local formatedTargetName = detailsFramework:AddClassColorToText(self.TargetName or "", class)
GameCooltip:AddLine(Loc ["STRING_TARGET"] .. ": |cFFFFFFFF" .. formatedTargetName .. "|r")
local blocks = self:GetParent().blocks
for _, block in ipairs(blocks) do
if (block.cast_start and block:IsShown() and block ~= self and((block.cast_start <= time and block.cast_start + 8 >= time) or(block.cast_start >= time and block.cast_start - 8 <= time))) then
GameCooltip:AddLine("")
local spell_name, _, spell_icon = GetSpellInfo(block.spell [1])
GameCooltip:AddLine(spell_name)
GameCooltip:AddIcon(spell_icon, 1, 1, 14, 14, .1, .9, .1, .9)
local amountMinutes, amountSeconds = math.floor(block.cast_start / 60), math.floor(block.cast_start % 60)
GameCooltip:AddLine(Loc ["STRING_TIME"] .. ": |cFFFFFFFF" .. amountMinutes .. "m " .. amountSeconds .. "s ")
GameCooltip:AddLine(Loc ["STRING_SOURCE"] .. ": |cFFFFFFFF" ..(block.SourceName or Loc ["STRING_UNKNOWN"]))
local targetName = block.TargetName or ""
local class = TimeLine:GetClass(targetName)
local formatedTargetName = detailsFramework:AddClassColorToText(targetName, class)
GameCooltip:AddLine(Loc ["STRING_TARGET"] .. ": |cFFFFFFFF" .. formatedTargetName .. "|r")
end
end
end
GameCooltip:ShowCooltip(self, "tooltip")