From 4fe002cf18309212b1322b052f7d4618a5e6c8c6 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Fri, 30 Jul 2021 20:22:07 -0300 Subject: [PATCH] Added Transliterate to healing tooltips, fixed some close buttons with green boxes --- classes/class_heal.lua | 58 +++++++++--------------------------- frames/window_custom.lua | 16 +++++----- frames/window_options2.lua | 4 ++- frames/window_statistics.lua | 23 ++++++++++++-- frames/window_wa.lua | 14 +++++---- 5 files changed, 54 insertions(+), 61 deletions(-) diff --git a/classes/class_heal.lua b/classes/class_heal.lua index b033edab..29fc6d63 100644 --- a/classes/class_heal.lua +++ b/classes/class_heal.lua @@ -1271,7 +1271,14 @@ function atributo_heal:ToolTip_HealingTaken (instancia, numero, barra, keydown) local lineHeight = _detalhes.tooltip.line_height for i = 1, _math_min (max, #meus_curadores) do - GameCooltip:AddLine (_detalhes:GetOnlyName (meus_curadores[i][1]), FormatTooltipNumber (_, meus_curadores[i][2]).." (".._cstr ("%.1f", (meus_curadores[i][2]/total_curado) * 100).."%)") + + local onyName = _detalhes:GetOnlyName(meus_curadores[i][1]) + --translate cyrillic alphabet to western alphabet by Vardex (https://github.com/Vardex May 22, 2019) + if (instancia.row_info.textL_translit_text) then + onyName = Translit:Transliterate(onyName, "!") + end + + GameCooltip:AddLine (onyName, FormatTooltipNumber (_, meus_curadores[i][2]).." (".._cstr ("%.1f", (meus_curadores[i][2]/total_curado) * 100).."%)") local classe = meus_curadores[i][3] if (not classe) then classe = "UNKNOW" @@ -1372,6 +1379,12 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) ActorSkillsContainer = self.targets for target_name, amount in _pairs (ActorSkillsContainer) do if (amount > 0) then + + --translate cyrillic alphabet to western alphabet by Vardex (https://github.com/Vardex May 22, 2019) + if (instancia.row_info.textL_translit_text) then + target_name = Translit:Transliterate(target_name, "!") + end + _table_insert (ActorHealingTargets, {target_name, amount, amount / ActorTotal * 100}) end end @@ -1591,7 +1604,6 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, icon_size.W, icon_size.H, 0.25, 0.49609375, 0.75, 1) end end - end --> ~Phases @@ -1642,48 +1654,6 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) end end - --> absorbs vs heal - --[=[ - if (instancia.sub_atributo == 1 or instancia.sub_atributo == 2) then - local total_healed = self.total - self.totalabsorb - local total_previned = self.totalabsorb - - local healed_percentage = total_healed / self.total * 100 - local previned_percentage = total_previned / self.total * 100 - - if (healed_percentage > 1 and previned_percentage > 1) then - GameCooltip:AddLine (_math_floor (healed_percentage).."%", _math_floor (previned_percentage).."%") - local r, g, b = _unpack (_detalhes.class_colors [self.classe]) - background_heal_vs_absorbs.color[1] = r - background_heal_vs_absorbs.color[2] = g - background_heal_vs_absorbs.color[3] = b - background_heal_vs_absorbs.specialSpark = false - GameCooltip:AddStatusBar (healed_percentage, 1, r, g, b, .9, false, background_heal_vs_absorbs) - GameCooltip:AddIcon ([[Interface\ICONS\Ability_Priest_ReflectiveShield]], 1, 2, 14, 14, 0.0625, 0.9375, 0.0625, 0.9375) - GameCooltip:AddIcon ([[Interface\ICONS\Ability_Monk_ChiWave]], 1, 1, 14, 14, 0.9375, 0.0625, 0.0625, 0.9375) - end - - elseif (instancia.sub_atributo == 3) then - local total_healed = self.total - local total_overheal = self.totalover - local both = total_healed + total_overheal - - local healed_okey = total_healed / both * 100 - local healed_disposed = total_overheal / both * 100 - - if (healed_okey > 1 and healed_disposed > 1) then - GameCooltip:AddLine (_math_floor (healed_okey).."%", _math_floor (healed_disposed).."%") - background_heal_vs_absorbs.color[1] = 1 - background_heal_vs_absorbs.color[2] = 0 - background_heal_vs_absorbs.color[3] = 0 - background_heal_vs_absorbs.specialSpark = false - GameCooltip:AddStatusBar (healed_okey, 1, 0, 1, 0, .9, false, background_heal_vs_absorbs) - GameCooltip:AddIcon ([[Interface\Scenarios\ScenarioIcon-Check]], 1, 1, 14, 14, 0, 1, 0, 1) - GameCooltip:AddIcon ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]], 1, 2, 14, 14, 1, 0, 0, 1) - end - end - --]=] - return true end diff --git a/frames/window_custom.lua b/frames/window_custom.lua index 2e66dda2..f1c404a8 100644 --- a/frames/window_custom.lua +++ b/frames/window_custom.lua @@ -158,7 +158,7 @@ if (not _G.DetailsCustomPanel or not DetailsCustomPanel.Initialized) then - DetailsPluginContainerWindow.OpenPlugin (DetailsCustomPanel) + DetailsPluginContainerWindow.OpenPlugin (DetailsCustomPanel) local GameCooltip = GameCooltip DetailsCustomPanel.Initialized = true @@ -214,12 +214,14 @@ f.Close = CreateFrame ("button", "$parentCloseButton", f) f.Close:SetPoint ("right", titlebar, "right", -2, 0) f.Close:SetSize (16, 16) - f.Close:SetNormalTexture (_detalhes.gump.folder .. "icons") - f.Close:SetHighlightTexture (_detalhes.gump.folder .. "icons") - f.Close:SetPushedTexture (_detalhes.gump.folder .. "icons") - f.Close:GetNormalTexture():SetTexCoord (0, 16/128, 0, 1) - f.Close:GetHighlightTexture():SetTexCoord (0, 16/128, 0, 1) - f.Close:GetPushedTexture():SetTexCoord (0, 16/128, 0, 1) + + f.Close:SetNormalTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + f.Close:SetHighlightTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + f.Close:SetPushedTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + f.Close:GetNormalTexture():SetDesaturated(true) + f.Close:GetHighlightTexture():SetDesaturated(true) + f.Close:GetPushedTexture():SetDesaturated(true) + f.Close:SetAlpha (0.7) f.Close:SetScript ("OnClick", function() _detalhes:CloseCustomDisplayWindow() end) f.Close:SetScript ("OnHide", function() diff --git a/frames/window_options2.lua b/frames/window_options2.lua index 0559e511..c1e8eda3 100644 --- a/frames/window_options2.lua +++ b/frames/window_options2.lua @@ -53,7 +53,7 @@ function Details.options.InitializeOptionsWindow(instance) Details:FormatBackground(f) DF:ApplyStandardBackdrop (f) - local titleBar = DF:CreateTitleBar (f, "Options Panel") + local titleBar = DF:CreateTitleBar(f, "Options Panel") titleBar.Text:Hide() local titleText = DF:NewLabel(titleBar, nil, "$parentTitleLabel", "title", "Details! " .. Loc ["STRING_OPTIONS_WINDOW"], "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) @@ -65,12 +65,14 @@ function Details.options.InitializeOptionsWindow(instance) DF:CreateScaleBar(DetailsOptionsWindow, Details.options_window) DetailsOptionsWindow:SetScale (Details.options_window.scale) + --[=[]] local closeButton = CreateFrame("button", "DetailsOptionsWindowCloseButton", DetailsOptionsWindow.widget, "UIPanelCloseButton") closeButton:SetWidth(32) closeButton:SetHeight(32) --closeButton:SetPoint("TOPRIGHT", DetailsOptionsWindow.widget, "TOPRIGHT", 0, 0) closeButton:SetText("X") closeButton:SetFrameLevel(closeButton:GetFrameLevel()+2) +--]=] --select the instance to edit local onSelectInstance = function (_, _, instanceId) diff --git a/frames/window_statistics.lua b/frames/window_statistics.lua index 7179a741..90d9fb30 100644 --- a/frames/window_statistics.lua +++ b/frames/window_statistics.lua @@ -64,6 +64,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild f:SetBackdropBorderColor (0, 0, 0, 1) --> menu title bar + --[=[]] local titlebar = CreateFrame ("frame", nil, f,"BackdropTemplate") titlebar:SetPoint ("topleft", f, "topleft", 2, -3) titlebar:SetPoint ("topright", f, "topright", -2, -3) @@ -71,24 +72,40 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild titlebar:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) titlebar:SetBackdropColor (.5, .5, .5, 1) titlebar:SetBackdropBorderColor (0, 0, 0, 1) + --]=] + + local titlebar = DF:CreateTitleBar(f, "Details! " .. Loc ["STRING_STATISTICS"]) --> menu title - local titleLabel = DF:NewLabel (titlebar, titlebar, nil, "titulo", "Details! " .. Loc ["STRING_STATISTICS"], "GameFontNormal", 12) --{227/255, 186/255, 4/255} - titleLabel:SetPoint ("center", titlebar , "center") - titleLabel:SetPoint ("top", titlebar , "top", 0, -4) + -- local titleLabel = DF:NewLabel (titlebar, titlebar, nil, "titulo", "Details! " .. Loc ["STRING_STATISTICS"], "GameFontNormal", 12) --{227/255, 186/255, 4/255} + -- titleLabel:SetPoint ("center", titlebar , "center") + -- titleLabel:SetPoint ("top", titlebar , "top", 0, -4) --> close button + --[=[]] f.Close = CreateFrame ("button", "$parentCloseButton", f) f.Close:SetPoint ("right", titlebar, "right", -2, 0) f.Close:SetSize (16, 16) + f.Close:SetNormalTexture (DF.folder .. "icons") f.Close:SetHighlightTexture (DF.folder .. "icons") f.Close:SetPushedTexture (DF.folder .. "icons") + f.Close:GetNormalTexture():SetTexCoord (0, 16/128, 0, 1) f.Close:GetHighlightTexture():SetTexCoord (0, 16/128, 0, 1) f.Close:GetPushedTexture():SetTexCoord (0, 16/128, 0, 1) f.Close:SetAlpha (0.7) f.Close:SetScript ("OnClick", function() f:Hide() end) +--]=] + --[=[]] + local closeButton = CreateFrame("button", "DetailsStatisticsWindowCloseButton", titlebar, "UIPanelCloseButton") + closeButton:SetWidth(32) + closeButton:SetHeight(32) + closeButton:SetText("X") + closeButton:SetFrameLevel(closeButton:GetFrameLevel()+2) + + f.Close = closeButton +--]=] if (not Details:GetTutorialCVar ("HISTORYPANEL_TUTORIAL")) then local tutorialFrame = CreateFrame ("frame", "$parentTutorialFrame",f,"BackdropTemplate") diff --git a/frames/window_wa.lua b/frames/window_wa.lua index ccddb553..99ec1229 100644 --- a/frames/window_wa.lua +++ b/frames/window_wa.lua @@ -2027,12 +2027,14 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr f.Close = CreateFrame ("button", "$parentCloseButton", f, "BackdropTemplate") f.Close:SetPoint ("right", f.TitleBar, "right", -2, 0) f.Close:SetSize (16, 16) - f.Close:SetNormalTexture (_detalhes.gump.folder .. "icons") - f.Close:SetHighlightTexture (_detalhes.gump.folder .. "icons") - f.Close:SetPushedTexture (_detalhes.gump.folder .. "icons") - f.Close:GetNormalTexture():SetTexCoord (0, 16/128, 0, 1) - f.Close:GetHighlightTexture():SetTexCoord (0, 16/128, 0, 1) - f.Close:GetPushedTexture():SetTexCoord (0, 16/128, 0, 1) + + f.Close:SetNormalTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + f.Close:SetHighlightTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + f.Close:SetPushedTexture ([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) + f.Close:GetNormalTexture():SetDesaturated(true) + f.Close:GetHighlightTexture():SetDesaturated(true) + f.Close:GetPushedTexture():SetDesaturated(true) + f.Close:SetAlpha (0.7) f.Close:SetScript ("OnClick", function() f:Hide() end)