diff --git a/classes/class_custom.lua b/classes/class_custom.lua index cf448bd1..1e7c45ba 100644 --- a/classes/class_custom.lua +++ b/classes/class_custom.lua @@ -840,7 +840,8 @@ newActor.name_complement = name_complement newActor.displayName = actor.displayName or (_detalhes:GetOnlyName(newActor.nome) .. (name_complement or "")) - newActor.spec = actor.spec + + newActor:SetSpecId(actor.spec) newActor.enemy = actor.enemy newActor.role = actor.role diff --git a/classes/class_damage.lua b/classes/class_damage.lua index 87251459..0b365d7c 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -5380,7 +5380,7 @@ end shadow = overall_dano:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) shadow.classe = actor.classe - shadow.spec = actor.spec + shadow:SetSpecId(actor.spec) shadow.grupo = actor.grupo shadow.pvp = actor.pvp shadow.isTank = actor.isTank @@ -5450,7 +5450,7 @@ end shadow = overall_dano:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) shadow.classe = actor.classe - shadow.spec = actor.spec + shadow:SetSpecId(actor.spec) shadow.isTank = actor.isTank shadow.grupo = actor.grupo shadow.pvp = actor.pvp diff --git a/classes/class_heal.lua b/classes/class_heal.lua index 83249d8f..63579118 100644 --- a/classes/class_heal.lua +++ b/classes/class_heal.lua @@ -2477,7 +2477,7 @@ end shadow = overall_cura:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) shadow.classe = actor.classe - shadow.spec = actor.spec + shadow:SetSpecId(actor.spec) shadow.grupo = actor.grupo shadow.pvp = actor.pvp shadow.isTank = actor.isTank @@ -2560,7 +2560,7 @@ end shadow = overall_cura:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) shadow.classe = actor.classe - shadow.spec = actor.spec + shadow:SetSpecId(actor.spec) shadow.grupo = actor.grupo shadow.pvp = actor.pvp shadow.isTank = actor.isTank diff --git a/classes/class_resources.lua b/classes/class_resources.lua index 126969a6..3161fd5d 100644 --- a/classes/class_resources.lua +++ b/classes/class_resources.lua @@ -1403,7 +1403,7 @@ end shadow = overall_energy:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) shadow.classe = actor.classe - shadow.spec = actor.spec + shadow:SetSpecId(actor.spec) shadow.grupo = actor.grupo shadow.pvp = actor.pvp shadow.isTank = actor.isTank @@ -1451,7 +1451,7 @@ end shadow = overall_energy:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) shadow.classe = actor.classe - shadow.spec = actor.spec + shadow:SetSpecId(actor.spec) shadow.grupo = actor.grupo shadow.pvp = actor.pvp shadow.isTank = actor.isTank diff --git a/classes/class_utility.lua b/classes/class_utility.lua index 8d472c05..ad8f3952 100644 --- a/classes/class_utility.lua +++ b/classes/class_utility.lua @@ -2352,7 +2352,7 @@ function atributo_misc:r_onlyrefresh_shadow (actor) shadow = overall_misc:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) shadow.classe = actor.classe - shadow.spec = actor.spec + shadow:SetSpecId(actor.spec) shadow.grupo = actor.grupo shadow.pvp = actor.pvp shadow.isTank = actor.isTank @@ -2481,7 +2481,7 @@ function atributo_misc:r_connect_shadow (actor, no_refresh, combat_object) shadow = overall_misc:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) shadow.classe = actor.classe - shadow.spec = actor.spec + shadow:SetSpecId(actor.spec) shadow.grupo = actor.grupo shadow.pvp = actor.pvp shadow.isTank = actor.isTank diff --git a/classes/container_actors.lua b/classes/container_actors.lua index ea654411..dd8cd400 100644 --- a/classes/container_actors.lua +++ b/classes/container_actors.lua @@ -171,7 +171,7 @@ if (_detalhes.track_specs) then local have_cached = _detalhes.cached_specs [serial] if (have_cached) then - novo_objeto.spec = have_cached + novo_objeto:SetSpecId(have_cached) --check is didn't changed the spec: if (_detalhes.streamer_config.quick_detection) then --validate the spec more times if on quick detection diff --git a/core/gears.lua b/core/gears.lua index 63f7e0eb..2a9648da 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -364,7 +364,7 @@ function _detalhes:TrackSpecsNow (track_everything) if (actor:IsPlayer()) then for spellid, spell in pairs(actor:GetSpellList()) do if (spelllist [spell.id]) then - actor.spec = spelllist [spell.id] + actor:SetSpecId(spelllist[spell.id]) _detalhes.cached_specs [actor.serial] = actor.spec break end @@ -376,7 +376,7 @@ function _detalhes:TrackSpecsNow (track_everything) if (actor:IsPlayer()) then for spellid, spell in pairs(actor:GetSpellList()) do if (spelllist [spell.id]) then - actor.spec = spelllist [spell.id] + actor:SetSpecId(spelllist[spell.id]) _detalhes.cached_specs [actor.serial] = actor.spec break end @@ -396,7 +396,7 @@ function _detalhes:TrackSpecsNow (track_everything) if (actor:IsPlayer()) then for spellid, spell in pairs(actor:GetSpellList()) do if (spelllist [spell.id]) then - actor.spec = spelllist [spell.id] + actor:SetSpecId(spelllist[spell.id]) _detalhes.cached_specs [actor.serial] = actor.spec break end @@ -408,7 +408,7 @@ function _detalhes:TrackSpecsNow (track_everything) if (actor:IsPlayer()) then for spellid, spell in pairs(actor:GetSpellList()) do if (spelllist [spell.id]) then - actor.spec = spelllist [spell.id] + actor:SetSpecId(spelllist[spell.id]) _detalhes.cached_specs [actor.serial] = actor.spec break end @@ -3093,4 +3093,16 @@ Details.performanceData = { callStack = "", culpritFunc = "", culpritDesc = "", -} \ No newline at end of file +} + +function Details:HandleRogueCombatSpecIconByGameVersion() + local _, _, _, patchVersion = GetBuildInfo() + if (patchVersion >= 70000) then --Legion + --rogue combat is a rogue outlaw + local rogueCombatCoords = Details.class_specs_coords[260] + rogueCombatCoords[1] = 0 + rogueCombatCoords[2] = 64 / 512 + rogueCombatCoords[3] = 384 / 512 + rogueCombatCoords[4] = 448 / 512 + end +end \ No newline at end of file diff --git a/functions/classes.lua b/functions/classes.lua index e419cf4d..98779d91 100644 --- a/functions/classes.lua +++ b/functions/classes.lua @@ -100,6 +100,26 @@ do CONTAINER_ENEMYDEBUFFTARGET_CLASS = 11 } + local initialSpecListOverride = { + [1455] = 251, --dk + [1456] = 577, --demon hunter + [1447] = 102, --druid + [1465] = 1467, --evoker + [1448] = 253, --hunter + [1449] = 63, --mage + [1450] = 269, --monk + [1451] = 70, --paladin + [1452] = 258, --priest + [1453] = 260, --rogue + [1444] = 262, --shaman + [1454] = 266, --warlock + [1446] = 71, --warrior + } + + function Details:SetSpecId(specId) + self.spec = initialSpecListOverride[specId] or specId + end + function _detalhes:Name (actor) return self.nome or actor and actor.nome end diff --git a/functions/pack.lua b/functions/pack.lua index 27ae1e72..2508e7f5 100644 --- a/functions/pack.lua +++ b/functions/pack.lua @@ -612,7 +612,7 @@ function Details.packFunctions.UnPackDamage(currentCombat, combatData, tablePosi --set the actor class, spec and group actorObject.classe = class - actorObject.spec = spec + actorObject:SetSpecId(spec) actorObject.grupo = isActorInGroup(class, actorFlag) actorObject.flag_original = actorFlag @@ -860,7 +860,7 @@ function Details.packFunctions.UnPackHeal(currentCombat, combatData, tablePositi --set the actor class, spec and group actorObject.classe = class - actorObject.spec = spec + actorObject:SetSpecId(spec) actorObject.grupo = isActorInGroup(class, actorFlag) actorObject.flag_original = actorFlag @@ -1392,7 +1392,7 @@ function Details.packFunctions.UnPackUtility(currentCombat, combatData, tablePos --set the actor class, spec and group actorObject.classe = class - actorObject.spec = spec + actorObject:SetSpecId(spec) actorObject.grupo = isActorInGroup(class, actorFlag) actorObject.flag_original = actorFlag --finished utility actor setup diff --git a/functions/playerclass.lua b/functions/playerclass.lua index 540d5fd4..5c08f291 100644 --- a/functions/playerclass.lua +++ b/functions/playerclass.lua @@ -301,7 +301,7 @@ do if (spec) then _detalhes.cached_specs [Actor.serial] = spec - Actor.spec = spec + Actor:SetSpecId(spec) Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe Actor.guessing_spec = nil @@ -328,7 +328,7 @@ do if (spec ~= Actor.spec) then _detalhes.cached_specs [Actor.serial] = spec - Actor.spec = spec + Actor:SetSpecId(spec) Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe Details:SendEvent("UNIT_SPEC", nil, Actor:GetUnitId(), spec, Actor.serial) @@ -362,7 +362,7 @@ do if (spec ~= Actor.spec) then _detalhes.cached_specs [Actor.serial] = spec - Actor.spec = spec + Actor:SetSpecId(spec) Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe Details:SendEvent("UNIT_SPEC", nil, Actor:GetUnitId(), spec, Actor.serial) @@ -405,7 +405,7 @@ do --get from the spec cache local spec = _detalhes.cached_specs [Actor.serial] if (spec) then - Actor.spec = spec + Actor:SetSpecId(spec) Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe Actor.guessing_spec = nil @@ -432,7 +432,7 @@ do if (spec) then _detalhes.cached_specs [Actor.serial] = spec - Actor.spec = spec + Actor:SetSpecId(spec) Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe Details:SendEvent("UNIT_SPEC", nil, Actor:GetUnitId(), spec, Actor.serial) @@ -458,7 +458,7 @@ do if (spec) then _detalhes.cached_specs [Actor.serial] = spec - Actor.spec = spec + Actor:SetSpecId(spec) Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe Actor.guessing_spec = nil @@ -486,7 +486,7 @@ do if (spec) then _detalhes.cached_specs [Actor.serial] = spec - Actor.spec = spec + Actor:SetSpecId(spec) Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe Actor.guessing_spec = nil @@ -520,7 +520,7 @@ do _detalhes.cached_specs [Actor.serial] = spec - Actor.spec = spec + Actor:SetSpecId(spec) Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe Actor.guessing_spec = nil @@ -547,7 +547,7 @@ do _detalhes.cached_specs [Actor.serial] = spec - Actor.spec = spec + Actor:SetSpecId(spec) Actor.classe = _detalhes.SpecIDToClass [spec] or Actor.classe Actor.need_refresh = true Actor.guessing_spec = nil diff --git a/functions/profiles.lua b/functions/profiles.lua index d9729b84..2f711daa 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -502,6 +502,9 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) --refresh broadcaster tools _detalhes:LoadFramesForBroadcastTools() + --change the rogue spec combat icon to outlaw depending on the game version + Details:HandleRogueCombatSpecIconByGameVersion() + if (_detalhes.initializing) then _detalhes.profile_loaded = true end diff --git a/functions/testbars.lua b/functions/testbars.lua index 663ba1eb..62e46a4d 100644 --- a/functions/testbars.lua +++ b/functions/testbars.lua @@ -201,40 +201,40 @@ function Details:CreateTestBars (alphabet, isArena) end if (who[3]) then - robot.spec = who[3] + robot:SetSpecId(who[3]) elseif (robot.classe == "DEATHKNIGHT") then local specs = {250, 251, 252} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "DRUID") then local specs = {102, 103, 104, 105} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "HUNTER") then local specs = {253, 254, 255} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "MAGE") then local specs = {62, 63, 64} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "MONK") then local specs = {268, 269, 270} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "PALADIN") then local specs = {65, 66, 70} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "PRIEST") then local specs = {256, 257, 258} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "ROGUE") then local specs = {259, 260, 261} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "SHAMAN") then local specs = {262, 263, 264} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "WARLOCK") then local specs = {265, 266, 267} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "WARRIOR") then local specs = {71, 72, 73} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) end robot.total = math.random (10000000, 60000000) @@ -263,40 +263,40 @@ function Details:CreateTestBars (alphabet, isArena) robot.classe = who[2] if (who[3]) then - robot.spec = who[3] + robot:SetSpecId(who[3]) elseif (robot.classe == "DEATHKNIGHT") then local specs = {250, 251, 252} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "DRUID") then local specs = {102, 103, 104, 105} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "HUNTER") then local specs = {253, 254, 255} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "MAGE") then local specs = {62, 63, 64} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "MONK") then local specs = {268, 269, 270} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "PALADIN") then local specs = {65, 66, 70} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "PRIEST") then local specs = {256, 257, 258} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "ROGUE") then local specs = {259, 260, 261} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "SHAMAN") then local specs = {262, 263, 264} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "WARLOCK") then local specs = {265, 266, 267} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) elseif (robot.classe == "WARRIOR") then local specs = {71, 72, 73} - robot.spec = specs [math.random (1, #specs)] + robot:SetSpecId(specs [math.random (1, #specs)]) end robot.total = math.random (10000000, 60000000) diff --git a/images/spec_icons_normal.tga b/images/spec_icons_normal.tga index ada5dfdb..6b456858 100644 Binary files a/images/spec_icons_normal.tga and b/images/spec_icons_normal.tga differ