diff --git a/boot.lua b/boot.lua index b343f6ed7..114c77b4a 100644 --- a/boot.lua +++ b/boot.lua @@ -6,8 +6,8 @@ local addonName, Details222 = ... local version, build, date, tocversion = GetBuildInfo() - _detalhes.build_counter = 10333 - _detalhes.alpha_build_counter = 10333 --if this is higher than the regular counter, use it instead + _detalhes.build_counter = 10334 + _detalhes.alpha_build_counter = 10334 --if this is higher than the regular counter, use it instead _detalhes.dont_open_news = true _detalhes.game_version = version _detalhes.userversion = version .. " " .. _detalhes.build_counter diff --git a/core/gears.lua b/core/gears.lua index a7c94eeb4..7201d81d6 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -3128,7 +3128,15 @@ end hooksecurefunc("ChatFrame_DisplayTimePlayed", function() if (Details.played_class_time) then - print(Details.GetPlayTimeOnClassString() .. " (/details playedclass)") + C_Timer.After(0, function() + local levelText = TIME_PLAYED_LEVEL and TIME_PLAYED_LEVEL:gsub("%%s", "") or "" + for fontString in ChatFrame1.fontStringPool:EnumerateActive() do + if (fontString:GetText() and fontString:GetText():find(levelText)) then + print(Details.GetPlayTimeOnClassString() .. " (/details playedclass)") + break + end + end + end) end end) diff --git a/core/parser.lua b/core/parser.lua index cfcadb4fb..0439c0338 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -6136,9 +6136,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _instance_backup = {}, } local exitErrors = __details_backup._exit_error - + local addToExitErrors = function(text) - table.insert(exitErrors, 1, text) + table.insert(exitErrors, 1, date() .. "|" .. text) table.remove(exitErrors, 10) end @@ -6150,7 +6150,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end) if (not savePlayTimeClass) then - addToExitErrors("Saving Play Time:" .. savePlayTimeError) + addToExitErrors("Saving Play Time: " .. savePlayTimeError) end --SAVINGDATA = true diff --git a/functions/profiles.lua b/functions/profiles.lua index 765551b29..a281a4cac 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -1443,7 +1443,7 @@ local default_global_data = { }, --auras (wa auras created from the aura panel) - details_auras = {}, + details_auras = {}, --deprecated due to major security wa code revamp --ilvl item_level_pool = {}, @@ -1467,7 +1467,7 @@ local default_global_data = { npcid_pool = {}, --aura creation frame libwindow - createauraframe = {}, + createauraframe = {}, --deprecated --min health done on the death report deathlog_healingdone_min = 1, diff --git a/functions/slash.lua b/functions/slash.lua index 43227840a..75551f9fe 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -6,10 +6,10 @@ local _ local addonName, Details222 = ... local CreateFrame = CreateFrame -local pairs = pairs +local pairs = pairs local UIParent = UIParent -local UnitGUID = UnitGUID -local tonumber= tonumber +local UnitGUID = UnitGUID +local tonumber= tonumber local LoggingCombat = LoggingCombat SLASH_PLAYEDCLASS1 = "/playedclass" @@ -30,22 +30,22 @@ function SlashCmdList.DETAILS (msg, editbox) local command, rest = msg:match("^(%S*)%s*(.-)$") command = string.lower(command) - + if (command == Loc ["STRING_SLASH_WIPE"] or command == "wipe") then - + elseif (command == "api") then _detalhes.OpenAPI() - - - + + + elseif (command == Loc ["STRING_SLASH_NEW"] or command == "new") then _detalhes:CriarInstancia(nil, true) - + elseif (command == Loc ["STRING_SLASH_HISTORY"] or command == "history" or command == "score" or command == "rank" or command == "ranking" or command == "statistics" or command == "stats") then _detalhes:OpenRaidHistoryWindow() - + elseif (command == Loc ["STRING_SLASH_TOGGLE"] or command == "toggle") then - + local instance = rest:match ("^(%S*)%s*(.-)$") instance = tonumber(instance) if (instance) then @@ -53,9 +53,9 @@ function SlashCmdList.DETAILS (msg, editbox) else _detalhes:ToggleWindows() end - + elseif (command == Loc ["STRING_SLASH_HIDE"] or command == Loc ["STRING_SLASH_HIDE_ALIAS1"] or command == "hide") then - + local instance = rest:match ("^(%S*)%s*(.-)$") instance = tonumber(instance) if (instance) then @@ -124,7 +124,7 @@ function SlashCmdList.DETAILS (msg, editbox) end end end - + elseif (command == "softshow") then for instanceID, instance in _detalhes:ListInstances() do if (instance:IsEnabled()) then @@ -133,7 +133,7 @@ function SlashCmdList.DETAILS (msg, editbox) end end end - + elseif (command == "softtoggle") then for instanceID, instance in _detalhes:ListInstances() do if (instance:IsEnabled()) then @@ -148,9 +148,9 @@ function SlashCmdList.DETAILS (msg, editbox) end end end - + elseif (command == Loc ["STRING_SLASH_SHOW"] or command == Loc ["STRING_SLASH_SHOW_ALIAS1"] or command == "show") then - + _detalhes.LastShowCommand = GetTime() local instance = rest:match ("^(%S*)%s*(.-)$") instance = tonumber(instance) @@ -162,40 +162,40 @@ function SlashCmdList.DETAILS (msg, editbox) if (not this_instance:IsEnabled() and this_instance.baseframe) then this_instance:EnableInstance() end - else + else _detalhes:ReabrirTodasInstancias() end - + elseif (command == Loc ["STRING_SLASH_WIPECONFIG"] or command == "reinstall") then _detalhes:WipeConfig() - + elseif (command == Loc ["STRING_SLASH_RESET"] or command == Loc ["STRING_SLASH_RESET_ALIAS1"] or command == "reset") then _detalhes.tabela_historico:resetar() - + elseif (command == Loc ["STRING_SLASH_DISABLE"] or command == "disable") then - + _detalhes:CaptureSet (false, "damage", true) _detalhes:CaptureSet (false, "heal", true) _detalhes:CaptureSet (false, "energy", true) _detalhes:CaptureSet (false, "miscdata", true) _detalhes:CaptureSet (false, "aura", true) _detalhes:CaptureSet (false, "spellcast", true) - + print(Loc ["STRING_DETAILS1"] .. Loc ["STRING_SLASH_CAPTUREOFF"]) - + elseif (command == Loc ["STRING_SLASH_ENABLE"] or command == "enable") then - + _detalhes:CaptureSet (true, "damage", true) _detalhes:CaptureSet (true, "heal", true) _detalhes:CaptureSet (true, "energy", true) _detalhes:CaptureSet (true, "miscdata", true) _detalhes:CaptureSet (true, "aura", true) _detalhes:CaptureSet (true, "spellcast", true) - + print(Loc ["STRING_DETAILS1"] .. Loc ["STRING_SLASH_CAPTUREON"]) - + elseif (command == Loc ["STRING_SLASH_OPTIONS"] or command == "options" or command == "config") then - + if (rest and tonumber(rest)) then local instanceN = tonumber(rest) if (instanceN > 0 and instanceN <= #_detalhes.tabela_instancias) then @@ -211,22 +211,22 @@ function SlashCmdList.DETAILS (msg, editbox) else _detalhes:OpenOptionsWindow (_detalhes:GetInstance(lower_instance)) end - + end elseif (command == Loc ["STRING_SLASH_WORLDBOSS"] or command == "worldboss") then - + local questIds = {{"Tarlna the Ageless", 81535}, {"Drov the Ruiner ", 87437}, {"Rukhmar", 87493}} - for _, _table in pairs(questIds) do + for _, _table in pairs(questIds) do print(format("%s: \124cff%s\124r", _table [1], IsQuestFlaggedCompleted (_table [2]) and "ff0000"..Loc ["STRING_KILLED"] or "00ff00"..Loc ["STRING_ALIVE"])) end - + elseif (command == Loc ["STRING_SLASH_CHANGES"] or command == Loc ["STRING_SLASH_CHANGES_ALIAS1"] or command == Loc ["STRING_SLASH_CHANGES_ALIAS2"] or command == "news" or command == "updates") then _detalhes:OpenNewsWindow() - + elseif (command == "discord") then _detalhes:CopyPaste ("https://discord.gg/AGSzAZX") - + elseif (command == "exitlog") then local newT = {} @@ -240,11 +240,19 @@ function SlashCmdList.DETAILS (msg, editbox) newT [#newT+1] = str end + newT [#newT+1] = "" + + if (__details_backup._exit_error) then + for _, str in ipairs(__details_backup._exit_error) do + newT [#newT+1] = str + end + end + Details:Dump(newT) - + elseif (command == "debugwindow") then - + local window1 = Details:GetWindow(1) if (window1) then local state = { @@ -254,19 +262,19 @@ function SlashCmdList.DETAILS (msg, editbox) IsOpen = window1:IsEnabled() and true or false, NumPoints = window1.baseframe:GetNumPoints(), } - + for i = 1, window1.baseframe:GetNumPoints() do state ["Point" .. i] = {window1.baseframe:GetPoint(i)} end - + local parent = window1.baseframe:GetParent() - + state ["ParentInfo"] = { Alpha = parent:GetAlpha(), IsShown = parent:IsShown(), NumPoints = parent:GetNumPoints(), } - + Details:Dump (state) else Details:Msg("Window 1 not found.") @@ -279,26 +287,26 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (command == "spells") then Details.OpenForge() DetailsForgePanel.SelectModule (_, _, 1) - + elseif (msg == "WA" or msg == "wa" or msg == "Wa" or msg == "wA") then _G.DetailsPluginContainerWindow.OpenPlugin(_G.DetailsAuraPanel) _G.DetailsAuraPanel.RefreshWindow() - + elseif (command == "feedback") then _detalhes.OpenFeedbackWindow() - + elseif (command == "profile") then if (rest and rest ~= "") then - + local profile = _detalhes:GetProfile (rest) if (not profile) then return _detalhes:Msg("Profile Not Found.") end - + if (not _detalhes:ApplyProfile (rest)) then return end - + _detalhes:Msg(Loc ["STRING_OPTIONS_PROFILE_LOADED"], rest) if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then _G.DetailsOptionsWindow:Hide() @@ -307,15 +315,15 @@ function SlashCmdList.DETAILS (msg, editbox) else _detalhes:Msg("/details profile ") end - + -------- debug --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - + elseif (msg == "exitlog") then - + local exitlog = _detalhes_global.exit_log local exiterrors = _detalhes_global.exit_errors - + print("EXIT LOG:") for index, text in ipairs(exitlog) do print(text) @@ -328,34 +336,34 @@ function SlashCmdList.DETAILS (msg, editbox) else print("|cFF00FF00No error occured!|r") end - + elseif (msg == "tr") then - + local f = CreateFrame("frame", nil, UIParent) f:SetSize(300, 300) f:SetPoint("center") - + -- /run TTT:SetTexture("Interface\\1024.tga") local texture = f:CreateTexture("TTT", "background") texture:SetAllPoints() texture:SetTexture("Interface\\1023.tga") - + local A = DetailsFramework:CreateAnimationHub (texture) - + local b = DetailsFramework:CreateAnimation(A, "ROTATION", 1, 40, 360) b:SetTarget (texture) A:Play() - + C_Timer.NewTicker(1, function() texture:SetTexCoord(math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random()) end) - - + + elseif (msg == "realmsync") then - + _detalhes.realm_sync = not _detalhes.realm_sync _detalhes:Msg("Realm Sync: ", _detalhes.realm_sync and "Enabled" or "Disabled") - + if (not _detalhes.realm_sync) then LeaveChannelByName ("Details") else @@ -363,15 +371,15 @@ function SlashCmdList.DETAILS (msg, editbox) end elseif (msg == "load") then - + print(DetailsDataStorage) - + local loaded, reason = LoadAddOn ("Details_DataStorage") print(loaded, reason, DetailsDataStorage) - - + + elseif (msg == "owner2") then - + local tip = CreateFrame('GameTooltip', 'GuardianOwnerTooltip', nil, 'GameTooltipTemplate') function GetGuardianOwner(guid) tip:SetOwner(WorldFrame, 'ANCHOR_NONE') @@ -380,35 +388,35 @@ function SlashCmdList.DETAILS (msg, editbox) --return strmatch(text and text:GetText() or '', "^([^%s']+)'") return text:GetText() end - + print(GetGuardianOwner(UnitGUID("target"))) - + elseif (msg == "chat") then - - + + elseif (msg == "chaticon") then _detalhes:Msg("|TInterface\\AddOns\\Details\\images\\icones_barra:" .. 14 .. ":" .. 14 .. ":0:0:256:32:0:32:0:32|tteste") - + elseif (msg == "align") then local c = RightChatPanel local w,h = c:GetSize() print(w,h) - + local instance1 = _detalhes.tabela_instancias [1] local instance2 = _detalhes.tabela_instancias [2] - + instance1.baseframe:ClearAllPoints() instance2.baseframe:ClearAllPoints() instance1.baseframe:SetSize(w/2 - 4, h-20-21-8) instance2.baseframe:SetSize(w/2 - 4, h-20-21-8) - + instance1.baseframe:SetPoint("bottomleft", RightChatDataPanel, "topleft", 1, 1) instance2.baseframe:SetPoint("bottomright", RightChatToggleButton, "topright", -1, 1) elseif (msg == "pets") then local f = _detalhes:CreateListPanel() - + local i = 1 for k, v in pairs(_detalhes.tabela_pets.pets) do if (v[6] == "Guardian of Ancient Kings") then @@ -416,37 +424,37 @@ function SlashCmdList.DETAILS (msg, editbox) i = i + 1 end end - + f:Show() - + elseif (msg == "savepets") then - + _detalhes.tabela_vigente.saved_pets = {} - + for k, v in pairs(_detalhes.tabela_pets.pets) do _detalhes.tabela_vigente.saved_pets [k] = {v[1], v[2], v[3]} end - + _detalhes:Msg("pet table has been saved on current combat.") elseif (msg == "move") then - + print("moving...") - + local instance = _detalhes.tabela_instancias [1] instance.baseframe:ClearAllPoints() --instance.baseframe:SetPoint("CENTER", UIParent, "CENTER", 300, 100) instance.baseframe:SetPoint("left", DetailsWelcomeWindow, "right", 10, 0) - + elseif (msg == "model") then local frame = CreateFrame("PlayerModel"); frame:SetPoint("center",UIParent,"center"); frame:SetHeight(600); frame:SetWidth(300); frame:SetDisplayInfo (49585); - + elseif (msg == "ej2") then - + --[[ get the EJ_ raid id local wantRaids = true -- set false to get 5-man list for i=1,1000 do @@ -455,7 +463,7 @@ function SlashCmdList.DETAILS (msg, editbox) DEFAULT_CHAT_FRAME:AddMessage( instanceID.." "..name ,1,0.7,0.5) end --]] - + local iid=362 for i=1, 100 do @@ -465,7 +473,7 @@ function SlashCmdList.DETAILS (msg, editbox) local msg = encounterID .. " , " .. name .. ", ".. rootSectionID.. ", "..link DEFAULT_CHAT_FRAME:AddMessage(msg, 1,0.7,0.5) end - + elseif (msg == "time") then print("GetTime()", GetTime()) print("time()", time()) @@ -474,39 +482,39 @@ function SlashCmdList.DETAILS (msg, editbox) _G.DetailsCopy:Show() _G.DetailsCopy.MyObject.text:HighlightText() _G.DetailsCopy.MyObject.text:SetFocus() - + elseif (msg == "garbage") then local a = {} - for i = 1, 10000 do + for i = 1, 10000 do a [i] = {math.random(50000)} end table.wipe(a) - + elseif (msg == "unitname") then - + local nome, realm = UnitName ("target") if (realm) then nome = nome.."-"..realm end print(nome, realm) - + elseif (msg == "raid") then - + local player, realm = "Ditador", "Azralon" - + local actorName if (realm ~= GetRealmName()) then actorName = player.."-"..realm else actorName = player end - + print(actorName) - + local guid = _detalhes:FindGUIDFromName ("Ditador") print(guid) - - for i = 1, GetNumGroupMembers()-1, 1 do + + for i = 1, GetNumGroupMembers()-1, 1 do local name, realm = UnitName ("party"..i) print(name, " -- ", realm) end @@ -515,17 +523,17 @@ function SlashCmdList.DETAILS (msg, editbox) _detalhes:PrintParserCacheIndexes() elseif (msg == "parsercache") then _detalhes:PrintParserCacheIndexes() - + elseif (msg == "captures") then - for k, v in pairs(_detalhes.capture_real) do + for k, v in pairs(_detalhes.capture_real) do print("real -",k,":",v) end - for k, v in pairs(_detalhes.capture_current) do + for k, v in pairs(_detalhes.capture_current) do print("current -",k,":",v) end - + elseif (msg == "slider") then - + local f = CreateFrame("frame", "TESTEDESCROLL", UIParent) f:SetPoint("center", UIParent, "center", 200, -2) f:SetWidth(300) @@ -533,9 +541,9 @@ function SlashCmdList.DETAILS (msg, editbox) f:SetBackdrop({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) f:SetBackdropColor(0, 0, 0, 1) f:EnableMouseWheel(true) - + local rows = {} - for i = 1, 7 do + for i = 1, 7 do local row = CreateFrame("frame", nil, UIParent) row:SetPoint("topleft", f, "topleft", 10, -(i-1)*21) row:SetWidth(200) @@ -546,39 +554,39 @@ function SlashCmdList.DETAILS (msg, editbox) row.text = t rows [#rows+1] = row end - + local data = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20} - - - + + + elseif (msg == "bcollor") then - + --local instancia = _detalhes.tabela_instancias [1] _detalhes.ResetButton.Middle:SetVertexColor(1, 1, 0, 1) - + --print(_detalhes.ResetButton:GetHighlightTexture()) - + local t = _detalhes.ResetButton:GetHighlightTexture() t:SetVertexColor(0, 1, 0, 1) --print(t:GetObjectType()) --_detalhes.ResetButton:SetHighlightTexture(t) _detalhes.ResetButton:SetNormalTexture(t) - + print("backdrop", _detalhes.ResetButton:GetBackdrop()) - + _detalhes.ResetButton:SetBackdropColor(0, 0, 1, 1) - + --Details.VarDump (_detalhes.ResetButton) - + elseif (command == "mini") then local instance = _detalhes.tabela_instancias [1] --Details.VarDump () --print(instance, instance.StatusBar.options, instance.StatusBar.left) print(instance.StatusBar.options [instance.StatusBar.left.mainPlugin.real_name].textSize) print(instance.StatusBar.left.options.textSize) - + elseif (command == "owner") then - + local petname = rest:match ("^(%S*)%s*(.-)$") local petGUID = UnitGUID("target") @@ -586,40 +594,40 @@ function SlashCmdList.DETAILS (msg, editbox) local scanTool = CreateFrame("GameTooltip", "DetailsScanTooltip", nil, "GameTooltipTemplate") scanTool:SetOwner(WorldFrame, "ANCHOR_NONE") end - + function getPetOwner (petName) local scanTool = _G.DetailsScanTooltip local scanText = _G ["DetailsScanTooltipTextLeft2"] -- This is the line with <[Player]'s Pet> - + scanTool:ClearLines() - + print(petName) scanTool:SetUnit(petName) - + local ownerText = scanText:GetText() - if (not ownerText) then - return nil + if (not ownerText) then + return nil end local owner, _ = string.split ("'", ownerText) return owner -- This is the pet's owner end - + --print(getPetOwner (petname)) print(getPetOwner (petGUID)) - + elseif (command == "buffsof") then - + local playername, segment = rest:match("^(%S*)%s*(.-)$") segment = tonumber(segment or 0) print("dumping buffs of ", playername, segment) - + local c = _detalhes:GetCombat("current") if (c) then - + local playerActor - + if (segment and segment ~= 0) then local c = _detalhes:GetCombat(segment) playerActor = c (4, playername) @@ -627,16 +635,16 @@ function SlashCmdList.DETAILS (msg, editbox) else playerActor = c (4, playername) end - + print("actor table: ", playerActor) - + if (not playerActor) then print("actor table not found") return end - + if (playerActor and playerActor.buff_uptime_spells and playerActor.buff_uptime_spells._ActorTable) then - for spellid, spellTable in pairs(playerActor.buff_uptime_spells._ActorTable) do + for spellid, spellTable in pairs(playerActor.buff_uptime_spells._ActorTable) do local spellname = GetSpellInfo(spellid) if (spellname) then print(spellid, spellname, spellTable.uptime) @@ -644,36 +652,36 @@ function SlashCmdList.DETAILS (msg, editbox) end end end - + elseif (msg == "teste") then - + local a, b = _detalhes:GetEncounterEnd (1098, 3) print(a, unpack(b)) - + elseif (msg == "yesno") then --_detalhes:Show() - + elseif (msg == "imageedit") then - + local callback = function(width, height, overlayColor, alpha, texCoords) print(width, height, alpha) print("overlay: ", unpack(overlayColor)) print("crop: ", unpack(texCoords)) end - + _detalhes.gump:ImageEditor (callback, "Interface\\TALENTFRAME\\bg-paladin-holy", nil, {1, 1, 1, 1}) -- {0.25, 0.25, 0.25, 0.25} elseif (msg == "chat") then - + local name, fontSize, r, g, b, a, shown, locked = FCF_GetChatWindowInfo (1); print(name,"|",fontSize,"|", r,"|", g,"|", b,"|", a,"|", shown,"|", locked) - + --local fontFile, unused, fontFlags = self:GetFont(); --self:SetFont(fontFile, fontSize, fontFlags); - + elseif (msg == "error") then a = nil + 1 - + --debug elseif (command == "resetcapture") then _detalhes.capture_real = { @@ -688,34 +696,34 @@ function SlashCmdList.DETAILS (msg, editbox) print(Loc ["STRING_DETAILS1"] .. "capture has been reseted.") --debug - elseif (command == "barra") then - + elseif (command == "barra") then + local whichRowLine = rest and tonumber(rest) or 1 - + local instancia = _detalhes.tabela_instancias [1] local barra = instancia.barras [whichRowLine] - - for i = 1, barra:GetNumPoints() do + + for i = 1, barra:GetNumPoints() do local point, relativeTo, relativePoint, xOfs, yOfs = barra:GetPoint(i) print(point, relativeTo, relativePoint, xOfs, yOfs) end - - elseif (msg == "opened") then + + elseif (msg == "opened") then 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() - + Details.VarDump (backdrop) Details.VarDump (backdrop.insets) - + print("bgcolor:",f:GetBackdropColor()) print("bordercolor",f:GetBackdropBorderColor()) - + elseif (command == "myguid") then --localize-me - + local g = UnitGUID("player") print(type(g)) print(g) @@ -723,9 +731,9 @@ function SlashCmdList.DETAILS (msg, editbox) local serial = g:sub (12, 18) serial = tonumber("0x"..serial) print(serial) - + --tonumber((UnitGUID("target")):sub(-12, -9), 16)) - + elseif (command == "npcid") then if (UnitExists("target")) then local serial = UnitGUID("target") @@ -739,15 +747,15 @@ function SlashCmdList.DETAILS (msg, editbox) edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, edgeSize = 1, tileSize = 5, } - + Details.id_frame = CreateFrame("Frame", "DetailsID", UIParent, "BackdropTemplate") Details.id_frame:SetHeight(14) Details.id_frame:SetWidth(120) Details.id_frame:SetPoint("center", UIParent, "center") Details.id_frame:SetBackdrop(backdrop) - + tinsert(UISpecialFrames, "DetailsID") - + Details.id_frame.texto = CreateFrame("editbox", nil, Details.id_frame, "BackdropTemplate") Details.id_frame.texto:SetPoint("topleft", Details.id_frame, "topleft") Details.id_frame.texto:SetAutoFocus(false) @@ -760,19 +768,19 @@ function SlashCmdList.DETAILS (msg, editbox) Details.id_frame.texto:SetBackdropBorderColor(0.3, 0.3, 0.30, 0.80) Details.id_frame.texto:SetText("") Details.id_frame.texto.perdeu_foco = nil - + Details.id_frame.texto:SetScript("OnEnterPressed", function() Details.id_frame.texto:ClearFocus() Details.id_frame:Hide() end) - + Details.id_frame.texto:SetScript("OnEscapePressed", function() Details.id_frame.texto:ClearFocus() Details.id_frame:Hide() end) - + end - + C_Timer.After(0.1, function() Details.id_frame:Show() Details.id_frame.texto:SetFocus() @@ -795,15 +803,15 @@ function SlashCmdList.DETAILS (msg, editbox) edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, edgeSize = 1, tileSize = 5, } - + Details.id_frame = CreateFrame("Frame", "DetailsID", UIParent, "BackdropTemplate") Details.id_frame:SetHeight(14) Details.id_frame:SetWidth(120) Details.id_frame:SetPoint("center", UIParent, "center") Details.id_frame:SetBackdrop(backdrop) - + tinsert(UISpecialFrames, "DetailsID") - + Details.id_frame.texto = CreateFrame("editbox", nil, Details.id_frame, "BackdropTemplate") Details.id_frame.texto:SetPoint("topleft", Details.id_frame, "topleft") Details.id_frame.texto:SetAutoFocus(false) @@ -816,19 +824,19 @@ function SlashCmdList.DETAILS (msg, editbox) Details.id_frame.texto:SetBackdropBorderColor(0.3, 0.3, 0.30, 0.80) Details.id_frame.texto:SetText("") Details.id_frame.texto.perdeu_foco = nil - + Details.id_frame.texto:SetScript("OnEnterPressed", function() Details.id_frame.texto:ClearFocus() Details.id_frame:Hide() end) - + Details.id_frame.texto:SetScript("OnEscapePressed", function() Details.id_frame.texto:ClearFocus() Details.id_frame:Hide() end) - + end - + C_Timer.After(0.1, function() Details.id_frame:Show() Details.id_frame.texto:SetFocus() @@ -837,15 +845,15 @@ function SlashCmdList.DETAILS (msg, editbox) end) end end - + elseif (command == "profile") then - + local profile = rest:match("^(%S*)%s*(.-)$") - + print("Force apply profile: ", profile) - + _detalhes:ApplyProfile (profile, false) - + elseif (msg == "version") then Details.ShowCopyValueFrame(Details.GetVersionString()) @@ -853,7 +861,7 @@ function SlashCmdList.DETAILS (msg, editbox) Details.SendHighFive() print(Loc ["STRING_DETAILS1"] .. "highfive sent, HI!") - + C_Timer.After(0.3, function() Details.RefreshUserList() end) @@ -874,14 +882,14 @@ function SlashCmdList.DETAILS (msg, editbox) end) C_Timer.After(4, function() Details.RefreshUserList (true) - end) + end) C_Timer.After(5, function() Details.RefreshUserList (true) end) C_Timer.After(8, function() Details.RefreshUserList (true) end) - + elseif (command == "names") then local t, filter = rest:match("^(%S*)%s*(.-)$") @@ -894,21 +902,21 @@ function SlashCmdList.DETAILS (msg, editbox) if (not f) then f = _detalhes:CreateListPanel() end - + local container = _detalhes.tabela_vigente [t]._NameIndexTable - + local i = 0 - for name, _ in pairs(container) do + for name, _ in pairs(container) do i = i + 1 f:add (name, i) end - + print(i, "names found.") - + f:Show() - + elseif (command == "actors") then - + local t, filter = rest:match("^(%S*)%s*(.-)$") t = tonumber(t) @@ -920,20 +928,20 @@ function SlashCmdList.DETAILS (msg, editbox) if (not f) then f = _detalhes:CreateListPanel() end - + local container = _detalhes.tabela_vigente [t]._ActorTable print(#container, "actors found.") - for index, actor in ipairs(container) do + for index, actor in ipairs(container) do f:add (actor.nome, index, filter) end - + f:Show() - + --debug elseif (msg == "save") then print("running... this is a debug command, details wont work until next /reload.") _detalhes:PrepareTablesForSave() - + elseif (msg == "buffs") then for i = 1, 40 do local name, texture, count, debuffType, duration, expirationTime, caster, canStealOrPurge, nameplateShowPersonal, spellid = UnitBuff ("player", i) @@ -942,7 +950,7 @@ function SlashCmdList.DETAILS (msg, editbox) end print(spellid, name) end - + elseif (msg == "id") then local one, two = rest:match("^(%S*)%s*(.-)$") if (one ~= "") then @@ -971,7 +979,7 @@ function SlashCmdList.DETAILS (msg, editbox) else _detalhes.debug = true print(Loc ["STRING_DETAILS1"] .. "diagnostic mode has been turned on.") - + if (rest and rest ~= "") then if (rest == "-clear") then _detalhes_global.debug_chr_log = "" @@ -984,7 +992,7 @@ function SlashCmdList.DETAILS (msg, editbox) return end end - + --debug combat log elseif (msg == "combatlog") then if (_detalhes.isLoggingCombat) then @@ -996,25 +1004,25 @@ function SlashCmdList.DETAILS (msg, editbox) print("Wow combatlog record turned ON.") _detalhes.isLoggingCombat = true end - + elseif (msg == "gs") then _detalhes:teste_grayscale() - + elseif (msg == "bwload") then if not BigWigs then LoadAddOn("BigWigs_Core") end BigWigs:Enable() LoadAddOn ("BigWigs_Highmaul") - + local mod = BigWigs:GetBossModule("Imperator Mar'gok") mod:Enable() - + elseif (msg == "bwsend") then local mod = BigWigs:GetBossModule("Imperator Mar'gok") mod:Message("stages", "Neutral", "Long", "Phase 2", false) - + elseif (msg == "bwregister") then - + local addon = {} BigWigs.RegisterMessage(addon, "BigWigs_Message") function addon:BigWigs_Message(event, module, key, text) @@ -1022,15 +1030,15 @@ function SlashCmdList.DETAILS (msg, editbox) print("Phase Changed!", event, module, key, text) end end - + elseif (msg == "pos") then local x, y = GetPlayerMapPosition ("player") - + if (not DetailsPosBox) then _detalhes.gump:CreateTextEntry(UIParent, function()end, 200, 20, nil, "DetailsPosBox") DetailsPosBox:SetPoint("center", UIParent, "center") end - + local one, two = rest:match("^(%S*)%s*(.-)$") if (one == "2") then DetailsPosBox.MyObject.text = "{x2 = " .. x .. ", y2 = " .. y .. "}" @@ -1039,24 +1047,24 @@ function SlashCmdList.DETAILS (msg, editbox) end DetailsPosBox.MyObject:SetFocus() DetailsPosBox.MyObject:HighlightText() - + elseif (msg == "outline") then - + local instancia = _detalhes.tabela_instancias [1] - for _, barra in ipairs(instancia.barras) do + for _, barra in ipairs(instancia.barras) do local _, _, flags = barra.lineText1:GetFont() print("outline:",flags) end - + elseif (msg == "sell") then - + --sell gray local c, i, n, v = 0 for b = 0, 4 do - for s = 1, GetContainerNumSlots(b) do + for s = 1, GetContainerNumSlots(b) do i = {GetContainerItemInfo (b, s)} n = i[7] - if n and string.find(n,"9d9d9d") then + if n and string.find(n,"9d9d9d") then v = {GetItemInfo(n)} q = i[2] c = c+v[11]*q @@ -1066,11 +1074,11 @@ function SlashCmdList.DETAILS (msg, editbox) end end print(GetCoinText(c)) - + --sell green equip local c, i, n, v = 0 for b = 0, 4 do - for s = 1, GetContainerNumSlots(b) do + for s = 1, GetContainerNumSlots(b) do local texture, itemCount, locked, quality, readable, lootable, itemLink = GetContainerItemInfo (b, s) if (quality == 2) then --a green item local itemName, itemLink, itemRarity, itemLevel, _, itemType, itemSubType = GetItemInfo (itemLink) @@ -1083,40 +1091,40 @@ function SlashCmdList.DETAILS (msg, editbox) end end end - + elseif (msg == "forge") then _detalhes:OpenForge() - + elseif (msg == "parser") then - + _detalhes:OnParserEvent ( - "COMBAT_LOG_EVENT_UNFILTERED", --evento = - 1548754114, --time = - "SPELL_DAMAGE", --token = - nil, --hidding = - "0000000000000000", --who_serial = - nil, --who_name = - 0x514, --who_flags = - 0x0, --who_flags2 = - "Player-3676-06F3C3FA", --alvo_serial = - "Icybluefur-Area52", --alvo_name = - 0x514, --alvo_flags = - 0x0, --alvo_flags2 = - 157247, --spellid = - "Reverberations", --spellname = - 0x1, --spelltype = - 4846, --amount = - -1, --overkill = - 1 --school = + "COMBAT_LOG_EVENT_UNFILTERED", --evento = + 1548754114, --time = + "SPELL_DAMAGE", --token = + nil, --hidding = + "0000000000000000", --who_serial = + nil, --who_name = + 0x514, --who_flags = + 0x0, --who_flags2 = + "Player-3676-06F3C3FA", --alvo_serial = + "Icybluefur-Area52", --alvo_name = + 0x514, --alvo_flags = + 0x0, --alvo_flags2 = + 157247, --spellid = + "Reverberations", --spellname = + 0x1, --spelltype = + 4846, --amount = + -1, --overkill = + 1 --school = ) - + elseif (msg == "ejloot") then DetailsFramework.EncounterJournal.EJ_SelectInstance (669) -- hellfire citadel DetailsFramework.EncounterJournal.EJ_SetDifficulty (16) - + local r = {} local total = 0 - + for i = 1, 100 do local name, description, encounterID, rootSectionID, link = DetailsFramework.EncounterJournal.EJ_GetEncounterInfoByIndex (i, 669) if (name) then @@ -1130,11 +1138,11 @@ function SlashCmdList.DETAILS (msg, editbox) total = total + 1 end end - end - + end + print("total loot", total) _detalhes_global.ALOOT = r - + elseif (msg == "ilvl" or msg == "itemlevel" or msg == "ilevel") then local item_amount = 16 @@ -1146,9 +1154,9 @@ function SlashCmdList.DETAILS (msg, editbox) ["INVTYPE_RANGED"] = true, ["INVTYPE_RANGEDRIGHT"] = true, } - + _detalhes:Msg("======== Item Level Debug ========") - + for equip_id = 1, 17 do if (equip_id ~= 4) then --shirt slot local item = GetInventoryItemLink (unitid, equip_id) @@ -1172,16 +1180,16 @@ function SlashCmdList.DETAILS (msg, editbox) end end end - + local average = item_level / item_amount _detalhes:Msg("gear score: " .. item_level, "| item amount:", item_amount, "| ilvl:", average) _detalhes.ilevel:CalcItemLevel ("player", UnitGUID("player"), true) - + elseif (msg == "score") then - + _detalhes:OpenRaidHistoryWindow ("Hellfire Citadel", 1800, 15, "DAMAGER", "Rock Lobster", 2, "Keyspell") - + elseif (msg == "bar") then local bar = _G.DetailsTestBar if (not bar) then @@ -1191,19 +1199,19 @@ function SlashCmdList.DETAILS (msg, editbox) 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 == "q") then - + local myframe = TestFrame if (not myframe) then myframe = TestFrame or CreateFrame("frame", "TestFrame", UIParent) @@ -1221,31 +1229,31 @@ function SlashCmdList.DETAILS (msg, editbox) print(myframe.texture:GetTexture()) end end - - - + + + if (true) then return end - + local y = -50 local allspecs = {} - + for a, b in pairs(_detalhes.class_specs_coords) do tinsert(allspecs, a) end - + for i = 1, 10 do - + local a = CreateFrame("statusbar", nil, UIParent) a:SetPoint("topleft", UIParent, "topleft", i*32, y) a:SetSize(32, 32) a:SetMinMaxValues(0, 1) - + local texture = a:CreateTexture(nil, "overlay") texture:SetSize(32, 32) texture:SetPoint("topleft") - + if (i%10 == 0) then y = y - 32 end @@ -1256,7 +1264,7 @@ function SlashCmdList.DETAILS (msg, editbox) local elapsedTime = 0 a:SetScript("OnUpdate", function(self, deltaTime) elapsedTime = elapsedTime + deltaTime - + --texture:SetSize(math.random(50, 300), math.random(50, 300)) --local spec = allspecs [math.random(#allspecs)] texture:SetTexture([[Interface\AddOns\Details\images\options_window]]) @@ -1264,17 +1272,17 @@ function SlashCmdList.DETAILS (msg, editbox) --texture:SetTexture([[Interface\AddOns\Details\images\options_window]]) --texture:SetTexture([[Interface\CHARACTERFRAME\Button_BloodPresence_DeathKnight]]) --texture:SetTexCoord(unpack(_detalhes.class_specs_coords [spec])) - + --a:SetAlpha(abs(math.sin (time))) --a:SetValue(abs(math.sin (time))) end) 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 --instancia:InstanceAlert (Loc ["STRING_PLEASE_WAIT"], {[[Interface\COMMON\StreamCircle]], 22, 22, true}, 5, {f, 1, 2, 3, 4, 5}) - + local lower_instance = _detalhes:GetLowerInstanceNumber() if (lower_instance) then local instance = _detalhes:GetInstance(lower_instance) @@ -1286,20 +1294,20 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "teste1") then -- /de teste1 _detalhes:OpenRaidHistoryWindow (1530, 1886, 15, "damage", "Rock Lobster", 2, "Keyspell") --, _role, _guild, _player_base, _player_name) - - elseif (msg == "qq") then + + elseif (msg == "qq") then local my_role = "DAMAGER" local raid_name = "Tomb of Sargeras" local guildName = "Rock Lobster" local func = {_detalhes.OpenRaidHistoryWindow, _detalhes, raid_name, 2050, 15, my_role, guildName} --, 2, UnitName ("player") --local icon = {[[Interface\AddOns\Details\images\icons]], 16, 16, false, 434/512, 466/512, 243/512, 273/512} local icon = {[[Interface\PvPRankBadges\PvPRank08]], 16, 16, false, 0, 1, 0, 1} - + local lower_instance = _detalhes:GetLowerInstanceNumber() local instance = _detalhes:GetInstance(lower_instance) - + instance:InstanceAlert ("Boss Defeated! Show Ranking", icon, 10, func, true) - + elseif (msg == "scroll" or msg == "scrolldamage" or msg == "scrolling") then Details:ScrollDamage() @@ -1314,7 +1322,7 @@ function SlashCmdList.DETAILS (msg, editbox) end elseif (msg == "spec") then - + local spec = DetailsFramework.GetSpecialization() if (spec) then local specID = DetailsFramework.GetSpecializationInfo(spec) @@ -1322,11 +1330,11 @@ function SlashCmdList.DETAILS (msg, editbox) print("Current SpecID: ", specID) end end - + elseif (msg == "senditemlevel") then _detalhes:SendCharacterData() print("Item level dispatched.") - + elseif (msg == "talents") then local talents = {} for i = 1, 7 do @@ -1338,23 +1346,23 @@ function SlashCmdList.DETAILS (msg, editbox) end end end - + print("talentID", "name", "texture", "selected", "available", "spellID", "unknown", "row", "column", "unknown", "unknown") for i = 1, #talents do print(GetTalentInfoByID (talents [i])) end - + elseif (msg == "merge") then - + --at this point, details! should not be in combat if (_detalhes.in_combat) then _detalhes:Msg("already in combat, closing current segment.") _detalhes:SairDoCombate() end - + --create a new combat to be the overall for the mythic run _detalhes:EntrarEmCombate() - + --get the current combat just created and the table with all past segments local newCombat = _detalhes:GetCurrentCombat() local segmentHistory = _detalhes:GetCombatSegments() @@ -1362,7 +1370,7 @@ function SlashCmdList.DETAILS (msg, editbox) local startDate, endDate = "", "" local lastSegment local segmentsAdded = 0 - + --add all boss segments from this run to this new segment for i = 1, 25 do local pastCombat = segmentHistory [i] @@ -1377,11 +1385,11 @@ function SlashCmdList.DETAILS (msg, editbox) segmentsAdded = segmentsAdded + 1 end end - + if (lastSegment) then startDate = lastSegment:GetDate() end - + newCombat.is_trash = false _detalhes:Msg("done merging, segments: " .. segmentsAdded .. ", total time: " .. DetailsFramework:IntegerToTimer(totalTime)) @@ -1398,17 +1406,17 @@ function SlashCmdList.DETAILS (msg, editbox) OverallSegment = true, } --]] - + --set some data newCombat:SetStartTime (GetTime() - totalTime) newCombat:SetEndTime (GetTime()) - + newCombat.data_inicio = startDate newCombat.data_fim = endDate - + --immediatly finishes the segment just started _detalhes:SairDoCombate() - + --cleanup the past segments table for i = 25, 1, -1 do local pastCombat = segmentHistory [i] @@ -1417,43 +1425,43 @@ function SlashCmdList.DETAILS (msg, editbox) segmentHistory [i] = nil end end - + --clear memory - collectgarbage() + collectgarbage() _detalhes:InstanciaCallFunction(Details.FadeHandler.Fader, "in", nil, "barras") _detalhes:InstanciaCallFunction(_detalhes.AtualizaSegmentos) _detalhes:InstanciaCallFunction(_detalhes.AtualizaSoloMode_AfertReset) _detalhes:InstanciaCallFunction(_detalhes.ResetaGump) _detalhes:RefreshMainWindow(-1, true) - - elseif (msg == "ej") then - + + elseif (msg == "ej") then + local result = {} local spellIDs = {} - + --uldir - DetailsFramework.EncounterJournal.EJ_SelectInstance (1031) - + DetailsFramework.EncounterJournal.EJ_SelectInstance (1031) + -- pega o root section id do boss local name, description, encounterID, rootSectionID, link = DetailsFramework.EncounterJournal.EJ_GetEncounterInfo (2168) --taloc (primeiro boss de Uldir) - + --overview local sectionInfo = C_EncounterJournal.GetSectionInfo (rootSectionID) local nextID = {sectionInfo.siblingSectionID} - + while (nextID [1]) do --get the deepest section in the hierarchy local ID = tremove(nextID) local sectionInfo = C_EncounterJournal.GetSectionInfo (ID) - + if (sectionInfo) then tinsert(result, sectionInfo) - + if (sectionInfo.spellID and type(sectionInfo.spellID) == "number" and sectionInfo.spellID ~= 0) then tinsert(spellIDs, sectionInfo.spellID) end - + local nextChild, nextSibling = sectionInfo.firstChildSectionID, sectionInfo.siblingSectionID if (nextSibling) then tinsert(nextID, nextSibling) @@ -1465,9 +1473,9 @@ function SlashCmdList.DETAILS (msg, editbox) break end end - + Details:DumpTable (result) - + elseif (msg == "saveskin") then local skin = Details.skins["Minimalistic"].instance_cprops local instance1 = Details:GetInstance(1) @@ -1588,19 +1596,19 @@ function SlashCmdList.DETAILS (msg, editbox) print("version:", _detalhes.build_counter >= _detalhes.alpha_build_counter and _detalhes.build_counter or _detalhes.alpha_build_counter) elseif (msg == "record") then - - + + _detalhes.ScheduleLoadStorage() _detalhes.TellDamageRecord = C_Timer.NewTimer(0.6, _detalhes.PrintEncounterRecord) _detalhes.TellDamageRecord.Boss = 2032 _detalhes.TellDamageRecord.Diff = 16 - - elseif (msg == "recordtest") then - local f = DetailsRecordFrameAnimation + elseif (msg == "recordtest") then + + local f = DetailsRecordFrameAnimation if (not f) then f = CreateFrame("frame", "DetailsRecordFrameAnimation", UIParent) - + --estrela no inicio dando um giro --Interface\Cooldown\star4 --efeito de batida? @@ -1610,14 +1618,14 @@ function SlashCmdList.DETAILS (msg, editbox) DetailsFramework:CreateAnimation(animationHub, "Scale", 1, .10, .9, .9, 1.1, 1.1) DetailsFramework:CreateAnimation(animationHub, "Scale", 2, .10, 1.2, 1.2, 1, 1) end - + --BFA BETA --elseif (msg == "update") then -- _detalhes:CopyPaste ([[https://www.wowinterface.com/downloads/info23056-DetailsDamageMeter8.07.3.5.html]]) - + elseif (msg == "auras") then Details.AuraTracker.Open() - + elseif (msg == "ec") then if (rest and tonumber(rest)) then local combatToErase = tonumber(rest) @@ -1636,9 +1644,9 @@ function SlashCmdList.DETAILS (msg, editbox) Details.Survey.OpenSurveyPanel() elseif (msg == "share") then - + local f = {} - + local elapsed = GetTime() local ignoredKeys = { @@ -1651,30 +1659,30 @@ function SlashCmdList.DETAILS (msg, editbox) previous_combat = true, owner = true, } - + local keys = {} - + --copy from table2 to table1 overwriting values function f.copy(t1, t2) if (t1.Timer) then t1, t2 = t1.t1, t1.t2 end - for key, value in pairs(t2) do + for key, value in pairs(t2) do if (not ignoredKeys [key] and type(value) ~= "function") then if (key == "targets") then t1 [key] = {} - + elseif (type(value) == "table") then t1 [key] = t1 [key] or {} - + --print(key, value) --local d = C_Timer.NewTimer(1, f.copy) --d.t1 = t1 [key] --d.t2 = t2 [key] --d.Timer = true - + keys [key] = true - + f.copy(t1 [key], t2 [key]) else t1 [key] = value @@ -1683,28 +1691,28 @@ function SlashCmdList.DETAILS (msg, editbox) end return t1 end - + --local copySegment = f.copy({}, _detalhes.tabela_vigente) local copySegment = f.copy({}, _detalhes.tabela_historico.tabelas [2]) - + --the segment received is raw and does not have metatables, need to refresh them local zipData = Details:CompressData (copySegment, "print") - + --print(zipData) --Details:Dump (keys) Details:Dump ({zipData}) else - + --if (_detalhes.opened_windows < 1) then -- _detalhes:CriarInstancia() --end - + if (command) then --check if the line passed is a parameters in the default profile if (_detalhes.default_profile [command]) then if (rest and (rest ~= "" and rest ~= " ")) then local whichType = type(_detalhes.default_profile [command]) - + --attempt to cast the passed value to the same value as the type in the profile if (whichType == "number") then rest = tonumber(rest) @@ -1714,7 +1722,7 @@ function SlashCmdList.DETAILS (msg, editbox) else print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' expects a number") end - + elseif (whichType == "string") then rest = tostring(rest) if (rest) then @@ -1723,21 +1731,21 @@ function SlashCmdList.DETAILS (msg, editbox) else print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' expects a string") end - + elseif (whichType == "boolean") then if (rest == "true") then _detalhes [command] = true print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' set to true") - + elseif (rest == "false") then _detalhes [command] = false print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' set to false") - + else print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' expects true or false") end end - + else local value = _detalhes [command] if (type(value) == "boolean") then @@ -1745,10 +1753,10 @@ function SlashCmdList.DETAILS (msg, editbox) end print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' current value is: " .. value) end - + return end - + end print("|cffffaeae/details|r |cffffff33" .. Loc ["STRING_SLASH_SHOW"] .. " " .. Loc ["STRING_SLASH_HIDE"] .. " " .. Loc ["STRING_SLASH_TOGGLE"] .. "|r|cfffcffb0 <" .. Loc ["STRING_WINDOW_NUMBER"] .. ">|r: " .. Loc ["STRING_SLASH_SHOWHIDETOGGLE_DESC"]) @@ -1760,7 +1768,7 @@ function SlashCmdList.DETAILS (msg, editbox) print("|cFFFFFF00DETAILS! VERSION|r:|cFFFFAA00" .. " " .. Details.GetVersionString()) print("|cffffaeae/details|r |cffffff33" .. "version" .. "|r: copy version.") - + end end @@ -1817,12 +1825,12 @@ function Details:UpdateUserPanel(usersTable) local scroll_height = 605 - 60 local scroll_lines = 26 local scroll_line_height = 20 - + local backdrop_color = {.2, .2, .2, 0.2} local backdrop_color_on_enter = {.8, .8, .8, 0.4} local backdrop_color_is_critical = {.4, .4, .2, 0.2} local backdrop_color_is_critical_on_enter = {1, 1, .8, 0.4} - + local y = -15 local headerY = y - 15 local scrollY = headerY - 20 @@ -1837,10 +1845,10 @@ function Details:UpdateUserPanel(usersTable) local headerOptions = { padding = 2, } - + DetailsUserPanel.Header = DetailsFramework:CreateHeader (DetailsUserPanel, headerTable, headerOptions) DetailsUserPanel.Header:SetPoint("topleft", DetailsUserPanel, "topleft", 5, headerY) - + local scroll_refresh = function(self, data, offset, total_lines) --store user names shown @@ -1849,7 +1857,7 @@ function Details:UpdateUserPanel(usersTable) for i = 1, total_lines do local index = i + offset local userTable = data [index] - + if (userTable) then local userName, userRealm, userVersion = unpack(userTable) if (not userShown[userName]) then @@ -1862,8 +1870,8 @@ function Details:UpdateUserPanel(usersTable) end end end - end - + end + local lineOnEnter = function(self) if (self.IsCritical) then self:SetBackdropColor(unpack(backdrop_color_is_critical_on_enter)) @@ -1871,43 +1879,43 @@ function Details:UpdateUserPanel(usersTable) self:SetBackdropColor(unpack(backdrop_color_on_enter)) end end - + local lineOnLeave = function(self) if (self.IsCritical) then self:SetBackdropColor(unpack(backdrop_color_is_critical)) else self:SetBackdropColor(unpack(backdrop_color)) end - + GameTooltip:Hide() end - + local scroll_createline = function(self, index) local line = CreateFrame("button", "$parentLine" .. index, self, "BackdropTemplate") line:SetPoint("topleft", self, "topleft", 3, -((index-1)*(scroll_line_height+1)) - 1) line:SetSize(scroll_width - 2, scroll_line_height) - + line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) line:SetBackdropColor(unpack(backdrop_color)) - + DetailsFramework:Mixin(line, DetailsFramework.HeaderFunctions) - + line:SetScript("OnEnter", lineOnEnter) line:SetScript("OnLeave", lineOnLeave) - + --username local userNameText = DetailsFramework:CreateLabel(line) - + --realm local realmText = DetailsFramework:CreateLabel(line) - + --version local versionText = DetailsFramework:CreateLabel(line) - + line:AddFrameToHeaderAlignment (userNameText) line:AddFrameToHeaderAlignment (realmText) line:AddFrameToHeaderAlignment (versionText) - + line:AlignWithHeader (DetailsUserPanel.Header, "left") line.UserNameText = userNameText @@ -1916,17 +1924,17 @@ function Details:UpdateUserPanel(usersTable) return line end - + local usersScroll = DetailsFramework:CreateScrollBox (DetailsUserPanel, "$parentUsersScroll", scroll_refresh, DetailsUserPanel.Data, scroll_width, scroll_height, scroll_lines, scroll_line_height) DetailsFramework:ReskinSlider(usersScroll) usersScroll:SetPoint("topleft", DetailsUserPanel, "topleft", 5, scrollY) Details.UserPanel.ScrollBox = usersScroll - + --create lines - for i = 1, scroll_lines do + for i = 1, scroll_lines do usersScroll:CreateLine (scroll_createline) end - + DetailsUserPanel:SetScript("OnShow", function() end) @@ -1943,25 +1951,25 @@ function _detalhes:CreateListPanel() _detalhes.ListPanel = _detalhes.gump:NewPanel(UIParent, nil, "DetailsActorsFrame", nil, 300, 600) _detalhes.ListPanel:SetPoint("center", UIParent, "center", 300, 0) _detalhes.ListPanel.barras = {} - + tinsert(UISpecialFrames, "DetailsActorsFrame") _detalhes.ListPanel.close_with_right = true - local container_barras_window = CreateFrame("ScrollFrame", "Details_ActorsBarrasScroll", _detalhes.ListPanel.widget) + local container_barras_window = CreateFrame("ScrollFrame", "Details_ActorsBarrasScroll", _detalhes.ListPanel.widget) local container_barras = CreateFrame("Frame", "Details_ActorsBarras", container_barras_window) _detalhes.ListPanel.container = container_barras _detalhes.ListPanel.width = 500 _detalhes.ListPanel.locked = false - + container_barras_window:SetBackdrop({ edgeFile = "Interface\\DialogFrame\\UI-DialogBox-gold-Border", tile = true, tileSize = 16, edgeSize = 5, insets = {left = 1, right = 1, top = 0, bottom = 1},}) container_barras_window:SetBackdropBorderColor(0, 0, 0, 0) - + container_barras:SetBackdrop({ bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, - insets = {left = 1, right = 1, top = 0, bottom = 1},}) + insets = {left = 1, right = 1, top = 0, bottom = 1},}) container_barras:SetBackdropColor(0, 0, 0, 0) container_barras:SetAllPoints(container_barras_window) @@ -1970,7 +1978,7 @@ function _detalhes:CreateListPanel() container_barras:EnableMouse(true) container_barras:SetResizable(false) container_barras:SetMovable(true) - + container_barras_window:SetWidth(460) container_barras_window:SetHeight(550) container_barras_window:SetScrollChild(container_barras) @@ -1983,9 +1991,9 @@ function _detalhes:CreateListPanel() container_barras_window.slider:SetFrameLevel(10) container_barras_window.ultimo = 0 - + container_barras_window.gump = container_barras - + function _detalhes.ListPanel:add (text, index, filter) local row = _detalhes.ListPanel.barras [index] if (not row) then @@ -1993,16 +2001,16 @@ function _detalhes:CreateListPanel() _detalhes.ListPanel.barras [index] = row row.text:SetPoint("topleft", _detalhes.ListPanel.container, "topleft", 0, -index * 15) end - + if (filter and text:find(filter)) then row.text:SetTextColor(1, 1, 0) else row.text:SetTextColor(1, 1, 1) end - + row.text:SetText(text) - end - + end + return _detalhes.ListPanel end @@ -2089,7 +2097,7 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then for i = 1, totalLines do local index = i + offset local unitTable = data[index] - + if (unitTable) then local line = self:GetLine(i) @@ -2192,34 +2200,34 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then local line = CreateFrame("frame", "$parentLine" .. index, self, "BackdropTemplate") line:SetPoint("topleft", self, "topleft", 1, -((index-1) * (CONST_SCROLL_LINE_HEIGHT + 1)) - 1) line:SetSize(scrollFrame:GetWidth() - 2, CONST_SCROLL_LINE_HEIGHT) - + line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) line:SetBackdropColor(unpack(backdrop_color)) - + DetailsFramework:Mixin(line, DetailsFramework.HeaderFunctions) - + line:SetScript("OnEnter", lineOnEnter) line:SetScript("OnLeave", lineOnLeave) - + --class icon local icon = line:CreateTexture("$parentClassIcon", "overlay") icon:SetSize(CONST_SCROLL_LINE_HEIGHT - 2, CONST_SCROLL_LINE_HEIGHT - 2) - + --player name local playerNameText = DetailsFramework:CreateLabel(line) - + --keystone level local keystoneLevelText = DetailsFramework:CreateLabel(line) - + --dungeon name local dungeonNameText = DetailsFramework:CreateLabel(line) - + --classic dungeon name local classicDungeonNameText = DetailsFramework:CreateLabel(line) - + --player rating local ratingText = DetailsFramework:CreateLabel(line) - + line.icon = icon line.playerNameText = playerNameText line.keystoneLevelText = keystoneLevelText @@ -2233,13 +2241,13 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then line:AddFrameToHeaderAlignment(dungeonNameText) --line:AddFrameToHeaderAlignment(classicDungeonNameText) line:AddFrameToHeaderAlignment(ratingText) - + line:AlignWithHeader(f.Header, "left") return line end --create lines - for i = 1, CONST_SCROLL_LINE_AMOUNT do + for i = 1, CONST_SCROLL_LINE_AMOUNT do scrollFrame:CreateLine(createLineForScroll) end @@ -2317,7 +2325,7 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then end end end - + local cutoffDate = time() - (86400 * 7) --7 days for unitName, keystoneTable in pairs(Details.keystone_cache) do --this unit in the cache isn't shown? diff --git a/startup.lua b/startup.lua index 6ec160e52..c36d72a5d 100644 --- a/startup.lua +++ b/startup.lua @@ -13,6 +13,12 @@ function Details:StartMeUp() --I'll never stop! Details.lastArenaStartTime = GetTime() Details.lastBattlegroundStartTime = GetTime() + --save the time when the addon finished loading + Details.AddOnStartTime = GetTime() + function Details.GetStartupTime() + return Details.AddOnStartTime or GetTime() + end + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --row single click, this determines what happen when the user click on a bar @@ -493,12 +499,6 @@ function Details:StartMeUp() --I'll never stop! --embed windows on the chat window Details.chat_embed:CheckChatEmbed(true) - --save the time when the addon finished loading - Details.AddOnStartTime = GetTime() - function Details.GetStartupTime() - return Details.AddOnStartTime or GetTime() - end - if (Details.player_details_window.skin ~= "ElvUI") then local setDefaultSkinOnPlayerBreakdownWindow = function() Details:ApplyPDWSkin("ElvUI")