diff --git a/boot.lua b/boot.lua index d24c11a6..d4f69536 100644 --- a/boot.lua +++ b/boot.lua @@ -4,9 +4,9 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0", "LibHotCorners") - _detalhes.version = "v1.18.5 (core 22)" - _detalhes.userversion = "v1.18.5" - _detalhes.build_counter = 8 + _detalhes.version = "v1.18.6 (core 22)" + _detalhes.userversion = "v1.18.6" + _detalhes.build_counter = 9 _detalhes.realversion = 22 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/classes/classe_custom.lua b/classes/classe_custom.lua index f9050fec..eccb8353 100644 --- a/classes/classe_custom.lua +++ b/classes/classe_custom.lua @@ -50,6 +50,7 @@ local ToKFunctions = _detalhes.ToKFunctions local SelectedToKFunction = ToKFunctions [1] local UsingCustomRightText = false + local UsingCustomLeftText = false local FormatTooltipNumber = ToKFunctions [8] local TooltipMaximizedMethod = 1 @@ -168,6 +169,7 @@ end local percentage_type = instance.row_info.percent_type local combat_time = combat:GetCombatTime() + UsingCustomLeftText = instance.row_info.textL_enable_custom_text UsingCustomRightText = instance.row_info.textR_enable_custom_text --> total bar @@ -882,15 +884,34 @@ end esta_barra.icone_classe:SetVertexColor (1, 1, 1) end + --texture and text + + local bar_number = "" + if (instancia.row_info.textL_show_number) then + bar_number = esta_barra.colocacao .. ". " + end + if (self.enemy) then if (self.arena_enemy) then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao .. ".|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + end esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) else if (_detalhes.faction_against == "Horde") then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA + end else - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t"..self.displayName) --seta o texto da esqueda -- ALLY + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t"..self.displayName) --seta o texto da esqueda -- ALLY + end end if (instancia.row_info.texture_class_colors) then @@ -899,9 +920,17 @@ end end else if (self.arena_ally) then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao .. ".|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + end else - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". "..self.displayName) --seta o texto da esqueda + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. self.displayName) --seta o texto da esqueda + end end end diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index ea9bb0dd..5ec578b3 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -48,7 +48,10 @@ local ToKFunctions = _detalhes.ToKFunctions local SelectedToKFunction = ToKFunctions [1] + + local UsingCustomLeftText = false local UsingCustomRightText = false + local FormatTooltipNumber = ToKFunctions [8] local TooltipMaximizedMethod = 1 @@ -977,6 +980,8 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex end local combat_time = instancia.showing:GetCombatTime() + + UsingCustomLeftText = instancia.row_info.textL_enable_custom_text UsingCustomRightText = instancia.row_info.textR_enable_custom_text local use_total_bar = false @@ -1425,15 +1430,32 @@ end --texture and text + local bar_number = "" + if (instancia.row_info.textL_show_number) then + bar_number = esta_barra.colocacao .. ". " + end + if (self.enemy) then if (self.arena_enemy) then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao .. ".|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + end esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) else if (_detalhes.faction_against == "Horde") then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA + end else - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t"..self.displayName) --seta o texto da esqueda -- ALLY + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t"..self.displayName) --seta o texto da esqueda -- ALLY + end end if (instancia.row_info.texture_class_colors) then @@ -1442,9 +1464,17 @@ end end else if (self.arena_ally) then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao .. ".|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + end else - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". "..self.displayName) --seta o texto da esqueda + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. self.displayName) --seta o texto da esqueda + end end end diff --git a/classes/classe_energy.lua b/classes/classe_energy.lua index c634b3f1..7d2543ab 100644 --- a/classes/classe_energy.lua +++ b/classes/classe_energy.lua @@ -59,6 +59,7 @@ local div_lugar = _detalhes.divisores.colocacao local ToKFunctions = _detalhes.ToKFunctions local SelectedToKFunction = ToKFunctions [1] +local UsingCustomLeftText = false local UsingCustomRightText = false local FormatTooltipNumber = ToKFunctions [8] @@ -284,6 +285,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex local percentage_type = instancia.row_info.percent_type local combat_time = instancia.showing:GetCombatTime() + UsingCustomLeftText = instancia.row_info.textL_enable_custom_text UsingCustomRightText = instancia.row_info.textR_enable_custom_text local use_total_bar = false @@ -578,15 +580,34 @@ function atributo_energy:RefreshBarra (esta_barra, instancia, from_resize) esta_barra.icone_classe:SetVertexColor (1, 1, 1) end + --texture and text + + local bar_number = "" + if (instancia.row_info.textL_show_number) then + bar_number = esta_barra.colocacao .. ". " + end + if (self.enemy) then if (self.arena_enemy) then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao .. ".|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + end esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) else if (_detalhes.faction_against == "Horde") then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA + end else - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t"..self.displayName) --seta o texto da esqueda -- ALLY + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t"..self.displayName) --seta o texto da esqueda -- ALLY + end end if (instancia.row_info.texture_class_colors) then @@ -595,9 +616,17 @@ function atributo_energy:RefreshBarra (esta_barra, instancia, from_resize) end else if (self.arena_ally) then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao .. ".|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + end else - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". "..self.displayName) --seta o texto da esqueda + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. self.displayName) --seta o texto da esqueda + end end end diff --git a/classes/classe_heal.lua b/classes/classe_heal.lua index 5e039fc1..d080eabb 100644 --- a/classes/classe_heal.lua +++ b/classes/classe_heal.lua @@ -59,6 +59,7 @@ local div_lugar = _detalhes.divisores.colocacao local ToKFunctions = _detalhes.ToKFunctions local SelectedToKFunction = ToKFunctions [1] local UsingCustomRightText = false +local UsingCustomLeftText = false local FormatTooltipNumber = ToKFunctions [8] local TooltipMaximizedMethod = 1 @@ -367,6 +368,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo --print (sub_atributo, total, keyName) local combat_time = instancia.showing:GetCombatTime() + UsingCustomLeftText = instancia.row_info.textL_enable_custom_text UsingCustomRightText = instancia.row_info.textR_enable_custom_text local use_total_bar = false @@ -452,10 +454,12 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type) --> instância, index, total, valor da 1º barra qual_barra = qual_barra+1 end - - end + if (_detalhes.is_using_row_animations) then + instancia:fazer_animacoes() + end + if (instancia.atributo == 5) then --> custom --> zerar o .custom dos Actors for index, player in _ipairs (conteudo) do @@ -664,7 +668,15 @@ function atributo_heal:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then - esta_barra.statusbar:SetValue (esta_porcentagem) + --esta_barra.statusbar:SetValue (esta_porcentagem) + + if (_detalhes.is_using_row_animations and not forcar) then + esta_barra.animacao_fim = esta_porcentagem + else + esta_barra.statusbar:SetValue (esta_porcentagem) + esta_barra.animacao_ignorar = true + end + gump:Fade (esta_barra, "out") if (instancia.row_info.texture_class_colors) then @@ -672,7 +684,7 @@ function atributo_heal:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo end if (instancia.row_info.texture_background_class_color) then esta_barra.background:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) - end + end return self:RefreshBarra (esta_barra, instancia) @@ -680,31 +692,26 @@ function atributo_heal:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo --> agora esta comparando se a tabela da barra é diferente da tabela na atualização anterior if (not tabela_anterior or tabela_anterior ~= esta_barra.minha_tabela or forcar) then --> aqui diz se a barra do jogador mudou de posição ou se ela apenas será atualizada - esta_barra.statusbar:SetValue (esta_porcentagem) + if (_detalhes.is_using_row_animations and not forcar) then + esta_barra.animacao_fim = esta_porcentagem + else + esta_barra.statusbar:SetValue (esta_porcentagem) + esta_barra.animacao_ignorar = true + end esta_barra.last_value = esta_porcentagem --> reseta o ultimo valor da barra - if (_detalhes.is_using_row_animations and forcar) then - esta_barra.tem_animacao = 0 - esta_barra:SetScript ("OnUpdate", nil) - end + --if (_detalhes.is_using_row_animations and forcar) then + -- esta_barra.tem_animacao = false + -- esta_barra:SetScript ("OnUpdate", nil) + --end return self:RefreshBarra (esta_barra, instancia) elseif (esta_porcentagem ~= esta_barra.last_value) then --> continua mostrando a mesma tabela então compara a porcentagem --> apenas atualizar if (_detalhes.is_using_row_animations) then - - local upRow = barras_container [qual_barra-1] - if (upRow) then - if (upRow.statusbar:GetValue() < esta_barra.statusbar:GetValue()) then - esta_barra.statusbar:SetValue (esta_porcentagem) - else - instancia:AnimarBarra (esta_barra, esta_porcentagem) - end - else - instancia:AnimarBarra (esta_barra, esta_porcentagem) - end + esta_barra.animacao_fim = esta_porcentagem else esta_barra.statusbar:SetValue (esta_porcentagem) end @@ -727,11 +734,25 @@ function atributo_heal:RefreshBarra (esta_barra, instancia, from_resize) end if (instancia.row_info.texture_background_class_color) then esta_barra.background:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) - end + end - if (self.classe == "UNKNOW") then - esta_barra.icone_classe:SetTexture ("Interface\\LFGFRAME\\LFGROLE_BW") - esta_barra.icone_classe:SetTexCoord (.25, .5, 0, 1) + --icon + + if (self.spellicon) then + esta_barra.icone_classe:SetTexture (self.spellicon) + esta_barra.icone_classe:SetTexCoord (0.078125, 0.921875, 0.078125, 0.921875) + esta_barra.icone_classe:SetVertexColor (1, 1, 1) + + elseif (self.classe == "UNKNOW") then + --esta_barra.icone_classe:SetTexture ("Interface\\LFGFRAME\\LFGROLE") + --esta_barra.icone_classe:SetTexCoord (.25, .5, 0, 1) + + --esta_barra.icone_classe:SetTexture ([[Interface\TARGETINGFRAME\PetBadge-Undead]]) + --esta_barra.icone_classe:SetTexCoord (0.09375, 0.90625, 0.09375, 0.90625) + + esta_barra.icone_classe:SetTexture ([[Interface\AddOns\Details\images\classes_plus]]) + esta_barra.icone_classe:SetTexCoord (0.50390625, 0.62890625, 0, 0.125) + esta_barra.icone_classe:SetVertexColor (1, 1, 1) elseif (self.classe == "UNGROUPPLAYER") then @@ -764,16 +785,35 @@ function atributo_heal:RefreshBarra (esta_barra, instancia, from_resize) esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [self.classe])) --very slow method esta_barra.icone_classe:SetVertexColor (1, 1, 1) end + + --texture and text + + local bar_number = "" + if (instancia.row_info.textL_show_number) then + bar_number = esta_barra.colocacao .. ". " + end if (self.enemy) then if (self.arena_enemy) then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao .. ".|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + end esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) else if (_detalhes.faction_against == "Horde") then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA + end else - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t"..self.displayName) --seta o texto da esqueda -- ALLY + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t"..self.displayName) --seta o texto da esqueda -- ALLY + end end if (instancia.row_info.texture_class_colors) then @@ -782,19 +822,20 @@ function atributo_heal:RefreshBarra (esta_barra, instancia, from_resize) end else if (self.arena_ally) then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao .. ".|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + end else - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". "..self.displayName) --seta o texto da esqueda + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. self.displayName) --seta o texto da esqueda + end end end - if (instancia.row_info.textL_class_colors) then - esta_barra.texto_esquerdo:SetTextColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) - end - if (instancia.row_info.textR_class_colors) then - esta_barra.texto_direita:SetTextColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) - end - esta_barra.texto_esquerdo:SetSize (esta_barra:GetWidth() - esta_barra.texto_direita:GetStringWidth() - 20, 15) end diff --git a/classes/classe_instancia_include.lua b/classes/classe_instancia_include.lua index 9e4b6d1c..a37d0b93 100644 --- a/classes/classe_instancia_include.lua +++ b/classes/classe_instancia_include.lua @@ -3,8 +3,12 @@ local _detalhes = _G._detalhes local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") function _detalhes:ResetInstanceConfig() - for key, value in pairs (table_deepcopy (_detalhes.instance_defaults)) do - self [key] = value + for key, value in pairs (_detalhes.instance_defaults) do + if (type (value) == "table") then + self [key] = table_deepcopy (value) + else + self [key] = value + end end end @@ -107,9 +111,15 @@ _detalhes.instance_defaults = { textL_class_colors = false, --right text class color textR_class_colors = false, - --right text informations + --left text customization + textL_enable_custom_text = false, + textL_custom_text = "{data1}. {data3}{data2}", + --right text customization textR_enable_custom_text = false, textR_custom_text = "{data1} ({data2}, {data3}%)", + --left text bar number + textL_show_number = true, + --if text class color are false, this color will be used fixed_text_color = {1, 1, 1}, --left text outline effect diff --git a/classes/classe_others.lua b/classes/classe_others.lua index d333d843..31d80cfb 100644 --- a/classes/classe_others.lua +++ b/classes/classe_others.lua @@ -60,6 +60,7 @@ local div_lugar = _detalhes.divisores.colocacao local ToKFunctions = _detalhes.ToKFunctions local SelectedToKFunction = ToKFunctions [1] +local UsingCustomLeftText = false local UsingCustomRightText = false local FormatTooltipNumber = ToKFunctions [8] @@ -583,6 +584,7 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo local barras_container = instancia.barras local percentage_type = instancia.row_info.percent_type + UsingCustomLeftText = instancia.row_info.textL_enable_custom_text UsingCustomRightText = instancia.row_info.textR_enable_custom_text if (instancia.bars_sort_direction == 1) then --top to bottom @@ -809,15 +811,34 @@ function atributo_misc:RefreshBarra (esta_barra, instancia, from_resize) esta_barra.icone_classe:SetVertexColor (1, 1, 1) end + --texture and text + + local bar_number = "" + if (instancia.row_info.textL_show_number) then + bar_number = esta_barra.colocacao .. ". " + end + if (self.enemy) then if (self.arena_enemy) then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao .. ".|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + end esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) else if (_detalhes.faction_against == "Horde") then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA + end else - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t"..self.displayName) --seta o texto da esqueda -- ALLY + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t"..self.displayName) --seta o texto da esqueda -- ALLY + end end if (instancia.row_info.texture_class_colors) then @@ -826,9 +847,17 @@ function atributo_misc:RefreshBarra (esta_barra, instancia, from_resize) end else if (self.arena_ally) then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao .. ".|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instancia.row_info.height .. ":" .. instancia.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t" .. self.displayName) + end else - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". "..self.displayName) --seta o texto da esqueda + if (UsingCustomLeftText) then + esta_barra.texto_esquerdo:SetText (instancia.row_info.textL_custom_text:ReplaceData (esta_barra.colocacao, self.displayName, "")) + else + esta_barra.texto_esquerdo:SetText (bar_number .. self.displayName) --seta o texto da esqueda + end end end diff --git a/core/util.lua b/core/util.lua index 149d713f..c59f5fb9 100644 --- a/core/util.lua +++ b/core/util.lua @@ -128,9 +128,9 @@ function _detalhes:NoToK (numero) return numero end - --> put points in numbers -- thanks http://richard.warburton.it - function _detalhes:comma_value(n) + function _detalhes:comma_value (n) + n = _math_floor (n) local left,num,right = _string_match (n,'^([^%d]*%d)(%d*)(.-)$') return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right end diff --git a/core/windows.lua b/core/windows.lua index 4b200821..9dcdff82 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -20,7 +20,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> constants - local end_window_spacement = 1 + local end_window_spacement = 0 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> core @@ -1091,7 +1091,7 @@ bg_texture:SetPoint ("topleft", panel, "topleft") bg_texture:SetPoint ("bottomright", panel, "bottomright") - function panel.widget:Open (text, callback, host) + function panel.widget:Open (text, callback, host, default) if (host) then panel:SetPoint ("center", host, "center") end @@ -1100,6 +1100,7 @@ panel.default_text = text panel.widget.editbox:SetText (text) panel.callback = callback + panel.default = default or "" panel:Show() end @@ -1280,7 +1281,7 @@ ok_button:InstallCustomTexture() ok_button:SetPoint ("topright", panel, "topright", -10, -174) - local reset_button = _detalhes.gump:NewButton (panel, nil, "$parentDefaultOk", nil, 80, 20, function() textentry.editbox:SetText (_detalhes.instance_defaults.row_info.textR_custom_text) end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_RESET"]) + local reset_button = _detalhes.gump:NewButton (panel, nil, "$parentDefaultOk", nil, 80, 20, function() textentry.editbox:SetText (panel.default) end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_RESET"]) reset_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_RESET_TOOLTIP"] reset_button:InstallCustomTexture() reset_button:SetPoint ("topright", panel, "topright", -100, -152) diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index cf2d3d64..40d63fe0 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -4737,6 +4737,17 @@ function window:CreateFrame5() window:CreateLineBackground2 (frame5, "textLeftOutlineSlider", "textLeftOutlineLabel", Loc ["STRING_OPTIONS_TEXT_LOUTILINE_DESC"]) + --> left show positio number + g:NewSwitch (frame5, _, "$parentPositionNumberSlider", "PositionNumberSlider", 60, 20, _, _, instance.row_info.textL_show_number) + g:NewLabel (frame5, _, "$parentPositionNumberLabel", "PositionNumberLabel", Loc ["STRING_OPTIONS_TEXT_LPOSITION"], "GameFontHighlightLeft") + + frame5.PositionNumberSlider:SetPoint ("left", frame5.PositionNumberLabel, "right", 2) + frame5.PositionNumberSlider.OnSwitch = function (self, instance, value) + instance:SetBarTextSettings (nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value) + end + + window:CreateLineBackground2 (frame5, "PositionNumberSlider", "PositionNumberLabel", Loc ["STRING_OPTIONS_TEXT_LPOSITION_DESC"]) + --> right outline g:NewSwitch (frame5, _, "$parentTextRightOutlineSlider", "textRightOutlineSlider", 60, 20, _, _, instance.row_info.textR_outline) g:NewLabel (frame5, _, "$parentTextRightOutlineLabel", "textRightOutlineLabel", Loc ["STRING_OPTIONS_TEXT_ROUTILINE"], "GameFontHighlightLeft") @@ -4789,7 +4800,6 @@ function window:CreateFrame5() g:NewTextEntry (frame5, _, "$parentCutomRightTextEntry", "cutomRightTextEntry", 180, 20) frame5.cutomRightTextEntry:SetPoint ("left", frame5.cutomRightTextEntryLabel, "right", 2, -1) - --frame5.cutomRightTextEntry.tooltip = "type the customized text" frame5.cutomRightTextEntry:SetHook ("OnTextChanged", function (self, byUser) if (not frame5.cutomRightTextEntry.text:find ("{func")) then @@ -4841,7 +4851,7 @@ function window:CreateFrame5() frame5.cutomRightTextEntry:PressEnter() end g:NewButton (frame5.cutomRightTextEntry, _, "$parentOpenTextBarEditorButton", "TextBarEditorButton", 22, 22, function() - DetailsWindowOptionsBarTextEditor:Open (frame5.cutomRightTextEntry.text, callback, _G.DetailsOptionsWindow) + DetailsWindowOptionsBarTextEditor:Open (frame5.cutomRightTextEntry.text, callback, _G.DetailsOptionsWindow, _detalhes.instance_defaults.row_info.textR_custom_text) end) frame5.TextBarEditorButton = frame5.cutomRightTextEntry.TextBarEditorButton frame5.TextBarEditorButton:SetPoint ("left", frame5.cutomRightTextEntry, "right", 2, 1) @@ -4863,6 +4873,96 @@ function window:CreateFrame5() frame5.customRightTextButton:GetNormalTexture():SetDesaturated (true) frame5.customRightTextButton.tooltip = "Reset to Default" + --> left text customization + + g:NewLabel (frame5, _, "$parentCutomLeftTextLabel", "cutomLeftTextLabel", Loc ["STRING_OPTIONS_BARLEFTTEXTCUSTOM"], "GameFontHighlightLeft") + g:NewSwitch (frame5, _, "$parentCutomLeftTextSlider", "cutomLeftTextSlider", 60, 20, _, _, instance.row_info.textL_enable_custom_text) + + frame5.cutomLeftTextSlider:SetPoint ("left", frame5.cutomLeftTextLabel, "right", 2) + frame5.cutomLeftTextSlider.OnSwitch = function (self, instance, value) + _G.DetailsOptionsWindow.instance:SetBarTextSettings (nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value) + end + + window:CreateLineBackground2 (frame5, "cutomLeftTextSlider", "cutomLeftTextLabel", Loc ["STRING_OPTIONS_BARLEFTTEXTCUSTOM_DESC"]) + + --text entry + g:NewLabel (frame5, _, "$parentCutomLeftText2Label", "cutomLeftTextEntryLabel", Loc ["STRING_OPTIONS_BARLEFTTEXTCUSTOM2"], "GameFontHighlightLeft") + g:NewTextEntry (frame5, _, "$parentCutomLeftTextEntry", "cutomLeftTextEntry", 180, 20) + frame5.cutomLeftTextEntry:SetPoint ("left", frame5.cutomLeftTextEntryLabel, "right", 2, -1) + + frame5.cutomLeftTextEntry:SetHook ("OnTextChanged", function (self, byUser) + + if (not frame5.cutomLeftTextEntry.text:find ("{func")) then + + if (frame5.cutomLeftTextEntry.changing and not byUser) then + frame5.cutomLeftTextEntry.changing = false + return + elseif (frame5.cutomLeftTextEntry.changing and byUser) then + frame5.cutomLeftTextEntry.changing = false + end + + if (byUser) then + local t = frame5.cutomLeftTextEntry.text + t = t:gsub ("||", "|") + _G.DetailsOptionsWindow.instance:SetBarTextSettings (nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, t) + else + local t = frame5.cutomLeftTextEntry.text + t = t:gsub ("|", "||") + frame5.cutomLeftTextEntry.changing = true + frame5.cutomLeftTextEntry.text = t + end + end + end) + + frame5.cutomLeftTextEntry:SetHook ("OnChar", function() + if (frame5.cutomLeftTextEntry.text:find ("{func")) then + GameCooltip:Reset() + GameCooltip:AddLine ("'func' keyword found, auto update disabled.") + GameCooltip:Show (frame5.cutomLeftTextEntry.widget) + end + end) + + frame5.cutomLeftTextEntry:SetHook ("OnEnterPressed", function() + local t = frame5.cutomLeftTextEntry.text + t = t:gsub ("||", "|") + _G.DetailsOptionsWindow.instance:SetBarTextSettings (nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, t) + end) + frame5.cutomLeftTextEntry:SetHook ("OnEscapePressed", function() + frame5.cutomLeftTextEntry:ClearFocus() + return true + end) + + window:CreateLineBackground2 (frame5, "cutomLeftTextEntry", "cutomLeftTextEntryLabel", Loc ["STRING_OPTIONS_BARLEFTTEXTCUSTOM2_DESC"]) + + frame5.cutomLeftTextEntry.text = instance.row_info.textL_custom_text + + local callback = function (text) + frame5.cutomLeftTextEntry.text = text + frame5.cutomLeftTextEntry:PressEnter() + end + g:NewButton (frame5.cutomLeftTextEntry, _, "$parentOpenTextBarEditorButton", "TextBarEditorButton", 22, 22, function() + DetailsWindowOptionsBarTextEditor:Open (frame5.cutomLeftTextEntry.text, callback, _G.DetailsOptionsWindow, _detalhes.instance_defaults.row_info.textL_custom_text) + end) + frame5.TextBarEditorButton = frame5.cutomLeftTextEntry.TextBarEditorButton + frame5.TextBarEditorButton:SetPoint ("left", frame5.cutomLeftTextEntry, "right", 2, 1) + frame5.TextBarEditorButton:SetNormalTexture ([[Interface\HELPFRAME\OpenTicketIcon]]) + frame5.TextBarEditorButton:SetHighlightTexture ([[Interface\HELPFRAME\OpenTicketIcon]]) + frame5.TextBarEditorButton:SetPushedTexture ([[Interface\HELPFRAME\OpenTicketIcon]]) + frame5.TextBarEditorButton:GetNormalTexture():SetDesaturated (true) + frame5.TextBarEditorButton.tooltip = "Row Text Editor" + + g:NewButton (frame5.cutomLeftTextEntry, _, "$parentResetCustomLeftTextButton", "customLeftTextButton", 20, 20, function() + frame5.cutomLeftTextEntry.text = _detalhes.instance_defaults.row_info.textL_custom_text + frame5.cutomLeftTextEntry:PressEnter() + end) + frame5.customLeftTextButton = frame5.cutomLeftTextEntry.customLeftTextButton + frame5.customLeftTextButton:SetPoint ("left", frame5.TextBarEditorButton, "right", 0, 0) + frame5.customLeftTextButton:SetNormalTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Down]]) + frame5.customLeftTextButton:SetHighlightTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]]) + frame5.customLeftTextButton:SetPushedTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Up]]) + frame5.customLeftTextButton:GetNormalTexture():SetDesaturated (true) + frame5.customLeftTextButton.tooltip = "Reset to Default" + --> anchors --general anchor @@ -4882,11 +4982,15 @@ function window:CreateFrame5() {"LeftTextAnchorLabel", 1, true}, {"textLeftOutlineLabel", 2}, {"classColorsLeftTextLabel", 3}, - {"RightTextAnchorLabel", 4, true}, - {"textRightOutlineLabel", 5}, - {"classColorsRightTextLabel", 6}, - {"cutomRightTextLabel", 7}, - {"cutomRightTextEntryLabel", 8}, + {"PositionNumberLabel", 4}, + {"cutomLeftTextLabel", 5}, + {"cutomLeftTextEntryLabel", 6}, + {"RightTextAnchorLabel", 7, true}, + {"textRightOutlineLabel", 8}, + {"classColorsRightTextLabel", 9}, + {"cutomRightTextLabel", 10}, + {"cutomRightTextEntryLabel", 11}, + } window:arrange_menu (frame5, left_side, x, window.top_start_at) @@ -6791,6 +6895,8 @@ function window:CreateFrame12() frame4.descVersionLabel:SetPoint ("topleft", frame4, "topleft", 290, y) g:NewLabel (frame4, _, "$parentDescEnabledLabel", "descEnabledLabel", Loc ["STRING_OPTIONS_PLUGINS_ENABLED"], "GameFontNormal", 12) frame4.descEnabledLabel:SetPoint ("topleft", frame4, "topleft", 400, y) + g:NewLabel (frame4, _, "$parentDescOptionsLabel", "descOptionsLabel", Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], "GameFontNormal", 12) + frame4.descOptionsLabel:SetPoint ("topleft", frame4, "topleft", 510, y) end y = y - 30 @@ -6833,6 +6939,12 @@ function window:CreateFrame12() end end + if (pluginObject.OpenOptionsPanel) then + g:NewButton (bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 86, 16, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"]) + bframe ["OptionsButton"..i]:SetPoint ("topleft", frame4, "topleft", 510, y-2) + bframe ["OptionsButton"..i]:InstallCustomTexture() + end + i = i + 1 y = y - 20 end @@ -6858,6 +6970,8 @@ function window:CreateFrame12() frame4.descVersionLabel:SetPoint ("topleft", frame4, "topleft", 290, y) g:NewLabel (frame4, _, "$parentDescEnabledLabel2", "descEnabledLabel", Loc ["STRING_OPTIONS_PLUGINS_ENABLED"], "GameFontNormal", 12) frame4.descEnabledLabel:SetPoint ("topleft", frame4, "topleft", 400, y) + g:NewLabel (frame4, _, "$parentDescOptionsLabel2", "descOptionsLabel", Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], "GameFontNormal", 12) + frame4.descOptionsLabel:SetPoint ("topleft", frame4, "topleft", 510, y) end y = y - 30 @@ -6927,6 +7041,8 @@ function window:CreateFrame12() frame4.descVersionLabel:SetPoint ("topleft", frame4, "topleft", 290, y) g:NewLabel (frame4, _, "$parentDescEnabledLabel3", "descEnabledLabel", Loc ["STRING_OPTIONS_PLUGINS_ENABLED"], "GameFontNormal", 12) frame4.descEnabledLabel:SetPoint ("topleft", frame4, "topleft", 400, y) + g:NewLabel (frame4, _, "$parentDescOptionsLabel3", "descOptionsLabel", Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], "GameFontNormal", 12) + frame4.descOptionsLabel:SetPoint ("topleft", frame4, "topleft", 510, y) end y = y - 30 @@ -7194,13 +7310,21 @@ function window:update_all (editing_instance) _G.DetailsOptionsWindow5PercentDropdown.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow5PercentDropdown.MyObject:Select (editing_instance.row_info.percent_type) + _G.DetailsOptionsWindow5CutomLeftTextSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow5CutomLeftTextSlider.MyObject:SetValue (editing_instance.row_info.textL_enable_custom_text) + _G.DetailsOptionsWindow5CutomRightTextSlider.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow5CutomRightTextSlider.MyObject:SetValue (editing_instance.row_info.textR_enable_custom_text) + + local text = editing_instance.row_info.textL_custom_text + _G.DetailsOptionsWindow5CutomLeftTextEntry.MyObject:SetText (text) local text = editing_instance.row_info.textR_custom_text - --text = text:gsub ("|", "||") _G.DetailsOptionsWindow5CutomRightTextEntry.MyObject:SetText (text) + _G.DetailsOptionsWindow5PositionNumberSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow5PositionNumberSlider.MyObject:SetValue (editing_instance.row_info.textL_show_number) + --> window 6 _G.DetailsOptionsWindow6BackdropDropdown.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow6BackdropDropdown.MyObject:Select (editing_instance.backdrop_texture) diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index ea48905b..dd328983 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -2856,7 +2856,7 @@ function gump:CriaNovaBarra (instancia, index) return esta_barra end -function _detalhes:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, rightcolorbyclass, leftoutline, rightoutline, customrighttextenabled, customrighttext, percentage_type) +function _detalhes:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, rightcolorbyclass, leftoutline, rightoutline, customrighttextenabled, customrighttext, percentage_type, showposition, customlefttextenabled, customlefttext) --> size if (size) then @@ -2896,6 +2896,14 @@ function _detalhes:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, self.row_info.textR_outline = rightoutline end + --> custom left text + if (type (customlefttextenabled) == "boolean") then + self.row_info.textL_enable_custom_text = customlefttextenabled + end + if (customlefttext) then + self.row_info.textL_custom_text = customlefttext + end + --> custom right text if (type (customrighttextenabled) == "boolean") then self.row_info.textR_enable_custom_text = customrighttextenabled @@ -2909,6 +2917,11 @@ function _detalhes:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, self.row_info.percent_type = percentage_type end + --> show position number + if (type (showposition) == "boolean") then + self.row_info.textL_show_number = showposition + end + self:InstanceReset() self:InstanceRefreshRows() end @@ -4498,7 +4511,7 @@ function _detalhes:ChangeSkin (skin_name) skin_name = "Default Skin" this_skin = _detalhes.skins [skin_name] end - + local just_updating = false if (self.skin == skin_name) then just_updating = true @@ -4578,7 +4591,7 @@ function _detalhes:ChangeSkin (skin_name) self.baseframe.scroll_up:SetTexture (skin_file) --> scrollbar parte de cima self.baseframe.scroll_down:SetTexture (skin_file) --> scrollbar parte de baixo self.baseframe.scroll_middle:SetTexture (skin_file) --> scrollbar parte do meio - + self.baseframe.rodape.top_bg:SetTexture (skin_file) --> rodape top background self.baseframe.rodape.esquerdo:SetTexture (skin_file) --> rodape esquerdo self.baseframe.rodape.direita:SetTexture (skin_file) --> rodape direito diff --git a/startup.lua b/startup.lua index f6c7854f..ab00ca55 100644 --- a/startup.lua +++ b/startup.lua @@ -362,10 +362,31 @@ function _G._detalhes:Start() --_detalhes:OpenCustomDisplayWindow() --BNSendFriendInvite ("tercio#1488") + + function _detalhes:EnterChatChannel() - --encode test + local realm = GetRealmName() + realm = realm or "" + + if (realm ~= "Azralon") then + return + end - --local box1 = + --> room name + local room_name = "Details" + + --> already in? + for room_index = 1, 10 do + local _, name = GetChannelName (room_index) + if (name == room_name) then + return --> already in the room + end + end + + --> enter + JoinChannelByName (room_name) + end + _detalhes:ScheduleTimer ("EnterChatChannel", 30) end