- Encounter Details (plugin): added a report button on Emotes tab.

- Encounter Details (plugin): improved Weakauras creation.
- Encounter Details (plugin): fixed the report text for interrupts and dispells.
- Truncated left text on bars now shows the entire text when hover over the bar.
- Added an extra option on minimap menu to disable the minimap icon.
- Fixed a problem when disabling the minimap icon through options panel.
- Fixed an issue with item level tracker feature.
This commit is contained in:
Tercio
2015-04-02 12:04:41 -03:00
parent bbf87488f1
commit fd74008fac
9 changed files with 213 additions and 51 deletions
+14 -5
View File
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -510,6 +510,7 @@ end
_detalhes.ilevel = {}
local ilvl_core = _detalhes:CreateEventListener()
ilvl_core.amt_inspecting = 0
ilvl_core:RegisterEvent ("GROUP_ONENTER", "OnEnter")
ilvl_core:RegisterEvent ("GROUP_ONLEAVE", "OnLeave")
@@ -529,7 +530,7 @@ local two_hand = {
local MAX_INSPECT_AMOUNT = 1
local MIN_ILEVEL_TO_STORE = 580
local LOOP_TIME = 3
local LOOP_TIME = 7
function _detalhes:IlvlFromNetwork (player, realm, core, ilvl)
local guid = UnitGUID (player .. "-" .. realm)
+24 -17
View File
@@ -1470,7 +1470,7 @@
feedback_frame:SetSize (512, 200)
feedback_frame.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-GNOME]])
feedback_frame.TitleText:SetText ("Details! Need Your Help!")
feedback_frame.TitleText:SetText ("Help Details! to Improve!")
feedback_frame.uppertext = feedback_frame:CreateFontString (nil, "artwork", "GameFontNormal")
feedback_frame.uppertext:SetText ("Tell us about your experience using Details!, what you liked most, where we could improve, what things you want to see in the future?")
@@ -2250,29 +2250,18 @@
--GameCooltip:SetBannerText (1, "Mini Map Menu", {"left", "right", 2, -5}, "white", 10)
--> reset
GameCooltip:AddMenu (1, _detalhes.tabela_historico.resetar, true, nil, nil, Loc ["STRING_MINIMAPMENU_RESET"], nil, true)
GameCooltip:AddMenu (1, _detalhes.tabela_historico.resetar, true, nil, nil, Loc ["STRING_ERASE_DATA"], nil, true)
GameCooltip:AddIcon ([[Interface\COMMON\VOICECHAT-MUTED]], 1, 1, 14, 14)
GameCooltip:AddLine ("$div")
--> nova instancai
--> nova instancia
GameCooltip:AddMenu (1, _detalhes.CriarInstancia, true, nil, nil, Loc ["STRING_MINIMAPMENU_NEWWINDOW"], nil, true)
GameCooltip:AddIcon ([[Interface\ICONS\Spell_ChargePositive]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125)
--> reopen window 64: 0.0078125
local reopen = function()
for _, instance in ipairs (_detalhes.tabela_instancias) do
if (not instance:IsAtiva()) then
_detalhes:CriarInstancia (instance.meu_id)
return
end
end
end
GameCooltip:AddMenu (1, reopen, nil, nil, nil, Loc ["STRING_MINIMAPMENU_REOPEN"], nil, true)
GameCooltip:AddIcon ([[Interface\ICONS\Ability_Priest_VoidShift]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125)
GameCooltip:AddIcon ([[Interface\Buttons\UI-AttributeButton-Encourage-Up]], 1, 1, 16, 16)
--> reopen all windows
GameCooltip:AddMenu (1, _detalhes.ReabrirTodasInstancias, true, nil, nil, Loc ["STRING_MINIMAPMENU_REOPENALL"], nil, true)
GameCooltip:AddIcon ([[Interface\ICONS\Ability_Priest_VoidShift]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125, "#ffb400")
GameCooltip:AddIcon ([[Interface\Buttons\UI-MicroStream-Green]], 1, 1, 14, 14, 0.1875, 0.8125, 0.84375, 0.15625)
GameCooltip:AddLine ("$div")
@@ -2283,6 +2272,24 @@
GameCooltip:AddMenu (1, _detalhes.DestravarInstancias, true, nil, nil, Loc ["STRING_MINIMAPMENU_UNLOCK"], nil, true)
GameCooltip:AddIcon ([[Interface\PetBattles\PetBattle-LockIcon]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125, "gray")
GameCooltip:AddLine ("$div")
--> disable minimap icon
local disable_minimap = function()
_detalhes.minimap.hide = not value
LDBIcon:Refresh ("Details", _detalhes.minimap)
if (_detalhes.minimap.hide) then
LDBIcon:Hide ("Details")
else
LDBIcon:Show ("Details")
end
end
GameCooltip:AddMenu (1, disable_minimap, true, nil, nil, Loc ["STRING_MINIMAPMENU_HIDEICON"], nil, true)
GameCooltip:AddIcon ([[Interface\Buttons\UI-Panel-HideButton-Disabled]], 1, 1, 14, 14, 7/32, 24/32, 8/32, 24/32, "gray")
--
GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, backgroundColor, _detalhes.tooltip_border_color)
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0.64453125, 0}, {.8, .8, .8, 0.2}, true)
+63 -15
View File
@@ -195,6 +195,7 @@
["unit"] = "",
["spellIds"] = {},
["debuffType"] = "HARMFUL",
["names"] = {""},
},
}
local buff_prototype = {
@@ -204,6 +205,7 @@
["unit"] = "",
["spellIds"] = {},
["debuffType"] = "HELPFUL",
["names"] = {""},
},
}
local cast_prototype = {
@@ -247,7 +249,7 @@
},
}
function _detalhes:CreateWeakAura (spellid, name, icon_texture, target, stacksize, sound, chat)
function _detalhes:CreateWeakAura (spellid, use_spellid, spellname, name, icon_texture, target, stacksize, sound, chat)
if (not WeakAuras or not WeakAurasSaved) then
return
@@ -268,6 +270,7 @@
local add = _detalhes.table.copy ({}, debuff_prototype)
add.trigger.spellId = tostring (spellid)
add.trigger.spellIds[1] = spellid
add.trigger.names [1] = spellname
add.trigger.unit = "player"
_detalhes.table.deploy (icon, add)
@@ -275,6 +278,7 @@
local add = _detalhes.table.copy ({}, debuff_prototype)
add.trigger.spellId = tostring (spellid)
add.trigger.spellIds[1] = spellid
add.trigger.names[1] = spellname
add.trigger.unit = "target"
_detalhes.table.deploy (icon, add)
@@ -282,6 +286,7 @@
local add = _detalhes.table.copy ({}, debuff_prototype)
add.trigger.spellId = tostring (spellid)
add.trigger.spellIds[1] = spellid
add.trigger.names[1] = spellname
add.trigger.unit = "focus"
_detalhes.table.deploy (icon, add)
@@ -289,6 +294,7 @@
local add = _detalhes.table.copy ({}, buff_prototype)
add.trigger.spellId = tostring (spellid)
add.trigger.spellIds[1] = spellid
add.trigger.names[1] = spellname
add.trigger.unit = "player"
_detalhes.table.deploy (icon, add)
@@ -296,6 +302,7 @@
local add = _detalhes.table.copy ({}, buff_prototype)
add.trigger.spellId = tostring (spellid)
add.trigger.spellIds[1] = spellid
add.trigger.names[1] = spellname
add.trigger.unit = "target"
_detalhes.table.deploy (icon, add)
@@ -303,24 +310,46 @@
local add = _detalhes.table.copy ({}, buff_prototype)
add.trigger.spellId = tostring (spellid)
add.trigger.spellIds[1] = spellid
add.trigger.names[1] = spellname
add.trigger.unit = "focus"
_detalhes.table.deploy (icon, add)
elseif (target == 21) then --Spell Cast Started
local add = _detalhes.table.copy ({}, cast_prototype)
add.trigger.spellId = tostring (spellid)
add.trigger.spellName = spellname
add.trigger.subeventSuffix = "_CAST_START"
if (not use_spellid) then
add.trigger.use_spellName = true
add.trigger.use_spellId = false
end
_detalhes.table.deploy (icon, add)
elseif (target == 22) then --Spell Cast Successful
local add = _detalhes.table.copy ({}, cast_prototype)
add.trigger.spellId = tostring (spellid)
add.trigger.spellName = spellname
if (not use_spellid) then
add.trigger.use_spellName = true
add.trigger.use_spellId = false
end
_detalhes.table.deploy (icon, add)
end
else
icon.trigger.spellId = tostring (spellid)
icon.trigger.name = spellname
tinsert (icon.trigger.spellIds, spellid)
end
if (not use_spellid) then
icon.trigger.use_spellId = false
icon.trigger.fullscan = false
icon.trigger.spellId = nil
icon.trigger.spellIds = {}
end
--print (use_spellid, icon.trigger.use_spellId, icon.trigger.fullscan)
if (stacksize and stacksize >= 1) then
stacksize = floor (stacksize)
@@ -369,7 +398,7 @@
if (not DetailsAuraPanel) then
local f = CreateFrame ("frame", "DetailsAuraPanel", UIParent, "ButtonFrameTemplate")
f:SetSize (300, 350)
f:SetSize (300, 378)
f:SetPoint ("center", UIParent, "center")
f:SetFrameStrata ("HIGH")
f:SetToplevel (true)
@@ -401,15 +430,26 @@
local fw = _detalhes:GetFramework()
--aura name
local name_label = fw:CreateLabel (f, "Name: ", nil, nil, "GameFontNormal")
local name_label = fw:CreateLabel (f, "Aura Name: ", nil, nil, "GameFontNormal")
local name_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraName", "$parentAuraName")
name_textentry:SetPoint ("left", name_label, "right", 2, 0)
f.name = name_textentry
--spellname
local spellname_label = fw:CreateLabel (f, "Spell Name: ", nil, nil, "GameFontNormal")
local spellname_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "SpellName", "$parentSpellName")
spellname_textentry:SetPoint ("left", spellname_label, "right", 2, 0)
f.spellname = spellname_textentry
--spellid
local auraid_label = fw:CreateLabel (f, "Spell Id: ", nil, nil, "GameFontNormal")
local auraid_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraSpellId", "$parentAuraSpellId")
auraid_textentry:Disable()
auraid_textentry:SetPoint ("left", auraid_label, "right", 2, 0)
--use spellid
local usespellid_label = fw:CreateLabel (f, "Use SpellId: ", nil, nil, "GameFontNormal")
local aura_use_spellid = fw:CreateSwitch (f, function(_, _, state) if (state) then auraid_textentry:Enable() else auraid_textentry:Disable() end end, false, nil, nil, nil, nil, "UseSpellId")
aura_use_spellid:SetPoint ("left", usespellid_label, "right", 2, 0)
aura_use_spellid.tooltip = "Use the spell id instead of the spell name, for advanced users."
--aura icon
local icon_label = fw:CreateLabel (f, "Icon: ", nil, nil, "GameFontNormal")
@@ -468,7 +508,7 @@
sound_effect:SetPoint ("left", sound_effect_label, "right", 2, 0)
--say something
local say_something_label = fw:CreateLabel (f, "Chat Message: ", nil, nil, "GameFontNormal")
local say_something_label = fw:CreateLabel (f, "/Say: ", nil, nil, "GameFontNormal")
local say_something = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "SaySomething", "$parentSaySomething")
say_something:SetPoint ("left", say_something_label, "right", 2, 0)
@@ -488,6 +528,8 @@
local create_func = function()
local name = f.AuraName.text
local spellname = f.SpellName.text
local use_spellId = f.UseSpellId.value
local spellid = f.AuraSpellId.text
local icon = f.IconButton.icon.texture
local target = f.AuraOnDropdown.value
@@ -497,7 +539,7 @@
local addon = f.AuraAddonDropdown.value
if (addon == "WA") then
_detalhes:CreateWeakAura (spellid, name, icon, target, stacksize, sound, chat)
_detalhes:CreateWeakAura (spellid, use_spellId, spellname, name, icon, target, stacksize, sound, chat)
else
_detalhes:Msg ("No Aura Addon selected. Addons currently supported: WeakAuras 2.")
end
@@ -518,22 +560,28 @@
local y_start = 21
name_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*1) + (50)) * -1)
auraid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*2) + (50)) * -1)
icon_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*3) + (50)) * -1)
aura_on_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*4) + (50)) * -1)
stack_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*5) + (50)) * -1)
sound_effect_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*6) + (50)) * -1)
say_something_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*7) + (50)) * -1)
aura_addon_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*10) + (50)) * -1)
spellname_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*2) + (60)) * -1)
auraid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*3) + (60)) * -1)
usespellid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*4) + (60)) * -1)
icon_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*5) + (70)) * -1)
aura_on_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*6) + (70)) * -1)
stack_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*7) + (70)) * -1)
sound_effect_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*8) + (70)) * -1)
say_something_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*9) + (70)) * -1)
aura_addon_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*11) + (60)) * -1)
create_button:SetPoint ("topleft", f, "topleft", x_start, ((y_start*12) + (50)) * -1)
cancel_button:SetPoint ("topright", f, "topright", x_start*-1, ((y_start*12) + (50)) * -1)
create_button:SetPoint ("topleft", f, "topleft", x_start, ((y_start*13) + (60)) * -1)
cancel_button:SetPoint ("topright", f, "topright", x_start*-1, ((y_start*13) + (60)) * -1)
end
DetailsAuraPanel.spellid = spellid
DetailsAuraPanel.name.text = spellname
DetailsAuraPanel.name.text = spellname .. " (d!)"
DetailsAuraPanel.spellname.text = spellname
DetailsAuraPanel.AuraSpellId.text = tostring (spellid)
DetailsAuraPanel.icon.texture = spellicon
+3 -3
View File
@@ -1680,11 +1680,11 @@ function window:CreateFrame19()
frame19.minimapSlider.OnSwitch = function (self, _, value)
_detalhes.minimap.hide = not value
LDBIcon:Refresh ("Details!", _detalhes.minimap)
LDBIcon:Refresh ("Details", _detalhes.minimap)
if (_detalhes.minimap.hide) then
LDBIcon:Hide ("Details!")
LDBIcon:Hide ("Details")
else
LDBIcon:Show ("Details!")
LDBIcon:Show ("Details")
end
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
+30 -7
View File
@@ -1809,10 +1809,30 @@ local barra_scripts_onenter = function (self)
self:SetBackdropColor (0.588, 0.588, 0.588, 0.7)
self.textura:SetBlendMode ("ADD")
--local r, g, b = self.textura:GetVertexColor()
--self.textura:SetVertexColor (math.min (r+0.1, 1), math.min (g+0.1, 1), math.min (b+0.1, 1))
--self.icone_classe:SetBlendMode ("ADD")
local lefttext = self.texto_esquerdo
if (lefttext:IsTruncated()) then
if (not _detalhes.left_anti_truncate) then
_detalhes.left_anti_truncate = CreateFrame ("frame", "DetailsLeftTextAntiTruncate", UIParent)
_detalhes.left_anti_truncate:SetBackdrop (gump_fundo_backdrop)
_detalhes.left_anti_truncate:SetBackdropColor (0, 0, 0, 0.8)
_detalhes.left_anti_truncate:SetFrameStrata ("FULLSCREEN")
_detalhes.left_anti_truncate.text = _detalhes.left_anti_truncate:CreateFontString (nil, "overlay", "GameFontNormal")
_detalhes.left_anti_truncate.text:SetPoint ("left", _detalhes.left_anti_truncate, "left", 3, 0)
end
_detalhes:SetFontSize (_detalhes.left_anti_truncate.text, self._instance.row_info.font_size)
_detalhes:SetFontFace (_detalhes.left_anti_truncate.text, self._instance.row_info.font_face_file)
_detalhes:SetFontColor (_detalhes.left_anti_truncate.text, lefttext:GetTextColor())
_detalhes.left_anti_truncate:SetPoint ("left", lefttext, "left", -3, 0)
_detalhes.left_anti_truncate.text:SetText (lefttext:GetText())
_detalhes.left_anti_truncate:SetSize (_detalhes.left_anti_truncate.text:GetStringWidth() + 3, self._instance.row_info.height)
_detalhes.left_anti_truncate:Show()
lefttext.untruncated = true
end
self:SetScript ("OnUpdate", shift_monitor)
end
@@ -1828,12 +1848,15 @@ local barra_scripts_onleave = function (self)
self:SetBackdropColor (0, 0, 0, 0)
self.textura:SetBlendMode ("BLEND")
--self.icone_classe:SetBlendMode ("BLEND")
--local r, g, b = self.textura:GetVertexColor()
--self.textura:SetVertexColor (math.min (r+0.1, 1), math.min (g+0.1, 1), math.min (b+0.1, 1))
self.showing_allspells = false
self:SetScript ("OnUpdate", nil)
local lefttext = self.texto_esquerdo
if (lefttext.untruncated) then
lefttext.untruncated = nil
_detalhes.left_anti_truncate:Hide()
end
end
local barra_scripts_onmousedown = function (self, button)
@@ -1442,7 +1442,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
if (not barra) then
barra = EncounterDetails:CreateRow (index, container, 3, 0, -6)
barra.TTT = "total_interrupt" -- tool tip type
barra.report_text = "Details! ".. Loc ["STRING_INTERRUPT_BY"]
barra.report_text = "Details! ".. Loc ["STRING_INTERRUPTS_OF"]
barra:SetBackdrop (backdrop_bar_onleave)
barra:SetBackdropColor (.0, .0, .0, 0.3)
barra:SetWidth (155)
@@ -1556,7 +1556,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
if (not barra) then
barra = EncounterDetails:CreateRow (index, container, 3, 3, -6)
barra.TTT = "dispell" -- tool tip type
barra.report_text = "Details! ".. Loc ["STRING_DISPELLED_BY"]
barra.report_text = "Details! ".. Loc ["STRING_DISPELLS_OF"]
barra:SetBackdrop (backdrop_bar_onleave)
barra:SetBackdropColor (.0, .0, .0, 0.3)
barra:SetWidth (160)
@@ -27,6 +27,8 @@ Loc ["STRING_INFLICTED_BY"] = "Damage inflicted by"
Loc ["STRING_INFLICTED"] = "Damage inflicted"
Loc ["STRING_ADDS"] = "Adds"
Loc ["STRING_INTERRUPTS"] = "Interrupts"
Loc ["STRING_INTERRUPTS_OF"] = "Interrupts of"
Loc ["STRING_DISPELLS_OF"] = "dispells of"
Loc ["STRING_DISPELLS"] = "Dispells"
Loc ["STRING_DEATH_LOG"] = "Death Log"
Loc ["STRING_FIGHT_SUMMARY"] = "Encounter Summary"
+73 -1
View File
@@ -1338,7 +1338,13 @@ do
emote_pool = emote_search_table
end
BossFrame.SearchResults:Show()
BossFrame.SearchResults:SetText ("Found " .. i .. " results")
BossFrame.SearchResults:SetText ("Found " .. i .. " matches")
if (i > 0) then
BossFrame.ReportEmoteButton:Enable()
elseif (i == 0) then
BossFrame.ReportEmoteButton:Disable()
end
else
BossFrame.SearchResults:Hide()
end
@@ -1428,6 +1434,8 @@ do
local link = GetSpellLink (spell)
text = text:gsub ("(|Hspell).*(|h)", link)
end
-- remove unit links
text = text:gsub ("(|Hunit).-(|h)", "")
-- remove the left space
text = text:gsub ("^%s$", "")
@@ -1518,9 +1526,11 @@ do
if (searching == "") then
searching = nil
FauxScrollFrame_SetOffset (scrollframe, 0)
BossFrame.ReportEmoteButton:Disable()
scrollframe:Update()
else
FauxScrollFrame_SetOffset (scrollframe, 0)
BossFrame.ReportEmoteButton:Enable()
scrollframe:Update()
end
end)
@@ -1540,6 +1550,68 @@ do
tinsert (BossFrame.EmoteWidgets, reset)
tinsert (BossFrame.EmoteWidgets, emotes_search_label)
-- report button
local report_emote_button = DetailsFrameWork:NewButton (BossFrame, nil, "$parentReportEmoteButton", "ReportEmoteButton", 120, 20, function()
local reportFunc = function (IsCurrent, IsReverse, AmtLines)
local segment = EncounterDetails.charsaved.emotes and EncounterDetails.charsaved.emotes [emote_segment]
if (segment) then
EncounterDetails.report_lines = {"Details!: Emotes for " .. segment.boss}
local added = 0
for index = 1, 16 do
local bar = emote_lines [index]
if (bar:IsShown() and added < AmtLines) then
local time = bar.lefttext:GetText()
local text = bar.righttext:GetText()
--"|Hunit:77182:Oregorger|hOregorger prepares to cast |cFFFF0000|Hspell:156879|h[Blackrock Barrage]|h|r."
-- remove textures
text = text:gsub ("(|T).*(|t)", "")
-- remove colors
text = text:gsub ("|c%x?%x?%x?%x?%x?%x?%x?%x?", "")
text = text:gsub ("|r", "")
-- replace links
for _, spellid in text:gmatch ("(|Hspell:)(.-)(|h)") do
local spell = tonumber (spellid)
local link = GetSpellLink (spell)
text = text:gsub ("(|Hspell).*(|h)", link)
end
-- remove unit links
text = text:gsub ("(|Hunit).-(|h)", "")
-- remove the left space
text = text:gsub ("^%s$", "")
tinsert (EncounterDetails.report_lines, time .. " " .. text)
added = added + 1
if (added == AmtLines) then
break
end
end
end
EncounterDetails:SendReportLines (EncounterDetails.report_lines)
else
EncounterDetails:Msg ("There is nothing to report.")
end
end
local use_slider = true
EncounterDetails:SendReportWindow (reportFunc, nil, nil, use_slider)
end, nil, nil, nil, "Report Lines")
report_emote_button:SetIcon ([[Interface\AddOns\Details\images\report_button]], 8, 16, nil, {0, 1, 0, 1}, nil, nil, 2)
report_emote_button:SetPoint ("topleft", BossFrame.SearchResults, "bottomleft", 0, -2)
report_emote_button:InstallCustomTexture()
report_emote_button:Disable()
tinsert (BossFrame.EmoteWidgets, report_emote_button)
--
for _, widget in pairs (BossFrame.EmoteWidgets) do
widget:Hide()
end