10.2 General Implementations and Fixes

- Implemented [Pip's Emerald Friendship Badge] trinket buffs.
- 10.2 trinket damage spells renamed to the item name.
- Framework update.
This commit is contained in:
Tercio Jose
2023-09-22 13:12:54 -03:00
parent 6199bf10e0
commit 250ce2fbf7
18 changed files with 862 additions and 44 deletions
+10 -8
View File
@@ -275,6 +275,7 @@ detailsFramework:Mixin(ButtonMetaFunctions, detailsFramework.ScriptHookMixin)
--methods
---change the function which will be called when the button is pressed
---callback function will receive the blizzard button as first parameter, click type as second, param1 and param2 as third and fourth
---@param func function
---@param param1 any
---@param param2 any
@@ -887,17 +888,18 @@ end
---@return df_button
function detailsFramework:NewButton(parent, container, name, member, width, height, func, param1, param2, texture, text, shortMethod, buttonTemplate, textTemplate)
if (not name) then
name = "DetailsFrameworkButtonNumber" .. detailsFramework.ButtonCounter
detailsFramework.ButtonCounter = detailsFramework.ButtonCounter + 1
elseif (not parent) then
if (not parent) then
error("Details! FrameWork: parent not found.", 2)
end
if (name:find("$parent")) then
local parentName = detailsFramework.GetParentName(parent)
name = name:gsub("$parent", parentName)
if (not name) then
local parentName = parent:GetName()
if (parentName) then
name = parentName .. "Button" .. detailsFramework.ButtonCounter
else
name = "DetailsFrameworkButtonNumber" .. detailsFramework.ButtonCounter
end
detailsFramework.ButtonCounter = detailsFramework.ButtonCounter + 1
end
local buttonObject = {type = "button", dframework = true}
+7 -2
View File
@@ -45,6 +45,11 @@
---@field SplitTextInLines fun(self:table, text:string) : string[] split a text into lines
---@field UnitGroupRolesAssigned fun(unitId: unit, bUseSupport:boolean, specId: specializationid) : string there's no self here
---@field SetAnchor fun(self:table, widget:uiobject, anchorTable:df_anchor, anchorTo:uiobject)
---@field
---@field
---@field AddTextureToText fun(text:string, textureInfo:table, bAddSpace:boolean?, bAddAfterText:boolean) : string textureInfo is a table with .texture .width .height .coords{left, right, top, bottom}
---@field CreateTextureInfo fun(texture:atlasname|texturepath|textureid, width:number?, height:number?, left:number?, right:number?, top:number?, bottom:number?, imageWidthnumber?, imageHeightnumber?) : table
---@field ApplyStandardBackdrop fun(self:table, frame:frame, bUseSolidColor:boolean?, alphaScale:number?)
---@field CreateLabel fun(self:table, parent:frame, text:string, size:number?, color:any?, font:string?, member:string?, name:string?, layer:drawlayer?) : df_label
---@field CreateDropDown fun(self:table, parent:frame, func:function, default:any, width:number?, height:number?, member:string?, name:string?, template:table?) : df_dropdown
---@field CreateTextEntry fun(self:table, parent:frame, textChangedCallback:function, width:number, height:number, member:string?, name:string?, labelText:string?, textentryTemplate:table?, labelTemplate:table?) : df_textentry
---@field ReskinSlider fun(self:table, slider:frame)
---@field
+21
View File
@@ -1083,6 +1083,27 @@ end
------------------------------------------------------------------------------------------------------------
--object constructor
---@class df_dropdown : table, frame
---@field SetTemplate fun(self:df_dropdown, template:table)
---@field BuildDropDownFontList fun(self:df_dropdown, onClick:function, icon:any, iconTexcoord:table?, iconSize:table?):table make a dropdown list with all fonts available, on select a font, call the function onClick
---@field
---@field
---@field
---@field
---@field
---create a dropdown object
---@param parent frame
---@param func function
---@param default any
---@param width number?
---@param height number?
---@param member string?
---@param name string?
---@param template table?
---@return df_dropdown
function DF:CreateDropDown(parent, func, default, width, height, member, name, template)
return DF:NewDropDown(parent, parent, name, member, width, height, func, default, template)
end
+62 -8
View File
@@ -1093,6 +1093,14 @@ function DF:AddClassColorToText(text, className)
return text
end
---returns the class icon texture coordinates and texture file path
---@param class string
---@return number, number, number, number, string
function DF:GetClassTCoordsAndTexture(class)
local l, r, t, b = unpack(CLASS_ICON_TCOORDS[class])
return l, r, t, b, [[Interface\WORLDSTATEFRAME\Icons-Classes]]
end
---create a string with the spell icon and the spell name using |T|t scape codes to add the icon inside the string
---@param self table
---@param spellId any
@@ -1105,14 +1113,6 @@ function DF:MakeStringFromSpellId(spellId)
return ""
end
---returns the class icon texture coordinates and texture file path
---@param class string
---@return number, number, number, number, string
function DF:GetClassTCoordsAndTexture(class)
local l, r, t, b = unpack(CLASS_ICON_TCOORDS[class])
return l, r, t, b, [[Interface\WORLDSTATEFRAME\Icons-Classes]]
end
---wrap 'text' with the class icon of 'playerName' using |T|t scape codes
---@param text string
---@param playerName string
@@ -1159,6 +1159,58 @@ function DF:AddClassIconToText(text, playerName, englishClassName, useSpec, icon
return text
end
---create a table with information about a texture
---@param texture any
---@param textureWidth any
---@param textureHeight any
---@param imageWidth any
---@param imageHeight any
---@param left any
---@param right any
---@param top any
---@param bottom any
---@return table
function DF:CreateTextureInfo(texture, textureWidth, textureHeight, left, right, top, bottom, imageWidth, imageHeight)
local textureInfo = {
texture = texture,
width = textureWidth or 16,
height = textureHeight or 16,
coords = {left or 0, right or 1, top or 0, bottom or 1},
}
textureInfo.imageWidth = imageWidth or textureInfo.width
textureInfo.imageHeight = imageHeight or textureInfo.height
return textureInfo
end
---add a texture to the start or end of a string
---@param text string
---@param textureInfo table
---@param bAddSpace any
---@param bAddAfterText any
---@return string
function DF:AddTextureToText(text, textureInfo, bAddSpace, bAddAfterText)
local texture = textureInfo.texture
local textureWidth = textureInfo.width
local textureHeight = textureInfo.height
local imageWidth = textureInfo.imageWidth or textureWidth
local imageHeight = textureInfo.imageHeight or textureHeight
local left, right, top, bottom = unpack(textureInfo.coords)
left = left or 0
right = right or 1
top = top or 0
bottom = bottom or 1
if (bAddAfterText) then
local newString = text .. (bAddSpace and " " or "") .. "|T" .. texture .. ":" .. textureWidth .. ":" .. textureHeight .. ":0:0:" .. imageWidth .. ":" .. imageHeight .. ":" .. (left * imageWidth) .. ":" .. (right * imageWidth) .. ":" .. (top * imageHeight) .. ":" .. (bottom * imageHeight) .. "|t"
return newString
else
local newString = "|T" .. texture .. ":" .. textureWidth .. ":" .. textureHeight .. ":0:0:" .. imageWidth .. ":" .. imageHeight .. ":" .. (left * imageWidth) .. ":" .. (right * imageWidth) .. ":" .. (top * imageHeight) .. ":" .. (bottom * imageHeight) .. "|t" .. (bAddSpace and " " or "") .. text
return newString
end
end
---return the size of a fontstring
---@param fontString table
---@return number
@@ -5633,6 +5685,8 @@ function DF:DebugVisibility(UIObject)
local bIsShown = UIObject:IsShown()
print("Is Shown:", bIsShown and "|cFF00FF00true|r" or "|cFFFF0000false|r")
print("Alpha > 0:", UIObject:GetAlpha() > 0 and "|cFF00FF00true|r" or "|cFFFF0000false|r")
local bIsVisible = UIObject:IsVisible()
print("Is Visible:", bIsVisible and "|cFF00FF00true|r" or "|cFFFF0000false|r")
+15 -1
View File
@@ -23,6 +23,10 @@ local spellNameCache = {}
local emptyTable = {}
local white = {1, 1, 1, 1}
local sortIconByShownState = function(i1, i2)
return i1:IsShown() and not i2:IsShown()
end
local iconFrameOnHideScript = function(self)
if (self.cooldownLooper) then
self.cooldownLooper:Cancel()
@@ -161,6 +165,15 @@ detailsFramework.IconGenericMixin = {
self:AddSpecificIcon(iconTemplateTable.id, iconTemplateTable.id, nil, iconTemplateTable.startTime, iconTemplateTable.duration, nil, nil, iconTemplateTable.count, nil, nil, nil, nil, nil, nil, iconTemplateTable)
end,
IsIconShown = function(self, identifierKey)
if (not identifierKey or identifierKey == "") then
return
end
if (self.AuraCache[identifierKey]) then
return true
end
end,
---set an icon frame with a template
---@param self df_iconrow the parent frame
---@param aI aurainfo
@@ -551,7 +564,8 @@ detailsFramework.IconGenericMixin = {
if iconAmount == 0 then
self:Hide()
else
table.sort(iconPool, function(i1, i2) return i1:IsShown() and not i2:IsShown() end)
table.sort(iconPool, sortIconByShownState)
local shownAmount = 0
for i = 1, iconAmount do
if iconPool[i]:IsShown() then
+612
View File
@@ -0,0 +1,612 @@
---@type detailsframework
local detailsFramework = _G["DetailsFramework"]
if (not detailsFramework or not DetailsFrameworkCanLoad) then
return
end
local _
local CreateFrame = CreateFrame
---@class df_keybindframe : frame, df_optionsmixin
---@field options table
---@field bIsKeybindFrame boolean
---@field CreateSpecButtons fun(self:df_keybindframe)
---@field SwitchSpec fun(self:button, button:string, newSpecId:number)
local mainStartX, mainStartY, mainHeightSize = 10, -100, 600
local default_options = {
width = 800,
height = 600,
}
local defaultSpecKeybindList = {
["EVOKER"] = {
[1467] = {
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
[1468] = {
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
[1473] = { --aug
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
},
["DEMONHUNTER"] = {
[577] = {--> havoc demon hunter
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
[581] = {--> vengeance demon hunter
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
},
["DEATHKNIGHT"] = {
[250] = { --> blood dk
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
[251] = { --> frost dk
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
[252] = { --> unholy dk
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
},
["WARRIOR"] = {
[71] = { --> warrior arms
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
[72] = { --> warrior fury
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
[73] = { --> warrior protect
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
},
["MAGE"] = {
[62] = { --> mage arcane
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
},
[63] = { --> mage fire
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
},
[64] = { --> mage frost
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
},
},
["ROGUE"] = {
[259] = { --> rogue assassination
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
},
[260] = { --> rogue combat
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
},
[261] = { --> rogue sub
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
},
},
["DRUID"] = {
[102] = { --> druid balance
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_dispel", actiontext = ""},
},
[103] = { --> druid feral
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
[104] = { --> druid guardian
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
[105] = { --> druid resto
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_dispel", actiontext = ""},
},
},
["HUNTER"] = {
[253] = { --> hunter bm
{key = "type1", action = "_target", actiontext = ""},
},
[254] = { --> hunter marks
{key = "type1", action = "_target", actiontext = ""},
},
[255] = { --> hunter survivor
{key = "type1", action = "_target", actiontext = ""},
},
},
["SHAMAN"] = {
[262] = { --> shaman elemental
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
},
[263] = { --> shamel enhancement
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
},
[264] = { --> shaman resto
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
},
},
["PRIEST"] = {
[256] = { --> priest disc
{key = "type1", action = "_target", actiontext = ""},
},
[257] = { --> priest holy
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_dispel", actiontext = ""},
},
[258] = { --> priest shadow
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
},
},
["WARLOCK"] = {
[265] = { --> warlock aff
{key = "type1", action = "_target", actiontext = ""},
},
[266] = { --> warlock demo
{key = "type1", action = "_target", actiontext = ""},
},
[267] = { --> warlock destro
{key = "type1", action = "_target", actiontext = ""},
},
},
["PALADIN"] = {
[65] = { --> paladin holy
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_dispel", actiontext = ""},
},
[66] = { --> paladin protect
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
[70] = { --> paladin ret
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
},
["MONK"] = {
[268] = {--> monk bm
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
[269] = {--> monk ww
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_interrupt", actiontext = ""},
{key = "type3", action = "_taunt", actiontext = ""},
},
[270] = {--> monk mw
{key = "type1", action = "_target", actiontext = ""},
{key = "type2", action = "_dispel", actiontext = ""},
},
},
}
local ignoredKeys = {
["LSHIFT"] = true,
["RSHIFT"] = true,
["LCTRL"] = true,
["RCTRL"] = true,
["LALT"] = true,
["RALT"] = true,
["UNKNOWN"] = true,
}
local mouseKeys = {
["LeftButton"] = "type1",
["RightButton"] = "type2",
["MiddleButton"] = "type3",
["Button4"] = "type4",
["Button5"] = "type5",
["Button6"] = "type6",
["Button7"] = "type7",
["Button8"] = "type8",
["Button9"] = "type9",
["Button10"] = "type10",
["Button11"] = "type11",
["Button12"] = "type12",
["Button13"] = "type13",
["Button14"] = "type14",
["Button15"] = "type15",
["Button16"] = "type16",
}
local keysToMouse = {
["type1"] = "LeftButton",
["type2"] = "RightButton",
["type3"] = "MiddleButton",
["type4"] = "Button4",
["type5"] = "Button5",
["type6"] = "Button6",
["type7"] = "Button7",
["type8"] = "Button8",
["type9"] = "Button9",
["type10"] = "Button10",
["type11"] = "Button11",
["type12"] = "Button12",
["type13"] = "Button13",
["type14"] = "Button14",
["type15"] = "Button15",
["type16"] = "Button16",
}
local lock_textentry = {
["_target"] = true,
["_taunt"] = true,
["_interrupt"] = true,
["_dispel"] = true,
["_spell"] = false,
["_macro"] = false,
}
--> helpers
local getMainFrame = function(UIObject)
local parentFrame = UIObject:GetParent()
for i = 1, 5 do
if (parentFrame.bIsKeybindFrame) then
return parentFrame
end
parentFrame = parentFrame:GetParent()
end
return nil
end
detailsFramework.KeybindMixin = {
IsListening = false,
EditingSpec = 0,
CurrentKeybindEditingSet = {},
AllSpecButtons = {},
SwitchSpec = function(self, button, newSpecId) --switch_spec
self.EditingSpec = newSpecId
self.CurrentKeybindEditingSet = EnemyGridDBChr.KeyBinds[newSpecId] --!need to get from the addon database
for _, button in ipairs (self.AllSpecButtons) do
button.selectedTexture:Hide()
end
self.MyObject.selectedTexture:Show()
--quick hide and show as a feedback to the player that the spec was changed
C_Timer.After (.04, function() EnemyGridOptionsPanelFrameKeybindScroill:Hide() end) --!need to defined the scroll frame
C_Timer.After (.06, function() EnemyGridOptionsPanelFrameKeybindScroill:Show() end) --!need to defined the scroll frame
--atualiza a scroll
EnemyGridOptionsPanelFrameKeybindScroill:UpdateScroll() --!need to defined the scroll frame
end,
CreateSpecButtons = function(self)
local specsTitle = detailsFramework:CreateLabel(self, "Config keys for spec:", 12, "silver")
specsTitle:SetPoint("topleft", self, "topleft", 10, mainStartY)
local allSpecButtons = self.AllSpecButtons
local options_text_template = detailsFramework:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")
local options_dropdown_template = detailsFramework:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")
local options_switch_template = detailsFramework:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")
local options_slider_template = detailsFramework:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE")
local options_button_template = detailsFramework:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")
for i = 1, 4 do
local newSpecButton = detailsFramework:CreateButton(self, self.SwitchSpec, 160, 20, "Spec1 Placeholder Text", 1, nil, nil, "specButton" .. i, nil, 0, options_button_template, options_text_template)
table.insert(allSpecButtons, newSpecButton)
self["SpecButton" .. i] = newSpecButton
newSpecButton:SetPoint("topleft", specsTitle, "bottomleft", 0, -10 + (20*(i-1)))
spec2:SetPoint ("topleft", specsTitle, "bottomleft", 0, -30)
spec3:SetPoint ("topleft", specsTitle, "bottomleft", 0, -50)
if (class == "DRUID") then
spec4:SetPoint ("topleft", specsTitle, "bottomleft", 0, -70)
end
end
local classLocName, class = UnitClass("player")
local i = 1
for specId in pairs(defaultSpecKeybindList[class]) do
local button = self["SpecButton" .. i]
local _, specName, _, specIcon = DF.GetSpecializationInfoByID(specId) --classic return nil
if (specName) then
button.text = specName
button:SetClickFunction(self.SwitchSpec, specId)
button:SetIcon(specIcon)
button.specID = specId
local selectedTexture = button:CreateTexture(nil, "background")
selectedTexture:SetAllPoints()
selectedTexture:SetColorTexture(1, 1, 1, 0.5)
if (specId ~= self.EditingSpec) then
selectedTexture:Hide()
end
button.selectedTexture = selectedTexture
i = i + 1
else
button:Hide()
end
end
end,
CreateKeybindListener = function(self)
local enter_the_key = CreateFrame ("frame", nil, self, "BackdropTemplate")
enter_the_key:SetFrameStrata("tooltip")
enter_the_key:SetSize(200, 60)
detailsFramework:ApplyStandardBackdrop(enter_the_key)
enter_the_key.text = detailsFramework:CreateLabel(enter_the_key, "- Press a keyboard key to bind.\n- Click to bind a mouse button.\n- Press escape to cancel.", 11, "orange")
enter_the_key.text:SetPoint("center", enter_the_key, "center", 0, 0)
enter_the_key:Hide()
end,
set_keybind_key = function(self, button, keybindIndex)
if (keyBindListener.IsListening) then
key = mouseKeys [button] or button
return registerKeybind (keyBindListener, key)
end
keyBindListener.IsListening = true
keyBindListener.keybindIndex = keybindIndex
keyBindListener:SetScript ("OnKeyDown", registerKeybind)
enter_the_key:Show()
enter_the_key:SetPoint ("bottom", self, "top")
end,
RefreshKeybindScroll = function(self, data, offset, totalLines)
local keyBindFrame = getMainFrame(self)
local keybinds = keyBindFrame.CurrentKeybindEditingSet
for i = 1, totalLines do
local index = i + offset
local keybindData = data[index]
if (keybindData) then
local line = self:GetLine(i)
--index
line.Index.text = index
--keybind
local keyBindText = keysToMouse[keybindData.key] or keybindData.key
keyBindText = keyBindText:gsub("type1", "LeftButton")
keyBindText = keyBindText:gsub("type2", "RightButton")
keyBindText = keyBindText:gsub("type3", "MiddleButton")
line.KeyBind.text = keyBindText
line.KeyBind:SetClickFunction(keyBindFrame.set_keybind_key, index, nil, "left")
line.KeyBind:SetClickFunction(keyBindFrame.set_keybind_key, index, nil, "right")
--action
line.ActionDrop:SetFixedParameter(index)
line.ActionDrop:Select(keybindData.action)
--action text
line.ActionText.text = keybindData.actiontext
line.ActionText:SetEnterFunction(set_action_text, index)
line.ActionText.CurIndex = index
if (lock_textentry[keybindData.action]) then
line.ActionText:Disable()
else
line.ActionText:Enable()
end
--delete
line.Delete:SetClickFunction(keyBindFrame.delete_keybind, index)
end
end
end,
delete_keybind = function(self, button, keybindIndex)
local keyBindFrame = getMainFrame(self)
tremove(keyBindFrame.CurrentKeybindEditingSet, keybindIndex)
keyBindFrame.keybindScroll:UpdateScroll()
--EnemyGrid.UpdateKeyBinds()
end,
change_key_action = function(self, keybindIndex, value)
local keyBindFrame = getMainFrame(self)
local keybind = keyBindFrame.CurrentKeybindEditingSet[keybindIndex]
keybind.action = value
keyBindFrame.keybindScroll:UpdateScroll()
--EnemyGrid.UpdateKeyBinds()
end,
set_action_on_espace_press = function (textentry, capsule)
local keyBindFrame = getMainFrame(textentry)
capsule = capsule or textentry.MyObject
local keybind = keyBindFrame.CurrentKeybindEditingSet[capsule.CurIndex]
textentry:SetText (keybind.actiontext)
--EnemyGrid.UpdateKeyBinds()
end,
fill_action_dropdown = function(dropdownObject)
local keyBindFrame = getMainFrame(dropdownObject)
local locClass, class = UnitClass("player")
local taunt = tauntList[class] and GetSpellInfo(tauntList[class]) or ""
local interrupt = interruptList[class] and GetSpellInfo(interruptList [class]) or ""
local dispel = dispelList[class]
if (type (dispel) == "table") then
local dispelString = "\n"
for specId, spellid in pairs(dispel) do
local _, specName = GetSpecializationInfoByID(specId) --!classic versions incompatible
local spellName = GetSpellInfo(spellid)
dispelString = dispelString .. "|cFFE5E5E5" .. specName .. "|r: |cFFFFFFFF" .. spellName .. "\n"
end
dispel = dispelString
else
dispel = GetSpellInfo(dispel) or ""
end
return {
{value = "_target", label = "Target", onclick = keyBindFrame.change_key_action, desc = "Target the unit"},
{value = "_taunt", label = "Taunt", onclick = keyBindFrame.change_key_action, desc = "Cast the taunt spell for your class\n\n|cFFFFFFFFSpell: " .. taunt},
{value = "_interrupt", label = "Interrupt", onclick = keyBindFrame.change_key_action, desc = "Cast the interrupt spell for your class\n\n|cFFFFFFFFSpell: " .. interrupt},
{value = "_dispel", label = "Dispel", onclick = keyBindFrame.change_key_action, desc = "Cast the interrupt spell for your class\n\n|cFFFFFFFFSpell: " .. dispel},
{value = "_spell", label = "Cast Spell", onclick = keyBindFrame.change_key_action, desc = "Type the spell name in the text box"},
{value = "_macro", label = "Macro", onclick = keyBindFrame.change_key_action, desc = "Type your macro in the text box"},
}
end,
---@param keyBindFrame df_keybindframe
---@param index number
CreateKeybindScrollLine = function(keyBindFrame, index)
local line = CreateFrame("frame", "$parentLine" .. index, keybindScroll)
line:SetSize(1009, 20)
line:SetPoint("topleft", keyBindFrame, "topleft", 0, -(index-1)*29)
detailsFramework:ApplyStandardBackdrop(line, index % 2 == 0)
detailsFramework:Mixin(line, detailsFramework.HeaderFunctions)
local options_text_template = detailsFramework:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")
local options_dropdown_template = detailsFramework:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")
local options_switch_template = detailsFramework:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")
local options_slider_template = detailsFramework:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE")
local options_button_template = detailsFramework:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")
line.Index = detailsFramework:CreateLabel(line, "place holder")
line.KeyBind = detailsFramework:CreateButton(line, function()end, 100, 20, "", nil, nil, nil, "SetNewKeybindButton", "$parentSetNewKeybindButton", 0, options_button_template, options_text_template)
line.ActionDrop = detailsFramework:CreateDropDown(line, keyBindFrame.fill_action_dropdown, 0, 120, 20, "ActionDropdown", "$parentActionDropdown", options_dropdown_template)
line.ActionText = detailsFramework:CreateTextEntry(line, function()end, 660, 20, "TextBox", "$parentActionText", nil, options_dropdown_template)
line.Delete = detailsFramework:CreateButton(line, keyBindFrame.delete_keybind, 16, 20, "", nil, nil, nil, "DeleteKeybindButton", "$parentDeleteKeybindButton", 2, options_button_template, options_text_template)
line.Delete:SetIcon([[Interface\Buttons\UI-StopButton]], nil, nil, nil, nil, nil, nil, 4)
line.Delete.tooltip = "erase this keybind"
--editbox
line.ActionText:SetJustifyH("left")
line.ActionText:SetHook("OnEscapePressed", keyBindFrame.set_action_on_espace_press)
line.ActionText:SetHook("OnEditFocusGained", function()
local playerSpells = {}
local tab, tabTex, offset, numSpells = GetSpellTabInfo(2)
for i = 1, numSpells do
local index = offset + i
local spellType, spellId = GetSpellBookItemInfo(index, "player")
if (spellType == "SPELL") then
local spellName = GetSpellInfo(spellId)
tinsert(playerSpells, spellName)
end
end
line.ActionText.WordList = playerSpells
end)
line.ActionText:SetAsAutoComplete("WordList")
line:AddFrameToHeaderAlignment(line.Index)
line:AddFrameToHeaderAlignment(line.KeyBind)
line:AddFrameToHeaderAlignment(line.ActionDrop)
line:AddFrameToHeaderAlignment(line.ActionText)
line:AddFrameToHeaderAlignment(line.Delete)
line:AlignWithHeader(keyBindFrame.Header, "left")
end,
---comment
---@param self df_keybindframe
CreateKeybindScroll = function(self)
local scroll_width = self.options.width - 10
local scroll_height = self.options.height - 40
local scroll_lines = self.options.amount_lines
local scroll_line_height = self.options.line_height
--header
local headerTable = {
{text = "", width = 20}, --index
{text = "", width = 20}, --spell icon
{text = "Ability Name", width = 120},
{text = "Keybind", width = 60},
{text = "Action Type", width = 60},
{text = "Action Text", width = 45},
{text = "Clear Keybind", width = 80},
}
local headerOptions = {
padding = 2,
}
---@type df_headerframe
self.Header = DetailsFramework:CreateHeader(self, headerTable, headerOptions)
self.Header:SetPoint("topleft", self, "topleft", 5, -25)
local keybindScroll = detailsFramework:CreateScrollBox(self, "$parentScrollBox", detailsFramework.KeybindMixin.RefreshKeybindScroll, {}, scroll_width, scroll_height, scroll_lines, scroll_line_height)
detailsFramework:ReskinSlider(keybindScroll)
keybindScroll:SetPoint("topleft", self.Header, "bottomleft", 0, -2)
self.keybindScroll = keybindScroll
for i = 1, scroll_lines do
keybindScroll:CreateLine(self.CreateKeybindScrollLine)
end
end,
}
---@param parent frame
---@param name string?
---@param options table?
function detailsFramework:CreateKeybindFrame(parent, name, options)
---@type df_keybindframe
local keyBindFrame = CreateFrame("frame", name, parent, "BackdropTemplate")
keyBindFrame.bIsKeybindFrame = true
detailsFramework:Mixin(keyBindFrame, detailsFramework.OptionsFunctions)
options = options or {}
keyBindFrame:BuildOptionsTable(default_options, options)
keyBindFrame:SetSize(keyBindFrame.options.width, keyBindFrame.options.height)
keyBindFrame:CreateSpecButtons()
keyBindFrame:SetScript("OnHide", function()
if (keyBindFrame.IsListening) then
keyBindFrame.IsListening = false
keyBindFrame:SetScript("OnKeyDown", nil)
end
end)
return keyBindFrame
end
+1 -1
View File
@@ -256,7 +256,7 @@ detailsFramework:Mixin(LabelMetaFunctions, detailsFramework.ScriptHookMixin)
------------------------------------------------------------------------------------------------------------
--object constructor
---@class df_label
---@class df_label: uiobject
---@field widget fontstring widget and label points to the same fontstring
---@field label fontstring widget and label points to the same fontstring
---@field align justifyh
+1
View File
@@ -1628,6 +1628,7 @@ function DF.Language.CreateLanguageSelector(addonId, parent, callback, selectedL
local languageLabel = DF:CreateLabel(parent, _G.LANGUAGE .. ":", 10, "silver")
languageLabel:SetPoint("right", languageSelector, "left", -3, 0)
languageSelector.languageLabel = languageLabel
return languageSelector
end
+1
View File
@@ -40,4 +40,5 @@
<Script file="pictureedit.lua"/>
<Script file="auras.lua"/>
<Script file="tabcontainer.lua"/>
<Script file="keybind.lua"/>
</Ui>
+15 -2
View File
@@ -531,8 +531,21 @@ end
------------------------------------------------------------------------------------------------------------
--object constructor
function detailsFramework:CreateTextEntry(parent, func, w, h, member, name, with_label, entry_template, label_template)
return detailsFramework:NewTextEntry(parent, parent, name, member, w, h, func, nil, nil, nil, with_label, entry_template, label_template)
---@class df_textentry : table, frame
---@field SetTemplate fun(self:df_textentry, template:table)
---@param parent frame
---@param textChangedCallback function
---@param width number
---@param height number
---@param member string?
---@param name string?
---@param labelText string?
---@param textentryTemplate table?
---@param labelTemplate table?
---@return df_textentry
function detailsFramework:CreateTextEntry(parent, textChangedCallback, width, height, member, name, labelText, textentryTemplate, labelTemplate)
return detailsFramework:NewTextEntry(parent, parent, name, member, width, height, textChangedCallback, nil, nil, nil, labelText, textentryTemplate, labelTemplate)
end
function detailsFramework:NewTextEntry(parent, container, name, member, width, height, func, param1, param2, space, withLabel, entryTemplate, labelTemplate)
+2 -1
View File
@@ -308,12 +308,13 @@ local cleanfunction = function() end
healthBarMetaFunctions.UpdateHealPrediction = function(self)
local currentHealth = self.currentHealth
local currentHealthMax = self.currentHealthMax
local healthPercent = currentHealth / currentHealthMax
if (not currentHealthMax or currentHealthMax <= 0) then
return
end
local healthPercent = currentHealth / currentHealthMax
--order is: the health of the unit > damage absorb > heal absorb > incoming heal
local width = self:GetWidth()
+2
View File
@@ -5043,8 +5043,10 @@ function damageClass:MontaInfoDamageDone() --I guess this fills the list of spel
---@type string
local spellName = _GetSpellInfo(spellId)
if (spellName) then
---@type number in which index the spell with the same name was stored
local index = alreadyAdded[spellName]
if (index and bShouldMergePlayerSpells) then
---@type spelltableadv
+67 -18
View File
@@ -396,6 +396,35 @@
--377458 377459
end
local override_aura_spellid = {
[426672] = { --Pip's Emerald Friendship Badge Urctos
CanOverride = function(auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, ...)
if (duration and duration >= 1 and duration <= 60) then
return true
end
end,
NewSpellId = 426674,
},
[426676] = { --Pip's Emerald Friendship Badge Aerwynn
CanOverride = function(auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, ...)
if (duration and duration >= 1 and duration <= 60) then
return true
end
end,
NewSpellId = 426677,
},
[426647] = { --Pip's Emerald Friendship Badge Pip
CanOverride = function(auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, ...)
if (duration and duration >= 1 and duration <= 60) then
return true
end
end,
NewSpellId = 426648
},
}
local bitfield_debuffs = {}
for _, spellid in ipairs(Details.BitfieldSwapDebuffsIDs) do
local spellname = GetSpellInfo(spellid)
@@ -2774,7 +2803,23 @@
end
end
if (spellId == 388007 or spellId == 388011) then --buff: bleesing of the summer and winter
if (override_aura_spellid[spellId] and UnitIsUnit(sourceName, "player")) then
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedBy(sourceName, spellId, sourceName)
if (auraName) then
local overrideTable = override_aura_spellid[spellId]
if (overrideTable.CanOverride(auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5)) then
--proc
parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, overrideTable.NewSpellId, spellName, "BUFF_UPTIME_IN")
local bAddToTarget, bOverrideTime = false, true
parser:add_buff_uptime(token, time+duration, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, overrideTable.NewSpellId, spellName, "BUFF_UPTIME_OUT", bAddToTarget, bOverrideTime)
--standard buff (not discounting the time with proc, this give the player how much time the buff was active overall)
parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, "BUFF_UPTIME_IN")
return
end
end
elseif (spellId == 388007 or spellId == 388011) then --buff: bleesing of the summer and winter
cacheAnything.paladin_vivaldi_blessings[targetSerial] = {sourceSerial, sourceName, sourceFlags}
elseif (spellId == 27827) then --spirit of redemption (holy ~priest) ~spirit
@@ -3430,7 +3475,7 @@
if (not spellTable) then
spellTable = sourceActor.debuff_uptime_spells:GetOrCreateSpell(spellId, true, "DEBUFF_UPTIME")
end
return _spell_utility_func(spellTable, targetSerial, targetName, targetFlags, sourceName, sourceActor, "BUFF_OR_DEBUFF", sAuraInOrOut)
return _spell_utility_func(spellTable, targetName, sourceActor, "BUFF_OR_DEBUFF", sAuraInOrOut)
end
end
@@ -3447,8 +3492,9 @@
---@param spellId spellid
---@param spellName spellname
---@param sAuraInOrOut string
---@param bAddToTarget boolean? --augmentation evoker
function parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, sAuraInOrOut, bAddToTarget)
---@param bAddToTarget boolean? --special auras which has to be added to the caster and target
---@param bOverrideTime boolean?
function parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, sAuraInOrOut, bAddToTarget, bOverrideTime)
_current_misc_container.need_refresh = true
local sourceActor = misc_cache[sourceName]
@@ -3473,7 +3519,7 @@
if (not spellTable) then
spellTable = sourceActor.buff_uptime_spells:GetOrCreateSpell(spellId, true, "BUFF_UPTIME")
end
_spell_utility_func(spellTable, targetSerial, targetName, targetFlags, sourceName, sourceActor, "BUFF_OR_DEBUFF", sAuraInOrOut)
_spell_utility_func(spellTable, targetName, sourceActor, "BUFF_OR_DEBUFF", sAuraInOrOut, bOverrideTime and floor(time))
end
if (bAddToTarget and sourceSerial ~= targetSerial) then
@@ -3506,7 +3552,7 @@
spellTable.id = spellId
end
_spell_utility_func(spellTable, sourceSerial, sourceName, sourceFlags, targetName, targetActor, "BUFF_OR_DEBUFF", sAuraInOrOut)
_spell_utility_func(spellTable, sourceName, targetActor, "BUFF_OR_DEBUFF", sAuraInOrOut, bOverrideTime and floor(time))
end
end
@@ -3857,7 +3903,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
end
return _spell_utility_func(spellTable, targetSerial, targetName, targetFlags, sourceName, token, "BUFF_OR_DEBUFF", "COOLDOWN")
return _spell_utility_func(spellTable, targetName, token, "BUFF_OR_DEBUFF", "COOLDOWN")
end
--serach key: ~interrupt
@@ -3884,7 +3930,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
if (not sourceName) then
sourceName = "[*] "..spellName
sourceName = "[*] " .. spellName
elseif (not targetName) then
return
@@ -3894,6 +3940,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
------------------------------------------------------------------------------------------------
--get actors
local petName, ownerName, ownerGUID, ownerFlags
---@type actorutility, actorutility
local sourceActor, ownerActor = misc_cache[sourceName], nil
if (not sourceActor) then
@@ -3904,9 +3952,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
if (not ownerActor) then
local petName, ownerName, ownerGUID, ownerFlag = Details.tabela_pets:PegaDono(sourceSerial, sourceName, sourceFlags)
petName, ownerName, ownerGUID, ownerFlags = Details.tabela_pets:PegaDono(sourceSerial, sourceName, sourceFlags)
if (petName) then
--print("pet found:", petName, ownerName, ownerGUID, ownerFlag)
ownerActor = _current_misc_container:GetOrCreateActor(ownerGUID, ownerName, ownerFlags, true)
--print("pet found:", petName, ownerName, ownerGUID, ownerFlags)
end
end
@@ -3948,7 +3997,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (not spell) then
spell = sourceActor.interrupt_spells:GetOrCreateSpell(spellId, true, token)
end
_spell_utility_func(spell, targetSerial, targetName, targetFlags, sourceName, token, extraSpellID, extraSpellName)
_spell_utility_func(spell, targetName, token, extraSpellID, extraSpellName)
if (spellId == 19647) then
--spell lock (warlock pet)
@@ -4018,7 +4067,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
---@type actor, actor
local sourceActor, ownerActor = misc_cache[sourceSerial] or misc_cache_pets[sourceSerial] or misc_cache[sourceName], misc_cache_petsOwners[sourceSerial]
if (not sourceActor) then
sourceActor, ownerActor, sourceName = _current_misc_container:GetOrCreateActor (sourceSerial, sourceName, sourceFlags, true)
sourceActor, ownerActor, sourceName = _current_misc_container:GetOrCreateActor(sourceSerial, sourceName, sourceFlags, true)
if (ownerActor) then
if (sourceSerial ~= "") then
misc_cache_pets [sourceSerial] = sourceActor
@@ -4204,7 +4253,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (not spellTable) then
spellTable = sourceActor.dispell_spells:GetOrCreateSpell(spellId, true, token)
end
_spell_utility_func(spellTable, targetSerial, targetName, targetFlags, sourceName, token, extraSpellID, extraSpellName)
_spell_utility_func(spellTable, targetName, token, extraSpellID, extraSpellName)
--is has an owner, add the dispel to the owner as well
if (ownerActor) then
@@ -4305,11 +4354,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
sourceActor.ress_targets[targetName] = (sourceActor.ress_targets[targetName] or 0) + 1
--actor spells table
local spell = sourceActor.ress_spells._ActorTable[spellId]
if (not spell) then
spell = sourceActor.ress_spells:GetOrCreateSpell(spellId, true, token)
local spellTable = sourceActor.ress_spells._ActorTable[spellId]
if (not spellTable) then
spellTable = sourceActor.ress_spells:GetOrCreateSpell(spellId, true, token)
end
return _spell_utility_func(spell, targetSerial, targetName, targetFlags, sourceName, token)
return _spell_utility_func(spellTable, targetName, token)
end
--serach key: ~cc
@@ -4376,7 +4425,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (not spellTable) then
spellTable = sourceActor.cc_break_spells:GetOrCreateSpell(extraSpellID, true, token)
end
return _spell_utility_func(spellTable, targetSerial, targetName, targetFlags, sourceName, token, spellId, spellName)
return _spell_utility_func(spellTable, targetName, token, spellId, spellName)
end
--serach key: ~dead ~death ~morte
+46 -3
View File
@@ -124,6 +124,10 @@ do
local itemName = C_Item.GetItemNameByID(itemId)
if (itemIcon and itemName) then
--limit the amount of characters of the item name
if (#itemName > 20) then
itemName = string.sub(itemName, 1, 20)
end
result = "" .. CreateTextureMarkup(itemIcon, iconSize, iconSize, iconSize, iconSize, unpack(coords)) .. " " .. itemName .. ""
end
@@ -203,7 +207,7 @@ do
[277185] = {name = GetSpellInfo(277185) .. " (Trinket)"}, --[Dread Gladiator's Badge]
[278057] = {name = GetSpellInfo(278057) .. " (Trinket)"}, --[Vigilant's Bloodshaper]
}
else --retail
else --retail (dragonflight)
defaultSpellCustomization = {
[1] = {name = Loc ["STRING_MELEE"], icon = [[Interface\ICONS\INV_Sword_04]]},
[2] = {name = Loc ["STRING_AUTOSHOT"], icon = [[Interface\ICONS\INV_Weapon_Bow_07]]},
@@ -217,7 +221,8 @@ do
[108271] = {name = GetSpellInfo(108271), icon = "Interface\\Addons\\Details\\images\\icon_astral_shift"},
[196917] = {name = lightOfTheMartyr_Name .. " (" .. Loc ["STRING_DAMAGE"] .. ")", icon = lightOfTheMartyr_Icon},
[77535] = {name = GetSpellInfo(77535), icon = "Interface\\Addons\\Details\\images\\icon_blood_shield"},
[395296] = {name = GetSpellInfo(395296), icon = "Interface\\Addons\\Details\\images\\ebon_might"},
[395296] = {name = GetSpellInfo(395296) .. " (on your self)", icon = "Interface\\Addons\\Details\\images\\ebon_might"},
[424428] = {name = GetSpellInfo(424428) .. " (4P)", icon = "Interface\\Addons\\Details\\images\\spells\\eruption_tier4.jpg", defaultName = GetSpellInfo(424428), breakdownCanStack = true},
}
customItemList[394453] = {itemId = 195480, isPassive = true} --ring: Seal of Diurna's Chosen
@@ -255,6 +260,27 @@ do
customItemList[381760] = {itemId = 193786, isPassive = true} --trinket: Mutated Magmammoth Scale (melee)
customItemList[389839] = {itemId = 193757, isPassive = true} --trinket: Ruby Whelp Shell
customItemList[401428] = {itemId = 202615, isPassive = true} --trinket: Vessel of Searing Shadow
--10.2
customItemList[426898] = {itemId = 207167, isPassive = false, nameExtra = "*on use*"} --trinket: Ashes of the Embersoul
customItemList[423611] = {itemId = 207167, isPassive = true, nameExtra = "*proc*"} --trinket: Ashes of the Embersoul (extra proc)
customItemList[426672] = {itemId = 207168, isPassive = true, nameExtra = "(vers)", icon = [[Interface\AddOns\Details\images\spells\spell_druid_bearhug_blackwhite.jpg]]} --trinket: Pip's Emerald Friendship Badge urctos
customItemList[426674] = {itemId = 207168, isPassive = true, nameExtra = "(*vers*)", icon = 571585} --trinket: Pip's Emerald Friendship Badge urctos
customItemList[426676] = {itemId = 207168, isPassive = true, nameExtra = "(crit)", icon = [[Interface\AddOns\Details\images\spells\elf_face_right.jpg]]} --trinket: Pip's Emerald Friendship Badge aerwynn
customItemList[426677] = {itemId = 207168, isPassive = true, nameExtra = "(*crit*)", icon = 2403539} --trinket: Pip's Emerald Friendship Badge aerwynn
customItemList[426647] = {itemId = 207168, isPassive = true, nameExtra = "(mast)", icon = [[Interface\AddOns\Details\images\spells\lil_dragon_left.jpg]]} --trinket: Pip's Emerald Friendship Badge pip
customItemList[426648] = {itemId = 207168, isPassive = true, nameExtra = "(*mast*)", icon = 5342919} --trinket: Pip's Emerald Friendship Badge pip
customItemList[422146] = {itemId = 207172, isPassive = false} --trinket: Belor'relos, the Sunstone
customItemList[426553] = {itemId = 208614, isPassive = true} --trinket: Augury of the Primal Flame
customItemList[426564] = {itemId = 208614, isPassive = true} --trinket: Augury of the Primal Flame (damage)
customItemList[427161] = {itemId = 208615, isPassive = false} --trinket: Nymue's Unraveling Spindle
customItemList[424324] = {itemId = 207788, isPassive = true} --weapon: [[PH] Fyrakk Cantrip 1H Mace INT] - shadowflame corrupted?
customItemList[426431] = {itemId = 210494, isPassive = true} --enchant: Incandescent Essence (aug evoker)
customItemList[426486] = {itemId = 210494, isPassive = true} --enchant: Incandescent Essence (aug evoker)
end
if (LIB_OPEN_RAID_SPELL_CUSTOM_NAMES) then
@@ -318,15 +344,21 @@ do
end
--itens
--[381760] = {name = formatTextForItem(193786), isPassive = true, itemId = 193786},
--[381760] = {name = formatTextForItem(193786), isPassive = true, itemId = 193786, nameExtra = ""|nil},
---@type number, customiteminfo
for spellId, itemInfo in pairs(customItemList) do
local bIsPassive = itemInfo.isPassive
local itemId = itemInfo.itemId
local nameExtra = itemInfo.nameExtra
local spellName, _, spellIcon = GetSpellInfo(spellId)
spellIcon = itemInfo.icon or spellIcon or [[Interface\InventoryItems\WoWUnknownItem01]]
local itemName = formatTextForItem(itemId)
if (itemName ~= "") then
if (nameExtra) then
itemName = itemName .. " " .. nameExtra
end
Details:UserCustomSpellAdd(spellId, itemName, spellIcon or [[Interface\InventoryItems\WoWUnknownItem01]])
else
if (not Details.UpdateIconsTimer or Details.UpdateIconsTimer:IsCancelled()) then
@@ -387,6 +419,17 @@ do
end
Details.GetSpellInfo = Details.getspellinfo
function Details.GetCustomSpellInfo(spellId)
local spellName, _, spellIcon = Details.GetSpellInfo(spellId)
local customInfo = defaultSpellCustomization[spellId]
if (customInfo) then
local defaultName, bCanStack = customInfo.defaultName, customInfo.breakdownCanStack
return spellName, _, spellIcon, defaultName, bCanStack
else
return spellName, _, spellIcon
end
end
--overwrite SpellInfo if the spell is a DoT, so Details.GetSpellInfo will return the name modified
function Details:SetAsDotSpell(spellId)
--do nothing if this spell already has a customization
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB