- Added keybinds to reset segments and scroll up/down.

- Added Spell Customization options where icon and the name of a spell can be changed.
- Added option to change the micro displays side, now it can be shown on the window top side.
- Added options to change the transparency when out of combat and out of a group.
- Added and Still under development the panel for create data captures for charts.
- Fixed a issue with flat skin where the close button was just too big.

- New API: _detalhes:InstanceCall (function, params ...) runs a function into all opened instances.
- New Framework: gump:NewSpellEntry() create a textfield for choose a spell.
- New Framework: gump:NewSpecialLuaEditorEntry() create a textbox with lua syntaxes highlight.
- New FrameWork: gump:NewFillPanel() create a panel with rows.
This commit is contained in:
tercio
2014-04-30 21:55:56 -03:00
parent 432eccb1b0
commit bc1d7965eb
36 changed files with 3446 additions and 420 deletions
+11
View File
@@ -0,0 +1,11 @@
<Bindings>
<Binding name="DETAILS_RESET_SEGMENTS" description="Clear all segments." header="Details">
_detalhes.tabela_historico:resetar()
</Binding>
<Binding name="DETAILS_SCROLL_DOWN" description="Scroll down the window which you have the mouse over." header="Details">
DetailsKeyBindScrollDown()
</Binding>
<Binding name="DETAILS_SCROLL_UP" description="Scroll up the window which you have the mouse over." header="Details">
DetailsKeyBindScrollUp()
</Binding>
</Bindings>
+1
View File
@@ -12,6 +12,7 @@ locales\Details-ptBR.lua
locales\Details-enUS.lua
boot.lua
indent.lua
core\util.lua
functions\profiles.lua
+1 -1
View File
@@ -791,7 +791,7 @@ end
elseif (not _table) then
return "", {0, 1, 0, 1}
end
return _table [CONST_INDEX_AVATAR_PATH] or default "", _table [CONST_INDEX_AVATAR_TEXCOORD] or {0, 1, 0, 1}
return _table [CONST_INDEX_AVATAR_PATH] or default or "", _table [CONST_INDEX_AVATAR_TEXCOORD] or {0, 1, 0, 1}
end
end
-1
View File
@@ -10,7 +10,6 @@
<Include file="LibSharedMedia-3.0\lib.xml" />
<Include file="NickTag-1.0\NickTag-1.0.xml" />
<Include file="LibHotCorners\LibHotCorners.xml" />
<Script file="LibDataBroker-1.1\LibDataBroker-1.1.lua"/>
<Script file="LibDBIcon-1.0\LibDBIcon-1.0.lua"/>
<Script file="LibGraph-2.0\LibGraph-2.0.lua"/>
+10 -5
View File
@@ -5,10 +5,10 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> global name declaration
_ = nil
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0", "LibHotCorners")
_detalhes.userversion = "v1.13.1"
_detalhes.userversion = "v1.13.5" --options iniciando junto
_detalhes.version = "Alpha 017"
_detalhes.realversion = 17
@@ -34,8 +34,6 @@ do
_detalhes.parser_frame:Hide()
--> armazena os escudos - Shields information for absorbs
_detalhes.escudos = {}
--> armazena os overwirtes de spells pelo usuario
_detalhes.SpellOverwriteUser = {}
--> armazena as funções dos frames - Frames functions
_detalhes.gump = {}
--> armazena as funções para inicialização dos dados - Metatable functions
@@ -260,6 +258,13 @@ do
_detalhes:Msg ("|cffb0b0b0you can always reset the addon running the command '/details reinstall' if it does fail to load after being updated.|r")
end
_detalhes:ScheduleTimer ("WelcomeMsgLogon", 8)
--> key binds
--> header
_G ["BINDING_HEADER_Details"] = "Details!"
--> keys
_G ["BINDING_NAME_DETAILS_RESET_SEGMENTS"] = "Reset Segments"
_G ["BINDING_NAME_DETAILS_SCROLL_UP"] = "Scroll Up All Windows"
_G ["BINDING_NAME_DETAILS_SCROLL_DOWN"] = "Scroll Down All Windows"
end
+7 -5
View File
@@ -89,7 +89,7 @@ function combate:NovaTabela (iniciada, _tabela_overall, combatId, ...)
esta_tabela.frags_need_refresh = false
--> time data container
esta_tabela.TimeData = _detalhes.timeContainer:CreateTimeTable()
esta_tabela.TimeData = _detalhes:TimeDataCreateCombatTables()
--> Skill cache (not used)
esta_tabela.CombatSkillCache = {}
@@ -165,10 +165,10 @@ function combate:NovaTabela (iniciada, _tabela_overall, combatId, ...)
return esta_tabela
end
function combate:GetTimeData (dataType)
--if (not dataType) then
return self.TimeData
--end
function combate:GetTimeData (name)
return self.TimeData [name]
end
function combate:TravarTempos()
@@ -236,6 +236,8 @@ function combate:GetCombatTime()
end
end
--[[global]] DETAILS_TOTALS_ONLYGROUP = true
function combate:GetTotal (attribute, subAttribute, onlyGroup)
if (attribute == 1 or attribute == 2) then
if (onlyGroup) then
+17 -2
View File
@@ -61,7 +61,16 @@ local segmentos = _detalhes.segmentos
------------------------------------------------------------------------------------------------------------------------
--> chama a função para ser executada em todas as instâncias
--> API: call a function to all enabled instances
function _detalhes:InstanceCall (funcao, ...)
for index, instance in _ipairs (_detalhes.tabela_instancias) do
if (instance:IsAtiva()) then --> only enabled
funcao (instance, ...)
end
end
end
--> chama a função para ser executada em todas as instâncias (internal)
function _detalhes:InstanciaCallFunction (funcao, ...)
for index, instancia in _ipairs (_detalhes.tabela_instancias) do
if (instancia:IsAtiva()) then --> só reabre se ela estiver ativa
@@ -70,7 +79,7 @@ function _detalhes:InstanciaCallFunction (funcao, ...)
end
end
--> chama a função para ser executada em todas as instâncias
--> chama a função para ser executada em todas as instâncias (internal)
function _detalhes:InstanciaCallFunctionOffline (funcao, ...)
for index, instancia in _ipairs (_detalhes.tabela_instancias) do
funcao (_, instancia, ...)
@@ -330,6 +339,12 @@ end
end
end
self:SetCombatAlpha (nil, nil, true)
--if (self.hide_out_of_combat and not UnitAffectingCombat ("player")) then
-- self:SetWindowAlphaForCombat (true, true)
--end
if (not temp and not _detalhes.initializing) then
_detalhes:SendEvent ("DETAILS_INSTANCE_OPEN", nil, self)
end
+5
View File
@@ -54,6 +54,8 @@ _detalhes.instance_defaults = {
hide_icon = false,
--anchor side of main window toolbar (1 = top 2 = bottom)
toolbar_side = 1,
--micro displays side
micro_displays_side = 2,
--stretch button anchor side (1 = top 2 = bottom)
stretch_button_side = 1,
--where plugins icon will be placed on main window toolbar (1 = left 2 = right)
@@ -139,6 +141,9 @@ _detalhes.instance_defaults = {
color_buttons = {1, 1, 1, 1},
--hide in combat
hide_in_combat = false,
hide_out_of_combat = false,
hide_in_combat_type = 1,
hide_in_combat_alpha = 0,
--strata
strata = "LOW",
+5 -6
View File
@@ -323,9 +323,8 @@
--> hide / alpha in combat
for index, instancia in ipairs (_detalhes.tabela_instancias) do
if (instancia.ativa) then
if (instancia.hide_in_combat) then
instancia:SetWindowAlphaForCombat (true)
end
instancia:SetCombatAlpha (nil, nil, true)
if (instancia.auto_switch_to) then
--salva o estado atual
@@ -572,9 +571,9 @@
--> hide / alpha in combat
for index, instancia in ipairs (_detalhes.tabela_instancias) do
if (instancia.ativa) then
if (instancia.hide_in_combat) then
instancia:SetWindowAlphaForCombat (false)
end
instancia:SetCombatAlpha (nil, nil, true)
if (instancia.auto_switch_to_old) then
instancia:SwitchBack()
end
+4 -1
View File
@@ -2740,6 +2740,7 @@
_detalhes:IniciarColetaDeLixo (true)
_detalhes:WipePets()
_detalhes:SchedulePetUpdate (1)
_detalhes:InstanceCall (_detalhes.SetCombatAlpha, nil, nil, true)
end
else
_detalhes.in_group = IsInGroup() or IsInRaid()
@@ -2749,6 +2750,7 @@
_detalhes:WipePets()
_detalhes:SchedulePetUpdate (1)
_table_wipe (_detalhes.details_users)
_detalhes:InstanceCall (_detalhes.SetCombatAlpha, nil, nil, true)
else
_detalhes:SchedulePetUpdate (2)
_detalhes:CheckDetailsUsers()
@@ -2815,6 +2817,7 @@
_detalhes.popup = _G.GameCooltip
end
_detalhes.in_group = IsInGroup() or IsInRaid()
--_detalhes:ApplyBasicKeys()
@@ -2822,7 +2825,7 @@
--> write into details object all basic keys
_detalhes:ApplyBasicKeys()
--> check if is first run
_detalhes:IsFirstRun()
_detalhes:LoadGlobalAndCharacterData()
--> load all the saved combats
_detalhes:LoadCombatTables()
--> load the profiles
+24 -3
View File
@@ -78,7 +78,14 @@
--> functions to set the three statusbar places: left, center and right
function _detalhes.StatusBar:SetCenterPlugin (instance, childObject, fromStartup)
childObject.frame:Show()
childObject.frame:SetPoint ("center", instance.baseframe.rodape.StatusBarCenterAnchor, "center")
childObject.frame:ClearAllPoints()
if (instance.micro_displays_side == 2) then --> default - bottom
childObject.frame:SetPoint ("center", instance.baseframe.rodape.StatusBarCenterAnchor, "center")
elseif (instance.micro_displays_side == 1) then --> top side
childObject.frame:SetPoint ("center", instance.baseframe.cabecalho.StatusBarCenterAnchor, "center")
end
_detalhes.StatusBar:AlignPluginText (childObject, 2)
instance.StatusBar.center = childObject
@@ -102,7 +109,14 @@
end
childObject.frame:Show()
childObject.frame:SetPoint ("left", instance.baseframe.rodape.StatusBarLeftAnchor, "left")
childObject.frame:ClearAllPoints()
if (instance.micro_displays_side == 2) then --> default - bottom
childObject.frame:SetPoint ("left", instance.baseframe.rodape.StatusBarLeftAnchor, "left")
elseif (instance.micro_displays_side == 1) then --> top side
childObject.frame:SetPoint ("left", instance.baseframe.cabecalho.StatusBarLeftAnchor, "left")
end
_detalhes.StatusBar:AlignPluginText (childObject, 1)
instance.StatusBar.left = childObject
@@ -121,7 +135,14 @@
function _detalhes.StatusBar:SetRightPlugin (instance, childObject, fromStartup)
childObject.frame:Show()
childObject.frame:SetPoint ("right", instance.baseframe.rodape.direita, "right", -20, 10)
childObject.frame:ClearAllPoints()
if (instance.micro_displays_side == 2) then --> default - bottom
childObject.frame:SetPoint ("right", instance.baseframe.rodape.direita, "right", -20, 10)
elseif (instance.micro_displays_side == 1) then --> top side
childObject.frame:SetPoint ("right", instance.baseframe.cabecalho.StatusBarRightAnchor, "right")
end
_detalhes.StatusBar:AlignPluginText (childObject, 3)
instance.StatusBar.right = childObject
+1 -1
View File
@@ -258,7 +258,7 @@
--> is in combat yet?
function _detalhes:EstaEmCombate()
_detalhes.tabela_vigente.TimeData:Record()
_detalhes:TimeDataTick()
if (_detalhes.zone_type == "pvp" or _InCombatLockdown()) then
return true
+2 -2
View File
@@ -283,10 +283,10 @@ local ButtonMetaFunctions = {}
_rawset (self, "func", cleanfunction)
end
if (param1) then
if (param1 ~= nil) then
_rawset (self, "param1", param1)
end
if (param2) then
if (param2 ~= nil) then
_rawset (self, "param2", param2)
end
+279 -2
View File
@@ -551,8 +551,286 @@ function gump:NewPanel (parent, container, name, member, w, h, backdrop, backdro
return PanelObject
end
------------color pick
------------fill panel
local button_on_enter = function (self)
self.MyObject._icon:SetBlendMode ("ADD")
end
local button_on_leave = function (self)
self.MyObject._icon:SetBlendMode ("BLEND")
end
function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_row, autowidth, options)
local panel = gump:NewPanel (parent, parent, name, member, w, h)
panel.backdrop = nil
options = options or {rowheight = 20}
panel.rows = {}
for index, t in ipairs (rows) do
local thisrow = gump:NewPanel (panel, panel, "$parentHeader_" .. name .. index, nil, 1, 20)
thisrow.backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Gold-Background]]}
thisrow.color = "silver"
thisrow.type = t.type
thisrow.func = t.func
thisrow.name = t.name
thisrow.notext = t.notext
thisrow.icon = t.icon
thisrow.iconalign = t.iconalign
local text = gump:NewLabel (thisrow, nil, name .. "$parentLabel", "text")
text:SetPoint ("left", thisrow, "left", 2, 0)
text:SetText (t.name)
tinsert (panel.rows, thisrow)
end
local cur_width = 0
local row_width = w / #rows
local anchors = {}
for index, row in ipairs (panel.rows) do
if (autowidth) then
row:SetWidth (row_width)
row:SetPoint ("topleft", panel, "topleft", cur_width, 0)
tinsert (anchors, cur_width)
cur_width = cur_width + row_width + 1
else
row:SetPoint ("topleft", panel, "topleft", cur_width, 0)
row.width = rows [index].width
tinsert (anchors, cur_width)
cur_width = cur_width + rows [index].width + 1
end
end
if (autowidth) then
panel.rows [#panel.rows]:SetWidth (row_width - #rows + 1)
else
panel.rows [#panel.rows]:SetWidth (rows [#rows].width - #rows + 1)
end
local refresh_fillbox = function (self)
local offset = FauxScrollFrame_GetOffset (self)
local filled_lines = total_lines()
for index = 1, #self.lines do
local row = self.lines [index]
if (index <= filled_lines) then
local real_index = index + offset
local results = fill_row (real_index)
if (results [1]) then
row:Show()
for i = 1, #row.row_widgets do
row.row_widgets [i].index = real_index
if (panel.rows [i].type == "icon") then
local result = results [i]:gsub (".-%\\", "")
row.row_widgets [i].icon.texture = results [i]
elseif (panel.rows [i].type == "button") then
if (type (results [i]) == "table") then
if (results [i].text) then
row.row_widgets [i]:SetText (results [i].text)
end
if (results [i].icon) then
row.row_widgets [i]._icon:SetTexture (results [i].icon)
end
if (results [i].func) then
row.row_widgets [i]:SetClickFunction (results [i].func, real_index, results [i].value)
end
else
row.row_widgets [i]:SetText (results [i])
end
else
--< text
row.row_widgets [i]:SetText (results [i])
end
end
else
row:Hide()
for i = 1, #row.row_widgets do
row.row_widgets [i]:SetText ("")
if (panel.rows [i].type == "icon") then
row.row_widgets [i].icon.texture = ""
end
end
end
else
row:Hide()
for i = 1, #row.row_widgets do
row.row_widgets [i]:SetText ("")
if (panel.rows [i].type == "icon") then
row.row_widgets [i].icon.texture = ""
end
end
end
end
end
function panel:Refresh()
local filled_lines = total_lines()
local scroll_total_lines = #panel.scrollframe
local line_height = options.rowheight
FauxScrollFrame_Update (panel.scrollframe, filled_lines, scroll_total_lines, line_height)
refresh_fillbox (panel.scrollframe)
end
local scrollframe = CreateFrame ("scrollframe", name .. "Scroll", panel.widget, "FauxScrollFrameTemplate")
scrollframe:SetScript ("OnVerticalScroll", function (self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 20, panel.Refresh) end)
scrollframe:SetPoint ("topleft", panel.widget, "topleft", 0, -21)
scrollframe:SetPoint ("topright", panel.widget, "topright", -23, -21)
scrollframe:SetPoint ("bottomleft", panel.widget, "bottomleft")
scrollframe:SetPoint ("bottomright", panel.widget, "bottomright", -23, 0)
scrollframe:SetSize (w, h)
panel.scrollframe = scrollframe
scrollframe.lines = {}
--create lines
local size = options.rowheight
local amount = math.floor (((h-21) / size))
for i = 1, amount do
local row = gump:NewPanel (scrollframe, nil, "$parentRow_" .. i, nil, 1, size)
row.backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]]}
row.color = {1, 1, 1, .2}
row:SetPoint ("topleft", scrollframe, "topleft", 0, (i-1) * size * -1)
row:SetPoint ("topright", scrollframe, "topright", 0, (i-1) * size * -1)
tinsert (scrollframe.lines, row)
row.row_widgets = {}
for o = 1, #rows do
local _type = panel.rows [o].type
if (_type == "text") then
--> create text
local text = gump:NewLabel (row, nil, name .. "$parentLabel" .. o, "text" .. o)
text:SetPoint ("left", row, "left", anchors [o], 0)
--> insert in the table
tinsert (row.row_widgets, text)
elseif (_type == "entry") then
--> create editbox
local editbox = gump:NewTextEntry (row, nil, "$parentEntry" .. o, "entry", panel.rows [o].width, 20, panel.rows [o].func, i, o)
editbox.align = "left"
editbox:SetHook ("OnEnterPressed", function()
editbox.widget.focuslost = true
editbox:ClearFocus()
editbox.func (editbox.index, editbox.text)
return true
end)
editbox:SetPoint ("left", row, "left", anchors [o], 0)
editbox:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = 1})
editbox:SetBackdropColor (1, 1, 1, 0.1)
editbox:SetBackdropBorderColor (1, 1, 1, 0.1)
--> insert in the table
tinsert (row.row_widgets, editbox)
elseif (_type == "button") then
--> create button
local button = gump:NewButton (row, nil, "$parentButton" .. o, "button", 60, 20)
--[
local func = function()
panel.rows [o].func (button.index, o)
panel:Refresh()
end
button:SetClickFunction (func)
--]]
button:SetPoint ("left", row, "left", anchors [o], 0)
--> create icon and the text
local icon = gump:NewImage (button, nil, 20, 20)
local text = gump:NewLabel (button)
button._icon = icon
button._text = text
button:SetHook ("OnEnter", button_on_enter)
button:SetHook ("OnLeave", button_on_leave)
if (panel.rows [o].icon) then
icon.texture = panel.rows [o].icon
if (panel.rows [o].iconalign) then
if (panel.rows [o].iconalign == "center") then
icon:SetPoint ("center", button, "center")
elseif (panel.rows [o].iconalign == "right") then
icon:SetPoint ("right", button, "right")
end
else
icon:SetPoint ("left", button, "left")
end
end
if (panel.rows [o].name and not panel.rows [o].notext) then
text:SetPoint ("left", icon, "right", 2, 0)
text.text = panel.rows [o].name
end
--> inser in the table
tinsert (row.row_widgets, button)
elseif (_type == "icon") then
--> create button and icon
local iconbutton = gump:NewButton (row, nil, "$parentIconButton" .. o, "iconbutton", 20, 20)
iconbutton:InstallCustomTexture()
local icon = gump:NewImage (iconbutton, nil, 20, 20, "artwork", nil, "icon", "$parentIcon" .. o)
iconbutton:SetPoint ("left", row, "left", anchors [o], 0)
icon:SetPoint ("left", iconbutton, "left", 0, 0)
--> set functions
local function iconcallback (texture)
iconbutton.icon.texture = texture
panel.rows [o].func (iconbutton.index, texture)
end
iconbutton:SetClickFunction (function()
gump:IconPick (iconcallback)
return true
end)
--> insert in the table
tinsert (row.row_widgets, iconbutton)
end
end
end
return panel
end
------------color pick
local color_pick_func = function()
local r, g, b = ColorPickerFrame:GetColorRGB()
local a = OpacitySliderFrame:GetValue()
@@ -588,7 +866,6 @@ function gump:ColorPick (frame, r, g, b, alpha, callback)
end
------------icon pick
function gump:IconPick (callback)
if (not gump.IconPickFrame) then
+4
View File
@@ -269,6 +269,10 @@ function gump:NewImage (parent, texture, w, h, layer, coords, member, name)
end
end
if (coords and type (coords) == "table" and coords [4]) then
ImageObject.image:SetTexCoord (unpack (coords))
end
setmetatable (ImageObject, ImageMetaFunctions)
return ImageObject
+141 -4
View File
@@ -268,6 +268,7 @@ local TextEntryMetaFunctions = {}
textentry.mouse_over = true
if (textentry:IsEnabled()) then
textentry.current_bordercolor = textentry.current_bordercolor or {textentry:GetBackdropBorderColor()}
textentry:SetBackdropBorderColor (0.5, 0.5, 0.5, 1)
end
@@ -295,7 +296,7 @@ local TextEntryMetaFunctions = {}
textentry.mouse_over = false
if (textentry:IsEnabled()) then
textentry:SetBackdropBorderColor(0.3, 0.3, 0.3, 0.8)
textentry:SetBackdropBorderColor (unpack (textentry.current_bordercolor))
end
local parent = textentry:GetParent().MyObject
@@ -360,8 +361,8 @@ local TextEntryMetaFunctions = {}
end
end
textentry:SetText("")
textentry.MyObject.currenttext = ""
--textentry:SetText("")
--textentry.MyObject.currenttext = ""
textentry.focuslost = true
textentry:ClearFocus()
end
@@ -491,9 +492,11 @@ function gump:NewTextEntry (parent, container, name, member, w, h, func, param1,
--> misc
TextEntryObject.container = container
TextEntryObject.have_tooltip = nil
TextEntryObject.editbox = CreateFrame ("EditBox", name, parent, "DetailsEditBoxTemplate2")
TextEntryObject.widget = TextEntryObject.editbox
TextEntryObject.editbox:SetTextInsets (3, 0, 0, -3)
if (not APITextEntryFunctions) then
APITextEntryFunctions = true
@@ -559,4 +562,138 @@ function gump:NewTextEntry (parent, container, name, member, w, h, func, param1,
return TextEntryObject
end
local SpellEntryOnEditFocusGained = function (self)
local start_build_cache = _detalhes:BuildSpellListSlow()
if (start_build_cache) then
DetailsLoadSpellCacheProgress:SetPoint ("left", self, "right", 2, 0)
end
end
local SpellEntryOnClickMenu = function (_, _, SpellID, editbox)
editbox:SetText (SpellID)
editbox:PressEnter()
editbox.HaveMenu = false
GameCooltip:ShowMe (false)
end
local SpellEntryOnTextChanged = function (editbox, userChanged)
if (not userChanged) then
return
elseif (not _detalhes.spellcachefull) then
return
end
editbox = editbox.MyObject
local text = editbox:GetText()
text = _detalhes:trim (text)
text = string.lower (text)
local LetterIndex = string.sub (text, 1, 1)
local LetterIndex_CacheContainer = _detalhes.spellcachefull [LetterIndex]
if (LetterIndex_CacheContainer) then
local GameCooltip = _G.GameCooltip
_detalhes:CooltipPreset (1)
GameCooltip:SetType ("menu")
GameCooltip:SetOwner (editbox.widget)
GameCooltip:SetOption ("NoLastSelectedBar", true)
GameCooltip:SetOption ("TextSize", 9)
local i = 1
for SpellID, SpellTable in pairs (LetterIndex_CacheContainer) do
if (string.lower (SpellTable[1]):find (text)) then
GameCooltip:AddMenu (1, SpellEntryOnClickMenu, SpellID, editbox, nil, SpellID..": "..SpellTable[1], SpellTable[2], true)
if (i > 20) then
break
else
i = i + 1
end
end
end
editbox.HaveMenu = true
GameCooltip.buttonOver = true
GameCooltip:ShowCooltip()
end
end
function gump:NewSpellEntry (parent, func, w, h, param1, param2, member, name)
local editbox = gump:NewTextEntry (parent, parent, name, member, w, h, func, param1, param2)
editbox:SetHook ("OnEditFocusGained", SpellEntryOnEditFocusGained)
editbox:SetHook ("OnTextChanged", SpellEntryOnTextChanged)
return editbox
end
local function_gettext = function (self)
return self.editbox:GetText()
end
local function_settext = function (self, text)
return self.editbox:SetText (text)
end
local function_clearfocus = function (self)
return self.editbox:ClearFocus()
end
local function_setfocus = function (self)
return self.editbox:SetFocus (true)
end
function gump:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent)
if (name:find ("$parent")) then
name = name:gsub ("$parent", parent:GetName())
end
local borderframe = CreateFrame ("Frame", name, parent)
borderframe:SetSize (w, h)
if (member) then
parent [member] = borderframe
end
local scrollframe = CreateFrame ("ScrollFrame", name, borderframe, "DetailsEditBoxMultiLineTemplate")
scrollframe:SetScript ("OnSizeChanged", function (self)
scrollframe.editbox:SetSize (self:GetSize())
end)
scrollframe:SetPoint ("topleft", borderframe, "topleft", 10, -10)
scrollframe:SetPoint ("bottomright", borderframe, "bottomright", -30, 10)
scrollframe.editbox:SetMultiLine (true)
scrollframe.editbox:SetJustifyH ("left")
scrollframe.editbox:SetJustifyV ("top")
scrollframe.editbox:SetMaxBytes (40960)
scrollframe.editbox:SetMaxLetters (20000)
borderframe.GetText = function_gettext
borderframe.SetText = function_settext
borderframe.ClearFocus = function_clearfocus
borderframe.SetFocus = function_setfocus
if (not nointent) then
IndentationLib.enable (scrollframe.editbox, nil, 4)
end
borderframe:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
tile = 1, tileSize = 16, edgeSize = 16, insets = {left = 5, right = 5, top = 5, bottom = 5}})
borderframe:SetBackdropColor (0.090195, 0.090195, 0.188234, 1)
borderframe:SetBackdropBorderColor (1, 1, 1, 1)
borderframe.scroll = scrollframe
borderframe.editbox = scrollframe.editbox
return borderframe
end
+26
View File
@@ -33,4 +33,30 @@
</Layers>
</EditBox>
<ScrollFrame name="DetailsEditBoxMultiLineTemplate" inherits="UIPanelScrollFrameTemplate" virtual="true">
<Size x="232" y="20"/>
<ScrollChild>
<EditBox name="$parentEditBox" multiLine="true" letters="255" autoFocus="false" countInvisibleLetters="true" parentKey="editbox">
<Size x="232" y="20"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT" />
<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT" />
<Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT" />
<Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT" />
</Anchors>
<Scripts>
<OnTextChanged>
<!-- ScrollingEdit_OnTextChanged (self, self:GetParent()); -->
</OnTextChanged>
<OnCursorChanged function="ScrollingEdit_OnCursorChanged"/>
<OnUpdate>
<!-- ScrollingEdit_OnUpdate (self, elapsed, self:GetParent());-->
</OnUpdate>
<OnEscapePressed function="EditBox_ClearFocus"/>
</Scripts>
<FontString inherits="GameFontHighlightSmall"/>
</EditBox>
</ScrollChild>
</ScrollFrame>
</Ui>
+32
View File
@@ -6,10 +6,42 @@ do
--> Globals
--[[global]] DETAILS_ATTRIBUTE_DAMAGE = 1
--[[global]] DETAILS_SUBATTRIBUTE_DAMAGEDONE = 1
--[[global]] DETAILS_SUBATTRIBUTE_DPS = 2
--[[global]] DETAILS_SUBATTRIBUTE_DAMAGETAKEN = 3
--[[global]] DETAILS_SUBATTRIBUTE_FRIENDLYFIRE = 4
--[[global]] DETAILS_SUBATTRIBUTE_FRAGS = 5
--[[global]] DETAILS_SUBATTRIBUTE_ENEMIES = 6
--[[global]] DETAILS_SUBATTRIBUTE_VOIDZONES = 7
--[[global]] DETAILS_ATTRIBUTE_HEAL = 2
--[[global]] DETAILS_SUBATTRIBUTE_HEALDONE = 1
--[[global]] DETAILS_SUBATTRIBUTE_HPS = 2
--[[global]] DETAILS_SUBATTRIBUTE_OVERHEAL = 3
--[[global]] DETAILS_SUBATTRIBUTE_HEALTAKEN = 4
--[[global]] DETAILS_SUBATTRIBUTE_HEALENEMY = 5
--[[global]] DETAILS_SUBATTRIBUTE_HEALPREVENTED = 6
--[[global]] DETAILS_ATTRIBUTE_ENERGY = 3
--[[global]] DETAILS_SUBATTRIBUTE_REGENMANA = 1
--[[global]] DETAILS_SUBATTRIBUTE_REGENRAGE = 2
--[[global]] DETAILS_SUBATTRIBUTE_REGENENERGY = 3
--[[global]] DETAILS_SUBATTRIBUTE_REGENRUNE = 4
--[[global]] DETAILS_ATTRIBUTE_MISC = 4
--[[global]] DETAILS_SUBATTRIBUTE_CCBREAK = 1
--[[global]] DETAILS_SUBATTRIBUTE_RESS = 2
--[[global]] DETAILS_SUBATTRIBUTE_INTERRUPT = 3
--[[global]] DETAILS_SUBATTRIBUTE_DISPELL = 4
--[[global]] DETAILS_SUBATTRIBUTE_DEATH = 5
--[[global]] DETAILS_SUBATTRIBUTE_DCOOLDOWN = 6
--[[global]] DETAILS_SUBATTRIBUTE_BUFFUPTIME = 7
--[[global]] DETAILS_SUBATTRIBUTE_DEBUFFUPTIME = 8
_detalhes.atributos_capture = {
"damage", --damage done
"damage", --dps
+6 -6
View File
@@ -81,9 +81,9 @@ end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> On Details! Load:
--> check if this is a first run, reset, or else.
--> check if this is a first run, reset, or just load the saved data.
function _detalhes:IsFirstRun()
function _detalhes:LoadGlobalAndCharacterData()
--> check and build the default container for character database
if (not _detalhes_database) then
@@ -270,15 +270,15 @@ function _detalhes:LoadConfig()
--> custom
_detalhes.custom = _detalhes_global.custom
--> parser
--> initialize parser
_detalhes.capture_current = {}
for captureType, captureValue in pairs (_detalhes.capture_real) do
_detalhes.capture_current [captureType] = captureValue
end
--> spells overwrite
_detalhes.SpellOverwriteUser = _detalhes_global.SpellOverwriteUser or _detalhes.SpellOverwriteUser
--> initialize spell cache
_detalhes:ClearSpellCache()
--> version first run
if (not _detalhes_database.last_version or _detalhes_database.last_version ~= _detalhes.userversion) then
_detalhes.is_version_first_run = true
+2
View File
@@ -605,6 +605,8 @@ local default_global_data = {
__profiles = {},
custom = {},
savedStyles = {},
savedCustomSpells = {},
savedTimeCaptures = {},
tutorial = {logons = 0, unlock_button = 0, version_announce = 0, main_help_button = 0, alert_frames = {false, false, false, false, false, false}, },
}
+2 -3
View File
@@ -435,6 +435,8 @@ function _detalhes:SaveConfig()
_detalhes_database.tabela_instancias = _detalhes.tabela_instancias
_detalhes_database.tabela_historico = _detalhes.tabela_historico
_detalhes:TimeDataCleanUpTemporary()
--> buffs
_detalhes.Buffs:SaveBuffs()
@@ -476,8 +478,5 @@ function _detalhes:SaveConfig()
_detalhes_database.last_realversion = _detalhes.realversion --> core number
_detalhes_database.last_version = _detalhes.userversion --> version
_detalhes_global.got_first_run = true
--> overwrite spells
_detalhes_global.SpellOverwriteUser = _detalhes.SpellOverwriteUser
end
+6 -2
View File
@@ -138,7 +138,7 @@ local _
-- the four anchors:
icon_point_anchor = {-37, 0},
left_corner_anchor = {-107, 0},
close_button_anchor = {5, -6},
close_button_anchor = {3, -5},
right_corner_anchor = {96, 0},
icon_point_anchor_bottom = {-37, 12},
@@ -146,8 +146,12 @@ local _
close_button_anchor_bottom = {5, 6},
right_corner_anchor_bottom = {96, 0},
close_button_size = {32, 32},
close_button_size = {26, 26},
instance_cprops = {
resetbutton_info = {always_small = true},
instance_button_anchor = {-19, 1},
}
})
-- 0.00048828125
+14
View File
@@ -394,6 +394,16 @@ function SlashCmdList.DETAILS (msg, editbox)
print ("Instances opened: " .. _detalhes.opened_windows)
--> debug, get a guid of something
elseif (command == "backdrop") then --> localize-me
local f = MacroFrameTextBackground
local backdrop = MacroFrameTextBackground:GetBackdrop()
vardump (backdrop)
vardump (backdrop.insets)
print ("bgcolor:",f:GetBackdropColor())
print ("bordercolor",f:GetBackdropBorderColor())
elseif (command == "myguid") then --> localize-me
local g = UnitGUID ("player")
@@ -405,6 +415,10 @@ function SlashCmdList.DETAILS (msg, editbox)
print (serial)
--tonumber((UnitGUID("target")):sub(-12, -9), 16))
elseif (command == "callfunction") then
_detalhes:InstanceCall (_detalhes.SetCombatAlpha, nil, nil, true)
elseif (command == "guid") then --> localize-me
+132 -6
View File
@@ -49,15 +49,73 @@ do
end
--> user overwrites
for spellId, spellTable in pairs (_detalhes.SpellOverwriteUser) do
local name, _, icon = _GetSpellInfo (spellId)
_rawset (_detalhes.spellcache, spellId, {spellTable.name or name, 1, spellTable.icon or icon})
-- [1] spellid [2] spellname [3] spellicon
for index, spellTable in ipairs (_detalhes.savedCustomSpells) do
_rawset (_detalhes.spellcache, spellTable [1], {spellTable [2], 1, spellTable [3]})
end
end
--> initialize spell cache
_detalhes:ClearSpellCache()
function _detalhes:UserCustomSpellUpdate (index, name, icon)
local t = _detalhes.savedCustomSpells [index]
if (t) then
t [2], t [3] = name or t [2], icon or t [3]
return _rawset (_detalhes.spellcache, t [1], {t [2], 1, t [3]})
else
return false
end
end
function _detalhes:FillUserCustomSpells()
local spells = {
[124464] = {name = GetSpellInfo (124464) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --> shadow word: pain mastery proc (priest)
[124465] = {name = GetSpellInfo (124465) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --> vampiric touch mastery proc (priest)
[124468] = {name = GetSpellInfo (124468) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --> mind flay mastery proc (priest)
[121414] = {name = GetSpellInfo (121414) .. " (Glaive #1)"}, --> glaive toss (hunter)
[120761] = {name = GetSpellInfo (120761) .. " (Glaive #2)"}, --> glaive toss (hunter)
[77451] = {name = GetSpellInfo (77451) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --> lava burst (shaman)
[45284] = {name = GetSpellInfo (45284) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --> lightningbolt (shaman)
[131079] = {name = GetSpellInfo (131079) .. " (Icy Veins)"}, --> frostbolt with icy veins glyph (mage)
[131080] = {name = GetSpellInfo (131080) .. " (Icy Veins)"}, --> ice lance with icy veins glyph (mage)
[131081] = {name = GetSpellInfo (131081) .. " (Icy Veins)"}, --> frostfire with icy veins glyph (mage)
}
for spellid, t in pairs (spells) do
local _, _, icon = GetSpellInfo (spellid)
_detalhes:UserCustomSpellAdd (spellid, t.name, icon)
end
end
function _detalhes:UserCustomSpellAdd (spellid, name, icon)
local is_overwrite = false
for index, t in ipairs (_detalhes.savedCustomSpells) do
if (t [1] == spellid) then
t[2] = name
t[3] = icon
is_overwrite = true
break
end
end
if (not is_overwrite) then
tinsert (_detalhes.savedCustomSpells, {spellid, name, icon})
end
return _rawset (_detalhes.spellcache, spellid, {name, 1, icon})
end
function _detalhes:UserCustomSpellRemove (index)
local t = _detalhes.savedCustomSpells [index]
if (t) then
local spellid = t [1]
local name, _, icon = _GetSpellInfo (spellid)
_rawset (_detalhes.spellcache, spellid, {name, 1, icon})
return tremove (_detalhes.savedCustomSpells, index)
end
return false
end
--> overwrite for API GetSpellInfo function
_detalhes.getspellinfo = function (spellid) return _unpack (_detalhes.spellcache[spellid]) end
@@ -69,6 +127,72 @@ do
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> Cache All Spells
function _detalhes:BuildSpellListSlow()
local load_frame = _G.DetailsLoadSpellCache
if (load_frame and (load_frame.completed or load_frame.inprogress)) then
return false
end
local step = 1
local max = 160000
if (not load_frame) then
load_frame = CreateFrame ("frame", "DetailsLoadSpellCache", UIParent)
load_frame:SetFrameStrata ("DIALOG")
local progress_label = load_frame:CreateFontString ("DetailsLoadSpellCacheProgress", "overlay", "GameFontHighlightSmall")
progress_label:SetText ("Loading Spells: 0%")
function _detalhes:BuildSpellListSlowTick()
progress_label:SetText ("Loading Spells: " .. load_frame:GetProgress() .. "%")
end
load_frame.tick = _detalhes:ScheduleRepeatingTimer ("BuildSpellListSlowTick", 1)
function load_frame:GetProgress()
return math.floor (step / max * 100)
end
end
local SpellCache = {a={}, b={}, c={}, d={}, e={}, f={}, g={}, h={}, i={}, j={}, k={}, l={}, m={}, n={}, o={}, p={}, q={}, r={}, s={}, t={}, u={}, v={}, w={}, x={}, y={}, z={}}
local _string_lower = string.lower
local _string_sub = string.sub
local blizzGetSpellInfo = GetSpellInfo
load_frame.inprogress = true
_detalhes.spellcachefull = SpellCache
load_frame:SetScript ("OnUpdate", function()
for spellid = step, step+500 do
local name, _, icon = blizzGetSpellInfo (spellid)
if (name) then
local LetterIndex = _string_lower (_string_sub (name, 1, 1)) --> get the first letter
local CachedIndex = SpellCache [LetterIndex]
if (CachedIndex) then
CachedIndex [spellid] = {name, icon}
end
end
end
step = step + 500
if (step > max) then
step = max
_G.DetailsLoadSpellCache.completed = true
_G.DetailsLoadSpellCache.inprogress = false
_detalhes:CancelTimer (_G.DetailsLoadSpellCache.tick)
DetailsLoadSpellCacheProgress:Hide()
load_frame:SetScript ("OnUpdate", nil)
end
end)
return true
end
function _detalhes:BuildSpellList()
local SpellCache = {a={}, b={}, c={}, d={}, e={}, f={}, g={}, h={}, i={}, j={}, k={}, l={}, m={}, n={}, o={}, p={}, q={}, r={}, s={}, t={}, u={}, v={}, w={}, x={}, y={}, z={}}
@@ -96,4 +220,6 @@ do
collectgarbage()
end
end
+1 -3
View File
@@ -1942,9 +1942,7 @@ do
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
_detalhes.SpellOverwrite = {
[124464] = {name = GetSpellInfo (124464) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --> shadow word: pain mastery proc (priest)
[124465] = {name = GetSpellInfo (124465) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --> vampiric touch mastery proc (priest)
[124468] = {name = GetSpellInfo (124468) .. " (" .. Loc ["STRING_MASTERY"] .. ")"} --> mind flay mastery proc (priest)
--[124464] = {name = GetSpellInfo (124464) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --> shadow word: pain mastery proc (priest)
}
function _detalhes:IsCooldown (spellid)
+198 -134
View File
@@ -1,162 +1,226 @@
--File Revision: 1
--Last Modification: 27/07/2013
-- Change Log:
-- 27/07/2013: Finished alpha version.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> basic stuff
local _
local _detalhes = _G._detalhes
--> mantain the enabled time captures
_detalhes.timeContainer = {}
_detalhes.timeContainer.Exec = {}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local _detalhes = _G._detalhes
local _
_detalhes.timeContainer = {
damage_recording = 0,
healing_recording = 0,
have_custom = false,
custom_functions = {},
custom_attributes = {},
current_table = {} --> place holder
}
_detalhes.timeContainer.__index = _detalhes.timeContainer
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> local pointers
local _pairs = pairs
local ipairs = ipairs
local time = time
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> details api functions
--> constants
--> remove a capture previous registred
function _detalhes:UnregisterTimeCapture (captureType)
if (type (captureType) == "number" and captureType == 1) then
if (_detalhes.timeContainer.damage_recording > 1) then
_detalhes.timeContainer.damage_recording = _detalhes.timeContainer.damage_recording - 1
end
elseif (type (captureType) == "number" and captureType == 2) then
if (_detalhes.timeContainer.healing_recording > 1) then
_detalhes.timeContainer.healing_recording = _detalhes.timeContainer.healing_recording - 1
end
elseif (type (captureType) == "string") then
if (_detalhes.timeContainer.have_custom) then
if (_detalhes.timeContainer.custom_functions [captureType]) then
_detalhes.timeContainer.custom_functions [captureType] = nil
local INDEX_NAME = 1
local INDEX_FUNCTION = 2
local INDEX_MATRIX = 3
local INDEX_AUTHOR = 4
local INDEX_VERSION = 5
local INDEX_ICON = 6
local INDEX_ENABLED = 7
local DEFAULT_USER_MATRIX = {max_value = 0, last_value = 0}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> register and unregister captures
function _detalhes:TimeDataUpdate (index_or_name, name, func, matrix, author, version, icon, is_enabled)
local this_capture
if (type (index_or_name) == "number") then
this_capture = _detalhes.savedTimeCaptures [index_or_name]
else
for index, t in ipairs (_detalhes.savedTimeCaptures) do
if (t [INDEX_NAME] == index_or_name) then
this_capture = t
end
end
end
end
--> register a new capture
function _detalhes:RegisterTimeCapture (captureType, customName, attributes)
if (type (captureType) == "number" and captureType == 1) then
if (_detalhes.timeContainer.damage_recording < 1) then
_detalhes.timeContainer.current_table.damage = {}
_detalhes.timeContainer.current_table.damageLast = 0
_detalhes.timeContainer.current_table.damageMax = 0
end
_detalhes.timeContainer.damage_recording = _detalhes.timeContainer.damage_recording + 1
elseif (type (captureType) == "number" and captureType == 2) then
if (_detalhes.timeContainer.healing_recording < 1) then
_detalhes.timeContainer.current_table.healing = {}
_detalhes.timeContainer.current_table.healingLast = 0
_detalhes.timeContainer.current_table.healingMax = 0
end
_detalhes.timeContainer.healing_recording = _detalhes.timeContainer.healing_recording + 1
elseif (type (captureType) == "function") then
if (customName) then
_detalhes.timeContainer.have_custom = true
_detalhes.timeContainer.custom_functions [customName] = captureType
_detalhes.timeContainer.custom_attributes [customName] = attributes or {}
_detalhes.timeContainer.current_table [customName .. "Data"] = {}
_detalhes.timeContainer.current_table [customName .. "Attributes"] = {}
if (attributes) then
for k, v in pairs (attributes) do
_detalhes.timeContainer.current_table [customName .. "Attributes"][k] = v
end
end
end
if (not this_capture) then
return false
end
if (this_capture.do_not_save) then
return _detalhes:Msg ("This capture belongs to a plugin and cannot be edited.")
end
this_capture [INDEX_NAME] = name or this_capture [INDEX_NAME]
this_capture [INDEX_FUNCTION] = func or this_capture [INDEX_FUNCTION]
this_capture [INDEX_MATRIX] = matrix or this_capture [INDEX_MATRIX]
this_capture [INDEX_AUTHOR] = author or this_capture [INDEX_AUTHOR]
this_capture [INDEX_VERSION] = version or this_capture [INDEX_VERSION]
this_capture [INDEX_ICON] = icon or this_capture [INDEX_ICON]
if (is_enabled ~= nil) then
this_capture [INDEX_ENABLED] = is_enabled
else
this_capture [INDEX_ENABLED] = this_capture [INDEX_ENABLED]
end
return true
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> internal functions
function _detalhes:TimeDataRegister (name, func, matrix, author, version, icon, is_enabled, force_no_save)
function _detalhes.timeContainer:CreateTimeTable()
local _t = {}
setmetatable (_t, _detalhes.timeContainer)
_t.timeIndex = 1
--
if (_detalhes.timeContainer.damage_recording > 0) then
_t.damage = {}
_t.damageLast = 0
_t.damageMax = 0
--> check name
if (not name) then
return "Couldn't register the time capture, name was nil."
end
--
if (_detalhes.timeContainer.healing_recording > 0) then
_t.healing = {}
_t.healingLast = 0
_t.healingMax = 0
end
--
if (_detalhes.timeContainer.have_custom) then
for customName, customFunction in _pairs (_detalhes.timeContainer.custom_functions) do
if (customFunction) then
_t [customName .. "Data"] = {}
_t [customName .. "Attributes"] = {}
local attributes = _detalhes.timeContainer.custom_attributes [customName]
local attributeTable = _t [customName .. "Attributes"]
for k, v in pairs (attributes) do
attributeTable [k] = v
end
end
--> check if the name already exists
for index, t in ipairs (_detalhes.savedTimeCaptures) do
if (t [INDEX_NAME] == name) then
return "Couldn't register the time capture, name already registred."
end
end
_detalhes.timeContainer.current_table = _t
--> check function
if (not func) then
return "Couldn't register the time capture, invalid function."
end
return _t
local no_save = nil
--> passed a function means that this isn't came from a user
--> so the plugin register the capture every time it loads.
if (type (func) == "function") then
no_save = true
--> this a custom capture from a user, so we register a default user table for matrix
elseif (type (func) == "string") then
matrix = DEFAULT_USER_MATRIX
end
if (not no_save and force_no_save) then
no_save = true
end
--> check matrix
if (not matrix or type (matrix) ~= "table") then
return "Couldn't register the time capture, matrix was invalid."
end
author = author or "Unknown"
version = version or "v1.0"
icon = icon or [[Interface\InventoryItems\WoWUnknownItem01]]
tinsert (_detalhes.savedTimeCaptures, {name, func, matrix, author, version, icon, is_enabled, do_not_save = no_save})
return true
end
--> unregister
function _detalhes:TimeDataUnregister (name)
if (type (name) == "number") then
return tremove (_detalhes.savedTimeCaptures, name)
else
for index, t in ipairs (_detalhes.savedTimeCaptures) do
if (t [INDEX_NAME] == name) then
tremove (_detalhes.savedTimeCaptures, index)
return true
end
end
return false
end
end
--> cleanup when logout
function _detalhes:TimeDataCleanUpTemporary()
local new_table = {}
for index, t in ipairs (_detalhes.savedTimeCaptures) do
if (not t.do_not_save) then
tinsert (new_table, t)
end
end
_detalhes.savedTimeCaptures = new_table
end
function _detalhes.timeContainer:Record()
if (self.damage_recording > 0) then
--> record damage
local currentDamage = _detalhes.tabela_vigente.totals_grupo[1]
local thisDamage = currentDamage - self.damageLast
self.damage [self.timeIndex] = thisDamage
if (thisDamage > self.damageMax) then
self.damageMax = thisDamage
end
self.damageLast = currentDamage
end
local tick_time = 0
--> starting a combat
function _detalhes:TimeDataCreateCombatTables()
if (self.healing_recording > 0) then
--> record healing
local currentHealing = _detalhes.tabela_vigente.totals_grupo[2]
self.healing [self.timeIndex] = currentHealing - self.healingLast
if (currentHealing > self.healingMax) then
self.healingMax = currentHealing
end
self.healingLast = currentHealing
end
--> create capture table
local data_captured = {}
--> drop the last capture exec table without wiping
local exec = {}
_detalhes.timeContainer.Exec = exec
if (self.have_custom) then
--> record unknow, handled by function
for customName, customFunction in _pairs (self.custom_functions) do
if (customFunction) then
customFunction (self.timeIndex, self [customName .. "Data"], self [customName .. "Attributes"])
--> build the exec table
for index, t in ipairs (_detalhes.savedTimeCaptures) do
if (t [INDEX_ENABLED]) then
local data = {}
data_captured [t [INDEX_NAME]] = data
if (type (t [INDEX_FUNCTION]) == "string") then
--> user
local func = loadstring (t [INDEX_FUNCTION])
if (func) then
tinsert (exec, { func = func, data = data, attributes = table_deepcopy (t [INDEX_MATRIX]), is_user = true })
end
else
--> plugin
tinsert (exec, { func = t [INDEX_FUNCTION], data = data, attributes = table_deepcopy (t [INDEX_MATRIX]) })
end
end
end
tick_time = 0
--> return the capture table the to combat object
return data_captured
end
local exec_user_func = function (func, attributes, data, this_second)
self.timeIndex = self.timeIndex + 1
end
local result = func()
local current = result - attributes.last_value
data [this_second] = current
if (current > attributes.max_value) then
attributes.max_value = current
data.max_value = current
end
attributes.last_value = result
end
function _detalhes:TimeDataTick()
tick_time = tick_time + 1
for index, t in ipairs (_detalhes.timeContainer.Exec) do
if (t.is_user) then
--> by a user
exec_user_func (t.func, t.attributes, t.data, tick_time)
else
--> by a plugin
t.func (t.attributes, t.data, tick_time)
end
end
end
+879 -190
View File
File diff suppressed because it is too large Load Diff
+171 -7
View File
@@ -1583,6 +1583,7 @@ end
local function button_up_scripts (main_frame, backgrounddisplay, instancia, scrollbar)
main_frame.button_up:SetScript ("OnMouseDown", function(self)
if (not scrollbar:IsEnabled()) then
return
end
@@ -1621,6 +1622,61 @@ local function button_up_scripts (main_frame, backgrounddisplay, instancia, scro
end)
end
function DetailsKeyBindScrollUp()
local last_key_pressed = _detalhes.KeyBindScrollUpLastPressed or GetTime()-0.3
local to_top = false
if (last_key_pressed+0.2 > GetTime()) then
to_top = true
end
_detalhes.KeyBindScrollUpLastPressed = GetTime()
for index, instance in ipairs (_detalhes.tabela_instancias) do
if (instance:IsEnabled()) then
local scrollbar = instance.scroll
local A = instance.barraS[1]
if (A and A > 1) then
if (to_top) then
scrollbar:SetValue (0)
scrollbar.ultimo = 0
instance.baseframe.button_up:Disable()
else
scrollbar:SetValue (scrollbar:GetValue() - instance.row_height*2)
end
elseif (A) then
scrollbar:SetValue (0)
scrollbar.ultimo = 0
instance.baseframe.button_up:Disable()
end
end
end
end
function DetailsKeyBindScrollDown()
for index, instance in ipairs (_detalhes.tabela_instancias) do
if (instance:IsEnabled()) then
local scrollbar = instance.scroll
local B = instance.barraS[2]
if (B and B < instance.rows_showing) then
scrollbar:SetValue (scrollbar:GetValue() + instance.row_height*2)
elseif (B) then
local _, maxValue = scrollbar:GetMinMaxValues()
scrollbar:SetValue (maxValue)
scrollbar.ultimo = maxValue
instance.baseframe.button_down:Disable()
end
end
end
end
local function iterate_scroll_scripts (backgrounddisplay, backgroundframe, baseframe, scrollbar, instancia)
baseframe:SetScript ("OnMouseWheel",
@@ -1930,7 +1986,7 @@ local function show_anti_overlap (instance, host, side)
anti_menu_overlap:Show()
end
--> ~inicio ~janela ~window
--> ~inicio ~janela ~window ~nova
function gump:CriaJanelaPrincipal (ID, instancia, criando)
-- main frames -----------------------------------------------------------------------------------------------------------------------------------------------
@@ -2918,7 +2974,7 @@ function _detalhes:SetWindowAlphaForInteract (alpha)
end
function _detalhes:SetWindowAlphaForCombat (entering_in_combat)
function _detalhes:SetWindowAlphaForCombat (entering_in_combat, true_hide)
local amount, rowsamount
@@ -2952,8 +3008,13 @@ function _detalhes:SetWindowAlphaForCombat (entering_in_combat)
end
--apply
gump:Fade (self.baseframe, "ALPHAANIM", amount)
gump:Fade (self.rowframe, "ALPHAANIM", rowsamount)
if (true_hide and amount == 0) then
gump:Fade (self.baseframe, _unpack (_detalhes.windows_fade_in))
gump:Fade (self.rowframe, _unpack (_detalhes.windows_fade_in))
else
gump:Fade (self.baseframe, "ALPHAANIM", amount)
gump:Fade (self.rowframe, "ALPHAANIM", rowsamount)
end
if (self.show_statusbar) then
self.baseframe.barra_fundo:Hide()
@@ -4261,13 +4322,16 @@ function _detalhes:ChangeSkin (skin_name)
self:HideSideBars()
end
--> refresh the side of the micro displays
self:MicroDisplaysSide()
--> update statusbar
if (self.show_statusbar) then
self:ShowStatusBar()
else
self:HideStatusBar()
end
--> update wallpaper
if (self.wallpaper.enabled) then
self:InstanceWallpaper (true)
@@ -4298,6 +4362,9 @@ function _detalhes:ChangeSkin (skin_name)
--> update window strata level
self:SetFrameStrata()
--> update the combat alphas
self:SetCombatAlpha (nil, nil, true)
--> update icons
_detalhes.ToolBar:ReorganizeIcons (nil, true) --call self:SetMenuAlpha()
@@ -4327,6 +4394,57 @@ function _detalhes:ChangeSkin (skin_name)
end
function _detalhes:SetCombatAlpha (modify_type, alpha_amount, interacting)
if (interacting) then
if (self.hide_in_combat_type == 1) then --None
return
elseif (self.hide_in_combat_type == 2) then --While In Combat
if (UnitAffectingCombat ("player") or InCombatLockdown()) then
self:SetWindowAlphaForCombat (true, true) --> hida a janela
else
self:SetWindowAlphaForCombat (false) --> deshida a janela
end
elseif (self.hide_in_combat_type == 3) then --"While Out of Combat"
if (UnitAffectingCombat ("player") or InCombatLockdown()) then
self:SetWindowAlphaForCombat (false) --> deshida a janela
else
self:SetWindowAlphaForCombat (true, true) --> hida a janela
end
elseif (self.hide_in_combat_type == 4) then --"While Out of a Group"
if (_detalhes.in_group) then
self:SetWindowAlphaForCombat (false) --> deshida a janela
else
self:SetWindowAlphaForCombat (true, true) --> hida a janela
end
end
return
end
if (not modify_type) then
modify_type = self.hide_in_combat_type
else
if (modify_type == 1) then --> changed to none
self:SetWindowAlphaForCombat (false)
end
end
if (not alpha_amount) then
alpha_amount = self.hide_in_combat_alpha
end
self.hide_in_combat_type = modify_type
self.hide_in_combat_alpha = alpha_amount
self:SetCombatAlpha (nil, nil, true)
end
function _detalhes:SetFrameStrata (strata)
if (not strata) then
@@ -4633,6 +4751,28 @@ function _detalhes:GetInstanceIconsCurrentAlpha()
end
end
function _detalhes:MicroDisplaysSide (side, fromuser)
if (not side) then
side = self.micro_displays_side
end
self.micro_displays_side = side
_detalhes.StatusBar:ReloadAnchors (self)
if (self.micro_displays_side == 2 and not self.show_statusbar) then --> bottom side
_detalhes.StatusBar:Hide (self)
if (fromuser) then
_detalhes:Msg (Loc ["STRING_OPTIONS_MICRODISPLAYWARNING"])
end
elseif (self.micro_displays_side == 2) then
_detalhes.StatusBar:Show (self)
elseif (self.micro_displays_side == 1) then
_detalhes.StatusBar:Show (self)
end
end
function _detalhes:ToolbarSide (side)
if (not side) then
@@ -5042,7 +5182,9 @@ function _detalhes:HideStatusBar (instancia)
self:StretchButtonAnchor()
_detalhes.StatusBar:Hide (self) --> mini displays widgets
if (self.micro_displays_side == 2) then --> bottom side
_detalhes.StatusBar:Hide (self) --> mini displays widgets
end
end
function _detalhes:StatusBarColor (r, g, b, a, no_save)
@@ -5084,7 +5226,9 @@ function _detalhes:ShowStatusBar (instancia)
self:ToolbarSide()
self:StretchButtonAnchor()
_detalhes.StatusBar:Show (self) --> mini displays widgets
if (self.micro_displays_side == 2) then --> bottom side
_detalhes.StatusBar:Show (self) --> mini displays widgets
end
end
function gump:CriaCabecalho (baseframe, instancia)
@@ -5191,6 +5335,26 @@ function gump:CriaCabecalho (baseframe, instancia)
baseframe.UPFrameConnect:SetResizable (true)
BGFrame_scripts (baseframe.UPFrameConnect, baseframe, instancia)
--> anchors para os micro displays no lado de cima da janela
local StatusBarLeftAnchor = CreateFrame ("frame", nil, baseframe)
StatusBarLeftAnchor:SetPoint ("bottomleft", baseframe, "topleft", 0, 9)
StatusBarLeftAnchor:SetWidth (1)
StatusBarLeftAnchor:SetHeight (1)
baseframe.cabecalho.StatusBarLeftAnchor = StatusBarLeftAnchor
local StatusBarCenterAnchor = CreateFrame ("frame", nil, baseframe)
StatusBarCenterAnchor:SetPoint ("center", baseframe, "center")
StatusBarCenterAnchor:SetPoint ("bottom", baseframe, "top", 0, 9)
StatusBarCenterAnchor:SetWidth (1)
StatusBarCenterAnchor:SetHeight (1)
baseframe.cabecalho.StatusBarCenterAnchor = StatusBarCenterAnchor
local StatusBarRightAnchor = CreateFrame ("frame", nil, baseframe)
StatusBarRightAnchor:SetPoint ("bottomright", baseframe, "topright", 0, 9)
StatusBarRightAnchor:SetWidth (1)
StatusBarRightAnchor:SetHeight (1)
baseframe.cabecalho.StatusBarRightAnchor = StatusBarRightAnchor
-- botões
-------------------------------------------------------------------------------------------------------------------------------------------------
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1326
View File
File diff suppressed because it is too large Load Diff
@@ -97,7 +97,45 @@ local function CreatePluginFrames (data)
--> check if was a boss fight
EncounterDetails:WasEncounter()
end
_detalhes:RegisterTimeCapture (1)
local damage_done_func = function (support_table, time_table, tick_second)
local current_total_damage = _detalhes.tabela_vigente.totals_grupo[1]
local current_damage = current_total_damage - support_table.last_damage
time_table [tick_second] = current_damage
if (current_damage > support_table.max_damage) then
support_table.max_damage = current_damage
time_table.max_damage = current_damage
end
support_table.last_damage = current_total_damage
end
local string_damage_done_func = [[
-- this script takes the current combat and request the total of damage done by the group.
-- first lets take the current combat and name it "current_combat".
local current_combat = _detalhes:GetCombat ("current") --> getting the current combat
-- now lets ask the combat for the total damage done by the raide group.
local total_damage = current_combat:GetTotal ( DETAILS_ATTRIBUTE_DAMAGE, nil, DETAILS_TOTALS_ONLYGROUP )
-- checks if the result is valid
if (not total_damage) then
return 0
end
-- with the number in hands, lets finish the code returning the amount
return total_damage
]]
--_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)
elseif (event == "COMBAT_PLAYER_ENTER") then --> combat started
if (EncounterDetails.showing) then
+6 -6
View File
@@ -95,7 +95,7 @@ do
function EncounterDetails:BuildDpsGraphic()
EncounterDetails.LastGraphicDrew = EncounterDetails.LastGraphicDrew or {}
local graphicData = _detalhes.tabela_vigente:GetTimeData()
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
@@ -105,7 +105,7 @@ do
EncounterDetails.LastGraphicDrew = graphicData
end
if (graphicData.damageMax == 0 or not graphicData.damage) then
if (graphicData.max_value == 0) then
return
end
@@ -233,12 +233,12 @@ do
lastBoss = _detalhes.tabela_vigente.is_boss and _detalhes.tabela_vigente.is_boss.index
local _data = {}
local dps_max = graphicData.damageMax
local amount = #graphicData.damage
local dps_max = graphicData.max_value
local amount = #graphicData
local scaleW = 1/670
local content = graphicData.damage
local content = graphicData
table.insert (content, 1, 0)
table.insert (content, 1, 0)
table.insert (content, #content+1, 0)
@@ -688,7 +688,7 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
local return_table = {}
for index, combate in ipairs (historico) do
if (combate.is_boss) then
if (combate.is_boss and combate.is_boss.index) then
local l, r, t, b, icon = _detalhes:GetBossIcon (combate.is_boss.mapid, combate.is_boss.index)
return_table [#return_table+1] = {value = index, label = "#" .. index .. " " .. combate.is_boss.name, icon = icon, texcoord = {l, r, t, b}, onclick = EncounterDetails.OpenAndRefresh}
end
@@ -41,41 +41,80 @@ local function CreatePluginFrames (data)
SpellDetails.data = data or {}
SpellDetails.updating = false
local timeCaptureFunction = function (second, myTimeTable, myAttributesTable)
--> second: number of the tick
--> myTimeTable: is the table wich will contain the data
--> myAttributesTable: table wich your custom parameters
local player_damage_done = function (support_table, time_table, tick_second)
if (SpellDetails.playerActor) then
--> get player total damage
local actorTotalDamage = SpellDetails.playerActor.total
--> calculate the diferente between last tick
local currentDamage = actorTotalDamage - myAttributesTable.lastDamage
--> record damage
myTimeTable [second] = currentDamage
--> check if this tick was greater then before
if (currentDamage > myAttributesTable.maxDamage) then
myAttributesTable.maxDamage = currentDamage
local player = _detalhes.tabela_vigente (1, _detalhes.playername)
if (player) then
local total_damage = player.total
local current_damage = total_damage - support_table.last_damage
time_table [tick_second] = current_damage
if (current_damage > support_table.max_damage) then
support_table.max_damage = current_damage
time_table.max_damage = current_damage
end
--> record tick total damage
myAttributesTable.lastDamage = actorTotalDamage
support_table.last_damage = total_damage
else
time_table [tick_second] = 0
end
end
local string_player_damage_done = [[
-- the goal of this script is get the current combat then get your character and extract your damage done.
-- the first thing to do is get the combat, so, we use here the command "_detalhes:GetCombat ( "overall" "current" or "segment number")"
local current_combat = _detalhes:GetCombat ("current") --> getting the current combat
-- the next step is request your character from the combat
-- to do this, we take the combat which here we named "current_combat" and tells what we want inside parentheses.
local my_self = current_combat (DETAILS_ATTRIBUTE_DAMAGE, _detalhes.playername)
-- _detalhes.playername holds the name of your character.
-- DETAILS_ATTRIBUTE_DAMAGE means we want the damage table, _HEAL _ENERGY _MISC is the other 3 tables.
-- before we proceed, the result needs to be checked to make sure its a valid result.
if (not my_self) then
return 0 -- the combat doesnt have *you*, this happens when you didn't deal any damage in the combat yet.
end
-- now its time to get the total damage.
local my_damage = my_self.total
-- then finally return the amount to the capture.
return my_damage
]]
function SpellDetails:OnDetailsEvent (event, ...)
if (event == "SHOW") then --> plugin shown on screen, actived
--> register a custom time capture // time capture is a custom function wich will run every second and grab any kind of data.
--> here we want to capture the damage of "player".
--> _detalhes:RegisterTimeCapture ( function, give a name, parameters table )
_detalhes:RegisterTimeCapture (timeCaptureFunction, "SpellDetails_PlayerDamage", {lastDamage = 0, maxDamage = 0})
elseif (event == "HIDE") then --> plugin hidded, disabled
SpellDetailsFrame:SetScript ("OnUpdate", nil)
_detalhes:UnregisterTimeCapture ("SpellDetails_PlayerDamage")
SpellDetails.playerActor = nil
elseif (event == "DETAILS_STARTED") then
-- _detalhes:TimeDataRegister ("Player Damage Done", player_damage_done, {last_damage = 0, max_damage = 0}, "Spell Details", "v1.0", [[Interface\ICONS\Achievement_Leader_Tyrande_Whisperwind]], true)
_detalhes:TimeDataRegister ("Player Damage Done", string_player_damage_done, nil, "Spell Details", "v1.0", [[Interface\ICONS\Achievement_Leader_Tyrande_Whisperwind]], true, true)
elseif (event == "REFRESH") then --> requested a refresh window
SpellDetails:Refresh()
@@ -318,21 +357,25 @@ local function CreatePluginFrames (data)
end
SpellDetails.LastGraphicDrew = SpellDetails.LastGraphicDrew or {}
local graphicData = _detalhes.tabela_vigente:GetTimeData()
local graphicData = _detalhes.tabela_vigente:GetTimeData ("Player Damage Done")
if (not graphicData) then
print ("No graphic available for this segment.")
return
end
if (graphicData == SpellDetails.LastGraphicDrew) then
return
else
SpellDetails.LastGraphicDrew = SpellDetails.LastGraphicDrew
end
if (not graphicData ["SpellDetails_PlayerDamageAttributes"]) then
return
elseif (graphicData ["SpellDetails_PlayerDamageAttributes"].maxDamage == 0) then
if (graphicData.max_damage == 0) then
return
end
if (#graphicData ["SpellDetails_PlayerDamageData"] < 2) then
if (#graphicData < 2) then
local timetooshort = SpellDetails.graphic.fundo.timetooshot or DetailsFrameWork:NewLabel (SpellDetails.graphic.fundo, SpellDetails.graphic.fundo, nil, "timetooshort", Loc ["STRING_TOOSHORT"], "GameFontHighlightSmall")
timetooshort:SetPoint ("TOPLEFT", SpellDetails.graphic.fundo, "TOPLEFT", 40, -55)
_detalhes:SetFontSize (timetooshort, 10)
@@ -346,12 +389,12 @@ local function CreatePluginFrames (data)
GraphicObject:ResetData()
local _data = {}
local dps_max = graphicData ["SpellDetails_PlayerDamageAttributes"].maxDamage
local amount = #graphicData ["SpellDetails_PlayerDamageData"]
local dps_max = graphicData.max_value
local amount = #graphicData
local scaleW = 1/288
local content = graphicData ["SpellDetails_PlayerDamageData"]
local content = graphicData
table.insert (content, 1, 0)
table.insert (content, 1, 0)
table.insert (content, #content+1, 0)
@@ -528,6 +571,8 @@ local function CreatePluginFrames (data)
--> botão para o gráfico:
local SwitchButton = DetailsFrameWork:NewDetailsButton (SpellDetailsFrame, SpellDetailsFrame, _, SpellDetails.ShowGraphic, _, _, 110, 15)
SwitchButton:SetFrameStrata ("TOOLTIP")
SwitchButton:SetFrameLevel (50)
SwitchButton:SetPoint ("TOPLEFT", SpellDetailsFrame, "TOPLEFT", 10, -274)
SwitchButton:SetFrameLevel (6)
SwitchButton:InstallCustomTexture()
+21 -1
View File
@@ -40,6 +40,12 @@ function _G._detalhes:Start()
f:SetScript ("OnMouseDown", function() f:StartMoving(); f:SetScript("OnUpdate", function() f:UpdateLeftRight() end) end)
f:SetScript ("OnMouseUp", function() f:StopMovingOrSizing(); f:SetScript("OnUpdate", nil); f:UpdateLeftRight() end)
function _detalhes:updatetestbox()
f:UpdateLeftRight()
end
_detalhes:ScheduleTimer("updatetestbox", 5)
--]]
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> details defaults
@@ -307,6 +313,9 @@ function _G._detalhes:Start()
}
self.custom [#self.custom+1] = HealingPotion
end
_detalhes:FillUserCustomSpells()
end
--_detalhes:OpenWelcomeWindow()
@@ -418,6 +427,8 @@ function _G._detalhes:Start()
lower_instance:InstanceAlert (Loc ["STRING_VERSION_UPDATE"], {[[Interface\GossipFrame\AvailableQuestIcon]], 16, 16, false}, 20, {_detalhes.OpenNewsWindow})
end
end
_detalhes:FillUserCustomSpells()
end
--> minimap
@@ -587,11 +598,13 @@ function _G._detalhes:Start()
end
end
--register lib-hotcorners
local reset_func = function() _detalhes.tabela_historico:resetar() end
_detalhes:RegisterHotCornerButton ("TOPLEFT", "DetailsLeftCornerButton", [[Interface\AddOns\Details\images\minimap]], "|cFFFFFFFFDetails!\n|cFF00FF00Left Click:|r clear all segments.", reset_func, nil, reset_func)
--> register time captures
--_detalhes:LoadUserTimeCaptures()
--[[
local f = CreateFrame ("frame", nil, UIParent)
@@ -611,5 +624,12 @@ function _G._detalhes:Start()
b:SetPoint ("left", f, "left")
b:SetAlpha (1)
--]]
--function _detalhes:OpenOptionsWindowAtStart()
--_detalhes:OpenOptionsWindow (_detalhes.tabela_instancias[1])
--end
--_detalhes:ScheduleTimer ("OpenOptionsWindowAtStart", 2)
end