- report key bindings and report history.
This commit is contained in:
@@ -11,6 +11,13 @@
|
||||
DetailsKeyBindScrollUp()
|
||||
</Binding>
|
||||
|
||||
<Binding name="DETAILS_REPORT_WINDOW1" description="Report data shown on window #1." header="DETAILS_KEYBIND_REPORT" category="Details!">
|
||||
_detalhes:FastReportWindow (1)
|
||||
</Binding>
|
||||
<Binding name="DETAILS_REPORT_WINDOW2" description="Report data shown on window #2." category="Details!">
|
||||
_detalhes:FastReportWindow (2)
|
||||
</Binding>
|
||||
|
||||
<Binding name="DETAILS_TOGGLE_ALL" description="open or close all windows" header="DETAILS_KEYBIND_WINDOW_CONTROL" category="Details!">
|
||||
_detalhes:ToggleWindows()
|
||||
</Binding>
|
||||
|
||||
@@ -2763,6 +2763,26 @@ function _detalhes:monta_relatorio (este_relatorio, custom)
|
||||
end
|
||||
end
|
||||
|
||||
if (self.meu_id and self.atributo and self.sub_atributo and _detalhes.report_where ~= "WHISPER" and _detalhes.report_where ~= "WHISPER2") then
|
||||
local already_exists
|
||||
for index, reported in ipairs (_detalhes.latest_report_table) do
|
||||
if (reported [1] == self.meu_id and reported [2] == self.atributo and reported [3] == self.sub_atributo and reported [5] == _detalhes.report_where) then
|
||||
already_exists = index
|
||||
break
|
||||
end
|
||||
end
|
||||
if (already_exists) then
|
||||
if (already_exists > 5) then
|
||||
local t = _detalhes.latest_report_table [already_exists]
|
||||
tremove (_detalhes.latest_report_table, already_exists)
|
||||
tinsert (_detalhes.latest_report_table, 1, t)
|
||||
end
|
||||
else
|
||||
tinsert (_detalhes.latest_report_table, 1, {self.meu_id, self.atributo, self.sub_atributo, amt, _detalhes.report_where})
|
||||
end
|
||||
tremove (_detalhes.latest_report_table, 11)
|
||||
end
|
||||
|
||||
local barras = self.barras
|
||||
local esta_barra
|
||||
|
||||
|
||||
@@ -1086,6 +1086,8 @@ local default_global_data = {
|
||||
details_auras = {},
|
||||
--> ilvl
|
||||
item_level_pool = {},
|
||||
--> latest report
|
||||
latest_report_table = {},
|
||||
}
|
||||
|
||||
_detalhes.default_global_data = default_global_data
|
||||
|
||||
@@ -7413,6 +7413,24 @@ function gump:CriaCabecalho (baseframe, instancia)
|
||||
GameCooltip:SetOption ("ButtonsYMod", -7)
|
||||
GameCooltip:SetOption ("HeighMod", 8)
|
||||
|
||||
local last_reports = _detalhes.latest_report_table
|
||||
if (#last_reports > 0) then
|
||||
for index = #last_reports, 1, -1 do
|
||||
local report = last_reports [index]
|
||||
local instance_number, attribute, subattribute, amt, report_where = unpack (report)
|
||||
|
||||
local name = _detalhes:GetSubAttributeName (attribute, subattribute)
|
||||
|
||||
local artwork = _detalhes.GetReportIconAndColor (report_where)
|
||||
|
||||
GameCooltip:AddLine (name, nil, 1, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus)
|
||||
GameCooltip:AddIcon (artwork.icon, 1, 1, 14, 14, artwork.coords[1], artwork.coords[2], artwork.coords[3], artwork.coords[4], artwork.color, nil, false)
|
||||
GameCooltip:AddMenu (1, _detalhes.ReportFromLatest, index)
|
||||
end
|
||||
|
||||
GameCooltip:AddLine ("$div")
|
||||
end
|
||||
|
||||
GameCooltip:AddLine (Loc ["STRING_REPORT_TOOLTIP"], nil, 1, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus)
|
||||
GameCooltip:AddIcon ([[Interface\Addons\Details\Images\report_button]], 1, 1, 12, 19)
|
||||
GameCooltip:AddMenu (1, _detalhes.Reportar, instancia, nil, "INSTANCE" .. instancia.meu_id)
|
||||
|
||||
+82
-1
@@ -22,6 +22,71 @@ local _UISpecialFrames = UISpecialFrames --> wow api locals
|
||||
|
||||
--> details API functions -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
function _detalhes:FastReportWindow (window)
|
||||
|
||||
if (not DetailsReportWindow) then
|
||||
gump:CriaJanelaReport()
|
||||
DetailsReportWindow:Hide()
|
||||
end
|
||||
|
||||
local instance = _detalhes:GetInstance (window)
|
||||
if (instance) then
|
||||
|
||||
if (instance.atributo == 1) then
|
||||
_detalhes.report_lines = 14
|
||||
elseif (instance.atributo == 2) then
|
||||
_detalhes.report_lines = 6
|
||||
else
|
||||
_detalhes.report_lines = max (10, instance.rows_fit_in_window)
|
||||
end
|
||||
|
||||
if (IsInRaid()) then
|
||||
_detalhes.report_where = "RAID"
|
||||
elseif (GetNumSubgroupMembers() > 0) then
|
||||
_detalhes.report_where = "PARTY"
|
||||
else
|
||||
_detalhes.report_where = "SAY"
|
||||
end
|
||||
|
||||
instance:monta_relatorio()
|
||||
|
||||
else
|
||||
_detalhes:Msg (Loc ["STRING_WINDOW_NOTFOUND"])
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes.ReportFromLatest (_, _, index)
|
||||
local t = _detalhes.latest_report_table [index]
|
||||
|
||||
if (t) then
|
||||
|
||||
if (not DetailsReportWindow) then
|
||||
gump:CriaJanelaReport()
|
||||
DetailsReportWindow:Hide()
|
||||
end
|
||||
|
||||
local id, attribute, subattribute, amt, report_where = unpack (t)
|
||||
local instance = _detalhes:GetInstance (id)
|
||||
_detalhes.report_lines = amt
|
||||
_detalhes.report_where = report_where
|
||||
|
||||
local cattribute, csubattribute = instance:GetDisplay()
|
||||
instance:SetDisplay (nil, attribute, subattribute)
|
||||
|
||||
instance:monta_relatorio()
|
||||
|
||||
instance:SetDisplay (nil, cattribute, csubattribute)
|
||||
|
||||
if (index > 5) then
|
||||
local t = _detalhes.latest_report_table [index]
|
||||
tremove (_detalhes.latest_report_table, index)
|
||||
tinsert (_detalhes.latest_report_table, 1, t)
|
||||
end
|
||||
|
||||
GameCooltip:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes:SendReportLines (lines)
|
||||
if (type (lines) == "string") then
|
||||
lines = {lines}
|
||||
@@ -230,7 +295,6 @@ local _UISpecialFrames = UISpecialFrames --> wow api locals
|
||||
|
||||
--> dropdown menus
|
||||
|
||||
local function cria_drop_down (este_gump)
|
||||
--[[
|
||||
Emote: 255 251 255
|
||||
Yell: 255 63 64
|
||||
@@ -248,6 +312,23 @@ BG Leader: 255 216 183
|
||||
General/Trade: 255 189 192
|
||||
--]]
|
||||
|
||||
|
||||
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}},
|
||||
["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}},
|
||||
}
|
||||
function _detalhes.GetReportIconAndColor (report_where)
|
||||
local key = report_where:gsub ((".*|"), "")
|
||||
return icons_and_colors [key]
|
||||
end
|
||||
|
||||
local function cria_drop_down (este_gump)
|
||||
|
||||
local iconsize = {16, 16}
|
||||
|
||||
local lista = {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user