- new API: Details:GetPlayerIcon (playername[, segmentobject]) - return the player class or spec icon.

- bar spacing now can go to -2, down from 0.
- Tiny Threat now shall correctly use the font set on the options panel after a logon.
This commit is contained in:
Tercio
2016-08-27 00:15:39 -03:00
parent ea34311bd8
commit faf818209e
5 changed files with 76 additions and 31 deletions
+6 -4
View File
@@ -3,8 +3,8 @@
_ = nil
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0")
_detalhes.build_counter = 2854 --it's 2885 for release
_detalhes.userversion = "v7.0.3.2885"
_detalhes.build_counter = 2899 --it's 2885 for release
_detalhes.userversion = "v7.0.3.2899"
_detalhes.realversion = 111 --core version
_detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")"
Details = _detalhes
@@ -22,13 +22,15 @@ do
--[[
|cFFFFFF00v5.17 (|cFFFFCC00August 19, 2016|r|cFFFFFF00)|r:\n\n
|cFFFFFF00-|r Fixed a bug on tiny threat where it won't used the font set after a /reload.\n\n
|cFFFFFF00-|r Bar spacing can now be set to -2 to 10 (from 0 to 10).\n\n
|cFFFFFF00-|r Attempt to fix GBoM and Stormlash on dungeon boss fights.\n\n
--]]
--
--Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v5.10c (|cFFFFCC00July 22, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Trying a workaround for the wow client's texture cache bug which causes FPS drops, please delete the file 'spec_icons_normal.TGA' from details/image folder.\n\n|cFFFFFF00v5.10b (|cFFFFCC00July 21, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed warlock's Soul Effigy.\n\n|cFFFFFF00v5.10a (|cFFFFCC00July 20, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with Calc Leech plugin.\n\n|cFFFFFF00v5.10 (|cFFFFCC00July 19, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Using .BLP format for images. If you have FPS drops caused by Details!, delete ALL .TGA files inside the folder Details/Images/\n\n|cFFFFFF00v5.8 (|cFFFFCC00July 11, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Big framework update. May have some bugs, please report to us if you find any.\n\n|cFFFFFF00v5.8 (|cFFFFCC00June 27, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Energy and Resources are working properly now.\n\n|cFFFFFF00-|r Added raid information for The Emerald Nightmare.\n\n|cFFFFFF00v5.7 (|cFFFFCC00June 16, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Most of the raid plugins got added on this version.\n\n|cFFFFFF00-|r Plugin 'Damage, The Game!' also got damage goals updated.\n\n|cFFFFFF00v5.5 (|cFFFFCC00June 03, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Default skin is now 'Safe Skin Legion Beta' which helps a little with the disabled texture issue.\n|cFFFFFF00-|r If you're using another skin, you may change at the options panel /details options > Skin Selection.\n|cFFFFFF00-|r You also can disable the class icons at Bars: General > Icon File."
Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v7.0.3 (|cFFFFCC00August 19, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Attempt to fix GBoM and Stormlash on dungeon boss fights.\n\n|cFFFFFF00v5.21 (|cFFFFCC00August 14, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for Monk's Soothing Mist on Streamer Plugin.\n\n|cFFFFFF00v5.20 (|cFFFFCC00August 13, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Warlock's Grimoire of Synergy buff uptime fix.\n\n|cFFFFFF00-|r Fix for the options panel background when using Classic panels.\n\n|cFFFFFF00-|r Tooltips are now slightly bigger.\n\n|cFFFFFF00-|r Fix for bookmark background where sometimes it has a light silver color.\n\n|cFFFFFF00-|r Fix for channel cast on Streamer Plugin.\n\n|cFFFFFF00-|r Legion followers fix.\n\n|cFFFFFF00-|r Boss detection for Legion dungeons.\n\n|cFFFFFF00-|r Priest spec detection review (thanks Yakumile-Azralon).\n\n|cFFFFFF00v5.15 (|cFFFFCC00August 5, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r fix for an error which happen sometimes during encounter start.\n\n|cFFFFFF00v5.14 (|cFFFFCC00August 2, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added outline option for bar's Left Text (experimental).\n\n|cFFFFFF00-|r 'Minimalistic' is once again the default skin for new windows, changed from the 'Safe Beta Skin'.\n\n|cFFFFFF00-|r Fixed some issues with spec detection and LibGroupInSpecT-1.1 has need enabled back again.\n\n|cFFFFFF00-|r Fixed an issue with micro displays not loading settings after a logon.\n\n|cFFFFFF00-|r Another wave of workarounds to prevent the client image cache bug.\n\n|cFFFFFF00-|r fixed the spam of 'segment not added to overall'.\n\n|cFFFFFF00-|r stormlash and blessing of might workarouds.\n\n|cFFFFFF00-|r warrior rampage fix.\n\n|cFFFFFF00-|r hunter throw axe fix.\n\n|cFFFFFF00v5.10c (|cFFFFCC00July 22, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Trying a workaround for the wow client's texture cache bug which causes FPS drops, please delete the file 'spec_icons_normal.TGA' from details/image folder.\n\n|cFFFFFF00v5.10b (|cFFFFCC00July 21, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed warlock's Soul Effigy.\n\n|cFFFFFF00v5.10a (|cFFFFCC00July 20, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with Calc Leech plugin.\n\n|cFFFFFF00v5.10 (|cFFFFCC00July 19, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Using .BLP format for images. If you have FPS drops caused by Details!, delete ALL .TGA files inside the folder Details/Images/\n\n|cFFFFFF00v5.8 (|cFFFFCC00July 11, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Big framework update. May have some bugs, please report to us if you find any.\n\n|cFFFFFF00v5.8 (|cFFFFCC00June 27, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Energy and Resources are working properly now.\n\n|cFFFFFF00-|r Added raid information for The Emerald Nightmare.\n\n|cFFFFFF00v5.7 (|cFFFFCC00June 16, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Most of the raid plugins got added on this version.\n\n|cFFFFFF00-|r Plugin 'Damage, The Game!' also got damage goals updated.\n\n|cFFFFFF00v5.5 (|cFFFFCC00June 03, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Default skin is now 'Safe Skin Legion Beta' which helps a little with the disabled texture issue.\n|cFFFFFF00-|r If you're using another skin, you may change at the options panel /details options > Skin Selection.\n|cFFFFFF00-|r You also can disable the class icons at Bars: General > Icon File."
Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v7.0.3.2899 (|cFFFFCC00August 26, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a bug on tiny threat where it won't used the font set after a /reload.\n\n|cFFFFFF00-|r Bar spacing can now be set to -2 to 10 (from 0 to 10).\n\n|cFFFFFF00-|r Attempt to fix GBoM and Stormlash on dungeon boss fights.\n\n|cFFFFFF00v5.21 (|cFFFFCC00August 14, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for Monk's Soothing Mist on Streamer Plugin.\n\n|cFFFFFF00v5.20 (|cFFFFCC00August 13, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Warlock's Grimoire of Synergy buff uptime fix.\n\n|cFFFFFF00-|r Fix for the options panel background when using Classic panels.\n\n|cFFFFFF00-|r Tooltips are now slightly bigger.\n\n|cFFFFFF00-|r Fix for bookmark background where sometimes it has a light silver color.\n\n|cFFFFFF00-|r Fix for channel cast on Streamer Plugin.\n\n|cFFFFFF00-|r Legion followers fix.\n\n|cFFFFFF00-|r Boss detection for Legion dungeons.\n\n|cFFFFFF00-|r Priest spec detection review (thanks Yakumile-Azralon).\n\n|cFFFFFF00v5.15 (|cFFFFCC00August 5, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r fix for an error which happen sometimes during encounter start.\n\n|cFFFFFF00v5.14 (|cFFFFCC00August 2, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added outline option for bar's Left Text (experimental).\n\n|cFFFFFF00-|r 'Minimalistic' is once again the default skin for new windows, changed from the 'Safe Beta Skin'.\n\n|cFFFFFF00-|r Fixed some issues with spec detection and LibGroupInSpecT-1.1 has need enabled back again.\n\n|cFFFFFF00-|r Fixed an issue with micro displays not loading settings after a logon.\n\n|cFFFFFF00-|r Another wave of workarounds to prevent the client image cache bug.\n\n|cFFFFFF00-|r fixed the spam of 'segment not added to overall'.\n\n|cFFFFFF00-|r stormlash and blessing of might workarouds.\n\n|cFFFFFF00-|r warrior rampage fix.\n\n|cFFFFFF00-|r hunter throw axe fix.\n\n|cFFFFFF00v5.10c (|cFFFFCC00July 22, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Trying a workaround for the wow client's texture cache bug which causes FPS drops, please delete the file 'spec_icons_normal.TGA' from details/image folder.\n\n|cFFFFFF00v5.10b (|cFFFFCC00July 21, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed warlock's Soul Effigy.\n\n|cFFFFFF00v5.10a (|cFFFFCC00July 20, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with Calc Leech plugin.\n\n|cFFFFFF00v5.10 (|cFFFFCC00July 19, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Using .BLP format for images. If you have FPS drops caused by Details!, delete ALL .TGA files inside the folder Details/Images/\n\n|cFFFFFF00v5.8 (|cFFFFCC00July 11, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Big framework update. May have some bugs, please report to us if you find any.\n\n|cFFFFFF00v5.8 (|cFFFFCC00June 27, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Energy and Resources are working properly now.\n\n|cFFFFFF00-|r Added raid information for The Emerald Nightmare.\n\n|cFFFFFF00v5.7 (|cFFFFCC00June 16, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Most of the raid plugins got added on this version.\n\n|cFFFFFF00-|r Plugin 'Damage, The Game!' also got damage goals updated.\n\n|cFFFFFF00v5.5 (|cFFFFCC00June 03, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Default skin is now 'Safe Skin Legion Beta' which helps a little with the disabled texture issue.\n|cFFFFFF00-|r If you're using another skin, you may change at the options panel /details options > Skin Selection.\n|cFFFFFF00-|r You also can disable the class icons at Bars: General > Icon File."
Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r "
+28
View File
@@ -79,6 +79,34 @@ do
end
end
function _detalhes:GetPlayerIcon (playerName, segment)
segment = segment or _detalhes.tabela_vigente
local texture
local L, R, T, B
local playerObject = segment (1, playerName)
if (not playerObject or not playerObject.spec) then
playerObject = segment (2, playerName)
end
if (playerObject) then
local spec = playerObject.spec
if (spec) then
texture = [[Interface\AddOns\Details\images\spec_icons_normal]]
L, R, T, B = unpack (_detalhes.class_specs_coords [spec])
else
texture = [[Interface\AddOns\Details\images\classes_small]]
L, R, T, B = unpack (_detalhes.class_coords [playerObject.classe or "UNKNOW"])
end
else
texture = [[Interface\AddOns\Details\images\classes_small]]
L, R, T, B = unpack (_detalhes.class_coords ["UNKNOW"])
end
return texture, L, R, T, B
end
function _detalhes:GuessClass (t)
local Actor, container, tries = t[1], t[2], t[3]
+28 -23
View File
@@ -2339,9 +2339,13 @@ function gump:CriaJanelaInfo()
local frame_backdrop_color = {0, 0, 0, 0.35}
local frame_backdrop_border_color = {0, 0, 0, 0}
local spell_compare_frame_width = {290, 220, 220}
local spell_compare_frame_width = {298, 225, 226}
local spell_compare_frame_height = 200
local target_compare_frame_height = 120
local target_compare_frame_height = 142
local xLocation = 2
local yLocation = -20
local targetBars = 9
local fill_compare_targets = function (self, player, other_players, target_pool)
@@ -2353,7 +2357,7 @@ function gump:CriaJanelaInfo()
local total = player.total_without_pet
if (not target_pool [1]) then
for i = 1, 7 do
for i = 1, targetBars do
local bar = self.bars [i]
local bar_2 = frame2.bars [i]
local bar_3 = frame3.bars [i]
@@ -2423,7 +2427,7 @@ function gump:CriaJanelaInfo()
end
end
for i = 1, 7 do
for i = 1, targetBars do
local bar = self.bars [i]
local bar_2 = frame2.bars [i]
local bar_3 = frame3.bars [i]
@@ -2558,7 +2562,7 @@ function gump:CriaJanelaInfo()
down = "" .. 999
end
bar_3 [2].righttext:SetText (_detalhes:ToK2Min (player_3_target_total))
bar_3 [2].righttext:SetText (" |c" .. plus .. down .. "%)|r")
bar_3 [2].righttext:SetText (" |c" .. plus .. down .. "%|r")
end
--bar_3 [2]:SetValue (player_3_target_total / player_3_top * 100)
@@ -2885,7 +2889,8 @@ function gump:CriaJanelaInfo()
end
table.sort (target_pool, _detalhes.Sort2)
FauxScrollFrame_Update (self, math.max (#target_pool, 5), 4, 14)
FauxScrollFrame_Update (self, #target_pool, targetBars, 14)
self:Show()
fill_compare_targets (self, self.tab.player, self.tab.players, target_pool)
end
@@ -3101,7 +3106,7 @@ function gump:CriaJanelaInfo()
if (up > 999) then
up = "" .. 999
end
bar [2].righttext:SetText (_detalhes:ToK2Min (this_spell [2]) .. " |c" .. minor .. up .. "%)|r")
bar [2].righttext:SetText (_detalhes:ToK2Min (this_spell [2]) .. " |c" .. minor .. up .. "%|r")
else
local diff = this_spell [2] - spell [2]
local down = diff / spell [2] * 100
@@ -3581,8 +3586,8 @@ function gump:CriaJanelaInfo()
frame3.tooltip.uptime_label2:SetText ("|c" .. plus .. down .. "%|r")
end
_detalhes.gump:SetFontColor (frame3.tooltip.casts_label3, "white")
_detalhes.gump:SetFontColor (frame3.tooltip.casts_label2, "white")
_detalhes.gump:SetFontColor (frame3.tooltip.uptime_label3, "white")
_detalhes.gump:SetFontColor (frame3.tooltip.uptime_label2, "white")
else
frame3.tooltip.uptime_label3:SetText (COMPARE_UNKNOWNDATA)
frame3.tooltip.uptime_label2:SetText (COMPARE_UNKNOWNDATA)
@@ -3672,12 +3677,12 @@ function gump:CriaJanelaInfo()
local create_bar = function (name, parent, index, main, is_target)
local y = ((index-1) * -15) - 7
local spellicon = parent:CreateTexture (nil, "overlay")
spellicon:SetSize (14, 14)
spellicon:SetPoint ("topleft", parent, "topleft", 4, y)
spellicon:SetTexture ([[Interface\InventoryItems\WoWUnknownItem01]])
local bar = CreateFrame ("StatusBar", name, parent)
bar.index = index
bar:SetPoint ("topleft", spellicon, "topright", 0, 0)
@@ -3688,7 +3693,7 @@ function gump:CriaJanelaInfo()
bar:SetValue (100)
bar:SetHeight (14)
bar.icon = spellicon
if (is_target) then
bar:SetScript ("OnEnter", on_enter_target)
bar:SetScript ("OnLeave", on_leave_target)
@@ -3696,9 +3701,9 @@ function gump:CriaJanelaInfo()
bar:SetScript ("OnEnter", on_enter)
bar:SetScript ("OnLeave", on_leave)
end
bar.lefttext = bar:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall")
local _, size, flags = bar.lefttext:GetFont()
local font = SharedMedia:Fetch ("font", "Arial Narrow")
bar.lefttext:SetFont (font, 11)
@@ -3957,7 +3962,7 @@ function gump:CriaJanelaInfo()
local frame1 = CreateFrame ("scrollframe", "DetailsPlayerComparisonBox1", frame, "FauxScrollFrameTemplate")
frame1:SetScript ("OnVerticalScroll", function (self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 14, refresh_comparison_box) end)
frame1:SetSize (spell_compare_frame_width[1], spell_compare_frame_height)
frame1:SetPoint ("topleft", frame, "topleft", 10, -30)
frame1:SetPoint ("topleft", frame, "topleft", xLocation, yLocation)
frame1:SetBackdrop (frame_backdrop)
frame1:SetBackdropColor (unpack (frame_backdrop_color))
@@ -3992,7 +3997,7 @@ function gump:CriaJanelaInfo()
target1.tooltip:SetWidth (spell_compare_frame_width[1])
--criar as barras do target1
for i = 1, 7 do
for i = 1, targetBars do
create_bar ("DetailsPlayerComparisonTarget1Bar"..i, target1, i, true, true)
end
@@ -4052,7 +4057,7 @@ function gump:CriaJanelaInfo()
target2.tooltip:SetWidth (spell_compare_frame_width[2])
--criar as barras do target2
for i = 1, 7 do
for i = 1, targetBars do
create_bar ("DetailsPlayerComparisonTarget2Bar"..i, target2, i, nil, true)
end
@@ -4107,20 +4112,20 @@ function gump:CriaJanelaInfo()
target3.tooltip:SetWidth (spell_compare_frame_width[3])
--criar as barras do target1
for i = 1, 7 do
for i = 1, targetBars do
create_bar ("DetailsPlayerComparisonTarget3Bar"..i, target3, i, nil, true)
end
end
-- ~compare
_detalhes:CreatePlayerDetailsTab ("Compare", Loc ["STRING_INFO_TAB_COMPARISON"], --[1] tab name [2] localized name
function (tabOBject, playerObject) --[2] condition
if (info.atributo > 2) then
return false
end
local same_class = {}
local class = playerObject.classe
local my_spells = {}
@@ -4302,7 +4307,7 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f
)
--newtab.frame:SetBackdropColor (.5, .50, .50, 1)
newtab.frame:SetBackdropColor (0, 0, 0, 0.05)
newtab.frame:SetBackdropColor (0, 0, 0, 0.3)
newtab.frame:SetBackdropBorderColor (.3, .3, .3, 0)
--local f = CreateFrame ("frame", nil, newtab)
+1 -1
View File
@@ -5629,7 +5629,7 @@ function window:CreateFrame4()
-- spacement
g:NewLabel (frame4, _, "$parentBarSpacementLabel", "BarSpacementLabel", Loc ["STRING_OPTIONS_BAR_SPACING"], "GameFontHighlightLeft")
local s = g:NewSlider (frame4, _, "$parentBarSpacementSizeSlider", "BarSpacementSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0, 10, 1, instance.row_info.space.between, nil, nil, nil, options_slider_template)
local s = g:NewSlider (frame4, _, "$parentBarSpacementSizeSlider", "BarSpacementSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -2, 10, 1, instance.row_info.space.between, nil, nil, nil, options_slider_template)
--config_slider (s)
frame4.BarSpacementSlider:SetPoint ("left", frame4.BarSpacementLabel, "right", 2)
@@ -61,7 +61,10 @@ local function CreatePluginFrames (data)
--> OnEvent Table
function ThreatMeter:OnDetailsEvent (event, ...)
if (event == "HIDE") then --> plugin hidded, disabled
if (event == "DETAILS_STARTED") then
ThreatMeter:RefreshRows()
elseif (event == "HIDE") then --> plugin hidded, disabled
ThreatMeter.Actived = false
ThreatMeter:Cancel()
@@ -189,12 +192,19 @@ local function CreatePluginFrames (data)
end
local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
function ThreatMeter:RefreshRow (row)
local instance = ThreatMeter:GetPluginInstance()
row.textsize = instance.row_info.font_size
row.textfont = instance.row_info.font_face
local font = SharedMedia:Fetch ("font", instance.row_info.font_face, true) or instance.row_info.font_face
--print (font, instance.row_info.font_face)
row.textfont = font
row.texture = instance.row_info.texture
row.shadow = instance.row_info.textL_outline