- fixed issues with death log.

- added upper images for CoolTip, parameter "top" for AddImage.
- added GetBossPortrait (mapid, bossindex)
- added new slash command "show"
- switch menu now open with OnMouseDown instead MouseUp.
- all menus on main window had the wait time down to 0.15s.
- slight revamp on segment menu.
- bugs fixed on TinyThreat.
This commit is contained in:
Tercio
2013-08-14 23:34:30 -03:00
parent 9b09fef6c2
commit 56eea9d3b1
11 changed files with 344 additions and 120 deletions
@@ -18,6 +18,7 @@ local throne_of_thunder = {
icon = "Interface\\AddOns\\Details_RaidInfo-ThroneOfThunder\\images\\icon256x128",
background = "Interface\\AddOns\\Details_RaidInfo-ThroneOfThunder\\images\\raid_tot",
backgroundEJ = [[Interface\EncounterJournal\UI-EJ-LOREBG-ThunderKingRaid]],
boss_names = {
"Jin'rokh the Breaker",
@@ -67,6 +68,7 @@ local throne_of_thunder = {
[1] = {
boss = "Jin'rokh the Breaker",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Jinrokh the Breaker]],
spell_mechanics = {
[137261] = {0x1, 0x40}, --> Lightning Storm
@@ -107,6 +109,7 @@ local throne_of_thunder = {
[2] = {
boss = "Horridon",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Horridon]],
spell_mechanics = {
[136719] = {0x10}, --> Blazing Sunlight (Wastewalker)
@@ -216,6 +219,7 @@ local throne_of_thunder = {
------------> Concil of Elders ------------------------------------------------------------------------------
[3] = {
boss = "Council of Elders",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Council of Elders]],
--> this is a fix for twisted fate spell, due Mar'li adds comes with exactly the same name as the player name, the add spell are assigned to the player
func = function()
@@ -311,6 +315,7 @@ local throne_of_thunder = {
------------> Tortos ------------------------------------------------------------------------------
[4] = {
boss = "Tortos",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Tortos]],
spell_mechanics = {
[134476] = {0x1}, --> "Rockfall",
@@ -345,7 +350,8 @@ local throne_of_thunder = {
------------> Megaera ------------------------------------------------------------------------------
[5] = {
boss = "Megaera",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Megaera]],
spell_mechanics = {
[139549] = {0x1}, --Rampage blue
[139548] = {0x1}, --rampage red
@@ -403,6 +409,7 @@ local throne_of_thunder = {
------------> Ji-Kun ------------------------------------------------------------------------------
[6] = {
boss = "Ji'kun",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Ji Kun]],
spell_mechanics = {
[134381] = {0x1}, --Quills
@@ -448,6 +455,8 @@ local throne_of_thunder = {
------------> Durumu the forgotten ------------------------------------------------------------------------------
[7] = {
boss = "Durumu the Forgotten",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Durumu]],
spell_mechanics = {
[133732] = {0x1, 0x200}, --> Infrared Light
[133738] = {0x1, 0x200}, --> Bright Light
@@ -531,6 +540,8 @@ local throne_of_thunder = {
------------> Primordius ------------------------------------------------------------------------------
[8] = {
boss = "Primordius",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Primordius]],
spell_mechanics = {
[136220] = {0x1, 0x2000}, --> Acidic Explosion
[136216] = {0x1, 0x40}, --> Caustic Gas
@@ -571,6 +582,8 @@ local throne_of_thunder = {
[9] = {
boss = "Dark Animus",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Dark Animus]],
spell_mechanics = {
[139867] = {0x1, 0x3000}, --> Interrupting Jolt
[138659] = {0x1}, --> Touch of the Animus
@@ -606,6 +619,8 @@ local throne_of_thunder = {
------------> Iron Qon ------------------------------------------------------------------------------
[10] = {
boss = "Iron Qon",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Iron Qon]],
spell_mechanics = {
[136925] = {0x40}, --> Burning Blast
[134628] = {0x200, 0x1}, --> Unleashed Flame
@@ -710,6 +725,7 @@ local throne_of_thunder = {
------------> Twin Consorts ------------------------------------------------------------------------------
[11] = {
boss = "Twin Consorts",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Empyreal Queens]],
spell_mechanics = {
[137410] = {0x200, 0x1}, --> Blazing Radiance
@@ -815,6 +831,7 @@ local throne_of_thunder = {
------------> Lei Shen ------------------------------------------------------------------------------
[12] = {
boss = "Lei Shen",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Lei Shen]],
spell_mechanics = {
[136889] = {0x2, 0x1}, --> Violent Gale Winds
@@ -38,16 +38,25 @@ local function CreatePluginFrames (data)
ThreatMeter.Rows = {}
--> current shown rows
ThreatMeter.ShownRows = {}
-->
ThreatMeter.Actived = false
--> window reference
local instance
local player
function _detalhes:FadeOnShow()
DetailsFrameWork:Fade (ThreatMeterFrame.titleIcon, "ALPHAANIM", 0.05)
DetailsFrameWork:Fade (ThreatMeterFrame.titleText, "ALPHAANIM", 0.05)
DetailsFrameWork:Fade (ThreatMeterFrame.titleText2, "IN", 0.5)
end
--> OnEvent Table
function ThreatMeter:OnDetailsEvent (event)
if (event == "HIDE") then --> plugin hidded, disabled
ThreatMeterFrame:SetScript ("OnUpdate", nil)
ThreatMeter.Actived = false
ThreatMeter:Cancel()
elseif (event == "SHOW") then
@@ -60,16 +69,20 @@ local function CreatePluginFrames (data)
ThreatMeter:SizeChanged()
player = UnitName ("player")
ThreatMeterFrame:RegisterEvent ("PLAYER_TARGET_CHANGED")
ThreatMeter.Actived = false
_detalhes:ScheduleTimer ("FadeOnShow", 3)
if (ThreatMeter:IsInCombat()) then
ThreatMeter.Actived = true
ThreatMeter:Start()
else
DetailsFrameWork:Fade (ThreatMeterFrame.titleIcon, 0)
DetailsFrameWork:Fade (ThreatMeterFrame.titleText, 0)
DetailsFrameWork:Fade (ThreatMeterFrame.titleText2, 0)
end
player = UnitName ("player")
DetailsFrameWork:Fade (ThreatMeterFrame.titleIcon, 0)
DetailsFrameWork:Fade (ThreatMeterFrame.titleText, 0)
elseif (event == "REFRESH") then --> requested a refresh window
-->
@@ -78,13 +91,17 @@ local function CreatePluginFrames (data)
if (IsInGroup() or IsInRaid()) then
DetailsFrameWork:Fade (ThreatMeterFrame.titleIcon, 1)
DetailsFrameWork:Fade (ThreatMeterFrame.titleText, 1)
DetailsFrameWork:Fade (ThreatMeterFrame.titleText2, 1)
end
ThreatMeter.Actived = true
ThreatMeter:Start()
elseif (event == "COMBAT_PLAYER_LEAVE") then --> combat ended
DetailsFrameWork:Fade (ThreatMeterFrame.titleIcon, 0)
DetailsFrameWork:Fade (ThreatMeterFrame.titleText, 0)
DetailsFrameWork:Fade (ThreatMeterFrame.titleIcon, "alpha", 0.05)
DetailsFrameWork:Fade (ThreatMeterFrame.titleText, "alpha", 0.05)
DetailsFrameWork:Fade (ThreatMeterFrame.titleText2, 1)
ThreatMeter:End()
ThreatMeter.Actived = false
elseif (event == "DETAILS_INSTANCE_ENDRESIZE" or event == "DETAILS_INSTANCE_SIZECHANGED") then
ThreatMeter:SizeChanged()
@@ -101,12 +118,15 @@ local function CreatePluginFrames (data)
ThreatMeterFrame:SetWidth (300)
ThreatMeterFrame:SetHeight (100)
--[[
ThreatMeterFrame:SetBackdrop ({
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
tile = true, tileSize = 16,
insets = {left = 1, right = 1, top = 0, bottom = 1},})
ThreatMeterFrame:SetBackdropColor (.3, .3, .3, .3)
--]]
local icon1 = DetailsFrameWork:NewImage (ThreatMeterFrame, nil, nil, "titleIcon", 64, 64, [[Interface\HELPFRAME\HelpIcon-ItemRestoration]])
icon1:SetPoint (10, -10)
local title = DetailsFrameWork:NewLabel (ThreatMeterFrame, nil, nil, "titleText", "Tiny Threat", "CoreAbilityFont", 26)
@@ -139,14 +159,6 @@ local function CreatePluginFrames (data)
local timer = 0
local interval = 1.0
function ThreatMeter:TargetChanged()
local NewTarget = _UnitName ("target")
if (NewTarget and not _UnitIsFriend ("player", "target")) then
target = NewTarget
end
ThreatMeter:HideBars()
end
local RoleIconCoord = {
["TANK"] = {0, 0.28125, 0.328125, 0.625},
["HEALER"] = {0.3125, 0.59375, 0, 0.296875},
@@ -201,7 +213,14 @@ local function CreatePluginFrames (data)
return false
end
end
--[[
local percent = threat_actor [2]
if (percentagem >= 50) then
thisRow:SetColor ( percent/100, 1, 0, 1)
else
thisRow:SetColor ( 1, percent/100, 0, 1)
end
--]]
local Threater = function()
local threat_table = {}
@@ -238,11 +257,19 @@ local function CreatePluginFrames (data)
thisRow:SetLeftText (threat_actor [1])
thisRow:SetRightText (_cstr ("%.1f", threat_actor [2]).."%")
thisRow:SetValue (threat_actor [2])
if (index == 1) then
thisRow:SetColor (threat_actor [2]*0.01, math.abs (threat_actor [2]-100)*0.01, 0, 1)
else
thisRow:SetColor (threat_actor [2]*0.01, math.abs (threat_actor [2]-100)*0.01, 0, .3)
local percent = threat_actor [2]
if (percent >= 50) then
thisRow:SetColor ( 1, math.abs (percent - 100)/100, 0, 1)
else
thisRow:SetColor ( percent/100, 1, 0, 1)
end
end
if (not thisRow.statusbar:IsShown()) then
thisRow:Show()
end
@@ -267,11 +294,26 @@ local function CreatePluginFrames (data)
thisRow:SetColor (threatpct*0.01, math.abs (threatpct-100)*0.01, 0, .3)
end
end
else
--print ("nao tem target")
end
end
function ThreatMeter:TargetChanged()
if (not ThreatMeter.Actived) then
return
end
local NewTarget = _UnitName ("target")
if (NewTarget and not _UnitIsFriend ("player", "target")) then
target = NewTarget
Threater()
else
ThreatMeter:HideBars()
end
end
local OnUpdate = function (self, elapsed)
timer = timer + elapsed
if (timer > interval) then
@@ -280,15 +322,16 @@ local function CreatePluginFrames (data)
--print ("aqui")
Threater()
--end
end
end
function ThreatMeter:Start()
ThreatMeter:HideBars()
if (_IsInRaid() or _IsInGroup()) then
--print ("Iniciando analizador de Threat")
ThreatMeterFrame:SetScript ("OnUpdate", OnUpdate)
if (ThreatMeter.Actived) then
if (_IsInRaid() or _IsInGroup()) then
--print ("Iniciando analizador de Threat")
ThreatMeterFrame:SetScript ("OnUpdate", OnUpdate)
end
end
end
@@ -306,7 +349,10 @@ end
function ThreatMeter:OnEvent (_, event, ...)
if (event == "ADDON_LOADED") then
if (event == "PLAYER_TARGET_CHANGED") then
ThreatMeter:TargetChanged()
elseif (event == "ADDON_LOADED") then
local AddonName = select (1, ...)
if (AddonName == "Details_TinyThreat") then
@@ -336,9 +382,6 @@ function ThreatMeter:OnEvent (_, event, ...)
end
end
elseif (event == "PLAYER_TARGET_CHANGED") then
ThreatMeter:TargetChanged()
elseif (event == "PLAYER_LOGOUT") then
_detalhes_databaseThreat = ThreatMeter.data