diff --git a/Details.toc b/Details.toc
index 82c2f48e..f029ac22 100644
--- a/Details.toc
+++ b/Details.toc
@@ -42,21 +42,7 @@ functions\rowanimation.lua
core\timemachine.lua
-framework\framework.lua
-framework\colors.lua
-framework\label.lua
-framework\slider.lua
-framework\itscroll.xml
-framework\picture.lua
-framework\help.lua
-framework\cooltip.xml
-framework\textentry.xml
-framework\panel.xml
-framework\normal_bar.xml
-framework\split_bar.xml
-framework\button.xml
-framework\dropdown.xml
-framework\pictureedit.lua
+
gumps\anime.lua
gumps\anime.xml
diff --git a/Libs/DF/addon.lua b/Libs/DF/addon.lua
new file mode 100644
index 00000000..b21fd7f3
--- /dev/null
+++ b/Libs/DF/addon.lua
@@ -0,0 +1,62 @@
+
+local DF = _G ["DetailsFramework"]
+local _
+
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
+function DF:CreateAddOn (name, global_saved, global_table, options_table, broker)
+
+ local addon = LibStub ("AceAddon-3.0"):NewAddon (name, "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0", "DetailsFramework-1.0", "AceComm-3.0")
+ _G [name] = addon
+ addon.__name = name
+
+ function addon:OnInitialize()
+
+ if (global_saved) then
+ if (broker and broker.Minimap and not global_table.Minimap) then
+ DF:Msg (name, "broker.Minimap is true but no global.Minimap declared.")
+ end
+ self.db = LibStub ("AceDB-3.0"):New (global_saved, global_table or {}, true)
+ end
+
+ if (options_table) then
+ LibStub ("AceConfig-3.0"):RegisterOptionsTable (name, options_table)
+ addon.OptionsFrame1 = LibStub ("AceConfigDialog-3.0"):AddToBlizOptions (name, name)
+
+ LibStub ("AceConfig-3.0"):RegisterOptionsTable (name .. "-Profiles", LibStub ("AceDBOptions-3.0"):GetOptionsTable (self.db))
+ addon.OptionsFrame2 = LibStub ("AceConfigDialog-3.0"):AddToBlizOptions (name .. "-Profiles", "Profiles", name)
+ end
+
+ if (broker) then
+ local broker_click_function = broker.OnClick
+ if (not broker_click_function and options_table) then
+ broker_click_function = function()
+ InterfaceOptionsFrame_OpenToCategory (name)
+ InterfaceOptionsFrame_OpenToCategory (name)
+ end
+ end
+
+ local databroker = LibStub ("LibDataBroker-1.1"):NewDataObject (name, {
+ type = broker.type or "launcher",
+ icon = broker.icon or [[Interface\PvPRankBadges\PvPRank15]],
+ text = broker.text or "",
+ OnTooltipShow = broker.OnTooltipShow,
+ OnClick = broker_click_function
+ })
+
+ if (databroker and broker.Minimap and global_table.Minimap) then
+ LibStub ("LibDBIcon-1.0"):Register (name, databroker, addon.db.profile.Minimap)
+ end
+ end
+
+ if (addon.OnInit) then
+ xpcall (addon.OnInit, geterrorhandler(), addon)
+ end
+
+ end
+
+ return addon
+
+end
\ No newline at end of file
diff --git a/Libs/DF/all_addons.tga b/Libs/DF/all_addons.tga
new file mode 100644
index 00000000..5b84de02
Binary files /dev/null and b/Libs/DF/all_addons.tga differ
diff --git a/Libs/DF/background.tga b/Libs/DF/background.tga
new file mode 100644
index 00000000..8978d43d
Binary files /dev/null and b/Libs/DF/background.tga differ
diff --git a/Libs/DF/border_1.tga b/Libs/DF/border_1.tga
new file mode 100644
index 00000000..0f84fce6
Binary files /dev/null and b/Libs/DF/border_1.tga differ
diff --git a/Libs/DF/border_2.tga b/Libs/DF/border_2.tga
new file mode 100644
index 00000000..22b2c534
Binary files /dev/null and b/Libs/DF/border_2.tga differ
diff --git a/Libs/DF/border_3.tga b/Libs/DF/border_3.tga
new file mode 100644
index 00000000..79e236bb
Binary files /dev/null and b/Libs/DF/border_3.tga differ
diff --git a/framework/button.lua b/Libs/DF/button.lua
similarity index 81%
rename from framework/button.lua
rename to Libs/DF/button.lua
index c69c9fc4..d7b19aad 100644
--- a/framework/button.lua
+++ b/Libs/DF/button.lua
@@ -1,7 +1,11 @@
---> details main objects
-local _detalhes = _G._detalhes
-local gump = _detalhes.gump
+local DF = _G ["DetailsFramework"]
+
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
+local _
local _rawset = rawset --> lua local
local _rawget = rawget --> lua local
local _setmetatable = setmetatable --> lua local
@@ -9,7 +13,7 @@ local _unpack = unpack --> lua local
local _type = type --> lua local
local _math_floor = math.floor --> lua local
local loadstring = loadstring --> lua local
-local _
+
local cleanfunction = function() end
local APIButtonFunctions = false
local ButtonMetaFunctions = {}
@@ -143,16 +147,16 @@ local ButtonMetaFunctions = {}
end
--> text color
local smember_textcolor = function (_object, _value)
- local _value1, _value2, _value3, _value4 = gump:ParseColors (_value)
+ local _value1, _value2, _value3, _value4 = DF:ParseColors (_value)
return _object.button.text:SetTextColor (_value1, _value2, _value3, _value4)
end
--> text font
local smember_textfont = function (_object, _value)
- return _detalhes:SetFontFace (_object.button.text, _value)
+ return DF:SetFontFace (_object.button.text, _value)
end
--> text size
local smember_textsize = function (_object, _value)
- return _detalhes:SetFontSize (_object.button.text, _value)
+ return DF:SetFontSize (_object.button.text, _value)
end
--> texture
local smember_texture = function (_object, _value)
@@ -244,9 +248,9 @@ local ButtonMetaFunctions = {}
-- setpoint
function ButtonMetaFunctions:SetPoint (v1, v2, v3, v4, v5)
- v1, v2, v3, v4, v5 = gump:CheckPoints (v1, v2, v3, v4, v5, self)
+ v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self)
if (not v1) then
- print ("Invalid parameter for SetPoint")
+ error ("SetPoint: Invalid parameter.")
return
end
return self.widget:SetPoint (v1, v2, v3, v4, v5)
@@ -313,18 +317,18 @@ local ButtonMetaFunctions = {}
if (arg2) then
return self.button.text:SetTextColor (color, arg2, arg3, arg4 or 1)
end
- local _value1, _value2, _value3, _value4 = gump:ParseColors (color)
+ local _value1, _value2, _value3, _value4 = DF:ParseColors (color)
return self.button.text:SetTextColor (_value1, _value2, _value3, _value4)
end
-- textsize
function ButtonMetaFunctions:SetTextSize (size)
- return _detalhes:SetFontSize (self.button.text, _value)
+ return DF:SetFontSize (self.button.text, _value)
end
-- textfont
function ButtonMetaFunctions:SetTextFont (font)
- return _detalhes:SetFontFace (_object.button.text, _value)
+ return DF:SetFontFace (_object.button.text, _value)
end
-- textures
@@ -401,7 +405,7 @@ local ButtonMetaFunctions = {}
end
if (overlay) then
if (type (overlay) == "string") then
- local r, g, b, a = gump:ParseColors (overlay)
+ local r, g, b, a = DF:ParseColors (overlay)
self.icon:SetVertexColor (r, g, b, a)
else
self.icon:SetVertexColor (unpack (overlay))
@@ -425,7 +429,7 @@ local ButtonMetaFunctions = {}
loop = false
break
else
- _detalhes:SetFontSize (self.button.text, textsize)
+ DF:SetFontSize (self.button.text, textsize)
text_width = self.button.text:GetStringWidth()
textsize = textsize - 1
end
@@ -612,17 +616,22 @@ local ButtonMetaFunctions = {}
end
end
- if (button.MyObject.have_tooltip) then
- _detalhes:CooltipPreset (2)
- GameCooltip:AddLine (button.MyObject.have_tooltip)
- GameCooltip:ShowCooltip (button, "tooltip")
+ if (button.MyObject.onenter_backdrop_border_color) then
+ button:SetBackdropBorderColor (unpack (button.MyObject.onenter_backdrop_border_color))
end
- local parent = button:GetParent().MyObject
- if (parent and parent.type == "panel") then
- if (parent.GradientEnabled) then
- parent:RunGradient()
+ if (button.MyObject.onenter_backdrop) then
+ button:SetBackdropColor (unpack (button.MyObject.onenter_backdrop))
+ end
+
+ if (button.MyObject.have_tooltip) then
+ GameCooltip2:Preset (2)
+ if (type (button.MyObject.have_tooltip) == "function") then
+ GameCooltip2:AddLine (button.MyObject.have_tooltip() or "")
+ else
+ GameCooltip2:AddLine (button.MyObject.have_tooltip)
end
+ GameCooltip2:ShowCooltip (button, "tooltip")
end
end
@@ -657,16 +666,17 @@ local ButtonMetaFunctions = {}
end
end
- if (button.MyObject.have_tooltip) then
- if (GameCooltip:GetText (1) == button.MyObject.have_tooltip) then
- GameCooltip:Hide()
- end
+ if (button.MyObject.onleave_backdrop_border_color) then
+ button:SetBackdropBorderColor (unpack (button.MyObject.onleave_backdrop_border_color))
end
- local parent = button:GetParent().MyObject
- if (parent and parent.type == "panel") then
- if (parent.GradientEnabled) then
- parent:RunGradient (false)
+ if (button.MyObject.onleave_backdrop) then
+ button:SetBackdropColor (unpack (button.MyObject.onleave_backdrop))
+ end
+
+ if (button.MyObject.have_tooltip) then
+ if (GameCooltip2:GetText (1) == button.MyObject.have_tooltip or type (button.MyObject.have_tooltip) == "function") then
+ GameCooltip2:Hide()
end
end
end
@@ -846,25 +856,77 @@ local ButtonMetaFunctions = {}
y = _math_floor (y)
if ((button.mouse_down+0.4 > GetTime() and (x == button.x and y == button.y)) or (x == button.x and y == button.y)) then
if (buttontype == "LeftButton") then
- button.MyObject.func (button.MyObject.param1, button.MyObject.param2, button, buttontype)
+ button.MyObject.func (button, buttontype, button.MyObject.param1, button.MyObject.param2)
else
- button.MyObject.funcright (button.MyObject.param1, button.MyObject.param2, button, buttontype)
+ button.MyObject.funcright (button, buttontype, button.MyObject.param1, button.MyObject.param2)
end
end
end
------------------------------------------------------------------------------------------------------------
---> object constructor
-function gump:CreateButton (parent, func, w, h, text, param1, param2, texture, member, name, short_method)
- return gump:NewButton (parent, parent, name, member, w, h, func, param1, param2, texture, text, short_method)
+function ButtonMetaFunctions:SetTemplate (template)
+
+ if (template.width) then
+ self:SetWidth (template.width)
+ end
+ if (template.height) then
+ self:SetHeight (template.height)
+ end
+
+ if (template.backdrop) then
+ self:SetBackdrop (template.backdrop)
+ end
+ if (template.backdropcolor) then
+ local r, g, b, a = DF:ParseColors (template.backdropcolor)
+ self:SetBackdropColor (r, g, b, a)
+ self.onleave_backdrop = {r, g, b, a}
+ end
+ if (template.backdropbordercolor) then
+ local r, g, b, a = DF:ParseColors (template.backdropbordercolor)
+ self:SetBackdropBorderColor (r, g, b, a)
+ self.onleave_backdrop_border_color = {r, g, b, a}
+ end
+
+ if (template.onentercolor) then
+ local r, g, b, a = DF:ParseColors (template.onentercolor)
+ self.onenter_backdrop = {r, g, b, a}
+ end
+
+ if (template.onleavecolor) then
+ local r, g, b, a = DF:ParseColors (template.onleavecolor)
+ self.onleave_backdrop = {r, g, b, a}
+ end
+
+ if (template.onenterbordercolor) then
+ local r, g, b, a = DF:ParseColors (template.onenterbordercolor)
+ self.onenter_backdrop_border_color = {r, g, b, a}
+ end
+
+ if (template.onleavebordercolor) then
+ local r, g, b, a = DF:ParseColors (template.onleavebordercolor)
+ self.onleave_backdrop_border_color = {r, g, b, a}
+ end
+
+ if (template.icon) then
+ local i = template.icon
+ self:SetIcon (i.texture, i.width, i.height, i.layout, i.texcoord, i.color, i.textdistance, i.leftpadding)
+ end
+
end
-function gump:NewButton (parent, container, name, member, w, h, func, param1, param2, texture, text, short_method)
+------------------------------------------------------------------------------------------------------------
+--> object constructor
+
+function DF:CreateButton (parent, func, w, h, text, param1, param2, texture, member, name, short_method, button_template, text_template)
+ return DF:NewButton (parent, parent, name, member, w, h, func, param1, param2, texture, text, short_method, button_template, text_template)
+end
+
+function DF:NewButton (parent, container, name, member, w, h, func, param1, param2, texture, text, short_method, button_template, text_template)
if (not name) then
- name = "DetailsButtonNumber" .. gump.ButtonCounter
- gump.ButtonCounter = gump.ButtonCounter + 1
+ name = "DetailsFrameworkButtonNumber" .. DF.ButtonCounter
+ DF.ButtonCounter = DF.ButtonCounter + 1
elseif (not parent) then
return nil
@@ -876,8 +938,7 @@ function gump:NewButton (parent, container, name, member, w, h, func, param1, pa
if (name:find ("$parent")) then
name = name:gsub ("$parent", parent:GetName())
end
-
-
+
local ButtonObject = {type = "button", dframework = true}
if (member) then
@@ -906,16 +967,20 @@ function gump:NewButton (parent, container, name, member, w, h, func, param1, pa
ButtonObject.options = {OnGrab = false}
- ButtonObject.button = CreateFrame ("button", name, parent, "DetailsButtonTemplate")
+ ButtonObject.button = CreateFrame ("button", name, parent, "DetailsFrameworkButtonTemplate")
ButtonObject.widget = ButtonObject.button
+ --ButtonObject.button:SetBackdrop ({bgFile = DF.folder .. "background", tileSize = 64, edgeFile = DF.folder .. "border_2", edgeSize = 10, insets = {left = 1, right = 1, top = 1, bottom = 1}})
+ ButtonObject.button:SetBackdropColor (0, 0, 0, 0.4)
+ ButtonObject.button:SetBackdropBorderColor (1, 1, 1, 1)
+
if (not APIButtonFunctions) then
APIButtonFunctions = true
local idx = getmetatable (ButtonObject.button).__index
for funcName, funcAddress in pairs (idx) do
if (not ButtonMetaFunctions [funcName]) then
ButtonMetaFunctions [funcName] = function (object, ...)
- local x = loadstring ( "return _G."..object.button:GetName()..":"..funcName.."(...)")
+ local x = loadstring ( "return _G['"..object.button:GetName().."']:"..funcName.."(...)")
return x (...)
end
end
@@ -950,7 +1015,7 @@ function gump:NewButton (parent, container, name, member, w, h, func, param1, pa
loop = false
break
else
- _detalhes:SetFontSize (ButtonObject.button.text, textsize)
+ DF:SetFontSize (ButtonObject.button.text, textsize)
text_width = ButtonObject.button.text:GetStringWidth()
textsize = textsize - 1
end
@@ -965,6 +1030,21 @@ function gump:NewButton (parent, container, name, member, w, h, func, param1, pa
ButtonObject.short_method = short_method
+ if (text_template) then
+ if (text_template.size) then
+ DF:SetFontSize (ButtonObject.button.text, text_template.size)
+ end
+ if (text_template.color) then
+ local r, g, b, a = DF:ParseColors (text_template.color)
+ ButtonObject.button.text:SetTextColor (r, g, b, a)
+ end
+ if (text_template.font) then
+ local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
+ local font = SharedMedia:Fetch ("font", text_template.font)
+ DF:SetFontFace (ButtonObject.button.text, font)
+ end
+ end
+
--> hooks
ButtonObject.button:SetScript ("OnEnter", OnEnter)
ButtonObject.button:SetScript ("OnLeave", OnLeave)
@@ -975,23 +1055,30 @@ function gump:NewButton (parent, container, name, member, w, h, func, param1, pa
_setmetatable (ButtonObject, ButtonMetaFunctions)
+ if (button_template) then
+ ButtonObject:SetTemplate (button_template)
+ end
+
return ButtonObject
end
local pickcolor_callback = function (self, r, g, b, a, button)
+ a = abs (a-1)
button.MyObject.color_texture:SetVertexColor (r, g, b, a)
button.MyObject:color_callback (r, g, b, a)
end
-local pickcolor = function (alpha, param2, self)
+local pickcolor = function (self, alpha, param2)
local r, g, b, a = self.MyObject.color_texture:GetVertexColor()
- gump:ColorPick (self, r, g, b, a, pickcolor_callback)
+ a = abs (a-1)
+ DF:ColorPick (self, r, g, b, a, pickcolor_callback)
end
local color_button_height = 16
local color_button_width = 16
local set_colorpick_color = function (button, r, g, b, a)
+ a = a or 1
button.color_texture:SetVertexColor (r, g, b, a)
end
@@ -999,48 +1086,39 @@ local colorpick_cancel = function (self)
ColorPickerFrame:Hide()
end
-function gump:NewColorPickButton (parent, name, member, callback, alpha)
+function DF:CreateColorPickButton (parent, name, member, callback, alpha, button_template)
+ return DF:NewColorPickButton (parent, name, member, callback, alpha, button_template)
+end
+
+function DF:NewColorPickButton (parent, name, member, callback, alpha, button_template)
--button
- local button = gump:NewButton (parent, _, name, member, color_button_width, color_button_height, pickcolor, alpha, "param2")
- button:InstallCustomTexture()
+ local button = DF:NewButton (parent, _, name, member, color_button_width, color_button_height, pickcolor, alpha, "param2", nil, nil, nil, button_template)
button.color_callback = callback
button.Cancel = colorpick_cancel
button.SetColor = set_colorpick_color
- button:SetBackdrop ({edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 6,
- bgFile = [[Interface\AddOns\Details\images\background]], insets = {left = 0, right = 0, top = 0, bottom = 0}})
+ if (not button_template) then
+ button:InstallCustomTexture()
+ button:SetBackdrop ({edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 6,
+ bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], insets = {left = 0, right = 0, top = 0, bottom = 0}})
+ end
--textura do fundo
- local background = gump:NewImage (button, nil, color_button_width, color_button_height, nil, nil, nil, "$parentBck")
- background:SetTexture ([[Interface\AddOns\Details\images\icons]])
+ local background = DF:NewImage (button, nil, color_button_width, color_button_height, nil, nil, nil, "$parentBck")
+ --background:SetTexture ([[Interface\AddOns\Details\images\icons]])
background:SetPoint ("topleft", button.widget, "topleft", 1, -2)
background:SetPoint ("bottomright", button.widget, "bottomright", -1, 1)
- --background:SetTexCoord (0.337890625, 0.5859375, 0.625, 0.685546875) --173 320 300 351
- background:SetTexCoord (0.337890625, 0.390625, 0.625, 0.658203125) --173 320 200 337
+ background:SetTexCoord (0.337890625, 0.390625, 0.625, 0.658203125)
background:SetDrawLayer ("background", 1)
--textura da cor
- local img = gump:NewImage (button, nil, color_button_width, color_button_height, nil, nil, "color_texture", "$parentTex")
+ local img = DF:NewImage (button, nil, color_button_width, color_button_height, nil, nil, "color_texture", "$parentTex")
img:SetTexture (1, 1, 1)
img:SetPoint ("topleft", button.widget, "topleft", 1, -2)
img:SetPoint ("bottomright", button.widget, "bottomright", -1, 1)
img:SetDrawLayer ("background", 2)
- --icone do color pick
- --[[
- local icon = gump:NewImage (button, nil, "$parentIcon", nil, 16, color_button_height)
- icon:SetTexture ("Interface\\AddOns\\Details\\images\\icons")
- icon:SetPoint ("topleft", button, "topleft", -1, 0)
- icon:SetDrawLayer ("border", 3)
- icon:SetTexCoord (0.640625, 0.6875, 0.630859375, 0.677734375) --328 323 352 347
-
- text
- local color_label = gump:NewLabel (button, nil, nil, nil, "color", "GameFontNormal")
- color_label:SetDrawLayer ("border", 4)
- color_label:SetPoint ("left", icon, "right", 2, 1)
- --]]
-
return button
end
\ No newline at end of file
diff --git a/framework/button.xml b/Libs/DF/button.xml
similarity index 90%
rename from framework/button.xml
rename to Libs/DF/button.xml
index 877aae3c..67d6a2da 100644
--- a/framework/button.xml
+++ b/Libs/DF/button.xml
@@ -1,7 +1,7 @@
-
\ No newline at end of file
diff --git a/framework/cooltip_background.tga b/Libs/DF/cooltip_background.tga
similarity index 100%
rename from framework/cooltip_background.tga
rename to Libs/DF/cooltip_background.tga
diff --git a/framework/dropdown.lua b/Libs/DF/dropdown.lua
similarity index 79%
rename from framework/dropdown.lua
rename to Libs/DF/dropdown.lua
index 65396d39..175c94c4 100644
--- a/framework/dropdown.lua
+++ b/Libs/DF/dropdown.lua
@@ -1,7 +1,10 @@
---> details main objects
-local _detalhes = _G._detalhes
-local gump = _detalhes.gump
+local DF = _G ["DetailsFramework"]
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
+local _
local _rawset = rawset --> lua local
local _rawget = rawget --> lua local
local _setmetatable = setmetatable --> lua local
@@ -10,7 +13,7 @@ local _type = type --> lua local
local _math_floor = math.floor --> lua local
local loadstring = loadstring --> lua local
local _string_len = string.len --> lua local
-local _
+
local cleanfunction = function() end
local APIDropDownFunctions = false
local DropDownMetaFunctions = {}
@@ -195,7 +198,7 @@ local DropDownMetaFunctions = {}
--> setpoint
function DropDownMetaFunctions:SetPoint (v1, v2, v3, v4, v5)
- v1, v2, v3, v4, v5 = gump:CheckPoints (v1, v2, v3, v4, v5, self)
+ v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self)
if (not v1) then
print ("Invalid parameter for SetPoint")
return
@@ -326,7 +329,11 @@ function DropDownMetaFunctions:Refresh()
end
function DropDownMetaFunctions:NoOptionSelected()
+ if (self.no_options) then
+ return
+ end
self.label:SetText (self.empty_text or "no option selected")
+ self.label:SetPoint ("left", self.icon, "right", 2, 0)
self.label:SetTextColor (1, 1, 1, 0.4)
if (self.empty_icon) then
self.icon:SetTexture (self.empty_icon)
@@ -345,6 +352,7 @@ function DropDownMetaFunctions:NoOption (state)
self:SetAlpha (0.5)
self.no_options = true
self.label:SetText ("no options")
+ self.label:SetPoint ("left", self.icon, "right", 2, 0)
self.label:SetTextColor (1, 1, 1, 0.4)
self.icon:SetTexture ([[Interface\CHARACTERFRAME\UI-Player-PlayTimeUnhealthy]])
self.icon:SetTexCoord (0, 1, 0, 1)
@@ -433,7 +441,7 @@ function DropDownMetaFunctions:Selected (_table)
if (_table.iconcolor) then
if (type (_table.iconcolor) == "string") then
- self.icon:SetVertexColor (gump:ParseColors (_table.iconcolor))
+ self.icon:SetVertexColor (DF:ParseColors (_table.iconcolor))
else
self.icon:SetVertexColor (unpack (_table.iconcolor))
end
@@ -441,6 +449,7 @@ function DropDownMetaFunctions:Selected (_table)
self.icon:SetVertexColor (1, 1, 1, 1)
end
+ self.icon:SetSize (self:GetHeight()-2, self:GetHeight()-2)
else
self.label:SetPoint ("left", self.label:GetParent(), "left", 4, 0)
end
@@ -448,7 +457,7 @@ function DropDownMetaFunctions:Selected (_table)
self.statusbar:SetTexture (_table.statusbar)
if (_table.color) then
- local _value1, _value2, _value3, _value4 = gump:ParseColors (_table.color)
+ local _value1, _value2, _value3, _value4 = DF:ParseColors (_table.color)
self.label:SetTextColor (_value1, _value2, _value3, _value4)
else
self.label:SetTextColor (1, 1, 1, 1)
@@ -464,7 +473,7 @@ function DropDownMetaFunctions:Selected (_table)
end
-function DetailsDropDownOptionClick (button)
+function DetailsFrameworkDropDownOptionClick (button)
--> update name and icon on main frame
button.object:Selected (button.table)
@@ -504,41 +513,41 @@ function DropDownMetaFunctions:Close()
local selectedTexture = _G [self:GetName() .. "_ScrollFrame_ScrollChild_SelectedTexture"]
selectedTexture:Hide()
-
+
self.opened = false
last_opened = false
end
--> close by escape key
-function DetailsDropDownOptionsFrameOnHide (frame)
+function DetailsFrameworkDropDownOptionsFrameOnHide (frame)
frame:GetParent().MyObject:Close()
end
-function DetailsDropDownOptionOnEnter (frame)
+function DetailsFrameworkDropDownOptionOnEnter (frame)
if (frame.table.desc) then
- _detalhes:CooltipPreset (2)
- GameCooltip:AddLine (frame.table.desc)
+ GameCooltip2:Preset (2)
+ GameCooltip2:AddLine (frame.table.desc)
if (frame.table.descfont) then
- GameCooltip:SetOption ("TextFont", frame.table.descfont)
+ GameCooltip2:SetOption ("TextFont", frame.table.descfont)
end
- GameCooltip:SetHost (frame, "topleft", "topright", 10, 0)
+ GameCooltip2:SetHost (frame, "topleft", "topright", 10, 0)
- GameCooltip:ShowCooltip (nil, "tooltip")
+ GameCooltip2:ShowCooltip (nil, "tooltip")
frame.tooltip = true
end
frame:GetParent().mouseover:SetPoint ("left", frame)
frame:GetParent().mouseover:Show()
end
-function DetailsDropDownOptionOnLeave (frame)
+function DetailsFrameworkDropDownOptionOnLeave (frame)
if (frame.table.desc) then
- _detalhes.popup:ShowMe (false)
+ GameCooltip2:ShowMe (false)
end
frame:GetParent().mouseover:Hide()
end
-function DetailsDropDownOnMouseDown (button)
+function DetailsFrameworkDropDownOnMouseDown (button)
local object = button.MyObject
@@ -583,7 +592,7 @@ function DetailsDropDownOnMouseDown (button)
local name = button:GetName() .. "Row" .. i
local parent = scrollChild
- _this_row = CreateFrame ("Button", name, parent, "DetailsDropDownOptionTemplate")
+ _this_row = CreateFrame ("Button", name, parent, "DetailsFrameworkDropDownOptionTemplate")
local anchor_i = i-1
_this_row:SetPoint ("topleft", parent, "topleft", 5, (-anchor_i*20)-5)
_this_row:SetPoint ("topright", parent, "topright", -5, (-anchor_i*20)-5)
@@ -604,7 +613,7 @@ function DetailsDropDownOnMouseDown (button)
if (_table.iconcolor) then
if (type (_table.iconcolor) == "string") then
- _this_row.icon:SetVertexColor (gump:ParseColors (_table.iconcolor))
+ _this_row.icon:SetVertexColor (DF:ParseColors (_table.iconcolor))
else
_this_row.icon:SetVertexColor (unpack (_table.iconcolor))
end
@@ -638,14 +647,15 @@ function DetailsDropDownOnMouseDown (button)
end
selectedTexture:Show()
- selectedTexture:SetVertexColor (1, 1, 1, .3);
+ selectedTexture:SetVertexColor (1, 1, 1, .3)
+ selectedTexture:SetTexCoord (0, 29/32, 5/32, 27/32)
currentIndex = tindex
currentText = nil
end
if (_table.color) then
- local _value1, _value2, _value3, _value4 = gump:ParseColors (_table.color)
+ local _value1, _value2, _value3, _value4 = DF:ParseColors (_table.color)
_this_row.label:SetTextColor (_value1, _value2, _value3, _value4)
else
_this_row.label:SetTextColor (1, 1, 1, 1)
@@ -740,7 +750,7 @@ function DetailsDropDownOnMouseDown (button)
end
-function DetailsDropDownOnEnter (self)
+function DetailsFrameworkDropDownOnEnter (self)
if (self.MyObject.OnEnterHook) then
local interrupt = self.MyObject.OnEnterHook (self)
@@ -755,28 +765,28 @@ function DetailsDropDownOnEnter (self)
self:SetBackdropColor (.2, .2, .2, .2)
end
+ if (self.MyObject.onenter_backdrop_border_color) then
+ self:SetBackdropBorderColor (unpack (self.MyObject.onenter_backdrop_border_color))
+ end
+
self.arrowTexture2:Show()
if (self.MyObject.have_tooltip) then
- GameCooltip:Reset()
- GameCooltip:SetType ("tooltip")
- GameCooltip:SetColor ("main", "transparent")
- _detalhes:CooltipPreset (2)
- GameCooltip:AddLine (self.MyObject.have_tooltip)
- GameCooltip:SetOwner (self)
- GameCooltip:ShowCooltip()
- end
-
- local parent = self:GetParent().MyObject
- if (parent and parent.type == "panel") then
- if (parent.GradientEnabled) then
- parent:RunGradient()
+ GameCooltip2:Preset (2)
+
+ if (type (self.MyObject.have_tooltip) == "function") then
+ GameCooltip2:AddLine (self.MyObject.have_tooltip() or "")
+ else
+ GameCooltip2:AddLine (self.MyObject.have_tooltip)
end
+
+ GameCooltip2:SetOwner (self)
+ GameCooltip2:ShowCooltip()
end
-
+
end
-function DetailsDropDownOnLeave (self)
+function DetailsFrameworkDropDownOnLeave (self)
if (self.MyObject.OnLeaveHook) then
local interrupt = self.MyObject.OnLeaveHook (self)
if (interrupt) then
@@ -790,25 +800,22 @@ function DetailsDropDownOnLeave (self)
self:SetBackdropColor (1, 1, 1, .5)
end
+ if (self.MyObject.onleave_backdrop_border_color) then
+ self:SetBackdropBorderColor (unpack (self.MyObject.onleave_backdrop_border_color))
+ end
+
self.arrowTexture2:Hide()
if (self.MyObject.have_tooltip) then
- _detalhes.popup:ShowMe (false)
- end
-
- local parent = self:GetParent().MyObject
- if (parent and parent.type == "panel") then
- if (parent.GradientEnabled) then
- parent:RunGradient (false)
- end
+ GameCooltip2:ShowMe (false)
end
end
-function DetailsDropDownOnSizeChanged (self, w, h)
+function DetailsFrameworkDropDownOnSizeChanged (self, w, h)
self.MyObject.label:SetSize (self:GetWidth()-40, 10)
end
-function DetailsDropDownOnShow (self)
+function DetailsFrameworkDropDownOnShow (self)
if (self.MyObject and self.MyObject.OnShowHook) then
local interrupt = self.MyObject.OnShowHook (self)
if (interrupt) then
@@ -817,7 +824,7 @@ function DetailsDropDownOnShow (self)
end
end
-function DetailsDropDownOnHide (self)
+function DetailsFrameworkDropDownOnHide (self)
if (self.MyObject and self.MyObject.OnHideHook) then
local interrupt = self.MyObject.OnHideHook (self)
if (interrupt) then
@@ -828,20 +835,74 @@ function DetailsDropDownOnHide (self)
self.MyObject:Close()
end
+function DF:BuildDropDownFontList (on_click, icon, icon_texcoord, icon_size)
+ local t = {}
+ local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
+ for name, fontPath in pairs (SharedMedia:HashTable ("font")) do
+ t[#t+1] = {value = name, label = name, onclick = on_click, icon = icon, iconsize = icon_size, texcoord = icon_texcoord, font = fontPath, descfont = "abcdefg ABCDEFG"}
+ end
+ table.sort (t, function (t1, t2) return t1.label < t2.label end)
+ return t
+end
+------------------------------------------------------------------------------------------------------------
+function DropDownMetaFunctions:SetTemplate (template)
+
+ if (template.width) then
+ self:SetWidth (template.width)
+ end
+ if (template.height) then
+ self:SetHeight (template.height)
+ end
+
+ if (template.backdrop) then
+ self:SetBackdrop (template.backdrop)
+ end
+ if (template.backdropcolor) then
+ local r, g, b, a = DF:ParseColors (template.backdropcolor)
+ self:SetBackdropColor (r, g, b, a)
+ self.onleave_backdrop = {r, g, b, a}
+ end
+ if (template.backdropbordercolor) then
+ local r, g, b, a = DF:ParseColors (template.backdropbordercolor)
+ self:SetBackdropBorderColor (r, g, b, a)
+ self.onleave_backdrop_border_color = {r, g, b, a}
+ end
+
+ if (template.onentercolor) then
+ local r, g, b, a = DF:ParseColors (template.onentercolor)
+ self.onenter_backdrop = {r, g, b, a}
+ end
+
+ if (template.onleavecolor) then
+ local r, g, b, a = DF:ParseColors (template.onleavecolor)
+ self.onleave_backdrop = {r, g, b, a}
+ end
+
+ if (template.onenterbordercolor) then
+ local r, g, b, a = DF:ParseColors (template.onenterbordercolor)
+ self.onenter_backdrop_border_color = {r, g, b, a}
+ end
+
+ if (template.onleavebordercolor) then
+ local r, g, b, a = DF:ParseColors (template.onleavebordercolor)
+ self.onleave_backdrop_border_color = {r, g, b, a}
+ end
+
+end
------------------------------------------------------------------------------------------------------------
--> object constructor
-function gump:CreateDropDown (parent, func, default, w, h, member, name)
- return gump:NewDropDown (parent, parent, name, member, w, h, func, default)
+function DF:CreateDropDown (parent, func, default, w, h, member, name, template)
+ return DF:NewDropDown (parent, parent, name, member, w, h, func, default, template)
end
-function gump:NewDropDown (parent, container, name, member, w, h, func, default)
+function DF:NewDropDown (parent, container, name, member, w, h, func, default, template)
if (not name) then
- name = "DetailsDropDownNumber" .. gump.DropDownCounter
- gump.DropDownCounter = gump.DropDownCounter + 1
+ name = "DetailsFrameworkDropDownNumber" .. DF.DropDownCounter
+ DF.DropDownCounter = DF.DropDownCounter + 1
elseif (not parent) then
return nil
@@ -882,7 +943,7 @@ function gump:NewDropDown (parent, container, name, member, w, h, func, default)
DropDownObject.container = container
DropDownObject.have_tooltip = nil
- DropDownObject.dropdown = CreateFrame ("Button", name, parent, "DetailsDropDownTemplate")
+ DropDownObject.dropdown = CreateFrame ("Button", name, parent, "DetailsFrameworkDropDownTemplate")
DropDownObject.widget = DropDownObject.dropdown
DropDownObject.__it = {nil, nil}
@@ -894,7 +955,7 @@ function gump:NewDropDown (parent, container, name, member, w, h, func, default)
for funcName, funcAddress in pairs (idx) do
if (not DropDownMetaFunctions [funcName]) then
DropDownMetaFunctions [funcName] = function (object, ...)
- local x = loadstring ( "return _G."..object.dropdown:GetName()..":"..funcName.."(...)")
+ local x = loadstring ( "return _G['"..object.dropdown:GetName().."']:"..funcName.."(...)")
return x (...)
end
end
@@ -922,7 +983,7 @@ function gump:NewDropDown (parent, container, name, member, w, h, func, default)
local scroll = _G [DropDownObject.dropdown:GetName() .. "_ScrollFrame"]
- DropDownObject.scroll = gump:NewScrollBar (scroll, _G [DropDownObject.dropdown:GetName() .. "_ScrollFrame".."_ScrollChild"], -25, -18)
+ DropDownObject.scroll = DF:NewScrollBar (scroll, _G [DropDownObject.dropdown:GetName() .. "_ScrollFrame".."_ScrollChild"], -25, -18)
function DropDownObject:HideScroll()
scroll.baixo:Hide()
@@ -954,6 +1015,10 @@ function gump:NewDropDown (parent, container, name, member, w, h, func, default)
end
end
+ if (template) then
+ DropDownObject:SetTemplate (template)
+ end
+
return DropDownObject
end
\ No newline at end of file
diff --git a/framework/dropdown.xml b/Libs/DF/dropdown.xml
similarity index 86%
rename from framework/dropdown.xml
rename to Libs/DF/dropdown.xml
index 29e0c0cf..301879cd 100644
--- a/framework/dropdown.xml
+++ b/Libs/DF/dropdown.xml
@@ -1,7 +1,7 @@
-
+
@@ -93,7 +93,7 @@
- DetailsDropDownOptionsFrameOnHide (self);
+ DetailsFrameworkDropDownOptionsFrameOnHide (self);
self:SetBackdropColor (0, 0, 0, 0.95);
@@ -119,8 +119,8 @@
-
-
+
+
@@ -160,33 +160,33 @@
- DetailsDropDownOnShow (self);
+ DetailsFrameworkDropDownOnShow (self);
- DetailsDropDownOnHide (self);
+ DetailsFrameworkDropDownOnHide (self);
- DetailsDropDownOnEnter (self);
+ DetailsFrameworkDropDownOnEnter (self);
- DetailsDropDownOnLeave (self);
+ DetailsFrameworkDropDownOnLeave (self);
- DetailsDropDownOnSizeChanged (self);
+ DetailsFrameworkDropDownOnSizeChanged (self);
- DetailsDropDownOnMouseDown (self);
+ DetailsFrameworkDropDownOnMouseDown (self);
-
+
@@ -222,15 +222,15 @@
- DetailsDropDownOptionClick (self);
+ DetailsFrameworkDropDownOptionClick (self);
- DetailsDropDownOptionOnEnter (self);
+ DetailsFrameworkDropDownOptionOnEnter (self);
- DetailsDropDownOptionOnLeave (self);
+ DetailsFrameworkDropDownOptionOnLeave (self);
diff --git a/Libs/DF/feedback_sites.tga b/Libs/DF/feedback_sites.tga
new file mode 100644
index 00000000..cad38ed4
Binary files /dev/null and b/Libs/DF/feedback_sites.tga differ
diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua
new file mode 100644
index 00000000..9552a3b4
--- /dev/null
+++ b/Libs/DF/fw.lua
@@ -0,0 +1,998 @@
+
+local major, minor = "DetailsFramework-1.0", 8
+local DF, oldminor = LibStub:NewLibrary (major, minor)
+
+if (not DF) then
+ DetailsFrameworkCanLoad = false
+ return
+end
+
+DetailsFrameworkCanLoad = true
+
+local _type = type
+local _unpack = unpack
+local _
+local upper = string.upper
+
+DF.LabelNameCounter = 1
+DF.PictureNameCounter = 1
+DF.BarNameCounter = 1
+DF.DropDownCounter = 1
+DF.PanelCounter = 1
+DF.ButtonCounter = 1
+DF.SliderCounter = 1
+DF.SplitBarCounter = 1
+
+LibStub:GetLibrary("AceTimer-3.0"):Embed (DF)
+
+do
+ local path = string.match (debugstack (1, 1, 0), "AddOns\\(.+)fw.lua")
+ if (path) then
+ DF.folder = "Interface\\AddOns\\" .. path
+ else
+ DF.folder = ""
+ end
+end
+
+DF.debug = false
+
+_G ["DetailsFramework"] = DF
+
+DF.embeds = DF.embeds or {}
+local embed_functions = {
+ "RemoveRealName",
+ "table",
+ "BuildDropDownFontList",
+ "SetFontSize",
+ "SetFontFace",
+ "SetFontColor",
+ "GetFontSize",
+ "GetFontFace",
+ "SetFontOutline",
+ "trim",
+ "Msg",
+ "CreateFlashAnimation",
+ "Fade",
+ "NewColor",
+ "IsHtmlColor",
+ "ParseColors",
+ "BuildMenu",
+ "ShowTutorialAlertFrame",
+ "GetNpcIdFromGuid",
+ "ShowFeedbackPanel",
+ "SetAsOptionsPanel",
+
+ "CreateDropDown",
+ "CreateButton",
+ "CreateColorPickButton",
+ "CreateLabel",
+ "CreateBar",
+ "CreatePanel",
+ "CreateFillPanel",
+ "ColorPick",
+ "IconPick",
+ "CreateSimplePanel",
+ "CreateChartPanel",
+ "CreateImage",
+ "CreateScrollBar",
+ "CreateSwitch",
+ "CreateSlider",
+ "CreateSplitBar",
+ "CreateTextEntry",
+ "Create1PxPanel",
+ "CreateFeedbackButton",
+ "CreateOptionsFrame",
+ "NewSpecialLuaEditorEntry",
+ "ShowPromptPanel",
+ "ShowTextPromptPanel",
+ "www_icons",
+ "GetTemplate",
+ "GetFrameworkFolder",
+}
+
+DF.table = {}
+
+function DF:GetFrameworkFolder()
+ return DF.folder
+end
+
+function DF.table.reverse (t)
+ local new = {}
+ local index = 1
+ for i = #t, 1, -1 do
+ new [index] = t[i]
+ index = index + 1
+ end
+ return new
+end
+
+--> copy from table2 to table1 overwriting values
+function DF.table.copy (t1, t2)
+ for key, value in pairs (t2) do
+ if (type (value) == "table") then
+ t1 [key] = t1 [key] or {}
+ DF.table.copy (t1 [key], t2 [key])
+ else
+ t1 [key] = value
+ end
+ end
+ return t1
+end
+
+--> copy values that does exist on table2 but not on table1
+function DF.table.deploy (t1, t2)
+ for key, value in pairs (t2) do
+ if (type (value) == "table") then
+ t1 [key] = t1 [key] or {}
+ DF.table.deploy (t1 [key], t2 [key])
+ elseif (t1 [key] == nil) then
+ t1 [key] = value
+ end
+ end
+end
+
+function DF.table.dump (t, s, deep)
+ s = s or ""
+ deep = deep or 0
+ local space = ""
+ for i = 1, deep do
+ space = space .. " "
+ end
+ for key, value in pairs (t) do
+ local tpe = _type (value)
+ if (type (key) ~= "string") then
+ key = "unknown?"
+ end
+ if (tpe == "table") then
+ s = s .. space .. "[" .. key .. "] = |cFFa9ffa9table {|r\n"
+ s = s .. DF.table.dump (value, nil, deep+1)
+ s = s .. space .. "|cFFa9ffa9}|r\n"
+ elseif (tpe == "string") then
+ s = s .. space .. "[" .. key .. "] = '|cFFfff1c1" .. value .. "|r'\n"
+ elseif (tpe == "number") then
+ s = s .. space .. "[" .. key .. "] = |cFFffc1f4" .. value .. "|r\n"
+ elseif (tpe == "function") then
+ s = s .. space .. "[" .. key .. "] = function()\n"
+ elseif (tpe == "boolean") then
+ s = s .. space .. "[" .. key .. "] = |cFF99d0ff" .. (value and "true" or "false") .. "|r\n"
+ end
+ end
+ return s
+end
+
+DF.www_icons = {
+ texture = "feedback_sites",
+ wowi = {0, 0.7890625, 0, 37/128},
+ curse = {0, 0.7890625, 38/123, 79/128},
+ mmoc = {0, 0.7890625, 80/123, 123/128},
+}
+
+function DF:Embed (target)
+ for k, v in pairs (embed_functions) do
+ target[v] = self[v]
+ end
+ self.embeds [target] = true
+ return target
+end
+
+function DF:RemoveRealName (name)
+ return name:gsub (("%-.*"), "")
+end
+
+function DF:SetFontSize (fontString, ...)
+ local fonte, _, flags = fontString:GetFont()
+ fontString:SetFont (fonte, max (...), flags)
+end
+function DF:SetFontFace (fontString, fontface)
+ local _, size, flags = fontString:GetFont()
+ fontString:SetFont (fontface, size, flags)
+end
+function DF:SetFontColor (fontString, r, g, b, a)
+ r, g, b, a = DF:ParseColors (r, g, b, a)
+ fontString:SetTextColor (r, g, b, a)
+end
+
+function DF:GetFontSize (fontString)
+ local _, size = fontString:GetFont()
+ return size
+end
+function DF:GetFontFace (fontString)
+ local fontface = fontString:GetFont()
+ return fontface
+end
+
+function DF:SetFontOutline (fontString, outline)
+ local fonte, size = fontString:GetFont()
+ if (outline) then
+ if (_type (outline) == "boolean" and outline) then
+ outline = "OUTLINE"
+ elseif (outline == 1) then
+ outline = "OUTLINE"
+ elseif (outline == 2) then
+ outline = "THICKOUTLINE"
+ end
+ end
+
+ fontString:SetFont (fonte, size, outline)
+end
+
+function DF:trim (s)
+ local from = s:match"^%s*()"
+ return from > #s and "" or s:match(".*%S", from)
+end
+
+function DF:Msg (msg)
+ print ("|cFFFFFFAA" .. self.__name .. "|r " .. msg)
+end
+
+function DF:GetNpcIdFromGuid (guid)
+ local NpcId = select ( 6, strsplit ( "-", guid ) )
+ if (NpcId) then
+ return tonumber ( NpcId )
+ end
+ return 0
+end
+
+local onFinish = function (self)
+ if (self.showWhenDone) then
+ self.frame:SetAlpha (1)
+ else
+ self.frame:SetAlpha (0)
+ self.frame:Hide()
+ end
+
+ if (self.onFinishFunc) then
+ self:onFinishFunc (self.frame)
+ end
+end
+
+local stop = function (self)
+ local FlashAnimation = self.FlashAnimation
+ FlashAnimation:Stop()
+end
+
+local flash = function (self, fadeInTime, fadeOutTime, flashDuration, showWhenDone, flashInHoldTime, flashOutHoldTime, loopType)
+
+ local FlashAnimation = self.FlashAnimation
+
+ local fadeIn = FlashAnimation.fadeIn
+ local fadeOut = FlashAnimation.fadeOut
+
+ fadeIn:Stop()
+ fadeOut:Stop()
+
+ fadeIn:SetDuration (fadeInTime or 1)
+ fadeIn:SetEndDelay (flashInHoldTime or 0)
+
+ fadeOut:SetDuration (fadeOutTime or 1)
+ fadeOut:SetEndDelay (flashOutHoldTime or 0)
+
+ FlashAnimation.duration = flashDuration
+ FlashAnimation.loopTime = FlashAnimation:GetDuration()
+ FlashAnimation.finishAt = GetTime() + flashDuration
+ FlashAnimation.showWhenDone = showWhenDone
+
+ FlashAnimation:SetLooping (loopType or "REPEAT")
+
+ self:Show()
+ self:SetAlpha (0)
+ FlashAnimation:Play()
+end
+
+function DF:CreateFlashAnimation (frame, onFinishFunc, onLoopFunc)
+ local FlashAnimation = frame:CreateAnimationGroup()
+
+ FlashAnimation.fadeOut = FlashAnimation:CreateAnimation ("Alpha") --> fade out anime
+ FlashAnimation.fadeOut:SetOrder (1)
+ FlashAnimation.fadeOut:SetChange (1)
+
+ FlashAnimation.fadeIn = FlashAnimation:CreateAnimation ("Alpha") --> fade in anime
+ FlashAnimation.fadeIn:SetOrder (2)
+ FlashAnimation.fadeIn:SetChange (-1)
+
+ frame.FlashAnimation = FlashAnimation
+ FlashAnimation.frame = frame
+ FlashAnimation.onFinishFunc = onFinishFunc
+
+ FlashAnimation:SetScript ("OnLoop", onLoopFunc)
+ FlashAnimation:SetScript ("OnFinished", onFinish)
+
+ frame.Flash = flash
+ frame.Stop = stop
+end
+
+-----------------------------------------
+
+local fade_IN_finished_func = function (frame)
+ if (frame.fading_in) then
+ frame.hidden = true
+ frame.faded = true
+ frame.fading_in = false
+ frame:Hide()
+ end
+end
+
+local fade_OUT_finished_func = function (frame)
+ if (frame:IsShown() and frame.fading_out) then
+ frame.hidden = false
+ frame.faded = false
+ frame.fading_out = false
+ else
+ frame:SetAlpha(0)
+ end
+end
+
+local just_fade_func = function (frame)
+ frame.hidden = false
+ frame.faded = true
+ frame.fading_in = false
+end
+
+local anim_OUT_alpha_func = function (frame)
+ frame.fading_out = false
+end
+
+local anim_IN_alpha_func = function (frame)
+ frame.fading_in = false
+end
+
+function DF:Fade (frame, tipo, velocidade, parametros)
+
+ if (_type (frame) == "table") then
+ if (frame.dframework) then
+ frame = frame.widget
+ end
+ end
+
+ velocidade = velocidade or 0.3
+
+ if (upper (tipo) == "IN") then
+
+ if (frame:GetAlpha() == 0 and frame.hidden and not frame.fading_out) then --> ja esta escondida
+ return
+ elseif (frame.fading_in) then --> ja esta com uma animação, se for true
+ return
+ end
+
+ if (frame.fading_out) then --> se tiver uma animação de aparecer em andamento se for true
+ frame.fading_out = false
+ end
+
+ UIFrameFadeIn (frame, velocidade, frame:GetAlpha(), 0)
+ frame.fading_in = true
+
+ frame.fadeInfo.finishedFunc = fade_IN_finished_func
+ frame.fadeInfo.finishedArg1 = frame
+
+ elseif (upper (tipo) == "OUT") then --> aparecer
+ if (frame:GetAlpha() == 1 and not frame.hidden and not frame.fading_in) then --> ja esta na tela
+ return
+ elseif (frame.fading_out) then --> já ta com fading out
+ return
+ end
+
+ if (frame.fading_in) then --> se tiver uma animação de hidar em andamento se for true
+ frame.fading_in = false
+ end
+
+ frame:Show()
+ UIFrameFadeOut (frame, velocidade, frame:GetAlpha(), 1.0)
+ frame.fading_out = true
+
+ frame.fadeInfo.finishedFunc = fade_OUT_finished_func
+ frame.fadeInfo.finishedArg1 = frame
+
+ elseif (tipo == 0) then --> força o frame a ser mostrado
+ frame.hidden = false
+ frame.faded = false
+ frame.fading_out = false
+ frame.fading_in = false
+ frame:Show()
+ frame:SetAlpha (1)
+
+ elseif (tipo == 1) then --> força o frame a ser hidado
+ frame.hidden = true
+ frame.faded = true
+ frame.fading_out = false
+ frame.fading_in = false
+ frame:SetAlpha (0)
+ frame:Hide()
+
+ elseif (tipo == -1) then --> apenas da fade sem hidar
+ if (frame:GetAlpha() == 0 and frame.hidden and not frame.fading_out) then --> ja esta escondida
+ return
+ elseif (frame.fading_in) then --> ja esta com uma animação, se for true
+ return
+ end
+
+ if (frame.fading_out) then --> se tiver uma animação de aparecer em andamento se for true
+ frame.fading_out = false
+ end
+
+ UIFrameFadeIn (frame, velocidade, frame:GetAlpha(), 0)
+ frame.fading_in = true
+ frame.fadeInfo.finishedFunc = just_fade_func
+ frame.fadeInfo.finishedArg1 = frame
+
+ elseif (upper (tipo) == "ALPHAANIM") then
+
+ local value = velocidade
+ local currentApha = frame:GetAlpha()
+ frame:Show()
+
+ if (currentApha < value) then
+ if (frame.fading_in) then --> se tiver uma animação de hidar em andamento se for true
+ frame.fading_in = false
+ frame.fadeInfo.finishedFunc = nil
+ end
+ UIFrameFadeOut (frame, 0.3, currentApha, value)
+ frame.fading_out = true
+
+ frame.fadeInfo.finishedFunc = anim_OUT_alpha_func
+ frame.fadeInfo.finishedArg1 = frame
+
+ else
+ if (frame.fading_out) then --> se tiver uma animação de hidar em andamento se for true
+ frame.fading_out = false
+ frame.fadeInfo.finishedFunc = nil
+ end
+ UIFrameFadeIn (frame, 0.3, currentApha, value)
+ frame.fading_in = true
+
+ frame.fadeInfo.finishedFunc = anim_IN_alpha_func
+ frame.fadeInfo.finishedArg1 = frame
+ end
+
+ elseif (upper (tipo) == "ALPHA") then --> setando um alpha determinado
+ if (frame.fading_in or frame.fading_out) then
+ frame.fadeInfo.finishedFunc = nil
+ UIFrameFadeIn (frame, velocidade, frame:GetAlpha(), frame:GetAlpha())
+ end
+ frame.hidden = false
+ frame.faded = false
+ frame.fading_in = false
+ frame.fading_out = false
+ frame:Show()
+ frame:SetAlpha (velocidade)
+ end
+end
+
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+--> points
+
+ function DF:CheckPoints (v1, v2, v3, v4, v5, object)
+
+ if (not v1 and not v2) then
+ return "topleft", object.widget:GetParent(), "topleft", 0, 0
+ end
+
+ if (_type (v1) == "string") then
+ local frameGlobal = _G [v1]
+ if (frameGlobal and frameGlobal.GetObjectType) then
+ return DF:CheckPoints (frameGlobal, v2, v3, v4, v5, object)
+ end
+
+ elseif (_type (v2) == "string") then
+ local frameGlobal = _G [v2]
+ if (frameGlobal and frameGlobal.GetObjectType) then
+ return DF:CheckPoints (v1, frameGlobal, v3, v4, v5, object)
+ end
+ end
+
+ if (_type (v1) == "string" and _type (v2) == "table") then --> :setpoint ("left", frame, _, _, _)
+ if (not v3 or _type (v3) == "number") then --> :setpoint ("left", frame, 10, 10)
+ v1, v2, v3, v4, v5 = v1, v2, v1, v3, v4
+ end
+
+ elseif (_type (v1) == "string" and _type (v2) == "number") then --> :setpoint ("topleft", x, y)
+ v1, v2, v3, v4, v5 = v1, object.widget:GetParent(), v1, v2, v3
+
+ elseif (_type (v1) == "number") then --> :setpoint (x, y)
+ v1, v2, v3, v4, v5 = "topleft", object.widget:GetParent(), "topleft", v1, v2
+
+ elseif (_type (v1) == "table") then --> :setpoint (frame, x, y)
+ v1, v2, v3, v4, v5 = "topleft", v1, "topleft", v2, v3
+
+ end
+
+ if (not v2) then
+ v2 = object.widget:GetParent()
+ elseif (v2.dframework) then
+ v2 = v2.widget
+ end
+
+ return v1 or "topleft", v2, v3 or "topleft", v4 or 0, v5 or 0
+ end
+
+
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+--> colors
+
+ function DF:NewColor (_colorname, _colortable, _green, _blue, _alpha)
+ assert (_type (_colorname) == "string", "NewColor: colorname must be a string.")
+ assert (not DF.alias_text_colors [_colorname], "NewColor: colorname already exists.")
+
+ if (_type (_colortable) == "table") then
+ if (_colortable[1] and _colortable[2] and _colortable[3]) then
+ _colortable[4] = _colortable[4] or 1
+ DF.alias_text_colors [_colorname] = _colortable
+ else
+ error ("invalid color table.")
+ end
+ elseif (_colortable and _green and _blue) then
+ _alpha = _alpha or 1
+ DF.alias_text_colors [_colorname] = {_colortable, _green, _blue, _alpha}
+ else
+ error ("invalid parameter.")
+ end
+
+ return true
+ end
+
+ function DF:IsHtmlColor (color)
+ return DF.alias_text_colors [color]
+ end
+
+ local tn = tonumber
+ function DF:ParseColors (_arg1, _arg2, _arg3, _arg4)
+ if (_type (_arg1) == "table") then
+ _arg1, _arg2, _arg3, _arg4 = _unpack (_arg1)
+
+ elseif (_type (_arg1) == "string") then
+
+ if (string.find (_arg1, "#")) then
+ _arg1 = _arg1:gsub ("#","")
+ if (string.len (_arg1) == 8) then --alpha
+ _arg1, _arg2, _arg3, _arg4 = tn ("0x" .. _arg1:sub (3, 4))/255, tn ("0x" .. _arg1:sub (5, 6))/255, tn ("0x" .. _arg1:sub (7, 8))/255, tn ("0x" .. _arg1:sub (1, 2))/255
+ else
+ _arg1, _arg2, _arg3, _arg4 = tn ("0x" .. _arg1:sub (1, 2))/255, tn ("0x" .. _arg1:sub (3, 4))/255, tn ("0x" .. _arg1:sub (5, 6))/255, 1
+ end
+
+ else
+ local color = DF.alias_text_colors [_arg1]
+ if (color) then
+ _arg1, _arg2, _arg3, _arg4 = _unpack (color)
+ else
+ _arg1, _arg2, _arg3, _arg4 = _unpack (DF.alias_text_colors.none)
+ end
+ end
+ end
+
+ if (not _arg1) then
+ _arg1 = 1
+ end
+ if (not _arg2) then
+ _arg2 = 1
+ end
+ if (not _arg3) then
+ _arg3 = 1
+ end
+ if (not _arg4) then
+ _arg4 = 1
+ end
+
+ return _arg1, _arg2, _arg3, _arg4
+ end
+
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+--> menus
+
+ function DF:BuildMenu (parent, menu, x_offset, y_offset, height, use_two_points, text_template, dropdown_template, switch_template, switch_is_box, slider_template, button_template)
+
+ if (not parent.widget_list) then
+ DF:SetAsOptionsPanel (parent)
+ end
+
+ local cur_x = x_offset
+ local cur_y = y_offset
+ local max_x = 0
+
+ height = abs ((height or parent:GetHeight()) - abs (y_offset) + 20)
+ height = height*-1
+
+ for index, widget_table in ipairs (menu) do
+
+ if (widget_table.type == "blank" or widget_table.type == "space") then
+ -- do nothing
+
+ elseif (widget_table.type == "label" or widget_table.type == "text") then
+ local label = DF:CreateLabel (parent, widget_table.get() or widget_table.text, widget_table.text_template or widget_table.size, widget_table.color, widget_table.font, nil, "$parentWidget" .. index, "overlay")
+ label._get = widget_table.get
+ label.widget_type = "label"
+ label:SetPoint (cur_x, cur_y)
+ tinsert (parent.widget_list, label)
+
+ elseif (widget_table.type == "select" or widget_table.type == "dropdown") then
+ local dropdown = DF:NewDropDown (parent, nil, "$parentWidget" .. index, nil, 140, 18, widget_table.values, widget_table.get(), dropdown_template)
+ dropdown.tooltip = widget_table.desc
+ dropdown._get = widget_table.get
+ dropdown.widget_type = "select"
+ local label = DF:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name .. (use_two_points and ": " or ""), "GameFontNormal", widget_table.text_template or text_template or 12)
+ dropdown:SetPoint ("left", label, "right", 2)
+ label:SetPoint (cur_x, cur_y)
+
+ local size = label.widget:GetStringWidth() + 140 + 4
+ if (size > max_x) then
+ max_x = size
+ end
+
+ tinsert (parent.widget_list, dropdown)
+
+ elseif (widget_table.type == "toggle" or widget_table.type == "switch") then
+ local switch = DF:NewSwitch (parent, nil, "$parentWidget" .. index, nil, 60, 20, nil, nil, widget_table.get(), nil, nil, nil, nil, switch_template)
+ switch.tooltip = widget_table.desc
+ switch._get = widget_table.get
+ switch.widget_type = "toggle"
+ switch.OnSwitch = widget_table.set
+
+ if (switch_is_box) then
+ switch:SetAsCheckBox()
+ end
+
+ local label = DF:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name .. (use_two_points and ": " or ""), "GameFontNormal", widget_table.text_template or text_template or 12)
+ switch:SetPoint ("left", label, "right", 2)
+ label:SetPoint (cur_x, cur_y)
+
+ local size = label.widget:GetStringWidth() + 60 + 4
+ if (size > max_x) then
+ max_x = size
+ end
+
+ tinsert (parent.widget_list, switch)
+
+ elseif (widget_table.type == "range" or widget_table.type == "slider") then
+ local is_decimanls = widget_table.usedecimals
+ local slider = DF:NewSlider (parent, nil, "$parentWidget" .. index, nil, 140, 20, widget_table.min, widget_table.max, widget_table.step, widget_table.get(), is_decimanls, nil, nil, slider_template)
+ slider.tooltip = widget_table.desc
+ slider._get = widget_table.get
+ slider.widget_type = "range"
+ slider:SetHook ("OnValueChange", widget_table.set)
+
+ local label = DF:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name .. (use_two_points and ": " or ""), "GameFontNormal", widget_table.text_template or text_template or 12)
+ slider:SetPoint ("left", label, "right", 2)
+ label:SetPoint (cur_x, cur_y)
+
+ local size = label.widget:GetStringWidth() + 140 + 6
+ if (size > max_x) then
+ max_x = size
+ end
+
+ tinsert (parent.widget_list, slider)
+
+ elseif (widget_table.type == "color" or widget_table.type == "color") then
+ local colorpick = DF:NewColorPickButton (parent, "$parentWidget" .. index, nil, widget_table.set, nil, button_template)
+ colorpick.tooltip = widget_table.desc
+ colorpick._get = widget_table.get
+ colorpick.widget_type = "color"
+
+ local default_value, g, b, a = widget_table.get()
+ if (type (default_value) == "table") then
+ colorpick:SetColor (unpack (default_value))
+ else
+ colorpick:SetColor (default_value, g, b, a)
+ end
+
+ local label = DF:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name .. (use_two_points and ": " or ""), "GameFontNormal", widget_table.text_template or text_template or 12)
+ colorpick:SetPoint ("left", label, "right", 2)
+ label:SetPoint (cur_x, cur_y)
+
+ local size = label.widget:GetStringWidth() + 60 + 4
+ if (size > max_x) then
+ max_x = size
+ end
+
+ tinsert (parent.widget_list, colorpick)
+
+ elseif (widget_table.type == "execute" or widget_table.type == "button") then
+
+ local button = DF:NewButton (parent, nil, "$parentWidget" .. index, nil, 120, 18, widget_table.func, widget_table.param1, widget_table.param2, nil, widget_table.name, nil, button_template)
+ if (not button_template) then
+ button:InstallCustomTexture()
+ end
+
+ button:SetPoint (cur_x, cur_y)
+ button.tooltip = widget_table.desc
+ button.widget_type = "execute"
+
+ local size = button:GetWidth() + 4
+ if (size > max_x) then
+ max_x = size
+ end
+
+ tinsert (parent.widget_list, button)
+
+ end
+
+ 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 = cur_x + max_x + 30
+
+ max_x = 0
+ end
+
+ end
+
+ end
+
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+--> tutorials
+
+ function DF:ShowTutorialAlertFrame (maintext, desctext, clickfunc)
+
+ local TutorialAlertFrame = _G.DetailsFrameworkTutorialAlertFrame
+
+ if (not TutorialAlertFrame) then
+
+ TutorialAlertFrame = CreateFrame ("ScrollFrame", "DetailsFrameworkTutorialAlertFrame", UIParent, "DetailsFrameworkTutorialAlertFrameTemplate")
+ TutorialAlertFrame.isFirst = true
+ TutorialAlertFrame:SetPoint ("left", UIParent, "left", -20, 100)
+
+ TutorialAlertFrame:SetWidth (290)
+ TutorialAlertFrame.ScrollChild:SetWidth (256)
+
+ local scrollname = TutorialAlertFrame.ScrollChild:GetName()
+ _G [scrollname .. "BorderTopLeft"]:SetVertexColor (1, 0.8, 0, 1)
+ _G [scrollname .. "BorderTopRight"]:SetVertexColor (1, 0.8, 0, 1)
+ _G [scrollname .. "BorderBotLeft"]:SetVertexColor (1, 0.8, 0, 1)
+ _G [scrollname .. "BorderBotRight"]:SetVertexColor (1, 0.8, 0, 1)
+ _G [scrollname .. "BorderLeft"]:SetVertexColor (1, 0.8, 0, 1)
+ _G [scrollname .. "BorderRight"]:SetVertexColor (1, 0.8, 0, 1)
+ _G [scrollname .. "BorderBottom"]:SetVertexColor (1, 0.8, 0, 1)
+ _G [scrollname .. "BorderTop"]:SetVertexColor (1, 0.8, 0, 1)
+
+ local iconbg = _G [scrollname .. "QuestIconBg"]
+ iconbg:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]])
+ iconbg:SetTexCoord (0, 1, 0, 1)
+ iconbg:SetSize (100, 100)
+ iconbg:ClearAllPoints()
+ iconbg:SetPoint ("bottomleft", TutorialAlertFrame.ScrollChild, "bottomleft")
+
+ _G [scrollname .. "Exclamation"]:SetVertexColor (1, 0.8, 0, 1)
+ _G [scrollname .. "QuestionMark"]:SetVertexColor (1, 0.8, 0, 1)
+
+ _G [scrollname .. "TopText"]:SetText ("Details!") --string
+ _G [scrollname .. "QuestName"]:SetText ("") --string
+ _G [scrollname .. "BottomText"]:SetText ("") --string
+
+ TutorialAlertFrame.ScrollChild.IconShine:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]])
+
+ TutorialAlertFrame:SetScript ("OnMouseUp", function (self)
+ if (self.clickfunc and type (self.clickfunc) == "function") then
+ self.clickfunc()
+ end
+ self:Hide()
+ end)
+ TutorialAlertFrame:Hide()
+ end
+
+ if (type (maintext) == "string") then
+ TutorialAlertFrame.ScrollChild.QuestName:SetText (maintext)
+ else
+ TutorialAlertFrame.ScrollChild.QuestName:SetText ("")
+ end
+
+ if (type (desctext) == "string") then
+ TutorialAlertFrame.ScrollChild.BottomText:SetText (desctext)
+ else
+ TutorialAlertFrame.ScrollChild.BottomText:SetText ("")
+ end
+
+ TutorialAlertFrame.clickfunc = clickfunc
+ TutorialAlertFrame:Show()
+ DetailsTutorialAlertFrame_SlideInFrame (TutorialAlertFrame, "AUTOQUEST")
+ end
+
+ local refresh_options = function (self)
+ for _, widget in ipairs (self.widget_list) do
+ if (widget._get) then
+ if (widget.widget_type == "label") then
+ if (widget._get()) then
+ widget:SetText (widget._get())
+ end
+ elseif (widget.widget_type == "select") then
+ widget:Select (widget._get())
+ elseif (widget.widget_type == "toggle" or widget.widget_type == "range") then
+ widget:SetValue (widget._get())
+ elseif (widget.widget_type == "color") then
+ local default_value, g, b, a = widget._get()
+ if (type (default_value) == "table") then
+ widget:SetColor (unpack (default_value))
+ else
+ widget:SetColor (default_value, g, b, a)
+ end
+ end
+ end
+ end
+ end
+
+ function DF:SetAsOptionsPanel (frame)
+ frame.RefreshOptions = refresh_options
+ frame.widget_list = {}
+ end
+
+ function DF:CreateOptionsFrame (name, title, template)
+
+ template = template or 1
+
+ if (template == 2) then
+ local options_frame = CreateFrame ("frame", name, UIParent, "ButtonFrameTemplate")
+ tinsert (UISpecialFrames, name)
+ options_frame:SetSize (500, 200)
+ options_frame.RefreshOptions = refresh_options
+ options_frame.widget_list = {}
+
+ options_frame:SetScript ("OnMouseDown", function(self, button)
+ if (button == "RightButton") then
+ if (self.moving) then
+ self.moving = false
+ self:StopMovingOrSizing()
+ end
+ return options_frame:Hide()
+ elseif (button == "LeftButton" and not self.moving) then
+ self.moving = true
+ self:StartMoving()
+ end
+ end)
+ options_frame:SetScript ("OnMouseUp", function(self)
+ if (self.moving) then
+ self.moving = false
+ self:StopMovingOrSizing()
+ end
+ end)
+
+ options_frame:SetMovable (true)
+ options_frame:EnableMouse (true)
+ options_frame:SetFrameStrata ("DIALOG")
+ options_frame:SetToplevel (true)
+
+ options_frame:Hide()
+
+ options_frame:SetPoint ("center", UIParent, "center")
+ options_frame.TitleText:SetText (title)
+ options_frame.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-BLOODELF]])
+
+ return options_frame
+
+ elseif (template == 1) then
+
+ local options_frame = CreateFrame ("frame", name, UIParent)
+ tinsert (UISpecialFrames, name)
+ options_frame:SetSize (500, 200)
+ options_frame.RefreshOptions = refresh_options
+ options_frame.widget_list = {}
+
+ options_frame:SetScript ("OnMouseDown", function(self, button)
+ if (button == "RightButton") then
+ if (self.moving) then
+ self.moving = false
+ self:StopMovingOrSizing()
+ end
+ return options_frame:Hide()
+ elseif (button == "LeftButton" and not self.moving) then
+ self.moving = true
+ self:StartMoving()
+ end
+ end)
+ options_frame:SetScript ("OnMouseUp", function(self)
+ if (self.moving) then
+ self.moving = false
+ self:StopMovingOrSizing()
+ end
+ end)
+
+ options_frame:SetMovable (true)
+ options_frame:EnableMouse (true)
+ options_frame:SetFrameStrata ("DIALOG")
+ options_frame:SetToplevel (true)
+
+ options_frame:Hide()
+
+ options_frame:SetPoint ("center", UIParent, "center")
+
+ options_frame:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
+ edgeFile = DF.folder .. "border_2", edgeSize = 32,
+ insets = {left = 1, right = 1, top = 1, bottom = 1}})
+ options_frame:SetBackdropColor (0, 0, 0, .7)
+
+ local texturetitle = options_frame:CreateTexture (nil, "artwork")
+ texturetitle:SetTexture ([[Interface\CURSOR\Interact]])
+ texturetitle:SetTexCoord (0, 1, 0, 1)
+ texturetitle:SetVertexColor (1, 1, 1, 1)
+ texturetitle:SetPoint ("topleft", options_frame, "topleft", 2, -3)
+ texturetitle:SetWidth (36)
+ texturetitle:SetHeight (36)
+
+ local title = DF:NewLabel (options_frame, nil, "$parentTitle", nil, title, nil, 20, "yellow")
+ title:SetPoint ("left", texturetitle, "right", 2, -1)
+ DF:SetFontOutline (title, true)
+
+ local c = CreateFrame ("Button", nil, options_frame, "UIPanelCloseButton")
+ c:SetWidth (32)
+ c:SetHeight (32)
+ c:SetPoint ("TOPRIGHT", options_frame, "TOPRIGHT", -3, -3)
+ c:SetFrameLevel (options_frame:GetFrameLevel()+1)
+
+ return options_frame
+ end
+ end
+
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+--> templates
+
+DF.font_templates = {}
+DF.font_templates ["ORANGE_FONT_TEMPLATE"] = {color = "orange", size = 11, font = "Accidental Presidency"}
+DF.font_templates ["OPTIONS_FONT_TEMPLATE"] = {color = "yellow", size = 12, font = "Accidental Presidency"}
+
+DF.dropdown_templates = {}
+DF.dropdown_templates ["OPTIONS_DROPDOWN_TEMPLATE"] = {
+ backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
+ backdropcolor = {1, 1, 1, .5},
+ backdropbordercolor = {0, 0, 0, 1},
+ onentercolor = {1, 1, 1, .5},
+ onenterbordercolor = {1, 1, 1, 1},
+}
+
+DF.switch_templates = {}
+DF.switch_templates ["OPTIONS_CHECKBOX_TEMPLATE"] = {
+ backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
+ backdropcolor = {1, 1, 1, .5},
+ backdropbordercolor = {0, 0, 0, 1},
+ width = 18,
+ height = 18,
+ enabled_backdropcolor = {1, 1, 1, .5},
+ disabled_backdropcolor = {1, 1, 1, .2},
+ onenterbordercolor = {1, 1, 1, 1},
+}
+DF.switch_templates ["OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"] = {
+ backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
+ backdropcolor = {1, 1, 1, .5},
+ backdropbordercolor = {0, 0, 0, 1},
+ width = 18,
+ height = 18,
+ enabled_backdropcolor = {1, 1, 1, .5},
+ disabled_backdropcolor = {1, 1, 1, .5},
+ onenterbordercolor = {1, 1, 1, 1},
+}
+
+DF.button_templates = {}
+DF.button_templates ["OPTIONS_BUTTON_TEMPLATE"] = {
+ backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
+ backdropcolor = {1, 1, 1, .5},
+ backdropbordercolor = {0, 0, 0, 1},
+}
+
+DF.slider_templates = {}
+DF.slider_templates ["OPTIONS_SLIDER_TEMPLATE"] = {
+ backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
+ backdropcolor = {1, 1, 1, .5},
+ backdropbordercolor = {0, 0, 0, 1},
+ onentercolor = {1, 1, 1, .5},
+ onenterbordercolor = {1, 1, 1, 1},
+ thumbtexture = [[Interface\Tooltips\UI-Tooltip-Background]],
+ thumbwidth = 16,
+ thumbheight = 14,
+ thumbcolor = {0, 0, 0, 0.5},
+}
+
+function DF:GetTemplate (type, template_name)
+ local template_table
+ if (type == "font") then
+ template_table = DF.font_templates
+ elseif (type == "dropdown") then
+ template_table = DF.dropdown_templates
+ elseif (type == "button") then
+ template_table = DF.button_templates
+ elseif (type == "switch") then
+ template_table = DF.switch_templates
+ elseif (type == "slider") then
+ template_table = DF.slider_templates
+ end
+ return template_table [template_name]
+end
+
diff --git a/framework/help.lua b/Libs/DF/help.lua
similarity index 84%
rename from framework/help.lua
rename to Libs/DF/help.lua
index 904e0bbf..fd71db35 100644
--- a/framework/help.lua
+++ b/Libs/DF/help.lua
@@ -1,8 +1,14 @@
-local _detalhes = _G._detalhes
-local gump = _detalhes.gump
+
+
+local DF = _G ["DetailsFramework"]
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
local _
local _rawset = rawset --> lua local
local _rawget = rawget --> lua local
+
local APIHelpFunctions = false
local HelpMetaFunctions = {}
@@ -44,7 +50,7 @@ function HelpMetaFunctions:AddHelp (width, height, x, y, buttonX, buttonY, text,
end
function HelpMetaFunctions:SetPoint (v1, v2, v3, v4, v5)
- v1, v2, v3, v4, v5 = gump:CheckPoints (v1, v2, v3, v4, v5, self)
+ v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self)
if (not v1) then
print ("Invalid parameter for SetPoint")
return
@@ -61,7 +67,7 @@ function HelpMetaFunctions:ShowHelp()
end
local nameCounter = 1
-function _detalhes.gump:NewHelp (parent, width, height, x, y, buttonWidth, buttonHeight, name)
+function DF:NewHelp (parent, width, height, x, y, buttonWidth, buttonHeight, name)
local help = {}
@@ -69,7 +75,7 @@ function _detalhes.gump:NewHelp (parent, width, height, x, y, buttonWidth, butto
parent = parent.widget
end
- local helpButton = CreateFrame ("button", name or "DetailsHelpButton"..nameCounter, parent, "MainHelpPlateButton")
+ local helpButton = CreateFrame ("button", name or "DetailsFrameworkHelpButton"..nameCounter, parent, "MainHelpPlateButton")
nameCounter = nameCounter + 1
if (not APIHelpFunctions) then
diff --git a/Libs/DF/icons.tga b/Libs/DF/icons.tga
new file mode 100644
index 00000000..4b34cb57
Binary files /dev/null and b/Libs/DF/icons.tga differ
diff --git a/framework/label.lua b/Libs/DF/label.lua
similarity index 78%
rename from framework/label.lua
rename to Libs/DF/label.lua
index 8da69613..c4ccbc6c 100644
--- a/framework/label.lua
+++ b/Libs/DF/label.lua
@@ -1,6 +1,9 @@
---> details main objects
-local _detalhes = _G._detalhes
-local gump = _detalhes.gump
+
+local DF = _G ["DetailsFramework"]
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
local _
local _rawset = rawset --> lua local
local _rawget = rawget --> lua local
@@ -108,16 +111,16 @@ local LabelMetaFunctions = {}
end
--> text color
local smember_textcolor = function (_object, _value)
- local _value1, _value2, _value3, _value4 = gump:ParseColors (_value)
+ local _value1, _value2, _value3, _value4 = DF:ParseColors (_value)
return _object.label:SetTextColor (_value1, _value2, _value3, _value4)
end
--> text font
local smember_textfont = function (_object, _value)
- return _detalhes:SetFontFace (_object.label, _value)
+ return DF:SetFontFace (_object.label, _value)
end
--> text size
local smember_textsize = function (_object, _value)
- return _detalhes:SetFontSize (_object.label, _value)
+ return DF:SetFontSize (_object.label, _value)
end
--> text align
local smember_textalign = function (_object, _value)
@@ -151,7 +154,7 @@ local LabelMetaFunctions = {}
end
--> outline (shadow)
local smember_outline = function (_object, _value)
- _detalhes:SetFontOutline (_object.label, _value)
+ DF:SetFontOutline (_object.label, _value)
end
local set_members_function_index = {
@@ -201,13 +204,13 @@ local LabelMetaFunctions = {}
if (arg2) then
return self.label:SetTextColor (color, arg2, arg3, arg4 or 1)
end
- local _value1, _value2, _value3, _value4 = gump:ParseColors (color)
+ local _value1, _value2, _value3, _value4 = DF:ParseColors (color)
return self.label:SetTextColor (_value1, _value2, _value3, _value4)
end
-- setpoint
function LabelMetaFunctions:SetPoint (v1, v2, v3, v4, v5)
- v1, v2, v3, v4, v5 = gump:CheckPoints (v1, v2, v3, v4, v5, self)
+ v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self)
if (not v1) then
print ("Invalid parameter for SetPoint")
return
@@ -215,13 +218,30 @@ local LabelMetaFunctions = {}
return self.widget:SetPoint (v1, v2, v3, v4, v5)
end
+------------------------------------------------------------------------------------------------------------
+
+ function LabelMetaFunctions:SetTemplate (template)
+ if (template.size) then
+ DF:SetFontSize (self.label, template.size)
+ end
+ if (template.color) then
+ local r, g, b, a = DF:ParseColors (template.color)
+ self:SetTextColor (r, g, b, a)
+ end
+ if (template.font) then
+ local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
+ local font = SharedMedia:Fetch ("font", template.font)
+ DF:SetFontFace (self.label, font)
+ end
+ end
+
------------------------------------------------------------------------------------------------------------
--> object constructor
-function gump:CreateLabel (parent, text, size, color, font, member, name, layer)
- return gump:NewLabel (parent, nil, name, member, text, font, size, color, layer)
+function DF:CreateLabel (parent, text, size, color, font, member, name, layer)
+ return DF:NewLabel (parent, nil, name, member, text, font, size, color, layer)
end
-function gump:NewLabel (parent, container, name, member, text, font, size, color, layer)
+function DF:NewLabel (parent, container, name, member, text, font, size, color, layer)
if (not parent) then
return nil
@@ -231,8 +251,8 @@ function gump:NewLabel (parent, container, name, member, text, font, size, color
end
if (not name) then
- name = "DetailsLabelNumber" .. gump.LabelNameCounter
- gump.LabelNameCounter = gump.LabelNameCounter + 1
+ name = "DetailsFrameworkLabelNumber" .. DF.LabelNameCounter
+ DF.LabelNameCounter = DF.LabelNameCounter + 1
end
if (name:find ("$parent")) then
@@ -268,7 +288,7 @@ function gump:NewLabel (parent, container, name, member, text, font, size, color
for funcName, funcAddress in pairs (idx) do
if (not LabelMetaFunctions [funcName]) then
LabelMetaFunctions [funcName] = function (object, ...)
- local x = loadstring ( "return _G."..object.label:GetName()..":"..funcName.."(...)")
+ local x = loadstring ( "return _G['"..object.label:GetName().."']:"..funcName.."(...)")
return x (...)
end
end
@@ -277,18 +297,24 @@ function gump:NewLabel (parent, container, name, member, text, font, size, color
LabelObject.label:SetText (text)
- if (size) then
- _detalhes:SetFontSize (LabelObject.label, size)
+ if (color) then
+ local r, g, b, a = DF:ParseColors (color)
+ LabelObject.label:SetTextColor (r, g, b, a)
+ end
+
+ if (size and type (size) == "number") then
+ DF:SetFontSize (LabelObject.label, size)
end
- if (color) then
- local r, g, b, a = gump:ParseColors (color)
- LabelObject.label:SetTextColor (r, g, b, a)
- end
+
LabelObject.label:SetJustifyH ("LEFT")
setmetatable (LabelObject, LabelMetaFunctions)
+
+ if (size and type (size) == "table") then
+ LabelObject:SetTemplate (size)
+ end
return LabelObject
end
\ No newline at end of file
diff --git a/Libs/DF/load.xml b/Libs/DF/load.xml
new file mode 100644
index 00000000..c89b6575
--- /dev/null
+++ b/Libs/DF/load.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Libs/DF/mail.tga b/Libs/DF/mail.tga
new file mode 100644
index 00000000..817eb66d
Binary files /dev/null and b/Libs/DF/mail.tga differ
diff --git a/Libs/DF/math.lua b/Libs/DF/math.lua
new file mode 100644
index 00000000..6cc7f7fd
--- /dev/null
+++ b/Libs/DF/math.lua
@@ -0,0 +1,18 @@
+
+local DF = _G ["DetailsFramework"]
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
+function DF:UnitDistance (unit1, unit2)
+ if (UnitExists (unit1) and UnitExists (unit2)) then
+ local u1X, u1Y = UnitPosition (unit1)
+ local u2X, u2Y = UnitPosition (unit2)
+
+ local dX = u2X-u1X
+ local dY = u2Y-u1Y
+
+ return sqrt ((dX*dX) + (dY*dY))
+ end
+ return 0
+end
\ No newline at end of file
diff --git a/framework/normal_bar.lua b/Libs/DF/normal_bar.lua
similarity index 82%
rename from framework/normal_bar.lua
rename to Libs/DF/normal_bar.lua
index 6e73436c..4d5605fb 100644
--- a/framework/normal_bar.lua
+++ b/Libs/DF/normal_bar.lua
@@ -1,6 +1,9 @@
---> details main objects
-local _detalhes = _G._detalhes
-local gump = _detalhes.gump
+
+local DF = _G ["DetailsFramework"]
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
local _
local _rawset = rawset --> lua locals
local _rawget = rawget --> lua locals
@@ -189,10 +192,11 @@ local APIBarFunctions
end
--> color
local smember_color = function (_object, _value)
- local _value1, _value2, _value3, _value4 = gump:ParseColors (_value)
+ local _value1, _value2, _value3, _value4 = DF:ParseColors (_value)
_object.statusbar:SetStatusBarColor (_value1, _value2, _value3, _value4)
_object._texture.original_colors = {_value1, _value2, _value3, _value4}
+ _object.timer_texture:SetVertexColor (_value1, _value2, _value3, _value4)
return _object._texture:SetVertexColor (_value1, _value2, _value3, _value4)
end
--> icon
@@ -213,8 +217,10 @@ local APIBarFunctions
if (type (_value) == "table") then
local _value1, _value2 = _unpack (_value)
_object._texture:SetTexture (_value1)
+ _object.timer_texture:SetTexture (_value1)
if (_value2) then
_object._texture:SetTexCoord (_unpack (_value2))
+ _object.timer_texture:SetTexCoord (_unpack (_value2))
end
else
if (_value:find ("\\")) then
@@ -223,8 +229,10 @@ local APIBarFunctions
local file = SharedMedia:Fetch ("statusbar", _value)
if (file) then
_object._texture:SetTexture (file)
+ _object.timer_texture:SetTexture (file)
else
_object._texture:SetTexture (_value)
+ _object.timer_texture:SetTexture (_value)
end
end
end
@@ -232,24 +240,24 @@ local APIBarFunctions
end
--> font face
local smember_textfont = function (_object, _value)
- _detalhes:SetFontFace (_object.textleft, _value)
- return _detalhes:SetFontFace (_object.textright, _value)
+ DF:SetFontFace (_object.textleft, _value)
+ return DF:SetFontFace (_object.textright, _value)
end
--> font size
local smember_textsize = function (_object, _value)
- _detalhes:SetFontSize (_object.textleft, _value)
- return _detalhes:SetFontSize (_object.textright, _value)
+ DF:SetFontSize (_object.textleft, _value)
+ return DF:SetFontSize (_object.textright, _value)
end
--> font color
local smember_textcolor = function (_object, _value)
- local _value1, _value2, _value3, _value4 = gump:ParseColors (_value)
+ local _value1, _value2, _value3, _value4 = DF:ParseColors (_value)
_object.textleft:SetTextColor (_value1, _value2, _value3, _value4)
return _object.textright:SetTextColor (_value1, _value2, _value3, _value4)
end
--> outline (shadow)
local smember_outline = function (_object, _value)
- _detalhes:SetFontOutline (_object.textleft, _value)
- return _detalhes:SetFontOutline (_object.textright, _value)
+ DF:SetFontOutline (_object.textleft, _value)
+ return DF:SetFontOutline (_object.textright, _value)
end
local set_members_function_index = {
@@ -305,7 +313,7 @@ local APIBarFunctions
--> set point
function BarMetaFunctions:SetPoint (v1, v2, v3, v4, v5)
- v1, v2, v3, v4, v5 = gump:CheckPoints (v1, v2, v3, v4, v5, self)
+ v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self)
if (not v1) then
print ("Invalid parameter for SetPoint")
return
@@ -338,7 +346,7 @@ local APIBarFunctions
--> set color
function BarMetaFunctions:SetColor (r, g, b, a)
- r, g, b, a = gump:ParseColors (r, g, b, a)
+ r, g, b, a = DF:ParseColors (r, g, b, a)
self._texture:SetVertexColor (r, g, b, a)
self.statusbar:SetStatusBarColor (r, g, b, a)
@@ -425,31 +433,14 @@ local APIBarFunctions
end
end
- if (not frame.MyObject.timer) then
- local oc = frame.MyObject._texture.original_colors --original colors
- gump:GradientEffect ( frame.MyObject._texture, "texture", oc[1], oc[2], oc[3], oc[4], oc[1]+0.2, oc[2]+0.2, oc[3]+0.2, oc[4], .2)
- frame.MyObject.div:Show()
- frame.MyObject.div:SetPoint ("left", frame, "left", frame:GetValue() * (frame:GetWidth()/100) - 16, 0)
- else
- local oc = frame.MyObject._texture.original_colors --original colors
- gump:GradientEffect ( frame.MyObject._texture, "texture", oc[1], oc[2], oc[3], oc[4], oc[1]-0.2, oc[2]-0.2, oc[3]-0.2, oc[4]+.2, .2)
- end
-
frame.MyObject.background:Show()
if (frame.MyObject.have_tooltip) then
- GameCooltip:Reset()
- GameCooltip:AddLine (frame.MyObject.have_tooltip)
- GameCooltip:ShowCooltip (frame, "tooltip")
+ GameCooltip2:Reset()
+ GameCooltip2:AddLine (frame.MyObject.have_tooltip)
+ GameCooltip2:ShowCooltip (frame, "tooltip")
end
-
- local parent = frame:GetParent().MyObject
- if (parent and parent.type == "panel") then
- if (parent.GradientEnabled) then
- parent:RunGradient()
- end
- end
-
+
end
local OnLeave = function (frame)
@@ -460,28 +451,8 @@ local APIBarFunctions
end
end
- if (not frame.MyObject.timer) then
- local oc = frame.MyObject._texture.original_colors --original colors
- local r, g, b, a = frame.MyObject._texture:GetVertexColor()
- gump:GradientEffect ( frame.MyObject._texture, "texture", r, g, b, a, oc[1], oc[2], oc[3], oc[4], .2)
- frame.MyObject.div:Hide()
-
- --frame.MyObject.background:Hide()
- else
- local oc = frame.MyObject.background.original_colors --original colors
- local r, g, b, a = frame.MyObject.background:GetVertexColor()
- gump:GradientEffect ( frame.MyObject.background, "texture", r, g, b, a, oc[1], oc[2], oc[3], oc[4], .2)
- end
-
if (frame.MyObject.have_tooltip) then
- _detalhes.popup:ShowMe (false)
- end
-
- local parent = frame:GetParent().MyObject
- if (parent and parent.type == "panel") then
- if (parent.GradientEnabled) then
- parent:RunGradient (false)
- end
+ GameCooltip2:ShowMe (false)
end
end
@@ -575,6 +546,7 @@ local APIBarFunctions
self.div_timer:Show()
self.background:Show()
+ self:Show()
self.timer = true
@@ -584,22 +556,22 @@ local APIBarFunctions
------------------------------------------------------------------------------------------------------------
--> object constructor
-function DetailsNormalBar_OnCreate (self)
+function DetailsFrameworkNormalBar_OnCreate (self)
self.texture.original_colors = {1, 1, 1, 1}
self.background.original_colors = {.3, .3, .3, .3}
self.timertexture.original_colors = {.3, .3, .3, .3}
return true
end
-function gump:CreateBar (parent, texture, w, h, value, member, name)
- return gump:NewBar (parent, parent, name, member, w, h, value, texture)
+function DF:CreateBar (parent, texture, w, h, value, member, name)
+ return DF:NewBar (parent, parent, name, member, w, h, value, texture)
end
-function gump:NewBar (parent, container, name, member, w, h, value, texture_name)
+function DF:NewBar (parent, container, name, member, w, h, value, texture_name)
if (not name) then
- name = "DetailsBarNumber" .. gump.BarNameCounter
- gump.BarNameCounter = gump.BarNameCounter + 1
+ name = "DetailsFrameworkBarNumber" .. DF.BarNameCounter
+ DF.BarNameCounter = DF.BarNameCounter + 1
elseif (not parent) then
return nil
@@ -645,7 +617,7 @@ function gump:NewBar (parent, container, name, member, w, h, value, texture_name
BarObject.container = container
--> create widgets
- BarObject.statusbar = CreateFrame ("statusbar", name, parent, "DetailsNormalBarTemplate")
+ BarObject.statusbar = CreateFrame ("statusbar", name, parent, "DetailsFrameworkNormalBarTemplate")
BarObject.widget = BarObject.statusbar
if (not APIBarFunctions) then
@@ -654,7 +626,7 @@ function gump:NewBar (parent, container, name, member, w, h, value, texture_name
for funcName, funcAddress in pairs (idx) do
if (not BarMetaFunctions [funcName]) then
BarMetaFunctions [funcName] = function (object, ...)
- local x = loadstring ( "return _G."..object.statusbar:GetName()..":"..funcName.."(...)")
+ local x = loadstring ( "return _G['"..object.statusbar:GetName().."']:"..funcName.."(...)")
return x (...)
end
end
diff --git a/framework/normal_bar.xml b/Libs/DF/normal_bar.xml
similarity index 93%
rename from framework/normal_bar.xml
rename to Libs/DF/normal_bar.xml
index 89793d93..919ca1e2 100644
--- a/framework/normal_bar.xml
+++ b/Libs/DF/normal_bar.xml
@@ -1,7 +1,7 @@
-
+
@@ -83,7 +83,7 @@
self:SetStatusBarTexture (self.texture);
- DetailsNormalBar_OnCreate (self);
+ DetailsFrameworkNormalBar_OnCreate (self);
diff --git a/framework/panel.lua b/Libs/DF/panel.lua
similarity index 58%
rename from framework/panel.lua
rename to Libs/DF/panel.lua
index 0146f33a..7f183395 100644
--- a/framework/panel.lua
+++ b/Libs/DF/panel.lua
@@ -1,7 +1,9 @@
---> details main objects
-local _detalhes = _G._detalhes
-local gump = _detalhes.gump
-local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
+
+local DF = _G ["DetailsFramework"]
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
local _
--> lua locals
local _rawset = rawset --> lua local
@@ -16,7 +18,7 @@ local cleanfunction = function() end
local PanelMetaFunctions = {}
local APIFrameFunctions
-simple_panel_counter = 1
+local simple_panel_counter = 1
------------------------------------------------------------------------------------------------------------
--> metatables
@@ -106,7 +108,7 @@ simple_panel_counter = 1
end
--> backdrop color
local smember_color = function (_object, _value)
- local _value1, _value2, _value3, _value4 = gump:ParseColors (_value)
+ local _value1, _value2, _value3, _value4 = DF:ParseColors (_value)
return _object:SetBackdropColor (_value1, _value2, _value3, _value4)
end
--> frame width
@@ -176,18 +178,18 @@ simple_panel_counter = 1
if (textType) then
textType = string.lower (textType)
if (textType == "short") then
- text = Loc ["STRING_RIGHTCLICK_CLOSE_SHORT"]
+ text = "close window"
elseif (textType == "medium") then
- text = Loc ["STRING_RIGHTCLICK_CLOSE_MEDIUM"]
+ text = "close window"
elseif (textType == "large") then
- text = Loc ["STRING_RIGHTCLICK_CLOSE_LARGE"]
+ text = "close window"
end
else
- text = Loc ["STRING_RIGHTCLICK_CLOSE_SHORT"]
+ text = "close window"
end
end
- return gump:NewLabel (self, _, "$parentRightMouseToClose", nil, "|TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:"..w..":"..h..":0:1:512:512:8:70:328:409|t " .. text)
+ return DF:NewLabel (self, _, "$parentRightMouseToClose", nil, "|TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:"..w..":"..h..":0:1:512:512:8:70:328:409|t " .. text)
end
--> show & hide
@@ -202,7 +204,7 @@ simple_panel_counter = 1
-- setpoint
function PanelMetaFunctions:SetPoint (v1, v2, v3, v4, v5)
- v1, v2, v3, v4, v5 = gump:CheckPoints (v1, v2, v3, v4, v5, self)
+ v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self)
if (not v1) then
print ("Invalid parameter for SetPoint")
return
@@ -257,11 +259,9 @@ simple_panel_counter = 1
function PanelMetaFunctions:SetBackdropColor (color, arg2, arg3, arg4)
if (arg2) then
self.frame:SetBackdropColor (color, arg2, arg3, arg4 or 1)
- self.frame.Gradient.OnLeave = {color, arg2, arg3, arg4 or 1}
else
- local _value1, _value2, _value3, _value4 = gump:ParseColors (color)
+ local _value1, _value2, _value3, _value4 = DF:ParseColors (color)
self.frame:SetBackdropColor (_value1, _value2, _value3, _value4)
- self.frame.Gradient.OnLeave = {_value1, _value2, _value3, _value4}
end
end
@@ -270,20 +270,10 @@ simple_panel_counter = 1
if (arg2) then
return self.frame:SetBackdropBorderColor (color, arg2, arg3, arg4)
end
- local _value1, _value2, _value3, _value4 = gump:ParseColors (color)
+ local _value1, _value2, _value3, _value4 = DF:ParseColors (color)
self.frame:SetBackdropBorderColor (_value1, _value2, _value3, _value4)
end
--- gradient colors
- function PanelMetaFunctions:SetGradient (FadeType, color)
- local _value1, _value2, _value3, _value4 = gump:ParseColors (color)
- if (FadeType == "OnEnter") then
- self.frame.Gradient.OnEnter = {_value1, _value2, _value3, _value4}
- elseif (FadeType == "OnLeave") then
- self.frame.Gradient.OnLeave = {_value1, _value2, _value3, _value4}
- end
- end
-
-- tooltip
function PanelMetaFunctions:SetTooltip (tooltip)
if (tooltip) then
@@ -320,14 +310,6 @@ simple_panel_counter = 1
self.widget:SetFrameStrata (strata)
end
end
-
--- enable and disable gradients
- function PanelMetaFunctions:DisableGradient()
- self.GradientEnabled = false
- end
- function PanelMetaFunctions:EnableGradient()
- self.GradientEnabled = true
- end
--> hooks
function PanelMetaFunctions:SetHook (hookType, func)
@@ -340,22 +322,6 @@ simple_panel_counter = 1
------------------------------------------------------------------------------------------------------------
--> scripts
-
- function PanelMetaFunctions:RunGradient (cancel)
- if (type (cancel) == "boolean" and not canceal) then
- local _r, _g, _b, _a = self.frame:GetBackdropColor()
- if (_r) then
- local OnLeaveColors = self.frame.Gradient.OnLeave
- gump:GradientEffect (self.frame, "frame", _r, _g, _b, _a, OnLeaveColors[1], OnLeaveColors[2], OnLeaveColors[3], OnLeaveColors[4], .3)
- end
- else
- local _r, _g, _b, _a = self.frame:GetBackdropColor()
- if (_r) then
- local OnEnterColors = self.frame.Gradient.OnEnter
- gump:GradientEffect (self.frame, "frame", _r, _g, _b, _a, OnEnterColors[1], OnEnterColors[2], OnEnterColors[3], OnEnterColors[4], .3)
- end
- end
- end
local OnEnter = function (frame)
if (frame.MyObject.OnEnterHook) then
@@ -365,17 +331,13 @@ simple_panel_counter = 1
end
end
- if (frame.MyObject.GradientEnabled) then
- frame.MyObject:RunGradient()
- end
-
if (frame.MyObject.have_tooltip) then
- GameCooltip:Reset()
- GameCooltip:SetType ("tooltip")
- GameCooltip:SetColor ("main", "transparent")
- GameCooltip:AddLine (frame.MyObject.have_tooltip)
- GameCooltip:SetOwner (frame)
- GameCooltip:ShowCooltip()
+ GameCooltip2:Reset()
+ GameCooltip2:SetType ("tooltip")
+ GameCooltip2:SetColor ("main", "transparent")
+ GameCooltip2:AddLine (frame.MyObject.have_tooltip)
+ GameCooltip2:SetOwner (frame)
+ GameCooltip2:ShowCooltip()
end
end
@@ -387,12 +349,8 @@ simple_panel_counter = 1
end
end
- if (frame.MyObject.GradientEnabled) then
- frame.MyObject:RunGradient (false)
- end
-
if (frame.MyObject.have_tooltip) then
- _detalhes.popup:ShowMe (false)
+ GameCooltip2:ShowMe (false)
end
end
@@ -466,15 +424,15 @@ simple_panel_counter = 1
------------------------------------------------------------------------------------------------------------
--> object constructor
-function gump:CreatePanel (parent, w, h, backdrop, backdropcolor, bordercolor, member, name)
- return gump:NewPanel (parent, parent, name, member, w, h, backdrop, backdropcolor, bordercolor)
+function DF:CreatePanel (parent, w, h, backdrop, backdropcolor, bordercolor, member, name)
+ return DF:NewPanel (parent, parent, name, member, w, h, backdrop, backdropcolor, bordercolor)
end
-function gump:NewPanel (parent, container, name, member, w, h, backdrop, backdropcolor, bordercolor)
+function DF:NewPanel (parent, container, name, member, w, h, backdrop, backdropcolor, bordercolor)
if (not name) then
- name = "DetailsPanelNumber" .. gump.PanelCounter
- gump.PanelCounter = gump.PanelCounter + 1
+ name = "DetailsFrameworkPanelNumber" .. DF.PanelCounter
+ DF.PanelCounter = DF.PanelCounter + 1
elseif (not parent) then
parent = UIParent
@@ -511,11 +469,10 @@ function gump:NewPanel (parent, container, name, member, w, h, backdrop, backdro
PanelObject.OnMouseUpHook = nil
--> misc
PanelObject.is_locked = true
- PanelObject.GradientEnabled = true
PanelObject.container = container
PanelObject.rightButtonClose = false
- PanelObject.frame = CreateFrame ("frame", name, parent, "DetailsPanelTemplate")
+ PanelObject.frame = CreateFrame ("frame", name, parent, "DetailsFrameworkPanelTemplate")
PanelObject.widget = PanelObject.frame
if (not APIFrameFunctions) then
@@ -524,7 +481,7 @@ function gump:NewPanel (parent, container, name, member, w, h, backdrop, backdro
for funcName, funcAddress in pairs (idx) do
if (not PanelMetaFunctions [funcName]) then
PanelMetaFunctions [funcName] = function (object, ...)
- local x = loadstring ( "return _G."..object.frame:GetName()..":"..funcName.."(...)")
+ local x = loadstring ( "return _G['"..object.frame:GetName().."']:"..funcName.."(...)")
return x (...)
end
end
@@ -575,7 +532,7 @@ end
local add_row = function (self, t, need_update)
local index = #self.rows+1
- local thisrow = gump:NewPanel (self, self, "$parentHeader_" .. self._name .. index, nil, 1, 20)
+ local thisrow = DF:NewPanel (self, self, "$parentHeader_" .. self._name .. index, nil, 1, 20)
thisrow.backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Gold-Background]]}
thisrow.color = "silver"
thisrow.type = t.type
@@ -587,7 +544,7 @@ local add_row = function (self, t, need_update)
thisrow.hidden = t.hidden or false
- local text = gump:NewLabel (thisrow, nil, self._name .. "$parentLabel" .. index, "text")
+ local text = DF:NewLabel (thisrow, nil, self._name .. "$parentLabel" .. index, "text")
text:SetPoint ("left", thisrow, "left", 2, 0)
text:SetText (t.name)
@@ -610,6 +567,7 @@ local align_rows = function (self)
local cur_width = 0
local row_width = self._width / rows_shown
+
local sindex = 1
wipe (self._anchors)
@@ -617,7 +575,6 @@ local align_rows = function (self)
for index, row in ipairs (self.rows) do
if (not row.hidden) then
if (self._autowidth) then
- --row:SetWidth (row_width)
if (self._raw_rows [index].width) then
row.width = self._raw_rows [index].width
else
@@ -788,19 +745,21 @@ local update_rows = function (self, updated_rows)
end
end
+ self.current_header = updated_rows
+
self:AlignRows()
end
local create_panel_text = function (self, row)
row.text_total = row.text_total + 1
- local text = gump:NewLabel (row, nil, self._name .. "$parentLabel" .. row.text_total, "text" .. row.text_total)
+ local text = DF:NewLabel (row, nil, self._name .. "$parentLabel" .. row.text_total, "text" .. row.text_total)
tinsert (row.text_available, text)
end
local create_panel_entry = function (self, row)
row.entry_total = row.entry_total + 1
- local editbox = gump:NewTextEntry (row, nil, "$parentEntry" .. row.entry_total, "entry", 120, 20)
+ local editbox = DF:NewTextEntry (row, nil, "$parentEntry" .. row.entry_total, "entry", 120, 20)
editbox.align = "left"
editbox:SetHook ("OnEnterPressed", function()
@@ -820,12 +779,13 @@ end
local create_panel_button = function (self, row)
row.button_total = row.button_total + 1
- local button = gump:NewButton (row, nil, "$parentButton" .. row.button_total, "button" .. row.button_total, 120, 20)
- button:InstallCustomTexture()
+ local button = DF:NewButton (row, nil, "$parentButton" .. row.button_total, "button" .. row.button_total, 120, 20)
+ --, nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")
+ --button:InstallCustomTexture()
--> create icon and the text
- local icon = gump:NewImage (button, nil, 20, 20)
- local text = gump:NewLabel (button)
+ local icon = DF:NewImage (button, nil, 20, 20)
+ local text = DF:NewLabel (button)
button._icon = icon
button._text = text
@@ -843,18 +803,18 @@ end
local create_panel_icon = function (self, row)
row.icon_total = row.icon_total + 1
- local iconbutton = gump:NewButton (row, nil, "$parentIconButton" .. row.icon_total, "iconbutton", 22, 20)
+ local iconbutton = DF:NewButton (row, nil, "$parentIconButton" .. row.icon_total, "iconbutton", 22, 20)
iconbutton:InstallCustomTexture()
iconbutton:SetHook ("OnEnter", button_on_enter)
iconbutton:SetHook ("OnLeave", button_on_leave)
iconbutton:SetHook ("OnMouseUp", function()
- gump:IconPick (icon_onclick, true, iconbutton)
+ DF:IconPick (icon_onclick, true, iconbutton)
return true
end)
- local icon = gump:NewImage (iconbutton, nil, 20, 20, "artwork", nil, "_icon", "$parentIcon" .. row.icon_total)
+ local icon = DF:NewImage (iconbutton, nil, 20, 20, "artwork", nil, "_icon", "$parentIcon" .. row.icon_total)
iconbutton._icon = icon
icon:SetPoint ("center", iconbutton, "center", 0, 0)
@@ -871,10 +831,31 @@ end
local drop_header_function = function (self)
wipe (self.rows)
end
- -- ~fillpanel
-function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_row, autowidth, options)
+
+local fillpanel_update_size = function (self, elapsed)
+ local panel = self.MyObject
- local panel = gump:NewPanel (parent, parent, name, member, w, h)
+ panel._width = panel:GetWidth()
+ panel._height = panel:GetHeight()
+
+ panel:UpdateRowAmount()
+ if (panel.current_header) then
+ update_rows (panel, panel.current_header)
+ end
+ panel:Refresh()
+
+ self:SetScript ("OnUpdate", nil)
+end
+
+ -- ~fillpanel
+ --alias
+function DF:CreateFillPanel (parent, rows, w, h, total_lines, fill_row, autowidth, options, member, name)
+ return DF:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_row, autowidth, options)
+end
+
+function DF:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_row, autowidth, options)
+
+ local panel = DF:NewPanel (parent, parent, name, member, w, h)
panel.backdrop = nil
options = options or {rowheight = 20}
@@ -900,6 +881,10 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
panel._totalfunc = total_lines
panel._autowidth = autowidth
+ panel:SetScript ("OnSizeChanged", function()
+ panel:SetScript ("OnUpdate", fillpanel_update_size)
+ end)
+
for index, t in ipairs (rows) do
panel.AddRow (panel, t)
end
@@ -943,11 +928,7 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
button = button + 1
buttonwidget.index = real_index
- local func = function()
- t.func (real_index, index)
- panel:Refresh()
- end
- buttonwidget:SetClickFunction (func)
+
if (type (results [index]) == "table") then
if (results [index].text) then
@@ -959,9 +940,24 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
end
if (results [index].func) then
- buttonwidget:SetClickFunction (results [index].func, real_index, results [index].value)
+ local func = function()
+ t.func (real_index, results [index].value)
+ panel:Refresh()
+ end
+ buttonwidget:SetClickFunction (func)
+ else
+ local func = function()
+ t.func (real_index, index)
+ panel:Refresh()
+ end
+ buttonwidget:SetClickFunction (func)
end
else
+ local func = function()
+ t.func (real_index, index)
+ panel:Refresh()
+ end
+ buttonwidget:SetClickFunction (func)
buttonwidget:SetText (results [index])
end
@@ -1010,44 +1006,46 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
scrollframe.lines = {}
--create lines
- local size = options.rowheight
- local amount = math.floor (((h-21) / size))
-
- for i = 1, amount do
- --local row = gump:NewPanel (panel, nil, , nil, 1, size)
- local row = CreateFrame ("frame", panel:GetName() .. "Row_" .. i, panel.widget)
- row:SetSize (1, size)
- row.color = {1, 1, 1, .2}
-
- row:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]]})
-
- if (i%2 == 0) then
- row:SetBackdropColor (.5, .5, .5, 0.2)
- else
- row:SetBackdropColor (1, 1, 1, 0.00)
+ function panel:UpdateRowAmount()
+ local size = options.rowheight
+ local amount = math.floor (((panel._height-21) / size))
+
+ for i = #scrollframe.lines+1, amount do
+ local row = CreateFrame ("frame", panel:GetName() .. "Row_" .. i, panel.widget)
+ row:SetSize (1, size)
+ row.color = {1, 1, 1, .2}
+
+ row:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]]})
+
+ if (i%2 == 0) then
+ row:SetBackdropColor (.5, .5, .5, 0.2)
+ else
+ row:SetBackdropColor (1, 1, 1, 0.00)
+ end
+
+ row:SetPoint ("topleft", scrollframe, "topleft", 0, (i-1) * size * -1)
+ row:SetPoint ("topright", scrollframe, "topright", 0, (i-1) * size * -1)
+ tinsert (scrollframe.lines, row)
+
+ row.text_available = {}
+ row.text_inuse = {}
+ row.text_total = 0
+
+ row.entry_available = {}
+ row.entry_inuse = {}
+ row.entry_total = 0
+
+ row.button_available = {}
+ row.button_inuse = {}
+ row.button_total = 0
+
+ row.icon_available = {}
+ row.icon_inuse = {}
+ row.icon_total = 0
end
-
- row:SetPoint ("topleft", scrollframe, "topleft", 0, (i-1) * size * -1)
- row:SetPoint ("topright", scrollframe, "topright", 0, (i-1) * size * -1)
- tinsert (scrollframe.lines, row)
-
- row.text_available = {}
- row.text_inuse = {}
- row.text_total = 0
-
- row.entry_available = {}
- row.entry_inuse = {}
- row.entry_total = 0
-
- row.button_available = {}
- row.button_inuse = {}
- row.button_total = 0
-
- row.icon_available = {}
- row.icon_inuse = {}
- row.icon_total = 0
end
-
+ panel:UpdateRowAmount()
+
panel.AlignRows (panel)
return panel
@@ -1067,7 +1065,7 @@ local color_pick_func_cancel = function()
ColorPickerFrame:dcallback (r, g, b, a, ColorPickerFrame.dframe)
end
-function gump:ColorPick (frame, r, g, b, alpha, callback)
+function DF:ColorPick (frame, r, g, b, alpha, callback)
ColorPickerFrame:ClearAllPoints()
ColorPickerFrame:SetPoint ("bottomleft", frame, "topright", 0, 0)
@@ -1091,68 +1089,66 @@ function gump:ColorPick (frame, r, g, b, alpha, callback)
end
------------icon pick
-function gump:IconPick (callback, close_when_select, param1, param2)
+function DF:IconPick (callback, close_when_select, param1, param2)
- if (not gump.IconPickFrame) then
+ if (not DF.IconPickFrame) then
local string_lower = string.lower
- gump.IconPickFrame = CreateFrame ("frame", "DetailsIconPickFrame", UIParent)
- tinsert (UISpecialFrames, "DetailsIconPickFrame")
- gump.IconPickFrame:SetFrameStrata ("DIALOG")
+ DF.IconPickFrame = CreateFrame ("frame", "DetailsFrameworkIconPickFrame", UIParent)
+ tinsert (UISpecialFrames, "DetailsFrameworkIconPickFrame")
+ DF.IconPickFrame:SetFrameStrata ("DIALOG")
- gump.IconPickFrame:SetPoint ("center", UIParent, "center")
- gump.IconPickFrame:SetWidth (350)
- gump.IconPickFrame:SetHeight (227)
- gump.IconPickFrame:EnableMouse (true)
- gump.IconPickFrame:SetMovable (true)
- gump.IconPickFrame:SetBackdrop ({bgFile = "Interface\\AddOns\\Details\\images\\background", edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
+ DF.IconPickFrame:SetPoint ("center", UIParent, "center")
+ DF.IconPickFrame:SetWidth (350)
+ DF.IconPickFrame:SetHeight (227)
+ DF.IconPickFrame:EnableMouse (true)
+ DF.IconPickFrame:SetMovable (true)
+ DF.IconPickFrame:SetBackdrop ({bgFile = DF.folder .. "background", edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
tile = true, tileSize = 32, edgeSize = 32, insets = {left = 5, right = 5, top = 5, bottom = 5}})
- --local title = gump.IconPickFrame:CreateTitleRegion()
+ DF.IconPickFrame:SetBackdropBorderColor (170/255, 170/255, 170/255)
+ DF.IconPickFrame:SetBackdropColor (24/255, 24/255, 24/255, .8)
+ DF.IconPickFrame:SetFrameLevel (1)
- gump.IconPickFrame:SetBackdropBorderColor (170/255, 170/255, 170/255)
- gump.IconPickFrame:SetBackdropColor (24/255, 24/255, 24/255, .8)
- gump.IconPickFrame:SetFrameLevel (1)
+ DF.IconPickFrame.emptyFunction = function() end
+ DF.IconPickFrame.callback = DF.IconPickFrame.emptyFunction
- gump.IconPickFrame.emptyFunction = function() end
- gump.IconPickFrame.callback = gump.IconPickFrame.emptyFunction
+ DF.IconPickFrame.preview = CreateFrame ("frame", nil, UIParent)
+ DF.IconPickFrame.preview:SetFrameStrata ("tooltip")
+ DF.IconPickFrame.preview:SetSize (76, 76)
+ local preview_image = DF:NewImage (DF.IconPickFrame.preview, nil, 76, 76)
+ preview_image:SetAllPoints (DF.IconPickFrame.preview)
+ DF.IconPickFrame.preview.icon = preview_image
+ DF.IconPickFrame.preview:Hide()
- gump.IconPickFrame.preview = CreateFrame ("frame", nil, UIParent)
- gump.IconPickFrame.preview:SetFrameStrata ("tooltip")
- gump.IconPickFrame.preview:SetSize (76, 76)
- local preview_image = gump:NewImage (gump.IconPickFrame.preview, nil, 76, 76)
- preview_image:SetAllPoints (gump.IconPickFrame.preview)
- gump.IconPickFrame.preview.icon = preview_image
- gump.IconPickFrame.preview:Hide()
-
- gump.IconPickFrame.searchLabel = gump:NewLabel (gump.IconPickFrame, nil, "$parentSearchBoxLabel", nil, "search:")
- gump.IconPickFrame.searchLabel:SetPoint ("topleft", gump.IconPickFrame, "topleft", 12, -20)
- gump.IconPickFrame.search = gump:NewTextEntry (gump.IconPickFrame, nil, "$parentSearchBox", nil, 140, 20)
- gump.IconPickFrame.search:SetPoint ("left", gump.IconPickFrame.searchLabel, "right", 2, 0)
- gump.IconPickFrame.search:SetHook ("OnTextChanged", function()
- gump.IconPickFrame.searching = gump.IconPickFrame.search:GetText()
- if (gump.IconPickFrame.searching == "") then
- gump.IconPickFrameScroll:Show()
- gump.IconPickFrame.searching = nil
- gump.IconPickFrame.updateFunc()
+ DF.IconPickFrame.searchLabel = DF:NewLabel (DF.IconPickFrame, nil, "$parentSearchBoxLabel", nil, "search:", font, size, color)
+ DF.IconPickFrame.searchLabel:SetPoint ("topleft", DF.IconPickFrame, "topleft", 12, -20)
+ DF.IconPickFrame.search = DF:NewTextEntry (DF.IconPickFrame, nil, "$parentSearchBox", nil, 140, 20)
+ DF.IconPickFrame.search:SetPoint ("left", DF.IconPickFrame.searchLabel, "right", 2, 0)
+ DF.IconPickFrame.search:SetHook ("OnTextChanged", function()
+ DF.IconPickFrame.searching = DF.IconPickFrame.search:GetText()
+ if (DF.IconPickFrame.searching == "") then
+ DF.IconPickFrameScroll:Show()
+ DF.IconPickFrame.searching = nil
+ DF.IconPickFrame.updateFunc()
else
- gump.IconPickFrameScroll:Hide()
- FauxScrollFrame_SetOffset (gump.IconPickFrame, 1)
- gump.IconPickFrame.last_filter_index = 1
- gump.IconPickFrame.updateFunc()
+ DF.IconPickFrameScroll:Hide()
+ FauxScrollFrame_SetOffset (DF.IconPickFrame, 1)
+ DF.IconPickFrame.last_filter_index = 1
+ DF.IconPickFrame.updateFunc()
end
end)
--> close button
- local close_button = CreateFrame ("button", nil, gump.IconPickFrame, "UIPanelCloseButton")
+ local close_button = CreateFrame ("button", nil, DF.IconPickFrame, "UIPanelCloseButton")
close_button:SetWidth (32)
close_button:SetHeight (32)
- close_button:SetPoint ("TOPRIGHT", gump.IconPickFrame, "TOPRIGHT", -8, -7)
+ close_button:SetPoint ("TOPRIGHT", DF.IconPickFrame, "TOPRIGHT", -8, -7)
close_button:SetFrameLevel (close_button:GetFrameLevel()+2)
local MACRO_ICON_FILENAMES = {}
- gump.IconPickFrame:SetScript ("OnShow", function()
+ DF.IconPickFrame:SetScript ("OnShow", function()
MACRO_ICON_FILENAMES = {};
MACRO_ICON_FILENAMES[1] = "INV_MISC_QUESTIONMARK";
@@ -1194,37 +1190,37 @@ function gump:IconPick (callback, close_when_select, param1, param2)
end)
- gump.IconPickFrame:SetScript ("OnHide", function()
+ DF.IconPickFrame:SetScript ("OnHide", function()
MACRO_ICON_FILENAMES = nil;
collectgarbage()
end)
- gump.IconPickFrame.buttons = {}
+ DF.IconPickFrame.buttons = {}
local OnClickFunction = function (self)
- gump.IconPickFrame.callback (self.icon:GetTexture(), gump.IconPickFrame.param1, gump.IconPickFrame.param2)
- if (gump.IconPickFrame.click_close) then
+ DF.IconPickFrame.callback (self.icon:GetTexture(), DF.IconPickFrame.param1, DF.IconPickFrame.param2)
+ if (DF.IconPickFrame.click_close) then
close_button:Click()
end
end
local onenter = function (self)
- gump.IconPickFrame.preview:SetPoint ("bottom", self, "top", 0, 2)
- gump.IconPickFrame.preview.icon:SetTexture (self.icon:GetTexture())
- gump.IconPickFrame.preview:Show()
+ DF.IconPickFrame.preview:SetPoint ("bottom", self, "top", 0, 2)
+ DF.IconPickFrame.preview.icon:SetTexture (self.icon:GetTexture())
+ DF.IconPickFrame.preview:Show()
self.icon:SetBlendMode ("ADD")
end
local onleave = function (self)
- gump.IconPickFrame.preview:Hide()
+ DF.IconPickFrame.preview:Hide()
self.icon:SetBlendMode ("BLEND")
end
- local backdrop = {bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16,
+ local backdrop = {bgFile = DF.folder .. "background", tile = true, tileSize = 16,
insets = {left = 0, right = 0, top = 0, bottom = 0}, edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]], edgeSize = 10}
for i = 0, 9 do
- local newcheck = CreateFrame ("Button", "DetailsIconPickFrameButton"..(i+1), gump.IconPickFrame)
- local image = newcheck:CreateTexture ("DetailsIconPickFrameButton"..(i+1).."Icon", "overlay")
+ local newcheck = CreateFrame ("Button", "DetailsFrameworkIconPickFrameButton"..(i+1), DF.IconPickFrame)
+ local image = newcheck:CreateTexture ("DetailsFrameworkIconPickFrameButton"..(i+1).."Icon", "overlay")
newcheck.icon = image
image:SetPoint ("topleft", newcheck, "topleft", 2, -2); image:SetPoint ("bottomright", newcheck, "bottomright", -2, 2)
newcheck:SetSize (30, 28)
@@ -1233,15 +1229,15 @@ function gump:IconPick (callback, close_when_select, param1, param2)
newcheck:SetScript ("OnClick", OnClickFunction)
newcheck.param1 = i+1
- newcheck:SetPoint ("topleft", gump.IconPickFrame, "topleft", 12 + (i*30), -40)
+ newcheck:SetPoint ("topleft", DF.IconPickFrame, "topleft", 12 + (i*30), -40)
newcheck:SetID (i+1)
- gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck
+ DF.IconPickFrame.buttons [#DF.IconPickFrame.buttons+1] = newcheck
newcheck:SetScript ("OnEnter", onenter)
newcheck:SetScript ("OnLeave", onleave)
end
for i = 11, 20 do
- local newcheck = CreateFrame ("Button", "DetailsIconPickFrameButton"..i, gump.IconPickFrame)
- local image = newcheck:CreateTexture ("DetailsIconPickFrameButton"..i.."Icon", "overlay")
+ local newcheck = CreateFrame ("Button", "DetailsFrameworkIconPickFrameButton"..i, DF.IconPickFrame)
+ local image = newcheck:CreateTexture ("DetailsFrameworkIconPickFrameButton"..i.."Icon", "overlay")
newcheck.icon = image
image:SetPoint ("topleft", newcheck, "topleft", 2, -2); image:SetPoint ("bottomright", newcheck, "bottomright", -2, 2)
newcheck:SetSize (30, 28)
@@ -1250,15 +1246,15 @@ function gump:IconPick (callback, close_when_select, param1, param2)
newcheck:SetScript ("OnClick", OnClickFunction)
newcheck.param1 = i
- newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
+ newcheck:SetPoint ("topleft", "DetailsFrameworkIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
newcheck:SetID (i)
- gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck
+ DF.IconPickFrame.buttons [#DF.IconPickFrame.buttons+1] = newcheck
newcheck:SetScript ("OnEnter", onenter)
newcheck:SetScript ("OnLeave", onleave)
end
for i = 21, 30 do
- local newcheck = CreateFrame ("Button", "DetailsIconPickFrameButton"..i, gump.IconPickFrame)
- local image = newcheck:CreateTexture ("DetailsIconPickFrameButton"..i.."Icon", "overlay")
+ local newcheck = CreateFrame ("Button", "DetailsFrameworkIconPickFrameButton"..i, DF.IconPickFrame)
+ local image = newcheck:CreateTexture ("DetailsFrameworkIconPickFrameButton"..i.."Icon", "overlay")
newcheck.icon = image
image:SetPoint ("topleft", newcheck, "topleft", 2, -2); image:SetPoint ("bottomright", newcheck, "bottomright", -2, 2)
newcheck:SetSize (30, 28)
@@ -1267,15 +1263,15 @@ function gump:IconPick (callback, close_when_select, param1, param2)
newcheck:SetScript ("OnClick", OnClickFunction)
newcheck.param1 = i
- newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
+ newcheck:SetPoint ("topleft", "DetailsFrameworkIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
newcheck:SetID (i)
- gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck
+ DF.IconPickFrame.buttons [#DF.IconPickFrame.buttons+1] = newcheck
newcheck:SetScript ("OnEnter", onenter)
newcheck:SetScript ("OnLeave", onleave)
end
for i = 31, 40 do
- local newcheck = CreateFrame ("Button", "DetailsIconPickFrameButton"..i, gump.IconPickFrame)
- local image = newcheck:CreateTexture ("DetailsIconPickFrameButton"..i.."Icon", "overlay")
+ local newcheck = CreateFrame ("Button", "DetailsFrameworkIconPickFrameButton"..i, DF.IconPickFrame)
+ local image = newcheck:CreateTexture ("DetailsFrameworkIconPickFrameButton"..i.."Icon", "overlay")
newcheck.icon = image
image:SetPoint ("topleft", newcheck, "topleft", 2, -2); image:SetPoint ("bottomright", newcheck, "bottomright", -2, 2)
newcheck:SetSize (30, 28)
@@ -1284,15 +1280,15 @@ function gump:IconPick (callback, close_when_select, param1, param2)
newcheck:SetScript ("OnClick", OnClickFunction)
newcheck.param1 = i
- newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
+ newcheck:SetPoint ("topleft", "DetailsFrameworkIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
newcheck:SetID (i)
- gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck
+ DF.IconPickFrame.buttons [#DF.IconPickFrame.buttons+1] = newcheck
newcheck:SetScript ("OnEnter", onenter)
newcheck:SetScript ("OnLeave", onleave)
end
for i = 41, 50 do
- local newcheck = CreateFrame ("Button", "DetailsIconPickFrameButton"..i, gump.IconPickFrame)
- local image = newcheck:CreateTexture ("DetailsIconPickFrameButton"..i.."Icon", "overlay")
+ local newcheck = CreateFrame ("Button", "DetailsFrameworkIconPickFrameButton"..i, DF.IconPickFrame)
+ local image = newcheck:CreateTexture ("DetailsFrameworkIconPickFrameButton"..i.."Icon", "overlay")
newcheck.icon = image
image:SetPoint ("topleft", newcheck, "topleft", 2, -2); image:SetPoint ("bottomright", newcheck, "bottomright", -2, 2)
newcheck:SetSize (30, 28)
@@ -1301,15 +1297,15 @@ function gump:IconPick (callback, close_when_select, param1, param2)
newcheck:SetScript ("OnClick", OnClickFunction)
newcheck.param1 = i
- newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
+ newcheck:SetPoint ("topleft", "DetailsFrameworkIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
newcheck:SetID (i)
- gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck
+ DF.IconPickFrame.buttons [#DF.IconPickFrame.buttons+1] = newcheck
newcheck:SetScript ("OnEnter", onenter)
newcheck:SetScript ("OnLeave", onleave)
end
for i = 51, 60 do
- local newcheck = CreateFrame ("Button", "DetailsIconPickFrameButton"..i, gump.IconPickFrame)
- local image = newcheck:CreateTexture ("DetailsIconPickFrameButton"..i.."Icon", "overlay")
+ local newcheck = CreateFrame ("Button", "DetailsFrameworkIconPickFrameButton"..i, DF.IconPickFrame)
+ local image = newcheck:CreateTexture ("DetailsFrameworkIconPickFrameButton"..i.."Icon", "overlay")
newcheck.icon = image
image:SetPoint ("topleft", newcheck, "topleft", 2, -2); image:SetPoint ("bottomright", newcheck, "bottomright", -2, 2)
newcheck:SetSize (30, 28)
@@ -1318,14 +1314,14 @@ function gump:IconPick (callback, close_when_select, param1, param2)
newcheck:SetScript ("OnClick", OnClickFunction)
newcheck.param1 = i
- newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
+ newcheck:SetPoint ("topleft", "DetailsFrameworkIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
newcheck:SetID (i)
- gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck
+ DF.IconPickFrame.buttons [#DF.IconPickFrame.buttons+1] = newcheck
newcheck:SetScript ("OnEnter", onenter)
newcheck:SetScript ("OnLeave", onleave)
end
- local scroll = CreateFrame ("ScrollFrame", "DetailsIconPickFrameScroll", gump.IconPickFrame, "ListScrollFrameTemplate")
+ local scroll = CreateFrame ("ScrollFrame", "DetailsFrameworkIconPickFrameScroll", DF.IconPickFrame, "ListScrollFrameTemplate")
local ChecksFrame_Update = function (self)
@@ -1336,8 +1332,8 @@ function gump:IconPick (callback, close_when_select, param1, param2)
local texture
local filter
- if (gump.IconPickFrame.searching) then
- filter = string_lower (gump.IconPickFrame.searching)
+ if (DF.IconPickFrame.searching) then
+ filter = string_lower (DF.IconPickFrame.searching)
end
if (filter and filter ~= "") then
@@ -1346,7 +1342,7 @@ function gump:IconPick (callback, close_when_select, param1, param2)
local tryed = 0
local found = 0
local type = type
- local buttons = gump.IconPickFrame.buttons
+ local buttons = DF.IconPickFrame.buttons
index = 1
for i = 1, 60 do
@@ -1371,7 +1367,7 @@ function gump:IconPick (callback, close_when_select, param1, param2)
macroPopupIcon:SetTexture (texture)
macroPopupButton:Show()
found = found + 1
- gump.IconPickFrame.last_filter_index = o
+ DF.IconPickFrame.last_filter_index = o
index = o+1
break
else
@@ -1382,13 +1378,13 @@ function gump:IconPick (callback, close_when_select, param1, param2)
end
for o = found+1, 60 do
- macroPopupButton = _G ["DetailsIconPickFrameButton"..o]
+ macroPopupButton = _G ["DetailsFrameworkIconPickFrameButton"..o]
macroPopupButton:Hide()
end
else
for i = 1, 60 do
- macroPopupIcon = _G ["DetailsIconPickFrameButton"..i.."Icon"]
- macroPopupButton = _G ["DetailsIconPickFrameButton"..i]
+ macroPopupIcon = _G ["DetailsFrameworkIconPickFrameButton"..i.."Icon"]
+ macroPopupButton = _G ["DetailsFrameworkIconPickFrameButton"..i]
index = (macroPopupOffset * 10) + i
texture = MACRO_ICON_FILENAMES [index]
if ( index <= numMacroIcons and texture ) then
@@ -1412,24 +1408,24 @@ function gump:IconPick (callback, close_when_select, param1, param2)
FauxScrollFrame_Update (scroll, ceil (numMacroIcons / 10) , 5, 20 )
end
- gump.IconPickFrame.updateFunc = ChecksFrame_Update
+ DF.IconPickFrame.updateFunc = ChecksFrame_Update
- scroll:SetPoint ("topleft", gump.IconPickFrame, "topleft", -18, -37)
+ scroll:SetPoint ("topleft", DF.IconPickFrame, "topleft", -18, -37)
scroll:SetWidth (330)
scroll:SetHeight (178)
scroll:SetScript ("OnVerticalScroll", function (self, offset) FauxScrollFrame_OnVerticalScroll (scroll, offset, 20, ChecksFrame_Update) end)
scroll.update = ChecksFrame_Update
- gump.IconPickFrameScroll = scroll
- gump.IconPickFrame:Hide()
+ DF.IconPickFrameScroll = scroll
+ DF.IconPickFrame:Hide()
end
- gump.IconPickFrame.param1, gump.IconPickFrame.param2 = param1, param2
+ DF.IconPickFrame.param1, DF.IconPickFrame.param2 = param1, param2
- gump.IconPickFrame:Show()
- gump.IconPickFrameScroll.update (gump.IconPickFrameScroll)
- gump.IconPickFrame.callback = callback or gump.IconPickFrame.emptyFunction
- gump.IconPickFrame.click_close = close_when_select
+ DF.IconPickFrame:Show()
+ DF.IconPickFrameScroll.update (DF.IconPickFrameScroll)
+ DF.IconPickFrame.callback = callback or DF.IconPickFrame.emptyFunction
+ DF.IconPickFrame.click_close = close_when_select
end
@@ -1439,27 +1435,45 @@ local simple_panel_mouse_down = function (self, button)
if (self.IsMoving) then
self.IsMoving = false
self:StopMovingOrSizing()
+ if (self.db and self.db.position) then
+ DF:SavePositionOnScreen (self)
+ end
+ end
+ if (not self.DontRightClickClose) then
+ self:Hide()
end
- self:Hide()
return
end
- self.IsMoving = true
- self:StartMoving()
+ if (not self.IsMoving and not self.IsLocked) then
+ self.IsMoving = true
+ self:StartMoving()
+ end
end
local simple_panel_mouse_up = function (self, button)
if (self.IsMoving) then
self.IsMoving = false
self:StopMovingOrSizing()
+ if (self.db and self.db.position) then
+ DF:SavePositionOnScreen (self)
+ end
end
end
local simple_panel_settitle = function (self, title)
- self.title:SetText (title)
+ self.Title:SetText (title)
end
-function gump:CreateSimplePanel (parent, w, h, title, name)
+local simple_panel_close_click = function (self)
+ self:GetParent():GetParent():Hide()
+end
+
+local SimplePanel_frame_backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}
+local SimplePanel_frame_backdrop_color = {0, 0, 0, 0.9}
+local SimplePanel_frame_backdrop_border_color = {0, 0, 0, 1}
+
+function DF:CreateSimplePanel (parent, w, h, title, name)
if (not name) then
- name = "DetailsSimplePanel" .. simple_panel_counter
+ name = "DetailsFrameworkSimplePanel" .. simple_panel_counter
simple_panel_counter = simple_panel_counter + 1
end
if (not parent) then
@@ -1472,21 +1486,41 @@ function gump:CreateSimplePanel (parent, w, h, title, name)
f:SetFrameStrata ("FULLSCREEN")
f:EnableMouse()
f:SetMovable (true)
+ f:SetBackdrop (SimplePanel_frame_backdrop)
+ f:SetBackdropColor (unpack (SimplePanel_frame_backdrop_color))
+ f:SetBackdropBorderColor (unpack (SimplePanel_frame_backdrop_border_color))
tinsert (UISpecialFrames, name)
-
+
+ local title_bar = CreateFrame ("frame", name .. "TitleBar", f)
+ title_bar:SetPoint ("topleft", f, "topleft", 2, -3)
+ title_bar:SetPoint ("topright", f, "topright", -2, -3)
+ title_bar:SetHeight (20)
+ title_bar:SetBackdrop (SimplePanel_frame_backdrop)
+ title_bar:SetBackdropColor (.2, .2, .2, 1)
+ title_bar:SetBackdropBorderColor (0, 0, 0, 1)
+
+ local close = CreateFrame ("button", name and name .. "CloseButton", title_bar)
+ close:SetSize (16, 16)
+ close:SetNormalTexture (DF.folder .. "icons")
+ close:SetHighlightTexture (DF.folder .. "icons")
+ close:SetPushedTexture (DF.folder .. "icons")
+ close:GetNormalTexture():SetTexCoord (0, 16/128, 0, 1)
+ close:GetHighlightTexture():SetTexCoord (0, 16/128, 0, 1)
+ close:GetPushedTexture():SetTexCoord (0, 16/128, 0, 1)
+ close:SetAlpha (0.7)
+ close:SetScript ("OnClick", simple_panel_close_click)
+ f.Close = close
+
+ local title_string = title_bar:CreateFontString (name and name .. "Title", "overlay", "GameFontNormal")
+ title_string:SetTextColor (.8, .8, .8, 1)
+ title_string:SetText (title or "")
+ f.Title = title_string
+
+ f.Title:SetPoint ("center", title_bar, "center")
+ f.Close:SetPoint ("right", title_bar, "right", -2, 0)
+
f:SetScript ("OnMouseDown", simple_panel_mouse_down)
f:SetScript ("OnMouseUp", simple_panel_mouse_up)
-
- f:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], tile = true, tileSize = 128, insets = {left=3, right=3, top=3, bottom=3},
- edgeFile = [[Interface\AddOns\Details\images\border_welcome]], edgeSize = 16})
- f:SetBackdropColor (1, 1, 1, 0.75)
-
- local close = CreateFrame ("button", name .. "Close", f, "UIPanelCloseButton")
- close:SetSize (32, 32)
- close:SetPoint ("topright", f, "topright", 0, -12)
-
- f.title = gump:CreateLabel (f, title or "", 12, nil, "GameFontNormal")
- f.title:SetPoint ("top", f, "top", 0, -22)
f.SetTitle = simple_panel_settitle
@@ -1495,9 +1529,666 @@ function gump:CreateSimplePanel (parent, w, h, title, name)
return f
end
+local Panel1PxBackdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 64,
+edgeFile = DF.folder .. "border_3", edgeSize = 9, insets = {left = 2, right = 2, top = 3, bottom = 3}}
+
+local Panel1PxOnClickClose = function (self)
+ self:GetParent():Hide()
+end
+local Panel1PxOnToggleLock = function (self)
+ if (self.IsLocked) then
+ self.IsLocked = false
+ self:SetMovable (true)
+ self:EnableMouse (true)
+ self.Lock:GetNormalTexture():SetTexCoord (32/128, 48/128, 0, 1)
+ self.Lock:GetHighlightTexture():SetTexCoord (32/128, 48/128, 0, 1)
+ self.Lock:GetPushedTexture():SetTexCoord (32/128, 48/128, 0, 1)
+ if (self.OnUnlock) then
+ self:OnUnlock()
+ end
+ if (self.db) then
+ self.db.IsLocked = self.IsLocked
+ end
+ else
+ self.IsLocked = true
+ self:SetMovable (false)
+ self:EnableMouse (false)
+ self.Lock:GetNormalTexture():SetTexCoord (16/128, 32/128, 0, 1)
+ self.Lock:GetHighlightTexture():SetTexCoord (16/128, 32/128, 0, 1)
+ self.Lock:GetPushedTexture():SetTexCoord (16/128, 32/128, 0, 1)
+ if (self.OnLock) then
+ self:OnLock()
+ end
+ if (self.db) then
+ self.db.IsLocked = self.IsLocked
+ end
+ end
+end
+local Panel1PxOnClickLock = function (self)
+ local f = self:GetParent()
+ Panel1PxOnToggleLock (f)
+end
+local Panel1PxSetTitle = function (self, text)
+ self.Title:SetText (text or "")
+end
+
+local Panel1PxSetLocked= function (self, lock_state)
+ if (type (lock_state) ~= "boolean") then
+ return
+ end
+ if (lock_state) then
+ -- lock it
+ self.IsLocked = false
+ Panel1PxOnClickLock (self.Lock)
+ else
+ -- unlockit
+ self.IsLocked = true
+ Panel1PxOnClickLock (self.Lock)
+ end
+end
+
+local Panel1PxReadConfig = function (self)
+ local db = self.db
+ if (db) then
+ db.IsLocked = db.IsLocked or false
+ self.IsLocked = db.IsLocked
+ db.position = db.position or {x = 0, y = 0}
+ db.position.x = db.position.x or 0
+ db.position.y = db.position.y or 0
+ DF:RestoreFramePosition (self)
+ end
+end
+
+function DF:SavePositionOnScreen (frame)
+ if (frame.db and frame.db.position) then
+ local x, y = DF:GetPositionOnScreen (frame)
+ --print ("saving...", x, y, frame:GetName())
+ if (x and y) then
+ frame.db.position.x, frame.db.position.y = x, y
+ end
+ end
+end
+
+function DF:GetPositionOnScreen (frame)
+ local xOfs, yOfs = frame:GetCenter()
+ if (not xOfs) then
+ return
+ end
+ local scale = frame:GetEffectiveScale()
+ local UIscale = UIParent:GetScale()
+ xOfs = xOfs*scale - GetScreenWidth()*UIscale/2
+ yOfs = yOfs*scale - GetScreenHeight()*UIscale/2
+ return xOfs/UIscale, yOfs/UIscale
+end
+
+function DF:RestoreFramePosition (frame)
+ if (frame.db and frame.db.position) then
+ local scale, UIscale = frame:GetEffectiveScale(), UIParent:GetScale()
+ frame:ClearAllPoints()
+ frame.db.position.x = frame.db.position.x or 0
+ frame.db.position.y = frame.db.position.y or 0
+ frame:SetPoint ("center", UIParent, "center", frame.db.position.x * UIscale / scale, frame.db.position.y * UIscale / scale)
+ end
+end
+
+local Panel1PxSavePosition= function (self)
+ DF:SavePositionOnScreen (self)
+end
+
+local Panel1PxHasPosition = function (self)
+ local db = self.db
+ if (db) then
+ if (db.position and db.position.x and (db.position.x ~= 0 or db.position.y ~= 0)) then
+ return true
+ end
+ end
+end
+
+function DF:Create1PxPanel (parent, w, h, title, name, config, title_anchor, no_special_frame)
+ local f = CreateFrame ("frame", name, parent or UIParent)
+ f:SetSize (w or 100, h or 75)
+ f:SetPoint ("center", UIParent, "center")
+
+ if (name and not no_special_frame) then
+ tinsert (UISpecialFrames, name)
+ end
+
+ f:SetScript ("OnMouseDown", simple_panel_mouse_down)
+ f:SetScript ("OnMouseUp", simple_panel_mouse_up)
+
+ f:SetBackdrop (Panel1PxBackdrop)
+ f:SetBackdropColor (0, 0, 0, 0.5)
+
+ f.IsLocked = (config and config.IsLocked ~= nil and config.IsLocked) or false
+ f:SetMovable (true)
+ f:EnableMouse (true)
+ f:SetUserPlaced (true)
+
+ f.db = config
+ --print (config.position.x, config.position.x)
+ Panel1PxReadConfig (f)
+
+ local close = CreateFrame ("button", name and name .. "CloseButton", f)
+ close:SetSize (16, 16)
+ close:SetNormalTexture (DF.folder .. "icons")
+ close:SetHighlightTexture (DF.folder .. "icons")
+ close:SetPushedTexture (DF.folder .. "icons")
+ close:GetNormalTexture():SetTexCoord (0, 16/128, 0, 1)
+ close:GetHighlightTexture():SetTexCoord (0, 16/128, 0, 1)
+ close:GetPushedTexture():SetTexCoord (0, 16/128, 0, 1)
+ close:SetAlpha (0.7)
+
+ local lock = CreateFrame ("button", name and name .. "LockButton", f)
+ lock:SetSize (16, 16)
+ lock:SetNormalTexture (DF.folder .. "icons")
+ lock:SetHighlightTexture (DF.folder .. "icons")
+ lock:SetPushedTexture (DF.folder .. "icons")
+ lock:GetNormalTexture():SetTexCoord (32/128, 48/128, 0, 1)
+ lock:GetHighlightTexture():SetTexCoord (32/128, 48/128, 0, 1)
+ lock:GetPushedTexture():SetTexCoord (32/128, 48/128, 0, 1)
+ lock:SetAlpha (0.7)
+
+ close:SetPoint ("topright", f, "topright", -3, -3)
+ lock:SetPoint ("right", close, "left", 3, 0)
+
+ close:SetScript ("OnClick", Panel1PxOnClickClose)
+ lock:SetScript ("OnClick", Panel1PxOnClickLock)
+
+ local title_string = f:CreateFontString (name and name .. "Title", "overlay", "GameFontNormal")
+ title_string:SetPoint ("topleft", f, "topleft", 5, -5)
+ title_string:SetText (title or "")
+
+ if (title_anchor) then
+ if (title_anchor == "top") then
+ title_string:ClearAllPoints()
+ title_string:SetPoint ("bottomleft", f, "topleft", 0, 0)
+ close:ClearAllPoints()
+ close:SetPoint ("bottomright", f, "topright", 0, 0)
+ end
+ f.title_anchor = title_anchor
+ end
+
+ f.SetTitle = Panel1PxSetTitle
+ f.Title = title_string
+ f.Lock = lock
+ f.Close = close
+ f.HasPosition = Panel1PxHasPosition
+ f.SavePosition = Panel1PxSavePosition
+
+ f.IsLocked = not f.IsLocked
+ f.SetLocked = Panel1PxSetLocked
+ Panel1PxOnToggleLock (f)
+
+ return f
+end
------------------------------------------------------------------------------------------------------------------------------------------------
---> chart panel
+-- ~prompt
+function DF:ShowPromptPanel (message, func_true, func_false)
+
+ if (not DF.prompt_panel) then
+ local f = CreateFrame ("frame", "DetailsFrameworkPrompt", UIParent)
+ f:SetSize (400, 65)
+ f:SetFrameStrata ("DIALOG")
+ f:SetPoint ("center", UIParent, "center", 0, 300)
+ f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
+ f:SetBackdropColor (0, 0, 0, 0.8)
+ f:SetBackdropBorderColor (0, 0, 0, 1)
+
+ local prompt = f:CreateFontString (nil, "overlay", "GameFontNormal")
+ prompt:SetPoint ("top", f, "top", 0, -15)
+ prompt:SetJustifyH ("center")
+ f.prompt = prompt
+
+ local button_true = DF:CreateButton (f, nil, 60, 20, "Yes")
+ button_true:SetPoint ("bottomleft", f, "bottomleft", 5, 5)
+ f.button_true = button_true
+
+ local button_false = DF:CreateButton (f, nil, 60, 20, "No")
+ button_false:SetPoint ("bottomright", f, "bottomright", -5, 5)
+ f.button_false = button_false
+
+ button_true:SetClickFunction (function()
+ local my_func = button_true.true_function
+ if (my_func) then
+ local okey, errormessage = pcall (my_func, true)
+ if (not okey) then
+ print ("error:", errormessage)
+ end
+ f:Hide()
+ end
+ end)
+
+ button_false:SetClickFunction (function()
+ local my_func = button_false.false_function
+ if (my_func) then
+ local okey, errormessage = pcall (my_func, true)
+ if (not okey) then
+ print ("error:", errormessage)
+ end
+ f:Hide()
+ end
+ end)
+
+ f:Hide()
+ DF.promtp_panel = f
+ end
+
+ assert (type (func_true) == "function" and type (func_false) == "function", "ShowPromptPanel expects two functions.")
+
+ DF.promtp_panel.prompt:SetText (message)
+ DF.promtp_panel.button_true.true_function = func_true
+ DF.promtp_panel.button_false.false_function = func_false
+
+ DF.promtp_panel:Show()
+end
+
+
+function DF:ShowTextPromptPanel (message, callback)
+
+ if (not DF.text_prompt_panel) then
+
+ local f = CreateFrame ("frame", "DetailsFrameworkPrompt", UIParent)
+ f:SetSize (400, 100)
+ f:SetFrameStrata ("DIALOG")
+ f:SetPoint ("center", UIParent, "center", 0, 300)
+ f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
+ f:SetBackdropColor (0, 0, 0, 0.8)
+ f:SetBackdropBorderColor (0, 0, 0, 1)
+
+ local prompt = f:CreateFontString (nil, "overlay", "GameFontNormal")
+ prompt:SetPoint ("top", f, "top", 0, -15)
+ prompt:SetJustifyH ("center")
+ f.prompt = prompt
+
+ local button_true = DF:CreateButton (f, nil, 60, 20, "Okey")
+ button_true:SetPoint ("bottomleft", f, "bottomleft", 10, 5)
+ f.button_true = button_true
+
+ local button_false = DF:CreateButton (f, function() f.textbox:ClearFocus(); f:Hide() end, 60, 20, "Cancel")
+ button_false:SetPoint ("bottomright", f, "bottomright", -10, 5)
+ f.button_false = button_false
+
+ local textbox = DF:CreateTextEntry (f, function()end, 380, 20, "textbox", nil, nil, nil, nil)
+ textbox:SetPoint ("topleft", f, "topleft", 10, -45)
+
+ button_true:SetClickFunction (function()
+ local my_func = button_true.true_function
+ if (my_func) then
+ local okey, errormessage = pcall (my_func, textbox:GetText())
+ textbox:ClearFocus()
+ if (not okey) then
+ print ("error:", errormessage)
+ end
+ f:Hide()
+ end
+ end)
+
+ f:Hide()
+ DF.text_prompt_panel = f
+ end
+
+ DF.text_prompt_panel:Show()
+
+ DF.text_prompt_panel.prompt:SetText (message)
+ DF.text_prompt_panel.button_true.true_function = callback
+ DF.text_prompt_panel.textbox:SetText ("")
+ DF.text_prompt_panel.textbox:SetFocus (true)
+
+end
+
+------------------------------------------------------------------------------------------------------------------------------------------------
+--> options button -- ~options
+function DF:CreateOptionsButton (parent, callback, name)
+
+ local b = CreateFrame ("button", name, parent)
+ b:SetSize (14, 14)
+ b:SetNormalTexture (DF.folder .. "icons")
+ b:SetHighlightTexture (DF.folder .. "icons")
+ b:SetPushedTexture (DF.folder .. "icons")
+ b:GetNormalTexture():SetTexCoord (48/128, 64/128, 0, 1)
+ b:GetHighlightTexture():SetTexCoord (48/128, 64/128, 0, 1)
+ b:GetPushedTexture():SetTexCoord (48/128, 64/128, 0, 1)
+ b:SetAlpha (0.7)
+
+ b:SetScript ("OnClick", callback)
+ b:SetScript ("OnEnter", function (self)
+ GameCooltip2:Reset()
+ GameCooltip2:AddLine ("Options")
+ GameCooltip2:ShowCooltip (self, "tooltip")
+ end)
+ b:SetScript ("OnLeave", function (self)
+ GameCooltip2:Hide()
+ end)
+
+ return b
+
+end
+
+------------------------------------------------------------------------------------------------------------------------------------------------
+--> feedback panel -- ~feedback
+
+function DF:CreateFeedbackButton (parent, callback, name)
+ local b = CreateFrame ("button", name, parent)
+ b:SetSize (12, 13)
+ b:SetNormalTexture (DF.folder .. "mail")
+ b:SetPushedTexture (DF.folder .. "mail")
+ b:SetHighlightTexture (DF.folder .. "mail")
+
+ b:SetScript ("OnClick", callback)
+ b:SetScript ("OnEnter", function (self)
+ GameCooltip2:Reset()
+ GameCooltip2:AddLine ("Send Feedback")
+ GameCooltip2:ShowCooltip (self, "tooltip")
+ end)
+ b:SetScript ("OnLeave", function (self)
+ GameCooltip2:Hide()
+ end)
+
+ return b
+end
+
+local backdrop_fb_line = {bgFile = DF.folder .. "background", edgeFile = DF.folder .. "border_3",
+tile = true, tileSize = 64, edgeSize = 8, insets = {left = 2, right = 2, top = 2, bottom = 2}}
+
+local on_enter_feedback = function (self)
+ self:SetBackdropColor (1, 1, 0, 0.5)
+end
+local on_leave_feedback = function (self)
+ self:SetBackdropColor (0, 0, 0, 0.3)
+end
+
+local on_click_feedback = function (self)
+
+ local feedback_link_textbox = DF.feedback_link_textbox
+
+ if (not feedback_link_textbox) then
+ local editbox = DF:CreateTextEntry (AddonFeedbackPanel, _, 275, 34)
+ editbox:SetAutoFocus (false)
+ editbox:SetHook ("OnEditFocusGained", function()
+ editbox.text = editbox.link
+ editbox:HighlightText()
+ end)
+ editbox:SetHook ("OnEditFocusLost", function()
+ editbox:Hide()
+ end)
+ editbox:SetHook ("OnChar", function()
+ editbox.text = editbox.link
+ editbox:HighlightText()
+ end)
+ editbox.text = ""
+
+ DF.feedback_link_textbox = editbox
+ feedback_link_textbox = editbox
+ end
+
+ feedback_link_textbox.link = self.link
+ feedback_link_textbox.text = self.link
+ feedback_link_textbox:Show()
+
+ feedback_link_textbox:SetPoint ("topleft", self.icon, "topright", 3, 0)
+
+ feedback_link_textbox:HighlightText()
+
+ feedback_link_textbox:SetFocus()
+ feedback_link_textbox:SetFrameLevel (self:GetFrameLevel()+2)
+end
+
+local feedback_get_fb_line = function (self)
+
+ local line = self.feedback_lines [self.next_feedback]
+ if (not line) then
+ line = CreateFrame ("frame", "AddonFeedbackPanelFB" .. self.next_feedback, self)
+ line:SetBackdrop (backdrop_fb_line)
+ line:SetBackdropColor (0, 0, 0, 0.3)
+ line:SetSize (390, 42)
+ line:SetPoint ("topleft", self.feedback_anchor, "bottomleft", 0, -5 + ((self.next_feedback-1) * 46 * -1))
+ line:SetScript ("OnEnter", on_enter_feedback)
+ line:SetScript ("OnLeave", on_leave_feedback)
+ line:SetScript ("OnMouseUp", on_click_feedback)
+
+ line.icon = line:CreateTexture (nil, "overlay")
+ line.icon:SetSize (90, 36)
+
+ line.desc = line:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
+
+ line.icon:SetPoint ("left", line, "left", 5, 0)
+ line.desc:SetPoint ("left", line.icon, "right", 5, 0)
+
+ local arrow = line:CreateTexture (nil, "overlay")
+ arrow:SetTexture ([[Interface\Buttons\JumpUpArrow]])
+ arrow:SetRotation (-1.55)
+ arrow:SetPoint ("right", line, "right", -5, 0)
+
+ self.feedback_lines [self.next_feedback] = line
+ end
+
+ self.next_feedback = self.next_feedback + 1
+
+ return line
+end
+
+local on_click_feedback = function (self)
+
+ local feedback_link_textbox = DF.feedback_link_textbox
+
+ if (not feedback_link_textbox) then
+ local editbox = DF:CreateTextEntry (AddonFeedbackPanel, _, 275, 34)
+ editbox:SetAutoFocus (false)
+ editbox:SetHook ("OnEditFocusGained", function()
+ editbox.text = editbox.link
+ editbox:HighlightText()
+ end)
+ editbox:SetHook ("OnEditFocusLost", function()
+ editbox:Hide()
+ end)
+ editbox:SetHook ("OnChar", function()
+ editbox.text = editbox.link
+ editbox:HighlightText()
+ end)
+ editbox.text = ""
+
+ DF.feedback_link_textbox = editbox
+ feedback_link_textbox = editbox
+ end
+
+ feedback_link_textbox.link = self.link
+ feedback_link_textbox.text = self.link
+ feedback_link_textbox:Show()
+
+ feedback_link_textbox:SetPoint ("topleft", self.icon, "topright", 3, 0)
+
+ feedback_link_textbox:HighlightText()
+
+ feedback_link_textbox:SetFocus()
+ feedback_link_textbox:SetFrameLevel (self:GetFrameLevel()+2)
+end
+
+local on_enter_addon = function (self)
+ if (self.tooltip) then
+ GameCooltip2:Preset (2)
+ GameCooltip2:AddLine ("|cFFFFFF00" .. self.name .. "|r")
+ GameCooltip2:AddLine ("")
+ GameCooltip2:AddLine (self.tooltip)
+ GameCooltip2:ShowCooltip (self, "tooltip")
+ end
+ self.icon:SetBlendMode ("ADD")
+end
+local on_leave_addon = function (self)
+ if (self.tooltip) then
+ GameCooltip2:Hide()
+ end
+ self.icon:SetBlendMode ("BLEND")
+end
+local on_click_addon = function (self)
+ local addon_link_textbox = DF.addon_link_textbox
+
+ if (not addon_link_textbox) then
+ local editbox = DF:CreateTextEntry (AddonFeedbackPanel, _, 128, 64)
+ editbox:SetAutoFocus (false)
+ editbox:SetHook ("OnEditFocusGained", function()
+ editbox.text = editbox.link
+ editbox:HighlightText()
+ end)
+ editbox:SetHook ("OnEditFocusLost", function()
+ editbox:Hide()
+ end)
+ editbox:SetHook ("OnChar", function()
+ editbox.text = editbox.link
+ editbox:HighlightText()
+ end)
+ editbox.text = ""
+
+ DF.addon_link_textbox = editbox
+ addon_link_textbox = editbox
+ end
+
+ addon_link_textbox.link = self.link
+ addon_link_textbox.text = self.link
+ addon_link_textbox:Show()
+
+ addon_link_textbox:SetPoint ("topleft", self.icon, "topleft", 0, 0)
+
+ addon_link_textbox:HighlightText()
+
+ addon_link_textbox:SetFocus()
+ addon_link_textbox:SetFrameLevel (self:GetFrameLevel()+2)
+end
+
+local feedback_get_addons_line = function (self)
+ local line = self.addons_lines [self.next_addons]
+ if (not line) then
+
+ line = CreateFrame ("frame", "AddonFeedbackPanelSA" .. self.next_addons, self)
+ line:SetSize (128, 64)
+
+ if (self.next_addons == 1) then
+ line:SetPoint ("topleft", self.addons_anchor, "bottomleft", 0, -5)
+ elseif (self.next_addons_line_break == self.next_addons) then
+ line:SetPoint ("topleft", self.addons_anchor, "bottomleft", 0, -5 + floor (self.next_addons_line_break/3) * 66 * -1)
+ self.next_addons_line_break = self.next_addons_line_break + 3
+ else
+ local previous = self.addons_lines [self.next_addons - 1]
+ line:SetPoint ("topleft", previous, "topright", 2, 0)
+ end
+
+ line:SetScript ("OnEnter", on_enter_addon)
+ line:SetScript ("OnLeave", on_leave_addon)
+ line:SetScript ("OnMouseUp", on_click_addon)
+
+ line.icon = line:CreateTexture (nil, "overlay")
+ line.icon:SetSize (128, 64)
+
+ line.icon:SetPoint ("topleft", line, "topleft", 0, 0)
+
+ self.addons_lines [self.next_addons] = line
+ end
+
+ self.next_addons = self.next_addons + 1
+
+ return line
+end
+
+local default_coords = {0, 1, 0, 1}
+local feedback_add_fb = function (self, table)
+ local line = self:GetFeedbackLine()
+ line.icon:SetTexture (table.icon)
+ line.icon:SetTexCoord (unpack (table.coords or default_coords))
+ line.desc:SetText (table.desc)
+ line.link = table.link
+ line:Show()
+end
+
+local feedback_add_addon = function (self, table)
+ local block = self:GetAddonsLine()
+ block.icon:SetTexture (table.icon)
+ block.icon:SetTexCoord (unpack (table.coords or default_coords))
+ block.link = table.link
+ block.tooltip = table.desc
+ block.name = table.name
+ block:Show()
+end
+
+local feedback_hide_all = function (self)
+ self.next_feedback = 1
+ self.next_addons = 1
+
+ for index, line in ipairs (self.feedback_lines) do
+ line:Hide()
+ end
+
+ for index, line in ipairs (self.addons_lines) do
+ line:Hide()
+ end
+end
+
+-- feedback_methods = { { icon = icon path, desc = description, link = url}}
+function DF:ShowFeedbackPanel (addon_name, version, feedback_methods, more_addons)
+
+ local f = _G.AddonFeedbackPanel
+
+ if (not f) then
+ f = DF:Create1PxPanel (UIParent, 400, 100, addon_name .. " Feedback", "AddonFeedbackPanel", nil)
+ f:SetFrameStrata ("FULLSCREEN")
+ f:SetPoint ("center", UIParent, "center")
+ f:SetBackdropColor (0, 0, 0, 0.8)
+ f.feedback_lines = {}
+ f.addons_lines = {}
+ f.next_feedback = 1
+ f.next_addons = 1
+ f.next_addons_line_break = 4
+
+ local feedback_anchor = f:CreateFontString (nil, "overlay", "GameFontNormal")
+ feedback_anchor:SetText ("Feedback:")
+ feedback_anchor:SetPoint ("topleft", f, "topleft", 5, -30)
+ f.feedback_anchor = feedback_anchor
+ local excla_text = f:CreateFontString (nil, "overlay", "GameFontNormal")
+ excla_text:SetText ("click and copy the link")
+ excla_text:SetPoint ("topright", f, "topright", -5, -30)
+ excla_text:SetTextColor (1, 0.8, 0.2, 0.6)
+
+ local addons_anchor = f:CreateFontString (nil, "overlay", "GameFontNormal")
+ addons_anchor:SetText ("AddOns From the Same Author:")
+ f.addons_anchor = addons_anchor
+ local excla_text2 = f:CreateFontString (nil, "overlay", "GameFontNormal")
+ excla_text2:SetText ("click and copy the link")
+ excla_text2:SetTextColor (1, 0.8, 0.2, 0.6)
+ f.excla_text2 = excla_text2
+
+ f.GetFeedbackLine = feedback_get_fb_line
+ f.GetAddonsLine = feedback_get_addons_line
+ f.AddFeedbackMethod = feedback_add_fb
+ f.AddOtherAddon = feedback_add_addon
+ f.HideAll = feedback_hide_all
+
+ DF:SetFontSize (f.Title, 14)
+
+ end
+
+ f:HideAll()
+ f:SetTitle (addon_name)
+
+ for index, feedback in ipairs (feedback_methods) do
+ f:AddFeedbackMethod (feedback)
+ end
+
+ f.addons_anchor:SetPoint ("topleft", f, "topleft", 5, f.next_feedback * 50 * -1)
+ f.excla_text2:SetPoint ("topright", f, "topright", -5, f.next_feedback * 50 * -1)
+
+ for index, addon in ipairs (more_addons) do
+ f:AddOtherAddon (addon)
+ end
+
+ f:SetHeight (80 + ((f.next_feedback-1) * 50) + (ceil ((f.next_addons-1)/3) * 66))
+
+ f:Show()
+
+ return true
+end
+
+
+------------------------------------------------------------------------------------------------------------------------------------------------
+--> chart panel -- ~chart
local chart_panel_backdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", edgeSize = 32, insets = {left = 5, right = 5, top = 5, bottom = 5}}
@@ -1552,13 +2243,17 @@ local chart_panel_set_scale = function (self, amt, func, text)
return
end
- local piece = amt / 8
+ local piece = amt / 1000 / 8
for i = 1, 8 do
if (func) then
self ["dpsamt" .. math.abs (i-9)]:SetText ( func (piece*i) .. (text or ""))
else
- self ["dpsamt" .. math.abs (i-9)]:SetText ( floor (piece*i) .. (text or ""))
+ if (piece*i > 1) then
+ self ["dpsamt" .. math.abs (i-9)]:SetText ( floor (piece*i) .. (text or ""))
+ else
+ self ["dpsamt" .. math.abs (i-9)]:SetText ( format ("%.3f", piece*i) .. (text or ""))
+ end
end
end
end
@@ -1659,14 +2354,17 @@ local create_box = function (self, next_box)
local thisbox = {}
self.BoxLabels [next_box] = thisbox
- local box = gump:NewImage (self.Graphic, nil, 16, 16, "border")
- local text = gump:CreateLabel (self.Graphic, nil, nil, nil, "GameFontNormal")
+ local box = DF:NewImage (self.Graphic, nil, 16, 16, "border")
- local border = gump:NewImage (self.Graphic, [[Interface\DialogFrame\UI-DialogBox-Gold-Corner]], 30, 30, "artwork")
+ local text = DF:NewLabel (self.Graphic)
+
+ local border = DF:NewImage (self.Graphic, [[Interface\DialogFrame\UI-DialogBox-Gold-Corner]], 30, 30, "artwork")
border:SetPoint ("center", box, "center", -3, -4)
+ border:SetTexture ([[Interface\DialogFrame\UI-DialogBox-Gold-Corner]])
- local checktexture = gump:NewImage (self.Graphic, [[Interface\Buttons\UI-CheckBox-Check]], 18, 18, "overlay")
+ local checktexture = DF:NewImage (self.Graphic, [[Interface\Buttons\UI-CheckBox-Check]], 18, 18, "overlay")
checktexture:SetPoint ("center", box, "center", -1, -1)
+ checktexture:SetTexture ([[Interface\Buttons\UI-CheckBox-Check]])
thisbox.box = box
thisbox.text = text
@@ -1674,7 +2372,11 @@ local create_box = function (self, next_box)
thisbox.check = checktexture
thisbox.enabled = true
- local button = gump:CreateButton (self.Graphic, chart_panel_enable_line, 20, 20, "", self, thisbox)
+ local button = CreateFrame ("button", nil, self.Graphic)
+ button:SetSize (20, 20)
+ button:SetScript ("OnClick", function()
+ chart_panel_enable_line (self, thisbox)
+ end)
button:SetPoint ("center", box, "center")
thisbox.button = button
@@ -1945,6 +2647,7 @@ local chart_panel_add_data = function (self, graphicData, color, name, elapsed_t
self.max_value = max_value
f:SetScale (max_value)
+
end
tinsert (f.GData, {_data, color or line_default_color, lineTexture, max_value, elapsed_time})
@@ -1989,7 +2692,7 @@ local chart_panel_onresize = function (self)
for i = 1, 17 do
local label = self.TimeLabels [i]
- label:SetPoint ("bottomleft", f, "bottomleft", 78 + ((i-1)*spacement), 13)
+ label:SetPoint ("bottomleft", self, "bottomleft", 78 + ((i-1)*spacement), 13)
label.line:SetHeight (height - 45)
end
@@ -2054,11 +2757,11 @@ local chart_panel_right_click_close = function (self, value)
end
end
-function gump:CreateChartPanel (parent, w, h, name)
+function DF:CreateChartPanel (parent, w, h, name)
if (not name) then
- name = "DetailsPanelNumber" .. gump.PanelCounter
- gump.PanelCounter = gump.PanelCounter + 1
+ name = "DFPanel" .. DF.PanelCounter
+ DF.PanelCounter = DF.PanelCounter + 1
end
parent = parent or UIParent
@@ -2084,11 +2787,10 @@ function gump:CreateChartPanel (parent, w, h, name)
c:SetAlpha (0.9)
f.CloseButton = c
- local title = gump:NewLabel (f, nil, "$parentTitle", "chart_title", "Chart!", nil, 20, "yellow")
- title:SetPoint (110, -13)
- _detalhes:SetFontOutline (title, true)
+ local title = DF:NewLabel (f, nil, "$parentTitle", "chart_title", "Chart!", nil, 20, {1, 1, 0})
+ title:SetPoint ("topleft", f, "topleft", 110, -13)
- local bottom_texture = gump:NewImage (f, nil, 702, 25, "background", nil, nil, "$parentBottomTexture")
+ local bottom_texture = DF:NewImage (f, nil, 702, 25, "background", nil, nil, "$parentBottomTexture")
bottom_texture:SetTexture (0, 0, 0, .6)
bottom_texture:SetPoint ("bottomleft", f, "bottomleft", 8, 7)
bottom_texture:SetPoint ("bottomright", f, "bottomright", -8, 7)
@@ -2101,12 +2803,16 @@ function gump:CreateChartPanel (parent, w, h, name)
f.TimeLabels = {}
for i = 1, 17 do
- local time = gump:NewLabel (f, nil, "$parentTime"..i, nil, "00:00")
+ local time = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
+ time:SetText ("00:00")
time:SetPoint ("bottomleft", f, "bottomleft", 78 + ((i-1)*36), 13)
f.TimeLabels [i] = time
- local line = gump:NewImage (f, nil, 1, h-45, "border", nil, nil, "$parentTime"..i.."Bar")
+
+ local line = f:CreateTexture (nil, "border")
+ line:SetSize (1, h-45)
line:SetTexture (1, 1, 1, .1)
line:SetPoint ("bottomleft", time, "topright", 0, -10)
+ line:Hide()
time.line = line
end
@@ -2132,9 +2838,6 @@ function gump:CreateChartPanel (parent, w, h, name)
f.Graphic = g
f.GData = {}
f.OData = {}
-
- g:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16})
- g:SetBackdropColor (0, 0, 0, 0.8)
--div lines
for i = 1, 8, 1 do
@@ -2143,10 +2846,13 @@ function gump:CreateChartPanel (parent, w, h, name)
line:SetWidth (670)
line:SetHeight (1.1)
- gump:NewLabel (f, f, nil, "dpsamt"..i, "100k", "GameFontHighlightSmall")
- f["dpsamt"..i]:SetPoint ("TOPLEFT", f, "TOPLEFT", 27, -61 + (-(24.6*i)))
- line:SetPoint ("topleft", f["dpsamt"..i].widget, "bottom", -27, 0)
- f["dpsamt"..i].line = line
+ local s = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
+ f ["dpsamt"..i] = s
+ s:SetText ("100k")
+ s:SetPoint ("topleft", f, "topleft", 27, -61 + (-(24.6*i)))
+
+ line:SetPoint ("topleft", s, "bottom", -27, 0)
+ s.line = line
end
f.SetTime = chart_panel_align_timelabels
@@ -2311,7 +3017,7 @@ local gframe_update = function (self, lines)
end
-function gump:CreateGFrame (parent, w, h, linewidth, onenter, onleave, member, name)
+function DF:CreateGFrame (parent, w, h, linewidth, onenter, onleave, member, name)
local f = CreateFrame ("frame", name, parent)
f:SetSize (w or 450, h or 150)
f.CustomLine = [[Interface\AddOns\Details\Libs\LibGraph-2.0\line]]
@@ -2334,100 +3040,4 @@ function gump:CreateGFrame (parent, w, h, linewidth, onenter, onleave, member, n
f._maxlines = floor (f:GetWidth() / f._linewidth)
return f
-end
-
---[=[
-
-function gframe:Reset()
- for i = #gframe.GraphLib_Lines_Used, 1, -1 do
- local line = tremove (gframe.GraphLib_Lines_Used)
- tinsert (gframe.GraphLib_Lines, line)
- line:Hide()
- end
-end
-
-function DeathGraphs:ShowGraphicForDeath (data)
-
- gframe:Reset()
- gframe:ShowGrid()
- gframe:Show()
-
- if (not data) then
- return
- end
-
- local timeline = data [1]
- local max_health = data[4]
-
- if (#timeline < 16) then
- while (#timeline < 16) do
- table.insert (timeline, 1, {false, 0, 0, data[6], max_health, "-1"})
- end
- end
-
- log = timeline
-
- local h = gframe:GetHeight()/100
-
- local o = 1
- local lastlife = 156
-
- --for i = 16, 1, -1 do
- for i = 1, 16, 1 do
- local t = timeline [i]
- if (type (t) == "table") then
-
- --> death parser
-
- local evtype = t [1] --event type
- local spellid = t [2] --spellid
- local amount = t [3] --amount healed or damaged
- local time = t [4] --time
- local life = t [5] --health
- local source = t [6] --source
-
- local plife = life / max_health * 100
- if (plife > 98) then
- plife = 98
- end
- plife = plife*h
-
- local line
-
- line = g:DrawLine (gframe, (o-1)*29, lastlife, o*29, plife, 50, red, "overlay")
-
- local ball = gballs [o]
- ball:SetPoint ("bottomleft", gframe, "bottomleft", (o*29)-8, plife-8)
- if (type (evtype) == "boolean" and evtype) then --> damage
- ball.spellicon:SetTexture (select (3, GetSpellInfo (spellid)))
- ball.spellicon:SetTexCoord (4/64, 60/64, 4/64, 60/64)
- else
- ball.spellicon:SetTexture (nil)
- end
-
- ball.line = line
-
- local clock = data[6] - time
- if (type (evtype) == "number" and evtype == 2) then
- if (clock <= 100) then
- timeline_bg.labels [o]:SetText (math.floor (clock))
- else
- timeline_bg.labels [o]:SetText (string.format ("%.1f", clock))
- end
- else
- timeline_bg.labels [o]:SetText ("-" .. string.format ("%.1f", clock))
- end
-
- local frame = gradeframes [o]
- frame.data = t
-
- lastlife = plife
- o = o + 1
- end
- end
-
- DeathGraphs:UpdateOverall()
-
-end
-
---]=]
\ No newline at end of file
+end
\ No newline at end of file
diff --git a/framework/panel.xml b/Libs/DF/panel.xml
similarity index 89%
rename from framework/panel.xml
rename to Libs/DF/panel.xml
index 1d778e2a..f3b4d510 100644
--- a/framework/panel.xml
+++ b/Libs/DF/panel.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/framework/picture.lua b/Libs/DF/picture.lua
similarity index 83%
rename from framework/picture.lua
rename to Libs/DF/picture.lua
index e57f694c..1dbbab96 100644
--- a/framework/picture.lua
+++ b/Libs/DF/picture.lua
@@ -1,6 +1,9 @@
---> details main objects
-local _detalhes = _G._detalhes
-local gump = _detalhes.gump
+
+local DF = _G ["DetailsFramework"]
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
local _
local _rawset = rawset --> lua local
local _rawget = rawget --> lua local
@@ -14,7 +17,6 @@ local cleanfunction = function() end
local APIImageFunctions = false
local ImageMetaFunctions = {}
-
------------------------------------------------------------------------------------------------------------
--> metatables
@@ -90,11 +92,11 @@ local ImageMetaFunctions = {}
--> texture
local smember_texture = function (_object, _value)
if (type (_value) == "table") then
- local r, g, b, a = gump:ParseColors (_value)
+ local r, g, b, a = DF:ParseColors (_value)
_object.image:SetTexture (r, g, b, a or 1)
else
- if (gump:IsHtmlColor (_value)) then
- local r, g, b, a = gump:ParseColors (_value)
+ if (DF:IsHtmlColor (_value)) then
+ local r, g, b, a = DF:ParseColors (_value)
_object.image:SetTexture (r, g, b, a or 1)
else
_object.image:SetTexture (_value)
@@ -116,11 +118,11 @@ local ImageMetaFunctions = {}
--> color
local smember_color = function (_object, _value)
if (type (_value) == "table") then
- local r, g, b, a = gump:ParseColors (_value)
+ local r, g, b, a = DF:ParseColors (_value)
_object.image:SetTexture (r,g,b, a or 1)
else
- if (gump:IsHtmlColor (_value)) then
- local r, g, b, a = gump:ParseColors (_value)
+ if (DF:IsHtmlColor (_value)) then
+ local r, g, b, a = DF:ParseColors (_value)
_object.image:SetTexture (r, g, b, a or 1)
else
_object.image:SetTexture (_value)
@@ -180,7 +182,7 @@ local ImageMetaFunctions = {}
-- setpoint
function ImageMetaFunctions:SetPoint (v1, v2, v3, v4, v5)
- v1, v2, v3, v4, v5 = gump:CheckPoints (v1, v2, v3, v4, v5, self)
+ v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self)
if (not v1) then
print ("Invalid parameter for SetPoint")
return
@@ -204,19 +206,19 @@ local ImageMetaFunctions = {}
------------------------------------------------------------------------------------------------------------
--> object constructor
-function gump:CreateImage (parent, texture, w, h, layer, coords, member, name)
- return gump:NewImage (parent, texture, w, h, layer, coords, member, name)
+function DF:CreateImage (parent, texture, w, h, layer, coords, member, name)
+ return DF:NewImage (parent, texture, w, h, layer, coords, member, name)
end
-function gump:NewImage (parent, texture, w, h, layer, coords, member, name)
+function DF:NewImage (parent, texture, w, h, layer, coords, member, name)
if (not parent) then
return nil
end
if (not name) then
- name = "DetailsPictureNumber" .. gump.PictureNameCounter
- gump.PictureNameCounter = gump.PictureNameCounter + 1
+ name = "DetailsFrameworkPictureNumber" .. DF.PictureNameCounter
+ DF.PictureNameCounter = DF.PictureNameCounter + 1
end
if (name:find ("$parent")) then
@@ -244,7 +246,7 @@ function gump:NewImage (parent, texture, w, h, layer, coords, member, name)
for funcName, funcAddress in pairs (idx) do
if (not ImageMetaFunctions [funcName]) then
ImageMetaFunctions [funcName] = function (object, ...)
- local x = loadstring ( "return _G."..object.image:GetName()..":"..funcName.."(...)")
+ local x = loadstring ( "return _G['"..object.image:GetName().."']:"..funcName.."(...)")
return x (...)
end
end
@@ -261,11 +263,11 @@ function gump:NewImage (parent, texture, w, h, layer, coords, member, name)
end
if (texture) then
if (type (texture) == "table") then
- local r, g, b = gump:ParseColors (texture)
+ local r, g, b = DF:ParseColors (texture)
ImageObject.image:SetTexture (r,g,b)
else
- if (gump:IsHtmlColor (texture)) then
- local r, g, b = gump:ParseColors (texture)
+ if (DF:IsHtmlColor (texture)) then
+ local r, g, b = DF:ParseColors (texture)
ImageObject.image:SetTexture (r, g, b)
else
ImageObject.image:SetTexture (texture)
diff --git a/framework/pictureedit.lua b/Libs/DF/pictureedit.lua
similarity index 72%
rename from framework/pictureedit.lua
rename to Libs/DF/pictureedit.lua
index 1690ac04..7435527f 100644
--- a/framework/pictureedit.lua
+++ b/Libs/DF/pictureedit.lua
@@ -1,28 +1,30 @@
-local _detalhes = _G._detalhes
-local g = _detalhes.gump
-local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
+
+local DF = _G ["DetailsFramework"]
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
local _
- local window = g:NewPanel (UIParent, nil, "DetailsImageEdit", nil, 100, 100, false)
+ local window = DF:NewPanel (UIParent, nil, "DetailsFrameworkImageEdit", nil, 100, 100, false)
window:SetPoint ("center", UIParent, "center")
window:SetResizable (true)
window:SetMovable (true)
- tinsert (UISpecialFrames, "DetailsImageEdit")
+ tinsert (UISpecialFrames, "DetailsFrameworkImageEdit")
window:SetFrameStrata ("TOOLTIP")
-
window:SetMaxResize (266, 226)
window.hooks = {}
- local background = g:NewImage (window, nil, nil, nil, "background", nil, nil, "$parentBackground")
+ local background = DF:NewImage (window, nil, nil, nil, "background", nil, nil, "$parentBackground")
background:SetAllPoints()
background:SetTexture (0, 0, 0, .8)
- local edit_texture = g:NewImage (window, nil, 300, 250, "artwork", nil, nil, "$parentImage")
+ local edit_texture = DF:NewImage (window, nil, 300, 250, "artwork", nil, nil, "$parentImage")
edit_texture:SetAllPoints()
- local background_frame = CreateFrame ("frame", "DetailsImageEditBackground", DetailsImageEdit)
- background_frame:SetPoint ("topleft", DetailsImageEdit, "topleft", -10, 12)
+ local background_frame = CreateFrame ("frame", "DetailsFrameworkImageEditBackground", DetailsFrameworkImageEdit)
+ background_frame:SetPoint ("topleft", DetailsFrameworkImageEdit, "topleft", -10, 12)
background_frame:SetFrameStrata ("DIALOG")
background_frame:SetSize (400, 252)
@@ -36,23 +38,23 @@ local _
window:StopMovingOrSizing()
end)
- background_frame:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 64,
- edgeFile = [[Interface\AddOns\Details\images\border_3]], edgeSize = 9, insets = {left = 2, right = 2, top = 3, bottom = 3}})
- background_frame:SetBackdropColor (0, 0, 0, 0.95)
+ background_frame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
+ background_frame:SetBackdropColor (0, 0, 0, 0.9)
+ background_frame:SetBackdropBorderColor (0, 0, 0, 1)
local haveHFlip = false
local haveVFlip = false
--> Top Slider
- local topCoordTexture = g:NewImage (window, nil, nil, nil, "overlay", nil, nil, "$parentImageTopCoord")
+ local topCoordTexture = DF:NewImage (window, nil, nil, nil, "overlay", nil, nil, "$parentImageTopCoord")
topCoordTexture:SetPoint ("topleft", window, "topleft")
topCoordTexture:SetPoint ("topright", window, "topright")
topCoordTexture.color = "red"
topCoordTexture.height = 1
topCoordTexture.alpha = .2
- local topSlider = g:NewSlider (window, nil, "$parentTopSlider", "topSlider", 100, 100, 0.1, 100, 0.1, 0)
+ local topSlider = DF:NewSlider (window, nil, "$parentTopSlider", "topSlider", 100, 100, 0.1, 100, 0.1, 0)
topSlider:SetAllPoints (window.widget)
topSlider:SetOrientation ("VERTICAL")
topSlider.backdrop = nil
@@ -69,7 +71,7 @@ local _
topSlider:SetHook ("OnValueChange", function (_, _, value)
topCoordTexture.image:SetHeight (window.frame:GetHeight()/100*value)
if (window.callback_func) then
- window.accept (true)
+ window.accept (nil, nil, true)
end
end)
@@ -77,14 +79,14 @@ local _
--> Bottom Slider
- local bottomCoordTexture = g:NewImage (window, nil, nil, nil, "overlay", nil, nil, "$parentImageBottomCoord")
+ local bottomCoordTexture = DF:NewImage (window, nil, nil, nil, "overlay", nil, nil, "$parentImageBottomCoord")
bottomCoordTexture:SetPoint ("bottomleft", window, "bottomleft", 0, 0)
bottomCoordTexture:SetPoint ("bottomright", window, "bottomright", 0, 0)
bottomCoordTexture.color = "red"
bottomCoordTexture.height = 1
bottomCoordTexture.alpha = .2
- local bottomSlider= g:NewSlider (window, nil, "$parentBottomSlider", "bottomSlider", 100, 100, 0.1, 100, 0.1, 100)
+ local bottomSlider= DF:NewSlider (window, nil, "$parentBottomSlider", "bottomSlider", 100, 100, 0.1, 100, 0.1, 100)
bottomSlider:SetAllPoints (window.widget)
bottomSlider:SetOrientation ("VERTICAL")
bottomSlider.backdrop = nil
@@ -102,7 +104,7 @@ local _
value = math.abs (value-100)
bottomCoordTexture.image:SetHeight (math.max (window.frame:GetHeight()/100*value, 1))
if (window.callback_func) then
- window.accept (true)
+ window.accept (nil, nil, true)
end
end)
@@ -110,14 +112,14 @@ local _
--> Left Slider
- local leftCoordTexture = g:NewImage (window, nil, nil, nil, "overlay", nil, nil, "$parentImageLeftCoord")
+ local leftCoordTexture = DF:NewImage (window, nil, nil, nil, "overlay", nil, nil, "$parentImageLeftCoord")
leftCoordTexture:SetPoint ("topleft", window, "topleft", 0, 0)
leftCoordTexture:SetPoint ("bottomleft", window, "bottomleft", 0, 0)
leftCoordTexture.color = "red"
leftCoordTexture.width = 1
leftCoordTexture.alpha = .2
- local leftSlider = g:NewSlider (window, nil, "$parentLeftSlider", "leftSlider", 100, 100, 0.1, 100, 0.1, 0.1)
+ local leftSlider = DF:NewSlider (window, nil, "$parentLeftSlider", "leftSlider", 100, 100, 0.1, 100, 0.1, 0.1)
leftSlider:SetAllPoints (window.widget)
leftSlider.backdrop = nil
leftSlider.fractional = true
@@ -133,7 +135,7 @@ local _
leftSlider:SetHook ("OnValueChange", function (_, _, value)
leftCoordTexture.image:SetWidth (window.frame:GetWidth()/100*value)
if (window.callback_func) then
- window.accept (true)
+ window.accept (nil, nil, true)
end
end)
@@ -141,14 +143,14 @@ local _
--> Right Slider
- local rightCoordTexture = g:NewImage (window, nil, nil, nil, "overlay", nil, nil, "$parentImageRightCoord")
+ local rightCoordTexture = DF:NewImage (window, nil, nil, nil, "overlay", nil, nil, "$parentImageRightCoord")
rightCoordTexture:SetPoint ("topright", window, "topright", 0, 0)
rightCoordTexture:SetPoint ("bottomright", window, "bottomright", 0, 0)
rightCoordTexture.color = "red"
rightCoordTexture.width = 1
rightCoordTexture.alpha = .2
- local rightSlider = g:NewSlider (window, nil, "$parentRightSlider", "rightSlider", 100, 100, 0.1, 100, 0.1, 100)
+ local rightSlider = DF:NewSlider (window, nil, "$parentRightSlider", "rightSlider", 100, 100, 0.1, 100, 0.1, 100)
rightSlider:SetAllPoints (window.widget)
rightSlider.backdrop = nil
rightSlider.fractional = true
@@ -165,7 +167,7 @@ local _
value = math.abs (value-100)
rightCoordTexture.image:SetWidth (math.max (window.frame:GetWidth()/100*value, 1))
if (window.callback_func) then
- window.accept (true)
+ window.accept (nil, nil, true)
end
end)
@@ -173,12 +175,12 @@ local _
--> Edit Buttons
- local buttonsBackground = g:NewPanel (UIParent, nil, "DetailsImageEditButtonsBg", nil, 115, 230)
+ local buttonsBackground = DF:NewPanel (UIParent, nil, "DetailsFrameworkImageEditButtonsBg", nil, 115, 230)
--buttonsBackground:SetPoint ("topleft", window, "topright", 2, 0)
buttonsBackground:SetPoint ("topright", background_frame, "topright", -8, -10)
buttonsBackground:Hide()
--buttonsBackground:SetMovable (true)
- tinsert (UISpecialFrames, "DetailsImageEditButtonsBg")
+ tinsert (UISpecialFrames, "DetailsFrameworkImageEditButtonsBg")
buttonsBackground:SetFrameStrata ("TOOLTIP")
local alphaFrameShown = false
@@ -188,7 +190,7 @@ local _
local alphaFrame
local originalColor = {0.9999, 0.8196, 0}
- local enableTexEdit = function (side, _, button)
+ local enableTexEdit = function (button, b, side)
if (alphaFrameShown) then
alphaFrame:Hide()
@@ -220,20 +222,20 @@ local _
window [side.."Slider"]:Show()
end
- local leftTexCoordButton = g:NewButton (buttonsBackground, nil, "$parentLeftTexButton", nil, 100, 20, enableTexEdit, "left", nil, nil, Loc ["STRING_IMAGEEDIT_CROPLEFT"], 1)
+ local leftTexCoordButton = DF:NewButton (buttonsBackground, nil, "$parentLeftTexButton", nil, 100, 20, enableTexEdit, "left", nil, nil, "Crop Left", 1)
leftTexCoordButton:SetPoint ("topright", buttonsBackground, "topright", -8, -10)
- local rightTexCoordButton = g:NewButton (buttonsBackground, nil, "$parentRightTexButton", nil, 100, 20, enableTexEdit, "right", nil, nil, Loc ["STRING_IMAGEEDIT_CROPRIGHT"], 1)
+ local rightTexCoordButton = DF:NewButton (buttonsBackground, nil, "$parentRightTexButton", nil, 100, 20, enableTexEdit, "right", nil, nil, "Crop Right", 1)
rightTexCoordButton:SetPoint ("topright", buttonsBackground, "topright", -8, -30)
- local topTexCoordButton = g:NewButton (buttonsBackground, nil, "$parentTopTexButton", nil, 100, 20, enableTexEdit, "top", nil, nil, Loc ["STRING_IMAGEEDIT_CROPTOP"], 1)
+ local topTexCoordButton = DF:NewButton (buttonsBackground, nil, "$parentTopTexButton", nil, 100, 20, enableTexEdit, "top", nil, nil, "Crop Top", 1)
topTexCoordButton:SetPoint ("topright", buttonsBackground, "topright", -8, -50)
- local bottomTexCoordButton = g:NewButton (buttonsBackground, nil, "$parentBottomTexButton", nil, 100, 20, enableTexEdit, "bottom", nil, nil, Loc ["STRING_IMAGEEDIT_CROPBOTTOM"], 1)
+ local bottomTexCoordButton = DF:NewButton (buttonsBackground, nil, "$parentBottomTexButton", nil, 100, 20, enableTexEdit, "bottom", nil, nil, "Crop Bottom", 1)
bottomTexCoordButton:SetPoint ("topright", buttonsBackground, "topright", -8, -70)
leftTexCoordButton:InstallCustomTexture()
rightTexCoordButton:InstallCustomTexture()
topTexCoordButton:InstallCustomTexture()
bottomTexCoordButton:InstallCustomTexture()
- local Alpha = g:NewButton (buttonsBackground, nil, "$parentBottomAlphaButton", nil, 100, 20, alpha, nil, nil, nil, Loc ["STRING_IMAGEEDIT_ALPHA"], 1)
+ local Alpha = DF:NewButton (buttonsBackground, nil, "$parentBottomAlphaButton", nil, 100, 20, alpha, nil, nil, nil, "Alpha", 1)
Alpha:SetPoint ("topright", buttonsBackground, "topright", -8, -115)
Alpha:InstallCustomTexture()
@@ -242,12 +244,12 @@ local _
if (default) then
edit_texture:SetVertexColor (unpack (default))
if (window.callback_func) then
- window.accept (true)
+ window.accept (nil, nil, true)
end
else
edit_texture:SetVertexColor (ColorPickerFrame:GetColorRGB())
if (window.callback_func) then
- window.accept (true)
+ window.accept (nil, nil, true)
end
end
end
@@ -284,21 +286,21 @@ local _
end
end
- local changeColorButton = g:NewButton (buttonsBackground, nil, "$parentOverlayColorButton", nil, 100, 20, changeColor, nil, nil, nil, Loc ["STRING_COLOR"], 1)
+ local changeColorButton = DF:NewButton (buttonsBackground, nil, "$parentOverlayColorButton", nil, 100, 20, changeColor, nil, nil, nil, "Color", 1)
changeColorButton:SetPoint ("topright", buttonsBackground, "topright", -8, -95)
changeColorButton:InstallCustomTexture()
- alphaFrame = g:NewPanel (buttonsBackground, nil, "DetailsImageEditAlphaBg", nil, 40, 225)
+ alphaFrame = DF:NewPanel (buttonsBackground, nil, "DetailsFrameworkImageEditAlphaBg", nil, 40, 225)
alphaFrame:SetPoint ("topleft", buttonsBackground, "topright", 2, 0)
alphaFrame:Hide()
- local alphaSlider = g:NewSlider (alphaFrame, nil, "$parentAlphaSlider", "alphaSlider", 30, 220, 1, 100, 1, edit_texture:GetAlpha()*100)
+ local alphaSlider = DF:NewSlider (alphaFrame, nil, "$parentAlphaSlider", "alphaSlider", 30, 220, 1, 100, 1, edit_texture:GetAlpha()*100)
alphaSlider:SetPoint ("top", alphaFrame, "top", 0, -5)
alphaSlider:SetOrientation ("VERTICAL")
alphaSlider.thumb:SetSize (40, 30)
--leftSlider.backdrop = nil
--leftSlider.fractional = true
- local alpha = function(_, _, button)
+ local alpha = function (button)
if (ColorPickerFrame:IsShown()) then
ColorPickerFrame:Hide()
@@ -328,7 +330,7 @@ local _
alphaSlider:SetHook ("OnValueChange", function (_, _, value)
edit_texture:SetAlpha (value/100)
if (window.callback_func) then
- window.accept (true)
+ window.accept (nil, nil, true)
end
end)
@@ -372,37 +374,37 @@ local _
topCoordTexture:SetHeight (window.frame:GetHeight()/100*topSlider:GetValue())
if (window.callback_func) then
- window.accept (true)
+ window.accept (nil, nil, true)
end
end)
--> flip
- local flip = function (side)
+ local flip = function (button, b, side)
if (side == 1) then
haveHFlip = not haveHFlip
if (window.callback_func) then
- window.accept (true)
+ window.accept (nil, nil, true)
end
elseif (side == 2) then
haveVFlip = not haveVFlip
if (window.callback_func) then
- window.accept (true)
+ window.accept (nil, nil, true)
end
end
end
- local flipButtonH = g:NewButton (buttonsBackground, nil, "$parentFlipButton", nil, 100, 20, flip, 1, nil, nil, Loc ["STRING_IMAGEEDIT_FLIPH"], 1)
+ local flipButtonH = DF:NewButton (buttonsBackground, nil, "$parentFlipButton", nil, 100, 20, flip, 1, nil, nil, "Flip H", 1)
flipButtonH:SetPoint ("topright", buttonsBackground, "topright", -8, -140)
flipButtonH:InstallCustomTexture()
--
- local flipButtonV = g:NewButton (buttonsBackground, nil, "$parentFlipButton2", nil, 100, 20, flip, 2, nil, nil, Loc ["STRING_IMAGEEDIT_FLIPV"], 1)
+ local flipButtonV = DF:NewButton (buttonsBackground, nil, "$parentFlipButton2", nil, 100, 20, flip, 2, nil, nil, "Flip V", 1)
flipButtonV:SetPoint ("topright", buttonsBackground, "topright", -8, -160)
flipButtonV:InstallCustomTexture()
--> accept
- window.accept = function (keep_editing)
+ window.accept = function (self, b, keep_editing)
if (not keep_editing) then
buttonsBackground:Hide()
@@ -433,7 +435,7 @@ local _
return window.callback_func (edit_texture.width, edit_texture.height, {edit_texture:GetVertexColor()}, edit_texture:GetAlpha(), coords, window.extra_param)
end
- local acceptButton = g:NewButton (buttonsBackground, nil, "$parentAcceptButton", nil, 100, 20, window.accept, nil, nil, nil, Loc ["STRING_IMAGEEDIT_DONE"], 1)
+ local acceptButton = DF:NewButton (buttonsBackground, nil, "$parentAcceptButton", nil, 100, 20, window.accept, nil, nil, nil, "Done", 1)
acceptButton:SetPoint ("topright", buttonsBackground, "topright", -8, -200)
acceptButton:InstallCustomTexture()
@@ -443,7 +445,7 @@ window:Hide()
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local ttexcoord
- function g:ImageEditor (callback, texture, texcoord, colors, width, height, extraParam, alpha, maximize)
+ function DF:ImageEditor (callback, texture, texcoord, colors, width, height, extraParam, alpha, maximize)
texcoord = texcoord or {0, 1, 0, 1}
ttexcoord = texcoord
@@ -461,22 +463,23 @@ window:Hide()
edit_texture:SetAlpha (alpha)
- _detalhes:ScheduleTimer ("RefreshImageEditor", 0.2)
+ DF:ScheduleTimer ("RefreshImageEditor", 0.2)
window:Show()
window.callback_func = callback
window.extra_param = extraParam
buttonsBackground:Show()
+ buttonsBackground.widget:SetBackdrop (nil)
table.wipe (window.hooks)
end
- function _detalhes:RefreshImageEditor()
+ function DF:RefreshImageEditor()
if (edit_texture.maximize) then
- DetailsImageEdit:SetSize (266, 226)
+ DetailsFrameworkImageEdit:SetSize (266, 226)
else
- DetailsImageEdit:SetSize (edit_texture.width, edit_texture.height)
+ DetailsFrameworkImageEdit:SetSize (edit_texture.width, edit_texture.height)
end
local l, r, t, b = unpack (ttexcoord)
@@ -502,7 +505,7 @@ window:Hide()
end
if (window.callback_func) then
- window.accept (true)
+ window.accept (nil, nil, true)
end
end
diff --git a/Libs/DF/scrollbar.lua b/Libs/DF/scrollbar.lua
new file mode 100644
index 00000000..342a61ad
--- /dev/null
+++ b/Libs/DF/scrollbar.lua
@@ -0,0 +1,235 @@
+
+local DF = _G ["DetailsFramework"]
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
+function DF:CreateScrollBar (master, slave, x, y)
+ return DF:NewScrollBar (master, slave, x, y)
+end
+
+function DF:NewScrollBar (master, slave, x, y)
+
+ local new_slider = CreateFrame ("Slider", nil, master)
+ new_slider.scrollMax = 560 --default - tamanho da janela de fundo
+
+ -- ///// SLIDER /////
+ new_slider:SetPoint ("TOPLEFT", master, "TOPRIGHT", x, y)
+ new_slider.ativo = true
+
+ new_slider.bg = new_slider:CreateTexture (nil, "BACKGROUND")
+ new_slider.bg:SetAllPoints (true)
+ new_slider.bg:SetTexture (0, 0, 0, 0)
+ --coisinha do meio
+ new_slider.thumb = new_slider:CreateTexture (nil, "OVERLAY")
+ new_slider.thumb:SetTexture ("Interface\\Buttons\\UI-ScrollBar-Knob")
+ new_slider.thumb:SetSize (29, 30)
+ new_slider:SetThumbTexture (new_slider.thumb)
+
+ new_slider:SetOrientation ("VERTICAL")
+ new_slider:SetSize(16, 100)
+ new_slider:SetMinMaxValues(0, new_slider.scrollMax)
+ new_slider:SetValue(0)
+ new_slider.ultimo = 0
+
+ local botao_cima = CreateFrame ("Button", nil, master)
+
+ botao_cima:SetPoint ("BOTTOM", new_slider, "TOP", 0, -12)
+ botao_cima.x = 0
+ botao_cima.y = -12
+
+ botao_cima:SetWidth (29)
+ botao_cima:SetHeight (32)
+ botao_cima:SetNormalTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Up")
+ botao_cima:SetPushedTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Down")
+ botao_cima:SetDisabledTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Disabled")
+ botao_cima:Show()
+ botao_cima:Disable()
+
+ local botao_baixo = CreateFrame ("Button", nil, master)
+ botao_baixo:SetPoint ("TOP", new_slider, "BOTTOM", 0, 12)
+ botao_baixo.x = 0
+ botao_baixo.y = 12
+
+ botao_baixo:SetWidth (29)
+ botao_baixo:SetHeight (32)
+ botao_baixo:SetNormalTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollDownButton-Up")
+ botao_baixo:SetPushedTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollDownButton-Down")
+ botao_baixo:SetDisabledTexture ("Interface\\BUTTONS\\UI-ScrollBar-ScrollDownButton-Disabled")
+ botao_baixo:Show()
+ botao_baixo:Disable()
+
+ master.baixo = botao_baixo
+ master.cima = botao_cima
+ master.slider = new_slider
+
+ botao_baixo:SetScript ("OnMouseDown", function(self)
+ if (not new_slider:IsEnabled()) then
+ return
+ end
+
+ local current = new_slider:GetValue()
+ local minValue, maxValue = new_slider:GetMinMaxValues()
+ if (current+5 < maxValue) then
+ new_slider:SetValue (current+5)
+ else
+ new_slider:SetValue (maxValue)
+ end
+ self.precionado = true
+ self.last_up = -0.3
+ self:SetScript ("OnUpdate", function(self, elapsed)
+ self.last_up = self.last_up + elapsed
+ if (self.last_up > 0.03) then
+ self.last_up = 0
+ local current = new_slider:GetValue()
+ local minValue, maxValue = new_slider:GetMinMaxValues()
+ if (current+2 < maxValue) then
+ new_slider:SetValue (current+2)
+ else
+ new_slider:SetValue (maxValue)
+ end
+ end
+ end)
+ end)
+ botao_baixo:SetScript ("OnMouseUp", function(self)
+ self.precionado = false
+ self:SetScript ("OnUpdate", nil)
+ end)
+
+ botao_cima:SetScript ("OnMouseDown", function(self)
+ if (not new_slider:IsEnabled()) then
+ return
+ end
+
+ local current = new_slider:GetValue()
+ if (current-5 > 0) then
+ new_slider:SetValue (current-5)
+ else
+ new_slider:SetValue (0)
+ end
+ self.precionado = true
+ self.last_up = -0.3
+ self:SetScript ("OnUpdate", function(self, elapsed)
+ self.last_up = self.last_up + elapsed
+ if (self.last_up > 0.03) then
+ self.last_up = 0
+ local current = new_slider:GetValue()
+ if (current-2 > 0) then
+ new_slider:SetValue (current-2)
+ else
+ new_slider:SetValue (0)
+ end
+ end
+ end)
+ end)
+ botao_cima:SetScript ("OnMouseUp", function(self)
+ self.precionado = false
+ self:SetScript ("OnUpdate", nil)
+ end)
+ --> isso aqui pra quando o slider ativar, o scroll fica na posição zero
+ botao_cima:SetScript ("OnEnable", function (self)
+ local current = new_slider:GetValue()
+ if (current == 0) then
+ botao_cima:Disable()
+ end
+ end)
+
+ new_slider:SetScript ("OnValueChanged", function (self)
+ local current = self:GetValue()
+ master:SetVerticalScroll (current)
+
+ local minValue, maxValue = new_slider:GetMinMaxValues()
+
+ if (current == minValue) then
+ botao_cima:Disable()
+ elseif (not botao_cima:IsEnabled()) then
+ botao_cima:Enable()
+ end
+
+ if (current == maxValue) then
+ botao_baixo:Disable()
+ elseif (not botao_baixo:IsEnabled()) then
+ botao_baixo:Enable()
+ end
+
+ end)
+
+ new_slider:SetScript ("OnShow", function (self)
+ botao_cima:Show()
+ botao_baixo:Show()
+ end)
+
+ new_slider:SetScript ("OnDisable", function (self)
+ botao_cima:Disable()
+ botao_baixo:Disable()
+ end)
+
+ new_slider:SetScript ("OnEnable", function (self)
+ botao_cima:Enable()
+ botao_baixo:Enable()
+ end)
+
+ master:SetScript ("OnMouseWheel", function (self, delta)
+ if (not new_slider:IsEnabled()) then
+ return
+ end
+
+ local current = new_slider:GetValue()
+ if (delta < 0) then
+ --baixo
+ local minValue, maxValue = new_slider:GetMinMaxValues()
+ if (current + (master.wheel_jump or 20) < maxValue) then
+ new_slider:SetValue (current + (master.wheel_jump or 20))
+ else
+ new_slider:SetValue (maxValue)
+ end
+ elseif (delta > 0) then
+ --cima
+ if (current + (master.wheel_jump or 20) > 0) then
+ new_slider:SetValue (current - (master.wheel_jump or 20))
+ else
+ new_slider:SetValue (0)
+ end
+ end
+ end)
+
+ function new_slider:Altura (h)
+ self:SetHeight (h)
+ end
+
+ function new_slider:Update (desativar)
+
+ if (desativar) then
+ new_slider:Disable()
+ new_slider:SetValue(0)
+ new_slider.ativo = false
+ master:EnableMouseWheel (false)
+ return
+ end
+
+ self.scrollMax = slave:GetHeight()-master:GetHeight()
+ if (self.scrollMax > 0) then
+ new_slider:SetMinMaxValues (0, self.scrollMax)
+ if (not new_slider.ativo) then
+ new_slider:Enable()
+ new_slider.ativo = true
+ master:EnableMouseWheel (true)
+ end
+ else
+ new_slider:Disable()
+ new_slider:SetValue(0)
+ new_slider.ativo = false
+ master:EnableMouseWheel (false)
+ end
+ end
+
+ function new_slider:cimaPoint (x, y)
+ botao_cima:SetPoint ("BOTTOM", new_slider, "TOP", x, (y)-12)
+ end
+
+ function new_slider:baixoPoint (x, y)
+ botao_baixo:SetPoint ("TOP", new_slider, "BOTTOM", x, (y)+12)
+ end
+
+ return new_slider
+end
\ No newline at end of file
diff --git a/framework/slider.lua b/Libs/DF/slider.lua
similarity index 72%
rename from framework/slider.lua
rename to Libs/DF/slider.lua
index 00be0922..0b295ab8 100644
--- a/framework/slider.lua
+++ b/Libs/DF/slider.lua
@@ -1,6 +1,9 @@
---> details main objects
-local _detalhes = _G._detalhes
-local gump = _detalhes.gump
+
+local DF = _G ["DetailsFramework"]
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
local _
local _rawset = rawset --> lua local
local _rawget = rawget --> lua local
@@ -10,7 +13,6 @@ local _type = type --> lua local
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
@@ -221,7 +223,7 @@ local NameLessSlider = 1
-- setpoint
function SliderMetaFunctions:SetPoint (v1, v2, v3, v4, v5)
- v1, v2, v3, v4, v5 = gump:CheckPoints (v1, v2, v3, v4, v5, self)
+ v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self)
if (not v1) then
print ("Invalid parameter for SetPoint")
return
@@ -283,7 +285,7 @@ local NameLessSlider = 1
function SliderMetaFunctions:Enable()
self.slider:Enable()
if (not self.lock_texture) then
- gump:NewImage (self, [[Interface\PetBattles\PetBattle-LockIcon]], 12, 12, "overlay", {0.0546875, 0.9453125, 0.0703125, 0.9453125}, "lock_texture", "$parentLockTexture")
+ DF:NewImage (self, [[Interface\PetBattles\PetBattle-LockIcon]], 12, 12, "overlay", {0.0546875, 0.9453125, 0.0703125, 0.9453125}, "lock_texture", "$parentLockTexture")
self.lock_texture:SetDesaturated (true)
self.lock_texture:SetPoint ("center", self.amt, "center")
end
@@ -300,7 +302,7 @@ local NameLessSlider = 1
self:SetAlpha (.4)
if (not self.lock_texture) then
- gump:NewImage (self, [[Interface\PetBattles\PetBattle-LockIcon]], 12, 12, "overlay", {0.0546875, 0.9453125, 0.0703125, 0.9453125}, "lock_texture", "$parentLockTexture")
+ DF:NewImage (self, [[Interface\PetBattles\PetBattle-LockIcon]], 12, 12, "overlay", {0.0546875, 0.9453125, 0.0703125, 0.9453125}, "lock_texture", "$parentLockTexture")
self.lock_texture:SetDesaturated (true)
self.lock_texture:SetPoint ("center", self.amt, "center")
end
@@ -327,7 +329,7 @@ local NameLessSlider = 1
return
end
- DetailsFrameworkSliderButtons:ShowMe (slider)
+ DetailsFrameworkSliderButtons1:ShowMe (slider)
if (slider.MyObject.OnEnterHook) then
local interrupt = slider.MyObject.OnEnterHook (slider)
@@ -338,25 +340,20 @@ local NameLessSlider = 1
slider.thumb:SetAlpha (1)
- if (slider.MyObject.have_tooltip and slider.MyObject.have_tooltip ~= Loc ["STRING_RIGHTCLICK_TYPEVALUE"]) then
- --GameCooltip:Reset()
- _detalhes:CooltipPreset (2)
- GameCooltip:AddLine (slider.MyObject.have_tooltip)
- GameCooltip:ShowCooltip (slider, "tooltip")
+ if (slider.MyObject.onenter_backdrop_border_color) then
+ slider:SetBackdropBorderColor (unpack (slider.MyObject.onenter_backdrop_border_color))
+ end
+
+ if (slider.MyObject.have_tooltip and slider.MyObject.have_tooltip ~= "Right Click to Type the Value") then
+ GameCooltip2:Preset (2)
+ GameCooltip2:AddLine (slider.MyObject.have_tooltip)
+ GameCooltip2:ShowCooltip (slider, "tooltip")
else
- _detalhes:CooltipPreset (1)
- GameCooltip:AddLine (Loc ["STRING_RIGHTCLICK_TYPEVALUE"])
- GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 16, 16, 0.015625, 0.15671875, 0.640625, 0.798828125)
- GameCooltip:ShowCooltip (slider, "tooltip")
+ GameCooltip2:Preset (1)
+ GameCooltip2:AddLine ("Right Click to Type the Value")
+ GameCooltip2:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 16, 16, 0.015625, 0.15671875, 0.640625, 0.798828125)
+ GameCooltip2:ShowCooltip (slider, "tooltip")
end
-
- local parent = slider:GetParent().MyObject
- if (parent and parent.type == "panel") then
- if (parent.GradientEnabled) then
- parent:RunGradient()
- end
- end
-
end
local OnLeave = function (slider)
@@ -365,7 +362,7 @@ local NameLessSlider = 1
return
end
- DetailsFrameworkSliderButtons:PrepareToHide()
+ DetailsFrameworkSliderButtons1:PrepareToHide()
if (slider.MyObject.OnLeaveHook) then
local interrupt = slider.MyObject.OnLeaveHook (slider)
@@ -376,21 +373,18 @@ local NameLessSlider = 1
slider.thumb:SetAlpha (.7)
- if (slider.MyObject.have_tooltip) then
- _detalhes.popup:ShowMe (false)
+ if (slider.MyObject.onleave_backdrop_border_color) then
+ slider:SetBackdropBorderColor (unpack (slider.MyObject.onleave_backdrop_border_color))
end
-
- local parent = slider:GetParent().MyObject
- if (parent and parent.type == "panel") then
- if (parent.GradientEnabled) then
- parent:RunGradient (false)
- end
+
+ if (slider.MyObject.have_tooltip) then
+ GameCooltip2:ShowMe (false)
end
end
- local f = CreateFrame ("frame", "DetailsFrameworkSliderButtons", UIParent)
+ local f = CreateFrame ("frame", "DetailsFrameworkSliderButtons1", UIParent)
f:Hide()
--f:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], tile = true, tileSize = 5})
f:SetHeight (18)
@@ -685,7 +679,12 @@ local NameLessSlider = 1
local OnValueChanged = function (slider)
- local amt = slider:GetValue()
+ local amt
+ if (slider.MyObject.useDecimals) then
+ amt = slider:GetValue()
+ else
+ amt = _math_floor (slider:GetValue())
+ end
if (slider.MyObject.typing_value and not slider.MyObject.typing_can_change) then
slider.MyObject:SetValue (slider.MyObject.typing_value_started)
@@ -702,6 +701,10 @@ local NameLessSlider = 1
end
end
+ if (slider.MyObject.OnValueChanged) then
+ slider.MyObject.OnValueChanged (slider, slider.MyObject.FixedValue, amt)
+ end
+
if (amt < 10 and amt >= 1) then
amt = "0"..amt
end
@@ -730,23 +733,35 @@ local SwitchOnClick = function (self, button, forced_value, 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")
-
+ if (slider.backdrop_disabledcolor) then
+ slider:SetBackdropColor (unpack (slider.backdrop_disabledcolor))
+ else
+ slider:SetBackdropColor (1, 0, 0, 0.4)
+ end
+
+ if (slider.is_checkbox) then
+ slider.checked_texture:Hide()
+ else
+ slider._text:SetText (slider._ltext)
+ slider._thumb:ClearAllPoints()
+ slider._thumb:SetPoint ("left", slider.widget, "left")
+ end
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")
-
+ if (slider.backdrop_enabledcolor) then
+ slider:SetBackdropColor (unpack (slider.backdrop_enabledcolor))
+ else
+ slider:SetBackdropColor (0, 0, 1, 0.4)
+ end
+ if (slider.is_checkbox) then
+ slider.checked_texture:Show()
+ else
+ slider._text:SetText (slider._rtext)
+ slider._thumb:ClearAllPoints()
+ slider._thumb:SetPoint ("right", slider.widget, "right")
+ end
end
if (slider.OnSwitch and not forced_value) then
@@ -785,38 +800,82 @@ end
local switch_disable = function (self)
if (not self.lock_texture) then
- gump:NewImage (self, [[Interface\PetBattles\PetBattle-LockIcon]], 12, 12, "overlay", {0.0546875, 0.9453125, 0.0703125, 0.9453125}, "lock_texture", "$parentLockTexture")
+ DF:NewImage (self, [[Interface\PetBattles\PetBattle-LockIcon]], 12, 12, "overlay", {0.0546875, 0.9453125, 0.0703125, 0.9453125}, "lock_texture", "$parentLockTexture")
self.lock_texture:SetDesaturated (true)
self.lock_texture:SetPoint ("center", self._thumb, "center")
end
+ if (self.is_checkbox) then
+ self.checked_texture:Hide()
+ else
+ self._text:Hide()
+ end
+
self.lock_texture:Show()
- self._text:Hide()
self:SetAlpha (.4)
_rawset (self, "lockdown", true)
end
local switch_enable = function (self)
if (not self.lock_texture) then
- gump:NewImage (self, [[Interface\PetBattles\PetBattle-LockIcon]], 12, 12, "overlay", {0.0546875, 0.9453125, 0.0703125, 0.9453125}, "lock_texture", "$parentLockTexture")
+ DF:NewImage (self, [[Interface\PetBattles\PetBattle-LockIcon]], 12, 12, "overlay", {0.0546875, 0.9453125, 0.0703125, 0.9453125}, "lock_texture", "$parentLockTexture")
self.lock_texture:SetDesaturated (true)
self.lock_texture:SetPoint ("center", self._thumb, "center")
end
+ if (self.is_checkbox) then
+ if (_rawget (self, "value")) then
+ self.checked_texture:Show()
+ else
+ self.checked_texture:Hide()
+ end
+ else
+ self._text:Show()
+ end
+
self.lock_texture:Hide()
- self._text:Show()
self:SetAlpha (1)
return _rawset (self, "lockdown", false)
end
-function gump:CreateSwitch (parent, on_switch, default_value, w, h, ltext, rtext, member, name, color_inverted, switch_func, return_func)
- local switch = gump:NewSwitch (parent, parent, name, member, w or 60, h or 20, ltext, rtext, default_value, color_inverted, switch_func, return_func)
+local set_as_checkbok = function (self)
+ local checked = self:CreateTexture (nil, "overlay")
+ checked:SetTexture ([[Interface\Buttons\UI-CheckBox-Check]])
+ checked:SetPoint ("center", self.button, "center", -1, -1)
+ local size_pct = self:GetWidth()/32
+ checked:SetSize (32*size_pct, 32*size_pct)
+ self.checked_texture = checked
+
+ self._thumb:Hide()
+ self._text:Hide()
+
+ self.is_checkbox = true
+
+ if (_rawget (self, "value")) then
+ self.checked_texture:Show()
+ if (self.backdrop_enabledcolor) then
+ self:SetBackdropColor (unpack (self.backdrop_enabledcolor))
+ else
+ self:SetBackdropColor (0, 0, 1, 0.4)
+ end
+ else
+ self.checked_texture:Hide()
+ if (self.backdrop_disabledcolor) then
+ self:SetBackdropColor (unpack (self.backdrop_disabledcolor))
+ else
+ self:SetBackdropColor (0, 0, 1, 0.4)
+ end
+ end
+end
+
+function DF:CreateSwitch (parent, on_switch, default_value, w, h, ltext, rtext, member, name, color_inverted, switch_func, return_func, with_label, switch_template, label_template)
+ local switch, label = DF:NewSwitch (parent, parent, name, member, w or 60, h or 20, ltext, rtext, default_value, color_inverted, switch_func, return_func, with_label, switch_template, label_template)
if (on_switch) then
switch.OnSwitch = on_switch
end
- return switch
+ return switch, label
end
-function gump:NewSwitch (parent, container, name, member, w, h, ltext, rtext, default_value, color_inverted, switch_func, return_func)
+function DF:NewSwitch (parent, container, name, member, w, h, ltext, rtext, default_value, color_inverted, switch_func, return_func, with_label, switch_template, label_template)
--> early checks
if (not name) then
@@ -835,7 +894,10 @@ function gump:NewSwitch (parent, container, name, member, w, h, ltext, rtext, de
--> build frames
- local slider = gump:NewButton (parent, container, name, member, w, h)
+ w = w or 60
+ h = h or 20
+
+ local slider = DF:NewButton (parent, container, name, member, w, h)
slider.switch_func = switch_func
slider.return_func = return_func
@@ -844,6 +906,8 @@ function gump:NewSwitch (parent, container, name, member, w, h, ltext, rtext, de
slider.SetFixedParameter = switch_set_fixparameter
slider.Disable = switch_disable
slider.Enable = switch_enable
+ slider.SetAsCheckBox = set_as_checkbok
+ slider.SetTemplate = SliderMetaFunctions.SetTemplate
if (member) then
parent [member] = slider
@@ -875,16 +939,104 @@ function gump:NewSwitch (parent, container, name, member, w, h, ltext, rtext, de
slider:SetValue (default_value)
slider.isSwitch = true
+
+ if (switch_template) then
+ slider:SetTemplate (switch_template)
+ end
+
+ if (with_label) then
+ local label = DF:CreateLabel (slider.widget, with_label, nil, nil, nil, "label", nil, "overlay")
+ label.text = with_label
+ slider.widget:SetPoint ("left", label.widget, "right", 2, 0)
+ with_label = label
+
+ if (label_template) then
+ label:SetTemplate (label_template)
+ end
+ end
- return slider
+ return slider, with_label
end
-function gump:NewSlider (parent, container, name, member, w, h, min, max, step, defaultv, isDecemal, isSwitch)
+function SliderMetaFunctions:SetTemplate (template)
+
+ --slider e switch
+ if (template.width) then
+ self:SetWidth (template.width)
+ end
+ if (template.height) then
+ self:SetHeight (template.height)
+ end
+
+ if (template.backdrop) then
+ self:SetBackdrop (template.backdrop)
+ end
+ if (template.backdropcolor) then
+ local r, g, b, a = DF:ParseColors (template.backdropcolor)
+ self:SetBackdropColor (r, g, b, a)
+ end
+ if (template.backdropbordercolor) then
+ local r, g, b, a = DF:ParseColors (template.backdropbordercolor)
+ self:SetBackdropBorderColor (r, g, b, a)
+ self.onleave_backdrop_border_color = {r, g, b, a}
+ end
+
+ if (template.onenterbordercolor) then
+ local r, g, b, a = DF:ParseColors (template.onenterbordercolor)
+ self.onenter_backdrop_border_color = {r, g, b, a}
+ end
+
+ if (template.onleavebordercolor) then
+ local r, g, b, a = DF:ParseColors (template.onleavebordercolor)
+ self.onleave_backdrop_border_color = {r, g, b, a}
+ end
+
+ if (template.thumbtexture) then
+ if (self.thumb) then
+ self.thumb:SetTexture (template.thumbtexture)
+ end
+ end
+ if (template.thumbwidth) then
+ if (self.thumb) then
+ self.thumb:SetWidth (template.thumbwidth)
+ end
+ end
+ if (template.thumbheight) then
+ if (self.thumb) then
+ self.thumb:SetHeight (template.thumbheight)
+ end
+ end
+ if (template.thumbcolor) then
+ if (self.thumb) then
+ local r, g, b, a = DF:ParseColors (template.thumbcolor)
+ self.thumb:SetVertexColor (r, g, b, a)
+ end
+ end
+
+ --switch only
+ if (template.enabled_backdropcolor) then
+ local r, g, b, a = DF:ParseColors (template.enabled_backdropcolor)
+ self.backdrop_enabledcolor = {r, g, b, a}
+ end
+ if (template.disabled_backdropcolor) then
+ local r, g, b, a = DF:ParseColors (template.disabled_backdropcolor)
+ self.backdrop_disabledcolor = {r, g, b, a}
+ end
+end
+
+function DF:CreateSlider (parent, w, h, min, max, step, defaultv, isDecemal, member, name, with_label, slider_template, label_template)
+ local slider, label = DF:NewSlider (parent, parent, name, member, w, h, min, max, step, defaultv, isDecemal, false, with_label, slider_template, label_template)
+ return slider, label
+end
+
+function DF:NewSlider (parent, container, name, member, w, h, min, max, step, defaultv, isDecemal, isSwitch, with_label, slider_template, label_template)
--> early checks
if (not name) then
- return nil
- elseif (not parent) then
+ name = "DetailsFrameworkSlider" .. DF.SliderCounter
+ DF.SliderCounter = DF.SliderCounter + 1
+ end
+ if (not parent) then
return nil
end
if (not container) then
@@ -914,6 +1066,9 @@ function gump:NewSlider (parent, container, name, member, w, h, min, max, step,
step = step or 1
defaultv = defaultv or min
+ w = w or 130
+ h = h or 19
+
--> default members:
--> hooks
SliderObject.OnEnterHook = nil
@@ -928,7 +1083,6 @@ function gump:NewSlider (parent, container, name, member, w, h, min, max, step,
SliderObject.FixedValue = nil
SliderObject.useDecimals = isDecemal or false
- --SliderObject.slider = CreateFrame ("slider", name, parent, "DetailsSliderTemplate")
SliderObject.slider = CreateFrame ("slider", name, parent)
SliderObject.widget = SliderObject.slider
@@ -938,7 +1092,7 @@ function gump:NewSlider (parent, container, name, member, w, h, min, max, step,
for funcName, funcAddress in pairs (idx) do
if (not SliderMetaFunctions [funcName]) then
SliderMetaFunctions [funcName] = function (object, ...)
- local x = loadstring ( "return _G."..object.slider:GetName()..":"..funcName.."(...)")
+ local x = loadstring ( "return _G['"..object.slider:GetName().."']:"..funcName.."(...)")
return x (...)
end
end
@@ -946,8 +1100,8 @@ function gump:NewSlider (parent, container, name, member, w, h, min, max, step,
end
SliderObject.slider.MyObject = SliderObject
- SliderObject.slider:SetWidth (w or 232)
- SliderObject.slider:SetHeight (h or 20)
+ SliderObject.slider:SetWidth (w)
+ SliderObject.slider:SetHeight (h)
SliderObject.slider:SetOrientation ("horizontal")
SliderObject.slider:SetMinMaxValues (min, max)
SliderObject.slider:SetValueStep (step)
@@ -965,7 +1119,7 @@ function gump:NewSlider (parent, container, name, member, w, h, min, max, step,
SliderObject.slider.thumb = SliderObject.thumb
if (not isSwitch) then
- SliderObject.have_tooltip = Loc ["STRING_RIGHTCLICK_TYPEVALUE"]
+ SliderObject.have_tooltip = "Right Click to Type the Value"
end
SliderObject.amt = SliderObject.slider:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
@@ -999,6 +1153,21 @@ function gump:NewSlider (parent, container, name, member, w, h, min, max, step,
_setmetatable (SliderObject, SliderMetaFunctions)
- return SliderObject
+ if (with_label) then
+ local label = DF:CreateLabel (SliderObject.slider, with_label, nil, nil, nil, "label", nil, "overlay")
+ label.text = with_label
+ SliderObject.slider:SetPoint ("left", label.widget, "right", 2, 0)
+ with_label = label
+
+ if (label_template) then
+ label:SetTemplate (label_template)
+ end
+ end
+
+ if (slider_template) then
+ SliderObject:SetTemplate (slider_template)
+ end
+
+ return SliderObject, with_label
end
\ No newline at end of file
diff --git a/framework/split_bar.lua b/Libs/DF/split_bar.lua
similarity index 86%
rename from framework/split_bar.lua
rename to Libs/DF/split_bar.lua
index 1d1f3dee..f83af669 100644
--- a/framework/split_bar.lua
+++ b/Libs/DF/split_bar.lua
@@ -1,6 +1,9 @@
---> details main objects
-local _detalhes = _G._detalhes
-local gump = _detalhes.gump
+
+local DF = _G ["DetailsFramework"]
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
local _
local _rawset = rawset --> lua local
local _rawget = rawget --> lua local
@@ -200,13 +203,13 @@ local APISplitBarFunctions
end
--> right color
local smember_rcolor = function (_object, _value)
- local _value1, _value2, _value3, _value4 = gump:ParseColors (_value)
+ local _value1, _value2, _value3, _value4 = DF:ParseColors (_value)
_object.background.original_colors = {_value1, _value2, _value3, _value4}
return _object.background:SetVertexColor (_value1, _value2, _value3, _value4)
end
--> left color
local smember_lcolor = function (_object, _value)
- local _value1, _value2, _value3, _value4 = gump:ParseColors (_value)
+ local _value1, _value2, _value3, _value4 = DF:ParseColors (_value)
_object.statusbar:SetStatusBarColor (_value1, _value2, _value3, _value4)
_object.texture.original_colors = {_value1, _value2, _value3, _value4}
@@ -256,17 +259,17 @@ local APISplitBarFunctions
end
--> font face
local smember_textfont = function (_object, _value)
- _detalhes:SetFontFace (_object.textleft, _value)
- return _detalhes:SetFontFace (_object.textright, _value)
+ DF:SetFontFace (_object.textleft, _value)
+ return DF:SetFontFace (_object.textright, _value)
end
--> font size
local smember_textsize = function (_object, _value)
- _detalhes:SetFontSize (_object.textleft, _value)
- return _detalhes:SetFontSize (_object.textright, _value)
+ DF:SetFontSize (_object.textleft, _value)
+ return DF:SetFontSize (_object.textright, _value)
end
--> font color
local smember_textcolor = function (_object, _value)
- local _value1, _value2, _value3, _value4 = gump:ParseColors (_value)
+ local _value1, _value2, _value3, _value4 = DF:ParseColors (_value)
_object.textleft:SetTextColor (_value1, _value2, _value3, _value4)
return _object.textright:SetTextColor (_value1, _value2, _value3, _value4)
end
@@ -325,7 +328,7 @@ local APISplitBarFunctions
-- setpoint
function SplitBarMetaFunctions:SetPoint (v1, v2, v3, v4, v5)
- v1, v2, v3, v4, v5 = gump:CheckPoints (v1, v2, v3, v4, v5, self)
+ v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self)
if (not v1) then
print ("Invalid parameter for SetPoint")
return
@@ -359,12 +362,12 @@ local APISplitBarFunctions
-- colors
function SplitBarMetaFunctions:SetLeftColor (r, g, b, a)
- r, g, b, a = gump:ParseColors (r, g, b, a)
+ r, g, b, a = DF:ParseColors (r, g, b, a)
self.texture:SetVertexColor (r, g, b, a)
self.texture.original_colors = {r, g, b, a}
end
function SplitBarMetaFunctions:SetRightColor (r, g, b, a)
- r, g, b, a = gump:ParseColors (r, g, b, a)
+ r, g, b, a = DF:ParseColors (r, g, b, a)
self.background:SetVertexColor (r, g, b, a)
self.background.original_colors = {r, g, b, a}
end
@@ -441,21 +444,12 @@ local APISplitBarFunctions
end
end
- local oc = frame.MyObject.texture.original_colors --original colors
- gump:GradientEffect ( frame.MyObject.texture, "texture", oc[1], oc[2], oc[3], oc[4], oc[1]+0.2, oc[2]+0.2, oc[3]+0.2, oc[4], .2)
frame.MyObject.div:SetPoint ("left", frame, "left", frame:GetValue() * (frame:GetWidth()/100) - 18, 0)
if (frame.MyObject.have_tooltip) then
- GameCooltip:Reset()
- GameCooltip:AddLine (frame.MyObject.have_tooltip)
- GameCooltip:ShowCooltip (frame, "tooltip")
- end
-
- local parent = frame:GetParent().MyObject
- if (parent and parent.type == "panel") then
- if (parent.GradientEnabled) then
- parent:RunGradient()
- end
+ GameCooltip2:Reset()
+ GameCooltip2:AddLine (frame.MyObject.have_tooltip)
+ GameCooltip2:ShowCooltip (frame, "tooltip")
end
end
@@ -466,20 +460,9 @@ local APISplitBarFunctions
return
end
end
-
- local oc = frame.MyObject.texture.original_colors --original colors
- local r, g, b, a = frame.MyObject.texture:GetVertexColor()
- gump:GradientEffect ( frame.MyObject.texture, "texture", r, g, b, a, oc[1], oc[2], oc[3], oc[4], .2)
-
+
if (frame.MyObject.have_tooltip) then
- _detalhes.popup:ShowMe (false)
- end
-
- local parent = frame:GetParent().MyObject
- if (parent and parent.type == "panel") then
- if (parent.GradientEnabled) then
- parent:RunGradient (false)
- end
+ DF.popup:ShowMe (false)
end
end
@@ -538,20 +521,27 @@ local APISplitBarFunctions
------------------------------------------------------------------------------------------------------------
--> object constructor
-function DetailsSplitlBar_OnCreate (self)
+function DetailsFrameworkSplitlBar_OnCreate (self)
self.texture.original_colors = {1, 1, 1, 1}
self.background.original_colors = {.5, .5, .5, 1}
self.spark:SetPoint ("left", self, "left", self:GetValue() * (self:GetWidth()/100) - 18, 0)
return true
end
-function gump:NewSplitBar (parent, container, name, member, w, h)
+function DF:CreateSplitBar (parent, parent, w, h, member, name)
+ return DF:NewSplitBar (parent, container, name, member, w, h)
+end
+
+function DF:NewSplitBar (parent, container, name, member, w, h)
if (not name) then
+ name = "DetailsFrameworkSplitbar" .. DF.SplitBarCounter
+ DF.SplitBarCounter = DF.SplitBarCounter + 1
+ end
+ if (not parent) then
return nil
- elseif (not parent) then
- return nil
- elseif (not container) then
+ end
+ if (not container) then
container = parent
end
@@ -587,7 +577,7 @@ function gump:NewSplitBar (parent, container, name, member, w, h)
SplitBarObject.container = container
--> create widgets
- SplitBarObject.statusbar = CreateFrame ("statusbar", name, parent, "DetailsSplitBarTemplate")
+ SplitBarObject.statusbar = CreateFrame ("statusbar", name, parent, "DetailsFrameworkSplitBarTemplate")
SplitBarObject.widget = SplitBarObject.statusbar
if (not APISplitBarFunctions) then
@@ -596,7 +586,7 @@ function gump:NewSplitBar (parent, container, name, member, w, h)
for funcName, funcAddress in pairs (idx) do
if (not SplitBarMetaFunctions [funcName]) then
SplitBarMetaFunctions [funcName] = function (object, ...)
- local x = loadstring ( "return _G."..object.statusbar:GetName()..":"..funcName.."(...)")
+ local x = loadstring ( "return _G['"..object.statusbar:GetName().."']:"..funcName.."(...)")
return x (...)
end
end
diff --git a/framework/split_bar.xml b/Libs/DF/split_bar.xml
similarity index 93%
rename from framework/split_bar.xml
rename to Libs/DF/split_bar.xml
index be7236c1..0f011e0c 100644
--- a/framework/split_bar.xml
+++ b/Libs/DF/split_bar.xml
@@ -2,7 +2,7 @@
-
+
@@ -74,7 +74,7 @@
self:SetStatusBarTexture (self.texture);
self:SetMinMaxValues (1, 100);
self:SetValue (50);
- DetailsSplitlBar_OnCreate (self);
+ DetailsFrameworkSplitlBar_OnCreate (self);
diff --git a/framework/textentry.lua b/Libs/DF/textentry.lua
similarity index 77%
rename from framework/textentry.lua
rename to Libs/DF/textentry.lua
index 4d0f36db..82c637ed 100644
--- a/framework/textentry.lua
+++ b/Libs/DF/textentry.lua
@@ -1,6 +1,9 @@
---> details main objects
-local _detalhes = _G._detalhes
-local gump = _detalhes.gump
+
+local DF = _G ["DetailsFramework"]
+if (not DF or not DetailsFrameworkCanLoad) then
+ return
+end
+
local _
local _rawset = rawset --> lua local
local _rawget = rawget --> lua local
@@ -15,7 +18,7 @@ local cleanfunction = function() end
local APITextEntryFunctions = false
local TextEntryMetaFunctions = {}
-gump.TextEntryCounter = 1
+DF.TextEntryCounter = 1
------------------------------------------------------------------------------------------------------------
--> metatables
@@ -157,7 +160,7 @@ gump.TextEntryCounter = 1
self.space = Width
end
- MyAnchor, SnapTo, HisAnchor, x, y = gump:CheckPoints (MyAnchor, SnapTo, HisAnchor, x, y, self)
+ MyAnchor, SnapTo, HisAnchor, x, y = DF:CheckPoints (MyAnchor, SnapTo, HisAnchor, x, y, self)
if (not MyAnchor) then
print ("Invalid parameter for SetPoint")
return
@@ -256,6 +259,9 @@ gump.TextEntryCounter = 1
self.editbox:SetBackdropBorderColor (unpack (self.enabled_border_color))
self.editbox:SetBackdropColor (unpack (self.enabled_backdrop_color))
self.editbox:SetTextColor (unpack (self.enabled_text_color))
+ if (self.editbox.borderframe) then
+ self.editbox.borderframe:SetBackdropColor (unpack (self.editbox.borderframe.onleave_backdrop))
+ end
end
end
@@ -270,6 +276,10 @@ gump.TextEntryCounter = 1
self.editbox:SetBackdropBorderColor (.5, .5, .5, .5)
self.editbox:SetBackdropColor (.5, .5, .5, .5)
self.editbox:SetTextColor (.5, .5, .5, .5)
+
+ if (self.editbox.borderframe) then
+ self.editbox.borderframe:SetBackdropColor (.5, .5, .5, .5)
+ end
end
end
@@ -285,9 +295,9 @@ gump.TextEntryCounter = 1
end
if (textentry.MyObject.have_tooltip) then
- _detalhes:CooltipPreset (2)
- GameCooltip:AddLine (textentry.MyObject.have_tooltip)
- GameCooltip:ShowCooltip (textentry, "tooltip")
+ GameCooltip2:Preset (2)
+ GameCooltip2:AddLine (textentry.MyObject.have_tooltip)
+ GameCooltip2:ShowCooltip (textentry, "tooltip")
end
textentry.mouse_over = true
@@ -297,13 +307,6 @@ gump.TextEntryCounter = 1
textentry:SetBackdropBorderColor (1, 1, 1, 1)
end
- local parent = textentry:GetParent().MyObject
- if (parent and parent.type == "panel") then
- if (parent.GradientEnabled) then
- parent:RunGradient()
- end
- end
-
end
local OnLeave = function (textentry)
@@ -315,7 +318,7 @@ gump.TextEntryCounter = 1
end
if (textentry.MyObject.have_tooltip) then
- _detalhes.popup:ShowMe (false)
+ GameCooltip2:ShowMe (false)
end
textentry.mouse_over = false
@@ -323,13 +326,7 @@ gump.TextEntryCounter = 1
if (textentry:IsEnabled()) then
textentry:SetBackdropBorderColor (unpack (textentry.current_bordercolor))
end
-
- local parent = textentry:GetParent().MyObject
- if (parent and parent.type == "panel") then
- if (parent.GradientEnabled) then
- parent:RunGradient (false)
- end
- end
+
end
local OnHide = function (textentry)
@@ -359,7 +356,7 @@ gump.TextEntryCounter = 1
end
end
- local texto = _detalhes:trim (textentry:GetText())
+ local texto = DF:trim (textentry:GetText())
if (_string_len (texto) > 0) then
textentry.text = texto
if (textentry.MyObject.func) then
@@ -404,7 +401,7 @@ gump.TextEntryCounter = 1
end
if (not textentry.focuslost) then
- local texto = _detalhes:trim (textentry:GetText())
+ local texto = DF:trim (textentry:GetText())
if (_string_len (texto) > 0) then
textentry.MyObject.currenttext = texto
if (textentry.MyObject.func) then
@@ -470,17 +467,46 @@ gump.TextEntryCounter = 1
end
------------------------------------------------------------------------------------------------------------
---> object constructor
-function gump:CreateTextEntry (parent, func, w, h, member, name)
- return gump:NewTextEntry (parent, parent, name, member, w, h, func)
+function TextEntryMetaFunctions:SetTemplate (template)
+ if (template.width) then
+ self:SetWidth (template.width)
+ end
+ if (template.height) then
+ self:SetHeight (template.height)
+ end
+
+ if (template.backdrop) then
+ self:SetBackdrop (template.backdrop)
+ end
+ if (template.backdropcolor) then
+ local r, g, b, a = DF:ParseColors (template.backdropcolor)
+ self:SetBackdropColor (r, g, b, a)
+ self.onleave_backdrop = {r, g, b, a}
+ end
+ if (template.backdropbordercolor) then
+ local r, g, b, a = DF:ParseColors (template.backdropbordercolor)
+ self:SetBackdropBorderColor (r, g, b, a)
+ self.editbox.current_bordercolor[1] = r
+ self.editbox.current_bordercolor[2] = g
+ self.editbox.current_bordercolor[3] = b
+ self.editbox.current_bordercolor[4] = a
+ self.onleave_backdrop_border_color = {r, g, b, a}
+ end
end
-function gump:NewTextEntry (parent, container, name, member, w, h, func, param1, param2, space)
+------------------------------------------------------------------------------------------------------------
+--> object constructor
+
+function DF:CreateTextEntry (parent, func, w, h, member, name, with_label, entry_template, label_template)
+ return DF:NewTextEntry (parent, parent, name, member, w, h, func, nil, nil, nil, with_label, entry_template, label_template)
+end
+
+function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, param2, space, with_label, entry_template, label_template)
if (not name) then
- name = "DetailsTextEntryNumber" .. gump.TextEntryCounter
- gump.TextEntryCounter = gump.TextEntryCounter + 1
+ name = "DetailsFrameworkTextEntryNumber" .. DF.TextEntryCounter
+ DF.TextEntryCounter = DF.TextEntryCounter + 1
elseif (not parent) then
return nil
@@ -525,7 +551,7 @@ function gump:NewTextEntry (parent, container, name, member, w, h, func, param1,
TextEntryObject.container = container
TextEntryObject.have_tooltip = nil
- TextEntryObject.editbox = CreateFrame ("EditBox", name, parent, "DetailsEditBoxTemplate2")
+ TextEntryObject.editbox = CreateFrame ("EditBox", name, parent, "DetailsFrameworkEditBoxTemplate2")
TextEntryObject.widget = TextEntryObject.editbox
TextEntryObject.editbox:SetTextInsets (3, 0, 0, -3)
@@ -536,7 +562,7 @@ function gump:NewTextEntry (parent, container, name, member, w, h, func, param1,
for funcName, funcAddress in pairs (idx) do
if (not TextEntryMetaFunctions [funcName]) then
TextEntryMetaFunctions [funcName] = function (object, ...)
- local x = loadstring ( "return _G."..object.editbox:GetName()..":"..funcName.."(...)")
+ local x = loadstring ( "return _G['"..object.editbox:GetName().."']:"..funcName.."(...)")
return x (...)
end
end
@@ -548,7 +574,7 @@ function gump:NewTextEntry (parent, container, name, member, w, h, func, param1,
if (not w and space) then
w = space
elseif (w and space) then
- if (gump.debug) then
+ if (DF.debug) then
print ("warning: you are using width and space, try use only space for better results.")
end
end
@@ -568,6 +594,8 @@ function gump:NewTextEntry (parent, container, name, member, w, h, func, param1,
TextEntryObject.enabled_border_color = {TextEntryObject.editbox:GetBackdropBorderColor()}
TextEntryObject.enabled_backdrop_color = {TextEntryObject.editbox:GetBackdropColor()}
TextEntryObject.enabled_text_color = {TextEntryObject.editbox:GetTextColor()}
+ TextEntryObject.onleave_backdrop = {TextEntryObject.editbox:GetBackdropColor()}
+ TextEntryObject.onleave_backdrop_border_color = {TextEntryObject.editbox:GetBackdropBorderColor()}
TextEntryObject.func = func
TextEntryObject.param1 = param1
@@ -578,8 +606,7 @@ function gump:NewTextEntry (parent, container, name, member, w, h, func, param1,
TextEntryObject.label = _G [name .. "_Desc"]
- TextEntryObject.editbox:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize = 12, insets = {left = 1, right = 1, top = 1, bottom = 1}})
- TextEntryObject.editbox:SetBackdropColor (0, 0, 0, 0.5)
+ TextEntryObject.editbox:SetBackdrop ({bgFile = DF.folder .. "background", tileSize = 64, edgeFile = DF.folder .. "border_2", edgeSize = 10, insets = {left = 1, right = 1, top = 1, bottom = 1}})
--> hooks
TextEntryObject.editbox:SetScript ("OnEnter", OnEnter)
@@ -597,75 +624,26 @@ function gump:NewTextEntry (parent, container, name, member, w, h, func, param1,
_setmetatable (TextEntryObject, TextEntryMetaFunctions)
- return TextEntryObject
-
-end
-
-local SpellEntryOnEditFocusGained = function (self)
- local start_build_cache = _detalhes:BuildSpellListSlow()
- if (start_build_cache) then
- DetailsLoadSpellCacheProgress:SetPoint ("left", self, "right", 2, 0)
- end
-end
-
-local SpellEntryOnClickMenu = function (_, _, SpellID, editbox)
- editbox:SetText (SpellID)
- editbox:PressEnter()
- editbox.HaveMenu = false
- GameCooltip:ShowMe (false)
-end
-
-local SpellEntryOnTextChanged = function (editbox, userChanged)
-
- if (not userChanged) then
- return
- elseif (not _detalhes.spellcachefull) then
- return
- end
-
- editbox = editbox.MyObject
-
- local text = editbox:GetText()
- text = _detalhes:trim (text)
- text = string.lower (text)
-
- local LetterIndex = string.sub (text, 1, 1)
- local LetterIndex_CacheContainer = _detalhes.spellcachefull [LetterIndex]
-
- if (LetterIndex_CacheContainer) then
-
- local GameCooltip = _G.GameCooltip
-
- _detalhes:CooltipPreset (1)
- GameCooltip:SetType ("menu")
- GameCooltip:SetOwner (editbox.widget)
- GameCooltip:SetOption ("NoLastSelectedBar", true)
- GameCooltip:SetOption ("TextSize", 9)
-
- local i = 1
-
- for SpellID, SpellTable in pairs (LetterIndex_CacheContainer) do
- if (string.lower (SpellTable[1]):find (text)) then
-
- GameCooltip:AddMenu (1, SpellEntryOnClickMenu, SpellID, editbox, nil, SpellID..": "..SpellTable[1], SpellTable[2], true)
-
- if (i > 20) then
- break
- else
- i = i + 1
- end
- end
+ if (with_label) then
+ local label = DF:CreateLabel (TextEntryObject.editbox, with_label, nil, nil, nil, "label", nil, "overlay")
+ label.text = with_label
+ TextEntryObject.editbox:SetPoint ("left", label.widget, "right", 2, 0)
+ if (label_template) then
+ label:SetTemplate (label_template)
end
-
- editbox.HaveMenu = true
- GameCooltip.buttonOver = true
- GameCooltip:ShowCooltip()
+ with_label = label
end
+ if (entry_template) then
+ TextEntryObject:SetTemplate (entry_template)
+ end
+
+ return TextEntryObject, with_label
+
end
-function gump:NewSpellEntry (parent, func, w, h, param1, param2, member, name)
- local editbox = gump:NewTextEntry (parent, parent, name, member, w, h, func, param1, param2)
+function DF:NewSpellEntry (parent, func, w, h, param1, param2, member, name)
+ local editbox = DF:NewTextEntry (parent, parent, name, member, w, h, func, param1, param2)
editbox:SetHook ("OnEditFocusGained", SpellEntryOnEditFocusGained)
editbox:SetHook ("OnTextChanged", SpellEntryOnTextChanged)
@@ -673,7 +651,6 @@ function gump:NewSpellEntry (parent, func, w, h, param1, param2, member, name)
return editbox
end
-
local function_gettext = function (self)
return self.editbox:GetText()
end
@@ -687,7 +664,7 @@ local function_setfocus = function (self)
return self.editbox:SetFocus (true)
end
-function gump:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent)
+function DF:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent)
if (name:find ("$parent")) then
name = name:gsub ("$parent", parent:GetName())
@@ -700,7 +677,7 @@ function gump:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent)
parent [member] = borderframe
end
- local scrollframe = CreateFrame ("ScrollFrame", name, borderframe, "DetailsEditBoxMultiLineTemplate")
+ local scrollframe = CreateFrame ("ScrollFrame", name, borderframe, "DetailsFrameworkEditBoxMultiLineTemplate")
scrollframe:SetScript ("OnSizeChanged", function (self)
scrollframe.editbox:SetSize (self:GetSize())
@@ -720,17 +697,32 @@ function gump:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent)
borderframe.ClearFocus = function_clearfocus
borderframe.SetFocus = function_setfocus
- if ((not nointent) and (IndentationLib and IndentationLib.enable)) then
+ borderframe.Enable = TextEntryMetaFunctions.Enable
+ borderframe.Disable = TextEntryMetaFunctions.Disable
+
+ borderframe.SetTemplate = TextEntryMetaFunctions.SetTemplate
+
+ if (not nointent) then
IndentationLib.enable (scrollframe.editbox, nil, 4)
end
- borderframe:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\AddOns\Details\images\border_3]],
+ borderframe:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
tile = 1, tileSize = 16, edgeSize = 16, insets = {left = 5, right = 5, top = 5, bottom = 5}})
+
+ scrollframe.editbox.current_bordercolor = {1, 1, 1, 0.7}
+ borderframe:SetBackdropBorderColor (1, 1, 1, 0.7)
borderframe:SetBackdropColor (0.090195, 0.090195, 0.188234, 1)
- borderframe:SetBackdropBorderColor (1, 1, 1, 1)
+
+ borderframe.enabled_border_color = {borderframe:GetBackdropBorderColor()}
+ borderframe.enabled_backdrop_color = {borderframe:GetBackdropColor()}
+ borderframe.enabled_text_color = {scrollframe.editbox:GetTextColor()}
+
+ borderframe.onleave_backdrop = {scrollframe.editbox:GetBackdropColor()}
+ borderframe.onleave_backdrop_border_color = {scrollframe.editbox:GetBackdropBorderColor()}
borderframe.scroll = scrollframe
borderframe.editbox = scrollframe.editbox
+ borderframe.editbox.borderframe = borderframe
return borderframe
end
\ No newline at end of file
diff --git a/framework/textentry.xml b/Libs/DF/textentry.xml
similarity index 89%
rename from framework/textentry.xml
rename to Libs/DF/textentry.xml
index e7569f23..4e5fce3d 100644
--- a/framework/textentry.xml
+++ b/Libs/DF/textentry.xml
@@ -2,7 +2,7 @@
-
+
@@ -34,7 +34,7 @@
-
+
diff --git a/Libs/DF/tutorial_alert.xml b/Libs/DF/tutorial_alert.xml
new file mode 100644
index 00000000..9185781c
--- /dev/null
+++ b/Libs/DF/tutorial_alert.xml
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+ self:SetHorizontalScroll(-28.5);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self:GetParent():Hide();
+
+
+ self:GetParent():Hide();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self:GetParent():Hide();
+
+
+ self:GetParent():Hide();
+ --if (self:GetParent():GetParent():GetParent().type=="COMPLETED") then
+ --self:GetParent():GetParent().Flash:Show();
+ --end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.IconFlash:SetVertexColor(1, 0, 0);
+
+
+ UIFrameFlash(self, 0.75, 0.75, -1, nil);
+
+
+ UIFrameFlashStop(self);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Libs/libs.xml b/Libs/libs.xml
index fad2d24a..eb99cabb 100644
--- a/Libs/libs.xml
+++ b/Libs/libs.xml
@@ -14,4 +14,6 @@
+
+
\ No newline at end of file
diff --git a/boot.lua b/boot.lua
index 034476da..18a9d85f 100644
--- a/boot.lua
+++ b/boot.lua
@@ -1,10 +1,10 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> global name declaration
-
+
_ = nil
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0")
- _detalhes.build_counter = 1602 --it's 1602 for release
- _detalhes.userversion = "v3.18.5b"
+ _detalhes.build_counter = 1601 --it's 1601 for release
+ _detalhes.userversion = "v3.19.0"
_detalhes.realversion = 74 --core version
_detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")"
Details = _detalhes
@@ -21,27 +21,15 @@ do
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
--[[
-|cFFFFFF00v3.18.0 (|cFFFFCC00Aug 11, 2015|r|cFFFFFF00)|r:\n\n
-
-|cFFFFFF00-|r Added the overheal made by pets on tooltip and player details window.\n\n
-|cFFFFFF00-|r Added an option to disable stretch button and bar highlight.\n\n|cFFFFFF00-|r Disabling nicknames now also disable avatars.\n\n
-
-|cFFFFFF00-|r Improvements on Weakauras creation from Encounter Details plugin.\n\n
-|cFFFFFF00-|r Improvements on 'Auto Switch to Current' feature. Details! windows are now more responsible about auto changing a segment while the player, for instance, has the report window opened.\n\n
-|cFFFFFF00-|r Fixed report for custom display Crowd Control.\n\n
-|cFFFFFF00-|r Fixed role icons on custom displays.\n\n
-|cFFFFFF00-|r Fixed item level of timewarped items.\n\n
-|cFFFFFF00-|r Fixed title text width when auto-hide menu buttons is enabled.\n\n
-|cFFFFFF00-|r Fixed background alpha after stretching which wasn't correctly coming back to original color.\n\n
-
-|cFFFFFF00-|r Added slash command '/de wipe'. It ends the raid encounter segment and stop capturing data.\nIf you are the raid leader, all other users of Details! will also stop.\nWorks great for users not make damage padding after a wipe call.\n\n
-|cFFFFFF00-|r Fixed an issue with dropdown boxes where wasn't showing all options.\n\n
+|cFFFFFF00v3.19.0 (|cFFFFCC00Aug 21, 2015|r|cFFFFFF00)|r:\n\n
+|cFFFFFF00-|r Updated Details! Framework.\n\n
+|cFFFFFF00-|r Added an option to make the menus on title bar work with clicks instead of hovering over them.\n\n
+|cFFFFFF00-|r .\n\n
--]]
-
--
- Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.18.5b (|cFFFFCC00Aug 20, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improvements on Weakauras creation from Encounter Details plugin.\n\n|cFFFFFF00-|r Improvements on 'Auto Switch to Current' feature. Details! windows are now more responsible about auto changing a segment while the player, for instance, has the report window opened.\n\n|cFFFFFF00-|r Added slash command '/de wipe'. It ends the raid encounter segment and stop capturing data.\nIf you are the raid leader, all other users of Details! will also stop.\nWorks great for players not make damage padding after a wipe call.\n\n|cFFFFFF00-|r Added the overheal made by pets on tooltip and player details window.\n\n|cFFFFFF00-|r Added an option to disable stretch button and bar highlight.\n\n|cFFFFFF00-|r Disabling nicknames now also disable avatars.\n\n|cFFFFFF00-|r Added 'spinal healing injector' on custom display 'Health Potion & Stone' used.\n\n|cFFFFFF00-|r Fixed title text width when auto-hide menu buttons is enabled.\n\n|cFFFFFF00-|r Fixed item level of timewarped items.\n\n|cFFFFFF00-|r Fixed report for custom display Crowd Control.\n\n|cFFFFFF00-|r Fixed role icons on custom displays.\n\n|cFFFFFF00-|r Fixed an issue with dropdown boxes where wasn't showing all options.\n\n|cFFFFFF00-|r Fixed Ticket #53: background alpha after stretching which wasn't correctly coming back to original color.\n\n|cFFFFFF00-|r Fixed ticket #51: API Call 'GetCombat('overall')' wasn't returning the overall combat object.\n\n|cFFFFFF00-|r Fixed ticket #50: issue opening icon selection frame.\n\n|cFFFFFF00v3.17.12 (|cFFFFCC00Aug 05, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for lock micro displays. When locked they don't interact with mouse or stay on top of menus.\n\n|cFFFFFF00-|r Fixed ticket #49: death display not working correctly with sort direction bottom-to-top.\n\n|cFFFFFF00-|r Fixed an issue with death display where the text wasn't updating their width correctly.\n\n|cFFFFFF00-|r Fixed an issue with energy and miscellaneous displays type not working correctly with bar animations.\n\n|cFFFFFF00-|r Fixed an issue while loading old profiles wans't updating their values for newer versions of the addon.\n\n|cFFFFFF00-|r Fixed an issue with bookmarks panel not opening correctly.\n\n|cFFFFFF00v3.17.10 (|cFFFFCC00Aug 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed ticket #47: Title bar font resets with UI reload / relog.\n\n|cFFFFFF00-|r Fixed ticket #46: Icon select panel wasn't opening.\n\n|cFFFFFF00-|r Fixed ticket #45: Windwalker icon for Mistweaver monks.\n\n|cFFFFFF00-|r Fixed issue with vehicles exchanging ownership, e.g. Soulbound Constructor on HFC raid.\n\n|cFFFFFF00v3.17.6 (|cFFFFCC00Jul 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major improvements on the aura tool creation for WeakAuras.\n\n|cFFFFFF00-|r Fixed some issues with spec icons where sometimes it shows four small icons.\n\n|cFFFFFF00-|r Added an option to show a stopwatch on the title text showing the elapsed time of an encounter.\n\n|cFFFFFF00-|r Window title text now shrinks correctly when isn't enough space for it.\n\n|cFFFFFF00-|r For some special cases, left click now open the report window and shift+click shows the tooltip content in the window.\n\n|cFFFFFF00-|r Damage Taken by Spells now are a part of Damage bracket (no more on custom).\n\n|cFFFFFF00-|r Fixed custom functions for the customized bar left text.\n\n|cFFFFFF00-|r Improvements on report text format and also reverse option now works as intended.\n\n|cFFFFFF00-|r Removed the option for report only what is shown in the window.\n\n|cFFFFFF00-|r Added skins for report panel, the skin follow the skin selected for Player Detail Window.\n\n|cFFFFFF00v3.16.0c (|cFFFFCC00Jul 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with Encounter Details graphic for Archimonde encounter.\n\n|cFFFFFF00-|r Numbers format on Player Detail Window now respect the format chosen on options panel.\n\n|cFFFFFF00-|r Removed pet icons on Player Detail Window.\n\n|cFFFFFF00-|r Fixed some wrong textures on spec icons.\n\n|cFFFFFF00-|r Improvements on all skins for the Player Detail Window.\n\n|cFFFFFF00v3.15.8b (|cFFFFCC00Jul 01, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Soul Capacitor trinket fix.\n\n|cFFFFFF00-|r Fixed several small bugs from 6.2 patch.\n\n|cFFFFFF00-|r Disabled the special behavior for Tyrant Velhari encounter.\n\n|cFFFFFF00v3.15.7 (|cFFFFCC00Jun 23, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for Hellfire Citadel raid.\n\n|cFFFFFF00-|r Added support for custom CLEU parser functions.\n\n|cFFFFFF00-|r Tyrant Velhari encounter now has a custom CLEU parser function for healing where the heal absorbed by Aura of Contempt will count towards overheal and not healing done.\n\n|cFFFFFF00-|r Added support for embed on Chat Tabs.\n\n|cFFFFFF00-|r |cFFAAFFAAPS: We've made an addon for Shadow-Lord Iskar encounter called 'Iskar Assist' check it out|r.\n\n|cFFFFFF00v3.15.5a (|cFFFFCC00Jun 12, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue where sometimes tooltips wasn't being shown.\n\n|cFFFFFF00-|r Fixed a problem with overall data where it was using, even on dungoens, the raid-only 30 delay rule.\n\n|cFFFFFF00-|r Fixed an issue with spec detection (now it may detect even faster).\n\n|cFFFFFF00v3.15.5 (|cFFFFCC00Jun 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a problem with auto hide feature not hiding plugins hosted by the window.\n\n|cFFFFFF00-|r Fixed an issue with stretch feature when the anchor button was anchored at the bottom side of the window.\n\n|cFFFFFF00-|r Small interface tweaks on tooltips, bookmark and player detail window.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show amount of casts and uptime.\n\n|cFFFFFF00-|r Added an extra tooltip for the class icon at the player's bar.\n\n|cFFFFFF00-|r Activity time now has only 3 seconds inactivity tolerance on battlegrounds and arenas.\n\n|cFFFFFF00-|r Effective time will automatically be used when inside a battleground and using sync from the score board.\n\n|cFFFFFF00-|r Added 'hide all' option on the minimap menu.\n\n|cFFFFFF00-|r Added support for battlegrounds.\n\n|cFFFFFF00-|r Added option for disable showing battleground enemies when the window is in group mode.\n\n|cFFFFFF00-|r Added option to disable the sync from battleground score board.\n\n|cFFFFFF00-|r Enemies from a battleground match segment won't be erased when the player logout.\n\n|cFFFFFF00v3.14.4 (|cFFFFCC00May 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r TimeLine (plugin): now also shows marks symbolizing the player death.\n\n|cFFFFFF00-|r Added raid history panel. Open it through bookmark or /details history.\n\n|cFFFFFF00-|r Added support for skins for Player Detail Window.\n\n|cFFFFFF00-|r Added report history on report button.\n\n|cFFFFFF00-|r Added key bindings settings for report what is shown on window #1 or #2.\n\n|cFFFFFF00v3.14.0b (|cFFFFCC00May 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Several texture changes for a smaller download size.\n\n|cFFFFFF00v3.13.4a (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created 'Details! Forge' but is still under development: /details forge.\n\n|cFFFFFF00-|r Several improvements on combatlog reader and custom displays.\n\n|cFFFFFF00-|r Improvements on enemies damage taken tooltip."
+ Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.19.0 (|cFFFFCC00Aug 21, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Updated Details! Framework.\n\n|cFFFFFF00-|r Added an option to make the menus on title bar work with clicks instead of hovering over them.\n\n|cFFFFFF00v3.18.5 (|cFFFFCC00Aug 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improvements on Weakauras creation from Encounter Details plugin.\n\n|cFFFFFF00-|r Improvements on 'Auto Switch to Current' feature. Details! windows are now more responsible about auto changing a segment while the player, for instance, has the report window opened.\n\n|cFFFFFF00-|r Added slash command '/de wipe'. It ends the raid encounter segment and stop capturing data.\nIf you are the raid leader, all other users of Details! will also stop.\nWorks great for players not make damage padding after a wipe call.\n\n|cFFFFFF00-|r Added the overheal made by pets on tooltip and player details window.\n\n|cFFFFFF00-|r Added an option to disable stretch button and bar highlight.\n\n|cFFFFFF00-|r Disabling nicknames now also disable avatars.\n\n|cFFFFFF00-|r Added 'spinal healing injector' on custom display 'Health Potion & Stone' used.\n\n|cFFFFFF00-|r Fixed title text width when auto-hide menu buttons is enabled.\n\n|cFFFFFF00-|r Fixed item level of timewarped items.\n\n|cFFFFFF00-|r Fixed report for custom display Crowd Control.\n\n|cFFFFFF00-|r Fixed role icons on custom displays.\n\n|cFFFFFF00-|r Fixed an issue with dropdown boxes where wasn't showing all options.\n\n|cFFFFFF00-|r Fixed Ticket #53: background alpha after stretching which wasn't correctly coming back to original color.\n\n|cFFFFFF00-|r Fixed ticket #51: API Call 'GetCombat('overall')' wasn't returning the overall combat object.\n\n|cFFFFFF00-|r Fixed ticket #50: issue opening icon selection frame.\n\n|cFFFFFF00v3.17.12 (|cFFFFCC00Aug 05, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for lock micro displays. When locked they don't interact with mouse or stay on top of menus.\n\n|cFFFFFF00-|r Fixed ticket #49: death display not working correctly with sort direction bottom-to-top.\n\n|cFFFFFF00-|r Fixed an issue with death display where the text wasn't updating their width correctly.\n\n|cFFFFFF00-|r Fixed an issue with energy and miscellaneous displays type not working correctly with bar animations.\n\n|cFFFFFF00-|r Fixed an issue while loading old profiles wans't updating their values for newer versions of the addon.\n\n|cFFFFFF00-|r Fixed an issue with bookmarks panel not opening correctly.\n\n|cFFFFFF00v3.17.10 (|cFFFFCC00Aug 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed ticket #47: Title bar font resets with UI reload / relog.\n\n|cFFFFFF00-|r Fixed ticket #46: Icon select panel wasn't opening.\n\n|cFFFFFF00-|r Fixed ticket #45: Windwalker icon for Mistweaver monks.\n\n|cFFFFFF00-|r Fixed issue with vehicles exchanging ownership, e.g. Soulbound Constructor on HFC raid.\n\n|cFFFFFF00v3.17.6 (|cFFFFCC00Jul 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major improvements on the aura tool creation for WeakAuras.\n\n|cFFFFFF00-|r Fixed some issues with spec icons where sometimes it shows four small icons.\n\n|cFFFFFF00-|r Added an option to show a stopwatch on the title text showing the elapsed time of an encounter.\n\n|cFFFFFF00-|r Window title text now shrinks correctly when isn't enough space for it.\n\n|cFFFFFF00-|r For some special cases, left click now open the report window and shift+click shows the tooltip content in the window.\n\n|cFFFFFF00-|r Damage Taken by Spells now are a part of Damage bracket (no more on custom).\n\n|cFFFFFF00-|r Fixed custom functions for the customized bar left text.\n\n|cFFFFFF00-|r Improvements on report text format and also reverse option now works as intended.\n\n|cFFFFFF00-|r Removed the option for report only what is shown in the window.\n\n|cFFFFFF00-|r Added skins for report panel, the skin follow the skin selected for Player Detail Window.\n\n|cFFFFFF00v3.16.0c (|cFFFFCC00Jul 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with Encounter Details graphic for Archimonde encounter.\n\n|cFFFFFF00-|r Numbers format on Player Detail Window now respect the format chosen on options panel.\n\n|cFFFFFF00-|r Removed pet icons on Player Detail Window.\n\n|cFFFFFF00-|r Fixed some wrong textures on spec icons.\n\n|cFFFFFF00-|r Improvements on all skins for the Player Detail Window.\n\n|cFFFFFF00v3.15.8b (|cFFFFCC00Jul 01, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Soul Capacitor trinket fix.\n\n|cFFFFFF00-|r Fixed several small bugs from 6.2 patch.\n\n|cFFFFFF00-|r Disabled the special behavior for Tyrant Velhari encounter.\n\n|cFFFFFF00v3.15.7 (|cFFFFCC00Jun 23, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for Hellfire Citadel raid.\n\n|cFFFFFF00-|r Added support for custom CLEU parser functions.\n\n|cFFFFFF00-|r Tyrant Velhari encounter now has a custom CLEU parser function for healing where the heal absorbed by Aura of Contempt will count towards overheal and not healing done.\n\n|cFFFFFF00-|r Added support for embed on Chat Tabs.\n\n|cFFFFFF00-|r |cFFAAFFAAPS: We've made an addon for Shadow-Lord Iskar encounter called 'Iskar Assist' check it out|r.\n\n|cFFFFFF00v3.15.5a (|cFFFFCC00Jun 12, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue where sometimes tooltips wasn't being shown.\n\n|cFFFFFF00-|r Fixed a problem with overall data where it was using, even on dungoens, the raid-only 30 delay rule.\n\n|cFFFFFF00-|r Fixed an issue with spec detection (now it may detect even faster).\n\n|cFFFFFF00v3.15.5 (|cFFFFCC00Jun 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a problem with auto hide feature not hiding plugins hosted by the window.\n\n|cFFFFFF00-|r Fixed an issue with stretch feature when the anchor button was anchored at the bottom side of the window.\n\n|cFFFFFF00-|r Small interface tweaks on tooltips, bookmark and player detail window.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show amount of casts and uptime.\n\n|cFFFFFF00-|r Added an extra tooltip for the class icon at the player's bar.\n\n|cFFFFFF00-|r Activity time now has only 3 seconds inactivity tolerance on battlegrounds and arenas.\n\n|cFFFFFF00-|r Effective time will automatically be used when inside a battleground and using sync from the score board.\n\n|cFFFFFF00-|r Added 'hide all' option on the minimap menu.\n\n|cFFFFFF00-|r Added support for battlegrounds.\n\n|cFFFFFF00-|r Added option for disable showing battleground enemies when the window is in group mode.\n\n|cFFFFFF00-|r Added option to disable the sync from battleground score board.\n\n|cFFFFFF00-|r Enemies from a battleground match segment won't be erased when the player logout.\n\n|cFFFFFF00v3.14.4 (|cFFFFCC00May 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r TimeLine (plugin): now also shows marks symbolizing the player death.\n\n|cFFFFFF00-|r Added raid history panel. Open it through bookmark or /details history.\n\n|cFFFFFF00-|r Added support for skins for Player Detail Window.\n\n|cFFFFFF00-|r Added report history on report button.\n\n|cFFFFFF00-|r Added key bindings settings for report what is shown on window #1 or #2.\n\n|cFFFFFF00v3.14.0b (|cFFFFCC00May 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Several texture changes for a smaller download size."
Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r "
@@ -64,10 +52,11 @@ do
--> armazena os escudos - Shields information for absorbs
_detalhes.escudos = {}
--> armazena as funções dos frames - Frames functions
- _detalhes.gump = {}
+ _detalhes.gump = _G ["DetailsFramework"]
function _detalhes:GetFramework()
return self.gump
end
+ GameCooltip = GameCooltip2
--> animações dos icones
_detalhes.icon_animations = {
load = {
diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua
index 8deff930..fc8a887b 100644
--- a/classes/classe_damage.lua
+++ b/classes/classe_damage.lua
@@ -1536,7 +1536,7 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
--> não há barras para mostrar -- not have something to show
if (#showing._ActorTable < 1) then
--> colocado isso recentemente para fazer as barras de dano sumirem na troca de atributo
- return _detalhes:EsconderBarrasNaoUsadas (instancia, showing)
+ return _detalhes:EsconderBarrasNaoUsadas (instancia, showing), "", 0, 0
end
--> total
@@ -1982,7 +1982,7 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
end
if (#conteudo < 1) then
- return _detalhes:EsconderBarrasNaoUsadas (instancia, showing)
+ return _detalhes:EsconderBarrasNaoUsadas (instancia, showing), "", 0, 0
end
_table_sort (conteudo, _detalhes.SortKeySimple)
diff --git a/classes/classe_energy.lua b/classes/classe_energy.lua
index f0e3a926..12a26db0 100644
--- a/classes/classe_energy.lua
+++ b/classes/classe_energy.lua
@@ -305,7 +305,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex
local showing = tabela_do_combate [class_type]
if (#showing._ActorTable < 1) then --> não há barras para mostrar
- return _detalhes:EsconderBarrasNaoUsadas (instancia, showing)
+ return _detalhes:EsconderBarrasNaoUsadas (instancia, showing), "", 0, 0
end
local total = 0
diff --git a/classes/classe_heal.lua b/classes/classe_heal.lua
index 77316803..7af75546 100644
--- a/classes/classe_heal.lua
+++ b/classes/classe_heal.lua
@@ -199,7 +199,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo
--> não há barras para mostrar -- not have something to show
if (#showing._ActorTable < 1) then --> não há barras para mostrar
--> colocado isso recentemente para fazer as barras de dano sumirem na troca de atributo
- return _detalhes:EsconderBarrasNaoUsadas (instancia, showing)
+ return _detalhes:EsconderBarrasNaoUsadas (instancia, showing), "", 0, 0
end
--> total
@@ -292,7 +292,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo
end
if (#conteudo < 1) then
- return _detalhes:EsconderBarrasNaoUsadas (instancia, showing)
+ return _detalhes:EsconderBarrasNaoUsadas (instancia, showing), "", 0, 0
end
_detalhes:ContainerSortHeal (conteudo, nil, keyName)
diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua
index 3a5aba55..159a8a5c 100644
--- a/classes/classe_instancia.lua
+++ b/classes/classe_instancia.lua
@@ -1040,9 +1040,14 @@ function _detalhes:UngroupInstance()
return self:Desagrupar (-1)
end
-function _detalhes:Desagrupar (instancia, lado)
+function _detalhes:Desagrupar (instancia, lado, lado2)
+ if (lado2 == -1) then
+ instancia = lado
+ self = instancia
+ lado = lado2
+ end
- if (self.meu_id) then --> significa que self é uma instancia
+ if (self.meu_id and not lado2) then --> significa que self é uma instancia
lado = instancia
instancia = self
end
@@ -2733,7 +2738,7 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu)
_detalhes.popup:Select (1, checked)
if (from_mode_menu) then
- instancia.baseframe.cabecalho.modo_selecao:GetScript ("OnEnter")(instancia.baseframe.cabecalho.modo_selecao)
+ instancia.baseframe.cabecalho.modo_selecao:GetScript ("OnEnter")(instancia.baseframe.cabecalho.modo_selecao, _, true)
--> running OnEnter does also trigger an instance enter event, so we need to manually leave the instance:
_detalhes.OnLeaveMainWindow (instancia, instancia.baseframe.cabecalho.modo_selecao)
@@ -2946,7 +2951,6 @@ function _detalhes:monta_relatorio (este_relatorio, custom)
local container = self.showing [atributo]._ActorTable
if (atributo == 1) then --> damage
-
if (self.sub_atributo == 5) then --> frags
local frags = self.showing.frags
local reportarFrags = {}
@@ -3019,7 +3023,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom)
amt = math.min (amt, container_amount or 0)
local raw_data_to_report = {}
-
+
for i = 1, container_amount do
local actor = container [i]
diff --git a/classes/classe_others.lua b/classes/classe_others.lua
index c943aae2..85d84e74 100644
--- a/classes/classe_others.lua
+++ b/classes/classe_others.lua
@@ -570,7 +570,7 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo
local showing = tabela_do_combate [class_type] --> o que esta sendo mostrado -> [1] - dano [2] - cura --> pega o container com ._NameIndexTable ._ActorTable
if (#showing._ActorTable < 1) then --> não há barras para mostrar
- return _detalhes:EsconderBarrasNaoUsadas (instancia, showing)
+ return _detalhes:EsconderBarrasNaoUsadas (instancia, showing), "", 0, 0
end
local total = 0
diff --git a/core/control.lua b/core/control.lua
index 29b19875..69b945ee 100644
--- a/core/control.lua
+++ b/core/control.lua
@@ -320,11 +320,11 @@
_detalhes.tabela_vigente:seta_data (_detalhes._detalhes_props.DATA_TYPE_START) --seta na tabela do combate a data do inicio do combate -- setup time data
_detalhes.in_combat = true --sinaliza ao addon que há um combate em andamento -- in combat flag up
-
_detalhes.tabela_vigente.combat_id = n_combate --> grava o número deste combate na tabela atual -- setup combat id on new table
-
_detalhes.last_combat_pre_pot_used = nil
+ _detalhes:FlagCurrentCombat()
+
--> é o timer que ve se o jogador ta em combate ou não -- check if any party or raid members are in combat
_detalhes.tabela_vigente.verifica_combate = _detalhes:ScheduleRepeatingTimer ("EstaEmCombate", 1)
@@ -648,15 +648,9 @@
local tempo_do_combate = _detalhes.tabela_vigente:GetCombatTime()
local invalid_combat
- --if ( tempo_do_combate >= ) then --> tempo minimo precisa ser 5 segundos pra acrecentar a tabela ao historico
- --if ( tempo_do_combate >= 5 or not _detalhes.tabela_historico.tabelas[1]) then --> tempo minimo precisa ser 5 segundos pra acrecentar a tabela ao historico
- if ( tempo_do_combate >= _detalhes.minimum_combat_time or not _detalhes.tabela_historico.tabelas[1]) then --> tempo minimo precisa ser 5 segundos pra acrecentar a tabela ao historico
+ if ((tempo_do_combate >= _detalhes.minimum_combat_time or not _detalhes.tabela_historico.tabelas[1]) and not _detalhes.tabela_vigente.discard_segment) then
_detalhes.tabela_historico:adicionar (_detalhes.tabela_vigente) --move a tabela atual para dentro do histórico
else
- --print ("combat invalid...")
- --> this is a little bit complicated, need a specific function for combat cancellation
- --_table_wipe (_detalhes.tabela_vigente) --> descarta ela, não será mais usada
-
invalid_combat = _detalhes.tabela_vigente
_detalhes.tabela_vigente = _detalhes.tabela_historico.tabelas[1] --> pega a tabela do ultimo combate
@@ -1147,9 +1141,13 @@
end
function _detalhes:AddTooltipHeaderStatusbar (r, g, b, a)
- GameCooltip:AddStatusBar (100, 1, 1, 1, 1, a, nil, nil, [[Interface\WorldStateFrame\WORLDSTATEFINALSCORE-HIGHLIGHT]])
+ --GameCooltip:AddStatusBar (100, 1, 1, 1, 1, a, nil, nil, [[Interface\WorldStateFrame\WORLDSTATEFINALSCORE-HIGHLIGHT]])
+ GameCooltip:AddStatusBar (100, 1, unpack (_detalhes.tooltip.header_statusbar))
+
end
+-- /run local a,b=_detalhes.tooltip.header_statusbar,0.3;a[1]=b;a[2]=b;a[3]=b;a[4]=0.8;
+
function _detalhes:AddTooltipSpellHeaderText (headerText, headerColor, amount, iconTexture, L, R, T, B)
if (_detalhes.tooltip.show_amount) then
GameCooltip:AddLine (headerText, "x" .. amount .. "", nil, headerColor, 1, 1, 1, .4, _detalhes.tooltip.fontsize_title)
diff --git a/core/parser.lua b/core/parser.lua
index d19cf52c..e850c817 100644
--- a/core/parser.lua
+++ b/core/parser.lua
@@ -3055,6 +3055,17 @@
-- PARSER
--serach key: ~parser ~events ~start ~inicio
+
+ function _detalhes:FlagCurrentCombat()
+ if (_detalhes.is_in_battleground) then
+ _detalhes.tabela_vigente.pvp = true
+ _detalhes.tabela_vigente.is_pvp = {name = _detalhes.zone_name, mapid = _detalhes.zone_id}
+ elseif (_detalhes.is_in_arena) then
+ _detalhes.tabela_vigente.arena = true
+ _detalhes.tabela_vigente.is_arena = {name = _detalhes.zone_name, zone = _detalhes.zone_name, mapid = _detalhes.zone_id}
+ end
+ end
+
function _detalhes:GetZoneType()
return _detalhes.zone_type
end
@@ -3088,7 +3099,7 @@
_detalhes.time_type = _detalhes.time_type_original
end
- if (zoneType == "pvp") then
+ if (zoneType == "pvp") then --> battlegrounds
if (_detalhes.debug) then
_detalhes:Msg ("(debug) battleground found.")
@@ -3459,7 +3470,6 @@
end
elseif (_detalhes.is_in_battleground) then
-
local timerType, timeSeconds, totalTime = select (1, ...)
if (_detalhes.start_battleground) then
@@ -3467,13 +3477,15 @@
end
_detalhes.start_battleground = _detalhes:ScheduleTimer ("CreateBattlegroundSegment", timeSeconds)
-
end
end
function _detalhes:CreateBattlegroundSegment()
- _current_combat:SetStartTime (_GetTime())
- --print ("Battleground has begun.")
+ if (_in_combat) then
+ _detalhes.tabela_vigente.discard_segment = true
+ _detalhes:SairDoCombate()
+ end
+ _detalhes:EntrarEmCombate()
end
-- ~load
@@ -3483,9 +3495,20 @@
if (addon_name == "Details") then
+ if (not _detalhes.gump) then
+ --> failed to load the framework.
+
+ if (not _detalhes.instance_load_failed) then
+ _detalhes:CreatePanicWarning()
+ end
+ _detalhes.instance_load_failed.text:SetText ("Framework for Details! isn't loaded.\nIf you just updated the addon, please reboot the game client.\nWe apologize for the inconvenience and thank you for your comprehension.")
+
+ return
+ end
+
--> cooltip
if (not _G.GameCooltip) then
- _detalhes.popup = DetailsCreateCoolTip()
+ _detalhes.popup = _G.GameCooltip
else
_detalhes.popup = _G.GameCooltip
end
@@ -3552,6 +3575,11 @@
saver:RegisterEvent ("PLAYER_LOGOUT")
saver:SetScript ("OnEvent", function (...)
+ if (not _detalhes.gump) then
+ --> failed to load the framework.
+ return
+ end
+
local saver_error = function (errortext)
_detalhes_global = _detalhes_global or {}
_detalhes_global.exit_errors = _detalhes_global.exit_errors or {}
@@ -3984,9 +4012,13 @@
local actor = _detalhes.tabela_vigente (1, name)
if (actor) then
+ if (damageDone == 0) then
+ damageDone = damageDone + _detalhes:GetOrderNumber()
+ end
actor.total = damageDone
actor.classe = classToken
- else
+
+ elseif (name ~= "Unknown") then
local guid = _UnitGUID (name)
if (guid) then
local flag
@@ -4003,9 +4035,13 @@
local actor = _detalhes.tabela_vigente (2, name)
if (actor) then
+ if (healingDone == 0) then
+ healingDone = healingDone + _detalhes:GetOrderNumber()
+ end
actor.total = healingDone
actor.classe = classToken
- else
+
+ elseif (name ~= "Unknown") then
local guid = _UnitGUID (name)
if (guid) then
local flag
diff --git a/core/plugins_raid.lua b/core/plugins_raid.lua
index a313e53c..74d70c84 100644
--- a/core/plugins_raid.lua
+++ b/core/plugins_raid.lua
@@ -104,7 +104,7 @@
if (from_mode_menu) then
--refresh
- instance.baseframe.cabecalho.modo_selecao:GetScript ("OnEnter")(instance.baseframe.cabecalho.modo_selecao)
+ instance.baseframe.cabecalho.modo_selecao:GetScript ("OnEnter")(instance.baseframe.cabecalho.modo_selecao, _, true)
end
else
if (not instance.wait_for_plugin) then
diff --git a/core/plugins_statusbar.lua b/core/plugins_statusbar.lua
index bb2b7302..b7d0508b 100644
--- a/core/plugins_statusbar.lua
+++ b/core/plugins_statusbar.lua
@@ -1467,7 +1467,6 @@ window.close_with_right = true
window.child = nil
window.instance = nil
window:SetFrameStrata ("FULLSCREEN")
-window:DisableGradient()
window:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize=12})
window:SetBackdropColor (0, 0, 0, 0.9)
@@ -1481,7 +1480,7 @@ extraWindow:Hide()
extraWindow:SetHook ("OnHide", function()
window:Hide()
end)
-extraWindow:DisableGradient()
+
extraWindow:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize=12})
extraWindow:SetBackdropColor (0, 0, 0, 0.9)
diff --git a/core/windows.lua b/core/windows.lua
index c33458f1..f3efa74e 100644
--- a/core/windows.lua
+++ b/core/windows.lua
@@ -429,8 +429,7 @@
function _detalhes:RestoreMainWindowPosition (pre_defined)
- if (not pre_defined and self.libwindow.x and self.mostrando == "normal") then
- --if (not true and not pre_defined and self.libwindow.x and self.mostrando == "normal") then
+ if (not pre_defined and self.libwindow.x and self.mostrando == "normal" and not _detalhes.instances_no_libwindow) then
local s = self.window_scale
self.baseframe:SetScale (s)
self.rowframe:SetScale (s)
@@ -1551,7 +1550,7 @@
capsule.image:SetDesaturated (true)
end
- local on_click = function (website)
+ local on_click = function (_, _, website)
if (website == 1) then
_detalhes:CopyPaste ([[http://www.wowinterface.com/downloads/addcomment.php?action=addcomment&fileid=23056]])
@@ -1609,12 +1608,12 @@
_detalhes.class_colors [self.MyObject.my_class][3] = b
_detalhes:AtualizaGumpPrincipal (-1, true)
end
- local set_color = function (class, index, self, button)
+ local set_color = function (self, button, class, index)
local current_class_color = _detalhes.class_colors [class]
local r, g, b = unpack (current_class_color)
_detalhes.gump:ColorPick (self, r, g, b, 1, callback)
end
- local reset_color = function (class, index, self, button)
+ local reset_color = function (self, button, class, index)
local color_table = RAID_CLASS_COLORS [class]
local r, g, b = color_table.r, color_table.g, color_table.b
self.MyObject.my_texture:SetVertexColor (r, g, b)
@@ -1685,7 +1684,7 @@
local panel = _G.DetailsBookmarkManager
panel.blocks = {}
- local clear_func = function (id)
+ local clear_func = function (self, button, id)
if (_detalhes.switch.table [id]) then
_detalhes.switch.table [id].atributo = nil
_detalhes.switch.table [id].sub_atributo = nil
@@ -1705,7 +1704,7 @@
end
local cooltip_color = {.1, .1, .1, .3}
- local set_att = function (id, _, self)
+ local set_att = function (self, button, id)
panel.selecting_slot = id
GameCooltip:Reset()
GameCooltip:SetType (3)
@@ -1714,6 +1713,10 @@
GameCooltip:SetColor (1, cooltip_color)
GameCooltip:SetColor (2, cooltip_color)
GameCooltip:SetOption ("HeightAnchorMod", -7)
+ GameCooltip:SetOption ("TextSize", _detalhes.font_sizes.menus)
+ GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color)
+ GameCooltip:SetBackdrop (2, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color)
+
GameCooltip:ShowCooltip()
end
diff --git a/framework/framework.lua b/framework/framework.lua
deleted file mode 100644
index 505f36a4..00000000
--- a/framework/framework.lua
+++ /dev/null
@@ -1,304 +0,0 @@
---> details main objects
-local _detalhes = _G._detalhes
-local gump = _detalhes.gump
-
-local _type = type
-local _unpack = unpack
-local _
-gump.LabelNameCounter = 1
-gump.PictureNameCounter = 1
-gump.BarNameCounter = 1
-gump.DropDownCounter = 1
-gump.PanelCounter = 1
-gump.ButtonCounter = 1
-
-gump.debug = false
-
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---> points
-function gump:CheckPoints (v1, v2, v3, v4, v5, object)
-
- --bg_esq:SetPoint ("topleft", DmgRankFrame, 10, -215)
-
- if (not v1 and not v2) then
- return "topleft", object.widget:GetParent(), "topleft", 0, 0
- end
-
- if (_type (v1) == "string") then
- local frameGlobal = _G [v1]
- if (frameGlobal and frameGlobal.GetObjectType) then
- return gump:CheckPoints (frameGlobal, v2, v3, v4, v5, object)
- end
-
- elseif (_type (v2) == "string") then
- local frameGlobal = _G [v2]
- if (frameGlobal and frameGlobal.GetObjectType) then
- return gump:CheckPoints (v1, frameGlobal, v3, v4, v5, object)
- end
- end
-
- if (_type (v1) == "string" and _type (v2) == "table") then --> :setpoint ("left", frame, _, _, _)
- if (not v3 or _type (v3) == "number") then --> :setpoint ("left", frame, 10, 10)
- v1, v2, v3, v4, v5 = v1, v2, v1, v3, v4
- --else
- --> :setpoint ("left", frame, "left", 10, 10)
- end
-
- elseif (_type (v1) == "string" and _type (v2) == "number") then --> :setpoint ("topleft", x, y)
- v1, v2, v3, v4, v5 = v1, object.widget:GetParent(), v1, v2, v3
-
- elseif (_type (v1) == "number") then --> :setpoint (x, y)
- v1, v2, v3, v4, v5 = "topleft", object.widget:GetParent(), "topleft", v1, v2
-
- elseif (_type (v1) == "table") then --> :setpoint (frame, x, y)
- v1, v2, v3, v4, v5 = "topleft", v1, "topleft", v2, v3
-
- end
-
- if (not v2) then
- v2 = object.widget:GetParent()
- elseif (v2.dframework) then
- v2 = v2.widget
- end
-
- return v1 or "topleft", v2, v3 or "topleft", v4 or 0, v5 or 0
-end
-
-
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---> color scheme
-
-function gump:NewColor (_colorname, _colortable, _green, _blue, _alpha)
-
- if (_type (_colorname) ~= "string") then
- return _detalhes:NewError ("color name must be a string.")
- end
-
- if (gump.alias_text_colors [_colorname]) then
- return _detalhes:NewError (_colorname .. " already exists.")
- end
-
- if (_type (_colortable) == "table") then
- if (_colortable[1] and _colortable[2] and _colortable[3]) then
- _colortable[4] = _colortable[4] or 1
- gump.alias_text_colors [_colorname] = _colortable
- else
- return _detalhes:NewError ("invalid color table.")
- end
- elseif (_colortable and _green and _blue) then
- _alpha = _alpha or 1
- gump.alias_text_colors [_colorname] = {_colortable, _green, _blue, _alpha}
- else
- return _detalhes:NewError ("invalid parameter.")
- end
-
- return true
-end
-
-function gump:IsHtmlColor (color)
- return gump.alias_text_colors [color]
-end
-
-local tn = tonumber
-function gump:ParseColors (_arg1, _arg2, _arg3, _arg4)
- if (_type (_arg1) == "table") then
- _arg1, _arg2, _arg3, _arg4 = _unpack (_arg1)
-
- elseif (_type (_arg1) == "string") then
-
- if (string.find (_arg1, "#")) then
- _arg1 = _arg1:gsub ("#","")
- if (string.len (_arg1) == 8) then --alpha
- _arg1, _arg2, _arg3, _arg4 = tn ("0x" .. _arg1:sub (3, 4))/255, tn ("0x" .. _arg1:sub (5, 6))/255, tn ("0x" .. _arg1:sub (7, 8))/255, tn ("0x" .. _arg1:sub (1, 2))/255
- else
- _arg1, _arg2, _arg3, _arg4 = tn ("0x" .. _arg1:sub (1, 2))/255, tn ("0x" .. _arg1:sub (3, 4))/255, tn ("0x" .. _arg1:sub (5, 6))/255, 1
- end
-
- else
- local color = gump.alias_text_colors [_arg1]
- if (color) then
- _arg1, _arg2, _arg3, _arg4 = _unpack (color)
- else
- _arg1, _arg2, _arg3, _arg4 = _unpack (gump.alias_text_colors.none)
- end
- end
- end
-
- if (not _arg1) then
- _arg1 = 1
- end
- if (not _arg2) then
- _arg2 = 1
- end
- if (not _arg3) then
- _arg3 = 1
- end
- if (not _arg4) then
- _arg4 = 1
- end
-
- return _arg1, _arg2, _arg3, _arg4
-end
-
-function gump:BuildMenu (parent, menu, x_offset, y_offset, height)
-
- local cur_x = x_offset
- local cur_y = y_offset
- local max_x = 0
-
- for index, widget_table in ipairs (menu) do
-
- if (widget_table.type == "select" or widget_table.type == "dropdown") then
- local dropdown = self:NewDropDown (parent, nil, "$parentWidget" .. index, nil, 140, 18, widget_table.values, widget_table.get())
- dropdown.tooltip = widget_table.desc
- local label = self:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name, "GameFontNormal", 12)
- dropdown:SetPoint ("left", label, "right", 2)
- label:SetPoint (cur_x, cur_y)
-
- local size = label.widget:GetStringWidth() + 140 + 4
- if (size > max_x) then
- max_x = size
- end
-
- elseif (widget_table.type == "toggle" or widget_table.type == "switch") then
- local switch = self:NewSwitch (parent, nil, "$parentWidget" .. index, nil, 60, 20, nil, nil, widget_table.get())
- switch.tooltip = widget_table.desc
- switch.OnSwitch = widget_table.set
-
- local label = self:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name, "GameFontNormal", 12)
- switch:SetPoint ("left", label, "right", 2)
- label:SetPoint (cur_x, cur_y)
-
- local size = label.widget:GetStringWidth() + 60 + 4
- if (size > max_x) then
- max_x = size
- end
-
- elseif (widget_table.type == "range" or widget_table.type == "slider") then
- local is_decimanls = widget_table.usedecimals
- local slider = self:NewSlider (parent, nil, "$parentWidget" .. index, nil, 140, 20, widget_table.min, widget_table.max, widget_table.step, widget_table.get(), is_decimanls)
- slider.tooltip = widget_table.desc
- slider:SetHook ("OnValueChange", widget_table.set)
-
- local label = self:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name, "GameFontNormal", 12)
- slider:SetPoint ("left", label, "right", 2)
- label:SetPoint (cur_x, cur_y)
-
- local size = label.widget:GetStringWidth() + 60 + 4
- if (size > max_x) then
- max_x = size
- end
-
- elseif (widget_table.type == "color" or widget_table.type == "color") then
- local colorpick = self:NewColorPickButton (parent, "$parentWidget" .. index, nil, widget_table.set)
- colorpick.tooltip = widget_table.desc
-
- local default_value, g, b, a = widget_table.get()
- if (type (default_value) == "table") then
- colorpick:SetColor (unpack (default_value))
- else
- colorpick:SetColor (default_value, g, b, a)
- end
-
- local label = self:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name, "GameFontNormal", 12)
- colorpick:SetPoint ("left", label, "right", 2)
- label:SetPoint (cur_x, cur_y)
-
- local size = label.widget:GetStringWidth() + 60 + 4
- if (size > max_x) then
- max_x = size
- end
-
- elseif (widget_table.type == "execute" or widget_table.type == "button") then
-
- local button = self:NewButton (parent, nil, "$parentWidget", nil, 120, 18, widget_table.func, widget_table.param1, widget_table.param2, nil, widget_table.name)
- button:InstallCustomTexture()
- button:SetPoint (cur_x, cur_y)
- button.tooltip = widget_table.desc
-
- local size = button:GetWidth() + 4
- if (size > max_x) then
- max_x = size
- end
-
- end
-
- 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
- end
-
- end
-
-end
-
-function gump:ShowTutorialAlertFrame (maintext, desctext, clickfunc)
-
- local TutorialAlertFrame = _G.DetailsTutorialAlertFrame
-
- if (not TutorialAlertFrame) then
-
- TutorialAlertFrame = CreateFrame ("ScrollFrame", "DetailsTutorialAlertFrame", UIParent, "DetailsTutorialAlertFrameTemplate")
- TutorialAlertFrame.isFirst = true
- TutorialAlertFrame:SetPoint ("left", UIParent, "left", -20, 100)
-
- TutorialAlertFrame:SetWidth (290)
- TutorialAlertFrame.ScrollChild:SetWidth (256)
-
- local scrollname = TutorialAlertFrame.ScrollChild:GetName()
- _G [scrollname .. "BorderTopLeft"]:SetVertexColor (1, 0.8, 0, 1)
- _G [scrollname .. "BorderTopRight"]:SetVertexColor (1, 0.8, 0, 1)
- _G [scrollname .. "BorderBotLeft"]:SetVertexColor (1, 0.8, 0, 1)
- _G [scrollname .. "BorderBotRight"]:SetVertexColor (1, 0.8, 0, 1)
- _G [scrollname .. "BorderLeft"]:SetVertexColor (1, 0.8, 0, 1)
- _G [scrollname .. "BorderRight"]:SetVertexColor (1, 0.8, 0, 1)
- _G [scrollname .. "BorderBottom"]:SetVertexColor (1, 0.8, 0, 1)
- _G [scrollname .. "BorderTop"]:SetVertexColor (1, 0.8, 0, 1)
-
- local iconbg = _G [scrollname .. "QuestIconBg"]
- iconbg:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]])
- iconbg:SetTexCoord (0, 1, 0, 1)
- iconbg:SetSize (100, 100)
- iconbg:ClearAllPoints()
- iconbg:SetPoint ("bottomleft", TutorialAlertFrame.ScrollChild, "bottomleft")
-
- _G [scrollname .. "Exclamation"]:SetVertexColor (1, 0.8, 0, 1)
- _G [scrollname .. "QuestionMark"]:SetVertexColor (1, 0.8, 0, 1)
-
- _G [scrollname .. "TopText"]:SetText ("Details!") --string
- _G [scrollname .. "QuestName"]:SetText ("") --string
- _G [scrollname .. "BottomText"]:SetText ("") --string
-
- TutorialAlertFrame.ScrollChild.IconShine:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]])
-
- TutorialAlertFrame:SetScript ("OnMouseUp", function (self)
- if (self.clickfunc and type (self.clickfunc) == "function") then
- self.clickfunc()
- end
- self:Hide()
- end)
- TutorialAlertFrame:Hide()
- end
-
- if (type (maintext) == "string") then
- TutorialAlertFrame.ScrollChild.QuestName:SetText (maintext)
- else
- TutorialAlertFrame.ScrollChild.QuestName:SetText ("")
- end
-
- if (type (desctext) == "string") then
- TutorialAlertFrame.ScrollChild.BottomText:SetText (desctext)
- else
- TutorialAlertFrame.ScrollChild.BottomText:SetText ("")
- end
-
- TutorialAlertFrame.clickfunc = clickfunc
- TutorialAlertFrame:Show()
- DetailsTutorialAlertFrame_SlideInFrame (TutorialAlertFrame, "AUTOQUEST")
-end
\ No newline at end of file
diff --git a/functions/link.lua b/functions/link.lua
index f24197de..7b19698c 100644
--- a/functions/link.lua
+++ b/functions/link.lua
@@ -2336,7 +2336,7 @@
-----------------------------------------------
- local select_module = function (module_number)
+ local select_module = function (a, b, module_number)
if (current_module ~= module_number) then
local module = all_modules [current_module]
@@ -2377,7 +2377,7 @@
end
function f:refresh()
- select_module (current_module)
+ select_module (nil, nil, current_module)
end
for i = 1, #all_modules do
@@ -2389,7 +2389,7 @@
tinsert (buttons, b)
end
- select_module (1)
+ select_module (nil, nil, 1)
end
diff --git a/functions/profiles.lua b/functions/profiles.lua
index 486eec3a..ce737218 100644
--- a/functions/profiles.lua
+++ b/functions/profiles.lua
@@ -189,7 +189,32 @@ end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> Profiles:
--> return the profile table requested
-
+
+function _detalhes:CreatePanicWarning()
+ _detalhes.instance_load_failed = CreateFrame ("frame", "DetailsPanicWarningFrame", UIParent)
+ _detalhes.instance_load_failed:SetHeight (80)
+ --tinsert (UISpecialFrames, "DetailsPanicWarningFrame")
+ _detalhes.instance_load_failed.text = _detalhes.instance_load_failed:CreateFontString (nil, "overlay", "GameFontNormal")
+ _detalhes.instance_load_failed.text:SetPoint ("center", _detalhes.instance_load_failed, "center")
+ _detalhes.instance_load_failed.text:SetTextColor (1, 0.6, 0)
+ _detalhes.instance_load_failed:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
+ _detalhes.instance_load_failed:SetBackdropColor (1, 0, 0, 0.2)
+ _detalhes.instance_load_failed:SetPoint ("topleft", UIParent, "topleft", 0, -250)
+ _detalhes.instance_load_failed:SetPoint ("topright", UIParent, "topright", 0, -250)
+end
+
+local safe_load = function (func, param1, param2)
+ local okey, errortext = pcall (func, param1, param2)
+ if (not okey) then
+ if (not _detalhes.instance_load_failed) then
+ _detalhes:CreatePanicWarning()
+ end
+ _detalhes.do_not_save_skins = true
+ _detalhes.instance_load_failed.text:SetText ("Failed to load a Details! window.\n/reload or reboot the game client may fix the problem.\nIf the problem persist, try /details reinstall.\nError: " .. errortext .. "")
+ end
+ return okey
+end
+
function _detalhes:ApplyProfile (profile_name, nosave, is_copy)
--> get the profile
@@ -383,8 +408,11 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy)
--> load data saved for this character only
instance:LoadLocalInstanceConfig()
if (skin.__was_opened) then
- --tinsert (_detalhes.resize_debug, #_detalhes.resize_debug+1, "libwindow X (383): " .. (instance.libwindow.x or 0))
- instance:AtivarInstancia()
+
+ if (not safe_load (_detalhes.AtivarInstancia, instance)) then
+ return
+ end
+
else
instance.ativa = false
end
@@ -555,18 +583,20 @@ function _detalhes:SaveProfile (saveas)
end
--> save skins
- table.wipe (profile.instances)
-
- for index, instance in ipairs (_detalhes.tabela_instancias) do
- local exported = instance:ExportSkin()
- exported.__was_opened = instance:IsEnabled()
- exported.__pos = table_deepcopy (instance:GetPosition())
- exported.__locked = instance.isLocked
- exported.__snap = table_deepcopy (instance.snap)
- exported.__snapH = instance.horizontalSnap
- exported.__snapV = instance.verticalSnap
- profile.instances [index] = exported
+ if (not _detalhes.do_not_save_skins) then
+ table.wipe (profile.instances)
+ for index, instance in ipairs (_detalhes.tabela_instancias) do
+ local exported = instance:ExportSkin()
+ exported.__was_opened = instance:IsEnabled()
+ exported.__pos = table_deepcopy (instance:GetPosition())
+ exported.__locked = instance.isLocked
+ exported.__snap = table_deepcopy (instance.snap)
+ exported.__snapH = instance.horizontalSnap
+ exported.__snapV = instance.verticalSnap
+ profile.instances [index] = exported
+ end
end
+ _detalhes.do_not_save_skins = nil
_detalhes:SaveLocalInstanceConfig()
@@ -870,6 +900,8 @@ local default_profile = {
instances_amount = 5,
instances_segments_locked = false,
instances_disable_bar_highlight = false,
+ instances_menu_click_to_open = false,
+ instances_no_libwindow = false,
--> if clear ungroup characters when logout
clear_ungrouped = true,
@@ -970,7 +1002,7 @@ local default_profile = {
show_amount = false,
commands = {},
header_text_color = {1, 0.9176, 0, 1}, --{1, 0.7, 0, 1}
- header_statusbar = {0.3, 0.3, 0.3, 0.8},
+ header_statusbar = {0.3, 0.3, 0.3, 0.8, false, false, "WorldState Score"},
submenu_wallpaper = true,
anchored_to = 1,
diff --git a/functions/skins.lua b/functions/skins.lua
index 600d3e4c..baf40168 100644
--- a/functions/skins.lua
+++ b/functions/skins.lua
@@ -141,8 +141,8 @@ local _
["bg_g"] = 0.0941,
["bars_grow_direction"] = 1,
["row_info"] = {
- ["textR_outline"] = false,
- ["spec_file"] = "Interface\\AddOns\\Details\\images\\spec_icons_normal",
+ ["textR_outline"] = true,
+ ["spec_file"] = "Interface\\AddOns\\Details\\images\\spec_icons_normal_alpha",
["textL_outline"] = true,
["texture_highlight"] = "Interface\\FriendsFrame\\UI-FriendsList-Highlight",
["textR_show_data"] = {
@@ -162,7 +162,7 @@ local _
["between"] = 1,
},
["texture_background_class_color"] = false,
- ["start_after_icon"] = true,
+ ["start_after_icon"] = false,
["font_face_file"] = "Fonts\\ARIALN.TTF",
["textL_custom_text"] = "{data1}. {data3}{data2}",
["font_size"] = 10,
@@ -200,7 +200,7 @@ local _
0.619607, -- [3]
0.116164, -- [4]
},
- ["font_face"] = "Arial Narrow",
+ ["font_face"] = "Accidental Presidency",
["texture_class_colors"] = true,
["backdrop"] = {
["enabled"] = false,
diff --git a/gumps/janela_custom.lua b/gumps/janela_custom.lua
index 583284bb..70081ef4 100644
--- a/gumps/janela_custom.lua
+++ b/gumps/janela_custom.lua
@@ -630,7 +630,7 @@
end
end
- function DetailsCustomPanel.StartEditCode (code)
+ function DetailsCustomPanel.StartEditCode (_, _, code)
if (code == 1) then --> edit main code
custom_window.codeeditor:SetText (DetailsCustomPanel.code1)
@@ -710,7 +710,7 @@
custom_window.menu [index] = {circle = circle, icon = texture, button = button}
end
- local build_menu = function (func, param2, self)
+ local build_menu = function (self, button, func, param2)
GameCooltip:Reset()
for index, custom_object in _ipairs (_detalhes.custom) do
@@ -725,6 +725,9 @@
GameCooltip:SetOption ("IgnoreButtonAutoHeight", false)
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
+ GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color)
+ GameCooltip:SetBackdrop (2, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color)
+
GameCooltip:SetType ("menu")
GameCooltip:SetHost (self, "left", "right", -7, 0)
GameCooltip:Show()
@@ -735,7 +738,6 @@
GameCooltip:Hide()
DetailsCustomPanel:StartEdit (custom_object)
end
- --custom_window:CreateMenuButton ("Edit", "Interface\\ICONS\\INV_Feather_06", build_menu, start_edit, nil, "Select a display to edit.", "Edit", {0.93, 0.07, 0.07, 0.93}) --> localize
custom_window:CreateMenuButton (Loc ["STRING_CUSTOM_EDIT"], "Interface\\ICONS\\INV_Inscription_RunescrollOfFortitude_Red", build_menu, start_edit, nil, nil, "Edit", {0.07, 0.93, 0.07, 0.93}) --> localize
--> remove button
@@ -1131,9 +1133,6 @@
button.MyObject.image:SetBlendMode ("ADD")
button.MyObject.line:SetBlendMode ("ADD")
button.MyObject.label:SetTextColor (1, 1, 1, 1)
- local OnEnterColors = button:GetParent().Gradient.OnEnter
- local _r, _g, _b, _a = button:GetParent():GetBackdropColor()
- gump:GradientEffect (button:GetParent(), "frame", _r, _g, _b, _a, OnEnterColors[1], OnEnterColors[2], OnEnterColors[3], OnEnterColors[4], .3)
GameTooltip:SetOwner (button, "ANCHOR_TOPLEFT")
GameTooltip:AddLine (button.MyObject.actor)
GameTooltip:Show()
@@ -1150,11 +1149,6 @@
button.MyObject.image:SetBlendMode ("BLEND")
button.MyObject.line:SetBlendMode ("BLEND")
button.MyObject.label:SetTextColor (.8, .8, .8, .8)
- local _r, _g, _b, _a = button:GetParent():GetBackdropColor()
- if (_r) then
- local OnLeaveColors = button:GetParent().Gradient.OnLeave
- gump:GradientEffect (button:GetParent(), "frame", _r, _g, _b, _a, OnLeaveColors[1], OnLeaveColors[2], OnLeaveColors[3], OnLeaveColors[4], .3)
- end
GameTooltip:Hide()
modelFrame:Hide()
end
@@ -1347,9 +1341,6 @@
button.MyObject.image:SetBlendMode ("ADD")
button.MyObject.line:SetBlendMode ("ADD")
button.MyObject.label:SetTextColor (1, 1, 1, 1)
- local OnEnterColors = button:GetParent().Gradient.OnEnter
- local _r, _g, _b, _a = button:GetParent():GetBackdropColor()
- gump:GradientEffect (button:GetParent(), "frame", _r, _g, _b, _a, OnEnterColors[1], OnEnterColors[2], OnEnterColors[3], OnEnterColors[4], .3)
GameTooltip:SetOwner (button, "ANCHOR_TOPLEFT")
GameTooltip:AddLine (button.MyObject.actor)
GameTooltip:Show()
@@ -1366,11 +1357,6 @@
button.MyObject.image:SetBlendMode ("BLEND")
button.MyObject.line:SetBlendMode ("BLEND")
button.MyObject.label:SetTextColor (.8, .8, .8, .8)
- local _r, _g, _b, _a = button:GetParent():GetBackdropColor()
- if (_r) then
- local OnLeaveColors = button:GetParent().Gradient.OnLeave
- gump:GradientEffect (button:GetParent(), "frame", _r, _g, _b, _a, OnLeaveColors[1], OnLeaveColors[2], OnLeaveColors[3], OnLeaveColors[4], .3)
- end
GameTooltip:Hide()
modelFrame:Hide()
@@ -1530,9 +1516,6 @@
button.MyObject.image:SetBlendMode ("ADD")
button.MyObject.line:SetBlendMode ("ADD")
button.MyObject.label:SetTextColor (1, 1, 1, 1)
- local OnEnterColors = button:GetParent().Gradient.OnEnter
- local _r, _g, _b, _a = button:GetParent():GetBackdropColor()
- gump:GradientEffect (button:GetParent(), "frame", _r, _g, _b, _a, OnEnterColors[1], OnEnterColors[2], OnEnterColors[3], OnEnterColors[4], .3)
GameTooltip:SetOwner (button, "ANCHOR_TOPLEFT")
_detalhes:GameTooltipSetSpellByID (button.MyObject.spellid)
@@ -1542,11 +1525,6 @@
button.MyObject.image:SetBlendMode ("BLEND")
button.MyObject.line:SetBlendMode ("BLEND")
button.MyObject.label:SetTextColor (.8, .8, .8, .8)
- local _r, _g, _b, _a = button:GetParent():GetBackdropColor()
- if (_r) then
- local OnLeaveColors = button:GetParent().Gradient.OnLeave
- gump:GradientEffect (button:GetParent(), "frame", _r, _g, _b, _a, OnLeaveColors[1], OnLeaveColors[2], OnLeaveColors[3], OnLeaveColors[4], .3)
- end
GameTooltip:Hide()
end
@@ -1759,6 +1737,11 @@
local percent_code = DetailsCustomPanel.code4
local object = DetailsCustomPanel.IsEditing
+
+ if (type (object) ~= "table") then
+ return _detalhes:Msg ("This object need to be saved before.")
+ end
+
object.script = main_code
object.tooltip = tooltip_code
diff --git a/gumps/janela_news.lua b/gumps/janela_news.lua
index ddcf1aff..bf425f11 100644
--- a/gumps/janela_news.lua
+++ b/gumps/janela_news.lua
@@ -9,10 +9,18 @@ function _detalhes:DumpTable (text_to_show, dumpvalues, keeptext)
end
function _detalhes:OpenNewsWindow (text_to_show, dumpvalues, keeptext)
+
local news_window = _detalhes:CreateOrOpenNewsWindow()
news_window:Title (Loc ["STRING_NEWS_TITLE"])
+ if (dumpvalues == "change_log" or text_to_show == "LeftButton") then
+ news_window:Text (Loc ["STRING_VERSION_LOG"])
+ news_window:Icon ([[Interface\AddOns\Details\images\icons2]], {108/512, 189/512, 319/512, 400/512})
+ news_window:Show()
+ return
+ end
+
if (text_to_show and type (text_to_show) == "table") then
DetailsNewsWindowLower:SetSize (450, 5000)
@@ -46,7 +54,6 @@ function _detalhes:OpenNewsWindow (text_to_show, dumpvalues, keeptext)
end
news_window:Icon ([[Interface\AddOns\Details\images\icons2]], {108/512, 189/512, 319/512, 400/512})
-
news_window:Show()
end
diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua
index d378db9f..bdd973bd 100644
--- a/gumps/janela_options.lua
+++ b/gumps/janela_options.lua
@@ -56,16 +56,33 @@ local texture_select_icon, texture_select_texcoord = [[Interface\AddOns\Details\
local dropdown_backdrop = {edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize = 14,
bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", tile = true, tileSize = 16, insets = {left = 3, right = 3, top = 0, bottom = 0}}
dropdown_backdrop_border_color = {.7, .7, .7}
-local dropdown_height = 16
+local dropdown_height = 18
local dropdown_backdrop_onenter = {0, 0, 0, 1}
local dropdown_backdrop_onleave = {.1, .1, .1, .9}
local SLIDER_WIDTH = 130
-local SLIDER_HEIGHT = 19
+local SLIDER_HEIGHT = 18
+local TEXTENTRY_HEIGHT = 18
local DROPDOWN_WIDTH = 160
local COLOR_BUTTON_WIDTH = 160
+g.button_templates ["DETAILS_SKIN_OPTION_BUTTON_TEMPLATE"] = {
+ backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
+ backdropcolor = {1, 1, 1, .5},
+ backdropbordercolor = {0, 0, 0, 1},
+ width = 160,
+ height = 18,
+ icon = {texture = [[Interface\Buttons\UI-OptionsButton]], width = 12, height = 12, color = {1, 0.8, 0, 1}, textdistance = 3, leftpadding = 2},
+}
+g.button_templates ["DETAILS_TITLEBAR_OPTION_BUTTON_TEMPLATE"] = {
+ backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
+ backdropcolor = {1, 1, 1, .1},
+ backdropbordercolor = {0, 0, 0, 1},
+ width = 21,
+ height = 21,
+}
+
_detalhes.options_window_background = [[Interface\AddOns\Details\images\options_window]]
function _detalhes:SetOptionsWindowTexture (texture)
@@ -100,6 +117,12 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section)
if (not window) then
+ local options_button_template = g:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")
+ local options_dropdown_template = g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")
+ local options_slider_template = g:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")
+ local options_switch_template = g:GetTemplate ("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE")
+
+
local config_slider = function (slider)
slider:SetBackdrop (slider_backdrop)
slider:SetBackdropColor (unpack (slider_backdrop_color))
@@ -312,7 +335,7 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section)
--local profile_string = g:NewLabel (window, nil, nil, "instancetext", "Current Profile:", "GameFontNormal", 12)
--profile_string:SetPoint ("bottomleft", window, "bottomleft", 27, 11)
- local instances = g:NewDropDown (window, _, "$parentInstanceSelectDropdown", "instanceDropdown", 200, 18, buildInstanceMenu, nil)
+ local instances = g:NewDropDown (window, _, "$parentInstanceSelectDropdown", "instanceDropdown", 200, 18, buildInstanceMenu) --, nil, options_dropdown_template
instances:SetPoint ("bottomright", window, "bottomright", -17, 09)
instances:SetHook ("OnEnter", function()
GameCooltip:Reset()
@@ -451,7 +474,7 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section)
--> change log
- local changelog = g:NewButton (window, _, "$parentOpenChangeLogButton", nil, 110, 14, _detalhes.OpenNewsWindow, nil, nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1)
+ local changelog = g:NewButton (window, _, "$parentOpenChangeLogButton", nil, 110, 14, _detalhes.OpenNewsWindow, "change_log", nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1)
changelog:SetPoint ("left", fillbars, "right", 10, 0)
changelog.textalign = "left"
changelog:SetHook ("OnEnter", function()
@@ -1170,6 +1193,7 @@ local menus2 = {
window.top_start_at = -90
window.buttons_width = 160
+ window.buttons_height = 18
function window:arrange_menu (frame, t, x, y_start)
local y = y_start
@@ -1248,21 +1272,21 @@ function window:CreateFrame20()
c[1], c[2], c[3], c[4] = r, g, b, a
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
- g:NewColorPickButton (frame20, "$parentTooltipTextColorPick", "TooltipTextColorPick", tooltip_text_color_callback)
+ g:NewColorPickButton (frame20, "$parentTooltipTextColorPick", "TooltipTextColorPick", tooltip_text_color_callback, nil, options_button_template)
-- right color pick
local tooltip_text_color_callback_right = function (button, r, g, b, a)
local c = _detalhes.tooltip.fontcolor_right
c[1], c[2], c[3], c[4] = r, g, b, a
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
- g:NewColorPickButton (frame20, "$parentTooltipTextColorPickRight", "TooltipTextColorPickRight", tooltip_text_color_callback_right)
+ g:NewColorPickButton (frame20, "$parentTooltipTextColorPickRight", "TooltipTextColorPickRight", tooltip_text_color_callback_right, nil, options_button_template)
-- anchor color pick
local tooltip_text_color_callback_anchor = function (button, r, g, b, a)
local c = _detalhes.tooltip.header_text_color
c[1], c[2], c[3], c[4] = r, g, b, a
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
- g:NewColorPickButton (frame20, "$parentTooltipTextColorPickAnchor", "TooltipTextColorPickAnchor", tooltip_text_color_callback_anchor)
+ g:NewColorPickButton (frame20, "$parentTooltipTextColorPickAnchor", "TooltipTextColorPickAnchor", tooltip_text_color_callback_anchor, nil, options_button_template)
-- text label
g:NewLabel (frame20, _, "$parentTooltipTextColorLabel", "TooltipTextColorLabel", Loc ["STRING_OPTIONS_TOOLTIPS_FONTCOLOR"], "GameFontHighlightLeft")
frame20.TooltipTextColorPick:SetPoint ("left", frame20.TooltipTextColorLabel, "right", 2, 0)
@@ -1278,8 +1302,8 @@ function window:CreateFrame20()
-- text size
g:NewLabel (frame20, _, "$parentTooltipTextSizeLabel", "TooltipTextSizeLabel", Loc ["STRING_OPTIONS_TOOLTIPS_FONTSIZE"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame20, _, "$parentTooltipTextSizeSlider", "TooltipTextSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 5, 32, 1, tonumber (_detalhes.tooltip.fontsize))
- config_slider (s)
+ local s = g:NewSlider (frame20, _, "$parentTooltipTextSizeSlider", "TooltipTextSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 5, 32, 1, tonumber (_detalhes.tooltip.fontsize), nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame20.TooltipTextSizeSlider:SetPoint ("left", frame20.TooltipTextSizeLabel, "right", 2)
frame20.TooltipTextSizeSlider:SetHook ("OnValueChange", function (self, _, amount)
@@ -1307,11 +1331,7 @@ function window:CreateFrame20()
end
g:NewLabel (frame20, _, "$parentTooltipFontLabel", "TooltipFontLabel", Loc ["STRING_OPTIONS_TOOLTIPS_FONTFACE"] , "GameFontHighlightLeft")
- local d = g:NewDropDown (frame20, _, "$parentTooltipFontDropdown", "TooltipFontDropdown", DROPDOWN_WIDTH, dropdown_height, build_tooltip_menu, _detalhes.tooltip.fontface)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame20, _, "$parentTooltipFontDropdown", "TooltipFontDropdown", DROPDOWN_WIDTH, dropdown_height, build_tooltip_menu, _detalhes.tooltip.fontface, options_dropdown_template)
frame20.TooltipFontDropdown:SetPoint ("left", frame20.TooltipFontLabel, "right", 2)
@@ -1319,8 +1339,9 @@ function window:CreateFrame20()
-- text shadow
g:NewLabel (frame20, _, "$parentTooltipShadowLabel", "TooltipShadowLabel", Loc ["STRING_OPTIONS_TEXT_LOUTILINE"], "GameFontHighlightLeft")
- g:NewSwitch (frame20, _, "$parentTooltipShadowSwitch", "TooltipShadowSwitch", 60, 20, nil, nil, _detalhes.tooltip.fontshadow)
+ g:NewSwitch (frame20, _, "$parentTooltipShadowSwitch", "TooltipShadowSwitch", 60, 20, nil, nil, _detalhes.tooltip.fontshadow, nil, nil, nil, nil, options_switch_template)
frame20.TooltipShadowSwitch:SetPoint ("left", frame20.TooltipShadowLabel, "right", 2)
+ frame20.TooltipShadowSwitch:SetAsCheckBox()
frame20.TooltipShadowSwitch.OnSwitch = function (self, _, value)
_detalhes.tooltip.fontshadow = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -1332,7 +1353,7 @@ function window:CreateFrame20()
_detalhes.tooltip.background = {r, g, b, a}
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
- g:NewColorPickButton (frame20, "$parentTooltipBackgroundColorPick", "TooltipBackgroundColorPick", tooltip_background_color_callback)
+ g:NewColorPickButton (frame20, "$parentTooltipBackgroundColorPick", "TooltipBackgroundColorPick", tooltip_background_color_callback, nil, options_button_template)
g:NewLabel (frame20, _, "$parentTooltipBackgroundColorLabel", "TooltipBackgroundColorLabel", Loc ["STRING_OPTIONS_TOOLTIPS_BACKGROUNDCOLOR"], "GameFontHighlightLeft")
frame20.TooltipBackgroundColorPick:SetPoint ("left", frame20.TooltipBackgroundColorLabel, "right", 2, 0)
window:CreateLineBackground2 (frame20, "TooltipBackgroundColorPick", "TooltipBackgroundColorLabel", Loc ["STRING_OPTIONS_TOOLTIPS_BACKGROUNDCOLOR_DESC"])
@@ -1370,11 +1391,7 @@ function window:CreateFrame20()
return abbreviationOptions
end
- local d = g:NewDropDown (frame20, _, "$parentTooltipAbbreviateDropdown", "TooltipdpsAbbreviateDropdown", 160, dropdown_height, buildAbbreviationMenu, _detalhes.tooltip.abbreviation)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame20, _, "$parentTooltipAbbreviateDropdown", "TooltipdpsAbbreviateDropdown", 160, dropdown_height, buildAbbreviationMenu, _detalhes.tooltip.abbreviation, options_dropdown_template)
frame20.TooltipdpsAbbreviateDropdown:SetPoint ("left", frame20.TooltipdpsAbbreviateLabel, "right", 2, 0)
@@ -1408,11 +1425,8 @@ function window:CreateFrame20()
return maximizeOptions
end
- local d = g:NewDropDown (frame20, _, "$parentTooltipMaximizeDropdown", "TooltipMaximizeDropdown", 160, dropdown_height, buildMaximizeMenu, _detalhes.tooltip.maximize_method)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame20, _, "$parentTooltipMaximizeDropdown", "TooltipMaximizeDropdown", 160, dropdown_height, buildMaximizeMenu, _detalhes.tooltip.maximize_method, options_dropdown_template)
+
frame20.TooltipMaximizeDropdown:SetPoint ("left", frame20.TooltipMaximizeLabel, "right", 2, 0)
@@ -1420,8 +1434,9 @@ function window:CreateFrame20()
--show amount
g:NewLabel (frame20, _, "$parentTooltipShowAmountLabel", "TooltipShowAmountLabel", Loc ["STRING_OPTIONS_TOOLTIPS_SHOWAMT"], "GameFontHighlightLeft")
- g:NewSwitch (frame20, _, "$parentTooltipShowAmountSlider", "TooltipShowAmountSlider", 60, 20, _, _, _detalhes.tooltip.show_amount)
+ g:NewSwitch (frame20, _, "$parentTooltipShowAmountSlider", "TooltipShowAmountSlider", 60, 20, _, _, _detalhes.tooltip.show_amount, nil, nil, nil, nil, options_switch_template)
frame20.TooltipShowAmountSlider:SetPoint ("left", frame20.TooltipShowAmountLabel, "right", 2)
+ frame20.TooltipShowAmountSlider:SetAsCheckBox()
frame20.TooltipShowAmountSlider.OnSwitch = function (self, _, value)
_detalhes.tooltip.show_amount = value
@@ -1452,22 +1467,18 @@ function window:CreateFrame20()
end
g:NewLabel (frame20, _, "$parentBackdropBorderTextureLabel", "BackdropBorderTextureLabel", Loc ["STRING_TEXTURE"], "GameFontHighlightLeft")
- local d = g:NewDropDown (frame20, _, "$parentBackdropBorderTextureDropdown", "BackdropBorderTextureDropdown", DROPDOWN_WIDTH, dropdown_height, buildTextureBackdropMenu, _detalhes.tooltip.border_texture)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame20, _, "$parentBackdropBorderTextureDropdown", "BackdropBorderTextureDropdown", DROPDOWN_WIDTH, dropdown_height, buildTextureBackdropMenu, _detalhes.tooltip.border_texture, options_dropdown_template)
frame20.BackdropBorderTextureDropdown:SetPoint ("left", frame20.BackdropBorderTextureLabel, "right", 2)
window:CreateLineBackground2 (frame20, "BackdropBorderTextureDropdown", "BackdropBorderTextureLabel", Loc ["STRING_OPTIONS_TOOLTIPS_BORDER_TEXTURE_DESC"])
--border size
g:NewLabel (frame20, _, "$parentBackdropSizeLabel", "BackdropSizeLabel", Loc ["STRING_OPTIONS_SIZE"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame20, _, "$parentBackdropSizeHeight", "BackdropSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 32, 1, _detalhes.tooltip.border_size)
- config_slider (s)
+ local s = g:NewSlider (frame20, _, "$parentBackdropSizeHeight", "BackdropSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 32, 1, _detalhes.tooltip.border_size, nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame20.BackdropSizeSlider:SetPoint ("left", frame20.BackdropSizeLabel, "right", 2)
- frame20.BackdropSizeSlider:SetThumbSize (50)
+ --frame20.BackdropSizeSlider:SetThumbSize (50)
frame20.BackdropSizeSlider:SetHook ("OnValueChange", function (_, _, amount)
_detalhes:SetTooltipBackdrop (nil, amount)
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -1479,7 +1490,7 @@ function window:CreateFrame20()
_detalhes:SetTooltipBackdrop (nil, nil, {r, g, b, a})
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
- g:NewColorPickButton (frame20, "$parentBackdropColorPick", "BackdropColorPick", backdropcolor_callback)
+ g:NewColorPickButton (frame20, "$parentBackdropColorPick", "BackdropColorPick", backdropcolor_callback, nil, options_button_template)
g:NewLabel (frame20, _, "$parentBackdropColorLabel", "BackdropColorLabel", Loc ["STRING_COLOR"], "GameFontHighlightLeft")
frame20.BackdropColorPick:SetPoint ("left", frame20.BackdropColorLabel, "right", 2, 0)
@@ -1493,8 +1504,8 @@ function window:CreateFrame20()
local unlock_function = function()
DetailsTooltipAnchor:MoveAnchor()
end
- local unlock_anchor_button = g:NewButton (frame20, nil, "$parentUnlockAnchorButton", "UnlockAnchorButton", window.buttons_width, 18, unlock_function, nil, nil, nil, Loc ["STRING_OPTIONS_TOOLTIPS_ANCHOR_TO_CHOOSE"], 1)
- unlock_anchor_button:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ local unlock_anchor_button = g:NewButton (frame20, nil, "$parentUnlockAnchorButton", "UnlockAnchorButton", window.buttons_width, 18, unlock_function, nil, nil, nil, Loc ["STRING_OPTIONS_TOOLTIPS_ANCHOR_TO_CHOOSE"], 1, options_button_template)
+ --unlock_anchor_button:InstallCustomTexture (nil, nil, nil, nil, nil, true)
frame20.UnlockAnchorButton:SetTextColor (button_color_rgb)
frame20.UnlockAnchorButton:SetIcon ([[Interface\COMMON\UI-ModelControlPanel]], nil, nil, nil, {20/64, 34/64, 38/128, 52/128}, nil, 4, 2)
@@ -1528,11 +1539,7 @@ function window:CreateFrame20()
return anchorOptions
end
- local d = g:NewDropDown (frame20, _, "$parentTooltipAnchorDropdown", "TooltipAnchorDropdown", 160, dropdown_height, buildAnchorMenu, _detalhes.tooltip.anchored_to)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame20, _, "$parentTooltipAnchorDropdown", "TooltipAnchorDropdown", 160, dropdown_height, buildAnchorMenu, _detalhes.tooltip.anchored_to, options_dropdown_template)
frame20.TooltipAnchorDropdown:SetPoint ("left", frame20.TooltipAnchorLabel, "right", 2, 0)
@@ -1562,11 +1569,7 @@ function window:CreateFrame20()
return anchorPointOptions
end
- local d = g:NewDropDown (frame20, _, "$parentTooltipAnchorSideDropdown", "TooltipAnchorSideDropdown", 160, dropdown_height, buildAnchorPointMenu, _detalhes.tooltip.anchor_point)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame20, _, "$parentTooltipAnchorSideDropdown", "TooltipAnchorSideDropdown", 160, dropdown_height, buildAnchorPointMenu, _detalhes.tooltip.anchor_point, options_dropdown_template)
frame20.TooltipAnchorSideDropdown:SetPoint ("left", frame20.TooltipAnchorSideLabel, "right", 2, 0)
@@ -1594,11 +1597,8 @@ function window:CreateFrame20()
return anchorRelativeOptions
end
- local d = g:NewDropDown (frame20, _, "$parentTooltipRelativeSideDropdown", "TooltipRelativeSideDropdown", 160, dropdown_height, buildAnchorRelativeMenu, _detalhes.tooltip.anchor_relative)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame20, _, "$parentTooltipRelativeSideDropdown", "TooltipRelativeSideDropdown", 160, dropdown_height, buildAnchorRelativeMenu, _detalhes.tooltip.anchor_relative, options_dropdown_template)
+
frame20.TooltipRelativeSideDropdown:SetPoint ("left", frame20.TooltipRelativeSideLabel, "right", 2, 0)
@@ -1606,8 +1606,8 @@ function window:CreateFrame20()
--tooltip offset
g:NewLabel (frame20, _, "$parentTooltipOffsetXLabel", "TooltipOffsetXLabel", Loc ["STRING_OPTIONS_TOOLTIPS_OFFSETX"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame20, _, "$parentTooltipOffsetXSlider", "TooltipOffsetXSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -100, 100, 1, tonumber (_detalhes.tooltip.anchor_offset[1]))
- config_slider (s)
+ local s = g:NewSlider (frame20, _, "$parentTooltipOffsetXSlider", "TooltipOffsetXSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -100, 100, 1, tonumber (_detalhes.tooltip.anchor_offset[1]), nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame20.TooltipOffsetXSlider:SetPoint ("left", frame20.TooltipOffsetXLabel, "right", 2)
frame20.TooltipOffsetXSlider:SetHook ("OnValueChange", function (self, _, amount)
@@ -1617,8 +1617,8 @@ function window:CreateFrame20()
window:CreateLineBackground2 (frame20, "TooltipOffsetXSlider", "TooltipOffsetXLabel", Loc ["STRING_OPTIONS_TOOLTIPS_OFFSETX_DESC"])
g:NewLabel (frame20, _, "$parentTooltipOffsetYLabel", "TooltipOffsetYLabel", Loc ["STRING_OPTIONS_TOOLTIPS_OFFSETY"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame20, _, "$parentTooltipOffsetYSlider", "TooltipOffsetYSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -100, 100, 1, tonumber (_detalhes.tooltip.anchor_offset[2]))
- config_slider (s)
+ local s = g:NewSlider (frame20, _, "$parentTooltipOffsetYSlider", "TooltipOffsetYSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -100, 100, 1, tonumber (_detalhes.tooltip.anchor_offset[2]), nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame20.TooltipOffsetYSlider:SetPoint ("left", frame20.TooltipOffsetYLabel, "right", 2)
frame20.TooltipOffsetYSlider:SetHook ("OnValueChange", function (self, _, amount)
@@ -1638,15 +1638,16 @@ function window:CreateFrame20()
local edit_menu_bg_func = function()
g:ImageEditor (edit_menu_bg_callback, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, 250, 300, nil, _detalhes.tooltip.menus_bg_color[4], true)
end
- local edit_menu_bg = g:NewButton (frame20, nil, "$parentEditMenuBgButton", "EditMenuBgButton", window.buttons_width, 18, edit_menu_bg_func, nil, nil, nil, Loc ["STRING_OPTIONS_TOOLTIPS_MENU_WALLP"])
- edit_menu_bg:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ local edit_menu_bg = g:NewButton (frame20, nil, "$parentEditMenuBgButton", "EditMenuBgButton", window.buttons_width, 18, edit_menu_bg_func, nil, nil, nil, Loc ["STRING_OPTIONS_TOOLTIPS_MENU_WALLP"], nil, options_button_template)
+ --edit_menu_bg:InstallCustomTexture (nil, nil, nil, nil, nil, true)
edit_menu_bg:SetIcon ([[Interface\CHATFRAME\UI-ChatIcon-Maximize-Down]], 12, 12, nil, {6/32, 23/32, 10/32, 25/32}, nil, 4, 2)
window:CreateLineBackground2 (frame20, "EditMenuBgButton", "EditMenuBgButton", Loc ["STRING_OPTIONS_TOOLTIPS_MENU_WALLP_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
--> disable cooltip wallpaper on submenus
g:NewLabel (frame20, _, "$parentCopyMainWallpaperLabel", "CopyMainWallpaperLabel", Loc ["STRING_OPTIONS_TOOLTIPS_IGNORESUBWALLPAPER"], "GameFontHighlightLeft")
- g:NewSwitch (frame20, _, "$parentCopyMainWallpaperSlider", "CopyMainWallpaperSlider", 60, 20, _, _, _detalhes.tooltip.submenu_wallpaper)
+ g:NewSwitch (frame20, _, "$parentCopyMainWallpaperSlider", "CopyMainWallpaperSlider", 60, 20, _, _, _detalhes.tooltip.submenu_wallpaper, nil, nil, nil, nil, options_switch_template)
frame20.CopyMainWallpaperSlider:SetPoint ("left", frame20.CopyMainWallpaperLabel, "right", 2)
+ frame20.CopyMainWallpaperSlider:SetAsCheckBox()
frame20.CopyMainWallpaperSlider.OnSwitch = function (self, _, value)
_detalhes.tooltip.submenu_wallpaper = value
@@ -1724,9 +1725,10 @@ function window:CreateFrame19()
--show or hide
g:NewLabel (frame19, _, "$parentMinimapLabel", "minimapLabel", Loc ["STRING_OPTIONS_MINIMAP"], "GameFontHighlightLeft")
- g:NewSwitch (frame19, _, "$parentMinimapSlider", "minimapSlider", 60, 20, _, _, not _detalhes.minimap.hide)
+ g:NewSwitch (frame19, _, "$parentMinimapSlider", "minimapSlider", 60, 20, _, _, not _detalhes.minimap.hide, nil, nil, nil, nil, options_switch_template)
frame19.minimapSlider:SetPoint ("left", frame19.minimapLabel, "right", 2, 0)
+ frame19.minimapSlider:SetAsCheckBox()
frame19.minimapSlider.OnSwitch = function (self, _, value)
_detalhes.minimap.hide = not value
@@ -1756,11 +1758,8 @@ function window:CreateFrame19()
local build_menu = function()
return menu
end
- local dropdown = g:NewDropDown (frame19, _, "$parentMinimapActionDropdown", "minimapActionDropdown", 160, dropdown_height, build_menu, _detalhes.minimap.onclick_what_todo)
- dropdown.onenter_backdrop = dropdown_backdrop_onenter
- dropdown.onleave_backdrop = dropdown_backdrop_onleave
- dropdown:SetBackdrop (dropdown_backdrop)
- dropdown:SetBackdropColor (unpack (dropdown_backdrop_onleave))
+ local dropdown = g:NewDropDown (frame19, _, "$parentMinimapActionDropdown", "minimapActionDropdown", 160, dropdown_height, build_menu, _detalhes.minimap.onclick_what_todo, options_dropdown_template)
+
frame19.minimapActionDropdown:SetPoint ("left", frame19.minimapActionLabel, "right", 2, 0)
window:CreateLineBackground2 (frame19, "minimapActionDropdown", "minimapActionLabel", Loc ["STRING_OPTIONS_MINIMAP_ACTION_DESC"])
@@ -1772,9 +1771,10 @@ function window:CreateFrame19()
--show or hide
g:NewLabel (frame19, _, "$parentHotcornerLabel", "hotcornerLabel", Loc ["STRING_OPTIONS_HOTCORNER"], "GameFontHighlightLeft")
- g:NewSwitch (frame19, _, "$parentHotcornerSlider", "hotcornerSlider", 60, 20, _, _, not _detalhes.hotcorner_topleft.hide)
+ g:NewSwitch (frame19, _, "$parentHotcornerSlider", "hotcornerSlider", 60, 20, _, _, not _detalhes.hotcorner_topleft.hide, nil, nil, nil, nil, options_switch_template)
frame19.hotcornerSlider:SetPoint ("left", frame19.hotcornerLabel, "right", 2, 0)
+ frame19.hotcornerSlider:SetAsCheckBox()
frame19.hotcornerSlider.OnSwitch = function (self, _, value)
_G.HotCorners:HideHotCornerButton ("Details!", "TOPLEFT", not value)
end
@@ -1787,7 +1787,7 @@ function window:CreateFrame19()
--broker text
g:NewLabel (frame19, _, "$parentBrokerTextLabel", "brokerTextLabel", Loc ["STRING_OPTIONS_DATABROKER_TEXT"], "GameFontHighlightLeft")
- local broker_entry = g:NewTextEntry (frame19, _, "$parentBrokerEntry", "BrokerTextEntry", 180, 20)
+ local broker_entry = g:NewTextEntry (frame19, _, "$parentBrokerEntry", "BrokerTextEntry", 180, TEXTENTRY_HEIGHT, nil, nil, nil, nil, nil, options_dropdown_template)
broker_entry:SetPoint ("left", frame19.brokerTextLabel, "right", 2, -1)
broker_entry.text = _detalhes.data_broker_text
@@ -1846,11 +1846,7 @@ function window:CreateFrame19()
return abbreviationOptions
end
- local d = g:NewDropDown (frame19, _, "$parentBrokerNumberAbbreviateDropdown", "BrokerNumberAbbreviateDropdown", 160, dropdown_height, buildAbbreviationMenu, _detalhes.minimap.text_format)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame19, _, "$parentBrokerNumberAbbreviateDropdown", "BrokerNumberAbbreviateDropdown", 160, dropdown_height, buildAbbreviationMenu, _detalhes.minimap.text_format, options_dropdown_template)
frame19.BrokerNumberAbbreviateDropdown:SetPoint ("left", frame19.BrokerNumberAbbreviateLabel, "right", 2, 0)
@@ -1861,9 +1857,10 @@ function window:CreateFrame19()
g:NewLabel (frame19, _, "$parentItemLevelTrackerAnchor", "ItemLevelTrackerAnchorLabel", Loc ["STRING_OPTIONS_ILVL_TRACKER"], "GameFontNormal")
--switch
g:NewLabel (frame19, _, "$parentItemLevelLabel", "ItemLevelLabel", Loc ["STRING_OPTIONS_ILVL_TRACKER_TEXT"], "GameFontHighlightLeft")
- g:NewSwitch (frame19, _, "$parentItemLevelSlider", "ItemLevelSlider", 60, 20, _, _, _detalhes.ilevel:IsTrackerEnabled())
+ g:NewSwitch (frame19, _, "$parentItemLevelSlider", "ItemLevelSlider", 60, 20, _, _, _detalhes.ilevel:IsTrackerEnabled(), nil, nil, nil, nil, options_switch_template)
frame19.ItemLevelSlider:SetPoint ("left", frame19.ItemLevelLabel, "right", 2, 0)
+ frame19.ItemLevelSlider:SetAsCheckBox()
frame19.ItemLevelSlider.OnSwitch = function (self, _, value)
_detalhes.ilevel:TrackItemLevel (value)
end
@@ -1963,11 +1960,7 @@ function window:CreateFrame18()
return BuildSwitchMenu()
end
- local d = g:NewDropDown (frame18, _, "$parentAutoSwitchDropdown", "autoSwitchDropdown", 160, dropdown_height, BuildThisMenu, 1)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame18, _, "$parentAutoSwitchDropdown", "autoSwitchDropdown", 160, dropdown_height, BuildThisMenu, 1, options_dropdown_template)
frame18.autoSwitchDropdown:SetPoint ("left", frame18.autoSwitchLabel, "right", 2, 0)
@@ -1993,11 +1986,7 @@ function window:CreateFrame18()
return BuildSwitchMenu()
end
- local d = g:NewDropDown (frame18, _, "$parentAutoSwitchWipeDropdown", "autoSwitchWipeDropdown", 160, dropdown_height, BuildThisMenu, 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)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame18, _, "$parentAutoSwitchWipeDropdown", "autoSwitchWipeDropdown", 160, dropdown_height, BuildThisMenu, 1, options_dropdown_template)
frame18.autoSwitchWipeDropdown:SetPoint ("left", frame18.AutoSwitchWipeLabel, "right", 2, 0)
@@ -2023,11 +2012,7 @@ function window:CreateFrame18()
return BuildSwitchMenu()
end
- local d = g:NewDropDown (frame18, _, "$parentAutoSwitchDamageNoCombatDropdown", "AutoSwitchDamageNoCombatDropdown", 160, dropdown_height, BuildThisMenu, 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)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame18, _, "$parentAutoSwitchDamageNoCombatDropdown", "AutoSwitchDamageNoCombatDropdown", 160, dropdown_height, BuildThisMenu, 1, options_dropdown_template)
frame18.AutoSwitchDamageNoCombatDropdown:SetPoint ("left", dps_icon1, "right", 2, 0)
frame18.AutoSwitchDamageNoCombatLabel:SetPoint ("left", dps_icon1, "left", 0, 0)
@@ -2054,11 +2039,7 @@ function window:CreateFrame18()
return BuildSwitchMenu()
end
- local d = g:NewDropDown (frame18, _, "$parentAutoSwitchDamageCombatDropdown", "AutoSwitchDamageCombatDropdown", 160, dropdown_height, BuildThisMenu, 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)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame18, _, "$parentAutoSwitchDamageCombatDropdown", "AutoSwitchDamageCombatDropdown", 160, dropdown_height, BuildThisMenu, 1, options_dropdown_template)
frame18.AutoSwitchDamageCombatDropdown:SetPoint ("left", frame18.AutoSwitchDamageCombatLabel, "right", 2, -1)
frame18.AutoSwitchDamageCombatLabel:SetPoint ("left", dps_icon2, "right", 2, 1)
@@ -2085,11 +2066,7 @@ function window:CreateFrame18()
return BuildSwitchMenu()
end
- local d = g:NewDropDown (frame18, _, "$parentAutoSwitchHealNoCombatDropdown", "AutoSwitchHealNoCombatDropdown", 160, dropdown_height, BuildThisMenu, 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)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame18, _, "$parentAutoSwitchHealNoCombatDropdown", "AutoSwitchHealNoCombatDropdown", 160, dropdown_height, BuildThisMenu, 1, options_dropdown_template)
--frame18.AutoSwitchHealNoCombatDropdown:SetPoint ("left", frame18.AutoSwitchHealNoCombatLabel, "right", 2, 0)
frame18.AutoSwitchHealNoCombatDropdown:SetPoint ("left", healer_icon1, "right", 2, 0)
@@ -2117,11 +2094,7 @@ function window:CreateFrame18()
return BuildSwitchMenu()
end
- local d = g:NewDropDown (frame18, _, "$parentAutoSwitchHealCombatDropdown", "AutoSwitchHealCombatDropdown", 160, dropdown_height, BuildThisMenu, 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)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame18, _, "$parentAutoSwitchHealCombatDropdown", "AutoSwitchHealCombatDropdown", 160, dropdown_height, BuildThisMenu, 1, options_dropdown_template)
--frame18.AutoSwitchHealCombatDropdown:SetPoint ("left", frame18.AutoSwitchHealCombatLabel, "right", 2, 0)
frame18.AutoSwitchHealCombatDropdown:SetPoint ("left", frame18.AutoSwitchHealCombatLabel, "right", 2, -1)
@@ -2149,12 +2122,8 @@ function window:CreateFrame18()
return BuildSwitchMenu()
end
- local d = g:NewDropDown (frame18, _, "$parentAutoSwitchTankNoCombatDropdown", "AutoSwitchTankNoCombatDropdown", 160, dropdown_height, BuildThisMenu, 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)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
-
+ local d = g:NewDropDown (frame18, _, "$parentAutoSwitchTankNoCombatDropdown", "AutoSwitchTankNoCombatDropdown", 160, dropdown_height, BuildThisMenu, 1, options_dropdown_template)
+
frame18.AutoSwitchTankNoCombatDropdown:SetPoint ("left", tank_icon1, "right", 2, 0)
frame18.AutoSwitchTankNoCombatLabel:SetPoint ("left", tank_icon1, "left", 0, 0)
@@ -2180,11 +2149,7 @@ function window:CreateFrame18()
return BuildSwitchMenu()
end
- local d = g:NewDropDown (frame18, _, "$parentAutoSwitchTankCombatDropdown", "AutoSwitchTankCombatDropdown", 160, dropdown_height, BuildThisMenu, 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)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame18, _, "$parentAutoSwitchTankCombatDropdown", "AutoSwitchTankCombatDropdown", 160, dropdown_height, BuildThisMenu, 1, options_dropdown_template)
frame18.AutoSwitchTankCombatDropdown:SetPoint ("left", frame18.AutoSwitchTankCombatLabel, "right", 2, -1)
frame18.AutoSwitchTankCombatLabel:SetPoint ("left", tank_icon2, "right", 2, 1)
@@ -2193,10 +2158,11 @@ function window:CreateFrame18()
--> auto current segment
- g:NewSwitch (frame18, _, "$parentAutoCurrentSlider", "autoCurrentSlider", 60, 20, _, _, instance.auto_current)
+ g:NewSwitch (frame18, _, "$parentAutoCurrentSlider", "autoCurrentSlider", 60, 20, _, _, instance.auto_current, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame18, _, "$parentAutoCurrentLabel", "autoCurrentLabel", Loc ["STRING_OPTIONS_INSTANCE_CURRENT"], "GameFontHighlightLeft")
frame18.autoCurrentSlider:SetPoint ("left", frame18.autoCurrentLabel, "right", 2)
+ frame18.autoCurrentSlider:SetAsCheckBox()
frame18.autoCurrentSlider.OnSwitch = function (self, instance, value)
instance.auto_current = value
@@ -2260,11 +2226,7 @@ function window:CreateFrame18()
return InstanceList
end
- local d = g:NewDropDown (frame18, _, "$parentDeleteInstanceDropdown", "deleteInstanceDropdown", 160, dropdown_height, buildSelectDeleteInstance, 0) -- func, default
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame18, _, "$parentDeleteInstanceDropdown", "deleteInstanceDropdown", 160, dropdown_height, buildSelectDeleteInstance, 0, options_dropdown_template)
frame18.deleteInstanceDropdown:SetPoint ("left", frame18.deleteInstanceLabel, "right", 2, 0)
@@ -2287,8 +2249,8 @@ function window:CreateFrame18()
--> menu text size
g:NewLabel (frame18, _, "$parentMenuTextSizeLabel", "MenuTextSizeLabel", Loc ["STRING_OPTIONS_MENU_FONT_SIZE"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame18, _, "$parentMenuTextSizeSlider", "MenuTextSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 5, 32, 1, _detalhes.font_sizes.menus)
- config_slider (s)
+ local s = g:NewSlider (frame18, _, "$parentMenuTextSizeSlider", "MenuTextSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 5, 32, 1, _detalhes.font_sizes.menus, nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame18.MenuTextSizeSlider:SetPoint ("left", frame18.MenuTextSizeLabel, "right", 2)
@@ -2314,11 +2276,7 @@ function window:CreateFrame18()
return fontTable
end
- local d = g:NewDropDown (frame18, _, "$parentFontDropdown", "fontDropdown", DROPDOWN_WIDTH, dropdown_height, buildFontMenu, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame18, _, "$parentFontDropdown", "fontDropdown", DROPDOWN_WIDTH, dropdown_height, buildFontMenu, nil, options_dropdown_template)
g:NewLabel (frame18, _, "$parentFontLabel", "fontLabel", Loc ["STRING_OPTIONS_MENU_FONT_FACE"], "GameFontHighlightLeft")
frame18.fontDropdown:SetPoint ("left", frame18.fontLabel, "right", 2)
@@ -2327,9 +2285,10 @@ function window:CreateFrame18()
--> disable groups
g:NewLabel (frame18, _, "$parentDisableGroupsLabel", "DisableGroupsLabel", Loc ["STRING_OPTIONS_DISABLE_GROUPS"], "GameFontHighlightLeft")
- g:NewSwitch (frame18, _, "$parentDisableGroupsSlider", "DisableGroupsSlider", 60, 20, _, _, _detalhes.disable_window_groups)
+ g:NewSwitch (frame18, _, "$parentDisableGroupsSlider", "DisableGroupsSlider", 60, 20, _, _, _detalhes.disable_window_groups, nil, nil, nil, nil, options_switch_template)
frame18.DisableGroupsSlider:SetPoint ("left", frame18.DisableGroupsLabel, "right", 2)
+ frame18.DisableGroupsSlider:SetAsCheckBox()
frame18.DisableGroupsSlider.OnSwitch = function (_, _, value)
_detalhes.disable_window_groups = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -2339,9 +2298,10 @@ function window:CreateFrame18()
--> disable reset button
g:NewLabel (frame18, _, "$parentDisableResetLabel", "DisableResetLabel", Loc ["STRING_OPTIONS_DISABLE_RESET"], "GameFontHighlightLeft")
- g:NewSwitch (frame18, _, "$parentDisableResetSlider", "DisableResetSlider", 60, 20, _, _, _detalhes.disable_reset_button)
+ g:NewSwitch (frame18, _, "$parentDisableResetSlider", "DisableResetSlider", 60, 20, _, _, _detalhes.disable_reset_button, nil, nil, nil, nil, options_switch_template)
frame18.DisableResetSlider:SetPoint ("left", frame18.DisableResetLabel, "right", 2)
+ frame18.DisableResetSlider:SetAsCheckBox()
frame18.DisableResetSlider.OnSwitch = function (_, _, value)
_detalhes.disable_reset_button = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -2351,9 +2311,10 @@ function window:CreateFrame18()
--> disable lock resize ungroup buttons
g:NewLabel (frame18, _, "$parentDisableLockResizeUngroupLabel", "DisableLockResizeUngroupLabel", Loc ["STRING_OPTIONS_DISABLE_LOCK_RESIZE"], "GameFontHighlightLeft")
- g:NewSwitch (frame18, _, "$parentDisableLockResizeUngroupSlider", "DisableLockResizeUngroupSlider", 60, 20, _, _, _detalhes.disable_lock_ungroup_buttons)
+ g:NewSwitch (frame18, _, "$parentDisableLockResizeUngroupSlider", "DisableLockResizeUngroupSlider", 60, 20, _, _, _detalhes.disable_lock_ungroup_buttons, nil, nil, nil, nil, options_switch_template)
frame18.DisableLockResizeUngroupSlider:SetPoint ("left", frame18.DisableLockResizeUngroupLabel, "right", 2)
+ frame18.DisableLockResizeUngroupSlider:SetAsCheckBox()
frame18.DisableLockResizeUngroupSlider.OnSwitch = function (_, _, value)
_detalhes.disable_lock_ungroup_buttons = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -2363,9 +2324,10 @@ function window:CreateFrame18()
--> disable stretch button
g:NewLabel (frame18, _, "$parentDisableStretchButtonLabel", "DisableStretchButtonLabel", Loc ["STRING_OPTIONS_DISABLE_STRETCH_BUTTON"], "GameFontHighlightLeft")
- g:NewSwitch (frame18, _, "$parentDisableStretchButtonSlider", "DisableStretchButtonSlider", 60, 20, _, _, _detalhes.disable_stretch_button)
+ g:NewSwitch (frame18, _, "$parentDisableStretchButtonSlider", "DisableStretchButtonSlider", 60, 20, _, _, _detalhes.disable_stretch_button, nil, nil, nil, nil, options_switch_template)
frame18.DisableStretchButtonSlider:SetPoint ("left", frame18.DisableStretchButtonLabel, "right", 2)
+ frame18.DisableStretchButtonSlider:SetAsCheckBox()
frame18.DisableStretchButtonSlider.OnSwitch = function (_, _, value)
_detalhes.disable_stretch_button = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -2375,9 +2337,10 @@ function window:CreateFrame18()
--> disable bar highlight
g:NewLabel (frame18, _, "$parentDisableBarHighlightLabel", "DisableBarHighlightLabel", Loc ["STRING_OPTIONS_DISABLE_BARHIGHLIGHT"], "GameFontHighlightLeft")
- g:NewSwitch (frame18, _, "$parentDisableBarHighlightSlider", "DisableBarHighlightSlider", 60, 20, _, _, _detalhes.instances_disable_bar_highlight)
+ g:NewSwitch (frame18, _, "$parentDisableBarHighlightSlider", "DisableBarHighlightSlider", 60, 20, _, _, _detalhes.instances_disable_bar_highlight, nil, nil, nil, nil, options_switch_template)
frame18.DisableBarHighlightSlider:SetPoint ("left", frame18.DisableBarHighlightLabel, "right", 2)
+ frame18.DisableBarHighlightSlider:SetAsCheckBox()
frame18.DisableBarHighlightSlider.OnSwitch = function (_, _, value)
_detalhes.instances_disable_bar_highlight = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -2387,21 +2350,36 @@ function window:CreateFrame18()
--> damage taken always on everything
g:NewLabel (frame18, _, "$parentDamageTakenEverythingLabel", "DamageTakenEverythingLabel", Loc ["STRING_OPTIONS_DTAKEN_EVERYTHING"], "GameFontHighlightLeft")
- g:NewSwitch (frame18, _, "$parentDamageTakenEverythingSlider", "DamageTakenEverythingSlider", 60, 20, _, _, _detalhes.damage_taken_everything)
+ g:NewSwitch (frame18, _, "$parentDamageTakenEverythingSlider", "DamageTakenEverythingSlider", 60, 20, _, _, _detalhes.damage_taken_everything, nil, nil, nil, nil, options_switch_template)
frame18.DamageTakenEverythingSlider:SetPoint ("left", frame18.DamageTakenEverythingLabel, "right", 2)
+ frame18.DamageTakenEverythingSlider:SetAsCheckBox()
frame18.DamageTakenEverythingSlider.OnSwitch = function (_, _, value)
_detalhes.damage_taken_everything = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
window:CreateLineBackground2 (frame18, "DamageTakenEverythingSlider", "DamageTakenEverythingLabel", Loc ["STRING_OPTIONS_DTAKEN_EVERYTHING_DESC"])
+
+ --> click to open menus
+ g:NewLabel (frame18, _, "$parentClickToOpenMenusLabel", "ClickToOpenMenusLabel", Loc ["STRING_OPTIONS_CLICK_TO_OPEN_MENUS"], "GameFontHighlightLeft")
+ g:NewSwitch (frame18, _, "$parentClickToOpenMenusSlider", "ClickToOpenMenusSlider", 60, 20, _, _, _detalhes.instances_menu_click_to_open, nil, nil, nil, nil, options_switch_template)
+
+ frame18.ClickToOpenMenusSlider:SetPoint ("left", frame18.ClickToOpenMenusLabel, "right", 2)
+ frame18.ClickToOpenMenusSlider:SetAsCheckBox()
+ frame18.ClickToOpenMenusSlider.OnSwitch = function (_, _, value)
+ _detalhes.instances_menu_click_to_open = value
+ _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
+ end
+
+ window:CreateLineBackground2 (frame18, "ClickToOpenMenusSlider", "ClickToOpenMenusLabel", Loc ["STRING_OPTIONS_CLICK_TO_OPEN_MENUS_DESC"])
--> Use Scroll Bar
g:NewLabel (frame18, _, "$parentUseScrollLabel", "scrollLabel", Loc ["STRING_OPTIONS_SCROLLBAR"], "GameFontHighlightLeft")
--
- g:NewSwitch (frame18, _, "$parentUseScrollSlider", "scrollSlider", 60, 20, _, _, _detalhes.use_scroll)
+ g:NewSwitch (frame18, _, "$parentUseScrollSlider", "scrollSlider", 60, 20, _, _, _detalhes.use_scroll, nil, nil, nil, nil, options_switch_template)
frame18.scrollSlider:SetPoint ("left", frame18.scrollLabel, "right", 2, 0)
+ frame18.scrollSlider:SetAsCheckBox()
frame18.scrollSlider.OnSwitch = function (self, _, value) --> slider, fixedValue, sliderValue
_detalhes.use_scroll = value
if (not value) then
@@ -2427,9 +2405,10 @@ function window:CreateFrame18()
--> Report
--heal links
g:NewLabel (frame18, _, "$parentReportHelpfulLinkLabel", "ReportHelpfulLinkLabel", Loc ["STRING_OPTIONS_REPORT_HEALLINKS"], "GameFontHighlightLeft")
- g:NewSwitch (frame18, _, "$parentReportHelpfulLinkSlider", "ReportHelpfulLinkSlider", 60, 20, _, _, _detalhes.report_heal_links)
+ g:NewSwitch (frame18, _, "$parentReportHelpfulLinkSlider", "ReportHelpfulLinkSlider", 60, 20, _, _, _detalhes.report_heal_links, nil, nil, nil, nil, options_switch_template)
frame18.ReportHelpfulLinkSlider:SetPoint ("left", frame18.ReportHelpfulLinkLabel, "right", 2)
+ frame18.ReportHelpfulLinkSlider:SetAsCheckBox()
frame18.ReportHelpfulLinkSlider.OnSwitch = function (_, _, value)
_detalhes.report_heal_links = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -2454,11 +2433,7 @@ function window:CreateFrame18()
local BuildReportFormatOptions = function()
return ReportFormatOptions
end
- local d = g:NewDropDown (frame18, _, "$parentReportFormatDropdown", "ReportFormatDropdown", 160, dropdown_height, BuildReportFormatOptions, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame18, _, "$parentReportFormatDropdown", "ReportFormatDropdown", 160, dropdown_height, BuildReportFormatOptions, nil, options_dropdown_template)
frame18.ReportFormatDropdown:SetPoint ("left", frame18.ReportFormatLabel, "right", 2, 0)
@@ -2512,7 +2487,8 @@ function window:CreateFrame18()
{"DisableStretchButtonLabel", 8},
{"DisableBarHighlightLabel", 9},
{"DamageTakenEverythingLabel", 10},
- {"scrollLabel", 11, true},
+ {"ClickToOpenMenusLabel", 11},
+ {"scrollLabel", 12, true},
}
@@ -2566,11 +2542,7 @@ function window:CreateFrame17()
return typeCombatAlpha
end
- local d = g:NewDropDown (frame17, _, "$parentCombatAlphaDropdown", "combatAlphaDropdown", 160, dropdown_height, buildTypeCombatAlpha, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame17, _, "$parentCombatAlphaDropdown", "combatAlphaDropdown", 160, dropdown_height, buildTypeCombatAlpha, nil, options_dropdown_template)
frame17.combatAlphaDropdown:SetPoint ("left", frame17.combatAlphaLabel, "right", 2, 0)
@@ -2578,8 +2550,8 @@ function window:CreateFrame17()
g:NewLabel (frame17, _, "$parentHideOnCombatAlphaLabel", "hideOnCombatAlphaLabel", Loc ["STRING_ALPHA"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame17, _, "$parentHideOnCombatAlphaSlider", "hideOnCombatAlphaSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0, 100, 1, _G.DetailsOptionsWindow.instance.hide_in_combat_alpha) -- min, max, step, defaultv
- config_slider (s)
+ local s = g:NewSlider (frame17, _, "$parentHideOnCombatAlphaSlider", "hideOnCombatAlphaSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0, 100, 1, _G.DetailsOptionsWindow.instance.hide_in_combat_alpha, nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame17.hideOnCombatAlphaSlider:SetPoint ("left", frame17.hideOnCombatAlphaLabel, "right", 2, 0)
frame17.hideOnCombatAlphaSlider:SetHook ("OnValueChange", function (self, instance, amount) --> slider, fixedValue, sliderValue
@@ -2605,14 +2577,14 @@ function window:CreateFrame17()
g:NewLabel (frame17, _, "$parentMenuAlphaAnchor", "menuAlphaAnchorLabel", Loc ["STRING_OPTIONS_MENU_ALPHA"], "GameFontNormal")
- g:NewSwitch (frame17, _, "$parentMenuOnEnterLeaveAlphaSwitch", "alphaSwitch", 60, 20, _, _, instance.menu_alpha.enabled)
+ g:NewSwitch (frame17, _, "$parentMenuOnEnterLeaveAlphaSwitch", "alphaSwitch", 60, 20, _, _, instance.menu_alpha.enabled, nil, nil, nil, nil, options_switch_template)
- local s = g:NewSlider (frame17, _, "$parentMenuOnEnterAlphaSlider", "menuOnEnterSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0, 1, 0.02, instance.menu_alpha.onenter, true)
- config_slider (s)
+ local s = g:NewSlider (frame17, _, "$parentMenuOnEnterAlphaSlider", "menuOnEnterSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0, 1, 0.02, instance.menu_alpha.onenter, true, nil, nil, options_slider_template)
+ --config_slider (s)
s.useDecimals = true
- local s = g:NewSlider (frame17, _, "$parentMenuOnLeaveAlphaSlider", "menuOnLeaveSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0, 1, 0.02, instance.menu_alpha.onleave, true)
- config_slider (s)
+ local s = g:NewSlider (frame17, _, "$parentMenuOnLeaveAlphaSlider", "menuOnLeaveSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0, 1, 0.02, instance.menu_alpha.onleave, true, nil, nil, options_slider_template)
+ --config_slider (s)
frame17.menuOnEnterSlider.useDecimals = true
frame17.menuOnLeaveSlider.useDecimals = true
@@ -2628,19 +2600,21 @@ function window:CreateFrame17()
window:CreateLineBackground2 (frame17, "menuOnLeaveSlider", "menuOnLeaveLabel", Loc ["STRING_OPTIONS_MENU_ALPHALEAVE_DESC"])
frame17.alphaSwitch:SetPoint ("left", frame17.alphaSwitchLabel, "right", 2)
+ frame17.alphaSwitch:SetAsCheckBox()
frame17.menuOnEnterSlider:SetPoint ("left", frame17.menuOnEnterLabel, "right", 2)
frame17.menuOnLeaveSlider:SetPoint ("left", frame17.menuOnLeaveLabel, "right", 2)
- frame17.menuOnEnterSlider:SetThumbSize (50)
- frame17.menuOnLeaveSlider:SetThumbSize (50)
+ frame17.menuOnEnterSlider:SetThumbSize (24)
+ frame17.menuOnLeaveSlider:SetThumbSize (24)
g:NewLabel (frame17, _, "$parentMenuOnEnterLeaveAlphaIconsTooLabel", "alphaIconsTooLabel", Loc ["STRING_OPTIONS_MENU_IGNOREBARS"], "GameFontHighlightLeft")
- g:NewSwitch (frame17, _, "$parentMenuOnEnterLeaveAlphaIconsTooSwitch", "alphaIconsTooSwitch", 60, 20, _, _, instance.menu_alpha.ignorebars)
+ g:NewSwitch (frame17, _, "$parentMenuOnEnterLeaveAlphaIconsTooSwitch", "alphaIconsTooSwitch", 60, 20, _, _, instance.menu_alpha.ignorebars, nil, nil, nil, nil, options_switch_template)
window:CreateLineBackground2 (frame17, "alphaIconsTooSwitch", "alphaIconsTooLabel", Loc ["STRING_OPTIONS_MENU_IGNOREBARS_DESC"])
frame17.alphaIconsTooSwitch:SetPoint ("left", frame17.alphaIconsTooLabel, "right", 2)
+ frame17.alphaIconsTooSwitch:SetAsCheckBox()
frame17.alphaIconsTooSwitch.OnSwitch = function (self, instance, value)
instance:SetMenuAlpha (nil, nil, nil, value)
@@ -2873,7 +2847,7 @@ function window:CreateFrame16()
frame16.userTimeCaptureFillPanel:Refresh()
end
- local edit_enabled = function (index, enabled)
+ local edit_enabled = function (index, enabled, a, b)
if (enabled) then
_detalhes:TimeDataUpdate (index, nil, nil, nil, nil, nil, nil, false)
else
@@ -2939,9 +2913,6 @@ function window:CreateFrame16()
addframe:SetFrameLevel (7)
addframe:Hide()
- addframe:SetGradient ("OnEnter", {0, 0, 0, .95})
- addframe:SetGradient ("OnLeave", {0, 0, 0, .95})
-
addframe:SetBackdropColor (0, 0, 0, 0.95)
local background = g:NewImage (addframe, [[Interface\ARCHEOLOGY\Arch-BookCompletedLeft]])
background:SetPoint ("topleft", addframe, "topleft")
@@ -2952,7 +2923,7 @@ function window:CreateFrame16()
--> name
local capture_name = g:NewLabel (addframe, nil, "$parentNameLabel", "nameLabel", Loc ["STRING_OPTIONS_CHART_ADDNAME"])
- local capture_name_entry = g:NewTextEntry (addframe, nil, "$parentNameEntry", "nameEntry", 160, 20, function() end)
+ local capture_name_entry = g:NewTextEntry (addframe, nil, "$parentNameEntry", "nameEntry", 160, TEXTENTRY_HEIGHT, function() end, nil, nil, nil, nil, options_dropdown_template)
capture_name_entry:SetMaxLetters (16)
capture_name_entry:SetPoint ("left", capture_name, "right", 2, 0)
@@ -2967,20 +2938,20 @@ function window:CreateFrame16()
local icon_button_func = function (texture)
addframe.iconButton.icon.texture = texture
end
- local capture_icon_button = g:NewButton (addframe, nil, "$parentIconButton", "iconButton", 20, 20, function() g:IconPick (icon_button_func, true) end)
+ local capture_icon_button = g:NewButton (addframe, nil, "$parentIconButton", "iconButton", 20, 20, function() g:IconPick (icon_button_func, true) end, nil, nil, nil, nil, nil, options_button_template)
local capture_icon_button_icon = g:NewImage (capture_icon_button, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon")
capture_icon_button_icon:SetPoint (0, 0)
- capture_icon_button:InstallCustomTexture()
+ --capture_icon_button:InstallCustomTexture()
capture_icon_button:SetPoint ("left", capture_icon, "right", 2, 0)
--> author
local capture_author = g:NewLabel (addframe, nil, "$parentAuthorLabel", "authorLabel", Loc ["STRING_OPTIONS_CHART_ADDAUTHOR"])
- local capture_author_entry = g:NewTextEntry (addframe, nil, "$parentAuthorEntry", "authorEntry", 160, 20, function() end)
+ local capture_author_entry = g:NewTextEntry (addframe, nil, "$parentAuthorEntry", "authorEntry", 160, TEXTENTRY_HEIGHT, function() end, nil, nil, nil, nil, options_dropdown_template)
capture_author_entry:SetPoint ("left", capture_author, "right", 2, 0)
--> version
local capture_version = g:NewLabel (addframe, nil, "$parentVersionLabel", "versionLabel", Loc ["STRING_OPTIONS_CHART_ADDVERSION"])
- local capture_version_entry = g:NewTextEntry (addframe, nil, "$parentVersionEntry", "versionEntry", 160, 20, function() end)
+ local capture_version_entry = g:NewTextEntry (addframe, nil, "$parentVersionEntry", "versionEntry", 160, TEXTENTRY_HEIGHT, function() end, nil, nil, nil, nil, options_dropdown_template)
capture_version_entry:SetPoint ("left", capture_version, "right", 2, 0)
--> open add panel button
@@ -2996,8 +2967,8 @@ function window:CreateFrame16()
DetailsIconPickFrame:Hide()
end
end
- local addbutton = g:NewButton (frame16, nil, "$parentAddButton", "addbutton", 100, 21, add, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_ADD"])
- addbutton:InstallCustomTexture()
+ local addbutton = g:NewButton (frame16, nil, "$parentAddButton", "addbutton", 100, 21, add, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_ADD"], nil, options_button_template)
+ --addbutton:InstallCustomTexture()
addbutton:SetPoint ("bottomright", panel, "topright", -30, 0)
addbutton:SetIcon ([[Interface\PaperDollInfoFrame\Character-Plus]], 12, 12, nil, nil, nil, 4)
window:CreateLineBackground2 (frame16, "addbutton", "addbutton", nil, nil, {1, 0.8, 0}, button_color_rgb)
@@ -3088,8 +3059,8 @@ function window:CreateFrame16()
DetailsIconPickFrame:Hide()
end
end
- local importbutton = g:NewButton (frame16, nil, "$parentImportButton", "importbutton", 100, 21, import, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_IMPORT"])
- importbutton:InstallCustomTexture()
+ local importbutton = g:NewButton (frame16, nil, "$parentImportButton", "importbutton", 100, 21, import, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_IMPORT"], nil, options_button_template)
+ --importbutton:InstallCustomTexture()
importbutton:SetPoint ("right", addbutton, "left", -4, 0)
importbutton:SetIcon ([[Interface\Buttons\UI-GuildButton-PublicNote-Up]], 14, 14, nil, nil, nil, 4)
window:CreateLineBackground2 (frame16, "importbutton", "importbutton", nil, nil, {1, 0.8, 0}, button_color_rgb)
@@ -3104,8 +3075,8 @@ function window:CreateFrame16()
right:Hide()
--> close button
- local closebutton = g:NewButton (addframe, nil, "$parentAddCloseButton", "addClosebutton", 100, 21, function() addframe:Hide() end, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_CLOSE"])
- closebutton:InstallCustomTexture()
+ local closebutton = g:NewButton (addframe, nil, "$parentAddCloseButton", "addClosebutton", 100, 21, function() addframe:Hide() end, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_CLOSE"], nil, options_button_template)
+ --closebutton:InstallCustomTexture()
--> confirm add capture
local addcapture = function()
@@ -3148,8 +3119,8 @@ function window:CreateFrame16()
end
- local addcapturebutton = g:NewButton (addframe, nil, "$parentAddCaptureButton", "addCapturebutton", 100, 21, addcapture, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_ADD2"])
- addcapturebutton:InstallCustomTexture()
+ local addcapturebutton = g:NewButton (addframe, nil, "$parentAddCaptureButton", "addCapturebutton", 100, 21, addcapture, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_ADD2"], nil, options_button_template)
+ --addcapturebutton:InstallCustomTexture()
--> anchors
local start = 25
@@ -3243,9 +3214,6 @@ function window:CreateFrame15()
addframe:SetFrameLevel (7)
addframe:Hide()
- addframe:SetGradient ("OnEnter", {0, 0, 0, .95})
- addframe:SetGradient ("OnLeave", {0, 0, 0, .95})
-
addframe:SetBackdropColor (0, 0, 0, 0.95)
local background = g:NewImage (addframe, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsBackground]])
background:SetPoint ("topleft", addframe, "topleft")
@@ -3262,7 +3230,7 @@ function window:CreateFrame15()
local spellicon = g:NewLabel (addframe, nil, "$parentSpelliconLabel", "spelliconLabel", Loc ["STRING_OPTIONS_SPELL_ADDICON"])
local spellname_entry_func = function() end
- local spellname_entry = g:NewTextEntry (addframe, nil, "$parentSpellnameEntry", "spellnameEntry", 160, 20, spellname_entry_func)
+ local spellname_entry = g:NewTextEntry (addframe, nil, "$parentSpellnameEntry", "spellnameEntry", 160, TEXTENTRY_HEIGHT, spellname_entry_func, nil, nil, nil, nil, options_dropdown_template)
spellname_entry:SetPoint ("left", spellname, "right", 2, 0)
local spellid_entry_func = function (arg1, arg2, spellid)
@@ -3330,8 +3298,8 @@ function window:CreateFrame15()
end
--> close button
- local closebutton = g:NewButton (addframe, nil, "$parentAddCloseButton", "addClosebutton", 100, 21, function() addframe:Hide(); table.wipe (all_cached_spells) end, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_CLOSE"])
- closebutton:InstallCustomTexture()
+ local closebutton = g:NewButton (addframe, nil, "$parentAddCloseButton", "addClosebutton", 100, 21, function() addframe:Hide(); table.wipe (all_cached_spells) end, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_CLOSE"], nil, options_button_template)
+ --closebutton:InstallCustomTexture()
local bg = window:CreateLineBackground2 (addframe.widget, closebutton, closebutton, nil, nil, {1, 0.8, 0}, button_color_rgb)
closebutton:SetTextColor (button_color_rgb)
@@ -3366,8 +3334,8 @@ function window:CreateFrame15()
addframe:Hide();
table.wipe (all_cached_spells)
end
- local addspellbutton = g:NewButton (addframe, nil, "$parentAddSpellButton", "addSpellbutton", 100, 21, addspell, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_ADD"])
- addspellbutton:InstallCustomTexture()
+ local addspellbutton = g:NewButton (addframe, nil, "$parentAddSpellButton", "addSpellbutton", 100, 21, addspell, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_ADD"], nil, options_button_template)
+ --addspellbutton:InstallCustomTexture()
local bg2 = window:CreateLineBackground2 (addframe.widget, addspellbutton, addspellbutton, nil, nil, {1, 0.8, 0}, button_color_rgb)
addspellbutton:SetTextColor (button_color_rgb)
bg:SetFrameLevel (bg2:GetFrameLevel()-1)
@@ -3406,8 +3374,8 @@ function window:CreateFrame15()
update_cache_scroll()
addframe:Show()
end
- local addbutton = g:NewButton (frame15, nil, "$parentAddButton", "addbutton", 100, 21, add, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_ADDSPELL"])
- addbutton:InstallCustomTexture()
+ local addbutton = g:NewButton (frame15, nil, "$parentAddButton", "addbutton", 100, 21, add, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_ADDSPELL"], nil, options_button_template)
+ --addbutton:InstallCustomTexture()
window:CreateLineBackground2 (frame15, "addbutton", "addbutton", nil, nil, {1, 0.8, 0}, button_color_rgb)
addbutton:SetTextColor (button_color_rgb)
@@ -3448,8 +3416,9 @@ function window:CreateFrame14()
--enabled
g:NewLabel (frame14, _, "$parentAttributeEnabledLabel", "attributeEnabledLabel", Loc ["STRING_ENABLED"], "GameFontHighlightLeft")
- g:NewSwitch (frame14, _, "$parentAttributeEnabledSwitch", "attributeEnabledSwitch", 60, 20, nil, nil, instance.attribute_text.enabled)
+ g:NewSwitch (frame14, _, "$parentAttributeEnabledSwitch", "attributeEnabledSwitch", 60, 20, nil, nil, instance.attribute_text.enabled, nil, nil, nil, nil, options_switch_template)
frame14.attributeEnabledSwitch:SetPoint ("left", frame14.attributeEnabledLabel, "right", 2)
+ frame14.attributeEnabledSwitch:SetAsCheckBox()
frame14.attributeEnabledSwitch.OnSwitch = function (self, instance, value)
instance:AttributeMenu (value)
@@ -3468,10 +3437,12 @@ function window:CreateFrame14()
--anchors
g:NewLabel (frame14, _, "$parentAttributeAnchorXLabel", "attributeAnchorXLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ANCHORX"], "GameFontHighlightLeft")
g:NewLabel (frame14, _, "$parentAttributeAnchorYLabel", "attributeAnchorYLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ANCHORY"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame14, _, "$parentAttributeAnchorXSlider", "attributeAnchorXSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -20, 300, 1, instance.attribute_text.anchor [1])
- config_slider (s)
- local s = g:NewSlider (frame14, _, "$parentAttributeAnchorYSlider", "attributeAnchorYSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -100, 50, 1, instance.attribute_text.anchor [2])
- config_slider (s)
+ local s = g:NewSlider (frame14, _, "$parentAttributeAnchorXSlider", "attributeAnchorXSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -20, 300, 1, instance.attribute_text.anchor [1], nil, nil, nil, options_slider_template)
+ --config_slider (s)
+ s:SetThumbSize (24)
+ local s = g:NewSlider (frame14, _, "$parentAttributeAnchorYSlider", "attributeAnchorYSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -100, 50, 1, instance.attribute_text.anchor [2], nil, nil, nil, options_slider_template)
+ --config_slider (s)
+ --s:SetThumbSize (28)
frame14.attributeAnchorXSlider:SetPoint ("left", frame14.attributeAnchorXLabel, "right", 2)
frame14.attributeAnchorYSlider:SetPoint ("left", frame14.attributeAnchorYLabel, "right", 2)
@@ -3531,11 +3502,7 @@ function window:CreateFrame14()
end
g:NewLabel (frame14, _, "$parentAttributeFontLabel", "attributeFontLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_FONT"], "GameFontHighlightLeft")
- local d = g:NewDropDown (frame14, _, "$parentAttributeFontDropdown", "attributeFontDropdown", DROPDOWN_WIDTH, dropdown_height, 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)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame14, _, "$parentAttributeFontDropdown", "attributeFontDropdown", DROPDOWN_WIDTH, dropdown_height, build_font_menu, instance.attribute_text.text_face, options_dropdown_template)
frame14.attributeFontDropdown:SetPoint ("left", frame14.attributeFontLabel, "right", 2)
@@ -3543,8 +3510,8 @@ function window:CreateFrame14()
--size
g:NewLabel (frame14, _, "$parentAttributeTextSizeLabel", "attributeTextSizeLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_TEXTSIZE"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame14, _, "$parentAttributeTextSizeSlider", "attributeTextSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 5, 32, 1, tonumber ( instance.attribute_text.text_size))
- config_slider (s)
+ local s = g:NewSlider (frame14, _, "$parentAttributeTextSizeSlider", "attributeTextSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 5, 32, 1, tonumber ( instance.attribute_text.text_size), nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame14.attributeTextSizeSlider:SetPoint ("left", frame14.attributeTextSizeLabel, "right", 2)
@@ -3581,7 +3548,7 @@ function window:CreateFrame14()
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
- g:NewColorPickButton (frame14, "$parentAttributeTextColorPick", "attributeTextColorPick", attribute_text_color_callback)
+ g:NewColorPickButton (frame14, "$parentAttributeTextColorPick", "attributeTextColorPick", attribute_text_color_callback, nil, options_button_template)
g:NewLabel (frame14, _, "$parentAttributeTextColorLabel", "attributeTextColorLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_TEXTCOLOR"], "GameFontHighlightLeft")
frame14.attributeTextColorPick:SetPoint ("left", frame14.attributeTextColorLabel, "right", 2, 0)
@@ -3590,8 +3557,9 @@ function window:CreateFrame14()
--shadow
g:NewLabel (frame14, _, "$parentAttributeShadowLabel", "attributeShadowLabel", Loc ["STRING_OPTIONS_TEXT_LOUTILINE"], "GameFontHighlightLeft")
- g:NewSwitch (frame14, _, "$parentAttributeShadowSwitch", "attributeShadowSwitch", 60, 20, nil, nil, instance.attribute_text.shadow)
+ g:NewSwitch (frame14, _, "$parentAttributeShadowSwitch", "attributeShadowSwitch", 60, 20, nil, nil, instance.attribute_text.shadow, nil, nil, nil, nil, options_switch_template)
frame14.attributeShadowSwitch:SetPoint ("left", frame14.attributeShadowLabel, "right", 2)
+ frame14.attributeShadowSwitch:SetAsCheckBox()
frame14.attributeShadowSwitch.OnSwitch = function (self, instance, value)
instance:AttributeMenu (nil, nil, nil, nil, nil, nil, nil, value)
@@ -3612,8 +3580,9 @@ function window:CreateFrame14()
local side_return_func = function (slider, value) if (value) then return 1 else return 2 end end
g:NewLabel (frame14, _, "$parentAttributeSideLabel", "attributeSideLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_SIDE"], "GameFontHighlightLeft")
- g:NewSwitch (frame14, _, "$parentAttributeSideSwitch", "attributeSideSwitch", 80, 20, "bottom", "top", instance.attribute_text.side, nil, side_switch_func, side_return_func)
+ g:NewSwitch (frame14, _, "$parentAttributeSideSwitch", "attributeSideSwitch", 80, 20, "bottom", "top", instance.attribute_text.side, nil, side_switch_func, side_return_func, nil, options_switch_template)
frame14.attributeSideSwitch:SetPoint ("left", frame14.attributeSideLabel, "right", 2)
+ frame14.attributeSideSwitch:SetAsCheckBox()
frame14.attributeSideSwitch.OnSwitch = function (self, instance, value)
instance:AttributeMenu (nil, nil, nil, nil, nil, nil, value)
@@ -3634,8 +3603,9 @@ function window:CreateFrame14()
--for encounters
g:NewLabel (frame14, _, "$parentAttributeEncounterTimerLabel", "AttributeEncounterTimerLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_ENCOUNTERTIMER"], "GameFontHighlightLeft")
- g:NewSwitch (frame14, _, "$parentAttributeEncounterTimerSwitch", "AttributeEncounterTimerSwitch", 60, 20, nil, nil, instance.attribute_text.show_timer [1])
+ g:NewSwitch (frame14, _, "$parentAttributeEncounterTimerSwitch", "AttributeEncounterTimerSwitch", 60, 20, nil, nil, instance.attribute_text.show_timer [1], nil, nil, nil, nil, options_switch_template)
frame14.AttributeEncounterTimerSwitch:SetPoint ("left", frame14.AttributeEncounterTimerLabel, "right", 2)
+ frame14.AttributeEncounterTimerSwitch:SetAsCheckBox()
frame14.AttributeEncounterTimerSwitch.OnSwitch = function (self, instance, value)
instance:AttributeMenu (nil, nil, nil, nil, nil, nil, nil, nil, value)
if (_detalhes.options_group_edit and not DetailsOptionsWindow.loading_settings) then
@@ -3715,7 +3685,7 @@ function window:CreateFrame1()
local avatar_x_anchor2 = window.right_start_at - 15
- local box = g:NewTextEntry (frame1, _, "$parentNicknameEntry", "nicknameEntry", SLIDER_WIDTH, SLIDER_HEIGHT, onPressEnter)
+ local box = g:NewTextEntry (frame1, _, "$parentNicknameEntry", "nicknameEntry", SLIDER_WIDTH, TEXTENTRY_HEIGHT, onPressEnter, nil, nil, nil, nil, options_dropdown_template)
frame1.nicknameEntry:SetPoint ("left", frame1.nicknameLabel, "right", 2, 0)
@@ -3748,7 +3718,7 @@ function window:CreateFrame1()
_G.AvatarPickFrame:Show()
end
- g:NewButton (frame1, _, "$parentAvatarFrame", "chooseAvatarButton", 275, 85, openAtavarPickFrame, nil, nil, nil, "", 1) --
+ g:NewButton (frame1, _, "$parentAvatarFrame", "chooseAvatarButton", 275, 85, openAtavarPickFrame, nil, nil, nil, "", 1)
frame1.chooseAvatarButton:SetTextColor (button_color_rgb)
g:NewLabel (frame1, _, "$parentChooseAvatarLabel", "ChooseAvatarLabel", Loc ["STRING_OPTIONS_AVATAR"], "GameFontHighlightLeft")
@@ -3807,8 +3777,9 @@ function window:CreateFrame1()
--> ignore nicknames --------------------------------------------------------------------------------------------------------------------------------------------
g:NewLabel (frame1, _, "$parentIgnoreNicknamesLabel", "IgnoreNicknamesLabel", Loc ["STRING_OPTIONS_IGNORENICKNAME"], "GameFontHighlightLeft")
- g:NewSwitch (frame1, _, "$parentIgnoreNicknamesSlider", "IgnoreNicknamesSlider", 60, 20, _, _, _detalhes.ignore_nicktag)
+ g:NewSwitch (frame1, _, "$parentIgnoreNicknamesSlider", "IgnoreNicknamesSlider", 60, 20, _, _, _detalhes.ignore_nicktag, nil, nil, nil, nil, options_switch_template)
frame1.IgnoreNicknamesSlider:SetPoint ("left", frame1.IgnoreNicknamesLabel, "right", 2)
+ frame1.IgnoreNicknamesSlider:SetAsCheckBox()
frame1.IgnoreNicknamesSlider.OnSwitch = function (self, _, value)
_detalhes.ignore_nicktag = value
@@ -3820,8 +3791,9 @@ function window:CreateFrame1()
--> realm name --------------------------------------------------------------------------------------------------------------------------------------------
g:NewLabel (frame1, _, "$parentRealmNameLabel", "realmNameLabel", Loc ["STRING_OPTIONS_REALMNAME"], "GameFontHighlightLeft")
- g:NewSwitch (frame1, _, "$parentRealmNameSlider", "realmNameSlider", 60, 20, _, _, _detalhes.remove_realm_from_name)
+ g:NewSwitch (frame1, _, "$parentRealmNameSlider", "realmNameSlider", 60, 20, _, _, _detalhes.remove_realm_from_name, nil, nil, nil, nil, options_switch_template)
frame1.realmNameSlider:SetPoint ("left", frame1.realmNameLabel, "right", 2)
+ frame1.realmNameSlider:SetAsCheckBox()
frame1.realmNameSlider.OnSwitch = function (self, _, value)
_detalhes.remove_realm_from_name = value
@@ -3837,8 +3809,8 @@ function window:CreateFrame1()
titulo_display_desc.width = 320
g:NewLabel (frame1, _, "$parentSliderLabel", "segmentsLabel", Loc ["STRING_OPTIONS_MAXSEGMENTS"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame1, _, "$parentSlider", "segmentsSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 25, 1, _detalhes.segments_amount)
- config_slider (s)
+ local s = g:NewSlider (frame1, _, "$parentSlider", "segmentsSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 25, 1, _detalhes.segments_amount, nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame1.segmentsSlider:SetPoint ("left", frame1.segmentsLabel, "right", 2, -1)
frame1.segmentsSlider:SetHook ("OnValueChange", function (self, _, amount) --> slider, fixedValue, sliderValue
@@ -3851,7 +3823,8 @@ function window:CreateFrame1()
--> Segments Locked
g:NewLabel (frame1, _, "$parentSegmentsLockedLabel", "SegmentsLockedLabel", Loc ["STRING_OPTIONS_LOCKSEGMENTS"], "GameFontHighlightLeft")
- g:NewSwitch (frame1, _, "$parentSegmentsLockedSlider", "SegmentsLockedSlider", 60, 20, _, _, _detalhes.instances_segments_locked)
+ g:NewSwitch (frame1, _, "$parentSegmentsLockedSlider", "SegmentsLockedSlider", 60, 20, _, _, _detalhes.instances_segments_locked, nil, nil, nil, nil, options_switch_template)
+ frame1.SegmentsLockedSlider:SetAsCheckBox()
frame1.SegmentsLockedSlider:SetPoint ("left", frame1.SegmentsLockedLabel, "right", 2)
frame1.SegmentsLockedSlider.OnSwitch = function (self, _, value)
@@ -3865,8 +3838,8 @@ function window:CreateFrame1()
g:NewLabel (frame1, _, "$parentWheelSpeedLabel", "WheelSpeedLabel", Loc ["STRING_OPTIONS_WHEEL_SPEED"], "GameFontHighlightLeft")
--
- local s = g:NewSlider (frame1, _, "$parentWheelSpeedSlider", "WheelSpeedSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 3, 1, _detalhes.scroll_speed)
- config_slider (s)
+ local s = g:NewSlider (frame1, _, "$parentWheelSpeedSlider", "WheelSpeedSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 3, 1, _detalhes.scroll_speed, nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame1.WheelSpeedSlider:SetPoint ("left", frame1.WheelSpeedLabel, "right", 2, -1)
frame1.WheelSpeedSlider:SetHook ("OnValueChange", function (self, _, amount) --> slider, fixedValue, sliderValue
@@ -3879,8 +3852,8 @@ function window:CreateFrame1()
--> Max Instances
g:NewLabel (frame1, _, "$parentLabelMaxInstances", "maxInstancesLabel", Loc ["STRING_OPTIONS_MAXINSTANCES"], "GameFontHighlightLeft")
--
- local s = g:NewSlider (frame1, _, "$parentSliderMaxInstances", "maxInstancesSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 30, 1, _detalhes.instances_amount) -- min, max, step, defaultv
- config_slider (s)
+ local s = g:NewSlider (frame1, _, "$parentSliderMaxInstances", "maxInstancesSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 30, 1, _detalhes.instances_amount, nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame1.maxInstancesSlider:SetPoint ("left", frame1.maxInstancesLabel, "right", 2, -1)
frame1.maxInstancesSlider:SetHook ("OnValueChange", function (self, _, amount) --> slider, fixedValue, sliderValue
@@ -3922,11 +3895,7 @@ function window:CreateFrame1()
return abbreviationOptions
end
- local d = g:NewDropDown (frame1, _, "$parentAbbreviateDropdown", "dpsAbbreviateDropdown", 160, dropdown_height, 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)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame1, _, "$parentAbbreviateDropdown", "dpsAbbreviateDropdown", 160, dropdown_height, buildAbbreviationMenu, _detalhes.ps_abbreviation, options_dropdown_template)
frame1.dpsAbbreviateDropdown:SetPoint ("left", frame1.dpsAbbreviateLabel, "right", 2, 0)
@@ -3944,7 +3913,9 @@ function window:CreateFrame1()
g:NewLabel (frame1, _, "$parentAnimateLabel", "animateLabel", Loc ["STRING_OPTIONS_ANIMATEBARS"], "GameFontHighlightLeft")
- g:NewSwitch (frame1, _, "$parentAnimateSlider", "animateSlider", 60, 20, _, _, _detalhes.use_row_animations) -- ltext, rtext, defaultv
+ g:NewSwitch (frame1, _, "$parentAnimateSlider", "animateSlider", 60, 20, _, _, _detalhes.use_row_animations, nil, nil, nil, nil, options_switch_template)
+ frame1.animateSlider:SetAsCheckBox()
+
frame1.animateSlider:SetPoint ("left",frame1.animateLabel, "right", 2, 0)
frame1.animateSlider.OnSwitch = function (self, _, value) --> slider, fixedValue, sliderValue (false, true)
_detalhes:SetUseAnimations (value)
@@ -3955,13 +3926,13 @@ function window:CreateFrame1()
--> update speed
- local s = g:NewSlider (frame1, _, "$parentSliderUpdateSpeed", "updatespeedSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0.05, 3, 0.05, _detalhes.update_speed, true)
- config_slider (s)
+ local s = g:NewSlider (frame1, _, "$parentSliderUpdateSpeed", "updatespeedSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0.05, 3, 0.05, _detalhes.update_speed, true, nil, nil, options_slider_template)
+ --config_slider (s)
g:NewLabel (frame1, _, "$parentUpdateSpeedLabel", "updatespeedLabel", Loc ["STRING_OPTIONS_WINDOWSPEED"], "GameFontHighlightLeft")
--
frame1.updatespeedSlider:SetPoint ("left", frame1.updatespeedLabel, "right", 2, -1)
- frame1.updatespeedSlider:SetThumbSize (50)
+ frame1.updatespeedSlider:SetThumbSize (28)
frame1.updatespeedSlider.useDecimals = true
local updateColor = function (slider, value)
if (value < 1) then
@@ -3987,8 +3958,8 @@ function window:CreateFrame1()
--lock unlock
- g:NewButton (frame1, _, "$parentLockButton", "LockButton", window.buttons_width, 18, _detalhes.lock_instance_function, nil, nil, nil, Loc ["STRING_OPTIONS_WC_LOCK"], 1)
- frame1.LockButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ g:NewButton (frame1, _, "$parentLockButton", "LockButton", window.buttons_width, window.buttons_height, _detalhes.lock_instance_function, nil, nil, nil, Loc ["STRING_OPTIONS_WC_LOCK"], 1, options_button_template)
+ --frame1.LockButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
window:CreateLineBackground2 (frame1, "LockButton", "LockButton", Loc ["STRING_OPTIONS_WC_LOCK_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
@@ -3996,8 +3967,8 @@ function window:CreateFrame1()
frame1.LockButton:SetTextColor (button_color_rgb)
--break snap
- g:NewButton (frame1, _, "$parentBreakSnapButton", "BreakSnapButton", window.buttons_width, 18, _G.DetailsOptionsWindow.instance.Desagrupar, -1, nil, nil, Loc ["STRING_OPTIONS_WC_UNSNAP"], 1)
- frame1.BreakSnapButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ g:NewButton (frame1, _, "$parentBreakSnapButton", "BreakSnapButton", window.buttons_width, window.buttons_height, _G.DetailsOptionsWindow.instance.Desagrupar, -1, nil, nil, Loc ["STRING_OPTIONS_WC_UNSNAP"], 1, options_button_template)
+ --frame1.BreakSnapButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
window:CreateLineBackground2 (frame1, "BreakSnapButton", "BreakSnapButton", Loc ["STRING_OPTIONS_WC_UNSNAP_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
@@ -4005,16 +3976,16 @@ function window:CreateFrame1()
frame1.BreakSnapButton:SetTextColor (button_color_rgb)
--close
- g:NewButton (frame1, _, "$parentCloseButton", "CloseButton", window.buttons_width, 18, _detalhes.close_instancia_func, _G.DetailsOptionsWindow.instance, nil, nil, Loc ["STRING_OPTIONS_WC_CLOSE"], 1)
- frame1.CloseButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ g:NewButton (frame1, _, "$parentCloseButton", "CloseButton", window.buttons_width, window.buttons_height, _detalhes.close_instancia_func, _G.DetailsOptionsWindow.instance, nil, nil, Loc ["STRING_OPTIONS_WC_CLOSE"], 1, options_button_template)
+ --frame1.CloseButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
window:CreateLineBackground2 (frame1, "CloseButton", "CloseButton", Loc ["STRING_OPTIONS_WC_CLOSE_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
frame1.CloseButton:SetIcon ([[Interface\Buttons\UI-Panel-MinimizeButton-Up]], nil, nil, nil, {0.143125, 0.8653125, 0.1446875, 0.8653125}, nil, nil, 2)
frame1.CloseButton:SetTextColor (button_color_rgb)
--create
- g:NewButton (frame1, _, "$parentCreateWindowButton", "CreateWindowButton", window.buttons_width, 18, function() _detalhes.CriarInstancia (nil, nil, true) end, nil, nil, nil, Loc ["STRING_OPTIONS_WC_CREATE"], 1)
- frame1.CreateWindowButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ g:NewButton (frame1, _, "$parentCreateWindowButton", "CreateWindowButton", window.buttons_width, window.buttons_height, function() _detalhes.CriarInstancia (nil, nil, true) end, nil, nil, nil, Loc ["STRING_OPTIONS_WC_CREATE"], 1, options_button_template)
+ --frame1.CreateWindowButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
window:CreateLineBackground2 (frame1, "CreateWindowButton", "CreateWindowButton", Loc ["STRING_OPTIONS_WC_CREATE_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
@@ -4059,8 +4030,8 @@ function window:CreateFrame1()
_detalhes.gump:ColorPick (_G.DetailsOptionsWindow1SetWindowColorButton, r, g, b, a, windowcolor_callback)
end
- g:NewButton (frame1, _, "$parentSetWindowColorButton", "SetWindowColorButton", window.buttons_width, 18, change_color, nil, nil, nil, "Change Color", 1)
- frame1.SetWindowColorButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ g:NewButton (frame1, _, "$parentSetWindowColorButton", "SetWindowColorButton", window.buttons_width, window.buttons_height, change_color, nil, nil, nil, "Change Color", 1, options_button_template)
+ --frame1.SetWindowColorButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
window:CreateLineBackground2 (frame1, "SetWindowColorButton", "SetWindowColorButton", "Shortcut to modify the window color.\nFor more options check out |cFFFFFF00Window Settings|r section.", nil, {1, 0.8, 0}, button_color_rgb)
@@ -4084,11 +4055,7 @@ function window:CreateFrame1()
return EraseDataOptions
end
- local d = g:NewDropDown (frame1, _, "$parentEraseDataDropdown", "EraseDataDropdown", 160, dropdown_height, BuildEraseDataMenu, _detalhes.segments_auto_erase)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame1, _, "$parentEraseDataDropdown", "EraseDataDropdown", 160, dropdown_height, BuildEraseDataMenu, _detalhes.segments_auto_erase, options_dropdown_template)
frame1.EraseDataDropdown:SetPoint ("left", frame1.EraseDataLabel, "right", 2, 0)
@@ -4096,16 +4063,16 @@ function window:CreateFrame1()
--config bookmarks
- g:NewButton (frame1, _, "$parentBookmarkButton", "BookmarkButton", window.buttons_width, 18, _detalhes.OpenBookmarkConfig, nil, nil, nil, Loc ["STRING_OPTIONS_WC_BOOKMARK"], 1)
- frame1.BookmarkButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ g:NewButton (frame1, _, "$parentBookmarkButton", "BookmarkButton", window.buttons_width, 18, _detalhes.OpenBookmarkConfig, nil, nil, nil, Loc ["STRING_OPTIONS_WC_BOOKMARK"], 1, options_button_template)
+ --frame1.BookmarkButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
window:CreateLineBackground2 (frame1, "BookmarkButton", "BookmarkButton", Loc ["STRING_OPTIONS_WC_BOOKMARK_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
frame1.BookmarkButton:SetIcon ([[Interface\Glues\CharacterSelect\Glues-AddOn-Icons]], nil, nil, nil, {0.75, 1, 0, 1}, nil, nil, 2)
frame1.BookmarkButton:SetTextColor (button_color_rgb)
--config class colors
- g:NewButton (frame1, _, "$parentClassColorsButton", "ClassColorsButton", window.buttons_width, 18, _detalhes.OpenClassColorsConfig, nil, nil, nil, Loc ["STRING_OPTIONS_CHANGE_CLASSCOLORS"], 1)
- frame1.ClassColorsButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ g:NewButton (frame1, _, "$parentClassColorsButton", "ClassColorsButton", window.buttons_width, 18, _detalhes.OpenClassColorsConfig, nil, nil, nil, Loc ["STRING_OPTIONS_CHANGE_CLASSCOLORS"], 1, options_button_template)
+ --frame1.ClassColorsButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
window:CreateLineBackground2 (frame1, "ClassColorsButton", "ClassColorsButton", Loc ["STRING_OPTIONS_CHANGE_CLASSCOLORS_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
frame1.ClassColorsButton:SetIcon ([[Interface\AddOns\Details\images\icons]], nil, nil, nil, {430/512, 459/512, 4/512, 30/512}, nil, nil, 2) -- , "orange"
@@ -4205,8 +4172,9 @@ function window:CreateFrame2()
--> Frags PVP Mode
g:NewLabel (frame2, _, "$parentLabelFragsPvP", "fragsPvpLabel", Loc ["STRING_OPTIONS_PVPFRAGS"], "GameFontHighlightLeft")
--
- g:NewSwitch (frame2, _, "$parentFragsPvpSlider", "fragsPvpSlider", 60, 20, _, _, _detalhes.only_pvp_frags)
+ g:NewSwitch (frame2, _, "$parentFragsPvpSlider", "fragsPvpSlider", 60, 20, _, _, _detalhes.only_pvp_frags, nil, nil, nil, nil, options_switch_template)
frame2.fragsPvpSlider:SetPoint ("left", frame2.fragsPvpLabel, "right", 2, 0)
+ frame2.fragsPvpSlider:SetAsCheckBox()
frame2.fragsPvpSlider.OnSwitch = function (self, _, amount) --> slider, fixedValue, sliderValue
_detalhes.only_pvp_frags = amount
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -4231,11 +4199,7 @@ function window:CreateFrame2()
local buildTimeTypeMenu = function()
return timetypeOptions
end
- local d = g:NewDropDown (frame2, _, "$parentTTDropdown", "timetypeDropdown", 160, dropdown_height, 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)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame2, _, "$parentTTDropdown", "timetypeDropdown", 160, dropdown_height, buildTimeTypeMenu, nil, options_dropdown_template)
frame2.timetypeDropdown:SetPoint ("left", frame2.timetypeLabel, "right", 2, 0)
@@ -4255,11 +4219,7 @@ function window:CreateFrame2()
local buildDeathLogLimitMenu = function()
return DeathLogLimitOptions
end
- local d = g:NewDropDown (frame2, _, "$parentDeathLogLimitDropdown", "DeathLogLimitDropdown", 160, dropdown_height, buildDeathLogLimitMenu, 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)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame2, _, "$parentDeathLogLimitDropdown", "DeathLogLimitDropdown", 160, dropdown_height, buildDeathLogLimitMenu, nil, options_dropdown_template)
frame2.DeathLogLimitDropdown:SetPoint ("left", frame2.DeathLogLimitLabel, "right", 2, 0)
@@ -4267,8 +4227,9 @@ function window:CreateFrame2()
--> Erase Chart Data
g:NewLabel (frame2, _, "$parentEraseChartDataLabel", "EraseChartDataLabel", Loc ["STRING_OPTIONS_ERASECHARTDATA"], "GameFontHighlightLeft")
- g:NewSwitch (frame2, _, "$parentEraseChartDataSlider", "EraseChartDataSlider", 60, 20, _, _, false)
+ g:NewSwitch (frame2, _, "$parentEraseChartDataSlider", "EraseChartDataSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame2.EraseChartDataSlider:SetPoint ("left", frame2.EraseChartDataLabel, "right", 2, 0)
+ frame2.EraseChartDataSlider:SetAsCheckBox()
frame2.EraseChartDataSlider.OnSwitch = function (self, _, value)
_detalhes.clear_graphic = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -4281,8 +4242,9 @@ function window:CreateFrame2()
--raid boss
g:NewLabel (frame2, _, "$parentOverallDataRaidBossLabel", "OverallDataRaidBossLabel", Loc ["STRING_OPTIONS_OVERALL_RAIDBOSS"], "GameFontHighlightLeft")
--
- g:NewSwitch (frame2, _, "$parentOverallDataRaidBossSlider", "OverallDataRaidBossSlider", 60, 20, _, _, false)
+ g:NewSwitch (frame2, _, "$parentOverallDataRaidBossSlider", "OverallDataRaidBossSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame2.OverallDataRaidBossSlider:SetPoint ("left", frame2.OverallDataRaidBossLabel, "right", 2, 0)
+ frame2.OverallDataRaidBossSlider:SetAsCheckBox()
--
frame2.OverallDataRaidBossSlider.OnSwitch = function (self, _, value)
if (value and bit.band (_detalhes.overall_flag, 0x1) == 0) then
@@ -4298,8 +4260,9 @@ function window:CreateFrame2()
--raid cleanup
g:NewLabel (frame2, _, "$parentOverallDataRaidCleaupLabel", "OverallDataRaidCleaupLabel", Loc ["STRING_OPTIONS_OVERALL_RAIDCLEAN"], "GameFontHighlightLeft")
--
- local raid_cleanup = g:NewSwitch (frame2, _, "$parentOverallDataRaidCleaupSlider", "OverallDataRaidCleaupSlider", 60, 20, _, _, false)
+ local raid_cleanup = g:NewSwitch (frame2, _, "$parentOverallDataRaidCleaupSlider", "OverallDataRaidCleaupSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame2.OverallDataRaidCleaupSlider:SetPoint ("left", frame2.OverallDataRaidCleaupLabel, "right", 2, 0)
+ frame2.OverallDataRaidCleaupSlider:SetAsCheckBox()
--
frame2.OverallDataRaidCleaupSlider.OnSwitch = function (self, _, value)
if (value and bit.band (_detalhes.overall_flag, 0x2) == 0) then
@@ -4315,8 +4278,9 @@ function window:CreateFrame2()
--dungeon boss
g:NewLabel (frame2, _, "$parentOverallDataDungeonBossLabel", "OverallDataDungeonBossLabel", Loc ["STRING_OPTIONS_OVERALL_DUNGEONBOSS"], "GameFontHighlightLeft")
--
- g:NewSwitch (frame2, _, "$parentOverallDataDungeonBossSlider", "OverallDataDungeonBossSlider", 60, 20, _, _, false)
+ g:NewSwitch (frame2, _, "$parentOverallDataDungeonBossSlider", "OverallDataDungeonBossSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame2.OverallDataDungeonBossSlider:SetPoint ("left", frame2.OverallDataDungeonBossLabel, "right", 2, 0)
+ frame2.OverallDataDungeonBossSlider:SetAsCheckBox()
--
frame2.OverallDataDungeonBossSlider.OnSwitch = function (self, _, value)
if (value and bit.band (_detalhes.overall_flag, 0x4) == 0) then
@@ -4332,8 +4296,9 @@ function window:CreateFrame2()
--dungeon cleanup
g:NewLabel (frame2, _, "$parentOverallDataDungeonCleaupLabel", "OverallDataDungeonCleaupLabel", Loc ["STRING_OPTIONS_OVERALL_DUNGEONCLEAN"], "GameFontHighlightLeft")
--
- g:NewSwitch (frame2, _, "$parentOverallDataDungeonCleaupSlider", "OverallDataDungeonCleaupSlider", 60, 20, _, _, false)
+ g:NewSwitch (frame2, _, "$parentOverallDataDungeonCleaupSlider", "OverallDataDungeonCleaupSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame2.OverallDataDungeonCleaupSlider:SetPoint ("left", frame2.OverallDataDungeonCleaupLabel, "right", 2, 0)
+ frame2.OverallDataDungeonCleaupSlider:SetAsCheckBox()
--
frame2.OverallDataDungeonCleaupSlider.OnSwitch = function (self, _, value)
if (value and bit.band (_detalhes.overall_flag, 0x8) == 0) then
@@ -4349,8 +4314,9 @@ function window:CreateFrame2()
--everything
g:NewLabel (frame2, _, "$parentOverallDataAllLabel", "OverallDataAllLabel", Loc ["STRING_OPTIONS_OVERALL_ALL"], "GameFontHighlightLeft")
--
- g:NewSwitch (frame2, _, "$parentOverallDataAllSlider", "OverallDataAllSlider", 60, 20, _, _, false)
+ g:NewSwitch (frame2, _, "$parentOverallDataAllSlider", "OverallDataAllSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame2.OverallDataAllSlider:SetPoint ("left", frame2.OverallDataAllLabel, "right", 2, 0)
+ frame2.OverallDataAllSlider:SetAsCheckBox()
--
function frame2:OverallSliderEnabled()
@@ -4387,8 +4353,9 @@ function window:CreateFrame2()
--erase on new boss
g:NewLabel (frame2, _, "$parentOverallNewBossLabel", "OverallNewBossLabel", Loc ["STRING_OPTIONS_OVERALL_NEWBOSS"], "GameFontHighlightLeft")
--
- g:NewSwitch (frame2, _, "$parentOverallNewBossSlider", "OverallNewBossSlider", 60, 20, _, _, false)
+ g:NewSwitch (frame2, _, "$parentOverallNewBossSlider", "OverallNewBossSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame2.OverallNewBossSlider:SetPoint ("left", frame2.OverallNewBossLabel, "right", 2, 0)
+ frame2.OverallNewBossSlider:SetAsCheckBox()
--
frame2.OverallNewBossSlider.OnSwitch = function (self, _, value)
_detalhes:OverallOptions (value)
@@ -4400,8 +4367,9 @@ function window:CreateFrame2()
--erase on challenge mode
g:NewLabel (frame2, _, "$parentOverallNewChallengeLabel", "OverallNewChallengeLabel", Loc ["STRING_OPTIONS_OVERALL_CHALLENGE"], "GameFontHighlightLeft")
--
- g:NewSwitch (frame2, _, "$parentOverallNewChallengeSlider", "OverallNewChallengeSlider", 60, 20, _, _, false)
+ g:NewSwitch (frame2, _, "$parentOverallNewChallengeSlider", "OverallNewChallengeSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame2.OverallNewChallengeSlider:SetPoint ("left", frame2.OverallNewChallengeLabel, "right", 2, 0)
+ frame2.OverallNewChallengeSlider:SetAsCheckBox()
--
frame2.OverallNewChallengeSlider.OnSwitch = function (self, _, value)
_detalhes:OverallOptions (nil, value)
@@ -4413,8 +4381,9 @@ function window:CreateFrame2()
--erase on logout overall_clear_logout
g:NewLabel (frame2, _, "$parentOverallOnLogoutLabel", "OverallOnLogoutLabel", Loc ["STRING_OPTIONS_OVERALL_LOGOFF"], "GameFontHighlightLeft")
--
- g:NewSwitch (frame2, _, "$parentOverallOnLogoutSlider", "OverallOnLogoutSlider", 60, 20, _, _, false)
+ g:NewSwitch (frame2, _, "$parentOverallOnLogoutSlider", "OverallOnLogoutSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame2.OverallOnLogoutSlider:SetPoint ("left", frame2.OverallOnLogoutLabel, "right", 2, 0)
+ frame2.OverallOnLogoutSlider:SetAsCheckBox()
--
frame2.OverallOnLogoutSlider.OnSwitch = function (self, _, value)
_detalhes:OverallOptions (nil, nil, value)
@@ -4463,8 +4432,9 @@ function window:CreateFrame2()
icon:SetDesaturated (not on_off)
end
- g:NewSwitch (frame2, _, "$parentCaptureDamageSlider", "damageCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["damage"])
+ g:NewSwitch (frame2, _, "$parentCaptureDamageSlider", "damageCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["damage"], nil, nil, nil, nil, options_switch_template)
frame2.damageCaptureSlider:SetPoint ("left", frame2.damageCaptureLabel, "right", 2)
+ frame2.damageCaptureSlider:SetAsCheckBox()
frame2.damageCaptureSlider.OnSwitch = function (self, _, value)
_detalhes:CaptureSet (value, "damage", true)
if (value) then
@@ -4476,8 +4446,9 @@ function window:CreateFrame2()
window:CreateLineBackground2 (frame2, "damageCaptureSlider", "damageCaptureLabel", Loc ["STRING_OPTIONS_CDAMAGE_DESC"], frame2.damageCaptureImage)
- g:NewSwitch (frame2, _, "$parentCaptureHealSlider", "healCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["heal"])
+ g:NewSwitch (frame2, _, "$parentCaptureHealSlider", "healCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["heal"], nil, nil, nil, nil, options_switch_template)
frame2.healCaptureSlider:SetPoint ("left", frame2.healCaptureLabel, "right", 2)
+ frame2.healCaptureSlider:SetAsCheckBox()
frame2.healCaptureSlider.OnSwitch = function (self, _, value)
_detalhes:CaptureSet (value, "heal", true)
if (value) then
@@ -4489,8 +4460,9 @@ function window:CreateFrame2()
window:CreateLineBackground2 (frame2, "healCaptureSlider", "healCaptureLabel", Loc ["STRING_OPTIONS_CHEAL_DESC"], frame2.healCaptureImage)
- g:NewSwitch (frame2, _, "$parentCaptureEnergySlider", "energyCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["energy"])
+ g:NewSwitch (frame2, _, "$parentCaptureEnergySlider", "energyCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["energy"], nil, nil, nil, nil, options_switch_template)
frame2.energyCaptureSlider:SetPoint ("left", frame2.energyCaptureLabel, "right", 2)
+ frame2.energyCaptureSlider:SetAsCheckBox()
frame2.energyCaptureSlider.OnSwitch = function (self, _, value)
_detalhes:CaptureSet (value, "energy", true)
@@ -4503,8 +4475,9 @@ function window:CreateFrame2()
window:CreateLineBackground2 (frame2, "energyCaptureSlider", "energyCaptureLabel", Loc ["STRING_OPTIONS_CENERGY_DESC"], frame2.energyCaptureImage)
- g:NewSwitch (frame2, _, "$parentCaptureMiscSlider", "miscCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["miscdata"])
+ g:NewSwitch (frame2, _, "$parentCaptureMiscSlider", "miscCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["miscdata"], nil, nil, nil, nil, options_switch_template)
frame2.miscCaptureSlider:SetPoint ("left", frame2.miscCaptureLabel, "right", 2)
+ frame2.miscCaptureSlider:SetAsCheckBox()
frame2.miscCaptureSlider.OnSwitch = function (self, _, value)
_detalhes:CaptureSet (value, "miscdata", true)
if (value) then
@@ -4516,8 +4489,9 @@ function window:CreateFrame2()
window:CreateLineBackground2 (frame2, "miscCaptureSlider", "miscCaptureLabel", Loc ["STRING_OPTIONS_CMISC_DESC"], frame2.miscCaptureImage)
- g:NewSwitch (frame2, _, "$parentCaptureAuraSlider", "auraCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["aura"])
+ g:NewSwitch (frame2, _, "$parentCaptureAuraSlider", "auraCaptureSlider", 60, 20, _, _, _detalhes.capture_real ["aura"], nil, nil, nil, nil, options_switch_template)
frame2.auraCaptureSlider:SetPoint ("left", frame2.auraCaptureLabel, "right", 2)
+ frame2.auraCaptureSlider:SetAsCheckBox()
frame2.auraCaptureSlider.OnSwitch = function (self, _, value)
_detalhes:CaptureSet (value, "aura", true)
if (value) then
@@ -4532,8 +4506,9 @@ function window:CreateFrame2()
--> cloud capture
g:NewLabel (frame2, _, "$parentCloudCaptureLabel", "cloudCaptureLabel", Loc ["STRING_OPTIONS_CLOUD"], "GameFontHighlightLeft")
- g:NewSwitch (frame2, _, "$parentCloudAuraSlider", "cloudCaptureSlider", 60, 20, _, _, _detalhes.cloud_capture)
+ g:NewSwitch (frame2, _, "$parentCloudAuraSlider", "cloudCaptureSlider", 60, 20, _, _, _detalhes.cloud_capture, nil, nil, nil, nil, options_switch_template)
frame2.cloudCaptureSlider:SetPoint ("left", frame2.cloudCaptureLabel, "right", 2)
+ frame2.cloudCaptureSlider:SetAsCheckBox()
frame2.cloudCaptureSlider.OnSwitch = function (self, _, value)
_detalhes.cloud_capture = value
end
@@ -4543,8 +4518,9 @@ function window:CreateFrame2()
--> battleground
--> remote parser
g:NewLabel (frame2, _, "$parentRemoteParserLabel", "RemoteParserLabel", Loc ["STRING_OPTIONS_BG_REMOTE_PARSER"], "GameFontHighlightLeft")
- g:NewSwitch (frame2, _, "$parentRemoteParserSlider", "RemoteParserSlider", 60, 20, _, _, _detalhes.use_battleground_server_parser)
+ g:NewSwitch (frame2, _, "$parentRemoteParserSlider", "RemoteParserSlider", 60, 20, _, _, _detalhes.use_battleground_server_parser, nil, nil, nil, nil, options_switch_template)
frame2.RemoteParserSlider:SetPoint ("left", frame2.RemoteParserLabel, "right", 2)
+ frame2.RemoteParserSlider:SetAsCheckBox()
frame2.RemoteParserSlider.OnSwitch = function (self, _, value)
_detalhes.use_battleground_server_parser = value
end
@@ -4552,8 +4528,9 @@ function window:CreateFrame2()
--> show all
g:NewLabel (frame2, _, "$parentShowAllLabel", "ShowAllLabel", Loc ["STRING_OPTIONS_BG_ALL_ALLY"], "GameFontHighlightLeft")
- g:NewSwitch (frame2, _, "$parentShowAllSlider", "ShowAllSlider", 60, 20, _, _, _detalhes.pvp_as_group)
+ g:NewSwitch (frame2, _, "$parentShowAllSlider", "ShowAllSlider", 60, 20, _, _, _detalhes.pvp_as_group, nil, nil, nil, nil, options_switch_template)
frame2.ShowAllSlider:SetPoint ("left", frame2.ShowAllLabel, "right", 2)
+ frame2.ShowAllSlider:SetAsCheckBox()
frame2.ShowAllSlider.OnSwitch = function (self, _, value)
_detalhes.pvp_as_group = value
end
@@ -4652,12 +4629,8 @@ function window:CreateFrame13()
return menu
end
- local select_profile_dropdown = g:NewDropDown (frame13, _, "$parentSelectProfileDropdown", "selectProfileDropdown", 160, dropdown_height, build_profile_menu, 0)
+ local select_profile_dropdown = g:NewDropDown (frame13, _, "$parentSelectProfileDropdown", "selectProfileDropdown", 160, dropdown_height, build_profile_menu, 0, options_dropdown_template)
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)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
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)
@@ -4667,9 +4640,10 @@ function window:CreateFrame13()
--> always use this profile
g:NewLabel (frame13, _, "$parentAlwaysUseLabel", "AlwaysUseLabel", Loc ["STRING_OPTIONS_ALWAYS_USE"], "GameFontHighlightLeft")
- g:NewSwitch (frame13, _, "$parentAlwaysUseSlider", "AlwaysUseSlider", 60, 20, _, _, _detalhes.always_use_profile)
+ g:NewSwitch (frame13, _, "$parentAlwaysUseSlider", "AlwaysUseSlider", 60, 20, _, _, _detalhes.always_use_profile, nil, nil, nil, nil, options_switch_template)
frame13.AlwaysUseSlider:SetPoint ("left", frame13.AlwaysUseLabel, "right", 2, -1)
+ frame13.AlwaysUseSlider:SetAsCheckBox()
frame13.AlwaysUseSlider.OnSwitch = function (self, _, value)
if (value) then
_detalhes.always_use_profile = select_profile_dropdown:GetValue()
@@ -4682,7 +4656,7 @@ function window:CreateFrame13()
--> new profile
- local profile_name = g:NewTextEntry (frame13, _, "$parentProfileNameEntry", "profileNameEntry", 120, 20)
+ local profile_name = g:NewTextEntry (frame13, _, "$parentProfileNameEntry", "profileNameEntry", 120, TEXTENTRY_HEIGHT, nil, nil, nil, nil, nil, options_dropdown_template)
local profile_name_label = g:NewLabel (frame13, _, "$parentProfileNameLabel", "profileNameLabel", Loc ["STRING_OPTIONS_PROFILES_CREATE"], "GameFontHighlightLeft")
profile_name:SetPoint ("left", profile_name_label, "right", 2, 0)
@@ -4705,8 +4679,8 @@ function window:CreateFrame13()
return _detalhes:Msg (Loc ["STRING_OPTIONS_PROFILE_NOTCREATED"])
end
end
- local profile_create_button = g:NewButton (frame13, _, "$parentProfileCreateButton", "profileCreateButton", 50, 18, create_profile, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_SAVE"])
- profile_create_button:InstallCustomTexture()
+ local profile_create_button = g:NewButton (frame13, _, "$parentProfileCreateButton", "profileCreateButton", 50, 18, create_profile, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_SAVE"], nil, options_button_template)
+ --profile_create_button:InstallCustomTexture()
profile_create_button:SetPoint ("left", profile_name, "right", 2, 0)
window:CreateLineBackground2 (frame13, profile_name, profile_name_label, Loc ["STRING_OPTIONS_PROFILES_CREATE_DESC"])
@@ -4736,15 +4710,11 @@ function window:CreateFrame13()
return menu
end
- local select_profileCopy_dropdown = g:NewDropDown (frame13, _, "$parentSelectProfileCopyDropdown", "selectProfileCopyDropdown", 160, dropdown_height, build_copy_menu, 0)
+ local select_profileCopy_dropdown = g:NewDropDown (frame13, _, "$parentSelectProfileCopyDropdown", "selectProfileCopyDropdown", 160, dropdown_height, build_copy_menu, 0, options_dropdown_template)
select_profileCopy_dropdown:SetEmptyTextAndIcon (Loc ["STRING_OPTIONS_PROFILE_SELECT"])
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)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
-
+
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)
@@ -4775,14 +4745,10 @@ function window:CreateFrame13()
return menu
end
- local select_profileErase_dropdown = g:NewDropDown (frame13, _, "$parentSelectProfileEraseDropdown", "selectProfileEraseDropdown", 160, dropdown_height, build_erase_menu, 0)
+ local select_profileErase_dropdown = g:NewDropDown (frame13, _, "$parentSelectProfileEraseDropdown", "selectProfileEraseDropdown", 160, dropdown_height, build_erase_menu, 0, options_dropdown_template)
select_profileErase_dropdown:SetEmptyTextAndIcon (Loc ["STRING_OPTIONS_PROFILE_SELECT"])
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)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
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)
@@ -4801,8 +4767,8 @@ function window:CreateFrame13()
_detalhes:ScheduleTimer ("RefreshOptionsAfterProfileReset", 1)
end
- local profile_reset_button = g:NewButton (frame13, _, "$parentProfileResetButton", "profileResetButton", window.buttons_width, 18, reset_profile, nil, nil, nil, Loc ["STRING_OPTIONS_PROFILES_RESET"])
- profile_reset_button:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ local profile_reset_button = g:NewButton (frame13, _, "$parentProfileResetButton", "profileResetButton", window.buttons_width, 18, reset_profile, nil, nil, nil, Loc ["STRING_OPTIONS_PROFILES_RESET"], nil, options_button_template)
+ --profile_reset_button:InstallCustomTexture (nil, nil, nil, nil, nil, true)
frame13.profileResetButton:SetIcon ([[Interface\Buttons\UI-RefreshButton]], 14, 14, nil, {0, 1, 0, 0.9375}, nil, 4, 2)
frame13.profileResetButton:SetTextColor (button_color_rgb)
@@ -4814,8 +4780,9 @@ function window:CreateFrame13()
--> save window position within profile
g:NewLabel (frame13, _, "$parentSavePosAndSizeLabel", "PosAndSizeLabel", Loc ["STRING_OPTIONS_PROFILE_POSSIZE"], "GameFontHighlightLeft")
- g:NewSwitch (frame13, _, "$parentPosAndSizeSlider", "PosAndSizeSlider", 60, 20, _, _, _detalhes.profile_save_pos)
+ g:NewSwitch (frame13, _, "$parentPosAndSizeSlider", "PosAndSizeSlider", 60, 20, _, _, _detalhes.profile_save_pos, nil, nil, nil, nil, options_switch_template)
frame13.PosAndSizeSlider:SetPoint ("left", frame13.PosAndSizeLabel, "right", 2, -1)
+ frame13.PosAndSizeSlider:SetAsCheckBox()
frame13.PosAndSizeSlider.OnSwitch = function (self, _, value)
_detalhes.profile_save_pos = value
_detalhes:SetProfileCProp (nil, "profile_save_pos", value)
@@ -5018,11 +4985,7 @@ function window:CreateFrame3()
end
-- skin
- local d = g:NewDropDown (frame3, _, "$parentSkinDropdown", "skinDropdown", 160, dropdown_height, buildSkinMenu, 1)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame3, _, "$parentSkinDropdown", "skinDropdown", 160, dropdown_height, buildSkinMenu, 1, options_dropdown_template)
g:NewLabel (frame3, _, "$parentSkinLabel", "skinLabel", Loc ["STRING_OPTIONS_INSTANCE_SKIN"], "GameFontHighlightLeft")
@@ -5032,7 +4995,7 @@ function window:CreateFrame3()
--> Create New Skin
- local function saveStyleFunc (temp)
+ local function saveStyleFunc (self, b, temp)
if ((not frame3.saveStyleName.text or frame3.saveStyleName.text == "") and not temp) then
_detalhes:Msg (Loc ["STRING_OPTIONS_PRESETNONAME"])
return
@@ -5069,18 +5032,18 @@ function window:CreateFrame3()
end
- g:NewTextEntry (frame3, _, "$parentSaveStyleName", "saveStyleName", 120, 20)
+ g:NewTextEntry (frame3, _, "$parentSaveStyleName", "saveStyleName", 120, TEXTENTRY_HEIGHT, nil, nil, nil, nil, nil, options_dropdown_template)
g:NewLabel (frame3, _, "$parentSaveSkinLabel", "saveSkinLabel", Loc ["STRING_OPTIONS_SAVELOAD_PNAME"], "GameFontHighlightLeft")
frame3.saveStyleName:SetPoint ("left", frame3.saveSkinLabel, "right", 2)
- g:NewButton (frame3, _, "$parentSaveStyleButton", "saveStyle", 50, 18, saveStyleFunc, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_SAVE"])
- frame3.saveStyle:InstallCustomTexture()
+ g:NewButton (frame3, _, "$parentSaveStyleButton", "saveStyle", 50, 18, saveStyleFunc, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_SAVE"], nil, options_button_template)
+ --frame3.saveStyle:InstallCustomTexture()
window:CreateLineBackground2 (frame3, "saveStyleName", "saveSkinLabel", Loc ["STRING_OPTIONS_SAVELOAD_CREATE_DESC"])
--> apply to all button
local applyToAll = function()
- local temp_preset = saveStyleFunc (true)
+ local temp_preset = saveStyleFunc (nil, nil, true)
local current_instance = _G.DetailsOptionsWindow.instance
for _, this_instance in ipairs (_detalhes.tabela_instancias) do
@@ -5103,7 +5066,7 @@ function window:CreateFrame3()
end
local makeDefault = function()
- local temp_preset = saveStyleFunc (true)
+ local temp_preset = saveStyleFunc (nil, nil, true)
_detalhes.standard_skin = temp_preset
_detalhes:Msg (Loc ["STRING_OPTIONS_SAVELOAD_STDSAVE"])
end
@@ -5111,12 +5074,12 @@ function window:CreateFrame3()
g:NewLabel (frame3, _, "$parentToAllStyleLabel", "toAllStyleLabel", "", "GameFontHighlightLeft")
g:NewLabel (frame3, _, "$parentmakeDefaultLabel", "makeDefaultLabel", "", "GameFontHighlightLeft")
- g:NewButton (frame3, _, "$parentToAllStyleButton", "applyToAll", 160, 18, applyToAll, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_APPLYTOALL"], 1)
- frame3.applyToAll:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ g:NewButton (frame3, _, "$parentToAllStyleButton", "applyToAll", 160, 18, applyToAll, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_APPLYTOALL"], 1, options_button_template)
+ --frame3.applyToAll:InstallCustomTexture (nil, nil, nil, nil, nil, true)
window:CreateLineBackground2 (frame3, "applyToAll", "applyToAll", Loc ["STRING_OPTIONS_SAVELOAD_APPLYALL_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
- g:NewButton (frame3, _, "$parentMakeDefaultButton", "makeDefault", 160, 18, makeDefault, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_MAKEDEFAULT"])
- frame3.makeDefault:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ g:NewButton (frame3, _, "$parentMakeDefaultButton", "makeDefault", 160, 18, makeDefault, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_MAKEDEFAULT"], nil, options_button_template)
+ --frame3.makeDefault:InstallCustomTexture (nil, nil, nil, nil, nil, true)
window:CreateLineBackground2 (frame3, "makeDefault", "makeDefault", Loc ["STRING_OPTIONS_SAVELOAD_STD_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
frame3.toAllStyleLabel:SetPoint ("left", frame3.applyToAll, "left")
@@ -5203,12 +5166,8 @@ function window:CreateFrame3()
return loadtable
end
- local d = g:NewDropDown (frame3, _, "$parentCustomSkinLoadDropdown", "customSkinSelectDropdown", 160, dropdown_height, buildCustomSkinMenu, 0) -- func, default
+ local d = g:NewDropDown (frame3, _, "$parentCustomSkinLoadDropdown", "customSkinSelectDropdown", 160, dropdown_height, buildCustomSkinMenu, 0, options_dropdown_template)
d:SetEmptyTextAndIcon (Loc ["STRING_OPTIONS_SKIN_SELECT"])
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
frame3.customSkinSelectDropdown:SetPoint ("left", frame3.loadCustomSkinLabel, "right", 2, 0)
@@ -5235,12 +5194,9 @@ function window:CreateFrame3()
return loadtable2
end
- local d = g:NewDropDown (frame3, _, "$parentCustomSkinRemoveDropdown", "customSkinSelectToRemoveDropdown", 160, dropdown_height, buildCustomSkinToEraseMenu, 0) -- func, default
+ local d = g:NewDropDown (frame3, _, "$parentCustomSkinRemoveDropdown", "customSkinSelectToRemoveDropdown", 160, dropdown_height, buildCustomSkinToEraseMenu, 0, options_dropdown_template)
d:SetEmptyTextAndIcon (Loc ["STRING_OPTIONS_SKIN_SELECT"])
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+
frame3.customSkinSelectToRemoveDropdown:SetPoint ("left", frame3.removeCustomSkinLabel, "right", 2, 0)
@@ -5284,12 +5240,8 @@ function window:CreateFrame3()
return loadtable2
end
- local d = g:NewDropDown (frame3, _, "$parentCustomSkinExportDropdown", "CustomSkinSelectToExportDropdown", 160, dropdown_height, buildCustomSkinToExportMenu, 0)
+ local d = g:NewDropDown (frame3, _, "$parentCustomSkinExportDropdown", "CustomSkinSelectToExportDropdown", 160, dropdown_height, buildCustomSkinToExportMenu, 0, options_dropdown_template)
d:SetEmptyTextAndIcon (Loc ["STRING_OPTIONS_SKIN_SELECT"])
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
frame3.CustomSkinSelectToExportDropdown:SetPoint ("left", frame3.ExportCustomSkinLabel, "right", 2, 0)
@@ -5317,8 +5269,8 @@ function window:CreateFrame3()
end
- g:NewButton (frame3, _, "$parentImportButton", "ImportButton", 160, 18, import_saved, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_IMPORT"])
- frame3.ImportButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ g:NewButton (frame3, _, "$parentImportButton", "ImportButton", 160, 18, import_saved, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_IMPORT"], nil, options_button_template)
+ --frame3.ImportButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
frame3.ImportButton:SetIcon ([[Interface\Buttons\UI-GuildButton-PublicNote-Up]], 14, 14, nil, nil, nil, 4, 2)
frame3.ImportButton:SetTextColor (button_color_rgb)
@@ -5346,11 +5298,8 @@ function window:CreateFrame3()
end
-- skin
- local d = g:NewDropDown (frame3, _, "$parentPDWSkinDropdown", "PDWSkinDropdown", 160, dropdown_height, buildPDWSkinMenu, 1)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame3, _, "$parentPDWSkinDropdown", "PDWSkinDropdown", 160, dropdown_height, buildPDWSkinMenu, 1, options_dropdown_template)
+
g:NewLabel (frame3, _, "$parentPDWSkinLabel", "PDWSkinLabel", Loc ["STRING_OPTIONS_INSTANCE_SKIN"], "GameFontHighlightLeft")
window:CreateLineBackground2 (frame3, "PDWSkinDropdown", "PDWSkinLabel", Loc ["STRING_OPTIONS_PDW_SKIN_DESC"])
@@ -5360,10 +5309,11 @@ function window:CreateFrame3()
g:NewLabel (frame3, _, "$parentChatTabEmbedAnchor", "ChatTabEmbedAnchor", Loc ["STRING_OPTIONS_TABEMB_ANCHOR"], "GameFontNormal")
--> enabled
- g:NewSwitch (frame3, _, "$parentChatTabEmbedEnabledSlider", "ChatTabEmbedEnabledSlider", 60, 20, _, _, _detalhes.chat_tab_embed.enabled)
+ g:NewSwitch (frame3, _, "$parentChatTabEmbedEnabledSlider", "ChatTabEmbedEnabledSlider", 60, 20, _, _, _detalhes.chat_tab_embed.enabled, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame3, _, "$parentChatTabEmbedEnabledLabel", "ChatTabEmbedEnabledLabel", Loc ["STRING_ENABLED"], "GameFontHighlightLeft")
frame3.ChatTabEmbedEnabledSlider:SetPoint ("left", frame3.ChatTabEmbedEnabledLabel, "right", 2)
+ frame3.ChatTabEmbedEnabledSlider:SetAsCheckBox()
frame3.ChatTabEmbedEnabledSlider.OnSwitch = function (self, instance, value)
_detalhes.chat_embed:SetTabSettings (_, value)
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -5375,7 +5325,7 @@ function window:CreateFrame3()
local tab_on_press_enter = function (_, _, text)
_detalhes.chat_embed:SetTabSettings (text)
end
- local tabname = g:NewTextEntry (frame3, _, "$parentChatTabEmbedNameEntry", "ChatTabEmbedNameEntry", SLIDER_WIDTH, SLIDER_HEIGHT, tab_on_press_enter)
+ local tabname = g:NewTextEntry (frame3, _, "$parentChatTabEmbedNameEntry", "ChatTabEmbedNameEntry", SLIDER_WIDTH, TEXTENTRY_HEIGHT, tab_on_press_enter, nil, nil, nil, nil, options_dropdown_template)
g:NewLabel (frame3, _, "$parentChatTabEmbedNameLabel", "ChatTabEmbedNameLabel", Loc ["STRING_OPTIONS_TABEMB_TABNAME"], "GameFontHighlightLeft")
tabname:SetPoint ("left", frame3.ChatTabEmbedNameLabel, "right", 2)
@@ -5383,10 +5333,11 @@ function window:CreateFrame3()
tabname.text = _detalhes.chat_tab_embed.tab_name
--> one or two windows
- g:NewSwitch (frame3, _, "$parentChatTabEmbed2WindowsSlider", "ChatTabEmbed2WindowsSlider", 60, 20, _, _, _detalhes.chat_tab_embed.single_window)
+ g:NewSwitch (frame3, _, "$parentChatTabEmbed2WindowsSlider", "ChatTabEmbed2WindowsSlider", 60, 20, _, _, _detalhes.chat_tab_embed.single_window, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame3, _, "$parentChatTabEmbed2WindowsLabel", "ChatTabEmbed2WindowsLabel", Loc ["STRING_OPTIONS_TABEMB_SINGLE"], "GameFontHighlightLeft")
frame3.ChatTabEmbed2WindowsSlider:SetPoint ("left", frame3.ChatTabEmbed2WindowsLabel, "right", 2)
+ frame3.ChatTabEmbed2WindowsSlider:SetAsCheckBox()
frame3.ChatTabEmbed2WindowsSlider.OnSwitch = function (self, instance, value)
_detalhes.chat_embed:SetTabSettings (_, _, value)
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -5462,11 +5413,11 @@ function window:CreateFrame4()
--> bar height
g:NewLabel (frame4, _, "$parentRowHeightLabel", "rowHeightLabel", Loc ["STRING_OPTIONS_BAR_HEIGHT"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame4, _, "$parentSliderRowHeight", "rowHeightSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 10, 30, 1, tonumber (instance.row_info.height))
- config_slider (s)
+ local s = g:NewSlider (frame4, _, "$parentSliderRowHeight", "rowHeightSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 10, 30, 1, tonumber (instance.row_info.height), nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame4.rowHeightSlider:SetPoint ("left", frame4.rowHeightLabel, "right", 2)
- frame4.rowHeightSlider:SetThumbSize (50)
+ --frame4.rowHeightSlider:SetThumbSize (50)
frame4.rowHeightSlider:SetHook ("OnValueChange", function (self, instance, amount)
instance:SetBarSettings (amount)
@@ -5498,10 +5449,11 @@ function window:CreateFrame4()
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:NewSwitch (frame4, _, "$parentBarGrowDirectionSlider", "barGrowDirectionSlider", 80, 20, Loc ["STRING_BOTTOM"], Loc ["STRING_TOP"], instance.bars_grow_direction, nil, grow_switch_func, grow_return_func, nil, options_switch_template)
g:NewLabel (frame4, _, "$parentBarGrowDirectionLabel", "barGrowDirectionLabel", Loc ["STRING_OPTIONS_BARGROW_DIRECTION"], "GameFontHighlightLeft")
frame4.barGrowDirectionSlider:SetPoint ("left", frame4.barGrowDirectionLabel, "right", 2)
+ frame4.barGrowDirectionSlider:SetAsCheckBox()
frame4.barGrowDirectionSlider.OnSwitch = function (self, instance, value)
instance:SetBarGrowDirection (value)
@@ -5520,10 +5472,11 @@ function window:CreateFrame4()
-- 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:NewSwitch (frame4, _, "$parentBarSortDirectionSlider", "barSortDirectionSlider", 80, 20, Loc ["STRING_BOTTOM"], Loc ["STRING_TOP"], instance.bars_sort_direction, nil, grow_switch_func, grow_return_func, nil, options_switch_template)
g:NewLabel (frame4, _, "$parentBarSortDirectionLabel", "barSortDirectionLabel", Loc ["STRING_OPTIONS_BARSORT_DIRECTION"], "GameFontHighlightLeft")
frame4.barSortDirectionSlider:SetPoint ("left", frame4.barSortDirectionLabel, "right", 2)
+ frame4.barSortDirectionSlider:SetAsCheckBox()
frame4.barSortDirectionSlider.OnSwitch = function (self, instance, value)
instance.bars_sort_direction = value
@@ -5543,8 +5496,8 @@ function window:CreateFrame4()
-- spacement
g:NewLabel (frame4, _, "$parentBarSpacementLabel", "BarSpacementLabel", Loc ["STRING_OPTIONS_BAR_SPACING"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame4, _, "$parentBarSpacementSizeSlider", "BarSpacementSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0, 10, 1, instance.row_info.space.between)
- config_slider (s)
+ local s = g:NewSlider (frame4, _, "$parentBarSpacementSizeSlider", "BarSpacementSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0, 10, 1, instance.row_info.space.between, nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame4.BarSpacementSlider:SetPoint ("left", frame4.BarSpacementLabel, "right", 2)
frame4.BarSpacementSlider:SetHook ("OnValueChange", function (self, instancia, amount)
@@ -5598,11 +5551,8 @@ function window:CreateFrame4()
end
g:NewLabel (frame4, _, "$parentTextureLabel", "textureLabel", Loc ["STRING_TEXTURE"], "GameFontHighlightLeft")
- local d = g:NewDropDown (frame4, _, "$parentTextureDropdown", "textureDropdown", DROPDOWN_WIDTH, dropdown_height, buildTextureMenu, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame4, _, "$parentTextureDropdown", "textureDropdown", DROPDOWN_WIDTH, dropdown_height, buildTextureMenu, nil, options_dropdown_template)
+
frame4.textureDropdown:SetPoint ("left", frame4.textureLabel, "right", 2)
window:CreateLineBackground2 (frame4, "textureDropdown", "textureLabel", Loc ["STRING_OPTIONS_BAR_TEXTURE_DESC"])
@@ -5626,15 +5576,16 @@ function window:CreateFrame4()
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
g:NewLabel (frame4, _, "$parentRowColorPickLabel", "rowPickColorLabel", Loc ["STRING_COLOR"], "GameFontHighlightLeft")
- g:NewColorPickButton (frame4, "$parentRowColorPick", "rowColorPick", rowcolor_callback)
+ g:NewColorPickButton (frame4, "$parentRowColorPick", "rowColorPick", rowcolor_callback, nil, options_button_template)
frame4.rowColorPick:SetPoint ("left", frame4.rowPickColorLabel, "right", 2, 0)
local background = window:CreateLineBackground2 (frame4, "rowColorPick", "rowPickColorLabel", Loc ["STRING_OPTIONS_BAR_COLOR_DESC"])
background:SetSize (50, 16)
-- bar texture by class color
g:NewLabel (frame4, _, "$parentUseClassColorsLabel", "classColorsLabel", Loc ["STRING_OPTIONS_BAR_COLORBYCLASS"], "GameFontHighlightLeft")
- g:NewSwitch (frame4, _, "$parentClassColorSlider", "classColorSlider", 60, 20, _, _, instance.row_info.texture_class_colors)
+ g:NewSwitch (frame4, _, "$parentClassColorSlider", "classColorSlider", 60, 20, _, _, instance.row_info.texture_class_colors, nil, nil, nil, nil, options_switch_template)
frame4.classColorSlider:SetFrameLevel (frame4.rowColorPick:GetFrameLevel()+2)
+ frame4.classColorSlider:SetAsCheckBox()
frame4.classColorSlider:SetPoint ("left", frame4.classColorsLabel, "right", 2, -1)
frame4.classColorSlider.OnSwitch = function (self, instance, value)
instance:SetBarSettings (nil, nil, value)
@@ -5683,11 +5634,8 @@ function window:CreateFrame4()
end
g:NewLabel (frame4, _, "$parentRowBackgroundTextureLabel", "rowBackgroundLabel", Loc ["STRING_TEXTURE"], "GameFontHighlightLeft")
- local d = g:NewDropDown (frame4, _, "$parentRowBackgroundTextureDropdown", "rowBackgroundDropdown", DROPDOWN_WIDTH, dropdown_height, buildTextureMenu2, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame4, _, "$parentRowBackgroundTextureDropdown", "rowBackgroundDropdown", DROPDOWN_WIDTH, dropdown_height, buildTextureMenu2, nil, options_dropdown_template)
+
frame4.rowBackgroundDropdown:SetPoint ("left", frame4.rowBackgroundLabel, "right", 2)
window:CreateLineBackground2 (frame4, "rowBackgroundDropdown", "rowBackgroundLabel", Loc ["STRING_OPTIONS_BAR_BTEXTURE_DESC"])
@@ -5706,7 +5654,7 @@ function window:CreateFrame4()
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
- g:NewColorPickButton (frame4, "$parentRowBackgroundColorPick", "rowBackgroundColorPick", rowcolorbackground_callback)
+ g:NewColorPickButton (frame4, "$parentRowBackgroundColorPick", "rowBackgroundColorPick", rowcolorbackground_callback, nil, options_button_template)
g:NewLabel (frame4, _, "$parentRowBackgroundColorPickLabel", "rowBackgroundPickLabel", Loc ["STRING_COLOR"], "GameFontHighlightLeft")
frame4.rowBackgroundColorPick:SetPoint ("left", frame4.rowBackgroundPickLabel, "right", 2, 0)
@@ -5714,9 +5662,10 @@ function window:CreateFrame4()
background:SetSize (50, 16)
--bar texture by class color
- g:NewSwitch (frame4, _, "$parentBackgroundClassColorSlider", "rowBackgroundColorByClassSlider", 60, 20, _, _, instance.row_info.texture_background_class_color)
+ g:NewSwitch (frame4, _, "$parentBackgroundClassColorSlider", "rowBackgroundColorByClassSlider", 60, 20, _, _, instance.row_info.texture_background_class_color, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame4, _, "$parentRowBackgroundClassColorLabel", "rowBackgroundColorByClassLabel", Loc ["STRING_OPTIONS_BAR_COLORBYCLASS"], "GameFontHighlightLeft")
frame4.rowBackgroundColorByClassSlider:SetFrameLevel (frame4.rowBackgroundColorPick:GetFrameLevel()+2)
+ frame4.rowBackgroundColorByClassSlider:SetAsCheckBox()
frame4.rowBackgroundColorByClassSlider:SetPoint ("left", frame4.rowBackgroundColorByClassLabel, "right", 2)
frame4.rowBackgroundColorByClassSlider.OnSwitch = function (self, instance, value)
instance:SetBarSettings (nil, nil, nil, nil, nil, value)
@@ -5744,7 +5693,7 @@ function window:CreateFrame4()
--> icon file
--> textbox
- g:NewTextEntry (frame4, _, "$parentIconFileEntry", "iconFileEntry", 180, 20)
+ g:NewTextEntry (frame4, _, "$parentIconFileEntry", "iconFileEntry", 180, TEXTENTRY_HEIGHT, nil, nil, nil, nil, nil, options_dropdown_template)
g:NewLabel (frame4, _, "$parentIconFileLabel", "iconFileLabel", Loc ["STRING_OPTIONS_BAR_ICONFILE"], "GameFontHighlightLeft")
g:NewLabel (frame4, _, "$parentIconFileLabel2", "iconFileLabel2", "", "GameFontHighlightLeft")
@@ -5811,11 +5760,7 @@ function window:CreateFrame4()
default = instance.row_info.icon_file
end
- local d = g:NewDropDown (frame4, _, "$parentIconSelectDropdown", "IconSelectDropdown", DROPDOWN_WIDTH, dropdown_height, BuiltIconList, default)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame4, _, "$parentIconSelectDropdown", "IconSelectDropdown", DROPDOWN_WIDTH, dropdown_height, BuiltIconList, default, options_dropdown_template)
d:SetPoint ("left", frame4.iconFileLabel, "right", 2)
window:CreateLineBackground2 (frame4, "IconSelectDropdown", "iconFileLabel", Loc ["STRING_OPTIONS_BAR_ICONFILE_DESC2"])
@@ -5897,9 +5842,10 @@ function window:CreateFrame4()
frame4.noIconButton.tooltip = "Clear icon file / Restore default"
--> bar start at
- g:NewSwitch (frame4, _, "$parentBarStartSlider", "barStartSlider", 60, 20, nil, nil, instance.row_info.start_after_icon)
+ g:NewSwitch (frame4, _, "$parentBarStartSlider", "barStartSlider", 60, 20, nil, nil, instance.row_info.start_after_icon, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame4, _, "$parentBarStartLabel", "barStartLabel", Loc ["STRING_OPTIONS_BARSTART"], "GameFontHighlightLeft")
+ frame4.barStartSlider:SetAsCheckBox()
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)
@@ -5923,8 +5869,9 @@ function window:CreateFrame4()
--enabled
g:NewLabel (frame4, _, "$parentBackdropEnabledLabel", "BackdropEnabledLabel", Loc ["STRING_ENABLED"], "GameFontHighlightLeft")
- g:NewSwitch (frame4, _, "$parentBackdropEnabledSlider", "BackdropEnabledSlider", 60, 20, _, _, instance.row_info.backdrop.enabled)
+ g:NewSwitch (frame4, _, "$parentBackdropEnabledSlider", "BackdropEnabledSlider", 60, 20, _, _, instance.row_info.backdrop.enabled, nil, nil, nil, nil, options_switch_template)
frame4.BackdropEnabledSlider:SetPoint ("left", frame4.BackdropEnabledLabel, "right", 2, -1)
+ frame4.BackdropEnabledSlider:SetAsCheckBox()
frame4.BackdropEnabledSlider.OnSwitch = function (self, instance, value)
instance:SetBarBackdropSettings (value)
@@ -5967,22 +5914,18 @@ function window:CreateFrame4()
end
g:NewLabel (frame4, _, "$parentBackdropBorderTextureLabel", "BackdropBorderTextureLabel", Loc ["STRING_TEXTURE"], "GameFontHighlightLeft")
- local d = g:NewDropDown (frame4, _, "$parentBackdropBorderTextureDropdown", "BackdropBorderTextureDropdown", DROPDOWN_WIDTH, dropdown_height, buildTextureBackdropMenu, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame4, _, "$parentBackdropBorderTextureDropdown", "BackdropBorderTextureDropdown", DROPDOWN_WIDTH, dropdown_height, buildTextureBackdropMenu, nil, options_dropdown_template)
frame4.BackdropBorderTextureDropdown:SetPoint ("left", frame4.BackdropBorderTextureLabel, "right", 2)
window:CreateLineBackground2 (frame4, "BackdropBorderTextureDropdown", "BackdropBorderTextureLabel", Loc ["STRING_OPTIONS_BAR_BACKDROP_TEXTURE_DESC"])
--size
g:NewLabel (frame4, _, "$parentBackdropSizeLabel", "BackdropSizeLabel", Loc ["STRING_OPTIONS_SIZE"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame4, _, "$parentBackdropSizeHeight", "BackdropSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 20, 1, tonumber (instance.row_info.height))
- config_slider (s)
+ local s = g:NewSlider (frame4, _, "$parentBackdropSizeHeight", "BackdropSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 20, 1, tonumber (instance.row_info.height), nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame4.BackdropSizeSlider:SetPoint ("left", frame4.BackdropSizeLabel, "right", 2)
- frame4.BackdropSizeSlider:SetThumbSize (50)
+ --frame4.BackdropSizeSlider:SetThumbSize (50)
frame4.BackdropSizeSlider:SetHook ("OnValueChange", function (self, instance, amount)
instance:SetBarBackdropSettings (nil, amount)
@@ -6012,7 +5955,7 @@ function window:CreateFrame4()
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
- g:NewColorPickButton (frame4, "$parentBackdropColorPick", "BackdropColorPick", backdropcolor_callback)
+ g:NewColorPickButton (frame4, "$parentBackdropColorPick", "BackdropColorPick", backdropcolor_callback, nil, options_button_template)
g:NewLabel (frame4, _, "$parentBackdropColorLabel", "BackdropColorLabel", Loc ["STRING_COLOR"], "GameFontHighlightLeft")
frame4.BackdropColorPick:SetPoint ("left", frame4.BackdropColorLabel, "right", 2, 0)
@@ -6092,19 +6035,19 @@ function window:CreateFrame5()
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
- g:NewColorPickButton (frame5, "$parentFixedTextColor", "fixedTextColor", textcolor_callback, false)
+ g:NewColorPickButton (frame5, "$parentFixedTextColor", "fixedTextColor", textcolor_callback, false, options_button_template)
local fixedColorText = g:NewLabel (frame5, _, "$parentFixedTextColorLabel", "fixedTextColorLabel", Loc ["STRING_OPTIONS_TEXT_FIXEDCOLOR"], "GameFontHighlightLeft")
frame5.fixedTextColor:SetPoint ("left", fixedColorText, "right", 2, 0)
window:CreateLineBackground2 (frame5, "fixedTextColor", "fixedTextColorLabel", Loc ["STRING_OPTIONS_TEXT_FIXEDCOLOR_DESC"])
--> text size
- local s = g:NewSlider (frame5, _, "$parentSliderFontSize", "fonsizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 5, 32, 1, tonumber (instance.row_info.font_size))
- config_slider (s)
+ local s = g:NewSlider (frame5, _, "$parentSliderFontSize", "fonsizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 5, 32, 1, tonumber (instance.row_info.font_size), nil, nil, nil, options_slider_template)
+ --config_slider (s)
g:NewLabel (frame5, _, "$parentFontSizeLabel", "fonsizeLabel", Loc ["STRING_OPTIONS_TEXT_SIZE"], "GameFontHighlightLeft")
frame5.fonsizeSlider:SetPoint ("left", frame5.fonsizeLabel, "right", 2)
- frame5.fonsizeSlider:SetThumbSize (50)
+ --frame5.fonsizeSlider:SetThumbSize (50)
frame5.fonsizeSlider:SetHook ("OnValueChange", function (self, instance, amount)
instance:SetBarTextSettings (amount)
@@ -6147,11 +6090,7 @@ function window:CreateFrame5()
return fontTable
end
- local d = g:NewDropDown (frame5, _, "$parentFontDropdown", "fontDropdown", DROPDOWN_WIDTH, dropdown_height, buildFontMenu, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame5, _, "$parentFontDropdown", "fontDropdown", DROPDOWN_WIDTH, dropdown_height, buildFontMenu, nil, options_dropdown_template)
g:NewLabel (frame5, _, "$parentFontLabel", "fontLabel", Loc ["STRING_OPTIONS_TEXT_FONT"], "GameFontHighlightLeft")
frame5.fontDropdown:SetPoint ("left", frame5.fontLabel, "right", 2)
@@ -6159,11 +6098,13 @@ function window:CreateFrame5()
window:CreateLineBackground2 (frame5, "fontDropdown", "fontLabel", Loc ["STRING_OPTIONS_TEXT_FONT_DESC"])
--> left text and right class color
- g:NewSwitch (frame5, _, "$parentUseClassColorsLeftTextSlider", "classColorsLeftTextSlider", 60, 20, _, _, instance.row_info.textL_class_colors)
- g:NewSwitch (frame5, _, "$parentUseClassColorsRightTextSlider", "classColorsRightTextSlider", 60, 20, _, _, instance.row_info.textR_class_colors)
+ g:NewSwitch (frame5, _, "$parentUseClassColorsLeftTextSlider", "classColorsLeftTextSlider", 60, 20, _, _, instance.row_info.textL_class_colors, nil, nil, nil, nil, options_switch_template)
+ g:NewSwitch (frame5, _, "$parentUseClassColorsRightTextSlider", "classColorsRightTextSlider", 60, 20, _, _, instance.row_info.textR_class_colors, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame5, _, "$parentUseClassColorsLeftText", "classColorsLeftTextLabel", Loc ["STRING_OPTIONS_BAR_COLORBYCLASS"], "GameFontHighlightLeft")
frame5.classColorsLeftTextSlider:SetPoint ("left", frame5.classColorsLeftTextLabel, "right", 2)
+ frame5.classColorsRightTextSlider:SetAsCheckBox()
+ frame5.classColorsLeftTextSlider:SetAsCheckBox()
frame5.classColorsLeftTextSlider.OnSwitch = function (self, instance, value)
instance:SetBarTextSettings (nil, nil, nil, value)
@@ -6201,10 +6142,11 @@ function window:CreateFrame5()
window:CreateLineBackground2 (frame5, "classColorsRightTextSlider", "classColorsRightTextLabel", Loc ["STRING_OPTIONS_TEXT_LCLASSCOLOR_DESC"])
--> left outline
- g:NewSwitch (frame5, _, "$parentTextLeftOutlineSlider", "textLeftOutlineSlider", 60, 20, _, _, instance.row_info.textL_outline)
+ g:NewSwitch (frame5, _, "$parentTextLeftOutlineSlider", "textLeftOutlineSlider", 60, 20, _, _, instance.row_info.textL_outline, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame5, _, "$parentTextLeftOutlineLabel", "textLeftOutlineLabel", Loc ["STRING_OPTIONS_TEXT_LOUTILINE"], "GameFontHighlightLeft")
frame5.textLeftOutlineSlider:SetPoint ("left", frame5.textLeftOutlineLabel, "right", 2)
+ frame5.textLeftOutlineSlider:SetAsCheckBox()
frame5.textLeftOutlineSlider.OnSwitch = function (self, instance, value)
instance:SetBarTextSettings (nil, nil, nil, nil, nil, value)
@@ -6222,10 +6164,11 @@ function window:CreateFrame5()
window:CreateLineBackground2 (frame5, "textLeftOutlineSlider", "textLeftOutlineLabel", Loc ["STRING_OPTIONS_TEXT_LOUTILINE_DESC"])
--> left show positio number
- g:NewSwitch (frame5, _, "$parentPositionNumberSlider", "PositionNumberSlider", 60, 20, _, _, instance.row_info.textL_show_number)
+ g:NewSwitch (frame5, _, "$parentPositionNumberSlider", "PositionNumberSlider", 60, 20, _, _, instance.row_info.textL_show_number, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame5, _, "$parentPositionNumberLabel", "PositionNumberLabel", Loc ["STRING_OPTIONS_TEXT_LPOSITION"], "GameFontHighlightLeft")
frame5.PositionNumberSlider:SetPoint ("left", frame5.PositionNumberLabel, "right", 2)
+ frame5.PositionNumberSlider:SetAsCheckBox()
frame5.PositionNumberSlider.OnSwitch = function (self, instance, value)
instance:SetBarTextSettings (nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value)
@@ -6243,10 +6186,11 @@ function window:CreateFrame5()
window:CreateLineBackground2 (frame5, "PositionNumberSlider", "PositionNumberLabel", Loc ["STRING_OPTIONS_TEXT_LPOSITION_DESC"])
--> right outline
- g:NewSwitch (frame5, _, "$parentTextRightOutlineSlider", "textRightOutlineSlider", 60, 20, _, _, instance.row_info.textR_outline)
+ g:NewSwitch (frame5, _, "$parentTextRightOutlineSlider", "textRightOutlineSlider", 60, 20, _, _, instance.row_info.textR_outline, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame5, _, "$parentTextRightOutlineLabel", "textRightOutlineLabel", Loc ["STRING_OPTIONS_TEXT_LOUTILINE"], "GameFontHighlightLeft")
frame5.textRightOutlineSlider:SetPoint ("left", frame5.textRightOutlineLabel, "right", 2)
+ frame5.textRightOutlineSlider:SetAsCheckBox()
frame5.textRightOutlineSlider.OnSwitch = function (self, instance, value)
instance:SetBarTextSettings (nil, nil, nil, nil, nil, nil, value)
@@ -6286,11 +6230,7 @@ function window:CreateFrame5()
return percentTable
end
- local d = g:NewDropDown (frame5, _, "$parentPercentDropdown", "percentDropdown", DROPDOWN_WIDTH, dropdown_height, buildPercentMenu, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame5, _, "$parentPercentDropdown", "percentDropdown", DROPDOWN_WIDTH, dropdown_height, buildPercentMenu, nil, options_dropdown_template)
g:NewLabel (frame5, _, "$parentPercentLabel", "percentLabel", Loc ["STRING_OPTIONS_PERCENT_TYPE"], "GameFontHighlightLeft")
frame5.percentDropdown:SetPoint ("left", frame5.percentLabel, "right", 2)
@@ -6300,9 +6240,10 @@ function window:CreateFrame5()
--> right text customization
g:NewLabel (frame5, _, "$parentCutomRightTextLabel", "cutomRightTextLabel", Loc ["STRING_OPTIONS_BARRIGHTTEXTCUSTOM"], "GameFontHighlightLeft")
- g:NewSwitch (frame5, _, "$parentCutomRightTextSlider", "cutomRightTextSlider", 60, 20, _, _, instance.row_info.textR_enable_custom_text)
+ g:NewSwitch (frame5, _, "$parentCutomRightTextSlider", "cutomRightTextSlider", 60, 20, _, _, instance.row_info.textR_enable_custom_text, nil, nil, nil, nil, options_switch_template)
frame5.cutomRightTextSlider:SetPoint ("left", frame5.cutomRightTextLabel, "right", 2)
+ frame5.cutomRightTextSlider:SetAsCheckBox()
frame5.cutomRightTextSlider.OnSwitch = function (self, instance, value)
instance:SetBarTextSettings (nil, nil, nil, nil, nil, nil, nil, value)
@@ -6321,7 +6262,7 @@ function window:CreateFrame5()
--text entry
g:NewLabel (frame5, _, "$parentCutomRightText2Label", "cutomRightTextEntryLabel", Loc ["STRING_OPTIONS_BARRIGHTTEXTCUSTOM2"], "GameFontHighlightLeft")
- g:NewTextEntry (frame5, _, "$parentCutomRightTextEntry", "cutomRightTextEntry", 180, 20)
+ g:NewTextEntry (frame5, _, "$parentCutomRightTextEntry", "cutomRightTextEntry", 180, TEXTENTRY_HEIGHT, nil, nil, nil, nil, nil, options_dropdown_template)
frame5.cutomRightTextEntry:SetPoint ("left", frame5.cutomRightTextEntryLabel, "right", 2, -1)
frame5.cutomRightTextEntry:SetHook ("OnTextChanged", function (self, byUser)
@@ -6423,9 +6364,10 @@ function window:CreateFrame5()
--> left text customization
g:NewLabel (frame5, _, "$parentCutomLeftTextLabel", "cutomLeftTextLabel", Loc ["STRING_OPTIONS_BARLEFTTEXTCUSTOM"], "GameFontHighlightLeft")
- g:NewSwitch (frame5, _, "$parentCutomLeftTextSlider", "cutomLeftTextSlider", 60, 20, _, _, instance.row_info.textL_enable_custom_text)
+ g:NewSwitch (frame5, _, "$parentCutomLeftTextSlider", "cutomLeftTextSlider", 60, 20, _, _, instance.row_info.textL_enable_custom_text, nil, nil, nil, nil, options_switch_template)
frame5.cutomLeftTextSlider:SetPoint ("left", frame5.cutomLeftTextLabel, "right", 2)
+ frame5.cutomLeftTextSlider:SetAsCheckBox()
frame5.cutomLeftTextSlider.OnSwitch = function (self, instance, value)
local instance = _G.DetailsOptionsWindow.instance
instance:SetBarTextSettings (nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value)
@@ -6445,7 +6387,7 @@ function window:CreateFrame5()
--text entry
g:NewLabel (frame5, _, "$parentCutomLeftText2Label", "cutomLeftTextEntryLabel", Loc ["STRING_OPTIONS_BARLEFTTEXTCUSTOM2"], "GameFontHighlightLeft")
- g:NewTextEntry (frame5, _, "$parentCutomLeftTextEntry", "cutomLeftTextEntry", 180, 20)
+ g:NewTextEntry (frame5, _, "$parentCutomLeftTextEntry", "cutomLeftTextEntry", 180, TEXTENTRY_HEIGHT, nil, nil, nil, nil, nil, options_dropdown_template)
frame5.cutomLeftTextEntry:SetPoint ("left", frame5.cutomLeftTextEntryLabel, "right", 2, -1)
frame5.cutomLeftTextEntry:SetHook ("OnTextChanged", function (self, byUser)
@@ -6547,10 +6489,11 @@ function window:CreateFrame5()
--> total dps percent bracket separator
-- total
- g:NewSwitch (frame5, _, "$parentRightTextShowTotalSlider", "RightTextShowTotalSlider", 60, 20, _, _, instance.row_info.textR_show_data [1])
+ g:NewSwitch (frame5, _, "$parentRightTextShowTotalSlider", "RightTextShowTotalSlider", 60, 20, _, _, instance.row_info.textR_show_data [1], nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame5, _, "$parentRightTextShowTotalLabel", "RightTextShowTotalLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_TOTAL"], "GameFontHighlightLeft")
frame5.RightTextShowTotalSlider:SetPoint ("left", frame5.RightTextShowTotalLabel, "right", 2)
+ frame5.RightTextShowTotalSlider:SetAsCheckBox()
frame5.RightTextShowTotalSlider.OnSwitch = function (self, instance, value)
instance:SetBarRightTextSettings (value)
@@ -6568,10 +6511,11 @@ function window:CreateFrame5()
window:CreateLineBackground2 (frame5, "RightTextShowTotalSlider", "RightTextShowTotalLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_TOTAL_DESC"])
-- ps
- g:NewSwitch (frame5, _, "$parentRightTextShowPSSlider", "RightTextShowPSSlider", 60, 20, _, _, instance.row_info.textR_show_data [2])
+ g:NewSwitch (frame5, _, "$parentRightTextShowPSSlider", "RightTextShowPSSlider", 60, 20, _, _, instance.row_info.textR_show_data [2], nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame5, _, "$parentRightTextShowPSLabel", "RightTextShowPSLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_PS"], "GameFontHighlightLeft")
frame5.RightTextShowPSSlider:SetPoint ("left", frame5.RightTextShowPSLabel, "right", 2)
+ frame5.RightTextShowPSSlider:SetAsCheckBox()
frame5.RightTextShowPSSlider.OnSwitch = function (self, instance, value)
instance:SetBarRightTextSettings (nil, value)
@@ -6590,10 +6534,11 @@ function window:CreateFrame5()
-- percent
- g:NewSwitch (frame5, _, "$parentRightTextShowPercentSlider", "RightTextShowPercentSlider", 60, 20, _, _, instance.row_info.textR_show_data [3])
+ g:NewSwitch (frame5, _, "$parentRightTextShowPercentSlider", "RightTextShowPercentSlider", 60, 20, _, _, instance.row_info.textR_show_data [3], nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame5, _, "$parentRightTextShowPercentLabel", "RightTextShowPercentLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_PERCENT"], "GameFontHighlightLeft")
frame5.RightTextShowPercentSlider:SetPoint ("left", frame5.RightTextShowPercentLabel, "right", 2)
+ frame5.RightTextShowPercentSlider:SetAsCheckBox()
frame5.RightTextShowPercentSlider.OnSwitch = function (self, instance, value)
instance:SetBarRightTextSettings (nil, nil, value)
@@ -6636,11 +6581,8 @@ function window:CreateFrame5()
return BracketTable
end
- local d = g:NewDropDown (frame5, _, "$parentBracketDropdown", "BracketDropdown", 60, dropdown_height, buildBracketMenu, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame5, _, "$parentBracketDropdown", "BracketDropdown", 60, dropdown_height, buildBracketMenu, nil, options_dropdown_template)
+
g:NewLabel (frame5, _, "$parentBracketLabel", "BracketLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_BRACKET"], "GameFontHighlightLeft")
frame5.BracketDropdown:SetPoint ("left", frame5.BracketLabel, "right", 2)
@@ -6677,11 +6619,8 @@ function window:CreateFrame5()
return SeparatorTable
end
- local d = g:NewDropDown (frame5, _, "$parentSeparatorDropdown", "SeparatorDropdown", 60, dropdown_height, buildSeparatorMenu, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame5, _, "$parentSeparatorDropdown", "SeparatorDropdown", 60, dropdown_height, buildSeparatorMenu, nil, options_dropdown_template)
+
g:NewLabel (frame5, _, "$parentSeparatorLabel", "SeparatorLabel", Loc ["STRING_OPTIONS_TEXT_SHOW_SEPARATOR"], "GameFontHighlightLeft")
frame5.SeparatorDropdown:SetPoint ("left", frame5.SeparatorLabel, "right", 2)
@@ -6788,7 +6727,7 @@ function window:CreateFrame6()
_detalhes:SendOptionsModifiedEvent (instance)
end
- g:NewColorPickButton (frame6, "$parentWindowColorPick", "windowColorPick", windowcolor_callback)
+ g:NewColorPickButton (frame6, "$parentWindowColorPick", "windowColorPick", windowcolor_callback, nil, options_button_template)
g:NewLabel (frame6, _, "$parentWindowColorPickLabel", "windowPickColorLabel", Loc ["STRING_OPTIONS_INSTANCE_COLOR"], "GameFontHighlightLeft")
frame6.windowColorPick:SetPoint ("left", frame6.windowPickColorLabel, "right", 2, 0)
@@ -6813,7 +6752,7 @@ function window:CreateFrame6()
_detalhes:SendOptionsModifiedEvent (instance)
end
- g:NewColorPickButton (frame6, "$parentWindowBackgroundColorPick", "windowBackgroundColorPick", windowbackgroundcolor_callback)
+ g:NewColorPickButton (frame6, "$parentWindowBackgroundColorPick", "windowBackgroundColorPick", windowbackgroundcolor_callback, nil, options_button_template)
g:NewLabel (frame6, _, "$parentWindowBackgroundColorPickLabel", "windowBackgroundPickColorLabel", Loc ["STRING_OPTIONS_INSTANCE_ALPHA2"], "GameFontHighlightLeft")
frame6.windowBackgroundColorPick:SetPoint ("left", frame6.windowBackgroundPickColorLabel, "right", 2, 0)
@@ -6836,10 +6775,11 @@ function window:CreateFrame6()
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:NewSwitch (frame6, _, "$parentStretchAnchorSlider", "stretchAnchorSlider", 80, 20, Loc ["STRING_BOTTOM"], Loc ["STRING_TOP"], instance.toolbar_side, nil, grow_switch_func, grow_return_func, nil, options_switch_template)
g:NewLabel (frame6, _, "$parentStretchAnchorLabel", "stretchAnchorLabel", Loc ["STRING_OPTIONS_STRETCH"], "GameFontHighlightLeft")
frame6.stretchAnchorSlider:SetPoint ("left", frame6.stretchAnchorLabel, "right", 2)
+ frame6.stretchAnchorSlider:SetAsCheckBox()
frame6.stretchAnchorSlider.OnSwitch = function (self, instance, value)
instance:StretchButtonAnchor (value)
@@ -6858,10 +6798,11 @@ function window:CreateFrame6()
window:CreateLineBackground2 (frame6, "stretchAnchorSlider", "stretchAnchorLabel", Loc ["STRING_OPTIONS_STRETCH_DESC"])
--> stretch button always on top
- g:NewSwitch (frame6, _, "$parentStretchAlwaysOnTopSlider", "stretchAlwaysOnTopSlider", 60, 20, _, _, instance.grab_on_top)
+ g:NewSwitch (frame6, _, "$parentStretchAlwaysOnTopSlider", "stretchAlwaysOnTopSlider", 60, 20, _, _, instance.grab_on_top, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame6, _, "$parentStretchAlwaysOnTopLabel", "stretchAlwaysOnTopLabel", Loc ["STRING_OPTIONS_STRETCHTOP"], "GameFontHighlightLeft")
frame6.stretchAlwaysOnTopSlider:SetPoint ("left", frame6.stretchAlwaysOnTopLabel, "right", 2, 0)
+ frame6.stretchAlwaysOnTopSlider:SetAsCheckBox()
frame6.stretchAlwaysOnTopSlider.OnSwitch = function (self, instance, value)
instance:StretchButtonAlwaysOnTop (value)
@@ -6880,10 +6821,11 @@ function window:CreateFrame6()
window:CreateLineBackground2 (frame6, "stretchAlwaysOnTopSlider", "stretchAlwaysOnTopLabel", Loc ["STRING_OPTIONS_STRETCHTOP_DESC"])
--> 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:NewSwitch (frame6, _, "$parentInstanceToolbarSideSlider", "instanceToolbarSideSlider", 80, 20, Loc ["STRING_BOTTOM"], Loc ["STRING_TOP"], instance.toolbar_side, nil, grow_switch_func, grow_return_func, nil, options_switch_template)
g:NewLabel (frame6, _, "$parentInstanceToolbarSideLabel", "instanceToolbarSideLabel", Loc ["STRING_OPTIONS_TOOLBARSIDE"], "GameFontHighlightLeft")
frame6.instanceToolbarSideSlider:SetPoint ("left", frame6.instanceToolbarSideLabel, "right", 2)
+ frame6.instanceToolbarSideSlider:SetAsCheckBox()
frame6.instanceToolbarSideSlider.OnSwitch = function (self, instance, value)
instance:ToolbarSide (value)
@@ -6907,10 +6849,11 @@ function window:CreateFrame6()
window:CreateLineBackground2 (frame6, "instanceToolbarSideSlider", "instanceToolbarSideLabel", Loc ["STRING_OPTIONS_TOOLBARSIDE_DESC"])
--> micro displays side
- g:NewSwitch (frame6, _, "$parentInstanceMicroDisplaysSideSlider", "instanceMicroDisplaysSideSlider", 80, 20, Loc ["STRING_BOTTOM"], Loc ["STRING_TOP"], instance.toolbar_side, nil, grow_switch_func, grow_return_func)
+ g:NewSwitch (frame6, _, "$parentInstanceMicroDisplaysSideSlider", "instanceMicroDisplaysSideSlider", 80, 20, Loc ["STRING_BOTTOM"], Loc ["STRING_TOP"], instance.toolbar_side, nil, grow_switch_func, grow_return_func, nil, options_switch_template)
g:NewLabel (frame6, _, "$parentInstanceMicroDisplaysSideLabel", "instanceMicroDisplaysSideLabel", Loc ["STRING_OPTIONS_MICRODISPLAYSSIDE"], "GameFontHighlightLeft")
frame6.instanceMicroDisplaysSideSlider:SetPoint ("left", frame6.instanceMicroDisplaysSideLabel, "right", 2)
+ frame6.instanceMicroDisplaysSideSlider:SetAsCheckBox()
frame6.instanceMicroDisplaysSideSlider.OnSwitch = function (self, instance, value)
instance:MicroDisplaysSide (value, true)
window:update_microframes()
@@ -6977,23 +6920,14 @@ function window:CreateFrame6()
return options
end
- local d = g:NewDropDown (frame6, _, "$parentMicroDisplayLeftDropdown", "MicroDisplayLeftDropdown", DROPDOWN_WIDTH, dropdown_height, BuildLeftMicroMenu, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame6, _, "$parentMicroDisplayLeftDropdown", "MicroDisplayLeftDropdown", DROPDOWN_WIDTH, dropdown_height, BuildLeftMicroMenu, nil, options_dropdown_template)
+
- local d = g:NewDropDown (frame6, _, "$parentMicroDisplayCenterDropdown", "MicroDisplayCenterDropdown", DROPDOWN_WIDTH, dropdown_height, BuildCenterMicroMenu, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame6, _, "$parentMicroDisplayCenterDropdown", "MicroDisplayCenterDropdown", DROPDOWN_WIDTH, dropdown_height, BuildCenterMicroMenu, nil, options_dropdown_template)
+
- local d = g:NewDropDown (frame6, _, "$parentMicroDisplayRightDropdown", "MicroDisplayRightDropdown", DROPDOWN_WIDTH, dropdown_height, BuildRightMicroMenu, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame6, _, "$parentMicroDisplayRightDropdown", "MicroDisplayRightDropdown", DROPDOWN_WIDTH, dropdown_height, BuildRightMicroMenu, nil, options_dropdown_template)
+
frame6.MicroDisplayLeftDropdown:SetPoint ("left", frame6.MicroDisplayLeftLabel, "right", 2)
frame6.MicroDisplayCenterDropdown:SetPoint ("left", frame6.MicroDisplayCenterLabel, "right", 2)
@@ -7003,7 +6937,7 @@ function window:CreateFrame6()
window:CreateLineBackground2 (frame6, "MicroDisplayCenterDropdown", "MicroDisplayCenterLabel", Loc ["STRING_OPTIONS_MICRODISPLAYS_DROPDOWN_TOOLTIP"])
window:CreateLineBackground2 (frame6, "MicroDisplayRightDropdown", "MicroDisplayRightLabel", Loc ["STRING_OPTIONS_MICRODISPLAYS_DROPDOWN_TOOLTIP"])
- local HideLeftMicroFrameButton = g:NewButton (frame6.MicroDisplayLeftDropdown, _, "$parentHideLeftMicroFrameButton", "HideLeftMicroFrameButton", 22, 22, function (_, _, self)
+ local HideLeftMicroFrameButton = g:NewButton (frame6.MicroDisplayLeftDropdown, _, "$parentHideLeftMicroFrameButton", "HideLeftMicroFrameButton", 22, 22, function (self, button)
if (_G.DetailsOptionsWindow.instance.StatusBar ["left"].options.isHidden) then
_detalhes.StatusBar:SetPlugin (_G.DetailsOptionsWindow.instance, _G.DetailsOptionsWindow.instance.StatusBar ["left"].real_name, "left")
else
@@ -7028,7 +6962,7 @@ function window:CreateFrame6()
self:GetNormalTexture():SetBlendMode("BLEND")
end)
- local HideCenterMicroFrameButton = g:NewButton (frame6.MicroDisplayCenterDropdown, _, "$parentHideCenterMicroFrameButton", "HideCenterMicroFrameButton", 22, 22, function (_, _, self)
+ local HideCenterMicroFrameButton = g:NewButton (frame6.MicroDisplayCenterDropdown, _, "$parentHideCenterMicroFrameButton", "HideCenterMicroFrameButton", 22, 22, function (self)
if (_G.DetailsOptionsWindow.instance.StatusBar ["center"].options.isHidden) then
_detalhes.StatusBar:SetPlugin (_G.DetailsOptionsWindow.instance, _G.DetailsOptionsWindow.instance.StatusBar ["center"].real_name, "center")
else
@@ -7054,7 +6988,7 @@ function window:CreateFrame6()
self:GetNormalTexture():SetBlendMode("BLEND")
end)
- local HideRightMicroFrameButton = g:NewButton (frame6.MicroDisplayRightDropdown, _, "$parentHideRightMicroFrameButton", "HideRightMicroFrameButton", 20, 20, function (_, _, self)
+ local HideRightMicroFrameButton = g:NewButton (frame6.MicroDisplayRightDropdown, _, "$parentHideRightMicroFrameButton", "HideRightMicroFrameButton", 20, 20, function (self)
if (_G.DetailsOptionsWindow.instance.StatusBar ["right"].options.isHidden) then
_detalhes.StatusBar:SetPlugin (_G.DetailsOptionsWindow.instance, _G.DetailsOptionsWindow.instance.StatusBar ["right"].real_name, "right")
else
@@ -7081,7 +7015,7 @@ function window:CreateFrame6()
-------------
- local ConfigRightMicroFrameButton = g:NewButton (frame6.MicroDisplayRightDropdown, _, "$parentConfigRightMicroFrameButton", "ConfigRightMicroFrameButton", 18, 18, function (_, _, self)
+ local ConfigRightMicroFrameButton = g:NewButton (frame6.MicroDisplayRightDropdown, _, "$parentConfigRightMicroFrameButton", "ConfigRightMicroFrameButton", 18, 18, function (self)
_G.DetailsOptionsWindow.instance.StatusBar ["right"]:Setup()
_G.DetailsOptionsWindow.instance.StatusBar ["right"]:Setup()
end)
@@ -7090,7 +7024,7 @@ function window:CreateFrame6()
ConfigRightMicroFrameButton:SetHighlightTexture ([[Interface\Buttons\UI-OptionsButton]])
ConfigRightMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_OPTION_TOOLTIP"]
- local ConfigCenterMicroFrameButton = g:NewButton (frame6.MicroDisplayCenterDropdown, _, "$parentConfigCenterMicroFrameButton", "ConfigCenterMicroFrameButton", 18, 18, function (_, _, self)
+ local ConfigCenterMicroFrameButton = g:NewButton (frame6.MicroDisplayCenterDropdown, _, "$parentConfigCenterMicroFrameButton", "ConfigCenterMicroFrameButton", 18, 18, function (self)
_G.DetailsOptionsWindow.instance.StatusBar ["center"]:Setup()
_G.DetailsOptionsWindow.instance.StatusBar ["center"]:Setup()
end)
@@ -7099,7 +7033,7 @@ function window:CreateFrame6()
ConfigCenterMicroFrameButton:SetHighlightTexture ([[Interface\Buttons\UI-OptionsButton]])
ConfigCenterMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_OPTION_TOOLTIP"]
- local ConfigLeftMicroFrameButton = g:NewButton (frame6.MicroDisplayLeftDropdown, _, "$parentConfigLeftMicroFrameButton", "ConfigLeftMicroFrameButton", 18, 18, function (_, _, self)
+ local ConfigLeftMicroFrameButton = g:NewButton (frame6.MicroDisplayLeftDropdown, _, "$parentConfigLeftMicroFrameButton", "ConfigLeftMicroFrameButton", 18, 18, function (self)
_G.DetailsOptionsWindow.instance.StatusBar ["left"]:Setup()
_G.DetailsOptionsWindow.instance.StatusBar ["left"]:Setup()
end)
@@ -7109,10 +7043,11 @@ function window:CreateFrame6()
ConfigLeftMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_OPTION_TOOLTIP"]
--> lock mini displays
- g:NewSwitch (frame6, _, "$parentLockMiniDisplaysSlider", "LockMiniDisplaysSlider", 60, 20, _, _, instance.micro_displays_locked)
+ g:NewSwitch (frame6, _, "$parentLockMiniDisplaysSlider", "LockMiniDisplaysSlider", 60, 20, _, _, instance.micro_displays_locked, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame6, _, "$parentLockMiniDisplaysLabel", "LockMiniDisplaysLabel", Loc ["STRING_OPTIONS_MICRODISPLAY_LOCK"], "GameFontHighlightLeft")
frame6.LockMiniDisplaysSlider:SetPoint ("left", frame6.LockMiniDisplaysLabel, "right", 2)
+ frame6.LockMiniDisplaysSlider:SetAsCheckBox()
frame6.LockMiniDisplaysSlider.OnSwitch = function (self, instance, value)
instance:MicroDisplaysLock (value)
@@ -7130,10 +7065,11 @@ function window:CreateFrame6()
window:CreateLineBackground2 (frame6, "LockMiniDisplaysSlider", "LockMiniDisplaysLabel", Loc ["STRING_OPTIONS_MICRODISPLAY_LOCK_DESC"])
--> sidebars
- g:NewSwitch (frame6, _, "$parentSideBarsSlider", "sideBarsSlider", 60, 20, _, _, instance.show_sidebars)
+ g:NewSwitch (frame6, _, "$parentSideBarsSlider", "sideBarsSlider", 60, 20, _, _, instance.show_sidebars, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame6, _, "$parentSideBarsLabel", "sideBarsLabel", Loc ["STRING_OPTIONS_SHOW_SIDEBARS"], "GameFontHighlightLeft")
frame6.sideBarsSlider:SetPoint ("left", frame6.sideBarsLabel, "right", 2)
+ frame6.sideBarsSlider:SetAsCheckBox()
frame6.sideBarsSlider.OnSwitch = function (self, instance, value)
if (value) then
instance:ShowSideBars()
@@ -7160,10 +7096,11 @@ function window:CreateFrame6()
--> show statusbar
- g:NewSwitch (frame6, _, "$parentStatusbarSlider", "statusbarSlider", 60, 20, _, _, instance.show_statusbar)
+ g:NewSwitch (frame6, _, "$parentStatusbarSlider", "statusbarSlider", 60, 20, _, _, instance.show_statusbar, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame6, _, "$parentStatusbarLabel", "statusbarLabel", Loc ["STRING_OPTIONS_SHOW_STATUSBAR"], "GameFontHighlightLeft")
frame6.statusbarSlider:SetPoint ("left", frame6.statusbarLabel, "right", 2)
+ frame6.statusbarSlider:SetAsCheckBox()
frame6.statusbarSlider.OnSwitch = function (self, instance, value)
if (value) then
instance:ShowStatusBar()
@@ -7218,11 +7155,8 @@ function window:CreateFrame6()
return backdropTable
end
- local d = g:NewDropDown (frame6, _, "$parentBackdropDropdown", "backdropDropdown", DROPDOWN_WIDTH, dropdown_height, buildBackdropMenu, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame6, _, "$parentBackdropDropdown", "backdropDropdown", DROPDOWN_WIDTH, dropdown_height, buildBackdropMenu, nil, options_dropdown_template)
+
g:NewLabel (frame6, _, "$parentBackdropLabel", "backdropLabel", Loc ["STRING_OPTIONS_INSTANCE_BACKDROP"], "GameFontHighlightLeft")
frame6.backdropDropdown:SetPoint ("left", frame6.backdropLabel, "right", 2)
@@ -7252,11 +7186,8 @@ function window:CreateFrame6()
}
local buildStrataMenu = function() return strataTable end
- local d = g:NewDropDown (frame6, _, "$parentStrataDropdown", "strataDropdown", DROPDOWN_WIDTH, dropdown_height, buildStrataMenu, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame6, _, "$parentStrataDropdown", "strataDropdown", DROPDOWN_WIDTH, dropdown_height, buildStrataMenu, nil, options_dropdown_template)
+
g:NewLabel (frame6, _, "$parentStrataLabel", "strataLabel", Loc ["STRING_OPTIONS_INSTANCE_STRATA"], "GameFontHighlightLeft")
frame6.strataDropdown:SetPoint ("left", frame6.strataLabel, "right", 2)
@@ -7280,16 +7211,17 @@ function window:CreateFrame6()
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
- g:NewColorPickButton (frame6, "$parentStatusbarColorPick", "statusbarColorPick", statusbar_color_callback)
+ g:NewColorPickButton (frame6, "$parentStatusbarColorPick", "statusbarColorPick", statusbar_color_callback, nil, options_button_template)
g:NewLabel (frame6, _, "$parentStatusbarColorLabel", "statusbarColorLabel", Loc ["STRING_OPTIONS_INSTANCE_STATUSBARCOLOR"], "GameFontHighlightLeft")
frame6.statusbarColorPick:SetPoint ("left", frame6.statusbarColorLabel, "right", 2, 0)
window:CreateLineBackground2 (frame6, "statusbarColorPick", "statusbarColorLabel", Loc ["STRING_OPTIONS_INSTANCE_STATUSBARCOLOR_DESC"])
--> window scale
- local s = g:NewSlider (frame6, _, "$parentWindowScaleSlider", "WindowScaleSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0.65, 1.5, 0.02, instance.window_scale, true)
- config_slider (s)
+ local s = g:NewSlider (frame6, _, "$parentWindowScaleSlider", "WindowScaleSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0.65, 1.5, 0.02, instance.window_scale, true, nil, nil, options_slider_template)
+ --config_slider (s)
s.fine_tuning = 0.011
+ s:SetThumbSize (25)
frame6.WindowScaleSlider:SetHook ("OnValueChange", function (self, instance, amount)
instance:SetWindowScale (amount, true)
@@ -7309,10 +7241,11 @@ function window:CreateFrame6()
end)
--> ignore mass show hide
- g:NewSwitch (frame6, _, "$parentIgnoreMassShowHideSlider", "IgnoreMassShowHideSlider", 60, 20, _, _, instance.ignore_mass_showhide)
+ g:NewSwitch (frame6, _, "$parentIgnoreMassShowHideSlider", "IgnoreMassShowHideSlider", 60, 20, _, _, instance.ignore_mass_showhide, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame6, _, "$parentIgnoreMassShowHideLabel", "IgnoreMassShowHideLabel", Loc ["STRING_OPTIONS_WINDOW_IGNOREMASSTOGGLE"], "GameFontHighlightLeft")
frame6.IgnoreMassShowHideSlider:SetPoint ("left", frame6.IgnoreMassShowHideLabel, "right", 2)
+ frame6.IgnoreMassShowHideSlider:SetAsCheckBox()
frame6.IgnoreMassShowHideSlider.OnSwitch = function (self, instance, value)
instance.ignore_mass_showhide = value
@@ -7387,10 +7320,10 @@ function window:CreateFrame7()
titulo_toolbar_desc.width = 320
-- menu anchors
- local s = g:NewSlider (frame7, _, "$parentMenuAnchorXSlider", "menuAnchorXSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -200, 200, 1, instance.menu_anchor[1])
- config_slider (s)
- local s = g:NewSlider (frame7, _, "$parentMenuAnchorYSlider", "menuAnchorYSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -30, 30, 1, instance.menu_anchor[2])
- config_slider (s)
+ local s = g:NewSlider (frame7, _, "$parentMenuAnchorXSlider", "menuAnchorXSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -200, 200, 1, instance.menu_anchor[1], nil, nil, nil, options_slider_template)
+ --config_slider (s)
+ local s = g:NewSlider (frame7, _, "$parentMenuAnchorYSlider", "menuAnchorYSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -30, 30, 1, instance.menu_anchor[2], nil, nil, nil, options_slider_template)
+ --config_slider (s)
g:NewLabel (frame7, _, "$parentMenuAnchorXLabel", "menuAnchorXLabel", Loc ["STRING_OPTIONS_MENU_X"], "GameFontHighlightLeft")
g:NewLabel (frame7, _, "$parentMenuAnchorYLabel", "menuAnchorYLabel", Loc ["STRING_OPTIONS_MENU_Y"], "GameFontHighlightLeft")
@@ -7398,7 +7331,7 @@ function window:CreateFrame7()
frame7.menuAnchorXSlider:SetPoint ("left", frame7.menuAnchorXLabel, "right", 2, -1)
frame7.menuAnchorYSlider:SetPoint ("left", frame7.menuAnchorYLabel, "right", 2)
- frame7.menuAnchorXSlider:SetThumbSize (50)
+ frame7.menuAnchorXSlider:SetThumbSize (24)
frame7.menuAnchorXSlider:SetHook ("OnValueChange", function (self, instance, x)
instance:MenuAnchor (x, nil)
@@ -7412,7 +7345,7 @@ function window:CreateFrame7()
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end)
- frame7.menuAnchorYSlider:SetThumbSize (50)
+ --frame7.menuAnchorYSlider:SetThumbSize (50)
frame7.menuAnchorYSlider:SetHook ("OnValueChange", function (self, instance, y)
instance:MenuAnchor (nil, y)
@@ -7457,10 +7390,11 @@ function window:CreateFrame7()
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:NewSwitch (frame7, _, "$parentMenuAnchorSideSlider", "pluginMenuAnchorSideSlider", 80, 20, Loc ["STRING_LEFT"], Loc ["STRING_RIGHT"], instance.menu_anchor.side, nil, menusode_switch_func, menuside_return_func, nil, options_switch_template)
g:NewLabel (frame7, _, "$parentMenuAnchorSideLabel", "menuAnchorSideLabel", Loc ["STRING_OPTIONS_MENU_ANCHOR"], "GameFontHighlightLeft")
frame7.pluginMenuAnchorSideSlider:SetPoint ("left", frame7.menuAnchorSideLabel, "right", 2)
+ frame7.pluginMenuAnchorSideSlider:SetAsCheckBox()
frame7.pluginMenuAnchorSideSlider.OnSwitch = function (self, instance, value)
instance:LeftMenuAnchorSide (value)
@@ -7478,10 +7412,11 @@ function window:CreateFrame7()
window:CreateLineBackground2 (frame7, "pluginMenuAnchorSideSlider", "menuAnchorSideLabel", Loc ["STRING_OPTIONS_MENU_ANCHOR_DESC"])
-- desaturate
- g:NewSwitch (frame7, _, "$parentDesaturateMenuSlider", "desaturateMenuSlider", 60, 20, _, _, instance.desaturated_menu)
+ g:NewSwitch (frame7, _, "$parentDesaturateMenuSlider", "desaturateMenuSlider", 60, 20, _, _, instance.desaturated_menu, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame7, _, "$parentDesaturateMenuLabel", "desaturateMenuLabel", Loc ["STRING_OPTIONS_DESATURATE_MENU"], "GameFontHighlightLeft")
frame7.desaturateMenuSlider:SetPoint ("left", frame7.desaturateMenuLabel, "right", 2)
+ frame7.desaturateMenuSlider:SetAsCheckBox()
frame7.desaturateMenuSlider.OnSwitch = function (self, instance, value)
instance:DesaturateMenu (value)
@@ -7499,10 +7434,11 @@ function window:CreateFrame7()
window:CreateLineBackground2 (frame7, "desaturateMenuSlider", "desaturateMenuLabel", Loc ["STRING_OPTIONS_DESATURATE_MENU_DESC"])
-- hide icon
- g:NewSwitch (frame7, _, "$parentHideIconSlider", "hideIconSlider", 60, 20, _, _, instance.hide_icon)
+ g:NewSwitch (frame7, _, "$parentHideIconSlider", "hideIconSlider", 60, 20, _, _, instance.hide_icon, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame7, _, "$parentHideIconLabel", "hideIconLabel", Loc ["STRING_OPTIONS_HIDE_ICON"], "GameFontHighlightLeft")
frame7.hideIconSlider:SetPoint ("left", frame7.hideIconLabel, "right", 2)
+ frame7.hideIconSlider:SetAsCheckBox()
frame7.hideIconSlider.OnSwitch = function (self, instance, value)
instance:HideMainIcon (value)
@@ -7561,10 +7497,11 @@ function window:CreateFrame7()
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:NewSwitch (frame7, _, "$parentPluginIconsDirectionSlider", "pluginIconsDirectionSlider", 80, 20, Loc ["STRING_LEFT"], Loc ["STRING_RIGHT"], instance.plugins_grow_direction, nil, grow_switch_func, grow_return_func, nil, options_switch_template)
g:NewLabel (frame7, _, "$parentPluginIconsDirectionLabel", "pluginIconsDirectionLabel", Loc ["STRING_OPTIONS_PICONS_DIRECTION"], "GameFontHighlightLeft")
frame7.pluginIconsDirectionSlider:SetPoint ("left", frame7.pluginIconsDirectionLabel, "right", 2)
+ frame7.pluginIconsDirectionSlider:SetAsCheckBox()
frame7.pluginIconsDirectionSlider.OnSwitch = function (self, instance, value)
instance.plugins_grow_direction = value
instance:ToolbarMenuSetButtons()
@@ -7607,7 +7544,7 @@ function window:CreateFrame7()
X6:SetVertexColor (1, 1, 1, .9)
local x_container = {X1, X2, X3, X4, X5, X6}
- local func = function (menu_button, arg1, arg2)
+ local func = function (self, button, menu_button)
local instance = _G.DetailsOptionsWindow.instance
instance.menu_icons [menu_button] = not instance.menu_icons [menu_button]
@@ -7631,18 +7568,19 @@ function window:CreateFrame7()
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
- local button1 = g:NewButton (frame7, _, "$parentShowButtons1", "showButtons1Button", 21, 21, func, 1)
- button1:InstallCustomTexture()
- local button2 = g:NewButton (frame7, _, "$parentShowButtons2", "showButtons2Button", 21, 21, func, 2)
- button2:InstallCustomTexture()
- local button3 = g:NewButton (frame7, _, "$parentShowButtons3", "showButtons3Button", 21, 21, func, 3)
- button3:InstallCustomTexture()
- local button4 = g:NewButton (frame7, _, "$parentShowButtons4", "showButtons4Button", 21, 21, func, 4)
- button4:InstallCustomTexture()
- local button5 = g:NewButton (frame7, _, "$parentShowButtons5", "showButtons5Button", 21, 21, func, 5)
- button5:InstallCustomTexture()
- local button6 = g:NewButton (frame7, _, "$parentShowButtons6", "showButtons6Button", 21, 21, func, 6)
- button6:InstallCustomTexture()
+ local t = g:GetTemplate ("button", "DETAILS_TITLEBAR_OPTION_BUTTON_TEMPLATE")
+ local button1 = g:NewButton (frame7, _, "$parentShowButtons1", "showButtons1Button", 21, 21, func, 1, nil, nil, nil, nil, t)
+ --button1:InstallCustomTexture()
+ local button2 = g:NewButton (frame7, _, "$parentShowButtons2", "showButtons2Button", 21, 21, func, 2, nil, nil, nil, nil, t)
+ --button2:InstallCustomTexture()
+ local button3 = g:NewButton (frame7, _, "$parentShowButtons3", "showButtons3Button", 21, 21, func, 3, nil, nil, nil, nil, t)
+ --button3:InstallCustomTexture()
+ local button4 = g:NewButton (frame7, _, "$parentShowButtons4", "showButtons4Button", 21, 21, func, 4, nil, nil, nil, nil, t)
+ --button4:InstallCustomTexture()
+ local button5 = g:NewButton (frame7, _, "$parentShowButtons5", "showButtons5Button", 21, 21, func, 5, nil, nil, nil, nil, t)
+ --button5:InstallCustomTexture()
+ local button6 = g:NewButton (frame7, _, "$parentShowButtons6", "showButtons6Button", 21, 21, func, 6, nil, nil, nil, nil, t)
+ --button6:InstallCustomTexture()
function frame7:update_icon_buttons (instance)
for i = 1, 6 do
@@ -7681,9 +7619,10 @@ function window:CreateFrame7()
window:CreateLineBackground2 (frame7, "showButtons1Button", "showButtonsLabel", Loc ["STRING_OPTIONS_MENU_SHOWBUTTONS_DESC"])
--icon sizes
- local s = g:NewSlider (frame7, _, "$parentMenuIconSizeSlider", "menuIconSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0.4, 1.6, 0.05, instance.menu_icons_size, true)
- config_slider (s)
+ local s = g:NewSlider (frame7, _, "$parentMenuIconSizeSlider", "menuIconSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0.4, 1.6, 0.05, instance.menu_icons_size, true, nil, nil, options_slider_template)
+ --config_slider (s)
s.useDecimals = true
+ s:SetThumbSize (24)
s.fine_tuning = 0.05
g:NewLabel (frame7, _, "$parentMenuIconSizeLabel", "menuIconSizeLabel", Loc ["STRING_OPTIONS_MENU_BUTTONSSIZE"], "GameFontHighlightLeft")
@@ -7708,8 +7647,8 @@ function window:CreateFrame7()
--icon spacement
- local s = g:NewSlider (frame7, _, "$parentMenuIconSpaceSlider", "MenuIconSpaceSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -5, 10, 1, instance.menu_icons.space)
- config_slider (s)
+ local s = g:NewSlider (frame7, _, "$parentMenuIconSpaceSlider", "MenuIconSpaceSlider", SLIDER_WIDTH, SLIDER_HEIGHT, -5, 10, 1, instance.menu_icons.space, nil, nil, nil, options_slider_template)
+ --config_slider (s)
g:NewLabel (frame7, _, "$parentMenuIconSpaceLabel", "MenuIconSpaceLabel", Loc ["STRING_OPTIONS_MENUS_SPACEMENT"], "GameFontHighlightLeft")
@@ -7733,10 +7672,11 @@ function window:CreateFrame7()
--icon shadow
- g:NewSwitch (frame7, _, "$parentMenuIconShadowSlider", "MenuIconShadowSlider", 60, 20, _, _, instance.menu_icons.shadow)
+ g:NewSwitch (frame7, _, "$parentMenuIconShadowSlider", "MenuIconShadowSlider", 60, 20, _, _, instance.menu_icons.shadow, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame7, _, "$parentMenuIconShadowLabel", "MenuIconShadowLabel", Loc ["STRING_OPTIONS_MENUS_SHADOW"], "GameFontHighlightLeft")
frame7.MenuIconShadowSlider:SetPoint ("left", frame7.MenuIconShadowLabel, "right", 2)
+ frame7.MenuIconShadowSlider:SetAsCheckBox()
frame7.MenuIconShadowSlider.OnSwitch = function (self, instance, value)
instance:ToolbarMenuSetButtonsOptions (nil, value)
@@ -7759,8 +7699,9 @@ function window:CreateFrame7()
--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)
+ g:NewSwitch (frame7, _, "$parentAutoHideLeftMenuSwitch", "autoHideLeftMenuSwitch", 60, 20, nil, nil, instance.auto_hide_menu.left, nil, nil, nil, nil, options_switch_template)
frame7.autoHideLeftMenuSwitch:SetPoint ("left", frame7.autoHideLeftMenuLabel, "right", 2)
+ frame7.autoHideLeftMenuSwitch:SetAsCheckBox()
frame7.autoHideLeftMenuSwitch.OnSwitch = function (self, instance, value)
instance:SetAutoHideMenu (value)
@@ -7828,8 +7769,9 @@ function window:CreateFrame8()
--> upper model enabled
g:NewLabel (frame8, _, "$parentModelUpperEnabledLabel", "ModelUpperEnabledLabel", Loc ["STRING_ENABLED"], "GameFontHighlightLeft")
- g:NewSwitch (frame8, _, "$parentModelUpperEnabledSlider", "ModelUpperEnabledSlider", 60, 20, _, _, _G.DetailsOptionsWindow.instance.row_info.models.upper_enabled)
+ g:NewSwitch (frame8, _, "$parentModelUpperEnabledSlider", "ModelUpperEnabledSlider", 60, 20, _, _, _G.DetailsOptionsWindow.instance.row_info.models.upper_enabled, nil, nil, nil, nil, options_switch_template)
frame8.ModelUpperEnabledSlider:SetPoint ("left", frame8.ModelUpperEnabledLabel, "right", 2, -1)
+ frame8.ModelUpperEnabledSlider:SetAsCheckBox()
frame8.ModelUpperEnabledSlider.OnSwitch = function (self, instance, value)
instance:SetBarModel (value)
@@ -7894,8 +7836,8 @@ function window:CreateFrame8()
end
end
- g:NewButton (frame8, frame8, "$parentModelUpperSelect", "ModelUpperSelect", window.buttons_width, 18, select_model, true, nil, nil, Loc ["STRING_OPTIONS_3D_SELECT"], 1)
- frame8.ModelUpperSelect:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ g:NewButton (frame8, frame8, "$parentModelUpperSelect", "ModelUpperSelect", window.buttons_width, window.buttons_height, select_model, true, nil, nil, Loc ["STRING_OPTIONS_3D_SELECT"], 1, options_button_template)
+ --frame8.ModelUpperSelect:InstallCustomTexture (nil, nil, nil, nil, nil, true)
window:CreateLineBackground2 (frame8, "ModelUpperSelect", "ModelUpperSelect", Loc ["STRING_OPTIONS_3D_USELECT_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
frame8.ModelUpperSelect:SetIcon ([[Interface\WorldStateFrame\OrcHead]], nil, nil, nil, {0.03125, 1-0.03125, 0.03125, 1-0.03125}, nil, nil, 2)
@@ -7904,8 +7846,9 @@ function window:CreateFrame8()
--> upper model alpha
g:NewLabel (frame8, _, "$parentModelUpperAlphaLabel", "ModelUpperAlphaLabel", Loc ["STRING_ALPHA"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame8, _, "$parentModelUpperAlphaSlider", "ModelUpperAlphaSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0, 1, 0.05, _G.DetailsOptionsWindow.instance.row_info.models.upper_alpha, true)
- config_slider (s)
+ local s = g:NewSlider (frame8, _, "$parentModelUpperAlphaSlider", "ModelUpperAlphaSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0, 1, 0.05, _G.DetailsOptionsWindow.instance.row_info.models.upper_alpha, true, nil, nil, options_slider_template)
+ --config_slider (s)
+ s:SetThumbSize (25)
frame8.ModelUpperAlphaSlider:SetPoint ("left", frame8.ModelUpperAlphaLabel, "right", 2)
@@ -7927,8 +7870,9 @@ function window:CreateFrame8()
--> lower model enabled
g:NewLabel (frame8, _, "$parentModelLowerEnabledLabel", "ModelLowerEnabledLabel", Loc ["STRING_ENABLED"], "GameFontHighlightLeft")
- g:NewSwitch (frame8, _, "$parentModelLowerEnabledSlider", "ModelLowerEnabledSlider", 60, 20, _, _, _G.DetailsOptionsWindow.instance.row_info.models.lower_enabled)
+ g:NewSwitch (frame8, _, "$parentModelLowerEnabledSlider", "ModelLowerEnabledSlider", 60, 20, _, _, _G.DetailsOptionsWindow.instance.row_info.models.lower_enabled, nil, nil, nil, nil, options_switch_template)
frame8.ModelLowerEnabledSlider:SetPoint ("left", frame8.ModelLowerEnabledLabel, "right", 2, -1)
+ frame8.ModelLowerEnabledSlider:SetAsCheckBox()
frame8.ModelLowerEnabledSlider.OnSwitch = function (self, instance, value)
instance:SetBarModel (nil, nil, nil, value)
@@ -7946,8 +7890,8 @@ function window:CreateFrame8()
--> lower model texture
- g:NewButton (frame8, frame8, "$parentModelLowerSelect", "ModelLowerSelect", window.buttons_width, 18, select_model, nil, nil, nil, Loc ["STRING_OPTIONS_3D_SELECT"])
- frame8.ModelLowerSelect:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ g:NewButton (frame8, frame8, "$parentModelLowerSelect", "ModelLowerSelect", window.buttons_width, window.buttons_height, select_model, nil, nil, nil, Loc ["STRING_OPTIONS_3D_SELECT"], nil, options_button_template)
+ --frame8.ModelLowerSelect:InstallCustomTexture (nil, nil, nil, nil, nil, true)
window:CreateLineBackground2 (frame8, "ModelLowerSelect", "ModelLowerSelect", Loc ["STRING_OPTIONS_3D_LSELECT_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
frame8.ModelLowerSelect:SetIcon ([[Interface\WorldStateFrame\OrcHead]], nil, nil, nil, {0.03125, 1-0.03125, 0.03125, 1-0.03125}, nil, nil, 2)
@@ -7955,8 +7899,9 @@ function window:CreateFrame8()
--> lower model alpha
g:NewLabel (frame8, _, "$parentModelLowerAlphaLabel", "ModelLowerAlphaLabel", Loc ["STRING_ALPHA"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame8, _, "$parentModelLowerAlphaSlider", "ModelLowerAlphaSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0, 1, 0.05, _G.DetailsOptionsWindow.instance.row_info.models.lower_alpha, true)
- config_slider (s)
+ local s = g:NewSlider (frame8, _, "$parentModelLowerAlphaSlider", "ModelLowerAlphaSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0, 1, 0.05, _G.DetailsOptionsWindow.instance.row_info.models.lower_alpha, true, nil, nil, options_slider_template)
+ --config_slider (s)
+ s:SetThumbSize (25)
frame8.ModelLowerAlphaSlider:SetPoint ("left", frame8.ModelLowerAlphaLabel, "right", 2)
@@ -7984,8 +7929,9 @@ function window:CreateFrame8()
--> enable fast updates
g:NewLabel (frame8, _, "$parentBarUpdateRateLabel", "BarUpdateRateLabel", Loc ["STRING_ENABLED"], "GameFontHighlightLeft")
- g:NewSwitch (frame8, _, "$parentBarUpdateRateSlider", "BarUpdateRateSlider", 60, 20, _, _, _G.DetailsOptionsWindow.instance.row_info.fast_ps_update)
+ g:NewSwitch (frame8, _, "$parentBarUpdateRateSlider", "BarUpdateRateSlider", 60, 20, _, _, _G.DetailsOptionsWindow.instance.row_info.fast_ps_update, nil, nil, nil, nil, options_switch_template)
frame8.BarUpdateRateSlider:SetPoint ("left", frame8.BarUpdateRateLabel, "right", 2, -1)
+ frame8.BarUpdateRateSlider:SetAsCheckBox()
frame8.BarUpdateRateSlider.OnSwitch = function (self, instance, value)
instance:FastPSUpdate (value)
@@ -8008,8 +7954,9 @@ function window:CreateFrame8()
--> enable player bar
g:NewLabel (frame8, _, "$parentShowMeLabel", "ShowMeLabel", Loc ["STRING_OPTIONS_BAR_FOLLOWING"], "GameFontHighlightLeft")
- g:NewSwitch (frame8, _, "$parentShowMeSlider", "ShowMeSlider", 60, 20, _, _, instance.following.enabled)
+ g:NewSwitch (frame8, _, "$parentShowMeSlider", "ShowMeSlider", 60, 20, _, _, instance.following.enabled, nil, nil, nil, nil, options_switch_template)
frame8.ShowMeSlider:SetPoint ("left", frame8.ShowMeLabel, "right", 2, -1)
+ frame8.ShowMeSlider:SetAsCheckBox()
frame8.ShowMeSlider.OnSwitch = function (self, instance, value)
instance:SetBarFollowPlayer (value)
@@ -8030,9 +7977,10 @@ function window:CreateFrame8()
g:NewLabel (frame8, _, "$parentTotalBarAnchor", "totalBarAnchorLabel", Loc ["STRING_OPTIONS_TOTALBAR_ANCHOR"], "GameFontNormal")
g:NewLabel (frame8, _, "$parentTotalBarLabel", "totalBarLabel", Loc ["STRING_ENABLED"], "GameFontHighlightLeft")
- g:NewSwitch (frame8, _, "$parentTotalBarSlider", "totalBarSlider", 60, 20, _, _, instance.total_bar.enabled)
+ g:NewSwitch (frame8, _, "$parentTotalBarSlider", "totalBarSlider", 60, 20, _, _, instance.total_bar.enabled, nil, nil, nil, nil, options_switch_template)
frame8.totalBarSlider:SetPoint ("left", frame8.totalBarLabel, "right", 2)
+ frame8.totalBarSlider:SetAsCheckBox()
frame8.totalBarSlider.OnSwitch = function (self, instance, value)
instance.total_bar.enabled = value
instance:InstanceReset()
@@ -8074,7 +8022,7 @@ function window:CreateFrame8()
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
- g:NewColorPickButton (frame8, "$parentTotalBarColorPick", "totalBarColorPick", totalbarcolor_callback)
+ g:NewColorPickButton (frame8, "$parentTotalBarColorPick", "totalBarColorPick", totalbarcolor_callback, nil, options_button_template)
g:NewLabel (frame8, _, "$parentTotalBarColorPickLabel", "totalBarPickColorLabel", Loc ["STRING_COLOR"], "GameFontHighlightLeft")
frame8.totalBarColorPick:SetPoint ("left", frame8.totalBarPickColorLabel, "right", 2, 0)
@@ -8082,9 +8030,10 @@ function window:CreateFrame8()
--> total bar only in group
g:NewLabel (frame8, _, "$parentTotalBarOnlyInGroupLabel", "totalBarOnlyInGroupLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_INGROUP"], "GameFontHighlightLeft")
- g:NewSwitch (frame8, _, "$parentTotalBarOnlyInGroupSlider", "totalBarOnlyInGroupSlider", 60, 20, _, _, instance.total_bar.only_in_group)
+ g:NewSwitch (frame8, _, "$parentTotalBarOnlyInGroupSlider", "totalBarOnlyInGroupSlider", 60, 20, _, _, instance.total_bar.only_in_group, nil, nil, nil, nil, options_switch_template)
frame8.totalBarOnlyInGroupSlider:SetPoint ("left", frame8.totalBarOnlyInGroupLabel, "right", 2)
+ frame8.totalBarOnlyInGroupSlider:SetAsCheckBox()
frame8.totalBarOnlyInGroupSlider.OnSwitch = function (self, instance, value)
instance.total_bar.only_in_group = value
instance:InstanceReset()
@@ -8129,8 +8078,8 @@ function window:CreateFrame8()
end
g:NewLabel (frame8, _, "$parentTotalBarIconLabel", "totalBarIconLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_ICON"], "GameFontHighlightLeft")
g:NewImage (frame8, nil, 20, 20, nil, nil, "totalBarIconTexture", "$parentTotalBarIconTexture")
- g:NewButton (frame8, _, "$parentTotalBarIconButton", "totalBarIconButton", 20, 20, totalbar_pickicon)
- frame8.totalBarIconButton:InstallCustomTexture (nil, nil, nil, true)
+ g:NewButton (frame8, _, "$parentTotalBarIconButton", "totalBarIconButton", 20, 20, totalbar_pickicon, nil, nil, nil, nil, nil, options_button_template)
+ --frame8.totalBarIconButton:InstallCustomTexture (nil, nil, nil, true)
frame8.totalBarIconButton:SetPoint ("left", frame8.totalBarIconLabel, "right", 2, 0)
frame8.totalBarIconTexture:SetPoint ("left", frame8.totalBarIconLabel, "right", 2, 0)
@@ -8230,7 +8179,7 @@ function window:CreateFrame9()
end
end
end
- g:NewButton (frame9, _, "$parentEditImage", "editImage", window.buttons_width, 18, startImageEdit, nil, nil, nil, Loc ["STRING_OPTIONS_EDITIMAGE"])
+ g:NewButton (frame9, _, "$parentEditImage", "editImage", window.buttons_width, 18, startImageEdit, nil, nil, nil, Loc ["STRING_OPTIONS_EDITIMAGE"], nil, options_button_template)
--> agora o dropdown do alinhamento
local onSelectAnchor = function (_, instance, anchor)
@@ -8261,11 +8210,8 @@ function window:CreateFrame9()
return anchorMenu
end
- local d = g:NewDropDown (frame9, _, "$parentAnchorDropdown", "anchorDropdown", DROPDOWN_WIDTH, dropdown_height, buildAnchorMenu, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame9, _, "$parentAnchorDropdown", "anchorDropdown", DROPDOWN_WIDTH, dropdown_height, buildAnchorMenu, nil, options_dropdown_template)
+
--> agora cria os 2 dropdown da categoria e wallpaper
@@ -8555,21 +8501,13 @@ function window:CreateFrame9()
}
local buildBackgroundMenu = function() return backgroundTable end
- g:NewSwitch (frame9, _, "$parentUseBackgroundSlider", "useBackgroundSlider", 60, 20, _, _, _G.DetailsOptionsWindow.instance.wallpaper.enabled)
+ g:NewSwitch (frame9, _, "$parentUseBackgroundSlider", "useBackgroundSlider", 60, 20, _, _, _G.DetailsOptionsWindow.instance.wallpaper.enabled, nil, nil, nil, nil, options_switch_template)
--category
- local d = g:NewDropDown (frame9, _, "$parentBackgroundDropdown", "backgroundDropdown", DROPDOWN_WIDTH, dropdown_height, buildBackgroundMenu, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
-
+ local d = g:NewDropDown (frame9, _, "$parentBackgroundDropdown", "backgroundDropdown", DROPDOWN_WIDTH, dropdown_height, buildBackgroundMenu, nil, options_dropdown_template)
+
--wallpaper
- local d = g:NewDropDown (frame9, _, "$parentBackgroundDropdown2", "backgroundDropdown2", DROPDOWN_WIDTH, dropdown_height, buildBackgroundMenu2, nil)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame9, _, "$parentBackgroundDropdown2", "backgroundDropdown2", DROPDOWN_WIDTH, dropdown_height, buildBackgroundMenu2, nil, options_dropdown_template)
-- Wallpaper Settings
@@ -8578,6 +8516,7 @@ function window:CreateFrame9()
g:NewLabel (frame9, _, "$parentBackgroundLabel", "enablewallpaperLabel", Loc ["STRING_ENABLED"], "GameFontHighlightLeft")
--
frame9.useBackgroundSlider:SetPoint ("left", frame9.enablewallpaperLabel, "right", 2, 0) --> slider ativar ou desativar
+ frame9.useBackgroundSlider:SetAsCheckBox()
frame9.useBackgroundSlider.OnSwitch = function (self, instance, value)
instance.wallpaper.enabled = value
if (value) then
@@ -8626,7 +8565,7 @@ function window:CreateFrame9()
--
frame9.anchorDropdown:SetPoint ("left", frame9.anchorLabel, "right", 2)
--
- frame9.editImage:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ --frame9.editImage:InstallCustomTexture (nil, nil, nil, nil, nil, true)
window:CreateLineBackground2 (frame9, "editImage", "editImage", Loc ["STRING_OPTIONS_WP_EDIT_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
frame9.editImage:SetTextColor (button_color_rgb)
frame9.editImage:SetIcon ([[Interface\AddOns\Details\images\icons]], 14, 14, nil, {469/512, 505/512, 290/512, 322/512}, nil, 4, 2)
@@ -8836,7 +8775,7 @@ function window:CreateFrame9()
filename:SetPoint ("topleft", f, "topleft", 15, -120)
filename:SetText (Loc ["STRING_OPTIONS_WALLPAPER_LOAD_FILENAME"])
- local editbox = g:NewTextEntry (f, nil, "$parentFileName", "FileName", 160, 20, function() end)
+ local editbox = g:NewTextEntry (f, nil, "$parentFileName", "FileName", 160, TEXTENTRY_HEIGHT, function() end, nil, nil, nil, nil, options_dropdown_template)
editbox:SetPoint ("left", filename, "right", 2, 0)
editbox.tooltip = Loc ["STRING_OPTIONS_WALLPAPER_LOAD_FILENAME_DESC"]
@@ -8857,9 +8796,9 @@ function window:CreateFrame9()
_detalhes:OpenOptionsWindow (instance)
window:update_wallpaper_info()
end
- local okey = g:NewButton (f, _, "$parentOkeyButton", nil, 105, 20, okey_func, nil, nil, nil, Loc ["STRING_OPTIONS_WALLPAPER_LOAD_OKEY"], 1)
+ local okey = g:NewButton (f, _, "$parentOkeyButton", nil, 105, 20, okey_func, nil, nil, nil, Loc ["STRING_OPTIONS_WALLPAPER_LOAD_OKEY"], 1, options_button_template)
okey:SetPoint ("left", editbox.widget, "right", 2, 0)
- okey:InstallCustomTexture()
+ --okey:InstallCustomTexture()
local throubleshoot_func = function()
if (t:GetText() == Loc ["STRING_OPTIONS_WALLPAPER_LOAD_EXCLAMATION"]) then
@@ -8868,17 +8807,17 @@ function window:CreateFrame9()
DetailsLoadWallpaperImage.t:SetText (Loc ["STRING_OPTIONS_WALLPAPER_LOAD_EXCLAMATION"])
end
end
- local throubleshoot = g:NewButton (f, _, "$parentThroubleshootButton", nil, 105, 20, throubleshoot_func, nil, nil, nil, Loc ["STRING_OPTIONS_WALLPAPER_LOAD_TROUBLESHOOT"], 1)
+ local throubleshoot = g:NewButton (f, _, "$parentThroubleshootButton", nil, 105, 20, throubleshoot_func, nil, nil, nil, Loc ["STRING_OPTIONS_WALLPAPER_LOAD_TROUBLESHOOT"], 1, options_button_template)
throubleshoot:SetPoint ("left", okey, "right", 2, 0)
- throubleshoot:InstallCustomTexture()
+ --throubleshoot:InstallCustomTexture()
end
DetailsLoadWallpaperImage.t:SetText (Loc ["STRING_OPTIONS_WALLPAPER_LOAD_EXCLAMATION"])
DetailsLoadWallpaperImage:Show()
end
- g:NewButton (frame9, _, "$parentLoadImage", "LoadImage", window.buttons_width, 18, load_image, nil, nil, nil, Loc ["STRING_OPTIONS_WALLPAPER_LOAD"])
- frame9.LoadImage:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ g:NewButton (frame9, _, "$parentLoadImage", "LoadImage", window.buttons_width, 18, load_image, nil, nil, nil, Loc ["STRING_OPTIONS_WALLPAPER_LOAD"], nil, options_button_template)
+ --frame9.LoadImage:InstallCustomTexture (nil, nil, nil, nil, nil, true)
window:CreateLineBackground2 (frame9, "LoadImage", "LoadImage", Loc ["STRING_OPTIONS_WALLPAPER_LOAD_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
frame9.LoadImage:SetTextColor (button_color_rgb)
frame9.LoadImage:SetIcon ([[Interface\AddOns\Details\images\icons]], 10, 13, nil, {437/512, 467/512, 191/512, 239/512}, nil, 5, 3)
@@ -8953,8 +8892,8 @@ function window:CreateFrame10()
--------------- Max Segments Saved
g:NewLabel (frame10, _, "$parentLabelSegmentsSave", "segmentsSaveLabel", Loc ["STRING_OPTIONS_SEGMENTSSAVE"], "GameFontHighlightLeft")
--
- local s = g:NewSlider (frame10, _, "$parentSliderSegmentsSave", "segmentsSliderToSave", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 25, 1, _detalhes.segments_amount_to_save)
- config_slider (s)
+ local s = g:NewSlider (frame10, _, "$parentSliderSegmentsSave", "segmentsSliderToSave", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 25, 1, _detalhes.segments_amount_to_save, nil, nil, nil, options_slider_template)
+ --config_slider (s)
--
frame10.segmentsSliderToSave:SetPoint ("left", frame10.segmentsSaveLabel, "right", 2, 0)
frame10.segmentsSliderToSave:SetHook ("OnValueChange", function (self, _, amount) --> slider, fixedValue, sliderValue
@@ -8967,8 +8906,9 @@ function window:CreateFrame10()
--------------- Panic Mode
g:NewLabel (frame10, _, "$parentPanicModeLabel", "panicModeLabel", Loc ["STRING_OPTIONS_PANIMODE"], "GameFontHighlightLeft")
--
- g:NewSwitch (frame10, _, "$parentPanicModeSlider", "panicModeSlider", 60, 20, _, _, _detalhes.segments_panic_mode)
+ g:NewSwitch (frame10, _, "$parentPanicModeSlider", "panicModeSlider", 60, 20, _, _, _detalhes.segments_panic_mode, nil, nil, nil, nil, options_switch_template)
frame10.panicModeSlider:SetPoint ("left", frame10.panicModeLabel, "right", 2, 0)
+ frame10.panicModeSlider:SetAsCheckBox()
frame10.panicModeSlider.OnSwitch = function (self, _, value) --> slider, fixedValue, sliderValue
_detalhes.segments_panic_mode = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -8980,8 +8920,9 @@ function window:CreateFrame10()
g:NewLabel (frame10, _, "$parentAnimateScrollLabel", "animatescrollLabel", Loc ["STRING_OPTIONS_ANIMATESCROLL"], "GameFontHighlightLeft")
--
- g:NewSwitch (frame10, _, "$parentClearAnimateScrollSlider", "animatescrollSlider", 60, 20, _, _, _detalhes.animate_scroll) -- ltext, rtext, defaultv
+ g:NewSwitch (frame10, _, "$parentClearAnimateScrollSlider", "animatescrollSlider", 60, 20, _, _, _detalhes.animate_scroll, nil, nil, nil, nil, options_switch_template) -- ltext, rtext, defaultv
frame10.animatescrollSlider:SetPoint ("left", frame10.animatescrollLabel, "right", 2, 0)
+ frame10.animatescrollSlider:SetAsCheckBox()
frame10.animatescrollSlider.OnSwitch = function (self, _, value) --> slider, fixedValue, sliderValue
_detalhes.animate_scroll = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -8993,8 +8934,9 @@ function window:CreateFrame10()
g:NewLabel (frame10, _, "$parentEraseTrash", "eraseTrashLabel", Loc ["STRING_OPTIONS_CLEANUP"], "GameFontHighlightLeft")
--
- g:NewSwitch (frame10, _, "$parentRemoveTrashSlider", "removeTrashSlider", 60, 20, _, _, _detalhes.trash_auto_remove)
+ g:NewSwitch (frame10, _, "$parentRemoveTrashSlider", "removeTrashSlider", 60, 20, _, _, _detalhes.trash_auto_remove, nil, nil, nil, nil, options_switch_template)
frame10.removeTrashSlider:SetPoint ("left", frame10.eraseTrashLabel, "right")
+ frame10.removeTrashSlider:SetAsCheckBox()
frame10.removeTrashSlider.OnSwitch = function (self, _, amount)
_detalhes.trash_auto_remove = amount
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -9098,11 +9040,8 @@ function window:CreateFrame10()
return PerformanceProfileOptions
end
- local d = g:NewDropDown (frame10, _, "$parentProfileTypeDropdown", "ProfileTypeDropdown", 160, dropdown_height, BuildPerformanceProfileMenu, 0)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame10, _, "$parentProfileTypeDropdown", "ProfileTypeDropdown", 160, dropdown_height, BuildPerformanceProfileMenu, 0, options_dropdown_template)
+
frame10.ProfileTypeDropdown:SetPoint ("left", frame10.ProfileTypeLabel, "right", 2)
@@ -9110,8 +9049,9 @@ function window:CreateFrame10()
--enabled slider
g:NewLabel (frame10, _, "$parenttProfileTypeEnabledLabel", "ProfileTypeEnabledLabel", Loc ["STRING_ENABLED"], "GameFontHighlightLeft")
- g:NewSwitch (frame10, _, "$parentProfileTypeEnabledSlider", "ProfileTypeEnabledSlider", 60, 20, _, _, false)
+ g:NewSwitch (frame10, _, "$parentProfileTypeEnabledSlider", "ProfileTypeEnabledSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame10.ProfileTypeEnabledSlider:SetPoint ("left", frame10.ProfileTypeEnabledLabel, "right", 2)
+ frame10.ProfileTypeEnabledSlider:SetAsCheckBox()
frame10.ProfileTypeEnabledSlider.OnSwitch = function (self, _, value)
if (editing) then
editing.enabled = value
@@ -9131,8 +9071,9 @@ function window:CreateFrame10()
--animate bars
g:NewLabel (frame10, _, "$parentAnimateLabel", "animateLabel", Loc ["STRING_OPTIONS_ANIMATEBARS"], "GameFontHighlightLeft")
- g:NewSwitch (frame10, _, "$parentAnimateSlider", "animateSlider", 60, 20, _, _, _detalhes.use_row_animations) -- ltext, rtext, defaultv
+ g:NewSwitch (frame10, _, "$parentAnimateSlider", "animateSlider", 60, 20, _, _, _detalhes.use_row_animations, nil, nil, nil, nil, options_switch_template)
frame10.animateSlider:SetPoint ("left",frame10.animateLabel, "right", 2, 0)
+ frame10.animateSlider:SetAsCheckBox()
frame10.animateSlider.OnSwitch = function (self, _, value) --> slider, fixedValue, sliderValue (false, true)
if (editing) then
editing.use_row_animations = value
@@ -9143,8 +9084,8 @@ function window:CreateFrame10()
--window:CreateLineBackground2 (frame10, "animateSlider", "animateLabel", Loc ["STRING_OPTIONS_ANIMATEBARS_DESC"])
--update speed
- local s = g:NewSlider (frame10, _, "$parentSliderUpdateSpeed", "updatespeedSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0.05, 3, 0.05, _detalhes.update_speed, true)
- config_slider (s)
+ local s = g:NewSlider (frame10, _, "$parentSliderUpdateSpeed", "updatespeedSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0.05, 3, 0.05, _detalhes.update_speed, true, nil, nil, options_slider_template)
+ --config_slider (s)
g:NewLabel (frame10, _, "$parentUpdateSpeedLabel", "updatespeedLabel", Loc ["STRING_OPTIONS_WINDOWSPEED"], "GameFontHighlightLeft")
--
@@ -9182,8 +9123,9 @@ function window:CreateFrame10()
g:NewLabel (frame10, _, "$parentCaptureAuraLabel", "auraCaptureLabel", Loc ["STRING_OPTIONS_CAURAS"], "GameFontHighlightLeft")
-- damage
- g:NewSwitch (frame10, _, "$parentCaptureDamageSlider", "damageCaptureSlider", 60, 20, _, _, false)
+ g:NewSwitch (frame10, _, "$parentCaptureDamageSlider", "damageCaptureSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame10.damageCaptureSlider:SetPoint ("left", frame10.damageCaptureLabel, "right", 2)
+ frame10.damageCaptureSlider:SetAsCheckBox()
frame10.damageCaptureSlider.OnSwitch = function (self, _, value)
if (editing) then
editing.damage = value
@@ -9194,8 +9136,9 @@ function window:CreateFrame10()
--window:CreateLineBackground2 (frame10, "damageCaptureSlider", "damageCaptureLabel", Loc ["STRING_OPTIONS_CDAMAGE_DESC"])
--heal
- g:NewSwitch (frame10, _, "$parentCaptureHealSlider", "healCaptureSlider", 60, 20, _, _, false)
+ g:NewSwitch (frame10, _, "$parentCaptureHealSlider", "healCaptureSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame10.healCaptureSlider:SetPoint ("left", frame10.healCaptureLabel, "right", 2)
+ frame10.healCaptureSlider:SetAsCheckBox()
frame10.healCaptureSlider.OnSwitch = function (self, _, value)
if (editing) then
editing.heal = value
@@ -9206,8 +9149,9 @@ function window:CreateFrame10()
--window:CreateLineBackground2 (frame10, "healCaptureSlider", "healCaptureLabel", Loc ["STRING_OPTIONS_CHEAL_DESC"])
--energy
- g:NewSwitch (frame10, _, "$parentCaptureEnergySlider", "energyCaptureSlider", 60, 20, _, _, false)
+ g:NewSwitch (frame10, _, "$parentCaptureEnergySlider", "energyCaptureSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame10.energyCaptureSlider:SetPoint ("left", frame10.energyCaptureLabel, "right", 2)
+ frame10.energyCaptureSlider:SetAsCheckBox()
frame10.energyCaptureSlider.OnSwitch = function (self, _, value)
if (editing) then
@@ -9219,8 +9163,9 @@ function window:CreateFrame10()
--window:CreateLineBackground2 (frame10, "energyCaptureSlider", "energyCaptureLabel", Loc ["STRING_OPTIONS_CENERGY_DESC"])
--misc
- g:NewSwitch (frame10, _, "$parentCaptureMiscSlider", "miscCaptureSlider", 60, 20, _, _, false)
+ g:NewSwitch (frame10, _, "$parentCaptureMiscSlider", "miscCaptureSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame10.miscCaptureSlider:SetPoint ("left", frame10.miscCaptureLabel, "right", 2)
+ frame10.miscCaptureSlider:SetAsCheckBox()
frame10.miscCaptureSlider.OnSwitch = function (self, _, value)
if (editing) then
editing.miscdata = value
@@ -9231,8 +9176,9 @@ function window:CreateFrame10()
--window:CreateLineBackground2 (frame10, "miscCaptureSlider", "miscCaptureLabel", Loc ["STRING_OPTIONS_CMISC_DESC"])
--aura
- g:NewSwitch (frame10, _, "$parentCaptureAuraSlider", "auraCaptureSlider", 60, 20, _, _, false)
+ g:NewSwitch (frame10, _, "$parentCaptureAuraSlider", "auraCaptureSlider", 60, 20, _, _, false, nil, nil, nil, nil, options_switch_template)
frame10.auraCaptureSlider:SetPoint ("left", frame10.auraCaptureLabel, "right", 2)
+ frame10.auraCaptureSlider:SetAsCheckBox()
frame10.auraCaptureSlider.OnSwitch = function (self, _, value)
if (editing) then
editing.aura = value
@@ -9299,9 +9245,10 @@ function window:CreateFrame11()
--interrupts
--enable
g:NewLabel (frame11, _, "$parentEnableInterruptsLabel", "EnableInterruptsLabel", Loc ["STRING_ENABLED"], "GameFontHighlightLeft")
- g:NewSwitch (frame11, _, "$parentEnableInterruptsSlider", "EnableInterruptsSlider", 60, 20, _, _, _detalhes.announce_interrupts.enabled)
+ g:NewSwitch (frame11, _, "$parentEnableInterruptsSlider", "EnableInterruptsSlider", 60, 20, _, _, _detalhes.announce_interrupts.enabled, nil, nil, nil, nil, options_switch_template)
frame11.EnableInterruptsSlider:SetPoint ("left", frame11.EnableInterruptsLabel, "right", 2)
+ frame11.EnableInterruptsSlider:SetAsCheckBox()
frame11.EnableInterruptsSlider.OnSwitch = function (_, _, value)
if (value) then
_detalhes:EnableInterruptAnnouncer()
@@ -9315,7 +9262,7 @@ function window:CreateFrame11()
--whisper target
g:NewLabel (frame11, _, "$parentInterruptsWhisperLabel", "InterruptsWhisperLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_WHISPER"], "GameFontHighlightLeft")
- g:NewTextEntry (frame11, _, "$parentInterruptsWhisperEntry", "InterruptsWhisperEntry", text_entry_size, 20)
+ g:NewTextEntry (frame11, _, "$parentInterruptsWhisperEntry", "InterruptsWhisperEntry", text_entry_size, TEXTENTRY_HEIGHT, nil, nil, nil, nil, nil, options_dropdown_template)
frame11.InterruptsWhisperEntry:SetPoint ("left", frame11.InterruptsWhisperLabel, "right", 2, -1)
frame11.InterruptsWhisperEntry:SetText (_detalhes.announce_interrupts.whisper)
@@ -9356,18 +9303,15 @@ function window:CreateFrame11()
end
g:NewLabel (frame11, _, "$parentInterruptsChannelLabel", "InterruptsChannelLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_CHANNEL"] , "GameFontHighlightLeft")
- local d = g:NewDropDown (frame11, _, "$parentInterruptsChannelDropdown", "InterruptsChannelDropdown", DROPDOWN_WIDTH, dropdown_height, build_channel_menu, _detalhes.announce_interrupts.channel)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame11, _, "$parentInterruptsChannelDropdown", "InterruptsChannelDropdown", DROPDOWN_WIDTH, dropdown_height, build_channel_menu, _detalhes.announce_interrupts.channel, options_dropdown_template)
+
frame11.InterruptsChannelDropdown:SetPoint ("left", frame11.InterruptsChannelLabel, "right", 2)
window:CreateLineBackground2 (frame11, "InterruptsChannelDropdown", "InterruptsChannelLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_CHANNEL_DESC"])
--campo para digitar o nome do proximo
g:NewLabel (frame11, _, "$parentInterruptsNextLabel", "InterruptsNextLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_NEXT"], "GameFontHighlightLeft")
- g:NewTextEntry (frame11, _, "$parentInterruptsNextEntry", "InterruptsNextEntry", text_entry_size, 20)
+ g:NewTextEntry (frame11, _, "$parentInterruptsNextEntry", "InterruptsNextEntry", text_entry_size, TEXTENTRY_HEIGHT, nil, nil, nil, nil, nil, options_dropdown_template)
frame11.InterruptsNextEntry:SetPoint ("left", frame11.InterruptsNextLabel, "right", 2, -1)
frame11.InterruptsNextEntry:SetText (_detalhes.announce_interrupts.next)
@@ -9389,7 +9333,7 @@ function window:CreateFrame11()
--campo para digitar a fala customizada
g:NewLabel (frame11, _, "$parentInterruptsCustomLabel", "InterruptsCustomLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_CUSTOM"], "GameFontHighlightLeft")
- g:NewTextEntry (frame11, _, "$parentInterruptsCustomEntry", "InterruptsCustomEntry", text_entry_size, 20)
+ g:NewTextEntry (frame11, _, "$parentInterruptsCustomEntry", "InterruptsCustomEntry", text_entry_size, TEXTENTRY_HEIGHT, nil, nil, nil, nil, nil, options_dropdown_template)
frame11.InterruptsCustomEntry:SetPoint ("left", frame11.InterruptsCustomLabel, "right", 2, -1)
frame11.InterruptsCustomEntry:SetText (_detalhes.announce_interrupts.custom)
@@ -9428,9 +9372,10 @@ function window:CreateFrame11()
--cooldowns
g:NewLabel (frame11, _, "$parentEnableCooldownsLabel", "EnableCooldownsLabel", Loc ["STRING_ENABLED"], "GameFontHighlightLeft")
- g:NewSwitch (frame11, _, "$parentEnableCooldownsSlider", "EnableCooldownsSlider", 60, 20, _, _, _detalhes.announce_cooldowns.enabled)
+ g:NewSwitch (frame11, _, "$parentEnableCooldownsSlider", "EnableCooldownsSlider", 60, 20, _, _, _detalhes.announce_cooldowns.enabled, nil, nil, nil, nil, options_switch_template)
frame11.EnableCooldownsSlider:SetPoint ("left", frame11.EnableCooldownsLabel, "right", 2)
+ frame11.EnableCooldownsSlider:SetAsCheckBox()
frame11.EnableCooldownsSlider.OnSwitch = function (_, _, value)
if (value) then
_detalhes:EnableCooldownAnnouncer()
@@ -9460,18 +9405,14 @@ function window:CreateFrame11()
end
g:NewLabel (frame11, _, "$parentCooldownChannelLabel", "CooldownChannelLabel", Loc ["STRING_OPTIONS_RT_COOLDOWNS_CHANNEL"] , "GameFontHighlightLeft")
- local d = g:NewDropDown (frame11, _, "$parentCooldownChannelDropdown", "CooldownChannelDropdown", DROPDOWN_WIDTH, dropdown_height, build_channel_menu, _detalhes.announce_cooldowns.channel)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame11, _, "$parentCooldownChannelDropdown", "CooldownChannelDropdown", DROPDOWN_WIDTH, dropdown_height, build_channel_menu, _detalhes.announce_cooldowns.channel, options_dropdown_template)
frame11.CooldownChannelDropdown:SetPoint ("left", frame11.CooldownChannelLabel, "right", 2)
window:CreateLineBackground2 (frame11, "CooldownChannelDropdown", "CooldownChannelLabel", Loc ["STRING_OPTIONS_RT_COOLDOWNS_CHANNEL_DESC"])
--campo para digitar a frase customizada
g:NewLabel (frame11, _, "$parentCooldownCustomLabel", "CooldownCustomLabel", Loc ["STRING_OPTIONS_RT_COOLDOWNS_CUSTOM"], "GameFontHighlightLeft")
- g:NewTextEntry (frame11, _, "$parentCooldownCustomEntry", "CooldownCustomEntry", text_entry_size, 20)
+ g:NewTextEntry (frame11, _, "$parentCooldownCustomEntry", "CooldownCustomEntry", text_entry_size, TEXTENTRY_HEIGHT, nil, nil, nil, nil, nil, options_dropdown_template)
frame11.CooldownCustomEntry:SetPoint ("left", frame11.CooldownCustomLabel, "right", 2, -1)
frame11.CooldownCustomEntry:SetText (_detalhes.announce_cooldowns.custom)
@@ -9608,9 +9549,9 @@ function window:CreateFrame11()
DetailsAnnounceSelectCooldownIgnored:Open()
- end, nil, nil, nil, Loc ["STRING_OPTIONS_RT_COOLDOWNS_SELECT"], 1)
+ end, nil, nil, nil, Loc ["STRING_OPTIONS_RT_COOLDOWNS_SELECT"], 1, options_button_template)
- frame11.CooldownIgnoreButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
+ --frame11.CooldownIgnoreButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
window:CreateLineBackground2 (frame11, "CooldownIgnoreButton", "CooldownIgnoreButton", Loc ["STRING_OPTIONS_RT_COOLDOWNS_SELECT_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
frame11.CooldownIgnoreButton:SetIcon ([[Interface\COMMON\UI-DropDownRadioChecks]], nil, nil, nil, {0, 0.5, 0, 0.5}, nil, nil, 2)
@@ -9619,9 +9560,10 @@ function window:CreateFrame11()
--deaths
g:NewLabel (frame11, _, "$parentEnableDeathsLabel", "EnableDeathsLabel", Loc ["STRING_ENABLED"], "GameFontHighlightLeft")
- g:NewSwitch (frame11, _, "$parentEnableDeathsSlider", "EnableDeathsSlider", 60, 20, _, _, _detalhes.announce_deaths.enabled)
+ g:NewSwitch (frame11, _, "$parentEnableDeathsSlider", "EnableDeathsSlider", 60, 20, _, _, _detalhes.announce_deaths.enabled, nil, nil, nil, nil, options_switch_template)
frame11.EnableDeathsSlider:SetPoint ("left", frame11.EnableDeathsLabel, "right", 2)
+ frame11.EnableDeathsSlider:SetAsCheckBox()
frame11.EnableDeathsSlider.OnSwitch = function (_, _, value)
if (value) then
_detalhes:EnableDeathAnnouncer()
@@ -9635,8 +9577,8 @@ function window:CreateFrame11()
--slider para quantidade de danos a mostrar
g:NewLabel (frame11, _, "$parentDeathsDamageLabel", "DeathsDamageLabel", Loc ["STRING_OPTIONS_RT_DEATHS_HITS"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame11, _, "$parentDeathsDamageSlider", "DeathsDamageSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 5, 1, _detalhes.announce_deaths.last_hits)
- config_slider (s)
+ local s = g:NewSlider (frame11, _, "$parentDeathsDamageSlider", "DeathsDamageSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 5, 1, _detalhes.announce_deaths.last_hits, nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame11.DeathsDamageSlider:SetPoint ("left", frame11.DeathsDamageLabel, "right", 2)
frame11.DeathsDamageSlider:SetHook ("OnValueChange", function (self, _, amount)
@@ -9647,8 +9589,8 @@ function window:CreateFrame11()
--slider para limite de mortes para reportar
g:NewLabel (frame11, _, "$parentDeathsAmountLabel", "DeathsAmountLabel", Loc ["STRING_OPTIONS_RT_DEATHS_FIRST"], "GameFontHighlightLeft")
- local s = g:NewSlider (frame11, _, "$parentDeathsAmountSlider", "DeathsAmountSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 30, 1, _detalhes.announce_deaths.only_first)
- config_slider (s)
+ local s = g:NewSlider (frame11, _, "$parentDeathsAmountSlider", "DeathsAmountSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 30, 1, _detalhes.announce_deaths.only_first, nil, nil, nil, options_slider_template)
+ --config_slider (s)
frame11.DeathsAmountSlider:SetPoint ("left", frame11.DeathsAmountLabel, "right", 2)
frame11.DeathsAmountSlider:SetHook ("OnValueChange", function (self, _, amount)
@@ -9674,11 +9616,7 @@ function window:CreateFrame11()
end
g:NewLabel (frame11, _, "$parentDeathChannelLabel", "DeathChannelLabel", Loc ["STRING_OPTIONS_RT_DEATHS_WHERE"] , "GameFontHighlightLeft")
- local d = g:NewDropDown (frame11, _, "$parentDeathChannelDropdown", "DeathChannelDropdown", DROPDOWN_WIDTH, dropdown_height, build_channel_menu, _detalhes.announce_deaths.where)
- d.onenter_backdrop = dropdown_backdrop_onenter
- d.onleave_backdrop = dropdown_backdrop_onleave
- d:SetBackdrop (dropdown_backdrop)
- d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color))
+ local d = g:NewDropDown (frame11, _, "$parentDeathChannelDropdown", "DeathChannelDropdown", DROPDOWN_WIDTH, dropdown_height, build_channel_menu, _detalhes.announce_deaths.where, options_dropdown_template)
frame11.DeathChannelDropdown:SetPoint ("left", frame11.DeathChannelLabel, "right", 2)
window:CreateLineBackground2 (frame11, "DeathChannelDropdown", "DeathChannelLabel", Loc ["STRING_OPTIONS_RT_DEATHS_WHERE_DESC"])
@@ -9686,9 +9624,10 @@ function window:CreateFrame11()
--> general tools
--> pre pots
g:NewLabel (frame11, _, "$parentEnabledPrePotLabel", "EnabledPrePotLabel", Loc ["STRING_OPTIONS_RT_INFOS_PREPOTION"], "GameFontHighlightLeft")
- g:NewSwitch (frame11, _, "$parentEnabledPrePotSlider", "EnabledPrePotSlider", 60, 20, _, _, _detalhes.announce_prepots.enabled)
+ g:NewSwitch (frame11, _, "$parentEnabledPrePotSlider", "EnabledPrePotSlider", 60, 20, _, _, _detalhes.announce_prepots.enabled, nil, nil, nil, nil, options_switch_template)
frame11.EnabledPrePotSlider:SetPoint ("left", frame11.EnabledPrePotLabel, "right", 2)
+ frame11.EnabledPrePotSlider:SetAsCheckBox()
frame11.EnabledPrePotSlider.OnSwitch = function (_, _, value)
_detalhes.announce_prepots.enabled = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -9698,9 +9637,10 @@ function window:CreateFrame11()
--> first hit
g:NewLabel (frame11, _, "$parentEnabledFirstHitLabel", "EnabledFirstHitLabel", Loc ["STRING_OPTIONS_RT_FIRST_HIT"], "GameFontHighlightLeft")
- g:NewSwitch (frame11, _, "$parentEnabledFirstHitSlider", "EnabledFirstHitSlider", 60, 20, _, _, _detalhes.announce_firsthit.enabled)
+ g:NewSwitch (frame11, _, "$parentEnabledFirstHitSlider", "EnabledFirstHitSlider", 60, 20, _, _, _detalhes.announce_firsthit.enabled, nil, nil, nil, nil, options_switch_template)
frame11.EnabledFirstHitSlider:SetPoint ("left", frame11.EnabledFirstHitLabel, "right", 2)
+ frame11.EnabledFirstHitSlider:SetAsCheckBox()
frame11.EnabledFirstHitSlider.OnSwitch = function (_, _, value)
_detalhes.announce_firsthit.enabled = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -9857,10 +9797,11 @@ function window:CreateFrame12()
local plugin_stable = _detalhes:GetPluginSavedTable (absName)
local plugin = _detalhes:GetPlugin (absName)
- g:NewSwitch (bframe, _, "$parentToolbarSlider"..i, "toolbarPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled)
+ g:NewSwitch (bframe, _, "$parentToolbarSlider"..i, "toolbarPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled, nil, nil, nil, nil, options_switch_template)
bframe ["toolbarPluginsSlider"..i].PluginName = absName
tinsert (window.plugin_widgets, bframe ["toolbarPluginsSlider"..i])
- bframe ["toolbarPluginsSlider"..i]:SetPoint ("topleft", frame4, "topleft", 400, y+1)
+ bframe ["toolbarPluginsSlider"..i]:SetPoint ("topleft", frame4, "topleft", 415, y+1)
+ bframe ["toolbarPluginsSlider"..i]:SetAsCheckBox()
bframe ["toolbarPluginsSlider"..i].OnSwitch = function (self, _, value)
plugin_stable.enabled = value
plugin.__enabled = value
@@ -9872,9 +9813,9 @@ function window:CreateFrame12()
end
if (pluginObject.OpenOptionsPanel) then
- g:NewButton (bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 86, 16, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"])
- bframe ["OptionsButton"..i]:SetPoint ("topleft", frame4, "topleft", 510, y-2)
- bframe ["OptionsButton"..i]:InstallCustomTexture()
+ g:NewButton (bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 86, 18, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], nil, options_button_template)
+ bframe ["OptionsButton"..i]:SetPoint ("topleft", frame4, "topleft", 510, y-0)
+ --bframe ["OptionsButton"..i]:InstallCustomTexture()
window:CreateLineBackground2 (bframe, "OptionsButton"..i, "OptionsButton"..i, nil, nil, {1, 0.8, 0}, button_color_rgb)
bframe ["OptionsButton"..i]:SetTextColor (button_color_rgb)
@@ -9941,10 +9882,11 @@ function window:CreateFrame12()
local plugin_stable = _detalhes:GetPluginSavedTable (absName)
local plugin = _detalhes:GetPlugin (absName)
- g:NewSwitch (bframe, _, "$parentRaidSlider"..i, "raidPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled)
+ g:NewSwitch (bframe, _, "$parentRaidSlider"..i, "raidPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled, nil, nil, nil, nil, options_switch_template)
tinsert (window.plugin_widgets, bframe ["raidPluginsSlider"..i])
bframe ["raidPluginsSlider"..i].PluginName = absName
- bframe ["raidPluginsSlider"..i]:SetPoint ("topleft", frame4, "topleft", 400, y+1)
+ bframe ["raidPluginsSlider"..i]:SetPoint ("topleft", frame4, "topleft", 415, y+1)
+ bframe ["raidPluginsSlider"..i]:SetAsCheckBox()
bframe ["raidPluginsSlider"..i].OnSwitch = function (self, _, value)
plugin_stable.enabled = value
plugin.__enabled = value
@@ -9958,9 +9900,9 @@ function window:CreateFrame12()
end
if (pluginObject.OpenOptionsPanel) then
- g:NewButton (bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 86, 16, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"])
- bframe ["OptionsButton"..i]:SetPoint ("topleft", frame4, "topleft", 510, y-2)
- bframe ["OptionsButton"..i]:InstallCustomTexture()
+ g:NewButton (bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 86, 18, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], nil, options_button_template)
+ bframe ["OptionsButton"..i]:SetPoint ("topleft", frame4, "topleft", 510, y-0)
+ --bframe ["OptionsButton"..i]:InstallCustomTexture()
window:CreateLineBackground2 (bframe, "OptionsButton"..i, "OptionsButton"..i, nil, nil, {1, 0.8, 0}, button_color_rgb)
bframe ["OptionsButton"..i]:SetTextColor (button_color_rgb)
@@ -10026,10 +9968,11 @@ function window:CreateFrame12()
local plugin_stable = _detalhes:GetPluginSavedTable (absName)
local plugin = _detalhes:GetPlugin (absName)
- g:NewSwitch (bframe, _, "$parentSoloSlider"..i, "soloPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled)
+ g:NewSwitch (bframe, _, "$parentSoloSlider"..i, "soloPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled, nil, nil, nil, nil, options_switch_template)
tinsert (window.plugin_widgets, bframe ["soloPluginsSlider"..i])
bframe ["soloPluginsSlider"..i].PluginName = absName
- bframe ["soloPluginsSlider"..i]:SetPoint ("topleft", frame4, "topleft", 400, y+1)
+ bframe ["soloPluginsSlider"..i]:SetPoint ("topleft", frame4, "topleft", 415, y+1)
+ bframe ["soloPluginsSlider"..i]:SetAsCheckBox()
bframe ["soloPluginsSlider"..i].OnSwitch = function (self, _, value)
plugin_stable.enabled = value
plugin.__enabled = value
@@ -10043,9 +9986,9 @@ function window:CreateFrame12()
end
if (pluginObject.OpenOptionsPanel) then
- g:NewButton (bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 86, 16, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"])
- bframe ["OptionsButton"..i]:SetPoint ("topleft", frame4, "topleft", 510, y-2)
- bframe ["OptionsButton"..i]:InstallCustomTexture()
+ g:NewButton (bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 86, 18, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], nil, options_button_template)
+ bframe ["OptionsButton"..i]:SetPoint ("topleft", frame4, "topleft", 510, y-0)
+ --bframe ["OptionsButton"..i]:InstallCustomTexture()
window:CreateLineBackground2 (bframe, "OptionsButton"..i, "OptionsButton"..i, nil, nil, {1, 0.8, 0}, button_color_rgb)
bframe ["OptionsButton"..i]:SetTextColor (button_color_rgb)
@@ -10299,8 +10242,8 @@ end --> if not window
f:SetPoint ("topleft", frame3.SkinExtraOptionsAnchor.widget, "bottomleft", 0, -10)
f:SetSize (250, 400)
- g:BuildMenu (f, skin_object.skin_options, 0, 0, 400)
-
+ g:BuildMenu (f, skin_object.skin_options, 0, 0, 400, nil, nil, nil, nil, nil, nil, g:GetTemplate ("button", "DETAILS_SKIN_OPTION_BUTTON_TEMPLATE"))
+
elseif (skin_object.skin_options) then
frame3.ExtraOptions [skin_name_formated]:Show()
end
@@ -10671,6 +10614,7 @@ end --> if not window
_G.DetailsOptionsWindow18DisableStretchButtonSlider.MyObject:SetValue (_detalhes.disable_stretch_button)
_G.DetailsOptionsWindow18DisableBarHighlightSlider.MyObject:SetValue (_detalhes.instances_disable_bar_highlight)
+ _G.DetailsOptionsWindow18ClickToOpenMenusSlider.MyObject:SetValue (_detalhes.instances_menu_click_to_open)
--> window 19
_G.DetailsOptionsWindow19MinimapSlider.MyObject:SetValue (not _detalhes.minimap.hide)
diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua
index 44c7aee5..c6779f77 100644
--- a/gumps/janela_principal.lua
+++ b/gumps/janela_principal.lua
@@ -1694,12 +1694,16 @@ function _detalhes:DelayOptionsRefresh (instance, no_reopen)
end
end
-local lockFunctionOnClick = function (button)
+local lockFunctionOnClick = function (button, button_type, button2)
if (_detalhes.disable_lock_ungroup_buttons) then
return
end
+ if (not button:GetParent().instance) then
+ button = button2 --from any other button
+ end
+
local baseframe = button:GetParent()
if (baseframe.isLocked) then
baseframe.isLocked = false
@@ -5199,10 +5203,10 @@ local OnClickNovoMenu = function (_, _, id, instance)
end
local ninstance = _detalhes.CriarInstancia (_, _, id)
- instance.baseframe.cabecalho.modo_selecao:GetScript ("OnEnter")(instance.baseframe.cabecalho.modo_selecao)
+ instance.baseframe.cabecalho.modo_selecao:GetScript ("OnEnter")(instance.baseframe.cabecalho.modo_selecao, _, true)
if (ninstance and is_new) then
- ninstance.baseframe.cabecalho.modo_selecao:GetScript ("OnEnter")(ninstance.baseframe.cabecalho.modo_selecao)
+ ninstance.baseframe.cabecalho.modo_selecao:GetScript ("OnEnter")(ninstance.baseframe.cabecalho.modo_selecao, _, true)
end
end
@@ -7332,7 +7336,14 @@ function _detalhes:SetTooltipBackdrop (border_texture, border_size, border_color
end
--> reset button functions
- local reset_button_onenter = function (self)
+ local reset_button_onenter = function (self, _, forced, from_click)
+
+ if (_detalhes.instances_menu_click_to_open and not forced) then
+ return
+ end
+
+ local instancia = self._instance or self.widget._instance
+ local baseframe = instancia.baseframe
local GameCooltip = GameCooltip
@@ -7396,7 +7407,12 @@ end
--> close button functions
- local close_button_onclick = function (self, _, button)
+ local close_button_onclick = function (self, button_type, button)
+
+ if (self and not self.instancia and button and button.instancia) then
+ self = button
+ end
+
self = self or button
self:Disable()
@@ -7485,6 +7501,300 @@ end
------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> build upper menu bar
+local menu_can_open = function()
+ if (GameCooltip.active) then
+ local owner = GameCooltip:GetOwner()
+ if (owner and owner:GetScript ("OnUpdate") == on_leave_menu) then
+ owner:SetScript ("OnUpdate", nil)
+ end
+ return true
+ end
+end
+
+local report_on_enter = function (self, motion, forced, from_click)
+
+ local is_cooltip_opened = menu_can_open() -- and not is_cooltip_opened
+ if (_detalhes.instances_menu_click_to_open and not forced) then
+ return
+ end
+
+ local instancia = self._instance or self.widget._instance
+ local baseframe = instancia.baseframe
+
+ OnEnterMainWindow (instancia, self, 3)
+ if (instancia.desaturated_menu) then
+ self:GetNormalTexture():SetDesaturated (false)
+ end
+
+ GameCooltip.buttonOver = true
+ baseframe.cabecalho.button_mouse_over = true
+
+ GameCooltip:Reset()
+
+ GameCooltip:SetType ("menu")
+ GameCooltip:SetOption ("ButtonsYMod", -3)
+ GameCooltip:SetOption ("YSpacingMod", 0)
+ GameCooltip:SetOption ("TextHeightMod", 0)
+ GameCooltip:SetOption ("IgnoreButtonAutoHeight", false)
+
+ GameCooltip:SetOption ("ButtonsYMod", -7)
+ GameCooltip:SetOption ("HeighMod", 8)
+
+ _detalhes:CheckLastReportsIntegrity()
+
+ local last_reports = _detalhes.latest_report_table
+ if (#last_reports > 0) then
+ for index = #last_reports, 1, -1 do
+ local report = last_reports [index]
+ local instance_number, attribute, subattribute, amt, report_where, custom_name = unpack (report)
+
+ local name = _detalhes:GetSubAttributeName (attribute, subattribute, custom_name)
+
+ local artwork = _detalhes.GetReportIconAndColor (report_where)
+
+ GameCooltip:AddLine (name .. " (#" .. amt .. ")", nil, 1, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus)
+ if (artwork) then
+ GameCooltip:AddIcon (artwork.icon, 1, 1, 14, 14, artwork.coords[1], artwork.coords[2], artwork.coords[3], artwork.coords[4], artwork.color, nil, false)
+ end
+ GameCooltip:AddMenu (1, _detalhes.ReportFromLatest, index)
+ end
+
+ GameCooltip:AddLine ("$div")
+ end
+
+ GameCooltip:AddLine (Loc ["STRING_REPORT_TOOLTIP"], nil, 1, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus)
+ GameCooltip:AddIcon ([[Interface\Addons\Details\Images\report_button]], 1, 1, 12, 19)
+ GameCooltip:AddMenu (1, _detalhes.Reportar, instancia, nil, "INSTANCE" .. instancia.meu_id)
+
+ GameCooltip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true)
+ GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color)
+
+ show_anti_overlap (instancia, self, "top")
+ _detalhes:SetMenuOwner (self, instancia)
+
+ GameCooltip:ShowCooltip()
+end
+
+local report_on_leave = function (self, motion, forced, from_click)
+
+ local instancia = self._instance or self.widget._instance
+ local baseframe = instancia.baseframe
+
+ OnLeaveMainWindow (instancia, self, 3)
+
+ hide_anti_overlap (instancia.baseframe.anti_menu_overlap)
+
+ GameCooltip.buttonOver = false
+ baseframe.cabecalho.button_mouse_over = false
+
+ if (instancia.desaturated_menu) then
+ self:GetNormalTexture():SetDesaturated (true)
+ end
+
+ if (GameCooltip.active) then
+ parameters_table [2] = from_click and 1 or 0
+ self:SetScript ("OnUpdate", on_leave_menu)
+ else
+ self:SetScript ("OnUpdate", nil)
+ end
+end
+
+local atributo_on_enter = function (self, motion, forced, from_click)
+
+ local is_cooltip_opened = menu_can_open() -- and not is_cooltip_opened
+ if (_detalhes.instances_menu_click_to_open and not forced) then
+ return
+ end
+
+ local instancia = self._instance or self.widget._instance
+ local baseframe = instancia.baseframe
+
+ OnEnterMainWindow (instancia, self, 3)
+
+ if (instancia.desaturated_menu) then
+ self:GetNormalTexture():SetDesaturated (false)
+ end
+
+ GameCooltip.buttonOver = true
+ baseframe.cabecalho.button_mouse_over = true
+
+ show_anti_overlap (instancia, self, "top")
+
+ GameCooltip:Reset()
+ GameCooltip:SetType (3)
+ GameCooltip:SetFixedParameter (instancia)
+
+ if (_detalhes.solo and _detalhes.solo == instancia.meu_id) then
+ _detalhes:MontaSoloOption (instancia)
+ elseif (instancia:IsRaidMode()) then
+ local have_plugins = _detalhes:MontaRaidOption (instancia)
+ if (not have_plugins) then
+ GameCooltip:SetType ("tooltip")
+ GameCooltip:SetOption ("ButtonsYMod", 0)
+ GameCooltip:SetOption ("YSpacingMod", 0)
+ GameCooltip:SetOption ("TextHeightMod", 0)
+ GameCooltip:SetOption ("IgnoreButtonAutoHeight", false)
+ GameCooltip:AddLine ("All raid plugins already\nin use or disabled.", nil, 1, "white", nil, 10, SharedMedia:Fetch ("font", "Friz Quadrata TT"))
+ GameCooltip:AddIcon ([[Interface\GROUPFRAME\UI-GROUP-ASSISTANTICON]], 1, 1)
+ GameCooltip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true)
+ end
+ else
+ _detalhes:MontaAtributosOption (instancia)
+ end
+
+ GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color)
+ GameCooltip:SetBackdrop (2, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color)
+ GameCooltip:SetOption ("TextSize", _detalhes.font_sizes.menus)
+
+ _detalhes:SetMenuOwner (self, instancia)
+ if (instancia.toolbar_side == 2) then --bottom
+ GameCooltip:SetOption ("HeightAnchorMod", 0)
+ end
+
+ GameCooltip:ShowCooltip (self)
+end
+
+local atributo_on_leave = function (self, motion, forced, from_click)
+ local instancia = self._instance or self.widget._instance
+ local baseframe = instancia.baseframe
+
+ OnLeaveMainWindow (instancia, self, 3)
+
+ hide_anti_overlap (instancia.baseframe.anti_menu_overlap)
+
+ if (instancia.desaturated_menu) then
+ self:GetNormalTexture():SetDesaturated (true)
+ end
+
+ GameCooltip.buttonOver = false
+ baseframe.cabecalho.button_mouse_over = false
+
+ if (GameCooltip.active) then
+ parameters_table [2] = 0
+ self:SetScript ("OnUpdate", on_leave_menu)
+ else
+ self:SetScript ("OnUpdate", nil)
+ end
+end
+
+local segmento_on_enter = function (self, motion, forced, from_click)
+
+ local is_cooltip_opened = menu_can_open() -- and not is_cooltip_opened
+ if (_detalhes.instances_menu_click_to_open and not forced) then
+ return
+ end
+
+ local instancia = self._instance or self.widget._instance
+ local baseframe = instancia.baseframe
+
+ OnEnterMainWindow (instancia, self, 3)
+
+ if (instancia.desaturated_menu) then
+ self:GetNormalTexture():SetDesaturated (false)
+ end
+
+ GameCooltip.buttonOver = true
+ baseframe.cabecalho.button_mouse_over = true
+
+ local passou = 0
+ if (_G.GameCooltip.active) then
+ passou = 0.15
+ end
+
+ parameters_table [1] = instancia
+ parameters_table [2] = from_click and 1 or passou
+ self:SetScript ("OnUpdate", build_segment_list)
+end
+
+local segmento_on_leave = function (self, motion, forced, from_click)
+ local instancia = self._instance or self.widget._instance
+ local baseframe = instancia.baseframe
+
+ OnLeaveMainWindow (instancia, self, 3)
+
+ hide_anti_overlap (instancia.baseframe.anti_menu_overlap)
+
+ if (instancia.desaturated_menu) then
+ self:GetNormalTexture():SetDesaturated (true)
+ end
+
+ GameCooltip.buttonOver = false
+ baseframe.cabecalho.button_mouse_over = false
+
+ if (GameCooltip.active) then
+ parameters_table [2] = 0
+ self:SetScript ("OnUpdate", on_leave_menu)
+ else
+ self:SetScript ("OnUpdate", nil)
+ end
+end
+
+local modo_selecao_on_enter = function (self, motion, forced, from_click)
+
+ local is_cooltip_opened = menu_can_open() -- not is_cooltip_opened
+ if (_detalhes.instances_menu_click_to_open and not forced) then
+ return
+ end
+
+ local instancia = self._instance or self.widget._instance
+ local baseframe = instancia.baseframe
+
+ OnEnterMainWindow (instancia, self, 3)
+
+ if (instancia.desaturated_menu) then
+ self:GetNormalTexture():SetDesaturated (false)
+ end
+
+ GameCooltip.buttonOver = true
+ baseframe.cabecalho.button_mouse_over = true
+
+ local passou = 0
+ if (_G.GameCooltip.active) then
+ passou = 0.15
+ end
+
+ local checked
+ if (instancia.modo == 1) then
+ checked = 4
+ elseif (instancia.modo == 2) then
+ checked = 1
+ elseif (instancia.modo == 3) then
+ checked = 2
+ elseif (instancia.modo == 4) then
+ checked = 3
+ end
+
+ parameters_table [1] = instancia
+ parameters_table [2] = from_click and 1 or passou
+ parameters_table [3] = checked
+
+ self:SetScript ("OnUpdate", build_mode_list)
+end
+
+local modo_selecao_on_leave = function (self)
+
+ local instancia = self._instance or self.widget._instance
+ local baseframe = instancia.baseframe
+
+ OnLeaveMainWindow (instancia, self, 3)
+
+ hide_anti_overlap (instancia.baseframe.anti_menu_overlap)
+
+ if (instancia.desaturated_menu) then
+ self:GetNormalTexture():SetDesaturated (true)
+ end
+
+ GameCooltip.buttonOver = false
+ baseframe.cabecalho.button_mouse_over = false
+
+ if (GameCooltip.active) then
+ parameters_table [2] = 0
+ self:SetScript ("OnUpdate", on_leave_menu)
+ else
+ self:SetScript ("OnUpdate", nil)
+ end
+end
+
function gump:CriaCabecalho (baseframe, instancia)
baseframe.cabecalho = {}
@@ -7642,14 +7952,21 @@ function gump:CriaCabecalho (baseframe, instancia)
local CoolTip = _G.GameCooltip
--> SELEÇÃO DO MODO ----------------------------------------------------------------------------------------------------------------------------------------------------
-
- local open_options_panel = function()
- _detalhes:OpenOptionsWindow (instancia)
+ local modo_selecao_button_click = function()
+ if (_detalhes.instances_menu_click_to_open) then
+ modo_selecao_on_enter (instancia.baseframe.cabecalho.modo_selecao.widget, _, true, true)
+ else
+ _detalhes:OpenOptionsWindow (instancia)
+ end
end
- baseframe.cabecalho.modo_selecao = gump:NewButton (baseframe, nil, "DetailsModeButton"..instancia.meu_id, nil, 16, 16, open_options_panel, nil, nil, [[Interface\AddOns\Details\images\modo_icone]])
+ baseframe.cabecalho.modo_selecao = gump:NewButton (baseframe, nil, "DetailsModeButton"..instancia.meu_id, nil, 16, 16, modo_selecao_button_click, nil, nil, [[Interface\AddOns\Details\images\modo_icone]])
baseframe.cabecalho.modo_selecao:SetPoint ("bottomleft", baseframe.cabecalho.ball, "bottomright", instancia.menu_anchor [1], instancia.menu_anchor [2])
baseframe.cabecalho.modo_selecao:SetFrameLevel (baseframe:GetFrameLevel()+5)
+ baseframe.cabecalho.modo_selecao.widget._instance = instancia
+
+ baseframe.cabecalho.modo_selecao:SetScript ("OnEnter", modo_selecao_on_enter)
+ baseframe.cabecalho.modo_selecao:SetScript ("OnLeave", modo_selecao_on_leave)
local b = baseframe.cabecalho.modo_selecao.widget
b:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
@@ -7657,70 +7974,24 @@ function gump:CriaCabecalho (baseframe, instancia)
b:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
b:GetHighlightTexture():SetTexCoord (0/256, 32/256, 0, 1)
b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
- b:GetPushedTexture():SetTexCoord (0/256, 32/256, 0, 1)
-
- --> Generating Cooltip menu from table template
+ b:GetPushedTexture():SetTexCoord (0/256, 32/256, 0, 1)
- --> Cooltip raw method for enter/leave show/hide
- baseframe.cabecalho.modo_selecao:SetScript ("OnEnter", function (self)
-
- --gump:Fade (baseframe.button_stretch, "alpha", 0.3)
- OnEnterMainWindow (instancia, self, 3)
-
- if (instancia.desaturated_menu) then
- self:GetNormalTexture():SetDesaturated (false)
- end
-
- _G.GameCooltip.buttonOver = true
- baseframe.cabecalho.button_mouse_over = true
-
- local passou = 0
- if (_G.GameCooltip.active) then
- passou = 0.15
- end
-
- local checked
- if (instancia.modo == 1) then
- checked = 4
- elseif (instancia.modo == 2) then
- checked = 1
- elseif (instancia.modo == 3) then
- checked = 2
- elseif (instancia.modo == 4) then
- checked = 3
- end
-
- parameters_table [1] = instancia
- parameters_table [2] = passou
- parameters_table [3] = checked
-
- self:SetScript ("OnUpdate", build_mode_list)
- end)
-
- baseframe.cabecalho.modo_selecao:SetScript ("OnLeave", function (self)
- OnLeaveMainWindow (instancia, self, 3)
-
- hide_anti_overlap (instancia.baseframe.anti_menu_overlap)
-
- if (instancia.desaturated_menu) then
- self:GetNormalTexture():SetDesaturated (true)
- end
-
- _G.GameCooltip.buttonOver = false
- baseframe.cabecalho.button_mouse_over = false
-
- if (_G.GameCooltip.active) then
- parameters_table [2] = 0
- self:SetScript ("OnUpdate", on_leave_menu)
- else
- self:SetScript ("OnUpdate", nil)
- end
- end)
--> SELECIONAR O SEGMENTO ----------------------------------------------------------------------------------------------------------------------------------------------------
- baseframe.cabecalho.segmento = gump:NewButton (baseframe, nil, "DetailsSegmentButton"..instancia.meu_id, nil, 16, 16, _detalhes.empty_function, nil, nil, [[Interface\AddOns\Details\images\segmentos_icone]])
+ local segmento_button_click = function()
+ if (_detalhes.instances_menu_click_to_open) then
+ segmento_on_enter (instancia.baseframe.cabecalho.segmento.widget, _, true, true)
+ end
+ end
+
+ baseframe.cabecalho.segmento = gump:NewButton (baseframe, nil, "DetailsSegmentButton"..instancia.meu_id, nil, 16, 16, segmento_button_click, nil, nil, [[Interface\AddOns\Details\images\segmentos_icone]])
baseframe.cabecalho.segmento:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1)
+ baseframe.cabecalho.segmento.widget._instance = instancia
+ baseframe.cabecalho.segmento:SetPoint ("left", baseframe.cabecalho.modo_selecao, "right", 0, 0)
+ baseframe.cabecalho.segmento:SetScript ("OnEnter", segmento_on_enter)
+ baseframe.cabecalho.segmento:SetScript ("OnLeave", segmento_on_leave)
+
local b = baseframe.cabecalho.segmento.widget
b:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
b:GetNormalTexture():SetTexCoord (32/256, 64/256, 0, 1)
@@ -7728,102 +7999,21 @@ function gump:CriaCabecalho (baseframe, instancia)
b:GetHighlightTexture():SetTexCoord (32/256, 64/256, 0, 1)
b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
b:GetPushedTexture():SetTexCoord (32/256, 64/256, 0, 1)
-
- baseframe.cabecalho.segmento:SetHook ("OnMouseUp", function (button, buttontype)
-
- if (buttontype == "LeftButton") then
-
- local segmento_goal = instancia.segmento + 1
- if (segmento_goal > segments_used) then
- segmento_goal = -1
- elseif (segmento_goal > _detalhes.segments_amount) then
- segmento_goal = -1
- end
-
- local total_shown = segments_filled+2
- local goal = segmento_goal+1
-
- local select_ = math.abs (goal - total_shown)
- GameCooltip:Select (1, select_)
-
- return instancia:TrocaTabela (segmento_goal)
- elseif (buttontype == "RightButton") then
-
- local segmento_goal = instancia.segmento - 1
- if (segmento_goal < -1) then
- segmento_goal = segments_used
- end
-
- local total_shown = segments_filled+2
- local goal = segmento_goal+1
-
- local select_ = math.abs (goal - total_shown)
- GameCooltip:Select (1, select_)
-
- return instancia:TrocaTabela (segmento_goal)
-
- elseif (buttontype == "MiddleButton") then
-
- local segmento_goal = 0
-
- local total_shown = segments_filled+2
- local goal = segmento_goal+1
-
- local select_ = math.abs (goal - total_shown)
- GameCooltip:Select (1, select_)
-
- return instancia:TrocaTabela (segmento_goal)
-
- end
- end)
- baseframe.cabecalho.segmento:SetPoint ("left", baseframe.cabecalho.modo_selecao, "right", 0, 0)
-
- --> Cooltip raw method for show/hide onenter/onhide
- baseframe.cabecalho.segmento:SetScript ("OnEnter", function (self)
- --gump:Fade (baseframe.button_stretch, "alpha", 0.3)
- OnEnterMainWindow (instancia, self, 3)
-
- if (instancia.desaturated_menu) then
- self:GetNormalTexture():SetDesaturated (false)
- end
-
- _G.GameCooltip.buttonOver = true
- baseframe.cabecalho.button_mouse_over = true
-
- local passou = 0
- if (_G.GameCooltip.active) then
- passou = 0.15
- end
-
- parameters_table [1] = instancia
- parameters_table [2] = passou
- self:SetScript ("OnUpdate", build_segment_list)
- end)
-
- --> Cooltip raw method
- baseframe.cabecalho.segmento:SetScript ("OnLeave", function (self)
- --gump:Fade (baseframe.button_stretch, -1)
- OnLeaveMainWindow (instancia, self, 3)
-
- hide_anti_overlap (instancia.baseframe.anti_menu_overlap)
-
- if (instancia.desaturated_menu) then
- self:GetNormalTexture():SetDesaturated (true)
- end
-
- _G.GameCooltip.buttonOver = false
- baseframe.cabecalho.button_mouse_over = false
-
- if (_G.GameCooltip.active) then
- parameters_table [2] = 0
- self:SetScript ("OnUpdate", on_leave_menu)
- else
- self:SetScript ("OnUpdate", nil)
- end
- end)
--> SELECIONAR O ATRIBUTO ----------------------------------------------------------------------------------------------------------------------------------------------------
- baseframe.cabecalho.atributo = gump:NewButton (baseframe, nil, "DetailsAttributeButton"..instancia.meu_id, nil, 16, 16, instancia.TrocaTabela, instancia, -3, [[Interface\AddOns\Details\images\sword]])
+ local atributo_button_click = function()
+ if (_detalhes.instances_menu_click_to_open) then
+ atributo_on_enter (instancia.baseframe.cabecalho.atributo.widget, _, true, true)
+ end
+ end
+
+ baseframe.cabecalho.atributo = gump:NewButton (baseframe, nil, "DetailsAttributeButton"..instancia.meu_id, nil, 16, 16, atributo_button_click)
+ baseframe.cabecalho.atributo:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1)
+ baseframe.cabecalho.atributo.widget._instance = instancia
+ baseframe.cabecalho.atributo:SetPoint ("left", baseframe.cabecalho.segmento.widget, "right", 0, 0)
+
+ baseframe.cabecalho.atributo:SetScript ("OnEnter", atributo_on_enter)
+ baseframe.cabecalho.atributo:SetScript ("OnLeave", atributo_on_leave)
local b = baseframe.cabecalho.atributo.widget
b:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
@@ -7833,179 +8023,51 @@ function gump:CriaCabecalho (baseframe, instancia)
b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
b:GetPushedTexture():SetTexCoord (68/256, 93/256, 0, 1)
- --baseframe.cabecalho.atributo = gump:NewDetailsButton (baseframe, _, instancia, instancia.TrocaTabela, instancia, -3, 16, 16, [[Interface\AddOns\Details\images\sword]])
- baseframe.cabecalho.atributo:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1)
- baseframe.cabecalho.atributo:SetPoint ("left", baseframe.cabecalho.segmento.widget, "right", 0, 0)
-
- --> Cooltip automatic method through Injection
-
- --> First we declare the function which will build the menu
- local BuildAttributeMenu = function()
- if (_detalhes.solo and _detalhes.solo == instancia.meu_id) then
- _detalhes:MontaSoloOption (instancia)
- elseif (instancia:IsRaidMode()) then
- local have_plugins = _detalhes:MontaRaidOption (instancia)
- if (not have_plugins) then
- GameCooltip:SetType ("tooltip")
- GameCooltip:SetOption ("ButtonsYMod", 0)
- GameCooltip:SetOption ("YSpacingMod", 0)
- GameCooltip:SetOption ("TextHeightMod", 0)
- GameCooltip:SetOption ("IgnoreButtonAutoHeight", false)
- GameCooltip:AddLine ("All raid plugins already\nin use or disabled.", nil, 1, "white", nil, 10, SharedMedia:Fetch ("font", "Friz Quadrata TT"))
- GameCooltip:AddIcon ([[Interface\GROUPFRAME\UI-GROUP-ASSISTANTICON]], 1, 1)
- GameCooltip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true)
- end
- else
- _detalhes:MontaAtributosOption (instancia)
- end
-
- GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color)
- GameCooltip:SetBackdrop (2, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color)
- end
-
- --> Now we create a table with some parameters
- --> your frame need to have a member called CoolTip
- baseframe.cabecalho.atributo.CoolTip = {
- Type = "menu", --> the type, menu tooltip tooltipbars
- BuildFunc = BuildAttributeMenu, --> called when user mouse over the frame
- OnEnterFunc = function (self)
- baseframe.cabecalho.button_mouse_over = true;
- OnEnterMainWindow (instancia, baseframe.cabecalho.atributo, 3)
- show_anti_overlap (instancia, self, "top")
- if (instancia.desaturated_menu) then
- self:GetNormalTexture():SetDesaturated (false)
- end
- end,
- OnLeaveFunc = function (self)
- baseframe.cabecalho.button_mouse_over = false;
- OnLeaveMainWindow (instancia, baseframe.cabecalho.atributo, 3)
- hide_anti_overlap (instancia.baseframe.anti_menu_overlap)
- if (instancia.desaturated_menu) then
- self:GetNormalTexture():SetDesaturated (true)
- end
- end,
- FixedValue = instancia,
- ShowSpeed = 0.15,
- Options = function()
- _detalhes:SetMenuOwner (baseframe.cabecalho.atributo.widget, instancia)
- if (instancia.toolbar_side == 1) then --top
- return {TextSize = _detalhes.font_sizes.menus}
- elseif (instancia.toolbar_side == 2) then --bottom
- return {TextSize = _detalhes.font_sizes.menus, HeightAnchorMod = 0} -- -7
- end
- end}
-
- --> install cooltip
- _G.GameCooltip:CoolTipInject (baseframe.cabecalho.atributo)
-
--> REPORTAR ~report ----------------------------------------------------------------------------------------------------------------------------------------------------
- baseframe.cabecalho.report = gump:NewButton (baseframe, nil, "DetailsReportButton"..instancia.meu_id, nil, 8, 16, _detalhes.Reportar, instancia, "INSTANCE" .. instancia.meu_id, [[Interface\Addons\Details\Images\report_button]])
-
- local b = baseframe.cabecalho.report.widget
- b:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
- b:GetNormalTexture():SetTexCoord (96/256, 128/256, 0, 1)
- b:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
- b:GetHighlightTexture():SetTexCoord (96/256, 128/256, 0, 1)
- b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
- b:GetPushedTexture():SetTexCoord (96/256, 128/256, 0, 1)
-
- --baseframe.cabecalho.report = gump:NewDetailsButton (baseframe, _, instancia, _detalhes.Reportar, instancia, nil, 16, 16, [[Interface\COMMON\VOICECHAT-ON]])
- baseframe.cabecalho.report:SetPoint ("left", baseframe.cabecalho.atributo, "right", -6, 0)
- baseframe.cabecalho.report:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1)
- baseframe.cabecalho.report:SetScript ("OnEnter", function (self)
- OnEnterMainWindow (instancia, self, 3)
- if (instancia.desaturated_menu) then
- self:GetNormalTexture():SetDesaturated (false)
- end
-
- GameCooltip.buttonOver = true
- baseframe.cabecalho.button_mouse_over = true
-
- GameCooltip:Reset()
-
- GameCooltip:SetType ("menu")
- GameCooltip:SetOption ("ButtonsYMod", -3)
- GameCooltip:SetOption ("YSpacingMod", 0)
- GameCooltip:SetOption ("TextHeightMod", 0)
- GameCooltip:SetOption ("IgnoreButtonAutoHeight", false)
-
- GameCooltip:SetOption ("ButtonsYMod", -7)
- GameCooltip:SetOption ("HeighMod", 8)
-
- _detalhes:CheckLastReportsIntegrity()
-
- local last_reports = _detalhes.latest_report_table
- if (#last_reports > 0) then
- for index = #last_reports, 1, -1 do
- local report = last_reports [index]
- local instance_number, attribute, subattribute, amt, report_where, custom_name = unpack (report)
-
- local name = _detalhes:GetSubAttributeName (attribute, subattribute, custom_name)
-
- local artwork = _detalhes.GetReportIconAndColor (report_where)
-
- GameCooltip:AddLine (name .. " (#" .. amt .. ")", nil, 1, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus)
- if (artwork) then
- GameCooltip:AddIcon (artwork.icon, 1, 1, 14, 14, artwork.coords[1], artwork.coords[2], artwork.coords[3], artwork.coords[4], artwork.color, nil, false)
- end
- GameCooltip:AddMenu (1, _detalhes.ReportFromLatest, index)
- end
-
- GameCooltip:AddLine ("$div")
- end
-
- GameCooltip:AddLine (Loc ["STRING_REPORT_TOOLTIP"], nil, 1, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus)
- GameCooltip:AddIcon ([[Interface\Addons\Details\Images\report_button]], 1, 1, 12, 19)
- GameCooltip:AddMenu (1, _detalhes.Reportar, instancia, nil, "INSTANCE" .. instancia.meu_id)
-
- GameCooltip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true)
- GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color)
-
- show_anti_overlap (instancia, self, "top")
- _detalhes:SetMenuOwner (self, instancia)
-
- GameCooltip:ShowCooltip()
-
- end)
- baseframe.cabecalho.report:SetScript ("OnLeave", function (self)
-
- OnLeaveMainWindow (instancia, self, 3)
-
- hide_anti_overlap (instancia.baseframe.anti_menu_overlap)
-
- GameCooltip.buttonOver = false
- baseframe.cabecalho.button_mouse_over = false
-
- if (instancia.desaturated_menu) then
- self:GetNormalTexture():SetDesaturated (true)
- end
-
- if (GameCooltip.active) then
- parameters_table [2] = 0
- self:SetScript ("OnUpdate", on_leave_menu)
- else
- self:SetScript ("OnUpdate", nil)
- end
-
- end)
+ local report_func = function()
+ instancia:Reportar ("INSTANCE" .. instancia.meu_id)
+ end
+ baseframe.cabecalho.report = gump:NewButton (baseframe, nil, "DetailsReportButton"..instancia.meu_id, nil, 8, 16, report_func)
+ baseframe.cabecalho.report:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1)
+ baseframe.cabecalho.report.widget._instance = instancia
+ baseframe.cabecalho.report:SetPoint ("left", baseframe.cabecalho.atributo, "right", -6, 0)
+ baseframe.cabecalho.report:SetScript ("OnEnter", report_on_enter)
+ baseframe.cabecalho.report:SetScript ("OnLeave", report_on_leave)
+ local b = baseframe.cabecalho.report.widget
+ b:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
+ b:GetNormalTexture():SetTexCoord (96/256, 128/256, 0, 1)
+ b:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
+ b:GetHighlightTexture():SetTexCoord (96/256, 128/256, 0, 1)
+ b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
+ b:GetPushedTexture():SetTexCoord (96/256, 128/256, 0, 1)
+
+
-- ~delete ~erase ~reset
--> reset ----------------------------------------------------------------------------------------------------------------------------------------------------
+ local reset_func = function()
+ if (_detalhes.instances_menu_click_to_open) then
+ reset_button_onenter (instancia.baseframe.cabecalho.reset, _, true, true)
+ else
+ if (not _detalhes.disable_reset_button) then
+ _detalhes.tabela_historico:resetar()
+ else
+ _detalhes:Msg (Loc ["STRING_OPTIONS_DISABLED_RESET"])
+ end
+ end
+ end
+
baseframe.cabecalho.reset = CreateFrame ("button", "DetailsClearSegmentsButton" .. instancia.meu_id, baseframe)
baseframe.cabecalho.reset:SetFrameLevel (baseframe.UPFrame:GetFrameLevel()+1)
baseframe.cabecalho.reset:SetSize (10, 16)
baseframe.cabecalho.reset:SetPoint ("right", baseframe.cabecalho.novo, "left")
baseframe.cabecalho.reset.instance = instancia
- baseframe.cabecalho.reset:SetScript ("OnClick", function()
- if (not _detalhes.disable_reset_button) then
- _detalhes.tabela_historico:resetar()
- else
- _detalhes:Msg (Loc ["STRING_OPTIONS_DISABLED_RESET"])
- end
- end)
+ baseframe.cabecalho.reset._instance = instancia
+
+ baseframe.cabecalho.reset:SetScript ("OnClick", reset_func)
baseframe.cabecalho.reset:SetScript ("OnEnter", reset_button_onenter)
baseframe.cabecalho.reset:SetScript ("OnLeave", reset_button_onleave)
@@ -8016,8 +8078,5 @@ function gump:CriaCabecalho (baseframe, instancia)
b:GetHighlightTexture():SetTexCoord (128/256, 160/256, 0, 1)
b:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
b:GetPushedTexture():SetTexCoord (128/256, 160/256, 0, 1)
-
---> fim botão reset
-
end
diff --git a/gumps/switch.lua b/gumps/switch.lua
index 070e82a3..7c04d1ea 100644
--- a/gumps/switch.lua
+++ b/gumps/switch.lua
@@ -642,7 +642,7 @@ end
--return _detalhes:FastSwitch (paramTable)
end
-
+
end
function _detalhes:FastSwitch (button, bookmark, bookmark_number, select_new)
@@ -659,8 +659,9 @@ function _detalhes:FastSwitch (button, bookmark, bookmark_number, select_new)
GameCooltip:SetColor (1, {.1, .1, .1, .3})
GameCooltip:SetColor (2, {.1, .1, .1, .3})
GameCooltip:SetOption ("HeightAnchorMod", -7)
- GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, backgroundColor, _detalhes.tooltip_border_color)
- GameCooltip:SetBackdrop (2, _detalhes.tooltip_backdrop, backgroundColor, _detalhes.tooltip_border_color)
+ GameCooltip:SetOption ("TextSize", _detalhes.font_sizes.menus)
+ GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color)
+ GameCooltip:SetBackdrop (2, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color)
return GameCooltip:ShowCooltip()
end
@@ -720,6 +721,11 @@ local add_coords = {464/512, 473/512, 1/512, 11/512}
function _detalhes.switch:Update()
+ if (not _detalhes.switch.vertical_amt) then
+ --wasn't opened yet, so doesn't matter if we update or not.
+ return
+ end
+
local slots = _detalhes.switch.slots
local x = 10
local y = 5
@@ -1094,6 +1100,7 @@ function _detalhes.switch:NewSwitchButton (frame, index, x, y, rightButton)
button.line:SetWidth (85)
button.line:SetPoint ("topleft", button, "topright", fundo_x-14, 0)
button.line:SetPoint ("bottomleft", button, "bottomright", fundo_x, fundo_y)
+ button.line:SetAlpha (0.6)
--fundo marrom 2
button.line2 = button:CreateTexture (nil, "background")
diff --git a/plugins/Details_DmgRank/Details_DmgRank.lua b/plugins/Details_DmgRank/Details_DmgRank.lua
index 16f979bd..aa843896 100644
--- a/plugins/Details_DmgRank/Details_DmgRank.lua
+++ b/plugins/Details_DmgRank/Details_DmgRank.lua
@@ -273,7 +273,6 @@ local function CreatePluginFrames (data)
--> background da badge e titulo
local bg1 = DetailsFrameWork:NewPanel (DmgRankFrame, _, "DetailsDmgRankBadgeBackground", _, 280, 75)
bg1:SetPoint ("topleft", DmgRankFrame, 10, -10)
- bg1:DisableGradient()
local GlowFrame = CreateFrame ("frame", "DetailsRankUpGlowFrame", bg1.widget, "DetailsAlertRankUpTemplate")
GlowFrame:SetPoint ("topleft", bg1.widget)
diff --git a/plugins/Details_EncounterDetails/frames.lua b/plugins/Details_EncounterDetails/frames.lua
index 6391f3c1..2f4c437e 100644
--- a/plugins/Details_EncounterDetails/frames.lua
+++ b/plugins/Details_EncounterDetails/frames.lua
@@ -1004,7 +1004,7 @@ do
--> revisar
BossFrame.Reset = function()
- BossFrame.switch ("main")
+ BossFrame.switch (nil, nil, "main")
if (_G.DetailsRaidDpsGraph) then
_G.DetailsRaidDpsGraph:ResetData()
end
@@ -1021,7 +1021,18 @@ do
local emote_segment = 1
local searching
- BossFrame.switch = function (to)
+ BossFrame.switch = function (to, _, to2)
+ if (type (to) == "string") then
+ to = to
+ elseif (type (to2) == "string") then
+ to = to2
+ end
+
+ BossFrame.DBMBars:Hide()
+ BossFrame.BigWigsBars:Hide()
+ BossFrame.label_dbm_bars:Hide()
+ BossFrame.label_bw_bars:Hide()
+
if (to == "main") then
local bg_texture = BossFrame.bg_main
@@ -1107,6 +1118,11 @@ do
BossFrame.segmentosDropdown:Enable()
+ BossFrame.DBMBars:Show()
+ BossFrame.BigWigsBars:Show()
+ BossFrame.label_dbm_bars:Show()
+ BossFrame.label_bw_bars:Show()
+
BossFrame.DBMBars:Refresh()
BossFrame.BigWigsBars:Refresh()
@@ -1680,7 +1696,7 @@ do
GameTooltip:Hide()
end
- local create_aura_func = function (spellid, encounter_id, self)
+ local create_aura_func = function (self, button, spellid, encounter_id)
local name, _, icon = EncounterDetails.getspellinfo (spellid)
EncounterDetails:OpenAuraPanel (spellid, name, self and self.MyObject._icon.texture, encounter_id)
end
@@ -1914,6 +1930,9 @@ do
local label_bw_bars = DetailsFrameWork:CreateLabel (BossFrame, "Big Wigs Bars:", 11, nil, "GameFontHighlightSmall")
label_bw_bars:SetPoint ("topleft", BossFrame, "topleft", 25, -205)
+ BossFrame.label_dbm_bars = label_dbm_bars
+ BossFrame.label_bw_bars = label_bw_bars
+
local on_select_dbm_bar = function (_, _, timer_id)
local timer_table = EncounterDetails.db.encounter_timers_dbm [timer_id]
local spell = tonumber (timer_id:match ("(%d+)"))
@@ -2007,6 +2026,11 @@ do
local dropdown_bw_bars = DetailsFrameWork:NewDropDown (BossFrame, _, "$parentBigWigsBarsDropdown", "BigWigsBars", 160, 20, build_bigwigs_bars, 1)
dropdown_bw_bars:SetPoint ("topleft", label_bw_bars, "bottomleft", -1, -2)
+ dropdown_dbm_bars:Hide()
+ dropdown_bw_bars:Hide()
+ label_dbm_bars:Hide()
+ label_bw_bars:Hide()
+
--
tinsert (BossFrame.EnemySpellsWidgets, EnemyActorSpells_label)
diff --git a/plugins/Details_TimeAttack/Details_TimeAttack.lua b/plugins/Details_TimeAttack/Details_TimeAttack.lua
index 2dde24eb..0fd7d57d 100644
--- a/plugins/Details_TimeAttack/Details_TimeAttack.lua
+++ b/plugins/Details_TimeAttack/Details_TimeAttack.lua
@@ -179,7 +179,6 @@ local function CreatePluginFrames()
bg1:SetBackdropColor ({.95, .95, .95, .6})
bg1:SetPoint ("center", TimeAttackFrame, 0, 50)
--> default panel options come with enabled gradiens, we want to disable this
- bg1:DisableGradient()
--> this is the main table wich will hold the times and labels also is a class
local HistoryPanelObject = {
@@ -194,7 +193,7 @@ local function CreatePluginFrames()
--> build the button to switch between recent times and saved times
local displayTipes = {Loc ["STRING_RECENTLY"], Loc ["STRING_SAVED"]}
local switchButton
- local function changedisplay (param)
+ local function changedisplay (self, button, param)
HistoryPanelObject.NowShowing = param
HistoryPanelObject:Refresh()
--HistoryPanelObject.NowShowing = math.abs (HistoryPanelObject.NowShowing-3)
@@ -221,7 +220,7 @@ local function CreatePluginFrames()
--> select realm history type
local on_select_historytype = function (_, _, type)
TimeAttack.db.realm_last_shown = type
- changedisplay (3)
+ changedisplay (_, _, 3)
end
local menu = {
{value = 40, icon = icon, iconcolor = "orange", texcoord = textcoord, label = "40 seconds", onclick = on_select_historytype},
@@ -362,7 +361,7 @@ local function CreatePluginFrames()
end
--> remove a saved or recently time
- local remove = function (index)
+ local remove = function (self, button, index)
if (HistoryPanelObject.NowShowing == 1) then --> recently
table.remove (HistoryPanelObject.Recently, index)
else --> history
@@ -372,7 +371,7 @@ local function CreatePluginFrames()
end
--> save a recently time
- local save = function (RecentlyIndex)
+ local save = function (self, button, RecentlyIndex)
if (RecentlyIndex) then --> click on any label
local ToSaveTimeObject = HistoryPanelObject.Recently [RecentlyIndex]
if (ToSaveTimeObject and not ToSaveTimeObject.FinishSaved) then
@@ -629,7 +628,7 @@ local function CreatePluginFrames()
end
- local WriteNoteStart = function (index)
+ local WriteNoteStart = function (self, button, index)
if (HistoryPanelObject.NowShowing == 1 and HistoryPanelObject.Recently [index].note) then --> recently
NoteInsertField:SetText (HistoryPanelObject.Recently [index].note)
@@ -658,7 +657,6 @@ local function CreatePluginFrames()
{tile = true, tileSize = 16, bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background"}, {.1, .1, .1, .3})
LabelBackground:SetPoint ("topleft", TimeAttackFrame, TimeAttack.HistoryX, TimeAttack.HistoryY)
- LabelBackground.frame.Gradient.OnEnter = {.9, .9, .9, 1}
LabelBackground.frame:SetFrameLevel (bg1.frame:GetFrameLevel()+1)
LabelBackground:SetHook ("OnEnter", OnEnterHook)
diff --git a/startup.lua b/startup.lua
index 92bee232..e69da40e 100644
--- a/startup.lua
+++ b/startup.lua
@@ -605,25 +605,6 @@ function _G._detalhes:Start()
_detalhes.AddOnStartTime = GetTime()
---[[
- local a = CreateFrame ("frame")
- a:RegisterEvent ("PLAYER_REGEN_ENABLED")
- a:RegisterEvent ("PLAYER_REGEN_DISABLED")
- a:RegisterEvent ("ENCOUNTER_START")
- a:RegisterEvent ("ENCOUNTER_END")
-
- a:SetScript ("OnEvent", function (self, event, ...)
- print (event)
- end)
---]]
-
---[[
-function _detalhes:TestResize()
- _detalhes:OpenNewsWindow ("TESTE, |TInterface\\AddOns\\Details\\images\\key_shift:20:40:0:0:64:64:0:64:0:40|t")
-end
-_detalhes:ScheduleTimer ("TestResize", 3)
---]]
-
- local a,b=_detalhes.tooltip.header_statusbar,0.3;a[1]=b;a[2]=b;a[3]=b;a[4]=0.8;
end
+_detalhes.AddOnLoadFilesTime = GetTime()