diff --git a/Definitions.lua b/Definitions.lua index a7a3437c..3e318b3f 100644 --- a/Definitions.lua +++ b/Definitions.lua @@ -137,6 +137,7 @@ ---@field container_type table [containertype] = "damage" or "heal" or "energy" or "utility" ---@field TextureAtlas table ---@field playername string +---@field breakdown_general profile_breakdown_settings ---@field ---@field GetDisplayClassByDisplayId fun(self: details, displayId: number) : table -return the class object for the given displayId (attributeId) ---@field GetTextureAtlas fun(self: details, atlasName: atlasname) : df_atlasinfo return the texture atlas data @@ -787,3 +788,8 @@ ---@class details222 : table ---@field TimeMachine timemachine +---@class profile_breakdown_settings : table +---@field font_size number +---@field font_color color +---@field font_outline outline +---@field font_face string \ No newline at end of file diff --git a/Libs/DF/buildmenu.lua b/Libs/DF/buildmenu.lua index e162ed36..00aa746c 100644 --- a/Libs/DF/buildmenu.lua +++ b/Libs/DF/buildmenu.lua @@ -32,6 +32,7 @@ local _ ---@field desc string ---@field descPhraseId string ---@field hooks table +---@field include_default boolean ---@class df_menu_toggle : df_menu_table ---@field set function @@ -962,7 +963,7 @@ function detailsFramework:BuildMenuVolatile(parent, menuOptions, xOffset, yOffse do if (widgetTable.type == "selectfont") then - local func = detailsFramework:CreateFontListGenerator(widgetTable.set) + local func = detailsFramework:CreateFontListGenerator(widgetTable.set, widgetTable.include_default) dropdown:SetFunction(func) elseif (widgetTable.type == "selectcolor") then @@ -1202,7 +1203,7 @@ function detailsFramework:BuildMenu(parent, menuOptions, xOffset, yOffset, heigh local dropdown do if (widgetTable.type == "selectfont") then - dropdown = detailsFramework:CreateFontDropDown(parent, widgetTable.set, widgetTable.get(), widgetWidth or 140, widgetHeight or defaultHeight, nil, "$parentWidget" .. index, dropdownTemplate) + dropdown = detailsFramework:CreateFontDropDown(parent, widgetTable.set, widgetTable.get(), widgetWidth or 140, widgetHeight or defaultHeight, nil, "$parentWidget" .. index, dropdownTemplate, widgetTable.include_default) elseif (widgetTable.type == "selectcolor") then dropdown = detailsFramework:CreateColorDropDown(parent, widgetTable.set, widgetTable.get(), widgetWidth or 140, widgetHeight or defaultHeight, nil, "$parentWidget" .. index, dropdownTemplate) diff --git a/Libs/DF/button.lua b/Libs/DF/button.lua index 2b68bad3..c5c1e4ac 100644 --- a/Libs/DF/button.lua +++ b/Libs/DF/button.lua @@ -735,9 +735,7 @@ detailsFramework:Mixin(ButtonMetaFunctions, detailsFramework.ScriptHookMixin) ---width, height, icon|table, textcolor, textsize, textfont, textalign, backdrop, backdropcolor, backdropbordercolor, onentercolor, onleavecolor, onenterbordercolor, onleavebordercolor ---@param template table|string function ButtonMetaFunctions:SetTemplate(template) - if (type(template) == "string") then - template = detailsFramework:GetTemplate("button", template) - end + template = detailsFramework:ParseTemplate(self.type, template) if (not template) then detailsFramework:Error("template not found") @@ -859,7 +857,7 @@ end self:SetScript("OnEnable", onEnableFunc) end - ---@class df_button : button, df_scripthookmixin + ---@class df_button : button, df_scripthookmixin, df_widgets ---@field widget button ---@field tooltip string ---@field shown boolean diff --git a/Libs/DF/definitions.lua b/Libs/DF/definitions.lua index a739c793..6067a10b 100644 --- a/Libs/DF/definitions.lua +++ b/Libs/DF/definitions.lua @@ -46,8 +46,57 @@ ---@field nativeHeight number? ---@field desaturated boolean? ---@field desaturation number? +---@field atlas string? ----@alias templatetype +---@alias df_templatename string + +---@class df_template : table +---@field width any +---@field height any +---@field backdrop any +---@field backdropcolor any +---@field backdropbordercolor any +---@field onentercolor any +---@field onleavecolor any +---@field onenterbordercolor any +---@field onleavebordercolor any +---@field icon any +---@field size any +---@field textsize any +---@field font any +---@field textfont any +---@field color any +---@field textcolor any +---@field textalign any +---@field rounded_corner any +---@field thumbtexture any +---@field slider_left any +---@field slider_right any +---@field slider_middle any +---@field thumbwidth any +---@field thumbheight any +---@field thumbcolor any +---@field amount_color any +---@field amount_outline any +---@field amount_size any +---@field enabled_backdropcolor any +---@field disabled_backdropcolor any +---@field is_checkbox any +---@field checked_texture any +---@field checked_xoffset any +---@field checked_yoffset any +---@field checked_size_percent any +---@field checked_color any + + + +---@class df_widgets : table +---@field type string +---@field dframework boolean +---@field container frame +---@field widget frame + +---@alias templatecategory ---| "font" ---| "dropdown" ---| "button" @@ -75,6 +124,12 @@ ---@field AnchorPoints string[] ---@field alias_text_colors table ---@field ClassFileNameToIndex table engClass -> classIndex +---@field ClientLanguage string +---@field dropdown_templates table +---@field switch_templates table +---@field button_templates table +---@field slider_templates table +---@field font_templates table ---@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 @@ -106,9 +161,10 @@ ---@field GetFontSize fun(self:table, fontstring:fontstring) : number return the font size of the fontstring ---@field SetFontColor fun(self:table, fontstring:fontstring, red:any, green:number?, blue:number?, alpha:number?) ---@field SetFontFace fun(self:table, fontstring:fontstring, font:string) +---@field SetFontDefault fun(self:table, fontstring:fontstring) ---@field GetFontFace fun(self:table, fontstring:fontstring) : string return the font face of the fontstring ---@field SetFontShadow fun(self:table, fontstring:fontstring, red:any, green:number?, blue:number?, alpha:number?, offsetX:number?, offsetY:number?) ----@field SetFontOutline fun(self:table, fontstring:fontstring, outline:fontflags) +---@field SetFontOutline fun(self:table, fontstring:fontstring, outline:outline) ---@field RemoveRealmName fun(self:table, name:string) : string, number remove the realm name from the player name, must be in the format of "name-realm" ---@field RemoveOwnerName fun(self:table, name:string) : string, number removes the owner name from a name string, the owner name must be between < and > ---@field CleanUpName fun(self:table, name:string) : string removes the realm name and owner name from a name string @@ -135,7 +191,7 @@ ---@field NewColor fun(self:table, colorName:string, red:number, green:number, blue:number, alpha:number?) : table ---@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 GetTemplate fun(self:table, templateType:templatetype, templateName:string) : table +---@field GetTemplate fun(self:table, templatecategory:templatecategory, templateName:string) : table ---@field UpdateLoadConditionsTable fun(self:table, loadConditionsTable:table) ---@field IconPick fun(self:table, callback:function, bCloseWhenSelect:boolean?, param1:any?, param2:any?) ---@field OpenLoadConditionsPanel fun(self:table, optionsTable:table, callback:function, frameOptions:table?) @@ -193,7 +249,17 @@ ---@field IsTexture fun(self:table, texture:any, bCheckTextureObject: boolean?) : boolean ---@field CreateAtlasString fun(self:table, atlas:atlasinfo|atlasname, textureHeight:number?, textureWidth:number?) : string ---@field SetMask fun(self:table, texture:texture, maskTexture:atlasname|texturepath|textureid) : nil +---@field GetClientRegion fun(self:table) : string +---@field GetBestFontPathForLanguage fun(self:table, languageId:string) : string +---@field SetTemplate fun(self:table, frame:uiobject, template:string) +---@field ParseTemplate fun(self:table, templateCategory:string, template:string|table) : table +---@field GetParentName fun(self:table, frame:uiobject) : string +---@field IsLatinLanguage fun(self:table, languageId:string) : boolean ---@field +---@field +---@field + + --[=[ diff --git a/Libs/DF/dropdown.lua b/Libs/DF/dropdown.lua index 64846bdc..58628d10 100644 --- a/Libs/DF/dropdown.lua +++ b/Libs/DF/dropdown.lua @@ -996,7 +996,7 @@ function DetailsFrameworkDropDownOnHide(self) end local iconSizeTable = {16, 16} -function DF:BuildDropDownFontList(onClick, icon, iconTexcoord, iconSize) +function DF:BuildDropDownFontList(onClick, icon, iconTexcoord, iconSize, bIncludeDefault) local fontTable = {} local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") @@ -1006,6 +1006,10 @@ function DF:BuildDropDownFontList(onClick, icon, iconTexcoord, iconSize) table.sort(fontTable, function(t1, t2) return t1.label < t2.label end) + if (bIncludeDefault) then + table.insert(fontTable, 1, {value = "DEFAULT", label = "DEFAULT", onclick = onClick, icon = icon, iconsize = iconSizeTable, texcoord = iconTexcoord, font = "", descfont = "abcdefg ABCDEFG"}) + end + return fontTable end @@ -1013,13 +1017,7 @@ end --template function DropDownMetaFunctions:SetTemplate(template) - if (type(template) == "string") then - local templateName = template - template = DF:GetTemplate("dropdown", templateName) - if (not template) then - print("no template found", templateName) - end - end + template = DF:ParseTemplate(self.type, template) self.template = template @@ -1101,7 +1099,7 @@ end ------------------------------------------------------------------------------------------------------------ --object constructor ----@class df_dropdown : table, frame +---@class df_dropdown : table, frame, df_widgets ---@field SetTemplate fun(self:df_dropdown, template:table|string) ---@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 SetFunction fun(self:df_dropdown, func:function) @@ -1119,8 +1117,8 @@ end ---return a function which when called returns a table filled with all fonts available and ready to be used on dropdowns ---@param callback function ---@return function -function DF:CreateFontListGenerator(callback) - return function() return DF:BuildDropDownFontList(callback, [[Interface\AnimCreate\AnimCreateIcons]], {0, 32/128, 64/128, 96/128}, 16) end +function DF:CreateFontListGenerator(callback, bIncludeDefault) + return function() return DF:BuildDropDownFontList(callback, [[Interface\AnimCreate\AnimCreateIcons]], {0, 32/128, 64/128, 96/128}, 16, bIncludeDefault) end end local colorGeneratorStatusBarTexture = [[Interface\Tooltips\UI-Tooltip-Background]] @@ -1204,8 +1202,9 @@ end ---@param member string? ---@param name string? ---@param template table? -function DF:CreateFontDropDown(parent, callback, default, width, height, member, name, template) - local func = DF:CreateFontListGenerator(callback) +---@param bIncludeDefault boolean? +function DF:CreateFontDropDown(parent, callback, default, width, height, member, name, template, bIncludeDefault) + local func = DF:CreateFontListGenerator(callback, bIncludeDefault) local dropDownObject = DF:NewDropDown(parent, parent, name, member, width, height, func, default, template) return dropDownObject end @@ -1256,7 +1255,7 @@ function DF:NewDropDown(parent, container, name, member, width, height, func, de end if (name:find("$parent")) then - local parentName = DF.GetParentName(parent) + local parentName = DF:GetParentName(parent) name = name:gsub("$parent", parentName) end diff --git a/Libs/DF/frames.lua b/Libs/DF/frames.lua index 4b5f698f..df652a32 100644 --- a/Libs/DF/frames.lua +++ b/Libs/DF/frames.lua @@ -14,86 +14,6 @@ local defaultBorderColorTable = {0.1, 0.1, 0.1, 1} ---@type edgenames[] local cornerNames = {"TopLeft", "TopRight", "BottomLeft", "BottomRight"} ----@class blz_backdrop : table ----@field TopLeftCorner texture ----@field TopRightCorner texture ----@field BottomLeftCorner texture ----@field BottomRightCorner texture ----@field TopEdge texture ----@field BottomEdge texture ----@field LeftEdge texture ----@field RightEdge texture ----@field Center texture - ----@class cornertextures : table ----@field TopLeft texture ----@field TopRight texture ----@field BottomLeft texture ----@field BottomRight texture - ----@class edgetextures : table ----@field Top texture ----@field Bottom texture ----@field Left texture ----@field Right texture - ----@class df_roundedpanel_options : table ----@field width number ----@field height number ----@field use_titlebar boolean ----@field use_scalebar boolean ----@field title string ----@field scale number ----@field roundness number ----@field color any ----@field border_color any ----@field corner_texture texturepath|textureid ----@field horizontal_border_size_offset number? - ----@class df_roundedpanel_preset : table, df_roundedpanel_options ----@field border_color any ----@field color any ----@field roundness number - ----@class df_roundedcornermixin : table ----@field RoundedCornerConstructor fun(self:df_roundedpanel) --called from CreateRoundedPanel ----@field SetColor fun(self:df_roundedpanel, red: any, green: number|nil, blue: number|nil, alpha: number|nil) ----@field SetBorderCornerColor fun(self:df_roundedpanel, red: any, green: number|nil, blue: number|nil, alpha: number|nil) ----@field SetRoundness fun(self:df_roundedpanel, slope: number) ----@field GetCornerSize fun(self:df_roundedpanel) : width, height ----@field OnSizeChanged fun(self:df_roundedpanel) --called when the frame size changes ----@field CreateBorder fun(self:df_roundedpanel) --called from SetBorderCornerColor if the border is not created yet ----@field CalculateBorderEdgeSize fun(self:df_roundedpanel, alignment: "vertical"|"horizontal"): number --calculate the size of the border edge texture ----@field SetTitleBarColor fun(self:df_roundedpanel, red: any, green: number|nil, blue: number|nil, alpha: number|nil) ----@field GetMaxFrameLevel fun(self:df_roundedpanel) : number --return the max frame level of the frame and its children - ----@class df_roundedpanel : frame, df_roundedcornermixin, df_optionsmixin, df_titlebar ----@field bHasBorder boolean ----@field bHasTitleBar boolean ----@field options df_roundedpanel_options ----@field cornerRoundness number ----@field CornerTextures cornertextures ----@field CenterTextures texture[] ----@field BorderCornerTextures cornertextures ----@field BorderEdgeTextures edgetextures ----@field TitleBar df_roundedpanel ----@field bIsTitleBar boolean ----@field TopLeft texture corner texture ----@field TopRight texture corner texture ----@field BottomLeft texture corner texture ----@field BottomRight texture corner texture ----@field TopEdgeBorder texture border edge ----@field BottomEdgeBorder texture border edge ----@field LeftEdgeBorder texture border edge ----@field RightEdgeBorder texture border edge ----@field TopLeftBorder texture border corner ----@field TopRightBorder texture border corner ----@field BottomLeftBorder texture border corner ----@field BottomRightBorder texture border corner ----@field TopHorizontalEdge texture texture connecting the top corners ----@field BottomHorizontalEdge texture texture connecting the bottom corners ----@field CenterBlock texture texture connecting the bottom left of the topleft corner with the top right of the bottom right corner - ---@param self df_roundedpanel ---@param textures cornertextures ---@param width number|nil diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 8c68c9b5..ea8b3c05 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,6 +1,6 @@ -local dversion = 518 +local dversion = 519 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary(major, minor) @@ -13,6 +13,8 @@ _G["DetailsFramework"] = DF ---@cast DF detailsframework +local detailsFramework = DF + DetailsFrameworkCanLoad = true local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") @@ -1193,6 +1195,11 @@ end ---@param fontString fontstring ---@param fontface string function DF:SetFontFace(fontString, fontface) + if (fontface == "DEFAULT") then + DF:SetFontDefault(fontString) + return + end + local font = SharedMedia:Fetch("font", fontface, true) if (font) then fontface = font @@ -1202,6 +1209,17 @@ function DF:SetFontFace(fontString, fontface) return fontString:SetFont(fontface, size, flags) end +local dummyFontString = UIParent:CreateFontString(nil, "background", "GameFontNormal") +local defaultFontFile = dummyFontString:GetFont() + +---get the UIObject of type 'FontString' and set the default game font into it +---@param self table +---@param fontString fontstring +function DF:SetFontDefault(fontString) + local _, size, flags = fontString:GetFont() + return fontString:SetFont(defaultFontFile, size, flags) +end + ---get the FontString passed and set the font color ---@param self table ---@param fontString fontstring @@ -1445,7 +1463,7 @@ DF.FontOutlineFlags = { ---set the outline of a fontstring, outline is a black border around the text, can be "NONE", "MONOCHROME", "OUTLINE" or "THICKOUTLINE" ---@param fontString table ----@param outline any +---@param outline outline function DF:SetFontOutline(fontString, outline) local font, fontSize = fontString:GetFont() if (outline) then @@ -1460,7 +1478,7 @@ function DF:SetFontOutline(fontString, outline) outline = "OUTLINE" elseif (type(outline) == "boolean" and not outline) then - outline = "" --"NONE" + outline = "NONE" elseif (outline == 1) then outline = "OUTLINE" @@ -1469,7 +1487,8 @@ function DF:SetFontOutline(fontString, outline) outline = "THICKOUTLINE" end end - outline = (not outline or outline == "NONE") and "" or outline + + outline = (not outline or outline == "NONE") and "NONE" or outline fontString:SetFont(font, fontSize, outline) end @@ -2478,13 +2497,8 @@ end DF.ClientLanguage = clientLanguage -function DF:DetectTextLanguage(text) - for i = 1, #text do - --or not - end -end - ---returns which region the language the client is running, return "western", "russia" or "asia" +---returns which region the language the client is running, return "western", "russia" or "asia" +---@return string function DF:GetClientRegion() if (clientLanguage == "zhCN" or clientLanguage == "koKR" or clientLanguage == "zhTW") then return "asia" @@ -2496,7 +2510,11 @@ function DF:GetClientRegion() end DF.registeredFontPaths = DF.registeredFontPaths or {} + -- ~language ~locale ~fontpath +---get a font path to be used for a specific language +---@param languageId string enUS, deDE, esES, esMX, frFR, itIT, ptBR, ruRU, zhCN, zhTW, koKR +---@return string function DF:GetBestFontPathForLanguage(languageId) local fontPath = DF.registeredFontPaths[languageId] if (fontPath) then @@ -2524,6 +2542,9 @@ function DF:GetBestFontPathForLanguage(languageId) return [[Fonts\FRIZQT__.TTF]] end +---return true if the language paren is latin: enUS, deDE, esES, esMX, frFR, itIT, ptBR +---@param languageId string +---@return boolean function DF:IsLatinLanguage(languageId) return latinLanguageIdsMap[languageId] end @@ -2551,6 +2572,131 @@ function DF:GetBestFontForLanguage(languageId, western, cyrillic, china, korean, end end + +local templateOnEnter = function(frame) + if (frame.onenter_backdrop) then + local r, g, b, a = detailsFramework:ParseColors(frame.onenter_backdrop) + frame:SetBackdropColor(r, g, b, a) + end + if (frame.onenter_backdrop_border_color) then + local r, g, b, a = detailsFramework:ParseColors(frame.onenter_backdrop_border_color) + frame:SetBackdropBorderColor(r, g, b, a) + end +end + +local templateOnLeave = function(frame) + if (frame.onleave_backdrop) then + local r, g, b, a = detailsFramework:ParseColors(frame.onleave_backdrop) + frame:SetBackdropColor(r, g, b, a) + end + if (frame.onleave_backdrop_border_color) then + local r, g, b, a = detailsFramework:ParseColors(frame.onleave_backdrop_border_color) + frame:SetBackdropBorderColor(r, g, b, a) + end +end + +---set a details framework template into a regular frame +---@param self table +---@param frame uiobject +---@param template string +function detailsFramework:SetTemplate(frame, template) + template = detailsFramework:ParseTemplate("button", template) + + if (frame.SetWidth) then + if (template.width) then + PixelUtil.SetWidth(frame, template.width) + end + + if (template.height) then + PixelUtil.SetHeight(frame, template.height) + end + end + + if (frame.SetBackdrop) then + if (template.backdrop) then + frame:SetBackdrop(template.backdrop) + end + + if (template.backdropcolor) then + local r, g, b, a = detailsFramework:ParseColors(template.backdropcolor) + frame:SetBackdropColor(r, g, b, a) + frame.onleave_backdrop = {r, g, b, a} + end + + if (template.backdropbordercolor) then + local r, g, b, a = detailsFramework:ParseColors(template.backdropbordercolor) + frame:SetBackdropBorderColor(r, g, b, a) + frame.onleave_backdrop_border_color = {r, g, b, a} + end + + if (template.onentercolor) then + local r, g, b, a = detailsFramework:ParseColors(template.onentercolor) + frame.onenter_backdrop = {r, g, b, a} + frame:HookScript("OnEnter", templateOnEnter) + frame.__has_onentercolor_script = true + end + + if (template.onleavecolor) then + local r, g, b, a = detailsFramework:ParseColors(template.onleavecolor) + frame.onleave_backdrop = {r, g, b, a} + frame:HookScript("OnLeave", templateOnLeave) + frame.__has_onleavecolor_script = true + end + + if (template.onenterbordercolor) then + local r, g, b, a = detailsFramework:ParseColors(template.onenterbordercolor) + frame.onenter_backdrop_border_color = {r, g, b, a} + if (not frame.__has_onentercolor_script) then + frame:HookScript("OnEnter", templateOnEnter) + end + end + + if (template.onleavebordercolor) then + local r, g, b, a = detailsFramework:ParseColors(template.onleavebordercolor) + frame.onleave_backdrop_border_color = {r, g, b, a} + if (not frame.__has_onleavecolor_script) then + frame:HookScript("OnLeave", templateOnLeave) + end + end + end + + if (frame.SetIcon) then + if (template.icon) then + local iconInfo = template.icon + frame:SetIcon(iconInfo.texture, iconInfo.width, iconInfo.height, iconInfo.layout, iconInfo.texcoord, iconInfo.color, iconInfo.textdistance, iconInfo.leftpadding) + end + end + + if (frame.SetTextColor) then + if (template.textsize) then + detailsFramework:SetFontSize(frame, template.textsize) + end + + if (template.textfont) then + detailsFramework:SetFontFace(frame, template.textfont) + end + + if (template.textcolor) then + detailsFramework:SetFontColor(frame, template.textcolor) + end + + --horizontal alignment + if (template.textalign and frame.SetJustifyH) then + template.textalign = string.lower(template.textalign) + + if (template.textalign == "left" or template.textalign == "<") then + frame:SetJustifyH("LEFT") + + elseif (template.textalign == "center" or template.textalign == "|") then + frame:SetJustifyH("CENTER") + + elseif (template.textalign == "right" or template.textalign == ">") then + frame:SetJustifyH("RIGHT") + end + end + end +end + --DF.font_templates ["ORANGE_FONT_TEMPLATE"] = {color = "orange", size = 11, font = "Accidental Presidency"} --DF.font_templates ["OPTIONS_FONT_TEMPLATE"] = {color = "yellow", size = 12, font = "Accidental Presidency"} DF.font_templates["ORANGE_FONT_TEMPLATE"] = {color = "orange", size = 10, font = DF:GetBestFontForLanguage()} @@ -2680,6 +2826,14 @@ DF.button_templates["OPTIONS_BUTTON_GOLDENBORDER_TEMPLATE"] = { backdropbordercolor = {1, 0.785, 0, 1}, } +DF.button_templates["STANDARD_GRAY"] = { + backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}, + backdropcolor = {0.2, 0.2, 0.2, 0.502}, + backdropbordercolor = {0, 0, 0, 0.5}, + onentercolor = {0.4, 0.4, 0.4, 0.502}, + +} + --sliders DF.slider_templates = DF.slider_templates or {} DF.slider_templates["OPTIONS_SLIDER_TEMPLATE"] = { @@ -2707,18 +2861,67 @@ DF.slider_templates["MODERN_SLIDER_TEMPLATE"] = { amount_outline = "outline", } ----install a template ----@param widgetType string +local templateTables = {DF.dropdown_templates, DF.button_templates, DF.switch_templates, DF.slider_templates, DF.font_templates} + +---template categories: "font", "dropdown", "button", "switch", "slider" +---receives a template category and a template name or table +---if a template name has been passed, the function will iterate over all template tables to find a template with the name passed +---@param self table +---@param templateCategory templatecategory +---@param template string|table +---@return table +function DF:ParseTemplate(templateCategory, template) + if (type(template) == "string") then + local objectType = templateCategory + + if (objectType == "label") then + templateCategory = "font" + + elseif (objectType == "dropdown") then + templateCategory = "dropdown" + + elseif (objectType == "button") then + templateCategory = "button" + + elseif (objectType == "switch") then + templateCategory = "switch" + + elseif (objectType == "slider") then + templateCategory = "slider" + end + + local templateTable = DF:GetTemplate(templateCategory, template) + if (templateTable) then + return templateTable + end + + --iterate over all template tables to find a template with the name passed + for i = 1, #templateTables do + local tTable = templateTables[i] + if (tTable[template]) then + return tTable[template] + end + end + else + return template + end + + ---@cast template table + return template +end + +---register a new template to be used with SetTemplate calls +---@param templateCategory templatecategory ---@param templateName string ---@param template table ---@param parentName any ---@return table -function DF:InstallTemplate(widgetType, templateName, template, parentName) +function DF:InstallTemplate(templateCategory, templateName, template, parentName) local newTemplate = {} --if has a parent, just copy the parent to the new template if (parentName and type(parentName) == "string") then - local parentTemplate = DF:GetTemplate(widgetType, parentName) + local parentTemplate = DF:GetTemplate(templateCategory, parentName) if (parentTemplate) then DF.table.copy(newTemplate, parentTemplate) end @@ -2727,10 +2930,10 @@ function DF:InstallTemplate(widgetType, templateName, template, parentName) --copy the template passed into the new template DF.table.copy(newTemplate, template) - widgetType = string.lower(widgetType) + templateCategory = string.lower(templateCategory) local templateTable - if (widgetType == "font") then + if (templateCategory == "font") then templateTable = DF.font_templates local font = template.font @@ -2740,16 +2943,16 @@ function DF:InstallTemplate(widgetType, templateName, template, parentName) font = DF:GetBestFontForLanguage(nil, font) end - elseif (widgetType == "dropdown") then + elseif (templateCategory == "dropdown") then templateTable = DF.dropdown_templates - elseif (widgetType == "button") then + elseif (templateCategory == "button") then templateTable = DF.button_templates - elseif (widgetType == "switch") then + elseif (templateCategory == "switch") then templateTable = DF.switch_templates - elseif (widgetType == "slider") then + elseif (templateCategory == "slider") then templateTable = DF.slider_templates end @@ -2780,7 +2983,10 @@ function DF:GetTemplate(widgetType, templateName) return templateTable[templateName] end -function DF.GetParentName(frame) +---get the name of the parent of the passed frame +---@param frame frame +---@return string +function DF:GetParentName(frame) local parentName = frame:GetName() if (not parentName) then error("Details! FrameWork: called $parent but parent was no name.", 2) @@ -2788,7 +2994,7 @@ function DF.GetParentName(frame) return parentName end -function DF:Error (errortext) +function DF:Error(errortext) print("|cFFFF2222Details! Framework Error|r:", errortext, self.GetName and self:GetName(), self.WidgetType, debugstack (2, 3, 0)) end diff --git a/Libs/DF/label.lua b/Libs/DF/label.lua index f34bc1a2..0c04a82a 100644 --- a/Libs/DF/label.lua +++ b/Libs/DF/label.lua @@ -249,6 +249,8 @@ detailsFramework:Mixin(LabelMetaFunctions, detailsFramework.ScriptHookMixin) --template function LabelMetaFunctions:SetTemplate(template) + template = detailsFramework:ParseTemplate(self.type, template) + if (template.size) then detailsFramework:SetFontSize(self.label, template.size) end @@ -266,7 +268,7 @@ detailsFramework:Mixin(LabelMetaFunctions, detailsFramework.ScriptHookMixin) ------------------------------------------------------------------------------------------------------------ --object constructor ----@class df_label: fontstring +---@class df_label: fontstring, df_widgets ---@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 @@ -336,11 +338,10 @@ function detailsFramework:NewLabel(parent, container, name, member, text, font, end if (name:find("$parent")) then - local parentName = detailsFramework.GetParentName(parent) + local parentName = detailsFramework:GetParentName(parent) name = name:gsub("$parent", parentName) end - ---@type df_label local labelObject = {type = "label", dframework = true} if (member) then @@ -359,6 +360,7 @@ function detailsFramework:NewLabel(parent, container, name, member, text, font, font = "GameFontNormal" end + labelObject.container = container labelObject.label = parent:CreateFontString(name, layer or "overlay", font) labelObject.widget = labelObject.label labelObject.label.MyObject = labelObject diff --git a/Libs/DF/math.lua b/Libs/DF/math.lua index 6531d0dc..a0779226 100644 --- a/Libs/DF/math.lua +++ b/Libs/DF/math.lua @@ -37,6 +37,8 @@ DF.Math = {} ---@field Clamp fun(minValue: number, maxValue: number, value: number) : number dont allow a number ot be lower or bigger than a certain range ---@field Round fun(num: number, numDecimalPlaces: number) : number cut fractions on a float ---@field GetObjectCoordinates fun(object: uiobject) : objectcoordinates return the coordinates of the four corners of an object +---@field MultiplyBy fun(value: number, ...) : ... multiply all the passed values by value. +---@field MapRangeColor fun(inputX: number, inputY: number, outputX: number, outputY: number, red: number, green: number, blue: number) : number, number, number ---find distance between two units @@ -69,6 +71,31 @@ function DF.Math.MapRangeClamped(inputX, inputY, outputX, outputY, value) return DF.Math.GetRangeValue(outputX, outputY, Clamp(DF.Math.GetRangePercent(inputX, inputY, value), 0, 1)) end +---*Receives a color, the range of the color and a range to map the color to, returns the color in the new range +---*Example: MapRangeColor(0, 1, 0, 255, 0.5, 0.5, 0.5) returns 127.5, 127.5, 127.5 +---@param inputX number X range of the original color +---@param inputY number Y range of the original color +---@param outputX number X range of the new color +---@param outputY number Y range of the new color +---@param red number +---@param green number +---@param blue number +---@return number, number, number +function DF.Math.MapRangeColor(inputX, inputY, outputX, outputY, red, green, blue) + local newR = DF.Math.MapRangeClamped(inputX, inputY, outputX, outputY, red) + local newG = DF.Math.MapRangeClamped(inputX, inputY, outputX, outputY, green) + local newB = DF.Math.MapRangeClamped(inputX, inputY, outputX, outputY, blue) + return newR, newG, newB +end + +function DF.Math.MultiplyBy(value, ...) + local values = {} + for i = 1, select("#", ...) do + values[i] = select(i, ...) * value + end + return unpack(values) +end + function DF.Math.MapRangeUnclamped(inputX, inputY, outputX, outputY, value) return DF.Math.GetRangeValue(outputX, outputY, DF.Math.GetRangePercent(inputX, inputY, value)) end diff --git a/Libs/DF/normal_bar.lua b/Libs/DF/normal_bar.lua index 3ddce3c3..b464e80e 100644 --- a/Libs/DF/normal_bar.lua +++ b/Libs/DF/normal_bar.lua @@ -761,7 +761,7 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name) end if (name:find("$parent")) then - local parentName = DF.GetParentName(parent) + local parentName = DF:GetParentName(parent) name = name:gsub("$parent", parentName) end diff --git a/Libs/DF/picture.lua b/Libs/DF/picture.lua index c06f7d75..43ed1a64 100644 --- a/Libs/DF/picture.lua +++ b/Libs/DF/picture.lua @@ -243,8 +243,9 @@ detailsFramework:Mixin(ImageMetaFunctions, detailsFramework.ScriptHookMixin) ------------------------------------------------------------------------------------------------------------ --object constructor - ---@class df_image : texture + ---@class df_image : texture, df_widgets ---@field SetGradient fun(gradientType: "vertical"|"horizontal", fromColor: table, toColor: table) + ---@field image texture ---@class df_gradienttable : table ---@field gradient "vertical"|"horizontal" @@ -303,7 +304,7 @@ detailsFramework:Mixin(ImageMetaFunctions, detailsFramework.ScriptHookMixin) end if (name:find("$parent")) then - local parentName = detailsFramework.GetParentName(parent) + local parentName = detailsFramework:GetParentName(parent) name = name:gsub("$parent", parentName) end @@ -452,7 +453,6 @@ end ---@param resetTexCoords boolean? function detailsFramework:SetAtlas(textureObject, atlas, useAtlasSize, filterMode, resetTexCoords) local isAtlas = C_Texture.GetAtlasInfo(type(atlas) == "string" and atlas or "--") - if (isAtlas and type(atlas) == "string") then textureObject:SetAtlas(atlas, useAtlasSize, filterMode, resetTexCoords) return @@ -462,6 +462,15 @@ function detailsFramework:SetAtlas(textureObject, atlas, useAtlasSize, filterMod ---@cast atlas df_atlasinfo local atlasInfo = atlas + local atlasName = atlas.atlas + if (atlasName) then + isAtlas = C_Texture.GetAtlasInfo(atlasName) + if (isAtlas) then + textureObject:SetAtlas(atlasName, useAtlasSize, filterMode, resetTexCoords) + return + end + end + if (useAtlasSize) then if (atlasInfo.width) then textureObject:SetWidth(atlasInfo.width) diff --git a/Libs/DF/slider.lua b/Libs/DF/slider.lua index 6004bf52..3f991a90 100644 --- a/Libs/DF/slider.lua +++ b/Libs/DF/slider.lua @@ -941,7 +941,7 @@ local set_as_checkbok = function(self) end end ----@class df_checkbox : df_button +---@class df_checkbox : df_button, df_widgets ---@field OnSwitch fun(self:df_checkbox, fixedValue:any, value:boolean) ---@field SetValue fun(self:df_button, value:boolean) ---@field GetValue fun(self:df_button):boolean @@ -992,6 +992,7 @@ function DF:NewSwitch(parent, container, name, member, width, height, leftText, local slider = DF:NewButton(parent, container, name, member, width, height) slider.HookList.OnSwitch = {} + slider.type = "switch" slider.switch_func = switch_func slider.return_func = return_func @@ -1056,16 +1057,7 @@ function DF:NewSwitch(parent, container, name, member, width, height, leftText, end function DFSliderMetaFunctions:SetTemplate(template) - if (type(template) == "string") then - local templateName = template - template = DF:GetTemplate("switch", templateName) - if (not template) then - template = DF:GetTemplate("slider", templateName) - if (not template) then - print("no template found", templateName) - end - end - end + template = DF:ParseTemplate(self.type, template) --slider e switch if (template.width) then @@ -1123,7 +1115,6 @@ function DFSliderMetaFunctions:SetTemplate(template) end end - if (template.thumbwidth) then if (self.thumb) then self.thumb:SetWidth(template.thumbwidth) @@ -1178,7 +1169,7 @@ end --DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) --DF:Mixin(DFSliderMetaFunctions, DF.TooltipHandlerMixin) ----@class df_slider : slider, df_scripthookmixin +---@class df_slider : slider, df_scripthookmixin, df_widgets ---@field widget slider ---@field slider slider ---@field type string @@ -1225,7 +1216,7 @@ function DF:NewSlider (parent, container, name, member, width, height, minValue, end if (name:find("$parent")) then - local parentName = DF.GetParentName(parent) + local parentName = DF:GetParentName(parent) name = name:gsub("$parent", parentName) end @@ -1264,6 +1255,7 @@ function DF:NewSlider (parent, container, name, member, width, height, minValue, SliderObject.slider:SetValueStep(0.01) else SliderObject.slider:SetValueStep(step) + SliderObject.slider:SetObeyStepOnDrag(true) end if (not APISliderFunctions) then diff --git a/Libs/DF/split_bar.lua b/Libs/DF/split_bar.lua index 254790c4..62e35eed 100644 --- a/Libs/DF/split_bar.lua +++ b/Libs/DF/split_bar.lua @@ -727,7 +727,7 @@ function DF:NewSplitBar (parent, container, name, member, w, h) end if (name:find("$parent")) then - local parentName = DF.GetParentName(parent) + local parentName = DF:GetParentName(parent) name = name:gsub("$parent", parentName) end diff --git a/Libs/DF/textentry.lua b/Libs/DF/textentry.lua index eae299ad..a8c4708e 100644 --- a/Libs/DF/textentry.lua +++ b/Libs/DF/textentry.lua @@ -596,7 +596,7 @@ function detailsFramework:NewTextEntry(parent, container, name, member, width, h end if (name:find("$parent")) then - local parentName = detailsFramework.GetParentName(parent) + local parentName = detailsFramework:GetParentName(parent) name = name:gsub("$parent", parentName) end @@ -1065,7 +1065,7 @@ end function detailsFramework:NewSpecialLuaEditorEntry(parent, width, height, member, name, nointent, showLineNumbers, bNoName) if (not bNoName) then if (name and name:find("$parent")) then - local parentName = detailsFramework.GetParentName(parent) + local parentName = detailsFramework:GetParentName(parent) name = name:gsub("$parent", parentName) end else diff --git a/Libs/DF/timebar.lua b/Libs/DF/timebar.lua index 031a66ef..bfc4a8d1 100644 --- a/Libs/DF/timebar.lua +++ b/Libs/DF/timebar.lua @@ -369,7 +369,7 @@ function DF:CreateTimeBar(parent, texture, width, height, value, member, name) end if (name:find("$parent")) then - local parentName = DF.GetParentName(parent) + local parentName = DF:GetParentName(parent) name = name:gsub("$parent", parentName) end diff --git a/Libs/LibLuaServer/LibLuaServer.lua b/Libs/LibLuaServer/LibLuaServer.lua index cc02013d..efc86ddd 100644 --- a/Libs/LibLuaServer/LibLuaServer.lua +++ b/Libs/LibLuaServer/LibLuaServer.lua @@ -152,8 +152,17 @@ function LibStub:IterateLibraries()end ---@alias outline ---| "NONE" +---| "MONOCHROME" ---| "OUTLINE" ---| "THICKOUTLINE" +---| "OUTLINEMONOCHROME" +---| "THICKOUTLINEMONOCHROME" +---| "none" +---| "monochrome" +---| "outline" +---| "thickoutline" +---| "outlinemonochrome" +---| "thickoutlinemonochrome" ---@alias orientation ---| "HORIZONTAL" diff --git a/classes/class_combat.lua b/classes/class_combat.lua index 9cae8f9b..982d8406 100644 --- a/classes/class_combat.lua +++ b/classes/class_combat.lua @@ -368,8 +368,8 @@ local segmentTypeToString = { ---return the atlasinfo for the combat icon ---@param self combat - ---@return df_atlasinfo - ---@return df_atlasinfo? + ---@return df_atlasinfo segmentIcon + ---@return df_atlasinfo? categoryIcon function classCombat:GetCombatIcon() local textureAtlas = Details:GetTextureAtlasTable() @@ -386,19 +386,19 @@ local segmentTypeToString = { return textureAtlas["segment-icon-mythicplus"] elseif (combatType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL) then - return textureAtlas["segment-icon-mythicplus"], textureAtlas["segment-icon-mythicplus-overall"] + return textureAtlas["segment-icon-mythicplus-overall"], textureAtlas["segment-icon-mythicplus"] elseif (combatType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSSTRASH) then - return textureAtlas["segment-icon-mythicplus"], textureAtlas["segment-icon-broom"] + return textureAtlas["segment-icon-broom"], textureAtlas["segment-icon-mythicplus"] elseif (combatType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSSWIPE) then - return textureAtlas["segment-icon-mythicplus"], textureAtlas["segment-icon-skull"] + return textureAtlas["segment-icon-skull"], textureAtlas["segment-icon-mythicplus"] elseif (combatType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSS) then - return textureAtlas["segment-icon-mythicplus"], textureAtlas["segment-icon-skull"] + return textureAtlas["segment-icon-skull"], textureAtlas["segment-icon-mythicplus"] elseif (combatType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASH) then - return textureAtlas["segment-icon-mythicplus"], textureAtlas["segment-icon-broom"] + return textureAtlas["segment-icon-broom"], textureAtlas["segment-icon-mythicplus"] elseif (combatType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_GENERIC) then return textureAtlas["segment-icon-mythicplus"] @@ -413,6 +413,19 @@ local segmentTypeToString = { return textureAtlas["segment-icon-broom"] elseif (combatType == DETAILS_SEGMENTTYPE_RAID_BOSS) then + local bossInfo = self:GetBossInfo() + local difficulty = bossInfo.diff + + if (difficulty == 16) then --mythic + return textureAtlas["segment-icon-skull"], textureAtlas["segment-icon-mythicraid"] + + elseif (difficulty == 15) then --heroic + return textureAtlas["segment-icon-skull"], textureAtlas["segment-icon-heroicraid"] + + elseif (difficulty == 14) then --heroic + return textureAtlas["segment-icon-skull"], textureAtlas["segment-icon-normalraid"] + end + return textureAtlas["segment-icon-skull"] elseif (combatType == DETAILS_SEGMENTTYPE_EVENT_VALENTINEDAY) then @@ -428,7 +441,7 @@ local segmentTypeToString = { local partyColor = {170/255, 167/255, 255/255} local loveIsInTheAirColor = {1, 0.411765, 0.705882, 1} local bossKillColor = "lime" - local bossWipeColor = "red" + local bossWipeColor = "orange" local mythicDungeonBossColor = {170/255, 167/255, 255/255, 1} local mythicDungeonBossWipeColor = {0.803922, 0.360784, 0.360784, 1} local mythicDungeonBossColor2 = {210/255, 200/255, 255/255, 1} @@ -514,7 +527,11 @@ local segmentTypeToString = { local formattedTime = self:GetFormattedCombatTime() local tryNumber = self:GetTryNumber() if (tryNumber) then - return bossInfo.name .." (#" .. tryNumber .. " " .. formattedTime .. ")", detailsFramework:ParseColors(bIsKill and bossKillColor or bossWipeColor) + if (bOnlyName) then + return bossInfo.name .." (#" .. tryNumber .. ")", detailsFramework:ParseColors(bIsKill and bossKillColor or bossWipeColor) + else + return bossInfo.name .." (#" .. tryNumber .. " " .. formattedTime .. ")", detailsFramework:ParseColors(bIsKill and bossKillColor or bossWipeColor) + end else local segmentId = self:GetSegmentSlotId() return bossInfo.name .." (#" .. segmentId .. ")", detailsFramework:ParseColors(bIsKill and bossKillColor or bossWipeColor) diff --git a/core/gears.lua b/core/gears.lua index 8b54f2c4..48a022c5 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -3162,7 +3162,7 @@ hooksecurefunc("ChatFrame_DisplayTimePlayed", function() local levelText = TIME_PLAYED_LEVEL and TIME_PLAYED_LEVEL:gsub("%%s", "") or "" for fontString in ChatFrame1.fontStringPool:EnumerateActive() do if (fontString:GetText() and fontString:GetText():find(levelText)) then - print(Details.GetPlayTimeOnClassString() .. " (/details playedclass)") + print(Details.GetPlayTimeOnClassString() .. " \ncommand: /details playedclass") break end end diff --git a/frames/window_breakdown/window_playerbreakdown.lua b/frames/window_breakdown/window_playerbreakdown.lua index fabbddee..99e8b05b 100644 --- a/frames/window_breakdown/window_playerbreakdown.lua +++ b/frames/window_breakdown/window_playerbreakdown.lua @@ -32,7 +32,11 @@ function breakdownWindowFrame.RegisterPluginButton(newPluginButton, newPluginObj newPluginButton.PluginAbsoluteName = newPluginAbsoluteName newPluginButton.PluginFrame = newPluginObject.Frame - newPluginButton:SetTemplate(detailsFramework:GetTemplate("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) + newPluginButton:SetTemplate("STANDARD_GRAY") + + --get the fontstring for this especific button + local fontString = _G[newPluginButton:GetName() .. "_Text"] + detailsFramework:SetFontDefault(fontString) newPluginObject.__breakdownwindow = true @@ -76,7 +80,7 @@ function breakdownWindowFrame.ShowPluginOnBreakdown(pluginObject, button) --reset the template on all plugin buttons for _, thisPluginButton in ipairs(breakdownWindowFrame.RegisteredPluginButtons) do ---@cast thisPluginButton df_button - thisPluginButton:SetTemplate(detailsFramework:GetTemplate("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) + thisPluginButton:SetTemplate(detailsFramework:GetTemplate("button", "STANDARD_GRAY")) --"DETAILS_PLUGINPANEL_BUTTON_TEMPLATE" end local pluginMainFrame = pluginObject.Frame @@ -186,10 +190,18 @@ function Details222.BreakdownWindow.HidePluginFrame() --reset the template on all plugin buttons for _, thisPluginButton in ipairs(breakdownWindowFrame.RegisteredPluginButtons) do ---@cast thisPluginButton df_button - thisPluginButton:SetTemplate(detailsFramework:GetTemplate("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) + thisPluginButton:SetTemplate(detailsFramework:GetTemplate("button", "STANDARD_GRAY")) end end + +function Details222.BreakdownWindow.ApplyFontSettings(fontString) + detailsFramework:SetFontSize(fontString, Details.breakdown_general.font_size) + detailsFramework:SetFontColor(fontString, Details.breakdown_general.font_color) + detailsFramework:SetFontOutline(fontString, Details.breakdown_general.font_outline) + detailsFramework:SetFontFace(fontString, Details.breakdown_general.font_face) +end + ------------------------------------------------------------------------------------------------------------------------------ --self = instancia --jogador = classe_damage ou classe_heal @@ -248,10 +260,16 @@ end Details.PlayerBreakdown.RoundedCornerPreset = { roundness = 6, - color = {.1, .1, .1, 0.98}, - border_color = {.05, .05, .05, 0.834}, + color = {.1, .1, .1, 0.834}, + --border_color = {.05, .05, .05, 0.834}, } +function Details:SetBreakdownWindowColor(r, g, b, a) + --setcolor implemented by rounded corners + breakdownWindowFrame:SetColor(r, g, b, a) + breakdownSideMenu:SetColor(r, g, b, a) +end + ---open the breakdown window ---@param self details ---@param instanceObject instance @@ -267,10 +285,12 @@ function Details:OpenBreakdownWindow(instanceObject, actorObject, bFromAttribute if (not breakdownWindowFrame.__rcorners) then breakdownWindowFrame:SetBackdropColor(.1, .1, .1, 0) breakdownWindowFrame:SetBackdropBorderColor(.1, .1, .1, 0) - breakdownWindowFrame.__background:Hide() detailsFramework:AddRoundedCornersToFrame(breakdownWindowFrame, Details.PlayerBreakdown.RoundedCornerPreset) + detailsFramework:AddRoundedCornersToFrame(breakdownSideMenu, Details.PlayerBreakdown.RoundedCornerPreset) end + Details:SetBreakdownWindowColor(unpack(Details.frame_background_color)) + if (not Details.row_singleclick_overwrite[mainAttribute] or not Details.row_singleclick_overwrite[mainAttribute][subAttribute]) then Details:CloseBreakdownWindow() return @@ -673,10 +693,6 @@ function breakdownWindowFrame.SetClassIcon(actorObject, class) end end -function Details:SetBreakdownWindowBackgroundTexture(texture) - breakdownWindowFrame.backgroundTexture:SetTexture(texture) -end - --search key: ~create ~inicio ~start function Details:CreateBreakdownWindow() table.insert(UISpecialFrames, breakdownWindowFrame:GetName()) @@ -712,13 +728,6 @@ function Details:CreateBreakdownWindow() end end - detailsFramework:ApplyStandardBackdrop(breakdownWindowFrame) - - --background - breakdownWindowFrame.backgroundTexture = breakdownWindowFrame:CreateTexture("$parent", "background", nil, -3) - breakdownWindowFrame.backgroundTexture:SetAllPoints() - breakdownWindowFrame.backgroundTexture:Hide() - --host the textures and fontstring of the default frame of the player breakdown window --what is the summary window: is the frame where all the widgets for the summary tab are created breakdownWindowFrame.SummaryWindowWidgets = CreateFrame("frame", "DetailsBreakdownWindowSummaryWidgets", breakdownWindowFrame, "BackdropTemplate") @@ -790,12 +799,17 @@ function Details:CreateBreakdownWindow() local gradientStartColor = Details222.ColorScheme.GetColorFor("gradient-background") local gradientUp = detailsFramework:CreateTexture(breakdownWindowFrame, {gradient = "vertical", fromColor = gradientStartColor, toColor = {0, 0, 0, 0.2}}, 1, 68, "artwork", {0, 1, 0, 1}) gradientUp:SetPoint("tops", 1, 18) - --gradientUp:Hide() + breakdownWindowFrame.gradientUp = gradientUp local gradientHeight = 481 local gradientDown = detailsFramework:CreateTexture(breakdownWindowFrame, {gradient = "vertical", fromColor = "transparent", toColor = {0, 0, 0, 0.7}}, 1, gradientHeight, "border", {0, 1, 0, 1}) gradientDown:SetPoint("bottomleft", breakdownWindowFrame.statusBar, "topleft", 1, 1) gradientDown:SetPoint("bottomright", breakdownWindowFrame.statusBar, "topright", -1, 1) + breakdownWindowFrame.gradientDown = gradientDown + + --visual debugging + gradientUp:Hide() + gradientDown:Hide() function breakdownWindowFrame:SetStatusbarText(text, fontSize, fontColor) if (not text) then @@ -924,10 +938,11 @@ function Details:CreatePlayerDetailsTab(tabName, locName, conditionFunc, fillFun tabFrame:SetPoint("bottomright", breakdownWindowFrame, "bottomright", -1, 20) tabFrame:Hide() - DetailsFramework:ApplyStandardBackdrop(tabFrame) - tabFrame:SetBackdropBorderColor(0, 0, 0, 0.3) - tabFrame.__background:SetAlpha(0.3) - tabFrame.RightEdge:Hide() + --DetailsFramework:ApplyStandardBackdrop(tabFrame) + --tabFrame:SetBackdropColor(0, 0, 0, 0) + --tabFrame:SetBackdropBorderColor(0, 0, 0, 0) + --tabFrame.__background:SetAlpha(0) + --tabFrame.RightEdge:Hide() --create the gradients in the top and bottom side of the breakdown window local gradientStartColor = Details222.ColorScheme.GetColorFor("gradient-background") diff --git a/frames/window_breakdown/window_playerbreakdown_list.lua b/frames/window_breakdown/window_playerbreakdown_list.lua index a7f8dfff..193d8ff2 100644 --- a/frames/window_breakdown/window_playerbreakdown_list.lua +++ b/frames/window_breakdown/window_playerbreakdown_list.lua @@ -22,7 +22,7 @@ local scrollbox_size = {215, 405} local scrollbox_lines = 20 local player_line_height = 20 local scrollbox_line_backdrop_color = {0.2, 0.2, 0.2, 0.5} -local scrollbox_line_backdrop_color_selected = {1, 1, 0, 0.934} +local scrollbox_line_backdrop_color_selected = {1, 1, 0, 0.45} local scrollbox_line_backdrop_color_highlight = {.9, .9, .9, 0.5} local player_scroll_size = {195, 288} @@ -100,23 +100,25 @@ end local refreshPluginButtons = function(breakdownWindowFrame, pluginsFrame, breakdownSideMenu) local amountPluginButtons = #breakdownWindowFrame.RegisteredPluginButtons local pluginButtonHeight = 20 - local spacingBetweenButtons = 2 + local spacingBetweenButtons = 1 local totalHeight = 0 for i = 1, amountPluginButtons do ---@type button local pluginButton = breakdownWindowFrame.RegisteredPluginButtons[i] pluginButton:Show() - pluginButton:SetWidth(pluginsFrame:GetWidth() - 4) - pluginButton:SetHeight(pluginButtonHeight) + PixelUtil.SetSize(pluginButton, pluginsFrame:GetWidth() - 4, pluginButtonHeight) pluginButton:ClearAllPoints() if (i == 1) then - pluginButton:SetPoint("topleft", pluginsFrame, "topleft", 2, -22) + PixelUtil.SetPoint(pluginButton, "topleft", pluginsFrame, "topleft", 2, -22) else - pluginButton:SetPoint("topleft", breakdownWindowFrame.RegisteredPluginButtons[i - 1], "bottomleft", 0, -spacingBetweenButtons) + PixelUtil.SetPoint(pluginButton, "topleft", breakdownWindowFrame.RegisteredPluginButtons[i - 1], "bottomleft", 0, -spacingBetweenButtons) end + local fontString = _G[pluginButton:GetName() .. "_Text"] + Details222.BreakdownWindow.ApplyFontSettings(fontString) + totalHeight = totalHeight + pluginButtonHeight + spacingBetweenButtons end @@ -125,7 +127,7 @@ local refreshPluginButtons = function(breakdownWindowFrame, pluginsFrame, breakd pluginsFrame:SetPoint("topleft", breakdownSideMenu, "topleft", 0, 0) pluginsFrame:SetWidth(breakdownSideMenu:GetWidth()) - pluginsFrame:SetHeight(amountPluginButtons * pluginButtonHeight + 22 + (amountPluginButtons * 2)) + pluginsFrame:SetHeight(amountPluginButtons * pluginButtonHeight + 22 + (amountPluginButtons * 1)) return totalHeight end @@ -275,6 +277,10 @@ local createPlayerScrollBox = function(breakdownWindowFrame, breakdownSideMenu, self.percentileText:SetAlpha(0.25) end + Details222.BreakdownWindow.ApplyFontSettings(self.playerName) + Details222.BreakdownWindow.ApplyFontSettings(self.itemLevelText) + Details222.BreakdownWindow.ApplyFontSettings(self.percentileText) + --set the statusbar local r, g, b = self.playerObject:GetClassColor() self.totalStatusBar:SetStatusBarColor(r, g, b, 1) @@ -311,59 +317,49 @@ local createPlayerScrollBox = function(breakdownWindowFrame, breakdownSideMenu, local createPlayerLine = function(self, index) --create a new line local line = CreateFrame("button", "$parentLine" .. index, self, "BackdropTemplate") + detailsFramework:SetTemplate(line, "STANDARD_GRAY") + detailsFramework:Mixin(line, detailsFramework.HeaderFunctions) - local upFrame = CreateFrame("frame", nil, line) - upFrame:SetFrameLevel(line:GetFrameLevel()+2) - upFrame:SetAllPoints() + ---@type frame + local OTTFrame = CreateFrame("frame", nil, line) + OTTFrame:SetFrameLevel(line:GetFrameLevel()+2) + OTTFrame:SetAllPoints() + line.OTTFrame = OTTFrame + + PixelUtil.SetPoint(line, "topleft", breakdownWindowFrame.PlayerSelectionHeader, "topleft", 1, -((index) * (player_line_height+1))) + PixelUtil.SetSize(line, scrollbox_size[1]-2, player_line_height) - --set its parameters - line:SetPoint("topleft", breakdownWindowFrame.PlayerSelectionHeader, "topleft", 1, -((index) * (player_line_height))) - line:SetSize(scrollbox_size[1]-2, player_line_height) line:RegisterForClicks("LeftButtonDown", "RightButtonDown") - line:SetScript("OnEnter", lineOnEnter) line:SetScript("OnLeave", lineOnLeave) line:SetScript("OnClick", lineOnClick) - detailsFramework:ApplyStandardBackdrop(line) - - local specIcon = upFrame:CreateTexture("$parentSpecIcon", "artwork") + local specIcon = OTTFrame:CreateTexture("$parentSpecIcon", "artwork") specIcon:SetSize(headerTable[1].width - 1, headerTable[1].width - 1) - specIcon:SetAlpha(0.71) + specIcon:SetAlpha(0.834) detailsFramework:SetMask(specIcon, [[Interface\COMMON\common-iconmask]]) - local roleIcon = upFrame:CreateTexture("$parentRoleIcon", "overlay") + local roleIcon = OTTFrame:CreateTexture("$parentRoleIcon", "overlay") roleIcon:SetSize((player_line_height-2) / 2, (player_line_height-2) / 2) roleIcon:SetAlpha(0.71) - local playerName = detailsFramework:CreateLabel(upFrame, "", 11, "white", "GameFontNormal") - if (fontFile) then - playerName.fontface = fontFile - end - if (fontSize) then - playerName.fontsize = fontSize - end - if (fontOutline) then - playerName.outline = fontOutline - end + local playerName = OTTFrame:CreateFontString("$parentPlayerName", "artwork", "GameFontNormal") + playerName:SetTextColor(1, 1, 1, .9) - --~create - playerName.textcolor = {1, 1, 1, .9} - - local className = detailsFramework:CreateLabel(upFrame, "", "GameFontNormal") + local className = detailsFramework:CreateLabel(OTTFrame, "", "GameFontNormal") className.textcolor = {.95, .8, .2, 0} className.textsize = 9 - local itemLevelText = detailsFramework:CreateLabel(upFrame, "", "GameFontNormal") + local itemLevelText = detailsFramework:CreateLabel(OTTFrame, "", "GameFontNormal") itemLevelText.textcolor = {1, 1, 1, .7} itemLevelText.textsize = 11 - local percentileText = detailsFramework:CreateLabel(upFrame, "", "GameFontNormal") + local percentileText = detailsFramework:CreateLabel(OTTFrame, "", "GameFontNormal") percentileText.textcolor = {1, 1, 1, .7} percentileText.textsize = 11 - local rankText = detailsFramework:CreateLabel(upFrame, "", "GameFontNormal") + local rankText = detailsFramework:CreateLabel(OTTFrame, "", "GameFontNormal") rankText.textcolor = {.3, .3, .3, .7} rankText.textsize = fontSize @@ -507,18 +503,15 @@ local createSegmentsScrollBox = function(breakdownWindowFrame, breakdownSideMenu local combatName = segmentData.combatName local r, g, b = segmentData.r, segmentData.g, segmentData.b local combatIcon1 = segmentData.combatIcon - local combatIcon2 = segmentData.combatIcon2 self.segmentText:SetText(combatName) + Details222.BreakdownWindow.ApplyFontSettings(self.segmentText) + self.segmentText:SetTextColor(r, g, b) detailsFramework:TruncateText(self.segmentText, player_scroll_size[1] - 20) - detailsFramework:SetAtlas(self.segmentIcon, combatIcon1) - if (combatIcon2) then - detailsFramework:SetAtlas(self.segmentSubIcon, combatIcon2) - else - self.segmentSubIcon:SetTexture("") - end + local bUseAtlasSize = true + detailsFramework:SetAtlas(self.segmentIcon, combatIcon1, bUseAtlasSize) self.combatUniqueID = segmentData.UID @@ -559,41 +552,28 @@ local createSegmentsScrollBox = function(breakdownWindowFrame, breakdownSideMenu --create a new line local line = CreateFrame("button", "$parentLine" .. index, self, "BackdropTemplate") detailsFramework:Mixin(line, detailsFramework.HeaderFunctions) + detailsFramework:SetTemplate(line, "STANDARD_GRAY") + + PixelUtil.SetPoint(line, "topleft", self, "topleft", 1, -((index-1) * (player_line_height+1))) + PixelUtil.SetSize(line, scrollbox_size[1]-2, player_line_height) - --set its parameters - line:SetPoint("topleft", self, "topleft", 1, -((index-1) * (player_line_height))) - line:SetSize(scrollbox_size[1]-2, player_line_height) line:RegisterForClicks("LeftButtonDown", "RightButtonDown") - line:SetScript("OnEnter", lineOnEnter) line:SetScript("OnLeave", lineOnLeave) line:SetScript("OnClick", lineOnClick) - detailsFramework:ApplyStandardBackdrop(line) - --segment icon, this icon will tell which type of segment the line is + ---@type df_image local segmentIcon = detailsFramework:CreateTexture(line, "", player_line_height, player_line_height - 1, "artwork") segmentIcon:SetSize(player_line_height - 4, player_line_height - 4) segmentIcon:SetAlpha(0.834) - local segmentSubIcon = detailsFramework:CreateTexture(line, "", player_line_height, player_line_height - 1, "artwork") - segmentSubIcon:SetSize(player_line_height - 4, player_line_height - 4) - segmentSubIcon:SetAlpha(0.834) - - local segmentText = detailsFramework:CreateLabel(line, "", fontSize or 11, "white", "GameFontNormal") - segmentText.outline = fontOutline or "none" - segmentText.textcolor = {1, 1, 1, .9} - if (fontFile) then - segmentText.textfont = fontFile - end - + local segmentText = line:CreateFontString("$parentSegmentName", "artwork", "GameFontNormal") line.segmentText = segmentText line.segmentIcon = segmentIcon - line.segmentSubIcon = segmentSubIcon segmentIcon:SetPoint("left", line, "left", 2, 0) - segmentSubIcon:SetPoint("left", segmentIcon, "right", 2, 0) - segmentText:SetPoint("left", segmentSubIcon, "right", 3, 1) + segmentText:SetPoint("left", segmentIcon.widget, "right", 3, 1) line.UpdateLine = updateSegmentLine @@ -638,8 +618,6 @@ function breakdownWindowPlayerList.CreatePlayerListFrame() PixelUtil.SetPoint(breakdownSideMenu, "topright", breakdownWindowFrame, "topleft", -2, 0) PixelUtil.SetPoint(breakdownSideMenu, "bottomright", breakdownWindowFrame, "bottomleft", -2, 0) - detailsFramework:AddRoundedCornersToFrame(breakdownSideMenu, Details.PlayerBreakdown.RoundedCornerPreset) - --> create headers local sectionHeaderHeight = 20 --plugins header frame @@ -758,15 +736,17 @@ function breakdownWindowPlayerList.CreatePlayerListFrame() lastSelectedPlayerPerSegment[Details:GetCombatFromBreakdownWindow():GetCombatUID()] = selectedPlayerName lastSelectedPlayerName = selectedPlayerName + local playerLineHeight = player_line_height+1 --the +1 is the space between the lines + --recalculate the height free, now that we know the amount of lines the player scroll will show - heightFree = heightFree - (linesForPlayerScroll * player_line_height) - local linesForSegmentsScroll = math.floor(heightFree/player_line_height) + heightFree = heightFree - (linesForPlayerScroll * playerLineHeight) + local linesForSegmentsScroll = math.floor(heightFree/playerLineHeight) playerScroll:SetNumFramesShown(linesForPlayerScroll) --looks like it is not updating the 'totalLines' at the refresh function - playerScroll:SetHeight(linesForPlayerScroll * player_line_height) + playerScroll:SetHeight(linesForPlayerScroll * playerLineHeight) segmentsScroll:SetNumFramesShown(linesForSegmentsScroll) - segmentsScroll:SetHeight(linesForSegmentsScroll * player_line_height) + segmentsScroll:SetHeight(linesForSegmentsScroll * playerLineHeight) playerScroll:SetData(playerList) playerScroll:Refresh() @@ -786,13 +766,12 @@ function breakdownWindowPlayerList.CreatePlayerListFrame() local UID = combatObject:GetCombatUID() local combatName, r, g, b = combatObject:GetCombatName(true) - local combatIcon, combatSubIcon = combatObject:GetCombatIcon() + local combatIcon, categoryIcon = combatObject:GetCombatIcon() segmentsData[i] = { UID = UID, combatName = combatName, combatIcon = combatIcon, - combatIcon2 = combatSubIcon, r = r or 1, g = g or 1, b = b or 1, @@ -826,4 +805,8 @@ function Details.PlayerBreakdown.CreatePlayerListFrame() breakdownWindowPlayerList.CreatePlayerListFrame() Details.PlayerBreakdown.playerListFrameCreated = true end +end + +function Details222.BreakdownWindow.RefreshScrolls() + Details:UpdateBreakdownPlayerList() end \ No newline at end of file diff --git a/frames/window_breakdown/window_playerbreakdown_spells.lua b/frames/window_breakdown/window_playerbreakdown_spells.lua index 06b6cf81..cdf50762 100644 --- a/frames/window_breakdown/window_playerbreakdown_spells.lua +++ b/frames/window_breakdown/window_playerbreakdown_spells.lua @@ -563,7 +563,7 @@ function spellsTab.OnCreateTabCallback(tabButton, tabFrame) --~init local optionsButton = DF:CreateButton(tabFrame, Details.OpenSpellBreakdownOptions, 130, 18, Loc["STRING_OPTIONS_PLUGINS_OPTIONS"], 14) --optionsButton:SetTemplate(DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) optionsButton:SetPoint("bottomright", tabFrame, "bottomright", -10, -19) - optionsButton:SetTemplate("OPTIONS_BUTTON_TEMPLATE") + optionsButton:SetTemplate("STANDARD_GRAY") optionsButton:SetIcon(Details:GetTextureAtlas("breakdown-icon-optionsbutton")) optionsButton.textsize = 12 optionsButton.textcolor = "DETAILS_STATISTICS_ICON" @@ -643,7 +643,7 @@ function spellsTab.OnCreateTabCallback(tabButton, tabFrame) --~init reportButton:SetPoint("right", optionsButton, "left", -5, 0) reportButton.textsize = 12 reportButton.textcolor = "DETAILS_STATISTICS_ICON" - reportButton:SetTemplate("OPTIONS_BUTTON_TEMPLATE") + reportButton:SetTemplate("STANDARD_GRAY") reportButton:SetIcon(Details:GetTextureAtlas("breakdown-icon-reportbutton")) reportButton:SetAlpha(0.834) diff --git a/frames/window_breakdown/window_playerbreakdown_spells_options.lua b/frames/window_breakdown/window_playerbreakdown_spells_options.lua index de4eb440..5c278918 100644 --- a/frames/window_breakdown/window_playerbreakdown_spells_options.lua +++ b/frames/window_breakdown/window_playerbreakdown_spells_options.lua @@ -1,5 +1,7 @@ local Details = Details + +---@type detailsframework local DF = DetailsFramework --create the main frame for the options panel @@ -27,6 +29,7 @@ local createOptionsPanel = function() DF:ApplyStandardBackdrop(optionsFrame, bUseSolidColor) local resetSettings = function() + --overwrite the settings for the spell frame for key, value in pairs (Details.default_global_data.breakdown_spell_tab) do if (type(value) == "table") then local t = DF.table.copy({}, value) @@ -36,6 +39,16 @@ local createOptionsPanel = function() end end + --overwrite the settings for the general frame + for key, value in pairs (Details.default_global_data.breakdown_general) do + if (type(value) == "table") then + local t = DF.table.copy({}, value) + Details.breakdown_general[key] = t + else + Details.breakdown_general[key] = value + end + end + local instanceObject = Details:GetActiveWindowFromBreakdownWindow() local actorObject = Details:GetActorObjectFromBreakdownWindow() local bFromAttributeChange = true @@ -60,6 +73,36 @@ local createOptionsPanel = function() local subSectionTitleTextTemplate = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE") local optionsTable = { + {type = "label", get = function() return "General Settings" end, text_template = subSectionTitleTextTemplate}, + --background color from setting Details.frame_background_color + { --background color + type = "color", + get = function() + local colorTable = Details.frame_background_color + return colorTable[1], colorTable[2], colorTable[3], colorTable[4] + end, + set = function(self, r, g, b, a) + local colorTable = Details.frame_background_color + + --/run Details.frame_background_color = {0.1215, 0.1176, 0.1294, 0.934} + + local normalizedRed = DF.Math.MapRangeClamped(0, 1, 0, 0.1215, r) + local normalizedGreen = DF.Math.MapRangeClamped(0, 1, 0, 0.1176, g) + local normalizedBlue = DF.Math.MapRangeClamped(0, 1, 0, 0.1294, b) + local normalizedAlpha = DF.Math.MapRangeClamped(0, 1, 0.8, 0.98, a) + + colorTable[1] = normalizedRed + colorTable[2] = normalizedGreen + colorTable[3] = normalizedBlue + colorTable[4] = normalizedAlpha + Details:SetBreakdownWindowColor(normalizedRed, normalizedGreen, normalizedBlue, normalizedAlpha) + end, + name = "Background Color", + desc = "Background Color", + }, + + {type = "blank"}, + {type = "label", get = function() return "Spell Details Block" end, text_template = subSectionTitleTextTemplate}, {--block height type = "range", @@ -76,7 +119,6 @@ local createOptionsPanel = function() }, {type = "blank"}, - {type = "blank"}, {type = "label", get = function() return "Spell Header Options" end, text_template = subSectionTitleTextTemplate}, { --per second @@ -167,6 +209,62 @@ local createOptionsPanel = function() desc = "Heal Absorbed", }, + {type = "blank"}, + + {type = "label", get = function() return "Text Options" end, text_template = subSectionTitleTextTemplate}, + { --font color + type = "color", + get = function() return Details.breakdown_general.font_color[1], Details.breakdown_general.font_color[2], Details.breakdown_general.font_color[3], Details.breakdown_general.font_color[4] end, + set = function(self, r, g, b, a) + local colorTable = Details.breakdown_general.font_color + colorTable[1] = r + colorTable[2] = g + colorTable[3] = b + colorTable[4] = a + Details:UpdateBreakdownPlayerList() + end, + name = "Text Color", + desc = "Text Color", + }, + + { --font size + type = "range", + get = function() return Details.breakdown_general.font_size end, + set = function(self, fixedparam, value) + Details.breakdown_general.font_size = value + Details:UpdateBreakdownPlayerList() + end, + min = 8, + max = 20, + step = 1, + name = "Text Size", + desc = "Text Size", + }, + + { --font outline + type = "outlinedropdown", + get = function() return Details.breakdown_general.font_outline end, + set = function(self, fixedparam, value) + Details.breakdown_general.font_outline = value + Details:UpdateBreakdownPlayerList() + end, + name = "Text Outline", + desc = "Text Outline", + }, + + {---font face + type = "fontdropdown", + get = function() return Details.breakdown_general.font_face end, + set = function(self, fixedparam, value) + Details.breakdown_general.font_face = value + Details:UpdateBreakdownPlayerList() + end, + name = "Font Face", + desc = "Font Face", + include_default = true, + }, + + {type = "breakline"}, {type = "label", get = function() return "Scroll Options" end, text_template = subSectionTitleTextTemplate}, diff --git a/frames/window_main.lua b/frames/window_main.lua index 0723c909..8b3b2444 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -6420,12 +6420,11 @@ local buildSegmentTooltip = function(self, deltaTime) if (combatType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASH or combatType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSSTRASH) then local combatName, r, g, b = thisCombat:GetCombatName() local broomStick = detailsFramework:CreateAtlasString(Details:GetTextureAtlas("segment-icon-broom")) - - --dumpt(mythicDungeonInfo) + local combatIcon, categoryIcon = thisCombat:GetCombatIcon() gameCooltip:AddLine(broomStick .. " " .. combatName, detailsFramework:IntegerToTimer(thisCombat:GetCombatTime()), 1, dungeonColor, combatTimeColor) local bDesaturated = false - gameCooltip:AddIcon(thisCombat:GetCombatIcon(), "main", "left", nil, nil, nil, nil, nil, nil, nil, nil, bDesaturated) + gameCooltip:AddIcon(categoryIcon, "main", "left", nil, nil, nil, nil, nil, nil, nil, nil, bDesaturated) --submenu gameCooltip:AddLine(Loc["STRING_SEGMENT_TRASH"], nil, 2, "white", "white") @@ -6452,7 +6451,8 @@ local buildSegmentTooltip = function(self, deltaTime) elseif (combatType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL) then gameCooltip:AddLine(thisCombat:GetCombatName(), detailsFramework:IntegerToTimer(endedAt - startedAt), 1, dungeonColor) - gameCooltip:AddIcon(thisCombat:GetCombatIcon(), "main", "left") + local combatIcon, categoryIcon = thisCombat:GetCombatIcon() + gameCooltip:AddIcon(categoryIcon, "main", "left") gameCooltip:AddStatusBar(100, 1, .5, .1, 0, 0.55, false, false, statusBarTexture) local timeInCombat = thisCombat:GetCombatTime() @@ -6483,6 +6483,8 @@ local buildSegmentTooltip = function(self, deltaTime) gameCooltip:AddStatusBar(100, 2, 0, 0, 0, 0.25, false, false, statusBarTexture) end + local combatIcon, categoryIcon = thisCombat:GetCombatIcon() + local skull = "|TInterface\\AddOns\\Details\\images\\icons:16:16:0:0:512:512:496:512:0:16|t" local skullIcon = detailsFramework:CreateAtlasString(Details:GetTextureAtlas("segment-icon-boss")) @@ -6490,7 +6492,7 @@ local buildSegmentTooltip = function(self, deltaTime) local combatName, combatColor = thisCombat:GetCombatName() local r, g, b, a = detailsFramework:ParseColors(combatColor) gameCooltip:AddLine(skullIcon .. " " .. combatName, detailsFramework:IntegerToTimer(elapsedCombatTime), 1, dungeonColor, combatTimeColor) - gameCooltip:AddIcon(thisCombat:GetCombatIcon(), "main", "left") + gameCooltip:AddIcon(categoryIcon, "main", "left") addIconAndStatusBar() --sub cooltip frame @@ -6579,7 +6581,10 @@ local buildSegmentTooltip = function(self, deltaTime) local tryNumber = thisCombat:GetTryNumber() local combatTime = thisCombat:GetCombatTime() local combatInstanceType = thisCombat:GetInstanceType() - local combatName, r, g, b = thisCombat:GetCombatName() + local bOnlyName = true + local combatName, r, g, b = thisCombat:GetCombatName(bOnlyName) + + local combatIcon, categoryIcon = thisCombat:GetCombatIcon() if (combatInstanceType == "party") then gameCooltip:AddLine(combatName, formattedElapsedTime, 1, dungeonColor, combatTimeColor) @@ -6587,16 +6592,16 @@ local buildSegmentTooltip = function(self, deltaTime) elseif (bossInfo.killed) then gameCooltip:AddLine(combatName, formattedElapsedTime, 1, "lime", combatTimeColor) else - gameCooltip:AddLine(combatName, formattedElapsedTime, 1, "red", combatTimeColor) + gameCooltip:AddLine(combatName, formattedElapsedTime, 1, "orange", combatTimeColor) end + gameCooltip:AddIcon(combatIcon, "main", "left") + local portrait = thisCombat:GetBossImage() if (portrait) then gameCooltip:AddIcon(portrait, 2, "top", 128, 64) end - gameCooltip:AddIcon(thisCombat:GetCombatIcon(), "main", "left") - if (Details.tooltip.submenu_wallpaper) then local background = Details:GetRaidIcon(bossInfo.mapid) if (background and bCanUseBackgroundImage) then diff --git a/frames/window_mythicplus/window_end_of_run.lua b/frames/window_mythicplus/window_end_of_run.lua index c2e47464..acb7537d 100644 --- a/frames/window_mythicplus/window_end_of_run.lua +++ b/frames/window_mythicplus/window_end_of_run.lua @@ -896,7 +896,7 @@ function mythicDungeonFrames.ShowEndOfMythicPlusPanel() local elapsedTime = Details222.MythicPlus.time or 1507 readyFrame.ElapsedTimeAmountLabel.text = DetailsFramework:IntegerToTimer(elapsedTime) - C_Timer.After(1.5, function() + C_Timer.After(2.5, function() --print("overall combat type:", overallMythicDungeonCombat:GetCombatType(), overallMythicDungeonCombat:GetCombatType() == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL) if (overallMythicDungeonCombat:GetCombatType() == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL) then local combatTime = overallMythicDungeonCombat:GetCombatTime() diff --git a/frames/window_report.lua b/frames/window_report.lua index c4aafe85..cbe112d3 100644 --- a/frames/window_report.lua +++ b/frames/window_report.lua @@ -839,11 +839,12 @@ local createDropdown = function(thisFrame) local flashTexture = window:CreateTexture(nil, "background") flashTexture:SetColorTexture(1, 1, 1) - flashTexture:SetAllPoints() + flashTexture:SetPoint("topleft", window, "topleft", -2, 2) + flashTexture:SetPoint("bottomright", window, "bottomright", 2, -2) local onShowAnimation = DetailsFramework:CreateAnimationHub(flashTexture, function() flashTexture:Show() end, function() flashTexture:Hide() end) - DetailsFramework:CreateAnimation(onShowAnimation, "ALPHA", 1, .2, 0, .10) - DetailsFramework:CreateAnimation(onShowAnimation, "ALPHA", 2, .2, .10, 0) + DetailsFramework:CreateAnimation(onShowAnimation, "ALPHA", 1, .4, 0, .90) + DetailsFramework:CreateAnimation(onShowAnimation, "ALPHA", 2, .4, .90, 0) window:SetScript("OnShow", function(self) local dropdown = window.select.MyObject @@ -882,6 +883,8 @@ local createDropdown = function(thisFrame) end window:RefreshRecentlyReported() + + window:SetColor(unpack(Details.frame_background_color)) end) window:SetScript("OnHide", function(self) diff --git a/functions/profiles.lua b/functions/profiles.lua index 4eeb8f69..9df54d00 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -1443,6 +1443,15 @@ local default_global_data = { }, }, + breakdown_general = { + font_size = 11, + font_color = {0.9, 0.9, 0.9, 0.923}, + font_outline = "NONE", + font_face = "DEFAULT", + }, + + frame_background_color = {0.1215, 0.1176, 0.1294, 0.8}, + --/run Details.breakdown_spell_tab.spellcontainer_height = 311 --352 --breakdown spell tab breakdown_spell_tab = { diff --git a/textures.lua b/textures.lua index d1c20020..27b4bebf 100644 --- a/textures.lua +++ b/textures.lua @@ -113,6 +113,48 @@ Details.TextureAtlas = { nativeHeight = 512, }, + ["segment-icon-mythicraid"] = { + file = [[interface/hud/uiguildbanner2x]], + width = 12, + height = 12, + leftTexCoord = 0.57421875, + rightTexCoord = 0.69921875, + topTexCoord = 0.13671875, + bottomTexCoord = 0.26171875, + tilesHorizontally = false, + tilesVertically = false, + nativeWidth = 256, + nativeHeight = 256, + }, + + ["segment-icon-heroicraid"] = { + file = [[interface/hud/uiguildbanner2x]], + width = 12, + height = 12, + leftTexCoord = 0.57421875, + rightTexCoord = 0.69921875, + topTexCoord = 0.00390625, + bottomTexCoord = 0.12890625, + tilesHorizontally = false, + tilesVertically = false, + nativeWidth = 256, + nativeHeight = 256, + }, + + ["segment-icon-normalraid"] = { + file = [[interface/hud/uiguildbanner]], + width = 12, + height = 12, + leftTexCoord = 0.70703125, + rightTexCoord = 0.83203125, + topTexCoord = 0.00390625, + bottomTexCoord = 0.12890625, + tilesHorizontally = false, + tilesVertically = false, + nativeWidth = 128, + nativeHeight = 128, + }, + ["segment-icon-regular"] = { file = [[Interface\QUESTFRAME\UI-Quest-BulletPoint]], width = 16,