diff --git a/Details.toc b/Details.toc index d89ef965..3653607c 100644 --- a/Details.toc +++ b/Details.toc @@ -72,6 +72,7 @@ classes\classe_energy.lua classes\classe_energy_habilidade.lua classes\classe_others.lua classes\classe_others_habilidade.lua +classes\classe_instancia_include.lua classes\classe_instancia.lua classes\classe_target.lua classes\classe_custom.lua diff --git a/Libs/LibDBIcon-1.0/LibDBIcon-1.0.lua b/Libs/LibDBIcon-1.0/LibDBIcon-1.0.lua index c523821f..dfc65a8f 100644 --- a/Libs/LibDBIcon-1.0/LibDBIcon-1.0.lua +++ b/Libs/LibDBIcon-1.0/LibDBIcon-1.0.lua @@ -1,6 +1,6 @@ --[[ Name: DBIcon-1.0 -Revision: $Rev: 30 $ +Revision: $Rev: 34 $ Author(s): Rabbit (rabbit.magtheridon@gmail.com) Description: Allows addons to register to recieve a lightweight minimap icon as an alternative to more heavy LDB displays. Dependencies: LibStub @@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- local DBICON10 = "LibDBIcon-1.0" -local DBICON10_MINOR = tonumber(("$Rev: 30 $"):match("(%d+)")) +local DBICON10_MINOR = tonumber(("$Rev: 34 $"):match("(%d+)")) if not LibStub then error(DBICON10 .. " requires LibStub.") end local ldb = LibStub("LibDataBroker-1.1", true) if not ldb then error(DBICON10 .. " requires LibDataBroker-1.1.") end @@ -43,6 +43,7 @@ if not lib then return end lib.disabled = lib.disabled or nil lib.objects = lib.objects or {} lib.callbackRegistered = lib.callbackRegistered or nil +lib.callbacks = lib.callbacks or LibStub("CallbackHandler-1.0"):New(lib) lib.notCreated = lib.notCreated or {} function lib:IconCallback(event, name, key, value, dataobj) @@ -235,6 +236,7 @@ local function createButton(name, object, db) if not db or not db.hide then button:Show() else button:Hide() end end + lib.callbacks:Fire("LibDBIcon_IconCreated", button, name) -- Fire 'Icon Created' callback end -- We could use a metatable.__index on lib.objects, but then we'd create diff --git a/boot.lua b/boot.lua index 51e936d4..3261a5db 100644 --- a/boot.lua +++ b/boot.lua @@ -8,7 +8,7 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.userversion = "v1.8.4" + _detalhes.userversion = "v1.9.0" _detalhes.version = "Alpha 013" _detalhes.realversion = 13 @@ -90,6 +90,7 @@ do _detalhes.ToolBar = {} --> current showing icons _detalhes.ToolBar.Shown = {} + _detalhes.ToolBar.AllButtons = {} --> plugin objects _detalhes.ToolBar.Plugins = {} --> name to plugin object @@ -208,6 +209,21 @@ do print (a,b) end end + + --> global 'table_deepcopy' copies a full table + function table_deepcopy (orig) + local orig_type = type(orig) + local copy + if orig_type == 'table' then + copy = {} + for orig_key, orig_value in next, orig, nil do + copy [table_deepcopy (orig_key)] = table_deepcopy (orig_value) + end + else + copy = orig + end + return copy + end --> delay messages function _detalhes:DelayMsg (msg) diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index 0d6638d9..f40f3226 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -662,6 +662,7 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex local qual_barra = 1 local barras_container = instancia.barras + for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado atributo_damage:AtualizarFrags (ntable[i], qual_barra, i, instancia) qual_barra = qual_barra+1 @@ -843,7 +844,7 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex if (amount < 1) then --> não há barras para mostrar if (forcar) then if (instancia.modo == 2) then --> group - for i = 1, instancia.barrasInfo.cabem do + for i = 1, instancia.rows_fit_in_window do gump:Fade (instancia.barras [i], "in", 0.3) end end @@ -865,10 +866,10 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex if (myPos) then --testando - local cima = math.floor (instancia.barrasInfo.cabem/2) - local baixo = math.ceil (instancia.barrasInfo.cabem/2) + local cima = math.floor (instancia.rows_fit_in_window / 2) + local baixo = math.ceil (instancia.rows_fit_in_window / 2) - if (instancia.barrasInfo.cabem%2 == 0) then + if (instancia.rows_fit_in_window % 2 == 0) then cima = cima - 1 end @@ -890,10 +891,21 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex end local combat_time = instancia.showing:GetCombatTime() - for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time) --> instância, index, total, valor da 1º barra - qual_barra = qual_barra+1 - end + + if (instancia.bars_sort_direction == 1) then --top to bottom + for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time) --> instância, index, total, valor da 1º barra + qual_barra = qual_barra+1 + end + + elseif (instancia.bars_sort_direction == 2) then --bottom to top + for i = instancia.barraS[2], instancia.barraS[1], -1 do --> vai atualizar só o range que esta sendo mostrado + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time) --> instância, index, total, valor da 1º barra + qual_barra = qual_barra+1 + end + + end + end @@ -912,7 +924,7 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex --> beta, hidar barras não usadas durante um refresh forçado if (forcar) then if (instancia.modo == 2) then --> group - for i = qual_barra, instancia.barrasInfo.cabem do + for i = qual_barra, instancia.rows_fit_in_window do gump:Fade (instancia.barras [i], "in", 0.3) end end @@ -1076,10 +1088,10 @@ end esta_barra.statusbar:SetValue (esta_porcentagem) gump:Fade (esta_barra, "out") - if (instancia.row_texture_class_colors) then + if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) end - if (instancia.barrasInfo.texturaBackgroundByClass) then + 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 @@ -1135,10 +1147,10 @@ end end end - if (instancia.row_texture_class_colors) then + if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) end - if (instancia.barrasInfo.texturaBackgroundByClass) then + 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 @@ -1180,22 +1192,22 @@ end if (self.enemy) then if (_detalhes.faction_against == "Horde") then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.barrasInfo.altura..":"..instancia.barrasInfo.altura..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA + 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 else - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.barrasInfo.altura..":"..instancia.barrasInfo.altura..":0:0:256:32:32:64:0:32|t"..self.displayName) --seta o texto da esqueda -- ALLY + 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 end - if (instancia.row_texture_class_colors) then + if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (0.94117, 0, 0.01960, 1) end else esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". "..self.displayName) --seta o texto da esqueda end - if (instancia.row_textL_class_colors) then + 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_textR_class_colors) then + 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 diff --git a/classes/classe_energy.lua b/classes/classe_energy.lua index 3b244568..c1eec998 100644 --- a/classes/classe_energy.lua +++ b/classes/classe_energy.lua @@ -278,9 +278,18 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex local qual_barra = 1 local barras_container = instancia.barras - for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar) --> instância, index, total, valor da 1º barra - qual_barra = qual_barra+1 + if (instancia.bars_sort_direction == 1) then --top to bottom + for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar) --> instância, index, total, valor da 1º barra + qual_barra = qual_barra+1 + end + + elseif (instancia.bars_sort_direction == 2) then --bottom to top + for i = instancia.barraS[2], instancia.barraS[1], 1 do --> vai atualizar só o range que esta sendo mostrado + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar) --> instância, index, total, valor da 1º barra + qual_barra = qual_barra+1 + end + end if (instancia.atributo == 5) then --> custom @@ -297,7 +306,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex --> beta, hidar barras não usadas durante um refresh forçado if (forcar) then if (instancia.modo == 2) then --> group - for i = qual_barra, instancia.barrasInfo.cabem do + for i = qual_barra, instancia.rows_fit_in_window do gump:Fade (instancia.barras [i], "in", 0.3) end end @@ -381,10 +390,10 @@ function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior, esta_barra.statusbar:SetValue (esta_porcentagem) gump:Fade (esta_barra, "out") - if (instancia.row_texture_class_colors) then + if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) end - if (instancia.barrasInfo.texturaBackgroundByClass) then + 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 @@ -440,10 +449,10 @@ function atributo_energy:RefreshBarra (esta_barra, instancia, from_resize) end end - if (instancia.row_texture_class_colors) then + if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) end - if (instancia.barrasInfo.texturaBackgroundByClass) then + 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 @@ -485,22 +494,22 @@ function atributo_energy:RefreshBarra (esta_barra, instancia, from_resize) if (self.enemy) then if (_detalhes.faction_against == "Horde") then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.barrasInfo.altura..":"..instancia.barrasInfo.altura..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA + 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 else - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.barrasInfo.altura..":"..instancia.barrasInfo.altura..":0:0:256:32:32:64:0:32|t"..self.displayName) --seta o texto da esqueda -- ALLY + 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 end - if (instancia.row_texture_class_colors) then + if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (240/255, 0, 5/255, 1) end else esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". "..self.displayName) --seta o texto da esqueda end - if (instancia.row_textL_class_colors) then + 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_textR_class_colors) then + 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 diff --git a/classes/classe_heal.lua b/classes/classe_heal.lua index e742f5a5..f5196d7d 100644 --- a/classes/classe_heal.lua +++ b/classes/classe_heal.lua @@ -333,10 +333,20 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo --print (sub_atributo, total, keyName) local combat_time = instancia.showing:GetCombatTime() - for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado - --conteudo[i]:AtualizaBarra (instancia, qual_barra, i, total, sub_atributo, forcar) --> instância, index, total, valor da 1º barra - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time) --> instância, index, total, valor da 1º barra - qual_barra = qual_barra+1 + + if (instancia.bars_sort_direction == 1) then --top to bottom + for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time) --> instância, index, total, valor da 1º barra + qual_barra = qual_barra+1 + end + + elseif (instancia.bars_sort_direction == 2) then --bottom to top + for i = instancia.barraS[2], instancia.barraS[1], 1 do --> vai atualizar só o range que esta sendo mostrado + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time) --> instância, index, total, valor da 1º barra + qual_barra = qual_barra+1 + end + + end if (instancia.atributo == 5) then --> custom @@ -353,7 +363,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo --> beta, hidar barras não usadas durante um refresh forçado if (forcar) then if (instancia.modo == 2) then --> group - for i = qual_barra, instancia.barrasInfo.cabem do + for i = qual_barra, instancia.rows_fit_in_window do gump:Fade (instancia.barras [i], "in", 0.3) end end @@ -488,10 +498,10 @@ function atributo_heal:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo esta_barra.statusbar:SetValue (esta_porcentagem) gump:Fade (esta_barra, "out") - if (instancia.row_texture_class_colors) then + if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) end - if (instancia.barrasInfo.texturaBackgroundByClass) then + 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 @@ -547,10 +557,10 @@ function atributo_heal:RefreshBarra (esta_barra, instancia, from_resize) end end - if (instancia.row_texture_class_colors) then + if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) end - if (instancia.barrasInfo.texturaBackgroundByClass) then + 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 @@ -592,22 +602,22 @@ function atributo_heal:RefreshBarra (esta_barra, instancia, from_resize) if (self.enemy) then if (_detalhes.faction_against == "Horde") then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.barrasInfo.altura..":"..instancia.barrasInfo.altura..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA + 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 else - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.barrasInfo.altura..":"..instancia.barrasInfo.altura..":0:0:256:32:32:64:0:32|t"..self.displayName) --seta o texto da esqueda -- ALLY + 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 end - if (instancia.row_texture_class_colors) then + if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (240/255, 0, 5/255, 1) end else esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". "..self.displayName) --seta o texto da esqueda end - if (instancia.row_textL_class_colors) then + 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_textR_class_colors) then + 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 diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index 3bb1ac1f..241f5920 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -218,8 +218,8 @@ end self.baseframe.isLocked = false self.baseframe.lock_button.label:SetText (Loc ["STRING_LOCK_WINDOW"]) self.baseframe.lock_button:SetWidth (self.baseframe.lock_button.label:GetStringWidth()+2) - gump:Fade (self.baseframe.resize_direita, 0) - gump:Fade (self.baseframe.resize_esquerda, 0) + self.baseframe.resize_direita:SetAlpha (0) + self.baseframe.resize_esquerda:SetAlpha (0) self.baseframe.lock_button:ClearAllPoints() self.baseframe.lock_button:SetPoint ("right", self.baseframe.resize_direita, "left", -1, 1.5) end @@ -231,8 +231,8 @@ end self.baseframe.lock_button:SetWidth (self.baseframe.lock_button.label:GetStringWidth()+2) self.baseframe.lock_button:ClearAllPoints() self.baseframe.lock_button:SetPoint ("bottomright", self.baseframe, "bottomright", -3, 0) - gump:Fade (self.baseframe.resize_direita, 1) - gump:Fade (self.baseframe.resize_esquerda, 1) + self.baseframe.resize_direita:SetAlpha (1) + self.baseframe.resize_esquerda:SetAlpha (1) end end end @@ -311,9 +311,9 @@ end return _detalhes:Msg (Loc ["STRING_INSTANCE_LIMIT"]) end - local nova_instancia = _detalhes:NovaInstancia (#_detalhes.tabela_instancias+1) - _detalhes.tabela_instancias [#_detalhes.tabela_instancias+1] = nova_instancia - return nova_instancia + local new_instance = _detalhes:NovaInstancia (#_detalhes.tabela_instancias+1) + _detalhes.tabela_instancias [#_detalhes.tabela_instancias+1] = new_instance + return new_instance elseif (id) then local instancia = _detalhes.tabela_instancias [id] @@ -335,16 +335,16 @@ end return _detalhes:Msg (Loc ["STRING_INSTANCE_LIMIT"]) end - local nova_instancia = _detalhes:NovaInstancia (#_detalhes.tabela_instancias+1) - _detalhes.tabela_instancias [#_detalhes.tabela_instancias+1] = nova_instancia + local new_instance = _detalhes:NovaInstancia (#_detalhes.tabela_instancias+1) + _detalhes.tabela_instancias [#_detalhes.tabela_instancias+1] = new_instance if (not _detalhes.initializing) then - _detalhes:SendEvent ("DETAILS_INSTANCE_OPEN", nil, nova_instancia) + _detalhes:SendEvent ("DETAILS_INSTANCE_OPEN", nil, new_instance) end _detalhes:GetLowerInstanceNumber() - return nova_instancia + return new_instance end ------------------------------------------------------------------------------------------------------------------------ @@ -496,10 +496,10 @@ function _detalhes:agrupar_janelas (lados) self.snap [4] = esta_instancia.meu_id esta_instancia.snap [2] = self.meu_id - esta_instancia.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", esta_instancia.baseframe.rodape.top_bg, "left", 25, 58) - esta_instancia.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", esta_instancia.baseframe.rodape.top_bg, "center", 20, 58) - esta_instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left_snap") - esta_instancia.baseframe.rodape.esquerdo.have_snap = true + --esta_instancia.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", esta_instancia.baseframe.rodape.top_bg, "left", 25, 58) + --esta_instancia.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", esta_instancia.baseframe.rodape.top_bg, "center", 20, 58) + --esta_instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left_snap") + --esta_instancia.baseframe.rodape.esquerdo.have_snap = true elseif (lado == 1) then --> esquerda --> mover frame @@ -527,10 +527,10 @@ function _detalhes:agrupar_janelas (lados) self.snap [2] = esta_instancia.meu_id esta_instancia.snap [4] = self.meu_id - self.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", self.baseframe.rodape.top_bg, "left", 25, 58) - self.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", self.baseframe.rodape.top_bg, "center", 20, 58) - self.baseframe.rodape.esquerdo:SetTexture ([[Interface\AddOns\Details\images\bar_down_left_snap]]) - self.baseframe.rodape.esquerdo.have_snap = true + --self.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", self.baseframe.rodape.top_bg, "left", 25, 58) + --self.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", self.baseframe.rodape.top_bg, "center", 20, 58) + --self.baseframe.rodape.esquerdo:SetTexture ([[Interface\AddOns\Details\images\bar_down_left_snap]]) + --self.baseframe.rodape.esquerdo.have_snap = true end if (not esta_instancia.ativa) then @@ -561,10 +561,10 @@ local function FixSnaps (instancia) esta_instancia = _detalhes.tabela_instancias [esta_instancia] --_detalhes:DelayMsg ("DEBUG janela "..instancia.meu_id.." com snap "..snap.. " em " .. esta_instancia.meu_id) if (snap == 2) then - instancia.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", instancia.baseframe.rodape.top_bg, "left", 25, 10) - instancia.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", instancia.baseframe.rodape.top_bg, "center", 20, 10) - instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left_snap") - instancia.baseframe.rodape.esquerdo.have_snap = true + --instancia.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", instancia.baseframe.rodape.top_bg, "left", 25, 10) + --instancia.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", instancia.baseframe.rodape.top_bg, "center", 20, 10) + --instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left_snap") + --instancia.baseframe.rodape.esquerdo.have_snap = true end end end @@ -609,10 +609,10 @@ function _detalhes:Desagrupar (instancia, lado) end if (index == 2) then -- index é o codigo do snap - esta_instancia.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", esta_instancia.baseframe.rodape.top_bg, "left", 5, 58) - esta_instancia.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", esta_instancia.baseframe.rodape.top_bg, "center", 0, 58) - esta_instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left") - esta_instancia.baseframe.rodape.esquerdo.have_snap = nil + --esta_instancia.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", esta_instancia.baseframe.rodape.top_bg, "left", 5, 58) + --esta_instancia.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", esta_instancia.baseframe.rodape.top_bg, "center", 0, 58) + --esta_instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left") + --esta_instancia.baseframe.rodape.esquerdo.have_snap = nil end end @@ -668,9 +668,9 @@ function _detalhes:SnapTextures (remove) if (esta_instancia:IsAtiva()) then if (esta_instancia.baseframe.rodape.esquerdo.have_snap) then if (remove) then - esta_instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left") + --esta_instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left") else - esta_instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left_snap") + --esta_instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left_snap") end end end @@ -681,279 +681,153 @@ end --> search key: ~new ~nova function _detalhes:NovaInstancia (ID) - -- Uma nova instância será uma extensão do acetimer somada com uma cópia da classe detalhes_funções - local nova_instancia = {} - _setmetatable (nova_instancia, _detalhes) + local new_instance = {} + _setmetatable (new_instance, _detalhes) - nova_instancia.meu_id = ID + --> instance number + new_instance.meu_id = ID + + --> setup all config + new_instance:ResetInstanceConfig() - nova_instancia.skin = "Default Skin" + --> internal stuff + new_instance.barras = {} --container que irá armazenar todas as barras + new_instance.barraS = {nil, nil} --de x até x são as barras que estão sendo mostradas na tela + new_instance.rolagem = false --barra de rolagem não esta sendo mostrada + new_instance.largura_scroll = 26 + new_instance.bar_mod = 0 + new_instance.bgdisplay_loc = 0 - nova_instancia.barras = {} --container que irá armazenar todas as barras - nova_instancia.barraS = {nil, nil} --de x até x são as barras que estão sendo mostradas na tela - nova_instancia.rolagem = false --barra de rolagem não esta sendo mostrada - - nova_instancia["barrasInfo"] = { - ["criadas"] = 0, --quantos frames de barras ja foram criados - ["mostrando"] = 0, --quantos jogadores que estão sendo mostrados agora - ["maximo"] = 50, --máximo de barras que pode ser criado - ["cabem"] = nil, --quantas barras cabem na janela - ["altura"] = 14, - ["fontSize"] = 10.5, - ["font"] = SharedMedia:Fetch ("font", "Arial Narrow"), - ["fontName"] = "Arial Narrow", - ["textura"] = _detalhes.default_texture, - ["texturaBackground"] = _detalhes.default_texture, - ["texturaBackgroundColor"] = {0, 0, 0, 0}, - ["texturaBackgroundByClass"] = false, - ["textureName"] = _detalhes.default_texture_name, - ["textureNameBackground"] = _detalhes.default_texture_name, - ["textura_mouseover"] = "Interface\\FriendsFrame\\UI-FriendsList-Highlight", - ["animar"] = true, - ["fade"] = true, - ["espaco"] = { - ["esquerda"] = 3, - ["direita"] = -5, - ["entre"] = 1, - } - } + --> displaying row info + new_instance.rows_created = 0 + new_instance.rows_showing = 0 + new_instance.rows_max = 50 + new_instance.rows_fit_in_window = nil - nova_instancia.largura_scroll = 26 - nova_instancia.bar_mod = 0 - nova_instancia.bgdisplay_loc = 0 - - nova_instancia.bg_alpha = _detalhes.default_bg_alpha - nova_instancia.bg_r = _detalhes.default_bg_color - nova_instancia.bg_g = _detalhes.default_bg_color - nova_instancia.bg_b = _detalhes.default_bg_color - - nova_instancia.auto_current = true - nova_instancia.row_texture_class_colors = true - nova_instancia.row_textL_class_colors = false - nova_instancia.row_textR_class_colors = false - nova_instancia.row_textL_outline = true - nova_instancia.row_textR_outline = false - nova_instancia.fixed_row_texture_color = {0, 0, 0} - nova_instancia.fixed_row_text_color = {1, 1, 1} - - nova_instancia.barrasInfo["alturaReal"] = nova_instancia.barrasInfo.altura+nova_instancia.barrasInfo.espaco.entre - - nova_instancia.posicao = { - ["normal"] = {}, - ["solo"] = {} + --> saved pos for normal mode and lone wolf mode + new_instance.posicao = { + ["normal"] = {}, + ["solo"] = {} } + --> save information about window snaps + new_instance.snap = {nil, nil, nil, nil} - nova_instancia.tooltip = { - ["n_habilidades"] = 3, - ["n_inimigos"] = 3 - } - - nova_instancia.snap = {nil, nil, nil, nil} - - --janela inicia no frame normal (group ou all) - nova_instancia.mostrando = "normal" - --menu consolidated - nova_instancia.consolidate = false - nova_instancia.icons = {true, true, true, true} + --> current state starts as normal + new_instance.mostrando = "normal" + --> menu consolidated + new_instance.consolidate = false + new_instance.icons = {true, true, true, true} - --cria a janela da instância - local _baseframe, _bgframe, _bgframe_display, _scrollframe = gump:CriaJanelaPrincipal (ID, nova_instancia, true) - - nova_instancia.baseframe = _baseframe - nova_instancia.bgframe = _bgframe - nova_instancia.bgdisplay = _bgframe_display - nova_instancia.scroll = _scrollframe + --> create window frames + local _baseframe, _bgframe, _bgframe_display, _scrollframe = gump:CriaJanelaPrincipal (ID, new_instance, true) + new_instance.baseframe = _baseframe + new_instance.bgframe = _bgframe + new_instance.bgdisplay = _bgframe_display + new_instance.scroll = _scrollframe - --status bar - nova_instancia.StatusBar = {} - nova_instancia.StatusBar.left = nil - nova_instancia.StatusBar.center = nil - nova_instancia.StatusBar.right = nil - nova_instancia.StatusBar.options = {} + --> status bar stuff + new_instance.StatusBar = {} + new_instance.StatusBar.left = nil + new_instance.StatusBar.center = nil + new_instance.StatusBar.right = nil + new_instance.StatusBar.options = {} - local clock = _detalhes.StatusBar:CreateStatusBarChildForInstance (nova_instancia, "DETAILS_STATUSBAR_PLUGIN_CLOCK") - _detalhes.StatusBar:SetCenterPlugin (nova_instancia, clock) - - local segment = _detalhes.StatusBar:CreateStatusBarChildForInstance (nova_instancia, "DETAILS_STATUSBAR_PLUGIN_PSEGMENT") - _detalhes.StatusBar:SetLeftPlugin (nova_instancia, segment) - - local dps = _detalhes.StatusBar:CreateStatusBarChildForInstance (nova_instancia, "DETAILS_STATUSBAR_PLUGIN_PDPS") - _detalhes.StatusBar:SetRightPlugin (nova_instancia, dps) - -- - - nova_instancia.color = {1, 1, 1, 1} - nova_instancia.wallpaper = { - enabled = false, - texture = nil, - anchor = "all", - alpha = 0.5, - texcoord = {0, 1, 0, 1}, - width = 0, - height = 0, - overlay = {1, 1, 1, 1} - } - - --> salva a altura antiga - nova_instancia.alturaAntiga = _baseframe:GetHeight() - - --atributo que será mostrado na criação do gump será o de dano: - nova_instancia.atributo = 1 --> dano - nova_instancia.sub_atributo = 1 --> damage done - - nova_instancia.sub_atributo_last = {1, 1, 1, 1, 1} - - nova_instancia.segmento = -1 --> combate atual - - -- atualiza tabela de historico e atributo - _detalhes:TrocaTabela (nova_instancia, 0, 1, 1) - - nova_instancia:DefaultIcons (true, true, true, true) - - --nova janela vem sempre com o modo grupo ativado - --nova_instancia.modo = _detalhes_props["MODO_GROUP"] - nova_instancia.modo = modo_grupo - nova_instancia.last_modo = modo_grupo - nova_instancia.LastModo = modo_grupo - - --nova_instancia.janela.gump_cabecalho.Title:SetText (Loc [_detalhes._detalhes_props.modo_nome[nova_instancia.modo]]) --poe o nome do modo no gump - --_baseframe.rodape.segmento:SetText ("Segmento: Atual") --> localiza-me + local clock = _detalhes.StatusBar:CreateStatusBarChildForInstance (new_instance, "DETAILS_STATUSBAR_PLUGIN_CLOCK") + _detalhes.StatusBar:SetCenterPlugin (new_instance, clock) + + local segment = _detalhes.StatusBar:CreateStatusBarChildForInstance (new_instance, "DETAILS_STATUSBAR_PLUGIN_PSEGMENT") + _detalhes.StatusBar:SetLeftPlugin (new_instance, segment) + + local dps = _detalhes.StatusBar:CreateStatusBarChildForInstance (new_instance, "DETAILS_STATUSBAR_PLUGIN_PDPS") + _detalhes.StatusBar:SetRightPlugin (new_instance, dps) - --mostra o gump na tela - nova_instancia.iniciada = true + --> internal stuff + new_instance.alturaAntiga = _baseframe:GetHeight() + new_instance.atributo = 1 --> dano + new_instance.sub_atributo = 1 --> damage done + new_instance.sub_atributo_last = {1, 1, 1, 1, 1} + new_instance.segmento = -1 --> combate atual + new_instance.modo = modo_grupo + new_instance.last_modo = modo_grupo + new_instance.LastModo = modo_grupo + + --> change the attribute + _detalhes:TrocaTabela (new_instance, 0, 1, 1) + + --> handle icons + new_instance:DefaultIcons (true, true, true, true) + + --> internal stuff + new_instance.row_height = new_instance.row_info.height + new_instance.row_info.space.between + + new_instance.iniciada = true + new_instance:SaveMainWindowPosition() + new_instance:ReajustaGump() + + new_instance.rows_fit_in_window = _math_floor (new_instance.posicao[new_instance.mostrando].h / new_instance.row_height) - nova_instancia:SaveMainWindowPosition() - nova_instancia:ReajustaGump() - - --> calcula quantas barras cabem na janela - nova_instancia.barrasInfo.cabem = _math_floor (nova_instancia.posicao[nova_instancia.mostrando].h / nova_instancia.barrasInfo.alturaReal) - - nova_instancia:AtivarInstancia() - - -- instância criada, hora de retorna-la a quem pediu - return nova_instancia + --> all done + new_instance:AtivarInstancia() + + return new_instance end ------------------------------------------------------------------------------------------------------------------------ --> ao reiniciar o addon esta função é rodada para recriar a janela da instância ---> search key: ~restaura +--> search key: ~restaura ~inicio function _detalhes:RestauraJanela (index, temp) - self.skin = self.skin or "Default Skin" + --> load + self:LoadInstanceConfig() - self.bg_alpha = self.bg_alpha or _detalhes.default_bg_alpha - self.bg_r = self.bg_r or _detalhes.default_bg_color - self.bg_g = self.bg_g or _detalhes.default_bg_color - self.bg_b = self.bg_b or _detalhes.default_bg_color - - if (self.auto_current == nil) then - self.auto_current = true - end - - if (self.row_texture_class_colors == nil) then - self.row_texture_class_colors = true - end - - if (self.row_textL_class_colors == nil) then - self.row_textL_class_colors = false - end - if (self.row_textR_class_colors == nil) then - self.row_textR_class_colors = false - end - if (self.row_textL_outline == nil) then - self.row_textL_outline = false - end - if (self.row_textR_outline == nil) then - self.row_textR_outline = false - end + --> reset internal stuff + self.sub_atributo_last = self.sub_atributo_last or {1, 1, 1, 1, 1} + self.rolagem = false + self.need_rolagem = false + self.barras = {} + self.barraS = {nil, nil} + self.rows_fit_in_window = nil + self.consolidate = self.consolidate or false + self.icons = self.icons or {true, true, true, true} + self.rows_created = 0 + self.rows_showing = 0 + self.rows_max = 50 + self.rows_fit_in_window = nil + self.largura_scroll = 26 + self.bar_mod = 0 + self.bgdisplay_loc = 0 + self.last_modo = self.last_modo or modo_grupo - if (self.fixed_row_texture_color == nil) then - self.fixed_row_texture_color = {0, 0, 0} - end - if (self.fixed_row_text_color == nil) then - self.fixed_row_text_color = {1, 1, 1} - end - - if (not self.barrasInfo.texturaBackground) then - self.barrasInfo.texturaBackground = _detalhes.default_texture - self.barrasInfo.texturaBackgroundColor = {0, 0, 0, 0} - self.barrasInfo.texturaBackgroundByClass = false - self.barrasInfo.textureNameBackground = _detalhes.default_texture_name - end - - if (not self.sub_atributo_last) then - self.sub_atributo_last = {1, 1, 1, 1, 1} - end + self.row_height = self.row_info.height + self.row_info.space.between + --> create frames local _baseframe, _bgframe, _bgframe_display, _scrollframe = gump:CriaJanelaPrincipal (self.meu_id, self) - self.baseframe = _baseframe self.bgframe = _bgframe self.bgdisplay = _bgframe_display self.scroll = _scrollframe - - --self.barrasInfo.textura = "Interface\\AddOns\\Details\\images\\bar44" - --self.barrasInfo.textura = "Interface\\AddOns\\Details\\images\\bar4" - --self.barrasInfo.textura = [[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]] - --self.barrasInfo.textura = "Interface\PaperDollInfoFrame\UI-Character-Skills-Bar" - - self.barrasInfo.textura = self.barrasInfo.textura or _detalhes.default_texture - self.barrasInfo.textureName = self.barrasInfo.textureName or _detalhes.default_texture_name - self.barrasInfo.fontSize = self.barrasInfo.fontSize or 10.5 - self.barrasInfo.font = self.barrasInfo.font or SharedMedia:Fetch ("font", "Arial Narrow") - self.barrasInfo.fontName = self.barrasInfo.fontName or "Arial Narrow" - - _detalhes:TrocaTabela (self, self.segmento, self.atributo, self.sub_atributo, true) --> passando true no 5º valor para a função ignorar a checagem de valores iguais - - --> resetando as cprops da instância: - self.rolagem = false - self.need_rolagem = false _baseframe:EnableMouseWheel (false) + self.alturaAntiga = _baseframe:GetHeight() - self.barras = {} - self.barraS = {nil, nil} - self.barrasInfo.cabem = nil - - self.consolidate = self.consolidate or false - self.icons = self.icons or {true, true, true, true} - - --> teste - --self.barrasInfo.altura = 14 - - self.barrasInfo.mostrando = 0 - self.barrasInfo.criadas = 0 - self.barrasInfo.alturaReal = self.barrasInfo.altura+self.barrasInfo.espaco.entre - - self.color = self.color or {1, 1, 1, 1} - self.wallpaper = self.wallpaper or { - enabled = false, - texture = nil, - anchor = "all", - alpha = 0.5, - texcoord = {0, 1, 0, 1}, - width = 0, - height = 0, - overlay = {1, 1, 1, 1} - } - + --> change the attribute + _detalhes:TrocaTabela (self, self.segmento, self.atributo, self.sub_atributo, true) --> passando true no 5º valor para a função ignorar a checagem de valores iguais + + --> set wallpaper if (self.wallpaper.enabled) then self:InstanceWallpaper (true) end + --> set the color of this instance window self:InstanceColor (self.color) - self.largura_scroll = 26 - self.bar_mod = 0 + --> scrollbar self:EsconderScrollBar (true) - - self.bgdisplay_loc = 0 - + + --> check snaps self.snap = self.snap or {nil, nil, nil, nil} FixSnaps (self) - - ---> salva o tamanho antigo da janela - self.alturaAntiga = _baseframe:GetHeight() - - -- status bar + + --> status bar stuff self.StatusBar = {} self.StatusBar.left = nil self.StatusBar.center = nil @@ -978,14 +852,8 @@ function _detalhes:RestauraJanela (index, temp) end local dps = _detalhes.StatusBar:CreateStatusBarChildForInstance (self, self.StatusBarSaved.right or "DETAILS_STATUSBAR_PLUGIN_PDPS") _detalhes.StatusBar:SetRightPlugin (self, dps, true) - -- - - if (not self.last_modo) then - self.last_modo = modo_all - end - self.barrasInfo.altura = self.barrasInfo.altura or 14 - self.barrasInfo.alturaReal = self.barrasInfo.altura+self.barrasInfo.espaco.entre + --> load mode if (self.modo == modo_alone) then if (_detalhes.solo and _detalhes.solo ~= self.meu_id) then --> proteção para ter apenas uma instância com a janela SOLO @@ -1001,6 +869,7 @@ function _detalhes:RestauraJanela (index, temp) self.mostrando = "normal" end + --> internal stuff self:RestoreMainWindowPosition() self:ReajustaGump() self:SaveMainWindowPosition() @@ -1011,7 +880,11 @@ function _detalhes:RestauraJanela (index, temp) self:AtivarInstancia (temp) self:ChangeSkin() - end + + --> all done + +end + ------------------------------------------------------------------------------------------------------------------------ function _detalhes:InstanceReset (instance) @@ -1029,40 +902,18 @@ function _detalhes:RefreshBars (instance) if (instance) then self = instance end - if (self.barras and self.barras[1]) then - - local altura = self.barrasInfo.altura - - for index, row in _ipairs (self.barras) do - - local y = self.barrasInfo.alturaReal * (row.row_id - 1) - y = y*-1 - row:SetPoint ("TOPLEFT", self.baseframe, "TOPLEFT", self.barrasInfo.espaco.esquerda, y) - row:SetHeight (altura) - row.icone_classe:SetHeight (altura) - row.icone_classe:SetWidth (altura) - row.icone_terceiro:SetHeight (altura) - row.icone_terceiro:SetWidth (altura) - - row.textura:SetTexture (self.barrasInfo.textura) - - row.background:SetTexture (self.barrasInfo.texturaBackground) - if (not self.barrasInfo.texturaBackgroundByClass) then - local c = self.barrasInfo.texturaBackgroundColor - row.background:SetVertexColor (c[1], c[2], c[3], c[4]) - else - local c = self.barrasInfo.texturaBackgroundColor - local r, g, b = row.background:GetVertexColor() - row.background:SetVertexColor (r, g, b, c[4]) - end - - row.texto_esquerdo:SetFont (self.barrasInfo.font or "GameFontHighlight", self.barrasInfo.fontSize or altura * 0.75) - row.texto_direita:SetFont (self.barrasInfo.font or "GameFontHighlight", self.barrasInfo.fontSize or altura * 0.75) - end - end + self:InstanceRefreshRows (instancia) end function _detalhes:SetBackgroundColor (...) + + local red = select (1, ...) + if (not red) then + self.bgdisplay:SetBackdropColor (self.bg_r, self.bg_g, self.bg_b, self.bg_alpha) + self.baseframe:SetBackdropColor (self.bg_r, self.bg_g, self.bg_b, self.bg_alpha) + return + end + local r, g, b = gump:ParseColors (...) self.bgdisplay:SetBackdropColor (r, g, b, self.bg_alpha or _detalhes.default_bg_alpha) self.baseframe:SetBackdropColor (r, g, b, self.bg_alpha or _detalhes.default_bg_alpha) @@ -1072,21 +923,15 @@ function _detalhes:SetBackgroundColor (...) end function _detalhes:SetBackgroundAlpha (alpha) - - --self.bgdisplay:SetBackdropColor (1, 1, 1, 1) - - alpha = alpha or _detalhes.default_bg_alpha - - --print ("antes",alpha) - alpha = _detalhes:Scale (0, 1, 0.2, 1, alpha) - 0.8 - --print ("depois",alpha) + if (not alpha) then + alpha = self.bg_alpha + else + alpha = _detalhes:Scale (0, 1, 0.2, 1, alpha) - 0.8 + end self.bgdisplay:SetBackdropColor (self.bg_r or _detalhes.default_bg_color, self.bg_g or _detalhes.default_bg_color, self.bg_b or _detalhes.default_bg_color, alpha) self.baseframe:SetBackdropColor (self.bg_r or _detalhes.default_bg_color, self.bg_g or _detalhes.default_bg_color, self.bg_b or _detalhes.default_bg_color, alpha) self.bg_alpha = alpha - - --local r, g, b, a = self.bgdisplay:GetBackdropColor() - --print (a) end function _detalhes:GetSize() diff --git a/classes/classe_instancia_include.lua b/classes/classe_instancia_include.lua new file mode 100644 index 00000000..5d09eea8 --- /dev/null +++ b/classes/classe_instancia_include.lua @@ -0,0 +1,122 @@ + +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 + end +end + +function _detalhes:LoadInstanceConfig() + for key, value in pairs (_detalhes.instance_defaults) do + if (self [key] == nil) then + if (type (value) == "table") then + self [key] = table_deepcopy (_detalhes.instance_defaults [key]) + else + self [key] = value + end + end + end +end + +_detalhes.instance_defaults = { + + --skin + skin = "Default Skin", + --baseframe backdrop color + bg_alpha = 0.7, + bg_r = 0.0941, + bg_g = 0.0941, + bg_b = 0.0941, + --auto current + auto_current = true, + --show sidebars + show_sidebars = true, + --show bottom statusbar + show_statusbar = true, + --blackwhiite icons + desaturated_menu = false, + --hide main window attribute icon + hide_icon = false, + --anchor side of main window toolbar (1 = top 2 = bottom) + toolbar_side = 1, + --stretch button anchor side (1 = top 2 = bottom) + stretch_button_side = 1, + --where plugins icon will be placed on main window toolbar (1 = left 2 = right) + plugins_grow_direction = 2, + --grow direction of main window bars (1 = top to bottom 2 = bottom to top) + bars_grow_direction = 1, + --sort direction is the direction of results on bars (1 = top to bottom 2 = bottom to top) + bars_sort_direction = 1, + --reset button info + resetbutton_info = {text_color = {1, 0.82, 0, 1}, text_face = "Friz Quadrata TT", text_size = 12, color_overlay = {1, 1, 1, 1}, always_small = false}, + --instance button info + instancebutton_info = {text_color = {1, 0.82, 0, 1}, text_face = "Friz Quadrata TT", text_size = 12, color_overlay = {1, 1, 1, 1}}, + --close button info + closebutton_info = {color_overlay = {1, 1, 1, 1}}, + --menu anchor store the anchor point of main menu + menu_anchor = {5, 1}, + --instance button anchor store the anchor point of instance and delete button + instance_button_anchor = {-27, 1}, + --row info + row_info = { + --if true the texture of the bars will have the color of his actor class + texture_class_colors = true, + --if texture class color are false, this color will be used + fixed_texture_color = {0, 0, 0}, + --left text class color + textL_class_colors = false, + --right text class color + textR_class_colors = false, + --if text class color are false, this color will be used + fixed_text_color = {1, 1, 1}, + --left text outline effect + textL_outline = true, + --right text outline effect + textR_outline = false, + --bar height + height = 14, + --font size + font_size = 10, + --font face (name) + font_face = "Arial Narrow", + --font face (file) + font_face_file = SharedMedia:Fetch ("font", "Arial Narrow"), + --bar texture + texture = "Details D'ictum", + --bar texture name + texture_file = [[Interface\AddOns\Details\images\bar4]], + --bar texture on mouse over + texture_highlight = [[Interface\FriendsFrame\UI-FriendsList-Highlight]], + --bar background texture + texture_background = "Details D'ictum", + --bar background file + texture_background_file = [[Interface\AddOns\Details\images\bar4]], + --bar background class color + texture_background_class_color = true, + --fixed texture color for background texture + fixed_texture_background_color = {0, 0, 0, 0}, + --space between bars + space = {left = 3, right = -5, between = 1} + + }, + --instance window color + color = {1, 1, 1, 1}, + --wallpaper + wallpaper = { + enabled = false, + texture = nil, + anchor = "all", + alpha = 0.5, + texcoord = {0, 1, 0, 1}, + width = 0, + height = 0, + overlay = {1, 1, 1, 1} + }, + --tooltip amounts + tooltip = { + ["n_abilities"] = 3, + ["n_enemies"] = 3 + } +} \ No newline at end of file diff --git a/classes/classe_others.lua b/classes/classe_others.lua index 710d8f00..505b267a 100644 --- a/classes/classe_others.lua +++ b/classes/classe_others.lua @@ -462,10 +462,18 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo local qual_barra = 1 local barras_container = instancia.barras - for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado - atributo_misc:DeadAtualizarBarra (mortes[i], qual_barra, i, instancia) - --conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, true) --> instância, index, total, valor da 1º barra - qual_barra = qual_barra+1 + if (instancia.bars_sort_direction == 1) then + for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado + atributo_misc:DeadAtualizarBarra (mortes[i], qual_barra, i, instancia) + qual_barra = qual_barra+1 + end + + elseif (instancia.bars_sort_direction == 2) then + for i = instancia.barraS[2], instancia.barraS[1], 1 do --> vai atualizar só o range que esta sendo mostrado + atributo_misc:DeadAtualizarBarra (mortes[i], qual_barra, i, instancia) + qual_barra = qual_barra+1 + end + end return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh @@ -554,9 +562,18 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo local qual_barra = 1 local barras_container = instancia.barras - for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado - conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName) --> instância, index, total, valor da 1º barra - qual_barra = qual_barra+1 + if (instancia.bars_sort_direction == 1) then --top to bottom + for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName) --> instância, index, total, valor da 1º barra + qual_barra = qual_barra+1 + end + + elseif (instancia.bars_sort_direction == 2) then --bottom to top + for i = instancia.barraS[2], instancia.barraS[1], 1 do --> vai atualizar só o range que esta sendo mostrado + conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName) --> instância, index, total, valor da 1º barra + qual_barra = qual_barra+1 + end + end if (instancia.atributo == 5) then --> custom @@ -573,7 +590,7 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo --> beta, hidar barras não usadas durante um refresh forçado if (forcar) then if (instancia.modo == 2) then --> group - for i = qual_barra, instancia.barrasInfo.cabem do + for i = qual_barra, instancia.rows_fit_in_window do gump:Fade (instancia.barras [i], "in", 0.3) end end @@ -664,10 +681,10 @@ function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo esta_barra.statusbar:SetValue (esta_porcentagem) gump:Fade (esta_barra, "out") - if (instancia.row_texture_class_colors) then + if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) end - if (instancia.barrasInfo.texturaBackgroundByClass) then + 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 @@ -723,10 +740,10 @@ function atributo_misc:RefreshBarra (esta_barra, instancia, from_resize) end end - if (instancia.row_texture_class_colors) then + if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) end - if (instancia.barrasInfo.texturaBackgroundByClass) then + 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 @@ -768,22 +785,22 @@ function atributo_misc:RefreshBarra (esta_barra, instancia, from_resize) if (self.enemy) then if (_detalhes.faction_against == "Horde") then - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.barrasInfo.altura..":"..instancia.barrasInfo.altura..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA + 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 else - esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". |TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.barrasInfo.altura..":"..instancia.barrasInfo.altura..":0:0:256:32:32:64:0:32|t"..self.displayName) --seta o texto da esqueda -- ALLY + 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 end - if (instancia.row_texture_class_colors) then + if (instancia.row_info.texture_class_colors) then esta_barra.textura:SetVertexColor (240/255, 0, 5/255, 1) end else esta_barra.texto_esquerdo:SetText (esta_barra.colocacao..". "..self.displayName) --seta o texto da esqueda end - if (instancia.row_textL_class_colors) then + 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_textR_class_colors) then + 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 diff --git a/core/control.lua b/core/control.lua index a8fef0c3..a7329817 100644 --- a/core/control.lua +++ b/core/control.lua @@ -808,7 +808,7 @@ --> primeira atualização após uma mudança de segmento --> verifica se há mais barras sendo mostradas do que o necessário -------------------- if (instancia.v_barras) then - for barra_numero = instancia.barrasInfo.mostrando+1, instancia.barrasInfo.criadas do + for barra_numero = instancia.rows_showing+1, instancia.rows_created do _detalhes.gump:Fade (instancia.barras[barra_numero], "in") end instancia.v_barras = false @@ -904,4 +904,4 @@ function _detalhes:UpdateControl() _tempo = _detalhes._tempo - end \ No newline at end of file + end diff --git a/core/plugins_raid.lua b/core/plugins_raid.lua index c7c5a1f1..450eae88 100644 --- a/core/plugins_raid.lua +++ b/core/plugins_raid.lua @@ -74,16 +74,16 @@ instancia:DefaultIcons (true, true, true, true) --> calcula se existem barras, etc... - if (not instancia.barrasInfo.cabem) then --> as barras não forma iniciadas ainda - instancia.barrasInfo.cabem = _math_floor (instancia.baseframe.BoxBarrasAltura / instancia.barrasInfo.alturaReal) - if (instancia.barrasInfo.criadas < instancia.barrasInfo.cabem) then - for i = #instancia.barras+1, instancia.barrasInfo.cabem do + if (not instancia.rows_fit_in_window) then --> as barras não forma iniciadas ainda + instancia.rows_fit_in_window = _math_floor (instancia.baseframe.BoxBarrasAltura / instancia.row_height) + if (instancia.rows_created < instancia.rows_fit_in_window) then + for i = #instancia.barras+1, instancia.rows_fit_in_window do local nova_barra = gump:CriaNovaBarra (instancia, i, 30) --> cria nova barra nova_barra.texto_esquerdo:SetText (Loc ["STRING_NEWROW"]) nova_barra.statusbar:SetValue (100) instancia.barras [i] = nova_barra end - instancia.barrasInfo.criadas = #instancia.barras + instancia.rows_created = #instancia.barras end end diff --git a/core/plugins_solo.lua b/core/plugins_solo.lua index b56aed23..a070aeca 100644 --- a/core/plugins_solo.lua +++ b/core/plugins_solo.lua @@ -124,16 +124,16 @@ end --> calcula se existem barras, etc... - if (not self.barrasInfo.cabem) then --> as barras não forma iniciadas ainda - self.barrasInfo.cabem = _math_floor (self.baseframe.BoxBarrasAltura / self.barrasInfo.alturaReal) - if (self.barrasInfo.criadas < self.barrasInfo.cabem) then - for i = #self.barras+1, self.barrasInfo.cabem do + if (not self.rows_fit_in_window) then --> as barras não forma iniciadas ainda + self.rows_fit_in_window = _math_floor (self.baseframe.BoxBarrasAltura / self.row_height) + if (self.rows_created < self.rows_fit_in_window) then + for i = #self.barras+1, self.rows_fit_in_window do local nova_barra = gump:CriaNovaBarra (self, i, 30) --> cria nova barra nova_barra.texto_esquerdo:SetText (Loc ["STRING_NEWROW"]) nova_barra.statusbar:SetValue (100) self.barras [i] = nova_barra end - self.barrasInfo.criadas = #self.barras + self.rows_created = #self.barras end end end diff --git a/core/plugins_statusbar.lua b/core/plugins_statusbar.lua index 661e6507..9ca4d7d0 100644 --- a/core/plugins_statusbar.lua +++ b/core/plugins_statusbar.lua @@ -28,6 +28,23 @@ --[[ This file contains Api and Internal functions, plus 4 built-in plugins You can use this four plugins to learn how they works--]] + --> hida all micro frames + function _detalhes.StatusBar:Hide (instance, side) + if (not side) then + instance.StatusBar.center.frame:Hide() + instance.StatusBar.left.frame:Hide() + instance.StatusBar.right.frame:Hide() + end + end + + function _detalhes.StatusBar:Show (instance, side) + if (not side) then + instance.StatusBar.center.frame:Show() + instance.StatusBar.left.frame:Show() + instance.StatusBar.right.frame:Show() + end + end + --> create a plugin child for an instance function _detalhes.StatusBar:CreateStatusBarChildForInstance (instance, pluginName) local PluginObject = _detalhes.StatusBar.NameTable [pluginName] @@ -257,6 +274,21 @@ return true end + --> reset micro frames + function _detalhes.StatusBar:Reset (instance) + _detalhes.StatusBar:ApplyOptions (instance.StatusBar.left, "textcolor", {1, 0.82, 0, 1}) + _detalhes.StatusBar:ApplyOptions (instance.StatusBar.center, "textcolor", {1, 0.82, 0, 1}) + _detalhes.StatusBar:ApplyOptions (instance.StatusBar.right, "textcolor", {1, 0.82, 0, 1}) + + _detalhes.StatusBar:ApplyOptions (instance.StatusBar.left, "textface", "Friz Quadrata TT") + _detalhes.StatusBar:ApplyOptions (instance.StatusBar.center, "textface", "Friz Quadrata TT") + _detalhes.StatusBar:ApplyOptions (instance.StatusBar.right, "textface", "Friz Quadrata TT") + + _detalhes.StatusBar:ApplyOptions (instance.StatusBar.left, "textsize", 9) + _detalhes.StatusBar:ApplyOptions (instance.StatusBar.center, "textsize", 9) + _detalhes.StatusBar:ApplyOptions (instance.StatusBar.right, "textsize", 9) + end + --> build-in function for create a frame for an plugin child function _detalhes.StatusBar:CreateChildFrame (instance, name, w, h) local frame = _detalhes.gump:NewPanel (instance.baseframe.cabecalho.fechar, nil, name..instance:GetInstanceId(), nil, w or DEFAULT_CHILD_WIDTH, h or DEFAULT_CHILD_HEIGHT, false) @@ -334,7 +366,8 @@ if (value) then child.options.textColor = value end - child.text:SetTextColor (unpack (child.options.textColor)) + local r, g, b, a = _detalhes.gump:ParseColors (child.options.textColor) + child.text:SetTextColor (r, g, b, a) elseif (option == "textsize") then if (value) then child.options.textSize = value diff --git a/core/plugins_toolbar.lua b/core/plugins_toolbar.lua index 973264d9..9ea0ae5f 100644 --- a/core/plugins_toolbar.lua +++ b/core/plugins_toolbar.lua @@ -52,6 +52,10 @@ FourCornerAnimeFrame.glow:SetScript ("OnFinished", nil) button.blink = FourCornerAnimeFrame + _detalhes.ToolBar.AllButtons [#_detalhes.ToolBar.AllButtons+1] = button + + + return button end @@ -160,7 +164,7 @@ _detalhes.ToolBar:ReorganizeIcons() end - function _detalhes.ToolBar:ReorganizeIcons (lastIcon) + function _detalhes.ToolBar:ReorganizeIcons (lastIcon) --> get the lower number instance local lower_instance = _detalhes:GetLowerInstanceNumber() @@ -182,25 +186,49 @@ local LastIcon local x = 0 - if (instance.consolidate) then - LastIcon = instance.consolidateButtonTexture - x = -3 - else - LastIcon = instance.lastIcon or instance.baseframe.cabecalho.report - end + + if (instance.plugins_grow_direction == 2) then --> right direction + + if (instance.consolidate) then + LastIcon = instance.consolidateButtonTexture + x = -3 + else + LastIcon = instance.lastIcon or instance.baseframe.cabecalho.report + end + + for _, ThisButton in ipairs (_detalhes.ToolBar.Shown) do + ThisButton:ClearAllPoints() + ThisButton:SetPoint ("left", LastIcon, "right", ThisButton.x + x, ThisButton.y) + ThisButton:Show() + LastIcon = ThisButton + end + + elseif (instance.plugins_grow_direction == 1) then --> left direction + + if (instance.consolidate) then + LastIcon = instance.consolidateButtonTexture + else + LastIcon = instance.baseframe.cabecalho.modo_selecao.widget + end - for _, ThisButton in ipairs (_detalhes.ToolBar.Shown) do - ThisButton:SetPoint ("left", LastIcon, "right", ThisButton.x + x, ThisButton.y) - ThisButton:Show() - LastIcon = ThisButton + for _, ThisButton in ipairs (_detalhes.ToolBar.Shown) do + ThisButton:ClearAllPoints() + ThisButton:SetPoint ("right", LastIcon, "left", ThisButton.x + x, ThisButton.y) + ThisButton:Show() + LastIcon = ThisButton + end end + + end for _, instancia in pairs (_detalhes.tabela_instancias) do if (instancia.baseframe and instancia:IsAtiva()) then - instancia:ReajustaGump() -- aqui + instancia:ReajustaGump() end end + instance:ChangeSkin() + return true end diff --git a/core/util.lua b/core/util.lua index 95f59e2d..58b71f11 100644 --- a/core/util.lua +++ b/core/util.lua @@ -160,6 +160,7 @@ outline = "THICKOUTLINE" end end + fontString:SetFont (fonte, size, outline) end @@ -309,7 +310,7 @@ --[[ test grayscale ]] function _detalhes:teste_grayscale() local instancia = _detalhes.tabela_instancias[1] - for i = 1, instancia.barrasInfo.criadas, 1 do + for i = 1, instancia.rows_created, 1 do local barra = instancia.barras[i] local red, green, blue, alpha = barra.textura:GetVertexColor() local grayscale = (red*0.03+green+blue) / 3 --> grayscale lightness method @@ -467,19 +468,19 @@ if (frame.meu_id) then --> ups, é uma instância if (parametros == "barras") then --> hida todas as barras da instância if (velocidade) then - for i = 1, frame.barrasInfo.criadas, 1 do + for i = 1, frame.rows_created, 1 do gump:Fade (frame.barras[i], tipo, velocidade) end return else velocidade = velocidade or 0.3 - for i = 1, frame.barrasInfo.criadas, 1 do + for i = 1, frame.rows_created, 1 do gump:Fade (frame.barras[i], tipo, 0.3+(i/10)) end return end elseif (parametros == "hide_barras") then --> hida todas as barras da instância - for i = 1, frame.barrasInfo.criadas, 1 do + for i = 1, frame.rows_created, 1 do local esta_barra = frame.barras[i] if (esta_barra.fading_in or esta_barra.fading_out) then esta_barra.fadeInfo.finishedFunc = nil @@ -505,7 +506,7 @@ if (frame == "all") then --> todas as instâncias for _, instancia in _ipairs (_detalhes.tabela_instancias) do if (parametros == "barras") then --> hida todas as barras da instância - for i = 1, instancia.barrasInfo.criadas, 1 do + for i = 1, instancia.rows_created, 1 do gump:Fade (instancia.barras[i], tipo, velocidade+(i/10)) end end diff --git a/core/windows.lua b/core/windows.lua index 784257dc..d045349f 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -244,9 +244,9 @@ end instancia.barraS = {nil, nil} --> zera o iterator - instancia.barrasInfo.mostrando = 0 --> resetou, então não esta mostranho nenhuma barra + instancia.rows_showing = 0 --> resetou, então não esta mostranho nenhuma barra - for i = 1, instancia.barrasInfo.criadas, 1 do --> limpa a referência do que estava sendo mostrado na barra + for i = 1, instancia.rows_created, 1 do --> limpa a referência do que estava sendo mostrado na barra local esta_barra= instancia.barras[i] esta_barra.minha_tabela = nil end @@ -264,7 +264,7 @@ if (self.mostrando == "normal") then --> somente alterar o tamanho das barras se tiver mostrando o gump normal if (self.meu_id == _detalhes.ResetButtonInstance) then - if (self.baseframe:GetWidth() < 215) then + if (self.baseframe:GetWidth() < 215 or self.resetbutton_info.always_small) then gump:Fade (_detalhes.ResetButton, 1) gump:Fade (_detalhes.ResetButton2, 0) _detalhes.ResetButtonMode = 2 @@ -321,6 +321,10 @@ end end + if (self.stretch_button_side == 2) then + self:StretchButtonAnchor (2) + end + if (self.freezed) then --> reajusta o freeze _detalhes:Freeze (self) @@ -329,50 +333,54 @@ -- -4 difere a precisão de quando a barra será adicionada ou apagada da barra self.baseframe.BoxBarrasAltura = self.baseframe:GetHeight()-4 - local T = self.barrasInfo.cabem + local T = self.rows_fit_in_window if (not T) then --> primeira vez que o gump esta sendo reajustado - T = _math_floor (self.baseframe.BoxBarrasAltura / self.barrasInfo.alturaReal) + T = _math_floor (self.baseframe.BoxBarrasAltura / self.row_height) -- o que mais precisa por aqui? end --> reajustar o local do relógio local meio = self.baseframe:GetWidth() / 2 local novo_local = meio - 25 - self.barrasInfo.cabem = _math_floor ( self.baseframe.BoxBarrasAltura / self.barrasInfo.alturaReal) + self.rows_fit_in_window = _math_floor ( self.baseframe.BoxBarrasAltura / self.row_height) - if (self.barrasInfo.cabem > #self.barras) then--> verifica se precisa criar mais barras - for i = #self.barras+1, self.barrasInfo.cabem, 1 do - local nova_barra = gump:CriaNovaBarra (self, i, 30) --> cria nova barra - nova_barra.texto_esquerdo:SetText (Loc ["STRING_NEWROW"]) --seta o texto da esqueda - nova_barra.statusbar:SetValue (100) - self.barras [i] = nova_barra + --if (not _detalhes.initializing) then + + if (self.rows_fit_in_window > #self.barras) then--> verifica se precisa criar mais barras + for i = #self.barras+1, self.rows_fit_in_window, 1 do + local nova_barra = gump:CriaNovaBarra (self, i, 30) --> cria nova barra + nova_barra.texto_esquerdo:SetText (Loc ["STRING_NEWROW"]) --seta o texto da esqueda + nova_barra.statusbar:SetValue (100) + self.barras [i] = nova_barra + end + self.rows_created = #self.barras end - self.barrasInfo.criadas = #self.barras - end - - --> seta a largura das barras - if (self.bar_mod and self.bar_mod ~= 0) then - for index = 1, self.barrasInfo.cabem do - self.barras [index]:SetWidth (self.baseframe:GetWidth()+self.bar_mod) + + --> seta a largura das barras + if (self.bar_mod and self.bar_mod ~= 0) then + for index = 1, self.rows_fit_in_window do + self.barras [index]:SetWidth (self.baseframe:GetWidth()+self.bar_mod) + end + else + for index = 1, self.rows_fit_in_window do + self.barras [index]:SetWidth (self.baseframe:GetWidth()+self.row_info.space.right) + end end - else - for index = 1, self.barrasInfo.cabem do - self.barras [index]:SetWidth (self.baseframe:GetWidth()+self.barrasInfo.espaco.direita) - end - end + + --end local A = self.barraS[1] if (not A) then --> primeira vez que o resize esta sendo usado, no caso no startup do addon ou ao criar uma nova instância --> hida as barras não usadas - for i = 1, self.barrasInfo.criadas, 1 do + for i = 1, self.rows_created, 1 do gump:Fade (self.barras [i], 1) self.barras [i].on = false - end + end return end - local X = self.barrasInfo.mostrando - local C = self.barrasInfo.cabem + local X = self.rows_showing + local C = self.rows_fit_in_window --> novo iterator local barras_diff = C - T --> aqui pega a quantidade de barras, se aumentou ou diminuiu @@ -465,31 +473,7 @@ else tabela:RefreshBarra (esta_barra, self, true) end - - if (esta_barra.minha_tabela.enemy) then - --if (i == 1) then - --print (esta_barra.texto_esquerdo:GetWrappedWidth()) - --end - - --esta_barra.texto_esquerdo:SetText (esta_barra.colocacao.."."..esta_barra.minha_tabela.nome.." |TInterface\\PVPFrame\\PVP-Currency-Horde:14:14|t") --seta o texto da esqueda - --local texto_len = esta_barra.texto_esquerdo:GetStringWidth() - --if (esta_barra.texto_esquerdo:IsTruncated()) then - --local tamanho = esta_barra:GetWidth()-esta_barra.texto_direita:GetStringWidth()-16-esta_barra:GetHeight() - --esta_barra.icone_secundario:SetPoint ("left", esta_barra.texto_esquerdo, "left", tamanho-2, 0) - --print ("aqui") - --else - --print ("aqui") - --if (i == 1) then - --print (esta_barra.texto_esquerdo:GetStringWidth()) --debug - --print (esta_barra.texto_esquerdo:GetText()) - --end - --local fonte, size, flags = esta_barra.texto_esquerdo:GetFont() - --print (fonte, size, flags) - --esta_barra.icone_secundario:SetPoint ("left", esta_barra.texto_esquerdo, "left", esta_barra.texto_esquerdo:GetStringWidth()+3, 0) - --esta_barra.texto_esquerdo:SetText (esta_barra.colocacao.."."..esta_barra.minha_tabela.nome.." |TInterface\\PVPFrame\\PVP-Currency-Horde:14:14|t") --seta o texto da esqueda - --end - end end qual_barra = qual_barra+1 @@ -661,4 +645,4 @@ _detalhes:ScheduleTimer ("delay_tutorial", 20) end - end \ No newline at end of file + end diff --git a/framework/cooltip.lua b/framework/cooltip.lua index 7d7aaf5b..b0db57b1 100644 --- a/framework/cooltip.lua +++ b/framework/cooltip.lua @@ -232,7 +232,7 @@ function DetailsCreateCoolTip() CoolTip.buttonClicked = false frame1:SetScript ("OnEnter", function (self) - if (CoolTip.Type ~= 1 and CoolTip.Type ~= 2) then + if (CoolTip.Type ~= 1 and CoolTip.Type ~= 2) then --> menu CoolTip.active = true CoolTip.mouseOver = true self:SetScript ("OnUpdate", nil) @@ -2359,7 +2359,7 @@ function DetailsCreateCoolTip() end if (self.CoolTip.OnLeaveFunc) then - self.CoolTip.OnLeaveFunc() + self.CoolTip.OnLeaveFunc (self) end if (self.OldOnLeaveScript) then @@ -2378,7 +2378,7 @@ function DetailsCreateCoolTip() end if (self.CoolTip.OnEnterFunc) then - self.CoolTip.OnEnterFunc() + self.CoolTip.OnEnterFunc (self) end if (self.OldOnEnterScript) then diff --git a/framework/slider.lua b/framework/slider.lua index ca4e7726..9889568e 100644 --- a/framework/slider.lua +++ b/framework/slider.lua @@ -367,19 +367,24 @@ local SliderMetaFunctions = {} editbox:SetScript ("OnEnterPressed", function() editbox:ClearFocus() editbox:Hide() - editbox:GetParent().MyObject.value = tonumber (editbox:GetText()) editbox:GetParent().MyObject.typing_value = false + editbox:GetParent().MyObject.value = tonumber (editbox:GetText()) end) editbox:SetScript ("OnEscapePressed", function() editbox:ClearFocus() editbox:Hide() editbox:GetParent().MyObject.typing_value = false + editbox:GetParent().MyObject.value = tonumber (self.typing_value_started) end) SliderMetaFunctions.editbox_typevalue = editbox end + local pvalue = self.previous_value [2] + self:SetValue (pvalue) + self.typing_value = true + self.typing_value_started = pvalue SliderMetaFunctions.editbox_typevalue:SetSize (self.width, self.height) SliderMetaFunctions.editbox_typevalue:SetPoint ("center", self.widget, "center") @@ -405,6 +410,14 @@ local SliderMetaFunctions = {} end end + local OnMouseUp = function (slider, button) + --if (button == "RightButton") then + -- if (slider.MyObject.typing_value) then + -- slider.MyObject:SetValue (slider.MyObject.previous_value [2]) + -- end + --end + end + local OnHide = function (slider) if (slider.MyObject.OnHideHook) then local interrupt = slider.MyObject.OnHideHook (slider) @@ -429,10 +442,20 @@ local SliderMetaFunctions = {} end end + local table_insert = table.insert + local table_remove = table.remove + local OnValueChanged = function (slider) local amt = slider:GetValue() + + if (slider.MyObject.typing_value) then + return slider.MyObject:SetValue (slider.MyObject.typing_value_started) + end + table_insert (slider.MyObject.previous_value, 1, amt) + table_remove (slider.MyObject.previous_value, 4) + if (slider.MyObject.OnValueChangeHook) then local interrupt = slider.MyObject.OnValueChangeHook (slider, slider.MyObject.FixedValue, amt) if (interrupt) then @@ -457,7 +480,7 @@ local SliderMetaFunctions = {} ------------------------------------------------------------------------------------------------------------ --> object constructor -function gump:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defaultv) +function gump:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defaultv, color_inverted) --> early checks if (not name) then @@ -484,22 +507,33 @@ function gump:NewSwitch (parent, container, name, member, w, h, ltext, rtext, de --> build frames local slider = gump:NewSlider (parent, container, name, member, w, h, 1, 2, 1, defaultv, nil, true) - slider:SetBackdrop ({edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", edgeSize = 8, + slider:SetBackdrop ({edgeFile = [[Interface\Buttons\UI-SliderBar-Border]], edgeSize = 8, bgFile = [[Interface\AddOns\Details\images\background]], insets = {left = 3, right = 3, top = 5, bottom = 5}}) + slider.invert_colors = color_inverted + slider:SetHook ("OnValueChange", function (self) if (slider:GetValue() == 1) then slider.amt:SetText (ltext) if (slider.OnSwitch) then slider.OnSwitch (slider, slider.FixedValue, false) end - slider:SetBackdropColor (1, 0, 0, 0.4) + if (not slider.invert_colors) then + slider:SetBackdropColor (1, 0, 0, 0.4) + else + slider:SetBackdropColor (0, 0, 1, 0.4) + end else slider.amt:SetText (rtext) if (slider.OnSwitch) then slider.OnSwitch (slider, slider.FixedValue, true) end - slider:SetBackdropColor (0, 0, 1, 0.4) + + if (not slider.invert_colors) then + slider:SetBackdropColor (0, 0, 1, 0.4) + else + slider:SetBackdropColor (1, 0, 0, 0.4) + end end return true end) @@ -624,6 +658,8 @@ function gump:NewSlider (parent, container, name, member, w, h, min, max, step, SliderObject.amt:SetPoint ("center", SliderObject.thumb, "center") SliderObject.slider.amt = SliderObject.amt + SliderObject.previous_value = {defaultv or 0, 0, 0} + --> hooks SliderObject.slider:SetScript ("OnEnter", OnEnter) SliderObject.slider:SetScript ("OnLeave", OnLeave) @@ -631,6 +667,7 @@ function gump:NewSlider (parent, container, name, member, w, h, min, max, step, SliderObject.slider:SetScript ("OnShow", OnShow) SliderObject.slider:SetScript ("OnValueChanged", OnValueChanged) SliderObject.slider:SetScript ("OnMouseDown", OnMouseDown) + SliderObject.slider:SetScript ("OnMouseUp", OnMouseUp) _setmetatable (SliderObject, SliderMetaFunctions) diff --git a/functions/savedata.lua b/functions/savedata.lua index ff7e1603..39b8d5c7 100644 --- a/functions/savedata.lua +++ b/functions/savedata.lua @@ -30,8 +30,14 @@ end _detalhes_database.nick_tag_cache = _detalhes.nick_tag_cache _detalhes_database.only_pvp_frags = _detalhes.only_pvp_frags + --> minimap + _detalhes_database.minimap = _detalhes.minimap + --> save instances (windows) _detalhes_database.tabela_instancias = _detalhes.tabela_instancias + _detalhes_database.class_icons_small = _detalhes.class_icons_small + _detalhes_database.class_coords = _detalhes.class_coords + _detalhes_database.class_colors = _detalhes.class_colors --> character info _detalhes_database.character_data = _detalhes.character_data --> options data @@ -59,7 +65,6 @@ end -- colors _detalhes_database.default_bg_color = _detalhes.default_bg_color _detalhes_database.default_bg_alpha = _detalhes.default_bg_alpha - _detalhes_database.class_colors = _detalhes.class_colors -- fades _detalhes_database.row_fade_in = _detalhes.row_fade_in _detalhes_database.windows_fade_in = _detalhes.windows_fade_in @@ -165,7 +170,10 @@ end --]] _detalhes.nick_tag_cache = _detalhes_database.nick_tag_cache or {} _detalhes:NickTagSetCache (_detalhes.nick_tag_cache) _detalhes.only_pvp_frags = _detalhes_database.only_pvp_frags - + + --> minimap + _detalhes.minimap = _detalhes_database.minimap + --> character info _detalhes.character_data = _detalhes_database.character_data @@ -195,7 +203,10 @@ end --]] --> instances (windows) _detalhes.tabela_instancias = _detalhes_database.tabela_instancias or {} - + _detalhes.class_icons_small = _detalhes_database.class_icons_small + _detalhes.class_coords = _detalhes_database.class_coords + _detalhes.class_colors = _detalhes_database.class_colors + --> get last combat table local historico_UM = _detalhes.tabela_historico.tabelas[1] @@ -247,7 +258,6 @@ end --]] _detalhes.report_lines = _detalhes_database.report_lines _detalhes.report_to_who = _detalhes_database.report_to_who -- colors - _detalhes.class_colors = _detalhes_database.class_colors _detalhes.default_bg_color = _detalhes_database.default_bg_color _detalhes.default_bg_alpha = _detalhes_database.default_bg_alpha -- fades @@ -367,4 +377,113 @@ function _detalhes:WipeConfig() b:SetScript ("OnClick", function() _detalhes.wipe_full_config = true; ReloadUI(); end) b:SetPoint ("center", UIParent, "center", 0, 0) +end + +function _detalhes:ApplyConfigDataOnLoad() + + --> basic + self.instances_amount = self.instances_amount or 12 + self.segments_amount = self.segments_amount or 12 + self.segments_amount_to_save = self.segments_amount_to_save or 5 + self.memory_threshold = self.memory_threshold or 3 + self.memory_ram = self.memory_ram or 64 + self.deadlog_limit = self.deadlog_limit or 12 + self.minimum_combat_time = self.minimum_combat_time or 5 + self.update_speed = self.update_speed or 1 + self.time_type = self.time_type or 1 + self.row_fade_in = self.row_fade_in or {"in", 0.2} + self.row_fade_out = self.row_fade_out or {"out", 0.2} + self.windows_fade_in = self.windows_fade_in or {"in", 0.2} + self.windows_fade_out = self.windows_fade_out or {"out", 0.2} + self.default_bg_color = self.default_bg_color or 0.0941 + self.default_bg_alpha = self.default_bg_alpha or 0.7 + self.new_window_size = self.new_window_size or {width = 300, height = 95} + self.max_window_size = self.max_window_size or {width = 480, height = 450} + self.window_clamp = self.window_clamp or {-8, 0, 21, -14} + self.window_clamp = {-8, 0, 21, -14} + self.report_lines = self.report_lines or 5 + self.report_to_who = self.report_to_who or "" + self.animate_scroll = self.animate_scroll or false + self.use_scroll = self.use_scroll or false + self.font_sizes = self.font_sizes or {menus = 10} + self.minimap = self.minimap or {hide = false, radius = 160, minimapPos = 220} + + --> tutorial + self.tutorial = self.tutorial or {} + self.tutorial.logons = self.tutorial.logons or 0 + self.tutorial.unlock_button = self.tutorial.unlock_button or 0 + self.tutorial.version_announce = self.tutorial.version_announce or 0 + self.tutorial.main_help_button = self.tutorial.main_help_button or 0 + self.tutorial.alert_frames = self.tutorial.alert_frames or {false, false, false, false, false, false} + self.tutorial.logons = self.tutorial.logons + 1 + self.tutorial.main_help_button = self.tutorial.main_help_button + 1 + self.character_data = self.character_data or {logons = 0} + self.character_data.logons = self.character_data.logons + 1 + + --> class colors + if (not self.class_colors or not self.class_colors.version or self.class_colors.version < self.class_colors_version) then + self.class_colors = {version = 1} + for classe, tabela_cor in pairs ( RAID_CLASS_COLORS ) do + self.class_colors [classe] = {tabela_cor.r, tabela_cor.g, tabela_cor.b} + end + self.class_colors ["UNKNOW"] = {0.2, 0.2, 0.2} + self.class_colors ["UNGROUPPLAYER"] = {0.4, 0.4, 0.4} + self.class_colors ["PET"] = {0.3, 0.4, 0.5} + self.class_colors ["ENEMY"] = {0.94117, 0, 0.01960, 1} + end + + self.class_icons_small = self.class_icons_small or [[Interface\AddOns\Details\images\classes_small]] + + --> class coords + if (not self.class_coords or not self.class_coords.version or self.class_coords.version < self.class_coords_version) then + self.class_coords = {} + for class, tcoord in pairs (_G.CLASS_ICON_TCOORDS) do + self.class_coords [class] = tcoord + end + + self.class_coords ["Alliance"] = {0.49609375, 0.7421875, 0.75, 1} + self.class_coords ["Horde"] = {0.7421875, 0.98828125, 0.75, 1} + self.class_coords ["PET"] = {0.25, 0.49609375, 0.75, 1} + self.class_coords ["MONSTER"] = {0, 0.25, 0.75, 1} + self.class_coords ["ENEMY"] = {0, 0.25, 0.75, 1} + self.class_coords ["UNKNOW"] = {0.5, 0.75, 0.75, 1} + self.class_coords ["UNGROUPPLAYER"] = {0.5, 0.75, 0.75, 1} + end + + --> booleans + if (type (self.trash_concatenate) ~= "boolean") then + self.trash_concatenate = false + end + if (type (self.trash_auto_remove) ~= "boolean") then + self.trash_auto_remove = false + end + + if (type (self.only_pvp_frags) ~= "boolean") then + self.only_pvp_frags = false + end + + if (type (self.remove_realm_from_name) ~= "boolean") then + self.remove_realm_from_name = true + end + + if (type (self.cloud_capture) ~= "boolean") then + self.cloud_capture = true + end + + if (type (self.segments_panic_mode) ~= "boolean") then + self.segments_panic_mode = true + end + + if (type (self.clear_graphic) ~= "boolean") then + self.clear_graphic = self.clear_graphic or true + end + + if (type (self.clear_ungrouped) ~= "boolean") then + self.clear_ungrouped = self.clear_ungrouped or true + end + + if (type (self.use_row_animations) ~= "boolean") then + self.use_row_animations = self.use_row_animations or false + end + end \ No newline at end of file diff --git a/functions/skins.lua b/functions/skins.lua index 7cd71d7c..32115335 100644 --- a/functions/skins.lua +++ b/functions/skins.lua @@ -38,7 +38,23 @@ local _ can_change_alpha_head = false, icon_anchor_main = {-1, 1}, icon_anchor_plugins = {-9, -7}, - icon_plugins_size = {19, 19} + icon_plugins_size = {19, 19}, + + -- the four anchors: + icon_point_anchor = {-37, 0}, + left_corner_anchor = {-107, 0}, + close_button_anchor = {5, -6}, + right_corner_anchor = {96, 0}, + + icon_point_anchor_bottom = {-37, 0}, + left_corner_anchor_bottom = {-107, 0}, + close_button_anchor_bottom = {5, 6}, + right_corner_anchor_bottom = {96, 0}, + + instance_cprops = { + menu_anchor = {5, 1}, + } + }) _detalhes:InstallSkin ("Flat Color", { @@ -47,21 +63,81 @@ local _ version = "1.0", site = "unknown", desc = "a flat skin", + + micro_frames = {color = {1, 1, 1, 1}, font = "Friz Quadrata TT", size = 10}, + can_change_alpha_head = true, icon_anchor_main = {-1, -5}, icon_anchor_plugins = {-7, -13}, - icon_plugins_size = {19, 18} + icon_plugins_size = {19, 18}, + + -- the four anchors: + icon_point_anchor = {-37, 0}, + left_corner_anchor = {-107, 0}, + close_button_anchor = {5, -6}, + right_corner_anchor = {96, 0}, + + icon_point_anchor_bottom = {-37, 12}, + left_corner_anchor_bottom = {-107, 0}, + close_button_anchor_bottom = {5, 6}, + right_corner_anchor_bottom = {96, 0}, }) + -- 0.00048828125 + --reset 19 514 83 530 + --close + _detalhes:InstallSkin ("Simply Gray", { file = [[Interface\AddOns\Details\images\skins\simplygray_skin]], author = "Details!", version = "1.0", site = "unknown", desc = "a flat skin", + + --general can_change_alpha_head = true, - icon_anchor_main = {-1, -5}, - icon_anchor_plugins = {-7, -13}, - icon_plugins_size = {19, 18} + + --icon anchors + icon_anchor_main = {-1, -5}, + icon_anchor_plugins = {-7, -13}, + icon_plugins_size = {19, 18}, + + --micro frames + micro_frames = {color = {.7, .7, .7, 1}, font = "Arial Narrow", size = 11}, + + --reset button + reset_button_coords = {0.01904296875, 0.0673828125, 0.50244140625, 0.51708984375}, + reset_button_small_coords = {0.11669921875, 0.13720703125, 0.50244140625, 0.51708984375}, + + --instance button + instance_button_coords = {0.01904296875, 0.04736328125, 0.48388671875, 0.49853515625}, + + --close button + close_button_coords = {0.01904296875, 0.03369140625, 0.52197265625, 0.53662109375}, + close_button_size = {18, 18}, + + -- the four anchors (for when the toolbar is on the top side) + icon_point_anchor = {-37, 0}, + left_corner_anchor = {-107, 0}, + close_button_anchor = {-2, 0}, + right_corner_anchor = {96, 0}, + + -- the four anchors (for when the toolbar is on the bottom side) + icon_point_anchor_bottom = {-37, 12}, + left_corner_anchor_bottom = {-107, 0}, + close_button_anchor_bottom = {-2, 0}, + right_corner_anchor_bottom = {96, 0}, + + --instance overwrites + --[[ when a skin is selected, all customized properties of the window is reseted and then the overwrites are applied]] + --[[ for the complete cprop list see the file classe_instancia_include.lua]] + instance_cprops = { + resetbutton_info = {text_color = {0.7, 0.7, 0.7, 1}, text_face = "Friz Quadrata TT", text_size = 12, color_overlay = {.5, .5, .5, 1}}, + instancebutton_info = {text_color = {.7, .7, .7, 1}, text_face = "Friz Quadrata TT", text_size = 12, color_overlay = {.5, .5, .5, 1}}, + menu_anchor = {-18, 1}, + instance_button_anchor = {-27, 3}, + hide_icon = true, + } + }) \ No newline at end of file diff --git a/functions/slash.lua b/functions/slash.lua index 7bf0eae5..abf2173b 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -294,6 +294,18 @@ function SlashCmdList.DETAILS (msg, editbox) print (Loc ["STRING_DETAILS1"] .. "capture has been reseted.") --> debug + elseif (command == "barra") then + + local qual_barra = rest and tonumber (rest) or 1 + + local instancia = _detalhes.tabela_instancias [1] + local barra = instancia.barras [qual_barra] + + for i = 1, barra:GetNumPoints() do + local point, relativeTo, relativePoint, xOfs, yOfs = barra:GetPoint (i) + print (point, relativeTo, relativePoint, xOfs, yOfs) + end + elseif (msg == "opened") then print ("Instances opened: " .. _detalhes.opened_windows) diff --git a/gumps/fw_mods.lua b/gumps/fw_mods.lua index b7e9aca6..696eddb3 100644 --- a/gumps/fw_mods.lua +++ b/gumps/fw_mods.lua @@ -642,23 +642,23 @@ function gump:NewScrollBar (master, slave, x, y) slider_gump:SetScript ("OnEnable", function (self) botao_cima:Enable() botao_baixo:Enable() - end) + end) master:SetScript ("OnMouseWheel", function (self, delta) if (not slider_gump:IsEnabled()) then return end - + local current = slider_gump:GetValue() if (delta < 0) then - if (current < slider_gump.scrollMax+20) then - slider_gump:SetValue (current + 20) + if (current < slider_gump.scrollMax + (master.wheel_jump or 20)) then + slider_gump:SetValue (current + (master.wheel_jump or 20)) else slider_gump:SetValue (slider_gump.scrollMax) end elseif (delta > 0) then - if (current+20 > 0) then - slider_gump:SetValue (current - 20) + if (current + (master.wheel_jump or 20) > 0) then + slider_gump:SetValue (current - (master.wheel_jump or 20)) else slider_gump:SetValue (0) end diff --git a/gumps/janela_info.lua b/gumps/janela_info.lua index 821bd376..fe0e5f7f 100644 --- a/gumps/janela_info.lua +++ b/gumps/janela_info.lua @@ -1252,7 +1252,7 @@ end local function CriaTexturaBarra (instancia, barra) barra.textura = _CreateFrame ("StatusBar", nil, barra) barra.textura:SetAllPoints (barra) - --barra.textura:SetStatusBarTexture (instancia.barrasInfo.textura) + --barra.textura:SetStatusBarTexture (instancia.row_info.texture_file) barra.textura:SetStatusBarTexture (_detalhes.default_texture) barra.textura:SetStatusBarColor(.5, .5, .5, 0) barra.textura:SetMinMaxValues(0,100) diff --git a/gumps/janela_news.lua b/gumps/janela_news.lua index 0f567531..c3c7a689 100644 --- a/gumps/janela_news.lua +++ b/gumps/janela_news.lua @@ -50,6 +50,15 @@ function _detalhes:CreateOrOpenNewsWindow() titulo:SetPoint ("center", frame, "center") titulo:SetPoint ("top", frame, "top", 0, -18) + --> reinstall textura + local textura = _detalhes.gump:NewImage (frame, _, "$parentExclamacao", nil, 64, 64, [[Interface\DialogFrame\DialogAlertIcon]]) + textura:SetPoint ("topleft", frame, "topleft", 60, -20) + --> reinstall aviso + local reinstall = _detalhes.gump:NewLabel (frame, nil, "$parentReinstall", nil, "", "GameFontHighlightLeft", 10) + reinstall:SetPoint ("left", textura, "right", 2, -2) + reinstall.text = Loc ["STRING_NEWS_REINSTALL"] + + local frame_upper = CreateFrame ("scrollframe", nil, frame) local frame_lower = CreateFrame ("frame", nil, frame_upper) frame_lower:SetSize (380, 390) diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index fbe60a1f..dd82f772 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -1,18 +1,14 @@ ---[[ - Como sera dividido o painel de opções: - - - - ---]] +--[[ options panel file --]] local _detalhes = _G._detalhes local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") +local LDB = LibStub ("LibDataBroker-1.1", true) +local LDBIcon = LDB and LibStub ("LibDBIcon-1.0", true) local g = _detalhes.gump local _ -local preset_version = 1 +local preset_version = 2 function _detalhes:OpenOptionsWindow (instance) @@ -102,10 +98,17 @@ function _detalhes:OpenOptionsWindow (instance) --> select instance dropbox local onSelectInstance = function (_, _, instance) + local this_instance = _detalhes.tabela_instancias [instance] + if (not this_instance.iniciada) then this_instance:RestauraJanela (instance) + + elseif (not this_instance:IsEnabled()) then + _detalhes.CriarInstancia (_, _, this_instance.meu_id) + end + _detalhes:OpenOptionsWindow (this_instance) end @@ -144,7 +147,7 @@ function _detalhes:OpenOptionsWindow (instance) return InstanceList end - local instances = g:NewDropDown (window, _, "$parentInstanceSelectDropdown", "instanceDropdown", 180, 18, buildInstanceMenu, nil) + local instances = g:NewDropDown (window, _, "$parentInstanceSelectDropdown", "instanceDropdown", 200, 18, buildInstanceMenu, nil) instances:SetPoint ("bottomright", window, "bottomright", -17, 13) local instances_string = g:NewLabel (window, nil, nil, "instancetext", Loc ["STRING_OPTIONS_EDITINSTANCE"], "GameFontNormal", 12) @@ -170,11 +173,13 @@ function _detalhes:OpenOptionsWindow (instance) instances_string:Hide() end + -- ~altura + if (options_type == 1) then window.options [1][1].slider:SetMinMaxValues (0, 110) elseif (options_type == 2) then - window.options [2][1].slider:SetMinMaxValues (0, 620) - window.options [2][1].slider.scrollMax = 620 + window.options [2][1].slider:SetMinMaxValues (0, 1300) + window.options [2][1].slider.scrollMax = 1300 elseif (options_type == 3) then window.options [3][1].slider:SetMinMaxValues (0, 180) end @@ -272,6 +277,7 @@ function _detalhes:OpenOptionsWindow (instance) container_window.slider:Altura (225) container_window.slider:cimaPoint (0, 1) container_window.slider:baixoPoint (0, -3) + container_window.wheel_jump = 80 container_window.ultimo = 0 container_window.gump = container_slave @@ -283,7 +289,7 @@ function _detalhes:OpenOptionsWindow (instance) table.insert (window.options [1], window:create_box (1)) table.insert (window.options [2], window:create_box (2)) table.insert (window.options [3], window:create_box (3)) - + function window:hide_options (options) for _, widget in ipairs (window.options [options]) do widget:Hide() @@ -300,7 +306,7 @@ function _detalhes:OpenOptionsWindow (instance) if (self.background_frame) then self = self.background_frame end - self:SetBackdropColor (0, 0, 0, 0) + if (self.parent and self.parent.info) then info_text.active = true info_text.text = self.parent.info @@ -310,10 +316,10 @@ function _detalhes:OpenOptionsWindow (instance) if (self.background_frame) then self = self.background_frame end - self:SetBackdropColor (0, 0, 0, 0) + --self:SetBackdropColor (0, 0, 0, 0) if (info_text.active) then info_text.active = false - info_text.text = "" + --info_text.text = "" end end @@ -510,136 +516,90 @@ function _detalhes:OpenOptionsWindow (instance) frame1.timetypeDropdown:SetHook ("OnEnter", background_on_enter) frame1.timetypeDropdown:SetHook ("OnLeave", background_on_leave) + --------------- Minimap Icon + g:NewLabel (frame1, _, "$parentMinimapLabel", "minimapLabel", Loc ["STRING_OPTIONS_MINIMAP"]) + frame1.minimapLabel:SetPoint (10, -310) + -- + g:NewSwitch (frame1, _, "$parentMinimapSlider", "minimapSlider", 60, 20, _, _, not _detalhes.minimap.hide) + frame1.minimapSlider:SetPoint ("left", frame1.minimapLabel, "right", 2, 0) + frame1.minimapSlider.OnSwitch = function (self, _, value) + _detalhes.minimap.hide = not value + + LDBIcon:Refresh ("Details!", _detalhes.minimap) + if (_detalhes.minimap.hide) then + LDBIcon:Hide ("Details!") + else + LDBIcon:Show ("Details!") + end + end + + frame1.minimapSlider.info = Loc ["STRING_OPTIONS_MINIMAP_DESC"] + + window:create_line_background (frame1, frame1.minimapLabel, frame1.minimapSlider) + frame1.minimapSlider:SetHook ("OnEnter", background_on_enter) + frame1.minimapSlider:SetHook ("OnLeave", background_on_leave) + ---------------- appearance local frame2 = window.options [2][1].gump + --skin + local titulo_skin = g:NewLabel (frame2, _, "$parentTituloSkin", "tituloSkinLabel", Loc ["STRING_OPTIONS_SKIN_A"], "GameFontNormal", 16) + local titulo_skin_desc = g:NewLabel (frame2, _, "$parentTituloSkin2", "tituloSkin2Label", Loc ["STRING_OPTIONS_SKIN_A_DESC"], "GameFontNormal", 9, "white") + titulo_skin_desc.width = 250 + + --bars general local titulo_bars = g:NewLabel (frame2, _, "$parentTituloPersona", "tituloBarsLabel", Loc ["STRING_OPTIONS_BARS"], "GameFontNormal", 16) local titulo_bars_desc = g:NewLabel (frame2, _, "$parentTituloPersona2", "tituloBars2Label", Loc ["STRING_OPTIONS_BARS_DESC"], "GameFontNormal", 9, "white") titulo_bars_desc.width = 250 + --bars text local titulo_texts = g:NewLabel (frame2, _, "$parentTituloPersona", "tituloBarsLabel", Loc ["STRING_OPTIONS_TEXT"], "GameFontNormal", 16) local titulo_texts_desc = g:NewLabel (frame2, _, "$parentTituloPersona2", "tituloBars2Label", Loc ["STRING_OPTIONS_TEXT_DESC"], "GameFontNormal", 9, "white") titulo_texts_desc.width = 250 + --window local titulo_instance = g:NewLabel (frame2, _, "$parentTituloPersona", "tituloBarsLabel", Loc ["STRING_OPTIONS_INSTANCE"], "GameFontNormal", 16) local titulo_instance_desc = g:NewLabel (frame2, _, "$parentTituloPersona2", "tituloBars2Label", Loc ["STRING_OPTIONS_INSTANCE_DESC"], "GameFontNormal", 9, "white") titulo_instance_desc.width = 250 + --toolbar + local titulo_toolbar = g:NewLabel (frame2, _, "$parentTituloToolbar", "tituloToolbarLabel", Loc ["STRING_OPTIONS_TOOLBAR_SETTINGS"], "GameFontNormal", 16) + local titulo_toolbar_desc = g:NewLabel (frame2, _, "$parentTituloToolbar2", "tituloToolbar2Label", Loc ["STRING_OPTIONS_TOOLBAR_SETTINGS_DESC"], "GameFontNormal", 9, "white") + titulo_toolbar_desc.width = 250 + + --wallpaper local titulo_wallpaper = g:NewLabel (frame2, _, "$parentTituloPersona", "tituloBarsLabel", Loc ["STRING_OPTIONS_WP"], "GameFontNormal", 16) local titulo_wallpaper_desc = g:NewLabel (frame2, _, "$parentTituloPersona2", "tituloBars2Label", Loc ["STRING_OPTIONS_WP_DESC"], "GameFontNormal", 9, "white") titulo_wallpaper_desc.width = 250 + --save load local titulo_save = g:NewLabel (frame2, _, "$parentTituloPersona", "tituloBarsLabel", Loc ["STRING_OPTIONS_SAVELOAD"], "GameFontNormal", 16) local titulo_save_desc = g:NewLabel (frame2, _, "$parentTituloPersona2", "tituloBars2Label", Loc ["STRING_OPTIONS_SAVELOAD_DESC"], "GameFontNormal", 9, "white") titulo_save_desc.width = 250 - + --> create functions and frames first: - - local default_preset = { - ["font_fixed_text_color"] = { - 1, -- [1] - 1, -- [2] - 1, -- [3] - }, - ["bar_background_by_class"] = false, - ["bar_background"] = "Details D'ictum", - ["font_textL_class"] = false, - ["wallpaper"] = { - ["enabled"] = false, - ["texcoord"] = { - 0, -- [1] - 1, -- [2] - 0, -- [3] - 1, -- [4] - }, - ["overlay"] = { - 1, -- [1] - 1, -- [2] - 1, -- [3] - 1, -- [4] - }, - ["anchor"] = "all", - ["height"] = 0, - ["alpha"] = 0.5, - ["width"] = 0, - }, - ["instance_skin"] = "Default Skin", - ["name"] = "default", - ["instance_color"] = { - 1, -- [1] - 1, -- [2] - 1, -- [3] - 1, -- [4] - }, - ["instance_bg_colors"] = { - 0.0941, -- [1] - 0.0941, -- [2] - 0.0941, -- [3] - }, - ["font_textR_class"] = false, - ["font_face"] = "Arial Narrow", - ["font_textR_outline"] = false, - ["font_size"] = 10.5, - ["font_textL_outline"] = false, - ["version"] = 1, - ["bar_fixed_texture_color"] = { - 0, -- [1] - 0, -- [2] - 0, -- [3] - }, - ["bar_background_color"] = { - 0, -- [1] - 0, -- [2] - 0, -- [3] - 0, -- [4] - }, - ["bar_color_by_class"] = true, - ["instance_alpha"] = 0.7599999904632568, - ["bar_texture"] = "Details D'ictum", - } - local function saveStyleFunc (temp) - if ((not frame2.saveStyleName.text or frame2.saveStyleName.text == "") and not temp) then _detalhes:Msg (Loc ["STRING_OPTIONS_PRESETNONAME"]) return end - local w = window.instance.wallpaper - local savedObject = { - --> geral - version = 1, - name = frame2.saveStyleName.text, --> preset name - - --> bars - bar_texture = frame2.textureDropdown.value, - bar_color_by_class = window.instance.row_texture_class_colors, - bar_fixed_texture_color = {unpack (window.instance.fixed_row_texture_color)}, - bar_background = window.instance.barrasInfo.textureNameBackground, - bar_background_color = {unpack (window.instance.barrasInfo.texturaBackgroundColor)}, - bar_background_by_class = window.instance.barrasInfo.texturaBackgroundByClass, - - --> text - font_size = tonumber (frame2.fonsizeSlider.value), - font_face = frame2.fontDropdown.value, - font_textL_class = window.instance.row_textL_class_colors, - font_textR_class = window.instance.row_textR_class_colors, - font_textL_outline = window.instance.row_textL_outline, - font_textR_outline = window.instance.row_textR_outline, - font_fixed_text_color = {unpack (window.instance.fixed_row_text_color)}, - - --> instance - instance_color = {unpack (window.instance.color)}, - instance_bg_colors = {window.instance.bg_r, window.instance.bg_g, window.instance.bg_b}, - instance_alpha = tonumber (frame2.alphaSlider.value), - instance_skin = window.instance.skin, - - --> wallpaper - wallpaper = {texture = w.texture, enabled = w.enabled, texcoord = {unpack (w.texcoord)}, overlay = {unpack(w.overlay)}, anchor = w.anchor, height = w.height, alpha = w.alpha, width = w.width}, + version = 2, + name = frame2.saveStyleName.text, --> preset name } + for key, value in pairs (window.instance) do + if (_detalhes.instance_defaults [key]) then + if (type (value) == "table") then + savedObject [key] = table_deepcopy (value) + else + savedObject [key] = value + end + end + end + if (temp) then return savedObject end @@ -656,50 +616,39 @@ function _detalhes:OpenOptionsWindow (instance) style = index else style = _detalhes.savedStyles [index] + if (not style.version or preset_version > style.version) then + return _detalhes:Msg (Loc ["STRING_OPTIONS_PRESETTOOLD"]) + end end - if (not style.version or preset_version > style.version) then - return _detalhes:Msg (Loc ["STRING_OPTIONS_PRESETTOOLD"]) + --> set skin preset + local skin = style.skin + instance.skin = "" + instance:ChangeSkin (skin) + + --> overwrite all instance parameters with saved ones + for key, value in pairs (style) do + if (key ~= "skin") then + if (type (value) == "table") then + instance [key] = table_deepcopy (value) + else + instance [key] = value + end + end end - --> bars - instance.barrasInfo.textura = SharedMedia:Fetch ("statusbar", style.bar_texture) - instance.barrasInfo.textureName = style.bar_texture - instance.row_texture_class_colors = style.bar_color_by_class - instance.fixed_row_texture_color = {unpack (style.bar_fixed_texture_color)} - instance.barrasInfo.texturaBackground = SharedMedia:Fetch ("statusbar", style.bar_background) - instance.barrasInfo.textureNameBackground = style.bar_background - instance.barrasInfo.texturaBackgroundColor = {unpack (style.bar_background_color)} - instance.barrasInfo.texturaBackgroundByClass = style.bar_background_by_class - - --> texts - instance.barrasInfo.font = SharedMedia:Fetch ("font", style.font_face) - instance.barrasInfo.fontName = style.font_face - instance.barrasInfo.fontSize = tonumber (style.font_size) - instance.row_textL_class_colors = style.font_textL_class - instance.row_textR_class_colors = style.font_textR_class - instance.row_textL_outline = style.font_textL_outline - instance.row_textR_outline = style.font_textR_outline - instance.fixed_row_text_color = {unpack (style.font_fixed_text_color)} - - --> instance - instance:InstanceColor (style.instance_color) - instance:SetBackgroundAlpha (style.instance_alpha) - instance:SetBackgroundColor (style.instance_bg_colors) - instance:ChangeSkin (style.instance_skin) - - --> wallpaper - instance:InstanceWallpaper (style.wallpaper) - - --> refresh - instance:RefreshBars() - instance:InstanceReset() - instance:InstanceRefreshRows() + --> apply all changed attributes + instance:ChangeSkin() + --> reload options panel _detalhes:OpenOptionsWindow (instance) end + local resetToDefaults = function() + loadStyle (nil, window.instance, _detalhes.instance_defaults) + end + ------ apply to all button local applyToAll = function() @@ -715,11 +664,6 @@ function _detalhes:OpenOptionsWindow (instance) _detalhes:OpenOptionsWindow (current_instance) end - - local resetToDefaults = function() - loadStyle (nil, window.instance, default_preset) - _detalhes:OpenOptionsWindow (window.instance) - end --> save and load stuff g:NewTextEntry (frame2, _, "$parentSaveStyleName", "saveStyleName", nil, 20, _, _, _, 178) --width will be auto adjusted if space parameter is passed @@ -730,7 +674,7 @@ function _detalhes:OpenOptionsWindow (instance) g:NewButton (frame2, _, "$parentResetToDefaultButton", "resetToDefaults", 100, 14, resetToDefaults, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_RESET"]) --> text size - g:NewSlider (frame2, _, "$parentSliderFontSize", "fonsizeSlider", SLIDER_WIDTH, 20, 8, 15, 1, tonumber (instance.barrasInfo.fontSize)) + g:NewSlider (frame2, _, "$parentSliderFontSize", "fonsizeSlider", SLIDER_WIDTH, 20, 8, 15, 1, tonumber (instance.row_info.font_size)) --> instance color local selectedColor = function() @@ -739,8 +683,7 @@ function _detalhes:OpenOptionsWindow (instance) frame2.instancecolortexture:SetTexture (r, g, b) frame2.instancecolortexture:SetAlpha (a) - - window.instance.color[1], window.instance.color[2], window.instance.color[3], window.instance.color[4] = r, g, b, a + window.instance:InstanceColor (r, g, b, a) end @@ -749,7 +692,6 @@ function _detalhes:OpenOptionsWindow (instance) frame2.instancecolortexture:SetTexture (c [1], c [2], c [3]) frame2.instancecolortexture:SetAlpha (c [4]) - window.instance.color[1], window.instance.color[2], window.instance.color[3], window.instance.color[4] = c [1], c [2], c [3], c [4] window.instance:InstanceColor (c [1], c [2], c [3], c [4]) ColorPickerFrame.func = nil @@ -766,7 +708,6 @@ function _detalhes:OpenOptionsWindow (instance) frame2.instancecolortexture:SetTexture (r, g, b) frame2.instancecolortexture:SetAlpha (a) - window.instance.color[1], window.instance.color[2], window.instance.color[3], window.instance.color[4] = r, g, b, a window.instance:InstanceColor (r, g, b, a) end @@ -790,25 +731,15 @@ function _detalhes:OpenOptionsWindow (instance) local selectedRowBackgroundColor = function() local r, g, b = ColorPickerFrame:GetColorRGB() local a = OpacitySliderFrame:GetValue() - - local c = window.instance.barrasInfo.texturaBackgroundColor - c [1], c [2], c [3], c [4] = r, g, b, a - - window.instance:RefreshBars() - window.instance:InstanceReset() - window.instance:InstanceRefreshRows() - frame2.rowBackgroundColorTexture:SetTexture (r, g, b, a) + + window.instance:SetBarSettings (nil, nil, nil, nil, nil, nil, {r, g, b, a}) end local canceledRowBackgroundColor = function() - local c = window.instance.barrasInfo.texturaBackgroundColor - c [1], c [2], c [3], c [4] = unpack (ColorPickerFrame.previousValues) - - window.instance:RefreshBars() - window.instance:InstanceReset() - window.instance:InstanceRefreshRows() - + frame2.rowBackgroundColorTexture:SetTexture (unpack (ColorPickerFrame.previousValues)) + window.instance:SetBarSettings (nil, nil, nil, nil, nil, nil, ColorPickerFrame.previousValues) + ColorPickerFrame.func = nil ColorPickerFrame.opacityFunc = nil ColorPickerFrame.cancelFunc = nil @@ -817,15 +748,8 @@ function _detalhes:OpenOptionsWindow (instance) local selectedRowBackgroundAlpha = function() local r, g, b = ColorPickerFrame:GetColorRGB() local a = OpacitySliderFrame:GetValue() - - local c = window.instance.barrasInfo.texturaBackgroundColor - c [1], c [2], c [3], c [4] = r, g, b, a - - window.instance:RefreshBars() - window.instance:InstanceReset() - window.instance:InstanceRefreshRows() - frame2.rowBackgroundColorTexture:SetTexture (r, g, b, a) + window.instance:SetBarSettings (nil, nil, nil, nil, nil, nil, {r, g, b, a}) end local colorpickRowBackground = function() @@ -833,10 +757,10 @@ function _detalhes:OpenOptionsWindow (instance) ColorPickerFrame.opacityFunc = selectedRowBackgroundAlpha ColorPickerFrame.cancelFunc = canceledRowBackgroundColor ColorPickerFrame.hasOpacity = true --false - ColorPickerFrame.opacity = window.instance.barrasInfo.texturaBackgroundColor[4] - ColorPickerFrame.previousValues = window.instance.barrasInfo.texturaBackgroundColor + ColorPickerFrame.opacity = window.instance.row_info.fixed_texture_background_color[4] + ColorPickerFrame.previousValues = window.instance.row_info.fixed_texture_background_color ColorPickerFrame:SetParent (window.widget) - ColorPickerFrame:SetColorRGB (unpack (window.instance.barrasInfo.texturaBackgroundColor)) + ColorPickerFrame:SetColorRGB (unpack (window.instance.row_info.fixed_texture_background_color)) ColorPickerFrame:Show() end @@ -844,10 +768,10 @@ function _detalhes:OpenOptionsWindow (instance) g:NewButton (frame2, _, "$parentRowBackgroundColorButton", "rowBackgroundColorButton", COLOR_BUTTON_WIDTH, 14, colorpickRowBackground, nil, nil, nil, Loc ["STRING_OPTIONS_PICKCOLOR"]) --> background with class color - g:NewSwitch (frame2, _, "$parentBackgroundClassColorSlider", "rowBackgroundColorByClassSlider", 60, 20, _, _, instance.barrasInfo.texturaBackgroundByClass) + g:NewSwitch (frame2, _, "$parentBackgroundClassColorSlider", "rowBackgroundColorByClassSlider", 60, 20, _, _, instance.row_info.texture_background_class_color) --> bar height - g:NewSlider (frame2, _, "$parentSliderRowHeight", "rowHeightSlider", SLIDER_WIDTH, 20, 10, 30, 1, tonumber (instance.barrasInfo.altura)) + g:NewSlider (frame2, _, "$parentSliderRowHeight", "rowHeightSlider", SLIDER_WIDTH, 20, 10, 30, 1, tonumber (instance.row_info.height)) --> transparency g:NewSlider (frame2, _, "$parentAlphaSlider", "alphaSlider", SLIDER_WIDTH, 20, 0.02, 1, 0.02, instance.bg_alpha, true) @@ -882,32 +806,164 @@ function _detalhes:OpenOptionsWindow (instance) --> auto current segment g:NewSwitch (frame2, _, "$parentAutoCurrentSlider", "autoCurrentSlider", 60, 20, _, _, instance.auto_current) - + + --> sidebars statusbar + g:NewSwitch (frame2, _, "$parentSideBarsSlider", "sideBarsSlider", 60, 20, _, _, instance.show_sidebars) + g:NewSwitch (frame2, _, "$parentStatusbarSlider", "statusbarSlider", 60, 20, _, _, instance.show_statusbar) + + --> desaturate + g:NewSwitch (frame2, _, "$parentDesaturateMenuSlider", "desaturateMenuSlider", 60, 20, _, _, instance.desaturated_menu) + + --> hide icon + g:NewSwitch (frame2, _, "$parentHideIconSlider", "hideIconSlider", 60, 20, _, _, instance.hide_icon) + + --> instance button anchor + g:NewSlider (frame2, _, "$parentInstanceButtonAnchorXSlider", "instanceButtonAnchorXSlider", SLIDER_WIDTH, 20, -200, 20, 1, instance.instance_button_anchor[1]) + g:NewSlider (frame2, _, "$parentInstanceButtonAnchorYSlider", "instanceButtonAnchorYSlider", SLIDER_WIDTH, 20, -10, 10, 1, instance.instance_button_anchor[2]) + + --> menu anchor + g:NewSlider (frame2, _, "$parentMenuAnchorXSlider", "menuAnchorXSlider", SLIDER_WIDTH, 20, -20, 200, 1, instance.menu_anchor[1]) + g:NewSlider (frame2, _, "$parentMenuAnchorYSlider", "menuAnchorYSlider", SLIDER_WIDTH, 20, -10, 10, 1, instance.menu_anchor[2]) + + --> close button + --button overlay + local close_overlay_color_callback = function (_, r, g, b, a) + frame2.closeOverlayColorImage:SetTexture (r, g, b, a) + window.instance:SetCloseButtonSettings ({r, g, b, a}) + end + local close_overlay_color_onclick = function() + local color_table = window.instance.closebutton_info.color_overlay + g:ColorPick (frame2.closeOverlayColorButton.widget, color_table[1], color_table[2], color_table[3], color_table[4], close_overlay_color_callback) + end + g:NewImage (frame2, nil, "$parentCloseOverlayColorImage", "closeOverlayColorImage", COLOR_BUTTON_WIDTH, 12, instance.closebutton_info.color_overlay) + g:NewButton (frame2, nil, "$parentCloseOverlayColorButton", "closeOverlayColorButton", COLOR_BUTTON_WIDTH, 14, close_overlay_color_onclick, nil, nil, nil, "color") + + --> reset button + --text color pick + local reset_text_color_callback = function (_, r, g, b, a) + frame2.resetTextColorImage:SetTexture (r, g, b, a) + window.instance:SetDeleteButtonSettings (nil, nil, {r, g, b, a}, nil) + end + local reset_text_color_onclick = function() + local color_table = window.instance.resetbutton_info.text_color + g:ColorPick (frame2.resetTextColorButton.widget, color_table[1], color_table[2], color_table[3], color_table[4], reset_text_color_callback) + end + g:NewImage (frame2, nil, "$parentResetTextColorImage", "resetTextColorImage", COLOR_BUTTON_WIDTH, 12, instance.resetbutton_info.text_color) + g:NewButton (frame2, nil, "$parentResetTextColorButton", "resetTextColorButton", COLOR_BUTTON_WIDTH, 14, reset_text_color_onclick, nil, nil, nil, "color") + + --text size + g:NewSlider (frame2, _, "$parentResetTextSizeSlider", "resetTextSizeSlider", SLIDER_WIDTH, 20, 8, 15, 1, tonumber (instance.resetbutton_info.text_size)) + frame2.resetTextSizeSlider:SetHook ("OnValueChange", function (self, instance, amount) + instance:SetDeleteButtonSettings (nil, amount) + end) + + --button overlay + local reset_overlay_color_callback = function (_, r, g, b, a) + frame2.resetOverlayColorImage:SetTexture (r, g, b, a) + window.instance:SetDeleteButtonSettings (nil, nil, nil, {r, g, b, a}) + end + local reset_overlay_color_onclick = function() + local color_table = window.instance.resetbutton_info.color_overlay + g:ColorPick (frame2.resetOverlayColorButton.widget, color_table[1], color_table[2], color_table[3], color_table[4], reset_overlay_color_callback) + end + g:NewImage (frame2, nil, "$parentResetOverlayColorImage", "resetOverlayColorImage", COLOR_BUTTON_WIDTH, 12, instance.resetbutton_info.color_overlay) + g:NewButton (frame2, nil, "$parentResetOverlayColorButton", "resetOverlayColorButton", COLOR_BUTTON_WIDTH, 14, reset_overlay_color_onclick, nil, nil, nil, "color") + --reset always small + g:NewSwitch (frame2, _, "$parentResetAlwaysSmallSlider", "resetAlwaysSmallSlider", 60, 20, _, _, instance.resetbutton_info.always_small) + + --text face + local reset_text_color_onselectfont = function (_, instance, fontName) + window.instance:SetDeleteButtonSettings (fontName) + end + local reset_text_color_build_font_menu = function() + local fontObjects = SharedMedia:HashTable ("font") + local fontTable = {} + for name, fontPath in pairs (fontObjects) do + fontTable[#fontTable+1] = {value = name, label = name, onclick = reset_text_color_onselectfont, font = fontPath} + end + return fontTable + end + g:NewDropDown (frame2, _, "$parentResetTextFontDropdown", "resetTextFontDropdown", DROPDOWN_WIDTH, 20, reset_text_color_build_font_menu, nil) + + --> stretch button anchor + g:NewSwitch (frame2, _, "$parentStretchAnchorSlider", "stretchAnchorSlider", 80, 20, Loc ["STRING_TOP"], Loc ["STRING_BOTTOM"], instance.stretch_button_side, true) + + --> plugins icons grow direction + g:NewSwitch (frame2, _, "$parentPluginIconsDirectionSlider", "pluginIconsDirectionSlider", 80, 20, Loc ["STRING_LEFT"], Loc ["STRING_RIGHT"], instance.plugins_grow_direction) + + --> instance toolbar side + g:NewSwitch (frame2, _, "$parentInstanceToolbarSideSlider", "instanceToolbarSideSlider", 80, 20, Loc ["STRING_TOP"], Loc ["STRING_BOTTOM"], instance.toolbar_side, true) + + --> bars grow direction + g:NewSwitch (frame2, _, "$parentBarGrowDirectionSlider", "barGrowDirectionSlider", 80, 20, Loc ["STRING_TOP"], Loc ["STRING_BOTTOM"], instance.bars_grow_direction, true) + + --> bars sort direction + g:NewSwitch (frame2, _, "$parentBarSortDirectionSlider", "barSortDirectionSlider", 80, 20, Loc ["STRING_TOP"], Loc ["STRING_BOTTOM"], instance.bars_sort_direction, true) + + --> instance button + --text color pick + local instance_text_color_callback = function (_, r, g, b, a) + frame2.instanceTextColorImage:SetTexture (r, g, b, a) + window.instance:SetInstanceButtonSettings (nil, nil, {r, g, b, a}) + end + local instance_text_color_onclick = function() + local color_table = window.instance.instancebutton_info.text_color + g:ColorPick (frame2.instanceTextColorButton.widget, color_table[1], color_table[2], color_table[3], color_table[4], instance_text_color_callback) + end + g:NewImage (frame2, nil, "$parentInstanceTextColorImage", "instanceTextColorImage", COLOR_BUTTON_WIDTH, 12, instance.instancebutton_info.text_color) + g:NewButton (frame2, nil, "$parentInstanceTextColorButton", "instanceTextColorButton", COLOR_BUTTON_WIDTH, 14, instance_text_color_onclick, nil, nil, nil, "color") + --text size + g:NewSlider (frame2, _, "$parentInstanceTextSizeSlider", "instanceTextSizeSlider", SLIDER_WIDTH, 20, 8, 15, 1, tonumber (instance.instancebutton_info.text_size)) + frame2.instanceTextSizeSlider:SetHook ("OnValueChange", function (self, instance, amount) + instance:SetInstanceButtonSettings (nil, amount) + end) + --button overlay + local instance_overlay_color_callback = function (_, r, g, b, a) + frame2.instanceOverlayColorImage:SetTexture (r, g, b, a) + window.instance:SetInstanceButtonSettings (nil, nil, nil, {r, g, b, a}) + end + local instance_overlay_color_onclick = function() + local color_table = window.instance.instancebutton_info.color_overlay + g:ColorPick (frame2.instanceOverlayColorButton.widget, color_table[1], color_table[2], color_table[3], color_table[4], instance_overlay_color_callback) + end + g:NewImage (frame2, nil, "$parentInstanceOverlayColorImage", "instanceOverlayColorImage", COLOR_BUTTON_WIDTH, 12, instance.instancebutton_info.color_overlay) + g:NewButton (frame2, nil, "$parentInstanceOverlayColorButton", "instanceOverlayColorButton", COLOR_BUTTON_WIDTH, 14, instance_overlay_color_onclick, nil, nil, nil, "color") + --text face + local instance_text_color_onselectfont = function (_, instance, fontName) + instance:SetInstanceButtonSettings (fontName) + end + local instance_text_color_build_font_menu = function() + local fontObjects = SharedMedia:HashTable ("font") + local fontTable = {} + for name, fontPath in pairs (fontObjects) do + fontTable[#fontTable+1] = {value = name, label = name, onclick = instance_text_color_onselectfont, font = fontPath} + end + return fontTable + end + g:NewDropDown (frame2, _, "$parentInstanceTextFontDropdown", "instanceTextFontDropdown", DROPDOWN_WIDTH, 20, instance_text_color_build_font_menu, nil) + --> bar texture by class color - g:NewSwitch (frame2, _, "$parentClassColorSlider", "classColorSlider", 60, 20, _, _, instance.row_texture_class_colors) + g:NewSwitch (frame2, _, "$parentClassColorSlider", "classColorSlider", 60, 20, _, _, instance.row_info.texture_class_colors) --> left text and right class color - g:NewSwitch (frame2, _, "$parentUseClassColorsLeftTextSlider", "classColorsLeftTextSlider", 60, 20, _, _, instance.row_textL_class_colors) - g:NewSwitch (frame2, _, "$parentUseClassColorsRightTextSlider", "classColorsRightTextSlider", 60, 20, _, _, instance.row_textR_class_colors) + g:NewSwitch (frame2, _, "$parentUseClassColorsLeftTextSlider", "classColorsLeftTextSlider", 60, 20, _, _, instance.row_info.textL_class_colors) + g:NewSwitch (frame2, _, "$parentUseClassColorsRightTextSlider", "classColorsRightTextSlider", 60, 20, _, _, instance.row_info.textR_class_colors) --> row texture color local selectedColorClass = function() local r, g, b = ColorPickerFrame:GetColorRGB() frame2.fixedRowColorTexture:SetTexture (r, g, b) - window.instance.fixed_row_texture_color[1], window.instance.fixed_row_texture_color[2], window.instance.fixed_row_texture_color[3] = r, g, b - instance:InstanceReset() - instance:InstanceRefreshRows() + + window.instance:SetBarSettings (nil, nil, nil, {r, g, b, 1}) end local canceledColorClass = function() local c = ColorPickerFrame.previousValues - frame2.fixedRowColorTexture:SetTexture (c [1], c [2], c [3]) + frame2.fixedRowColorTexture:SetTexture (c[1], c[2], c[3]) - window.instance.fixed_row_texture_color[1], window.instance.fixed_row_texture_color[2], window.instance.fixed_row_texture_color[3] = c [1], c [2], c [3] + window.instance:SetBarSettings (nil, nil, nil, {c[1], c[2], c[3], 1}) ColorPickerFrame.func = nil ColorPickerFrame.cancelFunc = nil - instance:InstanceReset() - instance:InstanceRefreshRows() end local colorpickClass = function() @@ -915,9 +971,9 @@ function _detalhes:OpenOptionsWindow (instance) ColorPickerFrame.cancelFunc = canceledColorClass ColorPickerFrame.opacityFunc = nil ColorPickerFrame.hasOpacity = false - ColorPickerFrame.previousValues = window.instance.fixed_row_texture_color + ColorPickerFrame.previousValues = window.instance.row_info.fixed_texture_color ColorPickerFrame:SetParent (window.widget) - ColorPickerFrame:SetColorRGB (unpack (window.instance.fixed_row_texture_color)) + ColorPickerFrame:SetColorRGB (unpack (window.instance.row_info.fixed_texture_color)) ColorPickerFrame:Show() end @@ -928,21 +984,16 @@ function _detalhes:OpenOptionsWindow (instance) local selectedTextColor = function() local r, g, b = ColorPickerFrame:GetColorRGB() frame2.fixedRowColorText:SetTexture (r, g, b) - window.instance.fixed_row_text_color[1], window.instance.fixed_row_text_color[2], window.instance.fixed_row_text_color[3] = r, g, b - instance:InstanceReset() - instance:InstanceRefreshRows() + window.instance:SetBarTextSettings (nil, nil, {r, g, b, 1}) end local canceledTextColor = function() local c = ColorPickerFrame.previousValues frame2.fixedRowColorText:SetTexture (c [1], c [2], c [3]) + window.instance:SetBarTextSettings (nil, nil, {c [1], c [2], c [3], 1}) - window.instance.fixed_row_text_color[1], window.instance.fixed_row_text_color[2], window.instance.fixed_row_text_color[3] = c [1], c [2], c [3] - ColorPickerFrame.func = nil ColorPickerFrame.cancelFunc = nil - instance:InstanceReset() - instance:InstanceRefreshRows() end local colorpickTextColor = function() @@ -950,9 +1001,9 @@ function _detalhes:OpenOptionsWindow (instance) ColorPickerFrame.cancelFunc = canceledTextColor ColorPickerFrame.opacityFunc = nil ColorPickerFrame.hasOpacity = false - ColorPickerFrame.previousValues = window.instance.fixed_row_text_color + ColorPickerFrame.previousValues = window.instance.row_info.fixed_text_color ColorPickerFrame:SetParent (window.widget) - ColorPickerFrame:SetColorRGB (unpack (window.instance.fixed_row_text_color)) + ColorPickerFrame:SetColorRGB (unpack (window.instance.row_info.fixed_text_color)) ColorPickerFrame:Show() end @@ -960,8 +1011,8 @@ function _detalhes:OpenOptionsWindow (instance) g:NewButton (frame2, _, "$parentFixedRowColorTButton", "fixedRowColorTButton", COLOR_BUTTON_WIDTH, 14, colorpickTextColor, nil, nil, nil, Loc ["STRING_OPTIONS_PICKCOLOR"]) --> outline - g:NewSwitch (frame2, _, "$parentTextLeftOutlineSlider", "textLeftOutlineSlider", 60, 20, _, _, instance.row_textL_outline) - g:NewSwitch (frame2, _, "$parentTextRightOutlineSlider", "textRightOutlineSlider", 60, 20, _, _, instance.row_textR_outline) + g:NewSwitch (frame2, _, "$parentTextLeftOutlineSlider", "textLeftOutlineSlider", 60, 20, _, _, instance.row_info.textL_outline) + g:NewSwitch (frame2, _, "$parentTextRightOutlineSlider", "textRightOutlineSlider", 60, 20, _, _, instance.row_info.textR_outline) --> wallpaper @@ -1192,25 +1243,11 @@ function _detalhes:OpenOptionsWindow (instance) g:NewDropDown (frame2, _, "$parentBackgroundDropdown", "backgroundDropdown", DROPDOWN_WIDTH, 20, buildBackgroundMenu, nil) g:NewDropDown (frame2, _, "$parentBackgroundDropdown2", "backgroundDropdown2", DROPDOWN_WIDTH, 20, buildBackgroundMenu2, nil) - --> bar texture - local onSelectTexture = function (_, instance, textureName) - instance.barrasInfo.textura = SharedMedia:Fetch ("statusbar", textureName) - instance.barrasInfo.textureName = textureName - instance:RefreshBars() - end - local textures = SharedMedia:HashTable ("statusbar") - local texTable = {} - for name, texturePath in pairs (textures) do - texTable[#texTable+1] = {value = name, label = name, statusbar = texturePath, onclick = onSelectTexture} - end - local buildTextureMenu = function() return texTable end - g:NewDropDown (frame2, _, "$parentTextureDropdown", "textureDropdown", DROPDOWN_WIDTH, 20, buildTextureMenu, nil) + --> text font local onSelectFont = function (_, instance, fontName) - instance.barrasInfo.font = SharedMedia:Fetch ("font", fontName) - instance.barrasInfo.fontName = fontName - instance:RefreshBars() + instance:SetBarTextSettings (nil, fontName) end local fontObjects = SharedMedia:HashTable ("font") local fontTable = {} @@ -1221,12 +1258,8 @@ function _detalhes:OpenOptionsWindow (instance) g:NewDropDown (frame2, _, "$parentFontDropdown", "fontDropdown", DROPDOWN_WIDTH, 20, buildFontMenu, nil) --> bar background - local onSelectTextureBackground = function (_, instance, textureName) - instance.barrasInfo.texturaBackground = SharedMedia:Fetch ("statusbar", textureName) - instance.barrasInfo.textureNameBackground = textureName - instance:RefreshBars() - instance:InstanceReset() - instance:InstanceRefreshRows() + local onSelectTextureBackground = function (_, instance, textureName) + instance:SetBarSettings (nil, nil, nil, nil, textureName) end local textures2 = SharedMedia:HashTable ("statusbar") @@ -1238,6 +1271,20 @@ function _detalhes:OpenOptionsWindow (instance) g:NewDropDown (frame2, _, "$parentRowBackgroundTextureDropdown", "rowBackgroundDropdown", DROPDOWN_WIDTH, 20, buildTextureMenu2, nil) + --> bar texture + local onSelectTexture = function (_, instance, textureName) + instance:SetBarSettings (nil, textureName) + end + + local textures = SharedMedia:HashTable ("statusbar") + local texTable = {} + for name, texturePath in pairs (textures) do + texTable[#texTable+1] = {value = name, label = name, statusbar = texturePath, onclick = onSelectTexture} + end + + local buildTextureMenu = function() return texTable end + g:NewDropDown (frame2, _, "$parentTextureDropdown", "textureDropdown", DROPDOWN_WIDTH, 20, buildTextureMenu, nil) + --> select skin local onSelectSkin = function (_, instance, skin_name) instance:ChangeSkin (skin_name) @@ -1280,10 +1327,10 @@ function _detalhes:OpenOptionsWindow (instance) -- background color g:NewLabel (frame2, _, "$parentRowBackgroundColorLabel", "rowBackgroundColorLabel", Loc ["STRING_OPTIONS_BAR_BCOLOR"]) - frame2.rowBackgroundColorTexture:SetPoint ("left", frame2.rowBackgroundColorLabel, "right", 2) + --frame2.rowBackgroundColorTexture:SetPoint ("left", frame2.rowBackgroundColorLabel, "right", 2) frame2.rowBackgroundColorTexture:SetTexture (1, 1, 1) - frame2.rowBackgroundColorButton:SetPoint ("left", frame2.rowBackgroundColorLabel, "right", 2) + frame2.rowBackgroundColorButton:SetPoint ("left", frame2.rowBackgroundColorTexture, "left") frame2.rowBackgroundColorButton:InstallCustomTexture() frame2.rowBackgroundColorButton.info = Loc ["STRING_OPTIONS_BAR_BCOLOR_DESC"] @@ -1296,10 +1343,7 @@ function _detalhes:OpenOptionsWindow (instance) frame2.rowBackgroundColorByClassSlider:SetPoint ("left", frame2.rowBackgroundColorByClassLabel, "right", 2) frame2.rowBackgroundColorByClassSlider.OnSwitch = function (self, instance, value) - instance.barrasInfo.texturaBackgroundByClass = value - instance:RefreshBars() - instance:InstanceReset() - instance:InstanceRefreshRows() + instance:SetBarSettings (nil, nil, nil, nil, nil, value) end frame2.rowBackgroundColorByClassSlider.info = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS2_DESC"] @@ -1313,8 +1357,8 @@ function _detalhes:OpenOptionsWindow (instance) frame2.rowHeightSlider:SetPoint ("left", frame2.rowHeightLabel, "right", 2) frame2.rowHeightSlider:SetThumbSize (50) frame2.rowHeightSlider:SetHook ("OnValueChange", function (self, instance, amount) - instance.barrasInfo.altura = amount - instance.barrasInfo.alturaReal = instance.barrasInfo.altura+instance.barrasInfo.espaco.entre + instance.row_info.height = amount + instance.row_height = instance.row_info.height+instance.row_info.space.between instance:RefreshBars() instance:InstanceReset() instance:ReajustaGump() @@ -1329,9 +1373,7 @@ function _detalhes:OpenOptionsWindow (instance) g:NewLabel (frame2, _, "$parentUseClassColorsLabel", "classColorsLabel", Loc ["STRING_OPTIONS_BAR_COLORBYCLASS"]) frame2.classColorSlider:SetPoint ("left", frame2.classColorsLabel, "right", 2) frame2.classColorSlider.OnSwitch = function (self, instance, value) - instance.row_texture_class_colors = value - instance:InstanceReset() - instance:InstanceRefreshRows() + instance:SetBarSettings (nil, nil, value) end frame2.classColorSlider.info = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS_DESC"] @@ -1353,9 +1395,8 @@ function _detalhes:OpenOptionsWindow (instance) g:NewLabel (frame2, _, "$parentFontSizeLabel", "fonsizeLabel", Loc ["STRING_OPTIONS_TEXT_SIZE"]) frame2.fonsizeSlider:SetPoint ("left", frame2.fonsizeLabel, "right", 2) frame2.fonsizeSlider:SetThumbSize (50) - frame2.fonsizeSlider:SetHook ("OnValueChange", function (self, instance, amount) - instance.barrasInfo.fontSize = amount - instance:RefreshBars() + frame2.fonsizeSlider:SetHook ("OnValueChange", function (self, instance, amount) + instance:SetBarTextSettings (amount) end) frame2.fonsizeSlider.info = Loc ["STRING_OPTIONS_TEXT_SIZE_DESC"] window:create_line_background (frame2, frame2.fonsizeLabel, frame2.fonsizeSlider) @@ -1375,11 +1416,8 @@ function _detalhes:OpenOptionsWindow (instance) g:NewLabel (frame2, _, "$parentUseClassColorsLeftText", "classColorsLeftTextLabel", Loc ["STRING_OPTIONS_TEXT_LCLASSCOLOR"]) frame2.classColorsLeftTextSlider:SetPoint ("left", frame2.classColorsLeftTextLabel, "right", 2) - --frame2.classColorsLeftTextSlider.tooltip = "if enabled, left bar text color matches the class, \nelse, a fixed color is used." frame2.classColorsLeftTextSlider.OnSwitch = function (self, instance, value) - instance.row_textL_class_colors = value - instance:InstanceReset() - instance:InstanceRefreshRows() + instance:SetBarTextSettings (nil, nil, nil, value) end frame2.classColorsLeftTextSlider.info = Loc ["STRING_OPTIONS_TEXT_LCLASSCOLOR_DESC"] @@ -1391,11 +1429,8 @@ function _detalhes:OpenOptionsWindow (instance) g:NewLabel (frame2, _, "$parentUseClassColorsRightText", "classColorsRightTextLabel", Loc ["STRING_OPTIONS_TEXT_RCLASSCOLOR"]) frame2.classColorsRightTextSlider:SetPoint ("left", frame2.classColorsRightTextLabel, "right", 2) - --frame2.classColorsRightTextSlider.tooltip = "if enabled, right bar text color matches the class, \nelse, a fixed color is used." frame2.classColorsRightTextSlider.OnSwitch = function (self, instance, value) - instance.row_textR_class_colors = value - instance:InstanceReset() - instance:InstanceRefreshRows() + instance:SetBarTextSettings (nil, nil, nil, nil, value) end frame2.classColorsRightTextSlider.info = Loc ["STRING_OPTIONS_TEXT_RCLASSCOLOR_DESC"] @@ -1417,9 +1452,7 @@ function _detalhes:OpenOptionsWindow (instance) frame2.textLeftOutlineSlider:SetPoint ("left", frame2.textLeftOutlineLabel, "right", 2) frame2.textLeftOutlineSlider.OnSwitch = function (self, instance, value) - instance.row_textL_outline = value - instance:InstanceReset() - instance:InstanceRefreshRows() + instance:SetBarTextSettings (nil, nil, nil, nil, nil, value) end frame2.textLeftOutlineSlider.info = Loc ["STRING_OPTIONS_TEXT_LOUTILINE_DESC"] @@ -1432,9 +1465,7 @@ function _detalhes:OpenOptionsWindow (instance) frame2.textRightOutlineSlider:SetPoint ("left", frame2.textRightOutlineLabel, "right", 2) frame2.textRightOutlineSlider.OnSwitch = function (self, instance, value) - instance.row_textR_outline = value - instance:InstanceReset() - instance:InstanceRefreshRows() + instance:SetBarTextSettings (nil, nil, nil, nil, nil, nil, value) end frame2.textRightOutlineSlider.info = Loc ["STRING_OPTIONS_TEXT_ROUTILINE_DESC"] @@ -1458,8 +1489,9 @@ function _detalhes:OpenOptionsWindow (instance) frame2.instancecolorbutton:SetHook ("OnEnter", background_on_enter) frame2.instancecolorbutton:SetHook ("OnLeave", background_on_leave) - -- Alpha + -- Color and Alpha g:NewLabel (frame2, _, "$parentAlphaLabel", "alphaLabel", Loc ["STRING_OPTIONS_INSTANCE_ALPHA"]) + g:NewLabel (frame2, _, "$parentBackgroundColorLabel", "backgroundColorLabel", Loc ["STRING_OPTIONS_INSTANCE_ALPHA2"]) -- frame2.alphaSlider:SetPoint ("left", frame2.alphaLabel, "right", 2, 0) frame2.alphaSlider.useDecimals = true @@ -1469,12 +1501,11 @@ function _detalhes:OpenOptionsWindow (instance) return true end) frame2.alphaSlider.thumb:SetSize (30+(120*0.2)+2, 20*1.2) - --frame2.alphaSlider.tooltip = "Change the background alpha for this instance" - frame2.backgroundColorTexture:SetPoint ("left", frame2.alphaSlider, "right", 5) + frame2.backgroundColorTexture:SetPoint ("left", frame2.backgroundColorLabel, "right", 2) frame2.backgroundColorTexture:SetTexture (1, 1, 1) - frame2.backgroundColorButton:SetPoint ("left", frame2.alphaSlider, "right", 5) + frame2.backgroundColorButton:SetPoint ("left", frame2.backgroundColorLabel, "right", 2) frame2.backgroundColorButton:InstallCustomTexture() -- alpha background COLOR???? @@ -1489,7 +1520,6 @@ function _detalhes:OpenOptionsWindow (instance) g:NewLabel (frame2, _, "$parentAutoCurrentLabel", "autoCurrentLabel", Loc ["STRING_OPTIONS_INSTANCE_CURRENT"]) frame2.autoCurrentSlider:SetPoint ("left", frame2.autoCurrentLabel, "right", 2) - --frame2.autoCurrentSlider.tooltip = "Whenever a combat start and there is no other instance on\ncurrent segment, this instance auto switch to current segment." frame2.autoCurrentSlider.OnSwitch = function (self, instance, value) instance.auto_current = value end @@ -1499,6 +1529,316 @@ function _detalhes:OpenOptionsWindow (instance) frame2.autoCurrentSlider:SetHook ("OnEnter", background_on_enter) frame2.autoCurrentSlider:SetHook ("OnLeave", background_on_leave) + -- show side bars + + g:NewLabel (frame2, _, "$parentSideBarsLabel", "sideBarsLabel", Loc ["STRING_OPTIONS_SHOW_SIDEBARS"]) + + frame2.sideBarsSlider:SetPoint ("left", frame2.sideBarsLabel, "right", 2) + frame2.sideBarsSlider.OnSwitch = function (self, instance, value) + if (value) then + instance:ShowSideBars() + else + instance:HideSideBars() + end + end + + frame2.sideBarsSlider.info = Loc ["STRING_OPTIONS_SHOW_SIDEBARS_DESC"] + window:create_line_background (frame2, frame2.sideBarsLabel, frame2.sideBarsSlider) + frame2.sideBarsSlider:SetHook ("OnEnter", background_on_enter) + frame2.sideBarsSlider:SetHook ("OnLeave", background_on_leave) + + -- show statusbar + + g:NewLabel (frame2, _, "$parentStatusbarLabel", "statusbarLabel", Loc ["STRING_OPTIONS_SHOW_STATUSBAR"]) + + frame2.statusbarSlider:SetPoint ("left", frame2.statusbarLabel, "right", 2) + frame2.statusbarSlider.OnSwitch = function (self, instance, value) + if (value) then + instance:ShowStatusBar() + else + instance:HideStatusBar() + end + end + + frame2.statusbarSlider.info = Loc ["STRING_OPTIONS_SHOW_STATUSBAR_DESC"] + window:create_line_background (frame2, frame2.statusbarLabel, frame2.statusbarSlider) + frame2.statusbarSlider:SetHook ("OnEnter", background_on_enter) + frame2.statusbarSlider:SetHook ("OnLeave", background_on_leave) + + --[[ + + + + --]] + + -- desaturate + g:NewLabel (frame2, _, "$parentDesaturateMenuLabel", "desaturateMenuLabel", Loc ["STRING_OPTIONS_DESATURATE_MENU"]) + + frame2.desaturateMenuSlider:SetPoint ("left", frame2.desaturateMenuLabel, "right", 2) + frame2.desaturateMenuSlider.OnSwitch = function (self, instance, value) + instance:DesaturateMenu (value) + end + + frame2.desaturateMenuSlider.info = Loc ["STRING_OPTIONS_DESATURATE_MENU_DESC"] + window:create_line_background (frame2, frame2.desaturateMenuLabel, frame2.desaturateMenuSlider) + frame2.desaturateMenuSlider:SetHook ("OnEnter", background_on_enter) + frame2.desaturateMenuSlider:SetHook ("OnLeave", background_on_leave) + + -- hide icon + g:NewLabel (frame2, _, "$parentHideIconLabel", "hideIconLabel", Loc ["STRING_OPTIONS_HIDE_ICON"]) + + frame2.hideIconSlider:SetPoint ("left", frame2.hideIconLabel, "right", 2) + frame2.hideIconSlider.OnSwitch = function (self, instance, value) + instance:HideMainIcon (value) + end + + frame2.hideIconSlider.info = Loc ["STRING_OPTIONS_HIDE_ICON_DESC"] + window:create_line_background (frame2, frame2.hideIconLabel, frame2.hideIconSlider) + frame2.hideIconSlider:SetHook ("OnEnter", background_on_enter) + frame2.hideIconSlider:SetHook ("OnLeave", background_on_leave) + + -- menu anchors + g:NewLabel (frame2, _, "$parentMenuAnchorXLabel", "menuAnchorXLabel", Loc ["STRING_OPTIONS_MENU_X"]) + frame2.menuAnchorXSlider:SetPoint ("left", frame2.menuAnchorXLabel, "right", 2) + frame2.menuAnchorXSlider:SetThumbSize (50) + frame2.menuAnchorXSlider:SetHook ("OnValueChange", function (self, instance, x) + instance:MenuAnchor (x, nil) + end) + + frame2.menuAnchorXSlider.info = Loc ["STRING_OPTIONS_MENU_X_DESC"] + window:create_line_background (frame2, frame2.menuAnchorXLabel, frame2.menuAnchorXSlider) + frame2.menuAnchorXSlider:SetHook ("OnEnter", background_on_enter) + frame2.menuAnchorXSlider:SetHook ("OnLeave", background_on_leave) + + g:NewLabel (frame2, _, "$parentMenuAnchorYLabel", "menuAnchorYLabel", Loc ["STRING_OPTIONS_MENU_Y"]) + frame2.menuAnchorYSlider:SetPoint ("left", frame2.menuAnchorYLabel, "right", 2) + frame2.menuAnchorYSlider:SetThumbSize (50) + frame2.menuAnchorYSlider:SetHook ("OnValueChange", function (self, instance, y) + instance:MenuAnchor (nil, y) + end) + + frame2.menuAnchorYSlider.info = Loc ["STRING_OPTIONS_MENU_Y_DESC"] + window:create_line_background (frame2, frame2.menuAnchorYLabel, frame2.menuAnchorYSlider) + frame2.menuAnchorYSlider:SetHook ("OnEnter", background_on_enter) + frame2.menuAnchorYSlider:SetHook ("OnLeave", background_on_leave) + + -- instance button anchors + g:NewLabel (frame2, _, "$parentInstanceButtonAnchorXLabel", "instanceButtonAnchorXLabel", Loc ["STRING_OPTIONS_INSBUTTON_X"]) + frame2.instanceButtonAnchorXSlider:SetPoint ("left", frame2.instanceButtonAnchorXLabel, "right", 2) + frame2.instanceButtonAnchorXSlider:SetThumbSize (50) + frame2.instanceButtonAnchorXSlider:SetHook ("OnValueChange", function (self, instance, x) + instance:InstanceButtonAnchor (x, nil) + end) + + frame2.instanceButtonAnchorXSlider.info = Loc ["STRING_OPTIONS_INSBUTTON_X_DESC"] + window:create_line_background (frame2, frame2.instanceButtonAnchorXLabel, frame2.instanceButtonAnchorXSlider) + frame2.instanceButtonAnchorXSlider:SetHook ("OnEnter", background_on_enter) + frame2.instanceButtonAnchorXSlider:SetHook ("OnLeave", background_on_leave) + + g:NewLabel (frame2, _, "$parentInstanceButtonAnchorYLabel", "instanceButtonAnchorYLabel", Loc ["STRING_OPTIONS_INSBUTTON_Y"]) + frame2.instanceButtonAnchorYSlider:SetPoint ("left", frame2.instanceButtonAnchorYLabel, "right", 2) + frame2.instanceButtonAnchorYSlider:SetThumbSize (50) + frame2.instanceButtonAnchorYSlider:SetHook ("OnValueChange", function (self, instance, y) + instance:InstanceButtonAnchor (nil, y) + end) + + frame2.instanceButtonAnchorYSlider.info =Loc ["STRING_OPTIONS_INSBUTTON_Y_DESC"] + window:create_line_background (frame2, frame2.instanceButtonAnchorYLabel, frame2.instanceButtonAnchorYSlider) + frame2.instanceButtonAnchorYSlider:SetHook ("OnEnter", background_on_enter) + frame2.instanceButtonAnchorYSlider:SetHook ("OnLeave", background_on_leave) + + -- reset button + -- text color + g:NewLabel (frame2, _, "$parentResetTextColorLabel", "resetTextColorLabel", Loc ["STRING_OPTIONS_RESET_TEXTCOLOR"]) + + frame2.resetTextColorImage:SetPoint ("left", frame2.resetTextColorLabel, "right", 2) + + frame2.resetTextColorButton:SetPoint ("left", frame2.resetTextColorLabel, "right", 2) + frame2.resetTextColorButton:InstallCustomTexture() + + frame2.resetTextColorButton.info = Loc ["STRING_OPTIONS_RESET_TEXTCOLOR_DESC"] + window:create_line_background (frame2, frame2.resetTextColorLabel, frame2.resetTextColorButton) + frame2.resetTextColorButton:SetHook ("OnEnter", background_on_enter) + frame2.resetTextColorButton:SetHook ("OnLeave", background_on_leave) + + -- text font + g:NewLabel (frame2, _, "$parentResetTextFontLabel", "resetTextFontLabel", Loc ["STRING_OPTIONS_RESET_TEXTFONT"]) + frame2.resetTextFontDropdown:SetPoint ("left", frame2.resetTextFontLabel, "right", 2) + + frame2.resetTextFontDropdown.info = Loc ["STRING_OPTIONS_RESET_TEXTFONT_DESC"] + window:create_line_background (frame2, frame2.resetTextFontLabel, frame2.resetTextFontDropdown) + frame2.resetTextFontDropdown:SetHook ("OnEnter", background_on_enter) + frame2.resetTextFontDropdown:SetHook ("OnLeave", background_on_leave) + + -- text size + g:NewLabel (frame2, _, "$parentResetTextSizeLabel", "resetTextSizeLabel", Loc ["STRING_OPTIONS_RESET_TEXTSIZE"]) + frame2.resetTextSizeSlider:SetPoint ("left", frame2.resetTextSizeLabel, "right", 2) + + frame2.resetTextSizeSlider.info = Loc ["STRING_OPTIONS_RESET_TEXTSIZE_DESC"] + window:create_line_background (frame2, frame2.resetTextSizeLabel, frame2.resetTextSizeSlider) + frame2.resetTextSizeSlider:SetHook ("OnEnter", background_on_enter) + frame2.resetTextSizeSlider:SetHook ("OnLeave", background_on_leave) + + -- color overlay + g:NewLabel (frame2, _, "$parentResetOverlayColorLabel", "resetOverlayColorLabel", Loc ["STRING_OPTIONS_RESET_OVERLAY"]) + + frame2.resetOverlayColorImage:SetPoint ("left", frame2.resetOverlayColorLabel, "right", 2) + + frame2.resetOverlayColorButton:SetPoint ("left", frame2.resetOverlayColorLabel, "right", 2) + frame2.resetOverlayColorButton:InstallCustomTexture() + + frame2.resetOverlayColorButton.info = Loc ["STRING_OPTIONS_RESET_OVERLAY_DESC"] + window:create_line_background (frame2, frame2.resetOverlayColorLabel, frame2.resetOverlayColorButton) + frame2.resetOverlayColorButton:SetHook ("OnEnter", background_on_enter) + frame2.resetOverlayColorButton:SetHook ("OnLeave", background_on_leave) + + -- reset always small + g:NewLabel (frame2, _, "$parentResetAlwaysSmallLabel", "resetAlwaysSmallLabel", Loc ["STRING_OPTIONS_RESET_SMALL"]) + + frame2.resetAlwaysSmallSlider:SetPoint ("left", frame2.resetAlwaysSmallLabel, "right", 2) + frame2.resetAlwaysSmallSlider.OnSwitch = function (self, instance, value) + instance:SetDeleteButtonSettings (nil, nil, nil, nil, value) + end + + frame2.resetAlwaysSmallSlider.info = Loc ["STRING_OPTIONS_RESET_SMALL_DESC"] + window:create_line_background (frame2, frame2.resetAlwaysSmallLabel, frame2.resetAlwaysSmallSlider) + frame2.resetAlwaysSmallSlider:SetHook ("OnEnter", background_on_enter) + frame2.resetAlwaysSmallSlider:SetHook ("OnLeave", background_on_leave) + + -- stretch button anchor + g:NewLabel (frame2, _, "$parentStretchAnchorLabel", "stretchAnchorLabel", Loc ["STRING_OPTIONS_STRETCH"]) + + frame2.stretchAnchorSlider:SetPoint ("left", frame2.stretchAnchorLabel, "right", 2) + frame2.stretchAnchorSlider.OnSwitch = function (self, instance, value) + instance:StretchButtonAnchor (value and 2 or 1) + end + frame2.stretchAnchorSlider.thumb:SetSize (40, 12) + + frame2.stretchAnchorSlider.info = Loc ["STRING_OPTIONS_STRETCH_DESC"] + window:create_line_background (frame2, frame2.stretchAnchorLabel, frame2.stretchAnchorSlider) + frame2.stretchAnchorSlider:SetHook ("OnEnter", background_on_enter) + frame2.stretchAnchorSlider:SetHook ("OnLeave", background_on_leave) + + -- plugin icons direction + g:NewLabel (frame2, _, "$parentPluginIconsDirectionLabel", "pluginIconsDirectionLabel", Loc ["STRING_OPTIONS_PICONS_DIRECTION"]) + + frame2.pluginIconsDirectionSlider:SetPoint ("left", frame2.pluginIconsDirectionLabel, "right", 2) + frame2.pluginIconsDirectionSlider.OnSwitch = function (self, instance, value) + instance.plugins_grow_direction = value and 2 or 1 + instance:DefaultIcons() + end + frame2.pluginIconsDirectionSlider.thumb:SetSize (40, 12) + + frame2.pluginIconsDirectionSlider.info = Loc ["STRING_OPTIONS_PICONS_DIRECTION_DESC"] + window:create_line_background (frame2, frame2.pluginIconsDirectionLabel, frame2.pluginIconsDirectionSlider) + frame2.pluginIconsDirectionSlider:SetHook ("OnEnter", background_on_enter) + frame2.pluginIconsDirectionSlider:SetHook ("OnLeave", background_on_leave) + + -- instance toolbar side + g:NewLabel (frame2, _, "$parentInstanceToolbarSideLabel", "instanceToolbarSideLabel", Loc ["STRING_OPTIONS_TOOLBARSIDE"]) + + frame2.instanceToolbarSideSlider:SetPoint ("left", frame2.instanceToolbarSideLabel, "right", 2) + frame2.instanceToolbarSideSlider.OnSwitch = function (self, instance, value) + instance.toolbar_side = value and 2 or 1 + instance:ToolbarSide (side) + + end + frame2.instanceToolbarSideSlider.thumb:SetSize (50, 12) + + frame2.instanceToolbarSideSlider.info = Loc ["STRING_OPTIONS_TOOLBARSIDE_DESC"] + window:create_line_background (frame2, frame2.instanceToolbarSideLabel, frame2.instanceToolbarSideSlider) + frame2.instanceToolbarSideSlider:SetHook ("OnEnter", background_on_enter) + frame2.instanceToolbarSideSlider:SetHook ("OnLeave", background_on_leave) + + -- bar grow direction + g:NewLabel (frame2, _, "$parentBarGrowDirectionLabel", "barGrowDirectionLabel", Loc ["STRING_OPTIONS_BARGROW_DIRECTION"]) + + frame2.barGrowDirectionSlider:SetPoint ("left", frame2.barGrowDirectionLabel, "right", 2) + frame2.barGrowDirectionSlider.OnSwitch = function (self, instance, value) + instance:SetBarGrowDirection (value and 2 or 1) + end + frame2.barGrowDirectionSlider.thumb:SetSize (50, 12) + + frame2.barGrowDirectionSlider.info = Loc ["STRING_OPTIONS_BARGROW_DIRECTION_DESC"] + window:create_line_background (frame2, frame2.barGrowDirectionLabel, frame2.barGrowDirectionSlider) + frame2.barGrowDirectionSlider:SetHook ("OnEnter", background_on_enter) + frame2.barGrowDirectionSlider:SetHook ("OnLeave", background_on_leave) + + -- bar sort direction + g:NewLabel (frame2, _, "$parentBarSortDirectionLabel", "barSortDirectionLabel", Loc ["STRING_OPTIONS_BARSORT_DIRECTION"]) + + frame2.barSortDirectionSlider:SetPoint ("left", frame2.barSortDirectionLabel, "right", 2) + frame2.barSortDirectionSlider.OnSwitch = function (self, instance, value) + instance.bars_sort_direction = value and 2 or 1 + _detalhes:AtualizaGumpPrincipal (-1, true) + end + frame2.barSortDirectionSlider.thumb:SetSize (50, 12) + + frame2.barSortDirectionSlider.info = Loc ["STRING_OPTIONS_BARSORT_DIRECTION_DESC"] + window:create_line_background (frame2, frame2.barSortDirectionLabel, frame2.barSortDirectionSlider) + frame2.barSortDirectionSlider:SetHook ("OnEnter", background_on_enter) + frame2.barSortDirectionSlider:SetHook ("OnLeave", background_on_leave) + + -- instance button + -- text color + g:NewLabel (frame2, _, "$parentInstanceTextColorLabel", "instanceTextColorLabel", Loc ["STRING_OPTIONS_INSTANCE_TEXTCOLOR"]) + + frame2.instanceTextColorImage:SetPoint ("left", frame2.instanceTextColorLabel, "right", 2) + + frame2.instanceTextColorButton:SetPoint ("left", frame2.instanceTextColorLabel, "right", 2) + frame2.instanceTextColorButton:InstallCustomTexture() + + frame2.instanceTextColorButton.info = Loc ["STRING_OPTIONS_INSTANCE_TEXTCOLOR_DESC"] + window:create_line_background (frame2, frame2.instanceTextColorLabel, frame2.instanceTextColorButton) + frame2.instanceTextColorButton:SetHook ("OnEnter", background_on_enter) + frame2.instanceTextColorButton:SetHook ("OnLeave", background_on_leave) + + -- text font + g:NewLabel (frame2, _, "$parentInstanceTextFontLabel", "instanceTextFontLabel", Loc ["STRING_OPTIONS_INSTANCE_TEXTFONT"]) + frame2.instanceTextFontDropdown:SetPoint ("left", frame2.instanceTextFontLabel, "right", 2) + + frame2.instanceTextFontDropdown.info = Loc ["STRING_OPTIONS_INSTANCE_TEXTFONT_DESC"] + window:create_line_background (frame2, frame2.instanceTextFontLabel, frame2.instanceTextFontDropdown) + frame2.instanceTextFontDropdown:SetHook ("OnEnter", background_on_enter) + frame2.instanceTextFontDropdown:SetHook ("OnLeave", background_on_leave) + + -- text size + g:NewLabel (frame2, _, "$parentInstanceTextSizeLabel", "instanceTextSizeLabel", Loc ["STRING_OPTIONS_INSTANCE_TEXTSIZE"]) + frame2.instanceTextSizeSlider:SetPoint ("left", frame2.instanceTextSizeLabel, "right", 2) + + frame2.instanceTextSizeSlider.info = Loc ["STRING_OPTIONS_INSTANCE_TEXTSIZE_DESC"] + window:create_line_background (frame2, frame2.instanceTextSizeLabel, frame2.instanceTextSizeSlider) + frame2.instanceTextSizeSlider:SetHook ("OnEnter", background_on_enter) + frame2.instanceTextSizeSlider:SetHook ("OnLeave", background_on_leave) + + -- color overlay + g:NewLabel (frame2, _, "$parentInstanceOverlayColorLabel", "instanceOverlayColorLabel", Loc ["STRING_OPTIONS_INSTANCE_OVERLAY"]) + + frame2.instanceOverlayColorImage:SetPoint ("left", frame2.instanceOverlayColorLabel, "right", 2) + + frame2.instanceOverlayColorButton:SetPoint ("left", frame2.instanceOverlayColorLabel, "right", 2) + frame2.instanceOverlayColorButton:InstallCustomTexture() + + frame2.instanceOverlayColorButton.info = Loc ["STRING_OPTIONS_INSTANCE_OVERLAY_DESC"] + window:create_line_background (frame2, frame2.instanceOverlayColorLabel, frame2.instanceOverlayColorButton) + frame2.instanceOverlayColorButton:SetHook ("OnEnter", background_on_enter) + frame2.instanceOverlayColorButton:SetHook ("OnLeave", background_on_leave) + + -- close button + -- color overlay + g:NewLabel (frame2, _, "$parentCloseOverlayColorLabel", "closeOverlayColorLabel", Loc ["STRING_OPTIONS_CLOSE_OVERLAY"]) + + frame2.closeOverlayColorImage:SetPoint ("left", frame2.closeOverlayColorLabel, "right", 2) + + frame2.closeOverlayColorButton:SetPoint ("left", frame2.closeOverlayColorLabel, "right", 2) + frame2.closeOverlayColorButton:InstallCustomTexture() + + frame2.closeOverlayColorButton.info = Loc ["STRING_OPTIONS_CLOSE_OVERLAY_DESC"] + window:create_line_background (frame2, frame2.closeOverlayColorLabel, frame2.closeOverlayColorButton) + frame2.closeOverlayColorButton:SetHook ("OnEnter", background_on_enter) + frame2.closeOverlayColorButton:SetHook ("OnLeave", background_on_leave) + + -- skin g:NewLabel (frame2, _, "$parentSkinLabel", "skinLabel", Loc ["STRING_OPTIONS_INSTANCE_SKIN"]) frame2.skinDropdown:SetPoint ("left", frame2.skinLabel, "right", 2) @@ -1579,7 +1919,6 @@ function _detalhes:OpenOptionsWindow (instance) ----- style name frame2.saveStyleName:SetLabelText (Loc ["STRING_OPTIONS_SAVELOAD_PNAME"] .. ":") - frame2.saveStyleName:SetPoint (10, -830) ----- add style button @@ -1632,56 +1971,98 @@ function _detalhes:OpenOptionsWindow (instance) -- Anchors -------------------------------------------------------------------------------------------------------------------------------------------- - titulo_bars:SetPoint (10, -10) - titulo_bars_desc:SetPoint (10, -30) + --> skin settings + --title + titulo_skin:SetPoint (10, -10) + titulo_skin_desc:SetPoint (10, -30) + --skin select + frame2.skinLabel:SetPoint (10, -70) + + --> general bar settings + titulo_bars:SetPoint (10, -110) + titulo_bars_desc:SetPoint (10, -130) - -- bar - frame2.textureLabel:SetPoint (10, -70) --bar texture - frame2.rowHeightLabel:SetPoint (10, -90) --bar height - frame2.classColorsLabel:SetPoint (10, -110) - frame2.rowBackgroundColorLabel:SetPoint (10, -130) --bar background color - frame2.rowBackgroundColorByClassLabel:SetPoint (10, -150) - frame2.rowBackgroundLabel:SetPoint (10, -170) --select background + frame2.rowHeightLabel:SetPoint (10, -170) --bar height + frame2.barGrowDirectionLabel:SetPoint (10, -190) --grow direction + frame2.barSortDirectionLabel:SetPoint (10, -210) --sort direction - titulo_texts:SetPoint (10, -210) - titulo_texts_desc:SetPoint (10, -230) + frame2.textureLabel:SetPoint (10, -250) --bar texture + frame2.classColorsLabel:SetPoint (10, -270) --class color + frame2.rowBackgroundLabel:SetPoint (10, -290) --select background + frame2.rowBackgroundColorByClassLabel:SetPoint (10, -310) --class color background + frame2.rowBackgroundColorTexture:SetPoint ("left", frame2.rowBackgroundColorByClassSlider, "right", 2) --bar color background - --texts - frame2.fonsizeLabel:SetPoint (10, -270) - frame2.fontLabel:SetPoint (10, -290) - frame2.textLeftOutlineLabel:SetPoint (10, -310) - frame2.textRightOutlineLabel:SetPoint (10, -330) - frame2.classColorsLeftTextLabel:SetPoint (10, -350) - frame2.classColorsRightTextLabel:SetPoint (10, -370) + --> text bar settings + titulo_texts:SetPoint (10, -350) + titulo_texts_desc:SetPoint (10, -370) - titulo_instance:SetPoint (10, -410) - titulo_instance_desc:SetPoint (10, -430) + frame2.fonsizeLabel:SetPoint (10, -410) --text size + frame2.fontLabel:SetPoint (10, -430) --text fontface + frame2.textLeftOutlineLabel:SetPoint (10, -450) --left outline + frame2.textRightOutlineLabel:SetPoint (10, -470) --right outline + frame2.classColorsLeftTextLabel:SetPoint (10, -490) --left color by class + frame2.classColorsRightTextLabel:SetPoint (10, -510) --right color by class - --instance - frame2.instancecolor:SetPoint (10, -470) - frame2.alphaLabel:SetPoint (10, -490) - frame2.autoCurrentLabel:SetPoint (10, -510) - frame2.skinLabel:SetPoint (10, -530) + --> window settings + titulo_instance:SetPoint (10, -550) + titulo_instance_desc:SetPoint (10, -570) - titulo_wallpaper:SetPoint (10, -570) - titulo_wallpaper_desc:SetPoint (10, -590) + frame2.instancecolor:SetPoint (10, -610) --window color + frame2.alphaLabel:SetPoint (10, -630) --background alpha + frame2.backgroundColorLabel:SetPoint (10, -650) --background color - --wallpaper - frame2.enablewallpaperLabel:SetPoint (10, -630) + frame2.autoCurrentLabel:SetPoint (10, -670) --auto current + frame2.instanceToolbarSideLabel:SetPoint (10, -690) + frame2.sideBarsLabel:SetPoint (10, -710) --borders + frame2.statusbarLabel:SetPoint (10, -730) --statusbar + frame2.stretchAnchorLabel:SetPoint (10, -750) --stretch direction + + --> toolbar settings + titulo_toolbar:SetPoint (10, -790) + titulo_toolbar_desc:SetPoint (10, -810) + + frame2.menuAnchorXLabel:SetPoint (10, -850) + frame2.menuAnchorYLabel:SetPoint (10, -870) + frame2.desaturateMenuLabel:SetPoint (10, -890) + frame2.hideIconLabel:SetPoint (10, -910) + frame2.pluginIconsDirectionLabel:SetPoint (10, -930) + + frame2.instanceButtonAnchorXLabel:SetPoint (10, -970) + frame2.instanceButtonAnchorYLabel:SetPoint (10, -990) + frame2.instanceTextColorLabel:SetPoint (10, -1010) + frame2.instanceTextFontLabel:SetPoint (10, -1030) + frame2.instanceTextSizeLabel:SetPoint (10, -1050) + frame2.instanceOverlayColorLabel:SetPoint (10, -1070) + + frame2.resetTextColorLabel:SetPoint (10, -1110) + frame2.resetTextFontLabel:SetPoint (10, -1130) + frame2.resetTextSizeLabel:SetPoint (10, -1150) + frame2.resetOverlayColorLabel:SetPoint (10, -1170) + frame2.resetAlwaysSmallLabel:SetPoint (10, -1190) + + frame2.closeOverlayColorLabel:SetPoint (10, -1230) - frame2.wallpapergroupLabel:SetPoint (10, -650) - frame2.selectwallpaperLabel:SetPoint (135, -650) + --> wallpaper settings + titulo_wallpaper:SetPoint (10, -1270) + titulo_wallpaper_desc:SetPoint (10, -1290) + + frame2.enablewallpaperLabel:SetPoint (10, -1330) + + frame2.wallpapergroupLabel:SetPoint (10, -1350) + frame2.selectwallpaperLabel:SetPoint (135, -1350) frame2.backgroundDropdown:SetPoint ("topleft", frame2.wallpapergroupLabel, "bottomleft") frame2.backgroundDropdown2:SetPoint ("topleft", frame2.selectwallpaperLabel, "bottomleft") - frame2.anchorLabel:SetPoint (10, -690) - frame2.editImage:SetPoint (10, -710) + frame2.anchorLabel:SetPoint (10, -1390) + frame2.editImage:SetPoint (10, -1410) - --save load + --> save and load - titulo_save:SetPoint (10, -750) - titulo_save_desc:SetPoint (10, -770) + titulo_save:SetPoint (10, -1450) + titulo_save_desc:SetPoint (10, -1470) + + frame2.saveStyleName:SetPoint (10, -1510) ---------------- performance local frame3 = window.options [3][1].gump @@ -1993,41 +2374,108 @@ function _detalhes:OpenOptionsWindow (instance) ---------------------------------------------------------------------------------------- --> Show + _G.DetailsOptionsWindow2ResetTextColorImage.MyObject:SetTexture (unpack (instance.resetbutton_info.text_color)) + _G.DetailsOptionsWindow2ResetTextSizeSlider.MyObject:SetValue (instance.resetbutton_info.text_size) + _G.DetailsOptionsWindow2ResetTextFontDropdown.MyObject:Select (instance.resetbutton_info.text_face) + _G.DetailsOptionsWindow2ResetOverlayColorImage.MyObject:SetTexture (unpack (instance.resetbutton_info.color_overlay)) + + _G.DetailsOptionsWindow2InstanceTextColorImage.MyObject:SetTexture (unpack (instance.instancebutton_info.text_color)) + _G.DetailsOptionsWindow2InstanceTextSizeSlider.MyObject:SetValue (instance.instancebutton_info.text_size) + _G.DetailsOptionsWindow2InstanceTextFontDropdown.MyObject:Select (instance.instancebutton_info.text_face) + _G.DetailsOptionsWindow2InstanceOverlayColorImage.MyObject:SetTexture (unpack (instance.instancebutton_info.color_overlay)) + + _G.DetailsOptionsWindow2CloseOverlayColorImage.MyObject:SetTexture (unpack (instance.closebutton_info.color_overlay)) + + _G.DetailsOptionsWindow2SideBarsSlider.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2SideBarsSlider.MyObject:SetValue (instance.show_sidebars) + + _G.DetailsOptionsWindow2StatusbarSlider.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2StatusbarSlider.MyObject:SetValue (instance.show_statusbar) + + _G.DetailsOptionsWindow2StretchAnchorSlider.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2StretchAnchorSlider.MyObject:SetValue (instance.stretch_button_side) + + _G.DetailsOptionsWindow2PluginIconsDirectionSlider.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2PluginIconsDirectionSlider.MyObject:SetValue (instance.plugins_grow_direction) + + _G.DetailsOptionsWindow2InstanceToolbarSideSlider.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2InstanceToolbarSideSlider.MyObject:SetValue (instance.toolbar_side) + + _G.DetailsOptionsWindow2BarSortDirectionSlider.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2BarSortDirectionSlider.MyObject:SetValue (instance.bars_sort_direction) + + _G.DetailsOptionsWindow2BarGrowDirectionSlider.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2BarGrowDirectionSlider.MyObject:SetValue (instance.bars_grow_direction) + + + _G.DetailsOptionsWindow2DesaturateMenuSlider.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2DesaturateMenuSlider.MyObject:SetValue (instance.desaturated_menu) + + _G.DetailsOptionsWindow2HideIconSlider.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2HideIconSlider.MyObject:SetValue (instance.hide_icon) + + _G.DetailsOptionsWindow2MenuAnchorXSlider.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2MenuAnchorXSlider.MyObject:SetValue (instance.menu_anchor[1]) + + _G.DetailsOptionsWindow2MenuAnchorYSlider.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2MenuAnchorYSlider.MyObject:SetValue (instance.menu_anchor[2]) + + _G.DetailsOptionsWindow2InstanceButtonAnchorXSlider.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2InstanceButtonAnchorXSlider.MyObject:SetValue (instance.instance_button_anchor[1]) + + _G.DetailsOptionsWindow2InstanceButtonAnchorYSlider.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2InstanceButtonAnchorYSlider.MyObject:SetValue (instance.instance_button_anchor[2]) + +---------------------------------------------------------------- + + --resetTextColor + _G.DetailsOptionsWindow2ResetTextFontDropdown.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2ResetTextSizeSlider.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2ResetAlwaysSmallSlider.MyObject:SetFixedParameter (instance) + --resetOverlayColorLabel + + --instanceTextColorLabel + _G.DetailsOptionsWindow2InstanceTextFontDropdown.MyObject:SetFixedParameter (instance) + _G.DetailsOptionsWindow2InstanceTextSizeSlider.MyObject:SetFixedParameter (instance) + --instanceOverlayColorLabel + + --closeOverlayColorLabel + _G.DetailsOptionsWindow2SkinDropdown.MyObject:SetFixedParameter (instance) _G.DetailsOptionsWindow2SkinDropdown.MyObject:Select (instance.skin) _G.DetailsOptionsWindow2TextureDropdown.MyObject:SetFixedParameter (instance) _G.DetailsOptionsWindow2RowBackgroundTextureDropdown.MyObject:SetFixedParameter (instance) - _G.DetailsOptionsWindow2TextureDropdown.MyObject:Select (instance.barrasInfo.textureName) - _G.DetailsOptionsWindow2RowBackgroundTextureDropdown.MyObject:Select (instance.barrasInfo.textureNameBackground) - _G.DetailsOptionsWindow2RowBackgroundColor.MyObject:SetTexture (unpack (instance.barrasInfo.texturaBackgroundColor)) + _G.DetailsOptionsWindow2TextureDropdown.MyObject:Select (instance.row_info.texture) + _G.DetailsOptionsWindow2RowBackgroundTextureDropdown.MyObject:Select (instance.row_info.texture_background) + _G.DetailsOptionsWindow2RowBackgroundColor.MyObject:SetTexture (unpack (instance.row_info.fixed_texture_background_color)) _G.DetailsOptionsWindow2BackgroundClassColorSlider.MyObject:SetFixedParameter (instance) - _G.DetailsOptionsWindow2BackgroundClassColorSlider.MyObject:SetValue (instance.barrasInfo.texturaBackgroundByClass) + _G.DetailsOptionsWindow2BackgroundClassColorSlider.MyObject:SetValue (instance.row_info.texture_background_class_color) _G.DetailsOptionsWindow2FontDropdown.MyObject:SetFixedParameter (instance) - _G.DetailsOptionsWindow2FontDropdown.MyObject:Select (instance.barrasInfo.fontName) + _G.DetailsOptionsWindow2FontDropdown.MyObject:Select (instance.row_info.font_face) -- _G.DetailsOptionsWindow2SliderRowHeight.MyObject:SetFixedParameter (instance) - _G.DetailsOptionsWindow2SliderRowHeight.MyObject:SetValue (instance.barrasInfo.altura) + _G.DetailsOptionsWindow2SliderRowHeight.MyObject:SetValue (instance.row_info.height) -- _G.DetailsOptionsWindow2SliderFontSize.MyObject:SetFixedParameter (instance) - _G.DetailsOptionsWindow2SliderFontSize.MyObject:SetValue (instance.barrasInfo.fontSize) + _G.DetailsOptionsWindow2SliderFontSize.MyObject:SetValue (instance.row_info.font_size) -- _G.DetailsOptionsWindow2AutoCurrentSlider.MyObject:SetFixedParameter (instance) _G.DetailsOptionsWindow2AutoCurrentSlider.MyObject:SetValue (instance.auto_current) -- _G.DetailsOptionsWindow2ClassColorSlider.MyObject:SetFixedParameter (instance) - _G.DetailsOptionsWindow2ClassColorSlider.MyObject:SetValue (instance.row_texture_class_colors) + _G.DetailsOptionsWindow2ClassColorSlider.MyObject:SetValue (instance.row_info.texture_class_colors) _G.DetailsOptionsWindow2UseClassColorsLeftTextSlider.MyObject:SetFixedParameter (instance) - _G.DetailsOptionsWindow2UseClassColorsLeftTextSlider.MyObject:SetValue (instance.row_textL_class_colors) + _G.DetailsOptionsWindow2UseClassColorsLeftTextSlider.MyObject:SetValue (instance.row_info.textL_class_colors) _G.DetailsOptionsWindow2UseClassColorsRightTextSlider.MyObject:SetFixedParameter (instance) - _G.DetailsOptionsWindow2UseClassColorsRightTextSlider.MyObject:SetValue (instance.row_textR_class_colors) + _G.DetailsOptionsWindow2UseClassColorsRightTextSlider.MyObject:SetValue (instance.row_info.textR_class_colors) _G.DetailsOptionsWindow2TextLeftOutlineSlider.MyObject:SetFixedParameter (instance) - _G.DetailsOptionsWindow2TextLeftOutlineSlider.MyObject:SetValue (instance.row_textL_outline) + _G.DetailsOptionsWindow2TextLeftOutlineSlider.MyObject:SetValue (instance.row_info.textL_outline) _G.DetailsOptionsWindow2TextRightOutlineSlider.MyObject:SetFixedParameter (instance) - _G.DetailsOptionsWindow2TextRightOutlineSlider.MyObject:SetValue (instance.row_textR_outline) + _G.DetailsOptionsWindow2TextRightOutlineSlider.MyObject:SetValue (instance.row_info.textR_outline) -- _G.DetailsOptionsWindow2AlphaSlider.MyObject:SetFixedParameter (instance) _G.DetailsOptionsWindow2AlphaSlider.MyObject:SetValue (instance.bg_alpha) @@ -2050,8 +2498,8 @@ function _detalhes:OpenOptionsWindow (instance) _G.DetailsOptionsWindow2InstanceColorTexture.MyObject:SetTexture (unpack (instance.color)) _G.DetailsOptionsWindow2BackgroundColorTexture.MyObject:SetTexture (instance.bg_r, instance.bg_g, instance.bg_b) - _G.DetailsOptionsWindow2FixedRowColorTexture.MyObject:SetTexture (unpack (instance.fixed_row_texture_color)) - _G.DetailsOptionsWindow2FixedRowColorTTexture.MyObject:SetTexture (unpack (instance.fixed_row_text_color)) + _G.DetailsOptionsWindow2FixedRowColorTexture.MyObject:SetTexture (unpack (instance.row_info.fixed_texture_color)) + _G.DetailsOptionsWindow2FixedRowColorTTexture.MyObject:SetTexture (unpack (instance.row_info.fixed_text_color)) GameCooltip:SetFixedParameter (_G.DetailsOptionsWindow2LoadStyleButton, instance) diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index f5786522..cfc27fc3 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -5,6 +5,7 @@ local _detalhes = _G._detalhes local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) local _ local gump = _detalhes.gump +local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0") local atributos = _detalhes.atributos local sub_atributos = _detalhes.sub_atributos @@ -19,7 +20,7 @@ local _pairs = pairs local _string_lower = string.lower local _unpack = unpack --api locals -local _CreateFrame = CreateFrame +local CreateFrame = CreateFrame local _GetTime = GetTime local _GetCursorPosition = GetCursorPosition local _GameTooltip = GameTooltip @@ -35,7 +36,7 @@ local modo_grupo = _detalhes._detalhes_props["MODO_GROUP"] local modo_all = _detalhes._detalhes_props["MODO_ALL"] local gump_fundo_backdrop = { - bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, + bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}} function _detalhes:ScheduleUpdate (instancia) @@ -58,33 +59,36 @@ end local DEFAULT_SKIN = [[Interface\AddOns\Details\images\skins\default_skin]] - local COORDS_LEFT_BALL = {0.15673828125, 0.28076171875, 0.08251953125, 0.20654296875} -- x1 160 y1 84 x2 288 y2 212 - local COORDS_LEFT_CONNECTOR = {0.29541015625, 0.30224609375, 0.08251953125, 0.20654296875} --302 84 310 212 - local COORDS_TOP_BACKGROUND = {0.15673828125, 0.65576171875, 0.22314453125, 0.34716796875} -- 160 228 672 356 - local COORDS_RIGHT_BALL = {0.31591796875, 0.43994140625, 0.08251953125, 0.20654296875} --324 84 452 212 + local COORDS_LEFT_BALL = {0.15673828125, 0.27978515625, 0.08251953125, 0.20556640625} -- 160 84 287 211 (updated) + local COORDS_LEFT_CONNECTOR = {0.29541015625, 0.30126953125, 0.08251953125, 0.20556640625} --302 84 309 211 (updated) + local COORDS_LEFT_CONNECTOR_NO_ICON = {0.58837890625, 0.59423828125, 0.08251953125, 0.20556640625} -- 602 84 609 211 (updated) + local COORDS_TOP_BACKGROUND = {0.15673828125, 0.65478515625, 0.22314453125, 0.34619140625} -- 160 228 671 355 (updated) + local COORDS_RIGHT_BALL = {0.31591796875, 0.43994140625, 0.08251953125, 0.20556640625} --324 84 451 211 (updated) + local COORDS_LEFT_BALL_NO_ICON = {0.44970703125, 0.57275390625, 0.08251953125, 0.20556640625} --460 84 587 211 (updated) - local COORDS_LEFT_SIDE_BAR = {0.76611328125, 0.82861328125, 0.00244140625, 0.50244140625} -- 784 2 849 515 - local COORDS_RIGHT_SIDE_BAR = {0.70068359375, 0.76318359375, 0.00244140625, 0.50244140625} -- 717 2 782 515 + local COORDS_LEFT_SIDE_BAR = {0.76611328125, 0.82763671875, 0.00244140625, 0.50146484375} -- 784 2 848 514 (updated) + local COORDS_RIGHT_SIDE_BAR = {0.70068359375, 0.76220703125, 0.00244140625, 0.50146484375} -- 717 2 781 514 (updated) + local COORDS_BOTTOM_SIDE_BAR = {0.32861328125, 0.82666015625, 0.50537109375, 0.56494140625} -- 336 517 847 579 (updated) - local COORDS_SLIDER_TOP = {0.00146484375, 0.03173828125, 0.00244140625, 0.03271484375} -- 1 2 33 34 - local COORDS_SLIDER_MIDDLE = {0.00146484375, 0.03173828125, 0.03955078125, 0.10107421875} -- 1 40 33 104 - local COORDS_SLIDER_DOWN = {0.00146484375, 0.03173828125, 0.10986328125, 0.14013671875} -- 1 112 33 144 + local COORDS_SLIDER_TOP = {0.00146484375, 0.03076171875, 0.00244140625, 0.03173828125} -- 1 2 32 33 -ok + local COORDS_SLIDER_MIDDLE = {0.00146484375, 0.03076171875, 0.03955078125, 0.10009765625} -- 1 40 32 103 -ok + local COORDS_SLIDER_DOWN = {0.00146484375, 0.03076171875, 0.10986328125, 0.13916015625} -- 1 112 32 143 -ok - local COORDS_STRETCH = {0.00146484375, 0.03173828125, 0.21435546875, 0.22900390625} -- 1 219 33 235 - local COORDS_RESIZE_RIGHT = {0.00146484375, 0.01611328125, 0.24560546875, 0.26025390625} -- 1 251 17 267 - local COORDS_RESIZE_LEFT = {0.02001953125, 0.03271484375, 0.24560546875, 0.26025390625} -- 20 251 34 267 + local COORDS_STRETCH = {0.00146484375, 0.03076171875, 0.21435546875, 0.22802734375} -- 1 219 32 234 -ok + local COORDS_RESIZE_RIGHT = {0.00146484375, 0.01513671875, 0.24560546875, 0.25927734375} -- 1 251 16 266 -ok + local COORDS_RESIZE_LEFT = {0.02001953125, 0.03173828125, 0.24560546875, 0.25927734375} -- 20 251 33 266 -ok - local COORDS_UNLOCK_BUTTON = {0.00146484375, 0.01611328125, 0.27197265625, 0.28662109375} -- 1 278 17 294 + local COORDS_UNLOCK_BUTTON = {0.00146484375, 0.01513671875, 0.27197265625, 0.28564453125} -- 1 278 16 293 -ok - local COORDS_BOTTOM_BACKGROUND = {0.15673828125, 0.65576171875, 0.35400390625, 0.47802734375} -- 160 362 672 490 - local COORDS_PIN_LEFT = {0.00146484375, 0.03173828125, 0.30126953125, 0.33154296875} -- 1 308 33 340 - local COORDS_PIN_RIGHT = {0.03564453125, 0.06591796875, 0.30126953125, 0.33154296875} -- 36 308 68 340 + local COORDS_BOTTOM_BACKGROUND = {0.15673828125, 0.65478515625, 0.35400390625, 0.47705078125} -- 160 362 671 489 -ok + local COORDS_PIN_LEFT = {0.00146484375, 0.03076171875, 0.30126953125, 0.33056640625} -- 1 308 32 339 -ok + local COORDS_PIN_RIGHT = {0.03564453125, 0.06494140625, 0.30126953125, 0.33056640625} -- 36 308 67 339 -ok -- icones: 365 = 0.35693359375 // 397 = 0.38720703125 function _detalhes:AtualizarScrollBar (x) - local cabe = self.barrasInfo.cabem --> quantas barras cabem na janela + local cabe = self.rows_fit_in_window --> quantas barras cabem na janela if (not self.barraS[1]) then --primeira vez que as barras estão aparecendo self.barraS[1] = 1 --primeira barra @@ -97,7 +101,7 @@ function _detalhes:AtualizarScrollBar (x) if (not self.rolagem) then if (x > cabe) then --> Ligar a ScrollBar - self.barrasInfo.mostrando = x + self.rows_showing = x if (not self.baseframe.isStretching) then self:MostrarScrollBar() @@ -106,26 +110,26 @@ function _detalhes:AtualizarScrollBar (x) self.barraS[2] = cabe --> B é o total que cabe na barra else --> Do contrário B é o total de barras - self.barrasInfo.mostrando = x + self.rows_showing = x self.barraS[2] = x end else - if (x > self.barrasInfo.mostrando) then --> tem mais barras mostrando agora do que na última atualização - self.barrasInfo.mostrando = x - local nao_mostradas = self.barrasInfo.mostrando - self.barrasInfo.cabem - local slider_height = nao_mostradas*self.barrasInfo.alturaReal + if (x > self.rows_showing) then --> tem mais barras mostrando agora do que na última atualização + self.rows_showing = x + local nao_mostradas = self.rows_showing - self.rows_fit_in_window + local slider_height = nao_mostradas*self.row_height self.scroll.scrollMax = slider_height self.scroll:SetMinMaxValues (0, slider_height) else --> diminuiu a quantidade, acontece depois de uma coleta de lixo - self.barrasInfo.mostrando = x - local nao_mostradas = self.barrasInfo.mostrando - self.barrasInfo.cabem + self.rows_showing = x + local nao_mostradas = self.rows_showing - self.rows_fit_in_window if (nao_mostradas < 1) then --> se estiver mostrando menos do que realmente cabe não precisa scrollbar self:EsconderScrollBar() else --> contrário, basta atualizar o tamanho da scroll - local slider_height = nao_mostradas*self.barrasInfo.alturaReal + local slider_height = nao_mostradas*self.row_height self.scroll.scrollMax = slider_height self.scroll:SetMinMaxValues (0, slider_height) end @@ -151,10 +155,10 @@ local function move_barras (self, elapsed) self._move_func.time = 0 self._move_func.instancia.bgdisplay_loc = self._move_func.instancia.bgdisplay_loc + self._move_func.inc --> inc é -1 ou 1 e irá crescer ou diminuir a janela - for index = 1, self._move_func.instancia.barrasInfo.cabem do + for index = 1, self._move_func.instancia.rows_fit_in_window do self._move_func.instancia.barras [index]:SetWidth (self:GetWidth()+self._move_func.instancia.bgdisplay_loc-3) end - self._move_func.instancia.bgdisplay:SetPoint ("BOTTOMRIGHT", self, "BOTTOMRIGHT", self._move_func.instancia.bgdisplay_loc, 0) + self._move_func.instancia.bgdisplay:SetPoint ("bottomright", self, "bottomright", self._move_func.instancia.bgdisplay_loc, 0) self._move_func.instancia.bar_mod = self._move_func.instancia.bgdisplay_loc+(-3) @@ -207,11 +211,11 @@ function _detalhes:MostrarScrollBar (sem_animacao) self:MoveBarrasTo (mover_para) else --> set size of rows - for index = 1, self.barrasInfo.cabem do + for index = 1, self.rows_fit_in_window do self.barras [index]:SetWidth (self.baseframe:GetWidth()+mover_para -3) --> -3 distance between row end and scroll start end --> move the semi-background to the left (which moves the scroll) - self.bgdisplay:SetPoint ("BOTTOMRIGHT", self.baseframe, "BOTTOMRIGHT", mover_para, 0) + self.bgdisplay:SetPoint ("bottomright", self.baseframe, "bottomright", mover_para, 0) self.bar_mod = mover_para + (-3) self.bgdisplay_loc = mover_para @@ -222,8 +226,8 @@ function _detalhes:MostrarScrollBar (sem_animacao) end end - local nao_mostradas = self.barrasInfo.mostrando - self.barrasInfo.cabem - local slider_height = nao_mostradas*self.barrasInfo.alturaReal + local nao_mostradas = self.rows_showing - self.rows_fit_in_window + local slider_height = nao_mostradas*self.row_height self.scroll.scrollMax = slider_height self.scroll:SetMinMaxValues (0, slider_height) @@ -233,10 +237,10 @@ function _detalhes:MostrarScrollBar (sem_animacao) self.scroll:SetValue (0) --> set value pode chamar o atualizador self.baseframe.button_down:Enable() - main.resize_direita:SetPoint ("BOTTOMRIGHT", main, "BOTTOMRIGHT", self.largura_scroll*-1, 0) + main.resize_direita:SetPoint ("bottomright", main, "bottomright", self.largura_scroll*-1, 0) if (main.isLocked) then - main.lock_button:SetPoint ("BOTTOMRIGHT", main, "BOTTOMRIGHT", self.largura_scroll*-1, 0) + main.lock_button:SetPoint ("bottomright", main, "bottomright", self.largura_scroll*-1, 0) end end @@ -257,12 +261,12 @@ function _detalhes:EsconderScrollBar (sem_animacao, force) local main = self.baseframe if (not sem_animacao and _detalhes.animate_scroll) then - self:MoveBarrasTo (self.barrasInfo.espaco.direita + 3) --> + self:MoveBarrasTo (self.row_info.space.right + 3) --> else - for index = 1, self.barrasInfo.cabem do + for index = 1, self.rows_fit_in_window do self.barras [index]:SetWidth (self.baseframe:GetWidth() - 5) --> -5 space between row end and window right border end - self.bgdisplay:SetPoint ("BOTTOMRIGHT", self.baseframe, "BOTTOMRIGHT", 0, 0) -- voltar o background na pocição inicial + self.bgdisplay:SetPoint ("bottomright", self.baseframe, "bottomright", 0, 0) -- voltar o background na pocição inicial self.bar_mod = 0 -- zera o bar mod, uma vez que as barras vão estar na pocisão inicial self.bgdisplay_loc = -2 if (self.baseframe:GetScript ("OnUpdate") and self.baseframe:GetScript ("OnUpdate") == move_barras) then @@ -274,9 +278,9 @@ function _detalhes:EsconderScrollBar (sem_animacao, force) self.scroll:Disable() main:EnableMouseWheel (false) - main.resize_direita:SetPoint ("BOTTOMRIGHT", main, "BOTTOMRIGHT", 0, 0) + main.resize_direita:SetPoint ("bottomright", main, "bottomright", 0, 0) if (main.isLocked) then - main.lock_button:SetPoint ("BOTTOMRIGHT", main, "BOTTOMRIGHT", 0, 0) + main.lock_button:SetPoint ("bottomright", main, "bottomright", 0, 0) end end @@ -285,8 +289,8 @@ local function OnLeaveMainWindow (instancia, self) if (instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and not instancia.baseframe.isLocked) then --> resizes and lock button - gump:Fade (instancia.baseframe.resize_direita, 1) - gump:Fade (instancia.baseframe.resize_esquerda, 1) + instancia.baseframe.resize_direita:SetAlpha (0) + instancia.baseframe.resize_esquerda:SetAlpha (0) gump:Fade (instancia.baseframe.lock_button, 1) --> stretch button @@ -294,11 +298,12 @@ local function OnLeaveMainWindow (instancia, self) gump:Fade (instancia.baseframe.button_stretch, "ALPHA", 0) --> snaps - gump:Fade (instancia.botao_separar, 1) + instancia.botao_separar:SetAlpha (0) - elseif (instancia.baseframe.isLocked) then + elseif (instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and instancia.baseframe.isLocked) then gump:Fade (instancia.baseframe.lock_button, 1) gump:Fade (instancia.baseframe.button_stretch, "ALPHA", 0) + instancia.botao_separar:SetAlpha (0) end end @@ -309,57 +314,38 @@ local function OnEnterMainWindow (instancia, self) if (instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and not instancia.baseframe.isLocked) then --> resizes and lock button - gump:Fade (instancia.baseframe.resize_direita, 0) - gump:Fade (instancia.baseframe.resize_esquerda, 0) + instancia.baseframe.resize_direita:SetAlpha (1) + instancia.baseframe.resize_esquerda:SetAlpha (1) + gump:Fade (instancia.baseframe.lock_button, 0) --> stretch button gump:Fade (instancia.baseframe.button_stretch, "ALPHA", 0.6) --> snaps - if (modo == 0) then - for _, instancia_id in _pairs (instancia.snap) do - if (instancia_id) then - instancia.botao_separar.texture:Show() - instancia.botao_separar.texture:SetTexCoord (unpack (COORDS_UNLOCK_BUTTON)) - gump:Fade (instancia.botao_separar.texture, 0) - gump:Fade (instancia.botao_separar, 0) - break - end + for _, instancia_id in _pairs (instancia.snap) do + if (instancia_id) then + instancia.botao_separar:SetAlpha (1) + break end end - elseif (instancia.baseframe.isLocked) then + elseif (instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and instancia.baseframe.isLocked) then gump:Fade (instancia.baseframe.lock_button, 0) gump:Fade (instancia.baseframe.button_stretch, "ALPHA", 0.6) + + --> snaps + for _, instancia_id in _pairs (instancia.snap) do + if (instancia_id) then + instancia.botao_separar:SetAlpha (1) + break + end + end end end _detalhes.OnEnterMainWindow = OnEnterMainWindow -local function resize_fade (instancia, modo) - if (instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and not instancia.baseframe.isLocked) then - gump:Fade (instancia.baseframe.resize_direita, modo) - gump:Fade (instancia.baseframe.resize_esquerda, modo) - gump:Fade (instancia.baseframe.lock_button, modo) - - if (modo == 0) then - for _, instancia_id in _pairs (instancia.snap) do - if (instancia_id) then - instancia.botao_separar.texture:Show() - instancia.botao_separar.texture:SetTexCoord (unpack (COORDS_UNLOCK_BUTTON)) - gump:Fade (instancia.botao_separar.texture, 0) - gump:Fade (instancia.botao_separar, 0) - break - end - end - else - gump:Fade (instancia.botao_separar, 1) - end - - end -end - local function VPL (instancia, esta_instancia) --> conferir esquerda if (instancia.ponto4.x < esta_instancia.ponto1.x) then --> a janela esta a esquerda @@ -447,27 +433,27 @@ local movement_onupdate = function (self, elapsed) end end -local function move_janela (BaseFrame, iniciando, instancia) +local function move_janela (baseframe, iniciando, instancia) instancia_alvo = _detalhes.tabela_instancias [instancia.meu_id-1] if (iniciando) then - BaseFrame.isMoving = true + baseframe.isMoving = true instancia:BaseFrameSnap() - BaseFrame:StartMoving() + baseframe:StartMoving() local _, ClampLeft, ClampRight = instancia:InstanciasHorizontais() local _, ClampBottom, ClampTop = instancia:InstanciasVerticais() if (ClampTop == 0) then - ClampTop = 33 + ClampTop = 0 end if (ClampBottom == 0) then - ClampBottom = 13 + ClampBottom = 0 end - BaseFrame:SetClampRectInsets (-ClampLeft-8, ClampRight, ClampTop, -ClampBottom) + baseframe:SetClampRectInsets (-ClampLeft, ClampRight, ClampTop, -ClampBottom) if (instancia_alvo) then @@ -504,7 +490,7 @@ local function move_janela (BaseFrame, iniciando, instancia) if (need_start) then --> se a instância não tiver sido aberta ainda - instancia_alvo:RestauraJanela (instancia_alvo.meu_id, true) --> problema do solo era aqui + instancia_alvo:RestauraJanela (instancia_alvo.meu_id, true) if (instancia_alvo:IsSoloMode()) then _detalhes.SoloTables:switch() end @@ -517,16 +503,16 @@ local function move_janela (BaseFrame, iniciando, instancia) need_start = false end - BaseFrame:SetScript ("OnUpdate", movement_onupdate) + baseframe:SetScript ("OnUpdate", movement_onupdate) end else - BaseFrame:StopMovingOrSizing() - BaseFrame.isMoving = false - BaseFrame:SetScript ("OnUpdate", nil) + baseframe:StopMovingOrSizing() + baseframe.isMoving = false + baseframe:SetScript ("OnUpdate", nil) - BaseFrame:SetClampRectInsets (unpack (_detalhes.window_clamp)) + --baseframe:SetClampRectInsets (unpack (_detalhes.window_clamp)) if (instancia_alvo) then instancia:AtualizaPontos() @@ -609,37 +595,33 @@ local function move_janela (BaseFrame, iniciando, instancia) end end -local function BGFrame_scripts (BG, BaseFrame, instancia) +local function BGFrame_scripts (BG, baseframe, instancia) BG:SetScript("OnEnter", function (self) - --resize_fade (instancia, 0) --mostrar - --gump:Fade (BaseFrame.button_stretch, "alpha", 0.6) OnEnterMainWindow (instancia, self) end) BG:SetScript("OnLeave", function (self) - --resize_fade (instancia, 1) --esconder - --gump:Fade (BaseFrame.button_stretch, -1) OnLeaveMainWindow (instancia, self) end) BG:SetScript ("OnMouseDown", function (frame, button) - if (BaseFrame.isMoving) then - move_janela (BaseFrame, false, instancia) + if (baseframe.isMoving) then + move_janela (baseframe, false, instancia) instancia:SaveMainWindowPosition() return end - if (not BaseFrame.isLocked and button == "LeftButton") then - move_janela (BaseFrame, true, instancia) --> novo movedor da janela + if (not baseframe.isLocked and button == "LeftButton") then + move_janela (baseframe, true, instancia) --> novo movedor da janela elseif (button == "RightButton") then _detalhes.switch:ShowMe (instancia) end end) BG:SetScript ("OnMouseUp", function (frame) - if (BaseFrame.isMoving) then - move_janela (BaseFrame, false, instancia) --> novo movedor da janela + if (baseframe.isMoving) then + move_janela (baseframe, false, instancia) --> novo movedor da janela instancia:SaveMainWindowPosition() end end) @@ -662,52 +644,44 @@ function gump:RegisterForDetailsMove (frame, instancia) end --> scripts do base frame -local function BFrame_scripts (BaseFrame, instancia) +local function BFrame_scripts (baseframe, instancia) - BaseFrame:SetScript("OnSizeChanged", function(self) + baseframe:SetScript("OnSizeChanged", function (self) instancia:SaveMainWindowPosition() instancia:ReajustaGump() _detalhes:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, instancia) end) - BaseFrame:SetScript("OnEnter", function (self) - --resize_fade (instancia, 0) --mostrar - --gump:Fade (BaseFrame.button_stretch, "alpha", 0.6) + baseframe:SetScript("OnEnter", function (self) OnEnterMainWindow (instancia, self) end) - BaseFrame:SetScript("OnLeave", function (self) - --resize_fade (instancia, 1) --esconder - --gump:Fade (BaseFrame.button_stretch, -1) + baseframe:SetScript("OnLeave", function (self) OnLeaveMainWindow (instancia, self) end) - BaseFrame:SetScript ("OnMouseDown", function (frame, button) - if (not BaseFrame.isLocked and button == "LeftButton") then - move_janela (BaseFrame, true, instancia) --> novo movedor da janela + baseframe:SetScript ("OnMouseDown", function (frame, button) + if (not baseframe.isLocked and button == "LeftButton") then + move_janela (baseframe, true, instancia) --> novo movedor da janela end end) - BaseFrame:SetScript ("OnMouseUp", function (frame) - if (BaseFrame.isMoving) then - move_janela (BaseFrame, false, instancia) --> novo movedor da janela + baseframe:SetScript ("OnMouseUp", function (frame) + if (baseframe.isMoving) then + move_janela (baseframe, false, instancia) --> novo movedor da janela instancia:SaveMainWindowPosition() end end) end -local function BackGroundDisplay_scripts (BackGroundDisplay, BaseFrame, instancia) +local function backgrounddisplay_scripts (backgrounddisplay, baseframe, instancia) - BackGroundDisplay:SetScript ("OnEnter", function (self) - --resize_fade (instancia, 0) --mostrar - --gump:Fade (BaseFrame.button_stretch, "alpha", 0.6) + backgrounddisplay:SetScript ("OnEnter", function (self) OnEnterMainWindow (instancia, self) end) - BackGroundDisplay:SetScript ("OnLeave", function (self) - --resize_fade (instancia, 1) --esconder - --gump:Fade (BaseFrame.button_stretch, -1) + backgrounddisplay:SetScript ("OnLeave", function (self) OnLeaveMainWindow (instancia, self) end) end @@ -957,21 +931,21 @@ local resizeTooltip = { {text = "|cff33CC00Click|cffEEEEEE: ".. Loc ["STRING_RESIZE_COMMON"]}, {text = "+|cff33CC00 Click|cffEEEEEE: " .. Loc ["STRING_RESIZE_HORIZONTAL"]}, - {icon = "Interface\\AddOns\\Details\\images\\key_shift", width = 24, height = 14, l = 0, r = 1, t = 0, b =0.640625}, + {icon = [[Interface\AddOns\Details\images\key_shift]], width = 24, height = 14, l = 0, r = 1, t = 0, b =0.640625}, {text = "+|cff33CC00 Click|cffEEEEEE: " .. Loc ["STRING_RESIZE_VERTICAL"]}, - {icon = "Interface\\AddOns\\Details\\images\\key_alt", width = 24, height = 14, l = 0, r = 1, t = 0, b =0.640625}, + {icon = [[Interface\AddOns\Details\images\key_alt]], width = 24, height = 14, l = 0, r = 1, t = 0, b =0.640625}, {text = "+|cff33CC00 Click|cffEEEEEE: " .. Loc ["STRING_RESIZE_ALL"]}, - {icon = "Interface\\AddOns\\Details\\images\\key_ctrl", width = 24, height = 14, l = 0, r = 1, t = 0, b =0.640625} + {icon = [[Interface\AddOns\Details\images\key_ctrl]], width = 24, height = 14, l = 0, r = 1, t = 0, b =0.640625} } --> search key: ~resizescript -local function resize_scripts (resizer, instancia, ScrollBar, side, baseframe) +local function resize_scripts (resizer, instancia, scrollbar, side, baseframe) resizer:SetScript ("OnMouseDown", function (self, button) - _detalhes.popup:ShowMe (false) --> Hide Cooltip + _G.GameCooltip:ShowMe (false) --> Hide Cooltip if (not self:GetParent().isLocked and button == "LeftButton" and instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"]) then self:GetParent().isResizing = true @@ -999,39 +973,39 @@ local function resize_scripts (resizer, instancia, ScrollBar, side, baseframe) if (side == "<") then if (_IsShiftKeyDown()) then - instancia.baseframe:StartSizing("LEFT") + instancia.baseframe:StartSizing("left") instancia.eh_horizontal = true elseif (_IsAltKeyDown()) then - instancia.baseframe:StartSizing("TOP") + instancia.baseframe:StartSizing("top") instancia.eh_vertical = true elseif (_IsControlKeyDown()) then - instancia.baseframe:StartSizing("BOTTOMLEFT") + instancia.baseframe:StartSizing("bottomleft") instancia.eh_tudo = true else - instancia.baseframe:StartSizing("BOTTOMLEFT") + instancia.baseframe:StartSizing("bottomleft") end - resizer:SetPoint ("BOTTOMLEFT", baseframe, "BOTTOMLEFT", -1, -1) + resizer:SetPoint ("bottomleft", baseframe, "bottomleft", -1, -1) resizer.afundado = true elseif (side == ">") then if (_IsShiftKeyDown()) then - instancia.baseframe:StartSizing("RIGHT") + instancia.baseframe:StartSizing("right") instancia.eh_horizontal = true elseif (_IsAltKeyDown()) then - instancia.baseframe:StartSizing("TOP") + instancia.baseframe:StartSizing("top") instancia.eh_vertical = true elseif (_IsControlKeyDown()) then - instancia.baseframe:StartSizing("BOTTOMRIGHT") + instancia.baseframe:StartSizing("bottomright") instancia.eh_tudo = true else - instancia.baseframe:StartSizing("BOTTOMRIGHT") + instancia.baseframe:StartSizing("bottomright") end if (instancia.rolagem and _detalhes.use_scroll) then - resizer:SetPoint ("BOTTOMRIGHT", baseframe, "BOTTOMRIGHT", (instancia.largura_scroll*-1) + 1, -1) + resizer:SetPoint ("bottomright", baseframe, "bottomright", (instancia.largura_scroll*-1) + 1, -1) else - resizer:SetPoint ("BOTTOMRIGHT", baseframe, "BOTTOMRIGHT", 1, -1) + resizer:SetPoint ("bottomright", baseframe, "bottomright", 1, -1) end resizer.afundado = true end @@ -1047,12 +1021,12 @@ local function resize_scripts (resizer, instancia, ScrollBar, side, baseframe) resizer.afundado = false if (resizer.side == 2) then if (instancia.rolagem and _detalhes.use_scroll) then - resizer:SetPoint ("BOTTOMRIGHT", baseframe, "BOTTOMRIGHT", instancia.largura_scroll*-1, 0) + resizer:SetPoint ("bottomright", baseframe, "bottomright", instancia.largura_scroll*-1, 0) else - resizer:SetPoint ("BOTTOMRIGHT", baseframe, "BOTTOMRIGHT", 0, 0) + resizer:SetPoint ("bottomright", baseframe, "bottomright", 0, 0) end else - resizer:SetPoint ("BOTTOMLEFT", baseframe, "BOTTOMLEFT", 0, 0) + resizer:SetPoint ("bottomleft", baseframe, "bottomleft", 0, 0) end end @@ -1120,11 +1094,18 @@ local function resize_scripts (resizer, instancia, ScrollBar, side, baseframe) end end) + resizer:SetScript ("OnHide", function (self) + if (self.going_hide) then + _G.GameCooltip:ShowMe (false) + self.going_hide = nil + end + end) + resizer:SetScript ("OnEnter", function (self) - - OnEnterMainWindow (instancia, self) - - if (instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and not instancia.baseframe.isLocked) then + if (instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and not instancia.baseframe.isLocked and not self.mostrando) then + + OnEnterMainWindow (instancia, self) + self.texture:SetBlendMode ("ADD") self.mostrando = true @@ -1139,20 +1120,24 @@ local function resize_scripts (resizer, instancia, ScrollBar, side, baseframe) resizer:SetScript ("OnLeave", function (self) - if (not self.movendo) then - OnLeaveMainWindow (instancia, self) + if (self.mostrando) then + + resizer.going_hide = true + if (not self.movendo) then + OnLeaveMainWindow (instancia, self) + end + + self.texture:SetBlendMode ("BLEND") + self.mostrando = false + + _G.GameCooltip:ShowMe (false) end - - self.texture:SetBlendMode ("BLEND") - _detalhes.popup:ShowMe (false) - - self.mostrando = false end) end local function lock_button_scripts (button, instancia) - button:SetScript ("OnEnter", function(self) + button:SetScript ("OnEnter", function (self) OnEnterMainWindow (instancia, self) @@ -1163,7 +1148,7 @@ local function lock_button_scripts (button, instancia) end) - button:SetScript ("OnLeave", function(self) + button:SetScript ("OnLeave", function (self) OnLeaveMainWindow (instancia, self) self.label:SetTextColor (.3, .3, .3, .6) @@ -1173,25 +1158,25 @@ local function lock_button_scripts (button, instancia) end local lockFunctionOnClick = function (button) - local BaseFrame = button:GetParent() - if (BaseFrame.isLocked) then - BaseFrame.isLocked = false - BaseFrame.instance.isLocked = false + local baseframe = button:GetParent() + if (baseframe.isLocked) then + baseframe.isLocked = false + baseframe.instance.isLocked = false button.label:SetText (Loc ["STRING_LOCK_WINDOW"]) button:SetWidth (button.label:GetStringWidth()+2) - gump:Fade (BaseFrame.resize_direita, 0) - gump:Fade (BaseFrame.resize_esquerda, 0) + baseframe.resize_direita:SetAlpha (1) + baseframe.resize_esquerda:SetAlpha (1) button:ClearAllPoints() - button:SetPoint ("right", BaseFrame.resize_direita, "left", -1, 1.5) + button:SetPoint ("right", baseframe.resize_direita, "left", -1, 1.5) else - BaseFrame.isLocked = true - BaseFrame.instance.isLocked = true + baseframe.isLocked = true + baseframe.instance.isLocked = true button.label:SetText (Loc ["STRING_UNLOCK_WINDOW"]) button:SetWidth (button.label:GetStringWidth()+2) button:ClearAllPoints() - button:SetPoint ("bottomright", BaseFrame, "bottomright", -3, 0) - gump:Fade (BaseFrame.resize_direita, 1) - gump:Fade (BaseFrame.resize_esquerda, 1) + button:SetPoint ("bottomright", baseframe, "bottomright", -3, 0) + baseframe.resize_direita:SetAlpha (0) + baseframe.resize_esquerda:SetAlpha (0) end end _detalhes.lock_instance_function = lockFunctionOnClick @@ -1212,14 +1197,12 @@ local function barra_scripts (esta_barra, instancia, i) esta_barra:SetScript ("OnEnter", function (self) self.mouse_over = true - --resize_fade (instancia, 0) --mostrar - --gump:Fade (instancia.baseframe.button_stretch, "alpha", 0.6) OnEnterMainWindow (instancia, esta_barra) instancia:MontaTooltip (self, i) self:SetBackdrop({ - bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", + bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1},}) self:SetBackdropColor (0.588, 0.588, 0.588, 0.7) @@ -1227,12 +1210,10 @@ local function barra_scripts (esta_barra, instancia, i) esta_barra:SetScript ("OnLeave", function (self) self.mouse_over = false - --resize_fade (instancia, 1) --esconder - --gump:Fade (instancia.baseframe.button_stretch, -1) OnLeaveMainWindow (instancia, self) _GameTooltip:Hide() - _detalhes.popup:ShowMe (false) + _G.GameCooltip:ShowMe (false) self:SetBackdrop({ bgFile = "", edgeFile = "", tile = true, tileSize = 16, edgeSize = 32, @@ -1252,8 +1233,8 @@ local function barra_scripts (esta_barra, instancia, i) return _detalhes.switch:ShowMe (instancia) end - esta_barra.texto_esquerdo:SetPoint ("LEFT", esta_barra.icone_classe, "right", 4, -1) - esta_barra.texto_direita:SetPoint ("RIGHT", esta_barra.statusbar, "RIGHT", 1, -1) + esta_barra.texto_esquerdo:SetPoint ("left", esta_barra.icone_classe, "right", 4, -1) + esta_barra.texto_direita:SetPoint ("right", esta_barra.statusbar, "right", 1, -1) self.mouse_down = _GetTime() self.button = button @@ -1283,8 +1264,8 @@ local function barra_scripts (esta_barra, instancia, i) end - esta_barra.texto_esquerdo:SetPoint ("LEFT", esta_barra.icone_classe, "right", 3, 0) - esta_barra.texto_direita:SetPoint ("RIGHT", esta_barra.statusbar, "RIGHT") + esta_barra.texto_esquerdo:SetPoint ("left", esta_barra.icone_classe, "right", 3, 0) + esta_barra.texto_direita:SetPoint ("right", esta_barra.statusbar, "right") local x, y = _GetCursorPosition() x = _math_floor (x) @@ -1304,7 +1285,7 @@ local function barra_scripts (esta_barra, instancia, i) end end) - esta_barra:SetScript ("OnClick", function(self, button) + esta_barra:SetScript ("OnClick", function (self, button) end) end @@ -1323,8 +1304,8 @@ function _detalhes:ReportSingleLine (instancia, barra) return _detalhes:Reportar (reportar, {_no_current = true, _no_inverse = true, _custom = true}) end -local function button_stretch_scripts (BaseFrame, BackGroundDisplay, instancia) - local button = BaseFrame.button_stretch +local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) + local button = baseframe.button_stretch button:SetScript ("OnEnter", function (self) self.mouse_over = true @@ -1335,27 +1316,31 @@ local function button_stretch_scripts (BaseFrame, BackGroundDisplay, instancia) gump:Fade (self, "ALPHA", 0) end) - button:SetScript ("OnMouseDown", function(self) + button:SetScript ("OnMouseDown", function (self) if (instancia:IsSoloMode()) then return end instancia:EsconderScrollBar (true) - BaseFrame._place = instancia:SaveMainWindowPosition() - BaseFrame.isResizing = true - BaseFrame.isStretching = true - BaseFrame:SetFrameStrata ("TOOLTIP") + baseframe._place = instancia:SaveMainWindowPosition() + baseframe.isResizing = true + baseframe.isStretching = true + baseframe:SetFrameStrata ("TOOLTIP") - local _r, _g, _b, _a = BaseFrame:GetBackdropColor() - gump:GradientEffect ( BaseFrame, "frame", _r, _g, _b, _a, _r, _g, _b, 0.9, 1.5) + local _r, _g, _b, _a = baseframe:GetBackdropColor() + gump:GradientEffect ( baseframe, "frame", _r, _g, _b, _a, _r, _g, _b, 0.9, 1.5) if (instancia.wallpaper.enabled) then - _r, _g, _b = BaseFrame.wallpaper:GetVertexColor() - _a = BaseFrame.wallpaper:GetAlpha() - gump:GradientEffect (BaseFrame.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, 0.05, 0.5) + _r, _g, _b = baseframe.wallpaper:GetVertexColor() + _a = baseframe.wallpaper:GetAlpha() + gump:GradientEffect (baseframe.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, 0.05, 0.5) end - BaseFrame:StartSizing ("TOP") + if (instancia.stretch_button_side == 1) then + baseframe:StartSizing ("top") + elseif (instancia.stretch_button_side == 2) then + baseframe:StartSizing ("bottom") + end local linha_horizontal = {} @@ -1414,12 +1399,12 @@ local function button_stretch_scripts (BaseFrame, BackGroundDisplay, instancia) return end - if (BaseFrame.isResizing) then - BaseFrame:StopMovingOrSizing() - BaseFrame.isResizing = false - instancia:RestoreMainWindowPosition (BaseFrame._place) + if (baseframe.isResizing) then + baseframe:StopMovingOrSizing() + baseframe.isResizing = false + instancia:RestoreMainWindowPosition (baseframe._place) instancia:ReajustaGump() - BaseFrame.isStretching = false + baseframe.isStretching = false if (instancia.need_rolagem) then instancia:MostrarScrollBar (true) end @@ -1455,16 +1440,16 @@ local function button_stretch_scripts (BaseFrame, BackGroundDisplay, instancia) end - local _r, _g, _b, _a = BaseFrame:GetBackdropColor() - gump:GradientEffect ( BaseFrame, "frame", _r, _g, _b, _a, instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha, 0.5) + local _r, _g, _b, _a = baseframe:GetBackdropColor() + gump:GradientEffect ( baseframe, "frame", _r, _g, _b, _a, instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha, 0.5) if (instancia.wallpaper.enabled) then - _r, _g, _b = BaseFrame.wallpaper:GetVertexColor() - _a = BaseFrame.wallpaper:GetAlpha() - gump:GradientEffect (BaseFrame.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, instancia.wallpaper.alpha, 1.0) + _r, _g, _b = baseframe.wallpaper:GetVertexColor() + _a = baseframe.wallpaper:GetAlpha() + gump:GradientEffect (baseframe.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, instancia.wallpaper.alpha, 1.0) end - BaseFrame:SetFrameStrata ("LOW") - BaseFrame.button_stretch:SetFrameStrata ("FULLSCREEN") + baseframe:SetFrameStrata ("LOW") + baseframe.button_stretch:SetFrameStrata ("FULLSCREEN") _detalhes:SnapTextures (false) @@ -1472,15 +1457,15 @@ local function button_stretch_scripts (BaseFrame, BackGroundDisplay, instancia) end) end -local function button_down_scripts (main_frame, BackGroundDisplay, instancia, ScrollBar) +local function button_down_scripts (main_frame, backgrounddisplay, instancia, scrollbar) main_frame.button_down:SetScript ("OnMouseDown", function(self) - if (not ScrollBar:IsEnabled()) then + if (not scrollbar:IsEnabled()) then return end local B = instancia.barraS[2] - if (B < instancia.barrasInfo.mostrando) then - ScrollBar:SetValue (ScrollBar:GetValue() + instancia.barrasInfo.alturaReal) + if (B < instancia.rows_showing) then + scrollbar:SetValue (scrollbar:GetValue() + instancia.row_height) end self.precionado = true @@ -1490,8 +1475,8 @@ local function button_down_scripts (main_frame, BackGroundDisplay, instancia, Sc if (self.last_up > 0.03) then self.last_up = 0 B = instancia.barraS[2] - if (B < instancia.barrasInfo.mostrando) then - ScrollBar:SetValue (ScrollBar:GetValue() + instancia.barrasInfo.alturaReal) + if (B < instancia.rows_showing) then + scrollbar:SetValue (scrollbar:GetValue() + instancia.row_height) else self:Disable() end @@ -1499,33 +1484,33 @@ local function button_down_scripts (main_frame, BackGroundDisplay, instancia, Sc end) end) - main_frame.button_down:SetScript ("OnMouseUp", function(self) + main_frame.button_down:SetScript ("OnMouseUp", function (self) self.precionado = false self:SetScript ("OnUpdate", nil) end) end -local function button_up_scripts (main_frame, BackGroundDisplay, instancia, ScrollBar) +local function button_up_scripts (main_frame, backgrounddisplay, instancia, scrollbar) main_frame.button_up:SetScript ("OnMouseDown", function(self) - if (not ScrollBar:IsEnabled()) then + if (not scrollbar:IsEnabled()) then return end local A = instancia.barraS[1] if (A > 1) then - ScrollBar:SetValue (ScrollBar:GetValue() - instancia.barrasInfo.alturaReal) + scrollbar:SetValue (scrollbar:GetValue() - instancia.row_height) end self.precionado = true self.last_up = -0.3 - self:SetScript ("OnUpdate", function(self, elapsed) + self:SetScript ("OnUpdate", function (self, elapsed) self.last_up = self.last_up + elapsed if (self.last_up > 0.03) then self.last_up = 0 A = instancia.barraS[1] if (A > 1) then - ScrollBar:SetValue (ScrollBar:GetValue() - instancia.barrasInfo.alturaReal) + scrollbar:SetValue (scrollbar:GetValue() - instancia.row_height) else self:Disable() end @@ -1533,47 +1518,47 @@ local function button_up_scripts (main_frame, BackGroundDisplay, instancia, Scro end) end) - main_frame.button_up:SetScript ("OnMouseUp", function(self) + main_frame.button_up:SetScript ("OnMouseUp", function (self) self.precionado = false self:SetScript ("OnUpdate", nil) end) main_frame.button_up:SetScript ("OnEnable", function (self) - local current = ScrollBar:GetValue() + local current = scrollbar:GetValue() if (current == 0) then main_frame.button_up:Disable() end end) end -local function iterate_scroll_scripts (BackGroundDisplay, BackGroundFrame, BaseFrame, ScrollBar, instancia) +local function iterate_scroll_scripts (backgrounddisplay, backgroundframe, baseframe, scrollbar, instancia) - BaseFrame:SetScript ("OnMouseWheel", + baseframe:SetScript ("OnMouseWheel", function (self, delta) if (delta > 0) then --> rolou pra cima local A = instancia.barraS[1] if (A > 1) then - ScrollBar:SetValue (ScrollBar:GetValue() - instancia.barrasInfo.alturaReal) + scrollbar:SetValue (scrollbar:GetValue() - instancia.row_height) else - ScrollBar:SetValue (0) - ScrollBar.ultimo = 0 - BaseFrame.button_up:Disable() + scrollbar:SetValue (0) + scrollbar.ultimo = 0 + baseframe.button_up:Disable() end elseif (delta < 0) then --> rolou pra baixo local B = instancia.barraS[2] - if (B < instancia.barrasInfo.mostrando) then - ScrollBar:SetValue (ScrollBar:GetValue() + instancia.barrasInfo.alturaReal) + if (B < instancia.rows_showing) then + scrollbar:SetValue (scrollbar:GetValue() + instancia.row_height) else - local _, maxValue = ScrollBar:GetMinMaxValues() - ScrollBar:SetValue (maxValue) - ScrollBar.ultimo = maxValue - BaseFrame.button_down:Disable() + local _, maxValue = scrollbar:GetMinMaxValues() + scrollbar:SetValue (maxValue) + scrollbar.ultimo = maxValue + baseframe.button_down:Disable() end end end) - ScrollBar:SetScript ("OnValueChanged", function(self) + scrollbar:SetScript ("OnValueChanged", function (self) local ultimo = self.ultimo local meu_valor = self:GetValue() if (ultimo == meu_valor) then --> não mudou @@ -1581,47 +1566,47 @@ local function iterate_scroll_scripts (BackGroundDisplay, BackGroundFrame, BaseF end --> shortcut - local minValue, maxValue = ScrollBar:GetMinMaxValues() + local minValue, maxValue = scrollbar:GetMinMaxValues() if (minValue == meu_valor) then instancia.barraS[1] = 1 - instancia.barraS[2] = instancia.barrasInfo.cabem + instancia.barraS[2] = instancia.rows_fit_in_window instancia:AtualizaGumpPrincipal (instancia, true) self.ultimo = meu_valor - BaseFrame.button_up:Disable() + baseframe.button_up:Disable() return elseif (maxValue == meu_valor) then - local min = instancia.barrasInfo.mostrando -instancia.barrasInfo.cabem + local min = instancia.rows_showing -instancia.rows_fit_in_window min = min+1 if (min < 1) then min = 1 end instancia.barraS[1] = min - instancia.barraS[2] = instancia.barrasInfo.mostrando + instancia.barraS[2] = instancia.rows_showing instancia:AtualizaGumpPrincipal (instancia, true) self.ultimo = meu_valor - BaseFrame.button_down:Disable() + baseframe.button_down:Disable() return end - if (not BaseFrame.button_up:IsEnabled()) then - BaseFrame.button_up:Enable() + if (not baseframe.button_up:IsEnabled()) then + baseframe.button_up:Enable() end - if (not BaseFrame.button_down:IsEnabled()) then - BaseFrame.button_down:Enable() + if (not baseframe.button_down:IsEnabled()) then + baseframe.button_down:Enable() end if (meu_valor > ultimo) then --> scroll down local B = instancia.barraS[2] - if (B < instancia.barrasInfo.mostrando) then --> se o valor maximo não for o máximo de barras a serem mostradas - local precisa_passar = ((B+1) * instancia.barrasInfo.alturaReal) - (instancia.barrasInfo.alturaReal*instancia.barrasInfo.cabem) + if (B < instancia.rows_showing) then --> se o valor maximo não for o máximo de barras a serem mostradas + local precisa_passar = ((B+1) * instancia.row_height) - (instancia.row_height*instancia.rows_fit_in_window) if (meu_valor > precisa_passar) then --> o valor atual passou o valor que precisa passar pra locomover local diff = meu_valor - ultimo --> pega a diferença de H - diff = diff / instancia.barrasInfo.alturaReal --> calcula quantas barras ele pulou + diff = diff / instancia.row_height --> calcula quantas barras ele pulou diff = _math_ceil (diff) --> arredonda para cima - if (instancia.barraS[2]+diff > instancia.barrasInfo.mostrando and ultimo > 0) then - instancia.barraS[1] = instancia.barrasInfo.mostrando - (instancia.barrasInfo.cabem-1) - instancia.barraS[2] = instancia.barrasInfo.mostrando + if (instancia.barraS[2]+diff > instancia.rows_showing and ultimo > 0) then + instancia.barraS[1] = instancia.rows_showing - (instancia.rows_fit_in_window-1) + instancia.barraS[2] = instancia.rows_showing else instancia.barraS[2] = instancia.barraS[2]+diff instancia.barraS[1] = instancia.barraS[1]+diff @@ -1632,14 +1617,14 @@ local function iterate_scroll_scripts (BackGroundDisplay, BackGroundFrame, BaseF else --> scroll up local A = instancia.barraS[1] if (A > 1) then - local precisa_passar = (A-1) * instancia.barrasInfo.alturaReal + local precisa_passar = (A-1) * instancia.row_height if (meu_valor < precisa_passar) then --> calcula quantas barras passou local diff = ultimo - meu_valor - diff = diff / instancia.barrasInfo.alturaReal + diff = diff / instancia.row_height diff = _math_ceil (diff) if (instancia.barraS[1]-diff < 1) then - instancia.barraS[2] = instancia.barrasInfo.cabem + instancia.barraS[2] = instancia.rows_fit_in_window instancia.barraS[1] = 1 else instancia.barraS[2] = instancia.barraS[2]-diff @@ -1725,18 +1710,18 @@ function _detalhes:InstanceAlert (msg, icon, time, clickfunc) self.alert:Show() end -function CreateAlertFrame (BaseFrame, instancia) +function CreateAlertFrame (baseframe, instancia) - local alert_bg = CreateFrame ("frame", nil, BaseFrame) - alert_bg:SetPoint ("bottom", BaseFrame, "bottom") - alert_bg:SetPoint ("left", BaseFrame, "left", 3, 0) - alert_bg:SetPoint ("right", BaseFrame, "right", -3, 0) + local alert_bg = CreateFrame ("frame", nil, baseframe) + alert_bg:SetPoint ("bottom", baseframe, "bottom") + alert_bg:SetPoint ("left", baseframe, "left", 3, 0) + alert_bg:SetPoint ("right", baseframe, "right", -3, 0) alert_bg:SetHeight (12) - alert_bg:SetBackdrop ({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, + alert_bg:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) alert_bg:SetBackdropColor (.1, .1, .1, 1) alert_bg:SetFrameStrata ("HIGH") - alert_bg:SetFrameLevel (BaseFrame:GetFrameLevel() + 6) + alert_bg:SetFrameLevel (baseframe:GetFrameLevel() + 6) alert_bg:Hide() local toptexture = alert_bg:CreateTexture (nil, "background") @@ -1827,401 +1812,378 @@ end --> inicio function gump:CriaJanelaPrincipal (ID, instancia, criando) - local BaseFrame = _CreateFrame ("ScrollFrame", "DetailsBaseFrame"..ID, _UIParent) - BaseFrame.instance = instancia - BaseFrame:SetFrameStrata ("LOW") - BaseFrame:SetFrameLevel (2) +-- main frames ----------------------------------------------------------------------------------------------------------------------------------------------- - local BackGroundFrame = _CreateFrame ("ScrollFrame", "Details_WindowFrame"..ID, BaseFrame) --> janela principal - local BackGroundDisplay = _CreateFrame ("Frame", "Details_GumpFrame"..ID, BackGroundFrame) --corpo - BackGroundFrame:SetFrameLevel (3) - BackGroundDisplay:SetFrameLevel (3) + local baseframe = CreateFrame ("scrollframe", "DetailsBaseFrame"..ID, _UIParent) --> main frame + baseframe.instance = instancia + baseframe:SetFrameStrata ("LOW") + baseframe:SetFrameLevel (2) - local SwitchButton = gump:NewDetailsButton (BackGroundDisplay, BaseFrame, _, function() end, nil, nil, 1, 1, "", "", "", "", + local backgroundframe = CreateFrame ("scrollframe", "Details_WindowFrame"..ID, baseframe) --> main window + local backgrounddisplay = CreateFrame ("frame", "Details_GumpFrame"..ID, backgroundframe) --> background window + backgroundframe:SetFrameLevel (3) + backgrounddisplay:SetFrameLevel (3) + + local switchbutton = gump:NewDetailsButton (backgrounddisplay, baseframe, _, function() end, nil, nil, 1, 1, "", "", "", "", {rightFunc = {func = function() _detalhes.switch:ShowMe (instancia) end, param1 = nil, param2 = nil}}) - SwitchButton:SetPoint ("topleft", BackGroundDisplay, "topleft") - SwitchButton:SetPoint ("bottomright", BackGroundDisplay, "bottomright") - SwitchButton:SetFrameLevel (BackGroundDisplay:GetFrameLevel()+1) + switchbutton:SetPoint ("topleft", backgrounddisplay, "topleft") + switchbutton:SetPoint ("bottomright", backgrounddisplay, "bottomright") + switchbutton:SetFrameLevel (backgrounddisplay:GetFrameLevel()+1) - local ScrollBar = _CreateFrame ("Slider", "Details_ScrollBar"..ID, BackGroundDisplay) --> scroll +-- scroll bar ----------------------------------------------------------------------------------------------------------------------------------------------- --- textura da scroll bar -------------------------------------------------------------------------------------------------------------------------------------------------- + local scrollbar = CreateFrame ("slider", "Details_ScrollBar"..ID, backgrounddisplay) --> scroll + --> scroll image-node up - BaseFrame.scroll_up = BackGroundDisplay:CreateTexture (nil, "BACKGROUND") - BaseFrame.scroll_up:SetPoint ("TOPLEFT", BackGroundDisplay, "TOPRIGHT", 0, 0) - BaseFrame.scroll_up:SetTexture (DEFAULT_SKIN) - BaseFrame.scroll_up:SetTexCoord (unpack (COORDS_SLIDER_TOP)) - BaseFrame.scroll_up:SetWidth (32) - BaseFrame.scroll_up:SetHeight (32) - --BaseFrame.scroll_up:SetTexture ("Interface\\AddOns\\Details\\images\\scrollbar") - --BaseFrame.scroll_up:SetTexCoord (0, 1, 0, 0.25) + baseframe.scroll_up = backgrounddisplay:CreateTexture (nil, "background") + baseframe.scroll_up:SetPoint ("topleft", backgrounddisplay, "topright", 0, 0) + baseframe.scroll_up:SetTexture (DEFAULT_SKIN) + baseframe.scroll_up:SetTexCoord (unpack (COORDS_SLIDER_TOP)) + baseframe.scroll_up:SetWidth (32) + baseframe.scroll_up:SetHeight (32) --> scroll image-node down - BaseFrame.scroll_down = BackGroundDisplay:CreateTexture (nil, "BACKGROUND") - BaseFrame.scroll_down:SetPoint ("BOTTOMLEFT", BackGroundDisplay, "BOTTOMRIGHT", 0, 0) - BaseFrame.scroll_down:SetTexture (DEFAULT_SKIN) - BaseFrame.scroll_down:SetTexCoord (unpack (COORDS_SLIDER_DOWN)) - BaseFrame.scroll_down:SetWidth (32) - BaseFrame.scroll_down:SetHeight (32) - --BaseFrame.scroll_down:SetTexture ("Interface\\AddOns\\Details\\images\\scrollbar") - --BaseFrame.scroll_down:SetTexCoord (0, 1, 0.751, 1) + baseframe.scroll_down = backgrounddisplay:CreateTexture (nil, "background") + baseframe.scroll_down:SetPoint ("bottomleft", backgrounddisplay, "bottomright", 0, 0) + baseframe.scroll_down:SetTexture (DEFAULT_SKIN) + baseframe.scroll_down:SetTexCoord (unpack (COORDS_SLIDER_DOWN)) + baseframe.scroll_down:SetWidth (32) + baseframe.scroll_down:SetHeight (32) --> scroll image-node middle - BaseFrame.scroll_middle = BackGroundDisplay:CreateTexture (nil, "BACKGROUND") - BaseFrame.scroll_middle:SetPoint ("TOP", BaseFrame.scroll_up, "BOTTOM", 0, 8) - BaseFrame.scroll_middle:SetPoint ("BOTTOM", BaseFrame.scroll_down, "TOP", 0, -11) - BaseFrame.scroll_middle:SetTexture (DEFAULT_SKIN) - BaseFrame.scroll_middle:SetTexCoord (unpack (COORDS_SLIDER_MIDDLE)) - BaseFrame.scroll_middle:SetWidth (32) - BaseFrame.scroll_middle:SetHeight (64) - --BaseFrame.scroll_middle:SetTexCoord (0, 1, 0.251, 0.75) - --BaseFrame.scroll_middle:SetTexture ("Interface\\AddOns\\Details\\images\\scrollbar") + baseframe.scroll_middle = backgrounddisplay:CreateTexture (nil, "background") + baseframe.scroll_middle:SetPoint ("top", baseframe.scroll_up, "bottom", 0, 8) + baseframe.scroll_middle:SetPoint ("bottom", baseframe.scroll_down, "top", 0, -11) + baseframe.scroll_middle:SetTexture (DEFAULT_SKIN) + baseframe.scroll_middle:SetTexCoord (unpack (COORDS_SLIDER_MIDDLE)) + baseframe.scroll_middle:SetWidth (32) + baseframe.scroll_middle:SetHeight (64) - --> três botões scroll up, down, window strech - BaseFrame.button_up = _CreateFrame ("Button", nil, BackGroundDisplay) - BaseFrame.button_down = _CreateFrame ("Button", nil, BackGroundDisplay) - BaseFrame.button_stretch = _CreateFrame ("Button", nil, BaseFrame) + --> scroll widgets + baseframe.button_up = CreateFrame ("button", nil, backgrounddisplay) + baseframe.button_down = CreateFrame ("button", nil, backgrounddisplay) - BaseFrame.button_stretch:SetPoint ("BOTTOM", BaseFrame, "TOP", 0, 20) - BaseFrame.button_stretch:SetPoint ("RIGHT", BaseFrame, "RIGHT", -27, 0) - BaseFrame.button_stretch:SetFrameStrata ("FULLSCREEN") - - local stretch_texture = BaseFrame.button_stretch:CreateTexture (nil, "overlay") - stretch_texture:SetTexture (DEFAULT_SKIN) - stretch_texture:SetTexCoord (unpack (COORDS_STRETCH)) - stretch_texture:SetWidth (32) - stretch_texture:SetHeight (16) - stretch_texture:SetAllPoints (BaseFrame.button_stretch) - BaseFrame.button_stretch.texture = stretch_texture - - BaseFrame.button_stretch:SetWidth (32) - BaseFrame.button_stretch:SetHeight (16) - gump:Fade (BaseFrame.button_stretch, "ALPHA", 0) - - BaseFrame.button_stretch:Show() + baseframe.button_up:SetWidth (29) + baseframe.button_up:SetHeight (32) + baseframe.button_up:SetNormalTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollUpButton-Up]]) + baseframe.button_up:SetPushedTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollUpButton-Down]]) + baseframe.button_up:SetDisabledTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollUpButton-Disabled]]) + baseframe.button_up:Disable() - BaseFrame.button_up:SetWidth (29) - BaseFrame.button_up:SetHeight (32) - BaseFrame.button_up:SetNormalTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Up") - BaseFrame.button_up:SetPushedTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Down") - BaseFrame.button_up:SetDisabledTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Disabled") - BaseFrame.button_up:Disable() + baseframe.button_down:SetWidth (29) + baseframe.button_down:SetHeight (32) + baseframe.button_down:SetNormalTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollDownButton-Up]]) + baseframe.button_down:SetPushedTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollDownButton-Down]]) + baseframe.button_down:SetDisabledTexture ([[Interface\BUTTONS\UI-ScrollBar-ScrollDownButton-Disabled]]) + baseframe.button_down:Disable() - BaseFrame.button_down:SetWidth (29) - BaseFrame.button_down:SetHeight (32) - BaseFrame.button_down:SetNormalTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollDownButton-Up") - BaseFrame.button_down:SetPushedTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollDownButton-Down") - BaseFrame.button_down:SetDisabledTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollDownButton-Disabled") - BaseFrame.button_down:Disable() + baseframe.button_up:SetPoint ("topright", baseframe.scroll_up, "topright", -4, 3) + baseframe.button_down:SetPoint ("bottomright", baseframe.scroll_down, "bottomright", -4, -6) - BaseFrame.button_up:SetPoint ("TOPRIGHT", BaseFrame.scroll_up, "TOPRIGHT", -4, 3) - BaseFrame.button_down:SetPoint ("BOTTOMRIGHT", BaseFrame.scroll_down, "BOTTOMRIGHT", -4, -6) + scrollbar:SetPoint ("top", baseframe.button_up, "bottom", 0, 12) + scrollbar:SetPoint ("bottom", baseframe.button_down, "top", 0, -12) + scrollbar:SetPoint ("left", backgrounddisplay, "right", 3, 0) + scrollbar:Show() - ScrollBar:SetPoint ("TOP", BaseFrame.button_up, "BOTTOM", 0, 12) - ScrollBar:SetPoint ("BOTTOM", BaseFrame.button_down, "TOP", 0, -12) - ScrollBar:SetPoint ("LEFT", BackGroundDisplay, "RIGHT", 3, 0) - ScrollBar:Show() + --> config set + scrollbar:SetOrientation ("VERTICAL") + scrollbar.scrollMax = 0 --default - tamanho da janela de fundo + scrollbar:SetMinMaxValues (0, 0) + scrollbar:SetValue (0) + scrollbar.ultimo = 0 + + --> thumb + scrollbar.thumb = scrollbar:CreateTexture (nil, "overlay") + scrollbar.thumb:SetTexture ([[Interface\Buttons\UI-ScrollBar-Knob]]) + scrollbar.thumb:SetSize (29, 30) + scrollbar:SetThumbTexture (scrollbar.thumb) + + --> scripts + button_down_scripts (baseframe, backgrounddisplay, instancia, scrollbar) + button_up_scripts (baseframe, backgrounddisplay, instancia, scrollbar) - button_stretch_scripts (BaseFrame, BackGroundDisplay, instancia) - - button_down_scripts (BaseFrame, BackGroundDisplay, instancia, ScrollBar) - button_up_scripts (BaseFrame, BackGroundDisplay, instancia, ScrollBar) +-- stretch button ----------------------------------------------------------------------------------------------------------------------------------------------- + baseframe.button_stretch = CreateFrame ("button", nil, baseframe) + baseframe.button_stretch:SetPoint ("bottom", baseframe, "top", 0, 20) + baseframe.button_stretch:SetPoint ("right", baseframe, "right", -27, 0) + baseframe.button_stretch:SetFrameStrata ("FULLSCREEN") ---slider -------------------------------------------------------------------------------------------------------------------------------------------------- - ScrollBar.scrollMax = 0 --default - tamanho da janela de fundo - - -- coisinha do meio - ScrollBar.thumb = ScrollBar:CreateTexture (nil, "OVERLAY") - ScrollBar.thumb:SetTexture ("Interface\\Buttons\\UI-ScrollBar-Knob") - ScrollBar.thumb:SetSize (29, 30) - ScrollBar:SetThumbTexture (ScrollBar.thumb) - - ScrollBar:SetOrientation ("VERTICAL") - ScrollBar:SetMinMaxValues(0, ScrollBar.scrollMax) - ScrollBar:SetValue(0) - ScrollBar.ultimo = 0 + local stretch_texture = baseframe.button_stretch:CreateTexture (nil, "overlay") + stretch_texture:SetTexture (DEFAULT_SKIN) + stretch_texture:SetTexCoord (unpack (COORDS_STRETCH)) + stretch_texture:SetWidth (32) + stretch_texture:SetHeight (16) + stretch_texture:SetAllPoints (baseframe.button_stretch) + baseframe.button_stretch.texture = stretch_texture + + baseframe.button_stretch:SetWidth (32) + baseframe.button_stretch:SetHeight (16) + + baseframe.button_stretch:Show() + gump:Fade (baseframe.button_stretch, "ALPHA", 0) --- janela principal -------------------------------------------------------------------------------------------------------------------------------------------------- + button_stretch_scripts (baseframe, backgrounddisplay, instancia) - BaseFrame:SetClampedToScreen (true) - BaseFrame:SetClampRectInsets (unpack (_detalhes.window_clamp)) - - BaseFrame:SetWidth (_detalhes.new_window_size.width) - BaseFrame:SetHeight (_detalhes.new_window_size.height) - - BaseFrame:SetPoint ("CENTER", _UIParent) - BaseFrame:EnableMouseWheel (false) - BaseFrame:EnableMouse (true) - BaseFrame:SetMovable (true) - BaseFrame:SetResizable (true) - BaseFrame:SetMinResize (150, 40) - BaseFrame:SetMaxResize (_detalhes.max_window_size.width, _detalhes.max_window_size.height) +-- main window config ------------------------------------------------------------------------------------------------------------------------------------------------- - BaseFrame:SetBackdrop (gump_fundo_backdrop) - BaseFrame:SetBackdropColor (instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha) - --- fundo -------------------------------------------------------------------------------------------------------------------------------------------------- + baseframe:SetClampedToScreen (true) + --baseframe:SetClampRectInsets (unpack (_detalhes.window_clamp)) + + baseframe:SetSize (_detalhes.new_window_size.width, _detalhes.new_window_size.height) + + baseframe:SetPoint ("center", _UIParent) + baseframe:EnableMouseWheel (false) + baseframe:EnableMouse (true) + baseframe:SetMovable (true) + baseframe:SetResizable (true) + baseframe:SetMinResize (150, 40) + baseframe:SetMaxResize (_detalhes.max_window_size.width, _detalhes.max_window_size.height) - BackGroundFrame:SetAllPoints (BaseFrame) - BackGroundFrame:SetScrollChild (BackGroundDisplay) + baseframe:SetBackdrop (gump_fundo_backdrop) + baseframe:SetBackdropColor (instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha) - BackGroundDisplay:SetResizable (true) - BackGroundDisplay:SetPoint ("TOPLEFT", BaseFrame, "TOPLEFT") - BackGroundDisplay:SetPoint ("BOTTOMRIGHT", BaseFrame, "BOTTOMRIGHT") - BackGroundDisplay:SetBackdrop (gump_fundo_backdrop) - BackGroundDisplay:SetBackdropColor (instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha) - --- congelamento da instância -------------------------------------------------------------------------------------------------------------------------------------------------- +-- background window config ------------------------------------------------------------------------------------------------------------------------------------------------- - instancia.freeze_icon = BackGroundDisplay:CreateTexture (nil, "OVERLAY") - instancia.freeze_icon:SetWidth (64) - instancia.freeze_icon:SetHeight (64) - instancia.freeze_icon:SetPoint ("center", BackGroundDisplay, "center") - instancia.freeze_icon:SetPoint ("left", BackGroundDisplay, "left") - instancia.freeze_icon:Hide() + backgroundframe:SetAllPoints (baseframe) + backgroundframe:SetScrollChild (backgrounddisplay) + + backgrounddisplay:SetResizable (true) + backgrounddisplay:SetPoint ("topleft", baseframe, "topleft") + backgrounddisplay:SetPoint ("bottomright", baseframe, "bottomright") + backgrounddisplay:SetBackdrop (gump_fundo_backdrop) + backgrounddisplay:SetBackdropColor (instancia.bg_r, instancia.bg_g, instancia.bg_b, instancia.bg_alpha) - instancia.freeze_texto = BackGroundDisplay:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") - instancia.freeze_texto:SetHeight (64) - instancia.freeze_texto:SetPoint ("left", instancia.freeze_icon, "right", -18, 0) - instancia.freeze_texto:SetTextColor (1, 1, 1) - instancia.freeze_texto:Hide() +-- instance mini widgets ------------------------------------------------------------------------------------------------------------------------------------------------- - instancia._version = BaseFrame:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") - instancia._version:SetPoint ("left", BackGroundDisplay, "left", 20, 0) - instancia._version:SetTextColor (1, 1, 1) - instancia._version:SetText ("this is a alpha version of Details\nyou can help us sending bug reports\nuse the blue button.") - if (not _detalhes.initializing) then - instancia._version:Hide() - end - - BaseFrame.wallpaper = BackGroundDisplay:CreateTexture (nil, "overlay") - BaseFrame.wallpaper:Hide() + --> freeze icon + instancia.freeze_icon = backgrounddisplay:CreateTexture (nil, "overlay") + instancia.freeze_icon:SetWidth (64) + instancia.freeze_icon:SetHeight (64) + instancia.freeze_icon:SetPoint ("center", backgrounddisplay, "center") + instancia.freeze_icon:SetPoint ("left", backgrounddisplay, "left") + instancia.freeze_icon:Hide() - BaseFrame.alert = CreateAlertFrame (BaseFrame, instancia) + instancia.freeze_texto = backgrounddisplay:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + instancia.freeze_texto:SetHeight (64) + instancia.freeze_texto:SetPoint ("left", instancia.freeze_icon, "right", -18, 0) + instancia.freeze_texto:SetTextColor (1, 1, 1) + instancia.freeze_texto:Hide() ---cria os 2 resizers ------------------------------------------------------------------------------------------------------------------------------------------------------------- + --> details version + instancia._version = baseframe:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + instancia._version:SetPoint ("left", backgrounddisplay, "left", 20, 0) + instancia._version:SetTextColor (1, 1, 1) + instancia._version:SetText ("this is a alpha version of Details\nyou can help us sending bug reports\nuse the blue button.") + if (not _detalhes.initializing) then + instancia._version:Hide() + end - BaseFrame.resize_direita = _CreateFrame ("Button", "Details_Resize_Direita"..ID, BaseFrame) + --> wallpaper + baseframe.wallpaper = backgrounddisplay:CreateTexture (nil, "overlay") + baseframe.wallpaper:Hide() - local resize_direita_texture = BaseFrame.resize_direita:CreateTexture (nil, "overlay") - resize_direita_texture:SetWidth (16) - resize_direita_texture:SetHeight (16) - resize_direita_texture:SetTexture (DEFAULT_SKIN) - resize_direita_texture:SetTexCoord (unpack (COORDS_RESIZE_RIGHT)) - resize_direita_texture:SetAllPoints (BaseFrame.resize_direita) - BaseFrame.resize_direita.texture = resize_direita_texture + --> alert frame + baseframe.alert = CreateAlertFrame (baseframe, instancia) + +-- resizers & lock button ------------------------------------------------------------------------------------------------------------------------------------------------------------ - BaseFrame.resize_direita:SetWidth (16) - BaseFrame.resize_direita:SetHeight (16) - BaseFrame.resize_direita:SetPoint ("BOTTOMRIGHT", BaseFrame, "BOTTOMRIGHT", 0, 0) - BaseFrame.resize_direita:EnableMouse (true) - BaseFrame.resize_direita:SetFrameLevel (BaseFrame:GetFrameLevel() + 6) - BaseFrame.resize_direita:SetFrameStrata ("HIGH") - BaseFrame.resize_direita.side = 2 + --> right resizer + baseframe.resize_direita = CreateFrame ("button", "Details_Resize_Direita"..ID, baseframe) + + local resize_direita_texture = baseframe.resize_direita:CreateTexture (nil, "overlay") + resize_direita_texture:SetWidth (16) + resize_direita_texture:SetHeight (16) + resize_direita_texture:SetTexture (DEFAULT_SKIN) + resize_direita_texture:SetTexCoord (unpack (COORDS_RESIZE_RIGHT)) + resize_direita_texture:SetAllPoints (baseframe.resize_direita) + baseframe.resize_direita.texture = resize_direita_texture + + baseframe.resize_direita:SetWidth (16) + baseframe.resize_direita:SetHeight (16) + baseframe.resize_direita:SetPoint ("bottomright", baseframe, "bottomright", 0, 0) + baseframe.resize_direita:EnableMouse (true) + baseframe.resize_direita:SetFrameLevel (baseframe:GetFrameLevel() + 6) + baseframe.resize_direita:SetFrameStrata ("HIGH") + baseframe.resize_direita.side = 2 --> lock window button - BaseFrame.lock_button = _CreateFrame ("Button", "Details_Lock_Button"..ID, BaseFrame) - BaseFrame.lock_button:SetPoint ("right", BaseFrame.resize_direita, "left", -1, 1.5) - BaseFrame.lock_button:SetFrameLevel (BaseFrame:GetFrameLevel() + 6) - BaseFrame.lock_button:SetWidth (40) - BaseFrame.lock_button:SetHeight (16) - BaseFrame.lock_button.label = BaseFrame.lock_button:CreateFontString (nil, "overlay", "GameFontNormal") - BaseFrame.lock_button.label:SetPoint ("right", BaseFrame.lock_button, "right") - BaseFrame.lock_button.label:SetTextColor (.3, .3, .3, .6) - BaseFrame.lock_button.label:SetJustifyH ("right") - BaseFrame.lock_button.label:SetText (Loc ["STRING_LOCK_WINDOW"]) - BaseFrame.lock_button:SetWidth (BaseFrame.lock_button.label:GetStringWidth()+2) - BaseFrame.lock_button:SetScript ("OnClick", lockFunctionOnClick) + baseframe.lock_button = CreateFrame ("button", "Details_Lock_Button"..ID, baseframe) + baseframe.lock_button:SetPoint ("right", baseframe.resize_direita, "left", -1, 1.5) + baseframe.lock_button:SetFrameLevel (baseframe:GetFrameLevel() + 6) + baseframe.lock_button:SetWidth (40) + baseframe.lock_button:SetHeight (16) + baseframe.lock_button.label = baseframe.lock_button:CreateFontString (nil, "overlay", "GameFontNormal") + baseframe.lock_button.label:SetPoint ("right", baseframe.lock_button, "right") + baseframe.lock_button.label:SetTextColor (.3, .3, .3, .6) + baseframe.lock_button.label:SetJustifyH ("right") + baseframe.lock_button.label:SetText (Loc ["STRING_LOCK_WINDOW"]) + baseframe.lock_button:SetWidth (baseframe.lock_button.label:GetStringWidth()+2) + baseframe.lock_button:SetScript ("OnClick", lockFunctionOnClick) - --> options window button - --[[ - BaseFrame.options_button = _CreateFrame ("Button", "Details_Options_Button"..ID, BaseFrame) - BaseFrame.options_button:SetPoint ("right", BaseFrame.lock_button, "left", -1, 0) - BaseFrame.options_button:SetFrameLevel (BaseFrame:GetFrameLevel() + 3) --> lower then normal rows - BaseFrame.options_button:SetWidth (40) - BaseFrame.options_button:SetHeight (16) - BaseFrame.options_button.label = BaseFrame.options_button:CreateFontString (nil, "overlay", "GameFontNormal") - BaseFrame.options_button.label:SetPoint ("right", BaseFrame.options_button, "right") - BaseFrame.options_button.label:SetTextColor (.3, .3, .3, .4) - BaseFrame.options_button.label:SetJustifyH ("right") - BaseFrame.options_button.label:SetText (Loc ["STRING_OPTIONS_WINDOW"]) - --]] - - BaseFrame.resize_esquerda = _CreateFrame ("Button", "Details_Resize_Esquerda"..ID, BaseFrame) - - local resize_esquerda_texture = BaseFrame.resize_esquerda:CreateTexture (nil, "overlay") - resize_esquerda_texture:SetWidth (16) - resize_esquerda_texture:SetHeight (16) - resize_esquerda_texture:SetTexture (DEFAULT_SKIN) - resize_esquerda_texture:SetTexCoord (unpack (COORDS_RESIZE_LEFT)) - resize_esquerda_texture:SetAllPoints (BaseFrame.resize_esquerda) - BaseFrame.resize_esquerda.texture = resize_esquerda_texture - - --BaseFrame.resize_esquerda:SetNormalTexture ("Interface\\AddOns\\Details\\images\\ResizeGripL") - --BaseFrame.resize_esquerda:SetHighlightTexture ("Interface\\AddOns\\Details\\images\\ResizeGripL") - BaseFrame.resize_esquerda:SetWidth (16) - BaseFrame.resize_esquerda:SetHeight (16) - BaseFrame.resize_esquerda:SetPoint ("BOTTOMLEFT", BaseFrame, "BOTTOMLEFT", 0, 0) - BaseFrame.resize_esquerda:EnableMouse (true) - BaseFrame.resize_esquerda:SetFrameLevel (BaseFrame:GetFrameLevel() + 6) - BaseFrame.resize_esquerda:SetFrameStrata ("HIGH") - - gump:Fade (BaseFrame.resize_esquerda, "in", 3.0) - gump:Fade (BaseFrame.resize_direita, "in", 3.0) - - if (instancia.isLocked) then - instancia.isLocked = not instancia.isLocked - lockFunctionOnClick (BaseFrame.lock_button) - end - - gump:Fade (BaseFrame.lock_button, -1, 3.0) - - ------------------------------------------------------------------------------------------------------------------------------------------------------------- - ---seta os scripts dos frames ------------------------------------------------------------------------------------------------------------------------------------------------------------- - - - - BFrame_scripts (BaseFrame, instancia) - - --BackGroundDisplay_scripts (BackGroundDisplay, BaseFrame, instancia) - - BGFrame_scripts (SwitchButton, BaseFrame, instancia) - BGFrame_scripts (BackGroundDisplay, BaseFrame, instancia) - --BGFrame_scripts (BackGroundFrame, BaseFrame, instancia) - - iterate_scroll_scripts (BackGroundDisplay, BackGroundFrame, BaseFrame, ScrollBar, instancia) - ------------------------------------------------------------------------------------------------------------------------------------------------------------- - ---chama função para criar o cabeçalho ------------------------------------------------------------------------------------------------------------------------------------------------------------- - - gump:CriaCabecalho (BaseFrame, instancia) - - --- cria as duas barras laterais ------------------------------------------------------------------------------------------------------------------------------------------------------------- - --> barra borda direita lateral - - --> barra borda esquerda lateral - BaseFrame.barra_esquerda = BaseFrame.cabecalho.fechar:CreateTexture (nil, "ARTWORK") - --BaseFrame.barra_esquerda:SetTexture ("Interface\\AddOns\\Details\\images\\bar_main_leftright") - --BaseFrame.barra_esquerda:SetTexCoord (0.5, 1, 0, 1) - BaseFrame.barra_esquerda:SetTexture (DEFAULT_SKIN) - BaseFrame.barra_esquerda:SetTexCoord (unpack (COORDS_LEFT_SIDE_BAR)) - BaseFrame.barra_esquerda:SetWidth (64) - BaseFrame.barra_esquerda:SetHeight (512) - BaseFrame.barra_esquerda:SetPoint ("TOPLEFT", BaseFrame, "TOPLEFT", -56, 0) - BaseFrame.barra_esquerda:SetPoint ("BOTTOMLEFT", BaseFrame, "BOTTOMLEFT", -56, -14) + --> left resizer + baseframe.resize_esquerda = CreateFrame ("button", "Details_Resize_Esquerda"..ID, baseframe) - BaseFrame.barra_direita = BaseFrame.cabecalho.fechar:CreateTexture (nil, "ARTWORK") - --BaseFrame.barra_direita:SetTexture ("Interface\\AddOns\\Details\\images\\bar_main_leftright") - --BaseFrame.barra_direita:SetTexCoord (0, 0.5, 0, 1) - BaseFrame.barra_direita:SetTexture (DEFAULT_SKIN) - BaseFrame.barra_direita:SetTexCoord (unpack (COORDS_RIGHT_SIDE_BAR)) - BaseFrame.barra_direita:SetWidth (64) - BaseFrame.barra_direita:SetHeight (512) - BaseFrame.barra_direita:SetPoint ("TOPRIGHT", BaseFrame, "TOPRIGHT", 56, 0) - BaseFrame.barra_direita:SetPoint ("BOTTOMRIGHT", BaseFrame, "BOTTOMRIGHT", 56, -14) - - ---chama função para criar o rodapé ------------------------------------------------------------------------------------------------------------------------------------------------------------- + local resize_esquerda_texture = baseframe.resize_esquerda:CreateTexture (nil, "overlay") + resize_esquerda_texture:SetWidth (16) + resize_esquerda_texture:SetHeight (16) + resize_esquerda_texture:SetTexture (DEFAULT_SKIN) + resize_esquerda_texture:SetTexCoord (unpack (COORDS_RESIZE_LEFT)) + resize_esquerda_texture:SetAllPoints (baseframe.resize_esquerda) + baseframe.resize_esquerda.texture = resize_esquerda_texture - gump:CriaRodape (BaseFrame, instancia) + baseframe.resize_esquerda:SetWidth (16) + baseframe.resize_esquerda:SetHeight (16) + baseframe.resize_esquerda:SetPoint ("bottomleft", baseframe, "bottomleft", 0, 0) + baseframe.resize_esquerda:EnableMouse (true) + baseframe.resize_esquerda:SetFrameLevel (baseframe:GetFrameLevel() + 6) + baseframe.resize_esquerda:SetFrameStrata ("HIGH") + + baseframe.resize_esquerda:SetAlpha (0) + baseframe.resize_direita:SetAlpha (0) + + if (instancia.isLocked) then + instancia.isLocked = not instancia.isLocked + lockFunctionOnClick (baseframe.lock_button) + end + + gump:Fade (baseframe.lock_button, -1, 3.0) + +-- scripts ------------------------------------------------------------------------------------------------------------------------------------------------------------ + + BFrame_scripts (baseframe, instancia) + + BGFrame_scripts (switchbutton, baseframe, instancia) + BGFrame_scripts (backgrounddisplay, baseframe, instancia) + + iterate_scroll_scripts (backgrounddisplay, backgroundframe, baseframe, scrollbar, instancia) + + +-- create toolbar ---------------------------------------------------------------------------------------------------------------------------------------------------------- + + gump:CriaCabecalho (baseframe, instancia) + +-- create statusbar ---------------------------------------------------------------------------------------------------------------------------------------------------------- + + gump:CriaRodape (baseframe, instancia) + +-- left and right side bars ------------------------------------------------------------------------------------------------------------------------------------------------------------ + + --> left + baseframe.barra_esquerda = baseframe.cabecalho.fechar:CreateTexture (nil, "artwork") + baseframe.barra_esquerda:SetTexture (DEFAULT_SKIN) + baseframe.barra_esquerda:SetTexCoord (unpack (COORDS_LEFT_SIDE_BAR)) + baseframe.barra_esquerda:SetWidth (64) + baseframe.barra_esquerda:SetHeight (512) + baseframe.barra_esquerda:SetPoint ("topleft", baseframe, "topleft", -56, 0) + baseframe.barra_esquerda:SetPoint ("bottomleft", baseframe, "bottomleft", -56, -14) + --> right + baseframe.barra_direita = baseframe.cabecalho.fechar:CreateTexture (nil, "artwork") + baseframe.barra_direita:SetTexture (DEFAULT_SKIN) + baseframe.barra_direita:SetTexCoord (unpack (COORDS_RIGHT_SIDE_BAR)) + baseframe.barra_direita:SetWidth (64) + baseframe.barra_direita:SetHeight (512) + baseframe.barra_direita:SetPoint ("topright", baseframe, "topright", 56, 0) + baseframe.barra_direita:SetPoint ("bottomright", baseframe, "bottomright", 56, -14) + --> bottom + baseframe.barra_fundo = baseframe.cabecalho.fechar:CreateTexture (nil, "artwork") + baseframe.barra_fundo:SetTexture (DEFAULT_SKIN) + baseframe.barra_fundo:SetTexCoord (unpack (COORDS_BOTTOM_SIDE_BAR)) + baseframe.barra_fundo:SetWidth (512) + baseframe.barra_fundo:SetHeight (64) + baseframe.barra_fundo:SetPoint ("bottomleft", baseframe, "bottomleft", 0, -56) + baseframe.barra_fundo:SetPoint ("bottomright", baseframe, "bottomright", 0, -56) + +-- break snap button ---------------------------------------------------------------------------------------------------------------------------------------------------------- + + instancia.botao_separar = CreateFrame ("button", "DetailsBreakSnapButton" .. ID, baseframe.cabecalho.fechar) + instancia.botao_separar:SetPoint ("bottom", baseframe.resize_direita, "top", -1, 0) + instancia.botao_separar:SetFrameLevel (baseframe:GetFrameLevel() + 5) + instancia.botao_separar:SetSize (13, 13) ------------------------------------------------------------------------------------------------------------------------------------------------------------- + instancia.botao_separar:SetScript ("OnClick", function() + instancia:Desagrupar (-1) + end) --- BETA -- botão de separar as instâncias que estão agrupadas - instancia.botao_separar = gump:NewDetailsButton (BaseFrame.cabecalho.fechar, _, instancia, instancia.Desagrupar, instancia, -1, 13, 13) - instancia.botao_separar:SetPoint ("BOTTOM", BaseFrame.resize_direita, "TOP", -1, 0) - instancia.botao_separar:SetFrameLevel (BaseFrame:GetFrameLevel() + 5) + instancia.botao_separar:SetNormalTexture (DEFAULT_SKIN) + instancia.botao_separar:SetDisabledTexture (DEFAULT_SKIN) + instancia.botao_separar:SetHighlightTexture (DEFAULT_SKIN, "ADD") + instancia.botao_separar:SetPushedTexture (DEFAULT_SKIN) + + instancia.botao_separar:GetNormalTexture():SetTexCoord (unpack (COORDS_UNLOCK_BUTTON)) + instancia.botao_separar:GetDisabledTexture():SetTexCoord (unpack (COORDS_UNLOCK_BUTTON)) + instancia.botao_separar:GetHighlightTexture():SetTexCoord (unpack (COORDS_UNLOCK_BUTTON)) + instancia.botao_separar:GetPushedTexture():SetTexCoord (unpack (COORDS_UNLOCK_BUTTON)) + + instancia.botao_separar:SetAlpha (0) - local cadeado_texture = instancia.botao_separar:CreateTexture (nil, "overlay") - cadeado_texture:SetTexture (DEFAULT_SKIN) - cadeado_texture:SetTexCoord (unpack (COORDS_UNLOCK_BUTTON)) - cadeado_texture:SetAllPoints (instancia.botao_separar) - instancia.botao_separar.texture = cadeado_texture - BaseFrame.unlock_texture = cadeado_texture +-- scripts ------------------------------------------------------------------------------------------------------------------------------------------------------------ - gump:Fade (instancia.botao_separar, "in", 3.0) + resize_scripts (baseframe.resize_direita, instancia, scrollbar, ">", baseframe) + resize_scripts (baseframe.resize_esquerda, instancia, scrollbar, "<", baseframe) + lock_button_scripts (baseframe.lock_button, instancia) + bota_separar_script (instancia.botao_separar, instancia) - resize_scripts (BaseFrame.resize_direita, instancia, ScrollBar, ">", BaseFrame) - resize_scripts (BaseFrame.resize_esquerda, instancia, ScrollBar, "<", BaseFrame) - lock_button_scripts (BaseFrame.lock_button, instancia) - - bota_separar_script (instancia.botao_separar, instancia) - ---------------------------------- BORDAS HIGHLIGHT - local fcima = CreateFrame ("frame", nil, BaseFrame.cabecalho.fechar) - fcima:SetPoint ("topleft", BaseFrame.cabecalho.top_bg, "bottomleft", -10, 37) - fcima:SetPoint ("topright", BaseFrame.cabecalho.ball_r, "bottomright", -33, 37) - gump:CreateFlashAnimation (fcima) - fcima:Hide() - - instancia.h_cima = fcima:CreateTexture (nil, "OVERLAY") - instancia.h_cima:SetTexture ("Interface\\AddOns\\Details\\images\\highlight_updown") - instancia.h_cima:SetTexCoord (0, 1, 0.5, 1) - instancia.h_cima:SetPoint ("topleft", BaseFrame.cabecalho.top_bg, "bottomleft", -10, 37) - --instancia.h_cima:SetPoint ("topright", BaseFrame.cabecalho.ball_r, "bottomright", -33, 37) - instancia.h_cima:SetPoint ("topright", BaseFrame.cabecalho.ball_r, "bottomright", -97, 37) - --instancia.h_cima:Hide() - instancia.h_cima = fcima - -- - local fbaixo = CreateFrame ("frame", nil, BaseFrame.cabecalho.fechar) - fbaixo:SetPoint ("topleft", BaseFrame.rodape.esquerdo, "bottomleft", 16, 17) - fbaixo:SetPoint ("topright", BaseFrame.rodape.direita, "bottomright", -16, 17) - gump:CreateFlashAnimation (fbaixo) - fbaixo:Hide() - - instancia.h_baixo = fbaixo:CreateTexture (nil, "OVERLAY") - instancia.h_baixo:SetTexture ("Interface\\AddOns\\Details\\images\\highlight_updown") - instancia.h_baixo:SetTexCoord (0, 1, 0, 0.5) - instancia.h_baixo:SetPoint ("topleft", BaseFrame.rodape.esquerdo, "bottomleft", 16, 17) - instancia.h_baixo:SetPoint ("topright", BaseFrame.rodape.direita, "bottomright", -16, 17) - --instancia.h_baixo:Hide() - instancia.h_baixo = fbaixo - -- - local fesquerda = CreateFrame ("frame", nil, BaseFrame.cabecalho.fechar) - fesquerda:SetPoint ("topleft", BaseFrame.barra_esquerda, "topleft", -8, 0) - fesquerda:SetPoint ("bottomleft", BaseFrame.barra_esquerda, "bottomleft", -8, 0) - gump:CreateFlashAnimation (fesquerda) - fesquerda:Hide() - - instancia.h_esquerda = fesquerda:CreateTexture (nil, "OVERLAY") - instancia.h_esquerda:SetTexture ("Interface\\AddOns\\Details\\images\\highlight_leftright") - instancia.h_esquerda:SetTexCoord (0.5, 1, 0, 1) - instancia.h_esquerda:SetPoint ("topleft", BaseFrame.barra_esquerda, "topleft", 40, 0) - instancia.h_esquerda:SetPoint ("bottomleft", BaseFrame.barra_esquerda, "bottomleft", 40, 0) - --instancia.h_esquerda:Hide() - instancia.h_esquerda = fesquerda - -- - local fdireita = CreateFrame ("frame", nil, BaseFrame.cabecalho.fechar) - fdireita:SetPoint ("topleft", BaseFrame.barra_direita, "topleft", 8, 18) - fdireita:SetPoint ("bottomleft", BaseFrame.barra_direita, "bottomleft", 8, 0) - gump:CreateFlashAnimation (fdireita) - fdireita:Hide() - - instancia.h_direita = fdireita:CreateTexture (nil, "OVERLAY") - instancia.h_direita:SetTexture ("Interface\\AddOns\\Details\\images\\highlight_leftright") - instancia.h_direita:SetTexCoord (0, 0.5, 1, 0) - instancia.h_direita:SetPoint ("topleft", BaseFrame.barra_direita, "topleft", 8, 18) - instancia.h_direita:SetPoint ("bottomleft", BaseFrame.barra_direita, "bottomleft", 8, 0) - --instancia.h_direita:Hide() - instancia.h_direita = fdireita +-- side bars highlights ------------------------------------------------------------------------------------------------------------------------------------------------------------ - --instancia.botao_separar:Hide() + --> top + local fcima = CreateFrame ("frame", nil, baseframe.cabecalho.fechar) + fcima:SetPoint ("topleft", baseframe.cabecalho.top_bg, "bottomleft", -10, 37) + fcima:SetPoint ("topright", baseframe.cabecalho.ball_r, "bottomright", -33, 37) + gump:CreateFlashAnimation (fcima) + fcima:Hide() + + instancia.h_cima = fcima:CreateTexture (nil, "overlay") + instancia.h_cima:SetTexture ([[Interface\AddOns\Details\images\highlight_updown]]) + instancia.h_cima:SetTexCoord (0, 1, 0.5, 1) + instancia.h_cima:SetPoint ("topleft", baseframe.cabecalho.top_bg, "bottomleft", -10, 37) + instancia.h_cima:SetPoint ("topright", baseframe.cabecalho.ball_r, "bottomright", -97, 37) + instancia.h_cima = fcima + + --> bottom + local fbaixo = CreateFrame ("frame", nil, baseframe.cabecalho.fechar) + fbaixo:SetPoint ("topleft", baseframe.rodape.esquerdo, "bottomleft", 16, 17) + fbaixo:SetPoint ("topright", baseframe.rodape.direita, "bottomright", -16, 17) + gump:CreateFlashAnimation (fbaixo) + fbaixo:Hide() + + instancia.h_baixo = fbaixo:CreateTexture (nil, "overlay") + instancia.h_baixo:SetTexture ([[Interface\AddOns\Details\images\highlight_updown]]) + instancia.h_baixo:SetTexCoord (0, 1, 0, 0.5) + instancia.h_baixo:SetPoint ("topleft", baseframe.rodape.esquerdo, "bottomleft", 16, 17) + instancia.h_baixo:SetPoint ("topright", baseframe.rodape.direita, "bottomright", -16, 17) + instancia.h_baixo = fbaixo + + --> left + local fesquerda = CreateFrame ("frame", nil, baseframe.cabecalho.fechar) + fesquerda:SetPoint ("topleft", baseframe.barra_esquerda, "topleft", -8, 0) + fesquerda:SetPoint ("bottomleft", baseframe.barra_esquerda, "bottomleft", -8, 0) + gump:CreateFlashAnimation (fesquerda) + fesquerda:Hide() + + instancia.h_esquerda = fesquerda:CreateTexture (nil, "overlay") + instancia.h_esquerda:SetTexture ([[Interface\AddOns\Details\images\highlight_leftright]]) + instancia.h_esquerda:SetTexCoord (0.5, 1, 0, 1) + instancia.h_esquerda:SetPoint ("topleft", baseframe.barra_esquerda, "topleft", 40, 0) + instancia.h_esquerda:SetPoint ("bottomleft", baseframe.barra_esquerda, "bottomleft", 40, 0) + instancia.h_esquerda = fesquerda + + --> right + local fdireita = CreateFrame ("frame", nil, baseframe.cabecalho.fechar) + fdireita:SetPoint ("topleft", baseframe.barra_direita, "topleft", 8, 18) + fdireita:SetPoint ("bottomleft", baseframe.barra_direita, "bottomleft", 8, 0) + gump:CreateFlashAnimation (fdireita) + fdireita:Hide() + + instancia.h_direita = fdireita:CreateTexture (nil, "overlay") + instancia.h_direita:SetTexture ([[Interface\AddOns\Details\images\highlight_leftright]]) + instancia.h_direita:SetTexCoord (0, 0.5, 1, 0) + instancia.h_direita:SetPoint ("topleft", baseframe.barra_direita, "topleft", 8, 18) + instancia.h_direita:SetPoint ("bottomleft", baseframe.barra_direita, "bottomleft", 8, 0) + instancia.h_direita = fdireita + +--> done if (criando) then local CProps = { @@ -2237,30 +2199,67 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) instancia.locs = CProps end - return BaseFrame, BackGroundFrame, BackGroundDisplay, ScrollBar + return baseframe, backgroundframe, backgrounddisplay, scrollbar end +function _detalhes:SetBarGrowDirection (direction) + + if (not direction) then + direction = self.bars_grow_direction + end + + self.bars_grow_direction = direction + + local x = self.row_info.space.left + + if (direction == 1) then --> top to bottom + for index, row in _ipairs (self.barras) do + local y = self.row_height * (index - 1) + y = y * -1 + row:ClearAllPoints() + row:SetPoint ("topleft", self.baseframe, "topleft", x, y) + end + + elseif (direction == 2) then --> bottom to top + for index, row in _ipairs (self.barras) do + local y = self.row_height * (index - 1) + row:ClearAllPoints() + row:SetPoint ("bottomleft", self.baseframe, "bottomleft", x, y + 2) + end + + end +end + --> Alias function gump:NewRow (instancia, index) return gump:CriaNovaBarra (instancia, index) end + +_detalhes.barras_criadas = 0 + --> search key: ~row ~barra function gump:CriaNovaBarra (instancia, index) - local BaseFrame = instancia.baseframe - local esta_barra = _CreateFrame ("Button", "DetailsBarra_"..instancia.meu_id.."_"..index, BaseFrame) + local baseframe = instancia.baseframe + local esta_barra = CreateFrame ("button", "DetailsBarra_"..instancia.meu_id.."_"..index, baseframe) esta_barra.row_id = index - local y = instancia.barrasInfo.alturaReal*(index-1) + local y = instancia.row_height*(index-1) - y = y*-1 + if (instancia.bars_grow_direction == 1) then + y = y*-1 + esta_barra:SetPoint ("topleft", baseframe, "topleft", instancia.row_info.space.left, y) + + elseif (instancia.bars_grow_direction == 2) then + --y = y*-1 + esta_barra:SetPoint ("bottomleft", baseframe, "bottomleft", instancia.row_info.space.left, y + 2) + + end - esta_barra:SetPoint ("TOPLEFT", BaseFrame, "TOPLEFT", instancia.barrasInfo.espaco.esquerda, y) - - esta_barra:SetHeight (instancia.barrasInfo.altura) --> altura determinada pela instância - esta_barra:SetWidth (BaseFrame:GetWidth()+instancia.barrasInfo.espaco.direita) + esta_barra:SetHeight (instancia.row_info.height) --> altura determinada pela instância + esta_barra:SetWidth (baseframe:GetWidth()+instancia.row_info.space.right) - esta_barra:SetFrameLevel (BaseFrame:GetFrameLevel() + 4) + esta_barra:SetFrameLevel (baseframe:GetFrameLevel() + 4) esta_barra.last_value = 0 esta_barra.w_mod = 0 @@ -2268,15 +2267,15 @@ function gump:CriaNovaBarra (instancia, index) esta_barra:EnableMouse (true) esta_barra:RegisterForClicks ("LeftButtonDown", "RightButtonDown") - esta_barra.statusbar = _CreateFrame ("StatusBar", nil, esta_barra) + esta_barra.statusbar = CreateFrame ("StatusBar", nil, esta_barra) esta_barra.statusbar:SetAllPoints (esta_barra) - esta_barra.textura = esta_barra.statusbar:CreateTexture (nil, "ARTWORK") + esta_barra.textura = esta_barra.statusbar:CreateTexture (nil, "artwork") esta_barra.textura:SetHorizTile (false) esta_barra.textura:SetVertTile (false) - esta_barra.textura:SetTexture (instancia.barrasInfo.textura) + esta_barra.textura:SetTexture (instancia.row_info.texture_file) - esta_barra.background = esta_barra:CreateTexture (nil, "BACKGROUND") + esta_barra.background = esta_barra:CreateTexture (nil, "background") esta_barra.background:SetTexture() esta_barra.background:SetAllPoints (esta_barra) @@ -2286,56 +2285,56 @@ function gump:CriaNovaBarra (instancia, index) esta_barra.statusbar:SetMinMaxValues (0, 100) esta_barra.statusbar:SetValue (100) - local icone_classe = esta_barra.statusbar:CreateTexture (nil, "OVERLAY") + local icone_classe = esta_barra.statusbar:CreateTexture (nil, "overlay") icone_classe:SetPoint ("left", esta_barra.statusbar, "left") - icone_classe:SetHeight (instancia.barrasInfo.altura) - icone_classe:SetWidth (instancia.barrasInfo.altura) - icone_classe:SetTexture ("Interface\\AddOns\\Details\\images\\classes_small") + icone_classe:SetHeight (instancia.row_info.height) + icone_classe:SetWidth (instancia.row_info.height) + icone_classe:SetTexture ([[Interface\AddOns\Details\images\classes_small]]) icone_classe:SetTexCoord (.75, 1, .75, 1) esta_barra.icone_classe = icone_classe - esta_barra.texto_esquerdo = esta_barra.statusbar:CreateFontString (nil, "OVERLAY", "GameFontHighlight") + esta_barra.texto_esquerdo = esta_barra.statusbar:CreateFontString (nil, "overlay", "GameFontHighlight") - esta_barra.texto_esquerdo:SetPoint ("LEFT", esta_barra.icone_classe, "right", 3, 0) - esta_barra.texto_esquerdo:SetJustifyH ("LEFT") + esta_barra.texto_esquerdo:SetPoint ("left", esta_barra.icone_classe, "right", 3, 0) + esta_barra.texto_esquerdo:SetJustifyH ("left") esta_barra.texto_esquerdo:SetNonSpaceWrap (true) - local icone_terceiro = esta_barra.statusbar:CreateTexture (nil, "OVERLAY") + local icone_terceiro = esta_barra.statusbar:CreateTexture (nil, "overlay") icone_terceiro:SetPoint ("left", esta_barra.statusbar, "left", 2, 0) - icone_terceiro:SetHeight (instancia.barrasInfo.altura) - icone_terceiro:SetWidth (instancia.barrasInfo.altura) + icone_terceiro:SetHeight (instancia.row_info.height) + icone_terceiro:SetWidth (instancia.row_info.height) esta_barra.icone_terceiro = icone_terceiro esta_barra.icone_terceiro:Hide() - esta_barra.texto_direita = esta_barra.statusbar:CreateFontString (nil, "OVERLAY", "GameFontHighlight") + esta_barra.texto_direita = esta_barra.statusbar:CreateFontString (nil, "overlay", "GameFontHighlight") - esta_barra.texto_direita:SetPoint ("RIGHT", esta_barra.statusbar, "RIGHT") - esta_barra.texto_direita:SetJustifyH ("RIGHT") + esta_barra.texto_direita:SetPoint ("right", esta_barra.statusbar, "right") + esta_barra.texto_direita:SetJustifyH ("right") - instancia:SetFontSize (esta_barra.texto_esquerdo, instancia.barrasInfo.fontSize) - instancia:SetFontFace (esta_barra.texto_esquerdo, instancia.barrasInfo.font) + instancia:SetFontSize (esta_barra.texto_esquerdo, instancia.row_info.font_size) + instancia:SetFontFace (esta_barra.texto_esquerdo, instancia.row_info.font_face_file) _detalhes.font_pool:add (esta_barra.texto_esquerdo) - instancia:SetFontSize (esta_barra.texto_direita, instancia.barrasInfo.fontSize) - instancia:SetFontFace (esta_barra.texto_direita, instancia.barrasInfo.font) + instancia:SetFontSize (esta_barra.texto_direita, instancia.row_info.font_size) + instancia:SetFontFace (esta_barra.texto_direita, instancia.row_info.font_face_file) _detalhes.font_pool:add (esta_barra.texto_direita) - if (instancia.row_textL_outline) then - instancia:SetFontOutline (esta_barra.texto_esquerdo, instancia.row_textL_outline) + if (instancia.row_info.textL_outline) then + instancia:SetFontOutline (esta_barra.texto_esquerdo, instancia.row_info.textL_outline) end - if (instancia.row_textR_outline) then - instancia:SetFontOutline (esta_barra.texto_direita, instancia.row_textR_outline) + if (instancia.row_info.textR_outline) then + instancia:SetFontOutline (esta_barra.texto_direita, instancia.row_info.textR_outline) end - if (not instancia.row_texture_class_colors) then - esta_barra.textura:SetVertexColor (_unpack (instancia.fixed_row_texture_color)) + if (not instancia.row_info.texture_class_colors) then + esta_barra.textura:SetVertexColor (_unpack (instancia.row_info.fixed_texture_color)) end - if (not instancia.row_textL_class_colors) then - esta_barra.texto_esquerdo:SetTextColor (_unpack (instancia.fixed_row_text_color)) + if (not instancia.row_info.textL_class_colors) then + esta_barra.texto_esquerdo:SetTextColor (_unpack (instancia.row_info.fixed_text_color)) end - if (not instancia.row_textR_class_colors) then - esta_barra.texto_direita:SetTextColor (_unpack (instancia.fixed_row_text_color)) + if (not instancia.row_info.textR_class_colors) then + esta_barra.texto_direita:SetTextColor (_unpack (instancia.row_info.fixed_text_color)) end --> inicia os scripts da barra @@ -2346,52 +2345,195 @@ function gump:CriaNovaBarra (instancia, index) return esta_barra end +function _detalhes:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, rightcolorbyclass, leftoutline, rightoutline) + + --> size + if (size) then + self.row_info.font_size = size + end + + --> font + if (font) then + self.row_info.font_face = font + self.row_info.font_face_file = SharedMedia:Fetch ("font", font) + end + + --> fixed color + if (fixedcolor) then + local red, green, blue, alpha = gump:ParseColors (fixedcolor) + local c = self.row_info.fixed_text_color + c[1], c[2], c[3], c[4] = red, green, blue, alpha + end + + --> left color by class + if (type (leftcolorbyclass) == "boolean") then + self.row_info.textL_class_colors = leftcolorbyclass + end + + --> right color by class + if (type (rightcolorbyclass) == "boolean") then + self.row_info.textR_class_colors = rightcolorbyclass + end + + --> left text outline + if (type (leftoutline) == "boolean") then + self.row_info.textL_outline = leftoutline + end + + --> right text outline + if (type (rightoutline) == "boolean") then + self.row_info.textR_outline = rightoutline + end + + self:InstanceReset() + self:InstanceRefreshRows() +end + +function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, backgroundtexture, backgroundcolorclass, backgroundfixedcolor) + + --> height + if (height) then + self.row_info.height = height + self.row_height = height + self.row_info.space.between + end + + --> texture + if (texture) then + self.row_info.texture = texture + self.row_info.texture_file = SharedMedia:Fetch ("statusbar", texture) + end + + --> color by class + if (type (colorclass) == "boolean") then + self.row_info.texture_class_colors = colorclass + end + + --> fixed color + if (fixedcolor) then + local red, green, blue, alpha = gump:ParseColors (fixedcolor) + local c = self.row_info.fixed_texture_color + c[1], c[2], c[3], c[4] = red, green, blue, alpha + end + + --> background texture + if (backgroundtexture) then + self.row_info.texture_background = backgroundtexture + self.row_info.texture_background_file = SharedMedia:Fetch ("statusbar", backgroundtexture) + end + + --> background color by class + if (type (backgroundcolorclass) == "boolean") then + self.row_info.texture_background_class_color = backgroundcolorclass + end + + --> background fixed color + if (backgroundfixedcolor) then + local red, green, blue, alpha = gump:ParseColors (backgroundfixedcolor) + local c = self.row_info.fixed_texture_background_color + c [1], c [2], c [3], c [4] = red, green, blue, alpha + end + + self:InstanceReset() + self:InstanceRefreshRows() + self:ReajustaGump() + +end + + +-- search key: ~row function _detalhes:InstanceRefreshRows (instancia) + if (instancia) then self = instancia end + + if (not self.barras or not self.barras[1]) then + return + end + + --> outline values + local left_text_outline = self.row_info.textL_outline + local right_text_outline = self.row_info.textR_outline + + --> texture color values + local texture_class_color = self.row_info.texture_class_colors + local texture_r, texture_g, texture_b + if (not texture_class_color) then + texture_r, texture_g, texture_b = _unpack (self.row_info.fixed_texture_color) + end - --outline - local L_outline = self.row_textL_outline - local R_outline = self.row_textR_outline - --texture color - local textureClassColor = self.row_texture_class_colors - local texture_r, texture_g, texture_b - if (not textureClassColor) then - texture_r, texture_g, texture_b = _unpack (self.fixed_row_texture_color) - end --text color - local leftTextClassColor = self.row_textL_class_colors - local rightTextClassColor = self.row_textR_class_colors - local text_r, text_g, text_b - if (not leftTextClassColor or not rightTextClassColor) then - text_r, text_g, text_b = _unpack (self.fixed_row_text_color) - end + local left_text_class_color = self.row_info.textL_class_colors + local right_text_class_color = self.row_info.textR_class_colors + local text_r, text_g, text_b + if (not left_text_class_color or not right_text_class_color) then + text_r, text_g, text_b = _unpack (self.row_info.fixed_text_color) + end + + local height = self.row_info.height + + -- do it for _, row in _ipairs (self.barras) do - - if (L_outline) then - self:SetFontOutline (row.texto_esquerdo, L_outline) + + --> positioning and size + row:SetHeight (height) + row.icone_classe:SetHeight (height) + row.icone_classe:SetWidth (height) + row.icone_terceiro:SetHeight (height) + row.icone_terceiro:SetWidth (height) + + if (not self.row_info.texture_background_class_color) then + local c = self.row_info.fixed_texture_background_color + row.background:SetVertexColor (c[1], c[2], c[3], c[4]) else - self:SetFontOutline (row.texto_esquerdo, nil) + local c = self.row_info.fixed_texture_background_color + local r, g, b = row.background:GetVertexColor() + row.background:SetVertexColor (r, g, b, c[4]) end - if (R_outline) then - self:SetFontOutline (row.texto_direita, R_outline) + + --> outline + if (left_text_outline) then + _detalhes:SetFontOutline (row.texto_esquerdo, left_text_outline) + else + _detalhes:SetFontOutline (row.texto_esquerdo, nil) + end + + if (right_text_outline) then + self:SetFontOutline (row.texto_direita, right_text_outline) else self:SetFontOutline (row.texto_direita, nil) end - -- - if (not textureClassColor) then + + --> texture: + row.textura:SetTexture (self.row_info.texture_file) + row.background:SetTexture (self.row_info.texture_background_file) + + --> texture class color: if true color changes on the fly through class refresh + if (not texture_class_color) then row.textura:SetVertexColor (texture_r, texture_g, texture_b) end - -- - if (not leftTextClassColor) then + + --> text class color: if true color changes on the fly through class refresh + if (not left_text_class_color) then row.texto_esquerdo:SetTextColor (text_r, text_g, text_b) end - if (not rightTextClassColor) then + if (not right_text_class_color) then row.texto_direita:SetTextColor (text_r, text_g, text_b) end + + --> text size + _detalhes:SetFontSize (row.texto_esquerdo, self.row_info.font_size or height * 0.75) + _detalhes:SetFontSize (row.texto_direita, self.row_info.font_size or height * 0.75) + + --> text font + _detalhes:SetFontFace (row.texto_esquerdo, self.row_info.font_face_file or "GameFontHighlight") + _detalhes:SetFontFace (row.texto_direita, self.row_info.font_face_file or "GameFontHighlight") + end + + self:SetBarGrowDirection() + end -- search key: ~wallpaper @@ -2509,10 +2651,20 @@ end function _detalhes:InstanceColor (red, green, blue, alpha) + + if (not red) then + red, green, blue, alpha = unpack (self.color) + end + if (type (red) ~= "number") then red, green, blue, alpha = gump:ParseColors (red) end + self.color [1] = red + self.color [2] = green + self.color [3] = blue + self.color [4] = alpha + local skin = _detalhes.skins [self.skin] self.baseframe.rodape.esquerdo:SetVertexColor (red, green, blue) @@ -2537,6 +2689,8 @@ function _detalhes:InstanceColor (red, green, blue, alpha) self.baseframe.barra_esquerda:SetAlpha (alpha) self.baseframe.barra_direita:SetVertexColor (red, green, blue) self.baseframe.barra_direita:SetAlpha (alpha) + self.baseframe.barra_fundo:SetVertexColor (red, green, blue) + self.baseframe.barra_fundo:SetAlpha (alpha) self.color[1], self.color[2], self.color[3], self.color[4] = red, green, blue, alpha end @@ -2608,88 +2762,228 @@ function _detalhes:StatusBarAlert (text, icon, color, time) end end -function gump:CriaRodape (BaseFrame, instancia) +function _detalhes:SetCloseButtonSettings (overlaycolor) - BaseFrame.rodape = {} + if (overlaycolor == "reset") then + overlaycolor = {1, 1, 1, 1} + end + + if (overlaycolor) then + local r, g, b, a = gump:ParseColors (overlaycolor) + self.closebutton_info.color_overlay [1] = r + self.closebutton_info.color_overlay [2] = g + self.closebutton_info.color_overlay [3] = b + self.closebutton_info.color_overlay [4] = a + end + + local r, g, b, a = unpack (self.closebutton_info.color_overlay) + self.baseframe.cabecalho.fechar:GetNormalTexture():SetVertexColor (r, g, b, a) + self.baseframe.cabecalho.fechar:GetPushedTexture():SetVertexColor (r, g, b, a) + self.baseframe.cabecalho.fechar:GetHighlightTexture():SetVertexColor (r, g, b, a) +end + +function _detalhes:SetInstanceButtonSettings (textfont, textsize, textcolor, overlaycolor) + + if (textfont == "reset") then + textfont = "Friz Quadrata TT" + textsize = 12 + textcolor = {1, 0.81, 0, 1} + overlaycolor = {1, 1, 1, 1} + end + + --> text color + if (textcolor) then + local r, g, b, a = gump:ParseColors (textcolor) + self.instancebutton_info.text_color [1] = r + self.instancebutton_info.text_color [2] = g + self.instancebutton_info.text_color [3] = b + self.instancebutton_info.text_color [4] = a + end + + _G [self.baseframe.cabecalho.novo:GetName().."Text"]:SetTextColor (unpack (self.instancebutton_info.text_color)) + + --> text font + if (textfont) then + self.instancebutton_info.text_face = textfont + end + + local font = SharedMedia:Fetch ("font", self.instancebutton_info.text_face) + _detalhes:SetFontFace (_G [self.baseframe.cabecalho.novo:GetName().."Text"], font) + + --> text size + if (textsize) then + self.instancebutton_info.text_size = textsize + end + + _detalhes:SetFontSize (_G [self.baseframe.cabecalho.novo:GetName().."Text"], self.instancebutton_info.text_size) + + --> overlay color + if (overlaycolor) then + local r, g, b, a = gump:ParseColors (overlaycolor) + self.instancebutton_info.color_overlay [1] = r + self.instancebutton_info.color_overlay [2] = g + self.instancebutton_info.color_overlay [3] = b + self.instancebutton_info.color_overlay [4] = a + end + + local r, g, b, a = unpack (self.instancebutton_info.color_overlay) + self.baseframe.cabecalho.novo.Left:SetVertexColor (r, g, b, a) + self.baseframe.cabecalho.novo.Middle:SetVertexColor (r, g, b, a) + self.baseframe.cabecalho.novo.Right:SetVertexColor (r, g, b, a) +end + +function _detalhes:SetDeleteButtonSettings (textfont, textsize, textcolor, overlaycolor, alwaysminimized) + + if (textfont == "reset") then + --print ("text color:", _G.DetailsResetButton1Text:GetTextColor()) + --print ("text font:", _detalhes:GetFontFace (_G.DetailsResetButton1Text)) + --print ("text size:", _detalhes:GetFontSize (_G.DetailsResetButton1Text)) + --print ("vertex color", _detalhes.ResetButton.Left:GetVertexColor()) + textfont = "Friz Quadrata TT" + textsize = 12 + textcolor = {1, 0.81, 0, 1} + overlaycolor = {1, 1, 1, 1} + alwaysminimized = false + end + + --> text color + if (textcolor) then + local r, g, b, a = gump:ParseColors (textcolor) + self.resetbutton_info.text_color [1] = r + self.resetbutton_info.text_color [2] = g + self.resetbutton_info.text_color [3] = b + self.resetbutton_info.text_color [4] = a + end + + if (_detalhes.ResetButtonInstance == self.meu_id) then + _G.DetailsResetButton1Text:SetTextColor (unpack (self.resetbutton_info.text_color)) + _G.DetailsResetButton2Text2:SetTextColor (unpack (self.resetbutton_info.text_color)) + end + + --> text font + if (textfont) then + self.resetbutton_info.text_face = textfont + end + + local font = SharedMedia:Fetch ("font", self.resetbutton_info.text_face) + _detalhes:SetFontFace (_G.DetailsResetButton1Text, font) + _detalhes:SetFontFace (_G.DetailsResetButton2Text2, font) + + --> text size + if (textsize) then + self.resetbutton_info.text_size = textsize + end + + _detalhes:SetFontSize (_G.DetailsResetButton1Text, self.resetbutton_info.text_size) + _detalhes:SetFontSize (_G.DetailsResetButton2Text2, self.resetbutton_info.text_size) + + --> overlay color + if (overlaycolor) then + local r, g, b, a = gump:ParseColors (overlaycolor) + self.resetbutton_info.color_overlay [1] = r + self.resetbutton_info.color_overlay [2] = g + self.resetbutton_info.color_overlay [3] = b + self.resetbutton_info.color_overlay [4] = a + end + + if (_detalhes.ResetButtonInstance == self.meu_id) then + local r, g, b, a = unpack (self.resetbutton_info.color_overlay) + _detalhes.ResetButton.Left:SetVertexColor (r, g, b, a) + _detalhes.ResetButton.Middle:SetVertexColor (r, g, b, a) + _detalhes.ResetButton.Right:SetVertexColor (r, g, b, a) + _detalhes.ResetButton2.Left:SetVertexColor (r, g, b, a) + _detalhes.ResetButton2.Middle:SetVertexColor (r, g, b, a) + _detalhes.ResetButton2.Right:SetVertexColor (r, g, b, a) + end + + --> always minimized + if (type (alwaysminimized) == "boolean") then + self.resetbutton_info.always_small = alwaysminimized + end + + self:ReajustaGump() +end + + +function gump:CriaRodape (baseframe, instancia) + + baseframe.rodape = {} --> esquerdo - BaseFrame.rodape.esquerdo = BaseFrame.cabecalho.fechar:CreateTexture (nil, "OVERLAY") - BaseFrame.rodape.esquerdo:SetPoint ("TOPRIGHT", BaseFrame, "BOTTOMLEFT", 16, 0) - BaseFrame.rodape.esquerdo:SetTexture (DEFAULT_SKIN) - BaseFrame.rodape.esquerdo:SetTexCoord (unpack (COORDS_PIN_LEFT)) - BaseFrame.rodape.esquerdo:SetWidth (32) - BaseFrame.rodape.esquerdo:SetHeight (32) - --BaseFrame.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left") + baseframe.rodape.esquerdo = baseframe.cabecalho.fechar:CreateTexture (nil, "overlay") + baseframe.rodape.esquerdo:SetPoint ("topright", baseframe, "bottomleft", 16, 0) + baseframe.rodape.esquerdo:SetTexture (DEFAULT_SKIN) + baseframe.rodape.esquerdo:SetTexCoord (unpack (COORDS_PIN_LEFT)) + baseframe.rodape.esquerdo:SetWidth (32) + baseframe.rodape.esquerdo:SetHeight (32) --> direito - BaseFrame.rodape.direita = BaseFrame.cabecalho.fechar:CreateTexture (nil, "OVERLAY") - BaseFrame.rodape.direita:SetPoint ("TOPLEFT", BaseFrame, "BOTTOMRIGHT", -16, 0) - BaseFrame.rodape.direita:SetTexture (DEFAULT_SKIN) - BaseFrame.rodape.direita:SetTexCoord (unpack (COORDS_PIN_RIGHT)) - BaseFrame.rodape.direita:SetWidth (32) - BaseFrame.rodape.direita:SetHeight (32) - --BaseFrame.rodape.direita:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_right") + baseframe.rodape.direita = baseframe.cabecalho.fechar:CreateTexture (nil, "overlay") + baseframe.rodape.direita:SetPoint ("topleft", baseframe, "bottomright", -16, 0) + baseframe.rodape.direita:SetTexture (DEFAULT_SKIN) + baseframe.rodape.direita:SetTexCoord (unpack (COORDS_PIN_RIGHT)) + baseframe.rodape.direita:SetWidth (32) + baseframe.rodape.direita:SetHeight (32) --> barra centro - BaseFrame.rodape.top_bg = BaseFrame:CreateTexture (nil, "BACKGROUND") - BaseFrame.rodape.top_bg:SetTexture (DEFAULT_SKIN) - BaseFrame.rodape.top_bg:SetTexCoord (unpack (COORDS_BOTTOM_BACKGROUND)) - BaseFrame.rodape.top_bg:SetWidth (512) - BaseFrame.rodape.top_bg:SetHeight (128) - BaseFrame.rodape.top_bg:SetPoint ("LEFT", BaseFrame.rodape.esquerdo, "RIGHT", -16, -48) - BaseFrame.rodape.top_bg:SetPoint ("RIGHT", BaseFrame.rodape.direita, "LEFT", 16, -48) + baseframe.rodape.top_bg = baseframe:CreateTexture (nil, "background") + baseframe.rodape.top_bg:SetTexture (DEFAULT_SKIN) + baseframe.rodape.top_bg:SetTexCoord (unpack (COORDS_BOTTOM_BACKGROUND)) + baseframe.rodape.top_bg:SetWidth (512) + baseframe.rodape.top_bg:SetHeight (128) + baseframe.rodape.top_bg:SetPoint ("left", baseframe.rodape.esquerdo, "right", -16, -48) + baseframe.rodape.top_bg:SetPoint ("right", baseframe.rodape.direita, "left", 16, -48) - local StatusBarLeftAnchor = CreateFrame ("frame", nil, BaseFrame) - StatusBarLeftAnchor:SetPoint ("left", BaseFrame.rodape.top_bg, "left", 5, 57) + local StatusBarLeftAnchor = CreateFrame ("frame", nil, baseframe) + StatusBarLeftAnchor:SetPoint ("left", baseframe.rodape.top_bg, "left", 5, 57) StatusBarLeftAnchor:SetWidth (1) StatusBarLeftAnchor:SetHeight (1) - BaseFrame.rodape.StatusBarLeftAnchor = StatusBarLeftAnchor + baseframe.rodape.StatusBarLeftAnchor = StatusBarLeftAnchor - local StatusBarCenterAnchor = CreateFrame ("frame", nil, BaseFrame) - StatusBarCenterAnchor:SetPoint ("center", BaseFrame.rodape.top_bg, "center", 0, 57) + local StatusBarCenterAnchor = CreateFrame ("frame", nil, baseframe) + StatusBarCenterAnchor:SetPoint ("center", baseframe.rodape.top_bg, "center", 0, 57) StatusBarCenterAnchor:SetWidth (1) StatusBarCenterAnchor:SetHeight (1) - - BaseFrame.rodape.StatusBarCenterAnchor = StatusBarCenterAnchor + baseframe.rodape.StatusBarCenterAnchor = StatusBarCenterAnchor --> display frame - BaseFrame.statusbar = CreateFrame ("frame", nil, BaseFrame.cabecalho.fechar) - BaseFrame.statusbar:SetFrameLevel (BaseFrame.cabecalho.fechar:GetFrameLevel()+2) - BaseFrame.statusbar:SetPoint ("LEFT", BaseFrame.rodape.esquerdo, "RIGHT", -13, 10) - BaseFrame.statusbar:SetPoint ("RIGHT", BaseFrame.rodape.direita, "LEFT", 13, 10) - BaseFrame.statusbar:SetHeight (14) + baseframe.statusbar = CreateFrame ("frame", nil, baseframe.cabecalho.fechar) + baseframe.statusbar:SetFrameLevel (baseframe.cabecalho.fechar:GetFrameLevel()+2) + baseframe.statusbar:SetPoint ("left", baseframe.rodape.esquerdo, "right", -13, 10) + baseframe.statusbar:SetPoint ("right", baseframe.rodape.direita, "left", 13, 10) + baseframe.statusbar:SetHeight (14) - local statusbar_icon = BaseFrame.statusbar:CreateTexture (nil, "overlay") + local statusbar_icon = baseframe.statusbar:CreateTexture (nil, "overlay") statusbar_icon:SetWidth (14) statusbar_icon:SetHeight (14) - statusbar_icon:SetPoint ("left", BaseFrame.statusbar, "left") + statusbar_icon:SetPoint ("left", baseframe.statusbar, "left") - local statusbar_text = BaseFrame.statusbar:CreateFontString (nil, "overlay", "GameFontNormal") + local statusbar_text = baseframe.statusbar:CreateFontString (nil, "overlay", "GameFontNormal") statusbar_text:SetPoint ("left", statusbar_icon, "right", 2, 0) - BaseFrame.statusbar:SetBackdrop ({ - bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, + baseframe.statusbar:SetBackdrop ({ + bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) - BaseFrame.statusbar:SetBackdropColor (0, 0, 0, 1) + baseframe.statusbar:SetBackdropColor (0, 0, 0, 1) - BaseFrame.statusbar.icon = statusbar_icon - BaseFrame.statusbar.text = statusbar_text - BaseFrame.statusbar.instancia = instancia + baseframe.statusbar.icon = statusbar_icon + baseframe.statusbar.text = statusbar_text + baseframe.statusbar.instancia = instancia - BaseFrame.statusbar:Hide() + baseframe.statusbar:Hide() --> frame invisível - BaseFrame.DOWNFrame = CreateFrame ("frame", nil, BaseFrame) - BaseFrame.DOWNFrame:SetPoint ("LEFT", BaseFrame.rodape.esquerdo, "RIGHT", 0, 10) - BaseFrame.DOWNFrame:SetPoint ("RIGHT", BaseFrame.rodape.direita, "LEFT", 0, 10) - BaseFrame.DOWNFrame:SetHeight (14) + baseframe.DOWNFrame = CreateFrame ("frame", nil, baseframe) + baseframe.DOWNFrame:SetPoint ("left", baseframe.rodape.esquerdo, "right", 0, 10) + baseframe.DOWNFrame:SetPoint ("right", baseframe.rodape.direita, "left", 0, 10) + baseframe.DOWNFrame:SetHeight (14) - BaseFrame.DOWNFrame:Show() - BaseFrame.DOWNFrame:EnableMouse (true) - BaseFrame.DOWNFrame:SetMovable (true) - BaseFrame.DOWNFrame:SetResizable (true) + baseframe.DOWNFrame:Show() + baseframe.DOWNFrame:EnableMouse (true) + baseframe.DOWNFrame:SetMovable (true) + baseframe.DOWNFrame:SetResizable (true) - BGFrame_scripts (BaseFrame.DOWNFrame, BaseFrame, instancia) + BGFrame_scripts (baseframe.DOWNFrame, baseframe, instancia) end function _detalhes:CheckConsolidates() @@ -2701,20 +2995,32 @@ function _detalhes:CheckConsolidates() end function _detalhes:ConsolidateIcons() + self.consolidate = true + self.consolidateButton:Show() - return self:DefaultIcons() + + self:DefaultIcons() + + return self:MenuAnchor() end function _detalhes:UnConsolidateIcons() + self.consolidate = false + if (not self.consolidateButton) then return self:DefaultIcons() end + self.consolidateButton:Hide() - return self:DefaultIcons() + + self:DefaultIcons() + + return self:MenuAnchor() end +--> search key: ~icon function _detalhes:DefaultIcons (_mode, _segment, _attributes, _report) if (_mode == nil) then @@ -2729,7 +3035,7 @@ function _detalhes:DefaultIcons (_mode, _segment, _attributes, _report) if (_report == nil) then _report = self.icons[4] end - + if (self.consolidate and not self.consolidateButton:IsShown()) then self.consolidateButton:Show() elseif (not self.consolidate and self.consolidateButton:IsShown()) then @@ -2760,13 +3066,15 @@ function _detalhes:DefaultIcons (_mode, _segment, _attributes, _report) if (not _gotFirst) then _thisIcon:ClearAllPoints() + if (self.consolidate) then - _thisIcon:SetPoint ("TOPLEFT", self.consolidateFrame, "TOPLEFT", -3, -5) + _thisIcon:SetPoint ("topleft", self.consolidateFrame, "topleft", -3, -5) _thisIcon:SetParent (self.consolidateFrame) else - _thisIcon:SetPoint ("BOTTOMLEFT", baseToolbar.ball, "BOTTOMRIGHT", 6 + anchors[index][1], 2 + anchors[index][2]) + _thisIcon:SetPoint ("bottomleft", baseToolbar.ball, "bottomright", anchors[index][1] + self.menu_anchor [1], anchors[index][2] + self.menu_anchor [2]) _thisIcon:SetParent (self.baseframe) _thisIcon:SetFrameLevel (self.baseframe.UPFrame:GetFrameLevel()+1) + end _gotFirst = true @@ -2774,7 +3082,9 @@ function _detalhes:DefaultIcons (_mode, _segment, _attributes, _report) for dex = index-1, 1, -1 do local _thisIcon2 = icons [dex] if (_thisIcon2:IsShown()) then + _thisIcon:ClearAllPoints() + if (self.consolidate) then _thisIcon:SetPoint ("topleft", _thisIcon2.widget or _thisIcon2, "bottomleft", anchors[index][1], anchors[index][2]-2) _thisIcon:SetParent (self.consolidateFrame) @@ -2801,8 +3111,8 @@ function _detalhes:DefaultIcons (_mode, _segment, _attributes, _report) self.lastIcon = baseToolbar.ball end - _detalhes.ToolBar:ReorganizeIcons() --> aqui 2553 - + _detalhes.ToolBar:ReorganizeIcons() + return true end @@ -2811,8 +3121,8 @@ local parameters_table = {} local on_leave_menu = function (self, elapsed) parameters_table[2] = parameters_table[2] + elapsed if (parameters_table[2] > 0.3) then - if (not _detalhes.popup.mouseOver and not _detalhes.popup.buttonOver) then - _detalhes.popup:ShowMe (false) + if (not _G.GameCooltip.mouseOver and not _G.GameCooltip.buttonOver) then + _G.GameCooltip:ShowMe (false) end self:SetScript ("OnUpdate", nil) end @@ -2843,14 +3153,18 @@ local build_mode_list = function (self, elapsed) CoolTip:SetOption ("FixedWidthSub", 146) CoolTip:SetOption ("SubMenuIsTooltip", true) - if (_detalhes.tutorial.main_help_button > 9) then + if (_detalhes.tutorial.logons > 9) then CoolTip:SetOption ("IgnoreSubMenu", true) end if (instancia.consolidate) then CoolTip:SetOwner (self, "topleft", "topright", 3) else - CoolTip:SetOwner (self) + if (instancia.toolbar_side == 1) then + CoolTip:SetOwner (self) + elseif (instancia.toolbar_side == 2) then --> bottom + CoolTip:SetOwner (self, "bottom", "top", 0, -7) + end end CoolTip:ShowCooltip() end @@ -2929,7 +3243,7 @@ local build_segment_list = function (self, elapsed) if (thisCombat.is_trash) then CoolTip:AddIcon ([[Interface\AddOns\Details\images\icons]], "main", "left", 16, 12, 0.02734375, 0.11328125, 0.19140625, 0.3125) else - CoolTip:AddIcon ("Interface\\QUESTFRAME\\UI-Quest-BulletPoint", "main", "left", 16, 16) + CoolTip:AddIcon ([[Interface\QUESTFRAME\UI-Quest-BulletPoint]], "main", "left", 16, 16) end end @@ -2948,7 +3262,7 @@ local build_segment_list = function (self, elapsed) else CoolTip:AddLine (Loc ["STRING_SEGMENT_LOWER"] .. " #" .. i, _, 1, "gray") CoolTip:AddMenu (1, instancia.TrocaTabela, i) - CoolTip:AddIcon ("Interface\\QUESTFRAME\\UI-Quest-BulletPoint", "main", "left", 16, 16, nil, nil, nil, nil, empty_segment_color) + CoolTip:AddIcon ([[Interface\QUESTFRAME\UI-Quest-BulletPoint]], "main", "left", 16, 16, nil, nil, nil, nil, empty_segment_color) CoolTip:AddLine (Loc ["STRING_SEGMENT_EMPTY"], _, 2) end @@ -2967,7 +3281,7 @@ local build_segment_list = function (self, elapsed) ----------- current CoolTip:AddLine (segmentos.current_standard, _, 1, "white") CoolTip:AddMenu (1, instancia.TrocaTabela, 0) - CoolTip:AddIcon ("Interface\\QUESTFRAME\\UI-Quest-BulletPoint", "main", "left", 16, 16, nil, nil, nil, nil, "orange") + CoolTip:AddIcon ([[Interface\QUESTFRAME\UI-Quest-BulletPoint]], "main", "left", 16, 16, nil, nil, nil, nil, "orange") local enemy = _detalhes.tabela_vigente.is_boss and _detalhes.tabela_vigente.is_boss.name or _detalhes.tabela_vigente.enemy or "--x--x--" @@ -3015,7 +3329,7 @@ local build_segment_list = function (self, elapsed) --CoolTip:AddLine (segmentos.overall_standard, _, 1, "white") Loc ["STRING_REPORT_LAST"] .. " " .. fight_amount .. " " .. Loc ["STRING_REPORT_FIGHTS"] CoolTip:AddLine (Loc ["STRING_SEGMENT_OVERALL"], _, 1, "white") CoolTip:AddMenu (1, instancia.TrocaTabela, -1) - CoolTip:AddIcon ("Interface\\QUESTFRAME\\UI-Quest-BulletPoint", "main", "left", 16, 16, nil, nil, nil, nil, "orange") + CoolTip:AddIcon ([[Interface\QUESTFRAME\UI-Quest-BulletPoint]], "main", "left", 16, 16, nil, nil, nil, nil, "orange") CoolTip:AddLine (Loc ["STRING_SEGMENT_ENEMY"] .. ":", "--x--x--", 2, "white", "white")--localize-me @@ -3068,7 +3382,11 @@ local build_segment_list = function (self, elapsed) if (instancia.consolidate) then CoolTip:SetOwner (self, "topleft", "topright", 3) else - CoolTip:SetOwner (self) + if (instancia.toolbar_side == 1) then + CoolTip:SetOwner (self) + elseif (instancia.toolbar_side == 2) then --> bottom + CoolTip:SetOwner (self, "bottom", "top", 0, -7) + end end CoolTip:SetOption ("TextSize", _detalhes.font_sizes.menus) @@ -3089,6 +3407,67 @@ local build_segment_list = function (self, elapsed) end +function _detalhes:DisableUIPanelButton (button) + button.Right:Hide() + button.Middle:Hide() + + button:SetScript ("OnMouseDown", function() + button.Left:SetPoint ("topleft", button, "topleft", 1, -1) + button.Left:SetPoint ("bottomleft", button, "bottomleft", 1, -1) + end) + + button:SetScript ("OnMouseUp", function() + button.Left:SetPoint ("topleft", button, "topleft") + button.Left:SetPoint ("bottomleft", button, "bottomleft") + end) + button:SetScript ("OnShow", function()end) + button:SetScript ("OnDisable", function()end) + button:SetScript ("OnEnable", function()end) +end + +function _detalhes:RestoreUIPanelButton (button) + --> restaura o botão + button.Left:SetTexture ([[Interface\Buttons\UI-Panel-Button-Down]]) + button.Left:SetTexCoord (0, 0.0937, 0, 0.6875) + button.Left:SetSize (12, 22) + button.Right:Show() + button.Middle:Show() + + button:SetScript ("OnMouseDown", function (self) + if ( self:IsEnabled() ) then + self.Left:SetTexture([[Interface\Buttons\UI-Panel-Button-Down]]); + self.Middle:SetTexture([[Interface\Buttons\UI-Panel-Button-Down]]); + self.Right:SetTexture([[Interface\Buttons\UI-Panel-Button-Down]]); + end + end) + + button:SetScript ("OnMouseUp", function (self) + if ( self:IsEnabled() ) then + self.Left:SetTexture([[Interface\Buttons\UI-Panel-Button-Up]]); + self.Middle:SetTexture([[Interface\Buttons\UI-Panel-Button-Up]]); + self.Right:SetTexture([[Interface\Buttons\UI-Panel-Button-Up]]); + end + end) + + button:SetScript ("OnShow", function (self) + if ( self:IsEnabled() ) then + self.Left:SetTexture([[Interface\Buttons\UI-Panel-Button-Up]]); + self.Middle:SetTexture([[Interface\Buttons\UI-Panel-Button-Up]]); + self.Right:SetTexture([[Interface\Buttons\UI-Panel-Button-Up]]); + end + end) + button:SetScript ("OnDisable", function (self) + self.Left:SetTexture([[Interface\Buttons\UI-Panel-Button-Disabled]]); + self.Middle:SetTexture([[Interface\Buttons\UI-Panel-Button-Disabled]]); + self.Right:SetTexture([[Interface\Buttons\UI-Panel-Button-Disabled]]); + end) + button:SetScript ("OnEnable", function (self) + self.Left:SetTexture([[Interface\Buttons\UI-Panel-Button-Up]]); + self.Middle:SetTexture([[Interface\Buttons\UI-Panel-Button-Up]]); + self.Right:SetTexture([[Interface\Buttons\UI-Panel-Button-Up]]); + end) +end + local botao_fechar_on_enter = function (self) OnEnterMainWindow (self.instancia, self, 3) end @@ -3096,48 +3475,197 @@ local botao_fechar_on_leave = function (self) OnLeaveMainWindow (self.instancia, self, 3) end +-- ~skin function _detalhes:ChangeSkin (skin_name) if (not skin_name) then skin_name = self.skin end - + local this_skin = _detalhes.skins [skin_name] - + if (not this_skin) then return false --> throw a msg end + + local just_updating = false + if (self.skin == skin_name) then + just_updating = true + end + + if (not just_updating) then + + --> reset all config + self:ResetInstanceConfig() + + --> overwrites + local overwrite_cprops = this_skin.instance_cprops + if (overwrite_cprops) then + for cprop, value in _pairs (overwrite_cprops) do + self [cprop] = value + end + end + + --> reset micro frames + _detalhes.StatusBar:Reset (self) + + --> reset instance button + self:SetInstanceButtonSettings ("reset") + + --> reset delete button + if (_detalhes.ResetButtonInstance == self.meu_id) then + self:SetDeleteButtonSettings ("reset") + end + + --> reset close button + self:SetCloseButtonSettings ("reset") + + end self.skin = skin_name + local skin_file = this_skin.file + + --> set textures + self.baseframe.cabecalho.ball:SetTexture (skin_file) --> bola esquerda + self.baseframe.cabecalho.emenda:SetTexture (skin_file) --> emenda que liga a bola a textura do centro + + self.baseframe.cabecalho.ball_r:SetTexture (skin_file) --> bola direita onde fica o botão de fechar + self.baseframe.cabecalho.top_bg:SetTexture (skin_file) --> top background + + self.baseframe.barra_esquerda:SetTexture (skin_file) --> barra lateral + self.baseframe.barra_direita:SetTexture (skin_file) --> barra lateral + + 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 + + self.baseframe.button_stretch.texture:SetTexture (skin_file) --> botão de esticar a janela + + self.baseframe.resize_direita.texture:SetTexture (skin_file) --> botão de redimencionar da direita + self.baseframe.resize_esquerda.texture:SetTexture (skin_file) --> botão de redimencionar da esquerda + + self.botao_separar:SetNormalTexture (skin_file) --> cadeado + self.botao_separar:SetDisabledTexture (skin_file) + self.botao_separar:SetHighlightTexture (skin_file, "ADD") + self.botao_separar:SetPushedTexture (skin_file) + + +----------> custom reset button + if (this_skin.reset_button_coords) then + if (_detalhes.ResetButtonInstance == self.meu_id) then + --> seta o botão + _detalhes.ResetButton.Left:SetTexture (skin_file) + _detalhes.ResetButton.Left:SetTexCoord (unpack (this_skin.reset_button_coords)) + _detalhes.ResetButton.Left:SetSize (_detalhes.ResetButton:GetSize()) + + _detalhes.ResetButton2.Left:SetTexture (skin_file) + _detalhes.ResetButton2.Left:SetTexCoord (unpack (this_skin.reset_button_small_coords or this_skin.reset_button_coords)) + _detalhes.ResetButton2.Left:SetSize (_detalhes.ResetButton2:GetSize()) + + --> remove propriedades do botão da blizzard + _detalhes:DisableUIPanelButton (_detalhes.ResetButton) + _detalhes:DisableUIPanelButton (_detalhes.ResetButton2) + end + else + _detalhes:RestoreUIPanelButton (_detalhes.ResetButton) + _detalhes:RestoreUIPanelButton (_detalhes.ResetButton2) + end + +----------> custom instance button + + if (this_skin.instance_button_coords) then + + --> seta o botão + self.baseframe.cabecalho.novo:SetHeight (12) + self.baseframe.cabecalho.novo.Left:SetTexture (skin_file) + self.baseframe.cabecalho.novo.Left:SetTexCoord (unpack (this_skin.instance_button_coords)) + self.baseframe.cabecalho.novo.Left:SetSize (self.baseframe.cabecalho.novo:GetSize()) + + --> remove propriedades do botão da blizzard + _detalhes:DisableUIPanelButton (self.baseframe.cabecalho.novo) + + else + self.baseframe.cabecalho.novo:SetHeight (15) + _detalhes:RestoreUIPanelButton (self.baseframe.cabecalho.novo) + end - self.baseframe.cabecalho.ball:SetTexture (skin_file) --> bola esquerda - self.baseframe.cabecalho.emenda:SetTexture (skin_file) --> emenda que liga a bola a textura do centro +----------> custom close button + + if (this_skin.close_button_coords) then - self.baseframe.cabecalho.ball_r:SetTexture (skin_file) --> bola direita onde fica o botão de fechar - self.baseframe.cabecalho.top_bg:SetTexture (skin_file) --> top background + --> textures + self.baseframe.cabecalho.fechar:SetDisabledTexture (skin_file) + self.baseframe.cabecalho.fechar:SetNormalTexture (skin_file) + self.baseframe.cabecalho.fechar:SetPushedTexture (skin_file) + self.baseframe.cabecalho.fechar:SetHighlightTexture (skin_file) + + --> texcoords + self.baseframe.cabecalho.fechar:GetDisabledTexture():SetTexCoord (unpack (this_skin.close_button_coords)) + self.baseframe.cabecalho.fechar:GetNormalTexture():SetTexCoord (unpack (this_skin.close_button_coords)) + self.baseframe.cabecalho.fechar:GetPushedTexture():SetTexCoord (unpack (this_skin.close_button_coords)) + self.baseframe.cabecalho.fechar:GetHighlightTexture():SetTexCoord (unpack (this_skin.close_button_coords)) + + --> if the custom close button have a specified size + if (this_skin.close_button_size) then + self.baseframe.cabecalho.fechar:SetSize (unpack (this_skin.close_button_size)) + else + self.baseframe.cabecalho.fechar:SetSize (18, 18) + end + + self.baseframe.cabecalho.fechar:SetScript ("OnMouseDown", function() + self.baseframe.cabecalho.fechar:SetPoint ("bottomright", self.baseframe, "topright", this_skin.close_button_anchor[1]+1, this_skin.close_button_anchor[2]-1) + end) + self.baseframe.cabecalho.fechar:SetScript ("OnMouseUp", function() + self.baseframe.cabecalho.fechar:SetPoint ("bottomright", self.baseframe, "topright", this_skin.close_button_anchor[1], this_skin.close_button_anchor[2]) + end) + + else + self.baseframe.cabecalho.fechar:SetDisabledTexture ([[Interface\Buttons\UI-Panel-MinimizeButton-Disabled]]) + self.baseframe.cabecalho.fechar:SetNormalTexture ([[Interface\Buttons\UI-Panel-MinimizeButton-Up]]) + self.baseframe.cabecalho.fechar:SetPushedTexture ([[Interface\Buttons\UI-Panel-MinimizeButton-Down]]) + self.baseframe.cabecalho.fechar:SetHighlightTexture ([[Interface\Buttons\UI-Panel-MinimizeButton-Highlight]]) + + self.baseframe.cabecalho.fechar:GetDisabledTexture():SetTexCoord (0, 1, 0, 1) + self.baseframe.cabecalho.fechar:GetNormalTexture():SetTexCoord (0, 1, 0, 1) + self.baseframe.cabecalho.fechar:GetPushedTexture():SetTexCoord (0, 1, 0, 1) + self.baseframe.cabecalho.fechar:GetHighlightTexture():SetTexCoord (0, 1, 0, 1) + + self.baseframe.cabecalho.fechar:SetScript ("OnMouseDown", nil) + self.baseframe.cabecalho.fechar:SetScript ("OnMouseUp", nil) + + self.baseframe.cabecalho.fechar:SetSize (32, 32) + end + +----------> customize micro frames - self.baseframe.barra_esquerda:SetTexture (skin_file) --> barra lateral - self.baseframe.barra_direita:SetTexture (skin_file) --> barra lateral + if (this_skin.micro_frames) then + if (this_skin.micro_frames.color) then + _detalhes.StatusBar:ApplyOptions (self.StatusBar.left, "textcolor", this_skin.micro_frames.color) + _detalhes.StatusBar:ApplyOptions (self.StatusBar.center, "textcolor", this_skin.micro_frames.color) + _detalhes.StatusBar:ApplyOptions (self.StatusBar.right, "textcolor", this_skin.micro_frames.color) + end + if (this_skin.micro_frames.font) then + _detalhes.StatusBar:ApplyOptions (self.StatusBar.left, "textface", this_skin.micro_frames.font) + _detalhes.StatusBar:ApplyOptions (self.StatusBar.center, "textface", this_skin.micro_frames.font) + _detalhes.StatusBar:ApplyOptions (self.StatusBar.right, "textface", this_skin.micro_frames.font) + end + if (this_skin.micro_frames.size) then + _detalhes.StatusBar:ApplyOptions (self.StatusBar.left, "textsize", this_skin.micro_frames.size) + _detalhes.StatusBar:ApplyOptions (self.StatusBar.center, "textsize", this_skin.micro_frames.size) + _detalhes.StatusBar:ApplyOptions (self.StatusBar.right, "textsize", this_skin.micro_frames.size) + end + end - 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 - - self.baseframe.button_stretch.texture:SetTexture (skin_file) --> botão de esticar a janela - - self.baseframe.resize_direita.texture:SetTexture (skin_file) --> botão de redimencionar da direita - self.baseframe.resize_esquerda.texture:SetTexture (skin_file) --> botão de redimencionar da esquerda - - self.baseframe.unlock_texture:SetTexture (skin_file) --> cadeado +----------> icon anchor and size if (self.modo == 1 or self.modo == 4 or self.atributo == 5) then -- alone e raid local icon_anchor = this_skin.icon_anchor_plugins - self.baseframe.cabecalho.atributo_icon:SetPoint ("TOPRIGHT", self.baseframe.cabecalho.ball_point, "TOPRIGHT", icon_anchor[1], icon_anchor[2]) + self.baseframe.cabecalho.atributo_icon:SetPoint ("topright", self.baseframe.cabecalho.ball_point, "topright", icon_anchor[1], icon_anchor[2]) if (self.modo == 1) then local plugin_index = _detalhes.SoloTables.Mode if (plugin_index > 0 and _detalhes.SoloTables.Menu [plugin_index]) then @@ -3151,34 +3679,464 @@ function _detalhes:ChangeSkin (skin_name) end else local icon_anchor = this_skin.icon_anchor_main --> ancora do icone do canto direito superior - self.baseframe.cabecalho.atributo_icon:SetPoint ("TOPRIGHT", self.baseframe.cabecalho.ball_point, "TOPRIGHT", icon_anchor[1], icon_anchor[2]) + self.baseframe.cabecalho.atributo_icon:SetPoint ("topright", self.baseframe.cabecalho.ball_point, "topright", icon_anchor[1], icon_anchor[2]) self:ChangeIcon() end +----------> lock alpha head + if (not this_skin.can_change_alpha_head) then self.baseframe.cabecalho.ball:SetAlpha (100) else self.baseframe.cabecalho.ball:SetAlpha (self.color[4]) end +----------> call widgets handlers + + --> refresh instance button + self:SetInstanceButtonSettings() + + --> refresh delete button + if (_detalhes.ResetButtonInstance == self.meu_id) then + self:SetDeleteButtonSettings() + end + + --> refresh close button + self:SetCloseButtonSettings() + + --> update toolbar + self:ToolbarSide() + + --> update stretch button + self:StretchButtonAnchor() + + --> update side bars + if (self.show_sidebars) then + self:ShowSideBars() + else + self:HideSideBars() + end + + --> update statusbar + if (self.show_statusbar) then + self:ShowStatusBar() + else + self:HideStatusBar() + end + + --> update wallpaper + if (self.wallpaper.enabled) then + self:InstanceWallpaper (true) + end + + --> update instance color + self:InstanceColor() + self:SetBackgroundColor() + self:SetBackgroundAlpha() + + --> refresh all bars + self:InstanceRefreshRows() + + --> refresh options panel if opened + if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then + _detalhes:OpenOptionsWindow (self) + end + end -function gump:CriaCabecalho (BaseFrame, instancia) +function _detalhes:ToolbarSide (side) + + if (not side) then + side = self.toolbar_side + end + + self.toolbar_side = side + + local skin = _detalhes.skins [self.skin] + + if (side == 1) then --> top + --> ball point + self.baseframe.cabecalho.ball_point:ClearAllPoints() + self.baseframe.cabecalho.ball_point:SetPoint ("bottomleft", self.baseframe, "topleft", unpack (skin.icon_point_anchor)) + --> ball + self.baseframe.cabecalho.ball:SetTexCoord (unpack (COORDS_LEFT_BALL)) + self.baseframe.cabecalho.ball:ClearAllPoints() + self.baseframe.cabecalho.ball:SetPoint ("bottomleft", self.baseframe, "topleft", unpack (skin.left_corner_anchor)) + --> botão fechar + self.baseframe.cabecalho.fechar:ClearAllPoints() + self.baseframe.cabecalho.fechar:SetPoint ("bottomright", self.baseframe, "topright", unpack (skin.close_button_anchor)) + --> ball r + self.baseframe.cabecalho.ball_r:SetTexCoord (unpack (COORDS_RIGHT_BALL)) + self.baseframe.cabecalho.ball_r:ClearAllPoints() + self.baseframe.cabecalho.ball_r:SetPoint ("bottomright", self.baseframe, "topright", unpack (skin.right_corner_anchor)) + + --> instance + self:InstanceButtonAnchor() + + --> tex coords + self.baseframe.cabecalho.emenda:SetTexCoord (unpack (COORDS_LEFT_CONNECTOR)) + self.baseframe.cabecalho.top_bg:SetTexCoord (unpack (COORDS_TOP_BACKGROUND)) + + --> menu + self:MenuAnchor() + + + else --> bottom + + local y = 0 + if (self.show_statusbar) then + y = -14 + end + + --> ball point + self.baseframe.cabecalho.ball_point:ClearAllPoints() + local _x, _y = unpack (skin.icon_point_anchor_bottom) + self.baseframe.cabecalho.ball_point:SetPoint ("topleft", self.baseframe, "bottomleft", _x, _y + y) + --> ball + self.baseframe.cabecalho.ball:ClearAllPoints() + local _x, _y = unpack (skin.left_corner_anchor_bottom) + self.baseframe.cabecalho.ball:SetPoint ("topleft", self.baseframe, "bottomleft", _x, _y + y) + local l, r, t, b = unpack (COORDS_LEFT_BALL) + self.baseframe.cabecalho.ball:SetTexCoord (l, r, b, t) + --> botão fechar + self.baseframe.cabecalho.fechar:ClearAllPoints() + local _x, _y = unpack (skin.close_button_anchor_bottom) + self.baseframe.cabecalho.fechar:SetPoint ("topright", self.baseframe, "bottomright", _x, _y + y) + --> ball r + self.baseframe.cabecalho.ball_r:ClearAllPoints() + local _x, _y = unpack (skin.right_corner_anchor_bottom) + self.baseframe.cabecalho.ball_r:SetPoint ("topright", self.baseframe, "bottomright", _x, _y + y) + local l, r, t, b = unpack (COORDS_RIGHT_BALL) + self.baseframe.cabecalho.ball_r:SetTexCoord (l, r, b, t) + + --> tex coords + local l, r, t, b = unpack (COORDS_LEFT_CONNECTOR) + self.baseframe.cabecalho.emenda:SetTexCoord (l, r, b, t) + local l, r, t, b = unpack (COORDS_TOP_BACKGROUND) + self.baseframe.cabecalho.top_bg:SetTexCoord (l, r, b, t) + + --> instance button + self:InstanceButtonAnchor() + + --> menu buttons + self:MenuAnchor() + end + + self:StretchButtonAnchor() + self:HideMainIcon() + + if (self.show_sidebars) then + self:ShowSideBars() + end + +end + +function _detalhes:StretchButtonAnchor (side) + + if (not side) then + side = self.stretch_button_side + end + + if (side == 1 or string.lower (side) == "top") then + + self.baseframe.button_stretch:ClearAllPoints() + + local y = 0 + if (self.toolbar_side == 2) then --bottom + y = -20 + end + + self.baseframe.button_stretch:SetPoint ("bottom", self.baseframe, "top", 0, 20 + y) + self.baseframe.button_stretch:SetPoint ("right", self.baseframe, "right", -27, 0) + self.baseframe.button_stretch.texture:SetTexCoord (unpack (COORDS_STRETCH)) + self.stretch_button_side = 1 + + elseif (side == 2 or string.lower (side) == "bottom") then + + self.baseframe.button_stretch:ClearAllPoints() + + local y = 0 + if (self.toolbar_side == 2) then --bottom + y = y -20 + end + if (self.show_statusbar) then + y = y -14 + end + + self.baseframe.button_stretch:SetPoint ("center", self.baseframe, "center") + self.baseframe.button_stretch:SetPoint ("top", self.baseframe, "bottom", 0, y) + + local l, r, t, b = unpack (COORDS_STRETCH) + self.baseframe.button_stretch.texture:SetTexCoord (r, l, b, t) + + self.stretch_button_side = 2 + + end + +end + +function _detalhes:InstanceButtonAnchor (x, y) + + if (not x) then + x = self.instance_button_anchor [1] + end + if (not y) then + y = self.instance_button_anchor [2] + end + + self.instance_button_anchor [1] = x + self.instance_button_anchor [2] = y + + self.baseframe.cabecalho.novo:ClearAllPoints() + + if (self.toolbar_side == 2) then --> bottom + local y_mod = 0 + if (self.show_statusbar) then + y_mod = 14 + end + self.baseframe.cabecalho.novo:SetPoint ("topright", self.baseframe, "bottomright", x, (y + y_mod) * -1) + else + self.baseframe.cabecalho.novo:SetPoint ("bottomright", self.baseframe, "topright", x, y) + end + +end + +function _detalhes:MenuAnchor (x, y) + + if (not x) then + x = self.menu_anchor [1] + end + if (not y) then + y = self.menu_anchor [2] + end + + self.menu_anchor [1] = x + self.menu_anchor [2] = y + + if (self.consolidate) then + self.consolidateButton:ClearAllPoints() + + if (self.toolbar_side == 1) then --> top + self.consolidateButton:SetPoint ("bottomleft", self.baseframe.cabecalho.ball, "bottomright", x, y) + + else --> bottom + + self.consolidateButton:SetPoint ("topleft", self.baseframe.cabecalho.ball, "topright", x, y*-1) + end + + else --> not consolidated + self.baseframe.cabecalho.modo_selecao:ClearAllPoints() + + if (self.toolbar_side == 1) then --> top + self.baseframe.cabecalho.modo_selecao:SetPoint ("bottomleft", self.baseframe.cabecalho.ball, "bottomright", x, y) + + else --> bottom + self.baseframe.cabecalho.modo_selecao:SetPoint ("topleft", self.baseframe.cabecalho.ball, "topright", x, y*-1) + + end + end +end + +function _detalhes:HideMainIcon (value) + + if (value == nil) then + value = self.hide_icon + end + + if (value) then + self.hide_icon = true + self.baseframe.cabecalho.atributo_icon:Hide() + self.baseframe.cabecalho.ball:SetParent (self.baseframe) + + if (self.toolbar_side == 1) then + self.baseframe.cabecalho.ball:SetTexCoord (unpack (COORDS_LEFT_BALL_NO_ICON)) + self.baseframe.cabecalho.emenda:SetTexCoord (unpack (COORDS_LEFT_CONNECTOR_NO_ICON)) + + elseif (self.toolbar_side == 2) then + local l, r, t, b = unpack (COORDS_LEFT_BALL_NO_ICON) + self.baseframe.cabecalho.ball:SetTexCoord (l, r, b, t) + local l, r, t, b = unpack (COORDS_LEFT_CONNECTOR_NO_ICON) + self.baseframe.cabecalho.emenda:SetTexCoord (l, r, b, t) + + end + + else + self.hide_icon = false + self.baseframe.cabecalho.atributo_icon:Show() + self.baseframe.cabecalho.ball:SetParent (_detalhes.listener) + + if (self.toolbar_side == 1) then + + self.baseframe.cabecalho.ball:SetTexCoord (unpack (COORDS_LEFT_BALL)) + self.baseframe.cabecalho.emenda:SetTexCoord (unpack (COORDS_LEFT_CONNECTOR)) + + elseif (self.toolbar_side == 2) then + + local l, r, t, b = unpack (COORDS_LEFT_BALL) + self.baseframe.cabecalho.ball:SetTexCoord (l, r, b, t) + local l, r, t, b = unpack (COORDS_LEFT_CONNECTOR) + self.baseframe.cabecalho.emenda:SetTexCoord (l, r, b, t) + end + end + +end + +--> search key: ~desaturate +function _detalhes:DesaturateMenu (value) + + if (value == nil) then + value = self.desaturated_menu + end + + if (value) then + self.desaturated_menu = true + self.baseframe.cabecalho.modo_selecao:GetNormalTexture():SetDesaturated (true) + self.baseframe.cabecalho.segmento:GetNormalTexture():SetDesaturated (true) + self.baseframe.cabecalho.atributo:GetNormalTexture():SetDesaturated (true) + self.baseframe.cabecalho.report:GetNormalTexture():SetDesaturated (true) + + if (self.meu_id == _detalhes:GetLowerInstanceNumber()) then + for _, button in _ipairs (_detalhes.ToolBar.AllButtons) do + button:GetNormalTexture():SetDesaturated (true) + end + end + + else + self.desaturated_menu = false + self.baseframe.cabecalho.modo_selecao:GetNormalTexture():SetDesaturated (false) + self.baseframe.cabecalho.segmento:GetNormalTexture():SetDesaturated (false) + self.baseframe.cabecalho.atributo:GetNormalTexture():SetDesaturated (false) + self.baseframe.cabecalho.report:GetNormalTexture():SetDesaturated (false) + + if (self.meu_id == _detalhes:GetLowerInstanceNumber()) then + for _, button in _ipairs (_detalhes.ToolBar.AllButtons) do + button:GetNormalTexture():SetDesaturated (false) + end + end + + end +end + +function _detalhes:ShowSideBars (instancia) + if (instancia) then + self = instancia + end + + self.show_sidebars = true + + self.baseframe.barra_esquerda:Show() + self.baseframe.barra_direita:Show() + + if (self.show_statusbar) then + self.baseframe.barra_esquerda:SetPoint ("bottomleft", self.baseframe, "bottomleft", -56, -14) + self.baseframe.barra_direita:SetPoint ("bottomright", self.baseframe, "bottomright", 56, -14) + + if (self.toolbar_side == 2) then + self.baseframe.barra_fundo:Show() + local l, r, t, b = unpack (COORDS_BOTTOM_SIDE_BAR) + self.baseframe.barra_fundo:SetTexCoord (l, r, b, t) + self.baseframe.barra_fundo:ClearAllPoints() + self.baseframe.barra_fundo:SetPoint ("bottomleft", self.baseframe, "topleft", -1, -6) + self.baseframe.barra_fundo:SetPoint ("bottomright", self.baseframe, "topright", -1, -6) + else + self.baseframe.barra_fundo:Hide() + end + else + self.baseframe.barra_esquerda:SetPoint ("bottomleft", self.baseframe, "bottomleft", -56, 0) + self.baseframe.barra_direita:SetPoint ("bottomright", self.baseframe, "bottomright", 56, 0) + + self.baseframe.barra_fundo:Show() + + if (self.toolbar_side == 2) then --tooltbar on bottom + local l, r, t, b = unpack (COORDS_BOTTOM_SIDE_BAR) + self.baseframe.barra_fundo:SetTexCoord (l, r, b, t) + self.baseframe.barra_fundo:ClearAllPoints() + self.baseframe.barra_fundo:SetPoint ("bottomleft", self.baseframe, "topleft", -1, -6) + self.baseframe.barra_fundo:SetPoint ("bottomright", self.baseframe, "topright", -1, -6) + else --tooltbar on top + self.baseframe.barra_fundo:SetTexCoord (unpack (COORDS_BOTTOM_SIDE_BAR)) + self.baseframe.barra_fundo:ClearAllPoints() + self.baseframe.barra_fundo:SetPoint ("bottomleft", self.baseframe, "bottomleft", -1, -56) + self.baseframe.barra_fundo:SetPoint ("bottomright", self.baseframe, "bottomright", -1, -56) + end + end + +end + +function _detalhes:HideSideBars (instancia) + if (instancia) then + self = instancia + end + + self.show_sidebars = false + + self.baseframe.barra_esquerda:Hide() + self.baseframe.barra_direita:Hide() + self.baseframe.barra_fundo:Hide() + +end + +function _detalhes:HideStatusBar (instancia) + if (instancia) then + self = instancia + end + + self.show_statusbar = false + + self.baseframe.rodape.esquerdo:Hide() + self.baseframe.rodape.direita:Hide() + self.baseframe.rodape.top_bg:Hide() + self.baseframe.rodape.StatusBarLeftAnchor:Hide() + self.baseframe.rodape.StatusBarCenterAnchor:Hide() + + if (self.toolbar_side == 2) then + self:ToolbarSide() + end + + if (self.show_sidebars) then + self:ShowSideBars() + end + + self:StretchButtonAnchor() + + _detalhes.StatusBar:Hide (self) --> mini displays widgets +end + +function _detalhes:ShowStatusBar (instancia) + if (instancia) then + self = instancia + end + + self.show_statusbar = true + + self.baseframe.rodape.esquerdo:Show() + self.baseframe.rodape.direita:Show() + self.baseframe.rodape.top_bg:Show() + self.baseframe.rodape.StatusBarLeftAnchor:Show() + self.baseframe.rodape.StatusBarCenterAnchor:Show() + + self:ToolbarSide() + self:StretchButtonAnchor() + + _detalhes.StatusBar:Show (self) --> mini displays widgets +end + +function gump:CriaCabecalho (baseframe, instancia) -- texturas da barra superior ------------------------------------------------------------------------------------------------------------------------------------------------- - BaseFrame.cabecalho = {} + baseframe.cabecalho = {} --> FECHAR INSTANCIA ---------------------------------------------------------------------------------------------------------------------------------------------------- - BaseFrame.cabecalho.fechar = _CreateFrame ("Button", nil, BaseFrame, "UIPanelCloseButton") - BaseFrame.cabecalho.fechar:SetWidth (32) - BaseFrame.cabecalho.fechar:SetHeight (32) - BaseFrame.cabecalho.fechar:SetFrameLevel (5) --> altura mais alta que os demais frames - BaseFrame.cabecalho.fechar:SetPoint ("BOTTOMRIGHT", BaseFrame, "TOPRIGHT", 5, -6) --> seta o ponto dele fixando no base frame + baseframe.cabecalho.fechar = CreateFrame ("button", nil, baseframe, "UIPanelCloseButton") + baseframe.cabecalho.fechar:SetWidth (32) + baseframe.cabecalho.fechar:SetHeight (32) + baseframe.cabecalho.fechar:SetFrameLevel (5) --> altura mais alta que os demais frames + baseframe.cabecalho.fechar:SetPoint ("bottomright", baseframe, "topright", 5, -6) --> seta o ponto dele fixando no base frame - BaseFrame.cabecalho.fechar:SetScript ("OnClick", function() - BaseFrame.cabecalho.fechar:Disable() + baseframe.cabecalho.fechar:SetScript ("OnClick", function() + baseframe.cabecalho.fechar:Disable() instancia:DesativarInstancia() --> não há mais instâncias abertas, então manda msg alertando if (_detalhes.opened_windows == 0) then @@ -3186,80 +4144,74 @@ function gump:CriaCabecalho (BaseFrame, instancia) end end) - BaseFrame.cabecalho.fechar.instancia = instancia - BaseFrame.cabecalho.fechar:SetText ("x") - BaseFrame.cabecalho.fechar:SetScript ("OnEnter", botao_fechar_on_enter) - BaseFrame.cabecalho.fechar:SetScript ("OnLeave", botao_fechar_on_leave) + baseframe.cabecalho.fechar.instancia = instancia + baseframe.cabecalho.fechar:SetText ("x") + baseframe.cabecalho.fechar:SetScript ("OnEnter", botao_fechar_on_enter) + baseframe.cabecalho.fechar:SetScript ("OnLeave", botao_fechar_on_leave) --> bola do canto esquedo superior --> primeiro criar a armação para apoiar as texturas - BaseFrame.cabecalho.ball_point = BaseFrame.cabecalho.fechar:CreateTexture (nil, "OVERLAY") - BaseFrame.cabecalho.ball_point:SetPoint ("BOTTOMLEFT", BaseFrame, "TOPLEFT", -37, 0) - BaseFrame.cabecalho.ball_point:SetWidth (64) - BaseFrame.cabecalho.ball_point:SetHeight (32) + baseframe.cabecalho.ball_point = baseframe.cabecalho.fechar:CreateTexture (nil, "overlay") + baseframe.cabecalho.ball_point:SetPoint ("bottomleft", baseframe, "topleft", -37, 0) + baseframe.cabecalho.ball_point:SetWidth (64) + baseframe.cabecalho.ball_point:SetHeight (32) --> icone do atributo - BaseFrame.cabecalho.atributo_icon = _detalhes.listener:CreateTexture (nil, "ARTWORK") + baseframe.cabecalho.atributo_icon = _detalhes.listener:CreateTexture (nil, "artwork") local icon_anchor = _detalhes.skins ["Default Skin"].icon_anchor_main - BaseFrame.cabecalho.atributo_icon:SetPoint ("TOPRIGHT", BaseFrame.cabecalho.ball_point, "TOPRIGHT", icon_anchor[1], icon_anchor[2]) - --BaseFrame.cabecalho.atributo_icon:SetTexture ("Interface\\AddOns\\Details\\images\\icon_mainwindow") - BaseFrame.cabecalho.atributo_icon:SetTexture (DEFAULT_SKIN) - BaseFrame.cabecalho.atributo_icon:SetWidth (32) - BaseFrame.cabecalho.atributo_icon:SetHeight (32) + baseframe.cabecalho.atributo_icon:SetPoint ("topright", baseframe.cabecalho.ball_point, "topright", icon_anchor[1], icon_anchor[2]) + baseframe.cabecalho.atributo_icon:SetTexture (DEFAULT_SKIN) + baseframe.cabecalho.atributo_icon:SetWidth (32) + baseframe.cabecalho.atributo_icon:SetHeight (32) --> bola overlay - BaseFrame.cabecalho.ball = _detalhes.listener:CreateTexture (nil, "OVERLAY") - BaseFrame.cabecalho.ball:SetPoint ("BOTTOMLEFT", BaseFrame, "TOPLEFT", -107, 0) - BaseFrame.cabecalho.ball:SetWidth (128) - BaseFrame.cabecalho.ball:SetHeight (128) + baseframe.cabecalho.ball = _detalhes.listener:CreateTexture (nil, "overlay") + baseframe.cabecalho.ball:SetPoint ("bottomleft", baseframe, "topleft", -107, 0) + baseframe.cabecalho.ball:SetWidth (128) + baseframe.cabecalho.ball:SetHeight (128) - --BaseFrame.cabecalho.ball:SetTexture ([[Interface\AddOns\Details\images\ball_left]]) - BaseFrame.cabecalho.ball:SetTexture (DEFAULT_SKIN) - BaseFrame.cabecalho.ball:SetTexCoord (unpack (COORDS_LEFT_BALL)) + baseframe.cabecalho.ball:SetTexture (DEFAULT_SKIN) + baseframe.cabecalho.ball:SetTexCoord (unpack (COORDS_LEFT_BALL)) --> emenda - BaseFrame.cabecalho.emenda = BaseFrame:CreateTexture (nil, "OVERLAY") - BaseFrame.cabecalho.emenda:SetPoint ("bottomleft", BaseFrame.cabecalho.ball, "bottomright") - BaseFrame.cabecalho.emenda:SetWidth (8) - BaseFrame.cabecalho.emenda:SetHeight (128) - --BaseFrame.cabecalho.emenda:SetTexture ([[Interface\AddOns\Details\images\emenda_left]]) - BaseFrame.cabecalho.emenda:SetTexture (DEFAULT_SKIN) - BaseFrame.cabecalho.emenda:SetTexCoord (unpack (COORDS_LEFT_CONNECTOR)) + baseframe.cabecalho.emenda = baseframe:CreateTexture (nil, "overlay") + baseframe.cabecalho.emenda:SetPoint ("bottomleft", baseframe.cabecalho.ball, "bottomright") + baseframe.cabecalho.emenda:SetWidth (8) + baseframe.cabecalho.emenda:SetHeight (128) + baseframe.cabecalho.emenda:SetTexture (DEFAULT_SKIN) + baseframe.cabecalho.emenda:SetTexCoord (unpack (COORDS_LEFT_CONNECTOR)) - BaseFrame.cabecalho.atributo_icon:Hide() - BaseFrame.cabecalho.ball:Hide() + baseframe.cabecalho.atributo_icon:Hide() + baseframe.cabecalho.ball:Hide() --> bola do canto direito superior - BaseFrame.cabecalho.ball_r = BaseFrame:CreateTexture (nil, "BACKGROUND") - BaseFrame.cabecalho.ball_r:SetPoint ("BOTTOMRIGHT", BaseFrame, "TOPRIGHT", 96, 0) - BaseFrame.cabecalho.ball_r:SetWidth (128) - BaseFrame.cabecalho.ball_r:SetHeight (128) - --BaseFrame.cabecalho.ball_r:SetTexture ("Interface\\AddOns\\Details\\images\\bar_top_right") - BaseFrame.cabecalho.ball_r:SetTexture (DEFAULT_SKIN) - BaseFrame.cabecalho.ball_r:SetTexCoord (unpack (COORDS_RIGHT_BALL)) + baseframe.cabecalho.ball_r = baseframe:CreateTexture (nil, "background") + baseframe.cabecalho.ball_r:SetPoint ("bottomright", baseframe, "topright", 96, 0) + baseframe.cabecalho.ball_r:SetWidth (128) + baseframe.cabecalho.ball_r:SetHeight (128) + baseframe.cabecalho.ball_r:SetTexture (DEFAULT_SKIN) + baseframe.cabecalho.ball_r:SetTexCoord (unpack (COORDS_RIGHT_BALL)) --> barra centro - BaseFrame.cabecalho.top_bg = BaseFrame:CreateTexture (nil, "BACKGROUND") - --BaseFrame.cabecalho.top_bg:SetPoint ("LEFT", BaseFrame.cabecalho.ball, "RIGHT", -4, 0) - BaseFrame.cabecalho.top_bg:SetPoint ("LEFT", BaseFrame.cabecalho.emenda, "RIGHT", 0, 0) - BaseFrame.cabecalho.top_bg:SetPoint ("RIGHT", BaseFrame.cabecalho.ball_r, "LEFT") - BaseFrame.cabecalho.top_bg:SetTexture (DEFAULT_SKIN) - BaseFrame.cabecalho.top_bg:SetTexCoord (unpack (COORDS_TOP_BACKGROUND)) - BaseFrame.cabecalho.top_bg:SetWidth (512) - BaseFrame.cabecalho.top_bg:SetHeight (128) - --BaseFrame.cabecalho.top_bg:SetTexture ("Interface\\AddOns\\Details\\images\\bar_top_center") + baseframe.cabecalho.top_bg = baseframe:CreateTexture (nil, "background") + baseframe.cabecalho.top_bg:SetPoint ("left", baseframe.cabecalho.emenda, "right", 0, 0) + baseframe.cabecalho.top_bg:SetPoint ("right", baseframe.cabecalho.ball_r, "left") + baseframe.cabecalho.top_bg:SetTexture (DEFAULT_SKIN) + baseframe.cabecalho.top_bg:SetTexCoord (unpack (COORDS_TOP_BACKGROUND)) + baseframe.cabecalho.top_bg:SetWidth (512) + baseframe.cabecalho.top_bg:SetHeight (128) --> frame invisível - BaseFrame.UPFrame = _CreateFrame ("frame", nil, BaseFrame) - BaseFrame.UPFrame:SetPoint ("LEFT", BaseFrame.cabecalho.ball, "RIGHT", 0, -53) - BaseFrame.UPFrame:SetPoint ("RIGHT", BaseFrame.cabecalho.ball_r, "LEFT", 0, -53) - BaseFrame.UPFrame:SetHeight (20) + baseframe.UPFrame = CreateFrame ("frame", nil, baseframe) + baseframe.UPFrame:SetPoint ("left", baseframe.cabecalho.ball, "right", 0, -53) + baseframe.UPFrame:SetPoint ("right", baseframe.cabecalho.ball_r, "left", 0, -53) + baseframe.UPFrame:SetHeight (20) - BaseFrame.UPFrame:Show() - BaseFrame.UPFrame:EnableMouse (true) - BaseFrame.UPFrame:SetMovable (true) - BaseFrame.UPFrame:SetResizable (true) + baseframe.UPFrame:Show() + baseframe.UPFrame:EnableMouse (true) + baseframe.UPFrame:SetMovable (true) + baseframe.UPFrame:SetResizable (true) - BGFrame_scripts (BaseFrame.UPFrame, BaseFrame, instancia) + BGFrame_scripts (baseframe.UPFrame, baseframe, instancia) -- botões @@ -3269,53 +4221,57 @@ function gump:CriaCabecalho (BaseFrame, instancia) --> SELEÇÃO DO MODO ---------------------------------------------------------------------------------------------------------------------------------------------------- - BaseFrame.cabecalho.modo_selecao = gump:NewButton (BaseFrame, nil, "DetailsModeButton"..instancia.meu_id, nil, 16, 16, _detalhes.empty_function, nil, nil, [[Interface\GossipFrame\HealerGossipIcon]]) - BaseFrame.cabecalho.modo_selecao:SetFrameLevel (BaseFrame.UPFrame:GetFrameLevel()+1) - BaseFrame.cabecalho.modo_selecao:SetPoint ("BOTTOMLEFT", BaseFrame.cabecalho.ball, "BOTTOMRIGHT", 0, 2) + baseframe.cabecalho.modo_selecao = gump:NewButton (baseframe, nil, "DetailsModeButton"..instancia.meu_id, nil, 16, 16, _detalhes.empty_function, nil, nil, [[Interface\GossipFrame\HealerGossipIcon]]) + baseframe.cabecalho.modo_selecao:SetPoint ("bottomleft", baseframe.cabecalho.ball, "bottomright", instancia.menu_anchor [1], instancia.menu_anchor [2]) + baseframe.cabecalho.modo_selecao:SetFrameLevel (baseframe:GetFrameLevel()+5) --> Generating Cooltip menu from table template local modeMenuTable = { {text = Loc ["STRING_MODE_GROUP"]}, {func = instancia.AlteraModo, param1 = 2}, - {icon = "Interface\\AddOns\\Details\\images\\modo_icones", l = 32/256, r = 32/256*2, t = 0, b = 1, width = 20, height = 20}, + {icon = [[Interface\AddOns\Details\images\modo_icones]], l = 32/256, r = 32/256*2, t = 0, b = 1, width = 20, height = 20}, {text = Loc ["STRING_HELP_MODEGROUP"], type = 2}, {icon = [[Interface\TUTORIALFRAME\TutorialFrame-QuestionMark]], type = 2, width = 16, height = 16, l = 8/64, r = 1 - (8/64), t = 8/64, b = 1 - (8/64)}, {text = Loc ["STRING_MODE_ALL"]}, {func = instancia.AlteraModo, param1 = 3}, - {icon = "Interface\\AddOns\\Details\\images\\modo_icones", l = 32/256*2, r = 32/256*3, t = 0, b = 1, width = 20, height = 20}, + {icon = [[Interface\AddOns\Details\images\modo_icones]], l = 32/256*2, r = 32/256*3, t = 0, b = 1, width = 20, height = 20}, {text = Loc ["STRING_HELP_MODEALL"], type = 2}, {icon = [[Interface\TUTORIALFRAME\TutorialFrame-QuestionMark]], type = 2, width = 16, height = 16, l = 8/64, r = 1 - (8/64), t = 8/64, b = 1 - (8/64)}, {text = Loc ["STRING_MODE_SELF"] .. " (|cffa0a0a0" .. Loc ["STRING_MODE_PLUGINS"] .. "|r)"}, {func = instancia.AlteraModo, param1 = 1}, - {icon = "Interface\\AddOns\\Details\\images\\modo_icones", l = 0, r = 32/256, t = 0, b = 1, width = 20, height = 20}, + {icon = [[Interface\AddOns\Details\images\modo_icones]], l = 0, r = 32/256, t = 0, b = 1, width = 20, height = 20}, {text = Loc ["STRING_HELP_MODESELF"], type = 2}, {icon = [[Interface\TUTORIALFRAME\TutorialFrame-QuestionMark]], type = 2, width = 16, height = 16, l = 8/64, r = 1 - (8/64), t = 8/64, b = 1 - (8/64)}, {text = Loc ["STRING_MODE_RAID"] .. " (|cffa0a0a0" .. Loc ["STRING_MODE_PLUGINS"] .. "|r)"}, {func = instancia.AlteraModo, param1 = 4}, - {icon = "Interface\\AddOns\\Details\\images\\modo_icones", l = 32/256*3, r = 32/256*4, t = 0, b = 1, width = 20, height = 20}, + {icon = [[Interface\AddOns\Details\images\modo_icones]], l = 32/256*3, r = 32/256*4, t = 0, b = 1, width = 20, height = 20}, {text = Loc ["STRING_HELP_MODERAID"], type = 2}, {icon = [[Interface\TUTORIALFRAME\TutorialFrame-QuestionMark]], type = 2, width = 16, height = 16, l = 8/64, r = 1 - (8/64), t = 8/64, b = 1 - (8/64)}, {text = Loc ["STRING_OPTIONS_WINDOW"]}, {func = _detalhes.OpenOptionsWindow}, - {icon = "Interface\\AddOns\\Details\\images\\modo_icones", l = 32/256*4, r = 32/256*5, t = 0, b = 1, width = 20, height = 20}, + {icon = [[Interface\AddOns\Details\images\modo_icones]], l = 32/256*4, r = 32/256*5, t = 0, b = 1, width = 20, height = 20}, } --> Cooltip raw method for enter/leave show/hide - BaseFrame.cabecalho.modo_selecao:SetScript ("OnEnter", function (self) + baseframe.cabecalho.modo_selecao:SetScript ("OnEnter", function (self) - --gump:Fade (BaseFrame.button_stretch, "alpha", 0.3) + --gump:Fade (baseframe.button_stretch, "alpha", 0.3) OnEnterMainWindow (instancia, self, 3) - _detalhes.popup.buttonOver = true - BaseFrame.cabecalho.button_mouse_over = true + if (instancia.desaturated_menu) then + self:GetNormalTexture():SetDesaturated (false) + end + + _G.GameCooltip.buttonOver = true + baseframe.cabecalho.button_mouse_over = true local passou = 0 - if (_detalhes.popup.active) then + if (_G.GameCooltip.active) then passou = 0.15 end @@ -3338,14 +4294,17 @@ function gump:CriaCabecalho (BaseFrame, instancia) self:SetScript ("OnUpdate", build_mode_list) end) - BaseFrame.cabecalho.modo_selecao:SetScript ("OnLeave", function (self) - --gump:Fade (BaseFrame.button_stretch, -1) + baseframe.cabecalho.modo_selecao:SetScript ("OnLeave", function (self) OnLeaveMainWindow (instancia, self, 3) - _detalhes.popup.buttonOver = false - BaseFrame.cabecalho.button_mouse_over = false + if (instancia.desaturated_menu) then + self:GetNormalTexture():SetDesaturated (true) + end - if (_detalhes.popup.active) then + _G.GameCooltip.buttonOver = false + baseframe.cabecalho.button_mouse_over = false + + if (_G.GameCooltip.active) then parameters_table [2] = 0 self:SetScript ("OnUpdate", on_leave_menu) else @@ -3354,10 +4313,10 @@ function gump:CriaCabecalho (BaseFrame, instancia) end) --> SELECIONAR O SEGMENTO ---------------------------------------------------------------------------------------------------------------------------------------------------- - BaseFrame.cabecalho.segmento = gump:NewButton (BaseFrame, nil, "DetailsSegmentButton"..instancia.meu_id, nil, 16, 16, _detalhes.empty_function, nil, nil, [[Interface\GossipFrame\TrainerGossipIcon]]) - BaseFrame.cabecalho.segmento:SetFrameLevel (BaseFrame.UPFrame:GetFrameLevel()+1) + baseframe.cabecalho.segmento = gump:NewButton (baseframe, nil, "DetailsSegmentButton"..instancia.meu_id, nil, 16, 16, _detalhes.empty_function, nil, nil, [[Interface\GossipFrame\TrainerGossipIcon]]) + baseframe.cabecalho.segmento:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1) - BaseFrame.cabecalho.segmento:SetHook ("OnMouseUp", function (button, buttontype) + baseframe.cabecalho.segmento:SetHook ("OnMouseUp", function (button, buttontype) if (buttontype == "LeftButton") then @@ -3404,18 +4363,22 @@ function gump:CriaCabecalho (BaseFrame, instancia) end end) - BaseFrame.cabecalho.segmento:SetPoint ("left", BaseFrame.cabecalho.modo_selecao, "right", 0, 0) + baseframe.cabecalho.segmento:SetPoint ("left", baseframe.cabecalho.modo_selecao, "right", 0, 0) --> Cooltip raw method for show/hide onenter/onhide - BaseFrame.cabecalho.segmento:SetScript ("OnEnter", function (self) - --gump:Fade (BaseFrame.button_stretch, "alpha", 0.3) + baseframe.cabecalho.segmento:SetScript ("OnEnter", function (self) + --gump:Fade (baseframe.button_stretch, "alpha", 0.3) OnEnterMainWindow (instancia, self, 3) - _detalhes.popup.buttonOver = true - BaseFrame.cabecalho.button_mouse_over = true + if (instancia.desaturated_menu) then + self:GetNormalTexture():SetDesaturated (false) + end + + _G.GameCooltip.buttonOver = true + baseframe.cabecalho.button_mouse_over = true local passou = 0 - if (_detalhes.popup.active) then + if (_G.GameCooltip.active) then passou = 0.15 end @@ -3425,14 +4388,18 @@ function gump:CriaCabecalho (BaseFrame, instancia) end) --> Cooltip raw method - BaseFrame.cabecalho.segmento:SetScript ("OnLeave", function (self) - --gump:Fade (BaseFrame.button_stretch, -1) + baseframe.cabecalho.segmento:SetScript ("OnLeave", function (self) + --gump:Fade (baseframe.button_stretch, -1) OnLeaveMainWindow (instancia, self, 3) - _detalhes.popup.buttonOver = false - BaseFrame.cabecalho.button_mouse_over = false + if (instancia.desaturated_menu) then + self:GetNormalTexture():SetDesaturated (true) + end - if (_detalhes.popup.active) then + _G.GameCooltip.buttonOver = false + baseframe.cabecalho.button_mouse_over = false + + if (_G.GameCooltip.active) then parameters_table [2] = 0 self:SetScript ("OnUpdate", on_leave_menu) else @@ -3441,9 +4408,9 @@ function gump:CriaCabecalho (BaseFrame, instancia) end) --> SELECIONAR O ATRIBUTO ---------------------------------------------------------------------------------------------------------------------------------------------------- - BaseFrame.cabecalho.atributo = gump:NewDetailsButton (BaseFrame, _, instancia, instancia.TrocaTabela, instancia, -3, 16, 16, "Interface\\AddOns\\Details\\images\\sword") - BaseFrame.cabecalho.atributo:SetFrameLevel (BaseFrame.UPFrame:GetFrameLevel()+1) - BaseFrame.cabecalho.atributo:SetPoint ("left", BaseFrame.cabecalho.segmento.widget, "right", 0, 0) + baseframe.cabecalho.atributo = gump:NewDetailsButton (baseframe, _, instancia, instancia.TrocaTabela, instancia, -3, 16, 16, [[Interface\AddOns\Details\images\sword]]) + baseframe.cabecalho.atributo:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1) + baseframe.cabecalho.atributo:SetPoint ("left", baseframe.cabecalho.segmento.widget, "right", 0, 0) --> Cooltip automatic method through Injection @@ -3460,57 +4427,74 @@ function gump:CriaCabecalho (BaseFrame, instancia) --> Now we create a table with some parameters --> your frame need to have a member called CoolTip - BaseFrame.cabecalho.atributo.CoolTip = { + baseframe.cabecalho.atributo.CoolTip = { Type = "menu", --> the type, menu tooltip tooltipbars BuildFunc = BuildAttributeMenu, --> called when user mouse over the frame - OnEnterFunc = function() BaseFrame.cabecalho.button_mouse_over = true; OnEnterMainWindow (instancia, BaseFrame.cabecalho.atributo, 3) end, - OnLeaveFunc = function() BaseFrame.cabecalho.button_mouse_over = false; OnLeaveMainWindow (instancia, BaseFrame.cabecalho.atributo, 3) end, + OnEnterFunc = function (self) + baseframe.cabecalho.button_mouse_over = true; + OnEnterMainWindow (instancia, baseframe.cabecalho.atributo, 3) + if (instancia.desaturated_menu) then + self:GetNormalTexture():SetDesaturated (false) + end + end, + OnLeaveFunc = function (self) + baseframe.cabecalho.button_mouse_over = false; + OnLeaveMainWindow (instancia, baseframe.cabecalho.atributo, 3) + if (instancia.desaturated_menu) then + self:GetNormalTexture():SetDesaturated (true) + end + end, FixedValue = instancia, ShowSpeed = 0.15, Options = function() if (instancia.consolidate) then return {Anchor = instancia.consolidateFrame, MyAnchor = "topleft", RelativeAnchor = "topright", TextSize = _detalhes.font_sizes.menus} else - return {TextSize = _detalhes.font_sizes.menus} + if (instancia.toolbar_side == 1) then --top + return {TextSize = _detalhes.font_sizes.menus} + elseif (instancia.toolbar_side == 2) then --bottom + return {TextSize = _detalhes.font_sizes.menus, HeightAnchorMod = -7} + end end end} --> install cooltip - _detalhes.popup:CoolTipInject (BaseFrame.cabecalho.atributo) + _G.GameCooltip:CoolTipInject (baseframe.cabecalho.atributo) --> REPORTAR ---------------------------------------------------------------------------------------------------------------------------------------------------- - BaseFrame.cabecalho.report = gump:NewDetailsButton (BaseFrame, _, instancia, _detalhes.Reportar, instancia, nil, 16, 16, [[Interface\COMMON\VOICECHAT-ON]]) - BaseFrame.cabecalho.report:SetPoint ("left", BaseFrame.cabecalho.atributo, "right", -6, 0) - BaseFrame.cabecalho.report:SetFrameLevel (BaseFrame.UPFrame:GetFrameLevel()+1) - BaseFrame.cabecalho.report:SetScript ("OnEnter", function (self) + baseframe.cabecalho.report = gump:NewDetailsButton (baseframe, _, instancia, _detalhes.Reportar, instancia, nil, 16, 16, [[Interface\COMMON\VOICECHAT-ON]]) + baseframe.cabecalho.report:SetPoint ("left", baseframe.cabecalho.atributo, "right", -6, 0) + baseframe.cabecalho.report:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1) + baseframe.cabecalho.report:SetScript ("OnEnter", function (self) OnEnterMainWindow (instancia, self, 3) + if (instancia.desaturated_menu) then + self:GetNormalTexture():SetDesaturated (false) + end end) - BaseFrame.cabecalho.report:SetScript ("OnLeave", function (self) + baseframe.cabecalho.report:SetScript ("OnLeave", function (self) OnLeaveMainWindow (instancia, self, 3) + if (instancia.desaturated_menu) then + self:GetNormalTexture():SetDesaturated (true) + end end) - - --> BOSS INFO ---------------------------------------------------------------------------------------------------------------------------------------------------- - --BaseFrame.cabecalho.boss_info = gump:NewDetailsButton (BaseFrame, BaseFrame, instancia, _detalhes.AbrirEncounterWindow, instancia, nil, 16, 16, - --"Interface\\COMMON\\help-i", "Interface\\COMMON\\help-i", "Interface\\COMMON\\help-i", "Interface\\COMMON\\help-i") - --BaseFrame.cabecalho.boss_info:SetPoint ("left", BaseFrame.cabecalho.report, "right", 1, 0) - --BaseFrame.cabecalho.boss_info:SetFrameLevel (BaseFrame.UPFrame:GetFrameLevel()+1) - --> NOVA INSTANCIA ---------------------------------------------------------------------------------------------------------------------------------------------------- - BaseFrame.cabecalho.novo = _CreateFrame ("Button", nil, BaseFrame, "OptionsButtonTemplate") - BaseFrame.cabecalho.novo:SetFrameLevel (BaseFrame.UPFrame:GetFrameLevel()+1) + baseframe.cabecalho.novo = CreateFrame ("button", "DetailsInstanceButton"..instancia.meu_id, baseframe, "OptionsButtonTemplate") + baseframe.cabecalho.novo:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1) - BaseFrame.cabecalho.novo:SetWidth (30) - BaseFrame.cabecalho.novo:SetHeight (15) - BaseFrame.cabecalho.novo:SetPoint ("RIGHT", BaseFrame.cabecalho.fechar, "LEFT", 1, 0) - BaseFrame.cabecalho.novo:SetScript ("OnClick", function() _detalhes:CriarInstancia (_, true); _detalhes.popup:ShowMe (false) end) - BaseFrame.cabecalho.novo:SetText ("#"..instancia.meu_id) + baseframe.cabecalho.novo:SetWidth (30) + baseframe.cabecalho.novo:SetHeight (15) + + baseframe.cabecalho.novo:SetPoint ("bottomright", baseframe, "topright", instancia.instance_button_anchor [1], instancia.instance_button_anchor [2]) + + baseframe.cabecalho.novo:SetScript ("OnClick", function() _detalhes:CriarInstancia (_, true); _G.GameCooltip:ShowMe (false) end) + baseframe.cabecalho.novo:SetText ("#"..instancia.meu_id) --> cooltip through inject --> OnClick Function [1] caller [2] fixed param [3] param1 [4] param2 local OnClickNovoMenu = function (_, _, id) _detalhes.CriarInstancia (_, _, id) - _detalhes.popup:ExecFunc (BaseFrame.cabecalho.novo) + _G.GameCooltip:ExecFunc (baseframe.cabecalho.novo) end --> Build Menu Function @@ -3544,15 +4528,23 @@ function gump:CriaCabecalho (BaseFrame, instancia) atributo = _detalhes.SoloTables.Mode or 1 local SoloInfo = _detalhes.SoloTables.Menu [atributo] - CoolTip:AddMenu (1, OnClickNovoMenu, index, nil, nil, "#".. index .. " " .. SoloInfo [1], _, true) - CoolTip:AddIcon (SoloInfo [2], 1, 1, 20, 20, 0, 1, 0, 1) + if (SoloInfo) then + CoolTip:AddMenu (1, OnClickNovoMenu, index, nil, nil, "#".. index .. " " .. SoloInfo [1], _, true) + CoolTip:AddIcon (SoloInfo [2], 1, 1, 20, 20, 0, 1, 0, 1) + else + CoolTip:AddMenu (1, OnClickNovoMenu, index, nil, nil, "#".. index .. " Unknown Plugin", _, true) + end elseif (modo == 4) then --raid atributo = _detalhes.RaidTables.Mode or 1 local RaidInfo = _detalhes.RaidTables.Menu [atributo] - CoolTip:AddMenu (1, OnClickNovoMenu, index, nil, nil, "#".. index .. " " .. RaidInfo [1], _, true) - CoolTip:AddIcon (RaidInfo [2], 1, 1, 20, 20, 0, 1, 0, 1) + if (RaidInfo) then + CoolTip:AddMenu (1, OnClickNovoMenu, index, nil, nil, "#".. index .. " " .. RaidInfo [1], _, true) + CoolTip:AddIcon (RaidInfo [2], 1, 1, 20, 20, 0, 1, 0, 1) + else + CoolTip:AddMenu (1, OnClickNovoMenu, index, nil, nil, "#".. index .. " Unknown Plugin", _, true) + end else @@ -3568,7 +4560,7 @@ function gump:CriaCabecalho (BaseFrame, instancia) end --> Inject Options Table - BaseFrame.cabecalho.novo.CoolTip = { + baseframe.cabecalho.novo.CoolTip = { --> cooltip type "menu" "tooltip" "tooltipbars" Type = "menu", --> how much time wait with mouse over the frame until cooltip show up @@ -3576,17 +4568,24 @@ function gump:CriaCabecalho (BaseFrame, instancia) --> will call for build menu BuildFunc = BuildClosedInstanceMenu, --> a hook for OnEnterScript - OnEnterFunc = function() OnEnterMainWindow (instancia, BaseFrame.cabecalho.novo, 3) end, + OnEnterFunc = function() OnEnterMainWindow (instancia, baseframe.cabecalho.novo, 3) end, --> a hook for OnLeaveScript - OnLeaveFunc = function() OnLeaveMainWindow (instancia, BaseFrame.cabecalho.novo, 3) end, + OnLeaveFunc = function() OnLeaveMainWindow (instancia, baseframe.cabecalho.novo, 3) end, --> default message if there is no option avaliable Default = Loc ["STRING_NOCLOSED_INSTANCES"], --> instancia is the first parameter sent after click, before parameters FixedValue = instancia, - Options = {TextSize = 10, NoLastSelectedBar = true}} + Options = function() + if (instancia.toolbar_side == 1) then --top + return {TextSize = 10, NoLastSelectedBar = true} + elseif (instancia.toolbar_side == 2) then --bottom + return {HeightAnchorMod = -7, TextSize = 10, NoLastSelectedBar = true} + end + end + } --> Inject - _detalhes.popup:CoolTipInject (BaseFrame.cabecalho.novo) + _G.GameCooltip:CoolTipInject (baseframe.cabecalho.novo) --> RESETAR HISTORICO ---------------------------------------------------------------------------------------------------------------------------------------------------- if (not _detalhes.ResetButton) then @@ -3609,8 +4608,8 @@ function gump:CriaCabecalho (BaseFrame, instancia) _detalhes.ResetButton:SetParent (instancia.baseframe) _detalhes.ResetButton2:SetParent (instancia.baseframe) - _detalhes.ResetButton:SetPoint ("RIGHT", instancia.baseframe.cabecalho.novo, "LEFT") - _detalhes.ResetButton2:SetPoint ("RIGHT", instancia.baseframe.cabecalho.novo, "LEFT", 3, 0) + _detalhes.ResetButton:SetPoint ("right", instancia.baseframe.cabecalho.novo, "left") + _detalhes.ResetButton2:SetPoint ("right", instancia.baseframe.cabecalho.novo, "left", 3, 0) _detalhes.ResetButton:SetFrameLevel (instancia.baseframe.UPFrame:GetFrameLevel()+1) _detalhes.ResetButton2:SetFrameLevel (instancia.baseframe.UPFrame:GetFrameLevel()+1) @@ -3625,11 +4624,11 @@ function gump:CriaCabecalho (BaseFrame, instancia) end -----------------> big button - _detalhes.ResetButton = _CreateFrame ("Button", nil, BaseFrame, "OptionsButtonTemplate") - _detalhes.ResetButton:SetFrameLevel (BaseFrame.UPFrame:GetFrameLevel()+1) + _detalhes.ResetButton = CreateFrame ("button", "DetailsResetButton1", baseframe, "UIPanelButtonTemplate") + _detalhes.ResetButton:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1) _detalhes.ResetButton:SetWidth (50) - _detalhes.ResetButton:SetHeight (15) - _detalhes.ResetButton:SetPoint ("RIGHT", BaseFrame.cabecalho.novo, "LEFT") + _detalhes.ResetButton:SetHeight (12) + _detalhes.ResetButton:SetPoint ("right", baseframe.cabecalho.novo, "left") _detalhes.ResetButton:SetText (Loc ["STRING_ERASE"]) @@ -3649,13 +4648,13 @@ function gump:CriaCabecalho (BaseFrame, instancia) OnLeaveMainWindow (_detalhes:GetInstance (lower_instance), self, 3) end - if (_detalhes.popup.active) then + if (_G.GameCooltip.active) then local passou = 0 self:SetScript ("OnUpdate", function (self, elapsed) passou = passou+elapsed if (passou > 0.3) then - if (not _detalhes.popup.mouse_over and not _detalhes.popup.button_over) then - _detalhes.popup:ShowMe (false) + if (not _G.GameCooltip.mouse_over and not _G.GameCooltip.button_over) then + _G.GameCooltip:ShowMe (false) end self:SetScript ("OnUpdate", nil) end @@ -3666,13 +4665,13 @@ function gump:CriaCabecalho (BaseFrame, instancia) end) ----------------> small button - _detalhes.ResetButton2 = _CreateFrame ("Button", nil, BaseFrame, "OptionsButtonTemplate") - _detalhes.ResetButton2:SetFrameLevel (BaseFrame.UPFrame:GetFrameLevel()+1) + _detalhes.ResetButton2 = CreateFrame ("button", "DetailsResetButton2", baseframe, "OptionsButtonTemplate") + _detalhes.ResetButton2:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1) _detalhes.ResetButton2:SetWidth (22) _detalhes.ResetButton2:SetHeight (15) - _detalhes.ResetButton2:SetPoint ("RIGHT", BaseFrame.cabecalho.novo, "LEFT", 2, 0) + _detalhes.ResetButton2:SetPoint ("right", baseframe.cabecalho.novo, "left", 2, 0) - local text = _detalhes.ResetButton2:CreateFontString (nil, "overlay", "GameFont_Gigantic") + local text = _detalhes.ResetButton2:CreateFontString ("DetailsResetButton2Text2", "overlay", "GameFont_Gigantic") text:SetText ("-") _detalhes.ResetButton2:SetFontString (text) _detalhes.ResetButton2:SetNormalFontObject ("GameFont_Gigantic") @@ -3693,13 +4692,13 @@ function gump:CriaCabecalho (BaseFrame, instancia) OnLeaveMainWindow (_detalhes:GetInstance (lower_instance), self, 3) end - if (_detalhes.popup.active) then + if (_G.GameCooltip.active) then local passou = 0 self:SetScript ("OnUpdate", function (self, elapsed) passou = passou+elapsed if (passou > 0.3) then - if (not _detalhes.popup.mouse_over and not _detalhes.popup.button_over) then - _detalhes.popup:ShowMe (false) + if (not _G.GameCooltip.mouse_over and not _G.GameCooltip.button_over) then + _G.GameCooltip:ShowMe (false) end self:SetScript ("OnUpdate", nil) end @@ -3715,12 +4714,10 @@ function gump:CriaCabecalho (BaseFrame, instancia) --> Botão de Ajuda ---------------------------------------------------------------------------------------------------------------------------------------------------- - if (instancia.meu_id == 1 and _detalhes.tutorial.main_help_button < 10) then - - _detalhes.tutorial.main_help_button = _detalhes.tutorial.main_help_button + 1 + if (instancia.meu_id == 1 and _detalhes.tutorial.logons < 3) then --> help button - local helpButton = CreateFrame ("button", "DetailsMainWindowHelpButton", BaseFrame, "MainHelpPlateButton") + local helpButton = CreateFrame ("button", "DetailsMainWindowHelpButton", baseframe, "MainHelpPlateButton") helpButton:SetWidth (28) helpButton:SetHeight (28) helpButton.I:SetWidth (22) @@ -3729,7 +4726,7 @@ function gump:CriaCabecalho (BaseFrame, instancia) helpButton.Ring:SetHeight (28) helpButton.Ring:SetPoint ("center", 5, -6) - helpButton:SetPoint ("topright", BaseFrame, "topleft", 37, 37) + helpButton:SetPoint ("topright", baseframe, "topleft", 37, 37) helpButton:SetFrameLevel (0) helpButton:SetFrameStrata ("LOW") @@ -3741,43 +4738,43 @@ function gump:CriaCabecalho (BaseFrame, instancia) --> modo, segmento e atributo [1] ={HighLightBox = {x = 25, y = 10, width = 60, height = 20}, ButtonPos = { x = 32, y = 40}, - ToolTipDir = "RIGHT", + ToolTipDir = "right", ToolTipText = Loc ["STRING_HELP_MENUS"] }, --> delete [2] ={HighLightBox = {x = 195, y = 10, width = 47, height = 20}, ButtonPos = { x = 197, y = 5}, - ToolTipDir = "LEFT", + ToolTipDir = "left", ToolTipText = Loc ["STRING_HELP_ERASE"] }, --> menu da instancia [3] ={HighLightBox = {x = 244, y = 10, width = 30, height = 20}, ButtonPos = { x = 237, y = 5}, - ToolTipDir = "RIGHT", + ToolTipDir = "right", ToolTipText = Loc ["STRING_HELP_INSTANCE"] }, --> stretch [4] ={HighLightBox = {x = 244, y = 30, width = 30, height = 20}, ButtonPos = { x = 237, y = 57}, - ToolTipDir = "RIGHT", + ToolTipDir = "right", ToolTipText = Loc ["STRING_HELP_STRETCH"] }, --> status bar [5] ={HighLightBox = {x = 0, y = -101, width = 300, height = 20}, ButtonPos = { x = 126, y = -88}, - ToolTipDir = "LEFT", + ToolTipDir = "left", ToolTipText = Loc ["STRING_HELP_STATUSBAR"] }, --> switch menu [6] ={HighLightBox = {x = 0, y = -10, width = 300, height = 95}, ButtonPos = { x = 127, y = -37}, - ToolTipDir = "LEFT", + ToolTipDir = "left", ToolTipText = Loc ["STRING_HELP_SWITCH"] }, --> resizer [7] ={HighLightBox = {x = 250, y = -81, width = 50, height = 20}, ButtonPos = { x = 253, y = -52}, - ToolTipDir = "RIGHT", + ToolTipDir = "right", ToolTipText = Loc ["STRING_HELP_RESIZE"] }, } @@ -3787,7 +4784,7 @@ function gump:CriaCabecalho (BaseFrame, instancia) instancia:SetSize (300, 95) - HelpPlate_Show (mainWindowHelp, BaseFrame, helpButton, true) + HelpPlate_Show (mainWindowHelp, baseframe, helpButton, true) else HelpPlate_Hide (true) end @@ -3800,8 +4797,8 @@ function gump:CriaCabecalho (BaseFrame, instancia) local consolidateFrame = CreateFrame ("frame", nil, _detalhes.listener) consolidateFrame:SetWidth (21) consolidateFrame:SetHeight (83) - consolidateFrame:SetFrameLevel (BaseFrame:GetFrameLevel()-1) - consolidateFrame:SetPoint ("BOTTOMLEFT", BaseFrame.cabecalho.ball, "BOTTOMRIGHT", 0, 20) + consolidateFrame:SetFrameLevel (baseframe:GetFrameLevel()-1) + --consolidateFrame:SetPoint ("bottomleft", baseframe.cabecalho.ball, "bottomright", 0, 20) consolidateFrame:SetFrameStrata ("FULLSCREEN") consolidateFrame:Hide() instancia.consolidateFrame = consolidateFrame @@ -3809,7 +4806,7 @@ function gump:CriaCabecalho (BaseFrame, instancia) ---------> consolidate texture local frameTexture = consolidateFrame:CreateTexture (nil, "background") - frameTexture:SetTexture ("Interface\\AddOns\\Details\\images\\consolidate_frame") + frameTexture:SetTexture ([[Interface\AddOns\Details\images\consolidate_frame]]) frameTexture:SetPoint ("top", consolidateFrame, "top", .5, 0) frameTexture:SetWidth (32) frameTexture:SetHeight (83) @@ -3817,18 +4814,16 @@ function gump:CriaCabecalho (BaseFrame, instancia) ---------> consolidate button - local consolidateButton = CreateFrame ("button", nil, BaseFrame) + local consolidateButton = CreateFrame ("button", nil, baseframe) consolidateButton:SetWidth (16) consolidateButton:SetHeight (16) - consolidateButton:SetFrameLevel (BaseFrame.UPFrame:GetFrameLevel()+1) - consolidateButton:SetPoint ("BOTTOMLEFT", BaseFrame.cabecalho.ball, "BOTTOMRIGHT", 6, 2) + consolidateButton:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1) + consolidateButton:SetPoint ("bottomleft", baseframe.cabecalho.ball, "bottomright", 6, 2) + consolidateFrame:SetPoint ("bottom", consolidateButton, "top", 3, 0) local normal_texture = consolidateButton:CreateTexture (nil, "overlay") - --normal_texture:SetTexture ("Interface\\AddOns\\Details\\images\\consolidate_frame") - normal_texture:SetTexture ("Interface\\GossipFrame\\HealerGossipIcon") + normal_texture:SetTexture ([[Interface\GossipFrame\HealerGossipIcon]]) normal_texture:SetVertexColor (.9, .8, 0) - --normal_texture:SetTexCoord (0, .5, 0.875, 1) - --normal_texture:SetTexCoord (0, 0.375, 0.75, 0.875) normal_texture:SetWidth (16) normal_texture:SetHeight (16) normal_texture:SetPoint ("center", consolidateButton, "center") @@ -3850,9 +4845,8 @@ function gump:CriaCabecalho (BaseFrame, instancia) self:SetScript ("OnUpdate", function (self, elapsed) passou = passou+elapsed if (passou > 0.5) then - if (not _detalhes.popup.active and not BaseFrame.cabecalho.button_mouse_over) then + if (not _G.GameCooltip.active and not baseframe.cabecalho.button_mouse_over) then consolidateFrame:Hide() - --normal_texture:SetTexCoord (0, .5, 0.875, 1) normal_texture:SetBlendMode ("BLEND") self:SetScript ("OnUpdate", nil) end @@ -3862,14 +4856,14 @@ function gump:CriaCabecalho (BaseFrame, instancia) end) consolidateButton:SetScript ("OnEnter", function (self) - gump:Fade (BaseFrame.button_stretch, "alpha", 0.3) + gump:Fade (baseframe.button_stretch, "alpha", 0.3) local passou = 0 consolidateFrame:SetScript ("OnUpdate", nil) - --normal_texture:SetTexCoord (.5, 1, 0.875, 1) normal_texture:SetBlendMode ("ADD") self:SetScript ("OnUpdate", function (self, elapsed) passou = passou+elapsed if (passou > 0.3) then + consolidateFrame:SetPoint ("bottom", self, "top", 3, 0) consolidateFrame:Show() self:SetScript ("OnUpdate", nil) end @@ -3877,15 +4871,14 @@ function gump:CriaCabecalho (BaseFrame, instancia) end) consolidateButton:SetScript ("OnLeave", function (self) - gump:Fade (BaseFrame.button_stretch, -1) + gump:Fade (baseframe.button_stretch, -1) local passou = 0 self:SetScript ("OnUpdate", function (self, elapsed) passou = passou+elapsed if (passou > 0.3) then - if (not consolidateFrame.mouse_over and not BaseFrame.cabecalho.button_mouse_over and not _detalhes.popup.active) then + if (not consolidateFrame.mouse_over and not baseframe.cabecalho.button_mouse_over and not _G.GameCooltip.active) then consolidateFrame:Hide() normal_texture:SetBlendMode ("BLEND") - --normal_texture:SetTexCoord (0, .5, 0.875, 1) end self:SetScript ("OnUpdate", nil) end diff --git a/images/icons.tga b/images/icons.tga index 0634c4e3..e654f7cf 100644 Binary files a/images/icons.tga and b/images/icons.tga differ diff --git a/images/skins/default_skin.tga b/images/skins/default_skin.tga index 4bf512e4..b3f8bb34 100644 Binary files a/images/skins/default_skin.tga and b/images/skins/default_skin.tga differ diff --git a/images/skins/flat_skin.tga b/images/skins/flat_skin.tga index d5a78666..0521e1fc 100644 Binary files a/images/skins/flat_skin.tga and b/images/skins/flat_skin.tga differ diff --git a/images/skins/simplygray_skin.tga b/images/skins/simplygray_skin.tga index d291b44c..30c15afc 100644 Binary files a/images/skins/simplygray_skin.tga and b/images/skins/simplygray_skin.tga differ diff --git a/locales/Details-enUS.lua b/locales/Details-enUS.lua index 358cb5f6..b8f832a9 100644 --- a/locales/Details-enUS.lua +++ b/locales/Details-enUS.lua @@ -4,13 +4,22 @@ if not Loc then return end -------------------------------------------------------------------------------------------------------------------------------------------- -- \n\n|cFFFFFF00-|r - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.8.4|r\n\n|cFFFFFF00-|r Added slash command 'details reinstall' which cleans Details! config in case of erros.\n\n|cFFFFFF00v1.8.3|r\n\n|cFFFFFF00-|r Added new skin: Simple Gray.\n\n|cFFFFFF00-|r Added minimap and interface addon panel buttons.\n\n|cFFFFFF00-|r Added new tutorials bubbles for basic aspects of Details! window.\n\n|cFFFFFF00-|r Fixed a issue with Panic Mode where sometimes his isnt triggered.\n\n|cFFFFFF00v1.8.0|r\n\n|cFFFFFF00-|r Added a new plugin: You Are Not Prepared.\n\n|cFFFFFF00-|r New options panel!\n\n|cFFFFFF00v1.7.0|r\n\n- Fixed some colors issues with enimies bars.\n\n|cFFFFFF00-|r Fixed some phrases which isn't still not translated to enUS.\n\n|cFFFFFF00-|r Major rewrite on CC-Breaks, now it's working properly.\n\n|cFFFFFF00-|r Added new sub attribute for damage: Voidzones & Debuffs.|cFFFFFF00v1.6.7|r\n\n- Added support to skins, you can change over options panel.\n\n|cFFFFFF00v1.6.5|r\n\n|cFFFFFF00-|r Added sub attribute 'Enemies' which shows, of course, only enemies.\n\n|cFFFFFF00-|r Fixed issue with successful spell cast.\n\n|cFFFFFF00v1.6.3|r\n\n|cFFFFFF00-|r data capture now runs 4% faster.\n\n|cFFFFFF00-|r Fixed issue with pets were wasn't uptading owner activity time.\n\n|cFFFFFF00-|r Fixed healing being counted even out of combat.\n\n|cFFFFFF00-|r Fixed some problems with multi-boss encountes like Twin Consorts.\n\n|cFFFFFF00-|r Added options for concatenate trash segments.\n\n|cFFFFFF00-|r Added options for auto remove trash segments. \n\n|cFFFFFF00-|r Added options for change bar height. \n\n|cFFFFFF00-|r Encounter Details now display how many interrupted and successful cast of a boss skill.\n\n|cFFFFFF00v1.6.1|r\n\n|cFFFFFF00-|r Fixed:\n- a issue with debuff uptime.\n- overall data dps and hps for overall data on micro display.\n- many bugs involving sword and book menus.\n- garbage collector erasing actors with interactions with your group members.\n\n|cFFFFFF00-|r overall data now always use the combat data for measure dps and hps.\n\n|cFFFFFF00v1.6.0|r\n\n|cFFFFFF00-|r Added debuff uptime at misc attribute.\n\n|cFFFFFF00-|r Disabled attributes now have a darkness effect over sword menu.\n\n|cFFFFFF00-|r Fixed a issue were sometimes you need to /reload before change a talent.\n\n|cFFFFFF00v1.5.3|r\n\n|cFFFFFF00-|r Fixed a issue with report data during combat lockdown.\n\n|cFFFFFF00-|r Improved pet owner recognition and added a ignore list if couldn't find his owner.\n\n|cFFFFFF00-|r Added an option to display only frags on enemy players.\n\n|cFFFFFF00-|r Added class colors for frags.\n\n|cFFFFFF00v1.5.2|r\n\n|cFFFFFF00-|r Fixed a issue were turning off buff uptime was disabling healing done too.\n\n|cFFFFFF00-|r Avoidance statistics will not be recorded for pets, ungrouped players and monsters.\n\n|cFFFFFF00-|r Fixed a issue were sometimes buff uptime was taking too long to save data on logout.\n\n|cFFFFFF00v1.5.1|r\n\n|cFFFFFF00-|r Fixed a issue with report data were sometimes wasn't working.\n\n|cFFFFFF00v1.5.0|r" + + + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.9.0|r\n\n|cFFFFFF00-|r Fixed minimap icon stuck problem.\n\n|cFFFFFF00-|r Skin support has been rewrite and now is more flexibe.\n\n|cFFFFFF00-|r Added up to 20 new customization options over options panel.\n\n|cFFFFFF00v1.8.4|r\n\n|cFFFFFF00-|r Added slash command 'details reinstall' which cleans Details! config in case of erros.\n\n|cFFFFFF00v1.8.3|r\n\n|cFFFFFF00-|r Added new skin: Simple Gray.\n\n|cFFFFFF00-|r Added minimap and interface addon panel buttons.\n\n|cFFFFFF00-|r Added new tutorials bubbles for basic aspects of Details! window.\n\n|cFFFFFF00-|r Fixed a issue with Panic Mode where sometimes his isnt triggered.\n\n|cFFFFFF00v1.8.0|r\n\n|cFFFFFF00-|r Added a new plugin: You Are Not Prepared.\n\n|cFFFFFF00-|r New options panel!\n\n|cFFFFFF00v1.7.0|r\n\n- Fixed some colors issues with enimies bars.\n\n|cFFFFFF00-|r Fixed some phrases which isn't still not translated to enUS.\n\n|cFFFFFF00-|r Major rewrite on CC-Breaks, now it's working properly.\n\n|cFFFFFF00-|r Added new sub attribute for damage: Voidzones & Debuffs.|cFFFFFF00v1.6.7|r\n\n- Added support to skins, you can change over options panel.\n\n|cFFFFFF00v1.6.5|r\n\n|cFFFFFF00-|r Added sub attribute 'Enemies' which shows, of course, only enemies.\n\n|cFFFFFF00-|r Fixed issue with successful spell cast.\n\n|cFFFFFF00v1.6.3|r\n\n|cFFFFFF00-|r data capture now runs 4% faster.\n\n|cFFFFFF00-|r Fixed issue with pets were wasn't uptading owner activity time.\n\n|cFFFFFF00-|r Fixed healing being counted even out of combat.\n\n|cFFFFFF00-|r Fixed some problems with multi-boss encountes like Twin Consorts.\n\n|cFFFFFF00-|r Added options for concatenate trash segments.\n\n|cFFFFFF00-|r Added options for auto remove trash segments. \n\n|cFFFFFF00-|r Added options for change bar height. \n\n|cFFFFFF00-|r Encounter Details now display how many interrupted and successful cast of a boss skill.\n\n|cFFFFFF00v1.6.1|r\n\n|cFFFFFF00-|r Fixed:\n- a issue with debuff uptime.\n- overall data dps and hps for overall data on micro display.\n- many bugs involving sword and book menus.\n- garbage collector erasing actors with interactions with your group members.\n\n|cFFFFFF00-|r overall data now always use the combat data for measure dps and hps.\n\n|cFFFFFF00v1.6.0|r\n\n|cFFFFFF00-|r Added debuff uptime at misc attribute.\n\n|cFFFFFF00-|r Disabled attributes now have a darkness effect over sword menu.\n\n|cFFFFFF00-|r Fixed a issue were sometimes you need to /reload before change a talent.\n\n|cFFFFFF00v1.5.3|r\n\n|cFFFFFF00-|r Fixed a issue with report data during combat lockdown.\n\n|cFFFFFF00-|r Improved pet owner recognition and added a ignore list if couldn't find his owner.\n\n|cFFFFFF00-|r Added an option to display only frags on enemy players.\n\n|cFFFFFF00-|r Added class colors for frags." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails:|r " --> color and details name Loc ["STRING_YES"] = "Yes" Loc ["STRING_NO"] = "No" + Loc ["STRING_TOP"] = "top" + Loc ["STRING_BOTTOM"] = "bottom" + Loc ["STRING_AUTO"] = "auto" + Loc ["STRING_LEFT"] = "left" + Loc ["STRING_CENTER"] = "center" + Loc ["STRING_RIGHT"] = "right" + Loc ["STRING_MINIMAP_TOOLTIP1"] = "|cFFCFCFCFleft click|r: open options panel" Loc ["STRING_MINIMAP_TOOLTIP2"] = "|cFFCFCFCFright click|r: quick menu" @@ -21,19 +30,18 @@ if not Loc then return end Loc ["STRING_MINIMAPMENU_UNLOCK"] = "Unlock" Loc ["STRING_MINIMAPMENU_LOCK"] = "Lock" + Loc ["STRING_RESETBUTTON_WRONG_INSTANCE"] = "Warning, reset button isn't in the current editing instance." + Loc ["STRING_INTERFACE_OPENOPTIONS"] = "Open Options Panel" Loc ["STRING_RIGHTCLICK_TYPEVALUE"] = "right click to type the value" - Loc ["STRING_AUTO"] = "auto" - Loc ["STRING_LEFT"] = "left" - Loc ["STRING_CENTER"] = "center" - Loc ["STRING_RIGHT"] = "right" Loc ["STRING_TOOOLD"] = "could not be installed because your Details! version is too old." Loc ["STRING_TOOOLD2"] = "your Details! version isn't the same." Loc ["STRING_CHANGED_TO_CURRENT"] = "Segment changed to current" Loc ["STRING_SEGMENT_TRASH"] = "Next Boss Cleanup" Loc ["STRING_VERSION_UPDATE"] = "new version: what's changed? click here" Loc ["STRING_NEWS_TITLE"] = "What's New In This Version" + Loc ["STRING_NEWS_REINSTALL"] = "Found problems after a update? try '/details reinstall' command." Loc ["STRING_TIME_OF_DEATH"] = "Death" Loc ["STRING_SHORTCUT_RIGHTCLICK"] = "Shortcut Menu (right click to close)" @@ -408,6 +416,8 @@ if not Loc then return end Loc ["STRING_OPTIONS_MAXINSTANCES_DESC"] = "Limit the number of Details! instances which can be created.\n\nYou can open and re-open instances clicking on the instance button |cFFFFFFFF#X|r." Loc ["STRING_OPTIONS_PVPFRAGS"] = "Only Pvp Frags" Loc ["STRING_OPTIONS_PVPFRAGS_DESC"] = "When enabled, only kills against enemy players will be count." + Loc ["STRING_OPTIONS_MINIMAP"] = "Minimap Icon" + Loc ["STRING_OPTIONS_MINIMAP_DESC"] = "Show or Hide minimap icon." Loc ["STRING_OPTIONS_TIMEMEASURE"] = "Time Measure" Loc ["STRING_OPTIONS_TIMEMEASURE_DESC"] = "|cFFFFFFFFActivity|r: the timer of each raid member is put on hold if his activity is ceased and back again to count when is resumed, common way of mensure Dps and Hps.\n\n|cFFFFFFFFEffective|r: used on rankings, this method uses the elapsed combat time for mensure the Dps and Hps of all raid members." @@ -454,14 +464,13 @@ if not Loc then return end Loc ["STRING_OPTIONS_CLOUD"] = "Cloud Capture" Loc ["STRING_OPTIONS_CLOUD_DESC"] = "When enabled, the data of disabled collectors are collected within others raid members." - - Loc ["STRING_OPTIONS_BARS"] = "Bar Settings" + Loc ["STRING_OPTIONS_BARS"] = "Bar General Settings" Loc ["STRING_OPTIONS_BARS_DESC"] = "This options control the appearance of the instance bars." Loc ["STRING_OPTIONS_BAR_TEXTURE"] = "Texture" Loc ["STRING_OPTIONS_BAR_TEXTURE_DESC"] = "Choose the texture of bars." - Loc ["STRING_OPTIONS_BAR_BTEXTURE"] = "Background Texture" + Loc ["STRING_OPTIONS_BAR_BTEXTURE"] = "Texture (bg)" Loc ["STRING_OPTIONS_BAR_BTEXTURE_DESC"] = "Choose the background texture of bars." Loc ["STRING_OPTIONS_BAR_BCOLOR"] = "Background Color" @@ -471,12 +480,12 @@ if not Loc then return end Loc ["STRING_OPTIONS_BAR_HEIGHT_DESC"] = "Change the height of bars." Loc ["STRING_OPTIONS_BAR_COLORBYCLASS"] = "Color By Class" - Loc ["STRING_OPTIONS_BAR_COLORBYCLASS_DESC"] = "When enabled, the instance bars have the color of the character class.\n\nDisabled: bars have a fixed color." + Loc ["STRING_OPTIONS_BAR_COLORBYCLASS_DESC"] = "When enabled, the instance bars have the color of the character class.\n\nIf disabled, the color chosen on the right box will be used." - Loc ["STRING_OPTIONS_BAR_COLORBYCLASS2"] = "Background Color By Class" - Loc ["STRING_OPTIONS_BAR_COLORBYCLASS2_DESC"] = "When enabled, the instance bars background have the color of the character class.\n\nDisabled: bars have a fixed color." + Loc ["STRING_OPTIONS_BAR_COLORBYCLASS2"] = "Color By Class (bg)" + Loc ["STRING_OPTIONS_BAR_COLORBYCLASS2_DESC"] = "When enabled, the instance bars background have the color of the character class.\n\nIf disabled, the color chosen on the right box will be used." -- - Loc ["STRING_OPTIONS_TEXT"] = "Text Settings" + Loc ["STRING_OPTIONS_TEXT"] = "Bar Text Settings" Loc ["STRING_OPTIONS_TEXT_DESC"] = "This options control the appearance of the instance bar texts." Loc ["STRING_OPTIONS_TEXT_SIZE"] = "Size" @@ -500,17 +509,94 @@ if not Loc then return end Loc ["STRING_OPTIONS_INSTANCE"] = "Instance Settings" Loc ["STRING_OPTIONS_INSTANCE_DESC"] = "This options control the appearance of the instance it self." - Loc ["STRING_OPTIONS_INSTANCE_COLOR"] = "Color" - Loc ["STRING_OPTIONS_INSTANCE_COLOR_DESC"] = "Change the color of instance window." + Loc ["STRING_OPTIONS_INSTANCE_COLOR"] = "Color and Transparency" + Loc ["STRING_OPTIONS_INSTANCE_COLOR_DESC"] = "Change the color and alpha of instance window." - Loc ["STRING_OPTIONS_INSTANCE_ALPHA"] = "Alpha" - Loc ["STRING_OPTIONS_INSTANCE_ALPHA_DESC"] = "This option let you change the color and transparency of instance window background." + Loc ["STRING_OPTIONS_INSTANCE_ALPHA"] = "Background Alpha" + Loc ["STRING_OPTIONS_INSTANCE_ALPHA_DESC"] = "This option let you change the transparency of the instance window background." + Loc ["STRING_OPTIONS_INSTANCE_ALPHA2"] = "Background Color" + Loc ["STRING_OPTIONS_INSTANCE_ALPHA2_DESC"] = "This option let you change the color of the instance window background." Loc ["STRING_OPTIONS_INSTANCE_CURRENT"] = "Auto Switch To Current" Loc ["STRING_OPTIONS_INSTANCE_CURRENT_DESC"] = "Whenever a combat start and there is no other instance on current segment, this instance auto switch to current segment." + Loc ["STRING_OPTIONS_SHOW_SIDEBARS"] = "Show Borders" + Loc ["STRING_OPTIONS_SHOW_SIDEBARS_DESC"] = "Show or hide window borders." + + Loc ["STRING_OPTIONS_SHOW_STATUSBAR"] = "Show Statusbar" + Loc ["STRING_OPTIONS_SHOW_STATUSBAR_DESC"] = "Show or hide the bottom statusbar." + Loc ["STRING_OPTIONS_INSTANCE_SKIN"] = "Skin" - Loc ["STRING_OPTIONS_INSTANCE_SKIN_DESC"] = "Modify all window textures based on a skin theme." + Loc ["STRING_OPTIONS_INSTANCE_SKIN_DESC"] = "Modify window appearance based on a skin theme." + +Loc ["STRING_OPTIONS_SKIN_A"] = "Skin Settings" +Loc ["STRING_OPTIONS_SKIN_A_DESC"] = "This options allows you to change the skin." + +Loc ["STRING_OPTIONS_TOOLBAR_SETTINGS"] = "Toolbar Settings" +Loc ["STRING_OPTIONS_TOOLBAR_SETTINGS_DESC"] = "This options change the main menu on the top of the window." + +Loc ["STRING_OPTIONS_DESATURATE_MENU"] = "Desaturate Menu" +Loc ["STRING_OPTIONS_DESATURATE_MENU_DESC"] = "Enabling this option, all menu icons on toolbar became black and white." + +Loc ["STRING_OPTIONS_HIDE_ICON"] = "Hide Icon" +Loc ["STRING_OPTIONS_HIDE_ICON_DESC"] = "When enabled, the icon on the top left corner isn't draw.\n\nSome skins may prefer remove this icon." + +Loc ["STRING_OPTIONS_MENU_X"] = "Menu Pos X" +Loc ["STRING_OPTIONS_MENU_X_DESC"] = "Slightly move the main menu on tooltip to the left or right direction." + +Loc ["STRING_OPTIONS_MENU_Y"] = "Menu Pos Y" +Loc ["STRING_OPTIONS_MENU_Y_DESC"] = "Slightly move the main menu on tooltip to the up or down direction." + +Loc ["STRING_OPTIONS_RESET_TEXTCOLOR"] = "Reset Text Color" +Loc ["STRING_OPTIONS_RESET_TEXTCOLOR_DESC"] = "Modify the reset button text color.\n\nOnly applied when reset button is hosted by this instance." + +Loc ["STRING_OPTIONS_RESET_TEXTFONT"] = "Reset Text Font" +Loc ["STRING_OPTIONS_RESET_TEXTFONT_DESC"] = "Modify the reset button text font.\n\nOnly applied when reset button is hosted by this instance." + +Loc ["STRING_OPTIONS_RESET_TEXTSIZE"] = "Reset Text Size" +Loc ["STRING_OPTIONS_RESET_TEXTSIZE_DESC"] = "Modify the reset button text size.\n\nOnly applied when reset button is hosted by this instance." + +Loc ["STRING_OPTIONS_RESET_OVERLAY"] = "Reset Overlay Color" +Loc ["STRING_OPTIONS_RESET_OVERLAY_DESC"] = "Modify the reset button overlay color.\n\nOnly applied when reset button is hosted by this instance." + +Loc ["STRING_OPTIONS_RESET_SMALL"] = "Reset Always Small" +Loc ["STRING_OPTIONS_RESET_SMALL_DESC"] = "When enabled, reset button always shown as his smaller size.\n\nOnly applied when reset button is hosted by this instance." + +Loc ["STRING_OPTIONS_INSTANCE_TEXTCOLOR"] = "Instance Text Color" +Loc ["STRING_OPTIONS_INSTANCE_TEXTCOLOR_DESC"] = "Change the instance button text color." + +Loc ["STRING_OPTIONS_INSTANCE_TEXTFONT"] = "Instance Text Font" +Loc ["STRING_OPTIONS_INSTANCE_TEXTFONT_DESC"] = "Change the instance button text font." + +Loc ["STRING_OPTIONS_INSTANCE_TEXTSIZE"] = "Instance Text Size" +Loc ["STRING_OPTIONS_INSTANCE_TEXTSIZE_DESC"] = "Change the instance button text size." + +Loc ["STRING_OPTIONS_INSTANCE_OVERLAY"] = "Instance Overlay Color" +Loc ["STRING_OPTIONS_INSTANCE_OVERLAY_DESC"] = "Change the instance button overlay color." + +Loc ["STRING_OPTIONS_CLOSE_OVERLAY"] = "Close Overlay Color" +Loc ["STRING_OPTIONS_CLOSE_OVERLAY_DESC"] = "Change the close button overlay color." + +Loc ["STRING_OPTIONS_STRETCH"] = "Stretch Button Anchor" +Loc ["STRING_OPTIONS_STRETCH_DESC"] = "Alternate the stretch button position.\n\nTop: the grab is placed on the top right corner.\n\nBottom: the grab is placed on the bottom center." + +Loc ["STRING_OPTIONS_PICONS_DIRECTION"] = "Plugin Icons Direction" +Loc ["STRING_OPTIONS_PICONS_DIRECTION_DESC"] = "Change the direction which plugins icons are displayed on the toolbar." + +Loc ["STRING_OPTIONS_INSBUTTON_X"] = "Instance Button X" +Loc ["STRING_OPTIONS_INSBUTTON_X_DESC"] = "Change the instance button position." + +Loc ["STRING_OPTIONS_INSBUTTON_Y"] = "Instance Button Y" +Loc ["STRING_OPTIONS_INSBUTTON_Y_DESC"] = "Change the instance button position." + +Loc ["STRING_OPTIONS_TOOLBARSIDE"] = "Toolbar Anchor" +Loc ["STRING_OPTIONS_TOOLBARSIDE_DESC"] = "Place the toolbar on the top or bottom side of window." + +Loc ["STRING_OPTIONS_BARGROW_DIRECTION"] = "Bar Grow Direction" +Loc ["STRING_OPTIONS_BARGROW_DIRECTION_DESC"] = "Change the bars grow method.." + +Loc ["STRING_OPTIONS_BARSORT_DIRECTION"] = "Bar Sort Direction" +Loc ["STRING_OPTIONS_BARSORT_DIRECTION_DESC"] = "Change the order which characters are shown within the bars." Loc ["STRING_OPTIONS_WP"] = "Wallpaper Settings" Loc ["STRING_OPTIONS_WP_DESC"] = "This options control the wallpaper of instance." diff --git a/locales/Details-ptBR.lua b/locales/Details-ptBR.lua index 9db58395..1d3a7bc0 100644 --- a/locales/Details-ptBR.lua +++ b/locales/Details-ptBR.lua @@ -2,13 +2,21 @@ local Loc = LibStub("AceLocale-3.0"):NewLocale("Details", "ptBR") if not Loc then return end -------------------------------------------------------------------------------------------------------------------------------------------- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.8.4|r\n\n|cFFFFFF00-|r Adicionado comando 'details reinstalar' no qual limpa a configuracao do Details! em caso de erros.\n\n|cFFFFFF00v1.8.3|r\n\n|cFFFFFF00-|r Adicionada nova skin: Simple Gray.\n\n|cFFFFFF00-|r Adicionado botoes para o Details! no minimapa e menu de addons no painel de intercace.\n\n|cFFFFFF00-|r Adicionados novas bolhas de tutoriais para aspectos basicos das janelas do Details!.\n\n|cFFFFFF00-|r Corrigido o Modo Panico aonde as vezes ele nao era disparado.\n\n|cFFFFFF00v1.8.0|r\n\n- Adicionado novo plugin: You Are Not Prepared.\n\n|cFFFFFF00-|r Novo painel de opcoes!\n\n|cFFFFFF00v1.7.0|r\n\n- Corrigido alguns problemas com as cores das barras de inimigos.\n\n|cFFFFFF00-|r CC Quebrado foi inteiramente reescrito e agora deve funcionar corretamente.\n\n|cFFFFFF00-|r Adicionado novo sub atributo ao dano: Voidzones & Debuffs.|cFFFFFF00v1.6.7|r\n\n- Adicionado suporte a skins, troque ela atraves do painel de opcoes.\n\n|cFFFFFF00v1.6.5|r\n\n|cFFFFFF00-|r Adicionado o sub atributo 'Inimigos' que mostra, eh claro, somente inimigos.\n\n|cFFFFFF00-|r Corrigido um problema na captura das magias conjuradas.|cFFFFFF00v1.6.3|r\n\n|cFFFFFF00-|r captura de dados agora roda 4% mais rapido.\n\n|cFFFFFF00-|r Corrigido problema onde os ajudantes nao atualizavam o tempo de atividade do dono.\n\n|cFFFFFF00-|r Corrigido problema onde o healing era contado mesmo fora do combate.\n\n|cFFFFFF00-|r Corrigido problema com chefes multiplos como Twin Consorts.\n\n|cFFFFFF00-|r Adicionada opcao para juntar os segmentos de trash mobs.\n\n|cFFFFFF00-|r Adicionada opcao para auto remover os segmentos de trash mobs. \n\n|cFFFFFF00-|r Adicionada opcao para alterar a altura das barras.\n\n|cFFFFFF00-|r Plugin Encounter Details agora mostra quantos cast bem sucedidos as magias interrompidas tiveram.\n\n|cFFFFFF00v1.6.1|r\n\n|cFFFFFF00-|r Corrigido:\n- problema com o tempo de debuffs.\n- dps dos dados gerais e o dps no micro display .\n- varios bugs envolvendo o menu da espada e do livro.\n- o coletor de lixo nao ira mais apagar jogadores com vinculo a membros do grupo.\n\n|cFFFFFF00-|r dados gerais agora sempre ira usar o tempo do combate para medir dps e hps.\n\n|cFFFFFF00v1.6.0|r\n\n|cFFFFFF00-|r Adicionado tempo de debuff no atributo miscelanea.\n\n|cFFFFFF00-|r Atributos desativados agora ficam escurecidos no menu da espada.\n\n|cFFFFFF00-|r Corrigido um problema aonde algumas vezes era necessario dar /reload para trocar um talento.\n\n|cFFFFFF00v1.5.3|r\n\n|cFFFFFF00-|r Corrigido problema ao reportar durante o combate.\n\n|cFFFFFF00-|r Melhorado a reconhecimento dos donos de ajudantes.\n\n|cFFFFFF00-|r Adicionada uma opcao para mostrar apenas frags em cima de jogadores inimigos.\n\n|cFFFFFF00-|r Adicionado cor e icone aos frags.\n\n|cFFFFFF00v1.5.2|r\n\n|cFFFFFF00-|r Corrigido problema onde desativando o tempo dos buffs estava desativando tambem a cura feita.\n\n|cFFFFFF00-|r Estatisticas de Avoidance nao seram mais capturadas para pessoas foram do grupo, monstros ou ajudantes.\n\n|cFFFFFF00-|r Corrigido problema onde as vezes estava demorando muito para salvar o tempo dos buffs ao sair do jogo.\n\n|cFFFFFF00v1.5.1|r\n\n|cFFFFFF00-|r Corrigido problema ao reportar o Dps onde as vezes nao mostrava nenhum jogador.\n\n|cFFFFFF00v1.5.0|r\n\n" + + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.9.0|r\n\n|cFFFFFF00-|r Corrigido o problema de nao movimentar o botao no minimapa.\n\n|cFFFFFF00-|r Suporte a skins foi reescrito e agora ficou mais flexivel.\n\n|cFFFFFF00-|r Adicionadas mais de 20 opcoes de customizacao no painel de opcoes.\n\n|cFFFFFF00v1.8.4|r\n\n|cFFFFFF00-|r Adicionado comando 'details reinstalar' no qual limpa a configuracao do Details! em caso de erros.\n\n|cFFFFFF00v1.8.3|r\n\n|cFFFFFF00-|r Adicionada nova skin: Simple Gray.\n\n|cFFFFFF00-|r Adicionado botoes para o Details! no minimapa e menu de addons no painel de intercace.\n\n|cFFFFFF00-|r Adicionados novas bolhas de tutoriais para aspectos basicos das janelas do Details!.\n\n|cFFFFFF00-|r Corrigido o Modo Panico aonde as vezes ele nao era disparado.\n\n|cFFFFFF00v1.8.0|r\n\n- Adicionado novo plugin: You Are Not Prepared.\n\n|cFFFFFF00-|r Novo painel de opcoes!\n\n|cFFFFFF00v1.7.0|r\n\n- Corrigido alguns problemas com as cores das barras de inimigos.\n\n|cFFFFFF00-|r CC Quebrado foi inteiramente reescrito e agora deve funcionar corretamente.\n\n|cFFFFFF00-|r Adicionado novo sub atributo ao dano: Voidzones & Debuffs.|cFFFFFF00v1.6.7|r\n\n- Adicionado suporte a skins, troque ela atraves do painel de opcoes.\n\n|cFFFFFF00v1.6.5|r\n\n|cFFFFFF00-|r Adicionado o sub atributo 'Inimigos' que mostra, eh claro, somente inimigos.\n\n|cFFFFFF00-|r Corrigido um problema na captura das magias conjuradas.|cFFFFFF00v1.6.3|r\n\n|cFFFFFF00-|r captura de dados agora roda 4% mais rapido.\n\n|cFFFFFF00-|r Corrigido problema onde os ajudantes nao atualizavam o tempo de atividade do dono.\n\n|cFFFFFF00-|r Corrigido problema onde o healing era contado mesmo fora do combate.\n\n|cFFFFFF00-|r Corrigido problema com chefes multiplos como Twin Consorts.\n\n|cFFFFFF00-|r Adicionada opcao para juntar os segmentos de trash mobs.\n\n|cFFFFFF00-|r Adicionada opcao para auto remover os segmentos de trash mobs. \n\n|cFFFFFF00-|r Adicionada opcao para alterar a altura das barras.\n\n|cFFFFFF00-|r Plugin Encounter Details agora mostra quantos cast bem sucedidos as magias interrompidas tiveram.\n\n|cFFFFFF00v1.6.1|r\n\n|cFFFFFF00-|r Corrigido:\n- problema com o tempo de debuffs.\n- dps dos dados gerais e o dps no micro display .\n- varios bugs envolvendo o menu da espada e do livro.\n- o coletor de lixo nao ira mais apagar jogadores com vinculo a membros do grupo.\n\n|cFFFFFF00-|r dados gerais agora sempre ira usar o tempo do combate para medir dps e hps.\n\n|cFFFFFF00v1.6.0|r\n\n|cFFFFFF00-|r Adicionado tempo de debuff no atributo miscelanea.\n\n|cFFFFFF00-|r Atributos desativados agora ficam escurecidos no menu da espada.\n\n|cFFFFFF00-|r Corrigido um problema aonde algumas vezes era necessario dar /reload para trocar um talento.\n\n|cFFFFFF00v1.5.3|r\n\n|cFFFFFF00-|r Corrigido problema ao reportar durante o combate.\n\n|cFFFFFF00-|r Melhorado a reconhecimento dos donos de ajudantes.\n\n|cFFFFFF00-|r Adicionada uma opcao para mostrar apenas frags em cima de jogadores inimigos.\n\n|cFFFFFF00-|r Adicionado cor e icone aos frags.\n\n|cFFFFFF00v1.5.2|r\n\n|cFFFFFF00-|r Corrigido problema onde desativando o tempo dos buffs estava desativando tambem a cura feita.\n\n|cFFFFFF00-|r Estatisticas de Avoidance nao seram mais capturadas para pessoas foram do grupo, monstros ou ajudantes.\n\n|cFFFFFF00-|r Corrigido problema onde as vezes estava demorando muito para salvar o tempo dos buffs ao sair do jogo.\n\n|cFFFFFF00v1.5.1|r\n\n|cFFFFFF00-|r Corrigido problema ao reportar o Dps onde as vezes nao mostrava nenhum jogador.\n\n|cFFFFFF00v1.5.0|r\n\n" Loc ["STRING_DETAILS1"] = "|cffffaeaeDetalhes:|r " --> color and details name Loc ["STRING_YES"] = "Sim" Loc ["STRING_NO"] = "Nao" + Loc ["STRING_TOP"] = "topo" + Loc ["STRING_BOTTOM"] = "baixo" + Loc ["STRING_AUTO"] = "auto" + Loc ["STRING_LEFT"] = "esquerda" + Loc ["STRING_CENTER"] = "centro" + Loc ["STRING_RIGHT"] = "direita" + Loc ["STRING_MINIMAP_TOOLTIP1"] = "|cFFCFCFCFbotao esquerdo|r: abrir o painel de opcoes" Loc ["STRING_MINIMAP_TOOLTIP2"] = "|cFFCFCFCFbotao direito|r: menu rapido" @@ -19,19 +27,18 @@ if not Loc then return end Loc ["STRING_MINIMAPMENU_UNLOCK"] = "Destravar" Loc ["STRING_MINIMAPMENU_LOCK"] = "Travar" + Loc ["STRING_RESETBUTTON_WRONG_INSTANCE"] = "Aviso, o botao de reset nao esta na janela que esta sendo editada." + Loc ["STRING_INTERFACE_OPENOPTIONS"] = "Abrir Painel de Opcoes" Loc ["STRING_RIGHTCLICK_TYPEVALUE"] = "botao direito para digitar o valor" - Loc ["STRING_AUTO"] = "auto" - Loc ["STRING_LEFT"] = "esquerda" - Loc ["STRING_CENTER"] = "centro" - Loc ["STRING_RIGHT"] = "direita" Loc ["STRING_TOOOLD"] = "nao pode ser instalado pois sua versao do Details! e muito antiga." Loc ["STRING_TOOOLD2"] = "a sua versao do Details! nao e a mesma." Loc ["STRING_CHANGED_TO_CURRENT"] = "Segmento trocado para atual" Loc ["STRING_SEGMENT_TRASH"] = "Caminho do Proximo Boss" Loc ["STRING_VERSION_UPDATE"] = "nova versao: clique para ver o que mudou" Loc ["STRING_NEWS_TITLE"] = "Quais As Novidades Desta Versao" + Loc ["STRING_NEWS_REINSTALL"] = "Encontrou problemas apos atualizar? tente o comando '/details reinstall'." Loc ["STRING_TIME_OF_DEATH"] = "Morreu" Loc ["STRING_SHORTCUT_RIGHTCLICK"] = "Menu de Atalho (botao direito para fechar)" @@ -401,6 +408,8 @@ if not Loc then return end Loc ["STRING_OPTIONS_MAXINSTANCES_DESC"] = "Limita o numero de janelas que podem ser criadas.\n\nVoce pode abrir ou reabrir as janelas atraves do botao de instancia localizado a esquerda do botao de fechar." Loc ["STRING_OPTIONS_PVPFRAGS"] = "Apenas Frags de Pvp" Loc ["STRING_OPTIONS_PVPFRAGS_DESC"] = "Quando ativado, serao registrados apenas mortes de jogadores da faccao inimiga." + Loc ["STRING_OPTIONS_MINIMAP"] = "Icone no Mini Mapa" + Loc ["STRING_OPTIONS_MINIMAP_DESC"] = "Mostra ou esconde o icone no mini mapa." Loc ["STRING_OPTIONS_TIMEMEASURE"] = "Medidas do Tempo" Loc ["STRING_OPTIONS_TIMEMEASURE_DESC"] = "|cFFFFFFFFTempo de Atividade|r: o tempo de cada membro da raide eh posto em pausa quando ele ficar ocioso e volta a contar o tempo quando ele voltar a atividade, eh a maneira mais comum de medir o Dps e Hps.\n\n|cFFFFFFFFTempo Efetivo|r: muito usado para ranqueamentos, este metodo usa o tempo total da luta para medir o Dps e Hps de todos os membros da raide." @@ -448,90 +457,164 @@ if not Loc then return end Loc ["STRING_OPTIONS_CLOUD_DESC"] = "Quando ativado, as informacoes de capturas deligadas eh buscada em outros membros da raide." - Loc ["STRING_OPTIONS_BARS"] = "Bar Settings" - Loc ["STRING_OPTIONS_BARS_DESC"] = "This options control the appearance of the instance bars." + Loc ["STRING_OPTIONS_BARS"] = "Configuracoes das Barras" + Loc ["STRING_OPTIONS_BARS_DESC"] = "Estas opcoes controlam a aparencia das barra da janela." - Loc ["STRING_OPTIONS_BAR_TEXTURE"] = "Texture" - Loc ["STRING_OPTIONS_BAR_TEXTURE_DESC"] = "Choose the texture of bars." + Loc ["STRING_OPTIONS_BAR_TEXTURE"] = "Textura" + Loc ["STRING_OPTIONS_BAR_TEXTURE_DESC"] = "Esta opcao altera a textura superior das barras." - Loc ["STRING_OPTIONS_BAR_BTEXTURE"] = "Background Texture" - Loc ["STRING_OPTIONS_BAR_BTEXTURE_DESC"] = "Choose the background texture of bars." + Loc ["STRING_OPTIONS_BAR_BTEXTURE"] = "Textura de Fundo" + Loc ["STRING_OPTIONS_BAR_BTEXTURE_DESC"] = "Altere a textura do fundo da barra, lembre-se de alterar a cor da textura e diminuir sua transparencia." - Loc ["STRING_OPTIONS_BAR_BCOLOR"] = "Background Color" - Loc ["STRING_OPTIONS_BAR_BCOLOR_DESC"] = "Choose the background color of bars." + Loc ["STRING_OPTIONS_BAR_BCOLOR"] = "Cor da Textura de Fundo" + Loc ["STRING_OPTIONS_BAR_BCOLOR_DESC"] = "Escolha a cor que a textura do fundo da barra tera, no painel, ha um controle de transparencia, nao esqueca de alterar." - Loc ["STRING_OPTIONS_BAR_HEIGHT"] = "Height" - Loc ["STRING_OPTIONS_BAR_HEIGHT_DESC"] = "Change the height of bars." + Loc ["STRING_OPTIONS_BAR_HEIGHT"] = "Altura" + Loc ["STRING_OPTIONS_BAR_HEIGHT_DESC"] = "Altera a altura das barras." - Loc ["STRING_OPTIONS_BAR_COLORBYCLASS"] = "Color By Class" - Loc ["STRING_OPTIONS_BAR_COLORBYCLASS_DESC"] = "When enabled, the instance bars have the color of the character class.\n\nDisabled: bars have a fixed color." + Loc ["STRING_OPTIONS_BAR_COLORBYCLASS"] = "Cor da Classe" + Loc ["STRING_OPTIONS_BAR_COLORBYCLASS_DESC"] = "Quando ativada, as barras aplicam a cor da classe do personagem na textura superior.\n\nQuando desligado, a barra ira utilizar a cor fixa determinada na caixa a direita." - Loc ["STRING_OPTIONS_BAR_COLORBYCLASS2"] = "Background Color By Class" - Loc ["STRING_OPTIONS_BAR_COLORBYCLASS2_DESC"] = "When enabled, the instance bars background have the color of the character class.\n\nDisabled: bars have a fixed color." + Loc ["STRING_OPTIONS_BAR_COLORBYCLASS2"] = "Cor da Classe (fundo)" + Loc ["STRING_OPTIONS_BAR_COLORBYCLASS2_DESC"] = "Quando ativada, as barras aplicam a cor da classe do personagem na textura de fundo.\n\nQuando desligado, a barra ira utilizar a cor fixa determinada na caixa a direita." -- - Loc ["STRING_OPTIONS_TEXT"] = "Text Settings" - Loc ["STRING_OPTIONS_TEXT_DESC"] = "This options control the appearance of the instance bar texts." + Loc ["STRING_OPTIONS_TEXT"] = "Opcoes dos Textos das Barras" + Loc ["STRING_OPTIONS_TEXT_DESC"] = "Os ajustes abaixo personalizam os textos mostrados nas barras." - Loc ["STRING_OPTIONS_TEXT_SIZE"] = "Size" - Loc ["STRING_OPTIONS_TEXT_SIZE_DESC"] = "Change the size of bar texts." + Loc ["STRING_OPTIONS_TEXT_SIZE"] = "Tamanho" + Loc ["STRING_OPTIONS_TEXT_SIZE_DESC"] = "Altera o tamanho da fonte do texto." Loc ["STRING_OPTIONS_TEXT_FONT"] = "Font" - Loc ["STRING_OPTIONS_TEXT_FONT_DESC"] = "Change the font of bar texts." + Loc ["STRING_OPTIONS_TEXT_FONT_DESC"] = "Modifica a fonte do texto usado nas barras." - Loc ["STRING_OPTIONS_TEXT_LOUTILINE"] = "Left Text Outline" - Loc ["STRING_OPTIONS_TEXT_LOUTILINE_DESC"] = "Enable or Disable the outline for left text." + Loc ["STRING_OPTIONS_TEXT_LOUTILINE"] = "Sombra do Texto Esquerdo" + Loc ["STRING_OPTIONS_TEXT_LOUTILINE_DESC"] = "Quando ativado o texto esquerdo ganhara um efeito de sombra ao seu redor." - Loc ["STRING_OPTIONS_TEXT_ROUTILINE"] = "Right Text Outline" - Loc ["STRING_OPTIONS_TEXT_ROUTILINE_DESC"] = "Enable or Disable the outline for right text." + Loc ["STRING_OPTIONS_TEXT_ROUTILINE"] = "Sombra do Texto Direito" + Loc ["STRING_OPTIONS_TEXT_ROUTILINE_DESC"] = "Quando ativado o texto da direita ganhara um efeito de sombra ao seu redor." - Loc ["STRING_OPTIONS_TEXT_LCLASSCOLOR"] = "Left Text Color By Class" - Loc ["STRING_OPTIONS_TEXT_LCLASSCOLOR_DESC"] = "When enabled, the left text uses the class color of the character.\n\nIf disabled, choose the color on the color picker button." + Loc ["STRING_OPTIONS_TEXT_LCLASSCOLOR"] = "Texto Esquerdo Cor da Classe" + Loc ["STRING_OPTIONS_TEXT_LCLASSCOLOR_DESC"] = "Quando ativado a cor do texto esquerdo sera automaticamento ajustado para a cor da classe do personagem mostrado.\n\nQuando desligado a cor na caixa a direita eh usado." - Loc ["STRING_OPTIONS_TEXT_RCLASSCOLOR"] = "Right Text Color By Class" - Loc ["STRING_OPTIONS_TEXT_RCLASSCOLOR_DESC"] = "When enabled, the right text uses the class color of the character.\n\nIf disabled, choose the color on the color picker button." + Loc ["STRING_OPTIONS_TEXT_RCLASSCOLOR"] = "Texto Direito Cor da Classe" + Loc ["STRING_OPTIONS_TEXT_RCLASSCOLOR_DESC"] = "Quando ativado a cor do texto da direita sera automaticamento ajustado para a cor da classe do personagem mostrado.\n\nQuando desligado a cor na caixa a direita eh usado." -- - Loc ["STRING_OPTIONS_INSTANCE"] = "Instance Settings" - Loc ["STRING_OPTIONS_INSTANCE_DESC"] = "This options control the appearance of the instance it self." + Loc ["STRING_OPTIONS_INSTANCE"] = "Configuracoes da Janela" + Loc ["STRING_OPTIONS_INSTANCE_DESC"] = "Estes ajustes configuram atributos basicos da janela da instancia." - Loc ["STRING_OPTIONS_INSTANCE_COLOR"] = "Color" - Loc ["STRING_OPTIONS_INSTANCE_COLOR_DESC"] = "Change the color of instance window." + Loc ["STRING_OPTIONS_INSTANCE_COLOR"] = "Cor e Transparencia" + Loc ["STRING_OPTIONS_INSTANCE_COLOR_DESC"] = "Altera a cor e a transparencia da janela." - Loc ["STRING_OPTIONS_INSTANCE_ALPHA"] = "Alpha" - Loc ["STRING_OPTIONS_INSTANCE_ALPHA_DESC"] = "This option let you change the color and transparency of instance window background." + Loc ["STRING_OPTIONS_INSTANCE_ALPHA"] = "Transparencia do Fundo" + Loc ["STRING_OPTIONS_INSTANCE_ALPHA_DESC"] = "Esta opcao altera a transparencia do fundo da janela." + Loc ["STRING_OPTIONS_INSTANCE_ALPHA2"] = "Cor de Fundo" + Loc ["STRING_OPTIONS_INSTANCE_ALPHA2_DESC"] = "Seleciona a cor do fundo da janela." - Loc ["STRING_OPTIONS_INSTANCE_CURRENT"] = "Auto Switch To Current" - Loc ["STRING_OPTIONS_INSTANCE_CURRENT_DESC"] = "Whenever a combat start and there is no other instance on current segment, this instance auto switch to current segment." + Loc ["STRING_OPTIONS_INSTANCE_CURRENT"] = "Mudar Para Atual" + Loc ["STRING_OPTIONS_INSTANCE_CURRENT_DESC"] = "Quando qualquer combate comecar e nao ha nenhuma instancia no segmento atual, esta instancia automaticamente troca para o segmento atual." - Loc ["STRING_OPTIONS_INSTANCE_SKIN"] = "Skin" - Loc ["STRING_OPTIONS_INSTANCE_SKIN_DESC"] = "Modify all window textures based on a skin theme." + Loc ["STRING_OPTIONS_SHOW_SIDEBARS"] = "Mostrar Barras Laterais" + Loc ["STRING_OPTIONS_SHOW_SIDEBARS_DESC"] = "Mostrar ou esconder as barras laterais na esquerda e direita da janela." - Loc ["STRING_OPTIONS_WP"] = "Wallpaper Settings" - Loc ["STRING_OPTIONS_WP_DESC"] = "This options control the wallpaper of instance." + Loc ["STRING_OPTIONS_INSTANCE_SKIN"] = "Pele (skin)" + Loc ["STRING_OPTIONS_INSTANCE_SKIN_DESC"] = "Modifica todas as texturas e opcoes da janela atraves de um padrao pre definido." - Loc ["STRING_OPTIONS_WP_ENABLE"] = "Show" - Loc ["STRING_OPTIONS_WP_ENABLE_DESC"] = "Enable or Disable the wallpaper of the instance.\n\nSelect the category and the image you want on the two following boxes." - - Loc ["STRING_OPTIONS_WP_GROUP"] = "Category" - Loc ["STRING_OPTIONS_WP_GROUP_DESC"] = "In this box, you select the group of the wallpaper, the images of this category can be chosen on the next dropbox." - - Loc ["STRING_OPTIONS_WP_GROUP2"] = "Wallpaper" - Loc ["STRING_OPTIONS_WP_GROUP2_DESC"] = "Select the wallpaper, for more, choose a diferent category on the left dropbox." - - Loc ["STRING_OPTIONS_WP_ALIGN"] = "Align" - Loc ["STRING_OPTIONS_WP_ALIGN_DESC"] = "Select how the wallpaper will align within the window instance.\n\n- |cFFFFFFFFFill|r: auto resize and align with all corners.\n\n- |cFFFFFFFFCenter|r: doesn`t resize and align with the center of the window.\n\n-|cFFFFFFFFStretch|r: auto resize on vertical or horizontal and align with left-right or top-bottom sides.\n\n-|cFFFFFFFFFour Corners|r: align with specified corner, no auto resize is made." - - Loc ["STRING_OPTIONS_WP_EDIT"] = "Edit Image" - Loc ["STRING_OPTIONS_WP_EDIT_DESC"] = "Open the image editor to change some wallpaper aspects." + Loc ["STRING_OPTIONS_SKIN_A"] = "Ajustes da Pele (Skin)" + Loc ["STRING_OPTIONS_SKIN_A_DESC"] = "Estas opcoes alteram as caracteristicas gerais da janela." - Loc ["STRING_OPTIONS_SAVELOAD"] = "Save and Load" - Loc ["STRING_OPTIONS_SAVELOAD_DESC"] = "This options allow you to save or load predefined settings." + Loc ["STRING_OPTIONS_TOOLBAR_SETTINGS"] = "Ajustes da Barra de Menus" + Loc ["STRING_OPTIONS_TOOLBAR_SETTINGS_DESC"] = "Estas opcoes lidam com a barra de ferramentas." + + Loc ["STRING_OPTIONS_DESATURATE_MENU"] = "Menu em Preto e Branco" + Loc ["STRING_OPTIONS_DESATURATE_MENU_DESC"] = "Ativando esta opcao o menu na barra de ferramentas torna-se preto e branco." + + Loc ["STRING_OPTIONS_HIDE_ICON"] = "Esconder Icone" + Loc ["STRING_OPTIONS_HIDE_ICON_DESC"] = "Quando ativado, o icone do atributo na barra de ferramentas eh escondido." + + Loc ["STRING_OPTIONS_MENU_X"] = "Posicao X Do Menu" + Loc ["STRING_OPTIONS_MENU_X_DESC"] = "Move a barra de menus para a esquerda ou direita no eixo horizontal." + + Loc ["STRING_OPTIONS_MENU_Y"] = "Posicao Y Do Menu" + Loc ["STRING_OPTIONS_MENU_Y_DESC"] = "Move a barra de menus para cima ou para baixo no eixo vertical." + + Loc ["STRING_OPTIONS_RESET_TEXTCOLOR"] = "Cor do Texto (reset)" + Loc ["STRING_OPTIONS_RESET_TEXTCOLOR_DESC"] = "Muda a cor do texto do botao de reset.\n\nO botao de reset eh apenas mostrado na janela 'mais baixa' (com o menor numero)." + + Loc ["STRING_OPTIONS_RESET_TEXTFONT"] = "Fonte do Texto (reset)" + Loc ["STRING_OPTIONS_RESET_TEXTFONT_DESC"] = "Muda a fonte do texto do botao de reset.\n\nO botao de reset eh apenas mostrado na janela 'mais baixa' (com o menor numero)." + + Loc ["STRING_OPTIONS_RESET_TEXTSIZE"] = "Tamanho do Texto (reset)" + Loc ["STRING_OPTIONS_RESET_TEXTSIZE_DESC"] = "Muda o tamanho do texto do botao de reset.\n\nO botao de reset eh apenas mostrado na janela 'mais baixa' (com o menor numero)." + + Loc ["STRING_OPTIONS_RESET_OVERLAY"] = "Overlay (reset)" + Loc ["STRING_OPTIONS_RESET_OVERLAY_DESC"] = "Altera a cor do botao de reset.\n\nO botao de reset eh apenas mostrado na janela 'mais baixa' (com o menor numero)." + + Loc ["STRING_OPTIONS_RESET_SMALL"] = "Reset Sempre Pequeno" + Loc ["STRING_OPTIONS_RESET_SMALL_DESC"] = "O botao de reset sempre sera mostrado na sua versao pequena.\n\nO botao de reset eh apenas mostrado na janela 'mais baixa' (com o menor numero)." + + Loc ["STRING_OPTIONS_INSTANCE_TEXTCOLOR"] = "Cor do Texto (instancia)" + Loc ["STRING_OPTIONS_INSTANCE_TEXTCOLOR_DESC"] = "Altera a cor do texto no botao da instancia." + + Loc ["STRING_OPTIONS_INSTANCE_TEXTFONT"] = "Fonte do Texto (instancia)" + Loc ["STRING_OPTIONS_INSTANCE_TEXTFONT_DESC"] = "Altera a fonte do texto no botao da instancia." + + Loc ["STRING_OPTIONS_INSTANCE_TEXTSIZE"] = "Tamanho do Texto (instancia)" + Loc ["STRING_OPTIONS_INSTANCE_TEXTSIZE_DESC"] = "Altera o tamanho do texto no botao da instancia." + + Loc ["STRING_OPTIONS_INSTANCE_OVERLAY"] = "Overlay (instancia)" + Loc ["STRING_OPTIONS_INSTANCE_OVERLAY_DESC"] = "Altera a cor do botao da instancia." + + Loc ["STRING_OPTIONS_CLOSE_OVERLAY"] = "Cor do Botao de Fechar" + Loc ["STRING_OPTIONS_CLOSE_OVERLAY_DESC"] = "Modifica a cor do botao de fechar." + + Loc ["STRING_OPTIONS_STRETCH"] = "Posicao do Botao de Esticar" + Loc ["STRING_OPTIONS_STRETCH_DESC"] = "Modifica a posicao do botao de esticar, ele pode ser mostrado em:\n\nTopo: o pegador eh mostrado logo acima do botao da instancia e do botao de fechar.\n\nBaixo: mostrado na parte central e inferior da janela." + + Loc ["STRING_OPTIONS_PICONS_DIRECTION"] = "Direcao dos Icones dos Plugins" + Loc ["STRING_OPTIONS_PICONS_DIRECTION_DESC"] = "Altera o lado que os icones dos plugins serao mostrados na barra de ferramentas." + + Loc ["STRING_OPTIONS_INSBUTTON_X"] = "Eixo X Botao da Instancia" + Loc ["STRING_OPTIONS_INSBUTTON_X_DESC"] = "Move o botao da instancia para a esquerda ou direita." + + Loc ["STRING_OPTIONS_INSBUTTON_Y"] = "Eixo Y Botao da Instancia" + Loc ["STRING_OPTIONS_INSBUTTON_Y_DESC"] = "Move o botao da instancia para cima ou para baixo." + + Loc ["STRING_OPTIONS_TOOLBARSIDE"] = "Posicao Barra de Ferramentas" + Loc ["STRING_OPTIONS_TOOLBARSIDE_DESC"] = "Altera aonde sera mostrada a barra de ferramentas, ela pode ser mostrada no topo da janela ou na parte inferior." + + Loc ["STRING_OPTIONS_BARGROW_DIRECTION"] = "Direcao de Crescimento" + Loc ["STRING_OPTIONS_BARGROW_DIRECTION_DESC"] = "Altera a posicao em que as barras comecam a serem mostradas, de cima da janela para baixo ou de baixo da janela para cima." + + Loc ["STRING_OPTIONS_BARSORT_DIRECTION"] = "Ordem das Barras" + Loc ["STRING_OPTIONS_BARSORT_DIRECTION_DESC"] = "Altera como as barras sao preenchidas, crescente ou decrescente, mas ainda mostrando sempre os primeiros colocados." + + Loc ["STRING_OPTIONS_WP"] = "Papel de Parede" + Loc ["STRING_OPTIONS_WP_DESC"] = "Estas opcoes controlam o papel de parede que eh mostrado no fundo da janela." - Loc ["STRING_OPTIONS_SAVELOAD_PNAME"] = "Preset Name" - Loc ["STRING_OPTIONS_SAVELOAD_SAVE"] = "save" - Loc ["STRING_OPTIONS_SAVELOAD_LOAD"] = "load" + Loc ["STRING_OPTIONS_WP_ENABLE"] = "Ativar/Desativar" + Loc ["STRING_OPTIONS_WP_ENABLE_DESC"] = "Liga ou desliga o papel de parede.\n\nVoce pode escolher qual papel de parede voce deseja usar nas caixas abaixo." + + Loc ["STRING_OPTIONS_WP_GROUP"] = "Categoria" + Loc ["STRING_OPTIONS_WP_GROUP_DESC"] = "Nesta caixa, selecione o tipo do papel de parede, apos selecionar, a caixa a direita ira mostrar as opcoes da categoria escolhida." + + Loc ["STRING_OPTIONS_WP_GROUP2"] = "Papel de Parede" + Loc ["STRING_OPTIONS_WP_GROUP2_DESC"] = "Selecione qual voce deseja colocar no fundo da janela, para mais opcoes troque de categoria na caixa da esquerda." + + Loc ["STRING_OPTIONS_WP_ALIGN"] = "Alinhamento" + Loc ["STRING_OPTIONS_WP_ALIGN_DESC"] = "Selecione como o papel de parede sera alinhado com a janela.\n\n- |cFFFFFFFFPreencher|r: redimenciona e alinha com os quatro cantos da janela.\n\n- |cFFFFFFFFCentralizado|r: nao redimenciona e alinha com o centro da janeça.\n\n-|cFFFFFFFFEsticado|r: redimenciona na vertical ou horizontal e alinha com os cantos da esquerda-direita ou lado superior-inferior.\n\n-|cFFFFFFFFQuatro Laterais|r: alinha com um canto especifico, nao ha redimencionamento automatico." + + Loc ["STRING_OPTIONS_WP_EDIT"] = "Editar Imagem" + Loc ["STRING_OPTIONS_WP_EDIT_DESC"] = "Abre o editor de imagens para alterar os aspectos do papel de parede escolhido." + + Loc ["STRING_OPTIONS_SAVELOAD"] = "Salvar e Carregar" + Loc ["STRING_OPTIONS_SAVELOAD_DESC"] = "Estas opcoes permitem guardar as configuracoes da janela podendo carrega-las em outros personagens." + + Loc ["STRING_OPTIONS_SAVELOAD_PNAME"] = "Nome" + Loc ["STRING_OPTIONS_SAVELOAD_SAVE"] = "salvar" + Loc ["STRING_OPTIONS_SAVELOAD_LOAD"] = "carregar" Loc ["STRING_OPTIONS_SAVELOAD_REMOVE"] = "x" - Loc ["STRING_OPTIONS_SAVELOAD_RESET"] = "reset to default" - Loc ["STRING_OPTIONS_SAVELOAD_APPLYTOALL"] = "apply to all instances" + Loc ["STRING_OPTIONS_SAVELOAD_RESET"] = "resetar p/ padroes" + Loc ["STRING_OPTIONS_SAVELOAD_APPLYTOALL"] = "aplicar em todas as janelas" -- Mini Tutorials ----------------------------------------------------------------------------------------------------------------- diff --git a/startup.lua b/startup.lua index d284b1ac..1268c47d 100644 --- a/startup.lua +++ b/startup.lua @@ -29,126 +29,21 @@ function _G._detalhes:Start() self.encounter = {} self.in_combat = false self.combat_id = self.combat_id or 0 - self.instances_amount = self.instances_amount or 12 - self.segments_amount = self.segments_amount or 12 - self.segments_amount_to_save = self.segments_amount_to_save or 5 - self.memory_threshold = self.memory_threshold or 3 - self.memory_ram = self.memory_ram or 64 - self.deadlog_limit = self.deadlog_limit or 12 - self.minimum_combat_time = self.minimum_combat_time or 5 - - if (type (self.trash_concatenate) ~= "boolean") then - self.trash_concatenate = false - end - if (type (self.trash_auto_remove) ~= "boolean") then - self.trash_auto_remove = false - end - - if (type (self.only_pvp_frags) ~= "boolean") then - self.only_pvp_frags = false - end - - if (type (self.remove_realm_from_name) ~= "boolean") then - self.remove_realm_from_name = true - end - - if (type (self.cloud_capture) ~= "boolean") then - self.cloud_capture = true - end - - if (type (self.segments_panic_mode) ~= "boolean") then - self.segments_panic_mode = true - end - - if (type (self.clear_graphic) ~= "boolean") then - self.clear_graphic = self.clear_graphic or true - end - - if (type (self.clear_ungrouped) ~= "boolean") then - self.clear_ungrouped = self.clear_ungrouped or true - end - - if (type (self.use_row_animations) ~= "boolean") then - self.use_row_animations = self.use_row_animations or false - end --> instances (windows) self.solo = self.solo or nil self.raid = self.raid or nil self.opened_windows = 0 - self.update_speed = self.update_speed or 1 - self.time_type = self.time_type or 1 - - self.row_fade_in = self.row_fade_in or {"in", 0.2} - self.row_fade_out = self.row_fade_out or {"out", 0.2} - self.windows_fade_in = self.windows_fade_in or {"in", 0.2} - self.windows_fade_out = self.windows_fade_out or {"out", 0.2} - self.default_texture = [[Interface\AddOns\Details\images\bar4]] self.default_texture_name = "Details D'ictum" - self.default_bg_color = self.default_bg_color or 0.0941 - self.default_bg_alpha = self.default_bg_alpha or 0.7 - - self.new_window_size = self.new_window_size or {width = 300, height = 95} - self.max_window_size = self.max_window_size or {width = 480, height = 450} - self.window_clamp = self.window_clamp or {-8, 0, 30, -14} - - self.report_lines = self.report_lines or 5 - self.report_to_who = self.report_to_who or "" - - self.animate_scroll = self.animate_scroll or false - self.use_scroll = self.use_scroll or false - self.tooltip_max_targets = 3 self.tooltip_max_abilities = 3 self.tooltip_max_pets = 1 - self.font_sizes = self.font_sizes or { - menus = 10 - } - - self.tutorial = self.tutorial or {} - self.tutorial.logons = self.tutorial.logons or 0 - self.tutorial.unlock_button = self.tutorial.unlock_button or 0 - self.tutorial.version_announce = self.tutorial.version_announce or 0 - self.tutorial.main_help_button = self.tutorial.main_help_button or 0 - self.tutorial.alert_frames = self.tutorial.alert_frames or {false, false, false, false, false, false} - self.tutorial.logons = self.tutorial.logons + 1 - - self.character_data = self.character_data or { - logons = 0, - } - - self.character_data.logons = self.character_data.logons + 1 - - --> class colors and tcoords - if (not self.class_colors) then - self.class_colors = {} - for classe, tabela_cor in pairs ( RAID_CLASS_COLORS ) do - self.class_colors [classe] = {tabela_cor.r, tabela_cor.g, tabela_cor.b} - end - self.class_colors ["UNKNOW"] = {0.2, 0.2, 0.2} - self.class_colors ["UNGROUPPLAYER"] = {0.4, 0.4, 0.4} - self.class_colors ["PET"] = {0.3, 0.4, 0.5} - end - self.class_colors ["ENEMY"] = self.class_colors ["ENEMY"] or {0.94117, 0, 0.01960, 1} - - self.class_coords = {} - for class, tcoord in pairs (_G.CLASS_ICON_TCOORDS) do - self.class_coords [class] = tcoord - end - - self.class_icons_small = [[Interface\AddOns\Details\images\classes_small]] - self.class_coords ["Alliance"] = {0.49609375, 0.7421875, 0.75, 1} - self.class_coords ["Horde"] = {0.7421875, 0.98828125, 0.75, 1} - self.class_coords ["PET"] = {0.25, 0.49609375, 0.75, 1} - self.class_coords ["MONSTER"] = {0, 0.25, 0.75, 1} - self.class_coords ["ENEMY"] = {0, 0.25, 0.75, 1} - - self.class_coords ["UNKNOW"] = {0.5, 0.75, 0.75, 1} - self.class_coords ["UNGROUPPLAYER"] = {0.5, 0.75, 0.75, 1} + self.class_coords_version = 1 + self.class_colors_version = 1 self.school_colors = { [1] = {1.00, 1.00, 0.00}, @@ -160,6 +55,9 @@ function _G._detalhes:Start() [64] = {1.00, 0.50, 1.00}, ["unknown"] = {0.5, 0.75, 0.75, 1} } + + --> parse all config + _detalhes:ApplyConfigDataOnLoad() --> single click row function replace --damage, dps, damage taken, friendly fire @@ -226,7 +124,7 @@ function _G._detalhes:Start() end self:GetLowerInstanceNumber() self:CheckConsolidates() - + --> start time machine self.timeMachine:Ligar() @@ -243,19 +141,32 @@ function _G._detalhes:Start() end end - function self:AtualizaGumps() + function self:RefreshAfterStartup() + self:AtualizaGumpPrincipal (-1, true) - self.AtualizaGumps = nil + + local lower_instance = _detalhes:GetLowerInstanceNumber() + for index = 1, #self.tabela_instancias do local instance = self.tabela_instancias [index] if (instance:IsAtiva()) then + --> refresh wallpaper if (instance.wallpaper.enabled) then instance:InstanceWallpaper (true) end + + --> refresh desaturated icons if is lower instance + if (index == lower_instance) then + instance:DesaturateMenu() + end end end + + _detalhes.ToolBar:ReorganizeIcons() + + self.RefreshAfterStartup = nil end - self:ScheduleTimer ("AtualizaGumps", 4) + self:ScheduleTimer ("RefreshAfterStartup", 4) --> start garbage collector self.ultima_coleta = 0 @@ -311,9 +222,10 @@ function _G._detalhes:Start() for index, instancia in ipairs (self.tabela_instancias) do if (instancia.ativa) then self:SendEvent ("DETAILS_INSTANCE_OPEN", nil, instancia) + --instancia:SetBarGrowDirection() end end - + --> all done, send started signal and we are ready function self:AnnounceStartup() self:SendEvent ("DETAILS_STARTED", "SEND_TO_ALL") @@ -336,7 +248,7 @@ function _G._detalhes:Start() for index, instancia in ipairs (self.tabela_instancias) do if (instancia.ativa) then self.gump:Fade (instancia._version, 0) - instancia._version:SetText ("Details Alpha " .. _detalhes.userversion .. " (core: " .. self.realversion .. ")") + instancia._version:SetText ("Details! Alpha " .. _detalhes.userversion .. " (core: " .. self.realversion .. ")") instancia._version:SetPoint ("bottomleft", instancia.baseframe, "bottomleft", 0, 1) self.gump:Fade (instancia._version, "in", 10) end @@ -405,7 +317,15 @@ function _G._detalhes:Start() GameCooltip:AddIcon ([[Interface\ICONS\Spell_ChargePositive]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125) --> reopen window 64: 0.0078125 - GameCooltip:AddMenu (1, _detalhes.CriarInstancia, true, nil, nil, Loc ["STRING_MINIMAPMENU_REOPEN"], nil, true) + local reopen = function() + for _, instance in ipairs (_detalhes.tabela_instancias) do + if (not instance:IsAtiva()) then + _detalhes:CriarInstancia (instance.meu_id) + return + end + end + end + GameCooltip:AddMenu (1, reopen, nil, nil, nil, Loc ["STRING_MINIMAPMENU_REOPEN"], nil, true) GameCooltip:AddIcon ([[Interface\ICONS\Ability_Priest_VoidShift]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125) GameCooltip:AddMenu (1, _detalhes.ReabrirTodasInstancias, true, nil, nil, Loc ["STRING_MINIMAPMENU_REOPENALL"], nil, true) @@ -434,7 +354,7 @@ function _G._detalhes:Start() }) if (minimapIcon and not LDBIcon:IsRegistered ("Details!")) then - LDBIcon:Register ("Details!", minimapIcon, [[Interface\AddOns\Details\images\minimap]]) + LDBIcon:Register ("Details!", minimapIcon, self.minimap) end end @@ -471,5 +391,14 @@ function _G._detalhes:Start() --> MicroButtonAlertTemplate self.MicroButtonAlert = CreateFrame ("frame", "DetailsMicroButtonAlert", UIParent, "MicroButtonAlertTemplate") self.MicroButtonAlert:Hide() - + + --[[ + print ("primeiro:") + local instancia = _detalhes.tabela_instancias [1] + for i = 1, instancia.barras [1]:GetNumPoints() do + local point, relativeTo, relativePoint, xOfs, yOfs = instancia.barras [1]:GetPoint (i) + print (point, relativeTo, relativePoint, xOfs, yOfs) + end + print ("---------------") + --]] end