- Fixed a rare bug where the window for Encounter Details Plugin won't open when clicking on its icon.

- Fixed death display color when not using colored by the player class.
- Added officer channel to 'Announce Death' feature.
This commit is contained in:
Tercio
2015-09-19 23:32:09 -03:00
parent 3eb6f854a9
commit 27e5823572
14 changed files with 138 additions and 46 deletions
+7 -1
View File
@@ -1,5 +1,6 @@
local major, minor = "DetailsFramework-1.0", 10
local dversion = 10
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
if (not DF) then
@@ -24,6 +25,11 @@ DF.ButtonCounter = 1
DF.SliderCounter = 1
DF.SplitBarCounter = 1
DF.FrameWorkVersion = tostring (dversion)
function DF:PrintVersion()
print ("Details! Framework Version:", DF.FrameWorkVersion)
end
LibStub:GetLibrary("AceTimer-3.0"):Embed (DF)
do
+35 -14
View File
@@ -528,6 +528,24 @@ local APIBarFunctions
self.timer = false
end
function BarMetaFunctions:CancelTimerBar (no_timer_end)
if (not self.HasTimer) then
return
end
if (self.TimerScheduled) then
DF:CancelTimer (self.TimerScheduled)
self.TimerScheduled = nil
else
if (self.statusbar:GetScript ("OnUpdate")) then
self.statusbar:SetScript ("OnUpdate", nil)
end
end
self.righttext = ""
if (not no_timer_end) then
self:OnTimerEnd()
end
end
local OnUpdate = function (self, elapsed)
--> percent of elapsed
local pct = abs (self.end_timer - GetTime() - self.tempo) / self.tempo
@@ -548,23 +566,24 @@ local APIBarFunctions
if (pct >= 1) then
self.righttext:SetText ("")
self:SetScript ("OnUpdate", nil)
self.MyObject.HasTimer = nil
self.MyObject:OnTimerEnd()
end
end
function BarMetaFunctions:SetTimer (tempo)
-- o que é inverso
-- barra cheia
-- barra vazia
-- o que é left to right
-- barra que faz da direita pra esquerda
-- contrário
self.statusbar.tempo = tempo
self.statusbar.remaining = tempo
function BarMetaFunctions:SetTimer (tempo, end_at)
if (end_at) then
self.statusbar.tempo = end_at - tempo
self.statusbar.remaining = end_at - GetTime()
self.statusbar.end_timer = end_at
else
self.statusbar.tempo = tempo
self.statusbar.remaining = tempo
self.statusbar.end_timer = GetTime() + tempo
end
self.statusbar.total_size = self.statusbar:GetWidth()
self.statusbar.end_timer = GetTime() + tempo
self.statusbar.inverse = self.BarIsInverse
self (0)
@@ -597,10 +616,12 @@ local APIBarFunctions
self.timer = true
DF:ScheduleTimer ("StartTimeBarAnimation", 0.1, self)
self.HasTimer = true
self.TimerScheduled = DF:ScheduleTimer ("StartTimeBarAnimation", 0.1, self)
end
function DF:StartTimeBarAnimation (timebar)
timebar.TimerScheduled = nil
timebar.statusbar:SetScript ("OnUpdate", OnUpdate)
end
@@ -723,4 +744,4 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name)
end
return BarObject
end
end --endd
+6 -3
View File
File diff suppressed because one or more lines are too long
+7 -7
View File
@@ -755,7 +755,7 @@
local icon_cache = {}
function atributo_custom:GetActorTable (actor, name_complement)
local index = self._NameIndexTable [actor.nome]
local index = self._NameIndexTable [actor.nome or actor.name]
if (index) then
return self._ActorTable [index]
@@ -779,10 +779,10 @@
end
else
class = actor.classe
class = actor.classe or actor.class
if (class == "UNKNOW") then
--> try once again
class = _detalhes:GetClass (actor.nome)
class = _detalhes:GetClass (actor.nome or actor.name)
if (class and class ~= "UNKNOW") then
actor.classe = class
end
@@ -790,9 +790,9 @@
end
local new_actor = _setmetatable ({
nome = actor.nome,
nome = actor.nome or actor.name,
classe = class,
value = _detalhes:GetOrderNumber (actor.nome),
value = _detalhes:GetOrderNumber(),
is_custom = true,
}, atributo_custom.mt)
@@ -820,7 +820,7 @@
end
else
if (not new_actor.classe) then
new_actor.classe = _detalhes:GetClass (actor.nome) or "UNKNOW"
new_actor.classe = _detalhes:GetClass (actor.nome or actor.name) or "UNKNOW"
end
if (new_actor.classe == "UNGROUPPLAYER") then
atributo_custom:ScheduleTimer ("UpdateClass", 5, {new_actor = new_actor, actor = actor})
@@ -830,7 +830,7 @@
index = #self._ActorTable+1
self._ActorTable [index] = new_actor
self._NameIndexTable [actor.nome] = index
self._NameIndexTable [actor.nome or actor.name] = index
return new_actor
end
end
+2 -2
View File
@@ -299,7 +299,7 @@
return _unpack (_detalhes.class_colors.ENEMY)
elseif (actor.owner) then
return _unpack (_detalhes.class_colors [actor.owner.classe])
return _unpack (_detalhes.class_colors [actor.owner.classe or "UNKNOW"])
elseif (actor.arena_team) then
if (actor.arena_team == 0) then
@@ -313,7 +313,7 @@
if (not is_player_class [actor.classe] and actor.flag_original and _bit_band (actor.flag_original, 0x00000020) ~= 0) then --> neutral
return _unpack (_detalhes.class_colors.NEUTRAL)
else
return _unpack (_detalhes.class_colors [actor.classe])
return _unpack (_detalhes.class_colors [actor.classe or "UNKNOW"])
end
end
+2 -1
View File
@@ -518,8 +518,9 @@ function atributo_misc:DeadAtualizarBarra (morte, qual_barra, colocacao, instanc
gump:Fade (esta_barra, "out")
end
--> seta a cor da barra e a cor do texto caso eles esteja mostrando com a cor da classe
local r, g, b, a = _unpack (_detalhes.class_colors [morte[4]])
esta_barra.textura:SetVertexColor (r, g, b, 1)
_detalhes:SetBarColors (esta_barra, instancia, r, g, b, a)
if (instancia.row_info.use_spec_icons) then
local nome = morte[3]
+27 -1
View File
@@ -15,6 +15,25 @@
return _detalhes.plugin_database [PluginAbsoluteName]
end
function _detalhes:UpdatePluginBarsConfig()
local instance = self:GetPluginInstance()
if (instance) then
self.row_info = self.row_info or {}
_detalhes.table.copy (self.row_info, instance.row_info)
self.bars_grow_direction = instance.bars_grow_direction
self.row_height = instance.row_height
self:SetBarGrowDirection()
end
end
function _detalhes:AttachToInstance()
local instance = self:GetPluginInstance()
if (instance) then
local w, h = instance:GetSize()
self.Frame:SetSize (w, h)
end
end
function _detalhes:GetPluginInstance (PluginAbsoluteName)
local plugin = self
if (PluginAbsoluteName) then
@@ -240,10 +259,17 @@
print ("Thank You Sir!===================")
end
local register_event_func = function (self, event)
self.Frame:RegisterEvent (event)
end
local unregister_event_func = function (self, event)
self.Frame:UnregisterEvent (event)
end
function _detalhes:NewPluginObject (FrameName, PluginOptions, PluginType)
PluginOptions = PluginOptions or 0x0
local NewPlugin = {__options = PluginOptions, __enabled = true}
local NewPlugin = {__options = PluginOptions, __enabled = true, RegisterEvent = register_event_func, UnregisterEvent = unregister_event_func}
local Frame = CreateFrame ("Frame", FrameName, UIParent)
Frame:RegisterEvent ("ADDON_LOADED")
+4
View File
@@ -520,6 +520,10 @@
end
channel = "PRINT"
elseif (where == 5) then --> officers
if (IsInGuild()) then
channel = "OFFICER"
end
end
local only_first = _detalhes.announce_deaths.only_first
+1 -1
View File
@@ -247,7 +247,7 @@
if (type (value) == "table") then
t1 [key] = t1 [key] or {}
_detalhes.table.deploy (t1 [key], t2 [key])
else
elseif (t1 [key] == nil) then
t1 [key] = value
end
end
+2 -2
View File
@@ -110,9 +110,9 @@ local common_events = {
if (not _detalhes.RegistredEvents [event]) then
if (object.Msg) then
object:DelayMsg ("(debug) unknown event", event)
object:DelayMsg ("[debug] unknown event:", event, object.__name)
else
_detalhes:DelayMsg ("(debug) unknown event", event)
_detalhes:DelayMsg ("[debug] unknown event:", event, object.__name)
end
return
end
+20
View File
@@ -1063,6 +1063,26 @@ function SlashCmdList.DETAILS (msg, editbox)
_detalhes:OpenRaidHistoryWindow ("Hellfire Citadel", 1800, 15, "DAMAGER", "Rock Lobster", 2, "Keyspell")
elseif (msg == "bar") then
local bar = _G.DetailsTestBar
if (not bar) then
bar = Details.gump:CreateBar (UIParent, nil, 600, 200, 100, nil, "DetailsTestBar")
_G.DetailsTestBar = bar
bar:SetPoint ("center", 0, 0)
bar.RightTextIsTimer = true
bar.BarIsInverse = true
end
bar.color = "HUNTER"
local start = GetTime()-45
local fim = GetTime()+5
bar:SetTimer (start, fim)
--C_Timer.After (5, function() bar:CancelTimerBar() end)
elseif (msg == "alert") then
--local instancia = _detalhes.tabela_instancias [1]
local f = function (a, b, c, d, e, f, g) print (a, b, c, d, e, f, g) end
+3
View File
@@ -9653,11 +9653,14 @@ function window:CreateFrame11()
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
local officer = _detalhes.GetReportIconAndColor ("OFFICER")
local channel_list = {
{value = 1, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0, 1}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_OPTIONS_RT_DEATHS_WHERE1"], onclick = on_select_channel},
{value = 2, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0.49, 0}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_OPTIONS_RT_DEATHS_WHERE2"], onclick = on_select_channel},
{value = 3, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {0.66, 0.65, 1}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_OPTIONS_RT_DEATHS_WHERE3"], onclick = on_select_channel},
{value = 4, icon = [[Interface\LFGFRAME\BattlenetWorking2]], iconsize = {14, 14}, iconcolor = {1, 1, 1, 1}, texcoord = {12/64, 53/64, 11/64, 53/64}, label = Loc ["STRING_CHANNEL_PRINT"], onclick = on_select_channel},
{value = 5, icon = officer.icon, iconsize = {14, 14}, iconcolor = officer.color, texcoord = officer.coords, label = officer.label, onclick = on_select_channel},
}
local build_channel_menu = function()
return channel_list
+21 -13
View File
@@ -3776,32 +3776,34 @@ function _detalhes:SetBarGrowDirection (direction)
self.bars_grow_direction = direction
local x = self.row_info.space.left
local bars = self.barras or self.Bars --> .Bars for third-party plugins
local baseframe = self.baseframe or self.Frame --> .Frame for plugins
local height = self.row_height
if (direction == 1) then --> top to bottom
for index, row in _ipairs (self.barras) do
local y = self.row_height * (index - 1)
for index, row in _ipairs (bars) do
local y = height * (index - 1)
y = y * -1
row:ClearAllPoints()
row:SetPoint ("topleft", self.baseframe, "topleft", x, y)
row:SetPoint ("topleft", baseframe, "topleft", x, y)
end
elseif (direction == 2) then --> bottom to top
for index, row in _ipairs (self.barras) do
local y = self.row_height * (index - 1)
for index, row in _ipairs (bars) do
local y = height * (index - 1)
row:ClearAllPoints()
row:SetPoint ("bottomleft", self.baseframe, "bottomleft", x, y + 2)
row:SetPoint ("bottomleft", baseframe, "bottomleft", x, y + 2)
end
end
--> update all row width
if (self.bar_mod and self.bar_mod ~= 0) then
for index = 1, #self.barras do
self.barras [index]:SetWidth (self.baseframe:GetWidth() + self.bar_mod)
for index = 1, #bars do
bars [index]:SetWidth (baseframe:GetWidth() + self.bar_mod)
end
else
for index = 1, #self.barras do
self.barras [index]:SetWidth (self.baseframe:GetWidth()+self.row_info.space.right)
for index = 1, #bars do
bars [index]:SetWidth (baseframe:GetWidth() + self.row_info.space.right)
--print (bars [index]:GetWidth(), baseframe:GetWidth())
end
end
end
@@ -6621,6 +6623,12 @@ function _detalhes:TitleTextTickTimer (instance)
end
end
function _detalhes:SetTitleBarText (text)
if (self.attribute_text.enabled and self.menu_attribute_string) then
self.menu_attribute_string:SetText (text)
end
end
function _detalhes:AttributeMenu (enabled, pos_x, pos_y, font, size, color, side, shadow, timer_encounter, timer_bg, timer_arena)
if (type (enabled) ~= "boolean") then
+1 -1
View File
@@ -322,7 +322,7 @@ local icons_and_colors = {
["PARTY"] = {icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.53125, 0.7265625, 0.078125, 0.40625}, color = {0.66, 0.65, 1}},
["RAID"] = {icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.53125, 0.7265625, 0.078125, 0.40625}, color = {1, 0.49, 0}},
["GUILD"] = {icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.8046875, 0.96875, 0.125, 0.390625}, color = {0.25, 0.98, 0.25}},
["OFFICER"] = {icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.8046875, 0.96875, 0.125, 0.390625}, color = {0.25, 0.74, 0.25}},
["OFFICER"] = {label = Loc ["STRING_REPORTFRAME_OFFICERS"], icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.8046875, 0.96875, 0.125, 0.390625}, color = {0.25, 0.74, 0.25}},
["WHISPER"] = {icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.0546875, 0.1953125, 0.625, 0.890625}, color = {1, 0.49, 1}},
["SAY"] = {icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.0390625, 0.203125, 0.09375, 0.375}, color = {1, 1, 1}},
["COPY"] = {icon = [[Interface\Buttons\UI-GuildButton-PublicNote-Disabled]], coords = {0, 1, 0, 1}, color = {1, 1, 1}},