Skip to content

Commit

Permalink
Removed portraits from tooltips and OpenRaidLib update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Dec 7, 2022
1 parent 15bf37f commit 9cad7e3
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 172 deletions.
54 changes: 28 additions & 26 deletions Libs/LibOpenRaid/GetPlayerInformation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ function openRaidLib.GetBorrowedTalentVersion()
end
end

local getDragonflightTalentsExportedString = function()
local exportStream = ExportUtil.MakeExportDataStream()
local configId = C_ClassTalents.GetActiveConfigID()
if (configId) then
local configInfo = C_Traits.GetConfigInfo(configId)
local currentSpecID = PlayerUtil.GetCurrentSpecID()
local treeInfo = C_Traits.GetTreeInfo(configId, configInfo.treeIDs[1])
local treeHash = C_Traits.GetTreeHash(treeInfo.ID)
local serializationVersion = C_Traits.GetLoadoutSerializationVersion()


end
end

local getDragonflightTalentsAsIndexTable = function()
local allTalents = {}
local configId = C_ClassTalents.GetActiveConfigID()
Expand Down Expand Up @@ -312,6 +326,8 @@ function openRaidLib.GearManager.GetPlayerGemsAndEnchantInfo()
--hold equipmentSlotId of equipments without an enchant
local slotsWithoutEnchant = {}

local gearWithEnchantIds = {}

for equipmentSlotId = 1, 17 do
local itemLink = GetInventoryItemLink("player", equipmentSlotId)
if (itemLink) then
Expand All @@ -322,34 +338,20 @@ function openRaidLib.GearManager.GetPlayerGemsAndEnchantInfo()
--enchant
--check if the slot can receive enchat and if the equipment has an enchant
local enchantAttribute = LIB_OPEN_RAID_ENCHANT_SLOTS[equipmentSlotId]
if (enchantAttribute) then --this slot can receive an enchat
local nEnchantId = 0

--check if this slot is relevant for the class, some slots can have enchants only for Agility which won't matter for Priests as an example
--if the value is an integer it points to an attribute (int, dex, str), otherwise it's true (boolean)
local slotIsRelevant = true
if (type(enchantAttribute) == "number") then
if (specMainAttribute ~= enchantAttribute) then
slotIsRelevant = false
end
if (enchantAttribute) then --this slot can receive an enchat
if (enchantId and enchantId ~= "") then
local number = tonumber(enchantId)
nEnchantId = number
gearWithEnchantIds[#gearWithEnchantIds+1] = nEnchantId
else
gearWithEnchantIds[#gearWithEnchantIds+1] = 0
end

if (slotIsRelevant) then
--does the slot has any enchant?
if (not enchantId or enchantId == "0" or enchantId == "") then
slotsWithoutEnchant[#slotsWithoutEnchant+1] = equipmentSlotId
else
--convert to integer
local enchantIdInt = tonumber(enchantId)
if (enchantIdInt) then
--does the enchant is relevent for the character?
if (not LIB_OPEN_RAID_ENCHANT_IDS[enchantIdInt]) then
slotsWithoutEnchant[#slotsWithoutEnchant+1] = equipmentSlotId
end
else
--the enchat has an invalid id
slotsWithoutEnchant[#slotsWithoutEnchant+1] = equipmentSlotId
end
end
--6400 and above is dragonflight enchantId number space
if (nEnchantId < 6300 and not LIB_OPEN_RAID_DEATHKNIGHT_RUNEFORGING_ENCHANT_IDS[nEnchantId]) then
slotsWithoutEnchant[#slotsWithoutEnchant+1] = equipmentSlotId
end
end

Expand All @@ -367,7 +369,7 @@ function openRaidLib.GearManager.GetPlayerGemsAndEnchantInfo()
slotsWithoutGems[#slotsWithoutGems+1] = equipmentSlotId

--check if the gem is not a valid gem (deprecated gem)
elseif (not LIB_OPEN_RAID_GEM_IDS[gemId]) then
elseif (gemId < 180000) then
slotsWithoutGems[#slotsWithoutGems+1] = equipmentSlotId
end
end
Expand Down
12 changes: 6 additions & 6 deletions Libs/LibOpenRaid/LibOpenRaid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t
end

local major = "LibOpenRaid-1.0"
local CONST_LIB_VERSION = 82
local CONST_LIB_VERSION = 84

if (not LIB_OPEN_RAID_MAX_VERSION) then
LIB_OPEN_RAID_MAX_VERSION = CONST_LIB_VERSION
Expand Down Expand Up @@ -1586,11 +1586,11 @@ openRaidLib.internalCallback.RegisterCallback("onLeaveCombat", openRaidLib.UnitI

--build the table with the gear information
local playerGearInfo = {}
playerGearInfo[#playerGearInfo+1] = itemLevel --[1]
playerGearInfo[#playerGearInfo+1] = gearDurability --[2]
playerGearInfo[#playerGearInfo+1] = weaponEnchant --[3]
playerGearInfo[#playerGearInfo+1] = slotsWithoutEnchant --[4]
playerGearInfo[#playerGearInfo+1] = slotsWithoutGems --[5]
playerGearInfo[#playerGearInfo+1] = itemLevel --[1] - one index
playerGearInfo[#playerGearInfo+1] = gearDurability --[2] - one index
playerGearInfo[#playerGearInfo+1] = weaponEnchant --[3] - one index
playerGearInfo[#playerGearInfo+1] = slotsWithoutEnchant --[4] - undefined
playerGearInfo[#playerGearInfo+1] = slotsWithoutGems --[5] - undefined

return playerGearInfo
end
Expand Down
83 changes: 24 additions & 59 deletions Libs/LibOpenRaid/ThingsToMantain_Dragonflight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,71 +114,33 @@ do
--when the value is a number, the slot only receives enchants for a specific attribute
LIB_OPEN_RAID_ENCHANT_SLOTS = {
--[INVSLOT_NECK] = true,
[INVSLOT_BACK] = true, --for all
[INVSLOT_CHEST] = true, --for all
[INVSLOT_FINGER1] = true, --for all
[INVSLOT_FINGER2] = true, --for all
[INVSLOT_MAINHAND] = true, --for all

[INVSLOT_FEET] = 2, --agility only
[INVSLOT_WRIST] = 1, --intellect only
[INVSLOT_HAND] = 3, --strenth only
[INVSLOT_BACK] = true,
[INVSLOT_CHEST] = true,
[INVSLOT_FINGER1] = true,
[INVSLOT_FINGER2] = true,
[INVSLOT_MAINHAND] = true,
[INVSLOT_FEET] = true,
[INVSLOT_WRIST] = true,
[INVSLOT_HAND] = true,
}

-- how to get the enchantId:
-- local itemLink = GetInventoryItemLink("player", slotId)
-- local enchandId = select(3, strsplit(":", itemLink))
-- print("enchantId:", enchandId)
LIB_OPEN_RAID_ENCHANT_IDS = {
--need to get this data to dragonflight
--FEET
--[6207] = INVSLOT_FEET, --[Enchant Boots - Speed of Soul]
--[6211] = INVSLOT_FEET, --[Enchant Boots - Eternal Agility] + 15 agi
--[6212] = INVSLOT_FEET, --[Enchant Boots - Agile Soulwalker] + 10 agi

--WRIST
--[6222] = INVSLOT_WRIST, [Enchant Bracers - Shaded Hearthing]
--[6219] = INVSLOT_WRIST, --[Enchant Bracers - Illuminated Soul] + 10 int
--[6220] = INVSLOT_WRIST, --[Enchant Bracers - Eternal Intellect] + 15 int

--HAND
--[6205] = INVSLOT_HAND, --[Enchant Gloves - Shadowlands Gathering]
--[6209] = INVSLOT_HAND, --[Enchant Gloves - Strength of Soul] +10 str
--[6210] = INVSLOT_HAND, --[Enchant Gloves - Eternal Strength] +15 str

--FINGER
--[6164] = INVSLOT_FINGER1, --[Enchant Ring - Tenet of Critical Strike] +16
--[6166] = INVSLOT_FINGER1, --[Enchant Ring - Tenet of Haste] +16
--[6168] = INVSLOT_FINGER1, --[Enchant Ring - Tenet of Mastery] +16
--[6170] = INVSLOT_FINGER1, --[Enchant Ring - Tenet of Versatility] +16

--BACK
--[6202] = INVSLOT_BACK, --[Enchant Cloak - Fortified Speed] +20 stam +30 speed
--[6203] = INVSLOT_BACK, --[Enchant Cloak - Fortified Avoidance] +20 stam +30 avoidance
--[6204] = INVSLOT_BACK, --[Enchant Cloak - Fortified Leech]
--[6208] = INVSLOT_BACK, --[Enchant Cloak - Soul Vitality]

--CHEST
--[6213] = INVSLOT_CHEST, --[Enchant Chest - Eternal Bulwark] +25 armor +20 agi or str
--[6214] = INVSLOT_CHEST, --[Enchant Chest - Eternal Skirmish] +20 agi or str +more white damage
--[6217] = INVSLOT_CHEST, --[Enchant Chest - Eternal Bounds] +20 int + 6% mana
--[6216] = INVSLOT_CHEST, --[Enchant Chest - Sacred Stats] +20 all stats
--[6230] = INVSLOT_CHEST, --[Enchant Chest - Eternal Stats] +30 all stats

--MAINHAND
--[6223] = INVSLOT_MAINHAND, --[Enchant Weapon - Lightless Force] + shadow wave damage
--[6226] = INVSLOT_MAINHAND, --[Enchant Weapon - Eternal Grace] + burst of healing done
--[6227] = INVSLOT_MAINHAND, --[Enchant Weapon - Ascended Vigor] + healing received increased
--[6228] = INVSLOT_MAINHAND, --[Enchant Weapon - Sinful Revelation] + 6% bleed damage
--[6229] = INVSLOT_MAINHAND, --[Enchant Weapon - Celestial Guidance] + 5% agility
--[6243] = INVSLOT_MAINHAND, --[Runeforging: Rune of Hysteria]
--[3370] = INVSLOT_MAINHAND, --[Runeforging: Rune of Razorice]
--[6241] = INVSLOT_MAINHAND, --[Runeforging: Rune of Sanguination]
--[6242] = INVSLOT_MAINHAND, --[Runeforging: Rune of Spellwarding]
--[6245] = INVSLOT_MAINHAND, --[Runeforging: Rune of the Apocalypse]
--[3368] = INVSLOT_MAINHAND, --[Runeforging: Rune of the Fallen Crusader]
--[3847] = INVSLOT_MAINHAND, --[Runeforging: Rune of the Stoneskin Gargoyle]
--[6244] = INVSLOT_MAINHAND, --[Runeforging: Rune of Unending Thirst]
--empty as the lib now get the enchant id and compare with expansion enchantId number space
}

LIB_OPEN_RAID_DEATHKNIGHT_RUNEFORGING_ENCHANT_IDS = {
[6243] = INVSLOT_MAINHAND, --[Runeforging: Rune of Hysteria]
[3370] = INVSLOT_MAINHAND, --[Runeforging: Rune of Razorice]
[6241] = INVSLOT_MAINHAND, --[Runeforging: Rune of Sanguination]
[6242] = INVSLOT_MAINHAND, --[Runeforging: Rune of Spellwarding]
[6245] = INVSLOT_MAINHAND, --[Runeforging: Rune of the Apocalypse]
[3368] = INVSLOT_MAINHAND, --[Runeforging: Rune of the Fallen Crusader]
[3847] = INVSLOT_MAINHAND, --[Runeforging: Rune of the Stoneskin Gargoyle]
[6244] = INVSLOT_MAINHAND, --[Runeforging: Rune of Unending Thirst]
}

--how to get the gemId:
Expand Down Expand Up @@ -401,9 +363,9 @@ do
[392966] = {cooldown = 90, duration = 20, specs = {73}, talent = false, charges = 1, class = "WARRIOR", type = 2}, --Spell Block
[384318] = {cooldown = 90, duration = 0, specs = {71, 72, 73}, talent = false, charges = 1, class = "WARRIOR", type = 1}, --Thunderous Roar
[46968] = {cooldown = 40, duration = 0, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 8}, --Shockwave
[23920] = {cooldown = 25, duration = 5, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 5}, --Shockwave
[107570] = {cooldown = 30, duration = 4, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 8}, --Storm Bolt
[23920] = {cooldown = 25, duration = 0, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 5}, --Spell Refleciton
[385060] = {cooldown = 45, duration = 0, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 5}, --Odyn's Fury (can remove root with Avatar)

--warlock
-- 265 - Affliction
Expand All @@ -422,6 +384,7 @@ do
[265187] = {cooldown = 90, duration = 15, specs = {266}, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Summon Demonic Tyrant
[1122] = {cooldown = 180, duration = 30, specs = {267}, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Summon Infernal
[104773] = {cooldown = 180, duration = 8, specs = {265, 266, 267}, talent = false, charges = 1, class = "WARLOCK", type = 2}, --Unending Resolve
[48020] = {cooldown = 30, duration = 0, specs = {265, 266, 267}, talent = false, charges = 1, class = "WARLOCK", type = 5}, --Demonic Circle: Teleport

--shaman
-- 262 - Elemental
Expand Down Expand Up @@ -496,6 +459,7 @@ do
[264735] = {cooldown = 180, duration = 0, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 2}, --Survival of the Fittest
[187698] = {cooldown = 30, duration = 0, specs = {}, talent = false, charges = 1, class = "HUNTER", type = 8}, --Tar Trap
[392060] = {cooldown = 60, duration = 3, specs = {}, talent = false, charges = 1, class = "HUNTER", type = 8}, --Wailing Arrow
[781] = {cooldown = 20, duration = 0, specs = {}, talent = false, charges = 1, class = "HUNTER", type = 5}, --Disengage

--druid
-- 102 - Balance
Expand Down Expand Up @@ -596,6 +560,7 @@ do
[205021] = {cooldown = 78, duration = 5, specs = {64}, talent = false, charges = 1, class = "MAGE", type = 1}, --Ray of Frost
[113724] = {cooldown = 45, duration = 10, specs = {62, 63, 64}, talent = false, charges = 1, class = "MAGE", type = 8}, --Ring of Frost
[31661] = {cooldown = 45, duration = 0, specs = {}, talent = false, charges = 1, class = "MAGE", type = 8}, --Dragon's Breath
[1953] = {cooldown = 15, duration = 0, specs = {}, talent = false, charges = 1, class = "MAGE", type = 5}, --Blink

-- This needs more work to actually function
--[342245] = {cooldown = 60, duration = 0, specs = {}, talent = false, charges = 1, class = "MAGE", type = 2}, --Alter Time
Expand Down
58 changes: 29 additions & 29 deletions classes/class_damage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3320,7 +3320,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
end
end

--MOSTRA INIMIGOS
--targets (enemies)
local topEnemy = ActorTargetsSortTable[1] and ActorTargetsSortTable[1][2] or 0
if (instancia.sub_atributo == 1 or instancia.sub_atributo == 6) then
--small blank space
Expand Down Expand Up @@ -3348,7 +3348,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
local enemyTable = ActorTargetsSortTable[i]
GameCooltip:AddLine(enemyTable[1], FormatTooltipNumber(_, enemyTable[2]) .." ("..format("%.1f", enemyTable[2] / ActorDamageWithPet * 100).."%)")

local portraitTexture = Details222.Textures.GetPortraitTextureForNpcID(enemyTable[3])
local portraitTexture-- = Details222.Textures.GetPortraitTextureForNpcID(enemyTable[3]) --disabled atm
if (portraitTexture) then
GameCooltip:AddIcon(portraitTexture, 1, 1, icon_size.W, icon_size.H)
else
Expand Down Expand Up @@ -4570,59 +4570,59 @@ function atributo_damage:MontaInfoDamageDone()

local topDamage = enemyTable[1] and enemyTable[1][2] or 0

local barra
for index, tabela in ipairs(enemyTable) do
barra = barras [index]
local thisLine
for index, thisEnemyTable in ipairs(enemyTable) do
thisLine = barras[index]

if (not barra) then --se a barra n�o existir, criar ela ent�o
barra = gump:CriaNovaBarraInfo2 (instance, index)
barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui � a parte da sele��o e descele��o
if (not thisLine) then --se a barra n�o existir, criar ela ent�o
thisLine = gump:CriaNovaBarraInfo2 (instance, index)
thisLine.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui � a parte da sele��o e descele��o
end

if (index == 1) then
barra.textura:SetValue(100)
thisLine.textura:SetValue(100)
else
barra.textura:SetValue(tabela[2] / topDamage * 100)
thisLine.textura:SetValue(thisEnemyTable[2] / topDamage * 100)
end

barra.lineText1:SetText(index .. ". " .. Details:GetOnlyName(tabela[1])) --seta o texto da esqueda
barra.lineText4:SetText(Details:comma_value (tabela[2]) .. " (" .. format("%.1f", tabela[3]) .. "%)") --seta o texto da direita
thisLine.lineText1:SetText(index .. ". " .. Details:GetOnlyName(thisEnemyTable[1])) --left text
thisLine.lineText4:SetText(Details:comma_value (thisEnemyTable[2]) .. " (" .. format("%.1f", thisEnemyTable[3]) .. "%)") --right text

barra.icone:SetTexture([[Interface\AddOns\Details\images\classes_small_alpha]]) --CLASSE
thisLine.icone:SetTexture([[Interface\AddOns\Details\images\classes_small_alpha]]) --class icon

local texCoords = Details.class_coords [tabela[4]]
local texCoords = Details.class_coords[thisEnemyTable[4]]
if (not texCoords) then
texCoords = Details.class_coords ["UNKNOW"]
texCoords = Details.class_coords["UNKNOW"]
end
barra.icone:SetTexCoord(unpack(texCoords))
thisLine.icone:SetTexCoord(unpack(texCoords))

local color = Details.class_colors [tabela[4]]
local color = Details.class_colors[thisEnemyTable[4]]
if (color) then
barra.textura:SetStatusBarColor(unpack(color))
thisLine.textura:SetStatusBarColor(unpack(color))
else
barra.textura:SetStatusBarColor(1, 1, 1)
thisLine.textura:SetStatusBarColor(1, 1, 1)
end

Details:name_space_info (barra)
Details:name_space_info(thisLine)

if (barra.mouse_over) then --atualizar o tooltip
if (barra.isAlvo) then
if (thisLine.mouse_over) then --atualizar o tooltip
if (thisLine.isAlvo) then
GameTooltip:Hide()
GameTooltip:SetOwner(barra, "ANCHOR_TOPRIGHT")
if (not barra.minha_tabela:MontaTooltipDamageTaken (barra, index)) then
GameTooltip:SetOwner(thisLine, "ANCHOR_TOPRIGHT")
if (not thisLine.minha_tabela:MontaTooltipDamageTaken(thisLine, index)) then
return
end
GameTooltip:Show()
end
end

barra.minha_tabela = self --grava o jogador na tabela
barra.nome_inimigo = tabela [1] --salva o nome do inimigo na barra --isso � necess�rio?
thisLine.minha_tabela = self --grava o jogador na tabela
thisLine.nome_inimigo = thisEnemyTable[1] --salva o nome do inimigo na barra --isso � necess�rio?

-- no rank do spell id colocar o que?
barra.spellid = "enemies"
thisLine.spellid = "enemies"

barra:Show() --mostra a barra
thisLine:Show() --mostra a barra
end
else
local combatObject = instance:GetShowingCombat()
Expand Down Expand Up @@ -4663,9 +4663,9 @@ function atributo_damage:MontaInfoDamageDone()

local targetName = targetTable[1]
local targetActorObject = damageContainer:GetActor(targetName)
local npcId = DetailsFramework:GetNpcIdFromGuid(targetActorObject:GetGUID())

if (targetActorObject) then
local npcId = DetailsFramework:GetNpcIdFromGuid(targetActorObject:GetGUID())
local portraitTexture = Details222.Textures.GetPortraitTextureForNpcID(npcId)
if (portraitTexture) then
Details222.Textures.FormatPortraitAsTexture(portraitTexture, barra.icone)
Expand Down
Loading

0 comments on commit 9cad7e3

Please sign in to comment.