From 9605299be0f2a0b356b6c19fdb90eedc6b2b41dd Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Sat, 1 Jun 2024 12:52:52 -0300 Subject: [PATCH] Added tranliterate into the icon tooltip --- Libs/DF/definitions.lua | 2 +- Libs/DF/fw.lua | 3 ++- Libs/DF/label.lua | 5 +++++ Libs/DF/picture.lua | 2 +- frames/window_main.lua | 9 ++++++++- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Libs/DF/definitions.lua b/Libs/DF/definitions.lua index fb172eef..d40be5bd 100644 --- a/Libs/DF/definitions.lua +++ b/Libs/DF/definitions.lua @@ -301,7 +301,7 @@ ---@field ParseTexture fun(self:table, texture:texturepath|textureid|atlasname|atlasinfo, width: number?, height: number?, leftTexCoord: number?, rightTexCoord: number?, topTexCoord: number?, bottomTexCoord: number?, vertexRed:number|string?, vertexGreenvertexRed:number?, vertexBluevertexRed:number?, vertexAlphavertexRed:number?) : any, number?, number?, number?, number?, number?, number?, number?, number?, number?, number?, number?, number? ---@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|table) : nil +---@field SetMask fun(self:table, texture:texture, maskTexture:atlasname|texturepath|textureid|table|string) : nil ---@field GetClientRegion fun(self:table) : string ---@field GetBestFontPathForLanguage fun(self:table, languageId:string) : string ---@field SetTemplate fun(self:table, frame:uiobject, template:string) diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 93c9a7d3..d47a87dd 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,6 +1,6 @@ -local dversion = 537 +local dversion = 538 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary(major, minor) @@ -2865,6 +2865,7 @@ end --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()} DF.font_templates["OPTIONS_FONT_TEMPLATE"] = {color = "yellow", size = 9.6, font = DF:GetBestFontForLanguage()} +DF.font_templates["SMALL_SILVER"] = {color = "silver", size = 9, font = DF:GetBestFontForLanguage()} --dropdowns DF.dropdown_templates = DF.dropdown_templates or {} diff --git a/Libs/DF/label.lua b/Libs/DF/label.lua index 0c04a82a..e0ac023b 100644 --- a/Libs/DF/label.lua +++ b/Libs/DF/label.lua @@ -408,6 +408,11 @@ function detailsFramework:NewLabel(parent, container, name, member, text, font, --if template has been passed as the third parameter if (size and type(size) == "table") then labelObject:SetTemplate(size) + + --check if a template was passed as the 3rd argument + elseif (size and type(size) == "string") then + local template = detailsFramework:ParseTemplate(labelObject.type, size) + labelObject:SetTemplate(template) end return labelObject diff --git a/Libs/DF/picture.lua b/Libs/DF/picture.lua index 15fdb306..7c653807 100644 --- a/Libs/DF/picture.lua +++ b/Libs/DF/picture.lua @@ -716,7 +716,7 @@ function detailsFramework:SetMask(texture, maskTexture) if (not texture.MaskTexture) then local parent = texture:GetParent() local maskTextureObject = parent:CreateMaskTexture(nil, "artwork") - maskTextureObject:SetAllPoints(texture) + maskTextureObject:SetAllPoints(texture.widget or texture) texture:AddMaskTexture(maskTextureObject) texture.MaskTexture = maskTextureObject end diff --git a/frames/window_main.lua b/frames/window_main.lua index ba964001..d7f2ff6a 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -2106,7 +2106,14 @@ local iconFrame_OnEnter = function(self) end end - GameCooltip:AddLine(name, specName) + if (instance.row_info.textL_translit_text) then + --translate cyrillic alphabet to western alphabet by Vardex (https://github.com/Vardex May 22, 2019) + local Translit = LibStub("LibTranslit-1.0") + GameCooltip:AddLine(Translit:Transliterate(name, "!"), specName) + else + GameCooltip:AddLine(name, specName) + end + if (class == "UNKNOW" or class == "UNGROUPPLAYER") then GameCooltip:AddIcon([[Interface\AddOns\Details\images\classes_small_alpha]], 1, 1, iconSize, iconSize, 0, 0.25, 0.75, 1) else