diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 48c03bd76..ac4152294 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,6 +1,6 @@ -local dversion = 385 +local dversion = 386 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary(major, minor) diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index e68f5c511..1bf14dcf5 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -9390,7 +9390,7 @@ detailsFramework.TimeLineBlockFunctions = { --dataIndex stores which line index from the data this line will use --lineData store members: .text .icon .timeline - local lineData = data.lines [self.dataIndex] + local lineData = data.lines[self.dataIndex] self.spellId = lineData.spellId @@ -9398,7 +9398,11 @@ detailsFramework.TimeLineBlockFunctions = { --this is the title and icon of the title if (lineData.icon) then self.icon:SetTexture(lineData.icon) - self.icon:SetTexCoord(.1, .9, .1, .9) + if (lineData.coords) then + self.icon:SetTexCoord(unpack(lineData.coords)) + else + self.icon:SetTexCoord(.1, .9, .1, .9) + end self.text:SetText(lineData.text or "") self.text:SetPoint("left", self.icon.widget, "right", 2, 0) else @@ -9423,12 +9427,13 @@ detailsFramework.TimeLineBlockFunctions = { local baseFrameLevel = parent:GetFrameLevel() + 10 for i = 1, #timelineData do - local blockInfo = timelineData [i] + local blockInfo = timelineData[i] - local timeInSeconds = blockInfo [1] - local length = blockInfo [2] - local isAura = blockInfo [3] - local auraDuration = blockInfo [4] + local timeInSeconds = blockInfo[1] + local length = blockInfo[2] + local isAura = blockInfo[3] + local auraDuration = blockInfo[4] + local blockSpellId = blockInfo[5] local payload = blockInfo.payload @@ -9445,13 +9450,18 @@ detailsFramework.TimeLineBlockFunctions = { PixelUtil.SetPoint(block, "left", self, "left", xOffset + headerWidth, 0) - block.info.spellId = spellId + block.info.spellId = blockSpellId or spellId block.info.time = timeInSeconds block.info.duration = auraDuration block.info.payload = payload if (useIconOnBlock) then - block.icon:SetTexture(lineData.icon) + local iconTexture = lineData.icon + if (blockSpellId) then + iconTexture = GetSpellTexture(blockSpellId) + end + + block.icon:SetTexture(iconTexture) block.icon:SetTexCoord(.1, .9, .1, .9) block.icon:SetAlpha(.834) block.icon:SetSize(self:GetHeight(), self:GetHeight()) @@ -9581,7 +9591,7 @@ detailsFramework.TimeLineFunctions = { ResetAllLines = function(self) for i = 1, #self.lines do - self.lines [i]:Reset() + self.lines[i]:Reset() end end, @@ -9638,7 +9648,7 @@ detailsFramework.TimeLineFunctions = { --refresh lines self:ResetAllLines() for i = 1, #self.data.lines do - local line = self:GetLine (i) + local line = self:GetLine(i) line.dataIndex = i --this index is used inside the line update function to know which data to get line.lineHeader:SetWidth(self.options.header_width) line:SetBlocksFromData() --the function to update runs within the line object @@ -9651,7 +9661,7 @@ detailsFramework.TimeLineFunctions = { self.elapsedTimeFrame:SetPoint("topright", self.body, "topright", 0, 0) self.elapsedTimeFrame:Reset() - self.elapsedTimeFrame:Refresh (self.data.length, self.currentScale) + self.elapsedTimeFrame:Refresh(self.data.length, self.currentScale) end, SetData = function(self, data) diff --git a/boot.lua b/boot.lua index 0db855875..9d14cf775 100644 --- a/boot.lua +++ b/boot.lua @@ -6,8 +6,8 @@ local version, build, date, tocversion = GetBuildInfo() - _detalhes.build_counter = 10205 - _detalhes.alpha_build_counter = 10205 --if this is higher than the regular counter, use it instead + _detalhes.build_counter = 10258 + _detalhes.alpha_build_counter = 10258 --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 cc1b089c1..50d8fe08f 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -2394,6 +2394,71 @@ function Details:DecompressData (data, dataType) end end +Details.specToRole = { + --DRUID + [102] = "DAMAGER", --BALANCE + [103] = "DAMAGER", --FERAL DRUID + [105] = "HEALER", --RESTORATION + + --HUNTER + [253] = "DAMAGER", --BM + [254] = "DAMAGER", --MM + [255] = "DAMAGER", --SURVIVOR + + --MAGE + [62] = "DAMAGER", --ARCANE + [64] = "DAMAGER", --FROST + [63] = "DAMAGER", ---FIRE + + --PALADIN + [70] = "DAMAGER", --RET + [65] = "HEALER", --HOLY + [66] = "TANK", --PROT + + --PRIEST + [257] = "HEALER", --HOLY + [256] = "HEALER", --DISC + [258] = "DAMAGER", --SHADOW + + --ROGUE + [259] = "DAMAGER", --ASSASSINATION + [260] = "DAMAGER", --COMBAT + [261] = "DAMAGER", --SUB + + --SHAMAN + [262] = "DAMAGER", --ELEMENTAL + [263] = "DAMAGER", --ENHAN + [264] = "HEALER", --RESTO + + --WARLOCK + [265] = "DAMAGER", --AFF + [266] = "DAMAGER", --DESTRO + [267] = "DAMAGER", --DEMO + + --WARRIOR + [71] = "DAMAGER", --ARMS + [72] = "DAMAGER", --FURY + [73] = "TANK", --PROT + + --DK + [250] = "TANK", --Blood + [251] = "DAMAGER", --Frost + [252] = "DAMAGER", --Unholy + + --MONK + [268] = "TANK", -- Brewmaster Monk + [269] = "DAMAGER", -- Windwalker Monk + [270] = "HEALER", -- Mistweaver Monk + + --DH + [577] = "DAMAGER", -- Havoc Demon Hunter + [581] = "TANK", -- Vengeance Demon Hunter + + --EVOKER + [1467] = "DAMAGER", --Devastation Evoker + [1468] = "HEALER", --Preservation Evoker +} + --oldschool talent tree if (DetailsFramework.IsWotLKWow()) then local talentWatchClassic = CreateFrame("frame") @@ -2541,59 +2606,6 @@ if (DetailsFramework.IsWotLKWow()) then end end - Details.specToRole = { - --DRUID - [102] = "DAMAGER", --BALANCE - [103] = "DAMAGER", --FERAL DRUID - [105] = "HEALER", --RESTORATION - - --HUNTER - [253] = "DAMAGER", --BM - [254] = "DAMAGER", --MM - [255] = "DAMAGER", --SURVIVOR - - --MAGE - [62] = "DAMAGER", --ARCANE - [64] = "DAMAGER", --FROST - [63] = "DAMAGER", ---FIRE - - --PALADIN - [70] = "DAMAGER", --RET - [65] = "HEALER", --HOLY - [66] = "TANK", --PROT - - --PRIEST - [257] = "HEALER", --HOLY - [256] = "HEALER", --DISC - [258] = "DAMAGER", --SHADOW - - --ROGUE - [259] = "DAMAGER", --ASSASSINATION - [260] = "DAMAGER", --COMBAT - [261] = "DAMAGER", --SUB - - --SHAMAN - [262] = "DAMAGER", --ELEMENTAL - [263] = "DAMAGER", --ENHAN - [264] = "HEALER", --RESTO - - --WARLOCK - [265] = "DAMAGER", --AFF - [266] = "DAMAGER", --DESTRO - [267] = "DAMAGER", --DEMO - - --WARRIOR - [71] = "DAMAGER", --ARMS - [72] = "DAMAGER", --FURY - [73] = "TANK", --PROT - - --Death Knight - [250] = "TANK", --Blood - [251] = "DAMAGER", --Frost - [252] = "DAMAGER", --Unholy - - } - function _detalhes:GetRoleFromSpec (specId, unitGUID) if (specId == 103) then --feral druid local talents = _detalhes.cached_talents [unitGUID] diff --git a/functions/classes.lua b/functions/classes.lua index 98779d910..97ebb56f5 100644 --- a/functions/classes.lua +++ b/functions/classes.lua @@ -189,6 +189,14 @@ do function _detalhes:Pets() return self.pets end + + function _detalhes:GetSpec(actor) + return self.spec or actor and actor.spec + end + + function _detalhes:Spec(actor) + return self.spec or actor and actor.spec + end --inherits to all actors without placing it on _detalhes namespace. _detalhes.container_combatentes.guid = _detalhes.GetGUID diff --git a/plugins/Details_DataStorage/Details_DataStorage.lua b/plugins/Details_DataStorage/Details_DataStorage.lua index 2d7e0cf9a..a073b99f5 100644 --- a/plugins/Details_DataStorage/Details_DataStorage.lua +++ b/plugins/Details_DataStorage/Details_DataStorage.lua @@ -3,7 +3,7 @@ DETAILS_STORAGE_VERSION = 5 function _detalhes:CreateStorageDB() DetailsDataStorage = { - VERSION = DETAILS_STORAGE_VERSION, + VERSION = DETAILS_STORAGE_VERSION, [14] = {}, --normal mode (raid) [15] = {}, --heroic mode (raid) [16] = {}, --mythic mode (raid) @@ -13,29 +13,27 @@ function _detalhes:CreateStorageDB() return DetailsDataStorage end -local f = CreateFrame("frame", nil, UIParent) +local f = CreateFrame ("frame", nil, UIParent) f:Hide() -f:RegisterEvent("ADDON_LOADED") - -f:SetScript("OnEvent", function(self, event, addonName) +f:RegisterEvent ("ADDON_LOADED") +f:SetScript ("OnEvent", function (self, event, addonName) if (addonName == "Details_DataStorage") then - DetailsDataStorage = DetailsDataStorage or _detalhes:CreateStorageDB() - + DetailsDataStorage.Data = {} + if (DetailsDataStorage.VERSION < DETAILS_STORAGE_VERSION) then - --do revisions + --> do revisions if (DetailsDataStorage.VERSION < 5) then - table.wipe(DetailsDataStorage) + table.wipe (DetailsDataStorage) DetailsDataStorage = _detalhes:CreateStorageDB() end end - + if (_detalhes and _detalhes.debug) then - print("|cFFFFFF00Details! Storage|r: loaded!") + print ("|cFFFFFF00Details! Storage|r: loaded!") end DETAILS_STORAGE_LOADED = true - end end)