- Fixed title bar icon for all skins (almost all skins has it disabled by default).

- Fixed the window ungroup button (above the resize one).
This commit is contained in:
Tercio
2015-01-31 19:02:47 -02:00
parent 3f5bbcad54
commit a5ede3a633
13 changed files with 114 additions and 47 deletions
+6 -4
View File
File diff suppressed because one or more lines are too long
+8
View File
@@ -2392,6 +2392,14 @@ function _detalhes:ChangeIcon (icon)
--print (debugstack())
if (not self.hide_icon) then
if (skin.icon_on_top) then
self.baseframe.cabecalho.atributo_icon:SetParent (self.floatingframe)
else
self.baseframe.cabecalho.atributo_icon:SetParent (self.baseframe)
end
end
if (icon) then
--> plugin chamou uma troca de icone
+4 -1
View File
@@ -455,11 +455,14 @@
local novo_x = self.posicao[self.mostrando].x*_UIscale/_scale
local novo_y = self.posicao[self.mostrando].y*_UIscale/_scale
if (pre_defined) then --> overwrite
if (pre_defined and pre_defined.x) then --> overwrite
novo_x = pre_defined.x*_UIscale/_scale
novo_y = pre_defined.y*_UIscale/_scale
self.posicao[self.mostrando].w = pre_defined.largura
self.posicao[self.mostrando].h = pre_defined.altura
elseif (pre_defined and not pre_defined.x) then
_detalhes:Msg ("invalid pre_defined table for resize, please rezise the window manually.")
end
self.baseframe:SetWidth (self.posicao[self.mostrando].w)
+6 -1
View File
@@ -223,7 +223,12 @@ function gump:BuildMenu (parent, menu, x_offset, y_offset, height)
end
cur_y = cur_y - 20
if (widget_table.spacement) then
cur_y = cur_y - 30
else
cur_y = cur_y - 20
end
if (cur_y > height) then
cur_y = y_offset
cur_x = max_x
+50 -20
View File
@@ -249,6 +249,30 @@ local _
}
})
local Minimalistic_Shadow = function()
local instance = _G.DetailsOptionsWindow and _G.DetailsOptionsWindow.instance
if (instance) then
instance:ToolbarMenuSetButtonsOptions (nil, true)
instance:AttributeMenu (nil, nil, nil, nil, nil, nil, nil, true)
instance:AttributeMenu (nil, nil, 3)
if (_detalhes.options_group_edit) then
for _, this_instance in ipairs (instance:GetInstanceGroup()) do
if (this_instance ~= instance) then
this_instance:ToolbarMenuSetButtonsOptions (nil, true)
this_instance:AttributeMenu (nil, nil, nil, nil, nil, nil, nil, true)
this_instance:AttributeMenu (nil, nil, 3)
end
end
end
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
end
_detalhes:InstallSkin ("Minimalistic", {
file = [[Interface\AddOns\Details\images\skins\classic_skin_v1]],
author = "Details!",
@@ -272,6 +296,9 @@ local _
left_corner_anchor_bottom = {-107, 0},
right_corner_anchor_bottom = {96, 0},
icon_on_top = true,
icon_ignore_alpha = true,
--overwrites
instance_cprops = {
["menu_icons_size"] = 0.850000023841858,
@@ -445,7 +472,7 @@ local _
["texture"] = "Details BarBorder 2",
},
},
["bg_b"] = 0.0941176470588235,
["bg_b"] = 0.0941176470588235,
},
callback = function (skin, instance, just_updating)
@@ -453,6 +480,7 @@ local _
end,
skin_options = {
{spacement = true, type = "button", name = "Shadowy Title Bar", func = Minimalistic_Shadow, desc = "Adds shadow on title bar components."},
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_RESET_TOOLTIP"], func = reset_tooltip, desc = Loc ["STRING_OPTIONS_SKIN_RESET_TOOLTIP_DESC"]},
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3"], func = set_tooltip_elvui2, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3_DESC"]},
}
@@ -482,6 +510,9 @@ local _
left_corner_anchor_bottom = {-107, 0},
right_corner_anchor_bottom = {96, 0},
icon_on_top = true,
icon_ignore_alpha = true,
--overwrites
instance_cprops = {
["color"] = {
@@ -669,25 +700,12 @@ local _
})
local dark_serenity = function()
local instance = _G.DetailsOptionsWindow.instance
if (instance) then
--> black color
instance:InstanceColor (0, 0, 0, 1)
--> flip wallpaper
local wtexc = instance.wallpaper.texcoord
wtexc[1], wtexc[2], wtexc[3], wtexc[4] = 0.04800000, 0.29800001, 0.75599998, 0.63099998
--> reload skin
instance:ChangeSkin()
end
end
_detalhes:InstallSkin ("Serenity", {
file = [[Interface\AddOns\Details\images\skins\flat_skin]],
author = "Details!",
version = "1.0",
site = "unknown",
desc = "White with a gradient wallpaper, this skin fits on almost all interfaces.\n\nFor ElvUI interfaces, change the window color to black to get an compatible visual.",
desc = "Light blue, this skin fits on almost all interfaces.\n\nFor ElvUI interfaces, change the window color to black to get an compatible visual.",
micro_frames = {color = {1, 1, 1, 1}, font = "Friz Quadrata TT", size = 10, left = "DETAILS_STATUSBAR_PLUGIN_PATTRIBUTE"},
@@ -705,6 +723,9 @@ local _
icon_point_anchor_bottom = {-37, 12},
left_corner_anchor_bottom = {-107, 0},
right_corner_anchor_bottom = {96, 0},
icon_on_top = true,
icon_ignore_alpha = true,
instance_cprops = {
["show_statusbar"] = false,
@@ -888,7 +909,6 @@ local _
skin_options = {
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_RESET_TOOLTIP"], func = reset_tooltip, desc = Loc ["STRING_OPTIONS_SKIN_RESET_TOOLTIP_DESC"]},
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3"], func = set_tooltip_elvui2, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3_DESC"]},
{type = "button", name = "Serenity Dark Side", func = dark_serenity, desc = "Flip the colors showing the dark side of Serenity."},
}
})
@@ -913,7 +933,7 @@ local _
instance2:ChangeSkin (instance1.skin)
end
if (instance3) then
if (instance3 and instance3:IsEnabled() and instance3.baseframe) then
instance3:ShutDown()
end
@@ -1001,6 +1021,8 @@ local _
control_script_on_start = nil,
control_script = nil,
icon_ignore_alpha = true,
--instance overwrites
--[[ when a skin is selected, all customized properties of the window is reseted and then the overwrites are applied]]
--[[ for the complete cprop list see the file classe_instancia_include.lua]]
@@ -1210,7 +1232,7 @@ local _
},
skin_options = {
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1"], func = align_right_chat, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1_DESC"]},
{spacement = true, type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1"], func = align_right_chat, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1_DESC"]},
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_RESET_TOOLTIP"], func = reset_tooltip, desc = Loc ["STRING_OPTIONS_SKIN_RESET_TOOLTIP_DESC"]},
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3"], func = set_tooltip_elvui2, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3_DESC"]},
}
@@ -1380,6 +1402,10 @@ local _
--instance overwrites
--[[ when a skin is selected, all customized properties of the window is reseted and then the overwrites are applied]]
--[[ for the complete cprop list see the file classe_instancia_include.lua]]
icon_on_top = true,
icon_ignore_alpha = true,
instance_cprops = {
["menu_icons_size"] = 0.899999976158142,
["color"] = {
@@ -1573,7 +1599,7 @@ local _
},
skin_options = {
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1"], func = align_right_chat, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1_DESC"]},
{spacement = true, type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1"], func = align_right_chat, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1_DESC"]},
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON2"], func = set_tooltip_elvui1, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON2_DESC"]},
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3"], func = set_tooltip_elvui2, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3_DESC"]},
}
@@ -1617,6 +1643,10 @@ local _
--instance overwrites
--[[ when a skin is selected, all customized properties of the window is reseted and then the overwrites are applied]]
--[[ for the complete cprop list see the file classe_instancia_include.lua]]
icon_on_top = true,
icon_ignore_alpha = true,
instance_cprops = {
["show_statusbar"] = false,
["color"] = {1,1,1,1},
@@ -1741,7 +1771,7 @@ local _
},
skin_options = {
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1"], func = align_right_chat, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1_DESC"]},
{spacement = true, type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1"], func = align_right_chat, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1_DESC"]},
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON2"], func = set_tooltip_elvui1, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON2_DESC"]},
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3"], func = set_tooltip_elvui2, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3_DESC"]},
}
+36 -17
View File
@@ -377,6 +377,7 @@ local function OnEnterMainWindow (instancia, self)
--> snaps
for _, instancia_id in _pairs (instancia.snap) do
if (instancia_id) then
instancia.break_snap_button:Show()
instancia.break_snap_button:SetAlpha (1)
break
end
@@ -2793,8 +2794,13 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
anti_menu_overlap:SetFrameStrata ("DIALOG")
anti_menu_overlap:EnableMouse (true)
anti_menu_overlap:Hide()
--anti_menu_overlap:SetBackdrop (gump_fundo_backdrop)
--anti_menu_overlap:SetBackdrop (gump_fundo_backdrop) --debug
baseframe.anti_menu_overlap = anti_menu_overlap
--> floating frame is an anchor for widgets which should be overlaying the window
local floatingframe = CreateFrame ("frame", "DetailsInstance"..ID.."BorderHolder", baseframe)
floatingframe:SetFrameLevel (baseframe:GetFrameLevel()+7)
instancia.floatingframe = floatingframe
-- scroll bar -----------------------------------------------------------------------------------------------------------------------------------------------
--> create the scrollbar, almost not used.
@@ -3040,9 +3046,7 @@ 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 = floatingframe:CreateTexture (nil, "artwork")
baseframe.barra_esquerda:SetTexture (DEFAULT_SKIN)
@@ -3070,7 +3074,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
-- break snap button ----------------------------------------------------------------------------------------------------------------------------------------------------------
instancia.break_snap_button = CreateFrame ("button", "DetailsBreakSnapButton" .. ID, baseframe.cabecalho.fechar)
instancia.break_snap_button = CreateFrame ("button", "DetailsBreakSnapButton" .. ID, floatingframe)
instancia.break_snap_button:SetPoint ("bottom", baseframe.resize_direita, "top", -1, 0)
instancia.break_snap_button:SetFrameLevel (baseframe:GetFrameLevel() + 5)
instancia.break_snap_button:SetSize (13, 13)
@@ -3104,7 +3108,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
-- side bars highlights ------------------------------------------------------------------------------------------------------------------------------------------------------------
--> top
local fcima = CreateFrame ("frame", "DetailsTopSideBarHighlight" .. instancia.meu_id, baseframe.cabecalho.fechar)
local fcima = CreateFrame ("frame", "DetailsTopSideBarHighlight" .. instancia.meu_id, floatingframe)
gump:CreateFlashAnimation (fcima)
fcima:Hide()
@@ -3118,7 +3122,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
instancia.h_cima = fcima
--> bottom
local fbaixo = CreateFrame ("frame", "DetailsBottomSideBarHighlight" .. instancia.meu_id, baseframe.cabecalho.fechar)
local fbaixo = CreateFrame ("frame", "DetailsBottomSideBarHighlight" .. instancia.meu_id, floatingframe)
gump:CreateFlashAnimation (fbaixo)
fbaixo:Hide()
@@ -3132,7 +3136,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
instancia.h_baixo = fbaixo
--> left
local fesquerda = CreateFrame ("frame", "DetailsLeftSideBarHighlight" .. instancia.meu_id, baseframe.cabecalho.fechar)
local fesquerda = CreateFrame ("frame", "DetailsLeftSideBarHighlight" .. instancia.meu_id, floatingframe)
gump:CreateFlashAnimation (fesquerda)
fesquerda:Hide()
@@ -3146,7 +3150,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
instancia.h_esquerda = fesquerda
--> right
local fdireita = CreateFrame ("frame", "DetailsRightSideBarHighlight" .. instancia.meu_id, baseframe.cabecalho.fechar)
local fdireita = CreateFrame ("frame", "DetailsRightSideBarHighlight" .. instancia.meu_id, floatingframe)
gump:CreateFlashAnimation (fdireita)
fdireita:Hide()
@@ -4218,7 +4222,12 @@ end
function _detalhes:InstanceAlpha (alpha)
self.baseframe.cabecalho.ball_r:SetAlpha (alpha)
self.baseframe.cabecalho.ball:SetAlpha (alpha)
self.baseframe.cabecalho.atributo_icon:SetAlpha (alpha)
local skin = _detalhes.skins [self.skin]
if (not skin.icon_ignore_alpha) then
self.baseframe.cabecalho.atributo_icon:SetAlpha (alpha)
end
self.baseframe.cabecalho.emenda:SetAlpha (alpha)
self.baseframe.cabecalho.top_bg:SetAlpha (alpha)
self.baseframe.barra_esquerda:SetAlpha (alpha)
@@ -4269,7 +4278,9 @@ function _detalhes:InstanceColor (red, green, blue, alpha, no_save, change_statu
self.baseframe.cabecalho.ball:SetVertexColor (red, green, blue)
self.baseframe.cabecalho.ball:SetAlpha (alpha)
self.baseframe.cabecalho.atributo_icon:SetAlpha (alpha)
if (not skin.icon_ignore_alpha) then
self.baseframe.cabecalho.atributo_icon:SetAlpha (alpha)
end
self.baseframe.cabecalho.emenda:SetVertexColor (red, green, blue)
self.baseframe.cabecalho.emenda:SetAlpha (alpha)
@@ -4361,7 +4372,7 @@ function gump:CriaRodape (baseframe, instancia)
baseframe.rodape = {}
--> esquerdo
baseframe.rodape.esquerdo = baseframe.cabecalho.fechar:CreateTexture (nil, "overlay")
baseframe.rodape.esquerdo = instancia.floatingframe:CreateTexture (nil, "overlay")
baseframe.rodape.esquerdo:SetPoint ("topright", baseframe, "bottomleft", 16, 0)
baseframe.rodape.esquerdo:SetTexture (DEFAULT_SKIN)
baseframe.rodape.esquerdo:SetTexCoord (unpack (COORDS_PIN_LEFT))
@@ -4369,7 +4380,7 @@ function gump:CriaRodape (baseframe, instancia)
baseframe.rodape.esquerdo:SetHeight (32)
--> direito
baseframe.rodape.direita = baseframe.cabecalho.fechar:CreateTexture (nil, "overlay")
baseframe.rodape.direita = instancia.floatingframe:CreateTexture (nil, "overlay")
baseframe.rodape.direita:SetPoint ("topleft", baseframe, "bottomright", -16, 0)
baseframe.rodape.direita:SetTexture (DEFAULT_SKIN)
baseframe.rodape.direita:SetTexCoord (unpack (COORDS_PIN_RIGHT))
@@ -4398,8 +4409,8 @@ function gump:CriaRodape (baseframe, instancia)
baseframe.rodape.StatusBarCenterAnchor = StatusBarCenterAnchor
--> display frame
baseframe.statusbar = CreateFrame ("frame", "DetailsStatusBar" .. instancia.meu_id, baseframe.cabecalho.fechar)
baseframe.statusbar:SetFrameLevel (baseframe.cabecalho.fechar:GetFrameLevel()+2)
baseframe.statusbar = CreateFrame ("frame", "DetailsStatusBar" .. instancia.meu_id, instancia.floatingframe)
baseframe.statusbar:SetFrameLevel (instancia.floatingframe:GetFrameLevel()+2)
baseframe.statusbar:SetPoint ("left", baseframe.rodape.esquerdo, "right", -13, 10)
baseframe.statusbar:SetPoint ("right", baseframe.rodape.direita, "left", 13, 10)
baseframe.statusbar:SetHeight (14)
@@ -6377,6 +6388,14 @@ function _detalhes:HideMainIcon (value)
end
local skin = _detalhes.skins [self.skin]
if (skin.icon_on_top) then
self.baseframe.cabecalho.atributo_icon:SetParent (self.floatingframe)
else
self.baseframe.cabecalho.atributo_icon:SetParent (self.baseframe)
end
else
self.hide_icon = false
gump:Fade (self.baseframe.cabecalho.atributo_icon, 0)
@@ -6797,14 +6816,14 @@ function gump:CriaCabecalho (baseframe, instancia)
baseframe.cabecalho.fechar:SetScript ("OnClick", close_button_onclick)
--> bola do canto esquedo superior --> primeiro criar a armação para apoiar as texturas
baseframe.cabecalho.ball_point = baseframe.cabecalho.fechar:CreateTexture (nil, "overlay")
baseframe.cabecalho.ball_point = instancia.floatingframe:CreateTexture (nil, "overlay")
baseframe.cabecalho.ball_point:SetPoint ("bottomleft", baseframe, "topleft", -37, 0)
baseframe.cabecalho.ball_point:SetWidth (64)
baseframe.cabecalho.ball_point:SetHeight (32)
--> icone do atributo
--baseframe.cabecalho.atributo_icon = _detalhes.listener:CreateTexture (nil, "artwork")
baseframe.cabecalho.atributo_icon = baseframe:CreateTexture (nil, "background")
baseframe.cabecalho.atributo_icon = baseframe:CreateTexture ("DetailsAttributeIcon" .. instancia.meu_id, "background")
local icon_anchor = _detalhes.skins ["WoW Interface"].icon_anchor_main
baseframe.cabecalho.atributo_icon:SetPoint ("topright", baseframe.cabecalho.ball_point, "topright", icon_anchor[1], icon_anchor[2])
baseframe.cabecalho.atributo_icon:SetTexture (DEFAULT_SKIN)
+4 -4
View File
@@ -108,7 +108,7 @@ do
window_color:SetPoint ("bottomright", frame, "topright", -3, 2)
local window_color_texture = gump:CreateImage (window_color, [[Interface\AddOns\Details\images\icons]], 14, 14, "artwork", {434/512, 466/512, 277/512, 307/512})
window_color_texture:SetAlpha (0.25)
window_color_texture:SetAlpha (0.35)
window_color_texture:SetAllPoints()
window_color:SetHook ("OnEnter", function()
@@ -121,7 +121,7 @@ do
GameCooltip:Show()
end)
window_color:SetHook ("OnLeave", function()
window_color_texture:SetAlpha (0.25)
window_color_texture:SetAlpha (0.35)
GameCooltip:Hide()
end)
@@ -135,7 +135,7 @@ do
options_button:SetPoint ("right", window_color, "left", -2, 0)
local options_button_texture = gump:CreateImage (options_button, [[Interface\AddOns\Details\images\modo_icones]], 14, 14, "artwork", {0.5, 0.625, 0, 1})
options_button_texture:SetAlpha (0.25)
options_button_texture:SetAlpha (0.35)
options_button_texture:SetAllPoints()
options_button:SetHook ("OnEnter", function()
@@ -148,7 +148,7 @@ do
GameCooltip:Show()
end)
options_button:SetHook ("OnLeave", function()
options_button_texture:SetAlpha (0.25)
options_button_texture:SetAlpha (0.35)
GameCooltip:Hide()
end)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 4.0 MiB