- Updated Details! Framework.

- Added an option to make the menus on title bar work with clicks instead of hovering over them.
This commit is contained in:
Tercio
2015-08-21 17:47:39 -03:00
parent 2b8a7b079e
commit 02aa979b1c
61 changed files with 4711 additions and 2393 deletions
+1 -15
View File
@@ -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
+62
View File
@@ -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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

+147 -69
View File
@@ -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
+1 -1
View File
@@ -1,7 +1,7 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ .. \FrameXML\UI.xsd">
<Script file="button.lua"/>
<Button name="DetailsButtonTemplate" virtual="true">
<Button name="DetailsFrameworkButtonTemplate" virtual="true">
<Size x="100" y="20"/>
<Layers>
+7 -3
View File
@@ -1,8 +1,12 @@
do
local _detalhes = _G._detalhes
local gump = _detalhes.gump
gump.alias_text_colors = {
local DF = _G ["DetailsFramework"]
if (not DF or not DetailsFrameworkCanLoad) then
return
end
DF.alias_text_colors = {
["aliceblue"] = {0.941176, 0.972549, 1, 1},
["antiquewhite"] = {0.980392, 0.921569, 0.843137, 1},
["aqua"] = {0, 1, 1, 1},
+188 -117
View File
@@ -1,10 +1,10 @@
local _detalhes = _G._detalhes
local AceLocale = LibStub ("AceLocale-3.0")
local Loc = AceLocale:GetLocale ( "Details" )
local DF = _G ["DetailsFramework"]
if (not DF or not DetailsFrameworkCanLoad) then
return
end
local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
local gump = _detalhes.gump
local _
--lua locals
local _math_floor= math.floor
@@ -21,21 +21,22 @@ local _GetScreenWidth = GetScreenWidth
local _GetScreenHeight = GetScreenHeight
local _UIParent = UIParent
local _CreateFrame = CreateFrame
local _UISpecialFrames = UISpecialFrames
function DetailsCreateCoolTip()
local version = 2
if (_G.GameCooltip) then
return _G.GameCooltip
end
function DF:CreateCoolTip()
----------------------------------------------------------------------
--> Cooltip Startup
----------------------------------------------------------------------
if (_G.GameCooltip2 and _G.GameCooltip2.version >= version) then
return
end
--> Start Cooltip Table
local CoolTip = {}
_G.GameCooltip = CoolTip
local CoolTip = {version = version}
_G.GameCooltip2 = CoolTip
--> Containers
CoolTip.LeftTextTable = {}
@@ -53,6 +54,8 @@ function DetailsCreateCoolTip()
CoolTip.WallpaperTable = {}
CoolTip.WallpaperTableSub = {}
CoolTip.PopupFrameTable = {}
CoolTip.FunctionsTableMain = {} --> menus
CoolTip.FunctionsTableSub = {} --> menus
CoolTip.ParametersTableMain = {} --> menus
@@ -112,7 +115,6 @@ function DetailsCreateCoolTip()
["SelectedBottomAnchorMod"] = true,
["SelectedLeftAnchorMod"] = true,
["SelectedRightAnchorMod"] = true,
["MinButtonHeight"] = true,
}
CoolTip.OptionsTable = {}
@@ -148,28 +150,50 @@ function DetailsCreateCoolTip()
--> Create Frames
--> main frame
local frame1 = CreateFrame ("Frame", "GameCoolTipFrame1", UIParent, "CooltipMainFrameTemplate")
tinsert (UISpecialFrames, "GameCoolTipFrame1")
gump:CreateFlashAnimation (frame1)
local frame1
if (not GameCooltipFrame1) then
frame1 = CreateFrame ("Frame", "GameCooltipFrame1", UIParent, "DFCooltipMainFrameTemplate")
tinsert (UISpecialFrames, "GameCooltipFrame1")
DF:CreateFlashAnimation (frame1)
else
frame1 = GameCooltipFrame1
end
GameCooltipFrame1_FrameBackgroundCenter:SetTexture (DF.folder .. "cooltip_background")
GameCooltipFrame1_FrameBackgroundCenter:SetTexCoord (0.10546875, 0.89453125, 0, 1)
GameCooltipFrame1_FrameBackgroundLeft:SetTexture (DF.folder .. "cooltip_background")
GameCooltipFrame1_FrameBackgroundLeft:SetTexCoord (0, 0.103515625, 0, 1)
GameCooltipFrame1_FrameBackgroundRight:SetTexture (DF.folder .. "cooltip_background")
GameCooltipFrame1_FrameBackgroundRight:SetTexCoord (0.896484375, 1, 0, 1)
--> secondary frame
local frame2 = CreateFrame ("Frame", "GameCoolTipFrame2", UIParent, "CooltipMainFrameTemplate")
tinsert (UISpecialFrames, "GameCoolTipFrame2")
gump:CreateFlashAnimation (frame2)
frame2:SetClampedToScreen (true)
local frame2
if (not GameCooltipFrame2) then
frame2 = CreateFrame ("Frame", "GameCooltipFrame2", UIParent, "DFCooltipMainFrameTemplate")
tinsert (UISpecialFrames, "GameCooltipFrame2")
DF:CreateFlashAnimation (frame2)
frame2:SetClampedToScreen (true)
else
frame2 = GameCooltipFrame2
end
frame2:SetPoint ("bottomleft", frame1, "bottomright")
GameCooltipFrame2_FrameBackgroundCenter:SetTexture (DF.folder .. "cooltip_background")
GameCooltipFrame2_FrameBackgroundCenter:SetTexCoord (0.10546875, 0.89453125, 0, 1)
GameCooltipFrame2_FrameBackgroundLeft:SetTexture (DF.folder .. "cooltip_background")
GameCooltipFrame2_FrameBackgroundLeft:SetTexCoord (0, 0.103515625, 0, 1)
GameCooltipFrame2_FrameBackgroundRight:SetTexture (DF.folder .. "cooltip_background")
GameCooltipFrame2_FrameBackgroundRight:SetTexCoord (0.896484375, 1, 0, 1)
CoolTip.frame1 = frame1
CoolTip.frame2 = frame2
gump:Fade (frame1, 0)
gump:Fade (frame2, 0)
DF:Fade (frame1, 0)
DF:Fade (frame2, 0)
--> button containers
frame1.Lines = {}
frame2.Lines = {}
----------------------------------------------------------------------
--> Title Function
@@ -235,11 +259,12 @@ function DetailsCreateCoolTip()
if (CoolTip.Type ~= 1 and CoolTip.Type ~= 2) then --> menu
CoolTip.active = true
CoolTip.mouseOver = true
CoolTip.had_interaction = true
self:SetScript ("OnUpdate", nil)
gump:Fade (self, 0)
DF:Fade (self, 0)
--rever
if (CoolTip.sub_menus) then
gump:Fade (frame2, 0)
DF:Fade (frame2, 0)
end
end
end)
@@ -251,9 +276,10 @@ function DetailsCreateCoolTip()
if (CoolTip.Type ~= 1 and CoolTip.Type ~= 2) then
CoolTip.active = true
CoolTip.mouseOver = true
CoolTip.had_interaction = true
self:SetScript ("OnUpdate", nil)
gump:Fade (self, 0)
gump:Fade (frame1, 0)
DF:Fade (self, 0)
DF:Fade (frame1, 0)
end
end)
@@ -261,11 +287,11 @@ function DetailsCreateCoolTip()
elapsedTime = elapsedTime+elapsed
if (elapsedTime > 0.7) then
if (not CoolTip.active and not CoolTip.buttonClicked and self == CoolTip.Host) then
gump:Fade (self, 1)
gump:Fade (frame2, 1)
DF:Fade (self, 1)
DF:Fade (frame2, 1)
elseif (not CoolTip.active) then
gump:Fade (self, 1)
gump:Fade (frame2, 1)
DF:Fade (self, 1)
DF:Fade (frame2, 1)
end
self:SetScript ("OnUpdate", nil)
frame2:SetScript ("OnUpdate", nil)
@@ -291,11 +317,11 @@ function DetailsCreateCoolTip()
elapsedTime = elapsedTime+elapsed
if (elapsedTime > 0.7) then
if (not CoolTip.active and not CoolTip.buttonClicked and self == CoolTip.Host) then
gump:Fade (self, 1)
gump:Fade (frame2, 1)
DF:Fade (self, 1)
DF:Fade (frame2, 1)
elseif (not CoolTip.active) then
gump:Fade (self, 1)
gump:Fade (frame2, 1)
DF:Fade (self, 1)
DF:Fade (frame2, 1)
end
self:SetScript ("OnUpdate", nil)
frame1:SetScript ("OnUpdate", nil)
@@ -341,7 +367,7 @@ function DetailsCreateCoolTip()
end
function CoolTip:CreateButton (index, frame, name)
local new_button = CreateFrame ("Button", name, frame, "CooltipButtonTemplate")
local new_button = CreateFrame ("Button", name, frame, "DFCooltipButtonTemplate")
frame.Lines [index] = new_button
return new_button
end
@@ -360,25 +386,26 @@ function DetailsCreateCoolTip()
elapsedTime = elapsedTime+elapsed
if (elapsedTime > 0.7) then
if (not CoolTip.active and not CoolTip.buttonClicked) then
gump:Fade (frame1, 1)
gump:Fade (frame2, 1)
DF:Fade (frame1, 1)
DF:Fade (frame2, 1)
elseif (not CoolTip.active) then
gump:Fade (frame1, 1)
gump:Fade (frame2, 1)
DF:Fade (frame1, 1)
DF:Fade (frame2, 1)
end
frame1:SetScript ("OnUpdate", nil)
end
end
function CoolTip:NewMainButton (i)
local botao = CoolTip:CreateButton (i, frame1, "CooltipMainButton"..i)
local botao = CoolTip:CreateButton (i, frame1, "GameCooltipMainButton"..i)
--> serach key: ~onenter
botao:SetScript ("OnEnter", function()
if (CoolTip.Type ~= 1 and CoolTip.Type ~= 2 and not botao.isDiv) then
CoolTip.active = true
CoolTip.mouseOver = true
CoolTip.had_interaction = true
frame1:SetScript ("OnUpdate", nil)
frame2:SetScript ("OnUpdate", nil)
@@ -391,7 +418,13 @@ function DetailsCreateCoolTip()
botao.leftIcon:SetBlendMode ("BLEND")
end
if (CoolTip.IndexesSub [botao.index] and CoolTip.IndexesSub [botao.index] > 0) then
if (CoolTip.PopupFrameTable [botao.index]) then
local on_enter, on_leave, param1, param2 = unpack (CoolTip.PopupFrameTable [botao.index])
if (on_enter) then
xpcall (on_enter, geterrorhandler(), frame1, param1, param2)
end
elseif (CoolTip.IndexesSub [botao.index] and CoolTip.IndexesSub [botao.index] > 0) then
if (CoolTip.OptionsTable.SubMenuIsTooltip) then
CoolTip:ShowSub (botao.index)
botao.index = i
@@ -408,11 +441,12 @@ function DetailsCreateCoolTip()
else
--hide second frame
gump:Fade (frame2, 1)
DF:Fade (frame2, 1)
CoolTip.last_button = nil
end
else
CoolTip.mouseOver = true
CoolTip.had_interaction = true
end
end)
@@ -432,6 +466,13 @@ function DetailsCreateCoolTip()
botao.rightIcon:SetBlendMode ("BLEND")
end
if (CoolTip.PopupFrameTable [botao.index]) then
local on_enter, on_leave, param1, param2 = unpack (CoolTip.PopupFrameTable [botao.index])
if (on_leave) then
xpcall (on_leave, geterrorhandler(), frame1, param1, param2)
end
end
elapsedTime = 0
frame1:SetScript ("OnUpdate", OnLeaveUpdateButton)
--CoolTip:HideSub (i)
@@ -450,18 +491,18 @@ function DetailsCreateCoolTip()
elapsedTime = elapsedTime+elapsed
if (elapsedTime > 0.7) then
if (not CoolTip.active and not CoolTip.buttonClicked) then
gump:Fade (frame1, 1)
gump:Fade (frame2, 1)
DF:Fade (frame1, 1)
DF:Fade (frame2, 1)
elseif (not CoolTip.active) then
gump:Fade (frame1, 1)
gump:Fade (frame2, 1)
DF:Fade (frame1, 1)
DF:Fade (frame2, 1)
end
frame2:SetScript ("OnUpdate", nil)
end
end
function CoolTip:NewSecondaryButton (i)
local botao = CoolTip:CreateButton (i, frame2, "CooltipSecButton"..i)
local botao = CoolTip:CreateButton (i, frame2, "GameCooltipSecButton"..i)
botao:SetScript ("OnEnter", function()
if (CoolTip.OptionsTable.SubMenuIsTooltip) then
@@ -470,6 +511,7 @@ function DetailsCreateCoolTip()
if (CoolTip.Type ~= 1 and CoolTip.Type ~= 2 and not botao.isDiv) then
CoolTip.active = true
CoolTip.mouseOver = true
CoolTip.had_interaction = true
botao.background:Show()
@@ -482,10 +524,11 @@ function DetailsCreateCoolTip()
frame1:SetScript ("OnUpdate", nil)
frame2:SetScript ("OnUpdate", nil)
gump:Fade (frame1, 0)
gump:Fade (frame2, 0)
DF:Fade (frame1, 0)
DF:Fade (frame2, 0)
else
CoolTip.mouseOver = true
CoolTip.had_interaction = true
end
end)
@@ -618,7 +661,7 @@ function DetailsCreateCoolTip()
if (r == 0 and g == 0 and b == 0 and a == 0) then
if (CoolTip.OptionsTable.TextColor) then
r, g, b, a = gump:ParseColors (CoolTip.OptionsTable.TextColor)
r, g, b, a = DF:ParseColors (CoolTip.OptionsTable.TextColor)
menuButton.leftText:SetTextColor (r, g, b, a)
else
menuButton.leftText:SetTextColor (1, 1, 1, 1)
@@ -628,7 +671,7 @@ function DetailsCreateCoolTip()
end
if (CoolTip.OptionsTable.TextSize and not leftTextTable [6]) then
_detalhes:SetFontSize (menuButton.leftText, CoolTip.OptionsTable.TextSize)
DF:SetFontSize (menuButton.leftText, CoolTip.OptionsTable.TextSize)
end
if (CoolTip.OptionsTable.LeftTextWidth) then
@@ -689,10 +732,10 @@ function DetailsCreateCoolTip()
if (r == 0 and g == 0 and b == 0 and a == 0) then
if (CoolTip.OptionsTable.TextColorRight) then
r, g, b, a = gump:ParseColors (CoolTip.OptionsTable.TextColorRight)
r, g, b, a = DF:ParseColors (CoolTip.OptionsTable.TextColorRight)
menuButton.rightText:SetTextColor (r, g, b, a)
elseif (CoolTip.OptionsTable.TextColor) then
r, g, b, a = gump:ParseColors (CoolTip.OptionsTable.TextColor)
r, g, b, a = DF:ParseColors (CoolTip.OptionsTable.TextColor)
menuButton.rightText:SetTextColor (r, g, b, a)
else
menuButton.rightText:SetTextColor (1, 1, 1, 1)
@@ -702,7 +745,7 @@ function DetailsCreateCoolTip()
end
if (CoolTip.OptionsTable.TextSize and not rightTextTable [6]) then
_detalhes:SetFontSize (menuButton.rightText, CoolTip.OptionsTable.TextSize)
DF:SetFontSize (menuButton.rightText, CoolTip.OptionsTable.TextSize)
end
if (CoolTip.OptionsTable.RightTextWidth) then
@@ -759,7 +802,7 @@ function DetailsCreateCoolTip()
menuButton.leftIcon:SetHeight (leftIconTable [3])
menuButton.leftIcon:SetTexCoord (leftIconTable [4], leftIconTable [5], leftIconTable [6], leftIconTable [7])
local ColorR, ColorG, ColorB, ColorA = gump:ParseColors (leftIconTable [8])
local ColorR, ColorG, ColorB, ColorA = DF:ParseColors (leftIconTable [8])
menuButton.leftIcon:SetVertexColor (ColorR, ColorG, ColorB, ColorA)
if (CoolTip.OptionsTable.IconBlendMode) then
@@ -782,7 +825,7 @@ function DetailsCreateCoolTip()
menuButton.rightIcon:SetHeight (rightIconTable [3])
menuButton.rightIcon:SetTexCoord (rightIconTable [4], rightIconTable [5], rightIconTable [6], rightIconTable [7])
local ColorR, ColorG, ColorB, ColorA = gump:ParseColors (rightIconTable [8])
local ColorR, ColorG, ColorB, ColorA = DF:ParseColors (rightIconTable [8])
menuButton.rightIcon:SetVertexColor (ColorR, ColorG, ColorB, ColorA)
if (CoolTip.OptionsTable.IconBlendMode) then
@@ -868,12 +911,12 @@ function DetailsCreateCoolTip()
if (StatusBar [7]) then
menuButton.statusbar2:SetValue (StatusBar[7].value)
menuButton.statusbar2.texture:SetTexture (StatusBar[7].texture or [[Interface\AddOns\Details\images\bar4_reverse]])
menuButton.statusbar2.texture:SetTexture (StatusBar[7].texture or [[Interface\RaidFrame\Raid-Bar-Hp-Fill]])
if (StatusBar[7].specialSpark) then
menuButton.spark2:Show()
end
if (StatusBar[7].color) then
local ColorR, ColorG, ColorB, ColorA = gump:ParseColors (StatusBar[7].color)
local ColorR, ColorG, ColorB, ColorA = DF:ParseColors (StatusBar[7].color)
menuButton.statusbar2:SetStatusBarColor (ColorR, ColorG, ColorB, ColorA)
else
menuButton.statusbar2:SetStatusBarColor (1, 1, 1, 1)
@@ -885,19 +928,8 @@ function DetailsCreateCoolTip()
if (CoolTip.OptionsTable.StatusBarTexture) then
menuButton.statusbar.texture:SetTexture (CoolTip.OptionsTable.StatusBarTexture)
end
if (StatusBar[8]) then
if (StatusBar[8]:find ("\\")) then
menuButton.statusbar.texture:SetTexture (StatusBar[8])
else
local texture = SharedMedia:Fetch ("statusbar", StatusBar[8])
menuButton.statusbar.texture:SetTexture (texture)
end
else
if (not CoolTip.OptionsTable.StatusBarTexture) then
menuButton.statusbar.texture:SetTexture ("Interface\\PaperDollInfoFrame\\UI-Character-Skills-Bar")
end
menuButton.statusbar.texture:SetTexture ("Interface\\PaperDollInfoFrame\\UI-Character-Skills-Bar")
end
else
@@ -967,7 +999,7 @@ function DetailsCreateCoolTip()
menuButton:SetPoint ("left", frame2, "left")
menuButton:SetPoint ("right", frame2, "right")
gump:Fade (menuButton, 0)
DF:Fade (menuButton, 0)
--> string length
local stringWidth = menuButton.leftText:GetStringWidth() + menuButton.rightText:GetStringWidth() + menuButton.leftIcon:GetWidth() + menuButton.rightIcon:GetWidth()
@@ -985,8 +1017,8 @@ function DetailsCreateCoolTip()
function CoolTip:SetupWallpaper (wallpaperTable, wallpaper)
local texture = wallpaperTable [1]
if (gump:IsHtmlColor (texture) or type (texture) == "table") then
local r, g, b, a = gump:ParseColors (texture)
if (DF:IsHtmlColor (texture) or type (texture) == "table") then
local r, g, b, a = DF:ParseColors (texture)
wallpaper:SetTexture (r, g, b, a)
else
wallpaper:SetTexture (texture)
@@ -996,7 +1028,7 @@ function DetailsCreateCoolTip()
local color = wallpaperTable[6]
if (color) then
local r, g, b, a = gump:ParseColors (color)
local r, g, b, a = DF:ParseColors (color)
wallpaper:SetVertexColor (r, g, b, a)
else
wallpaper:SetVertexColor (1, 1, 1, 1)
@@ -1016,7 +1048,7 @@ function DetailsCreateCoolTip()
function CoolTip:ShowSub (index)
if (CoolTip.OptionsTable.IgnoreSubMenu) then
gump:Fade (frame2, 1)
DF:Fade (frame2, 1)
return
end
@@ -1038,7 +1070,7 @@ function DetailsCreateCoolTip()
--> pegar a fontsize da label principal
local mainButton = frame1.Lines [index]
local fontSize = _detalhes:GetFontSize (mainButton.leftText)
local fontSize = DF:GetFontSize (mainButton.leftText)
local GotChecked = false
@@ -1082,7 +1114,7 @@ function DetailsCreateCoolTip()
end
for i = CoolTip.IndexesSub [index] + 1, #frame2.Lines do
gump:Fade (frame2.Lines[i], 1)
DF:Fade (frame2.Lines[i], 1)
end
local spacing = 0
@@ -1094,7 +1126,9 @@ function DetailsCreateCoolTip()
for i = 1, CoolTip.IndexesSub [index] do
local menuButton = frame2.Lines [i]
-- CoolTipFrame2.Lines [2].divbar
if (menuButton.leftText:GetText() == "$div") then
--> height
@@ -1183,7 +1217,7 @@ function DetailsCreateCoolTip()
frame2:SetWidth (frame2.w + 44)
end
gump:Fade (frame2, 0)
DF:Fade (frame2, 0)
CoolTip:CheckOverlap()
@@ -1212,7 +1246,7 @@ function DetailsCreateCoolTip()
end
function CoolTip:HideSub()
gump:Fade (frame2, 1)
DF:Fade (frame2, 1)
end
@@ -1225,7 +1259,7 @@ function DetailsCreateCoolTip()
function CoolTip:monta_tooltip()
--> hide sub frame
gump:Fade (frame2, 1)
DF:Fade (frame2, 1)
--> hide select bar
CoolTip:HideSelectedTexture (frame1)
@@ -1296,21 +1330,14 @@ function DetailsCreateCoolTip()
elseif (CoolTip.OptionsTable.IgnoreButtonAutoHeight) then
local height = _math_max (menuButton.leftText:GetStringHeight(), menuButton.rightText:GetStringHeight(), menuButton.leftIcon:GetHeight(), menuButton.rightIcon:GetHeight())
if (CoolTip.OptionsTable.MinButtonHeight) then
height = max (CoolTip.OptionsTable.MinButtonHeight, height)
end
menuButton:SetHeight (height)
menuButton:SetPoint ("top", frame1, "top", 0, temp)
temp = temp + ( height * -1) + spacing + (CoolTip.OptionsTable.ButtonsYMod or 0)
else
local height = frame1.hHeight
if (CoolTip.OptionsTable.MinButtonHeight) then
height = max (CoolTip.OptionsTable.MinButtonHeight, height)
end
menuButton:SetHeight (height + (CoolTip.OptionsTable.ButtonHeightMod or 0))
menuButton:SetPoint ("top", frame1, "top", 0, ( ( (i-1) * height) * -1) - 6 + (CoolTip.OptionsTable.ButtonsYMod or 0) + spacing)
menuButton:SetHeight (frame1.hHeight + (CoolTip.OptionsTable.ButtonHeightMod or 0))
menuButton:SetPoint ("top", frame1, "top", 0, ( ( (i-1) * frame1.hHeight) * -1) - 6 + (CoolTip.OptionsTable.ButtonsYMod or 0) + spacing)
end
--> points
@@ -1355,7 +1382,7 @@ function DetailsCreateCoolTip()
elseif (CoolTip.OptionsTable.IgnoreButtonAutoHeight) then
frame1:SetHeight ( (temp+spacing) * -1)
else
frame1:SetHeight ( _math_max ( (frame1.hHeight * CoolTip.Indexes) + 12 + (spacing*-1), 22 ))
frame1:SetHeight ( _math_max ( (frame1.hHeight * CoolTip.Indexes) + 12, 22 ))
end
end
@@ -1366,7 +1393,7 @@ function DetailsCreateCoolTip()
end
--> unhide frame
gump:Fade (frame1, 0)
DF:Fade (frame1, 0)
CoolTip:SetMyPoint (host)
--> fix sparks
@@ -1396,7 +1423,7 @@ function DetailsCreateCoolTip()
if (CoolTip.Indexes == 0) then
CoolTip:Reset()
CoolTip:SetType ("tooltip")
CoolTip:AddLine (Loc ["STRING_COOLTIP_NOOPTIONS"])
CoolTip:AddLine ("There is no options.")
CoolTip:ShowCooltip()
return
end
@@ -1415,12 +1442,12 @@ function DetailsCreateCoolTip()
frame2.w = 0
frame2:SetHeight (6)
if (CoolTip.SelectedIndexMain and CoolTip.IndexesSub [CoolTip.SelectedIndexMain] and CoolTip.IndexesSub [CoolTip.SelectedIndexMain] > 0) then
gump:Fade (frame2, 0)
DF:Fade (frame2, 0)
else
gump:Fade (frame2, 1)
DF:Fade (frame2, 1)
end
else
gump:Fade (frame2, 1)
DF:Fade (frame2, 1)
end
CoolTip.active = true
@@ -1573,7 +1600,7 @@ function DetailsCreateCoolTip()
frame1.frameWallpaper:Hide()
end
gump:Fade (frame1, 0)
DF:Fade (frame1, 0)
for i = 1, CoolTip.Indexes do
if (CoolTip.SelectedIndexMain and CoolTip.SelectedIndexMain == i) then
@@ -1858,7 +1885,7 @@ function DetailsCreateCoolTip()
end
function CoolTip:SetColor (menuType, ...)
local ColorR, ColorG, ColorB, ColorA = gump:ParseColors (...)
local ColorR, ColorG, ColorB, ColorA = DF:ParseColors (...)
if ((type (menuType) == "string" and menuType == "main") or (type (menuType) == "number" and menuType == 1)) then
frame1.framebackgroundLeft:SetVertexColor (ColorR, ColorG, ColorB, ColorA)
frame1.framebackgroundRight:SetVertexColor (ColorR, ColorG, ColorB, ColorA)
@@ -1953,6 +1980,8 @@ function DetailsCreateCoolTip()
frame2:SetBackdropBorderColor (unpack (default_backdropborder_color))
--[
_table_wipe (CoolTip.PopupFrameTable)
_table_wipe (CoolTip.LeftTextTable)
_table_wipe (CoolTip.LeftTextTableSub)
_table_wipe (CoolTip.RightTextTable)
@@ -2004,9 +2033,6 @@ function DetailsCreateCoolTip()
local f1Lines = frame1.Lines
for i = 1, #f1Lines do
f1Lines [i].statusbar.subMenuArrow:Hide()
if (f1Lines [i].divbar) then
f1Lines [i].divbar:Hide()
end
end
end
@@ -2206,7 +2232,7 @@ function DetailsCreateCoolTip()
--> parameters: value [, color red, color green, color blue, color alpha [, glow]]
--> can also use a table or html color name in color red and send glow in color green
function CoolTip:AddStatusBar (statusbarValue, frame, ColorR, ColorG, ColorB, ColorA, statusbarGlow, backgroundBar, BarTexture)
function CoolTip:AddStatusBar (statusbarValue, frame, ColorR, ColorG, ColorB, ColorA, statusbarGlow, backgroundBar)
--> need a previous line
if (CoolTip.Indexes == 0) then
@@ -2219,12 +2245,10 @@ function DetailsCreateCoolTip()
end
if (type (ColorR) == "table" or type (ColorR) == "string") then
statusbarGlow, backgroundBar, BarTexture, ColorR, ColorG, ColorB, ColorA = ColorG, ColorB, ColorA, gump:ParseColors (ColorR)
statusbarGlow, backgroundBar, ColorR, ColorG, ColorB, ColorA = ColorG, ColorB, DF:ParseColors (ColorR)
elseif (type (ColorR) == "boolean") then
BarTexture = ColorB
backgroundBar = ColorG
statusbarGlow = ColorR
ColorR, ColorG, ColorB, ColorA = 1, 1, 1, 1
else
--> error
@@ -2281,7 +2305,6 @@ function DetailsCreateCoolTip()
statusbarTable [5] = ColorA
statusbarTable [6] = statusbarGlow
statusbarTable [7] = backgroundBar
statusbarTable [8] = BarTexture
end
@@ -2348,7 +2371,7 @@ function DetailsCreateCoolTip()
end
if (color) then
local r, g, b, a = gump:ParseColors (color)
local r, g, b, a = DF:ParseColors (color)
fontstring:SetTextColor (r, g, b, a)
end
@@ -2373,11 +2396,11 @@ function DetailsCreateCoolTip()
f:SetBackdrop (backdrop)
end
if (backdropcolor) then
local r, g, b, a = gump:ParseColors (backdropcolor)
local r, g, b, a = DF:ParseColors (backdropcolor)
f:SetBackdropColor (r, g, b, a)
end
if (bordercolor) then
local r, g, b, a = gump:ParseColors (bordercolor)
local r, g, b, a = DF:ParseColors (bordercolor)
f:SetBackdropBorderColor (r, g, b, a)
end
@@ -2532,6 +2555,17 @@ function DetailsCreateCoolTip()
return true
end
----------------------------------------------------------------------
--> popup frame
function CoolTip:AddPopUpFrame (func_on_show, func_on_hide, param1, param2)
-- act like a sub menu
if (CoolTip.Indexes > 0) then
CoolTip.PopupFrameTable [CoolTip.Indexes] = {func_on_show or false, func_on_hide or false, param1, param2}
end
end
----------------------------------------------------------------------
--> adds a line.
--> only works with cooltip type 1 and 2 (tooltip and tooltip with bars)
@@ -2570,7 +2604,7 @@ function DetailsCreateCoolTip()
if (type (ColorR1) == "boolean" or not ColorR1) then
ColorR1, ColorG1, ColorB1, ColorA1 = 0, 0, 0, 0
else
ColorR1, ColorG1, ColorB1, ColorA1 = gump:ParseColors (ColorR1)
ColorR1, ColorG1, ColorB1, ColorA1 = DF:ParseColors (ColorR1)
end
end
@@ -2580,7 +2614,7 @@ function DetailsCreateCoolTip()
if (type (ColorR2) == "boolean" or not ColorR2) then
ColorR2, ColorG2, ColorB2, ColorA2 = 0, 0, 0, 0
else
ColorR2, ColorG2, ColorB2, ColorA2 = gump:ParseColors (ColorR2)
ColorR2, ColorG2, ColorB2, ColorA2 = DF:ParseColors (ColorR2)
end
end
@@ -2783,11 +2817,14 @@ function DetailsCreateCoolTip()
--> serach key: ~start
function CoolTip:Show (frame, menuType, color)
CoolTip.had_interaction = false
return CoolTip:ShowCooltip (frame, menuType, color)
end
function CoolTip:ShowCooltip (frame, menuType, color)
CoolTip.had_interaction = false
if (frame) then
--> details framework
if (frame.dframework) then
@@ -2821,8 +2858,8 @@ function DetailsCreateCoolTip()
function CoolTip:Close()
CoolTip.active = false
CoolTip.Host = nil
gump:Fade (frame1, 1)
gump:Fade (frame2, 1)
DF:Fade (frame1, 1)
DF:Fade (frame2, 1)
end
@@ -2973,5 +3010,39 @@ function DetailsCreateCoolTip()
--> all done
CoolTip:ClearAllOptions()
local preset2_backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = DF.folder .. "border_3", tile=true,
edgeSize = 16, tileSize = 64, insets = {left = 3, right = 3, top = 4, bottom = 4}}
local white_table = {1, 1, 1, 1}
function CoolTip:Preset (number)
self:Reset()
if (number == 1) then
self:SetOption ("TextFont", "Friz Quadrata TT")
self:SetOption ("TextColor", "orange")
self:SetOption ("TextSize", 12)
self:SetOption ("ButtonsYMod", -4)
self:SetOption ("YSpacingMod", -4)
self:SetOption ("IgnoreButtonAutoHeight", true)
self:SetColor (1, 0.5, 0.5, 0.5, 0.5)
elseif (number == 2) then
self:SetOption ("TextFont", "Friz Quadrata TT")
self:SetOption ("TextColor", "orange")
self:SetOption ("TextSize", 12)
self:SetOption ("FixedWidth", 220)
self:SetOption ("ButtonsYMod", -4)
self:SetOption ("YSpacingMod", -4)
self:SetOption ("IgnoreButtonAutoHeight", true)
self:SetColor (1, 0.5, 0.5, 0.5, 0.5)
self:SetBackdrop (1, preset2_backdrop, nil, white_table)
end
end
return CoolTip
end
end
DF:CreateCoolTip()
@@ -1,7 +1,6 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ .. \FrameXML\UI.xsd">
<Script file="cooltip.lua"/>
<Frame name="CooltipMainFrameTemplate" virtual="true" frameStrata="TOOLTIP">
<Frame name="DFCooltipMainFrameTemplate" virtual="true" frameStrata="TOOLTIP">
<Size x="500" y="500"/>
<Anchors>
<Anchor point="CENTER" relativeTo="$parent" relativePoint="CENTER" x="0" y="0"/>
@@ -150,7 +149,7 @@
</Layers>
</Frame>
<Button name="CooltipButtonTemplate" virtual="true">
<Button name="DFCooltipButtonTemplate" virtual="true">
<Size x="1" y="20"/>
<Frames>
@@ -314,4 +313,6 @@
</Scripts>
</Button>
<Script file="cooltip.lua"/>
</Ui>
+123 -58
View File
@@ -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
+14 -14
View File
@@ -1,7 +1,7 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ .. \FrameXML\UI.xsd">
<Script file="dropdown.lua"/>
<Button name="DetailsDropDownTemplate" virtual="true">
<Button name="DetailsFrameworkDropDownTemplate" virtual="true">
<Size x="150" y="20"/>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
@@ -93,7 +93,7 @@
<Scripts>
<OnHide>
DetailsDropDownOptionsFrameOnHide (self);
DetailsFrameworkDropDownOptionsFrameOnHide (self);
</OnHide>
<OnLoad>
self:SetBackdropColor (0, 0, 0, 0.95);
@@ -119,8 +119,8 @@
<Layers>
<Layer level="BACKGROUND">
<!-- selected texture -->
<Texture name="$parent_SelectedTexture" parentKey="selected" hidden="true" file="Interface\AddOns\Details\framework\cooltip_background">
<!-- selected texture // we don't know where the file is it -->
<Texture name="$parent_SelectedTexture" parentKey="selected" hidden="true" file="Interface\RAIDFRAME\Raid-Bar-Hp-Fill">
<Size x="150" y="16" />
<!--<TexCoords left="0.31250000" right="0.78515625" top="0.00390625" bottom="0.36328125"/>-->
<Anchors>
@@ -160,33 +160,33 @@
</OnLoad>
<OnShow>
DetailsDropDownOnShow (self);
DetailsFrameworkDropDownOnShow (self);
</OnShow>
<OnHide>
DetailsDropDownOnHide (self);
DetailsFrameworkDropDownOnHide (self);
</OnHide>
<OnEnter>
DetailsDropDownOnEnter (self);
DetailsFrameworkDropDownOnEnter (self);
</OnEnter>
<OnLeave>
DetailsDropDownOnLeave (self);
DetailsFrameworkDropDownOnLeave (self);
</OnLeave>
<OnSizeChanged>
DetailsDropDownOnSizeChanged (self);
DetailsFrameworkDropDownOnSizeChanged (self);
</OnSizeChanged>
<OnMouseDown>
DetailsDropDownOnMouseDown (self);
DetailsFrameworkDropDownOnMouseDown (self);
</OnMouseDown>
</Scripts>
</Button>
<Button name="DetailsDropDownOptionTemplate" virtual="true" frameStrata="TOOLTIP">
<Button name="DetailsFrameworkDropDownOptionTemplate" virtual="true" frameStrata="TOOLTIP">
<Size x="150" y="20" />
<Layers>
@@ -222,15 +222,15 @@
<Scripts>
<OnMouseDown>
DetailsDropDownOptionClick (self);
DetailsFrameworkDropDownOptionClick (self);
</OnMouseDown>
<OnEnter>
DetailsDropDownOptionOnEnter (self);
DetailsFrameworkDropDownOptionOnEnter (self);
</OnEnter>
<OnLeave>
DetailsDropDownOptionOnLeave (self);
DetailsFrameworkDropDownOptionOnLeave (self);
</OnLeave>
</Scripts>
Binary file not shown.
+998
View File
@@ -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
+11 -5
View File
@@ -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
BIN
View File
Binary file not shown.
+47 -21
View File
@@ -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
+22
View File
@@ -0,0 +1,22 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd">
<Script file="fw.lua"/>
<Script file="addon.lua"/>
<Script file="colors.lua"/>
<Script file="help.lua"/>
<Script file="label.lua"/>
<Script file="picture.lua"/>
<Script file="slider.lua"/>
<Script file="scrollbar.lua"/>
<Include file="tutorial_alert.xml"/>
<Include file="split_bar.xml"/>
<Include file="textentry.xml"/>
<Include file="button.xml"/>
<Include file="cooltip.xml"/>
<Include file="dropdown.xml"/>
<Include file="normal_bar.xml"/>
<Include file="panel.xml"/>
<Script file="pictureedit.lua"/>
</Ui>
BIN
View File
Binary file not shown.
+18
View File
@@ -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
@@ -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
@@ -1,7 +1,7 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ .. \FrameXML\UI.xsd">
<Script file="normal_bar.lua"/>
<StatusBar name="DetailsNormalBarTemplate" virtual="true">
<StatusBar name="DetailsFrameworkNormalBarTemplate" virtual="true">
<Size x="300" y="14"/>
<Layers>
@@ -83,7 +83,7 @@
<Scripts>
<OnLoad>
self:SetStatusBarTexture (self.texture);
DetailsNormalBar_OnCreate (self);
DetailsFrameworkNormalBar_OnCreate (self);
</OnLoad>
</Scripts>
</StatusBar>
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -2,7 +2,7 @@
<Script file="panel.lua"/>
<Frame name="DetailsPanelTemplate" virtual="true">
<Frame name="DetailsFrameworkPanelTemplate" virtual="true">
<Size x="100" y="100"/>
+22 -20
View File
@@ -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)
@@ -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
+235
View File
@@ -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
+237 -68
View File
@@ -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
@@ -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
@@ -2,7 +2,7 @@
<Script file="split_bar.lua"/>
<StatusBar name="DetailsSplitBarTemplate" virtual="true">
<StatusBar name="DetailsFrameworkSplitBarTemplate" virtual="true">
<Size x="300" y="14"/>
<Layers>
@@ -74,7 +74,7 @@
self:SetStatusBarTexture (self.texture);
self:SetMinMaxValues (1, 100);
self:SetValue (50);
DetailsSplitlBar_OnCreate (self);
DetailsFrameworkSplitlBar_OnCreate (self);
</OnLoad>
</Scripts>
+98 -106
View File
@@ -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
@@ -2,7 +2,7 @@
<Script file="textentry.lua"/>
<EditBox name="DetailsEditBoxTemplate2" virtual="true">
<EditBox name="DetailsFrameworkEditBoxTemplate2" virtual="true">
<Size x="232" y="20"/>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
@@ -34,7 +34,7 @@
</EditBox>
<ScrollFrame name="DetailsEditBoxMultiLineTemplate" inherits="UIPanelScrollFrameTemplate" virtual="true">
<ScrollFrame name="DetailsFrameworkEditBoxMultiLineTemplate" inherits="UIPanelScrollFrameTemplate" virtual="true">
<Size x="232" y="20"/>
<ScrollChild>
<EditBox name="$parentEditBox" multiLine="true" letters="255" autoFocus="false" countInvisibleLetters="true" parentKey="editbox">
+247
View File
@@ -0,0 +1,247 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<!-- raw copy from MoP WatchFrames, got removed on WoD -->
<ScrollFrame name="DetailsFrameworkTutorialAlertFrameTemplate" enableMouse="true" virtual="true">
<Size x="224" y="72"/>
<Scripts>
<OnLoad>
self:SetHorizontalScroll(-28.5);
</OnLoad>
</Scripts>
<ScrollChild>
<Frame name="$parentScrollChild" parentKey="ScrollChild">
<Size x="190" y="60"/>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentBg" setAllPoints="true">
<Color r="0" g="0" b="0" a="0.5"/>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture name="$parentBorderTopLeft" file="Interface\QuestFrame\AutoQuest-Parts">
<Size x="16" y="16"/>
<TexCoords left="0.02539063" right="0.05664063" top="0.01562500" bottom="0.26562500"/>
<Anchors>
<Anchor point="TOPLEFT" x="-4" y="4" />
</Anchors>
</Texture>
<Texture name="$parentBorderTopRight" file="Interface\QuestFrame\AutoQuest-Parts">
<Size x="16" y="16"/>
<TexCoords left="0.02539063" right="0.05664063" top="0.29687500" bottom="0.54687500"/>
<Anchors>
<Anchor point="TOPRIGHT" x="4" y="4" />
</Anchors>
</Texture>
<Texture name="$parentBorderBotLeft" file="Interface\QuestFrame\AutoQuest-Parts">
<Size x="16" y="16"/>
<TexCoords left="0.02539063" right="0.05664063" top="0.57812500" bottom="0.82812500"/>
<Anchors>
<Anchor point="BOTTOMLEFT" x="-4" y="-4" />
</Anchors>
</Texture>
<Texture name="$parentBorderBotRight" file="Interface\QuestFrame\AutoQuest-Parts">
<Size x="16" y="16"/>
<TexCoords left="0.06054688" right="0.09179688" top="0.01562500" bottom="0.26562500"/>
<Anchors>
<Anchor point="BOTTOMRIGHT" x="4" y="-4"/>
</Anchors>
</Texture>
<Texture name="$parentBorderLeft" file="Interface\QuestFrame\AutoQuestToastBorder-LeftRight" vertTile="true">
<Size x="8" y="16"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentBorderTopLeft" relativePoint="BOTTOMLEFT"/>
<Anchor point="BOTTOMLEFT" relativeTo="$parentBorderBotLeft" relativePoint="TOPLEFT"/>
</Anchors>
<TexCoords left="0" right="0.5" top="0" bottom="1"/>
</Texture>
<Texture name="$parentBorderRight" file="Interface\QuestFrame\AutoQuestToastBorder-LeftRight" vertTile="true">
<Size x="8" y="16"/>
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="$parentBorderTopRight" relativePoint="BOTTOMRIGHT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentBorderBotRight" relativePoint="TOPRIGHT"/>
</Anchors>
<TexCoords left="0.5" right="1" top="0" bottom="1"/>
</Texture>
<Texture name="$parentBorderTop" file="Interface\QuestFrame\AutoQuestToastBorder-TopBot" horizTile="true">
<Size x="16" y="8"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentBorderTopLeft" relativePoint="TOPRIGHT"/>
<Anchor point="TOPRIGHT" relativeTo="$parentBorderTopRight" relativePoint="TOPLEFT"/>
</Anchors>
<TexCoords left="0" right="1" top="0" bottom="0.5"/>
</Texture>
<Texture name="$parentBorderBottom" file="Interface\QuestFrame\AutoQuestToastBorder-TopBot" horizTile="true">
<Size x="16" y="8"/>
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parentBorderBotLeft" relativePoint="BOTTOMRIGHT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentBorderBotRight" relativePoint="BOTTOMLEFT"/>
</Anchors>
<TexCoords left="0" right="1" top="0.5" bottom="1"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<Texture name="$parentQuestIconBg" inherits="QuestIcon-Large">
<Anchors>
<Anchor point="CENTER" relativePoint="LEFT"/>
</Anchors>
</Texture>
</Layer>
<Layer level="ARTWORK" textureSubLevel="1">
<Texture name="$parentExclamation" parentKey="Exclamation" hidden="true" file="Interface\QuestFrame\AutoQuest-Parts">
<Size x="19" y="33"/>
<TexCoords left="0.13476563" right="0.17187500" top="0.01562500" bottom="0.53125000"/>
<Anchors>
<Anchor point="CENTER" relativeTo="$parentQuestIconBg" x="0.5" />
</Anchors>
</Texture>
<Texture name="$parentQuestionMark" parentKey="QuestionMark" hidden="true" file="Interface\QuestFrame\AutoQuest-Parts">
<Size x="19" y="33"/>
<TexCoords left="0.17578125" right="0.21289063" top="0.01562500" bottom="0.53125000"/>
<Anchors>
<Anchor point="CENTER" relativeTo="$parentQuestIconBg" x="0.5" />
</Anchors>
</Texture>
</Layer>
<Layer level="BORDER">
<FontString name="$parentQuestName" inherits="QuestFont_Large" parentKey="QuestName">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentQuestIconBg" relativePoint="RIGHT" x="-6"/>
<Anchor point="RIGHT" x="-8"/>
<Anchor point="TOP" x="0" y="-24"/>
</Anchors>
<Color r="1" g="1" b="1"/>
</FontString>
<FontString name="$parentTopText" inherits="GameFontNormalSmall" parentKey="TopText">
<Anchors>
<Anchor point="TOP" x="0" y="-4"/>
<Anchor point="LEFT" relativeTo="$parentQuestIconBg" relativePoint="RIGHT" x="-6"/>
<Anchor point="RIGHT" x="-8"/>
</Anchors>
</FontString>
<FontString name="$parentBottomText" inherits="GameFontDisableSmall" parentKey="BottomText">
<Anchors>
<Anchor point="BOTTOM" x="0" y="4"/>
<Anchor point="LEFT" relativeTo="$parentQuestIconBg" relativePoint="RIGHT" x="-6"/>
<Anchor point="RIGHT" x="-8"/>
</Anchors>
</FontString>
</Layer>
<Layer level="BORDER" textureSubLevel="1">
<Texture name="$parentShine" alphaMode="ADD" alpha="0" hidden="true" parentKey="Shine">
<Animations>
<AnimationGroup name="$parentFlash" parentKey="Flash">
<Alpha startDelay="0" change="0.4" duration="0.25" order="1"/>
<Alpha startDelay="0.05" change="-0.4" duration="0.25" order="2"/>
<Scripts>
<OnStop>
self:GetParent():Hide();
</OnStop>
<OnFinished>
self:GetParent():Hide();
</OnFinished>
</Scripts>
</AnimationGroup>
</Animations>
<Anchors>
<Anchor point="TOPLEFT" x="-1" y="1"/>
<Anchor point="BOTTOMRIGHT" x="1" y="-1"/>
</Anchors>
<Color r="1" g="1" b="1"/>
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture name="$parentIconShine" alphaMode="ADD" alpha="0" hidden="true" parentKey="IconShine" file="Interface\QuestFrame\AutoQuest-Parts">
<Size x="42" y="42"/>
<TexCoords left="0.21679688" right="0.29882813" top="0.01562500" bottom="0.67187500"/>
<Anchors>
<Anchor point="CENTER" relativeTo="$parentQuestIconBg"/>
</Anchors>
<Animations>
<AnimationGroup name="$parentFlash" parentKey="Flash">
<Alpha change="0.9" duration="0.25" order="1"/>
<Alpha startDelay="0.05" change="-0.9" duration="0.25" order="2"/>
<Scripts>
<OnStop>
self:GetParent():Hide();
</OnStop>
<OnFinished>
self:GetParent():Hide();
--if (self:GetParent():GetParent():GetParent().type=="COMPLETED") then
--self:GetParent():GetParent().Flash:Show();
--end
</OnFinished>
</Scripts>
</AnimationGroup>
</Animations>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="$parentFlash" useParentLevel="true" setAllPoints="true" hidden="true" parentKey="Flash">
<Layers>
<Layer level="BORDER">
<Texture name="QuestLogFrameCompleteButtonFlash" inherits="UIPanelButtonHighlightTexture" parentKey="Flash">
<Size x="180" y="28"/>
<Anchors>
<Anchor point="TOPLEFT" x="14" y="-2"/>
</Anchors>
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture name="$parentIconFlash" alphaMode="ADD" alpha="0.5" parentKey="IconFlash" file="Interface\QuestFrame\AutoQuest-Parts">
<Size x="42" y="42"/>
<TexCoords left="0.21679688" right="0.29882813" top="0.01562500" bottom="0.67187500"/>
<Anchors>
<Anchor point="CENTER" relativePoint="LEFT"/>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self.IconFlash:SetVertexColor(1, 0, 0);
</OnLoad>
<OnShow>
UIFrameFlash(self, 0.75, 0.75, -1, nil);
</OnShow>
<OnHide>
UIFrameFlashStop(self);
</OnHide>
</Scripts>
</Frame>
</Frames>
</Frame>
</ScrollChild>
</ScrollFrame>
<Frame name="DetailsFrameworkBoxAlertTemplateUp" inherits="GlowBoxTemplate" hidden="false" frameStrata="FULLSCREEN" virtual="true">
<Layers>
<Layer level="OVERLAY">
<FontString name="$parentText" parentKey="text" inherits="GameFontHighlightLeft" justifyV="TOP" text="">
<Size x="280" y="0"/>
<Anchors>
<Anchor point="TOPLEFT" x="16" y="-15"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Size x="300" y="150"/>
<Frames>
<Frame name="$parentArrow" parentKey="arrow" inherits="GlowBoxArrowTemplate">
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" x="40" y="1"/>
</Anchors>
</Frame>
</Frames>
</Frame>
</Ui>
+2
View File
@@ -14,4 +14,6 @@
<Script file="LibGraph-2.0\LibGraph-2.0.lua"/>
<Script file="LibWindow-1.1\LibWindow-1.1.lua"/>
<Include file="LibCompress\lib.xml"/>
<Include file="DF\load.xml"/>
</Ui>
+10 -21
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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)
+9 -5
View File
@@ -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]
+1 -1
View File
@@ -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
+8 -10
View File
@@ -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)
+44 -8
View File
@@ -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
+1 -1
View File
@@ -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
+1 -2
View File
@@ -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)
+10 -7
View File
@@ -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
-304
View File
@@ -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
+3 -3
View File
@@ -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
+47 -15
View File
@@ -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,
+4 -4
View File
@@ -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,
+10 -27
View File
@@ -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
+8 -1
View File
@@ -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
+530 -586
View File
File diff suppressed because it is too large Load Diff
+385 -326
View File
@@ -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
+10 -3
View File
@@ -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")
@@ -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)
+27 -3
View File
@@ -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)
@@ -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)
+1 -20
View File
@@ -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()