Skip to content

Commit

Permalink
Added Transliterate to healing tooltips, fixed some close buttons wit…
Browse files Browse the repository at this point in the history
…h green boxes
  • Loading branch information
Tercioo committed Jul 30, 2021
1 parent b32a48d commit 4fe002c
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 61 deletions.
58 changes: 14 additions & 44 deletions classes/class_heal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
16 changes: 9 additions & 7 deletions frames/window_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 3 additions & 1 deletion frames/window_options2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -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)
Expand Down
23 changes: 20 additions & 3 deletions frames/window_statistics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,48 @@ 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)
titlebar:SetHeight (20)
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")
Expand Down
14 changes: 8 additions & 6 deletions frames/window_wa.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 4fe002c

Please sign in to comment.