diff --git a/core/gears.lua b/core/gears.lua index 24e99678..53c84c3f 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -2770,4 +2770,172 @@ function Details.GetDragonflightTalentsAsHashTable() end return allTalents +end + + +--called from inside the function Details.GenerateSpecSpellList() +local getSpellList = function(specIndex, completeListOfSpells, sharedSpellsBetweenSpecs, specNames) + + local specId, specName, _, specIconTexture = GetSpecializationInfo(specIndex) + completeListOfSpells[specId] = {} + specNames[specId] = specName + + --get spells from talents + local configId = C_ClassTalents.GetActiveConfigID() + if (not configId) then + return completeListOfSpells + end + + local configInfo = C_Traits.GetConfigInfo(configId) + + --get the spells from the SPEC from talents + for treeIndex, treeId in ipairs(configInfo.treeIDs) do + local treeNodes = C_Traits.GetTreeNodes(treeId) + for nodeIdIndex, treeNodeID in ipairs(treeNodes) do + local traitNodeInfo = C_Traits.GetNodeInfo(configId, treeNodeID) + if (traitNodeInfo and traitNodeInfo.posX > 9000) then + local entryIds = traitNodeInfo.entryIDs + for i = 1, #entryIds do + local entryId = entryIds[i] --number + local traitEntryInfo = C_Traits.GetEntryInfo(configId, entryId) + local borderTypes = Enum.TraitNodeEntryType + if (traitEntryInfo.type == borderTypes.SpendSquare) then + local definitionId = traitEntryInfo.definitionID + local traitDefinitionInfo = C_Traits.GetDefinitionInfo(definitionId) + local spellId = traitDefinitionInfo.overriddenSpellID or traitDefinitionInfo.spellID + local spellName, _, spellTexture = GetSpellInfo(spellId) + if (spellName) then + completeListOfSpells[specId][spellId] = specId + end + end + end + end + end + end + + --get spells of the SPEC from the spell book + for i = 1, GetNumSpellTabs() do + local tabName, tabTexture, offset, numSpells, isGuild, offspecId = GetSpellTabInfo(i) + if (tabTexture == specIconTexture) then + offset = offset + 1 + local tabEnd = offset + numSpells + for entryOffset = offset, tabEnd - 1 do + local spellType, spellId = GetSpellBookItemInfo(entryOffset, "player") + if (spellId) then + if (spellType == "SPELL") then + spellId = C_SpellBook.GetOverrideSpell(spellId) + local spellName = GetSpellInfo(spellId) + local isPassive = IsPassiveSpell(entryOffset, "player") + if (spellName and not isPassive) then + completeListOfSpells[specId][spellId] = specId + end + end + end + end + end + end + + --get shared spells from the spell book + local tabName, tabTexture, offset, numSpells, isGuild, offspecId = GetSpellTabInfo(2) + offset = offset + 1 + local tabEnd = offset + numSpells + for entryOffset = offset, tabEnd - 1 do + local spellType, spellId = GetSpellBookItemInfo(entryOffset, "player") + if (spellId) then + if (spellType == "SPELL") then + spellId = C_SpellBook.GetOverrideSpell(spellId) + local spellName = GetSpellInfo(spellId) + local isPassive = IsPassiveSpell(entryOffset, "player") + if (spellName and not isPassive) then + sharedSpellsBetweenSpecs[spellId] = true + end + end + end + end + + local classNameLoc = UnitClass("player") + print(specName .. " " .. classNameLoc .. " spells recorded.") + return completeListOfSpells, sharedSpellsBetweenSpecs, specNames +end + +function Details.GenerateSpecSpellList() + local dumpSpellTable = 1 + + local specId, specName, _, specIconTexture = GetSpecializationInfo(GetSpecialization()) + local classNameLoc, className, classId = UnitClass("player") + + local completeListOfSpells = {} + local sharedSpellsBetweenSpecs = {} + local specNames = {} + + _G.SPELLS_FROM_THIS_CLASS = _G.SPELLS_FROM_THIS_CLASS or { + sharedSpells = {}, + specNames = {} + } + + local amountSpecs = GetNumSpecializationsForClassID(classId) + + local totalTimeToWait = 0 + DetailsFramework.Schedules.NewTimer(0, function() SetSpecialization(1) end) + DetailsFramework.Schedules.NewTimer(6, getSpellList, 1, completeListOfSpells, sharedSpellsBetweenSpecs, specNames) + totalTimeToWait = 7 + DetailsFramework.Schedules.NewTimer(7, function() SetSpecialization(2) end) + DetailsFramework.Schedules.NewTimer(13, getSpellList, 2, completeListOfSpells, sharedSpellsBetweenSpecs, specNames) + totalTimeToWait = 14 + + if (amountSpecs >= 3) then + DetailsFramework.Schedules.NewTimer(14, function() SetSpecialization(3) end) + DetailsFramework.Schedules.NewTimer(20, getSpellList, 3, completeListOfSpells, sharedSpellsBetweenSpecs, specNames) + totalTimeToWait = 21 + end + + if (amountSpecs >= 4) then + DetailsFramework.Schedules.NewTimer(21, function() SetSpecialization(4) end) + DetailsFramework.Schedules.NewTimer(28, getSpellList, 4, completeListOfSpells, sharedSpellsBetweenSpecs, specNames) + totalTimeToWait = 29 + end + + print("Total Time to Wait:", totalTimeToWait) + DetailsFramework.Schedules.NewTimer(totalTimeToWait, function() + if (dumpSpellTable) then + local parsedSpells = {} + local sharedSpells = sharedSpellsBetweenSpecs + + for specId, spellTable in pairs(completeListOfSpells) do + parsedSpells[specId] = {} + + --create a list of spells which is in use in the other spec talent tree + local spellsInUse = {} + for specId2, spellTable2 in pairs(completeListOfSpells) do + if (specId2 ~= specId) then + for spellId in pairs(spellTable2) do + spellsInUse[spellId] = true + end + end + end + for spellId in pairs(sharedSpells) do + spellsInUse[spellId] = true + end + + --build the list of spells for this spec + for spellId in pairs(spellTable) do + if (not spellsInUse[spellId]) then + parsedSpells[specId][spellId] = true + end + end + end + + local result = "" + for specId, spellsTable in pairs(parsedSpells) do + local specName = specNames[specId] + result = result .. "\n--" .. specName .. " " .. classNameLoc .. ":\n" + for spellId in pairs(spellsTable) do + local spellName = GetSpellInfo(spellId) + result = result .. "[" .. spellId .. "] = " .. specId .. ", --" .. spellName .. "\n" + end + end + + Details:Dump({result}) + end + end) end \ No newline at end of file diff --git a/core/parser.lua b/core/parser.lua index 8a76d8fe..7453186d 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -5775,49 +5775,58 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local saver = CreateFrame ("frame", nil, UIParent) saver:RegisterEvent ("PLAYER_LOGOUT") saver:SetScript ("OnEvent", function (...) - + --save the time played on this class, run protected + pcall(function() + local className = select(2, UnitClass("player")) + if (className) then + Details.class_time_played[className] = (Details.class_time_played[className] or 0) + GetTime() - Details.GetStartupTime() + end + end) + local currentStep = 0 --SAVINGDATA = true + _detalhes_global.exit_log = {} + _detalhes_global.exit_errors = _detalhes_global.exit_errors or {} + currentStep = "Checking the framework integrity" if (not _detalhes.gump) then - --> failed to load the framework. + --failed to load the framework + tinsert(_detalhes_global.exit_log, "The framework wasn't in Details member 'gump'.") + tinsert(_detalhes_global.exit_errors, 1, currentStep .. "|" .. date() .. "|" .. _detalhes.userversion .. "|Framework wasn't loaded|") return end - _detalhes_global.exit_log = {} - _detalhes_global.exit_errors = _detalhes_global.exit_errors or {} - - local saver_error = function (errortext) + local saver_error = function(errortext) _detalhes_global = _detalhes_global or {} - tinsert (_detalhes_global.exit_errors, 1, currentStep .. "|" .. date() .. "|" .. _detalhes.userversion .. "|" .. errortext .. "|" .. debugstack()) - tremove (_detalhes_global.exit_errors, 6) + tinsert(_detalhes_global.exit_errors, 1, currentStep .. "|" .. date() .. "|" .. _detalhes.userversion .. "|" .. errortext .. "|" .. debugstack()) + tremove(_detalhes_global.exit_errors, 6) end _detalhes.saver_error_func = saver_error _detalhes.logoff_saving_data = true - - --> close info window - if (_detalhes.FechaJanelaInfo) then - tinsert (_detalhes_global.exit_log, "1 - Closing Janela Info.") - currentStep = "Fecha Janela Info" - xpcall (_detalhes.FechaJanelaInfo, saver_error) - end - - --> do not save window pos - if (_detalhes.tabela_instancias) then - currentStep = "Dealing With Instances" - tinsert (_detalhes_global.exit_log, "2 - Clearing user place from instances.") - for id, instance in _detalhes:ListInstances() do - if (id) then - tinsert (_detalhes_global.exit_log, " - " .. id .. " has baseFrame: " .. (instance.baseframe and "yes" or "no") .. ".") - if (instance.baseframe) then - instance.baseframe:SetUserPlaced (false) - instance.baseframe:SetDontSavePosition (true) - end + + --close info window + if (_detalhes.FechaJanelaInfo) then + tinsert(_detalhes_global.exit_log, "1 - Closing Janela Info.") + currentStep = "Fecha Janela Info" + xpcall(_detalhes.FechaJanelaInfo, saver_error) + end + + --do not save window pos + if (_detalhes.tabela_instancias) then + currentStep = "Dealing With Instances" + tinsert (_detalhes_global.exit_log, "2 - Clearing user place from instances.") + for id, instance in _detalhes:ListInstances() do + if (id) then + tinsert (_detalhes_global.exit_log, " - " .. id .. " has baseFrame: " .. (instance.baseframe and "yes" or "no") .. ".") + if (instance.baseframe) then + instance.baseframe:SetUserPlaced (false) + instance.baseframe:SetDontSavePosition (true) end end end + end --> leave combat start save tables if (_detalhes.in_combat and _detalhes.tabela_vigente) then diff --git a/frames/window_spellcategory.lua b/frames/window_spellcategory.lua index 9f9bc677..9facf8b0 100644 --- a/frames/window_spellcategory.lua +++ b/frames/window_spellcategory.lua @@ -55,6 +55,14 @@ function Details.OpenSpellCategoryScreen() padding = 2, } + local savedSpellsCategories = Details.spell_category_savedtable + local unitClass = select(2, UnitClass("player")) + local thisClassSavedTable = savedSpellsCategories[unitClass] + if (not thisClassSavedTable) then + thisClassSavedTable = {} + savedSpellsCategories[unitClass] = thisClassSavedTable + end + detailsSpellCategoryFrame.Header = DetailsFramework:CreateHeader(detailsSpellCategoryFrame, headerTable, headerOptions) detailsSpellCategoryFrame.Header:SetPoint("topleft", detailsSpellCategoryFrame, "topleft", startX, headerY) diff --git a/functions/profiles.lua b/functions/profiles.lua index cc80813c..43a9357f 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -1300,6 +1300,12 @@ local default_global_data = { current_exp_raid_encounters = {}, installed_skins_cache = {}, + --> spell category feedback + spell_category_savedtable = {}, + + --> class time played + class_time_played = {}, + --> keystone cache keystone_cache = {}, diff --git a/functions/slash.lua b/functions/slash.lua index 5283ecaf..28363ed9 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -1566,6 +1566,9 @@ function SlashCmdList.DETAILS (msg, editbox) end return + elseif (msg == "generatespelllist") then + Details.GenerateSpecSpellList() + elseif (msg == "share") then local f = {} diff --git a/functions/spells.lua b/functions/spells.lua index 396cdd53..b04ab06f 100644 --- a/functions/spells.lua +++ b/functions/spells.lua @@ -8,7 +8,515 @@ do _detalhes.PotionList [spellID] = true end - if (DetailsFramework.IsWotLKWow()) then + if (DetailsFramework.IsDragonflight()) then + --/details generatespelllist + _detalhes.SpecSpellList = { --~spec + --Unholy Death Knight: + [390175] = 252, --Plaguebringer + [275699] = 252, --Apocalypse + [207317] = 252, --Epidemic + [207289] = 252, --Unholy Assault + [55090] = 252, --Scourge Strike + [115989] = 252, --Unholy Blight + [390279] = 252, --Vile Contagion + [63560] = 252, --Dark Transformation + [77575] = 252, --Outbreak + [49206] = 252, --Summon Gargoyle + [42650] = 252, --Army of the Dead + + --Frost Death Knight: + [49184] = 251, --Howling Blast + [57330] = 251, --Horn of Winter + [305392] = 251, --Chill Streak + [196770] = 251, --Remorseless Winter + [49143] = 251, --Frost Strike + [152279] = 251, --Breath of Sindragosa + [279302] = 251, --Frostwyrm's Fury + [194913] = 251, --Glacial Advance + [207230] = 251, --Frostscythe + [51271] = 251, --Pillar of Frost + + --Blood Death Knight: + [195292] = 250, --Death's Caress + [194844] = 250, --Bonestorm + [49028] = 250, --Dancing Rune Weapon + [206940] = 250, --Mark of Blood + [195182] = 250, --Marrowrend + [206931] = 250, --Blooddrinker + [55233] = 250, --Vampiric Blood + [274156] = 250, --Consumption + [221699] = 250, --Blood Tap + [108199] = 250, --Gorefiend's Grasp + [219809] = 250, --Tombstone + [194679] = 250, --Rune Tap + [50842] = 250, --Blood Boil + + --Havoc Demon Hunter: + [188499] = 577, --Blade Dance + [342817] = 577, --Glaive Tempest + [211881] = 577, --Fel Eruption + [196555] = 577, --Netherwalk + [195072] = 577, --Fel Rush + [162794] = 577, --Chaos Strike + [198013] = 577, --Eye Beam + [162243] = 577, --Demon's Bite + [258860] = 577, --Essence Break + [258925] = 577, --Fel Barrage + + --Vengeance Demon Hunter: + [203782] = 581, --Shear + [202138] = 581, --Sigil of Chains + [207407] = 581, --Soul Carver + [263648] = 581, --Soul Barrier + [320341] = 581, --Bulk Extraction + [228477] = 581, --Soul Cleave + [212084] = 581, --Fel Devastation + [204021] = 581, --Fiery Brand + [203720] = 581, --Demon Spikes + [189110] = 581, --Infernal Strike + [247454] = 581, --Spirit Bomb + + --Windwalker Monk: + [152175] = 269, --Whirling Dragon Punch + [113656] = 269, --Fists of Fury + [123904] = 269, --Invoke Xuen, the White Tiger + [137639] = 269, --Storm, Earth, and Fire + [122470] = 269, --Touch of Karma + [152173] = 269, --Serenity + [101545] = 269, --Flying Serpent Kick + [392983] = 269, --Strike of the Windlord + + --Mistweaver Monk: + [388615] = 270, --Restoral + [212051] = 270, --Reawaken + [198898] = 270, --Song of Chi-Ji + [124081] = 270, --Zen Pulse + [124682] = 270, --Enveloping Mist + [322118] = 270, --Invoke Yu'lon, the Jade Serpent + [115310] = 270, --Revival + [115450] = 270, --Detox + [196725] = 270, --Refreshing Jade Wind + [191837] = 270, --Essence Font + [116849] = 270, --Life Cocoon + [116680] = 270, --Thunder Focus Tea + [115151] = 270, --Renewing Mist + [325197] = 270, --Invoke Chi-Ji, the Red Crane + + --Brewmaster Monk: + [322960] = 268, --Fortifying Brew + [322507] = 268, --Celestial Brew + [119582] = 268, --Purifying Brew + [387184] = 268, --Weapons of Order + [115399] = 268, --Black Ox Brew + [324312] = 268, --Clash + [115176] = 268, --Zen Meditation + [121253] = 268, --Keg Smash + [325153] = 268, --Exploding Keg + [115181] = 268, --Breath of Fire + [132578] = 268, --Invoke Niuzao, the Black Ox + + --Enhancement Shaman: + [333974] = 263, --Fire Nova + [117014] = 263, --Elemental Blast + [51533] = 263, --Feral Spirit + [378270] = 263, --Deeply Rooted Elements + [384352] = 263, --Doom Winds + [197214] = 263, --Sundering + [114051] = 263, --Ascendance + [196884] = 263, --Feral Lunge + [8512] = 263, --Windfury Totem + [187874] = 263, --Crash Lightning + [60103] = 263, --Lava Lash + [342240] = 263, --Ice Strike + [33757] = 263, --Windfury Weapon + + --Restoration Shaman: + [197995] = 264, --Wellspring + [114052] = 264, --Ascendance + [383009] = 264, --Stormkeeper + [98008] = 264, --Spirit Link Totem + [5394] = 264, --Healing Stream Totem + [73685] = 264, --Unleash Life + [77130] = 264, --Purify Spirit + [16191] = 264, --Mana Tide Totem + [382021] = 264, --Earthliving Weapon + [382029] = 264, --Ever-Rising Tide + [207778] = 264, --Downpour + [61295] = 264, --Riptide + [73920] = 264, --Healing Rain + [207399] = 264, --Ancestral Protection Totem + [198838] = 264, --Earthen Wall Totem + [77472] = 264, --Healing Wave + [108280] = 264, --Healing Tide Totem + [52127] = 264, --Water Shield + [212048] = 264, --Ancestral Vision + + --Elemental Shaman: + [192222] = 262, --Liquid Magma Totem + [210714] = 262, --Icefury + [8042] = 262, --Earth Shock + [198067] = 262, --Fire Elemental + [192249] = 262, --Storm Elemental + [61882] = 262, --Earthquake + [114050] = 262, --Ascendance + [191634] = 262, --Stormkeeper + + --Feral Druid: + [5217] = 103, --Tiger's Fury + [285381] = 103, --Primal Wrath + [213764] = 103, --Swipe + [106951] = 103, --Berserk + [274837] = 103, --Feral Frenzy + + --Guardian Druid: + [343240] = 104, --Berserk: Ravage + [61336] = 104, --Survival Instincts + [80313] = 104, --Pulverize + [102558] = 104, --Incarnation: Guardian of Ursoc + [6807] = 104, --Maul + [377623] = 104, --Berserk: Unchecked Aggression + [377779] = 104, --Berserk: Persistence + [200851] = 104, --Rage of the Sleeper + [155835] = 104, --Bristling Fur + + --Balance Druid: + [191034] = 102, --Starfall + [78675] = 102, --Solar Beam + [202770] = 102, --Fury of Elune + [323764] = 102, --Convoke the Spirits + [102560] = 102, --Incarnation: Chosen of Elune + [202347] = 102, --Stellar Flare + [194223] = 102, --Celestial Alignment + [205636] = 102, --Force of Nature + [325727] = 102, --Adaptive Swarm + [274281] = 102, --New Moon + [202425] = 102, --Warrior of Elune + + --Restoration Druid: + [102342] = 105, --Ironbark + [88423] = 105, --Nature's Cure + [203651] = 105, --Overgrowth + [212040] = 105, --Revitalize + [392160] = 105, --Invigorate + [740] = 105, --Tranquility + [197721] = 105, --Flourish + [132158] = 105, --Nature's Swiftness + [102351] = 105, --Cenarion Ward + [50464] = 105, --Nourish + [33763] = 105, --Lifebloom + [145205] = 105, --Efflorescence + [33891] = 105, --Incarnation: Tree of Life + + --Retribution Paladin: + [383185] = 70, --Exorcism + [53385] = 70, --Divine Storm + [384052] = 70, --Radiant Decree + [343721] = 70, --Final Reckoning + [215661] = 70, --Justicar's Vengeance + [326734] = 70, --Healing Hands + [205191] = 70, --Eye for an Eye + [343527] = 70, --Execution Sentence + [184575] = 70, --Blade of Justice + [184662] = 70, --Shield of Vengeance + [255937] = 70, --Wake of Ashes + [183218] = 70, --Hand of Hindrance + [384392] = 70, --Crusade + [85256] = 70, --Templar's Verdict + [383327] = 70, --Final Verdict + + --Holy Paladin: + [85222] = 65, --Light of Dawn + [148039] = 65, --Barrier of Faith + [20473] = 65, --Holy Shock + [53563] = 65, --Beacon of Light + [82326] = 65, --Holy Light + [114165] = 65, --Holy Prism + [31821] = 65, --Aura Mastery + [156910] = 65, --Beacon of Faith + [214202] = 65, --Rule of Law + [394088] = 65, --Avenging Crusader + [212056] = 65, --Absolution + [200652] = 65, --Tyr's Deliverance + [114158] = 65, --Light's Hammer + [183998] = 65, --Light of the Martyr + [223306] = 65, --Bestow Faith + [210294] = 65, --Divine Favor + [388007] = 65, --Blessing of Summer + [4987] = 65, --Cleanse + + --Protection Paladin: + [31850] = 66, --Ardent Defender + [31935] = 66, --Avenger's Shield + [86659] = 66, --Guardian of Ancient Kings + [386653] = 66, --Bulwark of Righteous Fury + [387174] = 66, --Eye of Tyr + [327193] = 66, --Moment of Glory + [31884] = 66, --Avenging Wrath + [378974] = 66, --Bastion of Light + + --Demonology Warlock: + [264130] = 266, --Power Siphon + [264119] = 266, --Summon Vilefiend + [267217] = 266, --Nether Portal + [603] = 266, --Doom + [111898] = 266, --Grimoire: Felguard + [267211] = 266, --Bilescourge Bombers + [264057] = 266, --Soul Strike + [104316] = 266, --Call Dreadstalkers + [264178] = 266, --Demonbolt + [386833] = 266, --Guillotine + [105174] = 266, --Hand of Gul'dan + [265187] = 266, --Summon Demonic Tyrant + [267171] = 266, --Demonic Strength + [196277] = 266, --Implosion + + --Destruction Warlock: + [196447] = 267, --Channel Demonfire + [17877] = 267, --Shadowburn + [1122] = 267, --Summon Infernal + [6353] = 267, --Soul Fire + [80240] = 267, --Havoc + [5740] = 267, --Rain of Fire + [17962] = 267, --Conflagrate + [116858] = 267, --Chaos Bolt + [387976] = 267, --Dimensional Rift + [348] = 267, --Immolate + [29722] = 267, --Incinerate + [152108] = 267, --Cataclysm + + --Affliction Warlock: + [278350] = 265, --Vile Taint + [205179] = 265, --Phantom Singularity + [48181] = 265, --Haunt + [386951] = 265, --Soul Swap + [316099] = 265, --Unstable Affliction + [63106] = 265, --Siphon Life + [386997] = 265, --Soul Rot + [205180] = 265, --Summon Darkglare + [27243] = 265, --Seed of Corruption + [108503] = 265, --Grimoire of Sacrifice + [387073] = 265, --Soul Tap + [388667] = 265, --Drain Soul + [324536] = 265, --Malefic Rapture + [980] = 265, --Agony + + --Outlaw Rogue: + [195457] = 260, --Grappling Hook + [381989] = 260, --Keep It Rolling + [51690] = 260, --Killing Spree + [315341] = 260, --Between the Eyes + [196937] = 260, --Ghostly Strike + [2098] = 260, --Dispatch + [13877] = 260, --Blade Flurry + [271877] = 260, --Blade Rush + [315508] = 260, --Roll the Bones + [185763] = 260, --Pistol Shot + [343142] = 260, --Dreadblades + [13750] = 260, --Adrenaline Rush + + --Subtlety Rogue: + [114014] = 261, --Shuriken Toss + [197835] = 261, --Shuriken Storm + [185438] = 261, --Shadowstrike + [384631] = 261, --Flagellation + [277925] = 261, --Shuriken Tornado + [280719] = 261, --Secret Technique + [53] = 261, --Backstab + [212283] = 261, --Symbols of Death + [319175] = 261, --Black Powder + [121471] = 261, --Shadow Blades + + --Assassination Rogue: + [360194] = 259, --Deathmark + [381802] = 259, --Indiscriminate Carnage + [185565] = 259, --Poisoned Knife + [385424] = 259, --Serrated Bone Spike + [381664] = 259, --Amplifying Poison + [385627] = 259, --Kingsbane + [51723] = 259, --Fan of Knives + [5938] = 259, --Shiv + [703] = 259, --Garrote + [32645] = 259, --Envenom + [200806] = 259, --Exsanguinate + [121411] = 259, --Crimson Tempest + [2823] = 259, --Deadly Poison + [1329] = 259, --Mutilate + + --Frost Mage: + [30455] = 64, --Ice Lance + [257537] = 64, --Ebonbolt + [235219] = 64, --Cold Snap + [190356] = 64, --Blizzard + [199786] = 64, --Glacial Spike + [153595] = 64, --Comet Storm + [44614] = 64, --Flurry + [12472] = 64, --Icy Veins + [205021] = 64, --Ray of Frost + [11426] = 64, --Ice Barrier + [31687] = 64, --Summon Water Elemental + [84714] = 64, --Frozen Orb + + --Fire Mage: + [133] = 63, --Fireball + [2120] = 63, --Flamestrike + [257541] = 63, --Phoenix Flames + [2948] = 63, --Scorch + [44457] = 63, --Living Bomb + [11366] = 63, --Pyroblast + [235313] = 63, --Blazing Barrier + [190319] = 63, --Combustion + + --Arcane Mage: + [365350] = 62, --Arcane Surge + [153626] = 62, --Arcane Orb + [12051] = 62, --Evocation + [157980] = 62, --Supernova + [30451] = 62, --Arcane Blast + [376103] = 62, --Radiant Spark + [759] = 62, --Conjure Mana Gem + [235450] = 62, --Prismatic Barrier + [114923] = 62, --Nether Tempest + [5143] = 62, --Arcane Missiles + [321507] = 62, --Touch of the Magi + [205025] = 62, --Presence of Mind + [44425] = 62, --Arcane Barrage + + --Holy Priest: + [372835] = 257, --Lightwell + [14914] = 257, --Holy Fire + [2050] = 257, --Holy Word: Serenity + [34861] = 257, --Holy Word: Sanctify + [596] = 257, --Prayer of Healing + [204883] = 257, --Circle of Healing + [2060] = 257, --Heal + [392941] = 257, --Apotheosis + [64843] = 257, --Divine Hymn + [372616] = 257, --Empyreal Blaze + [372760] = 257, --Divine Word + [47788] = 257, --Guardian Spirit + [64901] = 257, --Symbol of Hope + [88625] = 257, --Holy Word: Chastise + + --Shadow Priest: + [391109] = 258, --Dark Ascension + [48045] = 258, --Mind Sear + [335467] = 258, --Devouring Plague + [263346] = 258, --Dark Void + [64044] = 258, --Psychic Horror + [341374] = 258, --Damnation + [228260] = 258, --Void Eruption + [73510] = 258, --Mind Spike + [15407] = 258, --Mind Flay + [263165] = 258, --Void Torrent + [15487] = 258, --Silence + [47585] = 258, --Dispersion + [232698] = 258, --Shadowform + [205385] = 258, --Shadow Crash + [34914] = 258, --Vampiric Touch + + --Discipline Priest: + [62618] = 256, --Power Word: Barrier + [47536] = 256, --Rapture + [246287] = 256, --Evangelism + [194509] = 256, --Power Word: Radiance + [373178] = 256, --Light's Wrath + [33206] = 256, --Pain Suppression + [47540] = 256, --Penance + [129250] = 256, --Power Word: Solace + [314867] = 256, --Shadow Covenant + [214621] = 256, --Schism + + --Devastation Evoker: + [368847] = 1467, --Firestorm + [370452] = 1467, --Shattering Star + [375087] = 1467, --Dragonrage + [359073] = 1467, --Eternity Surge + [357211] = 1467, --Pyre + + --Preservation Evoker: + [370960] = 1468, --Emerald Communion + [370537] = 1468, --Stasis + [367226] = 1468, --Spiritbloom + [361178] = 1468, --Mass Return + [359816] = 1468, --Dream Flight + [355936] = 1468, --Dream Breath + [357170] = 1468, --Time Dilation + [363534] = 1468, --Rewind + [360823] = 1468, --Naturalize + [373861] = 1468, --Temporal Anomaly + [366155] = 1468, --Reversion + [364343] = 1468, --Echo + + --Protection Warrior: + [12975] = 73, --Last Stand + [6572] = 73, --Revenge + [1160] = 73, --Demoralizing Shout + [20243] = 73, --Devastate + [871] = 73, --Shield Wall + [1161] = 73, --Challenging Shout + [394062] = 73, --Rend + [190456] = 73, --Ignore Pain + [385952] = 73, --Shield Charge + + --Arms Warrior: + [7384] = 71, --Overpower + [118038] = 71, --Die by the Sword + [772] = 71, --Rend + [260708] = 71, --Sweeping Strikes + [227847] = 71, --Bladestorm + [12294] = 71, --Mortal Strike + [260643] = 71, --Skullsplitter + [167105] = 71, --Colossus Smash + [845] = 71, --Cleave + + --Fury Warrior: + [85288] = 72, --Raging Blow + [1719] = 72, --Recklessness + [315720] = 72, --Onslaught + [184367] = 72, --Rampage + [184364] = 72, --Enraged Regeneration + [5308] = 72, --Execute + [385059] = 72, --Odyn's Fury + [190411] = 72, --Whirlwind + [23881] = 72, --Bloodthirst + + --Survival Hunter: + [360952] = 255, --Coordinated Assault + [186270] = 255, --Raptor Strike + [186289] = 255, --Aspect of the Eagle + [212436] = 255, --Butchery + [259495] = 255, --Wildfire Bomb + [269751] = 255, --Flanking Strike + [190925] = 255, --Harpoon + [187708] = 255, --Carve + [203415] = 255, --Fury of the Eagle + [360966] = 255, --Spearhead + [259489] = 255, --Kill Command + + --Marksmanship Hunter: + [260402] = 254, --Double Tap + [260243] = 254, --Volley + [186387] = 254, --Bursting Shot + [257620] = 254, --Multi-Shot + [288613] = 254, --Trueshot + [257044] = 254, --Rapid Fire + [19434] = 254, --Aimed Shot + + --Beast Mastery Hunter: + [2643] = 253, --Multi-Shot + [120679] = 253, --Dire Beast + [359844] = 253, --Call of the Wild + [321530] = 253, --Bloodshed + [131894] = 253, --A Murder of Crows + [19574] = 253, --Bestial Wrath + [217200] = 253, --Barbed Shot + [34026] = 253, --Kill Command + [193530] = 253, --Aspect of the Wild + + + } + + elseif (DetailsFramework.IsWotLKWow()) then _detalhes.SpecSpellList = { --~spec -- Balance Druid: @@ -341,6 +849,7 @@ do } else + --shadowlands _detalhes.SpecSpellList = { --~spec --spyro healer diff --git a/startup.lua b/startup.lua index 5c8b6357..f6b60e7c 100644 --- a/startup.lua +++ b/startup.lua @@ -6,10 +6,8 @@ local C_Timer = _G.C_Timer local CreateFrame = _G.CreateFrame local Loc = _G.LibStub("AceLocale-3.0"):GetLocale("Details") - --start funtion function Details:StartMeUp() --I'll never stop! - --set default time for arena and bg to be the Details! load time in case the client loads mid event Details.lastArenaStartTime = GetTime() Details.lastBattlegroundStartTime = GetTime() @@ -19,121 +17,116 @@ function Details:StartMeUp() --I'll never stop! --> single click row function replace --damage, dps, damage taken, friendly fire - self.row_singleclick_overwrite [1] = {true, true, true, true, self.atributo_damage.ReportSingleFragsLine, self.atributo_damage.ReportEnemyDamageTaken, self.atributo_damage.ReportSingleVoidZoneLine, self.atributo_damage.ReportSingleDTBSLine} + self.row_singleclick_overwrite[1] = {true, true, true, true, self.atributo_damage.ReportSingleFragsLine, self.atributo_damage.ReportEnemyDamageTaken, self.atributo_damage.ReportSingleVoidZoneLine, self.atributo_damage.ReportSingleDTBSLine} --healing, hps, overheal, healing taken - self.row_singleclick_overwrite [2] = {true, true, true, true, false, self.atributo_heal.ReportSingleDamagePreventedLine} + self.row_singleclick_overwrite[2] = {true, true, true, true, false, self.atributo_heal.ReportSingleDamagePreventedLine} --mana, rage, energy, runepower - self.row_singleclick_overwrite [3] = {true, true, true, true} + self.row_singleclick_overwrite[3] = {true, true, true, true} --cc breaks, ress, interrupts, dispells, deaths - self.row_singleclick_overwrite [4] = {true, true, true, true, self.atributo_misc.ReportSingleDeadLine, self.atributo_misc.ReportSingleCooldownLine, self.atributo_misc.ReportSingleBuffUptimeLine, self.atributo_misc.ReportSingleDebuffUptimeLine} - - function self:ReplaceRowSingleClickFunction(attribute, sub_attribute, func) + self.row_singleclick_overwrite[4] = {true, true, true, true, self.atributo_misc.ReportSingleDeadLine, self.atributo_misc.ReportSingleCooldownLine, self.atributo_misc.ReportSingleBuffUptimeLine, self.atributo_misc.ReportSingleDebuffUptimeLine} + + function self:ReplaceRowSingleClickFunction(attribute, subAttribute, func) assert(type(attribute) == "number" and attribute >= 1 and attribute <= 4, "ReplaceRowSingleClickFunction expects a attribute index on #1 argument.") - assert(type(sub_attribute) == "number" and sub_attribute >= 1 and sub_attribute <= 10, "ReplaceRowSingleClickFunction expects a sub attribute index on #2 argument.") + assert(type(subAttribute) == "number" and subAttribute >= 1 and subAttribute <= 10, "ReplaceRowSingleClickFunction expects a sub attribute index on #2 argument.") assert(type(func) == "function", "ReplaceRowSingleClickFunction expects a function on #3 argument.") - - self.row_singleclick_overwrite [attribute] [sub_attribute] = func + + self.row_singleclick_overwrite[attribute][subAttribute] = func return true end - + self.click_to_report_color = {1, 0.8, 0, 1} - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> initialize + C_Timer.After(2, function() + --test libOpenRaid deprecated code + --[=[ + local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0") + openRaidLib.playerInfoManager.GetPlayerInfo() + openRaidLib.RequestAllPlayersInfo() + openRaidLib.playerInfoManager.GetAllPlayersInfo() + openRaidLib.gearManager.GetAllPlayersGear() + openRaidLib.gearManager.GetPlayerGear() + openRaidLib.cooldownManager.GetAllPlayersCooldown() + openRaidLib.cooldownManager.GetPlayerCooldowns() + --]=] + end) - C_Timer.After(2, function() - --test libOpenRaid deprecated code - --[=[ - local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0") - openRaidLib.playerInfoManager.GetPlayerInfo() - openRaidLib.RequestAllPlayersInfo() - openRaidLib.playerInfoManager.GetAllPlayersInfo() - openRaidLib.gearManager.GetAllPlayersGear() - openRaidLib.gearManager.GetPlayerGear() - openRaidLib.cooldownManager.GetAllPlayersCooldown() - openRaidLib.cooldownManager.GetPlayerCooldowns() - --]=] - end) + --plugin container + self:CreatePluginWindowContainer() + self:InitializeForge() --to install into the container plugin + self:InitializeRaidHistoryWindow() + --self:InitializeOptionsWindow() - --build frames - --plugin container - self:CreatePluginWindowContainer() - self:InitializeForge() --to install into the container plugin - self:InitializeRaidHistoryWindow() - --self:InitializeOptionsWindow() - - C_Timer.After(2, function() - self:InitializeAuraCreationWindow() - end) - - self:InitializeCustomDisplayWindow() - self:InitializeAPIWindow() - self:InitializeRunCodeWindow() - self:InitializePlaterIntegrationWindow() - self:InitializeMacrosWindow() + C_Timer.After(2, function() + self:InitializeAuraCreationWindow() + end) + + self:InitializeCustomDisplayWindow() + self:InitializeAPIWindow() + self:InitializeRunCodeWindow() + self:InitializePlaterIntegrationWindow() + self:InitializeMacrosWindow() + + if (self.ocd_tracker.show_options) then + self:InitializeCDTrackerWindow() + end + + --custom window + self.custom = self.custom or {} + + --micro button alert + --"MainMenuBarMicroButton" has been removed on 9.0 + self.MicroButtonAlert = CreateFrame("frame", "DetailsMicroButtonAlert", UIParent) + self.MicroButtonAlert.Text = self.MicroButtonAlert:CreateFontString(nil, "overlay", "GameFontNormal") + self.MicroButtonAlert.Text:SetPoint("center") + self.MicroButtonAlert:Hide() + + --actor details window + self.playerDetailWindow = self.gump:CriaJanelaInfo() + Details.FadeHandler.Fader(self.playerDetailWindow, 1) + + --copy and paste window + self:CreateCopyPasteWindow() + self.CreateCopyPasteWindow = nil + + --start instances + if (self:GetNumInstancesAmount() == 0) then + self:CriarInstancia() + end + self:GetLowerInstanceNumber() + + --start time machine + self.timeMachine:Ligar() + + --update abbreviation shortcut + self.atributo_damage:UpdateSelectedToKFunction() + self.atributo_heal:UpdateSelectedToKFunction() + self.atributo_energy:UpdateSelectedToKFunction() + self.atributo_misc:UpdateSelectedToKFunction() + self.atributo_custom:UpdateSelectedToKFunction() - if (self.ocd_tracker.show_options) then - self:InitializeCDTrackerWindow() - end - - --custom window - self.custom = self.custom or {} - - --micro button alert - --"MainMenuBarMicroButton" has been removed on 9.0 - self.MicroButtonAlert = CreateFrame("frame", "DetailsMicroButtonAlert", UIParent) - self.MicroButtonAlert.Text = self.MicroButtonAlert:CreateFontString(nil, "overlay", "GameFontNormal") - self.MicroButtonAlert.Text:SetPoint("center") - self.MicroButtonAlert:Hide() - - --actor details window - self.playerDetailWindow = self.gump:CriaJanelaInfo() - Details.FadeHandler.Fader(self.playerDetailWindow, 1) - - --copy and paste window - self:CreateCopyPasteWindow() - self.CreateCopyPasteWindow = nil - - --> start instances - if (self:GetNumInstancesAmount() == 0) then - self:CriarInstancia() - end - self:GetLowerInstanceNumber() - - --> start time machine - self.timeMachine:Ligar() - - --> update abbreviation shortcut - - self.atributo_damage:UpdateSelectedToKFunction() - self.atributo_heal:UpdateSelectedToKFunction() - self.atributo_energy:UpdateSelectedToKFunction() - self.atributo_misc:UpdateSelectedToKFunction() - self.atributo_custom:UpdateSelectedToKFunction() - --> start instances updater - self:CheckSwitchOnLogon() - - function _detalhes:ScheduledWindowUpdate(forced) - if (not forced and _detalhes.in_combat) then + + function Details:ScheduledWindowUpdate(forced) + if (not forced and Details.in_combat) then return end - _detalhes.scheduled_window_update = nil - _detalhes:RefreshMainWindow(-1, true) + Details.scheduled_window_update = nil + Details:RefreshMainWindow(-1, true) end - function _detalhes:ScheduleWindowUpdate(time, forced) - if (_detalhes.scheduled_window_update) then - Details.Schedules.Cancel(_detalhes.scheduled_window_update) - _detalhes.scheduled_window_update = nil + function Details:ScheduleWindowUpdate(time, forced) + if (Details.scheduled_window_update) then + Details.Schedules.Cancel(Details.scheduled_window_update) + Details.scheduled_window_update = nil end - --_detalhes.scheduled_window_update = _detalhes:ScheduleTimer("ScheduledWindowUpdate", time or 1, forced) - _detalhes.scheduled_window_update = Details.Schedules.NewTimer(time or 1, Details.ScheduledWindowUpdate, Details, forced) + Details.scheduled_window_update = Details.Schedules.NewTimer(time or 1, Details.ScheduledWindowUpdate, Details, forced) end - + self:RefreshMainWindow(-1, true) Details:RefreshUpdater() - + for index = 1, #self.tabela_instancias do local instance = self.tabela_instancias[index] if (instance:IsAtiva()) then @@ -148,9 +141,8 @@ function Details:StartMeUp() --I'll never stop! end function self:RefreshAfterStartup() - --repair nicknames - if (not _detalhes.ignore_nicktag) then + if (not Details.ignore_nicktag) then local currentCombat = Details:GetCurrentCombat() local containerDamage = currentCombat:GetContainer(DETAILS_ATTRIBUTE_DAMAGE) for _, actorObject in containerDamage:ListActors() do @@ -164,32 +156,32 @@ function Details:StartMeUp() --I'll never stop! self:RefreshMainWindow(-1, true) - local lower_instance = _detalhes:GetLowerInstanceNumber() + local lower_instance = Details:GetLowerInstanceNumber() for index = 1, #self.tabela_instancias do local instance = self.tabela_instancias [index] if(instance:IsAtiva()) then - --> refresh wallpaper + --refresh wallpaper if(instance.wallpaper.enabled) then instance:InstanceWallpaper(true) else instance:InstanceWallpaper(false) end - - --> refresh desaturated icons if is lower instance + + --refresh desaturated icons if is lower instance if(index == lower_instance) then instance:DesaturateMenu() instance:SetAutoHideMenu(nil, nil, true) end - end end - - --> refresh lower instance plugin icons and skin - _detalhes.ToolBar:ReorganizeIcons() - --> refresh skin for other windows - if(lower_instance) then + + --refresh lower instance plugin icons and skin + Details.ToolBar:ReorganizeIcons() + + --refresh skin for other windows + if (lower_instance) then for i = lower_instance+1, #self.tabela_instancias do local instance = self:GetInstance(i) if (instance and instance.baseframe and instance.ativa) then @@ -197,22 +189,22 @@ function Details:StartMeUp() --I'll never stop! end end end - + self.RefreshAfterStartup = nil - - function _detalhes:CheckWallpaperAfterStartup() - if (not _detalhes.profile_loaded) then + + function Details:CheckWallpaperAfterStartup() + if (not Details.profile_loaded) then Details.Schedules.NewTimer(5, Details.CheckWallpaperAfterStartup, Details) - --return _detalhes:ScheduleTimer ("CheckWallpaperAfterStartup", 2) + --return Details:ScheduleTimer ("CheckWallpaperAfterStartup", 2) end - + for i = 1, self.instances_amount do local instance = self:GetInstance (i) if (instance and instance:IsEnabled()) then if (not instance.wallpaper.enabled) then instance:InstanceWallpaper (false) end - + instance.do_not_snap = true self.move_janela_func (instance.baseframe, true, instance, true) self.move_janela_func (instance.baseframe, false, instance, true) @@ -220,9 +212,9 @@ function Details:StartMeUp() --I'll never stop! end end self.CheckWallpaperAfterStartup = nil - _detalhes.profile_loaded = nil + Details.profile_loaded = nil end - --_detalhes:ScheduleTimer ("CheckWallpaperAfterStartup", 5) + --Details:ScheduleTimer ("CheckWallpaperAfterStartup", 5) Details.Schedules.NewTimer(5, Details.CheckWallpaperAfterStartup, Details) end @@ -281,19 +273,19 @@ function Details:StartMeUp() --I'll never stop! --update is in group self.details_users = {} self.in_group = IsInGroup() or IsInRaid() - + --done self.initializing = nil - + --scan pets - _detalhes:SchedulePetUpdate(1) - + Details:SchedulePetUpdate(1) + --send messages gathered on initialization --self:ScheduleTimer ("ShowDelayMsg", 10) Details.Schedules.NewTimer(10, Details.ShowDelayMsg, Details) - + --send instance open signal - for index, instancia in _detalhes:ListInstances() do + for index, instancia in Details:ListInstances() do if (instancia.ativa) then self:SendEvent ("DETAILS_INSTANCE_OPEN", nil, instancia) end @@ -302,30 +294,30 @@ function Details:StartMeUp() --I'll never stop! --send details startup done signal function self:AnnounceStartup() self:SendEvent ("DETAILS_STARTED", "SEND_TO_ALL") - - if (_detalhes.in_group) then - _detalhes:SendEvent ("GROUP_ONENTER") + + if (Details.in_group) then + Details:SendEvent ("GROUP_ONENTER") else - _detalhes:SendEvent ("GROUP_ONLEAVE") + Details:SendEvent ("GROUP_ONLEAVE") end - - _detalhes.last_zone_type = "INIT" - _detalhes.parser_functions:ZONE_CHANGED_NEW_AREA() - - _detalhes.AnnounceStartup = nil + + Details.last_zone_type = "INIT" + Details.parser_functions:ZONE_CHANGED_NEW_AREA() + + Details.AnnounceStartup = nil end --self:ScheduleTimer ("AnnounceStartup", 5) Details.Schedules.NewTimer(5, Details.AnnounceStartup, Details) - - if (_detalhes.failed_to_load) then - _detalhes:CancelTimer (_detalhes.failed_to_load) - _detalhes.failed_to_load = nil + + if (Details.failed_to_load) then + Details:CancelTimer (Details.failed_to_load) + Details.failed_to_load = nil end --announce alpha version function self:AnnounceVersion() - for index, instancia in _detalhes:ListInstances() do + for index, instancia in Details:ListInstances() do if (instancia.ativa) then Details.FadeHandler.Fader(instancia._version, "in", 0.1) end @@ -333,25 +325,24 @@ function Details:StartMeUp() --I'll never stop! end --check version - _detalhes:CheckVersion(true) - + Details:CheckVersion(true) + --restore cooltip anchor position, this is for the custom anchor in the screen _G.DetailsTooltipAnchor:Restore() - + --check is this is the first run if (self.is_first_run) then if (#self.custom == 0) then - _detalhes:AddDefaultCustomDisplays() + Details:AddDefaultCustomDisplays() end - _detalhes:FillUserCustomSpells() + Details:FillUserCustomSpells() end - + --check is this is the first run of this version if (self.is_version_first_run) then - - local lower_instance = _detalhes:GetLowerInstanceNumber() + local lower_instance = Details:GetLowerInstanceNumber() if (lower_instance) then - lower_instance = _detalhes:GetInstance (lower_instance) + lower_instance = Details:GetInstance (lower_instance) if (lower_instance) then --check if there's changes in the size of the news string @@ -367,7 +358,7 @@ function Details:StartMeUp() --I'll never stop! if (lower_instance) then _G.C_Timer.After(10, function() if (lower_instance:IsEnabled()) then - lower_instance:InstanceAlert(Loc ["STRING_VERSION_UPDATE"], {[[Interface\GossipFrame\AvailableQuestIcon]], 16, 16, false}, 60, {_detalhes.OpenNewsWindow}, true) + lower_instance:InstanceAlert(Loc ["STRING_VERSION_UPDATE"], {[[Interface\GossipFrame\AvailableQuestIcon]], 16, 16, false}, 60, {Details.OpenNewsWindow}, true) Details:Msg("A new version has been installed: /details news") --localize-me end end) @@ -375,32 +366,31 @@ function Details:StartMeUp() --I'll never stop! end end end - - _detalhes:FillUserCustomSpells() - _detalhes:AddDefaultCustomDisplays() - end - - local lower = _detalhes:GetLowerInstanceNumber() - if (lower) then - local instance = _detalhes:GetInstance (lower) - if (instance) then + Details:FillUserCustomSpells() + Details:AddDefaultCustomDisplays() + end + + local lower = Details:GetLowerInstanceNumber() + if (lower) then + local instance = Details:GetInstance (lower) + if (instance) then --in development local dev_icon = instance.bgdisplay:CreateTexture (nil, "overlay") dev_icon:SetWidth (40) dev_icon:SetHeight (40) dev_icon:SetPoint ("bottomleft", instance.baseframe, "bottomleft", 4, 8) dev_icon:SetAlpha (.3) - + local dev_text = instance.bgdisplay:CreateFontString (nil, "overlay", "GameFontHighlightSmall") dev_text:SetHeight (64) dev_text:SetPoint ("left", dev_icon, "right", 5, 0) dev_text:SetTextColor (1, 1, 1) dev_text:SetAlpha (.3) - + --version Details.FadeHandler.Fader (instance._version, 0) - instance._version:SetText ("Details! " .. _detalhes.userversion .. " (core " .. self.realversion .. ")") + instance._version:SetText ("Details! " .. Details.userversion .. " (core " .. self.realversion .. ")") instance._version:SetTextColor (1, 1, 1, .35) instance._version:SetPoint ("bottomleft", instance.baseframe, "bottomleft", 5, 1) @@ -408,7 +398,7 @@ function Details:StartMeUp() --I'll never stop! instance:SwitchBack() end - function _detalhes:FadeStartVersion() + function Details:FadeStartVersion() Details.FadeHandler.Fader (dev_icon, "in", 2) Details.FadeHandler.Fader (dev_text, "in", 2) Details.FadeHandler.Fader (instance._version, "in", 2) @@ -416,92 +406,95 @@ function Details:StartMeUp() --I'll never stop! Details.Schedules.NewTimer(12, Details.FadeStartVersion, Details) end end - - function _detalhes:OpenOptionsWindowAtStart() - --_detalhes:OpenOptionsWindow (_detalhes.tabela_instancias[1]) + + function Details:OpenOptionsWindowAtStart() + --Details:OpenOptionsWindow (Details.tabela_instancias[1]) --print (_G ["DetailsClearSegmentsButton1"]:GetSize()) - --_detalhes:OpenCustomDisplayWindow() - --_detalhes:OpenWelcomeWindow() + --Details:OpenCustomDisplayWindow() + --Details:OpenWelcomeWindow() end - --_detalhes:ScheduleTimer ("OpenOptionsWindowAtStart", 2) + --Details:ScheduleTimer ("OpenOptionsWindowAtStart", 2) Details.Schedules.NewTimer(2, Details.OpenOptionsWindowAtStart, Details) - --_detalhes:OpenCustomDisplayWindow() - + --Details:OpenCustomDisplayWindow() + --> minimap - pcall (_detalhes.RegisterMinimap, Details) - + pcall (Details.RegisterMinimap, Details) + --hot corner addon - function _detalhes:RegisterHotCorner() - _detalhes:DoRegisterHotCorner() + function Details:RegisterHotCorner() + Details:DoRegisterHotCorner() end - --_detalhes:ScheduleTimer ("RegisterHotCorner", 5) + --Details:ScheduleTimer ("RegisterHotCorner", 5) Details.Schedules.NewTimer(5, Details.RegisterHotCorner, Details) --restore mythic dungeon state - _detalhes:RestoreState_CurrentMythicDungeonRun() + Details:RestoreState_CurrentMythicDungeonRun() --open profiler - _detalhes:OpenProfiler() - + Details:OpenProfiler() + --start announcers - _detalhes:StartAnnouncers() - + Details:StartAnnouncers() + --open welcome if (self.is_first_run) then - _G.C_Timer.After (1, function() --wait details full load the rest of the systems before executing the welcome window - _detalhes:OpenWelcomeWindow() + C_Timer.After(1, function() --wait details full load the rest of the systems before executing the welcome window + Details:OpenWelcomeWindow() end) end - + --load broadcaster tools - _detalhes:LoadFramesForBroadcastTools() - _detalhes:BrokerTick() - + Details:LoadFramesForBroadcastTools() + Details:BrokerTick() + --register boss mobs callbacks (DBM and BigWigs) -> functions/bossmods.lua Details.Schedules.NewTimer(5, Details.BossModsLink, Details) --limit item level life for 24Hs local now = _G.time() - for guid, t in pairs (_detalhes.item_level_pool) do + for guid, t in pairs(Details.item_level_pool) do if (t.time + 86400 < now) then - _detalhes.item_level_pool [guid] = nil + Details.item_level_pool[guid] = nil end end - + --dailly reset of the cache for talents and specs local today = _G.date("%d") - if (_detalhes.last_day ~= today) then - wipe(_detalhes.cached_specs) - wipe(_detalhes.cached_talents) + if (Details.last_day ~= today) then + wipe(Details.cached_specs) + wipe(Details.cached_talents) end - --> get the player spec - C_Timer.After(2, _detalhes.parser_functions.PLAYER_SPECIALIZATION_CHANGED) + --get the player spec + C_Timer.After(2, Details.parser_functions.PLAYER_SPECIALIZATION_CHANGED) --embed windows on the chat window - _detalhes.chat_embed:CheckChatEmbed(true) - - --save the time when the addon finished loading - _detalhes.AddOnStartTime = _G.GetTime() - - if (_detalhes.player_details_window.skin ~= "ElvUI") then + 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 reset_player_detail_window = function() - _detalhes:ApplyPDWSkin("ElvUI") + Details:ApplyPDWSkin("ElvUI") end C_Timer.After(2, reset_player_detail_window) end - + --coach feature startup Details.Coach.StartUp() --force the group edit be always enabled when Details! starts - _detalhes.options_group_edit = true + Details.options_group_edit = true --shutdown pre-pot announcer Details.announce_prepots.enabled = false --remove standard skin on 9.0.1 - _detalhes.standard_skin = false + Details.standard_skin = false --enforce to show 6 abilities on the tooltip --_detalhes.tooltip.tooltip_max_abilities = 6 freeeeeedooommmmm @@ -509,12 +502,12 @@ function Details:StartMeUp() --I'll never stop! --Plater integration C_Timer.After(2, function() - _detalhes:RefreshPlaterIntegration() + Details:RefreshPlaterIntegration() end) - + --show warning message about classic beta if (not DetailsFramework.IsClassicWow()) then - + --i'm not in classc wow else print ("|CFFFFFF00[Details!]: you're using Details! for RETAIL on Classic WOW, please get the classic version (Details! Damage Meter Classic WoW), if you need help see our Discord (/details discord).") end @@ -543,8 +536,8 @@ function Details:StartMeUp() --I'll never stop! Details.boss_mods_timers.encounter_timers_bw = Details.boss_mods_timers.encounter_timers_bw or {} --clear overall data on new session - if (_detalhes.overall_clear_logout) then - _detalhes.tabela_overall = _detalhes.combate:NovaTabela() + if (Details.overall_clear_logout) then + Details.tabela_overall = Details.combate:NovaTabela() end if (not DetailsFramework.IsTimewalkWoW()) then @@ -561,6 +554,7 @@ function Details:StartMeUp() --I'll never stop! end) end + --hide the panel shown by pressing the right mouse button on the title bar when a cooltip is opened hooksecurefunc(GameCooltip, "SetMyPoint", function() if (DetailsAllAttributesFrame) then DetailsAllAttributesFrame:Hide() @@ -574,9 +568,13 @@ function Details:StartMeUp() --I'll never stop! function Details:InstallOkey() return true end + + --shutdown the old OnDeathMenu + --cleanup: this line can be removed after the first month of dragonflight + Details.on_death_menu = false end -_detalhes.AddOnLoadFilesTime = _G.GetTime() +Details.AddOnLoadFilesTime = _G.GetTime()