diff --git a/boot.lua b/boot.lua index 51578ae7..a8b9c6fe 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.12.00" + _detalhes.userversion = "v1.12.3" _detalhes.version = "Alpha 016" _detalhes.realversion = 16 @@ -204,6 +204,7 @@ do SharedMedia:Register ("statusbar", "Details D'ictum", [[Interface\AddOns\Details\images\bar4]]) SharedMedia:Register ("statusbar", "Details D'ictum (reverse)", [[Interface\AddOns\Details\images\bar4_reverse]]) SharedMedia:Register ("statusbar", "Details Serenity", [[Interface\AddOns\Details\images\bar_serenity]]) + SharedMedia:Register ("background", "Details Ground", [[Interface\AddOns\Details\images\background]]) --> global 'vardump' for dump table contents over chat panel function vardump (t) diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index fde0c864..fbeaef3c 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -796,7 +796,7 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex conteudo = _detalhes.cache_damage_group - if (sub_atributo == 2) then + if (sub_atributo == 2) then --> dps local combat_time = instancia.showing:GetCombatTime() atributo_damage:ContainerRefreshDps (conteudo, combat_time) end @@ -818,7 +818,7 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex total = total + conteudo[i][keyName] end else - if (sub_atributo == 2) then + if (sub_atributo == 2) then --> dps local combat_time = instancia.showing:GetCombatTime() atributo_damage:ContainerRefreshDps (conteudo, combat_time) end @@ -1137,11 +1137,11 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra, elseif (sub_atributo == 2) then --> mostrando dps dps = _math_floor (dps) if (_detalhes.ps_abbreviation == 2) then - esta_barra.texto_direita:SetText (_detalhes:ToK (dps) .. " " .. div_abre .. _detalhes:ToK (damage_total) .. ", " .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita - elseif (_detalhes.ps_abbreviation == 3) then esta_barra.texto_direita:SetText (_detalhes:ToK2 (dps) .. " " .. div_abre .. _detalhes:ToK (damage_total) .. ", " .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita + elseif (_detalhes.ps_abbreviation == 3) then + esta_barra.texto_direita:SetText (_detalhes:ToK2 (dps) .. " " .. div_abre .. _detalhes:ToK2 (damage_total) .. ", " .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita else - esta_barra.texto_direita:SetText (_cstr ("%.1f", dps) .. " " .. div_abre .. _detalhes:ToK (damage_total) .. ", " .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita + esta_barra.texto_direita:SetText (_detalhes:ToK2 (dps) .. " " .. div_abre .. damage_total .. ", " .. _cstr ("%.1f", porcentagem) .. "%" .. div_fecha) --seta o texto da direita end esta_porcentagem = _math_floor ((dps/instancia.top) * 100) --> determina qual o tamanho da barra @@ -1387,6 +1387,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra) do --> TOP HABILIDADES local ActorDamage = self.total_without_pet + local ActorDamageWithPet = self.total if (ActorDamage == 0) then ActorDamage = 0.00000001 end @@ -1452,7 +1453,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra) for i = 1, _math_min (_detalhes.tooltip_max_targets, #ActorTargetsSortTable) do local este_inimigo = ActorTargetsSortTable [i] - GameCooltip:AddLine (este_inimigo[1]..": ", _detalhes:comma_value (este_inimigo[2]) .." (".._cstr("%.1f", este_inimigo[2]/ActorDamage*100).."%)") + GameCooltip:AddLine (este_inimigo[1]..": ", _detalhes:comma_value (este_inimigo[2]) .." (".._cstr("%.1f", este_inimigo[2]/ActorDamageWithPet*100).."%)") GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\espadas", nil, nil, 14, 14) GameCooltip:AddStatusBar (100, 1, .1, .1, .1, .2) end diff --git a/classes/classe_heal.lua b/classes/classe_heal.lua index b3e542b8..e0463709 100644 --- a/classes/classe_heal.lua +++ b/classes/classe_heal.lua @@ -152,6 +152,24 @@ function _detalhes:ContainerSortHeal (container, amount, keyName2) end end +function atributo_heal:ContainerRefreshHps (container, combat_time) + + if (_detalhes.time_type == 2 or not _detalhes:CaptureGet ("heal")) then + for _, actor in _ipairs (container) do + if (actor.grupo) then + actor.last_hps = actor.total / combat_time + else + actor.last_hps = actor.total / actor:Tempo() + end + end + else + for _, actor in _ipairs (container) do + actor.last_hps = actor.total / actor:Tempo() + end + end + +end + function atributo_heal:ReportSingleDamagePreventedLine (actor, instancia) local barra = instancia.barras [actor.minha_barra] @@ -256,6 +274,11 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo conteudo = _detalhes.cache_healing_group + if (sub_atributo == 2) then --> hps + local combat_time = instancia.showing:GetCombatTime() + atributo_heal:ContainerRefreshHps (conteudo, combat_time) + end + if (#conteudo < 1) then return _detalhes:EsconderBarrasNaoUsadas (instancia, showing) end @@ -268,11 +291,16 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo instancia.top = conteudo[1][keyName] amount = #conteudo end - + for i = 1, amount do total = total + conteudo[i][keyName] end + else + if (sub_atributo == 2) then --> hps + local combat_time = instancia.showing:GetCombatTime() + atributo_heal:ContainerRefreshHps (conteudo, combat_time) + end --_table_sort (conteudo, _detalhes.SortKeyGroup) _detalhes.SortGroupHeal (conteudo, keyName) end @@ -538,11 +566,11 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l hps = _math_floor (hps) if (_detalhes.ps_abbreviation == 2) then - esta_barra.texto_direita:SetText (_detalhes:ToK (hps) .." ".. div_abre .. _detalhes:ToK (healing_total) .. ", ".._cstr("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita - elseif (_detalhes.ps_abbreviation == 2) then esta_barra.texto_direita:SetText (_detalhes:ToK2 (hps) .." ".. div_abre .. _detalhes:ToK (healing_total) .. ", ".._cstr("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita + elseif (_detalhes.ps_abbreviation == 3) then + esta_barra.texto_direita:SetText (_detalhes:ToK2 (hps) .." ".. div_abre .. _detalhes:ToK2 (healing_total) .. ", ".._cstr("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita else - esta_barra.texto_direita:SetText (_cstr("%.1f", hps) .." ".. div_abre .. _detalhes:ToK (healing_total) .. ", ".._cstr("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita + esta_barra.texto_direita:SetText (_detalhes:ToK2 (hps) .." ".. div_abre .. healing_total .. ", ".._cstr("%.1f", porcentagem).."%" .. div_fecha) --seta o texto da direita end esta_porcentagem = _math_floor ((hps/instancia.top) * 100) --> determina qual o tamanho da barra diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index ce667515..e4fe5f43 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -95,6 +95,18 @@ function _detalhes:GetLowerInstanceNumber() end end +function _detalhes:IsLowerInstance() + local lower = _detalhes:GetLowerInstanceNumber() + if (lower) then + return lower == self.meu_id + end + return false +end + +function _detalhes:IsInteracting() + return self.is_interacting +end + function _detalhes:GetMode() return self.modo end @@ -296,6 +308,8 @@ end gump:Fade (self.baseframe.cabecalho.ball, 0) gump:Fade (self.baseframe, 0) + self:SetMenuAlpha() + self.baseframe.cabecalho.fechar:Enable() self:ChangeIcon() @@ -720,6 +734,18 @@ end --> setup all config new_instance:ResetInstanceConfig() + --> setup default wallpaper + local spec = GetSpecialization() + if (spec) then + local id, name, description, icon, _background, role = GetSpecializationInfo (spec) + if (_background) then + local bg = "Interface\\TALENTFRAME\\" .. _background + if (new_instance.wallpaper) then + new_instance.wallpaper.texture = bg + new_instance.wallpaper.texcoord = {0, 1, 0, 0.703125} + end + end + end --> internal stuff new_instance.barras = {} --container que irá armazenar todas as barras @@ -791,6 +817,7 @@ end --> internal stuff new_instance.row_height = new_instance.row_info.height + new_instance.row_info.space.between + new_instance.oldwith = new_instance.baseframe:GetWidth() new_instance.iniciada = true new_instance:SaveMainWindowPosition() new_instance:ReajustaGump() @@ -943,6 +970,7 @@ function _detalhes:RestauraJanela (index, temp) end --> internal stuff + self.oldwith = self.baseframe:GetWidth() self:RestoreMainWindowPosition() self:ReajustaGump() self:SaveMainWindowPosition() @@ -967,7 +995,7 @@ function _detalhes:ExportSkin() } for key, value in pairs (self) do - if (_detalhes.instance_defaults [key]) then + if (_detalhes.instance_defaults [key] ~= nil) then if (type (value) == "table") then exported [key] = table_deepcopy (value) else @@ -1051,8 +1079,8 @@ function _detalhes:SetBackgroundAlpha (alpha) -- 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.bgdisplay:SetBackdropColor (self.bg_r, self.bg_g, self.bg_b, alpha) + self.baseframe:SetBackdropColor (self.bg_r, self.bg_g, self.bg_b, alpha) self.bg_alpha = alpha end diff --git a/classes/classe_instancia_include.lua b/classes/classe_instancia_include.lua index 8af001e2..a3258193 100644 --- a/classes/classe_instancia_include.lua +++ b/classes/classe_instancia_include.lua @@ -35,17 +35,19 @@ _detalhes.instance_defaults = { --skin skin = "Default Skin", - --baseframe backdrop color + --baseframe backdrop bg_alpha = 0.7, bg_r = 0.0941, bg_g = 0.0941, bg_b = 0.0941, + backdrop_texture = "Details Ground", --auto current auto_current = true, --show sidebars show_sidebars = true, --show bottom statusbar show_statusbar = true, + statusbar_info = {alpha = 1, overlay = {1, 1, 1}}, --blackwhiite icons desaturated_menu = false, --hide main window attribute icon @@ -66,13 +68,20 @@ _detalhes.instance_defaults = { 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}, + --menus: + --anchor store the anchor point of main menu + menu_anchor = {5, 1, side = 1}, + --auto hide window borders + menu_alpha = {enabled = false, iconstoo = true, onenter = 1, onleave = 1}, + --auto hide menu + auto_hide_menu = {left = false, right = false}, + --attribute text + attribute_text = {enabled = false, anchor = {5, 1}, text_face = "Friz Quadrata TT", text_size = 12, text_color = {1, 1, 1, 1}, side = 1}, --instance button anchor store the anchor point of instance and delete button instance_button_anchor = {-27, 1}, --total bar total_bar = {enabled = false, color = {1, 1, 1}, only_in_group = true, icon = [[Interface\ICONS\INV_Sigil_Thorim]]}, - + --row info row_info = { --if true the texture of the bars will have the color of his actor class @@ -117,10 +126,13 @@ _detalhes.instance_defaults = { space = {left = 3, right = -5, between = 1}, --icon file icon_file = [[Interface\AddOns\Details\images\classes_small]], + no_icon = false, + start_after_icon = true, }, --instance window color color = {1, 1, 1, 1}, + color_buttons = {1, 1, 1, 1}, --hide in combat hide_in_combat = false, hide_in_combat_alpha = 0, diff --git a/core/control.lua b/core/control.lua index 46563333..b6066f10 100644 --- a/core/control.lua +++ b/core/control.lua @@ -320,7 +320,7 @@ for index, instancia in ipairs (_detalhes.tabela_instancias) do if (instancia.ativa) then if (instancia.hide_in_combat) then - instancia:SetWindowAlpha (instancia.hide_in_combat_alpha / 100) + instancia:SetWindowAlphaForCombat (true) end if (instancia.auto_switch_to) then @@ -569,7 +569,7 @@ for index, instancia in ipairs (_detalhes.tabela_instancias) do if (instancia.ativa) then if (instancia.hide_in_combat) then - instancia:SetWindowAlpha (1, true) + instancia:SetWindowAlphaForCombat (false) end if (instancia.auto_switch_to_old) then instancia:SwitchBack() diff --git a/core/meta.lua b/core/meta.lua index 1322d026..6b6f051d 100644 --- a/core/meta.lua +++ b/core/meta.lua @@ -556,6 +556,8 @@ esta_instancia.consolidateButtonTexture = nil esta_instancia.consolidateButton = nil esta_instancia.lastIcon = nil + + esta_instancia.menu_attribute_string = nil end diff --git a/core/parser.lua b/core/parser.lua index 1ce265d1..224b02f4 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -2790,10 +2790,10 @@ end --if (UnitName ("player") == "Tiranaa" or UnitName ("player") == "Triciclo") then - _detalhes:SaveConfig() - _detalhes:SaveProfile() + + _detalhes_database.nick_tag_cache = table_deepcopy (_detalhes_database.nick_tag_cache) --_detalhes_global = nil --_detalhes_database = nil @@ -2845,6 +2845,9 @@ _detalhes.listener:SetScript ("OnEvent", _detalhes.OnEvent) function _detalhes:OnParserEvent (evento, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, ...) + + --print (alvo_name, alvo_flags2) + local funcao = token_list [token] if (funcao) then return funcao (nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, ... ) diff --git a/core/plugins.lua b/core/plugins.lua index c11789eb..fbff25df 100644 --- a/core/plugins.lua +++ b/core/plugins.lua @@ -167,6 +167,9 @@ Frame:RegisterEvent ("ADDON_LOADED") Frame:RegisterEvent ("PLAYER_LOGOUT") Frame:SetScript ("OnEvent", function(event, ...) return NewPlugin:OnEvent (event, ...) end) + + Frame:SetFrameStrata ("HIGH") + Frame:SetFrameLevel (6) Frame:Hide() Frame.__parent = NewPlugin diff --git a/core/plugins_statusbar.lua b/core/plugins_statusbar.lua index 322e10b7..b41d2100 100644 --- a/core/plugins_statusbar.lua +++ b/core/plugins_statusbar.lua @@ -293,7 +293,8 @@ --> 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) + --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) + local frame = _detalhes.gump:NewPanel (instance.baseframe.DOWNFrame, nil, name..instance:GetInstanceId(), nil, w or DEFAULT_CHILD_WIDTH, h or DEFAULT_CHILD_HEIGHT, false) --create widgets local text = _detalhes.gump:NewLabel (frame, nil, "$parentText", "text", "0") diff --git a/core/plugins_toolbar.lua b/core/plugins_toolbar.lua index 94160c68..3478d8de 100644 --- a/core/plugins_toolbar.lua +++ b/core/plugins_toolbar.lua @@ -57,8 +57,6 @@ _detalhes.ToolBar.AllButtons [#_detalhes.ToolBar.AllButtons+1] = button - - return button end @@ -171,7 +169,8 @@ _detalhes:RegisterEvent (_detalhes.ToolBar, "DETAILS_INSTANCE_OPEN", "OnInstanceOpen") _detalhes:RegisterEvent (_detalhes.ToolBar, "DETAILS_INSTANCE_CLOSE", "OnInstanceClose") - _detalhes.ToolBar.Enabled = true --> must have this member or will not receive the event + _detalhes.ToolBar.Enabled = true --> must have this member or wont receive the event + _detalhes.ToolBar.__enabled = true function _detalhes.ToolBar:OnInstanceOpen() _detalhes.ToolBar:ReorganizeIcons() @@ -194,10 +193,6 @@ local instance = _detalhes:GetInstance (lower_instance) - if (just_refresh) then - - end - _detalhes:ResetButtonSnapTo (instance) _detalhes.ResetButtonInstance = lower_instance @@ -206,6 +201,7 @@ local LastIcon local x = 0 + local to_alpha = instance:GetInstanceIconsCurrentAlpha() if (instance.plugins_grow_direction == 2) then --> right direction @@ -228,7 +224,10 @@ else ThisButton:SetPoint ("left", LastIcon, "right", ThisButton.x + x, ThisButton.y) end + ThisButton:Show() + ThisButton:SetAlpha (to_alpha) + LastIcon = ThisButton end @@ -245,12 +244,14 @@ ThisButton:SetParent (instance.baseframe.UPFrame) ThisButton:SetPoint ("right", LastIcon, "left", ThisButton.x + x, ThisButton.y) + ThisButton:Show() + ThisButton:SetAlpha (to_alpha) + LastIcon = ThisButton end end - end if (not just_refresh) then @@ -261,6 +262,8 @@ end instance:ChangeSkin() + else + instance:SetMenuAlpha() end return true diff --git a/core/windows.lua b/core/windows.lua index acc139e0..fed43dd5 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -141,23 +141,62 @@ self = instance end - local xOfs, yOfs = self.baseframe:GetCenter() + local mostrando = self.mostrando + + local baseframe_width = math.floor (self.baseframe:GetWidth()) + local baseframe_height = math.floor (self.baseframe:GetHeight()) + + if (not baseframe_width) then + return _detalhes:ScheduleTimer ("SaveMainWindowPosition", 1, self) + end + + --[[ + if (baseframe_width % 2 ~= 0) then + if (self.posicao[mostrando].w > baseframe_width) then + baseframe_width = baseframe_width +1 + else + baseframe_width = baseframe_width -1 + end + end + self.baseframe:SetWidth (baseframe_width) + if (baseframe_height % 2 ~= 0) then + if (self.posicao[mostrando].h > baseframe_height) then + baseframe_height = baseframe_height +1 + else + baseframe_height = baseframe_height -1 + end + end + self.baseframe:SetHeight (baseframe_height) + --]] + + local xOfs, yOfs = self.baseframe:GetCenter() if (not xOfs) then --> this is a small and unknow bug when resizing all windows throgh crtl key (all) the last window of a horizontal row can't 'GetCenter'. --> so, the trick is we start a timer to save pos later. return _detalhes:ScheduleTimer ("SaveMainWindowPosition", 1, self) end + + --xOfs = math.floor (xOfs) + --yOfs = math.floor (yOfs) + + if (xOfs % 2 ~= 0) then + --xOfs = xOfs -1 + end + if (yOfs % 2 ~= 0) then + --yOfs = yOfs -1 + end + + local q, w = self.baseframe:GetCenter() local _scale = self.baseframe:GetEffectiveScale() local _UIscale = _UIParent:GetScale() - local mostrando = self.mostrando xOfs = xOfs*_scale - _GetScreenWidth()*_UIscale/2 yOfs = yOfs*_scale - _GetScreenHeight()*_UIscale/2 - local _w = self.baseframe:GetWidth() - local _h = self.baseframe:GetHeight() + local _w = baseframe_width + local _h = baseframe_height local _x = xOfs/_UIscale local _y = yOfs/_UIscale @@ -267,10 +306,18 @@ if (self.baseframe:GetWidth() < 215 or self.resetbutton_info.always_small) then gump:Fade (_detalhes.ResetButton, 1) gump:Fade (_detalhes.ResetButton2, 0) + + local alpha = self:GetInstanceCurrentAlpha() + _detalhes.ResetButton2:SetAlpha (alpha) + _detalhes.ResetButtonMode = 2 else gump:Fade (_detalhes.ResetButton, 0) gump:Fade (_detalhes.ResetButton2, 1) + + local alpha = self:GetInstanceCurrentAlpha() + _detalhes.ResetButton2:SetAlpha (alpha) + _detalhes.ResetButtonMode = 1 end end @@ -405,14 +452,16 @@ end for index = T+1, C do - if (index <= X) then - gump:Fade (self.barras[index], "out") - else - --gump:Fade (self.barras[index], "in") - if (self.baseframe.isStretching or self.auto_resize) then - gump:Fade (self.barras[index], 1) + local barra = self.barras[index] + if (barra) then + if (index <= X) then + gump:Fade (barra, "out") else - gump:Fade (self.barras[index], "in", 0.1) + if (self.baseframe.isStretching or self.auto_resize) then + gump:Fade (barra, 1) + else + gump:Fade (barra, "in", 0.1) + end end end end @@ -436,11 +485,13 @@ self.barraS[2] = fim_iterator for index = T, C+1, -1 do - --gump:Fade (self.barras[index], "in") - if (self.baseframe.isStretching or self.auto_resize) then - gump:Fade (self.barras[index], 1) - else - gump:Fade (self.barras[index], "in", 0.1) + local barra = self.barras[index] + if (barra) then + if (self.baseframe.isStretching or self.auto_resize) then + gump:Fade (barra, 1) + else + gump:Fade (barra, "in", 0.1) + end end end end @@ -663,3 +714,141 @@ end end + + +--> create bubble + local f = CreateFrame ("frame", "DetailsBubble", UIParent) + f:SetPoint ("center", UIParent, "center") + f:SetSize (100, 100) + f:SetFrameStrata ("TOOLTIP") + f.isHorizontalFlipped = false + f.isVerticalFlipped = false + + local t = f:CreateTexture (nil, "artwork") + t:SetTexture ([[Interface\AddOns\Details\images\icons]]) + t:SetSize (131 * 1.2, 81 * 1.2) + --377 328 508 409 0.0009765625 + t:SetTexCoord (0.7373046875, 0.9912109375, 0.6416015625, 0.7978515625) + t:SetPoint ("center", f, "center") + + local line1 = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + line1:SetPoint ("topleft", t, "topleft", 24, -10) + _detalhes:SetFontSize (line1, 9) + line1:SetTextColor (.9, .9, .9, 1) + line1:SetSize (110, 12) + line1:SetJustifyV ("center") + line1:SetJustifyH ("center") + + local line2 = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + line2:SetPoint ("topleft", t, "topleft", 11, -20) + _detalhes:SetFontSize (line2, 9) + line2:SetTextColor (.9, .9, .9, 1) + line2:SetSize (140, 12) + line2:SetJustifyV ("center") + line2:SetJustifyH ("center") + + local line3 = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + line3:SetPoint ("topleft", t, "topleft", 7, -30) + _detalhes:SetFontSize (line3, 9) + line3:SetTextColor (.9, .9, .9, 1) + line3:SetSize (144, 12) + line3:SetJustifyV ("center") + line3:SetJustifyH ("center") + + local line4 = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + line4:SetPoint ("topleft", t, "topleft", 11, -40) + _detalhes:SetFontSize (line4, 9) + line4:SetTextColor (.9, .9, .9, 1) + line4:SetSize (140, 12) + line4:SetJustifyV ("center") + line4:SetJustifyH ("center") + + local line5 = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + line5:SetPoint ("topleft", t, "topleft", 24, -50) + _detalhes:SetFontSize (line5, 9) + line5:SetTextColor (.9, .9, .9, 1) + line5:SetSize (110, 12) + line5:SetJustifyV ("center") + line5:SetJustifyH ("center") + + f.lines = {line1, line2, line3, line4, line5} + + --t:SetPoint ("center", UIParent, "center") + + function f:FlipHorizontal() + if (not f.isHorizontalFlipped) then + if (f.isVerticalFlipped) then + t:SetTexCoord (0.9912109375, 0.7373046875, 0.7978515625, 0.6416015625) + else + t:SetTexCoord (0.9912109375, 0.7373046875, 0.6416015625, 0.7978515625) + end + f.isHorizontalFlipped = true + else + if (f.isVerticalFlipped) then + t:SetTexCoord (0.7373046875, 0.9912109375, 0.7978515625, 0.6416015625) + else + t:SetTexCoord (0.7373046875, 0.9912109375, 0.6416015625, 0.7978515625) + end + f.isHorizontalFlipped = false + end + end + + function f:FlipVertical() + + if (not f.isVerticalFlipped) then + if (f.isHorizontalFlipped) then + t:SetTexCoord (0.7373046875, 0.9912109375, 0.7978515625, 0.6416015625) + else + t:SetTexCoord (0.9912109375, 0.7373046875, 0.7978515625, 0.6416015625) + end + f.isVerticalFlipped = true + else + if (f.isHorizontalFlipped) then + t:SetTexCoord (0.7373046875, 0.9912109375, 0.6416015625, 0.7978515625) + else + t:SetTexCoord (0.9912109375, 0.7373046875, 0.6416015625, 0.7978515625) + end + f.isVerticalFlipped = false + end + end + + function f:SetBubbleText (line1, line2, line3, line4, line5) + if (not line1) then + for _, line in ipairs (f.lines) do + line:SetText ("") + end + return + end + + if (line1:find ("\n")) then + line1, line2, line3, line4, line5 = strsplit ("\n", line1) + end + + f.lines[1]:SetText (line1) + f.lines[2]:SetText (line2) + f.lines[3]:SetText (line3) + f.lines[4]:SetText (line4) + f.lines[5]:SetText (line5) + end + + function f:SetOwner (frame, myPoint, hisPoint, x, y, alpha) + f:ClearAllPoints() + f:SetBubbleText (nil) + t:SetTexCoord (0.7373046875, 0.9912109375, 0.6416015625, 0.7978515625) + f.isHorizontalFlipped = false + f.isVerticalFlipped = false + f:SetPoint (myPoint or "bottom", frame, hisPoint or "top", x or 0, y or 0) + t:SetAlpha (alpha or 1) + end + + function f:ShowBubble() + f:Show() + end + + function f:HideBubble() + f:Hide() + end + + f:SetBubbleText (nil) + + f:Hide() \ No newline at end of file diff --git a/framework/button.lua b/framework/button.lua index 6e2e42fc..74ab442a 100644 --- a/framework/button.lua +++ b/framework/button.lua @@ -761,12 +761,17 @@ local set_colorpick_color = function (button, r, g, b, a) button.color_texture:SetVertexColor (r, g, b, a) end +local colorpick_cancel = function (self) + ColorPickerFrame:Hide() +end + function gump:NewColorPickButton (parent, name, member, callback, alpha) --button local button = gump:NewButton (parent, _, name, member, color_button_width, color_button_height, pickcolor, alpha, "param2") button:InstallCustomTexture() button.color_callback = callback + button.Cancel = colorpick_cancel button.SetColor = set_colorpick_color button:SetBackdrop ({edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 6, diff --git a/framework/cooltip.lua b/framework/cooltip.lua index 1ec69b05..8b5f8398 100644 --- a/framework/cooltip.lua +++ b/framework/cooltip.lua @@ -2,6 +2,7 @@ local _detalhes = _G._detalhes local AceLocale = LibStub ("AceLocale-3.0") local Loc = AceLocale:GetLocale ( "Details" ) +local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") local gump = _detalhes.gump local _ @@ -86,6 +87,7 @@ function DetailsCreateCoolTip() ["StatusBarTexture"] = true, ["TextSize"] = true, ["TextFont"] = true, + ["TextColor"] = true, ["LeftTextWidth"] = true, ["RightTextWidth"] = true, ["LeftTextHeight"] = true, @@ -126,6 +128,7 @@ function DetailsCreateCoolTip() ["StatusBarTexture"] = nil, ["TextSize"] = nil, ["TextFont"] = nil, + ["TextColor"] = nil, ["LeftTextWidth"] = nil, ["RightTextWidth"] = nil, ["LeftTextHeight"] = nil, @@ -592,7 +595,7 @@ function DetailsCreateCoolTip() end function CoolTip:TextAndIcon (index, frame, menuButton, leftTextTable, rightTextTable, leftIconTable, rightIconTable, isSub) - + --> reset width menuButton.leftText:SetWidth (0) menuButton.leftText:SetHeight (0) @@ -603,7 +606,19 @@ function DetailsCreateCoolTip() if (leftTextTable) then menuButton.leftText:SetText (leftTextTable [1]) - menuButton.leftText:SetTextColor (leftTextTable [2], leftTextTable [3], leftTextTable [4], leftTextTable [5]) + + local r, g, b, a = leftTextTable [2], leftTextTable [3], leftTextTable [4], leftTextTable [5] + + if (r == 0 and g == 0 and b == 0 and a == 0) then + if (CoolTip.OptionsTable.TextColor) then + r, g, b, a = gump:ParseColors (CoolTip.OptionsTable.TextColor) + menuButton.leftText:SetTextColor (r, g, b, a) + else + menuButton.leftText:SetTextColor (1, 1, 1, 1) + end + else + menuButton.leftText:SetTextColor (r, g, b, a) + end if (CoolTip.OptionsTable.TextSize and not leftTextTable [6]) then _detalhes:SetFontSize (menuButton.leftText, CoolTip.OptionsTable.TextSize) @@ -622,22 +637,31 @@ function DetailsCreateCoolTip() end if (CoolTip.OptionsTable.TextFont and not leftTextTable [7]) then - menuButton.leftText:SetFontObject (CoolTip.OptionsTable.TextFont) - end - local face, size, flags = menuButton.leftText:GetFont() + if (_G [CoolTip.OptionsTable.TextFont]) then + menuButton.leftText:SetFontObject (GameFontRed or CoolTip.OptionsTable.TextFont) + else + local font = SharedMedia:Fetch ("font", CoolTip.OptionsTable.TextFont) + local _, size, flags = menuButton.leftText:GetFont() + menuButton.leftText:SetFont (font, size, flags) + end - if (_G [leftTextTable [7]]) then - menuButton.leftText:SetFontObject (leftTextTable [7]) - local face, size, flags = menuButton.leftText:GetFont() - size = leftTextTable [6] or CoolTip.OptionsTable.TextSize or size - - menuButton.leftText:SetFont (face, size, flags) + elseif (leftTextTable [7]) then + if (_G [leftTextTable [7]]) then + menuButton.leftText:SetFontObject (leftTextTable [7]) + local face, size, flags = menuButton.leftText:GetFont() + size = leftTextTable [6] or CoolTip.OptionsTable.TextSize or size + menuButton.leftText:SetFont (face, size, flags) + else + local font = SharedMedia:Fetch ("font", leftTextTable [7]) + local face, size, flags = menuButton.leftText:GetFont() + size = leftTextTable [6] or CoolTip.OptionsTable.TextSize or size + menuButton.leftText:SetFont (face, size, flags) + end else size = leftTextTable [6] or CoolTip.OptionsTable.TextSize or 10 face = leftTextTable [7] or [[Fonts\FRIZQT__.TTF]] flags = leftTextTable [8] - menuButton.leftText:SetFont (face, size, flags) end @@ -647,7 +671,19 @@ function DetailsCreateCoolTip() if (rightTextTable) then menuButton.rightText:SetText (rightTextTable [1]) - menuButton.rightText:SetTextColor (rightTextTable [2], rightTextTable [3], rightTextTable [4], rightTextTable [5]) + + local r, g, b, a = rightTextTable [2], rightTextTable [3], rightTextTable [4], rightTextTable [5] + + if (r == 0 and g == 0 and b == 0 and a == 0) then + if (CoolTip.OptionsTable.TextColor) then + r, g, b, a = gump:ParseColors (CoolTip.OptionsTable.TextColor) + menuButton.rightText:SetTextColor (r, g, b, a) + else + menuButton.rightText:SetTextColor (1, 1, 1, 1) + end + else + menuButton.rightText:SetTextColor (r, g, b, a) + end if (CoolTip.OptionsTable.TextSize and not rightTextTable [6]) then _detalhes:SetFontSize (menuButton.rightText, CoolTip.OptionsTable.TextSize) @@ -666,19 +702,29 @@ function DetailsCreateCoolTip() end if (CoolTip.OptionsTable.TextFont and not rightTextTable [7]) then - menuButton.rightText:SetFontObject (CoolTip.OptionsTable.TextFont) - end + if (_G [CoolTip.OptionsTable.TextFont]) then + menuButton.rightText:SetFontObject (CoolTip.OptionsTable.TextFont) + else + local font = SharedMedia:Fetch ("font", CoolTip.OptionsTable.TextFont) + local _, size, flags = menuButton.rightText:GetFont() + menuButton.rightText:SetFont (font, size, flags) + end - local face, size, flags = menuButton.rightText:GetFont() + elseif (rightTextTable [7]) then + if (_G [rightTextTable [7]]) then + menuButton.rightText:SetFontObject (rightTextTable [7]) + local face, size, flags = menuButton.rightText:GetFont() + size = rightTextTable [6] or CoolTip.OptionsTable.TextSize or size + menuButton.rightText:SetFont (face, size, flags) + else + local font = SharedMedia:Fetch ("font", rightTextTable [7]) + local face, size, flags = menuButton.rightText:GetFont() + size = rightTextTable [6] or CoolTip.OptionsTable.TextSize or size + menuButton.rightText:SetFont (face, size, flags) + end - if (_G [rightTextTable [7]]) then - menuButton.rightText:SetFontObject (rightTextTable [7]) - local face, size, flags = menuButton.rightText:GetFont() - size = rightTextTable [6] or CoolTip.OptionsTable.TextSize or size - - menuButton.rightText:SetFont (face, size, flags) else - size = rightTextTable [6] or 10 + size = rightTextTable [6] or CoolTip.OptionsTable.TextSize or 10 face = rightTextTable [7] or [[Fonts\FRIZQT__.TTF]] flags = rightTextTable [8] menuButton.rightText:SetFont (face, size, flags) @@ -1784,10 +1830,10 @@ function DetailsCreateCoolTip() end lineTable_left [1] = leftText --> line text - lineTable_left [2] = 1 - lineTable_left [3] = 1 - lineTable_left [4] = 1 - lineTable_left [5] = 1 + lineTable_left [2] = 0 + lineTable_left [3] = 0 + lineTable_left [4] = 0 + lineTable_left [5] = 0 lineTable_left [6] = false lineTable_left [7] = false lineTable_left [8] = false @@ -1876,10 +1922,10 @@ function DetailsCreateCoolTip() end subMenuTablesTexts [1] = leftText --> line text - subMenuTablesTexts [2] = 1 - subMenuTablesTexts [3] = 1 - subMenuTablesTexts [4] = 1 - subMenuTablesTexts [5] = 1 + subMenuTablesTexts [2] = 0 + subMenuTablesTexts [3] = 0 + subMenuTablesTexts [4] = 0 + subMenuTablesTexts [5] = 0 subMenuTablesTexts [6] = false subMenuTablesTexts [7] = false subMenuTablesTexts [8] = false @@ -2233,7 +2279,7 @@ function DetailsCreateCoolTip() ColorR2, ColorG2, ColorB2, ColorA2, fontSize, fontFace, fontFlag = ColorG1, ColorB1, ColorA1, ColorR2, ColorG2, ColorB2, ColorA2 if (type (ColorR1) == "boolean" or not ColorR1) then - ColorR1, ColorG1, ColorB1, ColorA1 = 1, 1, 1, 1 + ColorR1, ColorG1, ColorB1, ColorA1 = 0, 0, 0, 0 else ColorR1, ColorG1, ColorB1, ColorA1 = gump:ParseColors (ColorR1) end @@ -2243,7 +2289,7 @@ function DetailsCreateCoolTip() fontSize, fontFace, fontFlag = ColorG2, ColorB2, ColorA2 if (type (ColorR2) == "boolean" or not ColorR2) then - ColorR2, ColorG2, ColorB2, ColorA2 = 1, 1, 1, 1 + ColorR2, ColorG2, ColorB2, ColorA2 = 0, 0, 0, 0 else ColorR2, ColorG2, ColorB2, ColorA2 = gump:ParseColors (ColorR2) end diff --git a/framework/dropdown.lua b/framework/dropdown.lua index fea17401..1a42c3ca 100644 --- a/framework/dropdown.lua +++ b/framework/dropdown.lua @@ -613,7 +613,12 @@ function DetailsDropDownOnEnter (self) end end - self:SetBackdropColor (.2, .2, .2, .2) + if (self.MyObject.onenter_backdrop) then + self:SetBackdropColor (unpack (self.MyObject.onenter_backdrop)) + else + self:SetBackdropColor (.2, .2, .2, .2) + end + self.arrowTexture2:Show() if (self.MyObject.have_tooltip) then @@ -635,15 +640,20 @@ function DetailsDropDownOnEnter (self) end function DetailsDropDownOnLeave (self) - self:SetBackdropColor (1, 1, 1, .5) - self.arrowTexture2:Hide() - if (self.MyObject.OnLeaveHook) then local interrupt = self.MyObject.OnLeaveHook (self) if (interrupt) then return end end + + if (self.MyObject.onleave_backdrop) then + self:SetBackdropColor (unpack (self.MyObject.onleave_backdrop)) + else + self:SetBackdropColor (1, 1, 1, .5) + end + + self.arrowTexture2:Hide() if (self.MyObject.have_tooltip) then _detalhes.popup:ShowMe (false) @@ -790,17 +800,23 @@ function gump:NewDropDown (parent, container, name, member, w, h, func, default) --> initialize first menu selected local menu = func() - for i = default, #menu do - local _table = menu [i] - if (not _table) then - break - end - if (isOptionVisible (_table)) then - DropDownObject:Selected (_table) - break + if (type (default) == "string") then + DropDownObject:Select (default) + else + for i = default, #menu do + local _table = menu [i] + if (not _table) then + break + end + if (isOptionVisible (_table)) then + DropDownObject:Selected (_table) + break + end end end + + return DropDownObject end \ No newline at end of file diff --git a/framework/pictureedit.lua b/framework/pictureedit.lua index 4ec6458a..7b20b986 100644 --- a/framework/pictureedit.lua +++ b/framework/pictureedit.lua @@ -358,59 +358,11 @@ local _ --> flip local flip = function (side) if (side == 1) then - if (not haveHFlip) then - if (not haveVFlip) then - edit_texture:SetTexCoord (1, 0, 0, 1) - else - edit_texture:SetTexCoord (1, 0, 1, 0) - end - rightCoordTexture:Hide() - leftCoordTexture:Hide() - rightSlider:Hide() - leftSlider:Hide() - leftTexCoordButton:Disable() - rightTexCoordButton:Disable() - else - if (not haveVFlip) then - edit_texture:SetTexCoord (0, 1, 0, 1) - else - edit_texture:SetTexCoord (0, 1, 1, 0) - end - rightCoordTexture:Show() - leftCoordTexture:Show() - leftTexCoordButton:Enable() - rightTexCoordButton:Enable() - end haveHFlip = not haveHFlip if (window.callback_func) then window.accept (true) end - - elseif (side == 2) then - if (not haveVFlip) then - if (not haveHFlip) then - edit_texture:SetTexCoord (0, 1, 1, 0) - else - edit_texture:SetTexCoord (1, 0, 1, 0) - end - topCoordTexture:Hide() - bottomCoordTexture:Hide() - topSlider:Hide() - bottomSlider:Hide() - topTexCoordButton:Disable() - bottomTexCoordButton:Disable() - else - if (not haveHFlip) then - edit_texture:SetTexCoord (0, 1, 0, 1) - else - edit_texture:SetTexCoord (1, 0, 0, 1) - end - topCoordTexture:Show() - bottomCoordTexture:Show() - topTexCoordButton:Enable() - bottomTexCoordButton:Enable() - end haveVFlip = not haveVFlip if (window.callback_func) then window.accept (true) @@ -437,20 +389,22 @@ local _ end local coords = {} + local l, r, t, b = leftSlider.value/100, rightSlider.value/100, topSlider.value/100, bottomSlider.value/100 + if (haveHFlip) then - coords [1] = 1 - coords [2] = 0 + coords [1] = r + coords [2] = l else - coords [1] = leftSlider.value/100 - coords [2] = rightSlider.value /100 + coords [1] = l + coords [2] = r end if (haveVFlip) then - coords [3] = 1 - coords [4] = 0 + coords [3] = b + coords [4] = t else - coords [3] = topSlider.value/100 - coords [4] = bottomSlider.value/100 + coords [3] = t + coords [4] = b end return window.callback_func (edit_texture.width, edit_texture.height, {edit_texture:GetVertexColor()}, edit_texture:GetAlpha(), coords, window.extra_param) @@ -459,22 +413,19 @@ local _ local acceptButton = g:NewButton (buttonsBackground, nil, "$parentAcceptButton", nil, 100, 20, window.accept, nil, nil, nil, "DONE") acceptButton:SetPoint ("topleft", window, "topright", 10, -200) acceptButton:InstallCustomTexture() - - -- fazer botao de editar a cor - -- fazer botao de editar o tamanho - -- fazer botao de okey e retornar os valores - window:Hide() ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local ttexcoord - function g:ImageEditor (callback, texture, texcoord, colors, width, height, extraParam) + function g:ImageEditor (callback, texture, texcoord, colors, width, height, extraParam, alpha) texcoord = texcoord or {0, 1, 0, 1} ttexcoord = texcoord colors = colors or {1, 1, 1, 1} + + alpha = alpha or 1 edit_texture:SetTexture (texture) edit_texture.width = width @@ -482,7 +433,7 @@ window:Hide() edit_texture:SetVertexColor (colors [1], colors [2], colors [3]) - edit_texture:SetAlpha (colors [4] or 1) + edit_texture:SetAlpha (alpha) _detalhes:ScheduleTimer ("RefreshImageEditor", 0.2) @@ -499,26 +450,28 @@ window:Hide() window.width = edit_texture.width window.height = edit_texture.height - if (ttexcoord[1] == 1 and ttexcoord[2] == 0) then - haveHFlip = false - flip (1) - else + local l, r, t, b = unpack (ttexcoord) + + if (l > r) then haveHFlip = true - flip (1) - leftSlider:SetValue (ttexcoord[1]*100) - rightSlider:SetValue (ttexcoord[2]*100) - end - - if (ttexcoord[3] == 1 and ttexcoord[4] == 0) then - haveVFlip = false - flip (2) + leftSlider:SetValue (r * 100) + rightSlider:SetValue (l * 100) else - haveVFlip = true - flip (2) - topSlider:SetValue (ttexcoord[3]*100) - bottomSlider:SetValue (ttexcoord[4]*100) + haveHFlip = false + leftSlider:SetValue (l * 100) + rightSlider:SetValue (r * 100) end + if (t > b) then + haveVFlip = true + topSlider:SetValue (b * 100) + bottomSlider:SetValue (t * 100) + else + haveVFlip = false + topSlider:SetValue (t * 100) + bottomSlider:SetValue (b * 100) + end + if (window.callback_func) then window.accept (true) end diff --git a/framework/slider.lua b/framework/slider.lua index 9889568e..1d51fee1 100644 --- a/framework/slider.lua +++ b/framework/slider.lua @@ -11,6 +11,7 @@ local _math_floor = math.floor --> lua local local loadstring = loadstring --> lua local local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) +local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") local cleanfunction = function() end local APISliderFunctions = false @@ -315,8 +316,11 @@ local SliderMetaFunctions = {} slider.thumb:SetAlpha (1) if (slider.MyObject.have_tooltip) then - GameCooltip:Reset() + _detalhes:CooltipPreset (1) GameCooltip:AddLine (slider.MyObject.have_tooltip) + if (slider.MyObject.have_tooltip == Loc ["STRING_RIGHTCLICK_TYPEVALUE"]) then + GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 16, 16, 0.015625, 0.15671875, 0.640625, 0.798828125) + end GameCooltip:ShowCooltip (slider, "tooltip") end @@ -474,13 +478,73 @@ local SliderMetaFunctions = {} end slider.MyObject.ivalue = amt end - - ------------------------------------------------------------------------------------------------------------ --> object constructor -function gump:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defaultv, color_inverted) +local SwitchOnClick = function (self, button, forced_value, value) + + local slider = self.MyObject + + if (forced_value) then + rawset (slider, "value", not value) + end + + if (rawget (slider, "value")) then --actived + + rawset (slider, "value", false) + slider._text:SetText (slider._ltext) + slider._thumb:ClearAllPoints() + + slider:SetBackdropColor (1, 0, 0, 0.4) + slider._thumb:SetPoint ("left", slider.widget, "left") + + else + + rawset (slider, "value", true) + slider._text:SetText (slider._rtext) + slider._thumb:ClearAllPoints() + + slider:SetBackdropColor (0, 0, 1, 0.4) + slider._thumb:SetPoint ("right", slider.widget, "right") + + end + + if (slider.OnSwitch and not forced_value) then + local value = rawget (slider, "value") + if (slider.return_func) then + value = slider:return_func (value) + end + slider.OnSwitch (slider, slider.FixedValue, value) + end + +end + +local default_switch_func = function (self, passed_value) + if (self.value) then + return false + else + return true + end +end + +local switch_get_value = function (self) + return self.value +end + +local switch_set_value = function (self, value) + if (self.switch_func) then + value = self:switch_func (value) + end + + SwitchOnClick (self.widget, nil, true, value) +end + +local switch_set_fixparameter = function (self, value) + _rawset (self, "FixedValue", value) +end + +function gump:NewSwitch (parent, container, name, member, w, h, ltext, rtext, default_value, color_inverted, switch_func, return_func) --> early checks if (not name) then @@ -496,54 +560,47 @@ function gump:NewSwitch (parent, container, name, member, w, h, ltext, rtext, de ltext = ltext or "OFF" rtext = rtext or "ON" - if (type (defaultv) == "boolean" and not defaultv) then - defaultv = 1 - elseif (type (defaultv) == "boolean" and defaultv) then - defaultv = 2 - else - defaultv = defaultv or 1 - end - --> build frames - local slider = gump:NewSlider (parent, container, name, member, w, h, 1, 2, 1, defaultv, nil, true) + + local slider = gump:NewButton (parent, container, name, member, w, h) + + slider.switch_func = switch_func + slider.return_func = return_func + slider.SetValue = switch_set_value + slider.GetValue = switch_get_value + slider.SetFixedParameter = switch_set_fixparameter + + if (member) then + parent [member] = slider + end 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}}) + local thumb = slider:CreateTexture (nil, "artwork") + thumb:SetTexture ("Interface\\Buttons\\UI-ScrollBar-Knob") + thumb:SetSize (34+(h*0.2), h*1.2) + thumb:SetAlpha (0.7) + thumb:SetPoint ("left", slider.widget, "left") + + local text = slider:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + text:SetTextColor (.8, .8, .8, 1) + text:SetPoint ("center", thumb, "center") + + slider._text = text + slider._thumb = thumb + slider._ltext = ltext + slider._rtext = rtext + slider.thumb = thumb + 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 - 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 - - 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) - - slider:SetValue (1) - slider:SetValue (2) - slider:SetValue (defaultv) - + slider:SetScript ("OnClick", SwitchOnClick) + + slider:SetValue (default_value) + slider.isSwitch = true - + return slider end @@ -621,17 +678,12 @@ function gump:NewSlider (parent, container, name, member, w, h, min, max, step, SliderObject.slider:SetValueStep (step) SliderObject.slider:SetValue (defaultv) SliderObject.ivalue = defaultv - - --SliderObject.amt = _G [name .. "_Amt"] - --SliderObject.lock = _G [name .. "_LockTexture"] - --SliderObject.thumb = _G [name .. "_ThumbTexture"] - + SliderObject.slider:SetBackdrop ({edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", edgeSize = 8}) SliderObject.slider:SetBackdropColor (0.9, 0.7, 0.7, 1.0) - + SliderObject.thumb = SliderObject.slider:CreateTexture (nil, "artwork") SliderObject.thumb:SetTexture ("Interface\\Buttons\\UI-ScrollBar-Knob") - --SliderObject.thumb:SetSize (30, 24) SliderObject.thumb:SetSize (30+(h*0.2), h*1.2) SliderObject.thumb:SetAlpha (0.7) SliderObject.slider:SetThumbTexture (SliderObject.thumb) diff --git a/framework/textentry.lua b/framework/textentry.lua index bf3c5d13..77133d52 100644 --- a/framework/textentry.lua +++ b/framework/textentry.lua @@ -260,12 +260,9 @@ local TextEntryMetaFunctions = {} end if (textentry.MyObject.have_tooltip) then - GameCooltip:Reset() - GameCooltip:SetType ("tooltip") - GameCooltip:SetColor ("main", "transparent") + _detalhes:CooltipPreset (1) GameCooltip:AddLine (textentry.MyObject.have_tooltip) - GameCooltip:SetOwner (textentry) - GameCooltip:ShowCooltip() + GameCooltip:ShowCooltip (textentry, "tooltip") end textentry.mouse_over = true diff --git a/functions/boss.lua b/functions/boss.lua index 53d6e85c..46c3f274 100644 --- a/functions/boss.lua +++ b/functions/boss.lua @@ -143,7 +143,11 @@ do --> return the boss portrit function _detalhes:GetBossPortrait (mapid, bossindex) - return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex].portrait + if (mapid and bossindex) then + return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex].portrait + else + return false + end end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/functions/savedata.lua b/functions/savedata.lua index b98289cb..05dc1e52 100644 --- a/functions/savedata.lua +++ b/functions/savedata.lua @@ -13,6 +13,10 @@ end function _detalhes:SaveDataOnLogout() +if (true) then + return +end + if (_detalhes.wipe_full_config) then _detalhes_global = nil _detalhes_database = nil @@ -417,18 +421,28 @@ function _detalhes:WipeConfig() end +local is_exception = { + ["nick_tag_cache"] = true +} + function _detalhes:SaveConfig() + --> nicktag cache + --_detalhes.copy_nick_tag = table_deepcopy (_detalhes_database.nick_tag_cache) + --> cleanup _detalhes:PrepareTablesForSave() _detalhes_database.tabela_instancias = _detalhes.tabela_instancias + _detalhes_database.tabela_historico = _detalhes.tabela_historico --> buffs _detalhes.Buffs:SaveBuffs() --> salva o container do personagem for key, value in pairs (_detalhes.default_player_data) do - _detalhes_database [key] = _detalhes [key] + if (not is_exception [key]) then + _detalhes_database [key] = _detalhes [key] + end end --> salva o container das globais diff --git a/functions/skins.lua b/functions/skins.lua index f34d0062..a9597084 100644 --- a/functions/skins.lua +++ b/functions/skins.lua @@ -53,6 +53,7 @@ local _ instance_cprops = { menu_anchor = {5, 1}, + plugins_grow_direction = 2, } }) @@ -94,7 +95,7 @@ local _ --overwrites instance_cprops = { hide_icon = true, - menu_anchor = {-18, 1}, + menu_anchor = {-81, 1, side = 2}, instance_button_anchor = {-12, 3}, instancebutton_info = {text_color = {.8, .6, .0, 0.8}, text_face = "Friz Quadrata TT", text_size = 10, color_overlay = {1, 1, 1, 1}}, resetbutton_info = {text_color = {.8, .8, .8, 0.8}, text_color_small = {0, 0, 0, 0}, text_face = "Friz Quadrata TT", text_size = 12, color_overlay = {1, 1, 1, 1}, always_small = true}, @@ -102,6 +103,12 @@ local _ show_statusbar = false, color = {.3, .3, .3, 1}, bg_alpha = 0.2, + plugins_grow_direction = 1, + row_info = { + texture = "Blizzard Character Skills Bar", + font_face = "Arial Narrow", + }, + attribute_text = {enabled = true, side = 1, text_size = 12, anchor = {-18, 4}, text_color = {1, 1, 1, 1}, text_face = "Arial Narrow"}, }, callback = function (skin) @@ -349,10 +356,14 @@ local _ --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}, - + --reset_button_small_coords = {0.11669921875, 0.13720703125, 0.50244140625, 0.51708984375}, + reset_button_small_coords = {0.1162109375, 0.13671875, 0.50390625, 0.5146484375+0.00048828125+0.00048828125}, -- 119 516 140 527 + reset_button_small_size = {22, 12}, --instance button - instance_button_coords = {0.01904296875, 0.04736328125, 0.48388671875, 0.49853515625}, + --instance_button_coords = {0.01904296875, 0.04736328125, 0.48388671875, 0.49853515625}, + instance_button_coords = {0.0185546875, 0.046875+0.00048828125, 0.4833984375, 0.498046875+0.00048828125},--19 495 48 510 + instance_button_size = 12, + --0.00048828125 --close button close_button_coords = {0.01904296875, 0.03369140625, 0.52197265625, 0.53662109375}, @@ -399,15 +410,17 @@ local _ space = {left = 1, right = -2, between = 0}, }, wallpaper = { - overlay = {0, 0, 0, 0.498038113117218}, + overlay = {0, 0, 0}, width = 227.1267691385938, texcoord = {0.001000000014901161, 0.1710000038146973, 0.001000000014901161, 0.3539316177368164}, enabled = true, anchor = "all", height = 89.00001440917025, - alpha = 0.4980392451398075, + alpha = 0.6, texture = "Interface\\Glues\\CREDITS\\Badlands3", } } }) + + --alpha = 0.4980392451398075, \ No newline at end of file diff --git a/functions/slash.lua b/functions/slash.lua index cadf79dc..dbdb26ff 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -250,6 +250,42 @@ function SlashCmdList.DETAILS (msg, editbox) --vardump (_detalhes.ResetButton) + elseif (command == "buffsof") then + + local playername, segment = rest:match("^(%S*)%s*(.-)$") + segment = tonumber (segment or 0) + print ("dumping buffs of ", playername, segment) + + local c = _detalhes:GetCombat ("current") + if (c) then + + local playerActor + + if (segment and segment ~= 0) then + local c = _detalhes:GetCombat (segment) + playerActor = c (4, playername) + print ("using segment", segment, c, "player actor:", playerActor) + else + playerActor = c (4, playername) + end + + print ("actor table: ", playerActor) + + if (not playerActor) then + print ("actor table not found") + return + end + + if (playerActor and playerActor.buff_uptime_spell_tables and playerActor.buff_uptime_spell_tables._ActorTable) then + for spellid, spellTable in pairs (playerActor.buff_uptime_spell_tables._ActorTable) do + local spellname = GetSpellInfo (spellid) + if (spellname) then + print (spellid, spellname, spellTable.uptime) + end + end + end + end + elseif (msg == "alert") then local instancia = _detalhes.tabela_instancias [1] diff --git a/functions/spells.lua b/functions/spells.lua index 9a915919..9f269625 100644 --- a/functions/spells.lua +++ b/functions/spells.lua @@ -967,6 +967,11 @@ do [115310] = {180, 0, 0}, -- Revival [119582] = {60, 0, 0}, -- Purifying Brew [116844] = {45, 8, 0}, --Ring of Peace + [115308] = {0, 6, 0}, --Elusive Brew + [122783] = {90, 6}, -- Diffuse Magic + [122278] = {90, 45}, -- Dampen Harm + [115176] = {180, 8}, -- Zen Meditation + [115203] = {180, 20}, -- Fortifying Brew --["PALADIN"] = {}, [633] = {600, 0, 0}, --Lay on Hands @@ -1024,12 +1029,8 @@ do ["MAGE"] = {45438}, -- Monk - [115203] = {180, 20}, -- Fortifying Brew [122470] = {90, 10}, -- Touch of Karma - [115176] = {180, 8}, -- Zen Meditation [115213] = {180, 6}, -- Avert Harm - [122278] = {90, 45}, -- Dampen Harm - [122783] = {90, 6}, -- Diffuse Magic ["MONK"] = {115295, 115203, 122470, 115176, 116849, 115213, 122278, 122783}, -- Paladin diff --git a/gumps/janela_info.lua b/gumps/janela_info.lua index 0a692e39..c8169226 100644 --- a/gumps/janela_info.lua +++ b/gumps/janela_info.lua @@ -63,13 +63,45 @@ function _detalhes:AbreJanelaInfo (jogador) if (nome:find ("-")) then nome = nome:gsub (("-.*"), "") end - info.nome:SetText (nome) - + if (info.instancia.atributo == 1 and info.instancia.sub_atributo == 6) then --> enemy atributo_nome = sub_atributos [info.atributo].lista [1] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] end - + + info.nome:SetText (nome) info.atributo_nome:SetText (atributo_nome) + + local avatar = NickTag:GetNicknameTable (jogador.serial) + if (avatar) then + + info.avatar:SetTexture (avatar [2]) + info.avatar_bg:SetTexture (avatar [4]) + info.avatar_bg:SetTexCoord (unpack (avatar [5])) + info.avatar_bg:SetVertexColor (unpack (avatar [6])) + + info.avatar_nick:SetText (avatar [1] or nome) + info.avatar_attribute:SetText (atributo_nome) + info.avatar_attribute:SetPoint ("CENTER", info.avatar_nick, "CENTER", 0, 14) + + info.avatar:Show() + info.avatar_bg:Show() + info.avatar_nick:Show() + info.avatar_attribute:Show() + + info.nome:Hide() + info.atributo_nome:Hide() + else + info.avatar:Hide() + info.avatar_bg:Hide() + info.avatar_nick:Hide() + info.avatar_attribute:Hide() + + info.nome:Show() + info.atributo_nome:Show() + end + + + info.atributo_nome:SetPoint ("CENTER", info.nome, "CENTER", 0, 14) gump:TrocaBackgroundInfo (info) @@ -547,6 +579,25 @@ local function cria_textos (este_gump) este_gump.targets = este_gump:CreateFontString (nil, "OVERLAY", "QuestFont_Large") este_gump.targets:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 24, -235) este_gump.targets:SetText (Loc ["STRING_TARGETS"] .. ":") + + este_gump.avatar = este_gump:CreateTexture (nil, "overlay") + este_gump.avatar_bg = este_gump:CreateTexture (nil, "overlay") + este_gump.avatar_attribute = este_gump:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + este_gump.avatar_nick = este_gump:CreateFontString (nil, "overlay", "QuestFont_Large") + este_gump.avatar:SetDrawLayer ("overlay", 3) + este_gump.avatar_bg:SetDrawLayer ("overlay", 2) + este_gump.avatar_nick:SetDrawLayer ("overlay", 4) + + este_gump.avatar:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 70, -10) + este_gump.avatar_bg:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 70, -12) + este_gump.avatar_bg:SetSize (275, 60) + + este_gump.avatar_nick:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 208, -54) + + este_gump.avatar:Hide() + este_gump.avatar_bg:Hide() + este_gump.avatar_nick:Hide() + end @@ -1087,25 +1138,50 @@ function gump:CriaJanelaInfo() --SPELLS local spells_texture = frame:CreateTexture (nil, "artwork") - spells_texture:SetPoint ("topleft", frame, "topleft", 400, -100) + spells_texture:SetPoint ("topleft", frame, "topleft", 400, -80) spells_texture:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-HorizontalShadow]]) spells_texture:SetSize (128, 16) local spells_text = frame:CreateFontString (nil, "artwork", "GameFontNormal") spells_text:SetText ("Spells") spells_text :SetPoint ("left", spells_texture, "left", 2, 0) - for i = 1, 9 do - local icon = frame:CreateTexture (nil, "artwork") + local frame_tooltip_onenter = function (self) + if (self.spellid) then + self:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 512, edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", edgeSize = 8}) + self:SetBackdropColor (.5, .5, .5, .5) + GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT") + GameTooltip:SetSpellByID (self.spellid) + GameTooltip:Show() + end + end + local frame_tooltip_onleave = function (self) + if (self.spellid) then + self:SetBackdrop (nil) + GameTooltip:Hide() + end + end + + for i = 1, 10 do + local frame_tooltip = CreateFrame ("frame", nil, frame) + frame_tooltip:SetPoint ("topleft", frame, "topleft", 405, -100 + ((i-1)*15)*-1) + frame_tooltip:SetSize (150, 14) + frame_tooltip:SetScript ("OnEnter", frame_tooltip_onenter) + frame_tooltip:SetScript ("OnLeave", frame_tooltip_onleave) + + local icon = frame_tooltip:CreateTexture (nil, "artwork") icon:SetSize (14, 14) - icon:SetPoint ("topleft", frame, "topleft", 405, -120 + ((i-1)*15)*-1) - local spell = frame:CreateFontString (nil, "artwork", "GameFontHighlightSmall") + icon:SetPoint ("left", frame_tooltip, "left") + + local spell = frame_tooltip:CreateFontString (nil, "artwork", "GameFontHighlightSmall") spell:SetPoint ("left", icon, "right", 2, 0) spell:SetText ("spell name:") --> localize-me spell:SetTextColor (.8, .8, .8, 1) - local spell_amt = frame:CreateFontString (nil, "artwork", "GameFontHighlightSmall") + + local spell_amt = frame_tooltip:CreateFontString (nil, "artwork", "GameFontHighlightSmall") spell_amt:SetPoint ("left", spell, "right", 2, 0) spell_amt:SetText ("0") - tab ["spell" .. i] = {spell, spell_amt, icon} + + tab ["spell" .. i] = {spell, spell_amt, icon, frame_tooltip} end end @@ -1139,19 +1215,24 @@ function gump:CriaJanelaInfo() return ps, diff end - local spells_by_class = { + -- ~buff + local spells_by_class = { --buffss uptime ["DRUID"] = { [132402] = true, --savage defense [135286] = true, -- tooth and claw }, ["DEATHKNIGHT"] = { - [145676] = true, --riposte + [145677] = true, --riposte [77535] = true, --blood shield + --[49222] = true, --bone shield + [51460] = true, --runic corruption }, ["MONK"] = { - [118604] = true, --guard + [115295] = true, --guard [115307] = true, --shuffle [115308] = true, --elusive brew + --[128939] = true, --elusive brew + [125359] = true, --tiger power }, ["PALADIN"] = { [132403] = true, --shield of the righteous @@ -1182,7 +1263,9 @@ function gump:CriaJanelaInfo() tab.tankname:SetText ("Avoidance of\n" .. n) --> localize-me --> damage taken - local damagetaken = player.damage_taken + local playerdamage = combat (1, player.nome) + + local damagetaken = playerdamage.damage_taken local last_damage_received = 0 if (last_actor) then last_damage_received = last_actor.damage_taken / last_combat:GetCombatTime() @@ -1194,11 +1277,11 @@ function gump:CriaJanelaInfo() tab.damagepersecond:SetText (_detalhes:comma_value (_math_floor (ps)) .. " (" .. diff .. ")") --> absorbs - local totalabsorbs = player.avoidance.overall.ABSORB_AMT + local totalabsorbs = playerdamage.avoidance.overall.ABSORB_AMT local incomingtotal = damagetaken + totalabsorbs local last_total_absorbs = 0 - if (last_actor) then + if (last_actor and last_actor.avoidance) then last_total_absorbs = last_actor.avoidance.overall.ABSORB_AMT / last_combat:GetCombatTime() end @@ -1208,32 +1291,32 @@ function gump:CriaJanelaInfo() tab.absorbstotalpersecond:SetText (_detalhes:comma_value (_math_floor (ps)) .. " (" .. diff .. ")") --> dodge - local totaldodge = player.avoidance.overall.DODGE + local totaldodge = playerdamage.avoidance.overall.DODGE tab.dodge:SetText (totaldodge) local last_total_dodge = 0 - if (last_actor) then + if (last_actor and last_actor.avoidance) then last_total_dodge = last_actor.avoidance.overall.DODGE / last_combat:GetCombatTime() end local ps, diff = getpercent (totaldodge, last_total_dodge, elapsed_time, true) tab.dodgepersecond:SetText ( string.format ("%.2f", ps) .. " (" .. diff .. ")") --> parry - local totalparry = player.avoidance.overall.PARRY + local totalparry = playerdamage.avoidance.overall.PARRY tab.parry:SetText (totalparry) local last_total_parry = 0 - if (last_actor) then + if (last_actor and last_actor.avoidance) then last_total_parry = last_actor.avoidance.overall.PARRY / last_combat:GetCombatTime() end local ps, diff = getpercent (totalparry, last_total_parry, elapsed_time, true) tab.parrypersecond:SetText (string.format ("%.2f", ps) .. " (" .. diff .. ")") --> absorb - local fullabsorb = player.avoidance.overall.FULL_ABSORBED - local halfabsorb = player.avoidance.overall.PARTIAL_ABSORBED - local halfabsorb_amt = player.avoidance.overall.PARTIAL_ABSORB_AMT - local noabsorb = player.avoidance.overall.FULL_HIT + local fullabsorb = playerdamage.avoidance.overall.FULL_ABSORBED + local halfabsorb = playerdamage.avoidance.overall.PARTIAL_ABSORBED + local halfabsorb_amt = playerdamage.avoidance.overall.PARTIAL_ABSORB_AMT + local noabsorb = playerdamage.avoidance.overall.FULL_HIT tab.fullsbsorbed:SetText (fullabsorb) tab.partiallyabsorbed:SetText (halfabsorb) @@ -1242,7 +1325,7 @@ function gump:CriaJanelaInfo() if (halfabsorb_amt > 0) then local average = halfabsorb_amt / halfabsorb --tenho o average local last_average = 0 - if (last_actor) then + if (last_actor and last_actor.avoidance) then last_average = last_actor.avoidance.overall.PARTIAL_ABSORB_AMT / last_actor.avoidance.overall.PARTIAL_ABSORBED end @@ -1372,7 +1455,8 @@ function gump:CriaJanelaInfo() local esta_habilidade = cooldowns_usados[i] local nome_magia, _, icone_magia = _GetSpellInfo (esta_habilidade[1]) - local label1, label2, icon1 = unpack (tab ["spell" .. i]) + local label1, label2, icon1, framebg = unpack (tab ["spell" .. i]) + framebg.spellid = esta_habilidade[1] label1:SetText (nome_magia .. ":") label2:SetText (esta_habilidade[2]) @@ -1387,18 +1471,24 @@ function gump:CriaJanelaInfo() - --> buffs de druida - if (index_used < 9) then + --> buffs uptime + if (index_used < 11) then if (misc_player.buff_uptime_spell_tables) then local minha_tabela = misc_player.buff_uptime_spell_tables._ActorTable + + local encounter_time = combat:GetCombatTime() + for _spellid, _tabela in pairs (minha_tabela) do - if (spells_by_class [player.classe] [_spellid] and index_used < 9) then + if (spells_by_class [player.classe] [_spellid] and index_used <= 10) then local nome_magia, _, icone_magia = GetSpellInfo (_spellid) - local label1, label2, icon1 = unpack (tab ["spell" .. index_used]) + local label1, label2, icon1, framebg = unpack (tab ["spell" .. index_used]) + framebg.spellid = _spellid + + local t = _tabela.uptime / encounter_time * 100 label1:SetText (nome_magia .. ":") local minutos, segundos = _math_floor (_tabela.uptime / 60), _math_floor (_tabela.uptime % 60) - label2:SetText (minutos .. "m " .. segundos .. "s") + label2:SetText (minutos .. "m " .. segundos .. "s" .. " (" .. _math_floor (t) .. "%)") icon1:SetTexture (icone_magia) icon1:SetTexCoord (0.0625, 0.953125, 0.0625, 0.953125) @@ -1408,8 +1498,10 @@ function gump:CriaJanelaInfo() end end - for i = index_used, 9 do - local label1, label2, icon1 = unpack (tab ["spell" .. i]) + for i = index_used, 10 do + local label1, label2, icon1, framebg = unpack (tab ["spell" .. i]) + + framebg.spellid = nil label1:SetText ("-- -- -- --") label2:SetText ("") icon1:SetTexture (nil) diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index cd282b74..6cd19db4 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -11,6 +11,15 @@ local _ local preset_version = 3 _detalhes.preset_version = preset_version +local slider_backdrop = {edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", edgeSize = 8, +bgFile = [[Interface\ACHIEVEMENTFRAME\UI-GuildAchievement-Parchment-Horizontal-Desaturated]], tile = true, tileSize = 130, insets = {left = 1, right = 1, top = 5, bottom = 5}} +local slider_backdrop_color = {1, 1, 1, 1} + +local dropdown_backdrop = {edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", edgeSize = 10, +bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}} +local dropdown_backdrop_onenter = {0, 0, 0, 1} +local dropdown_backdrop_onleave = {.1, .1, .1, .9} + function _detalhes:OpenOptionsWindow (instance) GameCooltip:Close() @@ -47,6 +56,13 @@ function _detalhes:OpenOptionsWindow (instance) window.backdrop = nil _G.DetailsOptionsWindow.instance = instance + window:SetHook ("OnHide", function() + DetailsDisable3D:Hide() + DetailsOptionsWindowDisable3D:SetChecked (false) + window.Disable3DColorPick:Hide() + window.Disable3DColorPick:Cancel() + end) + --x 9 897 y 9 592 local background = g:NewImage (window, _, "$parentBackground", "background", 897, 592, [[Interface\AddOns\Details\images\options_window]]) @@ -185,8 +201,57 @@ function _detalhes:OpenOptionsWindow (instance) local instances_string = g:NewLabel (window, nil, nil, "instancetext", Loc ["STRING_OPTIONS_EDITINSTANCE"], "GameFontNormal", 12) instances_string:SetPoint ("right", instances, "left", -2) - --instances:Hide() - --instances_string:Hide() + local f = CreateFrame ("frame", "DetailsDisable3D", UIParent) + tinsert (UISpecialFrames, "DetailsDisable3D") + f:SetFrameStrata ("BACKGROUND") + f:SetFrameLevel (0) + f:SetPoint ("topleft", WorldFrame, "topleft") + f:SetPoint ("bottomright", WorldFrame, "bottomright") + f:Hide() + + local t = f:CreateTexture ("DetailsDisable3DTexture", "background") + t:SetAllPoints (f) + t:SetTexture (.5, .5, .5, 1) + + local c = f:CreateTexture ("DetailsDisable3DTexture", "border") + c:SetPoint ("center", f, "center", 0, -5) + c:SetTexture ([[Interface\Challenges\challenges-metalglow]]) + c:SetDesaturated (true) + c:SetAlpha (.6) + local tt = f:CreateFontString (nil, "artwork", "GameFontHighlightSmall") + tt:SetPoint ("center", f, "center", 0, -5) + tt:SetText ("Character\nPosition") + + local hide_3d_world = CreateFrame ("CheckButton", "DetailsOptionsWindowDisable3D", window.widget, "ChatConfigCheckButtonTemplate") + hide_3d_world:SetPoint ("bottomleft", window.widget, "bottomleft", 28, 7) + DetailsOptionsWindowDisable3DText:SetText ("Interface Edit Mode") + DetailsOptionsWindowDisable3DText:ClearAllPoints() + DetailsOptionsWindowDisable3DText:SetPoint ("left", hide_3d_world, "right", -2, 1) + DetailsOptionsWindowDisable3DText:SetTextColor (1, 0.8, 0) + hide_3d_world.tooltip = "Goodbye Cruel World :(" + hide_3d_world:SetHitRectInsets (0, -105, 0, 0) + + hide_3d_world:SetScript ("OnClick", function() + if (hide_3d_world:GetChecked()) then + f:Show() + window.Disable3DColorPick:Show() + else + f:Hide() + window.Disable3DColorPick:Hide() + end + end) + + local last_change = GetTime() + local disable3dcolor_callback = function (button, r, g, b) + if (last_change+0.5 < GetTime()) then --protection agaist fast color changes + t:SetTexture (r, g, b) + last_change = GetTime() + end + end + g:NewColorPickButton (window, "$parentDisable3DColorPick", "Disable3DColorPick", disable3dcolor_callback) + window.Disable3DColorPick:SetPoint ("left", hide_3d_world, "right", 120, 0) + window.Disable3DColorPick:SetColor (.5, .5, .5, 1) + window.Disable3DColorPick:Hide() --> left panel buttons @@ -206,16 +271,16 @@ function _detalhes:OpenOptionsWindow (instance) [12] = "Skins", } - local menus = { + local menus = { --labels nos menus {"Display", "Combat", "Profiles"}, - {"Skin Selection", "Row Settings", "Row Texts", "Window Settings", "Menu Bar", "Reset/Instance/Close", "Wallpaper"}, + {"Skin Selection", "Row Settings", "Row Texts and Extra Bars", "Window Settings", "Menus: Left Buttons", "Menus: Right Buttons", "Wallpaper"}, {"Performance Tweaks", "Data Collector"}, {"Plugins Management"} } local menus2 = { "Display", "Combat", - "Skin Selection", "Row Settings", "Row Texts", "Window Settings", "Menu Bar", "Reset/Instance/Close", "Wallpaper", + "Skin Selection", "Row Settings", "Row Texts and Extra Bars", "Window Settings", "Menus: Left Buttons", "Menus: Right Buttons", "Wallpaper", "Performance Tweaks", "Data Collector", "Plugins Management", "Profiles" } @@ -294,6 +359,10 @@ function _detalhes:OpenOptionsWindow (instance) local sub_menu_index = 1 local textcolor = {.8, .8, .8, 1} + local last_pressed + local all_buttons = {} + local true_index = 1 + local selected_textcolor = "wheat" local button_onenter = function (self) self.MyObject.my_bg_texture:SetVertexColor (1, 1, 1, 1) @@ -301,10 +370,22 @@ function _detalhes:OpenOptionsWindow (instance) end local button_onleave = function (self) self.MyObject.my_bg_texture:SetVertexColor (1, 1, 1, .5) - self.MyObject.textcolor = textcolor + if (last_pressed ~= self.MyObject) then + self.MyObject.textcolor = textcolor + else + self.MyObject.textcolor = selected_textcolor + end + end + local button_mouse_up = function (button) + button = button.MyObject + if (last_pressed ~= button) then + button.func (button.param1, button.param2, button) + last_pressed.widget.text:SetPoint ("left", last_pressed.widget, "left", 2, 0) + last_pressed.textcolor = textcolor + last_pressed = button + end + return true end - - local true_index = 1 --move buttons creation to loading process function window:create_left_menu() @@ -328,10 +409,12 @@ function _detalhes:OpenOptionsWindow (instance) button.textcolor = textcolor button.textsize = 11 button.my_bg_texture = texture + tinsert (all_buttons, button) y = y - 16 button:SetHook ("OnEnter", button_onenter) button:SetHook ("OnLeave", button_onleave) + button:SetHook ("OnMouseUp", button_mouse_up) true_index = true_index + 1 @@ -341,7 +424,7 @@ function _detalhes:OpenOptionsWindow (instance) end end - + window.options = { [1] = {}, [2] = {}, @@ -542,13 +625,30 @@ function _detalhes:OpenOptionsWindow (instance) else parent.background_frame = f end + + if (label:GetObjectType() == "FontString") then + local t = frameX:CreateTexture (nil, "artwork") + t:SetPoint ("left", label.widget or label, "left") + t:SetSize (label:GetStringWidth(), 12) + t:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-HorizontalShadow]]) + t:SetDesaturated (true) + t:SetAlpha (.5) + end + + end + + function window:CreateLineBackground (frame, widget_name, label_name, desc_loc) + frame [widget_name].info = desc_loc + window:create_line_background (frame, frame [label_name], frame [widget_name]) + frame [widget_name]:SetHook ("OnEnter", background_on_enter) + frame [widget_name]:SetHook ("OnLeave", background_on_leave) end select_options (1) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- General Settings - Display +-- General Settings - Display ~1 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame1() @@ -640,8 +740,12 @@ function window:CreateFrame1() titulo_display_desc.width = 320 g:NewLabel (frame1, _, "$parentSliderLabel", "segmentsLabel", Loc ["STRING_OPTIONS_MAXSEGMENTS"], "GameFontHighlightLeft") - g:NewSlider (frame1, _, "$parentSlider", "segmentsSlider", SLIDER_WIDTH, 20, 1, 25, 1, _detalhes.segments_amount) - frame1.segmentsSlider:SetPoint ("left", frame1.segmentsLabel, "right", 2, 0) + local s = g:NewSlider (frame1, _, "$parentSlider", "segmentsSlider", SLIDER_WIDTH, 20, 1, 25, 1, _detalhes.segments_amount) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + + frame1.segmentsSlider:SetPoint ("left", frame1.segmentsLabel, "right", 2, -1) frame1.segmentsSlider:SetHook ("OnValueChange", function (self, _, amount) --> slider, fixedValue, sliderValue _detalhes.segments_amount = math.floor (amount) end) @@ -682,8 +786,12 @@ function window:CreateFrame1() --> Max Instances g:NewLabel (frame1, _, "$parentLabelMaxInstances", "maxInstancesLabel", Loc ["STRING_OPTIONS_MAXINSTANCES"], "GameFontHighlightLeft") -- - g:NewSlider (frame1, _, "$parentSliderMaxInstances", "maxInstancesSlider", SLIDER_WIDTH, 20, 12, 30, 1, _detalhes.instances_amount) -- min, max, step, defaultv - frame1.maxInstancesSlider:SetPoint ("left", frame1.maxInstancesLabel, "right", 2, 0) + local s = g:NewSlider (frame1, _, "$parentSliderMaxInstances", "maxInstancesSlider", SLIDER_WIDTH, 20, 12, 30, 1, _detalhes.instances_amount) -- min, max, step, defaultv + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + + frame1.maxInstancesSlider:SetPoint ("left", frame1.maxInstancesLabel, "right", 2, -1) frame1.maxInstancesSlider:SetHook ("OnValueChange", function (self, _, amount) --> slider, fixedValue, sliderValue _detalhes.instances_amount = amount end) @@ -731,7 +839,12 @@ function window:CreateFrame1() return abbreviationOptions end - g:NewDropDown (frame1, _, "$parentAbbreviateDropdown", "dpsAbbreviateDropdown", 160, 20, buildAbbreviationMenu, _detalhes.ps_abbreviation) -- func, default + local d = g:NewDropDown (frame1, _, "$parentAbbreviateDropdown", "dpsAbbreviateDropdown", 160, 20, buildAbbreviationMenu, _detalhes.ps_abbreviation) -- func, default + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + frame1.dpsAbbreviateDropdown:SetPoint ("left", frame1.dpsAbbreviateLabel, "right", 2, 0) frame1.dpsAbbreviateDropdown.info = Loc ["STRING_OPTIONS_PS_ABBREVIATE_DESC"] @@ -746,7 +859,7 @@ function window:CreateFrame1() frame1.chooseAvatarButton:SetPoint (11, -90) frame1.avatarPreview:SetPoint (-8, -107) - frame1.avatarPreview2:SetPoint (-8, -107) + frame1.avatarPreview2:SetPoint (-8, -109) frame1.avatarNickname:SetPoint (100, -142) local avatar = NickTag:GetNicknameAvatar (UnitGUID ("player"), NICKTAG_DEFAULT_AVATAR, true) @@ -760,6 +873,7 @@ function window:CreateFrame1() --> animate bars g:NewLabel (frame1, _, "$parentAnimateLabel", "animateLabel", Loc ["STRING_OPTIONS_ANIMATEBARS"], "GameFontHighlightLeft") + g:NewSwitch (frame1, _, "$parentAnimateSlider", "animateSlider", 60, 20, _, _, _detalhes.use_row_animations) -- ltext, rtext, defaultv frame1.animateSlider:SetPoint ("left",frame1.animateLabel, "right", 2, 0) frame1.animateSlider.info = Loc ["STRING_OPTIONS_ANIMATEBARS_DESC"] @@ -773,10 +887,13 @@ function window:CreateFrame1() --> update speed - g:NewSlider (frame1, _, "$parentSliderUpdateSpeed", "updatespeedSlider", SLIDER_WIDTH, 20, 0.3, 3, 0.1, _detalhes.update_speed, true) + local s = g:NewSlider (frame1, _, "$parentSliderUpdateSpeed", "updatespeedSlider", SLIDER_WIDTH, 20, 0.3, 3, 0.1, _detalhes.update_speed, true) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + g:NewLabel (frame1, _, "$parentUpdateSpeedLabel", "updatespeedLabel", Loc ["STRING_OPTIONS_WINDOWSPEED"], "GameFontHighlightLeft") -- - frame1.updatespeedSlider:SetPoint ("left", frame1.updatespeedLabel, "right", 2, 0) + frame1.updatespeedSlider:SetPoint ("left", frame1.updatespeedLabel, "right", 2, -1) frame1.updatespeedSlider:SetThumbSize (50) frame1.updatespeedSlider.useDecimals = true local updateColor = function (slider, value) @@ -804,23 +921,25 @@ function window:CreateFrame1() --> anchors + local w_start = 10 + titulo_display:SetPoint (10, -200) titulo_display_desc:SetPoint (10, -220) - frame1.animateLabel:SetPoint (10, -260) - frame1.updatespeedLabel:SetPoint (10, -285) + frame1.animateLabel:SetPoint (w_start, -260) + frame1.updatespeedLabel:SetPoint (w_start, -285) - frame1.segmentsLabel:SetPoint (10, -310) - frame1.scrollLabel:SetPoint (10, -335) - frame1.maxInstancesLabel:SetPoint (10, -360) - frame1.minimapLabel:SetPoint (10, -385) - frame1.dpsAbbreviateLabel:SetPoint (10, -410) - frame1.realmNameLabel:SetPoint (10, -435) + frame1.segmentsLabel:SetPoint (w_start, -310) + frame1.scrollLabel:SetPoint (w_start, -335) + frame1.maxInstancesLabel:SetPoint (w_start, -360) + frame1.minimapLabel:SetPoint (w_start, -385) + frame1.dpsAbbreviateLabel:SetPoint (w_start, -410) + frame1.realmNameLabel:SetPoint (w_start, -435) end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- General Settings - Combat +-- General Settings - Combat ~2 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame2() @@ -863,7 +982,12 @@ function window:CreateFrame2() local buildTimeTypeMenu = function() return timetypeOptions end - g:NewDropDown (frame2, _, "$parentTTDropdown", "timetypeDropdown", 160, 20, buildTimeTypeMenu, nil) -- func, default + local d = g:NewDropDown (frame2, _, "$parentTTDropdown", "timetypeDropdown", 160, 20, buildTimeTypeMenu, nil) -- func, default + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + frame2.timetypeDropdown:SetPoint ("left", frame2.timetypeLabel, "right", 2, 0) frame2.timetypeDropdown.info = Loc ["STRING_OPTIONS_TIMEMEASURE_DESC"] @@ -882,7 +1006,11 @@ function window:CreateFrame2() instance.hide_in_combat = value end - g:NewSlider (frame2, _, "$parentHideOnCombatAlphaSlider", "hideOnCombatAlphaSlider", SLIDER_WIDTH, 20, 0, 100, 1, _G.DetailsOptionsWindow.instance.hide_in_combat_alpha) -- min, max, step, defaultv + local s = g:NewSlider (frame2, _, "$parentHideOnCombatAlphaSlider", "hideOnCombatAlphaSlider", SLIDER_WIDTH, 20, 0, 100, 1, _G.DetailsOptionsWindow.instance.hide_in_combat_alpha) -- min, max, step, defaultv + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + frame2.hideOnCombatAlphaSlider:SetPoint ("left", frame2.hideOnCombatAlphaLabel, "right", 2, 0) frame2.hideOnCombatAlphaSlider:SetHook ("OnValueChange", function (self, instance, amount) --> slider, fixedValue, sliderValue instance.hide_in_combat_alpha = amount @@ -947,7 +1075,12 @@ function window:CreateFrame2() return t end - g:NewDropDown (frame2, _, "$parentAutoSwitchDropdown", "autoSwitchDropdown", 160, 20, buildSwitchMenu, 1) -- func, default + local d = g:NewDropDown (frame2, _, "$parentAutoSwitchDropdown", "autoSwitchDropdown", 160, 20, buildSwitchMenu, 1) -- func, default + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + frame2.autoSwitchDropdown:SetPoint ("left", frame2.autoSwitchLabel, "right", 2, 0) frame2.autoSwitchDropdown.info = Loc ["STRING_OPTIONS_AUTO_SWITCH_DESC"] @@ -982,7 +1115,7 @@ function window:CreateFrame2() end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- General Settings - Profiles +-- General Settings - Profiles ~13 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame13() @@ -1024,6 +1157,12 @@ function window:CreateFrame13() return menu end local select_profile_dropdown = g:NewDropDown (frame13, _, "$parentSelectProfileDropdown", "selectProfileDropdown", 160, 20, build_profile_menu, 1) + local d = select_profile_dropdown + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + local select_profile_label = g:NewLabel (frame13, _, "$parentSelectProfileLabel", "selectProfileLabel", Loc ["STRING_OPTIONS_PROFILES_SELECT"], "GameFontHighlightLeft") select_profile_dropdown:SetPoint ("left", select_profile_label, "right", 2, 0) @@ -1078,6 +1217,12 @@ function window:CreateFrame13() return menu end local select_profileCopy_dropdown = g:NewDropDown (frame13, _, "$parentSelectProfileCopyDropdown", "selectProfileCopyDropdown", 160, 20, build_copy_menu, 1) + local d = select_profileCopy_dropdown + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + local select_profileCopy_label = g:NewLabel (frame13, _, "$parentSelectProfileCopyLabel", "selectProfileCopyLabel", Loc ["STRING_OPTIONS_PROFILES_COPY"], "GameFontHighlightLeft") select_profileCopy_dropdown:SetPoint ("left", select_profileCopy_label, "right", 2, 0) @@ -1102,6 +1247,12 @@ function window:CreateFrame13() return menu end local select_profileErase_dropdown = g:NewDropDown (frame13, _, "$parentSelectProfileEraseDropdown", "selectProfileEraseDropdown", 160, 20, build_erase_menu, 1) + local d = select_profileErase_dropdown + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + local select_profileErase_label = g:NewLabel (frame13, _, "$parentSelectProfileEraseLabel", "selectProfileLabel", Loc ["STRING_OPTIONS_PROFILES_ERASE"], "GameFontHighlightLeft") select_profileErase_dropdown:SetPoint ("left", select_profileErase_label, "right", 2, 0) @@ -1145,7 +1296,7 @@ function window:CreateFrame13() end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- Appearance - Skin +-- Appearance - Skin ~3 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame3() @@ -1223,7 +1374,12 @@ function window:CreateFrame3() end -- skin - g:NewDropDown (frame3, _, "$parentSkinDropdown", "skinDropdown", 160, 20, buildSkinMenu, 1) + local d = g:NewDropDown (frame3, _, "$parentSkinDropdown", "skinDropdown", 160, 20, buildSkinMenu, 1) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + g:NewLabel (frame3, _, "$parentSkinLabel", "skinLabel", Loc ["STRING_OPTIONS_INSTANCE_SKIN"], "GameFontHighlightLeft") frame3.skinDropdown.info = Loc ["STRING_OPTIONS_INSTANCE_SKIN_DESC"] @@ -1375,7 +1531,12 @@ function window:CreateFrame3() return loadtable end - g:NewDropDown (frame3, _, "$parentCustomSkinLoadDropdown", "customSkinSelectDropdown", 160, 20, buildCustomSkinMenu, nil) -- func, default + local d = g:NewDropDown (frame3, _, "$parentCustomSkinLoadDropdown", "customSkinSelectDropdown", 160, 20, buildCustomSkinMenu, nil) -- func, default + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + frame3.customSkinSelectDropdown:SetPoint ("left", frame3.loadCustomSkinLabel, "right", 2, 0) frame3.customSkinSelectDropdown.info = Loc ["STRING_OPTIONS_SAVELOAD_LOAD_DESC"] @@ -1400,7 +1561,12 @@ function window:CreateFrame3() return loadtable2 end - g:NewDropDown (frame3, _, "$parentCustomSkinRemoveDropdown", "customSkinSelectToRemoveDropdown", 160, 20, buildCustomSkinToEraseMenu, nil) -- func, default + local d = g:NewDropDown (frame3, _, "$parentCustomSkinRemoveDropdown", "customSkinSelectToRemoveDropdown", 160, 20, buildCustomSkinToEraseMenu, nil) -- func, default + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + frame3.customSkinSelectToRemoveDropdown:SetPoint ("left", frame3.removeCustomSkinLabel, "right", 2, 0) frame3.customSkinSelectToRemoveDropdown.info = Loc ["STRING_OPTIONS_SAVELOAD_LOAD_DESC"] @@ -1437,7 +1603,7 @@ function window:CreateFrame3() end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- Appearance - Row +-- Appearance - Row ~4 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame4() @@ -1470,13 +1636,14 @@ function window:CreateFrame4() g:NewSwitch (frame4, _, "$parentBackgroundClassColorSlider", "rowBackgroundColorByClassSlider", 60, 20, _, _, instance.row_info.texture_background_class_color) --> bar height - g:NewSlider (frame4, _, "$parentSliderRowHeight", "rowHeightSlider", SLIDER_WIDTH, 20, 10, 30, 1, tonumber (instance.row_info.height)) + local s = g:NewSlider (frame4, _, "$parentSliderRowHeight", "rowHeightSlider", SLIDER_WIDTH, 20, 10, 30, 1, tonumber (instance.row_info.height)) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) - --> bars grow direction - g:NewSwitch (frame4, _, "$parentBarGrowDirectionSlider", "barGrowDirectionSlider", 80, 20, Loc ["STRING_TOP"], Loc ["STRING_BOTTOM"], instance.bars_grow_direction, true) --> bars sort direction - g:NewSwitch (frame4, _, "$parentBarSortDirectionSlider", "barSortDirectionSlider", 80, 20, Loc ["STRING_TOP"], Loc ["STRING_BOTTOM"], instance.bars_sort_direction, true) + --> row texture color @@ -1507,7 +1674,11 @@ function window:CreateFrame4() end local buildTextureMenu2 = function() return texTable2 end - g:NewDropDown (frame4, _, "$parentRowBackgroundTextureDropdown", "rowBackgroundDropdown", DROPDOWN_WIDTH, 20, buildTextureMenu2, nil) + local d = g:NewDropDown (frame4, _, "$parentRowBackgroundTextureDropdown", "rowBackgroundDropdown", DROPDOWN_WIDTH, 20, buildTextureMenu2, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) --> bar texture local onSelectTexture = function (_, instance, textureName) @@ -1521,14 +1692,34 @@ function window:CreateFrame4() end local buildTextureMenu = function() return texTable end - g:NewDropDown (frame4, _, "$parentTextureDropdown", "textureDropdown", DROPDOWN_WIDTH, 20, buildTextureMenu, nil) + local d = g:NewDropDown (frame4, _, "$parentTextureDropdown", "textureDropdown", DROPDOWN_WIDTH, 20, buildTextureMenu, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) - -- bar grow direction + --> bar grow direction + local grow_switch_func = function (slider, value) + if (value == 1) then + return true + elseif (value == 2) then + return false + end + end + local grow_return_func = function (slider, value) + if (value) then + return 1 + else + return 2 + end + end + + g:NewSwitch (frame4, _, "$parentBarGrowDirectionSlider", "barGrowDirectionSlider", 80, 20, Loc ["STRING_BOTTOM"], Loc ["STRING_TOP"], instance.bars_grow_direction, nil, grow_switch_func, grow_return_func) g:NewLabel (frame4, _, "$parentBarGrowDirectionLabel", "barGrowDirectionLabel", Loc ["STRING_OPTIONS_BARGROW_DIRECTION"], "GameFontHighlightLeft") frame4.barGrowDirectionSlider:SetPoint ("left", frame4.barGrowDirectionLabel, "right", 2) frame4.barGrowDirectionSlider.OnSwitch = function (self, instance, value) - instance:SetBarGrowDirection (value and 2 or 1) + instance:SetBarGrowDirection (value) end frame4.barGrowDirectionSlider.thumb:SetSize (50, 12) @@ -1538,11 +1729,13 @@ function window:CreateFrame4() frame4.barGrowDirectionSlider:SetHook ("OnLeave", background_on_leave) -- bar sort direction + + g:NewSwitch (frame4, _, "$parentBarSortDirectionSlider", "barSortDirectionSlider", 80, 20, Loc ["STRING_BOTTOM"], Loc ["STRING_TOP"], instance.bars_sort_direction, nil, grow_switch_func, grow_return_func) g:NewLabel (frame4, _, "$parentBarSortDirectionLabel", "barSortDirectionLabel", Loc ["STRING_OPTIONS_BARSORT_DIRECTION"], "GameFontHighlightLeft") frame4.barSortDirectionSlider:SetPoint ("left", frame4.barSortDirectionLabel, "right", 2) frame4.barSortDirectionSlider.OnSwitch = function (self, instance, value) - instance.bars_sort_direction = value and 2 or 1 + instance.bars_sort_direction = value _detalhes:AtualizaGumpPrincipal (-1, true) end frame4.barSortDirectionSlider.thumb:SetSize (50, 12) @@ -1556,10 +1749,15 @@ function window:CreateFrame4() g:NewLabel (frame4, _, "$parentRowUpperTextureAnchor", "rowUpperTextureLabel", "Top Texture", "GameFontNormal") g:NewLabel (frame4, _, "$parentRowLowerTextureAnchor", "rowLowerTextureLabel", "Bottom Texture (background)", "GameFontNormal") + g:NewLabel (frame4, _, "$parentIconsAnchor", "rowIconsLabel", "Icons", "GameFontNormal") --alpha g:NewLabel (frame4, _, "$parentRowAlphaLabel", "rowAlphaLabel", "Alpha", "GameFontHighlightLeft") - g:NewSlider (frame4, _, "$parentRowAlphaSlider", "rowAlphaSlider", SLIDER_WIDTH, 20, 0.02, 1, 0.02, instance.row_info.alpha, true) + local s = g:NewSlider (frame4, _, "$parentRowAlphaSlider", "rowAlphaSlider", SLIDER_WIDTH, 20, 0.02, 1, 0.02, instance.row_info.alpha, true) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + frame4.rowAlphaSlider:SetPoint ("left", frame4.rowAlphaLabel, "right", 2, 0) frame4.rowAlphaSlider.useDecimals = true frame4.rowAlphaSlider:SetHook ("OnValueChange", function (self, instance, amount) @@ -1646,14 +1844,14 @@ function window:CreateFrame4() g:NewTextEntry (frame4, _, "$parentIconFileEntry", "iconFileEntry", 260, 20) frame4.iconFileEntry:SetPoint ("left", frame4.iconFileLabel, "right", 2, 0) - frame4.iconFileEntry.tooltip = "press escape to restore default value" + frame4.iconFileEntry.tooltip = "- Press escape to restore default value.\n- Leave empty to hide icons." frame4.iconFileEntry:SetHook ("OnEnterPressed", function() - instance:SetBarSettings (nil, nil, nil, nil, nil, nil, nil, nil, frame4.iconFileEntry.text) + _G.DetailsOptionsWindow.instance:SetBarSettings (nil, nil, nil, nil, nil, nil, nil, nil, frame4.iconFileEntry.text) end) frame4.iconFileEntry:SetHook ("OnEscapePressed", function() frame4.iconFileEntry:SetText ([[Interface\AddOns\Details\images\classes_small]]) frame4.iconFileEntry:ClearFocus() - instance:SetBarSettings (nil, nil, nil, nil, nil, nil, nil, nil, [[Interface\AddOns\Details\images\classes_small]]) + _G.DetailsOptionsWindow.instance:SetBarSettings (nil, nil, nil, nil, nil, nil, nil, nil, [[Interface\AddOns\Details\images\classes_small]]) return true end) @@ -1664,6 +1862,20 @@ function window:CreateFrame4() frame4.iconFileEntry.text = instance.row_info.icon_file + --bar start at + g:NewSwitch (frame4, _, "$parentBarStartSlider", "barStartSlider", 60, 20, nil, nil, instance.row_info.start_after_icon) + g:NewLabel (frame4, _, "$parentBarStartLabel", "barStartLabel", Loc ["STRING_OPTIONS_BARSTART"], "GameFontHighlightLeft") + + frame4.barStartSlider:SetPoint ("left", frame4.barStartLabel, "right", 2) + frame4.barStartSlider.OnSwitch = function (self, instance, value) + instance:SetBarSettings (nil, nil, nil, nil, nil, nil, nil, nil, nil, value) + end + + frame4.barStartSlider.info = Loc ["STRING_OPTIONS_BARSTART_DESC"] + window:create_line_background (frame4, frame4.barStartLabel, frame4.barStartSlider) + frame4.barStartSlider:SetHook ("OnEnter", background_on_enter) + frame4.barStartSlider:SetHook ("OnLeave", background_on_leave) + --anchors: titulo_bars:SetPoint (10, -10) titulo_bars_desc:SetPoint (10, -30) @@ -1686,12 +1898,14 @@ function window:CreateFrame4() frame4.rowBackgroundColorByClassLabel:SetPoint (10, -340) --class color background frame4.rowBackgroundPickLabel:SetPoint (10, -365) --bar color background - frame4.iconFileLabel:SetPoint (10, -405) + frame4.rowIconsLabel:SetPoint (10, -405) + frame4.iconFileLabel:SetPoint (10, -430) + frame4.barStartLabel:SetPoint (10, -455) end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- Appearance - Texts +-- Appearance - Texts ~5 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame5() @@ -1711,23 +1925,16 @@ function window:CreateFrame5() frame5.fixedTextColor:SetPoint ("left", fixedColorText, "right", 2, 0) --> text size - g:NewSlider (frame5, _, "$parentSliderFontSize", "fonsizeSlider", SLIDER_WIDTH, 20, 8, 15, 1, tonumber (instance.row_info.font_size)) + local s = g:NewSlider (frame5, _, "$parentSliderFontSize", "fonsizeSlider", SLIDER_WIDTH, 20, 8, 15, 1, tonumber (instance.row_info.font_size)) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) --> outline g:NewSwitch (frame5, _, "$parentTextLeftOutlineSlider", "textLeftOutlineSlider", 60, 20, _, _, instance.row_info.textL_outline) g:NewSwitch (frame5, _, "$parentTextRightOutlineSlider", "textRightOutlineSlider", 60, 20, _, _, instance.row_info.textR_outline) - --> text font - local onSelectFont = function (_, instance, fontName) - instance:SetBarTextSettings (nil, fontName) - end - local fontObjects = SharedMedia:HashTable ("font") - local fontTable = {} - for name, fontPath in pairs (fontObjects) do - fontTable[#fontTable+1] = {value = name, label = name, onclick = onSelectFont, font = fontPath} - end - local buildFontMenu = function() return fontTable end - g:NewDropDown (frame5, _, "$parentFontDropdown", "fontDropdown", DROPDOWN_WIDTH, 20, buildFontMenu, nil) + -- Text Settings @@ -1744,6 +1951,23 @@ function window:CreateFrame5() frame5.fonsizeSlider:SetHook ("OnLeave", background_on_leave) -- Text Fonts + + local onSelectFont = function (_, instance, fontName) + instance:SetBarTextSettings (nil, fontName) + end + local fontObjects = SharedMedia:HashTable ("font") + local fontTable = {} + for name, fontPath in pairs (fontObjects) do + fontTable[#fontTable+1] = {value = name, label = name, onclick = onSelectFont, font = fontPath} + end + local buildFontMenu = function() return fontTable end + + local d = g:NewDropDown (frame5, _, "$parentFontDropdown", "fontDropdown", DROPDOWN_WIDTH, 20, buildFontMenu, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + g:NewLabel (frame5, _, "$parentFontLabel", "fontLabel", Loc ["STRING_OPTIONS_TEXT_FONT"], "GameFontHighlightLeft") frame5.fontDropdown:SetPoint ("left", frame5.fontLabel, "right", 2) @@ -1806,7 +2030,76 @@ function window:CreateFrame5() window:create_line_background (frame5, frame5.textRightOutlineLabel, frame5.textRightOutlineSlider) frame5.textRightOutlineSlider:SetHook ("OnEnter", background_on_enter) frame5.textRightOutlineSlider:SetHook ("OnLeave", background_on_leave) - + + --show total bar + + g:NewLabel (frame5, _, "$parentTotalBarLabel", "totalBarLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR"], "GameFontHighlightLeft") + g:NewSwitch (frame5, _, "$parentTotalBarSlider", "totalBarSlider", 60, 20, _, _, instance.total_bar.enabled) + + frame5.totalBarSlider:SetPoint ("left", frame5.totalBarLabel, "right", 2) + frame5.totalBarSlider.OnSwitch = function (self, instance, value) + instance.total_bar.enabled = value + instance:InstanceReset() + end + + frame5.totalBarSlider.info = Loc ["STRING_OPTIONS_SHOW_TOTALBAR_DESC"] + window:create_line_background (frame5, frame5.totalBarLabel, frame5.totalBarSlider) + frame5.totalBarSlider:SetHook ("OnEnter", background_on_enter) + frame5.totalBarSlider:SetHook ("OnLeave", background_on_leave) + + --total bar color + local totalbarcolor_callback = function (button, r, g, b, a) + _G.DetailsOptionsWindow.instance.total_bar.color[1] = r + _G.DetailsOptionsWindow.instance.total_bar.color[2] = g + _G.DetailsOptionsWindow.instance.total_bar.color[3] = b + _G.DetailsOptionsWindow.instance:InstanceReset() + end + g:NewColorPickButton (frame5, "$parentTotalBarColorPick", "totalBarColorPick", totalbarcolor_callback) + g:NewLabel (frame5, _, "$parentTotalBarColorPickLabel", "totalBarPickColorLabel", Loc ["STRING_OPTIONS_COLOR"], "GameFontHighlightLeft") + frame5.totalBarColorPick:SetPoint ("left", frame5.totalBarPickColorLabel, "right", 2, 0) + + frame5.totalBarColorPick.info = Loc ["STRING_OPTIONS_SHOW_TOTALBAR_COLOR_DESC"] + window:create_line_background (frame5, frame5.totalBarPickColorLabel, frame5.totalBarColorPick) + frame5.totalBarColorPick:SetHook ("OnEnter", background_on_enter) + frame5.totalBarColorPick:SetHook ("OnLeave", background_on_leave) + + --total bar only in group + g:NewLabel (frame5, _, "$parentTotalBarOnlyInGroupLabel", "totalBarOnlyInGroupLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_INGROUP"], "GameFontHighlightLeft") + g:NewSwitch (frame5, _, "$parentTotalBarOnlyInGroupSlider", "totalBarOnlyInGroupSlider", 60, 20, _, _, instance.total_bar.only_in_group) + + frame5.totalBarOnlyInGroupSlider:SetPoint ("left", frame5.totalBarOnlyInGroupLabel, "right", 2) + frame5.totalBarOnlyInGroupSlider.OnSwitch = function (self, instance, value) + instance.total_bar.only_in_group = value + instance:InstanceReset() + end + + frame5.totalBarOnlyInGroupSlider.info = Loc ["STRING_OPTIONS_SHOW_TOTALBAR_INGROUP_DESC"] + window:create_line_background (frame5, frame5.totalBarOnlyInGroupLabel, frame5.totalBarOnlyInGroupSlider) + frame5.totalBarOnlyInGroupSlider:SetHook ("OnEnter", background_on_enter) + frame5.totalBarOnlyInGroupSlider:SetHook ("OnLeave", background_on_leave) + + --total bar icon + local totalbar_pickicon_callback = function (texture) + instance.total_bar.icon = texture + frame5.totalBarIconTexture:SetTexture (texture) + instance:InstanceReset() + end + local totalbar_pickicon = function() + g:IconPick (totalbar_pickicon_callback) + end + g:NewLabel (frame5, _, "$parentTotalBarIconLabel", "totalBarIconLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_ICON"], "GameFontHighlightLeft") + g:NewImage (frame5, _, "$parentTotalBarIconTexture", "totalBarIconTexture", 20, 20) + g:NewButton (frame5, _, "$parentTotalBarIconButton", "totalBarIconButton", 20, 20, totalbar_pickicon) + frame5.totalBarIconButton:InstallCustomTexture() + frame5.totalBarIconButton:SetPoint ("left", frame5.totalBarIconLabel, "right", 2, 0) + frame5.totalBarIconTexture:SetPoint ("left", frame5.totalBarIconLabel, "right", 2, 0) + + frame5.totalBarIconButton.info = Loc ["STRING_OPTIONS_SHOW_TOTALBAR_ICON_DESC"] + window:create_line_background (frame5, frame5.totalBarIconLabel, frame5.totalBarIconButton) + frame5.totalBarIconButton:SetHook ("OnEnter", background_on_enter) + frame5.totalBarIconButton:SetHook ("OnLeave", background_on_leave) + + titulo_texts:SetPoint (10, -10) titulo_texts_desc:SetPoint (10, -30) @@ -1819,10 +2112,16 @@ function window:CreateFrame5() frame5.fixedTextColorLabel:SetPoint (10, -220) + g:NewLabel (frame5, _, "$parentTotalBarAnchor", "totalBarAnchorLabel", "Total Bar", "GameFontNormal") + frame5.totalBarAnchorLabel:SetPoint (10, -255) + frame5.totalBarIconLabel:SetPoint (10, -280) + frame5.totalBarPickColorLabel:SetPoint (10, -305) + frame5.totalBarLabel:SetPoint (10, -355) + frame5.totalBarOnlyInGroupLabel:SetPoint (10, -330) end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- Appearance - Window Settings +-- Appearance - Window Settings ~6 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame6() @@ -1835,7 +2134,13 @@ function window:CreateFrame6() --> window color local windowcolor_callback = function (button, r, g, b, a) - _G.DetailsOptionsWindow.instance:InstanceColor (r, g, b, a) + if (_G.DetailsOptionsWindow.instance.menu_alpha.enabled and a ~= _G.DetailsOptionsWindow.instance.color[4]) then + _detalhes:Msg (Loc ["STRING_OPTIONS_MENU_ALPHAWARNING"]) + _G.DetailsOptionsWindow6StatusbarColorPick.MyObject:SetColor (r, g, b, _G.DetailsOptionsWindow.instance.menu_alpha.onleave) + return _G.DetailsOptionsWindow.instance:InstanceColor (r, g, b, _G.DetailsOptionsWindow.instance.menu_alpha.onleave, nil, true) + end + _G.DetailsOptionsWindow6StatusbarColorPick.MyObject:SetColor (r, g, b, a) + _G.DetailsOptionsWindow.instance:InstanceColor (r, g, b, a, nil, true) end g:NewColorPickButton (frame6, "$parentWindowColorPick", "windowColorPick", windowcolor_callback) g:NewLabel (frame6, _, "$parentWindowColorPickLabel", "windowPickColorLabel", Loc ["STRING_OPTIONS_INSTANCE_COLOR"], "GameFontHighlightLeft") @@ -1847,7 +2152,10 @@ function window:CreateFrame6() frame6.windowColorPick:SetHook ("OnLeave", background_on_leave) --> Transparency - g:NewSlider (frame6, _, "$parentAlphaSlider", "alphaSlider", SLIDER_WIDTH, 20, 0.02, 1, 0.02, instance.bg_alpha, true) + local s = g:NewSlider (frame6, _, "$parentAlphaSlider", "alphaSlider", SLIDER_WIDTH, 20, 0.02, 1, 0.02, instance.bg_alpha, true) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) --> background color @@ -1869,9 +2177,6 @@ function window:CreateFrame6() g:NewSwitch (frame6, _, "$parentSideBarsSlider", "sideBarsSlider", 60, 20, _, _, instance.show_sidebars) g:NewSwitch (frame6, _, "$parentStatusbarSlider", "statusbarSlider", 60, 20, _, _, instance.show_statusbar) - --> stretch button anchor - g:NewSwitch (frame6, _, "$parentStretchAnchorSlider", "stretchAnchorSlider", 80, 20, Loc ["STRING_TOP"], Loc ["STRING_BOTTOM"], instance.stretch_button_side, true) - -- Instance Settings -- Color and Alpha @@ -1894,11 +2199,28 @@ function window:CreateFrame6() frame6.alphaSlider:SetHook ("OnLeave", background_on_leave) -- stretch button anchor + + local grow_switch_func = function (slider, value) + if (value == 1) then + return true + elseif (value == 2) then + return false + end + end + local grow_return_func = function (slider, value) + if (value) then + return 1 + else + return 2 + end + end + + g:NewSwitch (frame6, _, "$parentStretchAnchorSlider", "stretchAnchorSlider", 80, 20, Loc ["STRING_BOTTOM"], Loc ["STRING_TOP"], instance.toolbar_side, nil, grow_switch_func, grow_return_func) g:NewLabel (frame6, _, "$parentStretchAnchorLabel", "stretchAnchorLabel", Loc ["STRING_OPTIONS_STRETCH"], "GameFontHighlightLeft") frame6.stretchAnchorSlider:SetPoint ("left", frame6.stretchAnchorLabel, "right", 2) frame6.stretchAnchorSlider.OnSwitch = function (self, instance, value) - instance:StretchButtonAnchor (value and 2 or 1) + instance:StretchButtonAnchor (value) end frame6.stretchAnchorSlider.thumb:SetSize (40, 12) @@ -1908,11 +2230,12 @@ function window:CreateFrame6() frame6.stretchAnchorSlider:SetHook ("OnLeave", background_on_leave) -- instance toolbar side + g:NewSwitch (frame6, _, "$parentInstanceToolbarSideSlider", "instanceToolbarSideSlider", 80, 20, Loc ["STRING_BOTTOM"], Loc ["STRING_TOP"], instance.toolbar_side, nil, grow_switch_func, grow_return_func) g:NewLabel (frame6, _, "$parentInstanceToolbarSideLabel", "instanceToolbarSideLabel", Loc ["STRING_OPTIONS_TOOLBARSIDE"], "GameFontHighlightLeft") - g:NewSwitch (frame6, _, "$parentInstanceToolbarSideSlider", "instanceToolbarSideSlider", 80, 20, Loc ["STRING_TOP"], Loc ["STRING_BOTTOM"], instance.toolbar_side, true) + frame6.instanceToolbarSideSlider:SetPoint ("left", frame6.instanceToolbarSideLabel, "right", 2) frame6.instanceToolbarSideSlider.OnSwitch = function (self, instance, value) - instance.toolbar_side = value and 2 or 1 + instance.toolbar_side = value instance:ToolbarSide (side) end @@ -1959,73 +2282,118 @@ function window:CreateFrame6() frame6.statusbarSlider:SetHook ("OnEnter", background_on_enter) frame6.statusbarSlider:SetHook ("OnLeave", background_on_leave) - --show total bar - - g:NewLabel (frame6, _, "$parentTotalBarLabel", "totalBarLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR"], "GameFontHighlightLeft") - g:NewSwitch (frame6, _, "$parentTotalBarSlider", "totalBarSlider", 60, 20, _, _, instance.total_bar.enabled) - - frame6.totalBarSlider:SetPoint ("left", frame6.totalBarLabel, "right", 2) - frame6.totalBarSlider.OnSwitch = function (self, instance, value) - instance.total_bar.enabled = value - instance:InstanceReset() + --> backdrop texture + local onBackdropSelect = function (_, instance, backdropName) + instance:SetBackdropTexture (backdropName) end + local backdropObjects = SharedMedia:HashTable ("background") + local backdropTable = {} + for name, backdropPath in pairs (backdropObjects) do + backdropTable[#backdropTable+1] = {value = name, label = name, onclick = onBackdropSelect} + end + local buildBackdropMenu = function() return backdropTable end - frame6.totalBarSlider.info = Loc ["STRING_OPTIONS_SHOW_TOTALBAR_DESC"] - window:create_line_background (frame6, frame6.totalBarLabel, frame6.totalBarSlider) - frame6.totalBarSlider:SetHook ("OnEnter", background_on_enter) - frame6.totalBarSlider:SetHook ("OnLeave", background_on_leave) + local d = g:NewDropDown (frame6, _, "$parentBackdropDropdown", "backdropDropdown", DROPDOWN_WIDTH, 20, buildBackdropMenu, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) - --total bar color - local totalbarcolor_callback = function (button, r, g, b, a) - _G.DetailsOptionsWindow.instance.total_bar.color[1] = r - _G.DetailsOptionsWindow.instance.total_bar.color[2] = g - _G.DetailsOptionsWindow.instance.total_bar.color[3] = b - _G.DetailsOptionsWindow.instance:InstanceReset() + g:NewLabel (frame6, _, "$parentBackdropLabel", "backdropLabel", Loc ["STRING_OPTIONS_INSTANCE_BACKDROP"], "GameFontHighlightLeft") + frame6.backdropDropdown:SetPoint ("left", frame6.backdropLabel, "right", 2) + + frame6.backdropDropdown.info = Loc ["STRING_OPTIONS_INSTANCE_BACKDROP_DESC"] + window:create_line_background (frame6, frame6.backdropLabel, frame6.backdropDropdown) + frame6.backdropDropdown:SetHook ("OnEnter", background_on_enter) + frame6.backdropDropdown:SetHook ("OnLeave", background_on_leave) + + --> alpha onenter onleave auto transparency + + g:NewLabel (frame6, _, "$parentMenuAlphaAnchor", "menuAlphaAnchorLabel", Loc ["STRING_OPTIONS_MENU_ALPHA"], "GameFontNormal") + + g:NewSwitch (frame6, _, "$parentMenuOnEnterLeaveAlphaIconsTooSwitch", "alphaIconsTooSwitch", 60, 20, _, _, instance.menu_alpha.iconstoo) + g:NewSwitch (frame6, _, "$parentMenuOnEnterLeaveAlphaSwitch", "alphaSwitch", 60, 20, _, _, instance.menu_alpha.enabled) + + local s = g:NewSlider (frame6, _, "$parentMenuOnEnterAlphaSlider", "menuOnEnterSlider", SLIDER_WIDTH, 20, 0, 1, 0.02, instance.menu_alpha.onenter, true) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + s.useDecimals = true + + local s = g:NewSlider (frame6, _, "$parentMenuOnLeaveAlphaSlider", "menuOnLeaveSlider", SLIDER_WIDTH, 20, 0, 1, 0.02, instance.menu_alpha.onleave, true) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + + frame6.menuOnEnterSlider.useDecimals = true + frame6.menuOnLeaveSlider.useDecimals = true + + g:NewLabel (frame6, _, "$parentMenuOnEnterLeaveAlphaIconsTooLabel", "alphaIconsTooLabel", Loc ["STRING_OPTIONS_MENU_ALPHAICONSTOO"], "GameFontHighlightLeft") + g:NewLabel (frame6, _, "$parentMenuOnEnterLeaveAlphaLabel", "alphaSwitchLabel", Loc ["STRING_OPTIONS_MENU_ALPHAENABLED"], "GameFontHighlightLeft") + g:NewLabel (frame6, _, "$parentMenuOnEnterAlphaLabel", "menuOnEnterLabel", Loc ["STRING_OPTIONS_MENU_ALPHAENTER"], "GameFontHighlightLeft") + g:NewLabel (frame6, _, "$parentMenuOnLeaveAlphaLabel", "menuOnLeaveLabel", Loc ["STRING_OPTIONS_MENU_ALPHALEAVE"], "GameFontHighlightLeft") + + frame6.alphaIconsTooSwitch.info = Loc ["STRING_OPTIONS_MENU_ALPHAICONSTOO_DESC"] + window:create_line_background (frame6, frame6.alphaIconsTooLabel, frame6.alphaIconsTooSwitch) + frame6.alphaIconsTooSwitch:SetHook ("OnEnter", background_on_enter) + frame6.alphaIconsTooSwitch:SetHook ("OnLeave", background_on_leave) + + frame6.alphaSwitch.info = Loc ["STRING_OPTIONS_MENU_ALPHAENABLED_DESC"] + window:create_line_background (frame6, frame6.alphaSwitchLabel, frame6.alphaSwitch) + frame6.alphaSwitch:SetHook ("OnEnter", background_on_enter) + frame6.alphaSwitch:SetHook ("OnLeave", background_on_leave) + + frame6.menuOnEnterSlider.info = Loc ["STRING_OPTIONS_MENU_ALPHAENTER_DESC"] + window:create_line_background (frame6, frame6.menuOnEnterLabel, frame6.menuOnEnterSlider) + frame6.menuOnEnterSlider:SetHook ("OnEnter", background_on_enter) + frame6.menuOnEnterSlider:SetHook ("OnLeave", background_on_leave) + + frame6.menuOnLeaveSlider.info = Loc ["STRING_OPTIONS_MENU_ALPHALEAVE_DESC"] + window:create_line_background (frame6, frame6.menuOnLeaveLabel, frame6.menuOnLeaveSlider) + frame6.menuOnLeaveSlider:SetHook ("OnEnter", background_on_enter) + frame6.menuOnLeaveSlider:SetHook ("OnLeave", background_on_leave) + + frame6.alphaIconsTooSwitch:SetPoint ("left", frame6.alphaIconsTooLabel, "right", 2) + frame6.alphaSwitch:SetPoint ("left", frame6.alphaSwitchLabel, "right", 2) + frame6.menuOnEnterSlider:SetPoint ("left", frame6.menuOnEnterLabel, "right", 2) + frame6.menuOnLeaveSlider:SetPoint ("left", frame6.menuOnLeaveLabel, "right", 2) + + frame6.menuOnEnterSlider:SetThumbSize (50) + frame6.menuOnLeaveSlider:SetThumbSize (50) + + frame6.alphaIconsTooSwitch.OnSwitch = function (self, instance, value) + -- + instance:SetMenuAlpha (nil, nil, nil, value) + end + frame6.alphaSwitch.OnSwitch = function (self, instance, value) + -- + instance:SetMenuAlpha (value) + end + frame6.menuOnEnterSlider:SetHook ("OnValueChange", function (self, instance, value) + -- + self.amt:SetText (string.format ("%.2f", value)) + instance:SetMenuAlpha (nil, value) + return true + end) + frame6.menuOnLeaveSlider:SetHook ("OnValueChange", function (self, instance, value) + -- + self.amt:SetText (string.format ("%.2f", value)) + instance:SetMenuAlpha (nil, nil, value) + return true + end) + + --> statusbar color overwrite + g:NewLabel (frame6, _, "$parentStatusbarLabelAnchor", "statusbarAnchorLabel", Loc ["STRING_OPTIONS_INSTANCE_STATUSBAR_ANCHOR"], "GameFontNormal") + + local statusbar_color_callback = function (button, r, g, b, a) + --do something + _G.DetailsOptionsWindow.instance:StatusBarColor (r, g, b, a) end - g:NewColorPickButton (frame6, "$parentTotalBarColorPick", "totalBarColorPick", totalbarcolor_callback) - g:NewLabel (frame6, _, "$parentTotalBarColorPickLabel", "totalBarPickColorLabel", Loc ["STRING_OPTIONS_COLOR"], "GameFontHighlightLeft") - frame6.totalBarColorPick:SetPoint ("left", frame6.totalBarPickColorLabel, "right", 2, 0) - - frame6.totalBarColorPick.info = Loc ["STRING_OPTIONS_SHOW_TOTALBAR_COLOR_DESC"] - window:create_line_background (frame6, frame6.totalBarPickColorLabel, frame6.totalBarColorPick) - frame6.totalBarColorPick:SetHook ("OnEnter", background_on_enter) - frame6.totalBarColorPick:SetHook ("OnLeave", background_on_leave) - - --total bar only in group - g:NewLabel (frame6, _, "$parentTotalBarOnlyInGroupLabel", "totalBarOnlyInGroupLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_INGROUP"], "GameFontHighlightLeft") - g:NewSwitch (frame6, _, "$parentTotalBarOnlyInGroupSlider", "totalBarOnlyInGroupSlider", 60, 20, _, _, instance.total_bar.only_in_group) - - frame6.totalBarOnlyInGroupSlider:SetPoint ("left", frame6.totalBarOnlyInGroupLabel, "right", 2) - frame6.totalBarOnlyInGroupSlider.OnSwitch = function (self, instance, value) - instance.total_bar.only_in_group = value - instance:InstanceReset() - end - - frame6.totalBarOnlyInGroupSlider.info = Loc ["STRING_OPTIONS_SHOW_TOTALBAR_INGROUP_DESC"] - window:create_line_background (frame6, frame6.totalBarOnlyInGroupLabel, frame6.totalBarOnlyInGroupSlider) - frame6.totalBarOnlyInGroupSlider:SetHook ("OnEnter", background_on_enter) - frame6.totalBarOnlyInGroupSlider:SetHook ("OnLeave", background_on_leave) - - --total bar icon - local totalbar_pickicon_callback = function (texture) - instance.total_bar.icon = texture - frame6.totalBarIconTexture:SetTexture (texture) - instance:InstanceReset() - end - local totalbar_pickicon = function() - g:IconPick (totalbar_pickicon_callback) - end - g:NewLabel (frame6, _, "$parentTotalBarIconLabel", "totalBarIconLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_ICON"], "GameFontHighlightLeft") - g:NewImage (frame6, _, "$parentTotalBarIconTexture", "totalBarIconTexture", 20, 20) - g:NewButton (frame6, _, "$parentTotalBarIconButton", "totalBarIconButton", 20, 20, totalbar_pickicon) - frame6.totalBarIconButton:InstallCustomTexture() - frame6.totalBarIconButton:SetPoint ("left", frame6.totalBarIconLabel, "right", 2, 0) - frame6.totalBarIconTexture:SetPoint ("left", frame6.totalBarIconLabel, "right", 2, 0) - - frame6.totalBarIconButton.info = Loc ["STRING_OPTIONS_SHOW_TOTALBAR_ICON_DESC"] - window:create_line_background (frame6, frame6.totalBarIconLabel, frame6.totalBarIconButton) - frame6.totalBarIconButton:SetHook ("OnEnter", background_on_enter) - frame6.totalBarIconButton:SetHook ("OnLeave", background_on_leave) + g:NewColorPickButton (frame6, "$parentStatusbarColorPick", "statusbarColorPick", statusbar_color_callback) + g:NewLabel (frame6, _, "$parentStatusbarColorLabel", "statusbarColorLabel", Loc ["STRING_OPTIONS_INSTANCE_STATUSBARCOLOR"], "GameFontHighlightLeft") + frame6.statusbarColorPick:SetPoint ("left", frame6.statusbarColorLabel, "right", 2, 0) + window:CreateLineBackground (frame6, "statusbarColorPick", "statusbarColorLabel", Loc ["STRING_OPTIONS_INSTANCE_STATUSBARCOLOR_DESC"]) + --anchors titulo_instance:SetPoint (10, -10) @@ -2035,22 +2403,25 @@ function window:CreateFrame6() --frame6.alphaLabel:SetPoint (10, -95) --background alpha frame6.windowBackgroundPickColorLabel:SetPoint (10, -95) --background color - frame6.instanceToolbarSideLabel:SetPoint (10, -145) - frame6.sideBarsLabel:SetPoint (10, -170) --borders - frame6.statusbarLabel:SetPoint (10, -195) --statusbar - frame6.stretchAnchorLabel:SetPoint (10, -220) --stretch direction + frame6.instanceToolbarSideLabel:SetPoint (10, -120) + frame6.sideBarsLabel:SetPoint (10, -145) --borders + frame6.stretchAnchorLabel:SetPoint (10, -170) --stretch direction + frame6.backdropLabel:SetPoint (10, -195) + + frame6.menuAlphaAnchorLabel:SetPoint (10, -230) + frame6.alphaSwitchLabel:SetPoint (10, -255) + frame6.menuOnEnterLabel:SetPoint (10, -280) + frame6.menuOnLeaveLabel:SetPoint (10, -305) + --frame6.alphaIconsTooLabel:SetPoint (10, -330) + + frame6.statusbarAnchorLabel:SetPoint (10, -340) + frame6.statusbarLabel:SetPoint (10, -365) --statusbar + frame6.statusbarColorLabel:SetPoint (10, -390) - g:NewLabel (frame6, _, "$parentTotalBarAnchor", "totalBarAnchorLabel", "Total Bar", "GameFontNormal") - frame6.totalBarAnchorLabel:SetPoint (10, -255) - frame6.totalBarIconLabel:SetPoint (10, -280) - frame6.totalBarPickColorLabel:SetPoint (10, -305) - frame6.totalBarLabel:SetPoint (10, -355) - frame6.totalBarOnlyInGroupLabel:SetPoint (10, -330) - end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- Appearance - Top Menu Bar +-- Appearance - Top Menu Bar ~7 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame7() @@ -2061,77 +2432,72 @@ function window:CreateFrame7() local titulo_toolbar_desc = g:NewLabel (frame7, _, "$parentTituloToolbar2", "tituloToolbar2Label", Loc ["STRING_OPTIONS_TOOLBAR_SETTINGS_DESC"], "GameFontNormal", 9, "white") titulo_toolbar_desc.width = 320 - --> instance button anchor - g:NewSlider (frame7, _, "$parentInstanceButtonAnchorXSlider", "instanceButtonAnchorXSlider", SLIDER_WIDTH, 20, -200, 20, 1, instance.instance_button_anchor[1]) - g:NewSlider (frame7, _, "$parentInstanceButtonAnchorYSlider", "instanceButtonAnchorYSlider", SLIDER_WIDTH, 20, -10, 10, 1, instance.instance_button_anchor[2]) - - --> desaturate - g:NewSwitch (frame7, _, "$parentDesaturateMenuSlider", "desaturateMenuSlider", 60, 20, _, _, instance.desaturated_menu) - - --> hide icon - g:NewSwitch (frame7, _, "$parentHideIconSlider", "hideIconSlider", 60, 20, _, _, instance.hide_icon) - - --> menu anchor - g:NewSlider (frame7, _, "$parentMenuAnchorXSlider", "menuAnchorXSlider", SLIDER_WIDTH, 20, -20, 200, 1, instance.menu_anchor[1]) - g:NewSlider (frame7, _, "$parentMenuAnchorYSlider", "menuAnchorYSlider", SLIDER_WIDTH, 20, -10, 10, 1, instance.menu_anchor[2]) - - --> plugins icons grow direction - g:NewSwitch (frame7, _, "$parentPluginIconsDirectionSlider", "pluginIconsDirectionSlider", 80, 20, Loc ["STRING_LEFT"], Loc ["STRING_RIGHT"], instance.plugins_grow_direction) - - -- menu anchors - g:NewLabel (frame7, _, "$parentMenuAnchorXLabel", "menuAnchorXLabel", Loc ["STRING_OPTIONS_MENU_X"], "GameFontHighlightLeft") - frame7.menuAnchorXSlider:SetPoint ("left", frame7.menuAnchorXLabel, "right", 2) + local s = g:NewSlider (frame7, _, "$parentMenuAnchorXSlider", "menuAnchorXSlider", 100, 20, -200, 200, 1, instance.menu_anchor[1]) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + local s = g:NewSlider (frame7, _, "$parentMenuAnchorYSlider", "menuAnchorYSlider", 100, 20, -10, 10, 1, instance.menu_anchor[2]) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + + --g:NewLabel (frame7, _, "$parentMenuAnchorXLabel", "menuAnchorXLabel", Loc ["STRING_OPTIONS_MENU_X"], "GameFontHighlightLeft") + g:NewLabel (frame7, _, "$parentMenuAnchorXLabel", "menuAnchorXLabel", "Position", "GameFontHighlightLeft") + g:NewLabel (frame7, _, "$parentMenuAnchorYLabel", "menuAnchorYLabel", Loc ["STRING_OPTIONS_MENU_Y"], "GameFontHighlightLeft") + + frame7.menuAnchorXSlider:SetPoint ("left", frame7.menuAnchorXLabel, "right", 2, -1) + --frame7.menuAnchorYSlider:SetPoint ("left", frame7.menuAnchorYLabel, "right", 2) + frame7.menuAnchorYSlider:SetPoint ("left", frame7.menuAnchorXSlider, "right", 2) + frame7.menuAnchorXSlider:SetThumbSize (50) frame7.menuAnchorXSlider:SetHook ("OnValueChange", function (self, instance, x) instance:MenuAnchor (x, nil) end) - - frame7.menuAnchorXSlider.info = Loc ["STRING_OPTIONS_MENU_X_DESC"] - window:create_line_background (frame7, frame7.menuAnchorXLabel, frame7.menuAnchorXSlider) - frame7.menuAnchorXSlider:SetHook ("OnEnter", background_on_enter) - frame7.menuAnchorXSlider:SetHook ("OnLeave", background_on_leave) - - g:NewLabel (frame7, _, "$parentMenuAnchorYLabel", "menuAnchorYLabel", Loc ["STRING_OPTIONS_MENU_Y"], "GameFontHighlightLeft") - frame7.menuAnchorYSlider:SetPoint ("left", frame7.menuAnchorYLabel, "right", 2) frame7.menuAnchorYSlider:SetThumbSize (50) frame7.menuAnchorYSlider:SetHook ("OnValueChange", function (self, instance, y) instance:MenuAnchor (nil, y) end) - frame7.menuAnchorYSlider.info = Loc ["STRING_OPTIONS_MENU_Y_DESC"] + frame7.menuAnchorXSlider.info = Loc ["STRING_OPTIONS_MENU_X_DESC"] + window:create_line_background (frame7, frame7.menuAnchorXLabel, frame7.menuAnchorXSlider) + frame7.menuAnchorXSlider:SetHook ("OnEnter", background_on_enter) + frame7.menuAnchorXSlider:SetHook ("OnLeave", background_on_leave) + + frame7.menuAnchorYSlider.info = Loc ["STRING_OPTIONS_MENU_X_DESC"] window:create_line_background (frame7, frame7.menuAnchorYLabel, frame7.menuAnchorYSlider) frame7.menuAnchorYSlider:SetHook ("OnEnter", background_on_enter) frame7.menuAnchorYSlider:SetHook ("OnLeave", background_on_leave) - - -- instance button anchors - g:NewLabel (frame7, _, "$parentInstanceButtonAnchorXLabel", "instanceButtonAnchorXLabel", Loc ["STRING_OPTIONS_INSBUTTON_X"], "GameFontHighlightLeft") - frame7.instanceButtonAnchorXSlider:SetPoint ("left", frame7.instanceButtonAnchorXLabel, "right", 2) - frame7.instanceButtonAnchorXSlider:SetThumbSize (50) - frame7.instanceButtonAnchorXSlider:SetHook ("OnValueChange", function (self, instance, x) - instance:InstanceButtonAnchor (x, nil) - end) - - frame7.instanceButtonAnchorXSlider.info = Loc ["STRING_OPTIONS_INSBUTTON_X_DESC"] - window:create_line_background (frame7, frame7.instanceButtonAnchorXLabel, frame7.instanceButtonAnchorXSlider) - frame7.instanceButtonAnchorXSlider:SetHook ("OnEnter", background_on_enter) - frame7.instanceButtonAnchorXSlider:SetHook ("OnLeave", background_on_leave) - - g:NewLabel (frame7, _, "$parentInstanceButtonAnchorYLabel", "instanceButtonAnchorYLabel", Loc ["STRING_OPTIONS_INSBUTTON_Y"], "GameFontHighlightLeft") - frame7.instanceButtonAnchorYSlider:SetPoint ("left", frame7.instanceButtonAnchorYLabel, "right", 2) - frame7.instanceButtonAnchorYSlider:SetThumbSize (50) - frame7.instanceButtonAnchorYSlider:SetHook ("OnValueChange", function (self, instance, y) - instance:InstanceButtonAnchor (nil, y) - end) - - frame7.instanceButtonAnchorYSlider.info =Loc ["STRING_OPTIONS_INSBUTTON_Y_DESC"] - window:create_line_background (frame7, frame7.instanceButtonAnchorYLabel, frame7.instanceButtonAnchorYSlider) - frame7.instanceButtonAnchorYSlider:SetHook ("OnEnter", background_on_enter) - frame7.instanceButtonAnchorYSlider:SetHook ("OnLeave", background_on_leave) - - --> instance toolbar side + -- menu anchor left and right + + local menusode_switch_func = function (slider, value) + if (value == 1) then + return false + elseif (value == 2) then + return true + end + end + local menuside_return_func = function (slider, value) + if (value) then + return 2 + else + return 1 + end + end + + g:NewSwitch (frame7, _, "$parentMenuAnchorSideSlider", "pluginMenuAnchorSideSlider", 80, 20, Loc ["STRING_LEFT"], Loc ["STRING_RIGHT"], instance.menu_anchor.side, nil, menusode_switch_func, menuside_return_func) + g:NewLabel (frame7, _, "$parentMenuAnchorSideLabel", "menuAnchorSideLabel", Loc ["STRING_OPTIONS_MENU_ANCHOR"], "GameFontHighlightLeft") + + frame7.pluginMenuAnchorSideSlider:SetPoint ("left", frame7.menuAnchorSideLabel, "right", 2) + frame7.pluginMenuAnchorSideSlider.OnSwitch = function (self, instance, value) + instance:LeftMenuAnchorSide (value) + end + + window:CreateLineBackground (frame7, "pluginMenuAnchorSideSlider", "menuAnchorSideLabel", Loc ["STRING_OPTIONS_MENU_ANCHOR_DESC"]) + -- desaturate + g:NewSwitch (frame7, _, "$parentDesaturateMenuSlider", "desaturateMenuSlider", 60, 20, _, _, instance.desaturated_menu) g:NewLabel (frame7, _, "$parentDesaturateMenuLabel", "desaturateMenuLabel", Loc ["STRING_OPTIONS_DESATURATE_MENU"], "GameFontHighlightLeft") frame7.desaturateMenuSlider:SetPoint ("left", frame7.desaturateMenuLabel, "right", 2) @@ -2145,6 +2511,7 @@ function window:CreateFrame7() frame7.desaturateMenuSlider:SetHook ("OnLeave", background_on_leave) -- hide icon + g:NewSwitch (frame7, _, "$parentHideIconSlider", "hideIconSlider", 60, 20, _, _, instance.hide_icon) g:NewLabel (frame7, _, "$parentHideIconLabel", "hideIconLabel", Loc ["STRING_OPTIONS_HIDE_ICON"], "GameFontHighlightLeft") frame7.hideIconSlider:SetPoint ("left", frame7.hideIconLabel, "right", 2) @@ -2158,12 +2525,29 @@ function window:CreateFrame7() frame7.hideIconSlider:SetHook ("OnLeave", background_on_leave) -- plugin icons direction + local grow_switch_func = function (slider, value) + if (value == 1) then + return false + elseif (value == 2) then + return true + end + end + local grow_return_func = function (slider, value) + if (value) then + return 2 + else + return 1 + end + end + + g:NewSwitch (frame7, _, "$parentPluginIconsDirectionSlider", "pluginIconsDirectionSlider", 80, 20, Loc ["STRING_LEFT"], Loc ["STRING_RIGHT"], instance.plugins_grow_direction, nil, grow_switch_func, grow_return_func) g:NewLabel (frame7, _, "$parentPluginIconsDirectionLabel", "pluginIconsDirectionLabel", Loc ["STRING_OPTIONS_PICONS_DIRECTION"], "GameFontHighlightLeft") frame7.pluginIconsDirectionSlider:SetPoint ("left", frame7.pluginIconsDirectionLabel, "right", 2) frame7.pluginIconsDirectionSlider.OnSwitch = function (self, instance, value) - instance.plugins_grow_direction = value and 2 or 1 - instance:DefaultIcons() + instance.plugins_grow_direction = value + --instance:DefaultIcons() + _detalhes.ToolBar:ReorganizeIcons (nil, true) end frame7.pluginIconsDirectionSlider.thumb:SetSize (40, 12) @@ -2172,20 +2556,160 @@ function window:CreateFrame7() frame7.pluginIconsDirectionSlider:SetHook ("OnEnter", background_on_enter) frame7.pluginIconsDirectionSlider:SetHook ("OnLeave", background_on_leave) + --attribute text + --text anchor on options menu + g:NewLabel (frame7, _, "$parentAttributeLabelAnchor", "attributeLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ANCHOR"], "GameFontNormal") + + --enabled + g:NewLabel (frame7, _, "$parentAttributeEnabledLabel", "attributeEnabledLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ENABLED"], "GameFontHighlightLeft") + g:NewSwitch (frame7, _, "$parentAttributeEnabledSwitch", "attributeEnabledSwitch", 60, 20, nil, nil, instance.attribute_text.enabled) + frame7.attributeEnabledSwitch:SetPoint ("left", frame7.attributeEnabledLabel, "right", 2) + frame7.attributeEnabledSwitch.OnSwitch = function (self, instance, value) + instance:AttributeMenu (value) + end + window:CreateLineBackground (frame7, "attributeEnabledSwitch", "attributeEnabledLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ENABLED_DESC"]) + + --anchors + g:NewLabel (frame7, _, "$parentAttributeAnchorXLabel", "attributeAnchorXLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ANCHORX"], "GameFontHighlightLeft") + g:NewLabel (frame7, _, "$parentAttributeAnchorYLabel", "attributeAnchorYLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ANCHORY"], "GameFontHighlightLeft") + local s = g:NewSlider (frame7, _, "$parentAttributeAnchorXSlider", "attributeAnchorXSlider", SLIDER_WIDTH, 20, -20, 300, 1, instance.attribute_text.anchor [1]) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + local s = g:NewSlider (frame7, _, "$parentAttributeAnchorYSlider", "attributeAnchorYSlider", SLIDER_WIDTH, 20, -50, 50, 1, instance.attribute_text.anchor [2]) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + + frame7.attributeAnchorXSlider:SetPoint ("left", frame7.attributeAnchorXLabel, "right", 2) + frame7.attributeAnchorYSlider:SetPoint ("left", frame7.attributeAnchorYLabel, "right", 2) + + frame7.attributeAnchorXSlider:SetHook ("OnValueChange", function (self, instance, amount) + instance:AttributeMenu (nil, amount) + end) + frame7.attributeAnchorYSlider:SetHook ("OnValueChange", function (self, instance, amount) + instance:AttributeMenu (nil, nil, amount) + end) + + window:CreateLineBackground (frame7, "attributeAnchorXSlider", "attributeAnchorXLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ANCHORX_DESC"]) + window:CreateLineBackground (frame7, "attributeAnchorYSlider", "attributeAnchorYLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ANCHORY_DESC"]) + + --font + local on_select_attribute_font = function (self, instance, fontName) + instance:AttributeMenu (nil, nil, nil, fontName) + end + + local build_font_menu = function() + local fonts = {} + for name, fontPath in pairs (SharedMedia:HashTable ("font")) do + fonts [#fonts+1] = {value = name, label = name, onclick = on_select_attribute_font, font = fontPath} + end + return fonts + end + + g:NewLabel (frame7, _, "$parentAttributeFontLabel", "attributeFontLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_FONT"], "GameFontHighlightLeft") + local d = g:NewDropDown (frame7, _, "$parentAttributeFontDropdown", "attributeFontDropdown", DROPDOWN_WIDTH, 20, build_font_menu, instance.attribute_text.text_face) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + + frame7.attributeFontDropdown:SetPoint ("left", frame7.attributeFontLabel, "right", 2) + + window:CreateLineBackground (frame7, "attributeFontDropdown", "attributeFontLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_FONT_DESC"]) + + --size + g:NewLabel (frame7, _, "$parentAttributeTextSizeLabel", "attributeTextSizeLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_TEXTSIZE"], "GameFontHighlightLeft") + local s = g:NewSlider (frame7, _, "$parentAttributeTextSizeSlider", "attributeTextSizeSlider", SLIDER_WIDTH, 20, 8, 25, 1, tonumber ( instance.attribute_text.text_size)) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + + frame7.attributeTextSizeSlider:SetPoint ("left", frame7.attributeTextSizeLabel, "right", 2) + + frame7.attributeTextSizeSlider:SetHook ("OnValueChange", function (self, instance, amount) + instance:AttributeMenu (nil, nil, nil, nil, amount) + end) + + window:CreateLineBackground (frame7, "attributeTextSizeSlider", "attributeTextSizeLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_TEXTSIZE_DESC"]) + + --color + local attribute_text_color_callback = function (button, r, g, b, a) + _G.DetailsOptionsWindow.instance:AttributeMenu (nil, nil, nil, nil, nil, {r, g, b, a}) + end + g:NewColorPickButton (frame7, "$parentAttributeTextColorPick", "attributeTextColorPick", attribute_text_color_callback) + g:NewLabel (frame7, _, "$parentAttributeTextColorLabel", "attributeTextColorLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_TEXTCOLOR"], "GameFontHighlightLeft") + + frame7.attributeTextColorPick:SetPoint ("left", frame7.attributeTextColorLabel, "right", 2, 0) + + window:CreateLineBackground (frame7, "attributeTextColorPick", "attributeTextColorLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_TEXTCOLOR_DESC"]) + + --side + local side_switch_func = function (slider, value) if (value == 2) then return false elseif (value == 1) then return true end end + local side_return_func = function (slider, value) if (value) then return 1 else return 2 end end + + g:NewLabel (frame7, _, "$parentAttributeSideLabel", "attributeSideLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_SIDE"], "GameFontHighlightLeft") + g:NewSwitch (frame7, _, "$parentAttributeSideSwitch", "attributeSideSwitch", 80, 20, "bottom", "top", instance.attribute_text.side, nil, side_switch_func, side_return_func) + frame7.attributeSideSwitch:SetPoint ("left", frame7.attributeSideLabel, "right", 2) + frame7.attributeSideSwitch.OnSwitch = function (self, instance, value) + instance:AttributeMenu (nil, nil, nil, nil, nil, nil, value) + end + --frame7.attributeSideSwitch:SetThumbSize (50) + window:CreateLineBackground (frame7, "attributeSideSwitch", "attributeSideLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_SIDE_DESC"]) + + --auto hide menus + --text anchor on options menu + g:NewLabel (frame7, _, "$parentAutoHideLabelAnchor", "autoHideLabel", Loc ["STRING_OPTIONS_MENU_AUTOHIDE_ANCHOR"], "GameFontNormal") + + --left + g:NewLabel (frame7, _, "$parentAutoHideLeftMenuLabel", "autoHideLeftMenuLabel", Loc ["STRING_OPTIONS_MENU_AUTOHIDE_LEFT"], "GameFontHighlightLeft") + g:NewSwitch (frame7, _, "$parentAutoHideLeftMenuSwitch", "autoHideLeftMenuSwitch", 60, 20, nil, nil, instance.auto_hide_menu.left) + frame7.autoHideLeftMenuSwitch:SetPoint ("left", frame7.autoHideLeftMenuLabel, "right", 2) + frame7.autoHideLeftMenuSwitch.OnSwitch = function (self, instance, value) + --do something + instance:SetAutoHideMenu (value) + end + window:CreateLineBackground (frame7, "autoHideLeftMenuSwitch", "autoHideLeftMenuLabel", Loc ["STRING_OPTIONS_MENU_AUTOHIDE_DESC"]) + --right + g:NewLabel (frame7, _, "$parentAutoHideRightMenuLabel", "autoHideRightMenuLabel", Loc ["STRING_OPTIONS_MENU_AUTOHIDE_RIGHT"], "GameFontHighlightLeft") + g:NewSwitch (frame7, _, "$parentAutoHideRightMenuSwitch", "autoHideRightMenuSwitch", 60, 20, nil, nil, instance.auto_hide_menu.right) + frame7.autoHideRightMenuSwitch:SetPoint ("left", frame7.autoHideRightMenuLabel, "right", 2) + frame7.autoHideRightMenuSwitch.OnSwitch = function (self, instance, value) + --do something + instance:SetAutoHideMenu (nil, value) + end + window:CreateLineBackground (frame7, "autoHideRightMenuSwitch", "autoHideRightMenuLabel", Loc ["STRING_OPTIONS_MENU_AUTOHIDE_DESC"]) + + + --> anchors titulo_toolbar:SetPoint (10, -10) titulo_toolbar_desc:SetPoint (10, -30) - frame7.instanceButtonAnchorXLabel:SetPoint (10, -70) - frame7.instanceButtonAnchorYLabel:SetPoint (10, -95) - frame7.menuAnchorXLabel:SetPoint (10, -120) - frame7.menuAnchorYLabel:SetPoint (10, -145) - frame7.desaturateMenuLabel:SetPoint (10, -170) - frame7.hideIconLabel:SetPoint (10, -195) - frame7.pluginIconsDirectionLabel:SetPoint (10, -220) - -end + frame7.menuAnchorXLabel:SetPoint (10, -70) + --frame7.menuAnchorYLabel:SetPoint (10, -95) + frame7.menuAnchorSideLabel:SetPoint (10, -95) + frame7.desaturateMenuLabel:SetPoint (10, -120) + frame7.hideIconLabel:SetPoint (10, -145) + frame7.pluginIconsDirectionLabel:SetPoint (10, -170) + frame7.attributeLabel:SetPoint (10, -205) + frame7.attributeEnabledLabel:SetPoint (10, -230) + frame7.attributeAnchorXLabel:SetPoint (10, -255) + frame7.attributeAnchorYLabel:SetPoint (10, -280) + frame7.attributeFontLabel:SetPoint (10, -305) + frame7.attributeTextSizeLabel:SetPoint (10, -330) + frame7.attributeTextColorLabel:SetPoint (10, -355) + frame7.attributeSideLabel:SetPoint (10, -380) + + frame7.autoHideLabel:SetPoint (10, -415) + frame7.autoHideLeftMenuLabel:SetPoint (10, -435) + frame7.autoHideRightMenuLabel:SetPoint (10, -455) + + + +end + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- Appearance - Reset Instance Close +-- Appearance - Reset Instance Close ~8 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame8() @@ -2226,7 +2750,11 @@ function window:CreateFrame8() frame8.resetTextColorPick:SetHook ("OnLeave", background_on_leave) --text size - g:NewSlider (frame8, _, "$parentResetTextSizeSlider", "resetTextSizeSlider", SLIDER_WIDTH, 20, 8, 15, 1, tonumber (instance.resetbutton_info.text_size)) + local s = g:NewSlider (frame8, _, "$parentResetTextSizeSlider", "resetTextSizeSlider", SLIDER_WIDTH, 20, 8, 15, 1, tonumber (instance.resetbutton_info.text_size)) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + frame8.resetTextSizeSlider:SetHook ("OnValueChange", function (self, instance, amount) instance:SetDeleteButtonSettings (nil, amount) end) @@ -2246,12 +2774,20 @@ function window:CreateFrame8() end return fontTable end - g:NewDropDown (frame8, _, "$parentResetTextFontDropdown", "resetTextFontDropdown", DROPDOWN_WIDTH, 20, reset_text_color_build_font_menu, nil) + local d = g:NewDropDown (frame8, _, "$parentResetTextFontDropdown", "resetTextFontDropdown", DROPDOWN_WIDTH, 20, reset_text_color_build_font_menu, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) --> instance button --text color pick --text size - g:NewSlider (frame8, _, "$parentInstanceTextSizeSlider", "instanceTextSizeSlider", SLIDER_WIDTH, 20, 8, 15, 1, tonumber (instance.instancebutton_info.text_size)) + local s = g:NewSlider (frame8, _, "$parentInstanceTextSizeSlider", "instanceTextSizeSlider", SLIDER_WIDTH, 20, 8, 15, 1, tonumber (instance.instancebutton_info.text_size)) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + frame8.instanceTextSizeSlider:SetHook ("OnValueChange", function (self, instance, amount) instance:SetInstanceButtonSettings (nil, amount) end) @@ -2269,13 +2805,18 @@ function window:CreateFrame8() end return fontTable end - g:NewDropDown (frame8, _, "$parentInstanceTextFontDropdown", "instanceTextFontDropdown", DROPDOWN_WIDTH, 20, instance_text_color_build_font_menu, nil) + local d = g:NewDropDown (frame8, _, "$parentInstanceTextFontDropdown", "instanceTextFontDropdown", DROPDOWN_WIDTH, 20, instance_text_color_build_font_menu, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) -- reset button -- text font + g:NewLabel (frame8, _, "$parentResetTextFontLabel", "resetTextFontLabel", Loc ["STRING_OPTIONS_RESET_TEXTFONT"], "GameFontHighlightLeft") frame8.resetTextFontDropdown:SetPoint ("left", frame8.resetTextFontLabel, "right", 2) @@ -2366,6 +2907,42 @@ function window:CreateFrame8() frame8.instanceOverlayColorPick:SetHook ("OnEnter", background_on_enter) frame8.instanceOverlayColorPick:SetHook ("OnLeave", background_on_leave) + --> instance button anchor + local s = g:NewSlider (frame8, _, "$parentInstanceButtonAnchorXSlider", "instanceButtonAnchorXSlider", SLIDER_WIDTH, 20, -200, 20, 1, instance.instance_button_anchor[1]) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + local s = g:NewSlider (frame8, _, "$parentInstanceButtonAnchorYSlider", "instanceButtonAnchorYSlider", SLIDER_WIDTH, 20, -10, 10, 1, instance.instance_button_anchor[2]) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + + g:NewLabel (frame8, _, "$parentInstanceButtonAnchorXLabel", "instanceButtonAnchorXLabel", Loc ["STRING_OPTIONS_INSBUTTON_X"], "GameFontHighlightLeft") + frame8.instanceButtonAnchorXSlider:SetPoint ("left", frame8.instanceButtonAnchorXLabel, "right", 2) + frame8.instanceButtonAnchorXSlider:SetThumbSize (50) + frame8.instanceButtonAnchorXSlider:SetHook ("OnValueChange", function (self, instance, x) + instance:InstanceButtonAnchor (x, nil) + end) + + frame8.instanceButtonAnchorXSlider.info = Loc ["STRING_OPTIONS_INSBUTTON_X_DESC"] + window:create_line_background (frame8, frame8.instanceButtonAnchorXLabel, frame8.instanceButtonAnchorXSlider) + frame8.instanceButtonAnchorXSlider:SetHook ("OnEnter", background_on_enter) + frame8.instanceButtonAnchorXSlider:SetHook ("OnLeave", background_on_leave) + + g:NewLabel (frame8, _, "$parentInstanceButtonAnchorYLabel", "instanceButtonAnchorYLabel", Loc ["STRING_OPTIONS_INSBUTTON_Y"], "GameFontHighlightLeft") + frame8.instanceButtonAnchorYSlider:SetPoint ("left", frame8.instanceButtonAnchorYLabel, "right", 2) + frame8.instanceButtonAnchorYSlider:SetThumbSize (50) + frame8.instanceButtonAnchorYSlider:SetHook ("OnValueChange", function (self, instance, y) + instance:InstanceButtonAnchor (nil, y) + end) + + frame8.instanceButtonAnchorYSlider.info =Loc ["STRING_OPTIONS_INSBUTTON_Y_DESC"] + window:create_line_background (frame8, frame8.instanceButtonAnchorYLabel, frame8.instanceButtonAnchorYSlider) + frame8.instanceButtonAnchorYSlider:SetHook ("OnEnter", background_on_enter) + frame8.instanceButtonAnchorYSlider:SetHook ("OnLeave", background_on_leave) + + + -- close button -- color overlay @@ -2383,23 +2960,25 @@ function window:CreateFrame8() frame8.instanceTextFontLabel:SetPoint (10, -125) frame8.instanceTextSizeLabel:SetPoint (10, -150) frame8.instanceOverlayColorPickLabel:SetPoint (10, -175) + frame8.instanceButtonAnchorXLabel:SetPoint (10, -200) + frame8.instanceButtonAnchorYLabel:SetPoint (10, -225) - frame8.resetAnchorLabel:SetPoint (10, -210) + frame8.resetAnchorLabel:SetPoint (10, -260) - frame8.resetTextColorPickLabel:SetPoint (10, -235) - frame8.resetTextFontLabel:SetPoint (10, -260) - frame8.resetTextSizeLabel:SetPoint (10, -285) - frame8.resetOverlayColorPickLabel:SetPoint (10, -310) - frame8.resetAlwaysSmallLabel:SetPoint (10, -335) + frame8.resetTextColorPickLabel:SetPoint (10, -285) + frame8.resetTextFontLabel:SetPoint (10, -310) + frame8.resetTextSizeLabel:SetPoint (10, -335) + frame8.resetOverlayColorPickLabel:SetPoint (10, -360) + frame8.resetAlwaysSmallLabel:SetPoint (10, -385) - frame8.closeAnchorLabel:SetPoint (10, -370) + frame8.closeAnchorLabel:SetPoint (10, -420) - frame8.closeButtonColorLabel:SetPoint (10, -395) + frame8.closeButtonColorLabel:SetPoint (10, -445) end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- Appearance - Wallpaper +-- Appearance - Wallpaper ~9 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame9() @@ -2414,23 +2993,24 @@ function window:CreateFrame9() --> primeiro o botão de editar a imagem local callmeback = function (width, height, overlayColor, alpha, texCoords) - local tinstance = _G ["DetailsOptionsWindow"].MyObject.instance + local tinstance = _G.DetailsOptionsWindow.instance tinstance:InstanceWallpaper (nil, nil, alpha, texCoords, width, height, overlayColor) window:update_wallpaper_info() end local startImageEdit = function() - local tinstance = _G ["DetailsOptionsWindow"].MyObject.instance + local tinstance = _G.DetailsOptionsWindow.instance if (not tinstance.wallpaper.texture) then return end - - if (tinstance.wallpaper.texture:find ("TALENTFRAME")) then - g:ImageEditor (callmeback, tinstance.wallpaper.texture, tinstance.wallpaper.texcoord, tinstance.wallpaper.overlay, _G.DetailsOptionsWindow.instance.baseframe.wallpaper:GetWidth(), _G.DetailsOptionsWindow.instance.baseframe.wallpaper:GetHeight()) + + local wp = tinstance.wallpaper + + if (wp.texture:find ("TALENTFRAME")) then + g:ImageEditor (callmeback, wp.texture, wp.texcoord, wp.overlay, tinstance.baseframe.wallpaper:GetWidth(), tinstance.baseframe.wallpaper:GetHeight(), nil, wp.alpha) else - tinstance.wallpaper.overlay [4] = 0.5 - g:ImageEditor (callmeback, tinstance.wallpaper.texture, tinstance.wallpaper.texcoord, tinstance.wallpaper.overlay, _G.DetailsOptionsWindow.instance.baseframe.wallpaper:GetWidth(), _G.DetailsOptionsWindow.instance.baseframe.wallpaper:GetHeight()) + g:ImageEditor (callmeback, wp.texture, wp.texcoord, wp.overlay, tinstance.baseframe.wallpaper:GetWidth(), tinstance.baseframe.wallpaper:GetHeight(), nil, wp.alpha) end end g:NewButton (frame9, _, "$parentEditImage", "editImage", 200, 18, startImageEdit, nil, nil, nil, Loc ["STRING_OPTIONS_EDITIMAGE"]) @@ -2454,7 +3034,11 @@ function window:CreateFrame9() return anchorMenu end - g:NewDropDown (frame9, _, "$parentAnchorDropdown", "anchorDropdown", DROPDOWN_WIDTH, 20, buildAnchorMenu, nil) + local d = g:NewDropDown (frame9, _, "$parentAnchorDropdown", "anchorDropdown", DROPDOWN_WIDTH, 20, buildAnchorMenu, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) --> agora cria os 2 dropdown da categoria e wallpaper @@ -2646,9 +3230,18 @@ function window:CreateFrame9() local buildBackgroundMenu = function() return backgroundTable end g:NewSwitch (frame9, _, "$parentUseBackgroundSlider", "useBackgroundSlider", 60, 20, _, _, _G.DetailsOptionsWindow.instance.wallpaper.enabled) - g:NewDropDown (frame9, _, "$parentBackgroundDropdown", "backgroundDropdown", DROPDOWN_WIDTH, 20, buildBackgroundMenu, nil) - g:NewDropDown (frame9, _, "$parentBackgroundDropdown2", "backgroundDropdown2", DROPDOWN_WIDTH, 20, buildBackgroundMenu2, nil) - + local d = g:NewDropDown (frame9, _, "$parentBackgroundDropdown", "backgroundDropdown", DROPDOWN_WIDTH, 20, buildBackgroundMenu, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + + local d = g:NewDropDown (frame9, _, "$parentBackgroundDropdown2", "backgroundDropdown2", DROPDOWN_WIDTH, 20, buildBackgroundMenu2, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + -- Wallpaper Settings -- wallpaper @@ -2718,6 +3311,41 @@ function window:CreateFrame9() frame9.backgroundDropdown2:SetHook ("OnEnter", background_on_enter) frame9.backgroundDropdown2:SetHook ("OnLeave", background_on_leave) + g:NewLabel (frame9, _, "$parentWallpaperPreviewAnchor", "wallpaperPreviewAnchorLabel", "Preview:", "GameFontNormal") + + --128 64 + + local icon1 = g:NewImage (frame9, _, "$parentIcon1", nil, 128, 64) + icon1:SetTexture ("Interface\\AddOns\\Details\\images\\icons") + icon1:SetPoint ("topleft", frame9.wallpaperPreviewAnchorLabel.widget, "bottomleft", 0, -5) + icon1:SetDrawLayer ("artwork", 0) + icon1:SetTexCoord (0.337890625, 0.5859375, 0.59375, 0.716796875-0.0009765625) --173 304 300 367 + local icon2 = g:NewImage (frame9, _, "$parentIcon2", nil, 128, 64) + icon2:SetTexture ("Interface\\AddOns\\Details\\images\\icons") + icon2:SetPoint ("left", icon1.widget, "right") + icon2:SetDrawLayer ("artwork", 0) + icon2:SetTexCoord (0.337890625, 0.5859375, 0.59375, 0.716796875-0.0009765625) --173 304 300 367 + + local icon3 = g:NewImage (frame9, _, "$parentIcon3", nil, 128, 64) + icon3:SetTexture ("Interface\\AddOns\\Details\\images\\icons") + icon3:SetPoint ("top", icon1.widget, "bottom") + icon3:SetDrawLayer ("artwork", 0) + icon3:SetTexCoord (0.337890625, 0.5859375, 0.59375+0.0009765625, 0.716796875) --173 304 300 367 + local icon4 = g:NewImage (frame9, _, "$parentIcon4", nil, 128, 64) + icon4:SetTexture ("Interface\\AddOns\\Details\\images\\icons") + icon4:SetPoint ("left", icon3.widget, "right") + icon4:SetDrawLayer ("artwork", 0) + icon4:SetTexCoord (0.337890625, 0.5859375, 0.59375+0.0009765625, 0.716796875) --173 304 300 367 + + icon1:SetVertexColor (.15, .15, .15, 1) + icon2:SetVertexColor (.15, .15, .15, 1) + icon3:SetVertexColor (.15, .15, .15, 1) + icon4:SetVertexColor (.15, .15, .15, 1) + + local preview = frame9:CreateTexture (nil, "overlay") + preview:SetSize (256, 128) + preview:SetPoint ("topleft", frame9.wallpaperPreviewAnchorLabel.widget, "bottomleft", 0, -5) + function window:update_wallpaper_info() local w = _G.DetailsOptionsWindow.instance.wallpaper @@ -2725,16 +3353,19 @@ function window:CreateFrame9() a = a * 100 a = string.format ("%.1f", a) .. "%" - local t = w.texcoord [1] or 0 + local t = w.texcoord [3] or 0 t = t * 100 t = string.format ("%.3f", t) .. "%" - local b = w.texcoord [2] or 1 + + local b = w.texcoord [4] or 1 b = b * 100 b = string.format ("%.3f", b) .. "%" - local l = w.texcoord [3] or 0 + + local l = w.texcoord [1] or 0 l = l * 100 l = string.format ("%.3f", l) .. "%" - local r = w.texcoord [4] or 1 + + local r = w.texcoord [2] or 1 r = r * 100 r = string.format ("%.3f", r) .. "%" @@ -2745,6 +3376,11 @@ function window:CreateFrame9() local blue = w.overlay[3] or "0" blue = math.ceil (blue * 255) + preview:SetTexture (w.texture) + preview:SetTexCoord (unpack (w.texcoord)) + preview:SetVertexColor (unpack (w.overlay)) + preview:SetAlpha (w.alpha) + frame9.wallpaperCurrentLabel.text = "Texture File: " .. (w.texture or "-- -- --") .. "\nAlpha: " .. a .. "\nOverlay red: " .. red .. " green: " .. green .. " blue: " .. blue .. "\nCut (top): " .. t .. "\nCut (bottom): " .. b .. "\nCut (left): " .. l .. "\nCut (right): " .. r end @@ -2768,16 +3404,17 @@ function window:CreateFrame9() frame9.anchorLabel:SetPoint (10, -145) frame9.editImage:SetPoint (10, -170) + frame9.wallpaperPreviewAnchorLabel:SetPoint (10, -210) + frame9.wallpaperCurrentAnchorLabel:SetPoint (10, -380) frame9.wallpaperCurrentLabel:SetPoint (10, -400) - --> wallpaper settings end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- Performance - Tweaks +-- Performance - Tweaks ~10 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame10() @@ -2790,11 +3427,17 @@ function window:CreateFrame10() titulo_performance_general_desc.width = 320 --------------- Memory - g:NewSlider (frame10, _, "$parentSliderSegmentsSave", "segmentsSliderToSave", SLIDER_WIDTH, 20, 1, 5, 1, _detalhes.segments_amount_to_save) - + local s = g:NewSlider (frame10, _, "$parentSliderSegmentsSave", "segmentsSliderToSave", SLIDER_WIDTH, 20, 1, 5, 1, _detalhes.segments_amount_to_save) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + g:NewLabel (frame10, _, "$parentLabelMemory", "memoryLabel", Loc ["STRING_OPTIONS_MEMORYT"], "GameFontHighlightLeft") - g:NewSlider (frame10, _, "$parentSliderMemory", "memorySlider", SLIDER_WIDTH, 20, 1, 4, 1, _detalhes.memory_threshold) + local s = g:NewSlider (frame10, _, "$parentSliderMemory", "memorySlider", SLIDER_WIDTH, 20, 1, 4, 1, _detalhes.memory_threshold) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + frame10.memorySlider:SetPoint ("left", frame10.memoryLabel, "right", 2, 0) frame10.memorySlider:SetHook ("OnValueChange", function (slider, _, amount) @@ -2912,7 +3555,7 @@ function window:CreateFrame10() end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- Performance - Captures +-- Performance - Captures ~11 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame11() @@ -3294,7 +3937,7 @@ end local panel_index = 1 local percent_string = g:NewLabel (window, nil, nil, "percent_string", "loading: 0%", "GameFontNormal", 12) percent_string.textcolor = "white" - percent_string:SetPoint ("bottomleft", window, "bottomleft", 27, 11) + percent_string:SetPoint ("bottomleft", window, "bottomleft", 340, 12) local step = 7.6923 function _detalhes:create_options_panels() @@ -3307,6 +3950,12 @@ end percent_string.hide = true _G.DetailsOptionsWindow.full_created = true + + local first_button = all_buttons [1] + last_pressed = first_button + first_button.widget.text:SetPoint ("left", first_button.widget, "left", 3, -1) + first_button.textcolor = selected_textcolor + end percent_string.text = "wait... " .. math.floor (step * panel_index) .. "%" @@ -3324,9 +3973,16 @@ end window:create_left_menu() _G.DetailsOptionsWindow.full_created = true + + local first_button = all_buttons [1] + last_pressed = first_button + first_button.widget.text:SetPoint ("left", first_button.widget, "left", 3, -1) + first_button.textcolor = selected_textcolor end + + select_options (1) end --> if not window @@ -3339,7 +3995,9 @@ function window:update_all (editing_instance) --> window 1 _G.DetailsOptionsWindow1RealmNameSlider.MyObject:SetValue (_detalhes.remove_realm_from_name) _G.DetailsOptionsWindow1Slider.MyObject:SetValue (_detalhes.segments_amount) --segments + _G.DetailsOptionsWindow1UseScrollSlider.MyObject:SetValue (_detalhes.use_scroll) + _G.DetailsOptionsWindow1SliderMaxInstances.MyObject:SetValue (_detalhes.instances_amount) _G.DetailsOptionsWindow1MinimapSlider.MyObject:SetValue (not _detalhes.minimap.hide) _G.DetailsOptionsWindow1AbbreviateDropdown.MyObject:Select (_detalhes.ps_abbreviation) @@ -3348,25 +4006,91 @@ function window:update_all (editing_instance) --> window 2 _G.DetailsOptionsWindow2FragsPvpSlider.MyObject:SetValue (_detalhes.only_pvp_frags) - _G.DetailsOptionsWindow2TTDropdown.MyObject:Select (_detalhes.time_type) + _G.DetailsOptionsWindow2TTDropdown.MyObject:Select (_detalhes.time_type) - --> window 13 - _G.DetailsOptionsWindow13SelectProfileDropdown.MyObject:Select (_detalhes:GetCurrentProfileName()) - _G.DetailsOptionsWindow13SelectProfileDropdown.MyObject:SetFixedParameter (editing_instance) + --> window 4 + _G.DetailsOptionsWindow4BarStartSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow4BarStartSlider.MyObject:SetValue (editing_instance.row_info.start_after_icon) + + --> window 5 + _G.DetailsOptionsWindow5TotalBarSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow5TotalBarSlider.MyObject:SetValue (editing_instance.total_bar.enabled) + + _G.DetailsOptionsWindow5TotalBarColorPick.MyObject:SetColor (unpack (editing_instance.total_bar.color)) + + _G.DetailsOptionsWindow5TotalBarOnlyInGroupSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow5TotalBarOnlyInGroupSlider.MyObject:SetValue (editing_instance.total_bar.only_in_group) + _G.DetailsOptionsWindow5TotalBarIconTexture.MyObject:SetTexture (editing_instance.total_bar.icon) + + --> window 6 + _G.DetailsOptionsWindow6MenuOnEnterLeaveAlphaSwitch.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow6MenuOnEnterAlphaSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow6MenuOnLeaveAlphaSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow6MenuOnEnterLeaveAlphaIconsTooSwitch.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow6BackdropDropdown.MyObject:SetFixedParameter (editing_instance) + + _G.DetailsOptionsWindow6MenuOnEnterAlphaSlider.MyObject:SetValue (editing_instance.menu_alpha.onenter) + _G.DetailsOptionsWindow6MenuOnLeaveAlphaSlider.MyObject:SetValue (editing_instance.menu_alpha.onleave) + _G.DetailsOptionsWindow6MenuOnEnterLeaveAlphaSwitch.MyObject:SetValue (editing_instance.menu_alpha.enabled) + _G.DetailsOptionsWindow6MenuOnEnterLeaveAlphaIconsTooSwitch.MyObject:SetValue (editing_instance.menu_alpha.iconstoo) + _G.DetailsOptionsWindow6BackdropDropdown.MyObject:Select (editing_instance.backdrop_texture) + + local r, g, b = unpack (editing_instance.statusbar_info.overlay) + _G.DetailsOptionsWindow6StatusbarColorPick.MyObject:SetColor (r, g, b, editing_instance.statusbar_info.alpha) + + --> window 7 + + _G.DetailsOptionsWindow7AttributeEnabledSwitch.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow7AttributeAnchorXSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow7AttributeAnchorYSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow7AttributeFontDropdown.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow7AttributeTextSizeSlider.MyObject:SetFixedParameter (editing_instance) + + _G.DetailsOptionsWindow7AttributeEnabledSwitch.MyObject:SetValue (editing_instance.attribute_text.enabled) + _G.DetailsOptionsWindow7AttributeAnchorXSlider.MyObject:SetValue (editing_instance.attribute_text.anchor [1]) + _G.DetailsOptionsWindow7AttributeAnchorYSlider.MyObject:SetValue (editing_instance.attribute_text.anchor [2]) + _G.DetailsOptionsWindow7AttributeFontDropdown.MyObject:Select (instance.attribute_text.text_face) + _G.DetailsOptionsWindow7AttributeTextSizeSlider.MyObject:SetValue (tonumber (editing_instance.attribute_text.text_size)) + _G.DetailsOptionsWindow7AttributeTextColorPick.MyObject:SetColor (unpack (editing_instance.attribute_text.text_color)) + + _G.DetailsOptionsWindow7AttributeSideSwitch.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow7AttributeSideSwitch.MyObject:SetValue (editing_instance.attribute_text.side) + + _G.DetailsOptionsWindow7AutoHideRightMenuSwitch.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow7AutoHideRightMenuSwitch.MyObject:SetValue (editing_instance.auto_hide_menu.right) + + _G.DetailsOptionsWindow7AutoHideLeftMenuSwitch.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow7AutoHideLeftMenuSwitch.MyObject:SetValue (editing_instance.auto_hide_menu.left) + + _G.DetailsOptionsWindow7MenuAnchorSideSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow7MenuAnchorSideSlider.MyObject:SetValue (editing_instance.menu_anchor.side) + + --> window 8 + _G.DetailsOptionsWindow8InstanceButtonAnchorXSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow8InstanceButtonAnchorXSlider.MyObject:SetValue (editing_instance.instance_button_anchor[1]) + + _G.DetailsOptionsWindow8InstanceButtonAnchorYSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow8InstanceButtonAnchorYSlider.MyObject:SetValue (editing_instance.instance_button_anchor[2]) --> window 10 _G.DetailsOptionsWindow10SliderMemory.MyObject:SetValue (_detalhes.memory_threshold) _G.DetailsOptionsWindow10PanicModeSlider.MyObject:SetValue (_detalhes.segments_panic_mode) _G.DetailsOptionsWindow10ClearAnimateScrollSlider.MyObject:SetValue (_detalhes.animate_scroll) _G.DetailsOptionsWindow10SliderSegmentsSave.MyObject:SetValue (_detalhes.segments_amount_to_save) - + --> window 11 _G.DetailsOptionsWindow11CaptureDamageSlider.MyObject:SetValue (_detalhes.capture_real ["damage"]) _G.DetailsOptionsWindow11CaptureHealSlider.MyObject:SetValue (_detalhes.capture_real ["heal"]) _G.DetailsOptionsWindow11CaptureEnergySlider.MyObject:SetValue (_detalhes.capture_real ["energy"]) _G.DetailsOptionsWindow11CaptureMiscSlider.MyObject:SetValue (_detalhes.capture_real ["miscdata"]) _G.DetailsOptionsWindow11CaptureAuraSlider.MyObject:SetValue (_detalhes.capture_real ["aura"]) - _G.DetailsOptionsWindow11CloudAuraSlider.MyObject:SetValue (_detalhes.cloud_capture) + _G.DetailsOptionsWindow11CloudAuraSlider.MyObject:SetValue (_detalhes.cloud_capture) + + --> window 13 + _G.DetailsOptionsWindow13SelectProfileDropdown.MyObject:Select (_detalhes:GetCurrentProfileName()) + _G.DetailsOptionsWindow13SelectProfileDropdown.MyObject:SetFixedParameter (editing_instance) + + ---------- _G.DetailsOptionsWindow8ResetTextColorPick.MyObject:SetColor (unpack (editing_instance.resetbutton_info.text_color)) @@ -3389,14 +4113,7 @@ function window:update_all (editing_instance) _G.DetailsOptionsWindow6SideBarsSlider.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow6SideBarsSlider.MyObject:SetValue (editing_instance.show_sidebars) - _G.DetailsOptionsWindow6TotalBarSlider.MyObject:SetFixedParameter (editing_instance) - _G.DetailsOptionsWindow6TotalBarSlider.MyObject:SetValue (editing_instance.total_bar.enabled) - - _G.DetailsOptionsWindow6TotalBarColorPick.MyObject:SetColor (unpack (editing_instance.total_bar.color)) - - _G.DetailsOptionsWindow6TotalBarOnlyInGroupSlider.MyObject:SetFixedParameter (editing_instance) - _G.DetailsOptionsWindow6TotalBarOnlyInGroupSlider.MyObject:SetValue (editing_instance.total_bar.only_in_group) - _G.DetailsOptionsWindow6TotalBarIconTexture.MyObject:SetTexture (editing_instance.total_bar.icon) + _G.DetailsOptionsWindow6StatusbarSlider.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow6StatusbarSlider.MyObject:SetValue (editing_instance.show_statusbar) @@ -3428,11 +4145,11 @@ function window:update_all (editing_instance) _G.DetailsOptionsWindow7MenuAnchorYSlider.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow7MenuAnchorYSlider.MyObject:SetValue (editing_instance.menu_anchor[2]) - _G.DetailsOptionsWindow7InstanceButtonAnchorXSlider.MyObject:SetFixedParameter (editing_instance) - _G.DetailsOptionsWindow7InstanceButtonAnchorXSlider.MyObject:SetValue (editing_instance.instance_button_anchor[1]) + - _G.DetailsOptionsWindow7InstanceButtonAnchorYSlider.MyObject:SetFixedParameter (editing_instance) - _G.DetailsOptionsWindow7InstanceButtonAnchorYSlider.MyObject:SetValue (editing_instance.instance_button_anchor[2]) + + + ---------------------------------------------------------------- @@ -3511,16 +4228,8 @@ function window:update_all (editing_instance) _G.DetailsOptionsWindow9AnchorDropdown.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow9BackgroundDropdown.MyObject:Select (editing_instance.wallpaper.texture) - if (editing_instance.wallpaper.enabled) then - _G.DetailsOptionsWindow9BackgroundDropdown.MyObject:Enable() - _G.DetailsOptionsWindow9BackgroundDropdown2.MyObject:Enable() - _G.DetailsOptionsWindow9UseBackgroundSlider.MyObject:SetValue (2) - else - _G.DetailsOptionsWindow9BackgroundDropdown.MyObject:Disable() - _G.DetailsOptionsWindow9BackgroundDropdown2.MyObject:Disable() - _G.DetailsOptionsWindow9UseBackgroundSlider.MyObject:SetValue (1) - end - + _G.DetailsOptionsWindow9UseBackgroundSlider.MyObject:SetValue (editing_instance.wallpaper.enabled) + _G.DetailsOptionsWindow6WindowColorPick.MyObject:SetColor (unpack (editing_instance.color)) --_G.DetailsOptionsWindow6InstanceColorTexture.MyObject:SetTexture (unpack (editing_instance.color)) @@ -3571,7 +4280,7 @@ else function _detalhes:options_loading_done() if (_G.DetailsOptionsWindow.full_created) then _G.DetailsOptionsWindow.MyObject:update_all (instance) - _detalhes:CancelTimer (window.loading_check) + _detalhes:CancelTimer (window.loading_check, true) end end window.loading_check = _detalhes:ScheduleRepeatingTimer ("options_loading_done", 0.1) diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index 0df2decf..56e325a3 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -35,10 +35,13 @@ local modo_alone = _detalhes._detalhes_props["MODO_ALONE"] local modo_grupo = _detalhes._detalhes_props["MODO_GROUP"] local modo_all = _detalhes._detalhes_props["MODO_ALL"] +--constants +local baseframe_strata = "HIGH" local gump_fundo_backdrop = { bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}} + function _detalhes:ScheduleUpdate (instancia) instancia.barraS = {nil, nil} instancia.update = true @@ -300,6 +303,10 @@ end local function OnLeaveMainWindow (instancia, self) + instancia.is_interacting = false + instancia:SetMenuAlpha (nil, nil, nil, true) + instancia:SetAutoHideMenu (nil, nil, true) + if (instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and not instancia.baseframe.isLocked) then --> resizes and lock button @@ -325,6 +332,10 @@ _detalhes.OnLeaveMainWindow = OnLeaveMainWindow local function OnEnterMainWindow (instancia, self) + instancia.is_interacting = true + instancia:SetMenuAlpha (nil, nil, nil, true) + instancia:SetAutoHideMenu (nil, nil, true) + if (instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and not instancia.baseframe.isLocked) then --> resizes and lock button @@ -663,6 +674,7 @@ local function BFrame_scripts (baseframe, instancia) baseframe:SetScript("OnSizeChanged", function (self) instancia:SaveMainWindowPosition() instancia:ReajustaGump() + instancia.oldwith = baseframe:GetWidth() _detalhes:SendEvent ("DETAILS_INSTANCE_SIZECHANGED", nil, instancia) end) @@ -1247,8 +1259,12 @@ 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) + if (instancia.row_info.no_icon) then + esta_barra.texto_esquerdo:SetPoint ("left", esta_barra.statusbar, "left", 3, -1) + else + esta_barra.texto_esquerdo:SetPoint ("left", esta_barra.icone_classe, "right", 4, -1) + end self.mouse_down = _GetTime() self.button = button @@ -1278,8 +1294,12 @@ 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") + if (instancia.row_info.no_icon) then + esta_barra.texto_esquerdo:SetPoint ("left", esta_barra.statusbar, "left", 2, 0) + else + esta_barra.texto_esquerdo:SetPoint ("left", esta_barra.icone_classe, "right", 3, 0) + end local x, y = _GetCursorPosition() x = _math_floor (x) @@ -1445,7 +1465,7 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) gump:GradientEffect (esta_instancia.baseframe.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, esta_instancia.baseframe.wallpaper.alpha, 1.0) end - esta_instancia.baseframe:SetFrameStrata ("LOW") + esta_instancia.baseframe:SetFrameStrata (baseframe_strata) esta_instancia.baseframe.button_stretch:SetFrameStrata ("FULLSCREEN") _detalhes:SendEvent ("DETAILS_INSTANCE_ENDSTRETCH", nil, esta_instancia.baseframe) end @@ -1462,7 +1482,7 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) gump:GradientEffect (baseframe.wallpaper, "texture", _r, _g, _b, _a, _r, _g, _b, instancia.wallpaper.alpha, 1.0) end - baseframe:SetFrameStrata ("LOW") + baseframe:SetFrameStrata (baseframe_strata) baseframe.button_stretch:SetFrameStrata ("FULLSCREEN") _detalhes:SnapTextures (false) @@ -1830,7 +1850,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) local baseframe = CreateFrame ("scrollframe", "DetailsBaseFrame"..ID, _UIParent) --> main frame baseframe.instance = instancia - baseframe:SetFrameStrata ("LOW") + baseframe:SetFrameStrata (baseframe_strata) baseframe:SetFrameLevel (2) local backgroundframe = CreateFrame ("scrollframe", "Details_WindowFrame"..ID, baseframe) --> main window @@ -1954,7 +1974,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) baseframe:EnableMouse (true) baseframe:SetMovable (true) baseframe:SetResizable (true) - baseframe:SetMinResize (150, 40) + baseframe:SetMinResize (150, 7) baseframe:SetMaxResize (_detalhes.max_window_size.width, _detalhes.max_window_size.height) baseframe:SetBackdrop (gump_fundo_backdrop) @@ -2022,8 +2042,8 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) 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:SetFrameLevel (baseframe:GetFrameLevel() + 6) baseframe.resize_direita.side = 2 --> lock window button @@ -2039,6 +2059,8 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) 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:SetFrameStrata ("HIGH") + baseframe.lock_button:SetFrameLevel (baseframe:GetFrameLevel() + 6) --> left resizer baseframe.resize_esquerda = CreateFrame ("button", "Details_Resize_Esquerda"..ID, baseframe) @@ -2055,8 +2077,8 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) 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:SetFrameLevel (baseframe:GetFrameLevel() + 6) baseframe.resize_esquerda:SetAlpha (0) baseframe.resize_direita:SetAlpha (0) @@ -2088,8 +2110,11 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) -- left and right side bars ------------------------------------------------------------------------------------------------------------------------------------------------------------ -- ~barra ~bordas ~border + local floatingframe = CreateFrame ("frame", "DetailsInstance"..ID.."BorderHolder", baseframe) + floatingframe:SetFrameLevel (baseframe:GetFrameLevel()+7) + instancia.floatingframe = floatingframe --> left - baseframe.barra_esquerda = baseframe.cabecalho.fechar:CreateTexture (nil, "artwork") + baseframe.barra_esquerda = floatingframe:CreateTexture (nil, "artwork") baseframe.barra_esquerda:SetTexture (DEFAULT_SKIN) baseframe.barra_esquerda:SetTexCoord (unpack (COORDS_LEFT_SIDE_BAR)) baseframe.barra_esquerda:SetWidth (64) @@ -2097,7 +2122,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) 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 = floatingframe:CreateTexture (nil, "artwork") baseframe.barra_direita:SetTexture (DEFAULT_SKIN) baseframe.barra_direita:SetTexCoord (unpack (COORDS_RIGHT_SIDE_BAR)) baseframe.barra_direita:SetWidth (64) @@ -2105,7 +2130,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) 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 = floatingframe:CreateTexture (nil, "artwork") baseframe.barra_fundo:SetTexture (DEFAULT_SKIN) baseframe.barra_fundo:SetTexCoord (unpack (COORDS_BOTTOM_SIDE_BAR)) baseframe.barra_fundo:SetWidth (512) @@ -2297,13 +2322,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", "DetailsBarra_Statusbar_"..instancia.meu_id.."_"..index, esta_barra) --esta_barra.statusbar:SetAllPoints (esta_barra) esta_barra.textura = esta_barra.statusbar:CreateTexture (nil, "artwork") esta_barra.textura:SetHorizTile (false) esta_barra.textura:SetVertTile (false) - esta_barra.textura:SetTexture (instancia.row_info.texture_file) + + local current_texture = SharedMedia:Fetch ("statusbar", instancia.row_info.texture) + esta_barra.textura:SetTexture (current_texture) esta_barra.background = esta_barra:CreateTexture (nil, "background") esta_barra.background:SetTexture() @@ -2318,7 +2345,7 @@ function gump:CriaNovaBarra (instancia, index) local icone_classe = esta_barra.statusbar:CreateTexture (nil, "overlay") 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:SetTexture (instancia.row_info.icon_file) icone_classe:SetTexCoord (.75, 1, .75, 1) esta_barra.icone_classe = icone_classe @@ -2340,11 +2367,11 @@ function gump:CriaNovaBarra (instancia, index) 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) + --_detalhes.font_pool:add (esta_barra.texto_esquerdo) 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) + --_detalhes.font_pool:add (esta_barra.texto_direita) if (instancia.row_info.textL_outline) then instancia:SetFontOutline (esta_barra.texto_esquerdo, instancia.row_info.textL_outline) @@ -2416,11 +2443,21 @@ function _detalhes:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, self:InstanceRefreshRows() end -function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, backgroundtexture, backgroundcolorclass, backgroundfixedcolor, alpha, iconfile) +function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, backgroundtexture, backgroundcolorclass, backgroundfixedcolor, alpha, iconfile, barstart) + + --> bar start + if (type (barstart) == "boolean") then + self.row_info.start_after_icon = barstart + end --> icon file if (iconfile) then self.row_info.icon_file = iconfile + if (iconfile == "") then + self.row_info.no_icon = true + else + self.row_info.no_icon = false + end end --> alpha @@ -2516,6 +2553,11 @@ function _detalhes:InstanceRefreshRows (instancia) --alpha local alpha = self.row_info.alpha + --icons + local no_icon = self.row_info.no_icon + local icon_texture = self.row_info.icon_file + local start_after_icon = self.row_info.start_after_icon + -- do it for _, row in _ipairs (self.barras) do @@ -2524,6 +2566,24 @@ function _detalhes:InstanceRefreshRows (instancia) row:SetHeight (height) row.icone_classe:SetHeight (height) row.icone_classe:SetWidth (height) + + --> icon + if (no_icon) then + row.statusbar:SetPoint ("topleft", row, "topleft") + row.statusbar:SetPoint ("bottomright", row, "bottomright") + row.texto_esquerdo:SetPoint ("left", row.statusbar, "left", 2, 0) + row.icone_classe:Hide() + else + if (start_after_icon) then + row.statusbar:SetPoint ("topleft", row.icone_classe, "topright") + else + row.statusbar:SetPoint ("topleft", row, "topleft") + end + + row.statusbar:SetPoint ("bottomright", row, "bottomright") + row.texto_esquerdo:SetPoint ("left", row.icone_classe, "right", 3, 0) + row.icone_classe:Show() + end if (not self.row_info.texture_background_class_color) then local c = self.row_info.fixed_texture_background_color @@ -2672,7 +2732,6 @@ function _detalhes:InstanceWallpaper (texture, anchor, alpha, texcoord, width, h end t:SetTexture (texture) - t:SetAlpha (alpha) t:SetTexCoord (unpack (texcoord)) t:SetWidth (width) t:SetHeight (height) @@ -2687,36 +2746,151 @@ function _detalhes:InstanceWallpaper (texture, anchor, alpha, texcoord, width, h wallpaper.height = height wallpaper.overlay = overlay - if (t.faded) then - gump:Fade (t, "out") + t:Show() + --t:SetAlpha (alpha) + gump:Fade (t, "ALPHAANIM", alpha) + +end + +function _detalhes:GetTextures() + local t = {} + t [1] = self.baseframe.rodape.esquerdo + t [2] = self.baseframe.rodape.direita + t [3] = self.baseframe.rodape.top_bg + + t [4] = self.baseframe.cabecalho.ball_r + t [5] = self.baseframe.cabecalho.ball + t [6] = self.baseframe.cabecalho.emenda + t [7] = self.baseframe.cabecalho.top_bg + + t [8] = self.baseframe.barra_esquerda + t [9] = self.baseframe.barra_direita + t [10] = self.baseframe.UPFrame + return t + --atributo_icon é uma exceção +end + +function _detalhes:SetWindowAlphaForInteract (alpha) + + if (self.is_interacting) then + --> entrou + self.baseframe:SetAlpha (alpha) else - gump:Fade (t, "AlphaAnim", alpha) + --> saiu + if (self.combat_changes_alpha) then --> combat alpha + self.baseframe:SetAlpha (self.combat_changes_alpha) + else + self.baseframe:SetAlpha (alpha) + end + end + +end + +function _detalhes:SetWindowAlphaForCombat (entering_in_combat) + + local amount + + if (entering_in_combat) then + amount = self.hide_in_combat_alpha / 100 + self.combat_changes_alpha = amount + else + if (self.menu_alpha.enabled) then --auto transparency + if (self.is_interacting) then + amount = self.menu_alpha.onenter + else + amount = self.menu_alpha.onleave + end + else + amount = self.color [4] + end + self.combat_changes_alpha = nil + end + + gump:Fade (self.baseframe, "ALPHAANIM", amount) + + if (self.show_statusbar) then + self.baseframe.barra_fundo:Hide() + end + if (self.hide_icon) then + self.baseframe.cabecalho.atributo_icon:Hide() + end + +end + +function _detalhes:InstanceButtonsColors (red, green, blue, alpha, no_save, only_left, only_right) + + if (not red) then + red, green, blue, alpha = unpack (self.color_buttons) + end + + if (type (red) ~= "number") then + red, green, blue, alpha = gump:ParseColors (red) + end + + if (not no_save) then + self.color_buttons [1] = red + self.color_buttons [2] = green + self.color_buttons [3] = blue + self.color_buttons [4] = alpha + end + + local baseToolbar = self.baseframe.cabecalho + + + if (only_left) then + + local icons = {baseToolbar.modo_selecao, baseToolbar.segmento, baseToolbar.atributo, baseToolbar.report} + + for _, button in _ipairs (icons) do + button:SetAlpha (alpha) + end + + if (self:IsLowerInstance()) then + for _, ThisButton in _ipairs (_detalhes.ToolBar.Shown) do + ThisButton:SetAlpha (alpha) + end + end + + elseif (only_right) then + + local icons = {baseToolbar.novo, baseToolbar.fechar} + + if (self.meu_id == _detalhes.ResetButtonInstance) then + tinsert (icons, _detalhes.ResetButton) + tinsert (icons, _detalhes.ResetButton2) + end + + for _, button in _ipairs (icons) do + button:SetAlpha (alpha) + end + + else + + local icons = {baseToolbar.modo_selecao, baseToolbar.segmento, baseToolbar.atributo, baseToolbar.report, baseToolbar.novo, baseToolbar.fechar} + + if (self.meu_id == _detalhes.ResetButtonInstance) then + tinsert (icons, _detalhes.ResetButton) + tinsert (icons, _detalhes.ResetButton2) + end + + for _, button in _ipairs (icons) do + button:SetAlpha (alpha) + end + + if (self:IsLowerInstance()) then + for _, ThisButton in _ipairs (_detalhes.ToolBar.Shown) do + ThisButton:SetAlpha (alpha) + end + end + end end -function _detalhes:SetWindowAlpha (alpha, run_instance_color) - local current_alpha = self.window_alpha or 1 - - if (current_alpha > alpha) then - gump:Fade (self.baseframe, "ALPHAANIM", alpha) - else - gump:Fade (self.baseframe, "ALPHAANIM", alpha) - end - - gump:Fade (self.baseframe.cabecalho.ball, "ALPHAANIM", alpha) - gump:Fade (self.baseframe.cabecalho.atributo_icon, "ALPHAANIM", alpha) - - self.window_alpha = alpha - - if (run_instance_color) then - self:InstanceColor() - end -end - -function _detalhes:InstanceColor (red, green, blue, alpha, no_save) +function _detalhes:InstanceColor (red, green, blue, alpha, no_save, change_statusbar) if (not red) then red, green, blue, alpha = unpack (self.color) + no_save = true end if (type (red) ~= "number") then @@ -2724,27 +2898,37 @@ function _detalhes:InstanceColor (red, green, blue, alpha, no_save) end if (not no_save) then + --> saving self.color [1] = red self.color [2] = green self.color [3] = blue self.color [4] = alpha + if (change_statusbar) then + self:StatusBarColor (red, green, blue, alpha) + end + else + --> not saving + self:StatusBarColor (nil, nil, nil, alpha, true) end local skin = _detalhes.skins [self.skin] + --[[ self.baseframe.rodape.esquerdo:SetVertexColor (red, green, blue) self.baseframe.rodape.esquerdo:SetAlpha (alpha) self.baseframe.rodape.direita:SetVertexColor (red, green, blue) self.baseframe.rodape.direita:SetAlpha (alpha) self.baseframe.rodape.top_bg:SetVertexColor (red, green, blue) self.baseframe.rodape.top_bg:SetAlpha (alpha) + --]] self.baseframe.cabecalho.ball_r:SetVertexColor (red, green, blue) self.baseframe.cabecalho.ball_r:SetAlpha (alpha) self.baseframe.cabecalho.ball:SetVertexColor (red, green, blue) - if (skin.can_change_alpha_head) then - self.baseframe.cabecalho.ball:SetAlpha (alpha) - end + + self.baseframe.cabecalho.ball:SetAlpha (alpha) + self.baseframe.cabecalho.atributo_icon:SetAlpha (alpha) + self.baseframe.cabecalho.emenda:SetVertexColor (red, green, blue) self.baseframe.cabecalho.emenda:SetAlpha (alpha) self.baseframe.cabecalho.top_bg:SetVertexColor (red, green, blue) @@ -2757,7 +2941,9 @@ function _detalhes:InstanceColor (red, green, blue, alpha, no_save) 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 + self.baseframe.UPFrame:SetAlpha (alpha) + + --self.color[1], self.color[2], self.color[3], self.color[4] = red, green, blue, alpha end function _detalhes:StatusBarAlertTime (instance) @@ -3753,6 +3939,12 @@ function _detalhes:ChangeSkin (skin_name) _detalhes.ResetButton2.Left:SetTexCoord (unpack (this_skin.reset_button_small_coords or this_skin.reset_button_coords)) _detalhes.ResetButton2.Left:SetSize (_detalhes.ResetButton2:GetSize()) + if (this_skin.reset_button_small_size) then + _detalhes.ResetButton2:SetSize (unpack (this_skin.reset_button_small_size)) + else + _detalhes.ResetButton2:SetSize (22, 15) + end + --> remove propriedades do botão da blizzard _detalhes:DisableUIPanelButton (_detalhes.ResetButton) _detalhes:DisableUIPanelButton (_detalhes.ResetButton2) @@ -3761,6 +3953,7 @@ function _detalhes:ChangeSkin (skin_name) if (_detalhes.ResetButtonInstance == self.meu_id) then _detalhes:RestoreUIPanelButton (_detalhes.ResetButton) _detalhes:RestoreUIPanelButton (_detalhes.ResetButton2) + _detalhes.ResetButton2:SetSize (22, 15) end end @@ -3769,7 +3962,7 @@ function _detalhes:ChangeSkin (skin_name) if (this_skin.instance_button_coords) then --> seta o botão - self.baseframe.cabecalho.novo:SetHeight (12) + self.baseframe.cabecalho.novo:SetHeight (this_skin.instance_button_size or 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()) @@ -3893,12 +4086,12 @@ function _detalhes:ChangeSkin (skin_name) if (_detalhes.ResetButtonInstance == self.meu_id) then self:SetDeleteButtonSettings() end - + --> refresh close button self:SetCloseButtonSettings() --> update toolbar - self:ToolbarSide() -- aqui + self:ToolbarSide() --> update stretch button self:StretchButtonAnchor() @@ -3912,7 +4105,7 @@ function _detalhes:ChangeSkin (skin_name) --> update statusbar if (self.show_statusbar) then - self:ShowStatusBar() -- aqui + self:ShowStatusBar() else self:HideStatusBar() end @@ -3928,7 +4121,9 @@ function _detalhes:ChangeSkin (skin_name) self:InstanceColor() self:SetBackgroundColor() self:SetBackgroundAlpha() - + self:SetAutoHideMenu() + self:SetBackdropTexture() + --> refresh all bars self:InstanceRefreshRows() @@ -3936,6 +4131,15 @@ function _detalhes:ChangeSkin (skin_name) --> update menu saturation self:DesaturateMenu() + --> update statusbar color + self:StatusBarColor() + + --> update attribute string + self:AttributeMenu() + self:LeftMenuAnchorSide() + + _detalhes.ToolBar:ReorganizeIcons (nil, true) --call self:SetMenuAlpha() + --> refresh options panel if opened if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then --print (self.meu_id) @@ -3956,11 +4160,275 @@ function _detalhes:ChangeSkin (skin_name) self.bgframe.skin = this_skin --self.bgframe.skin_script_instance = true end - + end end +function _detalhes:LeftMenuAnchorSide (side) + + if (not side) then + side = self.menu_anchor.side + end + + self.menu_anchor.side = side + + return self:MenuAnchor() + +end + +-- ~attributemenu +function _detalhes:AttributeMenu (enabled, pos_x, pos_y, font, size, color, side) + + if (type (enabled) ~= "boolean") then + enabled = self.attribute_text.enabled + end + + if (not pos_x) then + pos_x = self.attribute_text.anchor [1] + end + if (not pos_y) then + pos_y = self.attribute_text.anchor [2] + end + + if (not font) then + font = self.attribute_text.text_face + end + + if (not size) then + size = self.attribute_text.text_size + end + + if (not color) then + color = self.attribute_text.text_color + end + + if (not side) then + side = self.attribute_text.side + end + + self.attribute_text.enabled = enabled + self.attribute_text.anchor [1] = pos_x + self.attribute_text.anchor [2] = pos_y + self.attribute_text.text_face = font + self.attribute_text.text_size = size + self.attribute_text.text_color = color + self.attribute_text.side = side + + --> enabled + if (not enabled and self.menu_attribute_string) then + return self.menu_attribute_string:Hide() + elseif (not enabled) then + return + end + + if (not self.menu_attribute_string) then + + local label = gump:NewLabel (self.floatingframe, nil, "DetailsAttributeStringInstance" .. self.meu_id, nil, "", "GameFontHighlightSmall") + self.menu_attribute_string = label + self.menu_attribute_string.text = _detalhes:GetSubAttributeName (self.atributo, self.sub_atributo) + self.menu_attribute_string.owner_instance = self + + self.menu_attribute_string.Enabled = true + self.menu_attribute_string.__enabled = true + + function self.menu_attribute_string:OnEvent (instance, attribute, subAttribute) + if (instance == label.owner_instance) then + label.text = _detalhes:GetSubAttributeName (attribute, subAttribute) + end + end + + _detalhes:RegisterEvent (self.menu_attribute_string, "DETAILS_INSTANCE_CHANGEATTRIBUTE", self.menu_attribute_string.OnEvent) + + end + + self.menu_attribute_string:Show() + + --> anchor + if (side == 1) then --> a string esta no lado de cima + if (self.toolbar_side == 1) then -- a toolbar esta em cima + self.menu_attribute_string:ClearAllPoints() + self.menu_attribute_string:SetPoint ("bottomleft", self.baseframe.cabecalho.ball, "bottomright", self.attribute_text.anchor [1], self.attribute_text.anchor [2]) + + elseif (self.toolbar_side == 2) then --a toolbar esta em baixo + self.menu_attribute_string:ClearAllPoints() + self.menu_attribute_string:SetPoint ("bottomleft", self.baseframe, "topleft", self.attribute_text.anchor [1] + 21, self.attribute_text.anchor [2]) + + end + + elseif (side == 2) then --> a string esta no lado de baixo + if (self.toolbar_side == 1) then --toolbar esta em cima + self.menu_attribute_string:ClearAllPoints() + self.menu_attribute_string:SetPoint ("left", self.baseframe.rodape.StatusBarLeftAnchor, "left", self.attribute_text.anchor [1] + 16, self.attribute_text.anchor [2] - 6) + + elseif (self.toolbar_side == 2) then --toolbar esta em baixo + self.menu_attribute_string:SetPoint ("bottomleft", self.baseframe.cabecalho.ball, "topright", self.attribute_text.anchor [1], self.attribute_text.anchor [2] - 19) + + end + end + + --font face + local fontPath = SharedMedia:Fetch ("font", font) + _detalhes:SetFontFace (self.menu_attribute_string, fontPath) + + --font size + _detalhes:SetFontSize (self.menu_attribute_string, size) + + --color + _detalhes:SetFontColor (self.menu_attribute_string, color) + +end + +-- ~backdrop +function _detalhes:SetBackdropTexture (texturename) + + if (not texturename) then + texturename = self.backdrop_texture + end + + self.backdrop_texture = texturename + + local texture_path = SharedMedia:Fetch ("background", texturename) + + self.baseframe:SetBackdrop ({ + bgFile = texture_path, tile = true, tileSize = 128, + insets = {left = 0, right = 0, top = 0, bottom = 0}} + ) + self.bgdisplay:SetBackdrop ({ + bgFile = texture_path, tile = true, tileSize = 128, + insets = {left = 0, right = 0, top = 0, bottom = 0}} + ) + + self:SetBackgroundAlpha (self.bg_alpha) + +end + +-- ~alpha +function _detalhes:SetAutoHideMenu (left, right, interacting) + + if (interacting) then + if (self.is_interacting) then + if (self.auto_hide_menu.left) then + local r, g, b = unpack (self.color_buttons) + self:InstanceButtonsColors (r, g, b, 1, true, true) --no save, only left + end + if (self.auto_hide_menu.right) then + local r, g, b = unpack (self.color_buttons) + self:InstanceButtonsColors (r, g, b, 1, true, nil, true) --no save, only right + end + else + if (self.auto_hide_menu.left) then + local r, g, b = unpack (self.color_buttons) + self:InstanceButtonsColors (r, g, b, 0, true, true) --no save, only left + end + if (self.auto_hide_menu.right) then + local r, g, b = unpack (self.color_buttons) + self:InstanceButtonsColors (r, g, b, 0, true, nil, true) --no save, only right + end + end + return + end + + if (left == nil) then + left = self.auto_hide_menu.left + end + if (right == nil) then + right = self.auto_hide_menu.right + end + + self.auto_hide_menu.left = left + self.auto_hide_menu.right = right + + local r, g, b = unpack (self.color_buttons) + + if (not left) then + --auto hide is off + self:InstanceButtonsColors (r, g, b, 1, true, true) --no save, only left + else + if (self.is_interacting) then + self:InstanceButtonsColors (r, g, b, 1, true, true) --no save, only left + else + self:InstanceButtonsColors (0, 0, 0, 0, true, true) --no save, only left + end + end + + if (not right) then + --auto hide is off + self:InstanceButtonsColors (r, g, b, 1, true, nil, true) --no save, only right + else + if (self.is_interacting) then + self:InstanceButtonsColors (r, g, b, 1, true, nil, true) --no save, only right + else + self:InstanceButtonsColors (0, 0, 0, 0, true, nil, true) --no save, only right + end + end + + --auto_hide_menu = {left = false, right = false}, + +end +function _detalhes:SetMenuAlpha (enabled, onenter, onleave, interacting) + + if (interacting) then --> called from a onenter or onleave script + if (self.menu_alpha.enabled) then + if (self.is_interacting) then + return self:SetWindowAlphaForInteract (self.menu_alpha.onenter) + else + return self:SetWindowAlphaForInteract (self.menu_alpha.onleave) + end + end + return + end + + if (enabled == nil) then + enabled = self.menu_alpha.enabled + end + if (not onenter) then + onenter = self.menu_alpha.onenter + end + if (not onleave) then + onleave = self.menu_alpha.onleave + end + + self.menu_alpha.enabled = enabled + self.menu_alpha.onenter = onenter + self.menu_alpha.onleave = onleave + + if (not enabled) then + return self:SetWindowAlphaForInteract (self.color [4]) + end + + if (self.is_interacting) then + return self:SetWindowAlphaForInteract (onenter) --> set alpha + else + return self:SetWindowAlphaForInteract (onleave) --> set alpha + end + +end + +function _detalhes:GetInstanceCurrentAlpha() + if (self.menu_alpha.enabled) then + if (self:IsInteracting()) then + return self.menu_alpha.onenter + else + return self.menu_alpha.onleave + end + else + return self.color [4] + end +end + +function _detalhes:GetInstanceIconsCurrentAlpha() + if (self.menu_alpha.enabled and self.menu_alpha.iconstoo) then + if (self:IsInteracting()) then + return self.menu_alpha.onenter + else + return self.menu_alpha.onleave + end + else + return 1 + end +end + function _detalhes:ToolbarSide (side) if (not side) then @@ -4053,6 +4521,8 @@ function _detalhes:ToolbarSide (side) self:ShowSideBars() end + self:AttributeMenu() + end function _detalhes:StretchButtonAnchor (side) @@ -4137,26 +4607,52 @@ function _detalhes:MenuAnchor (x, y) 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) + if (self.menu_anchor.side == 1) then --> left + if (self.consolidate) then + self.consolidateButton:ClearAllPoints() - 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) + if (self.toolbar_side == 1) then --> top + self.consolidateButton:SetPoint ("bottomleft", self.baseframe.cabecalho.ball, "bottomright", x, y) + + else --> bottom - else --> bottom - self.baseframe.cabecalho.modo_selecao:SetPoint ("topleft", self.baseframe.cabecalho.ball, "topright", x, y*-1) + 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 + + elseif (self.menu_anchor.side == 2) then --> right + if (self.consolidate) then + self.consolidateButton:ClearAllPoints() + + if (self.toolbar_side == 1) then --> top + self.consolidateButton:SetPoint ("bottomright", self.baseframe, "topright", 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 ("topleft", self.baseframe.cabecalho.ball_r, "bottomleft", x, y+16) + + else --> bottom + self.baseframe.cabecalho.modo_selecao:SetPoint ("topleft", self.baseframe.cabecalho.ball_r, "topleft", x, y*-1) + + end end end end @@ -4345,6 +4841,29 @@ function _detalhes:HideStatusBar (instancia) _detalhes.StatusBar:Hide (self) --> mini displays widgets end +function _detalhes:StatusBarColor (r, g, b, a, no_save) + + if (not r) then + r, g, b = unpack (self.statusbar_info.overlay) + a = a or self.statusbar_info.alpha + end + + if (not no_save) then + self.statusbar_info.overlay [1] = r + self.statusbar_info.overlay [2] = g + self.statusbar_info.overlay [3] = b + self.statusbar_info.alpha = a + end + + self.baseframe.rodape.esquerdo:SetVertexColor (r, g, b) + self.baseframe.rodape.esquerdo:SetAlpha (a) + self.baseframe.rodape.direita:SetVertexColor (r, g, b) + self.baseframe.rodape.direita:SetAlpha (a) + self.baseframe.rodape.top_bg:SetVertexColor (r, g, b) + self.baseframe.rodape.top_bg:SetAlpha (a) + +end + function _detalhes:ShowStatusBar (instancia) if (instancia) then self = instancia @@ -4458,6 +4977,15 @@ function gump:CriaCabecalho (baseframe, instancia) BGFrame_scripts (baseframe.UPFrame, baseframe, instancia) + --> corrige o vão entre o baseframe e o upframe + baseframe.UPFrameConnect = CreateFrame ("frame", "DetailsAntiGap"..instancia.meu_id, baseframe) + baseframe.UPFrameConnect:SetPoint ("bottomleft", baseframe, "topleft", 0, -1) + baseframe.UPFrameConnect:SetPoint ("bottomright", baseframe, "topright", 0, -1) + baseframe.UPFrameConnect:SetHeight (2) + baseframe.UPFrameConnect:EnableMouse (true) + baseframe.UPFrameConnect:SetMovable (true) + baseframe.UPFrameConnect:SetResizable (true) + BGFrame_scripts (baseframe.UPFrameConnect, baseframe, instancia) -- botões ------------------------------------------------------------------------------------------------------------------------------------------------- @@ -4854,9 +5382,7 @@ function gump:CriaCabecalho (baseframe, instancia) instancia = _detalhes:GetInstance (instancia) end - --print (instancia.baseframe, instancia.baseframe:GetObjectType()) - - if (instancia.baseframe:GetWidth() < 215) then + if (instancia.baseframe:GetWidth() < 215 or instancia.resetbutton_info.always_small) then _detalhes.ResetButtonMode = 2 else _detalhes.ResetButtonMode = 1 diff --git a/gumps/janela_welcome.lua b/gumps/janela_welcome.lua index a36c2780..807334e8 100644 --- a/gumps/janela_welcome.lua +++ b/gumps/janela_welcome.lua @@ -171,7 +171,7 @@ function _detalhes:OpenWelcomeWindow () Loc ["STRING_WELCOME_41"] = "Some Cool Interface Tweaks:" Loc ["STRING_WELCOME_42"] = "Quick Appearance Settings" - Loc ["STRING_WELCOME_43"] = "Bellow there is few settings for change the look of window." + Loc ["STRING_WELCOME_43"] = "Choose your prefered skin:" Loc ["STRING_WELCOME_44"] = "Wallpaper" Loc ["STRING_WELCOME_45"] = "For more customization options, check the options panel." @@ -229,7 +229,7 @@ function _detalhes:OpenWelcomeWindow () Loc ["STRING_WELCOME_41"] = "Alguns ajustes bacanas na interface:" Loc ["STRING_WELCOME_42"] = "Ajustes na Aparencia" - Loc ["STRING_WELCOME_43"] = "Abaixo estao algumas opcoes para mudar a aparencia da janela." + Loc ["STRING_WELCOME_43"] = "Escolha sua Skin preferida:" Loc ["STRING_WELCOME_44"] = "Papel de Parede" Loc ["STRING_WELCOME_45"] = "Para mais ajustes na aparencia, veja o painel de opcoes." @@ -679,7 +679,12 @@ function _detalhes:OpenWelcomeWindow () texto_appearance:SetJustifyV ("top") texto_appearance:SetTextColor (1, 1, 1, 1) - --> widgets (all raw copy from options panel): + local skins_image = window:CreateTexture (nil, "overlay") + skins_image:SetTexture ([[Interface\Addons\Details\images\icons2]]) + skins_image:SetPoint ("topright", window, "topright", -30, -24) + skins_image:SetWidth (214) + skins_image:SetHeight (133) + skins_image:SetTexCoord (0, 0.41796875, 0, 0.259765625) --0, 0, 214 133 --skin @@ -945,7 +950,7 @@ function _detalhes:OpenWelcomeWindow () end end - pages [#pages+1] = {bg55, texto55, texto555, changemind, texto_appearance, skin_dropdown, skin_label, wallpaper_label_switch, wallpaper_switch, wallpaper_dropdown1, wallpaper_dropdown2, } + pages [#pages+1] = {bg55, texto55, texto555, skins_image, changemind, texto_appearance, skin_dropdown, skin_label, wallpaper_label_switch, wallpaper_switch, wallpaper_dropdown1, wallpaper_dropdown2, } for _, widget in ipairs (pages[#pages]) do widget:Hide() diff --git a/gumps/switch.lua b/gumps/switch.lua index 6a23d41b..c18d9b42 100644 --- a/gumps/switch.lua +++ b/gumps/switch.lua @@ -27,6 +27,9 @@ do frame:SetBackdropBorderColor (170/255, 170/255, 170/255) frame:SetBackdropColor (24/255, 24/255, 24/255, .8) + frame:SetFrameStrata ("HIGH") + frame:SetFrameLevel (8) + function _detalhes.switch:CloseMe() _detalhes.switch.frame:Hide() _detalhes.switch.frame:SetBackdropColor (24/255, 24/255, 24/255, .8) @@ -34,10 +37,10 @@ do end --> limitação: não tenho como pegar o base frame da instância por aqui - frame.close = gump:NewDetailsButton (frame, frame, _, function() end, nil, nil, 1, 1, "", "", "", "", {rightFunc = {func = _detalhes.switch.CloseMe, param1 = nil, param2 = nil}}) + frame.close = gump:NewDetailsButton (frame, frame, _, function() end, nil, nil, 1, 1, "", "", "", "", {rightFunc = {func = _detalhes.switch.CloseMe, param1 = nil, param2 = nil}}, "DetailsSwitchPanelClose") frame.close:SetPoint ("topleft", frame, "topleft") frame.close:SetPoint ("bottomright", frame, "bottomright") - frame.close:SetFrameLevel (frame:GetFrameLevel()+1) + frame.close:SetFrameLevel (9) frame:Hide() _detalhes.switch.frame = frame @@ -58,7 +61,7 @@ function _detalhes.switch:ShowMe (instancia) _detalhes.switch.current_instancia = instancia - _detalhes.switch.frame:SetFrameLevel (instancia.baseframe:GetFrameLevel() + 5) + --_detalhes.switch.frame:SetFrameLevel (instancia.baseframe:GetFrameLevel() + 5) _detalhes.switch.frame:SetPoint ("topleft", instancia.baseframe, "topleft", 2, 0) _detalhes.switch.frame:SetPoint ("bottomright", instancia.baseframe, "bottomright", -2, 0) diff --git a/images/icons.tga b/images/icons.tga index 21d744f1..ae770c2a 100644 Binary files a/images/icons.tga and b/images/icons.tga differ diff --git a/images/icons2.tga b/images/icons2.tga index 80b1780f..b274fbc6 100644 Binary files a/images/icons2.tga and b/images/icons2.tga differ diff --git a/images/options_window.tga b/images/options_window.tga index fe2a9712..e8f185db 100644 Binary files a/images/options_window.tga and b/images/options_window.tga differ diff --git a/images/skins/elvui.tga b/images/skins/elvui.tga index b7cb4dbd..99fe01bb 100644 Binary files a/images/skins/elvui.tga and b/images/skins/elvui.tga differ diff --git a/locales/Details-enUS.lua b/locales/Details-enUS.lua index 46cd9ccb..ae022f05 100644 --- a/locales/Details-enUS.lua +++ b/locales/Details-enUS.lua @@ -3,7 +3,8 @@ if not Loc then return end -------------------------------------------------------------------------------------------------------------------------------------------- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.12.0|r\n\n|cFFFFFF00-|r Added support to Profiles, now you can share the same config between two or more characters.\n\n|cFFFFFF00-|r - Options window now can be opened while in combat without triggering 'script ran too long' error.\n\n|cFFFFFF00-|r Added support for BattleTag friends over report window.\n\n|cFFFFFF00-|r Added pet threat to Tiny Threat plugin when out of a party or raid group.\n\n|cFFFFFF00-|r Fixed a issue with close button where it disappear without close the window when toolbar is in bottom side.\n\n|cFFFFFF00-|r Also fixed a issue where swapping toolbar positioning was sometimes making close button disappear.\n\n|cFFFFFF00-|r Fixed a problem opening options panel through minimap when there is no window opened.\n\n|cFFFFFF00v1.11.10|r\n\n|cFFFFFF00-|r Accuracy with warcraftlogs.com now is very high and okey with worldoflogs.com. Make sure the option |cFFFFDD00Time Measure|r under General Settings -> Combat is set to |cFFFFDD00Effective Time|r.\n\n|cFFFFFF00-|r Options Window has been revamped, again.\n\n|cFFFFFF00-|r Added a option for change the class icons.\n\n|cFFFFFF00-|r Added options for show Total Bar and configure it.\n\n|cFFFFFF00-|r Added a option for save a Standard Skin, new windows opened use this skin.\n\n|cFFFFFF00-|r Added a new skin: ElvUI Frame Style.\n\n|cFFFFFF00-|r When hover a spell icon under Player Details Window, the spell description is shown.\n\n|cFFFFFF00-|r Pressing Shift key on a spell bar over the Encounter Details Window, shows up the spell description.\n\n|cFFFFFF00v1.11.6|r\n\n|cFFFFFF00-|r Added new skin: Minimalistic, a very clean one.\n\n|cFFFFFF00-|r Added a new tab called avoidance on Player Details window for tanks.\n\n|cFFFFFF00-|r Added Copy & Paste option on report window. Now you can share your dps on twitter and facebook!\n\n|cFFFFFF00-|r Added a new option for auto switch what a window shows when you enter in a combat.\n\n|cFFFFFF00-|r Fixed issue with window background alpha which was changing the value everytime the options window is opened.\n\n|cFFFFFF00-|r Fixed the gap between the bar and the window background when disabling borders.\n\n|cFFFFFF00-|r Make some improvements on Tiny Threat plugin.\n\n|cFFFFFF00v1.11.3|r\n\n|cFFFFFF00-|r Fixed more known issues with skins.\n\n|cFFFFFF00-|r Fixed an issue where plugin icons wasn't hiding after close all windows.\n\n|cFFFFFF00v1.11.2|r\n\n|cFFFFFF00-|r Fixed bugs where Details! stop working if no plugin is actived on Wow addon panel.\n\n|cFFFFFF00v1.11.0|r\n\n|cFFFFFF00-|r Added an option for abbreviate Dps and Hps.\n\n|cFFFFFF00-|r Fixed issue where the window icon fade away when reopening the window.\n\n|cFFFFFF00-|r Improvements in class recognition.\n\n|cFFFFFF00-|r Added follow spells as defensive cooldowns:\nHealing Tide Totem, Spirit Link Totem, Demoralizing Banner, Mass Spell Reflection and Shield Block.\n\n|cFFFFFF00-|r More improvements done in Encounter Details plugin.\n\n|cFFFFFF00-|r Improvements made in the downloadable plugins: Timeline and Advanced Death Logs.\n\n|cFFFFFF00v1.10.0|r\n\n|cFFFFFF00-|r Fixed a issue with overall data Dps when have only one segment.\n\n|cFFFFFF00-|r Changed colors and added some backgrounds for menus.\n\n|cFFFFFF00-|r Options panel has his height size increased.\n\n|cFFFFFF00-|r Added options for hide the window or change the transparency when in combat.\n\n|cFFFFFF00-|r Added a control panel for plugins, where you can enable or disable then.\n\n|cFFFFFF00v1.9.5|r\n\n|cFFFFFF00-|r More fixes on Skins support and new tools for plugins.|r\n\n|cFFFFFF00v1.9.4|r\n\n|cFFFFFF00-|r Minor bug fixes and improvements on Welcome Screen." + + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.12.3|r\n\n|cFFFFFF00-|r - Fixed "Healing Per Second" which wasn't working at all.\n\n|cFFFFFF00-|r - Fixed the percent amount for target of damage done where sometimes it pass 100%.\n\n|cFFFFFF00-|r - Changes on Skins: "Minimalistic" and "Elm UI Frame Style". It's necessary re-apply.\n\n|cFFFFFF00-|r - Added more cooldowns and spells for Monk tank over avoidance panel.\n\n|cFFFFFF00-|r - Player avatar now is also shown on the Player Details window.\n\n|cFFFFFF00-|r - Leaving empty the the icon file box, make details use no icons on bars.\n\n|cFFFFFF00-|r - Added new feature: Auto Transparency, hide or show menus, statusbar and borders when mouse enter or leaves the window.\n\n|cFFFFFF00-|r - Added new feature: Attribute Text, shows on the toolbar or statusbar the current attribute shown.\n\n|cFFFFFF00-|r - Added new fueature: Auto Hide Menu, which hide or show the menus when mouse enter or leaves the window.\n\n|cFFFFFF00-|r - Image Editor now can Flip the image without messing with the crop.\n\n|cFFFFFF00v1.12.0|r\n\n|cFFFFFF00-|r Added support to Profiles, now you can share the same config between two or more characters.\n\n|cFFFFFF00-|r - Options window now can be opened while in combat without triggering 'script ran too long' error.\n\n|cFFFFFF00-|r Added support for BattleTag friends over report window.\n\n|cFFFFFF00-|r Added pet threat to Tiny Threat plugin when out of a party or raid group.\n\n|cFFFFFF00-|r Fixed a issue with close button where it disappear without close the window when toolbar is in bottom side.\n\n|cFFFFFF00-|r Also fixed a issue where swapping toolbar positioning was sometimes making close button disappear.\n\n|cFFFFFF00-|r Fixed a problem opening options panel through minimap when there is no window opened.\n\n|cFFFFFF00v1.11.10|r\n\n|cFFFFFF00-|r Accuracy with warcraftlogs.com now is very high and okey with worldoflogs.com. Make sure the option |cFFFFDD00Time Measure|r under General Settings -> Combat is set to |cFFFFDD00Effective Time|r.\n\n|cFFFFFF00-|r Options Window has been revamped, again.\n\n|cFFFFFF00-|r Added a option for change the class icons.\n\n|cFFFFFF00-|r Added options for show Total Bar and configure it.\n\n|cFFFFFF00-|r Added a option for save a Standard Skin, new windows opened use this skin.\n\n|cFFFFFF00-|r Added a new skin: ElvUI Frame Style.\n\n|cFFFFFF00-|r When hover a spell icon under Player Details Window, the spell description is shown.\n\n|cFFFFFF00-|r Pressing Shift key on a spell bar over the Encounter Details Window, shows up the spell description.\n\n|cFFFFFF00v1.11.6|r\n\n|cFFFFFF00-|r Added new skin: Minimalistic, a very clean one.\n\n|cFFFFFF00-|r Added a new tab called avoidance on Player Details window for tanks.\n\n|cFFFFFF00-|r Added Copy & Paste option on report window. Now you can share your dps on twitter and facebook!\n\n|cFFFFFF00-|r Added a new option for auto switch what a window shows when you enter in a combat.\n\n|cFFFFFF00-|r Fixed issue with window background alpha which was changing the value everytime the options window is opened.\n\n|cFFFFFF00-|r Fixed the gap between the bar and the window background when disabling borders.\n\n|cFFFFFF00-|r Make some improvements on Tiny Threat plugin.\n\n|cFFFFFF00v1.11.3|r\n\n|cFFFFFF00-|r Fixed more known issues with skins.\n\n|cFFFFFF00-|r Fixed an issue where plugin icons wasn't hiding after close all windows.\n\n|cFFFFFF00v1.11.2|r\n\n|cFFFFFF00-|r Fixed bugs where Details! stop working if no plugin is actived on Wow addon panel.\n\n|cFFFFFF00v1.11.0|r\n\n|cFFFFFF00-|r Added an option for abbreviate Dps and Hps.\n\n|cFFFFFF00-|r Fixed issue where the window icon fade away when reopening the window.\n\n|cFFFFFF00-|r Improvements in class recognition.\n\n|cFFFFFF00-|r Added follow spells as defensive cooldowns:\nHealing Tide Totem, Spirit Link Totem, Demoralizing Banner, Mass Spell Reflection and Shield Block.\n\n|cFFFFFF00-|r More improvements done in Encounter Details plugin.\n\n|cFFFFFF00-|r Improvements made in the downloadable plugins: Timeline and Advanced Death Logs." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails:|r " --> color and details name @@ -27,6 +28,8 @@ if not Loc then return end Loc ["STRING_MINIMAPMENU_UNLOCK"] = "Unlock" Loc ["STRING_MINIMAPMENU_LOCK"] = "Lock" + Loc ["STRING_WINDOW_MENU_UNLOCKED"] = "Left menu unlocked, set Menu Pos X > 20 over options panel to lock again." + Loc ["STRING_RESETBUTTON_WRONG_INSTANCE"] = "Warning, reset button isn't in the current editing instance." Loc ["STRING_INTERFACE_OPENOPTIONS"] = "Open Options Panel" @@ -505,7 +508,10 @@ if not Loc then return end 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_BAR_ICONFILE"] = "Icon File" - Loc ["STRING_OPTIONS_BAR_ICONFILE_DESC"] = "This option load a image responsable for the class icons in each row.\nThe image file need to be a .tga file with alpha channel.\n\nDetails! have three image icon files:\n\n- |cFFFFFF00classes|r\n- |cFFFFFF00classes_small|r\n- |cFFFFFF00classes_small_alpha|r\n\nAlso there is files inside wow which can be used:\n\n- |cFFFFFF00Interface\\ARENAENEMYFRAME\\UI-CLASSES-CIRCLES|r\n- |cFFFFFF00Interface\\Glues\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES|r" + Loc ["STRING_OPTIONS_BAR_ICONFILE_DESC"] = "This option load a image responsable for the class icons in each row.\nThe image file need to be a .tga file with alpha channel.\n\nDetails! have three image icon files:\n\n- |cFFFFFF00classes|r\n- |cFFFFFF00classes_small|r\n- |cFFFFFF00classes_small_alpha|r\n\nAlso there is files inside wow which can be used:\n\n- |cFFFFFF00Interface\\ARENAENEMYFRAME\\UI-CLASSES-CIRCLES|r\n- |cFFFFFF00Interface\\Glues\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES|r\n\nLeave the field empty to hide all icons." + + Loc ["STRING_OPTIONS_BARSTART"] = "Bar Start After Icon" + Loc ["STRING_OPTIONS_BARSTART_DESC"] = "Control if the bar starts on the right side of the icon or on the left side.\n\nThis is useful when using icons with some transparency." -- Loc ["STRING_OPTIONS_TEXT"] = "Bar Text Settings" Loc ["STRING_OPTIONS_TEXT_DESC"] = "This options control the appearance of the instance bar texts." @@ -529,8 +535,8 @@ if not Loc then return end 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_FIXEDCOLOR"] = "Text Color" - Loc ["STRING_OPTIONS_TEXT_ROWCOLOR"] = "Row Background Color" - Loc ["STRING_OPTIONS_TEXT_ROWCOLOR2"] = "Row Color" + Loc ["STRING_OPTIONS_TEXT_ROWCOLOR"] = "Alpha and Color When Not By Class" + Loc ["STRING_OPTIONS_TEXT_ROWCOLOR2"] = "Color When Not By Class" -- Loc ["STRING_OPTIONS_INSTANCE"] = "Instance Settings" Loc ["STRING_OPTIONS_INSTANCE_DESC"] = "This options control the appearance of the instance it self." @@ -538,6 +544,9 @@ if not Loc then return end Loc ["STRING_OPTIONS_INSTANCE_COLOR"] = "Window Color" Loc ["STRING_OPTIONS_INSTANCE_COLOR_DESC"] = "Change the color and alpha of instance window." + Loc ["STRING_OPTIONS_INSTANCE_BACKDROP"] = "Background Texture" + Loc ["STRING_OPTIONS_INSTANCE_BACKDROP_DESC"] = "Select the background texture used by this window." + 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" @@ -566,9 +575,9 @@ if not Loc then return end 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"] = "Left Menu Settings" Loc ["STRING_OPTIONS_TOOLBAR_SETTINGS_DESC"] = "This options change the main menu on the top of the window." -Loc ["STRING_OPTIONS_TOOLBAR2_SETTINGS"] = "Toolbar Button Settings" +Loc ["STRING_OPTIONS_TOOLBAR2_SETTINGS"] = "Right Menu Settings" Loc ["STRING_OPTIONS_TOOLBAR2_SETTINGS_DESC"] = "This options change the reset, instance and close buttons from the toolbar menu on the top of the window." Loc ["STRING_OPTIONS_DESATURATE_MENU"] = "Desaturate Menu" @@ -578,11 +587,52 @@ 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_X_DESC"] = "Move the left menu position, the first slider changes the horizontal axis, the second changes the vertical axis.\n\nIf menu anchor is set to right side, use -67 if this instance isn't hosting the reset button." 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_MENU_ANCHOR"] = "Menu Anchor Side" +Loc ["STRING_OPTIONS_MENU_ANCHOR_DESC"] = "Change if the left menu is attached within left side of window or in the right side." + +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ANCHOR"] = "Attribute Text" +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ENABLED"] = "Enabled" +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ENABLED_DESC"] = "Enable or disable the attribute name which is current shown on this instance." +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ANCHORX"] = "Pos X" +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ANCHORY"] = "Pos Y" +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ANCHORX_DESC"] = "Adjust the attribute text location on the X axis." +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ANCHORY_DESC"] = "Adjust the attribute text location on the Y axis." +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_FONT"] = "Text Font" +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_FONT_DESC"] = "Select the text font for attribute text." +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_TEXTSIZE"] = "Text Size" +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_TEXTSIZE_DESC"] = "Adjust the size of attribute text." +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_TEXTCOLOR"] = "Text Color" +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_TEXTCOLOR_DESC"] = "Change the attribute text color." +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_SIDE"] = "Text Anchor" +Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_SIDE_DESC"] = "Choose where the text is anchored." + +Loc ["STRING_OPTIONS_MENU_AUTOHIDE_ANCHOR"] = "Auto Hide Menu Buttons" +Loc ["STRING_OPTIONS_MENU_AUTOHIDE_LEFT"] = "Left Menu" +Loc ["STRING_OPTIONS_MENU_AUTOHIDE_RIGHT"] = "Right Menu" +Loc ["STRING_OPTIONS_MENU_AUTOHIDE_DESC"] = "When enabled the chosen menu automatically hides itself when the mouse leaves the Details! window and shows up when you are interacting with it again." + +Loc ["STRING_OPTIONS_INSTANCE_STATUSBAR_ANCHOR"] = "Statusbar" +Loc ["STRING_OPTIONS_INSTANCE_STATUSBARCOLOR"] = "Color and Transparency" +Loc ["STRING_OPTIONS_INSTANCE_STATUSBARCOLOR_DESC"] = "This option overwrite the default statusbar color and transparency." + +Loc ["STRING_OPTIONS_MENU_ALPHA"] = "Auto Transparency:" +Loc ["STRING_OPTIONS_MENU_ALPHAENABLED"] = "Enabled" +Loc ["STRING_OPTIONS_MENU_ALPHAENTER"] = "When Interacting" +Loc ["STRING_OPTIONS_MENU_ALPHALEAVE"] = "Stand by" +Loc ["STRING_OPTIONS_MENU_ALPHAICONSTOO"] = "Affect Buttons" + +Loc ["STRING_OPTIONS_MENU_ALPHAENABLED_DESC"] = "Enable or disable the auto transparency. When enabled, the alpha changes automatically when you hover and leave the window.\n\nThis settings overwrite the alpha selected over window settings." +Loc ["STRING_OPTIONS_MENU_ALPHAENTER_DESC"] = "When you have the mouse over the window, the transparency changes to this value." +Loc ["STRING_OPTIONS_MENU_ALPHALEAVE_DESC"] = "When you don't have the mouse over the window, the transparency changes to this value." +Loc ["STRING_OPTIONS_MENU_ALPHAICONSTOO_DESC"] = "If enabled, all icons, buttons, also have their alpha affected by this feature." + +Loc ["STRING_OPTIONS_MENU_ALPHAWARNING"] = "Auto Transparency is enabled, alpha may not be affected." + Loc ["STRING_OPTIONS_INSTANCE_BUTTON_ANCHOR"] = "Instance Button:" Loc ["STRING_OPTIONS_RESET_BUTTON_ANCHOR"] = "Reset Button:" Loc ["STRING_OPTIONS_CLOSE_BUTTON_ANCHOR"] = "Close Button:" diff --git a/locales/Details-ptBR.lua b/locales/Details-ptBR.lua index d6db72a7..d0854322 100644 --- a/locales/Details-ptBR.lua +++ b/locales/Details-ptBR.lua @@ -3,7 +3,7 @@ if not Loc then return end -------------------------------------------------------------------------------------------------------------------------------------------- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.12.0|r\n\n|cFFFFFF00-|r Added support to Profiles, now you can share the same config between two or more characters.\n\n|cFFFFFF00-|r - Options window now can be opened while in combat without triggering 'script ran too long' error.\n\n|cFFFFFF00-|r Added support for BattleTag friends over report window.\n\n|cFFFFFF00-|r Added pet threat to Tiny Threat plugin when out of a party or raid group.\n\n|cFFFFFF00-|r Fixed a issue with close button where it disappear without close the window when toolbar is in bottom side.\n\n|cFFFFFF00-|r Also fixed a issue where swapping toolbar positioning was sometimes making close button disappear.\n\n|cFFFFFF00-|r Fixed a problem opening options panel through minimap when there is no window opened.\n\n|cFFFFFF00v1.11.10|r\n\n|cFFFFFF00-|r Accuracy with warcraftlogs.com now is very high and okey with worldoflogs.com. Make sure the option |cFFFFDD00Time Measure|r under General Settings -> Combat is set to |cFFFFDD00Effective Time|r.\n\n|cFFFFFF00-|r Options Window has been revamped, again.\n\n|cFFFFFF00-|r Added a option for change the class icons.\n\n|cFFFFFF00-|r Added options for show Total Bar and configure it.\n\n|cFFFFFF00-|r Added a option for save a Standard Skin, new windows opened use this skin.\n\n|cFFFFFF00-|r Added a new skin: ElvUI Frame Style.\n\n|cFFFFFF00-|r When hover a spell icon under Player Details Window, the spell description is shown.\n\n|cFFFFFF00-|r Pressing Shift key on a spell bar over the Encounter Details Window, shows up the spell description.\n\n|cFFFFFF00v1.11.6|r\n\n|cFFFFFF00-|r Adicionado nova skin: Minimalistic.\n\n|cFFFFFF00-|r Adicionado nova aba chamada avoidance no painel de detalhes do jogador apenas para tanques.\n\n|cFFFFFF00-|r Adicionado opcao de Copiar e Coloar na janela de criar relatorios. Agora voce pode dizer seu dps aos seus amigos no twitter e facebook!\n\n|cFFFFFF00-|r Adicionada nova opcao de troca o que uma janela esta mostrando quando voce entrar em combate.\n\n|cFFFFFF00-|r Corrigido problema com a transparencia da janela onde ela mudava sozinha sempre que a janela de opcoes eta aberta.\n\n|cFFFFFF00-|r Corrigido o vao em branco que ficava entre o inicio de uma barra e o fundo da janela quando as bordas eram desligadas.\n\n|cFFFFFF00-|r Feito algumas melhorias no plugin Tiny Threat.\n\n|cFFFFFF00v1.11.3|r\n\n|cFFFFFF00-|r Corrigido mais problemas conhecidos com as Skins.\n\n|cFFFFFF00-|r Corrigido problema onde os icones dos plugins nao eram escondidos apos fechar todas as janelas.\n\n|cFFFFFF00v1.11.2|r\n\n|cFFFFFF00-|r Corrigido problemas onde o Details! parava de funcionar se nenhum plugin estiver ligado no painel de addons do Wow.|cFFFFFF00v1.11.0|r\n\n|cFFFFFF00-|r Adicionado opcao para abreviar o Dps e o Hps.\n\n|cFFFFFF00-|r Corrigido um problema onde o icone da janela desaparecia ao reabri-la.\n\n|cFFFFFF00-|r Melhorias no reconhecimento das classes.\n\n|cFFFFFF00-|r As seguintes magias foram adicionadas como cooldowns: Healing Tide Totem, Spirit Link Totem, Demoralizing Banner, Mass Spell Reflection and Shield Block.\n\n|cFFFFFF00-|r Mais melhorias feitas no plugin Encounter Details.\n\n|cFFFFFF00-|r Melhorias feitas nos plugins disponiveis para download: Timeline e Advanced Death Logs.\n\n|cFFFFFF00v1.10.0|r\n\n|cFFFFFF00-|r Corrigido um problema no Dps no segmento total quando existia apenas 1 segmento.\n\n|cFFFFFF00-|r Cores e imagem de fundo dos menus foram alterados.\n\n|cFFFFFF00-|r A altura do painel de opcoes foi aumentada.\n\n|cFFFFFF00-|r Adicionada opcao para esconder ou alterar a transparencia da janela quando estiver em combate.\n\n|cFFFFFF00-|r Adicionado um painel de controle de plugins para ativar ou desativa-los.\n\n|cFFFFFF00v1.9.5|r\n\n|cFFFFFF00-|rMais correcoes para as Skins e suporte a novos plugins.|r\n\n|cFFFFFF00v1.9.4|r\n\n|cFFFFFF00-|r Pequenas correcoes e melhorias na tela de boas vindas.\n\n|cFFFFFF00v1.9.3|r\n\n|cFFFFFF00-|r A barra agora comeca apos o icone e nao mais na borda esquerda da janela.\n\n|cFFFFFF00-|r Janela de boas vindas agora esta traduzida para outros idiomas.\n\n|cFFFFFF00-|r Corrigido o problema que estava afetando o plugin de Rank de Dano.\n\n|cFFFFFF00v1.9.1|r\n\n|cFFFFFF00-|r corrigido problema do icone na janela principal quando nao havia nenhum plugin instalado. \n\n|cFFFFFF00-|r corrigido problema com alguns botoes no painel de opcoes onde o texto estava fora do lugar.\n\n|cFFFFFF00-|r corrigido a posicao dos sub menus quando proximos a borda direita do monitor.\n\n|cFFFFFF00-|r corrigida a posicao do botao de fechar do skin padrao.\n\n|cFFFFFF00-|r corrigido um erro nas skins ao selecionar um plugin de raide ou solo.|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." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.12.3|r\n\n|cFFFFFF00-|r - Fixed "Healing Per Second" which wasn't working at all.\n\n|cFFFFFF00-|r - Fixed the percent amount for target of damage done where sometimes it pass 100%.\n\n|cFFFFFF00-|r - Changes on Skins: "Minimalistic" and "Elm UI Frame Style". It's necessary re-apply.\n\n|cFFFFFF00-|r - Added more cooldowns and spells for Monk tank over avoidance panel.\n\n|cFFFFFF00-|r - Player avatar now is also shown on the Player Details window.\n\n|cFFFFFF00-|r - Leaving empty the the icon file box, make details use no icons on bars.\n\n|cFFFFFF00-|r - Added new feature: Auto Transparency, hide or show menus, statusbar and borders when mouse enter or leaves the window.\n\n|cFFFFFF00-|r - Added new feature: Attribute Text, shows on the toolbar or statusbar the current attribute shown.\n\n|cFFFFFF00-|r - Added new fueature: Auto Hide Menu, which hide or show the menus when mouse enter or leaves the window.\n\n|cFFFFFF00-|r - Image Editor now can Flip the image without messing with the crop.\n\n|cFFFFFF00v1.12.0|r\n\n|cFFFFFF00-|r Added support to Profiles, now you can share the same config between two or more characters.\n\n|cFFFFFF00-|r - Options window now can be opened while in combat without triggering 'script ran too long' error.\n\n|cFFFFFF00-|r Added support for BattleTag friends over report window.\n\n|cFFFFFF00-|r Added pet threat to Tiny Threat plugin when out of a party or raid group.\n\n|cFFFFFF00-|r Fixed a issue with close button where it disappear without close the window when toolbar is in bottom side.\n\n|cFFFFFF00-|r Also fixed a issue where swapping toolbar positioning was sometimes making close button disappear.\n\n|cFFFFFF00-|r Fixed a problem opening options panel through minimap when there is no window opened.\n\n|cFFFFFF00v1.11.10|r\n\n|cFFFFFF00-|r Accuracy with warcraftlogs.com now is very high and okey with worldoflogs.com. Make sure the option |cFFFFDD00Time Measure|r under General Settings -> Combat is set to |cFFFFDD00Effective Time|r.\n\n|cFFFFFF00-|r Options Window has been revamped, again.\n\n|cFFFFFF00-|r Added a option for change the class icons.\n\n|cFFFFFF00-|r Added options for show Total Bar and configure it.\n\n|cFFFFFF00-|r Added a option for save a Standard Skin, new windows opened use this skin.\n\n|cFFFFFF00-|r Added a new skin: ElvUI Frame Style.\n\n|cFFFFFF00-|r When hover a spell icon under Player Details Window, the spell description is shown.\n\n|cFFFFFF00-|r Pressing Shift key on a spell bar over the Encounter Details Window, shows up the spell description.\n\n|cFFFFFF00v1.11.6|r\n\n|cFFFFFF00-|r Adicionado nova skin: Minimalistic.\n\n|cFFFFFF00-|r Adicionado nova aba chamada avoidance no painel de detalhes do jogador apenas para tanques.\n\n|cFFFFFF00-|r Adicionado opcao de Copiar e Coloar na janela de criar relatorios. Agora voce pode dizer seu dps aos seus amigos no twitter e facebook!\n\n|cFFFFFF00-|r Adicionada nova opcao de troca o que uma janela esta mostrando quando voce entrar em combate.\n\n|cFFFFFF00-|r Corrigido problema com a transparencia da janela onde ela mudava sozinha sempre que a janela de opcoes eta aberta.\n\n|cFFFFFF00-|r Corrigido o vao em branco que ficava entre o inicio de uma barra e o fundo da janela quando as bordas eram desligadas.\n\n|cFFFFFF00-|r Feito algumas melhorias no plugin Tiny Threat.\n\n|cFFFFFF00v1.11.3|r\n\n|cFFFFFF00-|r Corrigido mais problemas conhecidos com as Skins.\n\n|cFFFFFF00-|r Corrigido problema onde os icones dos plugins nao eram escondidos apos fechar todas as janelas.\n\n|cFFFFFF00v1.11.2|r\n\n|cFFFFFF00-|r Corrigido problemas onde o Details! parava de funcionar se nenhum plugin estiver ligado no painel de addons do Wow.|cFFFFFF00v1.11.0|r\n\n|cFFFFFF00-|r Adicionado opcao para abreviar o Dps e o Hps.\n\n|cFFFFFF00-|r Corrigido um problema onde o icone da janela desaparecia ao reabri-la.\n\n|cFFFFFF00-|r Melhorias no reconhecimento das classes.\n\n|cFFFFFF00-|r As seguintes magias foram adicionadas como cooldowns: Healing Tide Totem, Spirit Link Totem, Demoralizing Banner, Mass Spell Reflection and Shield Block.\n\n|cFFFFFF00-|r Mais melhorias feitas no plugin Encounter Details.\n\n|cFFFFFF00-|r Melhorias feitas nos plugins disponiveis para download: Timeline e Advanced Death Logs.\n\n|cFFFFFF00v1.10.0|r\n\n|cFFFFFF00-|r Corrigido um problema no Dps no segmento total quando existia apenas 1 segmento.\n\n|cFFFFFF00-|r Cores e imagem de fundo dos menus foram alterados.\n\n|cFFFFFF00-|r A altura do painel de opcoes foi aumentada.\n\n|cFFFFFF00-|r Adicionada opcao para esconder ou alterar a transparencia da janela quando estiver em combate.\n\n|cFFFFFF00-|r Adicionado um painel de controle de plugins para ativar ou desativa-los.\n\n|cFFFFFF00v1.9.5|r\n\n|cFFFFFF00-|rMais correcoes para as Skins e suporte a novos plugins.|r\n\n|cFFFFFF00v1.9.4|r\n\n|cFFFFFF00-|r Pequenas correcoes e melhorias na tela de boas vindas.\n\n|cFFFFFF00v1.9.3|r\n\n|cFFFFFF00-|r A barra agora comeca apos o icone e nao mais na borda esquerda da janela.\n\n|cFFFFFF00-|r Janela de boas vindas agora esta traduzida para outros idiomas.\n\n|cFFFFFF00-|r Corrigido o problema que estava afetando o plugin de Rank de Dano.\n\n|cFFFFFF00v1.9.1|r\n\n|cFFFFFF00-|r corrigido problema do icone na janela principal quando nao havia nenhum plugin instalado. \n\n|cFFFFFF00-|r corrigido problema com alguns botoes no painel de opcoes onde o texto estava fora do lugar.\n\n|cFFFFFF00-|r corrigido a posicao dos sub menus quando proximos a borda direita do monitor.\n\n|cFFFFFF00-|r corrigida a posicao do botao de fechar do skin padrao.\n\n|cFFFFFF00-|r corrigido um erro nas skins ao selecionar um plugin de raide ou solo.|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." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetalhes:|r " --> color and details name diff --git a/startup.lua b/startup.lua index 29a4cff4..b5e25115 100644 --- a/startup.lua +++ b/startup.lua @@ -118,10 +118,12 @@ function _G._detalhes:Start() end _detalhes.ToolBar:ReorganizeIcons() - + self.RefreshAfterStartup = nil end self:ScheduleTimer ("RefreshAfterStartup", 4) + + --> start garbage collector self.ultima_coleta = 0 @@ -165,6 +167,24 @@ function _G._detalhes:Start() -- self.listener:RegisterEvent ("UNIT_SPELLCAST_INTERRUPTED") ---------------------------------------------------------------------------------------------------------------------------------------- + local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0") + + function _detalhes:CooltipPreset (preset) + + local GameCooltip = GameCooltip + + GameCooltip:Reset() + + if (preset == 1) then + GameCooltip:SetOption ("TextFont", "Friz Quadrata TT") + GameCooltip:SetOption ("TextColor", "orange") + GameCooltip:SetOption ("TextSize", 12) + GameCooltip:SetOption ("ButtonsYMod", -4) + GameCooltip:SetOption ("YSpacingMod", -4) + GameCooltip:SetOption ("IgnoreButtonAutoHeight", true) + GameCooltip:SetColor (1, 0.5, 0.5, 0.5, 0.5) + end + end --> done self.initializing = nil @@ -220,6 +240,8 @@ function _G._detalhes:Start() end --]] + --_detalhes:OpenWelcomeWindow() --for debug + if (self.is_first_run) then _detalhes:OpenWelcomeWindow() @@ -257,7 +279,7 @@ function _G._detalhes:Start() end --> feedback trhead - if (self.tutorial.logons > 100 and false) then -- and self.tutorial.logons < 104 + if (self.tutorial.logons > 100) then -- and self.tutorial.logons < 104 --desligado por preocaução @@ -488,155 +510,6 @@ function _G._detalhes:Start() 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 ("---------------") - --]] - - - -- bubble test - local f = CreateFrame ("frame", "DetailsBubble", UIParent) - f:SetPoint ("center", UIParent, "center") - f:SetSize (100, 100) - f:SetFrameStrata ("TOOLTIP") - f.isHorizontalFlipped = false - f.isVerticalFlipped = false - - local t = f:CreateTexture (nil, "artwork") - t:SetTexture ([[Interface\AddOns\Details\images\icons]]) - t:SetSize (131 * 1.2, 81 * 1.2) - --377 328 508 409 0.0009765625 - t:SetTexCoord (0.7373046875, 0.9912109375, 0.6416015625, 0.7978515625) - t:SetPoint ("center", f, "center") - - local line1 = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - line1:SetPoint ("topleft", t, "topleft", 24, -10) - _detalhes:SetFontSize (line1, 9) - line1:SetTextColor (.9, .9, .9, 1) - line1:SetSize (110, 12) - line1:SetJustifyV ("center") - line1:SetJustifyH ("center") - - local line2 = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - line2:SetPoint ("topleft", t, "topleft", 11, -20) - _detalhes:SetFontSize (line2, 9) - line2:SetTextColor (.9, .9, .9, 1) - line2:SetSize (140, 12) - line2:SetJustifyV ("center") - line2:SetJustifyH ("center") - - local line3 = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - line3:SetPoint ("topleft", t, "topleft", 7, -30) - _detalhes:SetFontSize (line3, 9) - line3:SetTextColor (.9, .9, .9, 1) - line3:SetSize (144, 12) - line3:SetJustifyV ("center") - line3:SetJustifyH ("center") - - local line4 = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - line4:SetPoint ("topleft", t, "topleft", 11, -40) - _detalhes:SetFontSize (line4, 9) - line4:SetTextColor (.9, .9, .9, 1) - line4:SetSize (140, 12) - line4:SetJustifyV ("center") - line4:SetJustifyH ("center") - - local line5 = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall") - line5:SetPoint ("topleft", t, "topleft", 24, -50) - _detalhes:SetFontSize (line5, 9) - line5:SetTextColor (.9, .9, .9, 1) - line5:SetSize (110, 12) - line5:SetJustifyV ("center") - line5:SetJustifyH ("center") - - f.lines = {line1, line2, line3, line4, line5} - - --t:SetPoint ("center", UIParent, "center") - - function f:FlipHorizontal() - if (not f.isHorizontalFlipped) then - if (f.isVerticalFlipped) then - t:SetTexCoord (0.9912109375, 0.7373046875, 0.7978515625, 0.6416015625) - else - t:SetTexCoord (0.9912109375, 0.7373046875, 0.6416015625, 0.7978515625) - end - f.isHorizontalFlipped = true - else - if (f.isVerticalFlipped) then - t:SetTexCoord (0.7373046875, 0.9912109375, 0.7978515625, 0.6416015625) - else - t:SetTexCoord (0.7373046875, 0.9912109375, 0.6416015625, 0.7978515625) - end - f.isHorizontalFlipped = false - end - end - - function f:FlipVertical() - - if (not f.isVerticalFlipped) then - if (f.isHorizontalFlipped) then - t:SetTexCoord (0.7373046875, 0.9912109375, 0.7978515625, 0.6416015625) - else - t:SetTexCoord (0.9912109375, 0.7373046875, 0.7978515625, 0.6416015625) - end - f.isVerticalFlipped = true - else - if (f.isHorizontalFlipped) then - t:SetTexCoord (0.7373046875, 0.9912109375, 0.6416015625, 0.7978515625) - else - t:SetTexCoord (0.9912109375, 0.7373046875, 0.6416015625, 0.7978515625) - end - f.isVerticalFlipped = false - end - end - - function f:SetBubbleText (line1, line2, line3, line4, line5) - if (not line1) then - for _, line in ipairs (f.lines) do - line:SetText ("") - end - return - end - - if (line1:find ("\n")) then - line1, line2, line3, line4, line5 = strsplit ("\n", line1) - end - - f.lines[1]:SetText (line1) - f.lines[2]:SetText (line2) - f.lines[3]:SetText (line3) - f.lines[4]:SetText (line4) - f.lines[5]:SetText (line5) - end - - function f:SetOwner (frame, myPoint, hisPoint, x, y, alpha) - f:ClearAllPoints() - f:SetBubbleText (nil) - t:SetTexCoord (0.7373046875, 0.9912109375, 0.6416015625, 0.7978515625) - f.isHorizontalFlipped = false - f.isVerticalFlipped = false - f:SetPoint (myPoint or "bottom", frame, hisPoint or "top", x or 0, y or 0) - t:SetAlpha (alpha or 1) - end - - function f:ShowBubble() - f:Show() - end - - function f:HideBubble() - f:Hide() - end - - f:SetBubbleText (nil) - - f:Hide() - - local lower = _detalhes:GetLowerInstanceNumber() if (lower) then local instance = _detalhes:GetInstance (lower) @@ -678,5 +551,23 @@ function _G._detalhes:Start() end + --[[ + local f = CreateFrame ("frame", nil, UIParent) + f:SetSize (200, 200) + f:SetPoint ("center", UIParent, "center") + local t = f:CreateTexture (nil, "overlay") + t:SetPoint ("center", f, "center") + t:SetTexture (1, 1, 1, 1) + t:SetSize (100, 100) + + f:SetAlpha (.1) + t:SetAlpha (1) + t:SetVertexColor (1, 1, 1, 1) + + local b = CreateFrame ("button", "teste", f, "OptionsButtonTemplate") + b:SetSize (75, 30) + b:SetPoint ("left", f, "left") + b:SetAlpha (1) + --]] end