Framework and 10.2 updates

This commit is contained in:
Tercio Jose
2023-10-25 12:57:00 -03:00
parent 10dd61abdd
commit 73d152baac
11 changed files with 273 additions and 100 deletions
+1 -1
View File
@@ -877,7 +877,7 @@ end
---@param func function
---@param width number
---@param height number
---@param text string
---@param text any
---@param param1 any|nil
---@param param2 any|nil
---@param texture any|nil
+37 -2
View File
@@ -11,6 +11,29 @@
---@field removeduplicate fun(tbl1:table, tbl2:table) remove the keys from table1 which also exists in table2 with the same value
---@field dump fun(tbl:table) : string dump a table to a string
---@class df_language : table
---@field Register fun(addonId:any, languageId:string, gameLanguageOnly:boolean?) : table
---@field GetLanguageTable fun(addonId:any, languageId:string?) : table
---@field GetText fun(addonId:any, phraseId:string, silent:boolean?) : string, string
---@field ShowOptionsHelp fun()
---@field SetOption fun(addonId:any, optionId:string, value:any)
---@field SetCurrentLanguage fun(addonId:any, languageId:string)
---@field CreateLanguageSelector fun(addonId:any, parent:frame, callback:function, selectedLanguage:string?) : df_dropdown
---@field SetFontForLanguageId fun(addonId:any, languageId:string, fontPath:string)
---@field SetFontByAlphabetOrRegion fun(addonId:any, latin_FontPath:string, cyrillic_FontPath:string, china_FontPath:string, korean_FontPath:string, taiwan_FontPath:string)
---@field RegisterObject fun(addonId:any, object:uiobject, phraseId:string, silent:boolean?, ...) : boolean
---@field UpdateObjectArguments fun(addonId:any, object:uiobject, ...) : boolean
---@field RegisterTableKey fun(addonId:any, table:table, key:any, phraseId:string, silent:boolean?, ...) : boolean
---@field UpdateTableKeyArguments fun(addonId:any, table:table, key:any, ...) : boolean
---@field RegisterObjectWithDefault fun(addonId:any, object:uiobject, phraseId:string, defaultText:string, ...) : boolean
---@field RegisterTableKeyWithDefault fun(addonId:any, table:table, key:any, phraseId:string, defaultText:string, ...) : boolean
---@field CreateLocTable fun(addonId:any, phraseId:string, shouldRegister:boolean?, ...) : table
---@field SetTextWithLocTable fun(object:uiobject, locTable:table)
---@field SetTextWithLocTableWithDefault fun(object:uiobject, locTable:table, defaultText:string)
---@field SetTextIfLocTableOrDefault fun(object:uiobject, locTable:table)
---@field RegisterTableKeyWithLocTable fun(table:table, key:any, locTable:table, silence:boolean?)
---@field RegisterObjectWithLocTable fun(object:uiobject, locTable:table, silence:boolean?)
---@alias templatetype
---| "font"
---| "dropdown"
@@ -25,14 +48,23 @@
---@field RoundedCornerPanelMixin df_roundedcornermixin
---@field Schedules df_schedule
---@field HeaderFunctions df_headerfunctions
---@field Language df_language
---@field KeybindMixin df_keybindmixin
---@field ScriptHookMixin df_scripthookmixin
---@field ClassCache {ID:number, Name:string, FileString:string, Texture:string, TexCoord:number[]}[] only available after calling GetClassList()
---@field Math df_math
---@field table df_table_functions
---@field ClassFileNameToIndex table<string, number> engClass -> classIndex
---@field LoadSpellCache fun(self:table, hashMap:table, indexTable:table, allSpellsSameName:table) : hashMap:table, indexTable:table, allSpellsSameName:table load all spells in the game and add them into the passed tables
---@field UnloadSpellCache fun(self:table) wipe the table contents filled with LoadSpellCache()
---@field GetCurrentClassName fun(self:table) : string return the name of the class the player is playing
---@field GetCurrentSpecName fun(self:table) : string return the name of the spec the player is playing
---@field GetSpellCaches fun(self:table) : table, table, table return the tables filled with LoadSpellCache()
---@field GetCurrentSpec fun(self:table):number?
---@field GetCurrentSpecId fun(self:table):number? return the specId of the current spec, retuns nil if the expansion the player is playing does not support specs
---@field GetClassSpecIds fun(self:table, engClass:string):number[]
---@field IsValidSpecId fun(self:table, specId:number):boolean check if the passed specId is valid for the player class, also return false for tutorial specs
---@field GetClassList fun(self:table):{ID:number, Name:string, FileString:string, Texture:string, TexCoord:number[]}[]
---@field DebugVisibility fun(self:table, object:uiobject) print the reason why the frame isn't shown in the screen
---@field Dispatch fun(self:table, callback:function, ...) : any dispatch a function call using xpcall, print to chat if the function passed is invalid
---@field QuickDispatch fun(self:table, callback:function, ...) : any dispatch a function call without errors if the function passed is invalid
@@ -40,7 +72,7 @@
---@field GetDefaultBackdropColor fun(self:table) : red, green, blue, alpha return the standard backdrop color used by blizzard on their own frames
---@field Msg fun(self:table, message:string, ...) show a message in the chat frame
---@field MsgWarning fun(self:table, message:string, ...) show a warning message in the chat frame
---@field CreateButton fun(self:table, parent:frame, func:function, width:number, height:number, text:string?, param1:any, param2:any, texture:atlasname|texturepath|textureid|nil, member:string?, name:string?, shortMethod:any, buttonTemplate:table?, textTemplate:table?) : df_button
---@field CreateButton fun(self:table, parent:frame, func:function, width:number, height:number, text:any, param1:any, param2:any, texture:atlasname|texturepath|textureid|nil, member:string?, name:string?, shortMethod:any, buttonTemplate:table?, textTemplate:table?) : df_button
---@field CreateCloseButton fun(self:table, parent:frame, frameName:string?) : df_closebutton
---@field CreateTabButton fun(self:table, parent:frame, frameName:string?) : df_tabbutton
---@field CreateRoundedPanel fun(self:table, parent:frame, frameName:string?, optionsTable:df_roundedpanel_options?) : df_roundedpanel
@@ -75,7 +107,6 @@
---@field NewColor fun(self:table, colorName:string, red:number, green:number, blue:number, alpha:number)
---@field CreateKeybindFrame fun(self:table, parent:frame, name:string?, options:table?, setKeybindCallback:function?, keybindData:table?) : df_keybindframe
---@field CreateStatusBar fun(self:table, parent:frame, options:table?) : frame
---@field CreateScrollBox fun(self:table, parent:frame, name:string, refreshFunc:function, data:table, width:number, height:number, lineAmount:number, lineHeight:number, createLineFunc:function?, autoAmount:boolean?, noScroll:boolean?, noBackdrop:boolean?) : df_scrollbox
---@field GetTemplate fun(self:table, templateType:templatetype, templateName:string) : table
---@field UpdateLoadConditionsTable fun(self:table, loadConditionsTable:table)
---@field IconPick fun(self:table, callback:function, bCloseWhenSelect:boolean?, param1:any?, param2:any?)
@@ -87,5 +118,9 @@
---@field CreateSwitch fun(self:table, parent:frame, onSwitch:function, defaultValue:boolean, width:number?, height:number?, leftText:string?, rightText:string?, member:string?, name:string?, colorInverted:boolean?, switchFunc:function?, returnFunc:function?, withLabel:string?, switch_template:table?, label_template:table?) : df_checkbox, df_label?
---@field CreateCheckboxGroup fun(self:table, parent:frame, radioOptions:df_radiooptions[], name:string?, options:table?, anchorOptions:table?) : df_checkboxgroup
---@field CreateRadioGroup fun(self:table, parent:frame, radioOptions:df_radiooptions[], name:string?, options:table?, anchorOptions:table?) : df_radiogroup
---@field CreateScrollBox fun(self:table, parent:frame, name:string, refreshFunc:function, data:table, width:number, height:number, lineAmount:number, lineHeight:number, createLineFunc:function?, autoAmount:boolean?, noScroll:boolean?, noBackdrop:boolean?) : df_scrollbox
---@field CreateAuraScrollBox fun(self:table, parent:frame, name:string?, data:table?, onRemoveCallback:function?, options:table?) : df_aurascrollbox
---@field CreateGridScrollBox fun(self:table, parent:frame, name:string?, refreshFunc:function, data:table?, createColumnFrameFunc:function, options:table?) : df_gridscrollbox
---@field GetSizeFromPercent fun(self:table, uiObject:uiobject, percent:number) : number get the min size of a uiObject and multiply it by the percent passed
---@field
---@field
+108 -67
View File
@@ -1,6 +1,6 @@
local dversion = 477
local dversion = 479
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)
@@ -11,6 +11,8 @@ end
_G["DetailsFramework"] = DF
---@cast DF detailsframework
DetailsFrameworkCanLoad = true
local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
@@ -936,6 +938,16 @@ function DF:GroupIterator(callback, ...)
end
end
---receives an object and a percent amount, then calculate the return value by multiplying the min value of the object width or height by the percent received
---@param uiObject uiobject
---@param percent number
---@return number
function DF:GetSizeFromPercent(uiObject, percent)
local width, height = uiObject:GetSize()
local minValue = math.min(width, height)
return minValue * percent
end
---get an integer an format it as string with the time format 16:45
---@param self table
---@param value number
@@ -2097,8 +2109,47 @@ end
return descPhraseId or widgetTable.descPhraseId or widgetTable.desc or widgetTable.name or "-?-"
end
local getNamePhraseText = function(languageTable, widgetTable, useColon)
local namePhrase = languageTable and (languageTable[widgetTable.namePhraseId] or languageTable[widgetTable.name])
local getNamePhraseID = function(widgetTable, languageAddonId, languageTable, bIgnoreEmbed)
if (widgetTable.namePhraseId) then
return widgetTable.namePhraseId
end
if (not languageTable) then
return
end
local keyName = widgetTable.name
if (widgetTable.type == "label" and widgetTable.get) then
local key = widgetTable.get()
if (key and type(key) == "string") then
keyName = key
end
end
--embed key is when the phraseId is inside a string surounded by @
local embedPhraseId = keyName:match("@(.-)@")
local hasValue = DF.Language.DoesPhraseIDExistsInDefaultLanguage(languageAddonId, embedPhraseId or keyName)
if (not hasValue) then
return
end
if (embedPhraseId and not bIgnoreEmbed) then
return embedPhraseId, true
else
return keyName
end
end
local getNamePhraseText = function(languageTable, widgetTable, useColon, languageAddonId)
local namePhraseId, bWasEmbed = getNamePhraseID(widgetTable, languageAddonId, languageTable)
local namePhrase = languageTable and (languageTable[namePhraseId] or languageTable[widgetTable.namePhraseId] or languageTable[widgetTable.name])
if (bWasEmbed and widgetTable.name) then
namePhrase = widgetTable.name:gsub("@" .. namePhraseId .. "@", namePhrase)
end
return namePhrase or formatOptionNameWithColon(widgetTable.name, useColon) or widgetTable.namePhraseId or widgetTable.name or "-?-"
end
@@ -2179,7 +2230,8 @@ end
local label = getMenuWidgetVolative(parent, "label", widgetIndexes)
widgetCreated = label
local namePhrase = (languageTable and (languageTable[widgetTable.namePhraseId] or languageTable[widgetTable.name])) or (widgetTable.get and widgetTable.get()) or widgetTable.text or (widgetTable.namePhraseId) or ""
local namePhraseId = getNamePhraseID(widgetTable, languageAddonId, languageTable)
local namePhrase = (languageTable and (languageTable[namePhraseId] or languageTable[widgetTable.namePhraseId] or languageTable[widgetTable.name])) or (widgetTable.get and widgetTable.get()) or widgetTable.text or (widgetTable.namePhraseId) or ""
label.text = namePhrase
label.color = widgetTable.color
@@ -2218,7 +2270,7 @@ end
dropdown._get = widgetTable.get
dropdown.widget_type = "select"
local namePhrase = getNamePhraseText(languageTable, widgetTable, useColon)
local namePhrase = getNamePhraseText(languageTable, widgetTable, useColon, languageAddonId)
dropdown.hasLabel.text = namePhrase
dropdown.hasLabel:SetTemplate(widgetTable.text_template or textTemplate)
@@ -2281,7 +2333,7 @@ end
switch:SetHeight(widgetTable.height)
end
local namePhrase = getNamePhraseText(languageTable, widgetTable, useColon)
local namePhrase = getNamePhraseText(languageTable, widgetTable, useColon, languageAddonId)
switch.hasLabel.text = namePhrase
switch.hasLabel:SetTemplate(widgetTable.text_template or textTemplate)
@@ -2353,7 +2405,7 @@ end
end
end
local namePhrase = getNamePhraseText(languageTable, widgetTable, useColon)
local namePhrase = getNamePhraseText(languageTable, widgetTable, useColon, languageAddonId)
slider.hasLabel.text = namePhrase
slider.hasLabel:SetTemplate(widgetTable.text_template or textTemplate)
@@ -2403,7 +2455,7 @@ end
local label = colorpick.hasLabel
local namePhrase = getNamePhraseText(languageTable, widgetTable, useColon)
local namePhrase = getNamePhraseText(languageTable, widgetTable, useColon, languageAddonId)
label.text = namePhrase
label:SetTemplate(widgetTable.text_template or textTemplate)
@@ -2442,7 +2494,7 @@ end
button.textfont = textTemplate.font
button.textsize = textTemplate.size
local namePhrase = getNamePhraseText(languageTable, widgetTable, useColon)
local namePhrase = getNamePhraseText(languageTable, widgetTable, useColon, languageAddonId)
button.text = namePhrase
if (widgetTable.inline) then
@@ -2513,7 +2565,7 @@ end
end
end)
local namePhrase = getNamePhraseText(languageTable, widgetTable, useColon)
local namePhrase = getNamePhraseText(languageTable, widgetTable, useColon, languageAddonId)
textentry.hasLabel.text = namePhrase
textentry.hasLabel:SetTemplate(widgetTable.text_template or textTemplate)
textentry:SetPoint("left", textentry.hasLabel, "right", 2)
@@ -2586,35 +2638,6 @@ end
return widgetTable.desc
end
local getNamePhraseID = function(widgetTable, languageAddonId, languageTable)
if (widgetTable.namePhraseId) then
return widgetTable.namePhraseId
end
if (not languageTable) then
return
end
local keyName = widgetTable.name
if (widgetTable.type == "label" and widgetTable.get) then
local key = widgetTable.get()
if (key and type(key) == "string") then
keyName = key
end
end
--embed key is when the phraseId is inside a string surounded by @
local embedPhraseId = keyName:match("@(.-)@")
local hasValue = DF.Language.DoesPhraseIDExistsInDefaultLanguage(languageAddonId, embedPhraseId or keyName)
if (not hasValue) then
return
end
return keyName
end
function DF:BuildMenu(parent, menuOptions, xOffset, yOffset, height, useColon, textTemplate, dropdownTemplate, switchTemplate, switchIsCheckbox, sliderTemplate, buttonTemplate, valueChangeHook)
if (not parent.widget_list) then
DF:SetAsOptionsPanel(parent)
@@ -2711,7 +2734,7 @@ end
dropdown.widget_type = "select"
local label = DF:NewLabel(parent, nil, "$parentLabel" .. index, nil, "", "GameFontNormal", widgetTable.text_template or textTemplate or 12)
local namePhraseId = getNamePhraseID(widgetTable, languageAddonId, languageTable)
local namePhraseId = getNamePhraseID(widgetTable, languageAddonId, languageTable, true, true)
DetailsFramework.Language.RegisterObjectWithDefault(languageAddonId, label.widget, namePhraseId, formatOptionNameWithColon(widgetTable.name, useColon))
dropdown.addonId = languageAddonId
@@ -2786,7 +2809,7 @@ end
local label = DF:NewLabel(parent, nil, "$parentLabel" .. index, nil, "", "GameFontNormal", widgetTable.text_template or textTemplate or 12)
local namePhraseId = getNamePhraseID(widgetTable, languageAddonId, languageTable)
local namePhraseId = getNamePhraseID(widgetTable, languageAddonId, languageTable, true)
DetailsFramework.Language.RegisterObjectWithDefault(languageAddonId, label.widget, namePhraseId, formatOptionNameWithColon(widgetTable.name, useColon))
if (widgetTable.boxfirst or useBoxFirstOnAllWidgets) then
@@ -2851,7 +2874,7 @@ end
end
local label = DF:NewLabel(parent, nil, "$parentLabel" .. index, nil, "", "GameFontNormal", widgetTable.text_template or textTemplate or 12)
local namePhraseId = getNamePhraseID(widgetTable, languageAddonId, languageTable)
local namePhraseId = getNamePhraseID(widgetTable, languageAddonId, languageTable, true)
DetailsFramework.Language.RegisterObjectWithDefault(languageAddonId, label.widget, namePhraseId, formatOptionNameWithColon(widgetTable.name, useColon))
slider:SetPoint("left", label, "right", 2)
@@ -2900,7 +2923,7 @@ end
end
local label = DF:NewLabel(parent, nil, "$parentLabel" .. index, nil, "", "GameFontNormal", widgetTable.text_template or textTemplate or 12)
local namePhraseId = getNamePhraseID(widgetTable, languageAddonId, languageTable)
local namePhraseId = getNamePhraseID(widgetTable, languageAddonId, languageTable, true)
DetailsFramework.Language.RegisterObjectWithDefault(languageAddonId, label.widget, namePhraseId, formatOptionNameWithColon(widgetTable.name, useColon))
if (widgetTable.boxfirst or useBoxFirstOnAllWidgets) then
@@ -2933,7 +2956,7 @@ end
elseif (widgetTable.type == "execute") then
local button = DF:NewButton(parent, nil, "$parentWidget" .. index, nil, 120, 18, widgetTable.func, widgetTable.param1, widgetTable.param2, nil, "", nil, buttonTemplate, textTemplate)
local namePhraseId = getNamePhraseID(widgetTable, languageAddonId, languageTable)
local namePhraseId = getNamePhraseID(widgetTable, languageAddonId, languageTable, true)
DetailsFramework.Language.RegisterObjectWithDefault(languageAddonId, button.widget, namePhraseId, widgetTable.name)
if (not buttonTemplate) then
@@ -3007,7 +3030,7 @@ end
local label = DF:NewLabel(parent, nil, "$parentLabel" .. index, nil, "", "GameFontNormal", widgetTable.text_template or textTemplate or 12)
local namePhraseId = getNamePhraseID(widgetTable, languageAddonId, languageTable)
local namePhraseId = getNamePhraseID(widgetTable, languageAddonId, languageTable, true)
DetailsFramework.Language.RegisterObjectWithDefault(languageAddonId, label.widget, namePhraseId, formatOptionNameWithColon(widgetTable.name, useColon))
textentry:SetPoint("left", label, "right", 2)
@@ -4812,12 +4835,27 @@ function DF:ReskinSlider(slider, heightOffset)
end
end
function DF:GetCurrentClassName()
local className = UnitClass("player")
return className
end
function DF:GetCurrentSpecName()
local specIndex = DF.GetSpecialization()
if (specIndex) then
local specId, specName = DF.GetSpecializationInfo(specIndex)
if (specId and specId ~= 0) then
return specName
end
end
end
function DF:GetCurrentSpec()
local specIndex = DF.GetSpecialization()
if (specIndex) then
local specID = DF.GetSpecializationInfo(specIndex)
if (specID and specID ~= 0) then
return specID
local specId = DF.GetSpecializationInfo(specIndex)
if (specId and specId ~= 0) then
return specId
end
end
end
@@ -4842,8 +4880,12 @@ local specs_per_class = {
["EVOKER"] = {1467, 1468, 1473},
}
function DF:GetClassSpecIDs(class)
return specs_per_class [class]
function DF:GetClassSpecIDs(engClass)
return specs_per_class[engClass]
end
function DF:GetClassSpecIds(engClass) --naming conventions
return DF:GetClassSpecIDs(engClass)
end
local dispatch_error = function(context, errortext)
@@ -4936,44 +4978,42 @@ DF.ClassIndexToFileName = {
DF.ClassFileNameToIndex = {
["DEATHKNIGHT"] = 6,
["WARRIOR"] = 1,
["ROGUE"] = 4,
["MAGE"] = 8,
["PRIEST"] = 5,
["HUNTER"] = 3,
["WARLOCK"] = 9,
["DEMONHUNTER"] = 12,
["SHAMAN"] = 7,
["DRUID"] = 11,
["MONK"] = 10,
["PALADIN"] = 2,
["HUNTER"] = 3,
["ROGUE"] = 4,
["PRIEST"] = 5,
["DEATHKNIGHT"] = 6,
["SHAMAN"] = 7,
["MAGE"] = 8,
["WARLOCK"] = 9,
["MONK"] = 10,
["DRUID"] = 11,
["DEMONHUNTER"] = 12,
["EVOKER"] = 13,
}
DF.ClassCache = {}
function DF:GetClassList()
if (next (DF.ClassCache)) then
return DF.ClassCache
end
for className, classIndex in pairs(DF.ClassFileNameToIndex) do
local classTable = C_CreatureInfo.GetClassInfo (classIndex)
local classTable = C_CreatureInfo.GetClassInfo(classIndex)
if classTable then
local t = {
ID = classIndex,
Name = classTable.className,
Texture = [[Interface\GLUES\CHARACTERCREATE\UI-CharacterCreate-Classes]],
TexCoord = CLASS_ICON_TCOORDS [className],
TexCoord = CLASS_ICON_TCOORDS[className],
FileString = className,
}
tinsert(DF.ClassCache, t)
table.insert(DF.ClassCache, t)
end
end
return DF.ClassCache
end
--hardcoded race list
@@ -5398,7 +5438,7 @@ DF.SpecListByClass = {
---@param specId number
function DF:IsValidSpecId(specId)
local _, class = UnitClass("player")
local specs = DF.SpecListByClass[class]
local specs = DF.ClassSpecs[class]
return specs and specs[specId] and true or false
end
@@ -5935,4 +5975,5 @@ function _G.__benchmark(bNotPrintResult)
print("Elapsed Time:", elapsed)
return elapsed
end
end
end
+5
View File
@@ -12,6 +12,11 @@ end
---@field CountdownText fontstring
---@field CooldownEdge texture
---@field options table
---@field NextIcon number
---@field IconPool table<number, df_icongeneric> table which store the icons created for this iconrow
---@field SetAuraWithIconTemplate fun(self:df_icongeneric, aI:aurainfo, iconTemplateTable:table)
---@field ClearIcons fun(self:df_icongeneric, resetBuffs:boolean?, resetDebuffs:boolean?)
---@field AlignAuraIcons fun(self:df_icongeneric)
local unpack = unpack
local CreateFrame = CreateFrame
+11 -1
View File
@@ -110,7 +110,13 @@ detailsFramework:Mixin(LabelMetaFunctions, detailsFramework.ScriptHookMixin)
--text
local smember_text = function(object, value)
return object.label:SetText(value)
--check if this is a loc table
if (detailsFramework.Language.IsLocTable(value)) then
local locTable = value
detailsFramework.Language.RegisterObjectWithLocTable(object.widget or object, locTable)
else
return object.label:SetText(value)
end
end
--text color
@@ -235,6 +241,10 @@ detailsFramework:Mixin(LabelMetaFunctions, detailsFramework.ScriptHookMixin)
return self.label:SetTextColor(red, green, blue, alpha)
end
function LabelMetaFunctions:SetText(text)
return smember_text(self, text)
end
------------------------------------------------------------------------------------------------------------
--template
+37 -15
View File
@@ -177,7 +177,15 @@ detailsFramework.LayoutFrame = {
end
thisFrame:SetPoint(anchorPoint, self, anchorAt, currentX, currentY)
currentY = currentY - offsetY
if (options.use__height) then --use the childframe.__width
currentY = currentY - thisFrame.__height
elseif (options.min_height) then
currentY = currentY - math.max(options.min_height, offsetY)
else
currentY = currentY - offsetY
end
end
end
@@ -2026,12 +2034,12 @@ local no_options = {}
---@field Close button
---@field SetTitle fun(self: simplepanel, title: string)
---@param parent frame the parent frame
---@param width number|nil the width of the panel
---@param height number|nil the height of the panel
---@param title string|nil a string to show in the title bar
---@param frameName string|nil the name of the frame
---@param panelOptions table|nil a table with options described above
---@param savedVariableTable table|nil a table to save the scale of the panel
---@param width number? the width of the panel
---@param height number? the height of the panel
---@param title string? a string to show in the title bar
---@param frameName string? the name of the frame
---@param panelOptions table? a table with options described above
---@param savedVariableTable table? a table to save the scale of the panel
---@return frame
function detailsFramework:CreateSimplePanel(parent, width, height, title, frameName, panelOptions, savedVariableTable)
--create a saved variable table if the savedVariableTable has been not passed within the function call
@@ -2127,9 +2135,9 @@ function detailsFramework:CreateSimplePanel(parent, width, height, title, frameN
titleText:SetText(title or "")
simplePanel.Title = titleText
if (panelOptions.UseScaleBar and savedVariableTable [frameName]) then
detailsFramework:CreateScaleBar (simplePanel, savedVariableTable [frameName])
simplePanel:SetScale(savedVariableTable [frameName].scale)
if (panelOptions.UseScaleBar and savedVariableTable and savedVariableTable[frameName]) then
detailsFramework:CreateScaleBar(simplePanel, savedVariableTable[frameName])
simplePanel:SetScale(savedVariableTable[frameName].scale)
end
simplePanel.Title:SetPoint("center", titleBar, "center")
@@ -3987,6 +3995,7 @@ local default_radiogroup_options = {
---@field _set function
---@field _callback function
---@field __width number
---@field __height number
---@class df_radiogroupmixin : table
---@field allCheckBoxes df_radiogroup_checkbox[]
@@ -3995,6 +4004,7 @@ local default_radiogroup_options = {
---@field Enable fun(self:df_checkboxgroup)
---@field DeselectAll fun(self:df_checkboxgroup)
---@field Select fun(self:df_checkboxgroup, checkboxId:number)
---@field GetSelected fun(self:df_checkboxgroup):number
---@field FadeIn fun(self:df_checkboxgroup)
---@field FadeOut fun(self:df_checkboxgroup)
---@field GetAllCheckboxes fun(self:df_checkboxgroup):df_radiogroup_checkbox[]
@@ -4137,15 +4147,16 @@ detailsFramework.RadioGroupCoreFunctions = {
checkbox.Label:SetPoint("left", checkbox, "right", 2, 0)
end
local checkBoxLength = width + (checkbox.Icon:IsShown() and (checkbox.Icon:GetWidth() + 2)) + (checkbox.Label:GetStringWidth()) + 2
checkbox.__width = checkBoxLength
checkbox.widget.__width = checkBoxLength
checkbox.__width = width + (checkbox.Icon:IsShown() and (checkbox.Icon:GetWidth() + 2)) + (checkbox.Label:GetStringWidth()) + 2
checkbox.widget.__width = checkbox.__width
checkbox.__height = height + (checkbox.Icon:IsShown() and (checkbox.Icon:GetHeight() + 2))
checkbox.widget.__height = checkbox.__height
end,
Refresh = function(self)
self:ResetAllCheckboxes()
local radioOptions = self:GetOptions()
local radioCheckboxes = self:GetAllCheckboxes()
local totalWidth = 0
local maxHeight = 0
@@ -4182,6 +4193,17 @@ detailsFramework.RadioGroupCoreFunctions = {
end
end,
GetSelected = function(self)
local allCheckBoxes = self:GetAllCheckboxes()
for i = 1, #allCheckBoxes do
local thisCheckbox = allCheckBoxes[i]
if (thisCheckbox:GetValue()) then
return thisCheckbox._optionid, thisCheckbox:GetFixedParameter()
end
end
return 0
end,
SetOptions = function(self, radioOptions)
self.RadioOptionsTable = radioOptions
self:Refresh()
@@ -4193,7 +4215,7 @@ detailsFramework.RadioGroupCoreFunctions = {
}
---@class df_radiooptions : table
---@field name string
---@field name string|table can be a regular string or a locTable
---@field get fun():any?
---@field set fun(self:df_radiooptions, param, value)
---@field param any?
+17
View File
@@ -29,6 +29,7 @@ detailsFramework.Schedules.AfterCombatSchedules = {
---@field CancelAllAfterCombat fun()
---@field IsAfterCombatScheduled fun(id: any): boolean
---@field LazyExecute fun(callback: function, payload: table?, maxIterations: number?, onEndCallback: function?): table
---@field AfterById fun(time: number, callback: function, id: any, ...: any): timer
---@class df_looper : table
---@field payload table
@@ -240,6 +241,22 @@ function detailsFramework.Schedules.LazyExecute(callback, payload, maxIterations
return payload
end
function detailsFramework.Schedules.AfterById(time, callback, id, ...)
if (not detailsFramework.Schedules.ExecuteTimerTable) then
detailsFramework.Schedules.ExecuteTimerTable = {}
end
local alreadyHaveTimer = detailsFramework.Schedules.ExecuteTimerTable[id]
if (alreadyHaveTimer) then
alreadyHaveTimer:Cancel()
end
local newTimer = detailsFramework.Schedules.NewTimer(time, callback, ...)
detailsFramework.Schedules.ExecuteTimerTable[id] = newTimer
return newTimer
end
--schedule a task with an interval of @time without payload
function detailsFramework.Schedules.After(time, callback)
+31 -11
View File
@@ -337,10 +337,19 @@ local grid_scrollbox_options = {
function detailsFramework:CreateGridScrollBox(parent, name, refreshFunc, data, createColumnFrameFunc, options)
options = options or {}
local width = options.width or grid_scrollbox_options.width
local height = options.height or grid_scrollbox_options.height
local lineAmount = options.line_amount or grid_scrollbox_options.line_amount
local lineHeight = options.line_height or grid_scrollbox_options.line_height
--check values passed, get defaults and cast values due to the scrollbox require some values to be numbers
local width = type(options.width) == "number" and options.width or grid_scrollbox_options.width
---@cast width number
local height = type(options.height) == "number" and options.height or grid_scrollbox_options.height
---@cast height number
local lineAmount = type(options.line_amount) == "number" and options.line_amount or grid_scrollbox_options.line_amount
---@cast lineAmount number
local lineHeight = type(options.line_height) == "number" and options.line_height or grid_scrollbox_options.line_height
---@cast lineHeight number
local columnsPerLine = options.columns_per_line or grid_scrollbox_options.columns_per_line
local autoAmount = options.auto_amount
local noScroll = options.no_scroll
@@ -404,6 +413,10 @@ function detailsFramework:CreateGridScrollBox(parent, name, refreshFunc, data, c
end
end
if (not name) then
name = "DetailsFrameworkAuraScrollBox" .. math.random(1, 9999999)
end
local scrollBox = detailsFramework:CreateScrollBox(parent, name, refreshGrid, data, width, height, lineAmount, lineHeight, createLineFunc, autoAmount, noScroll, noBackdrop)
scrollBox:CreateLines(createLineFunc, lineAmount)
detailsFramework:ReskinSlider(scrollBox)
@@ -505,10 +518,10 @@ function detailsFramework:CreateAuraScrollBox(parent, name, data, onAuraRemoveCa
end
line:SetBackdropColor(unpack(options.backdrop_onenter))
local bAddedBySpellName = line.Flag --the user entered the spell name to track the spell (and not a spellId)
local bTrackByName = line.Flag --the user entered the spell name to track the spell (and not a spellId)
local spellId = line.SpellID
if (bAddedBySpellName) then --the user entered the spell name to track the spell
if (bTrackByName) then --the user entered the spell name to track the spell
local spellsHashMap, spellsIndexTable, spellsWithSameName = detailsFramework:GetSpellCaches()
if (spellsWithSameName) then
local spellName, _, spellIcon = GetSpellInfo(spellId)
@@ -546,7 +559,7 @@ function detailsFramework:CreateAuraScrollBox(parent, name, data, onAuraRemoveCa
end
local onClickAuraRemoveButton = function(self)
local spellId = self:GetParent().SpellID
local spellId = tonumber(self:GetParent().SpellID)
if (spellId and type(spellId) == "number") then
--button > line > scrollbox
local scrollBox = self:GetParent():GetParent()
@@ -599,9 +612,11 @@ function detailsFramework:CreateAuraScrollBox(parent, name, data, onAuraRemoveCa
end
---@class df_aurascrollbox : df_scrollbox
---@field TransformAuraData fun(self:df_aurascrollbox)
---@field data_original table
---@field refresh_original function
---@field TitleLabel fontstring
---@field TransformAuraData fun(self:df_aurascrollbox)
---@field GetTitleFontString fun(self:df_aurascrollbox): fontstring
data = data or {}
@@ -614,10 +629,15 @@ function detailsFramework:CreateAuraScrollBox(parent, name, data, onAuraRemoveCa
---@cast auraScrollBox df_aurascrollbox
auraScrollBox.data_original = data
local titleLabel = detailsFramework:CreateLabel(auraScrollBox, options.title_text)
titleLabel.textcolor = "silver"
titleLabel.textsize = 10
local titleLabel = auraScrollBox:CreateFontString("$parentTitleLabel", "overlay", "GameFontNormal")
titleLabel:SetPoint("bottomleft", auraScrollBox, "topleft", 0, 2)
detailsFramework:SetFontColor(titleLabel, "silver")
detailsFramework:SetFontSize(titleLabel, 10)
auraScrollBox.TitleLabel = titleLabel
function auraScrollBox:GetTitleFontString()
return self.TitleLabel
end
for i = 1, options.line_amount do
auraScrollBox:CreateLine(createLineFunc)
+1 -1
View File
@@ -39,7 +39,7 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t
end
local major = "LibOpenRaid-1.0"
local CONST_LIB_VERSION = 112
local CONST_LIB_VERSION = 113
if (LIB_OPEN_RAID_MAX_VERSION) then
if (CONST_LIB_VERSION <= LIB_OPEN_RAID_MAX_VERSION) then
@@ -607,6 +607,7 @@ do
[48792] = {cooldown = 120, duration = 8, specs = {250, 251, 252}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 2}, --Icebound Fortitude
[46585] = {cooldown = 120, duration = 60, specs = {250, 251, 252}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 1}, --Raise Dead
[49206] = {cooldown = 180, duration = 30, specs = {252}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 1}, --Summon Gargoyle
[207349] = {cooldown = 180, duration = 30, specs = {252}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 1}, --Summon Dark Arbiter (replaces Gargoyle)
[219809] = {cooldown = 60, duration = 8, specs = {250}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 2}, --Tombstone
[207289] = {cooldown = 78, duration = 12, specs = {252}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 1}, --Unholy Assault
[55233] = {cooldown = 90, duration = 10, specs = {250}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 2}, --Vampiric Blood
+24 -2
View File
@@ -274,24 +274,46 @@ do
customItemList[426431] = {itemId = 210494, isPassive = true} --enchant: Incandescent Essence (aug evoker)
customItemList[426486] = {itemId = 210494, isPassive = true} --enchant: Incandescent Essence (aug evoker)
customItemList[424324] = {itemId = 207788, isPassive = true} --weapon: [[PH] Fyrakk Cantrip 1H Mace INT] - shadowflame corrupted?
--customItemList[424324] = {itemId = 207786, isPassive = true} --weapon: [[PH] Fyrakk Cantrip 1H Axe STR] same as the mace
customItemList[424965] = {itemId = 207784, isPassive = true} --weapon: Thorncaller Claw
customItemList[425181] = {itemId = 207784, isPassive = true, nameExtra = "(*aoe*)"} --weapon: Thorncaller Claw
customItemList[425127] = {itemId = 207783, isPassive = true} --weapon: Cruel Dreamcarver (heal)
customItemList[423611] = {itemId = 207167, isPassive = true, nameExtra = "*proc*"} --trinket: Ashes of the Embersoul (extra proc)
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[425154] = {itemId = 207166, isPassive = true} --trinket: Infernal Signet Brand
customItemList[425154] = {itemId = 207166, isPassive = true} --trinket: Cataclysmic Signet Brand
customItemList[427037] = {itemId = 207175, isPassive = true} --trinket: Coiled Serpent Idol
customItemList[421996] = {itemId = 207173, isPassive = true} --trinket: Gift of Ursine Vengeance
customItemList[421994] = {itemId = 207173, isPassive = true} --trinket: Gift of Ursine Vengeance (buff)
customItemList[422441] = {itemId = 207169, isPassive = true} --trinket: Branch of the Tormented Ancient (buff)
customItemList[417458] = {itemId = 207566, isPassive = true} --trinket: Accelerating Sandglass
customItemList[417452] = {itemId = 207566, isPassive = true} --trinket: Accelerating Sandglass (buff)
customItemList[214169] = {itemId = 136715, isPassive = true} --trinket: Spiked Counterweight
customItemList[92174] = {itemId = 133192, isPassive = true} --trinket: Porcelain Crab
customItemList[429262] = {itemId = 109999, isPassive = true} --trinket: Witherbark's Branch (buff)
customItemList[418527] = {itemId = 207581, isPassive = true} --trinket: Mirror of Fractured Tomorrows (buff)
customItemList[214342] = {itemId = 137312, isPassive = true} --trinket: Nightmare Egg Shell
customItemList[429246] = {itemId = 110004, isPassive = true} --trinket: Coagulated Genesaur Blood
customItemList[214350] = {itemId = 137306, isPassive = true} --trinket: Oakheart's Gnarled Root
customItemList[429221] = {itemId = 133201, isPassive = true} --trinket: Sea Star
customItemList[215270] = {itemId = 136714, isPassive = true} --trinket: Amalgam's Seventh Spine
customItemList[417534] = {itemId = 207579, isPassive = true} --trinket: Time-Thief's Gambit
customItemList[270827] = {itemId = 159610, isPassive = true} --trinket: Vessel of Skittering Shadows
customItemList[271671] = {itemId = 159631, isPassive = true} --trinket: Lady Waycrest's Music Box
customItemList[215407] = {itemId = 136716, isPassive = true} --trinket: Caged Horror
customItemList[427161] = {itemId = 208615, onUse = true, castId = 422956, defaultName = GetSpellInfo(422956)} --trinket: Nymue's Unraveling Spindle
customItemList[425701] = {itemId = 207174, onUse = true, castId = 422750, defaultName = GetSpellInfo(422750)} --trinket: Fyrakk's Tainted Rageheart
customItemList[425509] = {itemId = 207169, onUse = true, castId = 422441, defaultName = GetSpellInfo(422441)} --trinket: Branch of the Tormented Ancient
customItemList[422146] = {itemId = 207172, onUse = true, castId = 422146, defaultName = GetSpellInfo(422146)} --trinket: Belor'relos, the Sunstone
customItemList[265953] = {itemId = 158319, onUse = true, castId = 265954, defaultName = GetSpellInfo(265953)} --trinket: My'das Talisman
customItemList[429257] = {itemId = 109999, onUse = true, castId = 429257, defaultName = GetSpellInfo(429257)} --trinket: Witherbark's Branch (no damage)
customItemList[427430] = {itemId = 207165, onUse = true, castId = 422146, defaultName = GetSpellInfo(422303), nameExtra = "*return*"} --trinket: Bandolier of Twisted Blades
customItemList[422303] = {itemId = 207165, onUse = true, castId = 422146, defaultName = GetSpellInfo(422303), nameExtra = "*throw*"} --trinket: Bandolier of Twisted Blades
customItemList[426898] = {itemId = 207167, onUse = true, castId = 423611, nameExtra = "*on use*", defaultName = GetSpellInfo(423611)} --trinket: Ashes of the Embersoul
customItemList[429271] = {itemId = 110009, onUse = true, castId = 429271, defaultName = GetSpellInfo(429271)} --trinket: Leaf of the Ancient Protectors
customItemList[429272] = {itemId = 110009, onUse = true, castId = 429271, nameExtra = "(*vers*)", defaultName = GetSpellInfo(429271)} --trinket: Leaf of the Ancient Protectors
end