- Added Acitivity Time for Damage + Healing, tooltip show the activity separately.
- Major changes on Encounter Details Plugin making more easy to use. - Removed Spell Details Plugin. - Added new plugin: Dps Tuning. - New API: actor:GetActorSpells() return table with spellid, spelltable. - New API: actor:GetSpell (spellid) return the table for the spellid. - New API: combat:GetCombatNumber() return a unique ID number identifying the combat. - New API: framework:CreateButton (parent, func, w, h, text, param1, param2, texture, member, name, short_method) - New API: framework:CreateDropDown (parent, func, default, w, h, member, name) - New API: framework:CreateLabel (parent, text, size, color, font, member, name, layer) - New API: framework:CreateBar (parent, texture, w, h, value, member, name) - New API: framework:CreateChartPanel (parent, w, h, name)
This commit is contained in:
@@ -70,6 +70,10 @@
|
||||
return self.last_events_tables
|
||||
end
|
||||
|
||||
function combate:GetCombatNumber()
|
||||
return self.combat_counter
|
||||
end
|
||||
|
||||
--return the name of the encounter or enemy
|
||||
function combate:GetCombatName (try_find)
|
||||
if (self.is_pvp) then
|
||||
@@ -141,6 +145,9 @@
|
||||
|
||||
_setmetatable (esta_tabela, combate)
|
||||
|
||||
_detalhes.combat_counter = _detalhes.combat_counter + 1
|
||||
esta_tabela.combat_counter = _detalhes.combat_counter
|
||||
|
||||
--> try discover if is a pvp combat
|
||||
local who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags = ...
|
||||
if (who_serial) then --> aqui irá identificar o boss ou o oponente
|
||||
|
||||
+69
-72
@@ -644,6 +644,11 @@
|
||||
table.wipe (self._NameIndexTable)
|
||||
end
|
||||
|
||||
function atributo_custom:GetValue (actor)
|
||||
local actor_table = self:GetActorTable (actor)
|
||||
return actor_table.value
|
||||
end
|
||||
|
||||
function atributo_custom:AddValue (actor, actortotal, checktop)
|
||||
local actor_table = self:GetActorTable (actor)
|
||||
actor_table.my_actor = actor
|
||||
@@ -654,6 +659,8 @@
|
||||
atributo_custom._TargetActorsProcessedTop = actor_table.value
|
||||
end
|
||||
end
|
||||
|
||||
return actor_table.value
|
||||
end
|
||||
|
||||
function atributo_custom:SetValue (actor, actortotal)
|
||||
@@ -1122,77 +1129,20 @@
|
||||
self.custom [#self.custom+1] = Healthstone
|
||||
end
|
||||
|
||||
local DamageActivityTime = {
|
||||
name = Loc ["STRING_CUSTOM_ACTIVITY_DPS"],
|
||||
icon = [[Interface\ICONS\Achievement_PVP_H_06]],
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local ActivityTime = {
|
||||
name = Loc ["STRING_CUSTOM_ACTIVITY_ALL"],
|
||||
icon = [[INTERFACE\ICONS\Achievement_PVP_G_15]],
|
||||
attribute = false,
|
||||
spellid = false,
|
||||
author = "Details!",
|
||||
desc = Loc ["STRING_CUSTOM_ACTIVITY_DPS_DESC"],
|
||||
desc = Loc ["STRING_CUSTOM_ACTIVITY_ALL_DESC"],
|
||||
source = false,
|
||||
target = false,
|
||||
total_script = [[
|
||||
local value, top, total, combat, instance = ...
|
||||
local minutos, segundos = math.floor (value/60), math.floor (value%60)
|
||||
return minutos .. "m " .. segundos .. "s"
|
||||
]],
|
||||
percent_script = [[
|
||||
local value, top, total, combat, instance = ...
|
||||
return string.format ("%.1f", value/top*100)
|
||||
]],
|
||||
script = [[
|
||||
--init:
|
||||
local combat, instance_container, instance = ...
|
||||
local total, amount = 0, 0
|
||||
|
||||
--get the misc actor container
|
||||
local damage_container = combat:GetActorList ( DETAILS_ATTRIBUTE_DAMAGE )
|
||||
|
||||
--do the loop:
|
||||
for _, player in ipairs ( damage_container ) do
|
||||
if (player.grupo) then
|
||||
local activity = player:Tempo()
|
||||
total = total + activity
|
||||
amount = amount + 1
|
||||
--add amount to the player
|
||||
instance_container:AddValue (player, activity)
|
||||
end
|
||||
end
|
||||
|
||||
--return:
|
||||
return total, combat:GetCombatTime(), amount
|
||||
]],
|
||||
tooltip = [[
|
||||
|
||||
]],
|
||||
}
|
||||
|
||||
local have = false
|
||||
for _, custom in ipairs (self.custom) do
|
||||
if (custom.name == Loc ["STRING_CUSTOM_ACTIVITY_DPS"]) then
|
||||
have = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if (not have) then
|
||||
setmetatable (DamageActivityTime, _detalhes.atributo_custom)
|
||||
DamageActivityTime.__index = _detalhes.atributo_custom
|
||||
self.custom [#self.custom+1] = DamageActivityTime
|
||||
end
|
||||
|
||||
local HealActivityTime = {
|
||||
name = Loc ["STRING_CUSTOM_ACTIVITY_HPS"],
|
||||
icon = [[Interface\ICONS\Achievement_PVP_G_06]],
|
||||
attribute = false,
|
||||
spellid = false,
|
||||
author = "Details!",
|
||||
desc = Loc ["STRING_CUSTOM_ACTIVITY_HPS_DESC"],
|
||||
source = false,
|
||||
target = false,
|
||||
total_script = [[
|
||||
local value, top, total, combat, instance = ...
|
||||
local minutos, segundos = math.floor (value/60), math.floor (value%60)
|
||||
return minutos .. "m " .. segundos .. "s"
|
||||
return math.floor (value)
|
||||
]],
|
||||
percent_script = [[
|
||||
local value, top, total, combat, instance = ...
|
||||
@@ -1203,39 +1153,86 @@
|
||||
local combat, instance_container, instance = ...
|
||||
local total, top, amount = 0, 0, 0
|
||||
|
||||
--get the misc actor container
|
||||
local damage_container = combat:GetActorList ( DETAILS_ATTRIBUTE_HEAL )
|
||||
--get the heal actor container
|
||||
local heal_container = combat:GetActorList ( DETAILS_ATTRIBUTE_HEAL )
|
||||
|
||||
--do the loop:
|
||||
for _, player in ipairs ( damage_container ) do
|
||||
for _, player in ipairs ( heal_container ) do
|
||||
if (player.grupo) then
|
||||
local activity = player:Tempo()
|
||||
total = total + activity
|
||||
amount = amount + 1
|
||||
--add amount to the player
|
||||
instance_container:AddValue (player, activity)
|
||||
if (activity > top) then
|
||||
top = activity
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--get the damage actor container
|
||||
local damage_container = combat:GetActorList ( DETAILS_ATTRIBUTE_DAMAGE )
|
||||
|
||||
--do the loop:
|
||||
for _, player in ipairs ( damage_container ) do
|
||||
if (player.grupo) then
|
||||
local activity = player:Tempo()
|
||||
total = total + activity
|
||||
if (not instance_container._NameIndexTable [player:Name()]) then
|
||||
amount = amount + 1
|
||||
end
|
||||
--add amount to the player
|
||||
local value = instance_container:AddValue (player, activity)
|
||||
if (value > top) then
|
||||
top = value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--return:
|
||||
return total, combat:GetCombatTime(), amount
|
||||
return total, top, amount
|
||||
]],
|
||||
tooltip = [[
|
||||
--init:
|
||||
local player, combat, instance = ...
|
||||
|
||||
local damage_actor = combat (DETAILS_ATTRIBUTE_DAMAGE, player:Name())
|
||||
if (damage_actor) then
|
||||
local damage_activity = damage_actor:Tempo()
|
||||
local minutos1, segundos1 = math.floor (damage_activity/60), math.floor (damage_activity%60)
|
||||
GameCooltip:AddLine ("Damage Activity", minutos1 .. "m " .. segundos1 .. "s")
|
||||
_detalhes:AddTooltipBackgroundStatusbar()
|
||||
GameCooltip:AddIcon ('Interface\\ICONS\\Achievement_PVP_H_06', 1, 1, 14, 14)
|
||||
else
|
||||
GameCooltip:AddLine ("Damage Activity", "0m 0s")
|
||||
end
|
||||
|
||||
local heal_actor = combat (DETAILS_ATTRIBUTE_HEAL, player:Name())
|
||||
if (heal_actor) then
|
||||
local heal_activity = heal_actor:Tempo()
|
||||
local minutos2, segundos2 = math.floor (heal_activity/60), math.floor (heal_activity%60)
|
||||
GameCooltip:AddLine ("Heal Activity", minutos2 .. "m " .. segundos2 .. "s")
|
||||
_detalhes:AddTooltipBackgroundStatusbar()
|
||||
GameCooltip:AddIcon ('Interface\\ICONS\\Achievement_PVP_G_06', 1, 1, 14, 14)
|
||||
else
|
||||
GameCooltip:AddLine ("Heal Activity", "0m 0s")
|
||||
end
|
||||
]],
|
||||
}
|
||||
|
||||
--/run _detalhes:AddDefaultCustomDisplays()
|
||||
|
||||
local have = false
|
||||
for _, custom in ipairs (self.custom) do
|
||||
if (custom.name == Loc ["STRING_CUSTOM_ACTIVITY_HPS"]) then
|
||||
if (custom.name == Loc ["STRING_CUSTOM_ACTIVITY_ALL"]) then
|
||||
have = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if (not have) then
|
||||
setmetatable (HealActivityTime, _detalhes.atributo_custom)
|
||||
HealActivityTime.__index = _detalhes.atributo_custom
|
||||
self.custom [#self.custom+1] = HealActivityTime
|
||||
setmetatable (ActivityTime, _detalhes.atributo_custom)
|
||||
ActivityTime.__index = _detalhes.atributo_custom
|
||||
self.custom [#self.custom+1] = ActivityTime
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1370,8 +1370,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
|
||||
end
|
||||
|
||||
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("player"), playerName, 0x00000514, _UnitGUID ("player"), playerName, 0x00000514, spellid, name, in_or_out)
|
||||
else
|
||||
break
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1398,9 +1397,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
|
||||
end
|
||||
|
||||
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("party"..groupIndex), playerName, 0x00000417, _UnitGUID ("party"..groupIndex), playerName, 0x00000417, spellid, name, in_or_out)
|
||||
|
||||
else
|
||||
--break
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1410,8 +1407,6 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
|
||||
if (name and unitCaster == "player") then
|
||||
local playerName = _UnitName ("player")
|
||||
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("player"), playerName, 0x00000417, _UnitGUID ("player"), playerName, 0x00000417, spellid, name, in_or_out)
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1431,8 +1426,6 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
|
||||
end
|
||||
|
||||
_detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("player"), playerName, 0x00000417, _UnitGUID ("player"), playerName, 0x00000417, spellid, name, in_or_out)
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+3
-1
@@ -536,7 +536,9 @@
|
||||
_detalhes.SoloTables.CombatID = _detalhes.SoloTables.CombatIDLast
|
||||
|
||||
else
|
||||
_detalhes:RefreshSolo()
|
||||
if (_detalhes.RefreshSolo) then
|
||||
_detalhes:RefreshSolo()
|
||||
end
|
||||
_detalhes.SoloTables.CombatID = nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2555,7 +2555,6 @@
|
||||
end
|
||||
end
|
||||
|
||||
--"ENVIRONMENTAL_DAMAGE" --> damage aplied by enviorement like lava.
|
||||
--SPELL_PERIODIC_MISSED --> need research
|
||||
--DAMAGE_SHIELD_MISSED --> need research
|
||||
--SPELL_EXTRA_ATTACKS --> need research
|
||||
|
||||
+36
-1
@@ -248,7 +248,42 @@
|
||||
|
||||
template = template or 1
|
||||
|
||||
if (template == 1) then
|
||||
if (template == 2) then
|
||||
local options_frame = CreateFrame ("frame", name, UIParent, "ButtonFrameTemplate")
|
||||
tinsert (UISpecialFrames, name)
|
||||
options_frame:SetSize (500, 200)
|
||||
options_frame:SetFrameStrata ("DIALOG")
|
||||
|
||||
options_frame:SetScript ("OnMouseDown", function(self, button)
|
||||
if (button == "RightButton") then
|
||||
if (self.moving) then
|
||||
self.moving = false
|
||||
self:StopMovingOrSizing()
|
||||
end
|
||||
return options_frame:Hide()
|
||||
elseif (button == "LeftButton" and not self.moving) then
|
||||
self.moving = true
|
||||
self:StartMoving()
|
||||
end
|
||||
end)
|
||||
options_frame:SetScript ("OnMouseUp", function(self)
|
||||
if (self.moving) then
|
||||
self.moving = false
|
||||
self:StopMovingOrSizing()
|
||||
end
|
||||
end)
|
||||
|
||||
options_frame:SetMovable (true)
|
||||
options_frame:EnableMouse (true)
|
||||
options_frame:Hide()
|
||||
|
||||
options_frame:SetPoint ("center", UIParent, "center")
|
||||
options_frame.TitleText:SetText (title)
|
||||
options_frame.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-BLOODELF]])
|
||||
|
||||
return options_frame
|
||||
|
||||
elseif (template == 1) then
|
||||
local options_frame = CreateFrame ("frame", name, UIParent)
|
||||
tinsert (UISpecialFrames, name)
|
||||
options_frame:SetSize (500, 200)
|
||||
|
||||
+13
-7
@@ -576,7 +576,7 @@ local ButtonMetaFunctions = {}
|
||||
end
|
||||
|
||||
if (button.MyObject.OnEnterHook) then
|
||||
local interrupt = button.MyObject.OnEnterHook (button)
|
||||
local interrupt = button.MyObject.OnEnterHook (button, button.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
@@ -621,7 +621,7 @@ local ButtonMetaFunctions = {}
|
||||
end
|
||||
|
||||
if (button.MyObject.OnLeaveHook) then
|
||||
local interrupt = button.MyObject.OnLeaveHook (button)
|
||||
local interrupt = button.MyObject.OnLeaveHook (button, button.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
@@ -653,7 +653,7 @@ local ButtonMetaFunctions = {}
|
||||
|
||||
local OnHide = function (button)
|
||||
if (button.MyObject.OnHideHook) then
|
||||
local interrupt = button.MyObject.OnHideHook (button)
|
||||
local interrupt = button.MyObject.OnHideHook (button, button.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
@@ -662,7 +662,7 @@ local ButtonMetaFunctions = {}
|
||||
|
||||
local OnShow = function (button)
|
||||
if (button.MyObject.OnShowHook) then
|
||||
local interrupt = button.MyObject.OnShowHook (button)
|
||||
local interrupt = button.MyObject.OnShowHook (button, button.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
@@ -687,7 +687,7 @@ local ButtonMetaFunctions = {}
|
||||
end
|
||||
|
||||
if (button.MyObject.OnMouseDownHook) then
|
||||
local interrupt = button.MyObject.OnMouseDownHook (button, buttontype)
|
||||
local interrupt = button.MyObject.OnMouseDownHook (button, buttontype, button.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
@@ -774,7 +774,7 @@ local ButtonMetaFunctions = {}
|
||||
end
|
||||
|
||||
if (button.MyObject.OnMouseUpHook) then
|
||||
local interrupt = button.MyObject.OnMouseUpHook (button, buttontype)
|
||||
local interrupt = button.MyObject.OnMouseUpHook (button, buttontype, button.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
@@ -836,10 +836,16 @@ local ButtonMetaFunctions = {}
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> object constructor
|
||||
|
||||
function gump:CreateButton (parent, func, w, h, text, param1, param2, texture, member, name, short_method)
|
||||
return gump:NewButton (parent, parent, name, member, w, h, func, param1, param2, texture, text, short_method)
|
||||
end
|
||||
|
||||
function gump:NewButton (parent, container, name, member, w, h, func, param1, param2, texture, text, short_method)
|
||||
|
||||
if (not name) then
|
||||
return nil
|
||||
name = "DetailsButtonNumber" .. gump.ButtonCounter
|
||||
gump.ButtonCounter = gump.ButtonCounter + 1
|
||||
|
||||
elseif (not parent) then
|
||||
return nil
|
||||
end
|
||||
|
||||
+11
-14
@@ -72,6 +72,7 @@ function DetailsCreateCoolTip()
|
||||
["FixedHeight"] = true,
|
||||
["FixedWidthSub"] = true,
|
||||
["FixedHeightSub"] = true,
|
||||
["AlignAsBlizzTooltip"] = true,
|
||||
["IgnoreSubMenu"] = true,
|
||||
["IgnoreButtonAutoHeight"] = true,
|
||||
["TextHeightMod"] = true,
|
||||
@@ -301,16 +302,6 @@ function DetailsCreateCoolTip()
|
||||
end)
|
||||
|
||||
frame1:SetScript ("OnHide", function (self)
|
||||
--[[ --> avoid taint errors
|
||||
if (not frame1.hidden) then --> significa que foi fechado com ESC
|
||||
frame1:Show()
|
||||
gump:Fade (frame1, 1)
|
||||
end
|
||||
if (not frame2.hidden) then --> significa que foi fechado com ESC
|
||||
frame2:Show()
|
||||
gump:Fade (frame2, 1)
|
||||
end
|
||||
--]]
|
||||
CoolTip.active = false
|
||||
CoolTip.buttonClicked = false
|
||||
CoolTip.mouseOver = false
|
||||
@@ -1163,7 +1154,13 @@ function DetailsCreateCoolTip()
|
||||
menuButton:SetPoint ("right", frame1, "right")
|
||||
|
||||
--> height
|
||||
if (CoolTip.OptionsTable.IgnoreButtonAutoHeight) then
|
||||
if (CoolTip.OptionsTable.AlignAsBlizzTooltip) then
|
||||
local height = _math_max (8, menuButton.leftText:GetStringHeight(), menuButton.rightText:GetStringHeight(), menuButton.leftIcon:GetHeight(), menuButton.rightIcon:GetHeight())
|
||||
menuButton:SetHeight (height)
|
||||
menuButton:SetPoint ("top", frame1, "top", 0, temp)
|
||||
temp = temp + ( height * -1)
|
||||
|
||||
elseif (CoolTip.OptionsTable.IgnoreButtonAutoHeight) then
|
||||
|
||||
local height = _math_max (menuButton.leftText:GetStringHeight(), menuButton.rightText:GetStringHeight(), menuButton.leftIcon:GetHeight(), menuButton.rightIcon:GetHeight())
|
||||
menuButton:SetHeight (height)
|
||||
@@ -1213,7 +1210,9 @@ function DetailsCreateCoolTip()
|
||||
if (CoolTip.OptionsTable.FixedHeight) then
|
||||
frame1:SetHeight (CoolTip.OptionsTable.FixedHeight)
|
||||
else
|
||||
if (CoolTip.OptionsTable.IgnoreButtonAutoHeight) then
|
||||
if (CoolTip.OptionsTable.AlignAsBlizzTooltip) then
|
||||
frame1:SetHeight ( (temp-10) * -1)
|
||||
elseif (CoolTip.OptionsTable.IgnoreButtonAutoHeight) then
|
||||
frame1:SetHeight ( (temp+spacing) * -1)
|
||||
else
|
||||
frame1:SetHeight ( _math_max ( (frame1.hHeight * CoolTip.Indexes) + 12, 22 ))
|
||||
@@ -2354,12 +2353,10 @@ function DetailsCreateCoolTip()
|
||||
if (not lineTable_left) then
|
||||
lineTable_left = {}
|
||||
_table_insert (frameTableLeft, CoolTip.Indexes, lineTable_left)
|
||||
--frameTableLeft [CoolTip.Indexes] = lineTable_left
|
||||
end
|
||||
if (not lineTable_right) then
|
||||
lineTable_right = {}
|
||||
_table_insert (frameTableRight, CoolTip.Indexes, lineTable_right)
|
||||
--frameTableRight [CoolTip.Indexes] = lineTable_right
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -819,10 +819,16 @@ end
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> object constructor
|
||||
|
||||
function gump:CreateDropDown (parent, func, default, w, h, member, name)
|
||||
return gump:NewDropDown (parent, parent, name, member, w, h, func, default)
|
||||
end
|
||||
|
||||
function gump:NewDropDown (parent, container, name, member, w, h, func, default)
|
||||
|
||||
if (not name) then
|
||||
return nil
|
||||
name = "DetailsDropDownNumber" .. gump.DropDownCounter
|
||||
gump.DropDownCounter = gump.DropDownCounter + 1
|
||||
|
||||
elseif (not parent) then
|
||||
return nil
|
||||
end
|
||||
|
||||
@@ -7,6 +7,10 @@ local _unpack = unpack
|
||||
local _
|
||||
gump.LabelNameCounter = 1
|
||||
gump.PictureNameCounter = 1
|
||||
gump.BarNameCounter = 1
|
||||
gump.DropDownCounter = 1
|
||||
gump.PanelCounter = 1
|
||||
gump.ButtonCounter = 1
|
||||
|
||||
gump.debug = false
|
||||
|
||||
|
||||
+4
-4
@@ -217,11 +217,11 @@ local LabelMetaFunctions = {}
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> object constructor
|
||||
function gump:CreateLabel (parent, text, size, color, font, member, name)
|
||||
return gump:NewLabel (parent, nil, name, member, text, font, size, color)
|
||||
function gump:CreateLabel (parent, text, size, color, font, member, name, layer)
|
||||
return gump:NewLabel (parent, nil, name, member, text, font, size, color, layer)
|
||||
end
|
||||
|
||||
function gump:NewLabel (parent, container, name, member, text, font, size, color)
|
||||
function gump:NewLabel (parent, container, name, member, text, font, size, color, layer)
|
||||
|
||||
if (not parent) then
|
||||
return nil
|
||||
@@ -257,7 +257,7 @@ function gump:NewLabel (parent, container, name, member, text, font, size, color
|
||||
|
||||
font = font or "GameFontHighlightSmall"
|
||||
|
||||
LabelObject.label = parent:CreateFontString (name, "OVERLAY", font)
|
||||
LabelObject.label = parent:CreateFontString (name, layer or "OVERLAY", font)
|
||||
LabelObject.widget = LabelObject.label
|
||||
|
||||
LabelObject.label.MyObject = LabelObject
|
||||
|
||||
@@ -419,7 +419,7 @@ local APIBarFunctions
|
||||
|
||||
local OnEnter = function (frame)
|
||||
if (frame.MyObject.OnEnterHook) then
|
||||
local interrupt = frame.MyObject.OnEnterHook (frame)
|
||||
local interrupt = frame.MyObject.OnEnterHook (frame, frame.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
@@ -591,10 +591,16 @@ function DetailsNormalBar_OnCreate (self)
|
||||
return true
|
||||
end
|
||||
|
||||
function gump:NewBar (parent, container, name, member, w, h, value)
|
||||
function gump:CreateBar (parent, texture, w, h, value, member, name)
|
||||
return gump:NewBar (parent, parent, name, member, w, h, value, texture)
|
||||
end
|
||||
|
||||
function gump:NewBar (parent, container, name, member, w, h, value, texture_name)
|
||||
|
||||
if (not name) then
|
||||
return nil
|
||||
name = "DetailsBarNumber" .. gump.BarNameCounter
|
||||
gump.BarNameCounter = gump.BarNameCounter + 1
|
||||
|
||||
elseif (not parent) then
|
||||
return nil
|
||||
elseif (not container) then
|
||||
@@ -617,6 +623,10 @@ function gump:NewBar (parent, container, name, member, w, h, value)
|
||||
if (container.dframework) then
|
||||
container = container.widget
|
||||
end
|
||||
|
||||
value = value or 0
|
||||
w = w or 150
|
||||
h = h or 14
|
||||
|
||||
--> default members:
|
||||
--> hooks
|
||||
@@ -680,6 +690,11 @@ function gump:NewBar (parent, container, name, member, w, h, value)
|
||||
|
||||
--> set class
|
||||
_setmetatable (BarObject, BarMetaFunctions)
|
||||
|
||||
|
||||
--> set texture
|
||||
if (texture_name) then
|
||||
smember_texture (BarObject, texture_name)
|
||||
end
|
||||
|
||||
return BarObject
|
||||
end
|
||||
|
||||
+532
-7
@@ -357,7 +357,7 @@ local APIFrameFunctions
|
||||
|
||||
local OnEnter = function (frame)
|
||||
if (frame.MyObject.OnEnterHook) then
|
||||
local interrupt = frame.MyObject.OnEnterHook (frame)
|
||||
local interrupt = frame.MyObject.OnEnterHook (frame, frame.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
@@ -379,7 +379,7 @@ local APIFrameFunctions
|
||||
|
||||
local OnLeave = function (frame)
|
||||
if (frame.MyObject.OnLeaveHook) then
|
||||
local interrupt = frame.MyObject.OnLeaveHook (frame)
|
||||
local interrupt = frame.MyObject.OnLeaveHook (frame, frame.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
@@ -397,7 +397,7 @@ local APIFrameFunctions
|
||||
|
||||
local OnHide = function (frame)
|
||||
if (frame.MyObject.OnHideHook) then
|
||||
local interrupt = frame.MyObject.OnHideHook (frame)
|
||||
local interrupt = frame.MyObject.OnHideHook (frame, frame.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
@@ -406,7 +406,7 @@ local APIFrameFunctions
|
||||
|
||||
local OnShow = function (frame)
|
||||
if (frame.MyObject.OnShowHook) then
|
||||
local interrupt = frame.MyObject.OnShowHook (frame)
|
||||
local interrupt = frame.MyObject.OnShowHook (frame, frame.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
@@ -415,7 +415,7 @@ local APIFrameFunctions
|
||||
|
||||
local OnMouseDown = function (frame, button)
|
||||
if (frame.MyObject.OnMouseDownHook) then
|
||||
local interrupt = frame.MyObject.OnMouseDownHook (frame, button)
|
||||
local interrupt = frame.MyObject.OnMouseDownHook (frame, button, frame.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
@@ -439,7 +439,7 @@ local APIFrameFunctions
|
||||
|
||||
local OnMouseUp = function (frame, button)
|
||||
if (frame.MyObject.OnMouseUpHook) then
|
||||
local interrupt = frame.MyObject.OnMouseUpHook (frame, button)
|
||||
local interrupt = frame.MyObject.OnMouseUpHook (frame, button, frame.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
@@ -464,10 +464,16 @@ local APIFrameFunctions
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> object constructor
|
||||
function gump:CreatePanel (parent, w, h, backdrop, backdropcolor, bordercolor, member, name)
|
||||
return gump:NewPanel (parent, parent, name, member, w, h, backdrop, backdropcolor, bordercolor)
|
||||
end
|
||||
|
||||
function gump:NewPanel (parent, container, name, member, w, h, backdrop, backdropcolor, bordercolor)
|
||||
|
||||
if (not name) then
|
||||
return nil
|
||||
name = "DetailsPanelNumber" .. gump.PanelCounter
|
||||
gump.PanelCounter = gump.PanelCounter + 1
|
||||
|
||||
elseif (not parent) then
|
||||
parent = UIParent
|
||||
end
|
||||
@@ -1129,3 +1135,522 @@ function gump:IconPick (callback, close_when_select)
|
||||
gump.IconPickFrame.click_close = close_when_select
|
||||
|
||||
end
|
||||
|
||||
local chart_panel_backdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
|
||||
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", edgeSize = 32, insets = {left = 5, right = 5, top = 5, bottom = 5}}
|
||||
|
||||
local chart_panel_align_timelabels = function (self, elapsed_time)
|
||||
|
||||
self.TimeScale = elapsed_time
|
||||
|
||||
local linha = self.TimeLabels [17]
|
||||
local minutos, segundos = math.floor (elapsed_time / 60), math.floor (elapsed_time % 60)
|
||||
if (segundos < 10) then
|
||||
segundos = "0" .. segundos
|
||||
end
|
||||
|
||||
if (minutos > 0) then
|
||||
if (minutos < 10) then
|
||||
minutos = "0" .. minutos
|
||||
end
|
||||
linha:SetText (minutos .. ":" .. segundos)
|
||||
else
|
||||
linha:SetText ("00:" .. segundos)
|
||||
end
|
||||
|
||||
local time_div = elapsed_time / 16 --786 -- 49.125
|
||||
|
||||
for i = 2, 16 do
|
||||
|
||||
local linha = self.TimeLabels [i]
|
||||
|
||||
local this_time = time_div * (i-1)
|
||||
local minutos, segundos = math.floor (this_time / 60), math.floor (this_time % 60)
|
||||
|
||||
if (segundos < 10) then
|
||||
segundos = "0" .. segundos
|
||||
end
|
||||
|
||||
if (minutos > 0) then
|
||||
if (minutos < 10) then
|
||||
minutos = "0" .. minutos
|
||||
end
|
||||
linha:SetText (minutos .. ":" .. segundos)
|
||||
else
|
||||
linha:SetText ("00:" .. segundos)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
local chart_panel_set_scale = function (self, amt, func, text)
|
||||
if (type (amt) ~= "number") then
|
||||
return
|
||||
end
|
||||
|
||||
local piece = amt / 8
|
||||
|
||||
for i = 1, 8 do
|
||||
if (func) then
|
||||
self ["dpsamt" .. math.abs (i-9)]:SetText ( func (piece*i) .. (text or ""))
|
||||
else
|
||||
self ["dpsamt" .. math.abs (i-9)]:SetText ( floor (piece*i) .. (text or ""))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local chart_panel_can_move = function (self, can)
|
||||
self.can_move = can
|
||||
end
|
||||
|
||||
local chart_panel_overlay_reset = function (self)
|
||||
self.OverlaysAmount = 1
|
||||
for index, pack in ipairs (self.Overlays) do
|
||||
for index2, texture in ipairs (pack) do
|
||||
texture:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local chart_panel_reset = function (self)
|
||||
|
||||
self.Graphic:ResetData()
|
||||
self.Graphic.max_value = 0
|
||||
|
||||
self.TimeScale = nil
|
||||
self.BoxLabelsAmount = 1
|
||||
table.wipe (self.GData)
|
||||
table.wipe (self.OData)
|
||||
|
||||
for index, box in ipairs (self.BoxLabels) do
|
||||
box.check:Hide()
|
||||
box.button:Hide()
|
||||
box.box:Hide()
|
||||
box.text:Hide()
|
||||
box.border:Hide()
|
||||
box.showing = false
|
||||
end
|
||||
|
||||
chart_panel_overlay_reset (self)
|
||||
end
|
||||
|
||||
local chart_panel_enable_line = function (f, thisbox)
|
||||
|
||||
local index = thisbox.index
|
||||
local type = thisbox.type
|
||||
|
||||
if (thisbox.enabled) then
|
||||
--disable
|
||||
thisbox.check:Hide()
|
||||
thisbox.enabled = false
|
||||
else
|
||||
--enable
|
||||
thisbox.check:Show()
|
||||
thisbox.enabled = true
|
||||
end
|
||||
|
||||
if (type == "graphic") then
|
||||
|
||||
f.Graphic:ResetData()
|
||||
f.Graphic.max_value = 0
|
||||
|
||||
local max = 0
|
||||
|
||||
for index, box in ipairs (f.BoxLabels) do
|
||||
if (box.type == type and box.showing and box.enabled) then
|
||||
local data = f.GData [index]
|
||||
f.Graphic:AddDataSeries (data[1], data[2], nil, data[3])
|
||||
if (data[4] > max) then
|
||||
max = data[4]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
f:SetScale (max)
|
||||
|
||||
elseif (type == "overlay") then
|
||||
|
||||
chart_panel_overlay_reset (f)
|
||||
|
||||
for index, box in ipairs (f.BoxLabels) do
|
||||
if (box.type == type and box.showing and box.enabled) then
|
||||
|
||||
f:AddOverlay (box.index)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
local create_box = function (self, next_box)
|
||||
|
||||
local thisbox = {}
|
||||
self.BoxLabels [next_box] = thisbox
|
||||
|
||||
local box = gump:NewImage (self, nil, 16, 16, "border")
|
||||
local text = gump:CreateLabel (self, nil, nil, nil, "GameFontNormal")
|
||||
|
||||
local border = gump:NewImage (self, [[Interface\DialogFrame\UI-DialogBox-Gold-Corner]], 30, 30, "artwork")
|
||||
border:SetPoint ("center", box, "center", -3, -4)
|
||||
|
||||
local checktexture = gump:NewImage (self, [[Interface\Buttons\UI-CheckBox-Check]], 18, 18, "overlay")
|
||||
checktexture:SetPoint ("center", box, "center", -1, -1)
|
||||
|
||||
thisbox.box = box
|
||||
thisbox.text = text
|
||||
thisbox.border = border
|
||||
thisbox.check = checktexture
|
||||
thisbox.enabled = true
|
||||
|
||||
local button = gump:CreateButton (self, chart_panel_enable_line, 20, 20, "", self, thisbox)
|
||||
button:SetPoint ("center", box, "center")
|
||||
|
||||
thisbox.button = button
|
||||
|
||||
thisbox.box:SetPoint ("right", text, "left", -4, 0)
|
||||
|
||||
if (next_box == 1) then
|
||||
thisbox.text:SetPoint ("topright", self, "topright", -35, -16)
|
||||
else
|
||||
thisbox.text:SetPoint ("right", self.BoxLabels [next_box-1].box, "left", -7, 0)
|
||||
end
|
||||
|
||||
return thisbox
|
||||
|
||||
end
|
||||
|
||||
local chart_panel_add_label = function (self, color, name, type, number)
|
||||
|
||||
local next_box = self.BoxLabelsAmount
|
||||
local thisbox = self.BoxLabels [next_box]
|
||||
|
||||
if (not thisbox) then
|
||||
thisbox = create_box (self, next_box)
|
||||
end
|
||||
|
||||
self.BoxLabelsAmount = self.BoxLabelsAmount + 1
|
||||
|
||||
thisbox.type = type
|
||||
thisbox.index = number
|
||||
|
||||
thisbox.box:SetTexture (unpack (color))
|
||||
thisbox.text:SetText (name)
|
||||
|
||||
thisbox.check:Show()
|
||||
thisbox.button:Show()
|
||||
thisbox.border:Show()
|
||||
thisbox.box:Show()
|
||||
thisbox.text:Show()
|
||||
|
||||
thisbox.showing = true
|
||||
thisbox.enabled = true
|
||||
|
||||
end
|
||||
|
||||
local line_default_color = {1, 1, 1}
|
||||
local draw_overlay = function (self, this_overlay, overlayData, color)
|
||||
|
||||
local pixel = self.Graphic:GetWidth() / self.TimeScale
|
||||
local index = 1
|
||||
local r, g, b = unpack (color)
|
||||
|
||||
for i = 1, #overlayData, 2 do
|
||||
local aura_start = overlayData [i]
|
||||
local aura_end = overlayData [i+1]
|
||||
|
||||
local this_block = this_overlay [index]
|
||||
if (not this_block) then
|
||||
this_block = self.Graphic:CreateTexture (nil, "border")
|
||||
tinsert (this_overlay, this_block)
|
||||
end
|
||||
this_block:SetHeight (self.Graphic:GetHeight())
|
||||
|
||||
this_block:SetPoint ("left", self.Graphic, "left", pixel * aura_start, 0)
|
||||
if (aura_end) then
|
||||
this_block:SetWidth ((aura_end-aura_start)*pixel)
|
||||
else
|
||||
--malformed table
|
||||
this_block:SetWidth (pixel*5)
|
||||
end
|
||||
|
||||
this_block:SetTexture (r, g, b, 0.25)
|
||||
this_block:Show()
|
||||
|
||||
index = index + 1
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
local chart_panel_add_overlay = function (self, overlayData, color, name, icon)
|
||||
|
||||
if (not self.TimeScale) then
|
||||
error ("Use SetTime (time) before adding an overlay.")
|
||||
end
|
||||
|
||||
if (type (overlayData) == "number") then
|
||||
local overlay_index = overlayData
|
||||
draw_overlay (self, self.Overlays [self.OverlaysAmount], self.OData [overlay_index][1], self.OData [overlay_index][2])
|
||||
else
|
||||
local this_overlay = self.Overlays [self.OverlaysAmount]
|
||||
if (not this_overlay) then
|
||||
this_overlay = {}
|
||||
tinsert (self.Overlays, this_overlay)
|
||||
end
|
||||
|
||||
draw_overlay (self, this_overlay, overlayData, color)
|
||||
|
||||
tinsert (self.OData, {overlayData, color or line_default_color})
|
||||
if (name) then
|
||||
self:AddLabel (color or line_default_color, name, "overlay", #self.OData)
|
||||
end
|
||||
end
|
||||
|
||||
self.OverlaysAmount = self.OverlaysAmount + 1
|
||||
end
|
||||
|
||||
local chart_panel_add_data = function (self, graphicData, color, name, lineTexture, smoothLevel)
|
||||
|
||||
|
||||
local f = self
|
||||
self = self.Graphic
|
||||
|
||||
local _data = {}
|
||||
local max_value = graphicData.max_value
|
||||
local amount = #graphicData
|
||||
|
||||
local scaleW = 1/self:GetWidth()
|
||||
|
||||
local content = graphicData
|
||||
tinsert (content, 1, 0)
|
||||
tinsert (content, 1, 0)
|
||||
tinsert (content, #content+1, 0)
|
||||
tinsert (content, #content+1, 0)
|
||||
|
||||
local _i = 3
|
||||
|
||||
local graphMaxDps = math.max (self.max_value, max_value)
|
||||
if (not smoothLevel) then
|
||||
while (_i <= #content-2) do
|
||||
local v = (content[_i-2]+content[_i-1]+content[_i]+content[_i+1]+content[_i+2])/5 --> normalize
|
||||
_data [#_data+1] = {scaleW*(_i-2), v/graphMaxDps} --> x and y coords
|
||||
_i = _i + 1
|
||||
end
|
||||
|
||||
elseif (smoothLevel == 1) then
|
||||
_i = 2
|
||||
while (_i <= #content-1) do
|
||||
local v = (content[_i-1]+content[_i]+content[_i+1])/3 --> normalize
|
||||
_data [#_data+1] = {scaleW*(_i-1), v/graphMaxDps} --> x and y coords
|
||||
_i = _i + 1
|
||||
end
|
||||
|
||||
elseif (smoothLevel == 2) then
|
||||
_i = 1
|
||||
while (_i <= #content) do
|
||||
local v = content[_i] --> do not normalize
|
||||
_data [#_data+1] = {scaleW*(_i), v/graphMaxDps} --> x and y coords
|
||||
_i = _i + 1
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
tremove (content, 1)
|
||||
tremove (content, 1)
|
||||
tremove (content, #graphicData)
|
||||
tremove (content, #graphicData)
|
||||
|
||||
if (max_value > self.max_value) then
|
||||
--> normalize previous data
|
||||
if (self.max_value > 0) then
|
||||
local normalizePercent = self.max_value / max_value
|
||||
for dataIndex, Data in ipairs (self.Data) do
|
||||
local Points = Data.Points
|
||||
for i = 1, #Points do
|
||||
Points[i][2] = Points[i][2]*normalizePercent
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self.max_value = max_value
|
||||
end
|
||||
|
||||
tinsert (f.GData, {_data, color or line_default_color, lineTexture, graphicData.max_value})
|
||||
if (name) then
|
||||
f:AddLabel (color or line_default_color, name, "graphic", #f.GData)
|
||||
end
|
||||
|
||||
self:AddDataSeries (_data, color or line_default_color, nil, lineTexture)
|
||||
|
||||
end
|
||||
|
||||
local chart_panel_onresize = function (self)
|
||||
local width, height = self:GetSize()
|
||||
local spacement = width - 78 - 60
|
||||
spacement = spacement / 16
|
||||
|
||||
for i = 1, 17 do
|
||||
local label = self.TimeLabels [i]
|
||||
label:SetPoint ("bottomleft", f, "bottomleft", 78 + ((i-1)*spacement), 13)
|
||||
label.line:SetHeight (height - 45)
|
||||
end
|
||||
|
||||
local spacement = (self.Graphic:GetHeight()) / 8
|
||||
for i = 1, 8 do
|
||||
self ["dpsamt"..i]:SetPoint ("TOPLEFT", self, "TOPLEFT", 27, -25 + (-(spacement* (i-1))) )
|
||||
self ["dpsamt"..i].line:SetWidth (width-20)
|
||||
end
|
||||
|
||||
self.Graphic:SetSize (width - 135, height - 67)
|
||||
self.Graphic:SetPoint ("topleft", self, "topleft", 108, -35)
|
||||
end
|
||||
|
||||
local chart_panel_vlines_on = function (self)
|
||||
for i = 1, 17 do
|
||||
local label = self.TimeLabels [i]
|
||||
label.line:Show()
|
||||
end
|
||||
end
|
||||
|
||||
local chart_panel_vlines_off = function (self)
|
||||
for i = 1, 17 do
|
||||
local label = self.TimeLabels [i]
|
||||
label.line:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
local chart_panel_set_title = function (self, title)
|
||||
self.chart_title.text = title
|
||||
end
|
||||
|
||||
local chart_panel_mousedown = function (self, button)
|
||||
if (button == "LeftButton" and self.can_move) then
|
||||
if (not self.isMoving) then
|
||||
self:StartMoving()
|
||||
self.isMoving = true
|
||||
end
|
||||
elseif (button == "RightButton") then
|
||||
if (not self.isMoving) then
|
||||
self:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
local chart_panel_mouseup = function (self, button)
|
||||
if (button == "LeftButton" and self.isMoving) then
|
||||
self:StopMovingOrSizing()
|
||||
self.isMoving = nil
|
||||
end
|
||||
end
|
||||
|
||||
function gump:CreateChartPanel (parent, w, h, name)
|
||||
|
||||
if (not name) then
|
||||
name = "DetailsPanelNumber" .. gump.PanelCounter
|
||||
gump.PanelCounter = gump.PanelCounter + 1
|
||||
end
|
||||
|
||||
parent = parent or UIParent
|
||||
w = w or 800
|
||||
h = h or 500
|
||||
|
||||
local f = CreateFrame ("frame", name, parent)
|
||||
f:SetSize (w or 500, h or 400)
|
||||
f:EnableMouse (true)
|
||||
f:SetMovable (true)
|
||||
|
||||
f:SetScript ("OnMouseDown", chart_panel_mousedown)
|
||||
f:SetScript ("OnMouseUp", chart_panel_mouseup)
|
||||
|
||||
f:SetBackdrop (chart_panel_backdrop)
|
||||
f:SetBackdropColor (.3, .3, .3, .3)
|
||||
|
||||
local c = CreateFrame ("Button", nil, f, "UIPanelCloseButton")
|
||||
c:SetWidth (32)
|
||||
c:SetHeight (32)
|
||||
c:SetPoint ("TOPRIGHT", f, "TOPRIGHT", -3, -7)
|
||||
c:SetFrameLevel (f:GetFrameLevel()+1)
|
||||
c:SetAlpha (0.9)
|
||||
f.CloseButton = c
|
||||
|
||||
local title = gump:NewLabel (f, nil, "$parentTitle", "chart_title", "Chart!", nil, 20, "yellow")
|
||||
title:SetPoint (110, -13)
|
||||
_detalhes:SetFontOutline (title, true)
|
||||
|
||||
local bottom_texture = gump:NewImage (f, nil, 702, 25, "background", nil, nil, "$parentBottomTexture")
|
||||
bottom_texture:SetTexture (0, 0, 0, .6)
|
||||
bottom_texture:SetPoint ("bottomleft", f, "bottomleft", 8, 7)
|
||||
bottom_texture:SetPoint ("bottomright", f, "bottomright", -8, 7)
|
||||
|
||||
f.Overlays = {}
|
||||
f.OverlaysAmount = 1
|
||||
|
||||
f.BoxLabels = {}
|
||||
f.BoxLabelsAmount = 1
|
||||
|
||||
f.TimeLabels = {}
|
||||
for i = 1, 17 do
|
||||
local time = gump:NewLabel (f, nil, "$parentTime"..i, nil, "00:00")
|
||||
time:SetPoint ("bottomleft", f, "bottomleft", 78 + ((i-1)*36), 13)
|
||||
f.TimeLabels [i] = time
|
||||
local line = gump:NewImage (f, nil, 1, h-45, "border", nil, nil, "$parentTime"..i.."Bar")
|
||||
line:SetTexture (1, 1, 1, .1)
|
||||
line:SetPoint ("bottomleft", time, "topright", 0, -10)
|
||||
time.line = line
|
||||
end
|
||||
|
||||
--graphic
|
||||
local g = LibStub:GetLibrary("LibGraph-2.0"):CreateGraphLine (name .. "Graphic", f, "topleft","topleft", 108, -35, w - 120, h - 67)
|
||||
g:SetXAxis (-1,1)
|
||||
g:SetYAxis (-1,1)
|
||||
g:SetGridSpacing (false, false)
|
||||
g:SetGridColor ({0.5,0.5,0.5,0.3})
|
||||
g:SetAxisDrawing (false,false)
|
||||
g:SetAxisColor({1.0,1.0,1.0,1.0})
|
||||
g:SetAutoScale (true)
|
||||
g:SetLineTexture ("smallline")
|
||||
g:SetBorderSize ("right", 0.001)
|
||||
g:SetBorderSize ("left", 0.000)
|
||||
g:SetBorderSize ("top", 0.002)
|
||||
g:SetBorderSize ("bottom", 0.001)
|
||||
g.VerticalLines = {}
|
||||
g.max_value = 0
|
||||
|
||||
g:SetLineTexture ("line")
|
||||
|
||||
f.Graphic = g
|
||||
f.GData = {}
|
||||
f.OData = {}
|
||||
|
||||
g:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16})
|
||||
g:SetBackdropColor (0, 0, 0, 0.8)
|
||||
|
||||
--div lines
|
||||
for i = 1, 8, 1 do
|
||||
local line = g:CreateTexture (nil, "overlay")
|
||||
line:SetTexture (1, 1, 1, .2)
|
||||
line:SetWidth (670)
|
||||
line:SetHeight (1.1)
|
||||
|
||||
gump:NewLabel (f, f, nil, "dpsamt"..i, "100k", "GameFontHighlightSmall")
|
||||
f["dpsamt"..i]:SetPoint ("TOPLEFT", f, "TOPLEFT", 27, -61 + (-(24.6*i)))
|
||||
line:SetPoint ("topleft", f["dpsamt"..i].widget, "bottom", -27, 0)
|
||||
f["dpsamt"..i].line = line
|
||||
end
|
||||
|
||||
f.SetTime = chart_panel_align_timelabels
|
||||
f.EnableVerticalLines = chart_panel_vlines_on
|
||||
f.DisableVerticalLines = chart_panel_vlines_off
|
||||
f.SetTitle = chart_panel_set_title
|
||||
f.SetScale = chart_panel_set_scale
|
||||
f.Reset = chart_panel_reset
|
||||
f.AddLine = chart_panel_add_data
|
||||
f.CanMove = chart_panel_can_move
|
||||
f.AddLabel = chart_panel_add_label
|
||||
f.AddOverlay = chart_panel_add_overlay
|
||||
|
||||
f:SetScript ("OnSizeChanged", chart_panel_onresize)
|
||||
chart_panel_onresize (f)
|
||||
|
||||
return f
|
||||
end
|
||||
|
||||
+7
-1
@@ -147,7 +147,13 @@ do
|
||||
|
||||
--> return the wallpaper for the raid instance
|
||||
function _detalhes:GetRaidBackground (mapid)
|
||||
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].background
|
||||
local bosstables = _detalhes.EncounterInformation [mapid]
|
||||
if (bosstables) then
|
||||
local bg = bosstables.backgroundFile
|
||||
if (bg) then
|
||||
return bg.file, unpack (bg.coords)
|
||||
end
|
||||
end
|
||||
end
|
||||
--> return the icon for the raid instance
|
||||
function _detalhes:GetRaidIcon (mapid)
|
||||
|
||||
@@ -118,5 +118,10 @@ do
|
||||
function _detalhes:Class (actor)
|
||||
return self.classe or actor.classe
|
||||
end
|
||||
|
||||
function _detalhes:GetActorSpells()
|
||||
return self.spell_tables._ActorTable
|
||||
end
|
||||
function _detalhes:GetSpell (spellid)
|
||||
return self.spell_tables._ActorTable [spellid]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -804,6 +804,7 @@ _detalhes.default_profile = default_profile
|
||||
local default_player_data = {
|
||||
--> current combat number
|
||||
combat_id = 0,
|
||||
combat_counter = 0,
|
||||
--> nicktag cache
|
||||
nick_tag_cache = {},
|
||||
--> plugin data
|
||||
|
||||
+11
-1
@@ -70,6 +70,10 @@
|
||||
this_capture [INDEX_ENABLED] = this_capture [INDEX_ENABLED]
|
||||
end
|
||||
|
||||
if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then
|
||||
_G.DetailsOptionsWindow16UserTimeCapturesFillPanel.MyObject:Refresh()
|
||||
end
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
@@ -131,11 +135,17 @@
|
||||
--> unregister
|
||||
function _detalhes:TimeDataUnregister (name)
|
||||
if (type (name) == "number") then
|
||||
return tremove (_detalhes.savedTimeCaptures, name)
|
||||
tremove (_detalhes.savedTimeCaptures, name)
|
||||
if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then
|
||||
_G.DetailsOptionsWindow16UserTimeCapturesFillPanel.MyObject:Refresh()
|
||||
end
|
||||
else
|
||||
for index, t in ipairs (_detalhes.savedTimeCaptures) do
|
||||
if (t [INDEX_NAME] == name) then
|
||||
tremove (_detalhes.savedTimeCaptures, index)
|
||||
if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then
|
||||
_G.DetailsOptionsWindow16UserTimeCapturesFillPanel.MyObject:Refresh()
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
+10
-4
@@ -91,10 +91,16 @@
|
||||
custom_window:SetSize (850, 370)
|
||||
custom_window:EnableMouse (true)
|
||||
custom_window:SetMovable (true)
|
||||
custom_window:SetScript ("OnMouseDown", function (self)
|
||||
if (not self.moving) then
|
||||
self.moving = true
|
||||
self:StartMoving()
|
||||
custom_window:SetScript ("OnMouseDown", function (self, button)
|
||||
if (button == "LeftButton") then
|
||||
if (not self.moving) then
|
||||
self.moving = true
|
||||
self:StartMoving()
|
||||
end
|
||||
elseif (button == "RightButton") then
|
||||
if (not self.moving) then
|
||||
_detalhes:CloseCustomDisplayWindow()
|
||||
end
|
||||
end
|
||||
end)
|
||||
custom_window:SetScript ("OnMouseUp", function (self)
|
||||
|
||||
+129
-170
@@ -363,78 +363,42 @@ end
|
||||
|
||||
|
||||
--> seta os scripts da janela de informações
|
||||
local mouse_down_func = function (self, button)
|
||||
if (button == "LeftButton") then
|
||||
info:StartMoving()
|
||||
info.isMoving = true
|
||||
elseif (button == "RightButton" and not self.isMoving) then
|
||||
_detalhes:FechaJanelaInfo()
|
||||
end
|
||||
end
|
||||
|
||||
local mouse_up_func = function (self, button)
|
||||
if (info.isMoving) then
|
||||
info:StopMovingOrSizing()
|
||||
info.isMoving = false
|
||||
end
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------
|
||||
local function seta_scripts (este_gump)
|
||||
|
||||
--> Janela
|
||||
este_gump:SetScript ("OnMouseDown",
|
||||
function (self, botao)
|
||||
if (botao == "LeftButton") then
|
||||
self:StartMoving()
|
||||
self.isMoving = true
|
||||
end
|
||||
end)
|
||||
|
||||
este_gump:SetScript ("OnMouseUp",
|
||||
function (self)
|
||||
if (self.isMoving) then
|
||||
self:StopMovingOrSizing()
|
||||
self.isMoving = false
|
||||
end
|
||||
end)
|
||||
|
||||
este_gump.container_barras.gump:SetScript ("OnMouseDown",
|
||||
function (self, botao)
|
||||
if (botao == "LeftButton") then
|
||||
este_gump:StartMoving()
|
||||
este_gump.isMoving = true
|
||||
end
|
||||
end)
|
||||
|
||||
este_gump.container_barras.gump:SetScript ("OnMouseUp",
|
||||
function (self)
|
||||
if (este_gump.isMoving) then
|
||||
este_gump:StopMovingOrSizing()
|
||||
este_gump.isMoving = false
|
||||
end
|
||||
end)
|
||||
|
||||
este_gump.container_detalhes:SetScript ("OnMouseDown",
|
||||
function (self, botao)
|
||||
if (botao == "LeftButton") then
|
||||
este_gump:StartMoving()
|
||||
este_gump.isMoving = true
|
||||
end
|
||||
end)
|
||||
|
||||
este_gump.container_detalhes:SetScript ("OnMouseUp",
|
||||
function (self)
|
||||
if (este_gump.isMoving) then
|
||||
este_gump:StopMovingOrSizing()
|
||||
este_gump.isMoving = false
|
||||
end
|
||||
end)
|
||||
este_gump:SetScript ("OnMouseDown", mouse_down_func)
|
||||
este_gump:SetScript ("OnMouseUp", mouse_up_func)
|
||||
|
||||
este_gump.container_alvos.gump:SetScript ("OnMouseDown",
|
||||
function (self, botao)
|
||||
if (botao == "LeftButton") then
|
||||
este_gump:StartMoving()
|
||||
este_gump.isMoving = true
|
||||
end
|
||||
end)
|
||||
este_gump.container_barras.gump:SetScript ("OnMouseDown", mouse_down_func)
|
||||
este_gump.container_barras.gump:SetScript ("OnMouseUp", mouse_up_func)
|
||||
|
||||
este_gump.container_alvos.gump:SetScript ("OnMouseUp",
|
||||
function (self)
|
||||
if (este_gump.isMoving) then
|
||||
este_gump:StopMovingOrSizing()
|
||||
este_gump.isMoving = false
|
||||
end
|
||||
end)
|
||||
este_gump.container_detalhes:SetScript ("OnMouseDown", mouse_down_func)
|
||||
este_gump.container_detalhes:SetScript ("OnMouseUp", mouse_up_func)
|
||||
|
||||
este_gump.container_alvos.gump:SetScript ("OnMouseDown", mouse_down_func)
|
||||
este_gump.container_alvos.gump:SetScript ("OnMouseUp", mouse_up_func)
|
||||
|
||||
--> botão fechar
|
||||
este_gump.fechar:SetScript ("OnClick", function(self)
|
||||
_detalhes:FechaJanelaInfo()
|
||||
end)
|
||||
este_gump.fechar:SetScript ("OnClick", function (self)
|
||||
_detalhes:FechaJanelaInfo()
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -453,7 +417,28 @@ end
|
||||
|
||||
--> cria a barra de detalhes a direita da janela de informações
|
||||
------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local detalhe_infobg_onenter = function (self)
|
||||
gump:Fade (self.overlay, "OUT")
|
||||
gump:Fade (self.reportar, "OUT")
|
||||
end
|
||||
|
||||
local detalhe_infobg_onleave = function (self)
|
||||
gump:Fade (self.overlay, "IN")
|
||||
gump:Fade (self.reportar, "IN")
|
||||
end
|
||||
|
||||
local detalhes_inforeport_onenter = function (self)
|
||||
gump:Fade (self:GetParent().overlay, "OUT")
|
||||
gump:Fade (self, "OUT")
|
||||
end
|
||||
local detalhes_inforeport_onleave = function (self)
|
||||
gump:Fade (self:GetParent().overlay, "IN")
|
||||
gump:Fade (self, "IN")
|
||||
end
|
||||
|
||||
function gump:CriaDetalheInfo (index)
|
||||
|
||||
local info = {}
|
||||
info.nome = _detalhes.janela_info.container_detalhes:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall")
|
||||
info.nome2 = _detalhes.janela_info.container_detalhes:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall")
|
||||
@@ -483,38 +468,15 @@ function gump:CriaDetalheInfo (index)
|
||||
info.bg.reportar:SetPoint ("BOTTOMLEFT", info.bg.overlay, "BOTTOMRIGHT", -33, 10)
|
||||
gump:Fade (info.bg.reportar, 1)
|
||||
|
||||
info.bg:SetScript ("OnEnter",
|
||||
function(self)
|
||||
gump:Fade (self.overlay, "OUT")
|
||||
gump:Fade (self.reportar, "OUT")
|
||||
end)
|
||||
info.bg:SetScript ("OnLeave",
|
||||
function(self)
|
||||
gump:Fade (self.overlay, "IN")
|
||||
gump:Fade (self.reportar, "IN")
|
||||
end)
|
||||
info.bg:SetScript ("OnEnter", detalhe_infobg_onenter)
|
||||
info.bg:SetScript ("OnLeave", detalhe_infobg_onleave)
|
||||
|
||||
info.bg.reportar:SetScript ("OnEnter", detalhes_inforeport_onenter)
|
||||
info.bg.reportar:SetScript ("OnLeave", detalhes_inforeport_onleave)
|
||||
|
||||
info.bg.reportar:SetScript ("OnEnter",
|
||||
function(self)
|
||||
gump:Fade (info.bg.overlay, "OUT")
|
||||
gump:Fade (self, "OUT")
|
||||
end)
|
||||
info.bg.reportar:SetScript ("OnLeave",
|
||||
function(self)
|
||||
gump:Fade (info.bg.overlay, "IN")
|
||||
gump:Fade (self, "IN")
|
||||
end)
|
||||
|
||||
info.bg_end = info.bg:CreateTexture (nil, "BACKGROUND")
|
||||
info.bg_end:SetHeight (47)
|
||||
--este_gump.bg4:SetPoint ("BOTTOMRIGHT", este_gump, "BOTTOMRIGHT", 0, 0)
|
||||
--este_gump.bg4:SetWidth (128)
|
||||
--este_gump.bg4:SetHeight (256)
|
||||
info.bg_end:SetTexture ("Interface\\AddOns\\Details\\images\\bar_detalhes2_end")
|
||||
--info.bg = _detalhes.janela_info.container_detalhes:CreateTexture (nil, "BACKGROUND")
|
||||
--info.bg:SetWidth (400)
|
||||
--info.bg:SetHeight (70)
|
||||
--info.bg:SetTexture ("Interface\\MONEYFRAME\\UI-MoneyFrame2")
|
||||
|
||||
_detalhes.janela_info.grupos_detalhes [index] = info
|
||||
end
|
||||
@@ -3384,6 +3346,79 @@ local row_on_leave = function (self)
|
||||
end
|
||||
end
|
||||
|
||||
local row_on_mousedown = function (self)
|
||||
if (self.fading_in) then
|
||||
return
|
||||
end
|
||||
|
||||
self.mouse_down = _GetTime()
|
||||
local x, y = _GetCursorPosition()
|
||||
self.x = _math_floor (x)
|
||||
self.y = _math_floor (y)
|
||||
|
||||
if ((not info.isLocked) or (info.isLocked == 0)) then
|
||||
info:StartMoving()
|
||||
info.isMoving = true
|
||||
end
|
||||
end
|
||||
|
||||
local row_on_mouseup = function (self)
|
||||
if (self.fading_in) then
|
||||
return
|
||||
end
|
||||
|
||||
if (info.isMoving) then
|
||||
info:StopMovingOrSizing()
|
||||
info.isMoving = false
|
||||
end
|
||||
|
||||
local x, y = _GetCursorPosition()
|
||||
x = _math_floor (x)
|
||||
y = _math_floor (y)
|
||||
if ((self.mouse_down+0.4 > _GetTime() and (x == self.x and y == self.y)) or (x == self.x and y == self.y)) then
|
||||
--> setar os textos
|
||||
|
||||
if (self.isMain) then --> se não for uma barra de alvo
|
||||
|
||||
local barra_antiga = info.mostrando
|
||||
if (barra_antiga and not info.mostrando_mouse_over) then
|
||||
|
||||
barra_antiga.textura:SetStatusBarColor (1, 1, 1, 1) --> volta a textura normal
|
||||
barra_antiga.on_focus = false --> não esta mais no foco
|
||||
|
||||
--> CLICOU NA MESMA BARRA
|
||||
if (barra_antiga == self) then -->
|
||||
info.mostrando_mouse_over = true
|
||||
return
|
||||
|
||||
--> CLICOU EM OUTRA BARRA
|
||||
else --> clicou em outra barra e trocou o foco
|
||||
barra_antiga:SetAlpha (.9) --> volta a alfa antiga
|
||||
|
||||
info.mostrando = self
|
||||
info.showing = i
|
||||
|
||||
info.jogador.detalhes = self.show
|
||||
info.jogador:MontaDetalhes (self.show, self)
|
||||
|
||||
self:SetAlpha (1)
|
||||
self.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1)
|
||||
self.on_focus = true
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
--> NÃO TINHA BARRAS PRECIONADAS
|
||||
-- info.mostrando = self
|
||||
info.mostrando_mouse_over = false
|
||||
self:SetAlpha (1)
|
||||
self.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1)
|
||||
self.on_focus = true
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
local function SetBarraScripts (esta_barra, instancia, i)
|
||||
|
||||
esta_barra._index = i
|
||||
@@ -3391,85 +3426,9 @@ local function SetBarraScripts (esta_barra, instancia, i)
|
||||
esta_barra:SetScript ("OnEnter", row_on_enter)
|
||||
esta_barra:SetScript ("OnLeave", row_on_leave)
|
||||
|
||||
esta_barra:SetScript ("OnMouseDown", function (self)
|
||||
|
||||
if (self.fading_in) then
|
||||
return
|
||||
end
|
||||
|
||||
self.mouse_down = _GetTime()
|
||||
local x, y = _GetCursorPosition()
|
||||
self.x = _math_floor (x)
|
||||
self.y = _math_floor (y)
|
||||
|
||||
if ((not info.isLocked) or (info.isLocked == 0)) then
|
||||
info:StartMoving()
|
||||
info.isMoving = true
|
||||
end
|
||||
|
||||
end)
|
||||
|
||||
esta_barra:SetScript ("OnMouseUp", function (self)
|
||||
esta_barra:SetScript ("OnMouseDown", row_on_mousedown)
|
||||
esta_barra:SetScript ("OnMouseUp", row_on_mouseup)
|
||||
|
||||
if (self.fading_in) then
|
||||
return
|
||||
end
|
||||
|
||||
if (info.isMoving) then
|
||||
info:StopMovingOrSizing()
|
||||
info.isMoving = false
|
||||
--instancia:SaveMainWindowPosition() --> precisa fazer algo pra salvar o trem
|
||||
end
|
||||
|
||||
local x, y = _GetCursorPosition()
|
||||
x = _math_floor (x)
|
||||
y = _math_floor (y)
|
||||
if ((self.mouse_down+0.4 > _GetTime() and (x == self.x and y == self.y)) or (x == self.x and y == self.y)) then
|
||||
--> setar os textos
|
||||
|
||||
if (self.isMain) then --> se não for uma barra de alvo
|
||||
|
||||
local barra_antiga = info.mostrando --> ??
|
||||
|
||||
--> on_focus = quando a barra esta precionada
|
||||
|
||||
if (barra_antiga and not info.mostrando_mouse_over) then
|
||||
|
||||
barra_antiga.textura:SetStatusBarColor (1, 1, 1, 1) --> volta a textura normal
|
||||
barra_antiga.on_focus = false --> não esta mais no foco
|
||||
|
||||
--> CLICOU NA MESMA BARRA
|
||||
if (barra_antiga == self) then -->
|
||||
info.mostrando_mouse_over = true
|
||||
return
|
||||
|
||||
--> CLICOU EM OUTRA BARRA
|
||||
else --> clicou em outra barra e trocou o foco
|
||||
barra_antiga:SetAlpha (.9) --> volta a alfa antiga
|
||||
|
||||
info.mostrando = self
|
||||
info.showing = i
|
||||
|
||||
info.jogador.detalhes = self.show
|
||||
info.jogador:MontaDetalhes (self.show, self)
|
||||
|
||||
self:SetAlpha (1)
|
||||
self.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1)
|
||||
self.on_focus = true
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
--> NÃO TINHA BARRAS PRECIONADAS
|
||||
-- info.mostrando = self
|
||||
info.mostrando_mouse_over = false
|
||||
self:SetAlpha (1)
|
||||
self.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1)
|
||||
self.on_focus = true
|
||||
end
|
||||
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
local function CriaTexturaBarra (instancia, barra)
|
||||
|
||||
+419
-406
@@ -661,52 +661,56 @@ local function move_janela (baseframe, iniciando, instancia)
|
||||
end
|
||||
_detalhes.move_janela_func = move_janela
|
||||
|
||||
local function BGFrame_scripts (BG, baseframe, instancia)
|
||||
|
||||
BG:SetScript("OnEnter", function (self)
|
||||
OnEnterMainWindow (instancia, self)
|
||||
end)
|
||||
|
||||
BG:SetScript("OnLeave", function (self)
|
||||
OnLeaveMainWindow (instancia, self)
|
||||
end)
|
||||
|
||||
BG:SetScript ("OnMouseDown", function (frame, button)
|
||||
if (baseframe.isMoving) then
|
||||
move_janela (baseframe, false, instancia)
|
||||
instancia:SaveMainWindowPosition()
|
||||
return
|
||||
end
|
||||
|
||||
if (not baseframe.isLocked and button == "LeftButton") then
|
||||
move_janela (baseframe, true, instancia) --> novo movedor da janela
|
||||
if (BG.is_toolbar) then
|
||||
if (instancia.attribute_text.enabled and instancia.attribute_text.side == 1 and instancia.toolbar_side == 1) then
|
||||
instancia.menu_attribute_string:SetPoint ("bottomleft", instancia.baseframe.cabecalho.ball, "bottomright", instancia.attribute_text.anchor [1]+1, instancia.attribute_text.anchor [2]-1)
|
||||
end
|
||||
end
|
||||
elseif (button == "RightButton") then
|
||||
if (_detalhes.switch.current_instancia and _detalhes.switch.current_instancia == instancia) then
|
||||
_detalhes.switch:CloseMe()
|
||||
else
|
||||
_detalhes.switch:ShowMe (instancia)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
BG:SetScript ("OnMouseUp", function (frame)
|
||||
if (baseframe.isMoving) then
|
||||
move_janela (baseframe, false, instancia) --> novo movedor da janela
|
||||
instancia:SaveMainWindowPosition()
|
||||
if (BG.is_toolbar) then
|
||||
if (instancia.attribute_text.enabled and instancia.attribute_text.side == 1 and instancia.toolbar_side == 1) then
|
||||
instancia.menu_attribute_string:SetPoint ("bottomleft", instancia.baseframe.cabecalho.ball, "bottomright", instancia.attribute_text.anchor [1], instancia.attribute_text.anchor [2])
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
local BGFrame_scripts_onenter = function (self)
|
||||
OnEnterMainWindow (self._instance, self)
|
||||
end
|
||||
|
||||
local BGFrame_scripts_onleave = function (self)
|
||||
OnLeaveMainWindow (self._instance, self)
|
||||
end
|
||||
|
||||
local BGFrame_scripts_onmousedown = function (self, button)
|
||||
if (self._instance.baseframe.isMoving) then
|
||||
move_janela (self._instance.baseframe, false, self._instance)
|
||||
self._instance:SaveMainWindowPosition()
|
||||
return
|
||||
end
|
||||
|
||||
if (not self._instance.baseframe.isLocked and button == "LeftButton") then
|
||||
move_janela (self._instance.baseframe, true, self._instance)
|
||||
if (self.is_toolbar) then
|
||||
if (self._instance.attribute_text.enabled and self._instance.attribute_text.side == 1 and self._instance.toolbar_side == 1) then
|
||||
self._instance.menu_attribute_string:SetPoint ("bottomleft", self._instance.baseframe.cabecalho.ball, "bottomright", self._instance.attribute_text.anchor [1]+1, self._instance.attribute_text.anchor [2]-1)
|
||||
end
|
||||
end
|
||||
elseif (button == "RightButton") then
|
||||
if (_detalhes.switch.current_instancia and _detalhes.switch.current_instancia == self._instance) then
|
||||
_detalhes.switch:CloseMe()
|
||||
else
|
||||
_detalhes.switch:ShowMe (self._instance)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local BGFrame_scripts_onmouseup = function (self, button)
|
||||
if (self._instance.baseframe.isMoving) then
|
||||
move_janela (self._instance.baseframe, false, self._instance) --> novo movedor da janela
|
||||
self._instance:SaveMainWindowPosition()
|
||||
if (self.is_toolbar) then
|
||||
if (self._instance.attribute_text.enabled and self._instance.attribute_text.side == 1 and self._instance.toolbar_side == 1) then
|
||||
self._instance.menu_attribute_string:SetPoint ("bottomleft", self._instance.baseframe.cabecalho.ball, "bottomright", self._instance.attribute_text.anchor [1], self._instance.attribute_text.anchor [2])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function BGFrame_scripts (BG, baseframe, instancia)
|
||||
BG._instance = instancia
|
||||
BG:SetScript ("OnEnter", BGFrame_scripts_onenter)
|
||||
BG:SetScript ("OnLeave", BGFrame_scripts_onleave)
|
||||
BG:SetScript ("OnMouseDown", BGFrame_scripts_onmousedown)
|
||||
BG:SetScript ("OnMouseUp", BGFrame_scripts_onmouseup)
|
||||
end
|
||||
|
||||
function gump:RegisterForDetailsMove (frame, instancia)
|
||||
|
||||
@@ -725,36 +729,41 @@ function gump:RegisterForDetailsMove (frame, instancia)
|
||||
end
|
||||
|
||||
--> scripts do base frame
|
||||
local BFrame_scripts_onsizechange = function (self)
|
||||
self._instance:SaveMainWindowPosition()
|
||||
self._instance:ReajustaGump()
|
||||
self._instance.oldwith = self:GetWidth()
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, self._instance)
|
||||
end
|
||||
|
||||
local BFrame_scripts_onenter = function (self)
|
||||
OnEnterMainWindow (self._instance, self)
|
||||
end
|
||||
|
||||
local BFrame_scripts_onleave = function (self)
|
||||
OnLeaveMainWindow (self._instance, self)
|
||||
end
|
||||
|
||||
local BFrame_scripts_onmousedown = function (self, button)
|
||||
if (not self.isLocked and button == "LeftButton") then
|
||||
move_janela (self, true, self._instance)
|
||||
end
|
||||
end
|
||||
|
||||
local BFrame_scripts_onmouseup = function (self, button)
|
||||
if (self.isMoving) then
|
||||
move_janela (self, false, self._instance) --> novo movedor da janela
|
||||
self._instance:SaveMainWindowPosition()
|
||||
end
|
||||
end
|
||||
|
||||
local function BFrame_scripts (baseframe, instancia)
|
||||
|
||||
baseframe:SetScript("OnSizeChanged", function (self)
|
||||
instancia:SaveMainWindowPosition()
|
||||
instancia:ReajustaGump()
|
||||
instancia.oldwith = baseframe:GetWidth()
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, instancia)
|
||||
end)
|
||||
|
||||
baseframe:SetScript("OnEnter", function (self)
|
||||
OnEnterMainWindow (instancia, self)
|
||||
end)
|
||||
|
||||
baseframe:SetScript("OnLeave", function (self)
|
||||
OnLeaveMainWindow (instancia, self)
|
||||
end)
|
||||
|
||||
baseframe:SetScript ("OnMouseDown", function (frame, button)
|
||||
if (not baseframe.isLocked and button == "LeftButton") then
|
||||
move_janela (baseframe, true, instancia) --> novo movedor da janela
|
||||
end
|
||||
end)
|
||||
|
||||
baseframe:SetScript ("OnMouseUp", function (frame)
|
||||
if (baseframe.isMoving) then
|
||||
move_janela (baseframe, false, instancia) --> novo movedor da janela
|
||||
instancia:SaveMainWindowPosition()
|
||||
end
|
||||
end)
|
||||
|
||||
baseframe._instance = instancia
|
||||
baseframe:SetScript("OnSizeChanged", BFrame_scripts_onsizechange)
|
||||
baseframe:SetScript("OnEnter", BFrame_scripts_onenter)
|
||||
baseframe:SetScript("OnLeave", BFrame_scripts_onleave)
|
||||
baseframe:SetScript ("OnMouseDown", BFrame_scripts_onmousedown)
|
||||
baseframe:SetScript ("OnMouseUp", BFrame_scripts_onmouseup)
|
||||
end
|
||||
|
||||
local function backgrounddisplay_scripts (backgrounddisplay, baseframe, instancia)
|
||||
@@ -1036,200 +1045,206 @@ local resizeTooltip = {
|
||||
}
|
||||
|
||||
--> search key: ~resizescript
|
||||
|
||||
local resize_scripts_onmousedown = function (self, button)
|
||||
_G.GameCooltip:ShowMe (false) --> Hide Cooltip
|
||||
|
||||
if (not self:GetParent().isLocked and button == "LeftButton" and self._instance.modo ~= _detalhes._detalhes_props["MODO_ALONE"]) then
|
||||
self:GetParent().isResizing = true
|
||||
self._instance:BaseFrameSnap()
|
||||
|
||||
local isVertical = self._instance.verticalSnap
|
||||
local isHorizontal = self._instance.horizontalSnap
|
||||
|
||||
local agrupadas
|
||||
if (self._instance.verticalSnap) then
|
||||
agrupadas = self._instance:InstanciasVerticais()
|
||||
elseif (self._instance.horizontalSnap) then
|
||||
agrupadas = self._instance:InstanciasHorizontais()
|
||||
end
|
||||
|
||||
self._instance.stretchToo = agrupadas
|
||||
if (self._instance.stretchToo and #self._instance.stretchToo > 0) then
|
||||
for _, esta_instancia in ipairs (self._instance.stretchToo) do
|
||||
esta_instancia.baseframe._place = esta_instancia:SaveMainWindowPosition()
|
||||
esta_instancia.baseframe.isResizing = true
|
||||
end
|
||||
end
|
||||
|
||||
----------------
|
||||
|
||||
if (self._myside == "<") then
|
||||
if (_IsShiftKeyDown()) then
|
||||
self._instance.baseframe:StartSizing("left")
|
||||
self._instance.eh_horizontal = true
|
||||
elseif (_IsAltKeyDown()) then
|
||||
self._instance.baseframe:StartSizing("top")
|
||||
self._instance.eh_vertical = true
|
||||
elseif (_IsControlKeyDown()) then
|
||||
self._instance.baseframe:StartSizing("bottomleft")
|
||||
self._instance.eh_tudo = true
|
||||
else
|
||||
self._instance.baseframe:StartSizing("bottomleft")
|
||||
end
|
||||
|
||||
self:SetPoint ("bottomleft", self._instance.baseframe, "bottomleft", -1, -1)
|
||||
self.afundado = true
|
||||
|
||||
elseif (self._myside == ">") then
|
||||
if (_IsShiftKeyDown()) then
|
||||
self._instance.baseframe:StartSizing ("right")
|
||||
self._instance.eh_horizontal = true
|
||||
elseif (_IsAltKeyDown()) then
|
||||
self._instance.baseframe:StartSizing ("top")
|
||||
self._instance.eh_vertical = true
|
||||
elseif (_IsControlKeyDown()) then
|
||||
self._instance.baseframe:StartSizing ("bottomright")
|
||||
self._instance.eh_tudo = true
|
||||
else
|
||||
self._instance.baseframe:StartSizing ("bottomright")
|
||||
end
|
||||
|
||||
if (self._instance.rolagem and _detalhes.use_scroll) then
|
||||
self:SetPoint ("bottomright", self._instance.baseframe, "bottomright", (self._instance.largura_scroll*-1) + 1, -1)
|
||||
else
|
||||
self:SetPoint ("bottomright", self._instance.baseframe, "bottomright", 1, -1)
|
||||
end
|
||||
self.afundado = true
|
||||
end
|
||||
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_STARTRESIZE", nil, self._instance)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
local resize_scripts_onmouseup = function (self, button)
|
||||
|
||||
if (self.afundado) then
|
||||
self.afundado = false
|
||||
if (self._myside == ">") then
|
||||
if (self._instance.rolagem and _detalhes.use_scroll) then
|
||||
self:SetPoint ("bottomright", self._instance.baseframe, "bottomright", self._instance.largura_scroll*-1, 0)
|
||||
else
|
||||
self:SetPoint ("bottomright", self._instance.baseframe, "bottomright", 0, 0)
|
||||
end
|
||||
else
|
||||
self:SetPoint ("bottomleft", self._instance.baseframe, "bottomleft", 0, 0)
|
||||
end
|
||||
end
|
||||
|
||||
if (self:GetParent().isResizing) then
|
||||
|
||||
self:GetParent():StopMovingOrSizing()
|
||||
self:GetParent().isResizing = false
|
||||
|
||||
if (self._instance.stretchToo and #self._instance.stretchToo > 0) then
|
||||
for _, esta_instancia in ipairs (self._instance.stretchToo) do
|
||||
esta_instancia.baseframe:StopMovingOrSizing()
|
||||
esta_instancia.baseframe.isResizing = false
|
||||
esta_instancia:ReajustaGump()
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, esta_instancia)
|
||||
end
|
||||
self._instance.stretchToo = nil
|
||||
end
|
||||
|
||||
local largura = self._instance.baseframe:GetWidth()
|
||||
local altura = self._instance.baseframe:GetHeight()
|
||||
|
||||
if (self._instance.eh_horizontal) then
|
||||
instancias_horizontais (self._instance, largura, true, true)
|
||||
self._instance.eh_horizontal = nil
|
||||
end
|
||||
|
||||
--if (instancia.eh_vertical) then
|
||||
instancias_verticais (self._instance, altura, true, true)
|
||||
self._instance.eh_vertical = nil
|
||||
--end
|
||||
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_ENDRESIZE", nil, self._instance)
|
||||
|
||||
if (self._instance.eh_tudo) then
|
||||
for _, esta_instancia in _ipairs (_detalhes.tabela_instancias) do
|
||||
if (esta_instancia:IsAtiva() and esta_instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"]) then
|
||||
esta_instancia.baseframe:ClearAllPoints()
|
||||
esta_instancia:SaveMainWindowPosition()
|
||||
esta_instancia:RestoreMainWindowPosition()
|
||||
end
|
||||
end
|
||||
|
||||
for _, esta_instancia in _ipairs (_detalhes.tabela_instancias) do
|
||||
if (esta_instancia:IsAtiva() and esta_instancia ~= self._instance and esta_instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"]) then
|
||||
esta_instancia.baseframe:SetWidth (largura)
|
||||
esta_instancia.baseframe:SetHeight (altura)
|
||||
esta_instancia.auto_resize = true
|
||||
esta_instancia:ReajustaGump()
|
||||
esta_instancia.auto_resize = false
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, esta_instancia)
|
||||
end
|
||||
end
|
||||
|
||||
self._instance.eh_tudo = nil
|
||||
end
|
||||
|
||||
self._instance:BaseFrameSnap()
|
||||
|
||||
for _, esta_instancia in _ipairs (_detalhes.tabela_instancias) do
|
||||
if (esta_instancia:IsAtiva()) then
|
||||
esta_instancia:SaveMainWindowPosition()
|
||||
esta_instancia:RestoreMainWindowPosition()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local resize_scripts_onhide = function (self)
|
||||
if (self.going_hide) then
|
||||
_G.GameCooltip:ShowMe (false)
|
||||
self.going_hide = nil
|
||||
end
|
||||
end
|
||||
|
||||
local resize_scripts_onenter = function (self)
|
||||
if (self._instance.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and not self._instance.baseframe.isLocked and not self.mostrando) then
|
||||
|
||||
OnEnterMainWindow (self._instance, self)
|
||||
|
||||
self.texture:SetBlendMode ("ADD")
|
||||
self.mostrando = true
|
||||
|
||||
GameCooltip:Reset()
|
||||
GameCooltip:SetType ("tooltip")
|
||||
GameCooltip:AddFromTable (resizeTooltip)
|
||||
GameCooltip:SetOption ("TextSize", _detalhes.font_sizes.menus)
|
||||
GameCooltip:SetOption ("NoLastSelectedBar", true)
|
||||
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
|
||||
GameCooltip:SetOwner (self)
|
||||
GameCooltip:ShowCooltip()
|
||||
end
|
||||
end
|
||||
|
||||
local resize_scripts_onleave = function (self)
|
||||
if (self.mostrando) then
|
||||
self.going_hide = true
|
||||
if (not self.movendo) then
|
||||
OnLeaveMainWindow (self._instance, self)
|
||||
end
|
||||
|
||||
self.texture:SetBlendMode ("BLEND")
|
||||
self.mostrando = false
|
||||
|
||||
GameCooltip:ShowMe (false)
|
||||
end
|
||||
end
|
||||
|
||||
local function resize_scripts (resizer, instancia, scrollbar, side, baseframe)
|
||||
resizer._instance = instancia
|
||||
resizer._myside = side
|
||||
|
||||
resizer:SetScript ("OnMouseDown", function (self, button)
|
||||
|
||||
_G.GameCooltip:ShowMe (false) --> Hide Cooltip
|
||||
|
||||
if (not self:GetParent().isLocked and button == "LeftButton" and instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"]) then
|
||||
self:GetParent().isResizing = true
|
||||
instancia:BaseFrameSnap()
|
||||
|
||||
local isVertical = instancia.verticalSnap
|
||||
local isHorizontal = instancia.horizontalSnap
|
||||
|
||||
local agrupadas
|
||||
if (instancia.verticalSnap) then
|
||||
agrupadas = instancia:InstanciasVerticais()
|
||||
elseif (instancia.horizontalSnap) then
|
||||
agrupadas = instancia:InstanciasHorizontais()
|
||||
end
|
||||
|
||||
instancia.stretchToo = agrupadas
|
||||
if (instancia.stretchToo and #instancia.stretchToo > 0) then
|
||||
for _, esta_instancia in ipairs (instancia.stretchToo) do
|
||||
esta_instancia.baseframe._place = esta_instancia:SaveMainWindowPosition()
|
||||
esta_instancia.baseframe.isResizing = true
|
||||
end
|
||||
end
|
||||
|
||||
----------------
|
||||
|
||||
if (side == "<") then
|
||||
if (_IsShiftKeyDown()) then
|
||||
instancia.baseframe:StartSizing("left")
|
||||
instancia.eh_horizontal = true
|
||||
elseif (_IsAltKeyDown()) then
|
||||
instancia.baseframe:StartSizing("top")
|
||||
instancia.eh_vertical = true
|
||||
elseif (_IsControlKeyDown()) then
|
||||
instancia.baseframe:StartSizing("bottomleft")
|
||||
instancia.eh_tudo = true
|
||||
else
|
||||
instancia.baseframe:StartSizing("bottomleft")
|
||||
end
|
||||
|
||||
resizer:SetPoint ("bottomleft", baseframe, "bottomleft", -1, -1)
|
||||
resizer.afundado = true
|
||||
|
||||
elseif (side == ">") then
|
||||
if (_IsShiftKeyDown()) then
|
||||
instancia.baseframe:StartSizing("right")
|
||||
instancia.eh_horizontal = true
|
||||
elseif (_IsAltKeyDown()) then
|
||||
instancia.baseframe:StartSizing("top")
|
||||
instancia.eh_vertical = true
|
||||
elseif (_IsControlKeyDown()) then
|
||||
instancia.baseframe:StartSizing("bottomright")
|
||||
instancia.eh_tudo = true
|
||||
else
|
||||
instancia.baseframe:StartSizing("bottomright")
|
||||
end
|
||||
|
||||
if (instancia.rolagem and _detalhes.use_scroll) then
|
||||
resizer:SetPoint ("bottomright", baseframe, "bottomright", (instancia.largura_scroll*-1) + 1, -1)
|
||||
else
|
||||
resizer:SetPoint ("bottomright", baseframe, "bottomright", 1, -1)
|
||||
end
|
||||
resizer.afundado = true
|
||||
end
|
||||
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_STARTRESIZE", nil, instancia)
|
||||
|
||||
end
|
||||
end)
|
||||
|
||||
resizer:SetScript ("OnMouseUp", function (self,button)
|
||||
|
||||
if (resizer.afundado) then
|
||||
resizer.afundado = false
|
||||
if (resizer.side == 2) then
|
||||
if (instancia.rolagem and _detalhes.use_scroll) then
|
||||
resizer:SetPoint ("bottomright", baseframe, "bottomright", instancia.largura_scroll*-1, 0)
|
||||
else
|
||||
resizer:SetPoint ("bottomright", baseframe, "bottomright", 0, 0)
|
||||
end
|
||||
else
|
||||
resizer:SetPoint ("bottomleft", baseframe, "bottomleft", 0, 0)
|
||||
end
|
||||
end
|
||||
|
||||
if (self:GetParent().isResizing) then
|
||||
|
||||
self:GetParent():StopMovingOrSizing()
|
||||
self:GetParent().isResizing = false
|
||||
|
||||
if (instancia.stretchToo and #instancia.stretchToo > 0) then
|
||||
for _, esta_instancia in ipairs (instancia.stretchToo) do
|
||||
esta_instancia.baseframe:StopMovingOrSizing()
|
||||
esta_instancia.baseframe.isResizing = false
|
||||
esta_instancia:ReajustaGump()
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, esta_instancia)
|
||||
end
|
||||
instancia.stretchToo = nil
|
||||
end
|
||||
|
||||
local largura = instancia.baseframe:GetWidth()
|
||||
local altura = instancia.baseframe:GetHeight()
|
||||
|
||||
if (instancia.eh_horizontal) then
|
||||
instancias_horizontais (instancia, largura, true, true)
|
||||
instancia.eh_horizontal = nil
|
||||
end
|
||||
|
||||
--if (instancia.eh_vertical) then
|
||||
instancias_verticais (instancia, altura, true, true)
|
||||
instancia.eh_vertical = nil
|
||||
--end
|
||||
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_ENDRESIZE", nil, instancia)
|
||||
|
||||
if (instancia.eh_tudo) then
|
||||
for _, esta_instancia in _ipairs (_detalhes.tabela_instancias) do
|
||||
if (esta_instancia:IsAtiva() and esta_instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"]) then
|
||||
esta_instancia.baseframe:ClearAllPoints()
|
||||
esta_instancia:SaveMainWindowPosition()
|
||||
esta_instancia:RestoreMainWindowPosition()
|
||||
end
|
||||
end
|
||||
|
||||
for _, esta_instancia in _ipairs (_detalhes.tabela_instancias) do
|
||||
if (esta_instancia:IsAtiva() and esta_instancia ~= instancia and esta_instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"]) then
|
||||
esta_instancia.baseframe:SetWidth (largura)
|
||||
esta_instancia.baseframe:SetHeight (altura)
|
||||
esta_instancia.auto_resize = true
|
||||
esta_instancia:ReajustaGump()
|
||||
esta_instancia.auto_resize = false
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, esta_instancia)
|
||||
end
|
||||
end
|
||||
|
||||
instancia.eh_tudo = nil
|
||||
end
|
||||
|
||||
instancia:BaseFrameSnap()
|
||||
|
||||
for _, esta_instancia in _ipairs (_detalhes.tabela_instancias) do
|
||||
if (esta_instancia:IsAtiva()) then
|
||||
esta_instancia:SaveMainWindowPosition()
|
||||
esta_instancia:RestoreMainWindowPosition()
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
resizer:SetScript ("OnHide", function (self)
|
||||
if (self.going_hide) then
|
||||
_G.GameCooltip:ShowMe (false)
|
||||
self.going_hide = nil
|
||||
end
|
||||
end)
|
||||
|
||||
resizer:SetScript ("OnEnter", function (self)
|
||||
if (instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and not instancia.baseframe.isLocked and not self.mostrando) then
|
||||
|
||||
OnEnterMainWindow (instancia, self)
|
||||
|
||||
self.texture:SetBlendMode ("ADD")
|
||||
self.mostrando = true
|
||||
|
||||
GameCooltip:Reset()
|
||||
GameCooltip:SetType ("tooltip")
|
||||
GameCooltip:AddFromTable (resizeTooltip)
|
||||
GameCooltip:SetOption ("TextSize", _detalhes.font_sizes.menus)
|
||||
GameCooltip:SetOption ("NoLastSelectedBar", true)
|
||||
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
|
||||
GameCooltip:SetOwner (resizer)
|
||||
GameCooltip:ShowCooltip()
|
||||
end
|
||||
end)
|
||||
|
||||
resizer:SetScript ("OnLeave", function (self)
|
||||
|
||||
if (self.mostrando) then
|
||||
|
||||
resizer.going_hide = true
|
||||
if (not self.movendo) then
|
||||
OnLeaveMainWindow (instancia, self)
|
||||
end
|
||||
|
||||
self.texture:SetBlendMode ("BLEND")
|
||||
self.mostrando = false
|
||||
|
||||
GameCooltip:ShowMe (false)
|
||||
end
|
||||
end)
|
||||
resizer:SetScript ("OnMouseDown", resize_scripts_onmousedown)
|
||||
resizer:SetScript ("OnMouseUp", resize_scripts_onmouseup)
|
||||
resizer:SetScript ("OnHide", resize_scripts_onhide)
|
||||
resizer:SetScript ("OnEnter", resize_scripts_onenter)
|
||||
resizer:SetScript ("OnLeave", resize_scripts_onleave)
|
||||
end
|
||||
|
||||
local lockButtonTooltip = {
|
||||
@@ -1392,161 +1407,159 @@ local on_switch_show = function (instance)
|
||||
return true
|
||||
end
|
||||
|
||||
local function barra_scripts (esta_barra, instancia, i)
|
||||
local barra_backdrop_onenter = {
|
||||
bgFile = [[Interface\Tooltips\UI-Tooltip-Background]],
|
||||
tile = true, tileSize = 16,
|
||||
insets = {left = 1, right = 1, top = 0, bottom = 1}
|
||||
}
|
||||
local barra_backdrop_onleave = {
|
||||
bgFile = "",
|
||||
edgeFile = "", tile = true, tileSize = 16, edgeSize = 32,
|
||||
insets = {left = 1, right = 1, top = 0, bottom = 1}
|
||||
}
|
||||
|
||||
esta_barra:SetScript ("OnEnter", function (self)
|
||||
self.mouse_over = true
|
||||
OnEnterMainWindow (instancia, esta_barra)
|
||||
local barra_scripts_onenter = function (self)
|
||||
self.mouse_over = true
|
||||
OnEnterMainWindow (self._instance, self)
|
||||
|
||||
instancia:MontaTooltip (self, i)
|
||||
|
||||
self:SetBackdrop({
|
||||
bgFile = [[Interface\Tooltips\UI-Tooltip-Background]],
|
||||
tile = true, tileSize = 16,
|
||||
insets = {left = 1, right = 1, top = 0, bottom = 1},})
|
||||
self:SetBackdropColor (0.588, 0.588, 0.588, 0.7)
|
||||
|
||||
self:SetScript ("OnUpdate", shift_monitor)
|
||||
|
||||
end)
|
||||
|
||||
esta_barra:SetScript ("OnLeave", function (self)
|
||||
self.mouse_over = false
|
||||
OnLeaveMainWindow (instancia, self)
|
||||
|
||||
_GameTooltip:Hide()
|
||||
_G.GameCooltip:ShowMe (false)
|
||||
|
||||
self:SetBackdrop({
|
||||
bgFile = "", edgeFile = "", tile = true, tileSize = 16, edgeSize = 32,
|
||||
insets = {left = 1, right = 1, top = 0, bottom = 1},})
|
||||
|
||||
self:SetBackdropBorderColor (0, 0, 0, 0)
|
||||
self:SetBackdropColor (0, 0, 0, 0)
|
||||
|
||||
self.showing_allspells = false
|
||||
self:SetScript ("OnUpdate", nil)
|
||||
|
||||
end)
|
||||
|
||||
esta_barra:SetScript ("OnMouseDown", function (self, button)
|
||||
|
||||
if (esta_barra.fading_in) then
|
||||
return
|
||||
end
|
||||
|
||||
if (button == "RightButton") then
|
||||
return _detalhes.switch:ShowMe (instancia)
|
||||
|
||||
elseif (button == "MiddleButton") then
|
||||
--> verifica se é damage taken
|
||||
|
||||
elseif (button == "LeftButton") then
|
||||
self._instance:MontaTooltip (self, self.row_id)
|
||||
|
||||
if (instancia.atributo == 1 and instancia.sub_atributo == 6) then --> enemies
|
||||
|
||||
local inimigo = esta_barra.minha_tabela.nome
|
||||
local custom_name = inimigo .. Loc ["STRING_CUSTOM_ENEMY_DT"]
|
||||
|
||||
--> procura se já tem um custom:
|
||||
for index, CustomObject in _ipairs (_detalhes.custom) do
|
||||
if (CustomObject:GetName() == custom_name) then
|
||||
--> fix for not saving funcs on logout
|
||||
if (not CustomObject.OnSwitchShow) then
|
||||
CustomObject.OnSwitchShow = on_switch_show
|
||||
end
|
||||
return instancia:TrocaTabela (instancia.segmento, 5, index)
|
||||
self:SetBackdrop (barra_backdrop_onenter)
|
||||
self:SetBackdropColor (0.588, 0.588, 0.588, 0.7)
|
||||
|
||||
self:SetScript ("OnUpdate", shift_monitor)
|
||||
end
|
||||
|
||||
local barra_scripts_onleave = function (self)
|
||||
self.mouse_over = false
|
||||
OnLeaveMainWindow (self._instance, self)
|
||||
|
||||
_GameTooltip:Hide()
|
||||
GameCooltip:ShowMe (false)
|
||||
|
||||
self:SetBackdrop (barra_backdrop_onleave)
|
||||
self:SetBackdropBorderColor (0, 0, 0, 0)
|
||||
self:SetBackdropColor (0, 0, 0, 0)
|
||||
|
||||
self.showing_allspells = false
|
||||
self:SetScript ("OnUpdate", nil)
|
||||
end
|
||||
|
||||
local barra_scripts_onmousedown = function (self, button)
|
||||
if (self.fading_in) then
|
||||
return
|
||||
end
|
||||
|
||||
if (button == "RightButton") then
|
||||
return _detalhes.switch:ShowMe (self._instance)
|
||||
|
||||
--elseif (button == "MiddleButton") then
|
||||
|
||||
elseif (button == "LeftButton") then
|
||||
|
||||
if (self._instance.atributo == 1 and self._instance.sub_atributo == 6) then --> enemies
|
||||
|
||||
local inimigo = self.minha_tabela.nome
|
||||
local custom_name = inimigo .. Loc ["STRING_CUSTOM_ENEMY_DT"]
|
||||
|
||||
--> procura se já tem um custom:
|
||||
for index, CustomObject in _ipairs (_detalhes.custom) do
|
||||
if (CustomObject:GetName() == custom_name) then
|
||||
--> fix for not saving funcs on logout
|
||||
if (not CustomObject.OnSwitchShow) then
|
||||
CustomObject.OnSwitchShow = on_switch_show
|
||||
end
|
||||
return self._instance:TrocaTabela (self._instance.segmento, 5, index)
|
||||
end
|
||||
|
||||
--> criar um custom para este actor.
|
||||
local new_custom_object = {
|
||||
name = custom_name,
|
||||
icon = [[Interface\ICONS\Pet_Type_Undead]],
|
||||
attribute = "damagedone",
|
||||
author = _detalhes.playername,
|
||||
desc = inimigo .. " Damage Taken",
|
||||
source = "[raid]",
|
||||
target = inimigo,
|
||||
script = false,
|
||||
tooltip = false,
|
||||
temp = true,
|
||||
OnSwitchShow = on_switch_show,
|
||||
}
|
||||
|
||||
tinsert (_detalhes.custom, new_custom_object)
|
||||
setmetatable (new_custom_object, _detalhes.atributo_custom)
|
||||
new_custom_object.__index = _detalhes.atributo_custom
|
||||
|
||||
return instancia:TrocaTabela (instancia.segmento, 5, #_detalhes.custom)
|
||||
--func, true, 5, index
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
esta_barra.texto_direita:SetPoint ("right", esta_barra.statusbar, "right", 1, -1)
|
||||
if (instancia.row_info.no_icon) then
|
||||
esta_barra.texto_esquerdo:SetPoint ("left", esta_barra.statusbar, "left", 3, -1)
|
||||
else
|
||||
esta_barra.texto_esquerdo:SetPoint ("left", esta_barra.icone_classe, "right", 4, -1)
|
||||
end
|
||||
|
||||
self.mouse_down = _GetTime()
|
||||
self.button = button
|
||||
local x, y = _GetCursorPosition()
|
||||
self.x = _math_floor (x)
|
||||
self.y = _math_floor (y)
|
||||
|
||||
local parent = instancia.baseframe
|
||||
if ((not parent.isLocked) or (parent.isLocked == 0)) then
|
||||
GameCooltip:Hide() --> fecha o tooltip
|
||||
move_janela (parent, true, instancia) --> novo movedor da janela
|
||||
end
|
||||
|
||||
end)
|
||||
|
||||
esta_barra:SetScript ("OnMouseUp", function (self, button)
|
||||
|
||||
local parent = instancia.baseframe
|
||||
if (parent.isMoving) then
|
||||
|
||||
move_janela (parent, false, instancia) --> novo movedor da janela
|
||||
instancia:SaveMainWindowPosition()
|
||||
_GameTooltip:SetOwner (self, "ANCHOR_TOPRIGHT")
|
||||
if (instancia:MontaTooltip (self, i)) then
|
||||
GameCooltip:Show (esta_barra, 1)
|
||||
end
|
||||
|
||||
--> criar um custom para este actor.
|
||||
local new_custom_object = {
|
||||
name = custom_name,
|
||||
icon = [[Interface\ICONS\Pet_Type_Undead]],
|
||||
attribute = "damagedone",
|
||||
author = _detalhes.playername,
|
||||
desc = inimigo .. " Damage Taken",
|
||||
source = "[raid]",
|
||||
target = inimigo,
|
||||
script = false,
|
||||
tooltip = false,
|
||||
temp = true,
|
||||
OnSwitchShow = on_switch_show,
|
||||
}
|
||||
|
||||
tinsert (_detalhes.custom, new_custom_object)
|
||||
setmetatable (new_custom_object, _detalhes.atributo_custom)
|
||||
new_custom_object.__index = _detalhes.atributo_custom
|
||||
|
||||
return self._instance:TrocaTabela (self._instance.segmento, 5, #_detalhes.custom)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
self.texto_direita:SetPoint ("right", self.statusbar, "right", 1, -1)
|
||||
if (self._instance.row_info.no_icon) then
|
||||
self.texto_esquerdo:SetPoint ("left", self.statusbar, "left", 3, -1)
|
||||
else
|
||||
self.texto_esquerdo:SetPoint ("left", self.icone_classe, "right", 4, -1)
|
||||
end
|
||||
|
||||
self.mouse_down = _GetTime()
|
||||
self.button = button
|
||||
local x, y = _GetCursorPosition()
|
||||
self.x = _math_floor (x)
|
||||
self.y = _math_floor (y)
|
||||
|
||||
if (not self._instance.baseframe.isLocked) then
|
||||
GameCooltip:Hide()
|
||||
move_janela (self._instance.baseframe, true, self._instance)
|
||||
end
|
||||
end
|
||||
|
||||
local barra_scripts_onmouseup = function (self, button)
|
||||
if (self._instance.baseframe.isMoving) then
|
||||
move_janela (self._instance.baseframe, false, self._instance)
|
||||
self._instance:SaveMainWindowPosition()
|
||||
|
||||
if (self._instance:MontaTooltip (self, self.row_id)) then
|
||||
GameCooltip:Show (self, 1)
|
||||
end
|
||||
end
|
||||
|
||||
esta_barra.texto_direita:SetPoint ("right", esta_barra.statusbar, "right")
|
||||
if (instancia.row_info.no_icon) then
|
||||
esta_barra.texto_esquerdo:SetPoint ("left", esta_barra.statusbar, "left", 2, 0)
|
||||
else
|
||||
esta_barra.texto_esquerdo:SetPoint ("left", esta_barra.icone_classe, "right", 3, 0)
|
||||
end
|
||||
|
||||
local x, y = _GetCursorPosition()
|
||||
x = _math_floor (x)
|
||||
y = _math_floor (y)
|
||||
self.texto_direita:SetPoint ("right", self.statusbar, "right")
|
||||
if (self._instance.row_info.no_icon) then
|
||||
self.texto_esquerdo:SetPoint ("left", self.statusbar, "left", 2, 0)
|
||||
else
|
||||
self.texto_esquerdo:SetPoint ("left", self.icone_classe, "right", 3, 0)
|
||||
end
|
||||
|
||||
local x, y = _GetCursorPosition()
|
||||
x = _math_floor (x)
|
||||
y = _math_floor (y)
|
||||
|
||||
if (self.mouse_down and (self.mouse_down+0.4 > _GetTime() and (x == self.x and y == self.y)) or (x == self.x and y == self.y)) then
|
||||
--> a única maneira de abrir a janela de info é por aqui...
|
||||
|
||||
if (self.button == "LeftButton" or self.button == "MiddleButton") then
|
||||
if (instancia.atributo == 5 or _IsShiftKeyDown()) then
|
||||
--> report
|
||||
return _detalhes:ReportSingleLine (instancia, self)
|
||||
end
|
||||
instancia:AbreJanelaInfo (self.minha_tabela)
|
||||
if (self.mouse_down and (self.mouse_down+0.4 > _GetTime() and (x == self.x and y == self.y)) or (x == self.x and y == self.y)) then
|
||||
if (self.button == "LeftButton" or self.button == "MiddleButton") then
|
||||
if (self._instance.atributo == 5 or _IsShiftKeyDown()) then
|
||||
--> report
|
||||
return _detalhes:ReportSingleLine (self._instance, self)
|
||||
end
|
||||
|
||||
self._instance:AbreJanelaInfo (self.minha_tabela)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
esta_barra:SetScript ("OnClick", function (self, button)
|
||||
local barra_scripts_onclick = function (self, button)
|
||||
|
||||
end)
|
||||
end
|
||||
|
||||
local function barra_scripts (esta_barra, instancia, i)
|
||||
esta_barra._instance = instancia
|
||||
|
||||
esta_barra:SetScript ("OnEnter", barra_scripts_onenter)
|
||||
esta_barra:SetScript ("OnLeave", barra_scripts_onleave)
|
||||
esta_barra:SetScript ("OnMouseDown", barra_scripts_onmousedown)
|
||||
esta_barra:SetScript ("OnMouseUp", barra_scripts_onmouseup)
|
||||
esta_barra:SetScript ("OnClick", barra_scripts_onclick)
|
||||
end
|
||||
|
||||
function _detalhes:ReportSingleLine (instancia, barra)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
## Interface: 50400
|
||||
## Title: Details Dps Tuning (plugin)
|
||||
## Notes: Plugin for Details
|
||||
## RequiredDeps: Details
|
||||
## OptionalDeps: Ace3
|
||||
|
||||
Details_DpsTuning.lua
|
||||
@@ -38,7 +38,7 @@ local _combat_object
|
||||
local CLASS_ICON_TCOORDS = _G.CLASS_ICON_TCOORDS
|
||||
|
||||
EncounterDetails.name = "Encounter Details"
|
||||
|
||||
EncounterDetails.debugmode = false
|
||||
|
||||
local ability_type_table = {
|
||||
[0x1] = "|cFF00FF00"..Loc ["STRING_HEAL"].."|r",
|
||||
@@ -61,8 +61,6 @@ local ability_type_table = {
|
||||
|
||||
}
|
||||
|
||||
local debugmode = false
|
||||
|
||||
--> main object frame functions
|
||||
local function CreatePluginFrames (data)
|
||||
|
||||
@@ -138,7 +136,7 @@ local function CreatePluginFrames (data)
|
||||
|
||||
--_detalhes:TimeDataRegister ("Raid Damage Done", damage_done_func, {last_damage = 0, max_damage = 0}, "Encounter Details", "v1.0", [[Interface\ICONS\Ability_DualWield]], true)
|
||||
_detalhes:TimeDataRegister ("Raid Damage Done", string_damage_done_func, nil, "Encounter Details", "v1.0", [[Interface\ICONS\Ability_DualWield]], true, true)
|
||||
|
||||
|
||||
if (EncounterDetails.db.show_icon == 4) then
|
||||
EncounterDetails:ShowIcon()
|
||||
elseif (EncounterDetails.db.show_icon == 5) then
|
||||
@@ -194,7 +192,8 @@ local function CreatePluginFrames (data)
|
||||
--drop last combat table
|
||||
EncounterDetails.LastSegmentShown = nil
|
||||
|
||||
--table.wipe (EncounterDetails.boss_emotes_table)
|
||||
--wipe emotes
|
||||
table.wipe (EncounterDetails.boss_emotes_table)
|
||||
|
||||
elseif (event == "GROUP_ONENTER") then
|
||||
if (EncounterDetails.db.show_icon == 2) then
|
||||
@@ -231,7 +230,7 @@ local function CreatePluginFrames (data)
|
||||
function EncounterDetails:WasEncounter()
|
||||
|
||||
--> check if last combat was a boss encounter fight
|
||||
if (not debugmode) then
|
||||
if (not EncounterDetails.debugmode) then
|
||||
|
||||
if (not _combat_object.is_boss) then
|
||||
return
|
||||
@@ -269,6 +268,7 @@ local function CreatePluginFrames (data)
|
||||
end
|
||||
|
||||
--> build all window data
|
||||
EncounterDetails.db.opened = EncounterDetails.db.opened + 1
|
||||
EncounterDetails:OpenAndRefresh()
|
||||
--> show
|
||||
EncounterDetailsFrame:Show()
|
||||
@@ -322,14 +322,12 @@ end
|
||||
|
||||
local function KillInfo (deathTable, row)
|
||||
|
||||
local lastEvents = deathTable [1]
|
||||
local timeOfDeath = deathTable [2]
|
||||
local eventos = deathTable [1]
|
||||
local hora_da_morte = deathTable [2]
|
||||
local hp_max = deathTable [5]
|
||||
|
||||
local lines = {}
|
||||
|
||||
local battleress = false
|
||||
local skillTable = row.extra
|
||||
local lastcooldown = false
|
||||
|
||||
local GameCooltip = GameCooltip
|
||||
|
||||
@@ -337,90 +335,98 @@ end
|
||||
GameCooltip:SetType ("tooltipbar")
|
||||
GameCooltip:SetOwner (row)
|
||||
|
||||
GameCooltip:AddLine ("Click to Report", nil, 1, "orange")
|
||||
GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 12, 16, 0.015625, 0.13671875, 0.4375, 0.59765625)
|
||||
GameCooltip:AddStatusBar (0, 1, 1, 1, 1, 1, false, {value = 100, color = {.3, .3, .3, 1}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar_serenity]]})
|
||||
|
||||
--death parser
|
||||
for index, event in _ipairs (eventos) do
|
||||
|
||||
for index, event in _ipairs (lastEvents) do
|
||||
|
||||
--max hp percent (in case of hp cooldowns)
|
||||
local hp = _math_floor (event[5]/hp_max*100)
|
||||
if (hp > 100) then
|
||||
hp = 100
|
||||
end
|
||||
|
||||
if (event [1]) then --> DAMAGE
|
||||
local nome_magia, _, icone_magia = _GetSpellInfo (event [2])
|
||||
|
||||
if (not event[3] and not battleress) then --> battle ress
|
||||
GameCooltip:AddLine ("+".._cstr ("%.1f", event[4] - timeOfDeath) .."s "..nome_magia.." ("..event[6]..")", "-- -- -- ", 1, "white")
|
||||
GameCooltip:AddIcon ("Interface\\Glues\\CharacterSelect\\Glues-AddOn-Icons", 1, 1, nil, nil, .75, 1, 0, 1)
|
||||
GameCooltip:AddStatusBar (100, 1, "silver", false)
|
||||
battleress = true
|
||||
local evtype = event [1]
|
||||
local spellname, _, spellicon = _GetSpellInfo (event [2])
|
||||
local amount = event [3]
|
||||
local time = event [4]
|
||||
local source = event [6]
|
||||
|
||||
if (type (evtype) == "boolean") then
|
||||
--> is damage or heal
|
||||
if (evtype) then
|
||||
--> damage
|
||||
GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (" .. source .. ")", "-" .. _detalhes:ToK (amount) .. " (" .. hp .. "%)", 1, "white", "white")
|
||||
GameCooltip:AddIcon (spellicon)
|
||||
|
||||
elseif (event[3]) then
|
||||
|
||||
local habilidade_school = skillTable [event [2]] --> pegou a tabela com os hex
|
||||
local _school = ""
|
||||
|
||||
if (habilidade_school) then
|
||||
for _, hex in _ipairs (habilidade_school) do
|
||||
_school = _school .. " " .. ability_type_table [hex]
|
||||
end
|
||||
end
|
||||
|
||||
_school = _detalhes:trim (_school)
|
||||
local texto_esquerdo
|
||||
if (nome_magia) then
|
||||
texto_esquerdo = "".._cstr ("%.1f", event[4] - timeOfDeath) .."s " .. nome_magia .. " (".. event [6] ..")" --" (".. _school ..")"
|
||||
texto_esquerdo = texto_esquerdo:gsub ("(%()%)", "")
|
||||
if (event [9]) then
|
||||
--> friendly fire
|
||||
GameCooltip:AddStatusBar (hp, 1, "darkorange", true)
|
||||
else
|
||||
texto_esquerdo = ""
|
||||
--> from a enemy
|
||||
GameCooltip:AddStatusBar (hp, 1, "red", true)
|
||||
end
|
||||
else
|
||||
--> heal
|
||||
GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (" .. source .. ")", "+" .. _detalhes:ToK (amount) .. " (" .. hp .. "%)", 1, "white", "white")
|
||||
GameCooltip:AddIcon (spellicon)
|
||||
GameCooltip:AddStatusBar (hp, 1, "green", true)
|
||||
|
||||
end
|
||||
|
||||
elseif (type (evtype) == "number") then
|
||||
if (evtype == 1) then
|
||||
--> cooldown
|
||||
GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (" .. source .. ")", "cooldown (" .. hp .. "%)", 1, "white", "white")
|
||||
GameCooltip:AddIcon (spellicon)
|
||||
GameCooltip:AddStatusBar (100, 1, "yellow", true)
|
||||
|
||||
elseif (evtype == 2 and not battleress) then
|
||||
--> battle ress
|
||||
battleress = event
|
||||
|
||||
elseif (evtype == 3) then
|
||||
--> last cooldown used
|
||||
lastcooldown = event
|
||||
|
||||
if (type (event [1]) ~= "boolean" and event [1] == 2) then --> last cooldown
|
||||
if (event[3] == 1) then
|
||||
GameCooltip:AddLine ("".._cstr ("%.1f", event[4] - timeOfDeath) .. "s " .. nome_magia .. " (" .. Loc ["STRING_LAST_COOLDOWN"] .. ")")
|
||||
GameCooltip:AddIcon (icone_magia)
|
||||
GameCooltip:AddStatusBar (100, 1, "gray", true)
|
||||
else
|
||||
GameCooltip:AddLine (Loc ["STRING_NOLAST_COOLDOWN"])
|
||||
GameCooltip:AddStatusBar (100, 1, "gray", true)
|
||||
end
|
||||
else
|
||||
GameCooltip:AddLine (texto_esquerdo, "-".._detalhes:ToK (event[3]).." (".. hp .."%)", 1, "white", "white")
|
||||
GameCooltip:AddIcon (icone_magia)
|
||||
|
||||
if (type (event [1]) ~= "boolean" and event [1] == 1) then --> cooldown
|
||||
GameCooltip:AddStatusBar (100, 1, "yellow", true)
|
||||
else
|
||||
GameCooltip:AddStatusBar (hp, 1, "red", true)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
else
|
||||
local nome_magia, _, icone_magia = _GetSpellInfo (event [2])
|
||||
GameCooltip:AddLine ("".._cstr ("%.1f", event[4] - timeOfDeath) .."s "..nome_magia.." ("..event[6]..")", "+".._detalhes:ToK (event[3]).." (".. hp .."%)", 1, "white", "white")
|
||||
GameCooltip:AddIcon (icone_magia, 1, 1)
|
||||
GameCooltip:AddStatusBar (hp, 1, "green", true)
|
||||
end
|
||||
end
|
||||
|
||||
GameCooltip:AddLine (deathTable [6] .. " " .. "died" , "-- -- -- ", 1, "white")
|
||||
GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\small_icons", 1, 1, nil, nil, .75, 1, 0, 1)
|
||||
GameCooltip:AddStatusBar (0, 1, .5, .5, .5, .5, false, {value = 100, color = {.5, .5, .5, 1}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar4_vidro]]})
|
||||
|
||||
if (battleress) then
|
||||
GameCooltip:AddSpecial ("line", 2, nil, deathTable [6] .. " "..Loc ["STRING_DIED"], "-- -- -- ", 1, "white")
|
||||
GameCooltip:AddSpecial ("icon", 2, nil, "Interface\\AddOns\\Details\\images\\small_icons", 1, 1, nil, nil, .75, 1, 0, 1)
|
||||
GameCooltip:AddSpecial ("statusbar", 2, nil, 100, 1, "darkgray", false)
|
||||
else
|
||||
GameCooltip:AddSpecial ("line", 1, nil, deathTable [6] .. " "..Loc ["STRING_DIED"], "-- -- -- ", 1, "white")
|
||||
GameCooltip:AddSpecial ("icon", 1, nil, "Interface\\AddOns\\Details\\images\\small_icons", 1, 1, nil, nil, .75, 1, 0, 1)
|
||||
GameCooltip:AddSpecial ("statusbar", 1, nil, 100, 1, "darkgray", false)
|
||||
|
||||
local nome_magia, _, icone_magia = _GetSpellInfo (battleress [2])
|
||||
GameCooltip:AddLine ("+" .. _cstr ("%.1f", battleress[4] - hora_da_morte) .. "s " .. nome_magia .. " (" .. battleress[6] .. ")", "", 1, "white")
|
||||
GameCooltip:AddIcon ("Interface\\Glues\\CharacterSelect\\Glues-AddOn-Icons", 1, 1, nil, nil, .75, 1, 0, 1)
|
||||
GameCooltip:AddStatusBar (0, 1, .5, .5, .5, .5, false, {value = 100, color = {.5, .5, .5, 1}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar4_vidro]]})
|
||||
end
|
||||
|
||||
if (lastcooldown) then
|
||||
if (lastcooldown[3] == 1) then
|
||||
local nome_magia, _, icone_magia = _GetSpellInfo (lastcooldown [2])
|
||||
GameCooltip:AddLine (_cstr ("%.1f", lastcooldown[4] - hora_da_morte) .. "s " .. nome_magia .. " (" .. Loc ["STRING_LAST_COOLDOWN"] .. ")")
|
||||
GameCooltip:AddIcon (icone_magia)
|
||||
else
|
||||
GameCooltip:AddLine (Loc ["STRING_NOLAST_COOLDOWN"])
|
||||
GameCooltip:AddIcon ([[Interface\CHARACTERFRAME\UI-Player-PlayTimeUnhealthy]], 1, 1, 18, 18)
|
||||
end
|
||||
GameCooltip:AddStatusBar (0, 1, 1, 1, 1, 1, false, {value = 100, color = {.3, .3, .3, 1}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar_serenity]]})
|
||||
end
|
||||
|
||||
|
||||
GameCooltip:SetOption ("StatusBarHeightMod", -6)
|
||||
GameCooltip:SetOption ("FixedWidth", 400)
|
||||
GameCooltip:SetOption ("FixedWidth", 300)
|
||||
GameCooltip:SetOption ("TextSize", 9)
|
||||
GameCooltip:SetOption ("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity")
|
||||
GameCooltip:ShowCooltip()
|
||||
GameCooltip:SetOption ("LeftBorderSize", -4)
|
||||
GameCooltip:SetOption ("RightBorderSize", 5)
|
||||
GameCooltip:SetOption ("StatusBarTexture", [[Interface\AddOns\Details\images\bar4_reverse]])
|
||||
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0.64453125, 0}, {.8, .8, .8, 0.2}, true)
|
||||
|
||||
GameCooltip:ShowCooltip()
|
||||
end
|
||||
|
||||
--> custom tooltip for dispells details ---------------------------------------------------------------------------------------------------------
|
||||
@@ -614,6 +620,9 @@ end
|
||||
|
||||
--> custom tooltip that handle mouse enter and leave on customized rows ---------------------------------------------------------------------------------------------------------
|
||||
|
||||
local backdrop_bar_onenter = {bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", edgeSize = 8, insets = {left = 1, right = 1, top = 0, bottom = 1}}
|
||||
local backdrop_bar_onleave = {bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}}
|
||||
|
||||
function EncounterDetails:SetRowScripts (barra, index, container)
|
||||
|
||||
barra:SetScript ("OnMouseDown", function (self)
|
||||
@@ -663,9 +672,9 @@ function EncounterDetails:SetRowScripts (barra, index, container)
|
||||
self:SetHeight (17)
|
||||
self:SetAlpha(1)
|
||||
|
||||
self:SetBackdrop({edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", tile = true, tileSize = 16, edgeSize = 10,insets = {left = 1, right = 1, top = 0, bottom = 1},})
|
||||
self:SetBackdropBorderColor (170/255, 170/255, 170/255)
|
||||
self:SetBackdropColor (24/255, 24/255, 24/255)
|
||||
self:SetBackdrop (backdrop_bar_onenter)
|
||||
self:SetBackdropColor (.0, .0, .0, 0.3)
|
||||
self:SetBackdropBorderColor (.0, .0, .0, 0.5)
|
||||
|
||||
GameTooltip:SetOwner (self, "ANCHOR_TOPRIGHT")
|
||||
|
||||
@@ -714,11 +723,10 @@ function EncounterDetails:SetRowScripts (barra, index, container)
|
||||
end
|
||||
|
||||
self:SetHeight (16)
|
||||
self:SetAlpha(0.9)
|
||||
self:SetAlpha (0.9)
|
||||
|
||||
self:SetBackdrop({bgFile = "", edgeFile = "", tile = true, tileSize = 16, edgeSize = 32, insets = {left = 1, right = 1, top = 0, bottom = 1},})
|
||||
self:SetBackdropBorderColor (0, 0, 0, 0)
|
||||
self:SetBackdropColor (0, 0, 0, 0)
|
||||
self:SetBackdrop (backdrop_bar_onleave)
|
||||
self:SetBackdropColor (.0, .0, .0, 0.3)
|
||||
|
||||
GameTooltip:Hide()
|
||||
_detalhes.popup:ShowMe (false, "tooltip")
|
||||
@@ -739,21 +747,23 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
if (segment) then
|
||||
--get combat segment, 1 more recently ...25 oldest
|
||||
_combat_object = EncounterDetails:GetCombat (segment)
|
||||
EncounterDetails._segment = segment
|
||||
else
|
||||
_G [frame:GetName().."SegmentsDropdown"].MyObject:Select (1, true)
|
||||
EncounterDetails._segment = 1
|
||||
end
|
||||
|
||||
local boss_id
|
||||
local map_id
|
||||
local boss_info
|
||||
|
||||
if (debugmode and not _combat_object.is_boss) then
|
||||
if (EncounterDetails.debugmode and not _combat_object.is_boss) then
|
||||
_combat_object.is_boss = {
|
||||
index = 1,
|
||||
name = _detalhes:GetBossName (1098, 1),
|
||||
zone = "Throne of Thunder",
|
||||
mapid = 1098,
|
||||
encounter = "Jin'Rohk the Breaker"
|
||||
name = "Immerseus",
|
||||
zone = "Siege of Orggrimar",
|
||||
mapid = 1136,
|
||||
encounter = "Immerseus"
|
||||
}
|
||||
end
|
||||
|
||||
@@ -785,6 +795,10 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
end
|
||||
end
|
||||
|
||||
if (EncounterDetailsFrame.ShowType == "graph") then
|
||||
EncounterDetails:BuildDpsGraphic()
|
||||
end
|
||||
|
||||
EncounterDetails.LastSegmentShown = _combat_object
|
||||
|
||||
-------------- set boss name and zone name --------------
|
||||
@@ -795,14 +809,18 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
local L, R, T, B, Texture = EncounterDetails:GetBossIcon (_combat_object.is_boss.mapid, _combat_object.is_boss.index)
|
||||
EncounterDetailsFrame.boss_icone:SetTexture (Texture)
|
||||
EncounterDetailsFrame.boss_icone:SetTexCoord (L, R, T, B)
|
||||
EncounterDetailsFrame.raidbackground:SetTexture (EncounterDetails:GetRaidBackground (_combat_object.is_boss.mapid))
|
||||
|
||||
local file, L, R, T, B = EncounterDetails:GetRaidBackground (_combat_object.is_boss.mapid)
|
||||
EncounterDetailsFrame.raidbackground:SetTexture (file)
|
||||
EncounterDetailsFrame.raidbackground:SetTexCoord (L, R, T, B)
|
||||
EncounterDetailsFrame.raidbackground:SetAlpha (0.8)
|
||||
|
||||
-------------- set totals on down frame --------------
|
||||
--[[ data mine:
|
||||
_combat_object ["totals_grupo"] hold the total [1] damage // [2] heal // [3] [energy_name] energies // [4] [misc_name] miscs --]]
|
||||
|
||||
EncounterDetailsFrame.StatusBar_totaldamage:SetText (Loc ["STRING_TOTAL_DAMAGE"]..": ".. _detalhes:comma_value (_combat_object.totals_grupo[1])) --> [1] total damage
|
||||
EncounterDetailsFrame.StatusBar_totalheal:SetText (Loc ["STRING_TOTAL_HEAL"]..": ".. _detalhes:comma_value (_combat_object.totals_grupo[2])) --> [2] total heal
|
||||
--EncounterDetailsFrame.StatusBar_totaldamage:SetText (Loc ["STRING_TOTAL_DAMAGE"]..": ".. _detalhes:comma_value (_combat_object.totals_grupo[1])) --> [1] total damage
|
||||
--EncounterDetailsFrame.StatusBar_totalheal:SetText (Loc ["STRING_TOTAL_HEAL"]..": ".. _detalhes:comma_value (_combat_object.totals_grupo[2])) --> [2] total heal
|
||||
|
||||
--> Container Overall Damage Taken
|
||||
--[[ data mine:
|
||||
@@ -1026,6 +1044,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
|
||||
--> agora ja tenho a lista de todos os adds da luta
|
||||
-- vasculhar o container de dano e achar os adds:
|
||||
-- ~add
|
||||
|
||||
local adds = {}
|
||||
|
||||
@@ -1089,8 +1108,11 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
|
||||
--> montou a tabela, agora precisa mostrar no painel
|
||||
|
||||
local function _DanoFeito (barra)
|
||||
barra = barra:GetParent()
|
||||
local function _DanoFeito (self)
|
||||
|
||||
self.textura:SetBlendMode ("ADD")
|
||||
|
||||
local barra = self:GetParent()
|
||||
local tabela = barra.jogador
|
||||
local dano_em = tabela.dano_em
|
||||
|
||||
@@ -1111,8 +1133,11 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
GameTooltip:Show()
|
||||
end
|
||||
|
||||
local function _DanoRecebido (barra)
|
||||
barra = barra:GetParent()
|
||||
local function _DanoRecebido (self)
|
||||
|
||||
self.textura:SetBlendMode ("ADD")
|
||||
|
||||
local barra = self:GetParent()
|
||||
local tabela = barra.jogador
|
||||
local damage_from = tabela.damage_from
|
||||
|
||||
@@ -1139,6 +1164,11 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
GameTooltip:Show()
|
||||
end
|
||||
|
||||
local function _OnHide (self)
|
||||
GameTooltip:Hide()
|
||||
self.textura:SetBlendMode ("BLEND")
|
||||
end
|
||||
|
||||
local y = 10
|
||||
local frame_adds = EncounterDetailsFrame.overall_adds
|
||||
container = frame_adds.gump
|
||||
@@ -1153,8 +1183,11 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
|
||||
local barra = container.barras [index]
|
||||
if (not barra) then
|
||||
barra = EncounterDetails:CreateRow (index, container)
|
||||
barra:SetWidth (160)
|
||||
barra = EncounterDetails:CreateRow (index, container, -0)
|
||||
barra:SetBackdrop (backdrop_bar_onleave)
|
||||
barra:SetBackdropColor (.0, .0, .0, 0.3)
|
||||
|
||||
barra:SetWidth (155)
|
||||
|
||||
barra._no_report = true
|
||||
|
||||
@@ -1168,11 +1201,11 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
add_damage_taken:SetResizable (false)
|
||||
add_damage_taken:SetPoint ("left", barra, "left", 0, 0)
|
||||
|
||||
add_damage_taken:SetBackdrop (gump_fundo_backdrop)
|
||||
add_damage_taken:SetBackdropColor (.3, .7, .7, 0.8)
|
||||
add_damage_taken:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16})
|
||||
add_damage_taken:SetBackdropColor (.0, .5, .0, 0.5)
|
||||
|
||||
add_damage_taken:SetScript ("OnEnter", _DanoRecebido)
|
||||
add_damage_taken:SetScript ("OnLeave", function() GameTooltip:Hide() end)
|
||||
add_damage_taken:SetScript ("OnLeave", _OnHide)
|
||||
add_damage_taken:SetScript ("OnClick", EncounterDetails.BossInfoRowClick)
|
||||
|
||||
add_damage_taken.textura = add_damage_taken:CreateTexture (nil, "overlay")
|
||||
@@ -1191,8 +1224,8 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
add_damage_done:SetResizable (false)
|
||||
add_damage_done:SetPoint ("left", add_damage_taken, "right", 0, 0)
|
||||
|
||||
add_damage_done:SetBackdrop (gump_fundo_backdrop)
|
||||
add_damage_done:SetBackdropColor (.9, .9, .3, 0.8)
|
||||
add_damage_done:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16})
|
||||
add_damage_done:SetBackdropColor (.5, .0, .0, 0.5)
|
||||
|
||||
add_damage_done.textura = add_damage_done:CreateTexture (nil, "overlay")
|
||||
add_damage_done.textura:SetTexture ("Interface\\Buttons\\UI-MicroStream-Red")
|
||||
@@ -1201,7 +1234,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
add_damage_done.textura:SetPoint ("topleft", add_damage_done, "topleft")
|
||||
|
||||
add_damage_done:SetScript ("OnEnter", _DanoFeito)
|
||||
add_damage_done:SetScript ("OnLeave", function() GameTooltip:Hide() end)
|
||||
add_damage_done:SetScript ("OnLeave", _OnHide)
|
||||
add_damage_done:SetScript ("OnClick", EncounterDetails.BossInfoRowClick)
|
||||
|
||||
barra.texto_esquerdo:SetPoint ("left", add_damage_done, "right")
|
||||
@@ -1213,10 +1246,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
end
|
||||
|
||||
barra.texto_esquerdo:SetText (addName)
|
||||
|
||||
--barra.texto_direita:SetText (_detalhes:comma_value (esta_tabela.total))
|
||||
barra.texto_direita:SetText (_detalhes:ToK (esta_tabela.total))
|
||||
|
||||
barra.texto_esquerdo:SetSize (barra:GetWidth() - barra.texto_direita:GetStringWidth() - 34, 15)
|
||||
|
||||
barra.jogador = esta_tabela --> barra.jogador agora tem a tabela com --> [1] total dano causado [2] jogadores que foram alvos [3] jogadores que castaram essa magia [4] ID da magia
|
||||
@@ -1225,9 +1255,6 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
barra.textura:SetStatusBarColor (1, 1, 1, 1) --> a cor pode ser a spell school da magia
|
||||
barra.textura:SetValue (100)
|
||||
|
||||
--barra.icone:SetTexture (icone_magia)
|
||||
--barra.icone:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [jogador.classe]))
|
||||
|
||||
barra:Show()
|
||||
quantidade = quantidade + 1
|
||||
index = index +1
|
||||
@@ -1300,6 +1327,9 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
barra = EncounterDetails:CreateRow (index, container, 3, 3, -6)
|
||||
barra.TTT = "total_interrupt" -- tool tip type
|
||||
barra.report_text = "Details! ".. Loc ["STRING_INTERRUPT_BY"]
|
||||
barra:SetBackdrop (backdrop_bar_onleave)
|
||||
barra:SetBackdropColor (.0, .0, .0, 0.3)
|
||||
barra:SetWidth (155)
|
||||
end
|
||||
|
||||
local spellid = tabela [3]
|
||||
@@ -1411,6 +1441,9 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
barra = EncounterDetails:CreateRow (index, container, 3, 3, -6)
|
||||
barra.TTT = "dispell" -- tool tip type
|
||||
barra.report_text = "Details! ".. Loc ["STRING_DISPELLED_BY"]
|
||||
barra:SetBackdrop (backdrop_bar_onleave)
|
||||
barra:SetBackdropColor (.0, .0, .0, 0.3)
|
||||
barra:SetWidth (160)
|
||||
end
|
||||
|
||||
local nome_magia, _, icone_magia = _GetSpellInfo (tabela [3])
|
||||
@@ -1471,6 +1504,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
|
||||
_detalhes:SetFontSize (barra.texto_esquerdo, 9)
|
||||
_detalhes:SetFontSize (barra.texto_direita, 9)
|
||||
_detalhes:SetFontFace (barra.texto_esquerdo, "Arial Narrow")
|
||||
barra:SetWidth (160)
|
||||
end
|
||||
|
||||
if (tabela [3]:find ("-")) then
|
||||
@@ -1530,6 +1564,7 @@ function EncounterDetails:OnEvent (_, event, ...)
|
||||
show_icon = 5, --automatic
|
||||
hide_on_combat = false, --hide the window when a new combat start
|
||||
max_emote_segments = 3,
|
||||
opened = 0,
|
||||
}
|
||||
|
||||
--> Install
|
||||
@@ -1549,8 +1584,6 @@ function EncounterDetails:OnEvent (_, event, ...)
|
||||
print (install.error)
|
||||
end
|
||||
|
||||
EncounterDetails.db = saveddata
|
||||
|
||||
EncounterDetails.charsaved = EncounterDetailsDB or {emotes = {}}
|
||||
EncounterDetailsDB = EncounterDetails.charsaved
|
||||
|
||||
|
||||
@@ -31,18 +31,8 @@ do
|
||||
end
|
||||
|
||||
local build_options_panel = function()
|
||||
local options_frame = CreateFrame ("frame", "EncounterDetailsOptionsWindow", UIParent, "ButtonFrameTemplate")
|
||||
tinsert (UISpecialFrames, "EncounterDetailsOptionsWindow")
|
||||
options_frame:SetSize (500, 200)
|
||||
options_frame:SetFrameStrata ("DIALOG")
|
||||
options_frame:SetScript ("OnMouseDown", function(self) self:StartMoving()end)
|
||||
options_frame:SetScript ("OnMouseUp", function(self) self:StopMovingOrSizing()end)
|
||||
options_frame:SetMovable (true)
|
||||
options_frame:EnableMouse (true)
|
||||
options_frame:Hide()
|
||||
options_frame:SetPoint ("center", UIParent, "center")
|
||||
options_frame.TitleText:SetText ("Encounter Details Options")
|
||||
options_frame.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-BLOODELF]])
|
||||
|
||||
local options_frame = EncounterDetails:CreatePluginOptionsFrame ("EncounterDetailsOptionsWindow", "Encounter Details Options", 2)
|
||||
|
||||
-- 1 = only when inside a raid map
|
||||
-- 2 = only when in raid group
|
||||
@@ -87,7 +77,6 @@ do
|
||||
-- /dump DETAILS_PLUGIN_ENCOUNTER_DETAILS.db.show_icon
|
||||
|
||||
local menu = {
|
||||
--show when dropdown
|
||||
{
|
||||
type = "select",
|
||||
get = function() return EncounterDetails.db.show_icon end,
|
||||
@@ -208,20 +197,38 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
local grafico_cores = {{1, 1, 1, 1}, {1, 0.5, 0.3, 1}, {0.75, 0.7, 0.1, 1}, {0.2, 0.9, 0.2, 1}, {0.2, 0.5, 0.9, 1}} --, {0.9, 0.2, 0.35, 1}, {0.85, 0.55, 0.45, 1}, {0.4, 0.98, 0.29, 1}
|
||||
local grafico_cores = {{1, 1, 1, 1}, {1, 0.5, 0.3, 1}, {0.75, 0.7, 0.1, 1}, {0.2, 0.9, 0.2, 1}, {0.2, 0.5, 0.9, 1}}
|
||||
|
||||
local lastBoss = nil
|
||||
EncounterDetails.CombatsAlreadyDrew = {}
|
||||
|
||||
function EncounterDetails:BuildDpsGraphic()
|
||||
|
||||
EncounterDetails.LastGraphicDrew = EncounterDetails.LastGraphicDrew or {}
|
||||
local graphicData = _detalhes.tabela_vigente:GetTimeData ("Raid Damage Done")
|
||||
|
||||
if (not graphicData or not _detalhes.tabela_vigente.start_time or not _detalhes.tabela_vigente.end_time) then
|
||||
return
|
||||
elseif (graphicData == EncounterDetails.LastGraphicDrew) then
|
||||
return
|
||||
local segment = EncounterDetails._segment
|
||||
|
||||
--print ("Segment:", segment)
|
||||
local g
|
||||
|
||||
if (not _G.DetailsRaidDpsGraph) then
|
||||
EncounterDetails:CreateGraphPanel()
|
||||
g = _G.DetailsRaidDpsGraph
|
||||
else
|
||||
EncounterDetails.LastGraphicDrew = graphicData
|
||||
g = _G.DetailsRaidDpsGraph
|
||||
|
||||
--if (not combat.is_boss or not lastBoss or combat.is_boss.index ~= lastBoss) then
|
||||
-- g.max_damage = 0
|
||||
--end
|
||||
end
|
||||
g:ResetData()
|
||||
|
||||
local combat = EncounterDetails:GetCombat (segment)
|
||||
local graphicData = combat:GetTimeData ("Raid Damage Done")
|
||||
|
||||
if (not graphicData or not combat.start_time or not combat.end_time) then
|
||||
EncounterDetails:Msg ("This segment doesn't have chart data.")
|
||||
return
|
||||
--elseif (EncounterDetails.CombatsAlreadyDrew [combat:GetCombatNumber()]) then
|
||||
--return
|
||||
end
|
||||
|
||||
if (graphicData.max_value == 0) then
|
||||
@@ -229,128 +236,66 @@ do
|
||||
end
|
||||
|
||||
--> battle time
|
||||
if (_detalhes.tabela_vigente.end_time - _detalhes.tabela_vigente.start_time < 12) then
|
||||
if (combat.end_time - combat.start_time < 12) then
|
||||
return
|
||||
end
|
||||
|
||||
local g
|
||||
|
||||
EncounterDetails.Frame.linhas = EncounterDetails.Frame.linhas or 0
|
||||
EncounterDetails.Frame.linhas = EncounterDetails.Frame.linhas + 1
|
||||
--EncounterDetails.Frame.linhas = EncounterDetails.Frame.linhas or 0
|
||||
EncounterDetails.Frame.linhas = 1
|
||||
|
||||
if (EncounterDetails.Frame.linhas > 5) then
|
||||
EncounterDetails.Frame.linhas = 1
|
||||
end
|
||||
|
||||
if (not _G.DetailsRaidDpsGraph) then
|
||||
g = Graphics:CreateGraphLine ("DetailsRaidDpsGraph", EncounterDetails.Frame, "topleft","topleft",20,-76,670,238)
|
||||
g:SetXAxis (-1,1)
|
||||
g:SetYAxis (-1,1)
|
||||
g:SetGridSpacing (false, false)
|
||||
g:SetGridColor ({0.5,0.5,0.5,0.3})
|
||||
g:SetAxisDrawing (false,false)
|
||||
g:SetAxisColor({1.0,1.0,1.0,1.0})
|
||||
g:SetAutoScale (true)
|
||||
g:SetLineTexture ("smallline")
|
||||
g:SetBorderSize ("right", 0.001)
|
||||
g.VerticalLines = {}
|
||||
g.TryIndicator = {}
|
||||
|
||||
function g:ChangeColorOnDataSeries (index, color)
|
||||
self.Data [index].Color = color
|
||||
self.NeedsUpdate=true
|
||||
end
|
||||
|
||||
function g:AddDataSeriesOnFirstIndex (points, color, n2)
|
||||
local data
|
||||
--Make sure there is data points
|
||||
if not points then
|
||||
return
|
||||
end
|
||||
|
||||
data=points
|
||||
if n2==nil then
|
||||
n2=false
|
||||
|
||||
g.max_damage = 0
|
||||
|
||||
for _, line in ipairs (g.VerticalLines) do
|
||||
line:Hide()
|
||||
end
|
||||
|
||||
lastBoss = combat.is_boss and combat.is_boss.index
|
||||
|
||||
--
|
||||
for i = segment + 4, segment+1, -1 do
|
||||
local combat = EncounterDetails:GetCombat (i)
|
||||
if (combat) then --the combat exists
|
||||
local elapsed_time = combat:GetCombatTime()
|
||||
|
||||
if (EncounterDetails.debugmode and not combat.is_boss) then
|
||||
combat.is_boss = {
|
||||
index = 1,
|
||||
name = _detalhes:GetBossName (1098, 1),
|
||||
zone = "Throne of Thunder",
|
||||
mapid = 1098,
|
||||
encounter = "Jin'Rohk the Breaker"
|
||||
}
|
||||
end
|
||||
if n2 or (table.getn(points)==2 and table.getn(points[1])~=2) then
|
||||
data={}
|
||||
for k,v in ipairs(points[1]) do
|
||||
tinsert(data,{v,points[2][k]})
|
||||
|
||||
if (elapsed_time > 12 and combat.is_boss and combat.is_boss.index == lastBoss) then --is the same boss
|
||||
|
||||
local chart_data = combat:GetTimeData ("Raid Damage Done")
|
||||
if (chart_data and chart_data.max_value and chart_data.max_value > 0) then --have a chart data
|
||||
--if (not EncounterDetails.CombatsAlreadyDrew [combat:GetCombatNumber()]) then --isn't drew yet
|
||||
EncounterDetails:DrawSegmentGraphic (g, chart_data, combat)
|
||||
--EncounterDetails.CombatsAlreadyDrew [combat:GetCombatNumber()] = true
|
||||
--end
|
||||
end
|
||||
end
|
||||
|
||||
table.insert (self.Data, 1, {Points=data;Color=color})
|
||||
|
||||
self.NeedsUpdate=true
|
||||
end
|
||||
|
||||
DetailsFrameWork:NewLabel (EncounterDetails.Frame, EncounterDetails.Frame, nil, "timeamt0", "00:00", "GameFontHighlightSmall")
|
||||
EncounterDetails.Frame["timeamt0"]:SetPoint ("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", 85, -300)
|
||||
|
||||
for i = 1, 8, 1 do
|
||||
|
||||
local line = g:CreateTexture (nil, "overlay")
|
||||
line:SetTexture (.5, .5, .5, .7)
|
||||
line:SetWidth (670)
|
||||
line:SetHeight (1)
|
||||
line:SetVertexColor (.4, .4, .4, .8)
|
||||
|
||||
DetailsFrameWork:NewLabel (EncounterDetails.Frame, EncounterDetails.Frame, nil, "dpsamt"..i, "", "GameFontHighlightSmall")
|
||||
EncounterDetails.Frame["dpsamt"..i]:SetPoint ("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", 27, -61 + (-(24.6*i)))
|
||||
line:SetPoint ("topleft", EncounterDetails.Frame["dpsamt"..i].widget, "bottom", -27, 0)
|
||||
|
||||
DetailsFrameWork:NewLabel (EncounterDetails.Frame, EncounterDetails.Frame, nil, "timeamt"..i, "", "GameFontHighlightSmall")
|
||||
EncounterDetails.Frame["timeamt"..i].widget:SetPoint ("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", 75+(73*i), -300)
|
||||
end
|
||||
|
||||
g.max_time = 0
|
||||
g.max_damage = 0
|
||||
|
||||
EncounterDetails.MaxGraphics = EncounterDetails.MaxGraphics or 5
|
||||
|
||||
for i = 1, EncounterDetails.MaxGraphics do
|
||||
local texture = g:CreateTexture (nil, "overlay")
|
||||
texture:SetWidth (9)
|
||||
texture:SetHeight (9)
|
||||
texture:SetPoint ("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", (i*65) + 299, -81)
|
||||
texture:SetTexture (unpack (grafico_cores[i]))
|
||||
local text = g:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall")
|
||||
text:SetPoint ("LEFT", texture, "right", 2, 0)
|
||||
text:SetJustifyH ("LEFT")
|
||||
if (i == 1) then
|
||||
text:SetText (Loc ["STRING_CURRENT"])
|
||||
else
|
||||
text:SetText (Loc ["STRING_TRY"] .. " #" .. i)
|
||||
end
|
||||
--texture:Hide()
|
||||
g.TryIndicator [#g.TryIndicator+1] = {texture = texture, text = text}
|
||||
end
|
||||
|
||||
local v = g:CreateTexture (nil, "overlay")
|
||||
v:SetWidth (1)
|
||||
v:SetHeight (238)
|
||||
v:SetPoint ("top", g, "top", 0, 1)
|
||||
v:SetPoint ("left", g, "left", 55, 0)
|
||||
v:SetTexture (1, 1, 1, 1)
|
||||
|
||||
local h = g:CreateTexture (nil, "overlay")
|
||||
h:SetWidth (668)
|
||||
h:SetHeight (2)
|
||||
h:SetPoint ("top", g, "top", 0, -217)
|
||||
h:SetPoint ("left", g, "left")
|
||||
h:SetTexture (1, 1, 1, 1)
|
||||
|
||||
else
|
||||
g = _G.DetailsRaidDpsGraph
|
||||
|
||||
if (not _detalhes.tabela_vigente.is_boss or not lastBoss or _detalhes.tabela_vigente.is_boss.index ~= lastBoss) then
|
||||
g:ResetData()
|
||||
g.max_damage = 0
|
||||
end
|
||||
end
|
||||
--
|
||||
|
||||
lastBoss = _detalhes.tabela_vigente.is_boss and _detalhes.tabela_vigente.is_boss.index
|
||||
EncounterDetails:DrawSegmentGraphic (g, graphicData, combat, combat)
|
||||
EncounterDetails.CombatsAlreadyDrew [combat:GetCombatNumber()] = true
|
||||
|
||||
g:Show()
|
||||
|
||||
end
|
||||
|
||||
function EncounterDetails:DrawSegmentGraphic (g, graphicData, combat, drawDeathsCombat)
|
||||
|
||||
local _data = {}
|
||||
local dps_max = graphicData.max_value
|
||||
local amount = #graphicData
|
||||
@@ -358,10 +303,11 @@ do
|
||||
local scaleW = 1/670
|
||||
|
||||
local content = graphicData
|
||||
table.insert (content, 1, 0)
|
||||
table.insert (content, 1, 0)
|
||||
table.insert (content, #content+1, 0)
|
||||
table.insert (content, #content+1, 0)
|
||||
tinsert (content, 1, 0)
|
||||
tinsert (content, 1, 0)
|
||||
tinsert (content, #content+1, 0)
|
||||
tinsert (content, #content+1, 0)
|
||||
|
||||
local _i = 3
|
||||
|
||||
local graphMaxDps = math.max (g.max_damage, dps_max)
|
||||
@@ -370,12 +316,13 @@ do
|
||||
_data [#_data+1] = {scaleW*(_i-2), v/graphMaxDps} --> x and y coords
|
||||
_i = _i + 1
|
||||
end
|
||||
|
||||
tremove (content, 1)
|
||||
tremove (content, 1)
|
||||
tremove (content, #graphicData)
|
||||
tremove (content, #graphicData)
|
||||
|
||||
--[[ precisa de uma proteção contra troca de tabela, no inicio dos trash
|
||||
Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
attempt to perform arithmetic on field 'end_time' (a nil value)--]]
|
||||
|
||||
local tempo = _detalhes.tabela_vigente.end_time - _detalhes.tabela_vigente.start_time
|
||||
local tempo = combat.end_time - combat.start_time
|
||||
if (g.max_time < tempo) then
|
||||
g.max_time = tempo
|
||||
|
||||
@@ -394,20 +341,14 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
end
|
||||
end
|
||||
|
||||
--print ("DPSMAX: " .. dps_max .. " > " .. g.max_damage)
|
||||
|
||||
if (dps_max > g.max_damage) then
|
||||
|
||||
--> normalize previous data
|
||||
|
||||
--table.insert (self.Data, 1, {Points=data;Color=color})
|
||||
|
||||
if (g.max_damage > 0) then
|
||||
local normalizePercent = g.max_damage / dps_max
|
||||
for dataIndex, Data in ipairs (g.Data) do
|
||||
local Points = Data.Points
|
||||
for i = 1, #Points do
|
||||
--print (Points[i][1], Points[i][2])
|
||||
Points[i][2] = Points[i][2]*normalizePercent
|
||||
end
|
||||
end
|
||||
@@ -435,102 +376,197 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
for i = 2, #g.Data do
|
||||
g:ChangeColorOnDataSeries (i, grafico_cores [i])
|
||||
end
|
||||
|
||||
local mortes = _detalhes.tabela_vigente.last_events_tables
|
||||
local scaleG = 650/_detalhes.tabela_vigente:GetCombatTime()
|
||||
|
||||
for _, row in _ipairs (g.VerticalLines) do
|
||||
row:Hide()
|
||||
end
|
||||
|
||||
for i = 1, math.min (3, #mortes) do
|
||||
|
||||
local vRowFrame = g.VerticalLines [i]
|
||||
local deadTime = mortes [i][2] - _detalhes.tabela_vigente.start_time
|
||||
|
||||
if (drawDeathsCombat) then
|
||||
local mortes = drawDeathsCombat.last_events_tables
|
||||
--local scaleG = 650/_detalhes.tabela_vigente:GetCombatTime()
|
||||
local scaleG = 610/drawDeathsCombat:GetCombatTime()
|
||||
|
||||
if (not vRowFrame) then
|
||||
|
||||
vRowFrame = CreateFrame ("frame", "DetailsEncountersVerticalLine"..i, g)
|
||||
vRowFrame:SetWidth (20)
|
||||
vRowFrame:SetHeight (43)
|
||||
vRowFrame:SetFrameLevel (g:GetFrameLevel()+2)
|
||||
|
||||
vRowFrame:SetScript ("OnEnter", function (frame)
|
||||
|
||||
if (vRowFrame.dead[1] and vRowFrame.dead[1][3] and vRowFrame.dead[1][3][2]) then
|
||||
local nome_magia3, _, icone_magia3 = _GetSpellInfo (vRowFrame.dead[1][3][2])
|
||||
if (type (vRowFrame.dead[1][3][3]) == "number") then
|
||||
nome_magia3 = _detalhes:comma_value (vRowFrame.dead[1][3][3]).." "..nome_magia3
|
||||
end
|
||||
|
||||
local nome_magia2, _, icone_magia2 = _GetSpellInfo (vRowFrame.dead[1][2][2])
|
||||
if (type (vRowFrame.dead[1][2][3]) == "number") then
|
||||
nome_magia2 = _detalhes:comma_value (vRowFrame.dead[1][2][3]).." "..nome_magia2
|
||||
end
|
||||
|
||||
local nome_magia1, _, icone_magia1 = _GetSpellInfo (vRowFrame.dead[1][1][2])
|
||||
if (type (vRowFrame.dead[1][1][3]) == "number") then
|
||||
nome_magia1 = _detalhes:comma_value (vRowFrame.dead[1][1][3]).." "..nome_magia1
|
||||
else --bress
|
||||
local decorrido = vRowFrame.dead[1][1][4] - _detalhes.tabela_vigente.start_time
|
||||
local minutos, segundos = _math_floor (decorrido/60), _math_floor (decorrido%60)
|
||||
nome_magia1 = minutos..":"..segundos.." "..nome_magia1
|
||||
end
|
||||
|
||||
GameCooltip:Reset()
|
||||
|
||||
GameCooltip:AddLine (vRowFrame.dead[6].." "..vRowFrame.dead[3])
|
||||
GameCooltip:AddIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\small_icons", _,_,_,_, .75, 1, 0, 1)
|
||||
|
||||
GameCooltip:AddLine (nome_magia3)
|
||||
GameCooltip:AddIcon (icone_magia3)
|
||||
|
||||
GameCooltip:AddLine (nome_magia2)
|
||||
GameCooltip:AddIcon (icone_magia1)
|
||||
|
||||
GameCooltip:AddLine (nome_magia1)
|
||||
GameCooltip:AddIcon (icone_magia1)
|
||||
|
||||
GameCooltip:SetOption ("TextSize", 9.5)
|
||||
GameCooltip:SetOption ("IconSize", 12)
|
||||
GameCooltip:SetOption ("HeightAnchorMod", -15)
|
||||
|
||||
GameCooltip:ShowCooltip (frame, "tooltip")
|
||||
end
|
||||
end)
|
||||
|
||||
vRowFrame:SetScript ("OnLeave", function (frame)
|
||||
_detalhes.popup:ShowMe (false)
|
||||
end)
|
||||
|
||||
vRowFrame.texture = vRowFrame:CreateTexture (nil, "overlay")
|
||||
vRowFrame.texture:SetTexture ("Interface\\AddOns\\Details\\images\\verticalline")
|
||||
vRowFrame.texture:SetWidth (3)
|
||||
vRowFrame.texture:SetHeight (20)
|
||||
vRowFrame.texture:SetPoint ("center", "DetailsEncountersVerticalLine"..i, "center")
|
||||
vRowFrame.texture:SetPoint ("bottom", "DetailsEncountersVerticalLine"..i, "bottom", 0, 0)
|
||||
vRowFrame.texture:SetVertexColor (1, 1, 1, .5)
|
||||
|
||||
vRowFrame.icon = vRowFrame:CreateTexture (nil, "overlay")
|
||||
vRowFrame.icon:SetTexture ("Interface\\WorldStateFrame\\SkullBones")
|
||||
vRowFrame.icon:SetTexCoord (0.046875, 0.453125, 0.046875, 0.46875)
|
||||
vRowFrame.icon:SetWidth (16)
|
||||
vRowFrame.icon:SetHeight (16)
|
||||
vRowFrame.icon:SetPoint ("center", "DetailsEncountersVerticalLine"..i, "center")
|
||||
vRowFrame.icon:SetPoint ("bottom", "DetailsEncountersVerticalLine"..i, "bottom", 0, 20)
|
||||
|
||||
g.VerticalLines [i] = vRowFrame
|
||||
for _, row in _ipairs (g.VerticalLines) do
|
||||
row:Hide()
|
||||
end
|
||||
|
||||
vRowFrame:SetPoint ("topleft", EncounterDetails.Frame, "topleft", (deadTime*scaleG), -268)
|
||||
vRowFrame.dead = mortes [i]
|
||||
vRowFrame:Show()
|
||||
for i = 1, math.min (3, #mortes) do
|
||||
|
||||
local vRowFrame = g.VerticalLines [i]
|
||||
|
||||
if (not vRowFrame) then
|
||||
|
||||
vRowFrame = CreateFrame ("frame", "DetailsEncountersVerticalLine"..i, g)
|
||||
vRowFrame:SetWidth (20)
|
||||
vRowFrame:SetHeight (43)
|
||||
vRowFrame:SetFrameLevel (g:GetFrameLevel()+2)
|
||||
|
||||
vRowFrame:SetScript ("OnEnter", function (frame)
|
||||
|
||||
if (vRowFrame.dead[1] and vRowFrame.dead[1][3] and vRowFrame.dead[1][3][2]) then
|
||||
|
||||
GameCooltip:Reset()
|
||||
|
||||
--time of death and player name
|
||||
GameCooltip:AddLine (vRowFrame.dead[6].." "..vRowFrame.dead[3])
|
||||
local class, l, r, t, b = _detalhes:GetClass (vRowFrame.dead[3])
|
||||
if (class) then
|
||||
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 12, 12, l, r, t, b)
|
||||
end
|
||||
GameCooltip:AddLine ("")
|
||||
|
||||
--last hits:
|
||||
local death = vRowFrame.dead
|
||||
local amt = 0
|
||||
for i = #death[1], 1, -1 do
|
||||
local this_hit = death[1][i]
|
||||
if (type (this_hit[1]) == "boolean" and this_hit[1]) then
|
||||
local spellname, _, spellicon = _GetSpellInfo (this_hit[2])
|
||||
local t = death [2] - this_hit [4]
|
||||
GameCooltip:AddLine ("-" .. _cstr ("%.1f", t) .. " " .. spellname .. " (" .. this_hit[6] .. ")", EncounterDetails:comma_value (this_hit [3]))
|
||||
GameCooltip:AddIcon (spellicon, 1, 1, 12, 12, 0.1, 0.9, 0.1, 0.9)
|
||||
amt = amt + 1
|
||||
if (amt == 3) then
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
GameCooltip:SetOption ("TextSize", 9.5)
|
||||
GameCooltip:SetOption ("HeightAnchorMod", -15)
|
||||
|
||||
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
|
||||
GameCooltip:ShowCooltip (frame, "tooltip")
|
||||
end
|
||||
end)
|
||||
|
||||
vRowFrame:SetScript ("OnLeave", function (frame)
|
||||
_detalhes.popup:ShowMe (false)
|
||||
end)
|
||||
|
||||
vRowFrame.texture = vRowFrame:CreateTexture (nil, "overlay")
|
||||
vRowFrame.texture:SetTexture ("Interface\\AddOns\\Details\\images\\verticalline")
|
||||
vRowFrame.texture:SetWidth (3)
|
||||
vRowFrame.texture:SetHeight (20)
|
||||
vRowFrame.texture:SetPoint ("center", "DetailsEncountersVerticalLine"..i, "center")
|
||||
vRowFrame.texture:SetPoint ("bottom", "DetailsEncountersVerticalLine"..i, "bottom", 0, 0)
|
||||
vRowFrame.texture:SetVertexColor (1, 1, 1, .5)
|
||||
|
||||
vRowFrame.icon = vRowFrame:CreateTexture (nil, "overlay")
|
||||
vRowFrame.icon:SetTexture ("Interface\\WorldStateFrame\\SkullBones")
|
||||
vRowFrame.icon:SetTexCoord (0.046875, 0.453125, 0.046875, 0.46875)
|
||||
vRowFrame.icon:SetWidth (16)
|
||||
vRowFrame.icon:SetHeight (16)
|
||||
vRowFrame.icon:SetPoint ("center", "DetailsEncountersVerticalLine"..i, "center")
|
||||
vRowFrame.icon:SetPoint ("bottom", "DetailsEncountersVerticalLine"..i, "bottom", 0, 20)
|
||||
|
||||
g.VerticalLines [i] = vRowFrame
|
||||
end
|
||||
|
||||
local deadTime = mortes [i].dead_at
|
||||
--print (deadTime, mortes [i][3])
|
||||
vRowFrame:SetPoint ("topleft", EncounterDetails.Frame, "topleft", (deadTime*scaleG)+70, -268)
|
||||
vRowFrame.dead = mortes [i]
|
||||
vRowFrame:Show()
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function EncounterDetails:CreateGraphPanel()
|
||||
local g = Graphics:CreateGraphLine ("DetailsRaidDpsGraph", EncounterDetails.Frame, "topleft","topleft",20,-76,670,238)
|
||||
g:SetXAxis (-1,1)
|
||||
g:SetYAxis (-1,1)
|
||||
g:SetGridSpacing (false, false)
|
||||
g:SetGridColor ({0.5,0.5,0.5,0.3})
|
||||
g:SetAxisDrawing (false,false)
|
||||
g:SetAxisColor({1.0,1.0,1.0,1.0})
|
||||
g:SetAutoScale (true)
|
||||
g:SetLineTexture ("smallline")
|
||||
g:SetBorderSize ("right", 0.001)
|
||||
g.VerticalLines = {}
|
||||
g.TryIndicator = {}
|
||||
|
||||
function g:ChangeColorOnDataSeries (index, color)
|
||||
self.Data [index].Color = color
|
||||
self.NeedsUpdate=true
|
||||
end
|
||||
|
||||
_G.DetailsRaidDpsGraph:Show()
|
||||
function g:AddDataSeriesOnFirstIndex (points, color, n2)
|
||||
local data
|
||||
--Make sure there is data points
|
||||
if not points then
|
||||
return
|
||||
end
|
||||
|
||||
data=points
|
||||
if n2==nil then
|
||||
n2=false
|
||||
end
|
||||
if n2 or (table.getn(points)==2 and table.getn(points[1])~=2) then
|
||||
data={}
|
||||
for k,v in ipairs(points[1]) do
|
||||
tinsert(data,{v,points[2][k]})
|
||||
end
|
||||
end
|
||||
|
||||
table.insert (self.Data, 1, {Points=data;Color=color})
|
||||
|
||||
self.NeedsUpdate=true
|
||||
end
|
||||
|
||||
DetailsFrameWork:NewLabel (EncounterDetails.Frame, EncounterDetails.Frame, nil, "timeamt0", "00:00", "GameFontHighlightSmall")
|
||||
EncounterDetails.Frame["timeamt0"]:SetPoint ("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", 85, -300)
|
||||
|
||||
end
|
||||
for i = 1, 8, 1 do
|
||||
|
||||
local line = g:CreateTexture (nil, "overlay")
|
||||
line:SetTexture (.5, .5, .5, .7)
|
||||
line:SetWidth (670)
|
||||
line:SetHeight (1)
|
||||
line:SetVertexColor (.4, .4, .4, .8)
|
||||
|
||||
DetailsFrameWork:NewLabel (EncounterDetails.Frame, EncounterDetails.Frame, nil, "dpsamt"..i, "", "GameFontHighlightSmall")
|
||||
EncounterDetails.Frame["dpsamt"..i]:SetPoint ("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", 27, -61 + (-(24.6*i)))
|
||||
line:SetPoint ("topleft", EncounterDetails.Frame["dpsamt"..i].widget, "bottom", -27, 0)
|
||||
|
||||
DetailsFrameWork:NewLabel (EncounterDetails.Frame, EncounterDetails.Frame, nil, "timeamt"..i, "", "GameFontHighlightSmall")
|
||||
EncounterDetails.Frame["timeamt"..i].widget:SetPoint ("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", 75+(73*i), -300)
|
||||
end
|
||||
|
||||
g.max_time = 0
|
||||
g.max_damage = 0
|
||||
|
||||
EncounterDetails.MaxGraphics = EncounterDetails.MaxGraphics or 5
|
||||
|
||||
for i = 1, EncounterDetails.MaxGraphics do
|
||||
local texture = g:CreateTexture (nil, "overlay")
|
||||
texture:SetWidth (9)
|
||||
texture:SetHeight (9)
|
||||
texture:SetPoint ("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", (i*65) + 299, -81)
|
||||
texture:SetTexture (unpack (grafico_cores[i]))
|
||||
local text = g:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall")
|
||||
text:SetPoint ("LEFT", texture, "right", 2, 0)
|
||||
text:SetJustifyH ("LEFT")
|
||||
if (i == 1) then
|
||||
text:SetText (Loc ["STRING_CURRENT"])
|
||||
else
|
||||
text:SetText (Loc ["STRING_TRY"] .. " #" .. i)
|
||||
end
|
||||
--texture:Hide()
|
||||
g.TryIndicator [#g.TryIndicator+1] = {texture = texture, text = text}
|
||||
end
|
||||
|
||||
local v = g:CreateTexture (nil, "overlay")
|
||||
v:SetWidth (1)
|
||||
v:SetHeight (238)
|
||||
v:SetPoint ("top", g, "top", 0, 1)
|
||||
v:SetPoint ("left", g, "left", 55, 0)
|
||||
v:SetTexture (1, 1, 1, 1)
|
||||
|
||||
local h = g:CreateTexture (nil, "overlay")
|
||||
h:SetWidth (668)
|
||||
h:SetHeight (2)
|
||||
h:SetPoint ("top", g, "top", 0, -217)
|
||||
h:SetPoint ("left", g, "left")
|
||||
h:SetTexture (1, 1, 1, 1)
|
||||
end
|
||||
|
||||
local BossFrame = EncounterDetails.Frame
|
||||
|
||||
@@ -565,6 +601,8 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
if (botao == "LeftButton") then
|
||||
self:StartMoving()
|
||||
self.isMoving = true
|
||||
elseif (botao == "RightButton" and not self.isMoving) then
|
||||
EncounterDetails:CloseWindow()
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -735,7 +773,8 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
widget:Hide()
|
||||
end
|
||||
|
||||
BossFrame.segmentosDropdown:Disable()
|
||||
BossFrame.segmentosDropdown:Enable()
|
||||
--BossFrame.segmentosDropdown:Disable()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -809,7 +848,11 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
--tooltips
|
||||
BossFrame.buttonSwitchNormal.MouseOnEnterHook = function()
|
||||
GameCooltip:Reset()
|
||||
GameCooltip:AddLine (Loc ["STRING_FIGHT_SUMMARY"])
|
||||
--GameCooltip:AddLine (Loc ["STRING_FIGHT_SUMMARY"])
|
||||
GameCooltip:AddLine (Loc ["STRING_FIGHT_SUMMARY"], nil, nil, "orange", nil, 12)
|
||||
--GameCooltip:AddIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 1, 1, 16, 16, 0, 0.1015625, 0, 0.515625)
|
||||
|
||||
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
|
||||
GameCooltip:ShowCooltip (BossFrame.buttonSwitchNormal, "tooltip")
|
||||
t:SetBlendMode ("ADD")
|
||||
end
|
||||
@@ -817,7 +860,10 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
--
|
||||
BossFrame.buttonSwitchGraphic.MouseOnEnterHook = function()
|
||||
GameCooltip:Reset()
|
||||
GameCooltip:AddLine (Loc ["STRING_FIGHT_GRAPHIC"])
|
||||
GameCooltip:AddLine (Loc ["STRING_FIGHT_GRAPHIC"], nil, nil, "orange", nil, 12)
|
||||
--GameCooltip:AddIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 1, 1, 16, 16, 0.1171875, 0.21875, 0, 0.515625)
|
||||
|
||||
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
|
||||
GameCooltip:ShowCooltip (BossFrame.buttonSwitchGraphic, "tooltip")
|
||||
g:SetBlendMode ("ADD")
|
||||
end
|
||||
@@ -825,7 +871,10 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
--
|
||||
BossFrame.buttonSwitchBossEmotes:SetHook ("OnEnter", function()
|
||||
GameCooltip:Reset()
|
||||
GameCooltip:AddLine ("boss emotes")
|
||||
GameCooltip:AddLine ("boss emotes", nil, nil, "orange", nil, 12)
|
||||
--GameCooltip:AddIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 1, 1, 16, 16, 90/256, 116/256, 0, 0.515625)
|
||||
|
||||
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
|
||||
GameCooltip:ShowCooltip (BossFrame.buttonSwitchBossEmotes, "tooltip")
|
||||
e:SetBlendMode ("ADD")
|
||||
end)
|
||||
@@ -1278,10 +1327,12 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
|
||||
mouseOver_adds_frame:SetScript ("OnEnter",
|
||||
function()
|
||||
_G.DetailsBubble:SetOwner (mouseOver_adds_frame.imagem, nil, nil, -45, -22)
|
||||
_G.DetailsBubble:FlipHorizontal()
|
||||
_G.DetailsBubble:SetBubbleText (Loc ["STRING_ADDS_HELP"])
|
||||
_G.DetailsBubble:ShowBubble()
|
||||
if (EncounterDetails.db.opened < 30) then
|
||||
_G.DetailsBubble:SetOwner (mouseOver_adds_frame.imagem, nil, nil, -45, -22)
|
||||
_G.DetailsBubble:FlipHorizontal()
|
||||
_G.DetailsBubble:SetBubbleText (Loc ["STRING_ADDS_HELP"])
|
||||
_G.DetailsBubble:ShowBubble()
|
||||
end
|
||||
mouseOver_adds_frame.imagem:SetTexCoord (0.7734375, 0.99609375, 0.03125, 0.3671875)
|
||||
end)
|
||||
mouseOver_adds_frame:SetScript ("OnLeave",
|
||||
@@ -1305,16 +1356,16 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
--container_adds_window:SetBackdropColor (0, 0, 0, 0.1)
|
||||
|
||||
container_adds_frame:SetAllPoints (container_adds_window)
|
||||
container_adds_frame:SetWidth (170)
|
||||
container_adds_frame:SetWidth (175)
|
||||
container_adds_frame:SetHeight (67)
|
||||
container_adds_frame:EnableMouse (true)
|
||||
container_adds_frame:SetResizable (false)
|
||||
container_adds_frame:SetMovable (true)
|
||||
|
||||
container_adds_window:SetWidth (170)
|
||||
container_adds_window:SetWidth (175)
|
||||
container_adds_window:SetHeight (65)
|
||||
container_adds_window:SetScrollChild (container_adds_frame)
|
||||
container_adds_window:SetPoint ("TOPLEFT", frame, "TOPLEFT", 260, -113)
|
||||
container_adds_window:SetPoint ("TOPLEFT", frame, "TOPLEFT", 255, -113)
|
||||
|
||||
DetailsFrameWork:NewLabel (container_adds_window, container_adds_window, nil, "titulo", Loc ["STRING_ADDS"], "QuestFont_Large", 16, {1, 1, 1})
|
||||
container_adds_window.titulo:SetPoint ("bottomleft", container_adds_window, "topleft", 0, 4)
|
||||
@@ -1355,10 +1406,11 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
|
||||
mouseOver_interrupt_frame:SetScript ("OnEnter",
|
||||
function()
|
||||
_G.DetailsBubble:SetOwner (mouseOver_interrupt_frame.imagem, nil, nil, 40, -18)
|
||||
--_G.DetailsBubble:FlipHorizontal()
|
||||
_G.DetailsBubble:SetBubbleText (Loc ["STRING_INTERRIPT_HELP"])
|
||||
_G.DetailsBubble:ShowBubble()
|
||||
if (EncounterDetails.db.opened < 30) then
|
||||
_G.DetailsBubble:SetOwner (mouseOver_interrupt_frame.imagem, nil, nil, 40, -18)
|
||||
_G.DetailsBubble:SetBubbleText (Loc ["STRING_INTERRIPT_HELP"])
|
||||
_G.DetailsBubble:ShowBubble()
|
||||
end
|
||||
mouseOver_interrupt_frame.imagem:SetTexCoord (0.6015625, 1, 0.4296875, 0.6953125)
|
||||
end)
|
||||
mouseOver_interrupt_frame:SetScript ("OnLeave",
|
||||
@@ -1374,29 +1426,22 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
|
||||
container_interrupt_frame.barras = {}
|
||||
|
||||
--container_interrupt_window:SetBackdrop({edgeFile = "Interface\\DialogFrame\\UI-DialogBox-gold-Border", tile = true, tileSize = 16, edgeSize = 5, insets = {left = 1, right = 1, top = 0, bottom = 1},})
|
||||
--container_interrupt_window:SetBackdropBorderColor (0,0,0,0)
|
||||
|
||||
--container_interrupt_window:SetBackdrop (gump_fundo_backdrop)
|
||||
--container_interrupt_window:SetBackdropBorderColor (1, 1, 1, 1)
|
||||
--container_interrupt_window:SetBackdropColor (0, 0, 0, 0.1)
|
||||
|
||||
container_interrupt_frame:SetAllPoints (container_interrupt_window)
|
||||
container_interrupt_frame:SetWidth (170)
|
||||
container_interrupt_frame:SetWidth (185)
|
||||
container_interrupt_frame:SetHeight (67)
|
||||
container_interrupt_frame:EnableMouse (true)
|
||||
container_interrupt_frame:SetResizable (false)
|
||||
container_interrupt_frame:SetMovable (true)
|
||||
|
||||
container_interrupt_window:SetWidth (170)
|
||||
container_interrupt_window:SetWidth (185)
|
||||
container_interrupt_window:SetHeight (65)
|
||||
container_interrupt_window:SetScrollChild (container_interrupt_frame)
|
||||
container_interrupt_window:SetPoint ("TOPLEFT", frame, "TOPLEFT", 480, -113)
|
||||
container_interrupt_window:SetPoint ("TOPLEFT", frame, "TOPLEFT", 470, -113)
|
||||
|
||||
DetailsFrameWork:NewLabel (container_interrupt_window, container_interrupt_window, nil, "titulo", Loc ["STRING_INTERRUPTS"], "QuestFont_Large", 16, {1, 1, 1})
|
||||
container_interrupt_window.titulo:SetPoint ("bottomleft", container_interrupt_window, "topleft", 0, 4)
|
||||
|
||||
DetailsFrameWork:NewScrollBar (container_interrupt_window, container_interrupt_frame, 4, -13)
|
||||
DetailsFrameWork:NewScrollBar (container_interrupt_window, container_interrupt_frame, -1, -13)
|
||||
container_interrupt_window.slider:Altura (45)
|
||||
container_interrupt_window.slider:cimaPoint (0, 1)
|
||||
container_interrupt_window.slider:baixoPoint (0, -1)
|
||||
@@ -1432,10 +1477,12 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
|
||||
mouseOver_dispell_frame:SetScript ("OnEnter",
|
||||
function()
|
||||
_G.DetailsBubble:SetOwner (mouseOver_dispell_frame.imagem, nil, nil, -45, -22)
|
||||
_G.DetailsBubble:FlipHorizontal()
|
||||
_G.DetailsBubble:SetBubbleText (Loc ["STRING_DISPELL_HELP"])
|
||||
_G.DetailsBubble:ShowBubble()
|
||||
if (EncounterDetails.db.opened < 30) then
|
||||
_G.DetailsBubble:SetOwner (mouseOver_dispell_frame.imagem, nil, nil, -45, -22)
|
||||
_G.DetailsBubble:FlipHorizontal()
|
||||
_G.DetailsBubble:SetBubbleText (Loc ["STRING_DISPELL_HELP"])
|
||||
_G.DetailsBubble:ShowBubble()
|
||||
end
|
||||
mouseOver_dispell_frame.imagem:SetTexCoord (0.1796875, 0.3359375, 0.4140625, 0.71875)
|
||||
end)
|
||||
mouseOver_dispell_frame:SetScript ("OnLeave",
|
||||
@@ -1451,29 +1498,22 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
|
||||
container_dispell_frame.barras = {}
|
||||
|
||||
--container_dispell_window:SetBackdrop (backdrop)
|
||||
--container_dispell_window:SetBackdropBorderColor (0,0,0,0)
|
||||
|
||||
--container_dispell_window:SetBackdrop (gump_fundo_backdrop)
|
||||
--container_dispell_window:SetBackdropBorderColor (1, 1, 1, 1)
|
||||
--container_dispell_window:SetBackdropColor (0, 0, 0, 0.1)
|
||||
|
||||
container_dispell_frame:SetAllPoints (container_dispell_window)
|
||||
container_dispell_frame:SetWidth (170)
|
||||
container_dispell_frame:SetWidth (190)
|
||||
container_dispell_frame:SetHeight (62)
|
||||
container_dispell_frame:EnableMouse (true)
|
||||
container_dispell_frame:SetResizable (false)
|
||||
container_dispell_frame:SetMovable (true)
|
||||
|
||||
container_dispell_window:SetWidth (170)
|
||||
container_dispell_window:SetWidth (190)
|
||||
container_dispell_window:SetHeight (68)
|
||||
container_dispell_window:SetScrollChild (container_dispell_frame)
|
||||
container_dispell_window:SetPoint ("TOPLEFT", frame, "TOPLEFT", 260, -231)
|
||||
container_dispell_window:SetPoint ("TOPLEFT", frame, "TOPLEFT", 245, -231)
|
||||
|
||||
DetailsFrameWork:NewLabel (container_dispell_window, container_dispell_window, nil, "titulo", Loc ["STRING_DISPELLS"], "QuestFont_Large", 16, {1, 1, 1})
|
||||
container_dispell_window.titulo:SetPoint ("bottomleft", container_dispell_window, "topleft", 0, 4)
|
||||
|
||||
DetailsFrameWork:NewScrollBar (container_dispell_window, container_dispell_frame, 4, -13)
|
||||
DetailsFrameWork:NewScrollBar (container_dispell_window, container_dispell_frame, -1, -13)
|
||||
container_dispell_window.slider:Altura (45)
|
||||
container_dispell_window.slider:cimaPoint (0, 1)
|
||||
container_dispell_window.slider:baixoPoint (0, -1)
|
||||
@@ -1483,8 +1523,7 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
container_dispell_frame.window = container_dispell_window
|
||||
container_dispell_window.ultimo = 0
|
||||
frame.overall_dispell = container_dispell_window
|
||||
|
||||
|
||||
|
||||
--> Caixa das mortes
|
||||
|
||||
local container_dead_window = CreateFrame ("ScrollFrame", "Details_Boss_ContainerDead", frame)
|
||||
@@ -1510,10 +1549,11 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
|
||||
mouseOver_dead_frame:SetScript ("OnEnter",
|
||||
function()
|
||||
_G.DetailsBubble:SetOwner (mouseOver_dead_frame.imagem, nil, nil, 40, -18)
|
||||
--_G.DetailsBubble:FlipHorizontal()
|
||||
_G.DetailsBubble:SetBubbleText (Loc ["STRING_DEATHS_HELP"])
|
||||
_G.DetailsBubble:ShowBubble()
|
||||
if (EncounterDetails.db.opened < 30) then
|
||||
_G.DetailsBubble:SetOwner (mouseOver_dead_frame.imagem, nil, nil, 40, -18)
|
||||
_G.DetailsBubble:SetBubbleText (Loc ["STRING_DEATHS_HELP"])
|
||||
_G.DetailsBubble:ShowBubble()
|
||||
end
|
||||
mouseOver_dead_frame.imagem:SetTexCoord (0.171875, 0.3359375, 0.03125, 0.34375)
|
||||
end)
|
||||
mouseOver_dead_frame:SetScript ("OnLeave",
|
||||
@@ -1528,31 +1568,23 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
|
||||
mouseOver_dead_frame:SetScript ("OnMouseUp", mouse_up)
|
||||
|
||||
container_dead_frame.barras = {}
|
||||
|
||||
--container_dead_window:SetBackdrop({edgeFile = "Interface\\DialogFrame\\UI-DialogBox-gold-Border", tile = true, tileSize = 16, edgeSize = 5, insets = {left = 1, right = 1, top = 0, bottom = 1},})
|
||||
--container_dead_window:SetBackdropBorderColor (0,0,0,0)
|
||||
|
||||
--container_dead_window:SetBackdrop (gump_fundo_backdrop)
|
||||
--container_dead_window:SetBackdropBorderColor (1, 1, 1, 1)
|
||||
--container_dead_window:SetBackdropColor (0, 0, 0, 0.1)
|
||||
|
||||
--container_dead_frame:SetAllPoints (container_dead_window)
|
||||
|
||||
container_dead_frame:SetPoint ("left", container_dead_window, "left")
|
||||
container_dead_frame:SetPoint ("right", container_dead_window, "right")
|
||||
container_dead_frame:SetPoint ("top", container_dead_window, "top")
|
||||
container_dead_frame:SetPoint ("bottom", container_dead_window, "bottom", 0, 10)
|
||||
|
||||
container_dead_frame:SetWidth (170)
|
||||
container_dead_frame:SetWidth (178)
|
||||
container_dead_frame:SetHeight (60)
|
||||
|
||||
container_dead_frame:EnableMouse (true)
|
||||
container_dead_frame:SetResizable (false)
|
||||
container_dead_frame:SetMovable (true)
|
||||
|
||||
container_dead_window:SetWidth (170)
|
||||
container_dead_window:SetWidth (178)
|
||||
container_dead_window:SetHeight (70)
|
||||
container_dead_window:SetScrollChild (container_dead_frame)
|
||||
container_dead_window:SetPoint ("TOPLEFT", frame, "TOPLEFT", 480, -235)
|
||||
container_dead_window:SetPoint ("TOPLEFT", frame, "TOPLEFT", 472, -235)
|
||||
|
||||
DetailsFrameWork:NewLabel (container_dead_window, container_dead_window, nil, "titulo", Loc ["STRING_DEATH_LOG"], "QuestFont_Large", 16, {1, 1, 1})
|
||||
container_dead_window.titulo:SetPoint ("bottomleft", container_dead_window, "topleft", 0, 3)
|
||||
|
||||
@@ -20,8 +20,8 @@ local siege_of_orgrimmar = {
|
||||
icon = "Interface\\AddOns\\Details_RaidInfo-SiegeOfOrgrimmar\\images\\icon256x128",
|
||||
|
||||
is_raid = true,
|
||||
|
||||
background = "Interface\\AddOns\\Details_RaidInfo-SiegeOfOrgrimmar\\images\\wallpaper",
|
||||
|
||||
backgroundFile = {file = [[Interface\Glues\LOADINGSCREENS\LoadScreenSiegeOfOrgrimmar]], coords = {0, 1, 256/1024, 840/1024}},
|
||||
backgroundEJ = [[Interface\EncounterJournal\UI-EJ-LOREBG-SiegeofOrgrimmar]],
|
||||
|
||||
boss_names = {
|
||||
|
||||
Binary file not shown.
@@ -21,7 +21,7 @@ local throne_of_thunder = {
|
||||
|
||||
is_raid = true,
|
||||
|
||||
background = "Interface\\AddOns\\Details_RaidInfo-ThroneOfThunder\\images\\raid_tot",
|
||||
backgroundFile = {file = [[Interface\Glues\LOADINGSCREENS\LoadscreenThunderkingRaid]], coords = {0, 1, 256/1024, 840/1024}},
|
||||
backgroundEJ = [[Interface\EncounterJournal\UI-EJ-LOREBG-ThunderKingRaid]],
|
||||
|
||||
boss_names = {
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,15 +0,0 @@
|
||||
## Interface: 50400
|
||||
## Title: Details Spells (plugin)
|
||||
## Notes: Plugin for Details
|
||||
## SavedVariablesPerCharacter: _detalhes_databaseSpellDetails
|
||||
## RequiredDeps: Details
|
||||
## OptionalDeps: Ace3
|
||||
|
||||
#@no-lib-strip@
|
||||
embeds.xml
|
||||
#@end-no-lib-strip@
|
||||
|
||||
enUS.lua
|
||||
ptBR.lua
|
||||
|
||||
Details_SpellDetails.lua
|
||||
@@ -1,137 +0,0 @@
|
||||
--- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings.
|
||||
-- @class file
|
||||
-- @name AceLocale-3.0
|
||||
-- @release $Id: AceLocale-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $
|
||||
local MAJOR,MINOR = "AceLocale-3.0", 6
|
||||
|
||||
local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
||||
|
||||
if not AceLocale then return end -- no upgrade needed
|
||||
|
||||
-- Lua APIs
|
||||
local assert, tostring, error = assert, tostring, error
|
||||
local getmetatable, setmetatable, rawset, rawget = getmetatable, setmetatable, rawset, rawget
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: GAME_LOCALE, geterrorhandler
|
||||
|
||||
local gameLocale = GetLocale()
|
||||
if gameLocale == "enGB" then
|
||||
gameLocale = "enUS"
|
||||
end
|
||||
|
||||
AceLocale.apps = AceLocale.apps or {} -- array of ["AppName"]=localetableref
|
||||
AceLocale.appnames = AceLocale.appnames or {} -- array of [localetableref]="AppName"
|
||||
|
||||
-- This metatable is used on all tables returned from GetLocale
|
||||
local readmeta = {
|
||||
__index = function(self, key) -- requesting totally unknown entries: fire off a nonbreaking error and return key
|
||||
rawset(self, key, key) -- only need to see the warning once, really
|
||||
geterrorhandler()(MAJOR..": "..tostring(AceLocale.appnames[self])..": Missing entry for '"..tostring(key).."'")
|
||||
return key
|
||||
end
|
||||
}
|
||||
|
||||
-- This metatable is used on all tables returned from GetLocale if the silent flag is true, it does not issue a warning on unknown keys
|
||||
local readmetasilent = {
|
||||
__index = function(self, key) -- requesting totally unknown entries: return key
|
||||
rawset(self, key, key) -- only need to invoke this function once
|
||||
return key
|
||||
end
|
||||
}
|
||||
|
||||
-- Remember the locale table being registered right now (it gets set by :NewLocale())
|
||||
-- NOTE: Do never try to register 2 locale tables at once and mix their definition.
|
||||
local registering
|
||||
|
||||
-- local assert false function
|
||||
local assertfalse = function() assert(false) end
|
||||
|
||||
-- This metatable proxy is used when registering nondefault locales
|
||||
local writeproxy = setmetatable({}, {
|
||||
__newindex = function(self, key, value)
|
||||
rawset(registering, key, value == true and key or value) -- assigning values: replace 'true' with key string
|
||||
end,
|
||||
__index = assertfalse
|
||||
})
|
||||
|
||||
-- This metatable proxy is used when registering the default locale.
|
||||
-- It refuses to overwrite existing values
|
||||
-- Reason 1: Allows loading locales in any order
|
||||
-- Reason 2: If 2 modules have the same string, but only the first one to be
|
||||
-- loaded has a translation for the current locale, the translation
|
||||
-- doesn't get overwritten.
|
||||
--
|
||||
local writedefaultproxy = setmetatable({}, {
|
||||
__newindex = function(self, key, value)
|
||||
if not rawget(registering, key) then
|
||||
rawset(registering, key, value == true and key or value)
|
||||
end
|
||||
end,
|
||||
__index = assertfalse
|
||||
})
|
||||
|
||||
--- Register a new locale (or extend an existing one) for the specified application.
|
||||
-- :NewLocale will return a table you can fill your locale into, or nil if the locale isn't needed for the players
|
||||
-- game locale.
|
||||
-- @paramsig application, locale[, isDefault[, silent]]
|
||||
-- @param application Unique name of addon / module
|
||||
-- @param locale Name of the locale to register, e.g. "enUS", "deDE", etc.
|
||||
-- @param isDefault If this is the default locale being registered (your addon is written in this language, generally enUS)
|
||||
-- @param silent If true, the locale will not issue warnings for missing keys. Must be set on the first locale registered. If set to "raw", nils will be returned for unknown keys (no metatable used).
|
||||
-- @usage
|
||||
-- -- enUS.lua
|
||||
-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "enUS", true)
|
||||
-- L["string1"] = true
|
||||
--
|
||||
-- -- deDE.lua
|
||||
-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "deDE")
|
||||
-- if not L then return end
|
||||
-- L["string1"] = "Zeichenkette1"
|
||||
-- @return Locale Table to add localizations to, or nil if the current locale is not required.
|
||||
function AceLocale:NewLocale(application, locale, isDefault, silent)
|
||||
|
||||
-- GAME_LOCALE allows translators to test translations of addons without having that wow client installed
|
||||
local gameLocale = GAME_LOCALE or gameLocale
|
||||
|
||||
local app = AceLocale.apps[application]
|
||||
|
||||
if silent and app and getmetatable(app) ~= readmetasilent then
|
||||
geterrorhandler()("Usage: NewLocale(application, locale[, isDefault[, silent]]): 'silent' must be specified for the first locale registered")
|
||||
end
|
||||
|
||||
if not app then
|
||||
if silent=="raw" then
|
||||
app = {}
|
||||
else
|
||||
app = setmetatable({}, silent and readmetasilent or readmeta)
|
||||
end
|
||||
AceLocale.apps[application] = app
|
||||
AceLocale.appnames[app] = application
|
||||
end
|
||||
|
||||
if locale ~= gameLocale and not isDefault then
|
||||
return -- nop, we don't need these translations
|
||||
end
|
||||
|
||||
registering = app -- remember globally for writeproxy and writedefaultproxy
|
||||
|
||||
if isDefault then
|
||||
return writedefaultproxy
|
||||
end
|
||||
|
||||
return writeproxy
|
||||
end
|
||||
|
||||
--- Returns localizations for the current locale (or default locale if translations are missing).
|
||||
-- Errors if nothing is registered (spank developer, not just a missing translation)
|
||||
-- @param application Unique name of addon / module
|
||||
-- @param silent If true, the locale is optional, silently return nil if it's not found (defaults to false, optional)
|
||||
-- @return The locale table for the current language.
|
||||
function AceLocale:GetLocale(application, silent)
|
||||
if not silent and not AceLocale.apps[application] then
|
||||
error("Usage: GetLocale(application[, silent]): 'application' - No locales registered for '"..tostring(application).."'", 2)
|
||||
end
|
||||
return AceLocale.apps[application]
|
||||
end
|
||||
@@ -1,4 +0,0 @@
|
||||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
|
||||
..\FrameXML\UI.xsd">
|
||||
<Script file="AceLocale-3.0.lua"/>
|
||||
</Ui>
|
||||
@@ -1,51 +0,0 @@
|
||||
-- $Id: LibStub.lua 76 2007-09-03 01:50:17Z mikk $
|
||||
-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
|
||||
-- LibStub is hereby placed in the Public Domain
|
||||
-- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
|
||||
local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
|
||||
local LibStub = _G[LIBSTUB_MAJOR]
|
||||
|
||||
-- Check to see is this version of the stub is obsolete
|
||||
if not LibStub or LibStub.minor < LIBSTUB_MINOR then
|
||||
LibStub = LibStub or {libs = {}, minors = {} }
|
||||
_G[LIBSTUB_MAJOR] = LibStub
|
||||
LibStub.minor = LIBSTUB_MINOR
|
||||
|
||||
-- LibStub:NewLibrary(major, minor)
|
||||
-- major (string) - the major version of the library
|
||||
-- minor (string or number ) - the minor version of the library
|
||||
--
|
||||
-- returns nil if a newer or same version of the lib is already present
|
||||
-- returns empty library object or old library object if upgrade is needed
|
||||
function LibStub:NewLibrary(major, minor)
|
||||
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
|
||||
minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
|
||||
|
||||
local oldminor = self.minors[major]
|
||||
if oldminor and oldminor >= minor then return nil end
|
||||
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
|
||||
return self.libs[major], oldminor
|
||||
end
|
||||
|
||||
-- LibStub:GetLibrary(major, [silent])
|
||||
-- major (string) - the major version of the library
|
||||
-- silent (boolean) - if true, library is optional, silently return nil if its not found
|
||||
--
|
||||
-- throws an error if the library can not be found (except silent is set)
|
||||
-- returns the library object if found
|
||||
function LibStub:GetLibrary(major, silent)
|
||||
if not self.libs[major] and not silent then
|
||||
error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
|
||||
end
|
||||
return self.libs[major], self.minors[major]
|
||||
end
|
||||
|
||||
-- LibStub:IterateLibraries()
|
||||
--
|
||||
-- Returns an iterator for the currently registered libraries
|
||||
function LibStub:IterateLibraries()
|
||||
return pairs(self.libs)
|
||||
end
|
||||
|
||||
setmetatable(LibStub, { __call = LibStub.GetLibrary })
|
||||
end
|
||||
@@ -1,13 +0,0 @@
|
||||
## Interface: 40200
|
||||
## Title: Lib: LibStub
|
||||
## Notes: Universal Library Stub
|
||||
## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel
|
||||
## X-Website: http://www.wowace.com/addons/libstub/
|
||||
## X-Category: Library
|
||||
## X-License: Public Domain
|
||||
## X-Curse-Packaged-Version: r95
|
||||
## X-Curse-Project-Name: LibStub
|
||||
## X-Curse-Project-ID: libstub
|
||||
## X-Curse-Repository-ID: wow/libstub/mainline
|
||||
|
||||
LibStub.lua
|
||||
@@ -1,41 +0,0 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
local lib, oldMinor = LibStub:NewLibrary("Pants", 1) -- make a new thingy
|
||||
assert(lib) -- should return the library table
|
||||
assert(not oldMinor) -- should not return the old minor, since it didn't exist
|
||||
|
||||
-- the following is to create data and then be able to check if the same data exists after the fact
|
||||
function lib:MyMethod()
|
||||
end
|
||||
local MyMethod = lib.MyMethod
|
||||
lib.MyTable = {}
|
||||
local MyTable = lib.MyTable
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 1) -- try to register a library with the same version, should silently fail
|
||||
assert(not newLib) -- should not return since out of date
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 0) -- try to register a library with a previous, should silently fail
|
||||
assert(not newLib) -- should not return since out of date
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 2) -- register a new version
|
||||
assert(newLib) -- library table
|
||||
assert(rawequal(newLib, lib)) -- should be the same reference as the previous
|
||||
assert(newOldMinor == 1) -- should return the minor version of the previous version
|
||||
|
||||
assert(rawequal(lib.MyMethod, MyMethod)) -- verify that values were saved
|
||||
assert(rawequal(lib.MyTable, MyTable)) -- verify that values were saved
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 3 Blah") -- register a new version with a string minor version (instead of a number)
|
||||
assert(newLib) -- library table
|
||||
assert(newOldMinor == 2) -- previous version was 2
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 4 and please ignore 15 Blah") -- register a new version with a string minor version (instead of a number)
|
||||
assert(newLib)
|
||||
assert(newOldMinor == 3) -- previous version was 3 (even though it gave a string)
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 5) -- register a new library, using a normal number instead of a string
|
||||
assert(newLib)
|
||||
assert(newOldMinor == 4) -- previous version was 4 (even though it gave a string)
|
||||
@@ -1,27 +0,0 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
for major, library in LibStub:IterateLibraries() do
|
||||
-- check that MyLib doesn't exist yet, by iterating through all the libraries
|
||||
assert(major ~= "MyLib")
|
||||
end
|
||||
|
||||
assert(not LibStub:GetLibrary("MyLib", true)) -- check that MyLib doesn't exist yet by direct checking
|
||||
assert(not pcall(LibStub.GetLibrary, LibStub, "MyLib")) -- don't silently fail, thus it should raise an error.
|
||||
local lib = LibStub:NewLibrary("MyLib", 1) -- create the lib
|
||||
assert(lib) -- check it exists
|
||||
assert(rawequal(LibStub:GetLibrary("MyLib"), lib)) -- verify that :GetLibrary("MyLib") properly equals the lib reference
|
||||
|
||||
assert(LibStub:NewLibrary("MyLib", 2)) -- create a new version
|
||||
|
||||
local count=0
|
||||
for major, library in LibStub:IterateLibraries() do
|
||||
-- check that MyLib exists somewhere in the libraries, by iterating through all the libraries
|
||||
if major == "MyLib" then -- we found it!
|
||||
count = count +1
|
||||
assert(rawequal(library, lib)) -- verify that the references are equal
|
||||
end
|
||||
end
|
||||
assert(count == 1) -- verify that we actually found it, and only once
|
||||
@@ -1,14 +0,0 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
local proxy = newproxy() -- non-string
|
||||
|
||||
assert(not pcall(LibStub.NewLibrary, LibStub, proxy, 1)) -- should error, proxy is not a string, it's userdata
|
||||
local success, ret = pcall(LibStub.GetLibrary, proxy, true)
|
||||
assert(not success or not ret) -- either error because proxy is not a string or because it's not actually registered.
|
||||
|
||||
assert(not pcall(LibStub.NewLibrary, LibStub, "Something", "No number in here")) -- should error, minor has no string in it.
|
||||
|
||||
assert(not LibStub:GetLibrary("Something", true)) -- shouldn't've created it from the above statement
|
||||
@@ -1,41 +0,0 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
|
||||
-- Pretend like loaded libstub is old and doesn't have :IterateLibraries
|
||||
assert(LibStub.minor)
|
||||
LibStub.minor = LibStub.minor - 0.0001
|
||||
LibStub.IterateLibraries = nil
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(type(LibStub.IterateLibraries)=="function")
|
||||
|
||||
|
||||
-- Now pretend that we're the same version -- :IterateLibraries should NOT be re-created
|
||||
LibStub.IterateLibraries = 123
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
-- Now pretend that a newer version is loaded -- :IterateLibraries should NOT be re-created
|
||||
LibStub.minor = LibStub.minor + 0.0001
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
-- Again with a huge number
|
||||
LibStub.minor = LibStub.minor + 1234567890
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
print("OK")
|
||||
@@ -1,6 +0,0 @@
|
||||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
|
||||
..\FrameXML\UI.xsd">
|
||||
|
||||
<Script file="Libs\LibStub\LibStub.lua"/>
|
||||
<Include file="Libs\AceLocale-3.0\AceLocale-3.0.xml" />
|
||||
</Ui>
|
||||
@@ -1,20 +0,0 @@
|
||||
local Loc = LibStub("AceLocale-3.0"):NewLocale("Details_SpellDetails", "enUS", true)
|
||||
|
||||
if (not Loc) then
|
||||
return
|
||||
end
|
||||
|
||||
Loc ["PLUGIN_NAME"] = "Spell Details"
|
||||
Loc ["STRING_TOOSHORT"] = "Combat time was too short \n and the graph cannot be generated."
|
||||
|
||||
Loc ["STRING_DAMAGE"] = "DMG"
|
||||
Loc ["STRING_DPS"] = "DPS"
|
||||
Loc ["STRING_TEMPO"] = "TIME"
|
||||
Loc ["STRING_PERCENT"] = "Percent"
|
||||
Loc ["STRING_UPTIME"] = "Uptime"
|
||||
Loc ["STRING_CRIT"] = "Critical"
|
||||
Loc ["STRING_MISS"] = "Miss"
|
||||
Loc ["STRING_BLOCKED"] = "Blocked"
|
||||
Loc ["STRING_GLANCING"] = "Glancing"
|
||||
Loc ["STRING_DEBUFFNAME"] = "insert buff name"
|
||||
Loc ["STRING_INCOMBAT"] = "You are in combat"
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 512 KiB |
@@ -1,21 +0,0 @@
|
||||
local Loc = LibStub("AceLocale-3.0"):NewLocale("Details_SpellDetails", "ptBR")
|
||||
|
||||
if (not Loc) then
|
||||
return
|
||||
end
|
||||
|
||||
Loc ["PLUGIN_NAME"] = "Detalhes das Magias"
|
||||
Loc ["STRING_TOOSHORT"] = "O tempo do combat foi curto\n e o grafico nao pode ser gerado."
|
||||
|
||||
Loc ["STRING_DAMAGE"] = "Dano"
|
||||
Loc ["STRING_DPS"] = "Dps"
|
||||
Loc ["STRING_TEMPO"] = "Tempo"
|
||||
Loc ["STRING_PERCENT"] = "Porcentagem"
|
||||
Loc ["STRING_UPTIME"] = "Ativo"
|
||||
Loc ["STRING_CRIT"] = "Critico"
|
||||
Loc ["STRING_MISS"] = "Erros"
|
||||
Loc ["STRING_BLOCKED"] = "Bloqueios"
|
||||
|
||||
Loc ["STRING_GLANCING"] = "Golpes Fracos"
|
||||
Loc ["STRING_DEBUFFNAME"] = "insira o nome do buff"
|
||||
Loc ["STRING_INCOMBAT"] = "Voce esta em combate"
|
||||
Reference in New Issue
Block a user